From cce0a62ba4087e70af8316b9ba78329352228e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 19 May 2015 13:31:50 +0200 Subject: [PATCH] BCM270x: Add vchiq device to platform file and Device Tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prepare to turn the vchiq module into a driver. Signed-off-by: Noralf Trønnes --- arch/arm/boot/dts/bcm2708_common.dtsi | 6 +++++ arch/arm/mach-bcm2708/bcm2708.c | 26 +++++++++++++++++++ arch/arm/mach-bcm2708/include/mach/platform.h | 1 + arch/arm/mach-bcm2709/bcm2709.c | 26 +++++++++++++++++++ arch/arm/mach-bcm2709/include/mach/platform.h | 1 + 5 files changed, 60 insertions(+) diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi index c5ed34bda2375..2d9bcd8ac97dc 100644 --- a/arch/arm/boot/dts/bcm2708_common.dtsi +++ b/arch/arm/boot/dts/bcm2708_common.dtsi @@ -114,6 +114,12 @@ compatible = "brcm,bcm2708-fb"; status = "disabled"; }; + + vchiq: vchiq { + compatible = "brcm,bcm2835-vchiq"; + reg = <0x7e00b840 0xf>; + interrupts = <0 2>; + }; }; clocks { diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c index cde2124566fe0..81cc9885de43b 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -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" @@ -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 diff --git a/arch/arm/mach-bcm2708/include/mach/platform.h b/arch/arm/mach-bcm2708/include/mach/platform.h index bef3e5a62f117..69674e92fec51 100644 --- a/arch/arm/mach-bcm2708/include/mach/platform.h +++ b/arch/arm/mach-bcm2708/include/mach/platform.h @@ -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 */ diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c index 95db41ff2601f..528bf6e18e5de 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -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" @@ -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 diff --git a/arch/arm/mach-bcm2709/include/mach/platform.h b/arch/arm/mach-bcm2709/include/mach/platform.h index 5574bb5356ca0..be9973354c20f 100644 --- a/arch/arm/mach-bcm2709/include/mach/platform.h +++ b/arch/arm/mach-bcm2709/include/mach/platform.h @@ -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 */