diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2012-11-26 16:38:38 -0500 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2012-11-26 16:38:38 -0500 |
| commit | 4c929c8a8837f4e5acdec5883a1b64a240751e2f (patch) | |
| tree | 19ca9af00b75642547ebb9863873acb1d77f5513 | |
| parent | d98eb5cfb0ac050ed8c8fafd029b94d451189864 (diff) | |
| parent | f7a9b36517d38cfa2213a346b154d2d7046ff223 (diff) | |
Merge tag 'integrator-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into next/cleanup
From Linus Walleij <linus.walleij@linaro.org>:
This series will do the following:
- Switch the Integrator/AP and /CP to use the SoC bus
when booting from device tree.
- Group all devices on the SoC below this bus so as to
set a good example of how to do this. The bus was
invented by Lee Jones, let's show how it's to be used
on a DT:ed SoC.
- Fetch the special system controller offsets from two
special device tree nodes for each case and replace
the static mappings with these at boot.
- Move some static remaps to the ATAG-only code path
and delete some static maps that aren't used.
- Push dependencies on system controller remaps down
to the Integrator/AP board file and the PCIv3 driver
respectively and use only dynamic remappings.
- Fix up conditional BUG() usage in the PCIv3 driver
to be simpler and more to the point.
* tag 'integrator-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
ARM: integrator: use BUG_ON where possible
ARM: integrator: push down SC dependencies
ARM: integrator: delete static UART1 mapping
ARM: integrator: delete SC mapping on the CP
ARM: integrator: remove static CP syscon mapping
ARM: integrator: remove static AP syscon mapping
ARM: integrator: hook the CP into the SoC bus
ARM: integrator: hook the AP into the SoC bus
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| -rw-r--r-- | Documentation/devicetree/bindings/arm/arm-boards | 4 | ||||
| -rw-r--r-- | arch/arm/boot/dts/integratorap.dts | 5 | ||||
| -rw-r--r-- | arch/arm/boot/dts/integratorcp.dts | 5 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/Kconfig | 2 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/common.h | 8 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/core.c | 141 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/include/mach/platform.h | 1 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/integrator_ap.c | 158 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/integrator_cp.c | 115 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/pci_v3.c | 32 |
10 files changed, 354 insertions, 117 deletions
diff --git a/Documentation/devicetree/bindings/arm/arm-boards b/Documentation/devicetree/bindings/arm/arm-boards index fc81a7d6b0f1..db5858e32d3f 100644 --- a/Documentation/devicetree/bindings/arm/arm-boards +++ b/Documentation/devicetree/bindings/arm/arm-boards | |||
| @@ -9,6 +9,10 @@ Required properties (in root node): | |||
| 9 | 9 | ||
| 10 | FPGA type interrupt controllers, see the versatile-fpga-irq binding doc. | 10 | FPGA type interrupt controllers, see the versatile-fpga-irq binding doc. |
| 11 | 11 | ||
| 12 | In the root node the Integrator/CP must have a /cpcon node pointing | ||
| 13 | to the CP control registers, and the Integrator/AP must have a | ||
| 14 | /syscon node pointing to the Integrator/AP system controller. | ||
| 15 | |||
| 12 | 16 | ||
| 13 | ARM Versatile Application and Platform Baseboards | 17 | ARM Versatile Application and Platform Baseboards |
| 14 | ------------------------------------------------- | 18 | ------------------------------------------------- |
diff --git a/arch/arm/boot/dts/integratorap.dts b/arch/arm/boot/dts/integratorap.dts index 61767757b50a..c9c3fa344647 100644 --- a/arch/arm/boot/dts/integratorap.dts +++ b/arch/arm/boot/dts/integratorap.dts | |||
| @@ -18,6 +18,11 @@ | |||
| 18 | bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk"; | 18 | bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk"; |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | syscon { | ||
| 22 | /* AP system controller registers */ | ||
| 23 | reg = <0x11000000 0x100>; | ||
| 24 | }; | ||
| 25 | |||
| 21 | timer0: timer@13000000 { | 26 | timer0: timer@13000000 { |
| 22 | compatible = "arm,integrator-timer"; | 27 | compatible = "arm,integrator-timer"; |
| 23 | }; | 28 | }; |
diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts index 2dd5e4e48481..8b119399025a 100644 --- a/arch/arm/boot/dts/integratorcp.dts +++ b/arch/arm/boot/dts/integratorcp.dts | |||
| @@ -18,6 +18,11 @@ | |||
| 18 | bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; | 18 | bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | cpcon { | ||
| 22 | /* CP controller registers */ | ||
| 23 | reg = <0xcb000000 0x100>; | ||
| 24 | }; | ||
| 25 | |||
| 21 | timer0: timer@13000000 { | 26 | timer0: timer@13000000 { |
| 22 | compatible = "arm,sp804", "arm,primecell"; | 27 | compatible = "arm,sp804", "arm,primecell"; |
| 23 | }; | 28 | }; |
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index 350e26636a06..abeff25532ab 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig | |||
| @@ -8,6 +8,7 @@ config ARCH_INTEGRATOR_AP | |||
| 8 | select MIGHT_HAVE_PCI | 8 | select MIGHT_HAVE_PCI |
| 9 | select SERIAL_AMBA_PL010 | 9 | select SERIAL_AMBA_PL010 |
| 10 | select SERIAL_AMBA_PL010_CONSOLE | 10 | select SERIAL_AMBA_PL010_CONSOLE |
| 11 | select SOC_BUS | ||
| 11 | help | 12 | help |
| 12 | Include support for the ARM(R) Integrator/AP and | 13 | Include support for the ARM(R) Integrator/AP and |
| 13 | Integrator/PP2 platforms. | 14 | Integrator/PP2 platforms. |
| @@ -19,6 +20,7 @@ config ARCH_INTEGRATOR_CP | |||
| 19 | select PLAT_VERSATILE_CLCD | 20 | select PLAT_VERSATILE_CLCD |
| 20 | select SERIAL_AMBA_PL011 | 21 | select SERIAL_AMBA_PL011 |
| 21 | select SERIAL_AMBA_PL011_CONSOLE | 22 | select SERIAL_AMBA_PL011_CONSOLE |
| 23 | select SOC_BUS | ||
| 22 | help | 24 | help |
| 23 | Include support for the ARM(R) Integrator CP platform. | 25 | Include support for the ARM(R) Integrator CP platform. |
| 24 | 26 | ||
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h index c3ff21b5ea24..79197d8b34aa 100644 --- a/arch/arm/mach-integrator/common.h +++ b/arch/arm/mach-integrator/common.h | |||
| @@ -1,6 +1,12 @@ | |||
| 1 | #include <linux/amba/serial.h> | 1 | #include <linux/amba/serial.h> |
| 2 | extern struct amba_pl010_data integrator_uart_data; | 2 | #ifdef CONFIG_ARCH_INTEGRATOR_AP |
| 3 | extern struct amba_pl010_data ap_uart_data; | ||
| 4 | #else | ||
| 5 | /* Not used without Integrator/AP support anyway */ | ||
| 6 | struct amba_pl010_data ap_uart_data {}; | ||
| 7 | #endif | ||
| 3 | void integrator_init_early(void); | 8 | void integrator_init_early(void); |
| 4 | int integrator_init(bool is_cp); | 9 | int integrator_init(bool is_cp); |
| 5 | void integrator_reserve(void); | 10 | void integrator_reserve(void); |
| 6 | void integrator_restart(char, const char *); | 11 | void integrator_restart(char, const char *); |
| 12 | void integrator_init_sysfs(struct device *parent, u32 id); | ||
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index ea22a17246d7..39c060f75e47 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c | |||
| @@ -18,10 +18,10 @@ | |||
| 18 | #include <linux/memblock.h> | 18 | #include <linux/memblock.h> |
| 19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
| 20 | #include <linux/smp.h> | 20 | #include <linux/smp.h> |
| 21 | #include <linux/termios.h> | ||
| 22 | #include <linux/amba/bus.h> | 21 | #include <linux/amba/bus.h> |
| 23 | #include <linux/amba/serial.h> | 22 | #include <linux/amba/serial.h> |
| 24 | #include <linux/io.h> | 23 | #include <linux/io.h> |
| 24 | #include <linux/stat.h> | ||
| 25 | 25 | ||
| 26 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
| 27 | #include <mach/platform.h> | 27 | #include <mach/platform.h> |
| @@ -46,10 +46,10 @@ static AMBA_APB_DEVICE(rtc, "rtc", 0, | |||
| 46 | INTEGRATOR_RTC_BASE, INTEGRATOR_RTC_IRQ, NULL); | 46 | INTEGRATOR_RTC_BASE, INTEGRATOR_RTC_IRQ, NULL); |
| 47 | 47 | ||
| 48 | static AMBA_APB_DEVICE(uart0, "uart0", 0, | 48 | static AMBA_APB_DEVICE(uart0, "uart0", 0, |
| 49 | INTEGRATOR_UART0_BASE, INTEGRATOR_UART0_IRQ, &integrator_uart_data); | 49 | INTEGRATOR_UART0_BASE, INTEGRATOR_UART0_IRQ, NULL); |
| 50 | 50 | ||
| 51 | static AMBA_APB_DEVICE(uart1, "uart1", 0, | 51 | static AMBA_APB_DEVICE(uart1, "uart1", 0, |
| 52 | INTEGRATOR_UART1_BASE, INTEGRATOR_UART1_IRQ, &integrator_uart_data); | 52 | INTEGRATOR_UART1_BASE, INTEGRATOR_UART1_IRQ, NULL); |
| 53 | 53 | ||
| 54 | static AMBA_APB_DEVICE(kmi0, "kmi0", 0, KMI0_BASE, KMI0_IRQ, NULL); | 54 | static AMBA_APB_DEVICE(kmi0, "kmi0", 0, KMI0_BASE, KMI0_IRQ, NULL); |
| 55 | static AMBA_APB_DEVICE(kmi1, "kmi1", 0, KMI1_BASE, KMI1_IRQ, NULL); | 55 | static AMBA_APB_DEVICE(kmi1, "kmi1", 0, KMI1_BASE, KMI1_IRQ, NULL); |
| @@ -77,6 +77,8 @@ int __init integrator_init(bool is_cp) | |||
| 77 | uart1_device.periphid = 0x00041010; | 77 | uart1_device.periphid = 0x00041010; |
| 78 | kmi0_device.periphid = 0x00041050; | 78 | kmi0_device.periphid = 0x00041050; |
| 79 | kmi1_device.periphid = 0x00041050; | 79 | kmi1_device.periphid = 0x00041050; |
| 80 | uart0_device.dev.platform_data = &ap_uart_data; | ||
| 81 | uart1_device.dev.platform_data = &ap_uart_data; | ||
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 84 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
| @@ -89,49 +91,6 @@ int __init integrator_init(bool is_cp) | |||
| 89 | 91 | ||
| 90 | #endif | 92 | #endif |
| 91 | 93 | ||
| 92 | /* | ||
| 93 | * On the Integrator platform, the port RTS and DTR are provided by | ||
| 94 | * bits in the following SC_CTRLS register bits: | ||
| 95 | * RTS DTR | ||
| 96 | * UART0 7 6 | ||
| 97 | * UART1 5 4 | ||
| 98 | */ | ||
| 99 | #define SC_CTRLC __io_address(INTEGRATOR_SC_CTRLC) | ||
| 100 | #define SC_CTRLS __io_address(INTEGRATOR_SC_CTRLS) | ||
| 101 | |||
| 102 | static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) | ||
| 103 | { | ||
| 104 | unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask; | ||
| 105 | u32 phybase = dev->res.start; | ||
| 106 | |||
| 107 | if (phybase == INTEGRATOR_UART0_BASE) { | ||
| 108 | /* UART0 */ | ||
| 109 | rts_mask = 1 << 4; | ||
| 110 | dtr_mask = 1 << 5; | ||
| 111 | } else { | ||
| 112 | /* UART1 */ | ||
| 113 | rts_mask = 1 << 6; | ||
| 114 | dtr_mask = 1 << 7; | ||
| 115 | } | ||
| 116 | |||
| 117 | if (mctrl & TIOCM_RTS) | ||
| 118 | ctrlc |= rts_mask; | ||
| 119 | else | ||
| 120 | ctrls |= rts_mask; | ||
| 121 | |||
| 122 | if (mctrl & TIOCM_DTR) | ||
| 123 | ctrlc |= dtr_mask; | ||
| 124 | else | ||
| 125 | ctrls |= dtr_mask; | ||
| 126 | |||
| 127 | __raw_writel(ctrls, SC_CTRLS); | ||
| 128 | __raw_writel(ctrlc, SC_CTRLC); | ||
| 129 | } | ||
| 130 | |||
| 131 | struct amba_pl010_data integrator_uart_data = { | ||
| 132 | .set_mctrl = integrator_uart_set_mctrl, | ||
| 133 | }; | ||
| 134 | |||
| 135 | static DEFINE_RAW_SPINLOCK(cm_lock); | ||
