aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/ste-u300.dts86
-rw-r--r--arch/arm/mach-u300/core.c81
3 files changed, 168 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b9f7121e6ecf..3dd1316a5a27 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -197,6 +197,7 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
197 tegra114-pluto.dtb 197 tegra114-pluto.dtb
198dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \ 198dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \
199 versatile-pb.dtb 199 versatile-pb.dtb
200dtb-$(CONFIG_ARCH_U300) += ste-u300.dtb
200dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ 201dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
201 vexpress-v2p-ca9.dtb \ 202 vexpress-v2p-ca9.dtb \
202 vexpress-v2p-ca15-tc1.dtb \ 203 vexpress-v2p-ca15-tc1.dtb \
diff --git a/arch/arm/boot/dts/ste-u300.dts b/arch/arm/boot/dts/ste-u300.dts
new file mode 100644
index 000000000000..9e423eb5aa0a
--- /dev/null
+++ b/arch/arm/boot/dts/ste-u300.dts
@@ -0,0 +1,86 @@
1/*
2 * Device Tree for the ST-Ericsson U300 Machine and SoC
3 */
4
5/dts-v1/;
6/include/ "skeleton.dtsi"
7
8/ {
9 model = "ST-Ericsson U300";
10 compatible = "stericsson,u300";
11 #address-cells = <1>;
12 #size-cells = <1>;
13
14 chosen {
15 bootargs = "root=/dev/ram0 console=ttyAMA0,115200n8 earlyprintk";
16 };
17
18 aliases {
19 serial0 = &uart0;
20 serial1 = &uart1;
21 };
22
23 memory {
24 reg = <0x48000000 0x03c00000>;
25 };
26
27 timer: timer@c0014000 {
28 compatible = "stericsson,u300-apptimer";
29 reg = <0xc0014000 0x1000>;
30 interrupt-parent = <&vica>;
31 interrupts = <24 25 26 27>;
32 };
33
34 gpio: gpio@c0016000 {
35 compatible = "stericsson,gpio-coh901";
36 reg = <0xc0016000 0x1000>;
37 interrupt-parent = <&vicb>;
38 interrupts = <0 1 2 18 21 22 23>;
39 interrupt-names = "gpio0", "gpio1", "gpio2", "gpio3",
40 "gpio4", "gpio5", "gpio6";
41 interrupt-controller;
42 #interrupt-cells = <2>;
43 gpio-controller;
44 #gpio-cells = <2>;
45 };
46
47 pinctrl: pinctrl@c0011000 {
48 compatible = "stericsson,pinctrl-u300";
49 reg = <0xc0011000 0x1000>;
50 };
51
52 amba {
53 compatible = "arm,amba-bus";
54 #address-cells = <1>;
55 #size-cells = <1>;
56 ranges;
57
58 vica: interrupt-controller@a0001000 {
59 compatible = "arm,versatile-vic";
60 interrupt-controller;
61 #interrupt-cells = <1>;
62 reg = <0xa0001000 0x20>;
63 };
64
65 vicb: interrupt-controller@a0002000 {
66 compatible = "arm,versatile-vic";
67 interrupt-controller;
68 #interrupt-cells = <1>;
69 reg = <0xa0002000 0x20>;
70 };
71
72 uart0: serial@c0013000 {
73 compatible = "arm,pl011", "arm,primecell";
74 reg = <0xc0013000 0x1000>;
75 interrupt-parent = <&vica>;
76 interrupts = <22>;
77 };
78
79 uart1: serial@c0007000 {
80 compatible = "arm,pl011", "arm,primecell";
81 reg = <0xc0007000 0x1000>;
82 interrupt-parent = <&vicb>;
83 interrupts = <20>;
84 };
85 };
86};
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index a683d17b2ce4..a210b1c4ccf4 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -33,6 +33,9 @@
33#include <linux/platform_data/pinctrl-coh901.h> 33#include <linux/platform_data/pinctrl-coh901.h>
34#include <linux/platform_data/dma-coh901318.h> 34#include <linux/platform_data/dma-coh901318.h>
35#include <linux/irqchip/arm-vic.h> 35#include <linux/irqchip/arm-vic.h>
36#include <linux/irqchip.h>
37#include <linux/of_platform.h>
38#include <linux/clocksource.h>
36 39
37#include <asm/types.h> 40#include <asm/types.h>
38#include <asm/setup.h> 41#include <asm/setup.h>
@@ -698,3 +701,81 @@ MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board")
698 .init_machine = u300_init_machine, 701 .init_machine = u300_init_machine,
699 .restart = u300_restart, 702 .restart = u300_restart,
700MACHINE_END 703MACHINE_END
704
705#ifdef CONFIG_OF
706
707/* These are mostly to get the right device names for the clock lookups */
708static struct of_dev_auxdata u300_auxdata_lookup[] __initdata = {
709 OF_DEV_AUXDATA("stericsson,pinctrl-u300", U300_SYSCON_BASE,
710 "pinctrl-u300", NULL),
711 OF_DEV_AUXDATA("stericsson,gpio-coh901", U300_GPIO_BASE,
712 "u300-gpio", &u300_gpio_plat),
713 OF_DEV_AUXDATA("arm,primecell", U300_UART0_BASE,
714 "uart0", &uart0_plat_data),
715 OF_DEV_AUXDATA("arm,primecell", U300_UART1_BASE,
716 "uart1", &uart1_plat_data),
717 OF_DEV_AUXDATA("arm,primecell", U300_MMCSD_BASE,
718 "mmci", &mmcsd_platform_data),
719 { /* sentinel */ },
720};
721
722static void __init u300_init_irq_dt(void)
723{
724 struct clk *clk;
725
726 /* initialize clocking early, we want to clock the INTCON */
727 u300_clk_init(U300_SYSCON_VBASE);
728
729 /* Bootstrap EMIF and SEMI clocks */
730 clk = clk_get_sys("pl172", NULL);
731 BUG_ON(IS_ERR(clk));
732 clk_prepare_enable(clk);
733 clk = clk_get_sys("semi", NULL);
734 BUG_ON(IS_ERR(clk));
735 clk_prepare_enable(clk);
736
737 /* Clock the interrupt controller */
738 clk = clk_get_sys("intcon", NULL);
739 BUG_ON(IS_ERR(clk));
740 clk_prepare_enable(clk);
741
742 irqchip_init();
743}
744
745static void __init u300_init_machine_dt(void)
746{
747 u16 val;
748
749 /* Check what platform we run and print some status information */
750 u300_init_check_chip();
751
752 u300_assign_physmem();
753
754 /* Initialize pinmuxing */
755 pinctrl_register_mappings(u300_pinmux_map,
756 ARRAY_SIZE(u300_pinmux_map));
757
758 of_platform_populate(NULL, of_default_bus_match_table,
759 u300_auxdata_lookup, NULL);
760
761 /* Enable SEMI self refresh */
762 val = readw(U300_SYSCON_VBASE + U300_SYSCON_SMCR) |
763 U300_SYSCON_SMCR_SEMI_SREFREQ_ENABLE;
764 writew(val, U300_SYSCON_VBASE + U300_SYSCON_SMCR);
765}
766
767static const char * u300_board_compat[] = {
768 "stericsson,u300",
769 NULL,
770};
771
772DT_MACHINE_START(U300_DT, "U300 S335/B335 (Device Tree)")
773 .map_io = u300_map_io,
774 .init_irq = u300_init_irq_dt,
775 .init_time = clocksource_of_init,
776 .init_machine = u300_init_machine_dt,
777 .restart = u300_restart,
778 .dt_compat = u300_board_compat,
779MACHINE_END
780
781#endif /* CONFIG_OF */