diff options
author | Magnus Damm <damm@opensource.se> | 2013-09-18 16:11:20 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-10-07 20:53:00 -0400 |
commit | f6ca6f11c921b227e33c5e91084be5ef30c32771 (patch) | |
tree | a6bc0b2e5885fa8cf396ce3c6fe098bc2e614e14 | |
parent | e3da5b36d48a8e55d1549da016e4c38ff3c0d0fc (diff) |
ARM: shmobile: r7s72100 SCIF support
Add SCIF serial port support to the r7s72100 SoC by
adding platform devices for SCIF0 -> SCIF7 together with
clock bindings. DT device description is excluded at
this point since such bindings are still under
development.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/mach-shmobile/clock-r7s72100.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/r7s72100.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r7s72100.c | 45 |
3 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c index 1e71094f809d..4aba20ca127e 100644 --- a/arch/arm/mach-shmobile/clock-r7s72100.c +++ b/arch/arm/mach-shmobile/clock-r7s72100.c | |||
@@ -170,6 +170,14 @@ static struct clk_lookup lookups[] = { | |||
170 | CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), | 170 | CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), |
171 | 171 | ||
172 | /* MSTP clocks */ | 172 | /* MSTP clocks */ |
173 | CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP47]), | ||
174 | CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP46]), | ||
175 | CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP45]), | ||
176 | CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[MSTP44]), | ||
177 | CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP43]), | ||
178 | CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), | ||
179 | CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), | ||
180 | CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), | ||
173 | }; | 181 | }; |
174 | 182 | ||
175 | void __init r7s72100_clock_init(void) | 183 | void __init r7s72100_clock_init(void) |
diff --git a/arch/arm/mach-shmobile/include/mach/r7s72100.h b/arch/arm/mach-shmobile/include/mach/r7s72100.h index f78062e98bd4..5f34b20ecd4a 100644 --- a/arch/arm/mach-shmobile/include/mach/r7s72100.h +++ b/arch/arm/mach-shmobile/include/mach/r7s72100.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_R7S72100_H__ | 1 | #ifndef __ASM_R7S72100_H__ |
2 | #define __ASM_R7S72100_H__ | 2 | #define __ASM_R7S72100_H__ |
3 | 3 | ||
4 | void r7s72100_add_dt_devices(void); | ||
4 | void r7s72100_clock_init(void); | 5 | void r7s72100_clock_init(void); |
5 | void r7s72100_init_early(void); | 6 | void r7s72100_init_early(void); |
6 | 7 | ||
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c index c1aded0984a8..d4eb509a1c87 100644 --- a/arch/arm/mach-shmobile/setup-r7s72100.c +++ b/arch/arm/mach-shmobile/setup-r7s72100.c | |||
@@ -21,10 +21,55 @@ | |||
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/of_platform.h> | 23 | #include <linux/of_platform.h> |
24 | #include <linux/serial_sci.h> | ||
24 | #include <mach/common.h> | 25 | #include <mach/common.h> |
26 | #include <mach/irqs.h> | ||
25 | #include <mach/r7s72100.h> | 27 | #include <mach/r7s72100.h> |
26 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
27 | 29 | ||
30 | #define SCIF_DATA(index, baseaddr, irq) \ | ||
31 | [index] = { \ | ||
32 | .type = PORT_SCIF, \ | ||
33 | .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE, \ | ||
34 | .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \ | ||
35 | .scbrr_algo_id = SCBRR_ALGO_2, \ | ||
36 | .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | \ | ||
37 | SCSCR_REIE, \ | ||
38 | .mapbase = baseaddr, \ | ||
39 | .irqs = { irq + 1, irq + 2, irq + 3, irq }, \ | ||
40 | } | ||
41 | |||
42 | enum { SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5, SCIF6, SCIF7 }; | ||
43 | |||
44 | static const struct plat_sci_port scif[] __initconst = { | ||
45 | SCIF_DATA(SCIF0, 0xe8007000, gic_iid(221)), /* SCIF0 */ | ||
46 | SCIF_DATA(SCIF1, 0xe8007800, gic_iid(225)), /* SCIF1 */ | ||
47 | SCIF_DATA(SCIF2, 0xe8008000, gic_iid(229)), /* SCIF2 */ | ||
48 | SCIF_DATA(SCIF3, 0xe8008800, gic_iid(233)), /* SCIF3 */ | ||
49 | SCIF_DATA(SCIF4, 0xe8009000, gic_iid(237)), /* SCIF4 */ | ||
50 | SCIF_DATA(SCIF5, 0xe8009800, gic_iid(241)), /* SCIF5 */ | ||
51 | SCIF_DATA(SCIF6, 0xe800a000, gic_iid(245)), /* SCIF6 */ | ||
52 | SCIF_DATA(SCIF7, 0xe800a800, gic_iid(249)), /* SCIF7 */ | ||
53 | }; | ||
54 | |||
55 | static inline void r7s72100_register_scif(int idx) | ||
56 | { | ||
57 | platform_device_register_data(&platform_bus, "sh-sci", idx, &scif[idx], | ||
58 | sizeof(struct plat_sci_port)); | ||
59 | } | ||
60 | |||
61 | void __init r7s72100_add_dt_devices(void) | ||
62 | { | ||
63 | r7s72100_register_scif(SCIF0); | ||
64 | r7s72100_register_scif(SCIF1); | ||
65 | r7s72100_register_scif(SCIF2); | ||
66 | r7s72100_register_scif(SCIF3); | ||
67 | r7s72100_register_scif(SCIF4); | ||
68 | r7s72100_register_scif(SCIF5); | ||
69 | r7s72100_register_scif(SCIF6); | ||
70 | r7s72100_register_scif(SCIF7); | ||
71 | } | ||
72 | |||
28 | void __init r7s72100_init_early(void) | 73 | void __init r7s72100_init_early(void) |
29 | { | 74 | { |
30 | shmobile_setup_delay(400, 1, 3); /* Cortex-A9 @ 400MHz */ | 75 | shmobile_setup_delay(400, 1, 3); /* Cortex-A9 @ 400MHz */ |