Skip to content

Commit

Permalink
BCM270x: Add vchiq device to platform file and Device Tree
Browse files Browse the repository at this point in the history
Prepare to turn the vchiq module into a driver.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
  • Loading branch information
notro committed May 19, 2015
1 parent 9112b62 commit cce0a62
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm/boot/dts/bcm2708_common.dtsi
Expand Up @@ -114,6 +114,12 @@
compatible = "brcm,bcm2708-fb";
status = "disabled";
};

vchiq: vchiq {
compatible = "brcm,bcm2835-vchiq";
reg = <0x7e00b840 0xf>;
interrupts = <0 2>;
};
};

clocks {
Expand Down
26 changes: 26 additions & 0 deletions arch/arm/mach-bcm2708/bcm2708.c
Expand Up @@ -437,6 +437,31 @@ static struct platform_device bcm2708_vcio_device = {
},
};

static struct resource bcm2708_vchiq_resources[] = {
{
.start = ARMCTRL_0_BELL_BASE,
.end = ARMCTRL_0_BELL_BASE + 16,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_ARM_DOORBELL_0,
.end = IRQ_ARM_DOORBELL_0,
.flags = IORESOURCE_IRQ,
},
};

static u64 vchiq_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);

static struct platform_device bcm2708_vchiq_device = {
.name = "bcm2835_vchiq",
.id = -1,
.resource = bcm2708_vchiq_resources,
.num_resources = ARRAY_SIZE(bcm2708_vchiq_resources),
.dev = {
.dma_mask = &vchiq_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
},
};

#ifdef CONFIG_BCM2708_GPIO
#define BCM_GPIO_DRIVER_NAME "bcm2708_gpio"

Expand Down Expand Up @@ -909,6 +934,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_vchiq_device);
#ifdef CONFIG_BCM2708_GPIO
bcm_register_device_dt(&bcm2708_gpio_device);
#endif
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-bcm2708/include/mach/platform.h
Expand Up @@ -81,6 +81,7 @@
#define ARMCTRL_IC_BASE (ARM_BASE + 0x200) /* ARM interrupt controller */
#define ARMCTRL_TIMER0_1_BASE (ARM_BASE + 0x400) /* Timer 0 and 1 */
#define ARMCTRL_0_SBM_BASE (ARM_BASE + 0x800) /* User 0 (ARM)'s Semaphores Doorbells and Mailboxes */
#define ARMCTRL_0_BELL_BASE (ARMCTRL_0_SBM_BASE + 0x40) /* User 0 (ARM)'s Doorbell */
#define ARMCTRL_0_MAIL0_BASE (ARMCTRL_0_SBM_BASE + 0x80) /* User 0 (ARM)'s Mailbox 0 */


Expand Down
26 changes: 26 additions & 0 deletions arch/arm/mach-bcm2709/bcm2709.c
Expand Up @@ -456,6 +456,31 @@ static struct platform_device bcm2708_vcio_device = {
},
};

static struct resource bcm2708_vchiq_resources[] = {
{
.start = ARMCTRL_0_BELL_BASE,
.end = ARMCTRL_0_BELL_BASE + 16,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_ARM_DOORBELL_0,
.end = IRQ_ARM_DOORBELL_0,
.flags = IORESOURCE_IRQ,
},
};

static u64 vchiq_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);

static struct platform_device bcm2708_vchiq_device = {
.name = "bcm2835_vchiq",
.id = -1,
.resource = bcm2708_vchiq_resources,
.num_resources = ARRAY_SIZE(bcm2708_vchiq_resources),
.dev = {
.dma_mask = &vchiq_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
},
};

#ifdef CONFIG_BCM2708_GPIO
#define BCM_GPIO_DRIVER_NAME "bcm2708_gpio"

Expand Down Expand Up @@ -930,6 +955,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_vchiq_device);
#ifdef CONFIG_BCM2708_GPIO
bcm_register_device_dt(&bcm2708_gpio_device);
#endif
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-bcm2709/include/mach/platform.h
Expand Up @@ -81,6 +81,7 @@
#define ARMCTRL_IC_BASE (ARM_BASE + 0x200) /* ARM interrupt controller */
#define ARMCTRL_TIMER0_1_BASE (ARM_BASE + 0x400) /* Timer 0 and 1 */
#define ARMCTRL_0_SBM_BASE (ARM_BASE + 0x800) /* User 0 (ARM)'s Semaphores Doorbells and Mailboxes */
#define ARMCTRL_0_BELL_BASE (ARMCTRL_0_SBM_BASE + 0x40) /* User 0 (ARM)'s Doorbell */
#define ARMCTRL_0_MAIL0_BASE (ARMCTRL_0_SBM_BASE + 0x80) /* User 0 (ARM)'s Mailbox 0 */


Expand Down

0 comments on commit cce0a62

Please sign in to comment.