sh: make early_platform code SuperH-specific
Subsystems (5)
v3 cover sh: make early_platform code SuperH-specific
I recently started a discussion about the need for a proper early device probing mechanism[1]. One that would be based on real platform drivers and support both platform data and device tree.
While we're far from reaching any consensus on the implementation, Arnd suggested that I start off by moving the SuperH-specific early platform drivers implementation to arch/sh[2].
This series is the first attempt at making way for a new, less hacky implementation.
The first patch removes the last instance of a non-sh driver using the early_platform API. It can be removed since ARM no longer probes early drivers.
The second patch moves all the early_platform code to arch/sh.
The last patch prefixes all early_platform symbols with 'sh_'.
[1] https://lkml.org/lkml/2018/4/26/657
[2] https://lkml.org/lkml/2018/4/27/239
v1 -> v2:
- certain drivers are compiled for arm/mach-shmobile too - we need to add ifdefs for CONFIG_SUPERH around early_platform calls
v2 -> v3:
- added a stub for is_early_platform_device() which always returns false on non-SuperH architectures
RESEND: rebased on top of v4.18-rc1 and verified that there are no build failures.
RESEND AGAIN: rebased on top of v4.19-rc1 and verified builds again.
Bartosz Golaszewski (3):
clocksource: timer-ti-dm: remove the early platform driver
registration
platform: move the early platform device support to arch/sh
sh: add the sh_ prefix to early platform symbols
arch/sh/drivers/Makefile | 2 +- arch/sh/drivers/platform_early.c | 347 +++++++++++++++++++++++++ arch/sh/include/asm/platform_early.h | 61 +++++ arch/sh/kernel/cpu/sh2/setup-sh7619.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-mxg.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 3 +- arch/sh/kernel/cpu/sh3/setup-sh3.c | 1 + arch/sh/kernel/cpu/sh3/setup-sh7705.c | 3 +- arch/sh/kernel/cpu/sh3/setup-sh770x.c | 3 +- arch/sh/kernel/cpu/sh3/setup-sh7710.c | 3 +- arch/sh/kernel/cpu/sh3/setup-sh7720.c | 3 +- arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 3 +- arch/sh/kernel/cpu/sh4/setup-sh7750.c | 9 +- arch/sh/kernel/cpu/sh4/setup-sh7760.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-shx3.c | 3 +- arch/sh/kernel/cpu/sh5/setup-sh5.c | 3 +- arch/sh/kernel/setup.c | 3 +- arch/sh/kernel/time.c | 5 +- drivers/base/platform.c | 288 -------------------- drivers/clocksource/sh_cmt.c | 13 +- drivers/clocksource/sh_mtu2.c | 13 +- drivers/clocksource/sh_tmu.c | 14 +- drivers/clocksource/timer-ti-dm.c | 1 - drivers/tty/serial/sh-sci.c | 11 +- include/linux/platform_device.h | 64 +---- 41 files changed, 525 insertions(+), 388 deletions(-) create mode 100644 arch/sh/drivers/platform_early.c create mode 100644 arch/sh/include/asm/platform_early.h
Signature · 1 line
2.18.0
PATCH RESEND v3 1/3 clocksource: timer-ti-dm: remove the early platform driver registration
From: Bartosz Golaszewski <[email protected]>
This driver is no longer used as an early platform driver. Remove the registration macro.
--- drivers/clocksource/timer-ti-dm.c | 1 - 1 file changed, 1 deletion(-)
drivers/clocksource/timer-ti-dm.c +0 -1
@@ -991,7 +991,6 @@ static struct platform_driver omap_dm_timer_driver = { }, }; -early_platform_init ("earlytimer" , &omap_dm_timer_driver);module_platform_driver (omap_dm_timer_driver);MODULE_DESCRIPTION ("OMAP Dual-Mode Timer Driver" );
Signature · 1 line
2.18.0
PATCH RESEND v3 2/3 platform: move the early platform device support to arch/sh
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
SuperH is the only user of the current implementation of early platform device support. We want to introduce a more robust approach to early probing. As the first step - move all the current early platform code to arch/sh.
In order not to export internal drivers/base functions to arch code for this temporary solution - copy the two needed routines for driver matching from drivers/base/platform.c to arch/sh/drivers/platform_early.c.
Also: call early_platform_cleanup() from subsys_initcall() so that it's called after all early devices are probed.
--- arch/sh/drivers/Makefile | 2 +- arch/sh/drivers/platform_early.c | 347 +++++++++++++++++++++++++ arch/sh/include/asm/platform_early.h | 61 +++++ arch/sh/kernel/cpu/sh2/setup-sh7619.c | 1 + arch/sh/kernel/cpu/sh2a/setup-mxg.c | 1 + arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 1 + arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 1 + arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 1 + arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 1 + arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 1 + arch/sh/kernel/cpu/sh3/setup-sh3.c | 1 + arch/sh/kernel/cpu/sh3/setup-sh7705.c | 1 + arch/sh/kernel/cpu/sh3/setup-sh770x.c | 1 + arch/sh/kernel/cpu/sh3/setup-sh7710.c | 1 + arch/sh/kernel/cpu/sh3/setup-sh7720.c | 1 + arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 1 + arch/sh/kernel/cpu/sh4/setup-sh7750.c | 1 + arch/sh/kernel/cpu/sh4/setup-sh7760.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 1 + arch/sh/kernel/cpu/sh4a/setup-shx3.c | 1 + arch/sh/kernel/cpu/sh5/setup-sh5.c | 1 + arch/sh/kernel/setup.c | 1 + arch/sh/kernel/time.c | 1 + drivers/base/platform.c | 288 -------------------- drivers/clocksource/sh_cmt.c | 7 + drivers/clocksource/sh_mtu2.c | 7 + drivers/clocksource/sh_tmu.c | 8 + drivers/tty/serial/sh-sci.c | 7 +- include/linux/platform_device.h | 64 +---- 40 files changed, 480 insertions(+), 342 deletions(-) create mode 100644 arch/sh/drivers/platform_early.c create mode 100644 arch/sh/include/asm/platform_early.h
arch/sh/drivers/Makefile +1 -1
@@ -3,7 +3,7 @@ # Makefile for the Linux SuperH-specific device drivers. # -obj-y += dma/ +obj-y += dma/ platform_early.o obj-$(CONFIG_PCI) += pci/ obj-$(CONFIG_SUPERHYWAY) += superhyway/
arch/sh/drivers/platform_early.c new file +347 -0
347 lines not on this page · raw message
arch/sh/include/asm/platform_early.h new file +61 -0
61 lines not on this page · raw message
arch/sh/kernel/cpu/sh2/setup-sh7619.c +1 -0
@@ -15,6 +15,7 @@#include <linux/sh_eth.h> #include <linux/sh_timer.h> #include <linux/io.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh2a/setup-mxg.c +1 -0
@@ -12,6 +12,7 @@#include <linux/serial.h> #include <linux/serial_sci.h> #include <linux/sh_timer.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh2a/setup-sh7201.c +1 -0
@@ -14,6 +14,7 @@#include <linux/serial_sci.h> #include <linux/sh_timer.h> #include <linux/io.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh2a/setup-sh7203.c +1 -0
@@ -13,6 +13,7 @@#include <linux/serial_sci.h> #include <linux/sh_timer.h> #include <linux/io.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh2a/setup-sh7206.c +1 -0
@@ -14,6 +14,7 @@#include <linux/serial_sci.h> #include <linux/sh_timer.h> #include <linux/io.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh2a/setup-sh7264.c +1 -0
@@ -14,6 +14,7 @@#include <linux/usb/r8a66597.h> #include <linux/sh_timer.h> #include <linux/io.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh2a/setup-sh7269.c +1 -0
@@ -15,6 +15,7 @@#include <linux/usb/r8a66597.h> #include <linux/sh_timer.h> #include <linux/io.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh3/setup-sh3.c +1 -0
@@ -11,6 +11,7 @@#include <linux/init.h> #include <linux/irq.h> #include <linux/io.h> +#include <asm/platform_early.h> /* All SH3 devices are equipped with IRQ0->5 (except sh7708) */
arch/sh/kernel/cpu/sh3/setup-sh7705.c +1 -0
@@ -17,6 +17,7 @@#include <linux/sh_intc.h> #include <asm/rtc.h> #include <cpu/serial.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh3/setup-sh770x.c +1 -0
@@ -21,6 +21,7 @@#include <linux/sh_timer.h> #include <linux/sh_intc.h> #include <cpu/serial.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh3/setup-sh7710.c +1 -0
@@ -16,6 +16,7 @@#include <linux/sh_timer.h> #include <linux/sh_intc.h> #include <asm/rtc.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh3/setup-sh7720.c +1 -0
@@ -22,6 +22,7 @@#include <linux/sh_intc.h> #include <linux/usb/ohci_pdriver.h> #include <asm/rtc.h> +#include <asm/platform_early.h> #include <cpu/serial.h> static struct resource rtc_resources[] = {
arch/sh/kernel/cpu/sh4/setup-sh4-202.c +1 -0
@@ -15,6 +15,7 @@#include <linux/sh_timer.h> #include <linux/sh_intc.h> #include <linux/io.h> +#include <asm/platform_early.h> static struct plat_sci_port scif0_platform_data = { .scscr =SCSCR_REIE ,
arch/sh/kernel/cpu/sh4/setup-sh7750.c +1 -0
@@ -16,6 +16,7 @@#include <linux/sh_intc.h> #include <linux/serial_sci.h> #include <generated/machtypes.h> +#include <asm/platform_early.h> static struct resource rtc_resources[] = { [0 ] = {
arch/sh/kernel/cpu/sh4/setup-sh7760.c +1 -0
@@ -14,6 +14,7 @@#include <linux/sh_intc.h> #include <linux/serial_sci.h> #include <linux/io.h> +#include <asm/platform_early.h> enum {UNUSED =0 ,
arch/sh/kernel/cpu/sh4a/setup-sh7343.c +1 -0
@@ -15,6 +15,7 @@#include <linux/sh_timer.h> #include <linux/sh_intc.h> #include <asm/clock.h> +#include <asm/platform_early.h> /* Serial */ static struct plat_sci_port scif0_platform_data = {
arch/sh/kernel/cpu/sh4a/setup-sh7366.c +1 -0
@@ -18,6 +18,7 @@#include <linux/sh_intc.h> #include <linux/usb/r8a66597.h> #include <asm/clock.h> +#include <asm/platform_early.h> static struct plat_sci_port scif0_platform_data = { .scscr =SCSCR_REIE ,
arch/sh/kernel/cpu/sh4a/setup-sh7722.c +1 -0
@@ -21,6 +21,7 @@#include <asm/clock.h> #include <asm/mmzone.h> #include <asm/siu.h> +#include <asm/platform_early.h> #include <cpu/dma-register.h> #include <cpu/sh7722.h>
arch/sh/kernel/cpu/sh4a/setup-sh7723.c +1 -0
@@ -19,6 +19,7 @@#include <linux/io.h> #include <asm/clock.h> #include <asm/mmzone.h> +#include <asm/platform_early.h> #include <cpu/sh7723.h> /* Serial */
arch/sh/kernel/cpu/sh4a/setup-sh7724.c +1 -0
@@ -27,6 +27,7 @@#include <asm/suspend.h> #include <asm/clock.h> #include <asm/mmzone.h> +#include <asm/platform_early.h> #include <cpu/dma-register.h> #include <cpu/sh7724.h>
arch/sh/kernel/cpu/sh4a/setup-sh7734.c +1 -0
@@ -21,6 +21,7 @@#include <linux/io.h> #include <asm/clock.h> #include <asm/irq.h> +#include <asm/platform_early.h> #include <cpu/sh7734.h> /* SCIF */
arch/sh/kernel/cpu/sh4a/setup-sh7757.c +1 -0
@@ -22,6 +22,7 @@#include <linux/usb/ohci_pdriver.h> #include <cpu/dma-register.h> #include <cpu/sh7757.h> +#include <asm/platform_early.h> static struct plat_sci_port scif2_platform_data = { .scscr =SCSCR_REIE ,
arch/sh/kernel/cpu/sh4a/setup-sh7763.c +1 -0
@@ -17,6 +17,7 @@#include <linux/io.h> #include <linux/serial_sci.h> #include <linux/usb/ohci_pdriver.h> +#include <asm/platform_early.h> static struct plat_sci_port scif0_platform_data = { .scscr =SCSCR_REIE ,
arch/sh/kernel/cpu/sh4a/setup-sh7770.c +1 -0
@@ -14,6 +14,7 @@#include <linux/sh_timer.h> #include <linux/sh_intc.h> #include <linux/io.h> +#include <asm/platform_early.h> static struct plat_sci_port scif0_platform_data = { .scscr =SCSCR_REIE |SCSCR_TOIE ,
arch/sh/kernel/cpu/sh4a/setup-sh7780.c +1 -0
@@ -16,6 +16,7 @@#include <linux/sh_timer.h> #include <linux/sh_intc.h> #include <cpu/dma-register.h> +#include <asm/platform_early.h> static struct plat_sci_port scif0_platform_data = { .scscr =SCSCR_REIE |SCSCR_CKE1 ,
arch/sh/kernel/cpu/sh4a/setup-sh7785.c +1 -0
@@ -17,6 +17,7 @@#include <linux/sh_timer.h> #include <linux/sh_intc.h> #include <asm/mmzone.h> +#include <asm/platform_early.h> #include <cpu/dma-register.h> static struct plat_sci_port scif0_platform_data = {
arch/sh/kernel/cpu/sh4a/setup-sh7786.c +1 -0
@@ -26,6 +26,7 @@#include <linux/usb/ohci_pdriver.h> #include <cpu/dma-register.h> #include <asm/mmzone.h> +#include <asm/platform_early.h> static struct plat_sci_port scif0_platform_data = { .scscr =SCSCR_REIE |SCSCR_CKE1 ,
arch/sh/kernel/cpu/sh4a/setup-shx3.c +1 -0
@@ -17,6 +17,7 @@#include <linux/sh_intc.h> #include <cpu/shx3.h> #include <asm/mmzone.h> +#include <asm/platform_early.h> /* * This intentionally only registers SCIF ports 0, 1, and 3. SCIF 2
arch/sh/kernel/cpu/sh5/setup-sh5.c +1 -0
@@ -15,6 +15,7 @@#include <linux/mm.h> #include <linux/sh_timer.h> #include <asm/addrspace.h> +#include <asm/platform_early.h> static struct plat_sci_port scif0_platform_data = { .flags =UPF_IOREMAP ,
arch/sh/kernel/setup.c +1 -0
@@ -43,6 +43,7 @@#include <asm/mmu_context.h> #include <asm/mmzone.h> #include <asm/sparsemem.h> +#include <asm/platform_early.h> /* * Initialize loops_per_jiffy as 10000000 (1000MIPS).
arch/sh/kernel/time.c +1 -0
@@ -21,6 +21,7 @@#include <linux/rtc.h> #include <asm/clock.h> #include <asm/rtc.h> +#include <asm/platform_early.h> /* Dummy RTC ops */ static void null_rtc_get_time (struct timespec *tv)
drivers/base/platform.c +0 -288
297 lines not on this page · raw message
drivers/clocksource/sh_cmt.c +7 -0
@@ -33,6 +33,10 @@#include <linux/slab.h> #include <linux/spinlock.h> +#ifdef CONFIG_SUPERH +#include <asm/platform_early.h> +#endif +struct sh_cmt_device ;/*
@@ -1100,7 +1104,10 @@ static void __exit sh_cmt_exit(void)platform_driver_unregister (&sh_cmt_device_driver); } +#ifdef CONFIG_SUPERH early_platform_init ("earlytimer" , &sh_cmt_device_driver); +#endif +subsys_initcall (sh_cmt_init);module_exit (sh_cmt_exit);
drivers/clocksource/sh_mtu2.c +7 -0
@@ -31,6 +31,10 @@#include <linux/slab.h> #include <linux/spinlock.h> +#ifdef CONFIG_SUPERH +#include <asm/platform_early.h> +#endif +struct sh_mtu2_device ;struct sh_mtu2_channel {
@@ -519,7 +523,10 @@ static void __exit sh_mtu2_exit(void)platform_driver_unregister (&sh_mtu2_device_driver); } +#ifdef CONFIG_SUPERH early_platform_init ("earlytimer" , &sh_mtu2_device_driver); +#endif +subsys_initcall (sh_mtu2_init);module_exit (sh_mtu2_exit);
drivers/clocksource/sh_tmu.c +8 -0
@@ -32,6 +32,10 @@#include <linux/slab.h> #include <linux/spinlock.h> +#ifdef CONFIG_SUPERH +#include <asm/platform_early.h> +#endif +enum sh_tmu_model {SH_TMU ,SH_TMU_SH3 ,
@@ -626,6 +630,7 @@ static int sh_tmu_probe(struct platform_device *pdev)pm_runtime_idle (&pdev->dev);return ret; } +if (is_early_platform_device (pdev))return 0 ;
@@ -676,7 +681,10 @@ static void __exit sh_tmu_exit(void)platform_driver_unregister (&sh_tmu_device_driver); } +#ifdef CONFIG_SUPERH early_platform_init ("earlytimer" , &sh_tmu_device_driver); +#endif +subsys_initcall (sh_tmu_init);module_exit (sh_tmu_exit);
drivers/tty/serial/sh-sci.c +6 -1
@@ -54,6 +54,7 @@#ifdef CONFIG_SUPERH #include <asm/sh_bios.h> +#include <asm/platform_early.h> #endif #include "serial_mctrl_gpio.h"
@@ -3023,6 +3024,7 @@ static struct console serial_console = { .data = &sci_uart_driver, }; +#ifdef CONFIG_SUPERH static struct console early_serial_console = { .name ="early_ttySC" , .write = serial_console_write,
@@ -3051,6 +3053,7 @@ static int sci_probe_earlyprintk(struct platform_device *pdev)register_console (&early_serial_console); return 0; } +#endif #define SCI_CONSOLE (&serial_console)
@@ -3253,8 +3256,10 @@ static int sci_probe(struct platform_device *dev)* the special early probe. We don't have sufficient device state * to make it beyond this yet. */ +#ifdef CONFIG_SUPERH if (is_early_platform_device (dev))return sci_probe_earlyprintk (dev); +#endif if (dev->dev.of_node) { p =sci_parse_dt (dev, &dev_id);
@@ -3351,7 +3356,7 @@ static void __exit sci_exit(void)uart_unregister_driver (&sci_uart_driver); } -#ifdef CONFIG_SERIAL_SH_SCI_CONSOLE +#if defined(CONFIG_SUPERH ) && defined(CONFIG_SERIAL_SH_SCI_CONSOLE )early_platform_init_buffer ("earlyprintk" , &sci_driver, early_serial_buf,ARRAY_SIZE (early_serial_buf));#endif
include/linux/platform_device.h +12 -52
74 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH RESEND v3 3/3 sh: add the sh_ prefix to early platform symbols
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Old early platform device support is now sh-specific. Before moving on to implementing new early platform framework based on real platform devices, prefix all early platform symbols with 'sh_'.
--- arch/sh/drivers/platform_early.c | 66 +++++++++++++------------- arch/sh/include/asm/platform_early.h | 30 ++++++------ arch/sh/kernel/cpu/sh2/setup-sh7619.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-mxg.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7705.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh770x.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7710.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7720.c | 2 +- arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 2 +- arch/sh/kernel/cpu/sh4/setup-sh7750.c | 8 ++-- arch/sh/kernel/cpu/sh4/setup-sh7760.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-shx3.c | 2 +- arch/sh/kernel/cpu/sh5/setup-sh5.c | 2 +- arch/sh/kernel/setup.c | 2 +- arch/sh/kernel/time.c | 4 +- drivers/clocksource/sh_cmt.c | 6 +-- drivers/clocksource/sh_mtu2.c | 6 +-- drivers/clocksource/sh_tmu.c | 6 +-- drivers/tty/serial/sh-sci.c | 4 +- include/linux/platform_device.h | 2 +- 37 files changed, 94 insertions(+), 94 deletions(-)
arch/sh/drivers/platform_early.c +33 -33
@@ -4,8 +4,8 @@#include <linux/mod_devicetable.h> #include <linux/pm.h> -static __initdata LIST_HEAD (early_platform_driver_list); -static __initdata LIST_HEAD (early_platform_device_list); +static __initdata LIST_HEAD (sh_early_platform_driver_list); +static __initdata LIST_HEAD (sh_early_platform_device_list);static const struct platform_device_id * platform_match_id(const struct platform_device_id *id,
@@ -58,13 +58,13 @@ static void pm_runtime_early_init(struct device *dev) {}#endif /** -* early_platform_driver_register - register early platform driver -* @epdrv: early_platform driver structure +* sh_early_platform_driver_register - register early platform driver +* @epdrv: sh_early_platform driver structure * @buf: string passed from early_param() * -* Helper function for early_platform_init() / early_platform_init_buffer() +* Helper function for sh_early_platform_init() / sh_early_platform_init_buffer() */ -int __init early_platform_driver_register (struct early_platform_driver *epdrv, +int __init sh_early_platform_driver_register (struct sh_early_platform_driver *epdrv,char *buf) {char *tmp;
@@ -75,7 +75,7 @@ int __init early_platform_driver_register(struct early_platform_driver *epdrv,*/ if (!epdrv->list.next) {INIT_LIST_HEAD (&epdrv->list); -list_add_tail (&epdrv->list, &early_platform_driver_list); +list_add_tail (&epdrv->list, &sh_early_platform_driver_list); }/* If the user has specified device then make sure the driver
@@ -84,7 +84,7 @@ int __init early_platform_driver_register(struct early_platform_driver *epdrv,*/ n =strlen (epdrv->pdrv->driver.name);if (buf && !strncmp (buf, epdrv->pdrv->driver.name, n)) { -list_move (&epdrv->list, &early_platform_driver_list); +list_move (&epdrv->list, &sh_early_platform_driver_list);/* Allow passing parameters after device name */ if (buf[n] =='\0' || buf[n] ==',' )
@@ -114,14 +114,14 @@ int __init early_platform_driver_register(struct early_platform_driver *epdrv, }/** -* early_platform_add_devices - adds a number of early platform devices +* sh_early_platform_add_devices - adds a number of early platform devices * @devs: array of early platform devices to add * @num: number of early platform devices in array * * Used by early architecture code to register early platform devices and * their platform data. */ -void __init early_platform_add_devices (struct platform_device **devs,int num) +void __init sh_early_platform_add_devices (struct platform_device **devs,int num) {struct device *dev;int i;
@@ -134,20 +134,20 @@ void __init early_platform_add_devices(struct platform_device **devs, int num)pm_runtime_early_init (dev);INIT_LIST_HEAD (&dev->devres_head);list_add_tail (&dev->devres_head, - &early_platform_device_list); + &sh_early_platform_device_list); } } }/** -* early_platform_driver_register_all - register early platform drivers +* sh_early_platform_driver_register_all - register early platform drivers * @class_str: string to identify early platform driver class * * Used by architecture code to register all early platform drivers * for a certain class. If omitted then only early platform drivers * with matching kernel command line class parameters will be registered. */ -void __init early_platform_driver_register_all (char *class_str) +void __init sh_early_platform_driver_register_all (char *class_str) {/* The "class_str" parameter may or may not be present on the kernel * command line. If it is present then there may be more than one
@@ -160,23 +160,23 @@ void __init early_platform_driver_register_all(char *class_str)* We use parse_early_options() to make sure the early_param() gets * called at least once. The early_param() may be called more than * once since the name of the preferred device may be specified on -* the kernel command line. early_platform_driver_register() handles +* the kernel command line. sh_early_platform_driver_register() handles * this case for us. */ parse_early_options (class_str); }/** -* early_platform_match - find early platform device matching driver +* sh_early_platform_match - find early platform device matching driver * @epdrv: early platform driver structure * @id: id to match against */ static struct platform_device *__init -early_platform_match (struct early_platform_driver *epdrv,int id) +sh_early_platform_match (struct sh_early_platform_driver *epdrv,int id) {struct platform_device *pd; -list_for_each_entry (pd, &early_platform_device_list, dev.devres_head) +list_for_each_entry (pd, &sh_early_platform_device_list, dev.devres_head)if (platform_match (&pd->dev, &epdrv->pdrv->driver))if (pd->id == id)return pd;
@@ -185,16 +185,16 @@ early_platform_match(struct early_platform_driver *epdrv, int id) }/** -* early_platform_left - check if early platform driver has matching devices +* sh_early_platform_left - check if early platform driver has matching devices * @epdrv: early platform driver structure * @id: return true if id or above exists */ -static int __init early_platform_left (struct early_platform_driver *epdrv, +static int __init sh_early_platform_left (struct sh_early_platform_driver *epdrv,int id) {struct platform_device *pd; -list_for_each_entry (pd, &early_platform_device_list, dev.devres_head) +list_for_each_entry (pd, &sh_early_platform_device_list, dev.devres_head)if (platform_match (&pd->dev, &epdrv->pdrv->driver))if (pd->id >= id)return 1 ;
@@ -203,22 +203,22 @@ static int __init early_platform_left(struct early_platform_driver *epdrv, }/** -* early_platform_driver_probe_id - probe drivers matching class_str and id +* sh_early_platform_driver_probe_id - probe drivers matching class_str and id * @class_str: string to identify early platform driver class * @id: id to match against * @nr_probe: number of platform devices to successfully probe before exiting */ -static int __init early_platform_driver_probe_id (char *class_str, +static int __init sh_early_platform_driver_probe_id (char *class_str,int id,int nr_probe) { -struct early_platform_driver *epdrv; +struct sh_early_platform_driver *epdrv;struct platform_device *match;int match_id;int n =0 ;int left =0 ; -list_for_each_entry (epdrv, &early_platform_driver_list, list) { +list_for_each_entry (epdrv, &sh_early_platform_driver_list, list) {/* only use drivers matching our class_str */ if (strcmp (class_str, epdrv->class_str))continue ;
@@ -229,7 +229,7 @@ static int __init early_platform_driver_probe_id(char *class_str, }else { match_id = id; - left +=early_platform_left (epdrv, id); + left +=sh_early_platform_left (epdrv, id);/* skip requested id */ switch (epdrv->requested_id) {
@@ -251,7 +251,7 @@ static int __init early_platform_driver_probe_id(char *class_str, match =NULL ;break ;default : - match =early_platform_match (epdrv, match_id); + match =sh_early_platform_match (epdrv, match_id); }if (match) {
@@ -293,7 +293,7 @@ static int __init early_platform_driver_probe_id(char *class_str, }/** -* early_platform_driver_probe - probe a class of registered drivers +* sh_early_platform_driver_probe - probe a class of registered drivers * @class_str: string to identify early platform driver class * @nr_probe: number of platform devices to successfully probe before exiting * @user_only: only probe user specified early platform devices
@@ -302,7 +302,7 @@ static int __init early_platform_driver_probe_id(char *class_str,* within a certain class. For probe to happen a registered early platform * device matching a registered early platform driver is needed. */ -int __init early_platform_driver_probe (char *class_str, +int __init sh_early_platform_driver_probe (char *class_str,int nr_probe,int user_only) {
@@ -310,7 +310,7 @@ int __init early_platform_driver_probe(char *class_str, n =0 ;for (i =-2 ; n < nr_probe; i++) { - k =early_platform_driver_probe_id (class_str, i, nr_probe - n); + k =sh_early_platform_driver_probe_id (class_str, i, nr_probe - n);if (k <0 )break ;
@@ -325,14 +325,14 @@ int __init early_platform_driver_probe(char *class_str, }/** -* early_platform_cleanup - clean up early platform code +* sh_early_platform_cleanup - clean up early platform code */ -static int __init early_platform_cleanup (void ) +static int __init sh_early_platform_cleanup (void ) {struct platform_device *pd, *pd2;/* clean up the devres list used to chain devices */ -list_for_each_entry_safe (pd, pd2, &early_platform_device_list, +list_for_each_entry_safe (pd, pd2, &sh_early_platform_device_list, dev.devres_head) {list_del (&pd->dev.devres_head);memset (&pd->dev.devres_head,0 ,sizeof (pd->dev.devres_head));
@@ -344,4 +344,4 @@ static int __init early_platform_cleanup(void)* This must happen once after all early devices are probed but before probing * real platform devices. */ -subsys_initcall (early_platform_cleanup); +subsys_initcall (sh_early_platform_cleanup);
arch/sh/include/asm/platform_early.h +15 -15
@@ -8,7 +8,7 @@#include <linux/pm_runtime.h> #include <linux/slab.h> -struct early_platform_driver { +struct sh_early_platform_driver {const char *class_str;struct platform_driver *pdrv;struct list_head list;
@@ -20,39 +20,39 @@ struct early_platform_driver {#define EARLY_PLATFORM_ID_UNSET -2#define EARLY_PLATFORM_ID_ERROR -3 -extern int early_platform_driver_register (struct early_platform_driver *epdrv, +extern int sh_early_platform_driver_register (struct sh_early_platform_driver *epdrv,char *buf); -extern void early_platform_add_devices (struct platform_device **devs,int num); +extern void sh_early_platform_add_devices (struct platform_device **devs,int num); -static inline int is_early_platform_device (struct platform_device *pdev) +static inline int is_sh_early_platform_device (struct platform_device *pdev) {return !pdev->dev.driver; } -extern void early_platform_driver_register_all (char *class_str); -extern int early_platform_driver_probe (char *class_str, +extern void sh_early_platform_driver_register_all (char *class_str); +extern int sh_early_platform_driver_probe (char *class_str,int nr_probe,int user_only); -#define early_platform_init (class_string, platdrv) \ - early_platform_init_buffer(class_string, platdrv, NULL, 0) +#define sh_early_platform_init (class_string, platdrv) \ + sh_early_platform_init_buffer(class_string, platdrv, NULL, 0)#ifndef MODULE -#define early_platform_init_buffer (class_string, platdrv, buf, bufsiz) \ -static __initdata struct early_platform_driver early_driver = { \ +#define sh_early_platform_init_buffer (class_string, platdrv, buf, bufsiz) \ +static __initdata struct sh_early_platform_driver early_driver = { \ .class_str = class_string, \ .buffer = buf, \ .bufsize = bufsiz, \ .pdrv = platdrv, \ .requested_id = EARLY_PLATFORM_ID_UNSET, \ }; \ -static int __init early_platform_driver_setup_func(char *buffer) \ +static int __init sh_early_platform_driver_setup_func(char *buffer) \ { \ - return early_platform_driver_register(&early_driver, buffer); \ + return sh_early_platform_driver_register(&early_driver, buffer); \ } \ -early_param(class_string, early_platform_driver_setup_func) +early_param(class_string, sh_early_platform_driver_setup_func)#else /* MODULE */ -#define early_platform_init_buffer (class_string, platdrv, buf, bufsiz) \ -static inline char *early_platform_driver_setup_func(void) \ +#define sh_early_platform_init_buffer (class_string, platdrv, buf, bufsiz) \ +static inline char *sh_early_platform_driver_setup_func(void) \ { \ return bufsiz ? buf : NULL; \ }
arch/sh/kernel/cpu/sh2/setup-sh7619.c +1 -1
@@ -203,6 +203,6 @@ void __init plat_early_device_setup(void)/* enable CMT clock */ __raw_writeb (__raw_readb (STBCR3 ) & ~0x10 ,STBCR3 ); -early_platform_add_devices (sh7619_early_devices, +sh_early_platform_add_devices (sh7619_early_devices,ARRAY_SIZE (sh7619_early_devices)); }
arch/sh/kernel/cpu/sh2a/setup-mxg.c +1 -1
@@ -173,6 +173,6 @@ static struct platform_device *mxg_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (mxg_early_devices, +sh_early_platform_add_devices (mxg_early_devices,ARRAY_SIZE (mxg_early_devices)); }
arch/sh/kernel/cpu/sh2a/setup-sh7201.c +1 -1
@@ -416,6 +416,6 @@ void __init plat_early_device_setup(void)/* enable MTU2 clock */ __raw_writeb (__raw_readb (STBCR3 ) & ~0x20 ,STBCR3 ); -early_platform_add_devices (sh7201_early_devices, +sh_early_platform_add_devices (sh7201_early_devices,ARRAY_SIZE (sh7201_early_devices)); }
arch/sh/kernel/cpu/sh2a/setup-sh7203.c +1 -1
@@ -353,6 +353,6 @@ void __init plat_early_device_setup(void)/* enable MTU2 clock */ __raw_writeb (__raw_readb (STBCR3 ) & ~0x20 ,STBCR3 ); -early_platform_add_devices (sh7203_early_devices, +sh_early_platform_add_devices (sh7203_early_devices,ARRAY_SIZE (sh7203_early_devices)); }
arch/sh/kernel/cpu/sh2a/setup-sh7206.c +1 -1
@@ -289,6 +289,6 @@ void __init plat_early_device_setup(void)/* enable MTU2 clock */ __raw_writeb (__raw_readb (STBCR3 ) & ~0x20 ,STBCR3 ); -early_platform_add_devices (sh7206_early_devices, +sh_early_platform_add_devices (sh7206_early_devices,ARRAY_SIZE (sh7206_early_devices)); }
arch/sh/kernel/cpu/sh2a/setup-sh7264.c +1 -1
@@ -550,6 +550,6 @@ static struct platform_device *sh7264_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7264_early_devices, +sh_early_platform_add_devices (sh7264_early_devices,ARRAY_SIZE (sh7264_early_devices)); }
arch/sh/kernel/cpu/sh2a/setup-sh7269.c +1 -1
@@ -566,6 +566,6 @@ static struct platform_device *sh7269_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7269_early_devices, +sh_early_platform_add_devices (sh7269_early_devices,ARRAY_SIZE (sh7269_early_devices)); }
arch/sh/kernel/cpu/sh3/setup-sh7705.c +1 -1
@@ -182,7 +182,7 @@ static struct platform_device *sh7705_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7705_early_devices, +sh_early_platform_add_devices (sh7705_early_devices,ARRAY_SIZE (sh7705_early_devices)); }
arch/sh/kernel/cpu/sh3/setup-sh770x.c +1 -1
@@ -234,7 +234,7 @@ static struct platform_device *sh770x_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh770x_early_devices, +sh_early_platform_add_devices (sh770x_early_devices,ARRAY_SIZE (sh770x_early_devices)); }
arch/sh/kernel/cpu/sh3/setup-sh7710.c +1 -1
@@ -181,7 +181,7 @@ static struct platform_device *sh7710_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7710_early_devices, +sh_early_platform_add_devices (sh7710_early_devices,ARRAY_SIZE (sh7710_early_devices)); }
arch/sh/kernel/cpu/sh3/setup-sh7720.c +1 -1
@@ -215,7 +215,7 @@ static struct platform_device *sh7720_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7720_early_devices, +sh_early_platform_add_devices (sh7720_early_devices,ARRAY_SIZE (sh7720_early_devices)); }
arch/sh/kernel/cpu/sh4/setup-sh4-202.c +1 -1
@@ -80,7 +80,7 @@ static struct platform_device *sh4202_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh4202_early_devices, +sh_early_platform_add_devices (sh4202_early_devices,ARRAY_SIZE (sh4202_early_devices)); }
arch/sh/kernel/cpu/sh4/setup-sh7750.c +4 -4
@@ -165,15 +165,15 @@ void __init plat_early_device_setup(void)if (mach_is_rts7751r2d ()) { scif_platform_data.scscr |=SCSCR_CKE1 ; dev[0 ] = &scif_device; -early_platform_add_devices (dev,1 ); +sh_early_platform_add_devices (dev,1 ); }else { dev[0 ] = &sci_device; -early_platform_add_devices (dev,1 ); +sh_early_platform_add_devices (dev,1 ); dev[0 ] = &scif_device; -early_platform_add_devices (dev,1 ); +sh_early_platform_add_devices (dev,1 ); } -early_platform_add_devices (sh7750_early_devices, +sh_early_platform_add_devices (sh7750_early_devices,ARRAY_SIZE (sh7750_early_devices)); }
arch/sh/kernel/cpu/sh4/setup-sh7760.c +1 -1
@@ -275,7 +275,7 @@ static struct platform_device *sh7760_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7760_early_devices, +sh_early_platform_add_devices (sh7760_early_devices,ARRAY_SIZE (sh7760_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7343.c +1 -1
@@ -300,7 +300,7 @@ static struct platform_device *sh7343_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7343_early_devices, +sh_early_platform_add_devices (sh7343_early_devices,ARRAY_SIZE (sh7343_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7366.c +1 -1
@@ -244,7 +244,7 @@ static struct platform_device *sh7366_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7366_early_devices, +sh_early_platform_add_devices (sh7366_early_devices,ARRAY_SIZE (sh7366_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7722.c +1 -1
@@ -516,7 +516,7 @@ static struct platform_device *sh7722_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7722_early_devices, +sh_early_platform_add_devices (sh7722_early_devices,ARRAY_SIZE (sh7722_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7723.c +1 -1
@@ -414,7 +414,7 @@ static struct platform_device *sh7723_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7723_early_devices, +sh_early_platform_add_devices (sh7723_early_devices,ARRAY_SIZE (sh7723_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7724.c +1 -1
@@ -834,7 +834,7 @@ static struct platform_device *sh7724_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7724_early_devices, +sh_early_platform_add_devices (sh7724_early_devices,ARRAY_SIZE (sh7724_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7734.c +1 -1
@@ -284,7 +284,7 @@ static struct platform_device *sh7734_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7734_early_devices, +sh_early_platform_add_devices (sh7734_early_devices,ARRAY_SIZE (sh7734_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7757.c +1 -1
@@ -771,7 +771,7 @@ static struct platform_device *sh7757_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7757_early_devices, +sh_early_platform_add_devices (sh7757_early_devices,ARRAY_SIZE (sh7757_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7763.c +1 -1
@@ -225,7 +225,7 @@ static struct platform_device *sh7763_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7763_early_devices, +sh_early_platform_add_devices (sh7763_early_devices,ARRAY_SIZE (sh7763_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7770.c +1 -1
@@ -320,7 +320,7 @@ static struct platform_device *sh7770_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7770_early_devices, +sh_early_platform_add_devices (sh7770_early_devices,ARRAY_SIZE (sh7770_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7780.c +1 -1
@@ -289,7 +289,7 @@ void __init plat_early_device_setup(void) scif1_platform_data.scscr &= ~SCSCR_CKE1 ; } -early_platform_add_devices (sh7780_early_devices, +sh_early_platform_add_devices (sh7780_early_devices,ARRAY_SIZE (sh7780_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7785.c +1 -1
@@ -357,7 +357,7 @@ static struct platform_device *sh7785_early_devices[] __initdata = {void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7785_early_devices, +sh_early_platform_add_devices (sh7785_early_devices,ARRAY_SIZE (sh7785_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-sh7786.c +1 -1
@@ -838,6 +838,6 @@ arch_initcall(sh7786_devices_setup);void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh7786_early_devices, +sh_early_platform_add_devices (sh7786_early_devices,ARRAY_SIZE (sh7786_early_devices)); }
arch/sh/kernel/cpu/sh4a/setup-shx3.c +1 -1
@@ -156,7 +156,7 @@ arch_initcall(shx3_devices_setup);void __init plat_early_device_setup (void ) { -early_platform_add_devices (shx3_early_devices, +sh_early_platform_add_devices (shx3_early_devices,ARRAY_SIZE (shx3_early_devices)); }
arch/sh/kernel/cpu/sh5/setup-sh5.c +1 -1
@@ -119,6 +119,6 @@ arch_initcall(sh5_devices_setup);void __init plat_early_device_setup (void ) { -early_platform_add_devices (sh5_early_devices, +sh_early_platform_add_devices (sh5_early_devices,ARRAY_SIZE (sh5_early_devices)); }
arch/sh/kernel/setup.c +1 -1
@@ -328,7 +328,7 @@ void __init setup_arch(char **cmdline_p)sh_mv_setup ();/* Let earlyprintk output early console messages */ -early_platform_driver_probe ("earlyprintk" ,1 ,1 ); +sh_early_platform_driver_probe ("earlyprintk" ,1 ,1 );#ifdef CONFIG_OF_FLATTREE #ifdef CONFIG_USE_BUILTIN_DTB
arch/sh/kernel/time.c +2 -2
@@ -105,8 +105,8 @@ static void __init sh_late_time_init(void)* clocksource and the jiffies clocksource is used transparently * instead. No error handling is necessary here. */ -early_platform_driver_register_all ("earlytimer" ); -early_platform_driver_probe ("earlytimer" ,2 ,0 ); +sh_early_platform_driver_register_all ("earlytimer" ); +sh_early_platform_driver_probe ("earlytimer" ,2 ,0 ); }void __init time_init (void )
drivers/clocksource/sh_cmt.c +3 -3
@@ -1047,7 +1047,7 @@ static int sh_cmt_probe(struct platform_device *pdev)struct sh_cmt_device *cmt =platform_get_drvdata (pdev);int ret; -if (!is_early_platform_device (pdev)) { +if (!is_sh_early_platform_device (pdev)) {pm_runtime_set_active (&pdev->dev);pm_runtime_enable (&pdev->dev); }
@@ -1067,7 +1067,7 @@ static int sh_cmt_probe(struct platform_device *pdev)pm_runtime_idle (&pdev->dev);return ret; } -if (is_early_platform_device (pdev)) +if (is_sh_early_platform_device (pdev))return 0 ; out:
@@ -1105,7 +1105,7 @@ static void __exit sh_cmt_exit(void) }#ifdef CONFIG_SUPERH -early_platform_init ("earlytimer" , &sh_cmt_device_driver); +sh_early_platform_init ("earlytimer" , &sh_cmt_device_driver);#endif subsys_initcall (sh_cmt_init);
drivers/clocksource/sh_mtu2.c +3 -3
@@ -454,7 +454,7 @@ static int sh_mtu2_probe(struct platform_device *pdev)struct sh_mtu2_device *mtu =platform_get_drvdata (pdev);int ret; -if (!is_early_platform_device (pdev)) { +if (!is_sh_early_platform_device (pdev)) {pm_runtime_set_active (&pdev->dev);pm_runtime_enable (&pdev->dev); }
@@ -474,7 +474,7 @@ static int sh_mtu2_probe(struct platform_device *pdev)pm_runtime_idle (&pdev->dev);return ret; } -if (is_early_platform_device (pdev)) +if (is_sh_early_platform_device (pdev))return 0 ; out:
@@ -524,7 +524,7 @@ static void __exit sh_mtu2_exit(void) }#ifdef CONFIG_SUPERH -early_platform_init ("earlytimer" , &sh_mtu2_device_driver); +sh_early_platform_init ("earlytimer" , &sh_mtu2_device_driver);#endif subsys_initcall (sh_mtu2_init);
drivers/clocksource/sh_tmu.c +3 -3
@@ -610,7 +610,7 @@ static int sh_tmu_probe(struct platform_device *pdev)struct sh_tmu_device *tmu =platform_get_drvdata (pdev);int ret; -if (!is_early_platform_device (pdev)) { +if (!is_sh_early_platform_device (pdev)) {pm_runtime_set_active (&pdev->dev);pm_runtime_enable (&pdev->dev); }
@@ -631,7 +631,7 @@ static int sh_tmu_probe(struct platform_device *pdev)return ret; } -if (is_early_platform_device (pdev)) +if (is_sh_early_platform_device (pdev))return 0 ; out:
@@ -682,7 +682,7 @@ static void __exit sh_tmu_exit(void) }#ifdef CONFIG_SUPERH -early_platform_init ("earlytimer" , &sh_tmu_device_driver); +sh_early_platform_init ("earlytimer" , &sh_tmu_device_driver);#endif subsys_initcall (sh_tmu_init);
drivers/tty/serial/sh-sci.c +2 -2
@@ -3257,7 +3257,7 @@ static int sci_probe(struct platform_device *dev)* to make it beyond this yet. */ #ifdef CONFIG_SUPERH -if (is_early_platform_device (dev)) +if (is_sh_early_platform_device (dev))return sci_probe_earlyprintk (dev);#endif
@@ -3357,7 +3357,7 @@ static void __exit sci_exit(void) }#if defined(CONFIG_SUPERH ) && defined(CONFIG_SERIAL_SH_SCI_CONSOLE ) -early_platform_init_buffer ("earlyprintk" , &sci_driver, +sh_early_platform_init_buffer ("earlyprintk" , &sci_driver, early_serial_buf,ARRAY_SIZE (early_serial_buf));#endif #ifdef CONFIG_SERIAL_SH_SCI_EARLYCON
include/linux/platform_device.h +1 -1
@@ -324,7 +324,7 @@ extern int platform_dma_configure(struct device *dev);* drivers. It should go away once we introduce the new platform_device-based * early driver framework. */ -static inline int is_early_platform_device (struct platform_device *pdev) +static inline int is_sh_early_platform_device (struct platform_device *pdev) {return 0 ; }
Signature · 1 line
2.18.0
Re: [RESEND PATCH v3 3/3] sh: add the sh_ prefix to early platform symbols
Hi Bartosz,
Quoted 53 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Old early platform device support is now sh-specific. Before moving on to implementing new early platform framework based on real platform devices, prefix all early platform symbols with '
sh_'.Signed-off-by Bartosz Golaszewski <[email protected]>--- arch/sh/drivers/platform_early.c | 66 +++++++++++++------------- arch/sh/include/asm/platform_early.h | 30 ++++++------ arch/sh/kernel/cpu/sh2/setup-sh7619.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-mxg.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7705.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh770x.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7710.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7720.c | 2 +- arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 2 +- arch/sh/kernel/cpu/sh4/setup-sh7750.c | 8 ++-- arch/sh/kernel/cpu/sh4/setup-sh7760.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-shx3.c | 2 +- arch/sh/kernel/cpu/sh5/setup-sh5.c | 2 +- arch/sh/kernel/setup.c | 2 +- arch/sh/kernel/time.c | 4 +- drivers/clocksource/sh_cmt.c | 6 +-- drivers/clocksource/sh_mtu2.c | 6 +-- drivers/clocksource/sh_tmu.c | 6 +-- drivers/tty/serial/sh-sci.c | 4 +- include/linux/platform_device.h | 2 +- 37 files changed, 94 insertions(+), 94 deletions(-)arch/sh/drivers/platform_early.c +0
-0
arch/sh/drivers/platform_early.c line 8
Quoted 7 lines
arch/sh/drivers/platform_early.c +2
-2@@ -4,8 +4,8 @@#include <linux/mod_devicetable.h> #include <linux/pm.h> -static __initdata LIST_HEAD (early_platform_driver_list); -static __initdata LIST_HEAD (early_platform_device_list); +static __initdata LIST_HEAD (sh_early_platform_driver_list); +static __initdata LIST_HEAD (sh_early_platform_device_list);
As discussed offline at ELC, I don't think this patch is useful at this stage, and in the context of this particular series. I believe it should be dropped and only the first two patches should be merged. If the SH maintainer is not responsive, then maybe Greg could take them as they remove cruft from core code.
As for the whole "early device" debate, my take is that we'd be much better off making the device model available early, rather than trying to architect something that is simply papering over the issue.
Thanks,
M.
Signature · 1 line
Jazz is not dead, it just smell funny.
Re: [RESEND PATCH v3 3/3] sh: add the sh_ prefix to early platform symbols
Hi Marc,
Quoted 5 lines · Marc Zyngier
On Mon, 27 Aug 2018 10:06:51 +0100,
Bartosz Golaszewski <[email protected]> wrote:
As for the whole "early device" debate, my take is that we'd be much better off making the device model available early, rather than trying to architect something that is simply papering over the issue.
The device model itself can be made available earlier, but the big blocker is mainly the use of everything related to the scheduler (threads, msleep()), which depends on the "early" timer.
I think it can be made to work if msleep() and all thread-related functions would return -EPROBE_DEFER, but that should be handled in every single driver, which may be already the case for thread-related functions, but not for e.g. msleep(), which currently returns void.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [RESEND PATCH v3 3/3] sh: add the sh_ prefix to early platform symbols
Hi Geert,
Quoted 10 lines · Geert Uytterhoeven
Hi Marc,
Quoted 5 lines · Marc Zyngier
On Mon, 27 Aug 2018 10:06:51 +0100,
Bartosz Golaszewski <[email protected]> wrote:
As for the whole "early device" debate, my take is that we'd be much better off making the device model available early, rather than trying to architect something that is simply papering over the issue.
Quoted 3 lines
The device model itself can be made available earlier, but the big blocker is mainly the use of everything related to the scheduler (threads,
msleep()), which depends on the "early" timer.
I agree this is an annoying dependency, as I've myself been down that particular rabbit hole... ;-)
Quoted 5 lines
I think it can be made to work if
msleep()and all thread-related functions would return -EPROBE_DEFER, but that should be handled in every single driver, which may be already the case for thread-related functions, but not for e.g.msleep(), which currently returns void.
That would be massively invasive...
One way of solving this would be to make the device model available early, but then preserve the ordering required by other subsystems such as the scheduler: interrupts, timers and clocks have to be available first, as they are basically at the root of all dependencies.
This is a different kind of "early" though, as having the device model early means all its functionalities are available early, and that includes being able to allocate DMA buffers, which some interrupt controllers require. The current proposal doesn't help with DMA, and still leaves these devices in a state where drivers have to reinvent their own square wheel.
Thanks,
M.
Signature · 1 line
Jazz is not dead, it just smell funny.
2018-08-27 11:06 GMT+02:00 Bartosz Golaszewski <[email protected]>:
Quoted 86 lines
I recently started a discussion about the need for a proper early device probing mechanism[1]. One that would be based on real platform drivers and support both platform data and device tree.
While we're far from reaching any consensus on the implementation, Arnd suggested that I start off by moving the SuperH-specific early platform drivers implementation to arch/sh[2].
This series is the first attempt at making way for a new, less hacky implementation.
The first patch removes the last instance of a non-sh driver using the
early_platformAPI. It can be removed since ARM no longer probes early drivers.The second patch moves all the
early_platformcode toarch/sh.The last patch prefixes all
early_platformsymbols with 'sh_'.[1] https://lkml.org/lkml/2018/4/26/657
[2] https://lkml.org/lkml/2018/4/27/239v1 -> v2:
- certain drivers are compiled for arm/mach-shmobile too - we need to add ifdefs forCONFIG_SUPERHaroundearly_platformcallsv2 -> v3:
- added a stub foris_early_platform_device()which always returns false on non-SuperH architecturesRESEND: rebased on top of v4.18-rc1 and verified that there are no build failures.
RESEND AGAIN: rebased on top of v4.19-rc1 and verified builds again.
Bartosz Golaszewski (3):
clocksource: timer-ti-dm: remove the early platform driver
registration
platform: move the early platform device support toarch/sh
sh: add thesh_prefix to early platform symbolsarch/sh/drivers/Makefile | 2 +- arch/sh/drivers/platform_early.c | 347 +++++++++++++++++++++++++ arch/sh/include/asm/platform_early.h | 61 +++++ arch/sh/kernel/cpu/sh2/setup-sh7619.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-mxg.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 3 +- arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 3 +- arch/sh/kernel/cpu/sh3/setup-sh3.c | 1 + arch/sh/kernel/cpu/sh3/setup-sh7705.c | 3 +- arch/sh/kernel/cpu/sh3/setup-sh770x.c | 3 +- arch/sh/kernel/cpu/sh3/setup-sh7710.c | 3 +- arch/sh/kernel/cpu/sh3/setup-sh7720.c | 3 +- arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 3 +- arch/sh/kernel/cpu/sh4/setup-sh7750.c | 9 +- arch/sh/kernel/cpu/sh4/setup-sh7760.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 3 +- arch/sh/kernel/cpu/sh4a/setup-shx3.c | 3 +- arch/sh/kernel/cpu/sh5/setup-sh5.c | 3 +- arch/sh/kernel/setup.c | 3 +- arch/sh/kernel/time.c | 5 +- drivers/base/platform.c | 288 -------------------- drivers/clocksource/sh_cmt.c | 13 +- drivers/clocksource/sh_mtu2.c | 13 +- drivers/clocksource/sh_tmu.c | 14 +- drivers/clocksource/timer-ti-dm.c | 1 - drivers/tty/serial/sh-sci.c | 11 +- include/linux/platform_device.h | 64 +---- 41 files changed, 525 insertions(+), 388 deletions(-) create mode 100644 arch/sh/drivers/platform_early.c create mode 100644 arch/sh/include/asm/platform_early.h
Quoted 3 lines
--
2.18.0
Ping for 4.20. This is the third release cycle I'm trying to get this merged and there never were any objections.
Bart
On 20/09/2018 15:00, Bartosz Golaszewski wrote:
[ ... ]
Quoted 2 lines
Ping for 4.20. This is the third release cycle I'm trying to get this merged and there never were any objections.
Thanks for the heads up, it is in the pipe.
-- Daniel
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
2018-09-20 18:09 GMT+02:00 Daniel Lezcano <[email protected]>:
Quoted 9 lines · Bartosz Golaszewski
[ ... ]
Quoted 2 lines
Ping for 4.20. This is the third release cycle I'm trying to get this merged and there never were any objections.
Thanks for the heads up, it is in the pipe.
I guess you mean only the clocksource patch?
Bart
Quoted 5 lines · Bartosz Golaszewski
2018-09-20 18:09 GMT+02:00 Daniel Lezcano <[email protected]>:
Quoted 4 lines · Bartosz Golaszewski
[ ... ]
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Ping for 4.20. This is the third release cycle I'm trying to get this merged and there never were any objections.
Thanks for the heads up, it is in the pipe.
I guess you mean only the clocksource patch?
I meant it is in the pipe of things to review :)
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
czw., 20 wrz 2018 o 18:48 Daniel Lezcano <[email protected]> napisał(a):
Quoted 19 lines · Bartosz Golaszewski
Quoted 5 lines
2018-09-20 18:09 GMT+02:00 Daniel Lezcano <[email protected]>:
Quoted 4 lines · Bartosz Golaszewski
[ ... ]
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Ping for 4.20. This is the third release cycle I'm trying to get this merged and there never were any objections.
Thanks for the heads up, it is in the pipe.
I guess you mean only the clocksource patch?
I meant it is in the pipe of things to review :)
Quoted 7 lines
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCsFollow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Last hopefull ping for v4.20...
Bart