Skip to content

Commit

Permalink
BCM270x: Switch to firmware driver
Browse files Browse the repository at this point in the history
defconfig: enable BCM2835_MBOX, RASPBERRYPI_FIRMWARE and BCM_VCIO.
Add firmware node and change mailbox node in Device Tree.
Add/update platform file for firmware and mailbox.
Strip bcm2708-vcio of everything except the legacy API and hook it
up with the firmware driver.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
  • Loading branch information
notro authored and popcornmix committed Jul 13, 2015
1 parent becc341 commit 3349eaf
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 344 deletions.
8 changes: 7 additions & 1 deletion arch/arm/boot/dts/bcm2708_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@
};

mailbox: mailbox@7e00b800 {
compatible = "brcm,bcm2708-vcio";
compatible = "brcm,bcm2835-mbox";
reg = <0x7e00b880 0x40>;
interrupts = <0 1>;
#mbox-cells = <0>;
};

watchdog: watchdog@7e100000 {
Expand Down Expand Up @@ -205,6 +206,11 @@
<1 9>;
};

firmware: firmware {
compatible = "raspberrypi,bcm2835-firmware";
mboxes = <&mailbox>;
};

leds: leds {
compatible = "gpio-leds";
};
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ CONFIG_HW_RANDOM_BCM2708=m
CONFIG_RAW_DRIVER=y
CONFIG_BRCM_CHAR_DRIVERS=y
CONFIG_BCM_VC_CMA=y
CONFIG_BCM_VCIO=y
CONFIG_BCM_VC_SM=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=m
Expand Down Expand Up @@ -1074,6 +1075,7 @@ CONFIG_FB_FLEX=m
CONFIG_FB_TFT_FBTFT_DEVICE=m
CONFIG_MAILBOX=y
CONFIG_BCM2708_MBOX=y
CONFIG_BCM2835_MBOX=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_EXTCON=m
CONFIG_EXTCON_ARIZONA=m
Expand All @@ -1082,6 +1084,7 @@ CONFIG_IIO_BUFFER=y
CONFIG_IIO_BUFFER_CB=y
CONFIG_IIO_KFIFO_BUF=m
CONFIG_DHT11=m
CONFIG_RASPBERRYPI_FIRMWARE=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ CONFIG_HW_RANDOM_BCM2708=m
CONFIG_RAW_DRIVER=y
CONFIG_BRCM_CHAR_DRIVERS=y
CONFIG_BCM_VC_CMA=y
CONFIG_BCM_VCIO=y
CONFIG_BCM_VC_SM=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=m
Expand Down Expand Up @@ -1067,6 +1068,7 @@ CONFIG_FB_FLEX=m
CONFIG_FB_TFT_FBTFT_DEVICE=m
CONFIG_MAILBOX=y
CONFIG_BCM2708_MBOX=y
CONFIG_BCM2835_MBOX=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_EXTCON=m
CONFIG_EXTCON_ARIZONA=m
Expand All @@ -1075,6 +1077,7 @@ CONFIG_IIO_BUFFER=y
CONFIG_IIO_BUFFER_CB=y
CONFIG_IIO_KFIFO_BUF=m
CONFIG_DHT11=m
CONFIG_RASPBERRYPI_FIRMWARE=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
Expand Down
13 changes: 12 additions & 1 deletion arch/arm/mach-bcm2708/bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static struct resource bcm2708_vcio_resources[] = {
static u64 vcio_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);

static struct platform_device bcm2708_vcio_device = {
.name = "bcm2708_vcio",
.name = "bcm2835-mbox",
.id = -1, /* only one VideoCore I/O area */
.resource = bcm2708_vcio_resources,
.num_resources = ARRAY_SIZE(bcm2708_vcio_resources),
Expand All @@ -415,6 +415,16 @@ static struct platform_device bcm2708_vcio_device = {
},
};

static u64 rpifw_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);

static struct platform_device bcm2708_rpifw_device = {
.name = "raspberrypi-firmware",
.dev = {
.dma_mask = &rpifw_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
},
};

static struct resource bcm2708_vchiq_resources[] = {
{
.start = ARMCTRL_0_BELL_BASE,
Expand Down Expand Up @@ -871,6 +881,7 @@ void __init bcm2708_init(void)

bcm_register_device_dt(&bcm2708_dmaengine_device);
bcm_register_device_dt(&bcm2708_vcio_device);
bcm_register_device_dt(&bcm2708_rpifw_device);
bcm_register_device_dt(&bcm2708_vchiq_device);
#ifdef CONFIG_BCM2708_GPIO
bcm_register_device_dt(&bcm2708_gpio_device);
Expand Down
13 changes: 12 additions & 1 deletion arch/arm/mach-bcm2709/bcm2709.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ static struct resource bcm2708_vcio_resources[] = {
static u64 vcio_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);

static struct platform_device bcm2708_vcio_device = {
.name = "bcm2708_vcio",
.name = "bcm2835-mbox",
.id = -1, /* only one VideoCore I/O area */
.resource = bcm2708_vcio_resources,
.num_resources = ARRAY_SIZE(bcm2708_vcio_resources),
Expand All @@ -436,6 +436,16 @@ static struct platform_device bcm2708_vcio_device = {
},
};

static u64 rpifw_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);

static struct platform_device bcm2708_rpifw_device = {
.name = "raspberrypi-firmware",
.dev = {
.dma_mask = &rpifw_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
},
};

static struct resource bcm2708_vchiq_resources[] = {
{
.start = ARMCTRL_0_BELL_BASE,
Expand Down Expand Up @@ -892,6 +902,7 @@ void __init bcm2709_init(void)

bcm_register_device_dt(&bcm2708_dmaengine_device);
bcm_register_device_dt(&bcm2708_vcio_device);
bcm_register_device_dt(&bcm2708_rpifw_device);
bcm_register_device_dt(&bcm2708_vchiq_device);
#ifdef CONFIG_BCM2708_GPIO
bcm_register_device_dt(&bcm2708_gpio_device);
Expand Down
2 changes: 1 addition & 1 deletion drivers/mailbox/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if MAILBOX

config BCM2708_MBOX
bool "Broadcom BCM2708 Mailbox (vcio)"
depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
depends on BCM2835_MBOX
help
Broadcom BCM2708 Mailbox (vcio)

Expand Down
Loading

0 comments on commit 3349eaf

Please sign in to comment.