aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/Kconfig6
-rw-r--r--arch/arm/mach-ux500/Makefile.boot1
-rw-r--r--arch/arm/mach-ux500/board-mop500.c99
-rw-r--r--arch/arm/mach-ux500/cache-l2x0.c7
-rw-r--r--arch/arm/mach-ux500/cpu.c14
-rw-r--r--arch/arm/mach-ux500/timer.c11
6 files changed, 131 insertions, 7 deletions
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 8904d18de01a..880d02ec89d4 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -58,6 +58,12 @@ config UX500_AUTO_PLATFORM
58 At least one platform needs to be selected in order to build 58 At least one platform needs to be selected in order to build
59 a working kernel. If everything else is disabled, this 59 a working kernel. If everything else is disabled, this
60 automatically enables MACH_MOP500. 60 automatically enables MACH_MOP500.
61
62config MACH_UX500_DT
63 bool "Generic U8500 support using device tree"
64 depends on MACH_MOP500
65 select USE_OF
66
61endmenu 67endmenu
62 68
63config UX500_DEBUG_UART 69config UX500_DEBUG_UART
diff --git a/arch/arm/mach-ux500/Makefile.boot b/arch/arm/mach-ux500/Makefile.boot
index ff0a4b5b0a82..dd5cd00e2554 100644
--- a/arch/arm/mach-ux500/Makefile.boot
+++ b/arch/arm/mach-ux500/Makefile.boot
@@ -2,3 +2,4 @@
2params_phys-y := 0x00000100 2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4 4
5dtb-$(CONFIG_MACH_SNOWBALL) += snowball.dtb
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 29d330374994..77d03c1fbd04 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -30,6 +30,9 @@
30#include <linux/gpio_keys.h> 30#include <linux/gpio_keys.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32 32
33#include <linux/of.h>
34#include <linux/of_platform.h>
35
33#include <linux/leds.h> 36#include <linux/leds.h>
34#include <asm/mach-types.h> 37#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
@@ -440,7 +443,7 @@ static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
440}; 443};
441#endif 444#endif
442 445
443static struct pl022_ssp_controller ssp0_platform_data = { 446static struct pl022_ssp_controller ssp0_plat = {
444 .bus_id = 0, 447 .bus_id = 0,
445#ifdef CONFIG_STE_DMA40 448#ifdef CONFIG_STE_DMA40
446 .enable_dma = 1, 449 .enable_dma = 1,
@@ -458,7 +461,7 @@ static struct pl022_ssp_controller ssp0_platform_data = {
458 461
459static void __init mop500_spi_init(struct device *parent) 462static void __init mop500_spi_init(struct device *parent)
460{ 463{
461 db8500_add_ssp0(parent, &ssp0_platform_data); 464 db8500_add_ssp0(parent, &ssp0_plat);
462} 465}
463 466
464#ifdef CONFIG_STE_DMA40 467#ifdef CONFIG_STE_DMA40
@@ -618,6 +621,7 @@ static void __init mop500_init_machine(void)
618 621
619 mop500_pins_init(); 622 mop500_pins_init();
620 623
624 /* FIXME: parent of ab8500 should be prcmu */
621 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) 625 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
622 mop500_platform_devs[i]->dev.parent = parent; 626 mop500_platform_devs[i]->dev.parent = parent;
623 627
@@ -738,3 +742,94 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
738 .handle_irq = gic_handle_irq, 742 .handle_irq = gic_handle_irq,
739 .init_machine = snowball_init_machine, 743 .init_machine = snowball_init_machine,
740MACHINE_END 744MACHINE_END
745
746#ifdef CONFIG_MACH_UX500_DT
747
748struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
749 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
750 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
751 OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
752 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat),
753 {},
754};
755
756static const struct of_device_id u8500_soc_node[] = {
757 /* only create devices below soc node */
758 { .compatible = "stericsson,db8500", },
759 { },
760};
761
762static void __init u8500_init_machine(void)
763{
764 struct device *parent = NULL;
765 int i2c0_devs;
766 int i;
767
768 parent = u8500_init_devices();
769 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
770
771 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
772 mop500_platform_devs[i]->dev.parent = parent;
773 for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
774 snowball_platform_devs[i]->dev.parent = parent;
775
776 /* automatically probe child nodes of db8500 device */
777 of_platform_populate(NULL, u8500_soc_node, u8500_auxdata_lookup, parent);
778
779 if (of_machine_is_compatible("st-ericsson,mop500")) {
780 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
781 mop500_pins_init();
782
783 platform_add_devices(mop500_platform_devs,
784 ARRAY_SIZE(mop500_platform_devs));
785
786 mop500_sdi_init(parent);
787 } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
788 snowball_pins_init();
789 platform_add_devices(snowball_platform_devs,
790 ARRAY_SIZE(snowball_platform_devs));
791
792 snowball_sdi_init(parent);
793 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
794 /*
795 * The HREFv60 board removed a GPIO expander and routed
796 * all these GPIO pins to the internal GPIO controller
797 * instead.
798 */
799 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
800 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
801 hrefv60_pins_init();
802 platform_add_devices(mop500_platform_devs,
803 ARRAY_SIZE(mop500_platform_devs));
804
805 hrefv60_sdi_init(parent);
806 }
807 mop500_i2c_init(parent);
808
809 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
810 i2c_register_board_info(2, mop500_i2c2_devices,
811 ARRAY_SIZE(mop500_i2c2_devices));
812
813 /* This board has full regulator constraints */
814 regulator_has_full_constraints();
815}
816
817static const char * u8500_dt_board_compat[] = {
818 "calaosystems,snowball-a9500",
819 "st-ericsson,hrefv60+",
820 "st-ericsson,u8500",
821 "st-ericsson,mop500",
822 NULL,
823};
824
825
826DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
827 .map_io = u8500_map_io,
828 .init_irq = ux500_init_irq,
829 /* we re-use nomadik timer here */
830 .timer = &ux500_timer,
831 .handle_irq = gic_handle_irq,
832 .init_machine = u8500_init_machine,
833 .dt_compat = u8500_dt_board_compat,
834MACHINE_END
835#endif
diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c
index da5569d83d58..77a75ed0df67 100644
--- a/arch/arm/mach-ux500/cache-l2x0.c
+++ b/arch/arm/mach-ux500/cache-l2x0.c
@@ -5,6 +5,8 @@
5 */ 5 */
6 6
7#include <linux/io.h> 7#include <linux/io.h>
8#include <linux/of.h>
9
8#include <asm/cacheflush.h> 10#include <asm/cacheflush.h>
9#include <asm/hardware/cache-l2x0.h> 11#include <asm/hardware/cache-l2x0.h>
10#include <mach/hardware.h> 12#include <mach/hardware.h>
@@ -45,7 +47,10 @@ static int __init ux500_l2x0_init(void)
45 ux500_l2x0_unlock(); 47 ux500_l2x0_unlock();
46 48
47 /* 64KB way size, 8 way associativity, force WA */ 49 /* 64KB way size, 8 way associativity, force WA */
48 l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff); 50 if (of_have_populated_dt())
51 l2x0_of_init(0x3e060000, 0xc0000fff);
52 else
53 l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff);
49 54
50 /* 55 /*
51 * We can't disable l2 as we are in non secure mode, currently 56 * We can't disable l2 as we are in non secure mode, currently
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index 6242e88e5fd3..d11f3892a27d 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -16,6 +16,8 @@
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/stat.h> 18#include <linux/stat.h>
19#include <linux/of.h>
20#include <linux/of_irq.h>
19 21
20#include <asm/hardware/gic.h> 22#include <asm/hardware/gic.h>
21#include <asm/mach/map.h> 23#include <asm/mach/map.h>
@@ -28,6 +30,11 @@
28 30
29void __iomem *_PRCMU_BASE; 31void __iomem *_PRCMU_BASE;
30 32
33static const struct of_device_id ux500_dt_irq_match[] = {
34 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
35 {},
36};
37
31void __init ux500_init_irq(void) 38void __init ux500_init_irq(void)
32{ 39{
33 void __iomem *dist_base; 40 void __iomem *dist_base;
@@ -42,7 +49,12 @@ void __init ux500_init_irq(void)
42 } else 49 } else
43 ux500_unknown_soc(); 50 ux500_unknown_soc();
44 51
45 gic_init(0, 29, dist_base, cpu_base); 52#ifdef CONFIG_OF
53 if (of_have_populated_dt())
54 of_irq_init(ux500_dt_irq_match);
55 else
56#endif
57 gic_init(0, 29, dist_base, cpu_base);
46 58
47 /* 59 /*
48 * Init clocks here so that they are available for system timer 60 * Init clocks here so that they are available for system timer
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
index e9d580702fbb..d37df98b5c32 100644
--- a/arch/arm/mach-ux500/timer.c
+++ b/arch/arm/mach-ux500/timer.c
@@ -7,6 +7,7 @@
7#include <linux/io.h> 7#include <linux/io.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/clksrc-dbx500-prcmu.h> 9#include <linux/clksrc-dbx500-prcmu.h>
10#include <linux/of.h>
10 11
11#include <asm/smp_twd.h> 12#include <asm/smp_twd.h>
12 13
@@ -30,9 +31,13 @@ static void __init ux500_twd_init(void)
30 twd_local_timer = cpu_is_u5500() ? &u5500_twd_local_timer : 31 twd_local_timer = cpu_is_u5500() ? &u5500_twd_local_timer :
31 &u8500_twd_local_timer; 32 &u8500_twd_local_timer;
32 33
33 err = twd_local_timer_register(twd_local_timer); 34 if (of_have_populated_dt())
34 if (err) 35 twd_local_timer_of_register();
35 pr_err("twd_local_timer_register failed %d\n", err); 36 else {
37 err = twd_local_timer_register(twd_local_timer);
38 if (err)
39 pr_err("twd_local_timer_register failed %d\n", err);
40 }
36} 41}
37#else 42#else
38#define ux500_twd_init() do { } while(0) 43#define ux500_twd_init() do { } while(0)