From 3e05f24aa95bb043f1103b41392b61ce83d2675e Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:01 +0900 Subject: ARM: shmobile: r8a7779: Add helper to read mode pins Add and use helper to read mode pins. This will be re-used when moving marzen-reference to the common clock framework. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-r8a7779.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c') diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 86ec4b625a78..25e1d0b72463 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -762,6 +762,24 @@ void __init r8a7779_add_standard_devices_dt(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } +#define MODEMR 0xffcc0020 + +u32 __init r8a7779_read_mode_pins(void) +{ + static u32 mode; + static bool mode_valid; + + if (!mode_valid) { + void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); + BUG_ON(!modemr); + mode = ioread32(modemr); + iounmap(modemr); + mode_valid = true; + } + + return mode; +} + static const char *r8a7779_compat_dt[] __initdata = { "renesas,r8a7779", NULL, -- cgit v1.2.3 From f48039a3da40f0c193122c83ad582913f2daf29d Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:02 +0900 Subject: ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c r8a7779_earlytimer_init() calls r8a7779_clock_init() and r8a7779_clock_init() is defined in clock-r8a7779.c. If both CONFIG_COMMON_CLK and CONFIG_ARCH_R8A7779 are enabled, as will be the case when marzen-reference moves to use the common clock framework, then setup-r8a7779.c is compiled but clock-r8a7779.c is not. As r8a7779_earlytimer_init() is not used by marzen-reference simply move it to clock-r8a7779.c. [horms+renesas@verge.net.au: rebase] Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/clock-r8a7779.c | 11 +++++++++++ arch/arm/mach-shmobile/setup-r8a7779.c | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c') diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index 5dd66a21f036..e690927f3505 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "clock.h" #include "common.h" @@ -261,3 +262,13 @@ void __init r8a7779_clock_init(void) else panic("failed to setup r8a7779 clocks\n"); } + +/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ +void __init __weak r8a7779_register_twd(void) { } + +void __init r8a7779_earlytimer_init(void) +{ + r8a7779_clock_init(); + r8a7779_register_twd(); + shmobile_earlytimer_init(); +} diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 25e1d0b72463..23122f62366c 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -674,16 +674,6 @@ void __init r8a7779_add_standard_devices(void) r8a7779_register_hpb_dmae(); } -/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ -void __init __weak r8a7779_register_twd(void) { } - -void __init r8a7779_earlytimer_init(void) -{ - r8a7779_clock_init(); - r8a7779_register_twd(); - shmobile_earlytimer_init(); -} - void __init r8a7779_add_early_devices(void) { early_platform_add_devices(r8a7779_devices_dt, -- cgit v1.2.3 From f8fba0ce6628109bac9d33f65b637a87a2f3be24 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:03 +0900 Subject: ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code Move the clock initialisation and OF device population from SoC to board code. This is in keeping with the pattern used by Lager. And the clock portion is part of decoupling clock initialisation from SoC code in preparation for moving to the common clock framework. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 3 +++ arch/arm/mach-shmobile/setup-r8a7779.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 94bd57203ff5..46ed17a50183 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include @@ -27,7 +28,9 @@ static void __init marzen_init(void) { + r8a7779_clock_init(); r8a7779_add_standard_devices_dt(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */ } diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 23122f62366c..15f533b89702 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -744,12 +744,8 @@ void __init r8a7779_init_delay(void) void __init r8a7779_add_standard_devices_dt(void) { - /* clocks are setup late during boot in the case of DT */ - r8a7779_clock_init(); - platform_add_devices(r8a7779_devices_dt, ARRAY_SIZE(r8a7779_devices_dt)); - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } #define MODEMR 0xffcc0020 -- cgit v1.2.3 From 0157b62674aa3db1fc574bb65e6b0e30bb0683d7 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 16 May 2014 13:42:59 +0900 Subject: ARM: shmobile: r8a7779: Use DT CPU Frequency in common case Convert the common C-code-less r8a7779 DT board support to use shmobile_init_delay() to be able to migrate away from per-SoC delay setup functions. Based on work by Magnus dam for the r8a7740 SoC. Cc: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-r8a7779.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c') diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 15f533b89702..706832f34a69 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -773,7 +773,7 @@ static const char *r8a7779_compat_dt[] __initdata = { DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)") .map_io = r8a7779_map_io, - .init_early = r8a7779_init_delay, + .init_early = shmobile_init_delay, .nr_irqs = NR_IRQS_LEGACY, .init_irq = r8a7779_init_irq_dt, .init_machine = r8a7779_add_standard_devices_dt, -- cgit v1.2.3 From daab540e3a2afeb8c087a67dfaee5aa50a29e844 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 16 May 2014 13:43:01 +0900 Subject: ARM: shmobile: r8a7779: Remove unused r8a7779_init_delay() Remove the now unused r8a7779_init_delay() function. Based on work for the r8a7740 SoC by Magnus Damm. Cc: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/include/mach/r8a7779.h | 1 - arch/arm/mach-shmobile/setup-r8a7779.c | 5 ----- 2 files changed, 6 deletions(-) (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c') diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h index 5ef0bad6334d..5415c719dc19 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h @@ -10,7 +10,6 @@ enum { HPBDMA_SLAVE_SDHI0_RX, }; -extern void r8a7779_init_delay(void); extern void r8a7779_init_irq_extpin(int irlm); extern void r8a7779_init_irq_extpin_dt(int irlm); extern void r8a7779_init_irq_dt(void); diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 706832f34a69..f96a30481dfb 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -737,11 +737,6 @@ void __init r8a7779_init_irq_dt(void) __raw_writel(0x003fee3f, INT2SMSKCR4); } -void __init r8a7779_init_delay(void) -{ - shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */ -} - void __init r8a7779_add_standard_devices_dt(void) { platform_add_devices(r8a7779_devices_dt, -- cgit v1.2.3 From 6d4abd79c80742629477479b01077bb92eccdd53 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:39:32 +0900 Subject: ARM: shmobile: marzen: Initialise SCIF devices using DT Initialise SCIF devices using DT when booting marzen using multiplatform. Acked-by: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7779-marzen.dts | 22 +++++++++++++++++++--- arch/arm/mach-shmobile/setup-r8a7779.c | 8 ++++---- 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c') diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts index 321290828eee..20b176807848 100644 --- a/arch/arm/boot/dts/r8a7779-marzen.dts +++ b/arch/arm/boot/dts/r8a7779-marzen.dts @@ -18,6 +18,11 @@ model = "marzen"; compatible = "renesas,marzen", "renesas,r8a7779"; + aliases { + serial2 = &scif2; + serial4 = &scif4; + }; + chosen { bootargs = "console=ttySC2,115200 ignore_loglevel root=/dev/nfs ip=on"; }; @@ -74,9 +79,6 @@ }; &pfc { - pinctrl-0 = <&scif2_pins &scif4_pins>; - pinctrl-names = "default"; - lan0_pins: lan0 { intc { renesas,groups = "intc_irq1_b"; @@ -109,6 +111,20 @@ }; }; +&scif2 { + pinctrl-0 = <&scif2_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + +&scif4 { + pinctrl-0 = <&scif4_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + &sdhi0 { pinctrl-0 = <&sdhi0_pins>; pinctrl-names = "default"; diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index f96a30481dfb..2f59b99b9b86 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -640,16 +640,16 @@ static void __init r8a7779_register_hpb_dmae(void) } static struct platform_device *r8a7779_devices_dt[] __initdata = { + &tmu0_device, +}; + +static struct platform_device *r8a7779_standard_devices[] __initdata = { &scif0_device, &scif1_device, &scif2_device, &scif3_device, &scif4_device, &scif5_device, - &tmu0_device, -}; - -static struct platform_device *r8a7779_standard_devices[] __initdata = { &i2c0_device, &i2c1_device, &i2c2_device, -- cgit v1.2.3 From 1b55353c9214788b0d0797a5fd4585af1557a12c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 20 Jun 2014 18:53:05 +0200 Subject: ARM: shmobile: Move r8a7779.h Change location of r8a7779.h so it can be included as "r8a7779.h" instead of the old style Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 4 ++- arch/arm/mach-shmobile/board-marzen.c | 4 ++- arch/arm/mach-shmobile/clock-r8a7779.c | 3 ++- arch/arm/mach-shmobile/include/mach/r8a7779.h | 36 ------------------------- arch/arm/mach-shmobile/pm-r8a7779.c | 4 ++- arch/arm/mach-shmobile/r8a7779.h | 36 +++++++++++++++++++++++++ arch/arm/mach-shmobile/setup-r8a7779.c | 4 ++- arch/arm/mach-shmobile/smp-r8a7779.c | 4 ++- 8 files changed, 53 insertions(+), 42 deletions(-) delete mode 100644 arch/arm/mach-shmobile/include/mach/r8a7779.h create mode 100644 arch/arm/mach-shmobile/r8a7779.h (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 0a000b74ac6d..21b3e1ca2261 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -22,12 +22,14 @@ #include #include #include -#include + #include #include + #include "clock.h" #include "common.h" #include "irqs.h" +#include "r8a7779.h" static void __init marzen_init_timer(void) { diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index fe445ef49fb9..25a1037e289d 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c @@ -41,13 +41,15 @@ #include #include #include + #include -#include #include #include #include + #include "common.h" #include "irqs.h" +#include "r8a7779.h" /* Fixed 3.3V regulator to be used by SDHI0 */ static struct regulator_consumer_supply fixed3v3_power_consumers[] = { diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index e690927f3505..c51f9db3f66f 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c @@ -24,9 +24,10 @@ #include #include #include -#include + #include "clock.h" #include "common.h" +#include "r8a7779.h" /* * MD1 = 1 MD1 = 0 diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h deleted file mode 100644 index 5415c719dc19..000000000000 --- a/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef __ASM_R8A7779_H__ -#define __ASM_R8A7779_H__ - -#include - -/* HPB-DMA slave IDs */ -enum { - HPBDMA_SLAVE_DUMMY, - HPBDMA_SLAVE_SDHI0_TX, - HPBDMA_SLAVE_SDHI0_RX, -}; - -extern void r8a7779_init_irq_extpin(int irlm); -extern void r8a7779_init_irq_extpin_dt(int irlm); -extern void r8a7779_init_irq_dt(void); -extern void r8a7779_map_io(void); -extern void r8a7779_earlytimer_init(void); -extern void r8a7779_add_early_devices(void); -extern void r8a7779_add_standard_devices(void); -extern void r8a7779_add_standard_devices_dt(void); -extern void r8a7779_init_late(void); -extern u32 r8a7779_read_mode_pins(void); -extern void r8a7779_clock_init(void); -extern void r8a7779_pinmux_init(void); -extern void r8a7779_pm_init(void); -extern void r8a7779_register_twd(void); - -#ifdef CONFIG_PM -extern void __init r8a7779_init_pm_domains(void); -#else -static inline void r8a7779_init_pm_domains(void) {} -#endif /* CONFIG_PM */ - -extern struct smp_operations r8a7779_smp_ops; - -#endif /* __ASM_R8A7779_H__ */ diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c index f0f36cb5ffe7..69f70b7f7fb2 100644 --- a/arch/arm/mach-shmobile/pm-r8a7779.c +++ b/arch/arm/mach-shmobile/pm-r8a7779.c @@ -19,10 +19,12 @@ #include #include #include + #include -#include + #include "common.h" #include "pm-rcar.h" +#include "r8a7779.h" /* SYSC */ #define SYSCIER 0x0c diff --git a/arch/arm/mach-shmobile/r8a7779.h b/arch/arm/mach-shmobile/r8a7779.h new file mode 100644 index 000000000000..5415c719dc19 --- /dev/null +++ b/arch/arm/mach-shmobile/r8a7779.h @@ -0,0 +1,36 @@ +#ifndef __ASM_R8A7779_H__ +#define __ASM_R8A7779_H__ + +#include + +/* HPB-DMA slave IDs */ +enum { + HPBDMA_SLAVE_DUMMY, + HPBDMA_SLAVE_SDHI0_TX, + HPBDMA_SLAVE_SDHI0_RX, +}; + +extern void r8a7779_init_irq_extpin(int irlm); +extern void r8a7779_init_irq_extpin_dt(int irlm); +extern void r8a7779_init_irq_dt(void); +extern void r8a7779_map_io(void); +extern void r8a7779_earlytimer_init(void); +extern void r8a7779_add_early_devices(void); +extern void r8a7779_add_standard_devices(void); +extern void r8a7779_add_standard_devices_dt(void); +extern void r8a7779_init_late(void); +extern u32 r8a7779_read_mode_pins(void); +extern void r8a7779_clock_init(void); +extern void r8a7779_pinmux_init(void); +extern void r8a7779_pm_init(void); +extern void r8a7779_register_twd(void); + +#ifdef CONFIG_PM +extern void __init r8a7779_init_pm_domains(void); +#else +static inline void r8a7779_init_pm_domains(void) {} +#endif /* CONFIG_PM */ + +extern struct smp_operations r8a7779_smp_ops; + +#endif /* __ASM_R8A7779_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 2f59b99b9b86..8dbc407f4c8d 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -40,14 +40,16 @@ #include #include #include -#include + #include #include #include #include #include + #include "common.h" #include "irqs.h" +#include "r8a7779.h" static struct map_desc r8a7779_io_desc[] __initdata = { /* 2M entity map for 0xf0000000 (MPCORE) */ diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index c230fc0c3fef..3100e355c3fd 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c @@ -23,13 +23,15 @@ #include #include #include -#include + #include #include #include #include + #include "common.h" #include "pm-rcar.h" +#include "r8a7779.h" #define AVECR IOMEM(0xfe700040) #define R8A7779_SCU_BASE 0xf0000000 -- cgit v1.2.3