diff options
author | Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> | 2010-06-02 14:18:28 +0200 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2010-09-02 22:45:33 -0600 |
commit | e9087b695b2445e04c826abdde9ff56afb554454 (patch) | |
tree | 492aea0a1494138fada5dd60efd1120e0c050a0f /arch | |
parent | de6c80bf77e65a34ad4dd361c299d4fcdd08ed99 (diff) | |
download | linux-2.6.34-ux500-e9087b695b2445e04c826abdde9ff56afb554454.tar.gz |
mach-ux500: Mailbox driver configuration
Configuration changes for mailbox driver.
ST-Ericsson ID: AP259650
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/730
Tested-by: Stefan NILSSON <stefan.xk.nilsson@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Change-Id: I2d92ba3e441263cd6f6cdec1187d09cf0a50f55e
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/2398
Diffstat (limited to 'arch')
-rwxr-xr-x | arch/arm/mach-ux500/Kconfig | 14 | ||||
-rw-r--r-- | arch/arm/mach-ux500/cpu-db5500.c | 88 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/db5500-regs.h | 14 | ||||
-rwxr-xr-x | arch/arm/mach-ux500/include/mach/irqs.h | 17 |
4 files changed, 131 insertions, 2 deletions
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index cad7589e91e..9fd9ffdfc64 100755 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig @@ -72,6 +72,20 @@ config SENSORS1P_MOP help Add support for Osram's SFH7741 Proximity Sensor and Samsumg HED54XXU11 HAL Switch +config U5500_MODEM_IRQ + bool "Modem IRQ support" + depends on UX500_SOC_DB5500 + default y + help + Add support for handling IRQ:s from modem side + +config U5500_MBOX + bool "Mailbox support" + depends on UX500_SOC_DB5500 && U5500_MODEM_IRQ + default y + help + Add support for u5500 mailbox communication between CPU:s + source "arch/arm/mach-ux500/Kconfig-arch" config FORCE_MAX_ZONEORDER diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c index 0b8b3d26156..ca7d19016f7 100644 --- a/arch/arm/mach-ux500/cpu-db5500.c +++ b/arch/arm/mach-ux500/cpu-db5500.c @@ -15,6 +15,7 @@ #include <mach/hardware.h> #include <mach/devices.h> #include <mach/setup.h> +#include <mach/irqs.h> static struct map_desc u5500_io_desc[] __initdata = { __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K), @@ -24,6 +25,90 @@ static struct map_desc u5500_io_desc[] __initdata = { __IO_DEV_DESC(U5500_GPIO4_BASE, SZ_4K), }; +static struct resource mbox0_resources[] = { + { + .name = "MBOX_PEER", + .start = U5500_MBOX0_PEER_START, + .end = U5500_MBOX0_PEER_END, + .flags = IORESOURCE_MEM, + }, + { + .name = "MBOX_LOCAL", + .start = U5500_MBOX0_LOCAL_START, + .end = U5500_MBOX0_LOCAL_END, + .flags = IORESOURCE_MEM, + }, + { + .name = "MBOX_IRQ", + .start = MBOX_PAIR0_VIRT_IRQ, + .end = MBOX_PAIR0_VIRT_IRQ, + .flags = IORESOURCE_IRQ, + } +}; + +static struct resource mbox1_resources[] = { + { + .name = "MBOX_PEER", + .start = U5500_MBOX1_PEER_START, + .end = U5500_MBOX1_PEER_END, + .flags = IORESOURCE_MEM, + }, + { + .name = "MBOX_LOCAL", + .start = U5500_MBOX1_LOCAL_START, + .end = U5500_MBOX1_LOCAL_END, + .flags = IORESOURCE_MEM, + }, + { + .name = "MBOX_IRQ", + .start = MBOX_PAIR1_VIRT_IRQ, + .end = MBOX_PAIR1_VIRT_IRQ, + .flags = IORESOURCE_IRQ, + } +}; + +static struct resource mbox2_resources[] = { + { + .name = "MBOX_PEER", + .start = U5500_MBOX2_PEER_START, + .end = U5500_MBOX2_PEER_END, + .flags = IORESOURCE_MEM, + }, + { + .name = "MBOX_LOCAL", + .start = U5500_MBOX2_LOCAL_START, + .end = U5500_MBOX2_LOCAL_END, + .flags = IORESOURCE_MEM, + }, + { + .name = "MBOX_IRQ", + .start = MBOX_PAIR2_VIRT_IRQ, + .end = MBOX_PAIR2_VIRT_IRQ, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device mbox0_device = { + .id = 0, + .name = "mbox", + .resource = mbox0_resources, + .num_resources = ARRAY_SIZE(mbox0_resources), +}; + +static struct platform_device mbox1_device = { + .id = 1, + .name = "mbox", + .resource = mbox1_resources, + .num_resources = ARRAY_SIZE(mbox1_resources), +}; + +static struct platform_device mbox2_device = { + .id = 2, + .name = "mbox", + .resource = mbox2_resources, + .num_resources = ARRAY_SIZE(mbox2_resources), +}; + static struct platform_device *u5500_platform_devs[] __initdata = { &u5500_gpio_devs[0], &u5500_gpio_devs[1], @@ -33,6 +118,9 @@ static struct platform_device *u5500_platform_devs[] __initdata = { &u5500_gpio_devs[5], &u5500_gpio_devs[6], &u5500_gpio_devs[7], + &mbox0_device, + &mbox1_device, + &mbox2_device, }; void __init u5500_map_io(void) diff --git a/arch/arm/mach-ux500/include/mach/db5500-regs.h b/arch/arm/mach-ux500/include/mach/db5500-regs.h index d724dae2fde..5a1f761e457 100644 --- a/arch/arm/mach-ux500/include/mach/db5500-regs.h +++ b/arch/arm/mach-ux500/include/mach/db5500-regs.h @@ -102,4 +102,18 @@ #define U5500_GPIOBANK6_BASE (U5500_GPIO4_BASE + 0x80) #define U5500_GPIOBANK7_BASE (U5500_GPIO4_BASE + 0x100) +#define U5500_MBOX_BASE 0xBFFD1000 +#define U5500_MBOX0_PEER_START (U5500_MBOX_BASE + 0x40) +#define U5500_MBOX0_PEER_END (U5500_MBOX_BASE + 0x5F) +#define U5500_MBOX0_LOCAL_START (U5500_MBOX_BASE + 0x60) +#define U5500_MBOX0_LOCAL_END (U5500_MBOX_BASE + 0x7F) +#define U5500_MBOX1_PEER_START (U5500_MBOX_BASE + 0x80) +#define U5500_MBOX1_PEER_END (U5500_MBOX_BASE + 0x9F) +#define U5500_MBOX1_LOCAL_START (U5500_MBOX_BASE + 0xA0) +#define U5500_MBOX1_LOCAL_END (U5500_MBOX_BASE + 0xBF) +#define U5500_MBOX2_PEER_START (U5500_MBOX_BASE + 0x00) +#define U5500_MBOX2_PEER_END (U5500_MBOX_BASE + 0x1F) +#define U5500_MBOX2_LOCAL_START (U5500_MBOX_BASE + 0x20) +#define U5500_MBOX2_LOCAL_END (U5500_MBOX_BASE + 0x3F) + #endif diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h index 3df869212d2..b883d013773 100755 --- a/arch/arm/mach-ux500/include/mach/irqs.h +++ b/arch/arm/mach-ux500/include/mach/irqs.h @@ -56,6 +56,7 @@ #define IRQ_SDMMC0 (IRQ_SPI_START + 60) #define IRQ_HWSEM (IRQ_SPI_START + 61) #define IRQ_MSP1 (IRQ_SPI_START + 62) +#define IRQ_MODEM (IRQ_SPI_START + 65) #define IRQ_SPI1 (IRQ_SPI_START + 96) #define IRQ_MSP2 (IRQ_SPI_START + 98) #define IRQ_SDMMC4 (IRQ_SPI_START + 99) @@ -94,9 +95,21 @@ #define GPIO_TO_IRQ(gpio) (gpio + U8500_SOC_NR_IRQS) #define IRQ_TO_GPIO(irq) (irq - U8500_SOC_NR_IRQS) -#define NR_IRQS GPIO_TO_IRQ(U8500_NR_GPIO) - #define NOMADIK_GPIO_TO_IRQ GPIO_TO_IRQ #define NOMADIK_IRQ_TO_GPIO IRQ_TO_GPIO +/* After the GPIO ones we reserve a range of IRQ:s in which virtual + * IRQ:s representing modem IRQ:s can be allocated + */ +#define IRQ_MODEM_EVENTS_BASE ( GPIO_TO_IRQ(U8500_NR_GPIO) + 1 ) +#define IRQ_MODEM_EVENTS_NBR 72 +#define IRQ_MODEM_EVENTS_END (IRQ_MODEM_EVENTS_BASE + IRQ_MODEM_EVENTS_NBR) + +/* List of virtual IRQ:s that are allocated from the range above */ +#define MBOX_PAIR0_VIRT_IRQ IRQ_MODEM_EVENTS_BASE + 43 +#define MBOX_PAIR1_VIRT_IRQ IRQ_MODEM_EVENTS_BASE + 45 +#define MBOX_PAIR2_VIRT_IRQ IRQ_MODEM_EVENTS_BASE + 41 + +#define NR_IRQS IRQ_MODEM_EVENTS_END + #endif /* ASM_ARCH_IRQS_H */ |