Skip to contentSkip to conversation

arch/arm/mach-* late_initcall cleanup

PATCH New Shawn Guo 14 participants 53 messages Apr 26, 2012 – May 2, 2012

Subsystems (15)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

cover arch/arm/mach-* late_initcall cleanup

This series tries to clean up those late_initcall in arch/arm/mach-*, which will be a blocker for single kernel build for multiple platforms. Even on single platform, for example imx, where we already have single kernel image for imx3, imx5 and imx6 families, late_initcall does not scale. We have to detect soc type in the late_initcall to do soc sepcific late initialization.

The first patch provides a machine specific late_initcall time hook, and the rest of the series converts the existing late_initcall in arch/arm/mach-* to use that hook. It touches a lot of board files, which makes me image how the world would be beatiful if some day all these great number of board files get killed by DT support.

With this series, there are still a couple of late_initcall remaining in arch/arm/mach-*, but those are used to register platform driver, which are not the case concerning us here.

Regards,
Shawn

---
Shawn Guo (17):
ARM: provide a late_initcall hook for platform initialization
ARM: at91: use machine specific hook for late init
ARM: davinci: use machine specific hook for late init
ARM: ep93xx: use machine specific hook for late init
ARM: exynos: use machine specific hook for late init
ARM: imx: use machine specific hook for late init
ARM: kirkwood: use machine specific hook for late init
ARM: msm: use machine specific hook for late init
ARM: omap1: use machine specific hook for late init
ARM: omap2: use machine specific hook for late init
ARM: pnx4008: use machine specific hook for late init
ARM: prima2: use machine specific hook for late init
ARM: s3c64xx: use machine specific hook for late init
ARM: sa1100: use machine specific hook for late init
ARM: shmobile: use machine specific hook for late init
ARM: tegra: use machine specific hook for late init
ARM: ux500: use machine specific hook for late init

 arch/arm/include/asm/mach/arch.h               |    1 +
 arch/arm/kernel/setup.c                        |    8 +++
 arch/arm/mach-at91/board-1arm.c                |    1 +
 arch/arm/mach-at91/board-afeb-9260v1.c         |    1 +
 arch/arm/mach-at91/board-cam60.c               |    1 +
 arch/arm/mach-at91/board-carmeva.c             |    1 +
 arch/arm/mach-at91/board-cpu9krea.c            |    1 +
 arch/arm/mach-at91/board-cpuat91.c             |    1 +
 arch/arm/mach-at91/board-csb337.c              |    1 +
 arch/arm/mach-at91/board-csb637.c              |    1 +
 arch/arm/mach-at91/board-dt.c                  |    1 +
 arch/arm/mach-at91/board-eb01.c                |    1 +
 arch/arm/mach-at91/board-eb9200.c              |    1 +
 arch/arm/mach-at91/board-ecbat91.c             |    1 +
 arch/arm/mach-at91/board-eco920.c              |    1 +
 arch/arm/mach-at91/board-flexibity.c           |    1 +
 arch/arm/mach-at91/board-foxg20.c              |    1 +
 arch/arm/mach-at91/board-gsia18s.c             |    1 +
 arch/arm/mach-at91/board-kafa.c                |    1 +
 arch/arm/mach-at91/board-kb9202.c              |    1 +
 arch/arm/mach-at91/board-neocore926.c          |    1 +
 arch/arm/mach-at91/board-pcontrol-g20.c        |    1 +
 arch/arm/mach-at91/board-picotux200.c          |    1 +
 arch/arm/mach-at91/board-qil-a9260.c           |    1 +
 arch/arm/mach-at91/board-rm9200dk.c            |    1 +
 arch/arm/mach-at91/board-rm9200ek.c            |    1 +
 arch/arm/mach-at91/board-rsi-ews.c             |    1 +
 arch/arm/mach-at91/board-sam9-l9260.c          |    1 +
 arch/arm/mach-at91/board-sam9260ek.c           |    1 +
 arch/arm/mach-at91/board-sam9261ek.c           |    1 +
 arch/arm/mach-at91/board-sam9263ek.c           |    1 +
 arch/arm/mach-at91/board-sam9g20ek.c           |    1 +
 arch/arm/mach-at91/board-sam9m10g45ek.c        |    1 +
 arch/arm/mach-at91/board-sam9rlek.c            |    1 +
 arch/arm/mach-at91/board-snapper9260.c         |    1 +
 arch/arm/mach-at91/board-stamp9g20.c           |    1 +
 arch/arm/mach-at91/board-usb-a926x.c           |    1 +
 arch/arm/mach-at91/board-yl-9200.c             |    1 +
 arch/arm/mach-at91/clock.c                     |    3 +-
 arch/arm/mach-at91/generic.h                   |    5 ++
 arch/arm/mach-at91/setup.c                     |    5 ++
 arch/arm/mach-davinci/board-da830-evm.c        |    1 +
 arch/arm/mach-davinci/board-da850-evm.c        |    1 +
 arch/arm/mach-davinci/board-dm355-evm.c        |    1 +
 arch/arm/mach-davinci/board-dm355-leopard.c    |    1 +
 arch/arm/mach-davinci/board-dm365-evm.c        |    1 +
 arch/arm/mach-davinci/board-dm644x-evm.c       |    1 +
 arch/arm/mach-davinci/board-dm646x-evm.c       |    1 +
 arch/arm/mach-davinci/board-mityomapl138.c     |    1 +
 arch/arm/mach-davinci/board-neuros-osd2.c      |    1 +
 arch/arm/mach-davinci/board-omapl138-hawk.c    |    1 +
 arch/arm/mach-davinci/board-sffsdr.c           |    1 +
 arch/arm/mach-davinci/board-tnetv107x-evm.c    |    1 +
 arch/arm/mach-davinci/clock.c                  |    3 +-
 arch/arm/mach-davinci/common.c                 |    7 +++
 arch/arm/mach-davinci/cpufreq.c                |    3 +-
 arch/arm/mach-davinci/include/mach/common.h    |   19 +++++++
 arch/arm/mach-davinci/pm.c                     |    3 +-
 arch/arm/mach-ep93xx/adssphere.c               |    1 +
 arch/arm/mach-ep93xx/core.c                    |    5 ++
 arch/arm/mach-ep93xx/crunch.c                  |    4 +-
 arch/arm/mach-ep93xx/gesbc9312.c               |    1 +
 arch/arm/mach-ep93xx/include/mach/platform.h   |    7 +++
 arch/arm/mach-ep93xx/micro9.c                  |    4 ++
 arch/arm/mach-ep93xx/simone.c                  |    1 +
 arch/arm/mach-ep93xx/snappercl15.c             |    1 +
 arch/arm/mach-ep93xx/ts72xx.c                  |    1 +
 arch/arm/mach-ep93xx/vision_ep9307.c           |    1 +
 arch/arm/mach-exynos/common.c                  |    5 ++
 arch/arm/mach-exynos/common.h                  |    7 +++
 arch/arm/mach-exynos/mach-armlex4210.c         |    1 +
 arch/arm/mach-exynos/mach-exynos4-dt.c         |    1 +
 arch/arm/mach-exynos/mach-exynos5-dt.c         |    1 +
 arch/arm/mach-exynos/mach-nuri.c               |    1 +
 arch/arm/mach-exynos/mach-origen.c             |    1 +
 arch/arm/mach-exynos/mach-smdk4x12.c           |    1 +
 arch/arm/mach-exynos/mach-smdkv310.c           |    1 +
 arch/arm/mach-exynos/mach-universal_c210.c     |    1 +
 arch/arm/mach-exynos/pm_domains.c              |    3 +-
 arch/arm/mach-imx/cpu-imx5.c                   |    6 +--
 arch/arm/mach-imx/imx51-dt.c                   |    1 +
 arch/arm/mach-imx/mach-cpuimx51.c              |    1 +
 arch/arm/mach-imx/mach-cpuimx51sd.c            |    1 +
 arch/arm/mach-imx/mach-mx51_3ds.c              |    1 +
 arch/arm/mach-imx/mach-mx51_babbage.c          |    1 +
 arch/arm/mach-imx/mach-mx51_efikamx.c          |   42 +++++++++-------
 arch/arm/mach-imx/mach-mx51_efikasb.c          |   28 ++++++-----
 arch/arm/mach-imx/mach-pcm037.c                |    6 ++
 arch/arm/mach-imx/mach-pcm037_eet.c            |    6 +--
 arch/arm/mach-imx/mm-imx5.c                    |    5 ++
 arch/arm/mach-imx/pcm037.h                     |    6 ++
 arch/arm/mach-kirkwood/board-dt.c              |    1 +
 arch/arm/mach-kirkwood/common.c                |    6 ++-
 arch/arm/mach-kirkwood/common.h                |    1 +
 arch/arm/mach-kirkwood/d2net_v2-setup.c        |    1 +
 arch/arm/mach-kirkwood/db88f6281-bp-setup.c    |    1 +
 arch/arm/mach-kirkwood/dockstar-setup.c        |    1 +
 arch/arm/mach-kirkwood/guruplug-setup.c        |    1 +
 arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c |    1 +
 arch/arm/mach-kirkwood/netspace_v2-setup.c     |    3 +
 arch/arm/mach-kirkwood/netxbig_v2-setup.c      |    2 +
 arch/arm/mach-kirkwood/openrd-setup.c          |    3 +
 arch/arm/mach-kirkwood/rd88f6192-nas-setup.c   |    1 +
 arch/arm/mach-kirkwood/rd88f6281-setup.c       |    1 +
 arch/arm/mach-kirkwood/sheevaplug-setup.c      |    2 +
 arch/arm/mach-kirkwood/t5325-setup.c           |    1 +
 arch/arm/mach-kirkwood/ts219-setup.c           |    1 +
 arch/arm/mach-kirkwood/ts41x-setup.c           |    1 +
 arch/arm/mach-msm/board-halibut.c              |    7 +++
 arch/arm/mach-msm/board-mahimahi.c             |    7 +++
 arch/arm/mach-msm/board-msm7x27.c              |   10 ++++
 arch/arm/mach-msm/board-msm7x30.c              |    9 +++
 arch/arm/mach-msm/board-msm8960.c              |    8 +++
 arch/arm/mach-msm/board-msm8x60.c              |   11 ++++
 arch/arm/mach-msm/board-qsd8x50.c              |    8 +++
 arch/arm/mach-msm/board-sapphire.c             |    7 +++
 arch/arm/mach-msm/board-trout.c                |    7 +++
 arch/arm/mach-msm/clock.c                      |    4 +-
 arch/arm/mach-msm/include/mach/board.h         |    7 +++
 arch/arm/mach-msm/smd_debug.c                  |    3 +-
 arch/arm/mach-omap1/board-ams-delta.c          |    8 +++-
 arch/arm/mach-omap1/board-fsample.c            |    1 +
 arch/arm/mach-omap1/board-generic.c            |    1 +
 arch/arm/mach-omap1/board-h2.c                 |    1 +
 arch/arm/mach-omap1/board-h3.c                 |    1 +
 arch/arm/mach-omap1/board-htcherald.c          |    1 +
 arch/arm/mach-omap1/board-innovator.c          |    1 +
 arch/arm/mach-omap1/board-nokia770.c           |    1 +
 arch/arm/mach-omap1/board-osk.c                |    1 +
 arch/arm/mach-omap1/board-palmte.c             |    1 +
 arch/arm/mach-omap1/board-palmtt.c             |    1 +
 arch/arm/mach-omap1/board-palmz71.c            |    1 +
 arch/arm/mach-omap1/board-perseus2.c           |    1 +
 arch/arm/mach-omap1/board-sx1.c                |    1 +
 arch/arm/mach-omap1/board-voiceblue.c          |    1 +
 arch/arm/mach-omap1/common.h                   |   10 ++++
 arch/arm/mach-omap1/io.c                       |    5 ++
 arch/arm/mach-omap1/serial.c                   |    3 +-
 arch/arm/mach-omap2/board-2430sdp.c            |    1 +
 arch/arm/mach-omap2/board-3430sdp.c            |    1 +
 arch/arm/mach-omap2/board-3630sdp.c            |    1 +
 arch/arm/mach-omap2/board-4430sdp.c            |    1 +
 arch/arm/mach-omap2/board-am3517crane.c        |    1 +
 arch/arm/mach-omap2/board-am3517evm.c          |    1 +
 arch/arm/mach-omap2/board-apollon.c            |    1 +
 arch/arm/mach-omap2/board-cm-t35.c             |    2 +
 arch/arm/mach-omap2/board-cm-t3517.c           |    1 +
 arch/arm/mach-omap2/board-devkit8000.c         |    1 +
 arch/arm/mach-omap2/board-generic.c            |    1 +
 arch/arm/mach-omap2/board-h4.c                 |    1 +
 arch/arm/mach-omap2/board-igep0020.c           |    2 +
 arch/arm/mach-omap2/board-ldp.c                |    1 +
 arch/arm/mach-omap2/board-n8x0.c               |    3 +
 arch/arm/mach-omap2/board-omap3beagle.c        |    1 +
 arch/arm/mach-omap2/board-omap3evm.c           |    1 +
 arch/arm/mach-omap2/board-omap3logic.c         |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c       |    1 +
 arch/arm/mach-omap2/board-omap3stalker.c       |    1 +
 arch/arm/mach-omap2/board-omap3touchbook.c     |    1 +
 arch/arm/mach-omap2/board-omap4panda.c         |    1 +
 arch/arm/mach-omap2/board-overo.c              |    1 +
 arch/arm/mach-omap2/board-rm680.c              |    2 +
 arch/arm/mach-omap2/board-rx51.c               |    1 +
 arch/arm/mach-omap2/board-ti8168evm.c          |    2 +
 arch/arm/mach-omap2/board-zoom.c               |    2 +
 arch/arm/mach-omap2/common.h                   |   47 ++++++++++++++++++
 arch/arm/mach-omap2/io.c                       |   63 ++++++++++++++++++++++++
 arch/arm/mach-omap2/mux.c                      |    3 +-
 arch/arm/mach-omap2/pm.c                       |    3 +-
 arch/arm/mach-omap2/pm24xx.c                   |   17 ++-----
 arch/arm/mach-omap2/pm34xx.c                   |    7 +--
 arch/arm/mach-omap2/pm44xx.c                   |    6 +--
 arch/arm/mach-pnx4008/core.c                   |   12 +++++
 arch/arm/mach-pnx4008/pm.c                     |    4 +-
 arch/arm/mach-prima2/common.h                  |    6 ++
 arch/arm/mach-prima2/pm.c                      |    3 +-
 arch/arm/mach-prima2/prima2.c                  |    6 ++
 arch/arm/mach-s3c64xx/common.c                 |    5 ++
 arch/arm/mach-s3c64xx/common.h                 |    7 +++
 arch/arm/mach-s3c64xx/mach-anw6410.c           |    1 +
 arch/arm/mach-s3c64xx/mach-crag6410.c          |    1 +
 arch/arm/mach-s3c64xx/mach-hmt.c               |    1 +
 arch/arm/mach-s3c64xx/mach-mini6410.c          |    1 +
 arch/arm/mach-s3c64xx/mach-ncp.c               |    1 +
 arch/arm/mach-s3c64xx/mach-real6410.c          |    1 +
 arch/arm/mach-s3c64xx/mach-smartq5.c           |    1 +
 arch/arm/mach-s3c64xx/mach-smartq7.c           |    1 +
 arch/arm/mach-s3c64xx/mach-smdk6400.c          |    1 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c          |    1 +
 arch/arm/mach-s3c64xx/pm.c                     |    3 +-
 arch/arm/mach-sa1100/assabet.c                 |    1 +
 arch/arm/mach-sa1100/badge4.c                  |    1 +
 arch/arm/mach-sa1100/cerf.c                    |    1 +
 arch/arm/mach-sa1100/collie.c                  |    1 +
 arch/arm/mach-sa1100/generic.c                 |    4 ++
 arch/arm/mach-sa1100/generic.h                 |    7 +++
 arch/arm/mach-sa1100/h3100.c                   |    1 +
 arch/arm/mach-sa1100/h3600.c                   |    1 +
 arch/arm/mach-sa1100/hackkit.c                 |    1 +
 arch/arm/mach-sa1100/jornada720.c              |    1 +
 arch/arm/mach-sa1100/lart.c                    |    1 +
 arch/arm/mach-sa1100/nanoengine.c              |    1 +
 arch/arm/mach-sa1100/pleb.c                    |    1 +
 arch/arm/mach-sa1100/pm.c                      |    4 +-
 arch/arm/mach-sa1100/shannon.c                 |    1 +
 arch/arm/mach-sa1100/simpad.c                  |    1 +
 arch/arm/mach-shmobile/Makefile                |    2 +-
 arch/arm/mach-shmobile/board-ag5evm.c          |    1 +
 arch/arm/mach-shmobile/board-ap4evb.c          |    1 +
 arch/arm/mach-shmobile/board-bonito.c          |    1 +
 arch/arm/mach-shmobile/board-g3evm.c           |    1 +
 arch/arm/mach-shmobile/board-g4evm.c           |    1 +
 arch/arm/mach-shmobile/board-kota2.c           |    1 +
 arch/arm/mach-shmobile/board-mackerel.c        |    1 +
 arch/arm/mach-shmobile/board-marzen.c          |    1 +
 arch/arm/mach-shmobile/common.c                |   24 +++++++++
 arch/arm/mach-shmobile/cpuidle.c               |    3 +-
 arch/arm/mach-shmobile/include/mach/common.h   |   14 +++++
 arch/arm/mach-shmobile/suspend.c               |    3 +-
 arch/arm/mach-tegra/board-dt-tegra20.c         |    1 +
 arch/arm/mach-tegra/board-dt-tegra30.c         |    1 +
 arch/arm/mach-tegra/board-harmony.c            |    1 +
 arch/arm/mach-tegra/board-paz00.c              |    1 +
 arch/arm/mach-tegra/board-seaboard.c           |    3 +
 arch/arm/mach-tegra/board-trimslice.c          |    1 +
 arch/arm/mach-tegra/board.h                    |   16 ++++++
 arch/arm/mach-tegra/clock.c                    |    3 +-
 arch/arm/mach-tegra/common.c                   |    7 +++
 arch/arm/mach-tegra/pinmux.c                   |    3 +-
 arch/arm/mach-tegra/powergate.c                |    4 +-
 arch/arm/mach-ux500/board-mop500.c             |    4 ++
 arch/arm/mach-ux500/board-u5500.c              |    1 +
 arch/arm/mach-ux500/clock.c                    |    6 +--
 arch/arm/mach-ux500/clock.h                    |   12 +++++
 arch/arm/mach-ux500/cpu.c                      |    6 ++
 arch/arm/mach-ux500/include/mach/setup.h       |    1 +
 arch/arm/plat-mxc/include/mach/common.h        |    7 +++
 237 files changed, 695 insertions(+), 116 deletions(-)
author
#1 lore raw

PATCH 1/17 ARM: provide a late_initcall hook for platform initialization

This allows platforms to set up things that need to be done at late_initcall time.

Cc Russell King <[email protected]>
---
 arch/arm/include/asm/mach/arch.h |    1 +
 arch/arm/kernel/setup.c          |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/include/asm/mach/arch.h +1 -0
index d7692ca..0b1c94b 100644
@@ -43,6 +43,7 @@ struct machine_desc {
 	void			(*init_irq)(void);
 	struct sys_timer	*timer;		/* system tick timer	*/
 	void			(*init_machine)(void);
+	void			(*init_late)(void);
 #ifdef CONFIG_MULTI_IRQ_HANDLER
 	void			(*handle_irq)(struct pt_regs *);
 #endif
arch/arm/kernel/setup.c +8 -0
index ebfac78..549f036 100644
@@ -800,6 +800,14 @@ static int __init customize_machine(void)
 }
 arch_initcall(customize_machine);
 
+static int __init init_machine_late(void)
+{
+	if (machine_desc->init_late)
+		machine_desc->init_late();
+	return 0;
+}
+late_initcall(init_machine_late);
+
 #ifdef CONFIG_KEXEC
 static inline unsigned long long get_total_mem(void)
 {
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 1/17 ARM: provide a late_initcall hook for platform initialization

Quoted 38 lines · Shawn Guo

This allows platforms to set up things that need to be done at late_initcall time.

Cc Russell King <[email protected]>

---
?arch/arm/include/asm/mach/arch.h | ? ?1 +
?arch/arm/kernel/setup.c ? ? ? ? ?| ? ?8 ++++++++
?2 files changed, 9 insertions(+), 0 deletions(-)

arch/arm/include/asm/mach/arch.h +0 -0
index d7692ca..0b1c94b 100644
@@ -43,6 +43,7 @@ struct machine_desc {
 ? ? ? ?void ? ? ? ? ? ? ? ? ? ?(*init_irq)(void);

? ? ? ?struct sys_timer ? ? ? ?*timer; ? ? ? ? /* system tick timer ? ?*/ ? ? ? ?void ? ? ? ? ? ? ? ? ? ?(*init_machine)(void);
+ ? ? ? void ? ? ? ? ? ? ? ? ? ?(*init_late)(void);
?#ifdef CONFIG_MULTI_IRQ_HANDLER
? ? ? ?void ? ? ? ? ? ? ? ? ? ?(*handle_irq)(struct pt_regs *); ?#endif

arch/arm/kernel/setup.c +8 -0
index ebfac78..549f036 100644
@@ -800,6 +800,14 @@ static int __init customize_machine(void)
 ?}
 ?arch_initcall(customize_machine);
 
+static int __init init_machine_late(void)
+{
+ ? ? ? if (machine_desc->init_late)
+ ? ? ? ? ? ? ? machine_desc->init_late();
+ ? ? ? return 0;
+}
+late_initcall(init_machine_late);
+
Quoted 6 lines

?#ifdef CONFIG_KEXEC
?static inline unsigned long long get_total_mem(void) ?{
--
1.7.5.4

author
#3 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

In reply to Shawn Guo
Cc Andrew Victor <[email protected]>
Cc Nicolas Ferre <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
---
 arch/arm/mach-at91/board-1arm.c         |    1 +
 arch/arm/mach-at91/board-afeb-9260v1.c  |    1 +
 arch/arm/mach-at91/board-cam60.c        |    1 +
 arch/arm/mach-at91/board-carmeva.c      |    1 +
 arch/arm/mach-at91/board-cpu9krea.c     |    1 +
 arch/arm/mach-at91/board-cpuat91.c      |    1 +
 arch/arm/mach-at91/board-csb337.c       |    1 +
 arch/arm/mach-at91/board-csb637.c       |    1 +
 arch/arm/mach-at91/board-dt.c           |    1 +
 arch/arm/mach-at91/board-eb01.c         |    1 +
 arch/arm/mach-at91/board-eb9200.c       |    1 +
 arch/arm/mach-at91/board-ecbat91.c      |    1 +
 arch/arm/mach-at91/board-eco920.c       |    1 +
 arch/arm/mach-at91/board-flexibity.c    |    1 +
 arch/arm/mach-at91/board-foxg20.c       |    1 +
 arch/arm/mach-at91/board-gsia18s.c      |    1 +
 arch/arm/mach-at91/board-kafa.c         |    1 +
 arch/arm/mach-at91/board-kb9202.c       |    1 +
 arch/arm/mach-at91/board-neocore926.c   |    1 +
 arch/arm/mach-at91/board-pcontrol-g20.c |    1 +
 arch/arm/mach-at91/board-picotux200.c   |    1 +
 arch/arm/mach-at91/board-qil-a9260.c    |    1 +
 arch/arm/mach-at91/board-rm9200dk.c     |    1 +
 arch/arm/mach-at91/board-rm9200ek.c     |    1 +
 arch/arm/mach-at91/board-rsi-ews.c      |    1 +
 arch/arm/mach-at91/board-sam9-l9260.c   |    1 +
 arch/arm/mach-at91/board-sam9260ek.c    |    1 +
 arch/arm/mach-at91/board-sam9261ek.c    |    1 +
 arch/arm/mach-at91/board-sam9263ek.c    |    1 +
 arch/arm/mach-at91/board-sam9g20ek.c    |    1 +
 arch/arm/mach-at91/board-sam9m10g45ek.c |    1 +
 arch/arm/mach-at91/board-sam9rlek.c     |    1 +
 arch/arm/mach-at91/board-snapper9260.c  |    1 +
 arch/arm/mach-at91/board-stamp9g20.c    |    1 +
 arch/arm/mach-at91/board-usb-a926x.c    |    1 +
 arch/arm/mach-at91/board-yl-9200.c      |    1 +
 arch/arm/mach-at91/clock.c              |    3 +--
 arch/arm/mach-at91/generic.h            |    5 +++++
 arch/arm/mach-at91/setup.c              |    5 +++++
 39 files changed, 47 insertions(+), 2 deletions(-)
arch/arm/mach-at91/board-1arm.c +1 -0
index 2628384..0a9fb25 100644
@@ -98,4 +98,5 @@ MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
 	.init_early	= onearm_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= onearm_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-afeb-9260v1.c +1 -0
index 161efba..89461c3 100644
@@ -219,5 +219,6 @@ MACHINE_START(AFEB9260, "Custom afeb9260 board")
 	.init_early	= afeb9260_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= afeb9260_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
 
arch/arm/mach-at91/board-cam60.c +1 -0
index c6d44ee..8ab5489 100644
@@ -195,4 +195,5 @@ MACHINE_START(CAM60, "KwikByte CAM60")
 	.init_early	= cam60_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= cam60_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-carmeva.c +1 -0
index 59d9cf9..e1c6c14 100644
@@ -165,4 +165,5 @@ MACHINE_START(CARMEVA, "Carmeva")
 	.init_early	= carmeva_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= carmeva_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-cpu9krea.c +1 -0
index 5f3680e..087d742 100644
@@ -383,4 +383,5 @@ MACHINE_START(CPUAT9G20, "Eukrea CPU9G20")
 	.init_early	= cpu9krea_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= cpu9krea_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-cpuat91.c +1 -0
index e094cc8..c08079a 100644
@@ -185,4 +185,5 @@ MACHINE_START(CPUAT91, "Eukrea")
 	.init_early	= cpuat91_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= cpuat91_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-csb337.c +1 -0
index 1a1547b..0d20af4 100644
@@ -260,4 +260,5 @@ MACHINE_START(CSB337, "Cogent CSB337")
 	.init_early	= csb337_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= csb337_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-csb637.c +1 -0
index f650bf3..3716a7d 100644
@@ -140,4 +140,5 @@ MACHINE_START(CSB637, "Cogent CSB637")
 	.init_early	= csb637_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= csb637_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-dt.c +1 -0
index c18d4d3..ce967f7 100644
@@ -62,5 +62,6 @@ DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
 	.init_early	= at91_dt_initialize,
 	.init_irq	= at91_dt_init_irq,
 	.init_machine	= at91_dt_device_init,
+	.init_late	= at91_init_late,
 	.dt_compat	= at91_dt_board_compat,
 MACHINE_END
arch/arm/mach-at91/board-eb01.c +1 -0
index d2023f2..7448e11 100644
@@ -45,5 +45,6 @@ MACHINE_START(AT91EB01, "Atmel AT91 EB01")
 	.timer		= &at91x40_timer,
 	.init_early	= at91eb01_init_early,
 	.init_irq	= at91eb01_init_irq,
+	.init_late	= at91_init_late,
 MACHINE_END
 
arch/arm/mach-at91/board-eb9200.c +1 -0
index d302ca3..3cdf1e4 100644
@@ -125,4 +125,5 @@ MACHINE_START(ATEB9200, "Embest ATEB9200")
 	.init_early	= eb9200_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= eb9200_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-ecbat91.c +1 -0
index 69966ce..cefbf18 100644
@@ -177,4 +177,5 @@ MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
 	.init_early	= ecb_at91init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ecb_at91board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-eco920.c +1 -0
index f23aabe..2236fd5 100644
@@ -140,4 +140,5 @@ MACHINE_START(ECO920, "eco920")
 	.init_early	= eco920_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= eco920_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-flexibity.c +1 -0
index 1815152..28006fe 100644
@@ -167,4 +167,5 @@ MACHINE_START(FLEXIBITY, "Flexibity Connect")
 	.init_early	= flexibity_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= flexibity_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-foxg20.c +1 -0
index caf017f..892ccee 100644
@@ -270,4 +270,5 @@ MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20")
 	.init_early	= foxg20_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= foxg20_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-gsia18s.c +1 -0
index 230e719..9a1e6be 100644
@@ -579,4 +579,5 @@ MACHINE_START(GSIA18S, "GS_IA18_S")
 	.init_early	= gsia18s_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= gsia18s_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-kafa.c +1 -0
index efde1b2..fafc29b 100644
@@ -100,4 +100,5 @@ MACHINE_START(KAFA, "Sperry-Sun KAFA")
 	.init_early	= kafa_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= kafa_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-kb9202.c +1 -0
index 59b92aa..524f975 100644
@@ -140,4 +140,5 @@ MACHINE_START(KB9200, "KB920x")
 	.init_early	= kb9202_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= kb9202_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-neocore926.c +1 -0
index 57d5f6a..f43fa3e 100644
@@ -385,4 +385,5 @@ MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926")
 	.init_early	= neocore926_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= neocore926_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-pcontrol-g20.c +1 -0
index b4a12fc..2de2dff 100644
@@ -222,4 +222,5 @@ MACHINE_START(PCONTROL_G20, "PControl G20")
 	.init_early	= pcontrol_g20_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= pcontrol_g20_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-picotux200.c +1 -0
index 59e35dd..0f99e1b 100644
@@ -127,4 +127,5 @@ MACHINE_START(PICOTUX2XX, "picotux 200")
 	.init_early	= picotux200_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= picotux200_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-qil-a9260.c +1 -0
index b6ed5ed..b846954 100644
@@ -266,4 +266,5 @@ MACHINE_START(QIL_A9260, "CALAO QIL_A9260")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-rm9200dk.c +1 -0
index 01332aa..c65bcc1 100644
@@ -230,4 +230,5 @@ MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
 	.init_early	= dk_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= dk_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-rm9200ek.c +1 -0
index b2e4fe2..822ed37 100644
@@ -197,4 +197,5 @@ MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-rsi-ews.c +1 -0
index af0750f..79b46f4 100644
@@ -232,4 +232,5 @@ MACHINE_START(RSI_EWS, "RSI EWS")
 	.init_early	= rsi_ews_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= rsi_ews_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-sam9-l9260.c +1 -0
index e8b116b..7c5fddb 100644
@@ -209,4 +209,5 @@ MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-sam9260ek.c +1 -0
index d5aec55..b2c4f00 100644
@@ -351,4 +351,5 @@ MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-sam9261ek.c +1 -0
index 065fed3..78db782 100644
@@ -622,4 +622,5 @@ MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-sam9263ek.c +1 -0
index 2ffe50f..3c0271e 100644
@@ -450,4 +450,5 @@ MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-sam9g20ek.c +1 -0
index 8923ec9..1ea04e2 100644
@@ -415,4 +415,5 @@ MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-sam9m10g45ek.c +1 -0
index c88e908..a6f683b 100644
@@ -498,4 +498,5 @@ MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-sam9rlek.c +1 -0
index b109ce2..5811150 100644
@@ -326,4 +326,5 @@ MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-snapper9260.c +1 -0
index ebc9d01..967b376 100644
@@ -183,6 +183,7 @@ MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module")
 	.init_early	= snapper9260_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= snapper9260_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
 
 
arch/arm/mach-at91/board-stamp9g20.c +1 -0
index 7640049..d077653 100644
@@ -315,4 +315,5 @@ MACHINE_START(STAMP9G20, "taskit Stamp9G20")
 	.init_early	= stamp9g20evb_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= stamp9g20evb_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-usb-a926x.c +1 -0
index b7483a3..6ed2625 100644
@@ -379,4 +379,5 @@ MACHINE_START(USB_A9G20, "CALAO USB_A92G0")
 	.init_early	= ek_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= ek_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/board-yl-9200.c +1 -0
index 38dd279..4804a86 100644
@@ -597,4 +597,5 @@ MACHINE_START(YL9200, "uCdragon YL-9200")
 	.init_early	= yl9200_init_early,
 	.init_irq	= at91_init_irq_default,
 	.init_machine	= yl9200_board_init,
+	.init_late	= at91_init_late,
 MACHINE_END
arch/arm/mach-at91/clock.c +1 -2
index 6b69282..f0ec583 100644
@@ -852,7 +852,7 @@ int __init at91_clock_init(unsigned long main_clock)
 /*
  * Several unused clocks may be active.  Turn them off.
  */
-static int __init at91_clock_reset(void)
+int __init at91_clock_reset(void)
 {
 	unsigned long pcdr = 0;
 	unsigned long scdr = 0;
@@ -876,7 +876,6 @@ static int __init at91_clock_reset(void)
 
 	return 0;
 }
-late_initcall(at91_clock_reset);
 
 void at91sam9_idle(void)
 {
arch/arm/mach-at91/generic.h +5 -0
index dd9b346..c328118 100644
@@ -54,8 +54,10 @@ extern void __init at91sam9g45_set_console_clock(int id);
 #ifdef CONFIG_AT91_PMC_UNIT
 extern int __init at91_clock_init(unsigned long main_clock);
 extern int __init at91_dt_clock_init(void);
+extern int at91_clock_reset(void);
 #else
 static int inline at91_clock_init(unsigned long main_clock) { return 0; }
+static inline int at91_clock_reset(void) { return 0; }
 #endif
 struct device;
 
@@ -80,6 +82,9 @@ extern void at91_ioremap_matrix(u32 base_addr);
 /* Ram Controler */
 extern void at91_ioremap_ramc(int id, u32 addr, u32 size);
 
+/* late init */
+extern void at91_init_late(void);
+
  /* GPIO */
 #define AT91RM9200_PQFP		3	/* AT91RM9200 PQFP package has 3 banks */
 #define AT91RM9200_BGA		4	/* AT91RM9200 BGA package has 4 banks */
arch/arm/mach-at91/setup.c +5 -0
index f44a2e7..b17199f 100644
@@ -458,3 +458,8 @@ void __init at91_initialize(unsigned long main_clock)
 
 	at91_boot_soc.init();
 }
+
+void __init at91_init_late(void)
+{
+	at91_clock_reset();
+}
Signature · 1 line
1.7.5.4
#4 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 36 lines · Shawn Guo
Cc Andrew Victor <[email protected]>
Cc Nicolas Ferre <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
---
 arch/arm/mach-at91/board-1arm.c         |    1 +
 arch/arm/mach-at91/board-afeb-9260v1.c  |    1 +
 arch/arm/mach-at91/board-cam60.c        |    1 +
 arch/arm/mach-at91/board-carmeva.c      |    1 +
 arch/arm/mach-at91/board-cpu9krea.c     |    1 +
 arch/arm/mach-at91/board-cpuat91.c      |    1 +
 arch/arm/mach-at91/board-csb337.c       |    1 +
 arch/arm/mach-at91/board-csb637.c       |    1 +
 arch/arm/mach-at91/board-dt.c           |    1 +
 arch/arm/mach-at91/board-eb01.c         |    1 +
 arch/arm/mach-at91/board-eb9200.c       |    1 +
 arch/arm/mach-at91/board-ecbat91.c      |    1 +
 arch/arm/mach-at91/board-eco920.c       |    1 +
 arch/arm/mach-at91/board-flexibity.c    |    1 +
 arch/arm/mach-at91/board-foxg20.c       |    1 +
 arch/arm/mach-at91/board-gsia18s.c      |    1 +
 arch/arm/mach-at91/board-kafa.c         |    1 +
 arch/arm/mach-at91/board-kb9202.c       |    1 +
 arch/arm/mach-at91/board-neocore926.c   |    1 +
 arch/arm/mach-at91/board-pcontrol-g20.c |    1 +
 arch/arm/mach-at91/board-picotux200.c   |    1 +
 arch/arm/mach-at91/board-qil-a9260.c    |    1 +
 arch/arm/mach-at91/board-rm9200dk.c     |    1 +
 arch/arm/mach-at91/board-rm9200ek.c     |    1 +
 arch/arm/mach-at91/board-rsi-ews.c      |    1 +
 arch/arm/mach-at91/board-sam9-l9260.c   |    1 +
 arch/arm/mach-at91/board-sam9260ek.c    |    1 +
 arch/arm/mach-at91/board-sam9261ek.c    |    1 +
 arch/arm/mach-at91/board-sam9263ek.c    |    1 +
 arch/arm/mach-at91/board-sam9g20ek.c    |    1 +
 arch/arm/mach-at91/board-sam9m10g45ek.c |    1 +
Quoted 8 lines
 arch/arm/mach-at91/board-sam9rlek.c     |    1 +
 arch/arm/mach-at91/board-snapper9260.c  |    1 +
 arch/arm/mach-at91/board-stamp9g20.c    |    1 +
 arch/arm/mach-at91/board-usb-a926x.c    |    1 +
 arch/arm/mach-at91/board-yl-9200.c      |    1 +
 arch/arm/mach-at91/clock.c              |    3 +--
 arch/arm/mach-at91/generic.h            |    5 +++++
 arch/arm/mach-at91/setup.c              |    5 +++++

I like it but I think it's more time to put soc init that machine init

Best Regards,
J.

author
#5 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

I like it but I think it's more time to put soc init that machine init

Yes, just like other hooks in struct machine_desc, when there is no machine specific but only soc specific setup need to get done, the hook is pretty much like a soc specific one. But when you get some machine specific setup besides soc one, you will be happy to have it. Taking board "Carmeva" as exmaple, it will be something like the following.

static void __init carmeva_init_late(void)

{
	at91_init_late();
	carmeva_specific_late_init();
}

MACHINE_START(CARMEVA, "Carmeva")
/* Maintainer: Conitec Datasystems */
.timer = &at91rm9200_timer,
.map_io = at91_map_io,
.init_early = carmeva_init_early,
.init_irq = at91_init_irq_default,
.init_machine = carmeva_board_init,
.init_late = carmeva_init_late,
MACHINE_END

Signature · 2 lines
Regards,
Shawn
#6 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 15 lines · Shawn Guo
Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

I like it but I think it's more time to put soc init that machine init

Yes, just like other hooks in struct machine_desc, when there is no machine specific but only soc specific setup need to get done, the hook is pretty much like a soc specific one. But when you get some machine specific setup besides soc one, you will be happy to have it. Taking board "Carmeva" as exmaple, it will be something like the following.

static void __init carmeva_init_late(void)

{
	at91_init_late();
	carmeva_specific_late_init();
}
Quoted 9 lines

MACHINE_START(CARMEVA, "Carmeva")
/* Maintainer: Conitec Datasystems */
.timer = &at91rm9200_timer,
.map_io = at91_map_io,
.init_early = carmeva_init_early,
.init_irq = at91_init_irq_default,
.init_machine = carmeva_board_init,
.init_late = carmeva_init_late,
MACHINE_END

no really don't like this idea to duplicate code I didn't like either for timer, or any other common init

we discuss with Arnd we came back with 2 ideas one is to use a machine specific initcall or compatible specifc initcall or the second one is to resurect Marc patch series to introduce soc_desc

and on at91 Ill not touch it as the old style board can NOT be compiled with other soc (only one at91 soc at a time).

And I'll not fix it as we move to the DT which I fix to be able to be compiled in the multiarch kernel.

Best Regards,
J.

author
#7 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

we discuss with Arnd we came back with 2 ideas one is to use a machine specific initcall or compatible specifc initcall

Do you mean an initcall with machine/compatible detection inside? The whole point of the hooks in struct machine_desc is to save the machine/compatible detection. You already use .init_machine as an arch_initcall time hook, and what .init_late provides you is just a late_initcall time hook. If you want to detect machine/compatible in your late_initcall rather than using this hook, you should not use .init_machine for the same reason.

Quoted 3 lines

or the second one is to
resurect Marc patch series to introduce soc_desc

This is the approach I can agree on, but isn't the patch moving one step close to that, turning the late_initcall into a function which can be hooked into soc specific call?

Quoted 6 lines

and on at91 Ill not touch it as the old style board can NOT be compiled with other soc (only one at91 soc at a time).

And I'll not fix it as we move to the DT which I fix to be able to be compiled in the multiarch kernel.

It's something on your plate. Just tell me to drop the patch from the series, if you do not want it in.

Signature · 2 lines
Regards,
Shawn
#8 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 11 lines · Shawn Guo
Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

we discuss with Arnd we came back with 2 ideas one is to use a machine specific initcall or compatible specifc initcall

Do you mean an initcall with machine/compatible detection inside? The whole point of the hooks in struct machine_desc is to save the machine/compatible detection. You already use .init_machine as an arch_initcall time hook, and what .init_late provides you is just a late_initcall time hook. If you want to detect machine/compatible in your late_initcall rather than using this hook, you should not use .init_machine for the same reason.

on DT we just do this

so the hook start to make not too much sense
at machine level

as this is for nearly all of them purely soc

Quoted 7 lines
Quoted 4 lines

or the second one is to
resurect Marc patch series to introduce soc_desc

This is the approach I can agree on, but isn't the patch moving one step close to that, turning the late_initcall into a function which can be hooked into soc specific call?

no you touch too much file and make code expertoed where this no need of this

Quoted 9 lines
Quoted 7 lines

and on at91 Ill not touch it as the old style board can NOT be compiled with other soc (only one at91 soc at a time).

And I'll not fix it as we move to the DT which I fix to be able to be compiled in the multiarch kernel.

It's something on your plate. Just tell me to drop the patch from the series, if you do not want it in.

no I want it clean an ALL arch and do not duplicated code

Best Regards,
J.

author
#9 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · Shawn Guo
Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

we discuss with Arnd we came back with 2 ideas one is to use a machine specific initcall or compatible specifc initcall

Quoted 9 lines
Quoted 7 lines

Do you mean an initcall with machine/compatible detection inside? The whole point of the hooks in struct machine_desc is to save the machine/compatible detection. You already use .init_machine as an arch_initcall time hook, and what .init_late provides you is just a late_initcall time hook. If you want to detect machine/compatible in your late_initcall rather than using this hook, you should not use .init_machine for the same reason.

on DT we just do this

I'm talking about non-DT case. Sadly, there are still so many non-DT board files in arch/arm/mach-at91.

Quoted 5 lines

so the hook start to make not too much sense
at machine level

as this is for nearly all of them purely soc

This reminds me an argument against soc_desc stuff. With DT adopted, the struct machine_desc (hooks inside it) becomes purely soc specific, so why do we need soc_desc then?

Quoted 13 lines
Quoted 7 lines
Quoted 4 lines

or the second one is to
resurect Marc patch series to introduce soc_desc

This is the approach I can agree on, but isn't the patch moving one step close to that, turning the late_initcall into a function which can be hooked into soc specific call?

no you touch too much file and make code expertoed where this no need of this

Quoted 4 lines
Quoted 4 lines

and on at91 Ill not touch it as the old style board can NOT be compiled with other soc (only one at91 soc at a time).

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

And I'll not fix it as we move to the DT which I fix to be able to be compiled in the multiarch kernel.

It's something on your plate. Just tell me to drop the patch from the series, if you do not want it in.

no I want it clean an ALL arch and do not duplicated code

I do not quite understand this sentence, but I guess you are asking me to drop the patch. Will do.

Signature · 2 lines
Regards,
Shawn
#10 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 13 lines · Shawn Guo
Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · Shawn Guo
Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

we discuss with Arnd we came back with 2 ideas one is to use a machine specific initcall or compatible specifc initcall

Do you mean an initcall with machine/compatible detection inside? The whole point of the hooks in struct machine_desc is to save the machine/compatible detection. You already use .init_machine as an arch_initcall time hook, and what .init_late provides you is just a late_initcall time hook. If you want to detect machine/compatible in your late_initcall rather than using this hook, you should not use .init_machine for the same reason.

Quoted 4 lines
Quoted 2 lines

on DT we just do this

I'm talking about non-DT case. Sadly, there are still so many non-DT board files in arch/arm/mach-at91.

It depends on whether we want to allow non-DT board files for multiplatform kernels. We clearly can allow them, but I think we can spare some trouble and also make the configuration simpler if we just disallow it, and make only those platforms that are converted to both allow multiplat and DT boot as sub-options under the top-level multiplatform kernel option. If we do that, we can keep a lot of initcalls in the platform code and just add an "if (!of_have_populated_dt())" in them or a check for the respective device.

Quoted 8 lines
Quoted 5 lines

so the hook start to make not too much sense
at machine level

as this is for nearly all of them purely soc

This reminds me an argument against soc_desc stuff. With DT adopted, the struct machine_desc (hooks inside it) becomes purely soc specific, so why do we need soc_desc then?

Ah, good point. I was wondering what happened to that discussion.

On a related note, I have looked up what kinds of initcalls are in the platform code:

$ git grep -h ^[a-z_]*_initcall arch/arm/ | cut -f 1 -d \( | sort | uniq -c | sort -n      1 subsys_initcall_sync
      2 postcore_initcall_sync
      5 console_initcall
      7 fs_initcall
      9 early_initcall
     14 __initcall
     34 device_initcall
     35 postcore_initcall
     43 core_initcall
     49 late_initcall
     87 subsys_initcall
    128 arch_initcall

I think that if we do the late_initcall mechanism that you proposed, we will probaly need the same for subsyste_initcall, and although we already have mach_desc->init_machine() at the arch_initcall level, it seems that there are a lot of other users that don't use it (for good or for not so good reasons, I have not checked) and that would definitely benefit from the method that Jean-Christophe posted. I think we will end up wanting both in any case.

Arnd

#11 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 19 lines · Arnd Bergmann
Quoted 13 lines · Shawn Guo
Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · Shawn Guo
Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

we discuss with Arnd we came back with 2 ideas one is to use a machine specific initcall or compatible specifc initcall

Do you mean an initcall with machine/compatible detection inside? The whole point of the hooks in struct machine_desc is to save the machine/compatible detection. You already use .init_machine as an arch_initcall time hook, and what .init_late provides you is just a late_initcall time hook. If you want to detect machine/compatible in your late_initcall rather than using this hook, you should not use .init_machine for the same reason.

Quoted 4 lines
Quoted 2 lines

on DT we just do this

I'm talking about non-DT case. Sadly, there are still so many non-DT board files in arch/arm/mach-at91.

Quoted 8 lines

It depends on whether we want to allow non-DT board files for multiplatform kernels. We clearly can allow them, but I think we can spare some trouble and also make the configuration simpler if we just disallow it, and make only those platforms that are converted to both allow multiplat and DT boot as sub-options under the top-level multiplatform kernel option. If we do that, we can keep a lot of initcalls in the platform code and just add an "if (!of_have_populated_dt())" in them or a check for the respective device.

I agree with Arnd

and in your patch you export sensitive SoC function that no board Maintainer will ever have to care about

As example on at91 you ask the baord maintainer to call the clock shutdown to disable the non used clock

if we use the soc_desc or the conditional initcall we will avoid a lot of trouble

I'll send a patch for soc_desc and conditional initcall will see which Russell prefer.

Best Regards,
J.

Quoted 38 lines
Quoted 9 lines
Quoted 6 lines

so the hook start to make not too much sense
at machine level

as this is for nearly all of them purely soc

This reminds me an argument against soc_desc stuff. With DT adopted, the struct machine_desc (hooks inside it) becomes purely soc specific, so why do we need soc_desc then?

Ah, good point. I was wondering what happened to that discussion.

On a related note, I have looked up what kinds of initcalls are in the platform code:

$ git grep -h ^[a-z_]*_initcall arch/arm/ | cut -f 1 -d \( | sort | uniq -c | sort -n      1 subsys_initcall_sync
      2 postcore_initcall_sync
      5 console_initcall
      7 fs_initcall
      9 early_initcall
     14 __initcall
     34 device_initcall
     35 postcore_initcall
     43 core_initcall
     49 late_initcall
     87 subsys_initcall
    128 arch_initcall

I think that if we do the late_initcall mechanism that you proposed, we will probaly need the same for subsyste_initcall, and although we already have mach_desc->init_machine() at the arch_initcall level, it seems that there are a lot of other users that don't use it (for good or for not so good reasons, I have not checked) and that would definitely benefit from the method that Jean-Christophe posted. I think we will end up wanting both in any case.

Arnd

author
#12 lore raw

PATCH 2/17 ARM: at91: use machine specific hook for late init

Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD

I'll send a patch for soc_desc and conditional initcall will see which Russell prefer.

Hmm, it seems you haven't answered my question about soc_desc. With DT adopted, machine_desc actually becomes the equivalent of soc_desc. Why do we need soc_desc then?

Signature · 2 lines
Regards,
Shawn
author
#13 lore raw

PATCH 3/17 ARM: davinci: use machine specific hook for late init

In reply to Shawn Guo
Cc Sekhar Nori <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-davinci/board-da830-evm.c     |    1 +
 arch/arm/mach-davinci/board-da850-evm.c     |    1 +
 arch/arm/mach-davinci/board-dm355-evm.c     |    1 +
 arch/arm/mach-davinci/board-dm355-leopard.c |    1 +
 arch/arm/mach-davinci/board-dm365-evm.c     |    1 +
 arch/arm/mach-davinci/board-dm644x-evm.c    |    1 +
 arch/arm/mach-davinci/board-dm646x-evm.c    |    1 +
 arch/arm/mach-davinci/board-mityomapl138.c  |    1 +
 arch/arm/mach-davinci/board-neuros-osd2.c   |    1 +
 arch/arm/mach-davinci/board-omapl138-hawk.c |    1 +
 arch/arm/mach-davinci/board-sffsdr.c        |    1 +
 arch/arm/mach-davinci/board-tnetv107x-evm.c |    1 +
 arch/arm/mach-davinci/clock.c               |    3 +--
 arch/arm/mach-davinci/common.c              |    7 +++++++
 arch/arm/mach-davinci/cpufreq.c             |    3 +--
 arch/arm/mach-davinci/include/mach/common.h |   19 +++++++++++++++++++
 arch/arm/mach-davinci/pm.c                  |    3 +--
 17 files changed, 41 insertions(+), 6 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +1 -0
index dc1afe5..0031864 100644
@@ -681,6 +681,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
 	.init_irq	= cp_intc_init,
 	.timer		= &davinci_timer,
 	.init_machine	= da830_evm_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= da8xx_restart,
 MACHINE_END
arch/arm/mach-davinci/board-da850-evm.c +1 -0
index a70de24..280cbed 100644
@@ -1411,6 +1411,7 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
 	.init_irq	= cp_intc_init,
 	.timer		= &davinci_timer,
 	.init_machine	= da850_evm_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= da8xx_restart,
 MACHINE_END
arch/arm/mach-davinci/board-dm355-evm.c +1 -0
index 82ed753..1c7b1f4 100644
@@ -357,6 +357,7 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
 	.init_irq     = davinci_irq_init,
 	.timer	      = &davinci_timer,
 	.init_machine = dm355_evm_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= davinci_restart,
 MACHINE_END
arch/arm/mach-davinci/board-dm355-leopard.c +1 -0
index d74a8b3..8e77032 100644
@@ -276,6 +276,7 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
 	.init_irq     = davinci_irq_init,
 	.timer	      = &davinci_timer,
 	.init_machine = dm355_leopard_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= davinci_restart,
 MACHINE_END
arch/arm/mach-davinci/board-dm365-evm.c +1 -0
index 5bce2b8..688a9c5 100644
@@ -618,6 +618,7 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
 	.init_irq	= davinci_irq_init,
 	.timer		= &davinci_timer,
 	.init_machine	= dm365_evm_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= davinci_restart,
 MACHINE_END
arch/arm/mach-davinci/board-dm644x-evm.c +1 -0
index 3683306..d34ed55 100644
@@ -825,6 +825,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
 	.init_irq     = davinci_irq_init,
 	.timer	      = &davinci_timer,
 	.init_machine = davinci_evm_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= davinci_restart,
 MACHINE_END
arch/arm/mach-davinci/board-dm646x-evm.c +1 -0
index d72ab94..f213359 100644
@@ -798,6 +798,7 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
 	.init_irq     = davinci_irq_init,
 	.timer        = &davinci_timer,
 	.init_machine = evm_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= davinci_restart,
 MACHINE_END
arch/arm/mach-davinci/board-mityomapl138.c +1 -0
index 672d820..beecde3 100644
@@ -572,6 +572,7 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
 	.init_irq	= cp_intc_init,
 	.timer		= &davinci_timer,
 	.init_machine	= mityomapl138_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= da8xx_restart,
 MACHINE_END
arch/arm/mach-davinci/board-neuros-osd2.c +1 -0
index a772bb4..5de69f2 100644
@@ -278,6 +278,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
 	.init_irq	= davinci_irq_init,
 	.timer		= &davinci_timer,
 	.init_machine = davinci_ntosd2_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= davinci_restart,
 MACHINE_END
arch/arm/mach-davinci/board-omapl138-hawk.c +1 -0
index 45e8157..dc1208e 100644
@@ -343,6 +343,7 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
 	.init_irq	= cp_intc_init,
 	.timer		= &davinci_timer,
 	.init_machine	= omapl138_hawk_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= da8xx_restart,
 MACHINE_END
arch/arm/mach-davinci/board-sffsdr.c +1 -0
index 76e67509..9078acf 100644
@@ -157,6 +157,7 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
 	.init_irq     = davinci_irq_init,
 	.timer	      = &davinci_timer,
 	.init_machine = davinci_sffsdr_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= davinci_restart,
 MACHINE_END
arch/arm/mach-davinci/board-tnetv107x-evm.c +1 -0
index 5f14e30..ac4e003 100644
@@ -282,6 +282,7 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
 	.init_irq	= cp_intc_init,
 	.timer		= &davinci_timer,
 	.init_machine	= tnetv107x_evm_board_init,
+	.init_late	= davinci_init_late,
 	.dma_zone_size	= SZ_128M,
 	.restart	= tnetv107x_restart,
 MACHINE_END
arch/arm/mach-davinci/clock.c +1 -2
index 008772e..34668ea 100644
@@ -213,7 +213,7 @@ EXPORT_SYMBOL(clk_unregister);
 /*
  * Disable any unused clocks left on by the bootloader
  */
-static int __init clk_disable_unused(void)
+int __init davinci_clk_disable_unused(void)
 {
 	struct clk *ck;
 
@@ -237,7 +237,6 @@ static int __init clk_disable_unused(void)
 
 	return 0;
 }
-late_initcall(clk_disable_unused);
 #endif
 
 static unsigned long clk_sysclk_recalc(struct clk *clk)
arch/arm/mach-davinci/common.c +7 -0
index cb9b2e4..64b0f65 100644
@@ -117,3 +117,10 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
 err:
 	panic("davinci_common_init: SoC Initialization failed\n");
 }
+
+void __init davinci_init_late(void)
+{
+	davinci_cpufreq_init();
+	davinci_pm_init();
+	davinci_clk_disable_unused();
+}
arch/arm/mach-davinci/cpufreq.c +1 -2
index 031048f..4729eaa 100644
@@ -240,10 +240,9 @@ static struct platform_driver davinci_cpufreq_driver = {
 	.remove = __exit_p(davinci_cpufreq_remove),
 };
 
-static int __init davinci_cpufreq_init(void)
+int __init davinci_cpufreq_init(void)
 {
 	return platform_driver_probe(&davinci_cpufreq_driver,
 							davinci_cpufreq_probe);
 }
-late_initcall(davinci_cpufreq_init);
 
arch/arm/mach-davinci/include/mach/common.h +19 -0
index 5cd39a4..bdc4aa8 100644
@@ -84,6 +84,25 @@ extern struct davinci_soc_info davinci_soc_info;
 extern void davinci_common_init(struct davinci_soc_info *soc_info);
 extern void davinci_init_ide(void);
 void davinci_restart(char mode, const char *cmd);
+void davinci_init_late(void);
+
+#ifdef CONFIG_DAVINCI_RESET_CLOCKS
+int davinci_clk_disable_unused(void);
+#else
+static inline int davinci_clk_disable_unused(void) { return 0; }
+#endif
+
+#ifdef CONFIG_CPU_FREQ
+int davinci_cpufreq_init(void);
+#else
+static inline int davinci_cpufreq_init(void) { return 0; }
+#endif
+
+#ifdef CONFIG_SUSPEND
+int davinci_pm_init(void);
+#else
+static inline int davinci_pm_init(void) { return 0; }
+#endif
 
 /* standard place to map on-chip SRAMs; they *may* support DMA */
 #define SRAM_VIRT	0xfffe0000
arch/arm/mach-davinci/pm.c +1 -2
index 04c49f7..eb8360b 100644
@@ -152,8 +152,7 @@ static struct platform_driver davinci_pm_driver = {
 	.remove = __exit_p(davinci_pm_remove),
 };
 
-static int __init davinci_pm_init(void)
+int __init davinci_pm_init(void)
 {
 	return platform_driver_probe(&davinci_pm_driver, davinci_pm_probe);
 }
-late_initcall(davinci_pm_init);
Signature · 1 line
1.7.5.4
author
#14 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

In reply to Shawn Guo
Cc Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>
---
 arch/arm/mach-ep93xx/adssphere.c             |    1 +
 arch/arm/mach-ep93xx/core.c                  |    5 +++++
 arch/arm/mach-ep93xx/crunch.c                |    4 +---
 arch/arm/mach-ep93xx/gesbc9312.c             |    1 +
 arch/arm/mach-ep93xx/include/mach/platform.h |    7 +++++++
 arch/arm/mach-ep93xx/micro9.c                |    4 ++++
 arch/arm/mach-ep93xx/simone.c                |    1 +
 arch/arm/mach-ep93xx/snappercl15.c           |    1 +
 arch/arm/mach-ep93xx/ts72xx.c                |    1 +
 arch/arm/mach-ep93xx/vision_ep9307.c         |    1 +
 10 files changed, 23 insertions(+), 3 deletions(-)
arch/arm/mach-ep93xx/adssphere.c +1 -0
index 2d45947..a472777 100644
@@ -41,5 +41,6 @@ MACHINE_START(ADSSPHERE, "ADS Sphere board")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= adssphere_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/core.c +5 -0
index 8d25895..365a90b 100644
@@ -904,3 +904,8 @@ void ep93xx_restart(char mode, const char *cmd)
 	while (1)
 		;
 }
+
+void __init ep93xx_init_late(void)
+{
+	crunch_init();
+}
arch/arm/mach-ep93xx/crunch.c +1 -3
index 74753e2..a4a2ab9 100644
@@ -79,12 +79,10 @@ static struct notifier_block crunch_notifier_block = {
 	.notifier_call	= crunch_do,
 };
 
-static int __init crunch_init(void)
+int __init crunch_init(void)
 {
 	thread_register_notifier(&crunch_notifier_block);
 	elf_hwcap |= HWCAP_CRUNCH;
 
 	return 0;
 }
-
-late_initcall(crunch_init);
arch/arm/mach-ep93xx/gesbc9312.c +1 -0
index fcdffbe..437c341 100644
@@ -41,5 +41,6 @@ MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= gesbc9312_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/include/mach/platform.h +7 -0
index 602bd87..1ecb040 100644
@@ -53,5 +53,12 @@ void ep93xx_init_devices(void);
 extern struct sys_timer ep93xx_timer;
 
 void ep93xx_restart(char, const char *);
+void ep93xx_init_late(void);
+
+#ifdef CONFIG_CRUNCH
+int crunch_init(void);
+#else
+static inline int crunch_init(void) { return 0; }
+#endif
 
 #endif
arch/arm/mach-ep93xx/micro9.c +4 -0
index dc431c5..3d7cdab 100644
@@ -85,6 +85,7 @@ MACHINE_START(MICRO9, "Contec Micro9-High")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= micro9_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
 #endif
@@ -98,6 +99,7 @@ MACHINE_START(MICRO9M, "Contec Micro9-Mid")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= micro9_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
 #endif
@@ -111,6 +113,7 @@ MACHINE_START(MICRO9L, "Contec Micro9-Lite")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= micro9_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
 #endif
@@ -124,6 +127,7 @@ MACHINE_START(MICRO9S, "Contec Micro9-Slim")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= micro9_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
 #endif
arch/arm/mach-ep93xx/simone.c +1 -0
index f40c298..33dc079 100644
@@ -86,5 +86,6 @@ MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= simone_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/snappercl15.c +1 -0
index 0c00852..eb28237 100644
@@ -183,5 +183,6 @@ MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
 	.handle_irq	= vic_handle_irq,
 	.timer 		= &ep93xx_timer,
 	.init_machine	= snappercl15_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/ts72xx.c +1 -0
index 5ea7909..d4ef339 100644
@@ -252,5 +252,6 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= ts72xx_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/vision_ep9307.c +1 -0
index ba156eb..2905a49 100644
@@ -367,5 +367,6 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= vision_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
Signature · 1 line
1.7.5.4
#15 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

Quoted 3 lines · Shawn Guo
Cc Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>

Why do we want this? It increases the size of the code and changes a static function to a non-static one that now requires ifdefery to handle the !CONFIG_CRUNCH case. I don't see the value in this patch?

~Ryan

Quoted 163 lines
---
 arch/arm/mach-ep93xx/adssphere.c             |    1 +
 arch/arm/mach-ep93xx/core.c                  |    5 +++++
 arch/arm/mach-ep93xx/crunch.c                |    4 +---
 arch/arm/mach-ep93xx/gesbc9312.c             |    1 +
 arch/arm/mach-ep93xx/include/mach/platform.h |    7 +++++++
 arch/arm/mach-ep93xx/micro9.c                |    4 ++++
 arch/arm/mach-ep93xx/simone.c                |    1 +
 arch/arm/mach-ep93xx/snappercl15.c           |    1 +
 arch/arm/mach-ep93xx/ts72xx.c                |    1 +
 arch/arm/mach-ep93xx/vision_ep9307.c         |    1 +
 10 files changed, 23 insertions(+), 3 deletions(-)
arch/arm/mach-ep93xx/adssphere.c +1 -0
index 2d45947..a472777 100644
@@ -41,5 +41,6 @@ MACHINE_START(ADSSPHERE, "ADS Sphere board")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= adssphere_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/core.c +5 -0
index 8d25895..365a90b 100644
@@ -904,3 +904,8 @@ void ep93xx_restart(char mode, const char *cmd)
 	while (1)
 		;
 }
+
+void __init ep93xx_init_late(void)
+{
+	crunch_init();
+}
arch/arm/mach-ep93xx/crunch.c +1 -3
index 74753e2..a4a2ab9 100644
@@ -79,12 +79,10 @@ static struct notifier_block crunch_notifier_block = {
 	.notifier_call	= crunch_do,
 };
 
-static int __init crunch_init(void)
+int __init crunch_init(void)
 {
 	thread_register_notifier(&crunch_notifier_block);
 	elf_hwcap |= HWCAP_CRUNCH;
 
 	return 0;
 }
-
-late_initcall(crunch_init);
arch/arm/mach-ep93xx/gesbc9312.c +1 -0
index fcdffbe..437c341 100644
@@ -41,5 +41,6 @@ MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= gesbc9312_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/include/mach/platform.h +7 -0
index 602bd87..1ecb040 100644
@@ -53,5 +53,12 @@ void ep93xx_init_devices(void);
 extern struct sys_timer ep93xx_timer;
 
 void ep93xx_restart(char, const char *);
+void ep93xx_init_late(void);
+
+#ifdef CONFIG_CRUNCH
+int crunch_init(void);
+#else
+static inline int crunch_init(void) { return 0; }
+#endif
 
 #endif
arch/arm/mach-ep93xx/micro9.c +4 -0
index dc431c5..3d7cdab 100644
@@ -85,6 +85,7 @@ MACHINE_START(MICRO9, "Contec Micro9-High")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= micro9_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
 #endif
@@ -98,6 +99,7 @@ MACHINE_START(MICRO9M, "Contec Micro9-Mid")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= micro9_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
 #endif
@@ -111,6 +113,7 @@ MACHINE_START(MICRO9L, "Contec Micro9-Lite")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= micro9_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
 #endif
@@ -124,6 +127,7 @@ MACHINE_START(MICRO9S, "Contec Micro9-Slim")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= micro9_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
 #endif
arch/arm/mach-ep93xx/simone.c +1 -0
index f40c298..33dc079 100644
@@ -86,5 +86,6 @@ MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= simone_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/snappercl15.c +1 -0
index 0c00852..eb28237 100644
@@ -183,5 +183,6 @@ MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
 	.handle_irq	= vic_handle_irq,
 	.timer 		= &ep93xx_timer,
 	.init_machine	= snappercl15_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/ts72xx.c +1 -0
index 5ea7909..d4ef339 100644
@@ -252,5 +252,6 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= ts72xx_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
arch/arm/mach-ep93xx/vision_ep9307.c +1 -0
index ba156eb..2905a49 100644
@@ -367,5 +367,6 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
 	.handle_irq	= vic_handle_irq,
 	.timer		= &ep93xx_timer,
 	.init_machine	= vision_init_machine,
+	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
#16 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

Quoted 11 lines · Ryan Mallon
Quoted 3 lines · Shawn Guo
Cc Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>

Why do we want this? It increases the size of the code and changes a static function to a non-static one that now requires ifdefery to handle the !CONFIG_CRUNCH case. I don't see the value in this patch?

Ryan,

See Shawn's "[PATCH 00/17] arch/arm/mach-* late_initcall cleanup".

I haven't looked closely at this yet. I think there may be some platforms where the late_initcall's might cause a problem when making an ARM unified kernel.

Actually I have a question about the ARM unified kernel.

Wouldn't every mach-* supported by a unified kernel have to at least be the same ARM variant (i.e. they share a common compiler setup)? The ep93xx is an arm920t. Are there any other mach-* types that use that?

Regards,
Hartley

#17 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

Quoted 4 lines · H Hartley Sweeten

Wouldn't every mach-* supported by a unified kernel have to at least be the same ARM variant (i.e. they share a common compiler setup)? The ep93xx is an arm920t. Are there any other mach-* types that use that?

... which would be compatible with any kernel which includes ARMv4 through to ARMv5t CPUs. I've built for many many many years Integrator support with every CPU between ARM720T to ARM926T.

#18 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

Quoted 9 lines · Russell King
Quoted 4 lines · H Hartley Sweeten

Wouldn't every mach-* supported by a unified kernel have to at least be the same ARM variant (i.e. they share a common compiler setup)? The ep93xx is an arm920t. Are there any other mach-* types that use that?

... which would be compatible with any kernel which includes ARMv4 through to ARMv5t CPUs. I've built for many many many years Integrator support with every CPU between ARM720T to ARM926T.

Thanks for the clarification!

Ryan,
Based on that I would assume that Shawn's patch is also relevant to ep93xx to help with the unified kernel.

Regards,
Hartley

#19 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

In reply to H Hartley Sweeten
Quoted 13 lines · H Hartley Sweeten
Quoted 11 lines · Ryan Mallon
Quoted 3 lines · Shawn Guo
Cc Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>

Why do we want this? It increases the size of the code and changes a static function to a non-static one that now requires ifdefery to handle the !CONFIG_CRUNCH case. I don't see the value in this patch?

Quoted 7 lines

Ryan,

See Shawn's "[PATCH 00/17] arch/arm/mach-* late_initcall cleanup".

I haven't looked closely at this yet. I think there may be some platforms where the late_initcall's might cause a problem when making an ARM unified kernel.

Hmm, I see. It's a bit annoying that it makes the code less clean, but I can't really see any other nice way of doing it :-/.

~Ryan

#20 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

Quoted 10 lines · Ryan Mallon
Quoted 6 lines

See Shawn's "[PATCH 00/17] arch/arm/mach-* late_initcall cleanup".

I haven't looked closely at this yet. I think there may be some platforms where the late_initcall's might cause a problem when making an ARM unified kernel.

Hmm, I see. It's a bit annoying that it makes the code less clean, but I can't really see any other nice way of doing it :-/.

Well, we could treat crunch as a special case and not call it through the init_late callback but instead add a check in crunch_init() detect the presence of crunch hardware. We don't have to replace every late_initcall with the new method, although it only makes sense to apply the series if we do most of them.

Arnd

author
#21 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

In reply to Ryan Mallon
Quoted 3 lines · Ryan Mallon

Hmm, I see. It's a bit annoying that it makes the code less clean, but I can't really see any other nice way of doing it :-/.

I guess you will feel the gain if you have more stuff later that need to get done in late_initcall time, especially when these stuff are soc specific or even board specific.

Signature · 2 lines
Regards,
Shawn
#22 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

In reply to Shawn Guo
Quoted 4 lines · Shawn Guo
Cc Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>
Quoted 12 lines
---
 arch/arm/mach-ep93xx/adssphere.c             |    1 +
 arch/arm/mach-ep93xx/core.c                  |    5 +++++
 arch/arm/mach-ep93xx/crunch.c                |    4 +---
 arch/arm/mach-ep93xx/gesbc9312.c             |    1 +
 arch/arm/mach-ep93xx/include/mach/platform.h |    7 +++++++
 arch/arm/mach-ep93xx/micro9.c                |    4 ++++
 arch/arm/mach-ep93xx/simone.c                |    1 +
 arch/arm/mach-ep93xx/snappercl15.c           |    1 +
 arch/arm/mach-ep93xx/ts72xx.c                |    1 +
 arch/arm/mach-ep93xx/vision_ep9307.c         |    1 +
 10 files changed, 23 insertions(+), 3 deletions(-)

The machines defined in arch/arm/mach-ep93xx/edb93xx.c are missing the .init_late addition.

Regards,
Hartley

author
#23 lore raw

PATCH 4/17 ARM: ep93xx: use machine specific hook for late init

Quoted 18 lines · H Hartley Sweeten
Quoted 4 lines · Shawn Guo
Cc Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>
Quoted 12 lines
---
 arch/arm/mach-ep93xx/adssphere.c             |    1 +
 arch/arm/mach-ep93xx/core.c                  |    5 +++++
 arch/arm/mach-ep93xx/crunch.c                |    4 +---
 arch/arm/mach-ep93xx/gesbc9312.c             |    1 +
 arch/arm/mach-ep93xx/include/mach/platform.h |    7 +++++++
 arch/arm/mach-ep93xx/micro9.c                |    4 ++++
 arch/arm/mach-ep93xx/simone.c                |    1 +
 arch/arm/mach-ep93xx/snappercl15.c           |    1 +
 arch/arm/mach-ep93xx/ts72xx.c                |    1 +
 arch/arm/mach-ep93xx/vision_ep9307.c         |    1 +
 10 files changed, 23 insertions(+), 3 deletions(-)
Quoted 3 lines

The machines defined in arch/arm/mach-ep93xx/edb93xx.c are missing the .init_late addition.

How did I get it missed? Thanks for the catching, Hartley.

Signature · 2 lines
Regards,
Shawn
author
#24 lore raw

PATCH 5/17 ARM: exynos: use machine specific hook for late init

In reply to Shawn Guo
---
 arch/arm/mach-exynos/common.c              |    5 +++++
 arch/arm/mach-exynos/common.h              |    7 +++++++
 arch/arm/mach-exynos/mach-armlex4210.c     |    1 +
 arch/arm/mach-exynos/mach-exynos4-dt.c     |    1 +
 arch/arm/mach-exynos/mach-exynos5-dt.c     |    1 +
 arch/arm/mach-exynos/mach-nuri.c           |    1 +
 arch/arm/mach-exynos/mach-origen.c         |    1 +
 arch/arm/mach-exynos/mach-smdk4x12.c       |    1 +
 arch/arm/mach-exynos/mach-smdkv310.c       |    1 +
 arch/arm/mach-exynos/mach-universal_c210.c |    1 +
 arch/arm/mach-exynos/pm_domains.c          |    3 +--
 11 files changed, 21 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/common.c +5 -0
index 8614aab..16da001 100644
@@ -285,6 +285,11 @@ void exynos5_restart(char mode, const char *cmd)
 	__raw_writel(0x1, EXYNOS_SWRESET);
 }
 
+void __init exynos_init_late(void)
+{
+	exynos_pm_late_initcall();
+}
+
 /*
  * exynos_map_io
  *
arch/arm/mach-exynos/common.h +7 -0
index 677b546..aed2eeb 100644
@@ -19,6 +19,13 @@ void exynos4_init_irq(void);
 void exynos5_init_irq(void);
 void exynos4_restart(char mode, const char *cmd);
 void exynos5_restart(char mode, const char *cmd);
+void exynos_init_late(void);
+
+#ifdef CONFIG_PM_GENERIC_DOMAINS
+int exynos_pm_late_initcall(void);
+#else
+static int exynos_pm_late_initcall(void) { return 0; }
+#endif
 
 #ifdef CONFIG_ARCH_EXYNOS4
 void exynos4_register_clocks(void);
arch/arm/mach-exynos/mach-armlex4210.c +1 -0
index d726fcd..40eaa8c5 100644
@@ -214,6 +214,7 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
 	.map_io		= armlex4210_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= armlex4210_machine_init,
+	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
 	.restart	= exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-exynos4-dt.c +1 -0
index 8245f1c..e7e9743 100644
@@ -83,6 +83,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
 	.map_io		= exynos4210_dt_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= exynos4210_dt_machine_init,
+	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
 	.dt_compat	= exynos4210_dt_compat,
 	.restart        = exynos4_restart,
arch/arm/mach-exynos/mach-exynos5-dt.c +1 -0
index 4711c89..5b1ab97 100644
@@ -72,6 +72,7 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
 	.map_io		= exynos5250_dt_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= exynos5250_dt_machine_init,
+	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
 	.dt_compat	= exynos5250_dt_compat,
 	.restart        = exynos5_restart,
arch/arm/mach-exynos/mach-nuri.c +1 -0
index b4f1f90..5d68532 100644
@@ -1350,6 +1350,7 @@ MACHINE_START(NURI, "NURI")
 	.map_io		= nuri_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= nuri_machine_init,
+	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
 	.reserve        = &nuri_reserve,
 	.restart	= exynos4_restart,
arch/arm/mach-exynos/mach-origen.c +1 -0
index 878d4c9..263ba44 100644
@@ -735,6 +735,7 @@ MACHINE_START(ORIGEN, "ORIGEN")
 	.map_io		= origen_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= origen_machine_init,
+	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
 	.reserve	= &origen_reserve,
 	.restart	= exynos4_restart,
arch/arm/mach-exynos/mach-smdk4x12.c +1 -0
index d00e4f0..763967d 100644
@@ -303,6 +303,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
 	.map_io		= smdk4x12_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= smdk4x12_machine_init,
+	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
 	.restart	= exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-smdkv310.c +1 -0
index 83b91fa..f9d2b31 100644
@@ -393,6 +393,7 @@ MACHINE_START(SMDKC210, "SMDKC210")
 	.map_io		= smdkv310_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= smdkv310_machine_init,
+	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
 	.restart	= exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-universal_c210.c +1 -0
index 7ebf79c..7c34886 100644
@@ -1112,6 +1112,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
 	.map_io		= universal_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= universal_machine_init,
+	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
 	.reserve        = &universal_reserve,
 	.restart	= exynos4_restart,
arch/arm/mach-exynos/pm_domains.c +1 -2
index 13b3068..e9fafcf 100644
@@ -193,9 +193,8 @@ static __init int exynos4_pm_init_power_domain(void)
 }
 arch_initcall(exynos4_pm_init_power_domain);
 
-static __init int exynos_pm_late_initcall(void)
+int __init exynos_pm_late_initcall(void)
 {
 	pm_genpd_poweroff_unused();
 	return 0;
 }
-late_initcall(exynos_pm_late_initcall);
Signature · 1 line
1.7.5.4
author
#25 lore raw

PATCH 6/17 ARM: imx: use machine specific hook for late init

In reply to Shawn Guo
Cc Sascha Hauer <[email protected]>
---
 arch/arm/mach-imx/cpu-imx5.c            |    6 +---
 arch/arm/mach-imx/imx51-dt.c            |    1 +
 arch/arm/mach-imx/mach-cpuimx51.c       |    1 +
 arch/arm/mach-imx/mach-cpuimx51sd.c     |    1 +
 arch/arm/mach-imx/mach-mx51_3ds.c       |    1 +
 arch/arm/mach-imx/mach-mx51_babbage.c   |    1 +
 arch/arm/mach-imx/mach-mx51_efikamx.c   |   42 +++++++++++++++++--------------
 arch/arm/mach-imx/mach-mx51_efikasb.c   |   28 +++++++++++---------
 arch/arm/mach-imx/mach-pcm037.c         |    6 ++++
 arch/arm/mach-imx/mach-pcm037_eet.c     |    6 +---
 arch/arm/mach-imx/mm-imx5.c             |    5 +++
 arch/arm/mach-imx/pcm037.h              |    6 ++++
 arch/arm/plat-mxc/include/mach/common.h |    7 +++++
 13 files changed, 70 insertions(+), 41 deletions(-)
arch/arm/mach-imx/cpu-imx5.c +1 -5
index aa15c51..8eb15a2 100644
@@ -62,11 +62,8 @@ EXPORT_SYMBOL(mx51_revision);
  * Dependent on link order - so the assumption is that vfp_init is called
  * before us.
  */
-static int __init mx51_neon_fixup(void)
+int __init mx51_neon_fixup(void)
 {
-	if (!cpu_is_mx51())
-		return 0;
-
 	if (mx51_revision() < IMX_CHIP_REVISION_3_0 &&
 			(elf_hwcap & HWCAP_NEON)) {
 		elf_hwcap &= ~HWCAP_NEON;
@@ -75,7 +72,6 @@ static int __init mx51_neon_fixup(void)
 	return 0;
 }
 
-late_initcall(mx51_neon_fixup);
 #endif
 
 static int get_mx53_srev(void)
arch/arm/mach-imx/imx51-dt.c +1 -0
index 5cca5739..da4f4f5 100644
@@ -115,6 +115,7 @@ DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
 	.handle_irq	= imx51_handle_irq,
 	.timer		= &imx51_timer,
 	.init_machine	= imx51_dt_init,
+	.init_late	= imx51_init_late,
 	.dt_compat	= imx51_dt_board_compat,
 	.restart	= mxc_restart,
 MACHINE_END
arch/arm/mach-imx/mach-cpuimx51.c +1 -0
index 944025d..4bd7c76 100644
@@ -297,5 +297,6 @@ MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module")
 	.handle_irq = imx51_handle_irq,
 	.timer = &mxc_timer,
 	.init_machine = eukrea_cpuimx51_init,
+	.init_late	= imx51_init_late,
 	.restart	= mxc_restart,
 MACHINE_END
arch/arm/mach-imx/mach-cpuimx51sd.c +1 -0
index 9fbe923..0b8770f 100644
@@ -335,5 +335,6 @@ MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
 	.handle_irq = imx51_handle_irq,
 	.timer = &mxc_timer,
 	.init_machine = eukrea_cpuimx51sd_init,
+	.init_late	= imx51_init_late,
 	.restart	= mxc_restart,
 MACHINE_END
arch/arm/mach-imx/mach-mx51_3ds.c +1 -0
index 83eab41..3c5b163 100644
@@ -175,5 +175,6 @@ MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
 	.handle_irq = imx51_handle_irq,
 	.timer = &mx51_3ds_timer,
 	.init_machine = mx51_3ds_init,
+	.init_late	= imx51_init_late,
 	.restart	= mxc_restart,
 MACHINE_END
arch/arm/mach-imx/mach-mx51_babbage.c +1 -0
index e4b822e..f3b0115 100644
@@ -426,5 +426,6 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
 	.handle_irq = imx51_handle_irq,
 	.timer = &mx51_babbage_timer,
 	.init_machine = mx51_babbage_init,
+	.init_late	= imx51_init_late,
 	.restart	= mxc_restart,
 MACHINE_END
arch/arm/mach-imx/mach-mx51_efikamx.c +23 -19

57 lines not on this page · raw message

arch/arm/mach-imx/mach-mx51_efikasb.c +16 -12
index 24aded9..e73db38 100644
@@ -211,22 +211,25 @@ static void mx51_efikasb_power_off(void)
 
 static int __init mx51_efikasb_power_init(void)
 {
-	if (machine_is_mx51_efikasb()) {
-		pwgt1 = regulator_get(NULL, "pwgt1");
-		pwgt2 = regulator_get(NULL, "pwgt2");
-		if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
-			regulator_enable(pwgt1);
-			regulator_enable(pwgt2);
-		}
-		gpio_request(EFIKASB_POWEROFF, "poweroff");
-		pm_power_off = mx51_efikasb_power_off;
-
-		regulator_has_full_constraints();
+	pwgt1 = regulator_get(NULL, "pwgt1");
+	pwgt2 = regulator_get(NULL, "pwgt2");
+	if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
+		regulator_enable(pwgt1);
+		regulator_enable(pwgt2);
 	}
+	gpio_request(EFIKASB_POWEROFF, "poweroff");
+	pm_power_off = mx51_efikasb_power_off;
+
+	regulator_has_full_constraints();
 
 	return 0;
 }
-late_initcall(mx51_efikasb_power_init);
+
+static void __init mx51_efikasb_init_late(void)
+{
+	imx51_init_late();
+	mx51_efikasb_power_init();
+}
 
 /* 01     R1.3 board
    10     R2.0 board */
@@ -287,6 +290,7 @@ MACHINE_START(MX51_EFIKASB, "Genesi Efika Smartbook")
 	.init_irq = mx51_init_irq,
 	.handle_irq = imx51_handle_irq,
 	.init_machine =  efikasb_board_init,
+	.init_late = mx51_efikasb_init_late,
 	.timer = &mx51_efikasb_timer,
 	.restart	= mxc_restart,
 MACHINE_END
arch/arm/mach-imx/mach-pcm037.c +6 -0
index 5fddf94..3aba3a9 100644
@@ -694,6 +694,11 @@ static void __init pcm037_reserve(void)
 			MX3_CAMERA_BUF_SIZE);
 }
 
+static void __init pcm037_init_late(void)
+{
+	pcm037_eet_init_devices();
+}
+
 MACHINE_START(PCM037, "Phytec Phycore pcm037")
 	/* Maintainer: Pengutronix */
 	.atag_offset = 0x100,
@@ -704,5 +709,6 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
 	.handle_irq = imx31_handle_irq,
 	.timer = &pcm037_timer,
 	.init_machine = pcm037_init,
+	.init_late = pcm037_init_late,
 	.restart	= mxc_restart,
 MACHINE_END
arch/arm/mach-imx/mach-pcm037_eet.c +1 -5
index 1b7606b..1a55c47 100644
@@ -160,11 +160,8 @@ static const struct gpio_keys_platform_data
 	.rep		= 0, /* No auto-repeat */
 };
 
-static int __init eet_init_devices(void)
+int __init pcm037_eet_init_devices(void)
 {
-	if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET)
-		return 0;
-
 	mxc_iomux_setup_multiple_pins(pcm037_eet_pins,
 				ARRAY_SIZE(pcm037_eet_pins), "pcm037_eet");
 
@@ -176,4 +173,3 @@ static int __init eet_init_devices(void)
 
 	return 0;
 }
-late_initcall(eet_init_devices);
arch/arm/mach-imx/mm-imx5.c +5 -0
index e10f391..d6b7e9f 100644
@@ -234,3 +234,8 @@ void __init imx53_soc_init(void)
 	platform_device_register_simple("imx31-audmux", 0, imx53_audmux_res,
 					ARRAY_SIZE(imx53_audmux_res));
 }
+
+void __init imx51_init_late(void)
+{
+	mx51_neon_fixup();
+}
arch/arm/mach-imx/pcm037.h +6 -0
index d692972..7d16769 100644
@@ -8,4 +8,10 @@ enum pcm037_board_variant {
 
 extern enum pcm037_board_variant pcm037_variant(void);
 
+#ifdef CONFIG_MACH_PCM037_EET
+int pcm037_eet_init_devices(void);
+#else
+static inline int pcm037_eet_init_devices(void) { return 0; }
+#endif
+
 #endif
arch/arm/plat-mxc/include/mach/common.h +7 -0
index 0319c4a..cf663d8 100644
@@ -53,6 +53,7 @@ extern void imx35_soc_init(void);
 extern void imx50_soc_init(void);
 extern void imx51_soc_init(void);
 extern void imx53_soc_init(void);
+extern void imx51_init_late(void);
 extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq);
 extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int);
 extern int mx1_clocks_init(unsigned long fref);
@@ -149,4 +150,10 @@ extern void imx6q_pm_init(void);
 static inline void imx6q_pm_init(void) {}
 #endif
 
+#ifdef CONFIG_NEON
+extern int mx51_neon_fixup(void);
+#else
+static inline int mx51_neon_fixup(void) { return 0; }
+#endif
+
 #endif
Signature · 1 line
1.7.5.4
maintainer
#26 lore raw

PATCH 6/17 ARM: imx: use machine specific hook for late init

arch/arm/mach-imx/mach-pcm037_eet.c static const struct gpio_keys_platform_data · line 166

Quoted 6 lines · Shawn Guo
Cc Sascha Hauer <[email protected]>
arch/arm/mach-imx/mach-pcm037_eet.c +1 -3
-static int __init eet_init_devices(void)
+int __init pcm037_eet_init_devices(void)
 {
-	if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET)
-		return 0;

The pcm037_variant() != PCM037_EET gets lost here.

Otherwise looks good.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author
#27 lore raw

PATCH 6/17 ARM: imx: use machine specific hook for late init

Quoted 10 lines · Sascha Hauer

arch/arm/mach-imx/mach-pcm037_eet.c static const struct gpio_keys_platform_data · line 166

Quoted 6 lines · Shawn Guo
Cc Sascha Hauer <[email protected]>
arch/arm/mach-imx/mach-pcm037_eet.c +1 -3
-static int __init eet_init_devices(void)
+int __init pcm037_eet_init_devices(void)
 {
-	if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET)
-		return 0;

The pcm037_variant() != PCM037_EET gets lost here.

Yes. Thanks for the catching. Will fix it.

Signature · 2 lines
Regards,
Shawn
author
#28 lore raw

PATCH 7/17 ARM: kirkwood: use machine specific hook for late init

In reply to Shawn Guo
Cc Lennert Buytenhek <[email protected]>
Cc Nicolas Pitre <[email protected]>
---
 arch/arm/mach-kirkwood/board-dt.c              |    1 +
 arch/arm/mach-kirkwood/common.c                |    6 +++++-
 arch/arm/mach-kirkwood/common.h                |    1 +
 arch/arm/mach-kirkwood/d2net_v2-setup.c        |    1 +
 arch/arm/mach-kirkwood/db88f6281-bp-setup.c    |    1 +
 arch/arm/mach-kirkwood/dockstar-setup.c        |    1 +
 arch/arm/mach-kirkwood/guruplug-setup.c        |    1 +
 arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c |    1 +
 arch/arm/mach-kirkwood/netspace_v2-setup.c     |    3 +++
 arch/arm/mach-kirkwood/netxbig_v2-setup.c      |    2 ++
 arch/arm/mach-kirkwood/openrd-setup.c          |    3 +++
 arch/arm/mach-kirkwood/rd88f6192-nas-setup.c   |    1 +
 arch/arm/mach-kirkwood/rd88f6281-setup.c       |    1 +
 arch/arm/mach-kirkwood/sheevaplug-setup.c      |    2 ++
 arch/arm/mach-kirkwood/t5325-setup.c           |    1 +
 arch/arm/mach-kirkwood/ts219-setup.c           |    1 +
 arch/arm/mach-kirkwood/ts41x-setup.c           |    1 +
 17 files changed, 27 insertions(+), 1 deletions(-)
arch/arm/mach-kirkwood/board-dt.c +1 -0
index 1c672d9..aaa495c 100644
@@ -70,6 +70,7 @@ DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
 	.init_irq	= kirkwood_init_irq,
 	.timer		= &kirkwood_timer,
 	.init_machine	= kirkwood_dt_init,
+	.init_late	= kirkwood_init_late,
 	.restart	= kirkwood_restart,
 	.dt_compat	= kirkwood_dt_board_compat,
 MACHINE_END
arch/arm/mach-kirkwood/common.c +5 -1
index a02cae8..af88ffe 100644
@@ -530,7 +530,6 @@ static int __init kirkwood_clock_gate(void)
 
 	return 0;
 }
-late_initcall(kirkwood_clock_gate);
 
 void kirkwood_restart(char mode, const char *cmd)
 {
@@ -547,3 +546,8 @@ void kirkwood_restart(char mode, const char *cmd)
 	while (1)
 		;
 }
+
+void __init kirkwood_init_late(void)
+{
+	kirkwood_clock_gate();
+}
arch/arm/mach-kirkwood/common.h +1 -0
index fa8e768..6d8829e 100644
@@ -50,6 +50,7 @@ void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
 void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev_ready)(struct mtd_info *));
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
+void kirkwood_init_late(void);
 
 /* board init functions for boards not fully converted to fdt */
 #ifdef CONFIG_MACH_DREAMPLUG_DT
arch/arm/mach-kirkwood/d2net_v2-setup.c +1 -0
index 6e1bac9..94ddb45 100644
@@ -226,6 +226,7 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/db88f6281-bp-setup.c +1 -0
index d933593..1edc314 100644
@@ -102,6 +102,7 @@ MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/dockstar-setup.c +1 -0
index 61d9a55..3ffd50f 100644
@@ -107,6 +107,7 @@ MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/guruplug-setup.c +1 -0
index bdaed38..b5c0cc2 100644
@@ -126,6 +126,7 @@ MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c +1 -0
index 85f6169..25943da 100644
@@ -168,6 +168,7 @@ MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/netspace_v2-setup.c +3 -0
index e6bba01..06ed9b0 100644
@@ -263,6 +263,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
@@ -275,6 +276,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
@@ -287,6 +289,7 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/netxbig_v2-setup.c +2 -0
index 31ae8de..ec0a1ebd 100644
@@ -404,6 +404,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
@@ -416,6 +417,7 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/openrd-setup.c +3 -0
index 7e99c3f..8d58f32 100644
@@ -225,6 +225,7 @@ MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
@@ -238,6 +239,7 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
@@ -251,6 +253,7 @@ MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/rd88f6192-nas-setup.c +1 -0
index fd2c9c8..c9cc221 100644
@@ -84,6 +84,7 @@ MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/rd88f6281-setup.c +1 -0
index ef92207..0863bb0 100644
@@ -120,6 +120,7 @@ MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/sheevaplug-setup.c +2 -0
index 4ea70e5f..51ba9be 100644
@@ -143,6 +143,7 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
@@ -155,6 +156,7 @@ MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/t5325-setup.c +1 -0
index f9d2a11..498f83e 100644
@@ -212,6 +212,7 @@ MACHINE_START(T5325, "HP t5325 Thin Client")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/ts219-setup.c +1 -0
index 73e2b6c..8b217ce 100644
@@ -137,6 +137,7 @@ MACHINE_START(TS219, "QNAP TS-119/TS-219")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
arch/arm/mach-kirkwood/ts41x-setup.c +1 -0
index 5bbca26..cb77ab9 100644
@@ -181,6 +181,7 @@ MACHINE_START(TS41X, "QNAP TS-41x")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
+	.init_late	= kirkwood_init_late,
 	.timer		= &kirkwood_timer,
 	.restart	= kirkwood_restart,
 MACHINE_END
Signature · 1 line
1.7.5.4
author
#29 lore raw

PATCH 8/17 ARM: msm: use machine specific hook for late init

In reply to Shawn Guo
Cc David Brown <[email protected]>
Cc Daniel Walker <[email protected]>
Cc Bryan Huntsman <[email protected]>
---
 arch/arm/mach-msm/board-halibut.c      |    7 +++++++
 arch/arm/mach-msm/board-mahimahi.c     |    7 +++++++
 arch/arm/mach-msm/board-msm7x27.c      |   10 ++++++++++
 arch/arm/mach-msm/board-msm7x30.c      |    9 +++++++++
 arch/arm/mach-msm/board-msm8960.c      |    8 ++++++++
 arch/arm/mach-msm/board-msm8x60.c      |   11 +++++++++++
 arch/arm/mach-msm/board-qsd8x50.c      |    8 ++++++++
 arch/arm/mach-msm/board-sapphire.c     |    7 +++++++
 arch/arm/mach-msm/board-trout.c        |    7 +++++++
 arch/arm/mach-msm/clock.c              |    4 +---
 arch/arm/mach-msm/include/mach/board.h |    7 +++++++
 arch/arm/mach-msm/smd_debug.c          |    3 +--
 12 files changed, 83 insertions(+), 5 deletions(-)
arch/arm/mach-msm/board-halibut.c +7 -0
index 26aac36..f60944c 100644
@@ -94,6 +94,12 @@ static void __init halibut_map_io(void)
 	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
+static void __init halibut_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
 	.atag_offset	= 0x100,
 	.fixup		= halibut_fixup,
@@ -101,5 +107,6 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
 	.init_early	= halibut_init_early,
 	.init_irq	= halibut_init_irq,
 	.init_machine	= halibut_init,
+	.init_late	= halibut_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-mahimahi.c +7 -0
index 5a4882f..6ee7c9a 100644
@@ -71,6 +71,12 @@ static void __init mahimahi_map_io(void)
 	msm_clock_init();
 }
 
+static void __init mahimahi_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 extern struct sys_timer msm_timer;
 
 MACHINE_START(MAHIMAHI, "mahimahi")
@@ -79,5 +85,6 @@ MACHINE_START(MAHIMAHI, "mahimahi")
 	.map_io		= mahimahi_map_io,
 	.init_irq	= msm_init_irq,
 	.init_machine	= mahimahi_init,
+	.init_late	= mahimahi_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-msm7x27.c +10 -0
index 6d84ee7..8e8ca0f 100644
@@ -128,11 +128,18 @@ static void __init msm7x2x_map_io(void)
 #endif
 }
 
+static void __init msm7x2x_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
 	.atag_offset	= 0x100,
 	.map_io		= msm7x2x_map_io,
 	.init_irq	= msm7x2x_init_irq,
 	.init_machine	= msm7x2x_init,
+	.init_late	= msm7x2x_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
 
@@ -141,6 +148,7 @@ MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
 	.map_io		= msm7x2x_map_io,
 	.init_irq	= msm7x2x_init_irq,
 	.init_machine	= msm7x2x_init,
+	.init_late	= msm7x2x_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
 
@@ -149,6 +157,7 @@ MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
 	.map_io		= msm7x2x_map_io,
 	.init_irq	= msm7x2x_init_irq,
 	.init_machine	= msm7x2x_init,
+	.init_late	= msm7x2x_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
 
@@ -157,5 +166,6 @@ MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
 	.map_io		= msm7x2x_map_io,
 	.init_irq	= msm7x2x_init_irq,
 	.init_machine	= msm7x2x_init,
+	.init_late	= msm7x2x_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-msm7x30.c +9 -0
index db81ed5..a71d8f9 100644
@@ -120,6 +120,12 @@ static void __init msm7x30_map_io(void)
 	msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
 }
 
+static void __init msm7x30_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
 	.atag_offset = 0x100,
 	.fixup = msm7x30_fixup,
@@ -127,6 +133,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
 	.map_io = msm7x30_map_io,
 	.init_irq = msm7x30_init_irq,
 	.init_machine = msm7x30_init,
+	.init_late = msm7x30_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -137,6 +144,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
 	.map_io = msm7x30_map_io,
 	.init_irq = msm7x30_init_irq,
 	.init_machine = msm7x30_init,
+	.init_late = msm7x30_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -147,5 +155,6 @@ MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
 	.map_io = msm7x30_map_io,
 	.init_irq = msm7x30_init_irq,
 	.init_machine = msm7x30_init,
+	.init_late = msm7x30_init_late,
 	.timer = &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-msm8960.c +8 -0
index ed35981..4eb8232 100644
@@ -93,6 +93,12 @@ static void __init msm8960_rumi3_init(void)
 	platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
 }
 
+static void __init msm8960_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
 	.fixup = msm8960_fixup,
 	.reserve = msm8960_reserve,
@@ -101,6 +107,7 @@ MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
 	.timer = &msm_timer,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8960_sim_init,
+	.init_late = msm8960_init_late,
 MACHINE_END
 
 MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
@@ -111,5 +118,6 @@ MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
 	.timer = &msm_timer,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8960_rumi3_init,
+	.init_late = msm8960_init_late,
 MACHINE_END
 
arch/arm/mach-msm/board-msm8x60.c +11 -0
index 962e711..1dd6ce7 100644
@@ -68,6 +68,12 @@ static void __init msm8x60_init(void)
 {
 }
 
+static void __init msm8x60_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 #ifdef CONFIG_OF
 static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = {
 	{}
@@ -106,6 +112,7 @@ MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8x60_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -116,6 +123,7 @@ MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8x60_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -126,6 +134,7 @@ MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8x60_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -136,6 +145,7 @@ MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8x60_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -145,6 +155,7 @@ DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
 	.map_io = msm8x60_map_io,
 	.init_irq = msm8x60_init_irq,
 	.init_machine = msm8x60_dt_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 	.dt_compat = msm8x60_fluid_match,
 MACHINE_END
arch/arm/mach-msm/board-qsd8x50.c +8 -0
index 7e8909c..45ce374 100644
@@ -191,11 +191,18 @@ static void __init qsd8x50_init(void)
 	qsd8x50_init_mmc();
 }
 
+static void __init qsd8x50_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
 	.atag_offset = 0x100,
 	.map_io = qsd8x50_map_io,
 	.init_irq = qsd8x50_init_irq,
 	.init_machine = qsd8x50_init,
+	.init_late = qsd8x50_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -204,5 +211,6 @@ MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
 	.map_io = qsd8x50_map_io,
 	.init_irq = qsd8x50_init_irq,
 	.init_machine = qsd8x50_init,
+	.init_late = qsd8x50_init_late,
 	.timer = &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-sapphire.c +7 -0
index 4a8ea0d..9ca39ec 100644
@@ -101,6 +101,12 @@ static void __init sapphire_map_io(void)
 	msm_clock_init();
 }
 
+static void __init sapphire_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(SAPPHIRE, "sapphire")
 /* Maintainer: Brian Swetland <[email protected]> */
 	.atag_offset    = 0x100,
@@ -108,5 +114,6 @@ MACHINE_START(SAPPHIRE, "sapphire")
 	.map_io         = sapphire_map_io,
 	.init_irq       = sapphire_init_irq,
 	.init_machine   = sapphire_init,
+	.init_late      = sapphire_init_late,
 	.timer          = &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-trout.c +7 -0
index d4060a3..c66bd81 100644
@@ -98,6 +98,12 @@ static void __init trout_map_io(void)
 	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
+static void __init trout_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(TROUT, "HTC Dream")
 	.atag_offset	= 0x100,
 	.fixup		= trout_fixup,
@@ -105,5 +111,6 @@ MACHINE_START(TROUT, "HTC Dream")
 	.init_early	= trout_init_early,
 	.init_irq	= trout_init_irq,
 	.init_machine	= trout_init,
+	.init_late	= trout_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
arch/arm/mach-msm/clock.c +1 -3
index d9145df..4b06db1 100644
@@ -156,7 +156,7 @@ void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks)
  * Disable any clocks that belong to us (CLKFLAG_AUTO_OFF) but have
  * not been explicitly enabled by a clk_enable() call.
  */
-static int __init clock_late_init(void)
+int __init msm_clock_late_init(void)
 {
 	unsigned long flags;
 	struct clk *clk;
@@ -180,5 +180,3 @@ static int __init clock_late_init(void)
 	return 0;
 }
 
-late_initcall(clock_late_init);
-
arch/arm/mach-msm/include/mach/board.h +7 -0
index 2ce8f1f..ae5a67b 100644
@@ -42,9 +42,16 @@ void __init msm_map_common_io(void);
 void __init msm_init_irq(void);
 void __init msm_init_gpio(void);
 void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks);
+int __init msm_clock_late_init(void);
 void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *);
 int __init msm_add_sdcc(unsigned int controller,
 			struct msm_mmc_platform_data *plat,
 			unsigned int stat_irq, unsigned long stat_irq_flags);
 
+#if defined(CONFIG_MSM_SMD) && defined(CONFIG_DEBUG_FS)
+int smd_debugfs_init(void);
+#else
+static inline int smd_debugfs_init(void) { return 0; }
+#endif
+
 #endif
arch/arm/mach-msm/smd_debug.c +1 -2
index c56df9e..8056b3e 100644
@@ -216,7 +216,7 @@ static void debug_create(const char *name, umode_t mode,
 	debugfs_create_file(name, mode, dent, fill, &debug_ops);
 }
 
-static int smd_debugfs_init(void)
+int __init smd_debugfs_init(void)
 {
 	struct dentry *dent;
 
@@ -234,7 +234,6 @@ static int smd_debugfs_init(void)
 	return 0;
 }
 
-late_initcall(smd_debugfs_init);
 #endif
 
 
Signature · 1 line
1.7.5.4
#30 lore raw

PATCH 8/17 ARM: msm: use machine specific hook for late init

This should be ok. I'll forward it on to Saravana Kannan and Stephen Boyd, since it will affect the clock changes they are working on, but It's not too difficult to adapt.

David

Quoted 384 lines · Shawn Guo
Cc David Brown <[email protected]>
Cc Daniel Walker <[email protected]>
Cc Bryan Huntsman <[email protected]>
---
 arch/arm/mach-msm/board-halibut.c      |    7 +++++++
 arch/arm/mach-msm/board-mahimahi.c     |    7 +++++++
 arch/arm/mach-msm/board-msm7x27.c      |   10 ++++++++++
 arch/arm/mach-msm/board-msm7x30.c      |    9 +++++++++
 arch/arm/mach-msm/board-msm8960.c      |    8 ++++++++
 arch/arm/mach-msm/board-msm8x60.c      |   11 +++++++++++
 arch/arm/mach-msm/board-qsd8x50.c      |    8 ++++++++
 arch/arm/mach-msm/board-sapphire.c     |    7 +++++++
 arch/arm/mach-msm/board-trout.c        |    7 +++++++
 arch/arm/mach-msm/clock.c              |    4 +---
 arch/arm/mach-msm/include/mach/board.h |    7 +++++++
 arch/arm/mach-msm/smd_debug.c          |    3 +--
 12 files changed, 83 insertions(+), 5 deletions(-)
arch/arm/mach-msm/board-halibut.c +7 -0
index 26aac36..f60944c 100644
@@ -94,6 +94,12 @@ static void __init halibut_map_io(void)
 	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
+static void __init halibut_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
 	.atag_offset	= 0x100,
 	.fixup		= halibut_fixup,
@@ -101,5 +107,6 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
 	.init_early	= halibut_init_early,
 	.init_irq	= halibut_init_irq,
 	.init_machine	= halibut_init,
+	.init_late	= halibut_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-mahimahi.c +7 -0
index 5a4882f..6ee7c9a 100644
@@ -71,6 +71,12 @@ static void __init mahimahi_map_io(void)
 	msm_clock_init();
 }
 
+static void __init mahimahi_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 extern struct sys_timer msm_timer;
 
 MACHINE_START(MAHIMAHI, "mahimahi")
@@ -79,5 +85,6 @@ MACHINE_START(MAHIMAHI, "mahimahi")
 	.map_io		= mahimahi_map_io,
 	.init_irq	= msm_init_irq,
 	.init_machine	= mahimahi_init,
+	.init_late	= mahimahi_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-msm7x27.c +10 -0
index 6d84ee7..8e8ca0f 100644
@@ -128,11 +128,18 @@ static void __init msm7x2x_map_io(void)
 #endif
 }
 
+static void __init msm7x2x_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
 	.atag_offset	= 0x100,
 	.map_io		= msm7x2x_map_io,
 	.init_irq	= msm7x2x_init_irq,
 	.init_machine	= msm7x2x_init,
+	.init_late	= msm7x2x_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
 
@@ -141,6 +148,7 @@ MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
 	.map_io		= msm7x2x_map_io,
 	.init_irq	= msm7x2x_init_irq,
 	.init_machine	= msm7x2x_init,
+	.init_late	= msm7x2x_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
 
@@ -149,6 +157,7 @@ MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
 	.map_io		= msm7x2x_map_io,
 	.init_irq	= msm7x2x_init_irq,
 	.init_machine	= msm7x2x_init,
+	.init_late	= msm7x2x_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
 
@@ -157,5 +166,6 @@ MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
 	.map_io		= msm7x2x_map_io,
 	.init_irq	= msm7x2x_init_irq,
 	.init_machine	= msm7x2x_init,
+	.init_late	= msm7x2x_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-msm7x30.c +9 -0
index db81ed5..a71d8f9 100644
@@ -120,6 +120,12 @@ static void __init msm7x30_map_io(void)
 	msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
 }
 
+static void __init msm7x30_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
 	.atag_offset = 0x100,
 	.fixup = msm7x30_fixup,
@@ -127,6 +133,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
 	.map_io = msm7x30_map_io,
 	.init_irq = msm7x30_init_irq,
 	.init_machine = msm7x30_init,
+	.init_late = msm7x30_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -137,6 +144,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
 	.map_io = msm7x30_map_io,
 	.init_irq = msm7x30_init_irq,
 	.init_machine = msm7x30_init,
+	.init_late = msm7x30_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -147,5 +155,6 @@ MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
 	.map_io = msm7x30_map_io,
 	.init_irq = msm7x30_init_irq,
 	.init_machine = msm7x30_init,
+	.init_late = msm7x30_init_late,
 	.timer = &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-msm8960.c +8 -0
index ed35981..4eb8232 100644
@@ -93,6 +93,12 @@ static void __init msm8960_rumi3_init(void)
 	platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
 }
 
+static void __init msm8960_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
 	.fixup = msm8960_fixup,
 	.reserve = msm8960_reserve,
@@ -101,6 +107,7 @@ MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
 	.timer = &msm_timer,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8960_sim_init,
+	.init_late = msm8960_init_late,
 MACHINE_END
 
 MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
@@ -111,5 +118,6 @@ MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
 	.timer = &msm_timer,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8960_rumi3_init,
+	.init_late = msm8960_init_late,
 MACHINE_END
 
arch/arm/mach-msm/board-msm8x60.c +11 -0
index 962e711..1dd6ce7 100644
@@ -68,6 +68,12 @@ static void __init msm8x60_init(void)
 {
 }
 
+static void __init msm8x60_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 #ifdef CONFIG_OF
 static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = {
 	{}
@@ -106,6 +112,7 @@ MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8x60_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -116,6 +123,7 @@ MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8x60_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -126,6 +134,7 @@ MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8x60_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -136,6 +145,7 @@ MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
 	.init_machine = msm8x60_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -145,6 +155,7 @@ DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
 	.map_io = msm8x60_map_io,
 	.init_irq = msm8x60_init_irq,
 	.init_machine = msm8x60_dt_init,
+	.init_late = msm8x60_init_late,
 	.timer = &msm_timer,
 	.dt_compat = msm8x60_fluid_match,
 MACHINE_END
arch/arm/mach-msm/board-qsd8x50.c +8 -0
index 7e8909c..45ce374 100644
@@ -191,11 +191,18 @@ static void __init qsd8x50_init(void)
 	qsd8x50_init_mmc();
 }
 
+static void __init qsd8x50_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
 	.atag_offset = 0x100,
 	.map_io = qsd8x50_map_io,
 	.init_irq = qsd8x50_init_irq,
 	.init_machine = qsd8x50_init,
+	.init_late = qsd8x50_init_late,
 	.timer = &msm_timer,
 MACHINE_END
 
@@ -204,5 +211,6 @@ MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
 	.map_io = qsd8x50_map_io,
 	.init_irq = qsd8x50_init_irq,
 	.init_machine = qsd8x50_init,
+	.init_late = qsd8x50_init_late,
 	.timer = &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-sapphire.c +7 -0
index 4a8ea0d..9ca39ec 100644
@@ -101,6 +101,12 @@ static void __init sapphire_map_io(void)
 	msm_clock_init();
 }
 
+static void __init sapphire_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(SAPPHIRE, "sapphire")
 /* Maintainer: Brian Swetland <[email protected]> */
 	.atag_offset    = 0x100,
@@ -108,5 +114,6 @@ MACHINE_START(SAPPHIRE, "sapphire")
 	.map_io         = sapphire_map_io,
 	.init_irq       = sapphire_init_irq,
 	.init_machine   = sapphire_init,
+	.init_late      = sapphire_init_late,
 	.timer          = &msm_timer,
 MACHINE_END
arch/arm/mach-msm/board-trout.c +7 -0
index d4060a3..c66bd81 100644
@@ -98,6 +98,12 @@ static void __init trout_map_io(void)
 	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
+static void __init trout_init_late(void)
+{
+	msm_clock_late_init();
+	smd_debugfs_init();
+}
+
 MACHINE_START(TROUT, "HTC Dream")
 	.atag_offset	= 0x100,
 	.fixup		= trout_fixup,
@@ -105,5 +111,6 @@ MACHINE_START(TROUT, "HTC Dream")
 	.init_early	= trout_init_early,
 	.init_irq	= trout_init_irq,
 	.init_machine	= trout_init,
+	.init_late	= trout_init_late,
 	.timer		= &msm_timer,
 MACHINE_END
arch/arm/mach-msm/clock.c +1 -3
index d9145df..4b06db1 100644
@@ -156,7 +156,7 @@ void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks)
  * Disable any clocks that belong to us (CLKFLAG_AUTO_OFF) but have
  * not been explicitly enabled by a clk_enable() call.
  */
-static int __init clock_late_init(void)
+int __init msm_clock_late_init(void)
 {
 	unsigned long flags;
 	struct clk *clk;
@@ -180,5 +180,3 @@ static int __init clock_late_init(void)
 	return 0;
 }
 
-late_initcall(clock_late_init);
-
arch/arm/mach-msm/include/mach/board.h +7 -0
index 2ce8f1f..ae5a67b 100644
@@ -42,9 +42,16 @@ void __init msm_map_common_io(void);
 void __init msm_init_irq(void);
 void __init msm_init_gpio(void);
 void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks);
+int __init msm_clock_late_init(void);
 void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *);
 int __init msm_add_sdcc(unsigned int controller,
 			struct msm_mmc_platform_data *plat,
 			unsigned int stat_irq, unsigned long stat_irq_flags);
 
+#if defined(CONFIG_MSM_SMD) && defined(CONFIG_DEBUG_FS)
+int smd_debugfs_init(void);
+#else
+static inline int smd_debugfs_init(void) { return 0; }
+#endif
+
 #endif
arch/arm/mach-msm/smd_debug.c +1 -2
index c56df9e..8056b3e 100644
@@ -216,7 +216,7 @@ static void debug_create(const char *name, umode_t mode,
 	debugfs_create_file(name, mode, dent, fill, &debug_ops);
 }
 
-static int smd_debugfs_init(void)
+int __init smd_debugfs_init(void)
 {
 	struct dentry *dent;
 
@@ -234,7 +234,6 @@ static int smd_debugfs_init(void)
 	return 0;
 }
 
-late_initcall(smd_debugfs_init);
 #endif
 
 
Signature · 1 line
1.7.5.4
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
author
#31 lore raw

PATCH 8/17 ARM: msm: use machine specific hook for late init

Quoted 4 lines · David Brown

This should be ok. I'll forward it on to Saravana Kannan and Stephen Boyd, since it will affect the clock changes they are working on, but It's not too difficult to adapt.

I will drop the change on clock code, since common clk migration will kill that late_initcall anyway, so that we can save the conflict.

Regards,
Shawn

author
#32 lore raw

PATCH 9/17 ARM: omap1: use machine specific hook for late init

In reply to Shawn Guo
Cc Tony Lindgren <[email protected]>
---
 arch/arm/mach-omap1/board-ams-delta.c |    8 +++++++-
 arch/arm/mach-omap1/board-fsample.c   |    1 +
 arch/arm/mach-omap1/board-generic.c   |    1 +
 arch/arm/mach-omap1/board-h2.c        |    1 +
 arch/arm/mach-omap1/board-h3.c        |    1 +
 arch/arm/mach-omap1/board-htcherald.c |    1 +
 arch/arm/mach-omap1/board-innovator.c |    1 +
 arch/arm/mach-omap1/board-nokia770.c  |    1 +
 arch/arm/mach-omap1/board-osk.c       |    1 +
 arch/arm/mach-omap1/board-palmte.c    |    1 +
 arch/arm/mach-omap1/board-palmtt.c    |    1 +
 arch/arm/mach-omap1/board-palmz71.c   |    1 +
 arch/arm/mach-omap1/board-perseus2.c  |    1 +
 arch/arm/mach-omap1/board-sx1.c       |    1 +
 arch/arm/mach-omap1/board-voiceblue.c |    1 +
 arch/arm/mach-omap1/common.h          |   10 ++++++++++
 arch/arm/mach-omap1/io.c              |    5 +++++
 arch/arm/mach-omap1/serial.c          |    3 +--
 18 files changed, 37 insertions(+), 3 deletions(-)
arch/arm/mach-omap1/board-ams-delta.c +7 -1
index c1b681e..f2f8a58 100644
@@ -595,7 +595,12 @@ gpio_free:
 	gpio_free(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
 	return err;
 }
-late_initcall(late_init);
+
+static void __init ams_delta_init_late(void)
+{
+	omap1_init_late();
+	late_init();
+}
 
 static void __init ams_delta_map_io(void)
 {
@@ -611,6 +616,7 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= ams_delta_init,
+	.init_late	= ams_delta_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-fsample.c +1 -0
index 80bd43c..a77ee57 100644
@@ -383,6 +383,7 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= omap_fsample_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-generic.c +1 -0
index 9a5fe58..e75e2d5 100644
@@ -88,6 +88,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= omap_generic_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-h2.c +1 -0
index 553a2e5..04cf994 100644
@@ -446,6 +446,7 @@ MACHINE_START(OMAP_H2, "TI-H2")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= h2_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-h3.c +1 -0
index 4c19f4c..a11ef0a 100644
@@ -439,6 +439,7 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= h3_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-htcherald.c +1 -0
index 60c06ee..118a9d4 100644
@@ -605,6 +605,7 @@ MACHINE_START(HERALD, "HTC Herald")
 	.reserve	= omap_reserve,
 	.init_irq       = omap1_init_irq,
 	.init_machine   = htcherald_init,
+	.init_late	= omap1_init_late,
 	.timer          = &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-innovator.c +1 -0
index 67d7fd5..7970223 100644
@@ -457,6 +457,7 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= innovator_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-nokia770.c +1 -0
index d21dcc2..7212ae9 100644
@@ -255,6 +255,7 @@ MACHINE_START(NOKIA770, "Nokia 770")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= omap_nokia770_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-osk.c +1 -0
index a5f85dd..da8d872 100644
@@ -574,6 +574,7 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= osk_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-palmte.c +1 -0
index a60e6c2..949b62a 100644
@@ -267,6 +267,7 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= omap_palmte_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-palmtt.c +1 -0
index 8d85487..7f1e1cf 100644
@@ -313,6 +313,7 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= omap_palmtt_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-palmz71.c +1 -0
index a2c5abc..0711685 100644
@@ -330,6 +330,7 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= omap_palmz71_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-perseus2.c +1 -0
index 76d4ee0..512989b 100644
@@ -345,6 +345,7 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= omap_perseus2_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-sx1.c +1 -0
index f34cb74..3b7b82b 100644
@@ -407,6 +407,7 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= omap_sx1_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= omap1_restart,
 MACHINE_END
arch/arm/mach-omap1/board-voiceblue.c +1 -0
index 37232d0..afd67f0 100644
@@ -294,6 +294,7 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
 	.reserve	= omap_reserve,
 	.init_irq	= omap1_init_irq,
 	.init_machine	= voiceblue_init,
+	.init_late	= omap1_init_late,
 	.timer		= &omap1_timer,
 	.restart	= voiceblue_restart,
 MACHINE_END
arch/arm/mach-omap1/common.h +10 -0
index af658ad..0b77e6d 100644
@@ -52,8 +52,18 @@ static inline void omap16xx_map_io(void)
 }
 #endif
 
+#ifdef CONFIG_OMAP_SERIAL_WAKE
+int omap_serial_wakeup_init(void);
+#else
+static inline int omap_serial_wakeup_init(void)
+{
+	return 0;
+}
+#endif
+
 void omap1_init_early(void);
 void omap1_init_irq(void);
+void omap1_init_late(void);
 void omap1_restart(char, const char *);
 
 extern struct sys_timer omap1_timer;
arch/arm/mach-omap1/io.c +5 -0
index d969a72..cf811f2 100644
@@ -138,6 +138,11 @@ void __init omap1_init_early(void)
 	omap_init_consistent_dma_size();
 }
 
+void __init omap1_init_late(void)
+{
+	omap_serial_wakeup_init();
+}
+
 /*
  * NOTE: Please use ioremap + __raw_read/write where possible instead of these
  */
arch/arm/mach-omap1/serial.c +1 -2
index 93ae8f2..6809c9e 100644
@@ -237,7 +237,7 @@ static void __init omap_serial_set_port_wakeup(int gpio_nr)
 	enable_irq_wake(gpio_to_irq(gpio_nr));
 }
 
-static int __init omap_serial_wakeup_init(void)
+int __init omap_serial_wakeup_init(void)
 {
 	if (!cpu_is_omap16xx())
 		return 0;
@@ -251,7 +251,6 @@ static int __init omap_serial_wakeup_init(void)
 
 	return 0;
 }
-late_initcall(omap_serial_wakeup_init);
 
 #endif	/* CONFIG_OMAP_SERIAL_WAKE */
 
Signature · 1 line
1.7.5.4
author
#33 lore raw

PATCH 10/17 ARM: omap2: use machine specific hook for late init

In reply to Shawn Guo
Cc Tony Lindgren <[email protected]>
---
 arch/arm/mach-omap2/board-2430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c        |    1 +
 arch/arm/mach-omap2/board-4430sdp.c        |    1 +
 arch/arm/mach-omap2/board-am3517crane.c    |    1 +
 arch/arm/mach-omap2/board-am3517evm.c      |    1 +
 arch/arm/mach-omap2/board-apollon.c        |    1 +
 arch/arm/mach-omap2/board-cm-t35.c         |    2 +
 arch/arm/mach-omap2/board-cm-t3517.c       |    1 +
 arch/arm/mach-omap2/board-devkit8000.c     |    1 +
 arch/arm/mach-omap2/board-generic.c        |    1 +
 arch/arm/mach-omap2/board-h4.c             |    1 +
 arch/arm/mach-omap2/board-igep0020.c       |    2 +
 arch/arm/mach-omap2/board-ldp.c            |    1 +
 arch/arm/mach-omap2/board-n8x0.c           |    3 +
 arch/arm/mach-omap2/board-omap3beagle.c    |    1 +
 arch/arm/mach-omap2/board-omap3evm.c       |    1 +
 arch/arm/mach-omap2/board-omap3logic.c     |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c   |    1 +
 arch/arm/mach-omap2/board-omap3stalker.c   |    1 +
 arch/arm/mach-omap2/board-omap3touchbook.c |    1 +
 arch/arm/mach-omap2/board-omap4panda.c     |    1 +
 arch/arm/mach-omap2/board-overo.c          |    1 +
 arch/arm/mach-omap2/board-rm680.c          |    2 +
 arch/arm/mach-omap2/board-rx51.c           |    1 +
 arch/arm/mach-omap2/board-ti8168evm.c      |    2 +
 arch/arm/mach-omap2/board-zoom.c           |    2 +
 arch/arm/mach-omap2/common.h               |   47 +++++++++++++++++++++
 arch/arm/mach-omap2/io.c                   |   63 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/mux.c                  |    3 +-
 arch/arm/mach-omap2/pm.c                   |    3 +-
 arch/arm/mach-omap2/pm24xx.c               |   17 ++-----
 arch/arm/mach-omap2/pm34xx.c               |    7 +---
 arch/arm/mach-omap2/pm44xx.c               |    6 +--
 34 files changed, 154 insertions(+), 27 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +1 -0
index e658f83..99ca6ba 100644
@@ -303,6 +303,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
 	.init_irq	= omap2_init_irq,
 	.handle_irq	= omap2_intc_handle_irq,
 	.init_machine	= omap_2430sdp_init,
+	.init_late	= omap2430_init_late,
 	.timer		= &omap2_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-3430sdp.c +1 -0
index da75f23..8ceb480 100644
@@ -635,6 +635,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap_3430sdp_init,
+	.init_late	= omap3430_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-3630sdp.c +1 -0
index 6ef350d..2dc9ba5 100644
@@ -217,6 +217,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap_sdp_init,
+	.init_late	= omap3630_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-4430sdp.c +1 -0
index 130ab00..3f6cf22 100644
@@ -969,6 +969,7 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
 	.init_irq	= gic_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= omap_4430sdp_init,
+	.init_late	= omap4430_init_late,
 	.timer		= &omap4_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-am3517crane.c +1 -0
index c3851e8..7231020 100644
@@ -100,6 +100,7 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= am3517_crane_init,
+	.init_late	= am35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-am3517evm.c +1 -0
index 3645285..ae50e11 100644
@@ -402,6 +402,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= am3517_evm_init,
+	.init_late	= am35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-apollon.c +1 -0
index 768ece2..502c31e 100644
@@ -356,6 +356,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
 	.init_irq	= omap2_init_irq,
 	.handle_irq	= omap2_intc_handle_irq,
 	.init_machine	= omap_apollon_init,
+	.init_late	= omap2420_init_late,
 	.timer		= &omap2_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-cm-t35.c +2 -0
index 909a8b9..f975061 100644
@@ -686,6 +686,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= cm_t35_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
@@ -698,6 +699,7 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730")
 	.init_irq       = omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine   = cm_t3730_init,
+	.init_late     = omap3630_init_late,
 	.timer          = &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-cm-t3517.c +1 -0
index 9e66e16..a33ad46 100644
@@ -303,6 +303,7 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= cm_t3517_init,
+	.init_late	= am35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-devkit8000.c +1 -0
index a2010f0..f616c8c 100644
@@ -664,6 +664,7 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= devkit8000_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_secure_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-generic.c +1 -0
index 098d183..56ffcc9 100644
@@ -158,6 +158,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
 	.init_irq	= omap_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= omap4_init,
+	.init_late	= omap4430_init_late,
 	.timer		= &omap4_timer,
 	.dt_compat	= omap4_boards_compat,
 	.restart	= omap_prcm_restart,
arch/arm/mach-omap2/board-h4.c +1 -0
index 0bbbabe..876becf 100644
@@ -398,6 +398,7 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
 	.init_irq	= omap2_init_irq,
 	.handle_irq	= omap2_intc_handle_irq,
 	.init_machine	= omap_h4_init,
+	.init_late	= omap2420_init_late,
 	.timer		= &omap2_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-igep0020.c +2 -0
index 930c0d3..21df74e 100644
@@ -684,6 +684,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= igep_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
@@ -696,6 +697,7 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= igep_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-ldp.c +1 -0
index 1b60495..ef9e829 100644
@@ -442,6 +442,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap_ldp_init,
+	.init_late	= omap3430_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-n8x0.c +3 -0
index 518091c..8ca14e8 100644
@@ -694,6 +694,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
 	.init_irq	= omap2_init_irq,
 	.handle_irq	= omap2_intc_handle_irq,
 	.init_machine	= n8x0_init_machine,
+	.init_late	= omap2420_init_late,
 	.timer		= &omap2_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
@@ -706,6 +707,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
 	.init_irq	= omap2_init_irq,
 	.handle_irq	= omap2_intc_handle_irq,
 	.init_machine	= n8x0_init_machine,
+	.init_late	= omap2420_init_late,
 	.timer		= &omap2_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
@@ -718,6 +720,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
 	.init_irq	= omap2_init_irq,
 	.handle_irq	= omap2_intc_handle_irq,
 	.init_machine	= n8x0_init_machine,
+	.init_late	= omap2420_init_late,
 	.timer		= &omap2_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-omap3beagle.c +1 -0
index 7be8d65..b6cd804 100644
@@ -565,6 +565,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap3_beagle_init,
+	.init_late	= omap3_init_late,
 	.timer		= &omap3_secure_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-omap3evm.c +1 -0
index 49df127..e98c230 100644
@@ -692,6 +692,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap3_evm_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-omap3logic.c +2 -0
index 9b3c141..8927927 100644
@@ -218,6 +218,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap3logic_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
@@ -230,6 +231,7 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap3logic_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-omap3pandora.c +1 -0
index 33d995d..57aebee 100644
@@ -622,6 +622,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap3pandora_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-omap3stalker.c +1 -0
index 4dffc95..c05fe3a 100644
@@ -457,6 +457,7 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
 	.init_irq		= omap3_init_irq,
 	.handle_irq		= omap3_intc_handle_irq,
 	.init_machine		= omap3_stalker_init,
+	.init_late		= omap35xx_init_late,
 	.timer			= &omap3_secure_timer,
 	.restart		= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-omap3touchbook.c +1 -0
index ae2251f..485d14d 100644
@@ -387,6 +387,7 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap3_touchbook_init,
+	.init_late	= omap3430_init_late,
 	.timer		= &omap3_secure_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-omap4panda.c +1 -0
index 1b782ba..7ca817f 100644
@@ -582,6 +582,7 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
 	.init_irq	= gic_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= omap4_panda_init,
+	.init_late	= omap4430_init_late,
 	.timer		= &omap4_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-overo.c +1 -0
index 33aa391..af7ac0b 100644
@@ -571,6 +571,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= overo_init,
+	.init_late	= omap35xx_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-rm680.c +2 -0
index ae53d71..0ad1bb3 100644
@@ -151,6 +151,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= rm680_init,
+	.init_late	= omap3630_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
@@ -163,6 +164,7 @@ MACHINE_START(NOKIA_RM696, "Nokia RM-696 board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= rm680_init,
+	.init_late	= omap3630_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-rx51.c +1 -0
index 27f01f0..5010f6d 100644
@@ -129,6 +129,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= rx51_init,
+	.init_late	= omap3430_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-ti8168evm.c +2 -0
index ab9a7a9..d4c8392 100644
@@ -52,6 +52,7 @@ MACHINE_START(TI8168EVM, "ti8168evm")
 	.init_irq	= ti81xx_init_irq,
 	.timer		= &omap3_timer,
 	.init_machine	= ti81xx_evm_init,
+	.init_late	= ti81xx_init_late,
 	.restart	= omap_prcm_restart,
 MACHINE_END
 
@@ -63,5 +64,6 @@ MACHINE_START(TI8148EVM, "ti8148evm")
 	.init_irq	= ti81xx_init_irq,
 	.timer		= &omap3_timer,
 	.init_machine	= ti81xx_evm_init,
+	.init_late	= ti81xx_init_late,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/board-zoom.c +2 -0
index 5c20bcc..4e7e561 100644
@@ -137,6 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap_zoom_init,
+	.init_late	= omap3430_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
@@ -149,6 +150,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
 	.init_irq	= omap3_init_irq,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap_zoom_init,
+	.init_late	= omap3630_init_late,
 	.timer		= &omap3_timer,
 	.restart	= omap_prcm_restart,
 MACHINE_END
arch/arm/mach-omap2/common.h +47 -0

59 lines not on this page · raw message

arch/arm/mach-omap2/io.c +63 -0

87 lines not on this page · raw message

arch/arm/mach-omap2/mux.c +1 -2
index 65c3391..0ede4d6 100644
@@ -788,7 +788,7 @@ static void __init omap_mux_free_names(struct omap_mux *m)
 }
 
 /* Free all data except for GPIO pins unless CONFIG_DEBUG_FS is set */
-static int __init omap_mux_late_init(void)
+int __init omap_mux_late_init(void)
 {
 	struct omap_mux_partition *partition;
 	int ret;
@@ -823,7 +823,6 @@ static int __init omap_mux_late_init(void)
 
 	return 0;
 }
-late_initcall(omap_mux_late_init);
 
 static void __init omap_mux_package_fixup(struct omap_mux *p,
 					struct omap_mux *superset)
arch/arm/mach-omap2/pm.c +1 -2
index d0c1c96..9cb5ced 100644
@@ -295,7 +295,7 @@ static int __init omap2_common_pm_init(void)
 }
 postcore_initcall(omap2_common_pm_init);
 
-static int __init omap2_common_pm_late_init(void)
+int __init omap2_common_pm_late_init(void)
 {
 	/*
 	 * In the case of DT, the PMIC and SR initialization will be done using
@@ -322,4 +322,3 @@ static int __init omap2_common_pm_late_init(void)
 
 	return 0;
 }
-late_initcall(omap2_common_pm_late_init);
arch/arm/mach-omap2/pm24xx.c +5 -12
index 95442b6..b2758b8 100644
@@ -301,13 +301,10 @@ static void __init prcm_setup_regs(void)
 				WKUP_MOD, PM_WKEN);
 }
 
-static int __init omap2_pm_init(void)
+int __init omap2_pm_init(void)
 {
 	u32 l;
 
-	if (!cpu_is_omap24xx())
-		return -ENODEV;
-
 	printk(KERN_INFO "Power Management for OMAP2 initializing\n");
 	l = omap2_prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_REVISION_OFFSET);
 	printk(KERN_INFO "PRCM revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
@@ -373,17 +370,13 @@ static int __init omap2_pm_init(void)
 	 * These routines need to be in SRAM as that's the only
 	 * memory the MPU can see when it wakes up.
 	 */
-	if (cpu_is_omap24xx()) {
-		omap2_sram_idle = omap_sram_push(omap24xx_idle_loop_suspend,
-						 omap24xx_idle_loop_suspend_sz);
+	omap2_sram_idle = omap_sram_push(omap24xx_idle_loop_suspend,
+					 omap24xx_idle_loop_suspend_sz);
 
-		omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
-						    omap24xx_cpu_suspend_sz);
-	}
+	omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
+					    omap24xx_cpu_suspend_sz);
 
 	arm_pm_idle = omap2_pm_idle;
 
 	return 0;
 }
-
-late_initcall(omap2_pm_init);
arch/arm/mach-omap2/pm34xx.c +1 -6
index 703bd10..c769b88 100644
@@ -699,15 +699,12 @@ static void __init pm_errata_configure(void)
 	}
 }
 
-static int __init omap3_pm_init(void)
+int __init omap3_pm_init(void)
 {
 	struct power_state *pwrst, *tmp;
 	struct clockdomain *neon_clkdm, *per_clkdm, *mpu_clkdm, *core_clkdm;
 	int ret;
 
-	if (!cpu_is_omap34xx())
-		return -ENODEV;
-
 	if (!omap3_has_io_chain_ctrl())
 		pr_warning("PM: no software I/O chain control; some wakeups may be lost\n");
 
@@ -808,5 +805,3 @@ err2:
 err1:
 	return ret;
 }
-
-late_initcall(omap3_pm_init);
arch/arm/mach-omap2/pm44xx.c +1 -5
index 88562535..ea24174 100644
@@ -141,15 +141,12 @@ static void omap_default_idle(void)
  * Initializes all powerdomain and clockdomain target states
  * and all PRCM settings.
  */
-static int __init omap4_pm_init(void)
+int __init omap4_pm_init(void)
 {
 	int ret;
 	struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm, *l4wkup;
 	struct clockdomain *ducati_clkdm, *l3_2_clkdm, *l4_per_clkdm;
 
-	if (!cpu_is_omap44xx())
-		return -ENODEV;
-
 	if (omap_rev() == OMAP4430_REV_ES1_0) {
 		WARN(1, "Power Management not supported on OMAP4430 ES1.0\n");
 		return -ENODEV;
@@ -217,4 +214,3 @@ static int __init omap4_pm_init(void)
 err2:
 	return ret;
 }
-late_initcall(omap4_pm_init);
Signature · 1 line
1.7.5.4
author
#34 lore raw

PATCH 11/17 ARM: pnx4008: use machine specific hook for late init

In reply to Shawn Guo
Cc Russell King <[email protected]>
---
 arch/arm/mach-pnx4008/core.c |   12 ++++++++++++
 arch/arm/mach-pnx4008/pm.c   |    4 +---
 2 files changed, 13 insertions(+), 3 deletions(-)
arch/arm/mach-pnx4008/core.c +12 -0
index be4c928..a00d2f1 100644
@@ -265,6 +265,17 @@ static void pnx4008_restart(char mode, const char *cmd)
 	soft_restart(0);
 }
 
+#ifdef CONFIG_PM
+extern int pnx4008_pm_init(void);
+#else
+static inline int pnx4008_pm_init(void) { return 0; }
+#endif
+
+void __init pnx4008_init_late(void)
+{
+	pnx4008_pm_init();
+}
+
 extern struct sys_timer pnx4008_timer;
 
 MACHINE_START(PNX4008, "Philips PNX4008")
@@ -273,6 +284,7 @@ MACHINE_START(PNX4008, "Philips PNX4008")
 	.map_io 		= pnx4008_map_io,
 	.init_irq 		= pnx4008_init_irq,
 	.init_machine 		= pnx4008_init,
+	.init_late		= pnx4008_init_late,
 	.timer 			= &pnx4008_timer,
 	.restart		= pnx4008_restart,
 MACHINE_END
arch/arm/mach-pnx4008/pm.c +1 -3
index f3e60a0..26f8d06 100644
@@ -124,7 +124,7 @@ static const struct platform_suspend_ops pnx4008_pm_ops = {
 	.valid = pnx4008_pm_valid,
 };
 
-static int __init pnx4008_pm_init(void)
+int __init pnx4008_pm_init(void)
 {
 	u32 sram_size_to_allocate;
 
@@ -151,5 +151,3 @@ static int __init pnx4008_pm_init(void)
 	suspend_set_ops(&pnx4008_pm_ops);
 	return 0;
 }
-
-late_initcall(pnx4008_pm_init);
Signature · 1 line
1.7.5.4
author
#35 lore raw

PATCH 12/17 ARM: prima2: use machine specific hook for late init

In reply to Shawn Guo
---
 arch/arm/mach-prima2/common.h |    6 ++++++
 arch/arm/mach-prima2/pm.c     |    3 +--
 arch/arm/mach-prima2/prima2.c |    6 ++++++
 3 files changed, 13 insertions(+), 2 deletions(-)
arch/arm/mach-prima2/common.h +6 -0
index b28a930..60d826f 100644
@@ -24,4 +24,10 @@ static inline void sirfsoc_map_lluart(void)  {}
 extern void __init sirfsoc_map_lluart(void);
 #endif
 
+#ifdef CONFIG_SUSPEND
+extern int sirfsoc_pm_init(void);
+#else
+static inline int sirfsoc_pm_init(void) { return 0; }
+#endif
+
 #endif
arch/arm/mach-prima2/pm.c +1 -2
index 26ebb57..fb5a791 100644
@@ -85,12 +85,11 @@ static const struct platform_suspend_ops sirfsoc_pm_ops = {
 	.valid = suspend_valid_only_mem,
 };
 
-static int __init sirfsoc_pm_init(void)
+int __init sirfsoc_pm_init(void)
 {
 	suspend_set_ops(&sirfsoc_pm_ops);
 	return 0;
 }
-late_initcall(sirfsoc_pm_init);
 
 static const struct of_device_id pwrc_ids[] = {
 	{ .compatible = "sirf,prima2-pwrc" },
arch/arm/mach-prima2/prima2.c +6 -0
index 02b9c05..8f0429d 100644
@@ -25,6 +25,11 @@ void __init sirfsoc_mach_init(void)
 	of_platform_bus_probe(NULL, sirfsoc_of_bus_ids, NULL);
 }
 
+void __init sirfsoc_init_late(void)
+{
+	sirfsoc_pm_init();
+}
+
 static const char *prima2cb_dt_match[] __initdata = {
        "sirf,prima2-cb",
        NULL
@@ -39,6 +44,7 @@ MACHINE_START(PRIMA2_EVB, "prima2cb")
 	.timer		= &sirfsoc_timer,
 	.dma_zone_size	= SZ_256M,
 	.init_machine	= sirfsoc_mach_init,
+	.init_late	= sirfsoc_init_late,
 	.dt_compat      = prima2cb_dt_match,
 	.restart	= sirfsoc_restart,
 MACHINE_END
Signature · 1 line
1.7.5.4
#36 lore raw

PATCH 12/17 ARM: prima2: use machine specific hook for late init

2012/4/26 Shawn Guo <[email protected]>

Quoted 3 lines
Quoted 65 lines

---

?arch/arm/mach-prima2/common.h | ? ?6 ++++++
?arch/arm/mach-prima2/pm.c ? ? | ? ?3 +--
?arch/arm/mach-prima2/prima2.c | ? ?6 ++++++

?3 files changed, 13 insertions(+), 2 deletions(-)

arch/arm/mach-prima2/common.h +0 -0
index b28a930..60d826f 100644
@@ -24,4 +24,10 @@ static inline void sirfsoc_map_lluart(void) ?{}
 ?extern void __init sirfsoc_map_lluart(void);

?#endif

arch/arm/mach-prima2/common.h +6 -0
+#ifdef CONFIG_SUSPEND
+extern int sirfsoc_pm_init(void);
+#else
+static inline int sirfsoc_pm_init(void) { return 0; }
+#endif
+

?#endif

arch/arm/mach-prima2/pm.c +1 -2
index 26ebb57..fb5a791 100644
@@ -85,12 +85,11 @@ static const struct platform_suspend_ops sirfsoc_pm_ops = {
 ? ? ? ?.valid = suspend_valid_only_mem,
 ?};
 
-static int __init sirfsoc_pm_init(void)
+int __init sirfsoc_pm_init(void)
 ?{
 ? ? ? ?suspend_set_ops(&sirfsoc_pm_ops);
 ? ? ? ?return 0;
 ?}
-late_initcall(sirfsoc_pm_init);
 
 ?static const struct of_device_id pwrc_ids[] = {
 ? ? ? ?{ .compatible = "sirf,prima2-pwrc" },
arch/arm/mach-prima2/prima2.c +5 -0
index 02b9c05..8f0429d 100644
@@ -25,6 +25,11 @@ void __init sirfsoc_mach_init(void)
 ? ? ? ?of_platform_bus_probe(NULL, sirfsoc_of_bus_ids, NULL);
 ?}
 
+void __init sirfsoc_init_late(void)
+{
+ ? ? ? sirfsoc_pm_init();
+}
+
 ?static const char *prima2cb_dt_match[] __initdata = {
 ? ? ? ?"sirf,prima2-cb",

? ? ? ?NULL

arch/arm/mach-prima2/prima2.c +1 -0
@@ -39,6 +44,7 @@ MACHINE_START(PRIMA2_EVB, "prima2cb")
 ? ? ? ?.timer ? ? ? ? ?= &sirfsoc_timer,
 ? ? ? ?.dma_zone_size ?= SZ_256M,
 ? ? ? ?.init_machine ? = sirfsoc_mach_init,
+ ? ? ? .init_late ? ? ?= sirfsoc_init_late,
 ? ? ? ?.dt_compat ? ? ?= prima2cb_dt_match,
 ? ? ? ?.restart ? ? ? ?= sirfsoc_restart,

?MACHINE_END
--
1.7.5.4

author
#37 lore raw

PATCH 13/17 ARM: s3c64xx: use machine specific hook for late init

In reply to Shawn Guo
Cc Ben Dooks <[email protected]>
Cc Kukjin Kim <[email protected]>
---
 arch/arm/mach-s3c64xx/common.c        |    5 +++++
 arch/arm/mach-s3c64xx/common.h        |    7 +++++++
 arch/arm/mach-s3c64xx/mach-anw6410.c  |    1 +
 arch/arm/mach-s3c64xx/mach-crag6410.c |    1 +
 arch/arm/mach-s3c64xx/mach-hmt.c      |    1 +
 arch/arm/mach-s3c64xx/mach-mini6410.c |    1 +
 arch/arm/mach-s3c64xx/mach-ncp.c      |    1 +
 arch/arm/mach-s3c64xx/mach-real6410.c |    1 +
 arch/arm/mach-s3c64xx/mach-smartq5.c  |    1 +
 arch/arm/mach-s3c64xx/mach-smartq7.c  |    1 +
 arch/arm/mach-s3c64xx/mach-smdk6400.c |    1 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c |    1 +
 arch/arm/mach-s3c64xx/pm.c            |    3 +--
 13 files changed, 23 insertions(+), 2 deletions(-)
arch/arm/mach-s3c64xx/common.c +5 -0
index b313380..be746e3 100644
@@ -384,3 +384,8 @@ void s3c64xx_restart(char mode, const char *cmd)
 	/* if all else fails, or mode was for soft, jump to 0 */
 	soft_restart(0);
 }
+
+void __init s3c64xx_init_late(void)
+{
+	s3c64xx_pm_late_initcall();
+}
arch/arm/mach-s3c64xx/common.h +7 -0
index 7a10be6..6cfc99b 100644
@@ -24,6 +24,7 @@ void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
 void s3c64xx_setup_clocks(void);
 
 void s3c64xx_restart(char mode, const char *cmd);
+void s3c64xx_init_late(void);
 
 #ifdef CONFIG_CPU_S3C6400
 
@@ -51,4 +52,10 @@ extern void s3c6410_init_clocks(int xtal);
 #define s3c6410_init NULL
 #endif
 
+#ifdef CONFIG_PM
+int __init s3c64xx_pm_late_initcall(void);
+#else
+static inline int s3c64xx_pm_late_initcall(void) { return 0; }
+#endif
+
 #endif /* __ARCH_ARM_MACH_S3C64XX_COMMON_H */
arch/arm/mach-s3c64xx/mach-anw6410.c +1 -0
index b86f277..8808aa5 100644
@@ -241,6 +241,7 @@ MACHINE_START(ANW6410, "A&W6410")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= anw6410_map_io,
 	.init_machine	= anw6410_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-crag6410.c +1 -0
index e20bf58..607d3f1 100644
@@ -811,6 +811,7 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= crag6410_map_io,
 	.init_machine	= crag6410_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-hmt.c +1 -0
index 521e07b..1bf6b9d 100644
@@ -272,6 +272,7 @@ MACHINE_START(HMT, "Airgoo-HMT")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= hmt_map_io,
 	.init_machine	= hmt_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-mini6410.c +1 -0
index c34c2ab..5aef599 100644
@@ -350,6 +350,7 @@ MACHINE_START(MINI6410, "MINI6410")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= mini6410_map_io,
 	.init_machine	= mini6410_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-ncp.c +1 -0
index 0efa2ba..cad2e05 100644
@@ -104,6 +104,7 @@ MACHINE_START(NCP, "NCP")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= ncp_map_io,
 	.init_machine	= ncp_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-real6410.c +1 -0
index be2a9a2..a88b60f 100644
@@ -331,6 +331,7 @@ MACHINE_START(REAL6410, "REAL6410")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= real6410_map_io,
 	.init_machine	= real6410_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-smartq5.c +1 -0
index 3f42431d..c5021d0 100644
@@ -152,6 +152,7 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq5_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-smartq7.c +1 -0
index e5c09b6..aa9072a 100644
@@ -168,6 +168,7 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq7_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-smdk6400.c +1 -0
index 5f09653..b0f4525 100644
@@ -93,6 +93,7 @@ MACHINE_START(SMDK6400, "SMDK6400")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= smdk6400_map_io,
 	.init_machine	= smdk6400_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/mach-smdk6410.c +1 -0
index d55bc96..315a8b4 100644
@@ -709,6 +709,7 @@ MACHINE_START(SMDK6410, "SMDK6410")
 	.handle_irq	= vic_handle_irq,
 	.map_io		= smdk6410_map_io,
 	.init_machine	= smdk6410_machine_init,
+	.init_late	= s3c64xx_init_late,
 	.timer		= &s3c24xx_timer,
 	.restart	= s3c64xx_restart,
 MACHINE_END
arch/arm/mach-s3c64xx/pm.c +1 -2
index 7d3e81b..7feb426 100644
@@ -365,10 +365,9 @@ static __init int s3c64xx_pm_initcall(void)
 }
 arch_initcall(s3c64xx_pm_initcall);
 
-static __init int s3c64xx_pm_late_initcall(void)
+int __init s3c64xx_pm_late_initcall(void)
 {
 	pm_genpd_poweroff_unused();
 
 	return 0;
 }
-late_initcall(s3c64xx_pm_late_initcall);
Signature · 1 line
1.7.5.4
author
#38 lore raw

PATCH 14/17 ARM: sa1100: use machine specific hook for late init

In reply to Shawn Guo
Cc Russell King <[email protected]>
---
 arch/arm/mach-sa1100/assabet.c    |    1 +
 arch/arm/mach-sa1100/badge4.c     |    1 +
 arch/arm/mach-sa1100/cerf.c       |    1 +
 arch/arm/mach-sa1100/collie.c     |    1 +
 arch/arm/mach-sa1100/generic.c    |    4 ++++
 arch/arm/mach-sa1100/generic.h    |    7 +++++++
 arch/arm/mach-sa1100/h3100.c      |    1 +
 arch/arm/mach-sa1100/h3600.c      |    1 +
 arch/arm/mach-sa1100/hackkit.c    |    1 +
 arch/arm/mach-sa1100/jornada720.c |    1 +
 arch/arm/mach-sa1100/lart.c       |    1 +
 arch/arm/mach-sa1100/nanoengine.c |    1 +
 arch/arm/mach-sa1100/pleb.c       |    1 +
 arch/arm/mach-sa1100/pm.c         |    4 +---
 arch/arm/mach-sa1100/shannon.c    |    1 +
 arch/arm/mach-sa1100/simpad.c     |    1 +
 16 files changed, 25 insertions(+), 3 deletions(-)
arch/arm/mach-sa1100/assabet.c +1 -0
index 375d3f7..d1dc7f1 100644
@@ -538,6 +538,7 @@ MACHINE_START(ASSABET, "Intel-Assabet")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= assabet_init,
+	.init_late	= sa11x0_init_late,
 #ifdef CONFIG_SA1111
 	.dma_zone_size	= SZ_1M,
 #endif
arch/arm/mach-sa1100/badge4.c +1 -0
index e0f0c03..b30fb99 100644
@@ -305,6 +305,7 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
 	.map_io		= badge4_map_io,
 	.nr_irqs	= SA1100_NR_IRQS,
 	.init_irq	= sa1100_init_irq,
+	.init_late	= sa11x0_init_late,
 	.timer		= &sa1100_timer,
 #ifdef CONFIG_SA1111
 	.dma_zone_size	= SZ_1M,
arch/arm/mach-sa1100/cerf.c +1 -0
index 4a61f60..09d7f4b 100644
@@ -134,5 +134,6 @@ MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
 	.init_irq	= cerf_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= cerf_init,
+	.init_late	= sa11x0_init_late,
 	.restart	= sa11x0_restart,
 MACHINE_END
arch/arm/mach-sa1100/collie.c +1 -0
index c7f418b..ea5cff3 100644
@@ -401,5 +401,6 @@ MACHINE_START(COLLIE, "Sharp-Collie")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= collie_init,
+	.init_late	= sa11x0_init_late,
 	.restart	= sa11x0_restart,
 MACHINE_END
arch/arm/mach-sa1100/generic.c +4 -0
index 7c524b4..49468e6 100644
@@ -359,6 +359,10 @@ static int __init sa1100_init(void)
 
 arch_initcall(sa1100_init);
 
+void __init sa11x0_init_late(void)
+{
+	sa11x0_pm_init();
+}
 
 /*
  * Common I/O mapping:
arch/arm/mach-sa1100/generic.h +7 -0
index 9eb3b3c..a5b7c13 100644
@@ -11,6 +11,7 @@ extern void __init sa1100_map_io(void);
 extern void __init sa1100_init_irq(void);
 extern void __init sa1100_init_gpio(void);
 extern void sa11x0_restart(char, const char *);
+extern void sa11x0_init_late(void);
 
 #define SET_BANK(__nr,__start,__size) \
 	mi->bank[__nr].start = (__start), \
@@ -41,3 +42,9 @@ void sa11x0_register_mcp(struct mcp_plat_data *data);
 
 struct sa1100fb_mach_info;
 void sa11x0_register_lcd(struct sa1100fb_mach_info *inf);
+
+#ifdef CONFIG_PM
+int sa11x0_pm_init(void);
+#else
+static inline int sa11x0_pm_init(void) { return 0; }
+#endif
arch/arm/mach-sa1100/h3100.c +1 -0
index b2e8d0f..e1571ea 100644
@@ -110,6 +110,7 @@ MACHINE_START(H3100, "Compaq iPAQ H3100")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= h3100_mach_init,
+	.init_late	= sa11x0_init_late,
 	.restart	= sa11x0_restart,
 MACHINE_END
 
arch/arm/mach-sa1100/h3600.c +1 -0
index cb6659f..ba7a290 100644
@@ -160,6 +160,7 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= h3600_mach_init,
+	.init_late	= sa11x0_init_late,
 	.restart	= sa11x0_restart,
 MACHINE_END
 
arch/arm/mach-sa1100/hackkit.c +1 -0
index 5535475..7f86bd9 100644
@@ -199,5 +199,6 @@ MACHINE_START(HACKKIT, "HackKit Cpu Board")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= hackkit_init,
+	.init_late	= sa11x0_init_late,
 	.restart	= sa11x0_restart,
 MACHINE_END
arch/arm/mach-sa1100/jornada720.c +1 -0
index ca7a7e8..e3084f4 100644
@@ -348,6 +348,7 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= jornada720_mach_init,
+	.init_late	= sa11x0_init_late,
 #ifdef CONFIG_SA1111
 	.dma_zone_size	= SZ_1M,
 #endif
arch/arm/mach-sa1100/lart.c +1 -0
index eb6534e..b775a0a 100644
@@ -147,6 +147,7 @@ MACHINE_START(LART, "LART")
 	.nr_irqs	= SA1100_NR_IRQS,
 	.init_irq	= sa1100_init_irq,
 	.init_machine	= lart_init,
+	.init_late	= sa11x0_init_late,
 	.timer		= &sa1100_timer,
 	.restart	= sa11x0_restart,
 MACHINE_END
arch/arm/mach-sa1100/nanoengine.c +1 -0
index 8f6446b..41f69d9 100644
@@ -112,5 +112,6 @@ MACHINE_START(NANOENGINE, "BSE nanoEngine")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= nanoengine_init,
+	.init_late	= sa11x0_init_late,
 	.restart	= sa11x0_restart,
 MACHINE_END
arch/arm/mach-sa1100/pleb.c +1 -0
index 1602575..37fe0a0 100644
@@ -135,5 +135,6 @@ MACHINE_START(PLEB, "PLEB")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine   = pleb_init,
+	.init_late	= sa11x0_init_late,
 	.restart	= sa11x0_restart,
 MACHINE_END
arch/arm/mach-sa1100/pm.c +1 -3
index 2fa499e..690cf0c 100644
@@ -117,10 +117,8 @@ static const struct platform_suspend_ops sa11x0_pm_ops = {
 	.valid		= suspend_valid_only_mem,
 };
 
-static int __init sa11x0_pm_init(void)
+int __init sa11x0_pm_init(void)
 {
 	suspend_set_ops(&sa11x0_pm_ops);
 	return 0;
 }
-
-late_initcall(sa11x0_pm_init);
arch/arm/mach-sa1100/shannon.c +1 -0
index ca8bf59..5d33fc3 100644
@@ -104,5 +104,6 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
 	.init_irq	= sa1100_init_irq,
 	.timer		= &sa1100_timer,
 	.init_machine	= shannon_init,
+	.init_late	= sa11x0_init_late,
 	.restart	= sa11x0_restart,
 MACHINE_END
arch/arm/mach-sa1100/simpad.c +1 -0
index 3efae03..fbd5359 100644
@@ -395,6 +395,7 @@ MACHINE_START(SIMPAD, "Simpad")
 	.map_io		= simpad_map_io,
 	.nr_irqs	= SA1100_NR_IRQS,
 	.init_irq	= sa1100_init_irq,
+	.init_late	= sa11x0_init_late,
 	.timer		= &sa1100_timer,
 	.restart	= sa11x0_restart,
 MACHINE_END
Signature · 1 line
1.7.5.4
author
#39 lore raw

PATCH 15/17 ARM: shmobile: use machine specific hook for late init

In reply to Shawn Guo
Cc Paul Mundt <[email protected]>
Cc Magnus Damm <[email protected]>
---
 arch/arm/mach-shmobile/Makefile              |    2 +-
 arch/arm/mach-shmobile/board-ag5evm.c        |    1 +
 arch/arm/mach-shmobile/board-ap4evb.c        |    1 +
 arch/arm/mach-shmobile/board-bonito.c        |    1 +
 arch/arm/mach-shmobile/board-g3evm.c         |    1 +
 arch/arm/mach-shmobile/board-g4evm.c         |    1 +
 arch/arm/mach-shmobile/board-kota2.c         |    1 +
 arch/arm/mach-shmobile/board-mackerel.c      |    1 +
 arch/arm/mach-shmobile/board-marzen.c        |    1 +
 arch/arm/mach-shmobile/common.c              |   24 ++++++++++++++++++++++++
 arch/arm/mach-shmobile/cpuidle.c             |    3 +--
 arch/arm/mach-shmobile/include/mach/common.h |   14 ++++++++++++++
 arch/arm/mach-shmobile/suspend.c             |    3 +--
 13 files changed, 49 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/mach-shmobile/common.c
arch/arm/mach-shmobile/Makefile +1 -1
index e7c2590..93d62fb 100644
@@ -3,7 +3,7 @@
 #
 
 # Common objects
-obj-y				:= timer.o console.o clock.o
+obj-y				:= timer.o console.o clock.o common.o
 
 # CPU objects
 obj-$(CONFIG_ARCH_SH7367)	+= setup-sh7367.o clock-sh7367.o intc-sh7367.o
arch/arm/mach-shmobile/board-ag5evm.c +1 -0
index cb224a3..a99e7e6 100644
@@ -598,5 +598,6 @@ MACHINE_START(AG5EVM, "ag5evm")
 	.init_irq	= sh73a0_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= ag5evm_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
arch/arm/mach-shmobile/board-ap4evb.c +1 -0
index b56dde2..522866d 100644
@@ -1440,5 +1440,6 @@ MACHINE_START(AP4EVB, "ap4evb")
 	.init_irq	= sh7372_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= ap4evb_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
arch/arm/mach-shmobile/board-bonito.c +1 -0
index 81fd95f..e6b1fd3 100644
@@ -500,5 +500,6 @@ MACHINE_START(BONITO, "bonito")
 	.init_irq	= r8a7740_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= bonito_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
arch/arm/mach-shmobile/board-g3evm.c +1 -0
index 39b6cf8..796fa00 100644
@@ -338,5 +338,6 @@ MACHINE_START(G3EVM, "g3evm")
 	.init_irq	= sh7367_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= g3evm_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
arch/arm/mach-shmobile/board-g4evm.c +1 -0
index 0e5a39c..f125732 100644
@@ -381,5 +381,6 @@ MACHINE_START(G4EVM, "g4evm")
 	.init_irq	= sh7377_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= g4evm_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
arch/arm/mach-shmobile/board-kota2.c +1 -0
index 200dcd4..f60f1b2 100644
@@ -521,5 +521,6 @@ MACHINE_START(KOTA2, "kota2")
 	.init_irq	= sh73a0_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= kota2_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
arch/arm/mach-shmobile/board-mackerel.c +1 -0
index f49e28a..4cd438f 100644
@@ -1623,5 +1623,6 @@ MACHINE_START(MACKEREL, "mackerel")
 	.init_irq	= sh7372_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= mackerel_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
arch/arm/mach-shmobile/board-marzen.c +1 -0
index ef0e13b..14de378 100644
@@ -98,5 +98,6 @@ MACHINE_START(MARZEN, "marzen")
 	.init_irq	= r8a7779_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= marzen_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
arch/arm/mach-shmobile/common.c new file +24 -0
new file mode 100644
index 0000000..608aba9
@@ -0,0 +1,24 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <mach/common.h>
+
+void __init shmobile_init_late(void)
+{
+	shmobile_suspend_init();
+	shmobile_cpuidle_init();
+}
arch/arm/mach-shmobile/cpuidle.c +1 -2
index 7e65591..7b541e9 100644
@@ -46,7 +46,7 @@ static struct cpuidle_driver shmobile_cpuidle_driver = {
 
 void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
 
-static int shmobile_cpuidle_init(void)
+int shmobile_cpuidle_init(void)
 {
 	struct cpuidle_device *dev = &shmobile_cpuidle_dev;
 	struct cpuidle_driver *drv = &shmobile_cpuidle_driver;
@@ -65,4 +65,3 @@ static int shmobile_cpuidle_init(void)
 
 	return 0;
 }
-late_initcall(shmobile_cpuidle_init);
arch/arm/mach-shmobile/include/mach/common.h +14 -0
index 83ad3fe..2a527c4 100644
@@ -83,4 +83,18 @@ extern void r8a7779_secondary_init(unsigned int cpu);
 extern int r8a7779_boot_secondary(unsigned int cpu);
 extern void r8a7779_smp_prepare_cpus(void);
 
+extern void shmobile_init_late(void);
+
+#ifdef CONFIG_SUSPEND
+int shmobile_suspend_init(void);
+#else
+static inline int shmobile_suspend_init(void) { return 0; }
+#endif
+
+#ifdef CONFIG_CPU_IDLE
+int shmobile_cpuidle_init(void);
+#else
+static inline int shmobile_cpuidle_init(void) { return 0; }
+#endif
+
 #endif /* __ARCH_MACH_COMMON_H */
arch/arm/mach-shmobile/suspend.c +1 -2
index 4d1b86a..47d83f7 100644
@@ -39,9 +39,8 @@ struct platform_suspend_ops shmobile_suspend_ops = {
 	.valid		= suspend_valid_only_mem,
 };
 
-static int __init shmobile_suspend_init(void)
+int __init shmobile_suspend_init(void)
 {
 	suspend_set_ops(&shmobile_suspend_ops);
 	return 0;
 }
-late_initcall(shmobile_suspend_init);
Signature · 1 line
1.7.5.4
#41 lore raw

PATCH 15/17 ARM: shmobile: use machine specific hook for late init

Quoted 6 lines · Magnus Damm

Hi Shawn,

[Added Rafael as CC]

[Regarding getting rid of initcalls, probably for multi-subarch kernels]

Quoted 8 lines
Quoted 3 lines · Shawn Guo
Cc Paul Mundt <[email protected]>
Cc Magnus Damm <[email protected]>

This is certainly in the right direction, thank you!

Am I supposed to take this or is someone else taking it?

Rafael

author
#42 lore raw

PATCH 15/17 ARM: shmobile: use machine specific hook for late init

Hi Rafael,

Quoted 2 lines · Rafael J. Wysocki

Am I supposed to take this or is someone else taking it?

I think it will be easier to have this whole series go through arm-soc tree, so appreicate it if you can give your ack here.

Regards,
Shawn

#43 lore raw

PATCH 15/17 ARM: shmobile: use machine specific hook for late init

Hi,

Quoted 7 lines · Shawn Guo

Hi Rafael,

Quoted 2 lines · Rafael J. Wysocki

Am I supposed to take this or is someone else taking it?

I think it will be easier to have this whole series go through arm-soc tree, so appreicate it if you can give your ack here.

Since you've got the Magnus' ACK already, you don't need mine. :-)

However, my question was to the other maintainers in the CC list whether any of them was going to take the patch directly or I was supposed to push it to them.

Thanks,
Rafael

author
#44 lore raw

PATCH 15/17 ARM: shmobile: use machine specific hook for late init

Quoted 4 lines · Rafael J. Wysocki

However, my question was to the other maintainers in the CC list whether any of them was going to take the patch directly or I was supposed to push it to them.

With acks collected from platform maintainers, I will eventually send a pull-request to arm-soc maintainers (Arnd, Olof) to include the whole series into arm-soc tree.

Regards,
Shawn

#45 lore raw

PATCH 15/17 ARM: shmobile: use machine specific hook for late init

Quoted 8 lines · Shawn Guo
Quoted 4 lines · Rafael J. Wysocki

However, my question was to the other maintainers in the CC list whether any of them was going to take the patch directly or I was supposed to push it to them.

With acks collected from platform maintainers, I will eventually send a pull-request to arm-soc maintainers (Arnd, Olof) to include the whole series into arm-soc tree.

Please feel free to add my ACK to the $subject patch, then, if that helps.

Thanks,
Rafael

author
#46 lore raw

PATCH 15/17 ARM: shmobile: use machine specific hook for late init

Quoted 2 lines · Rafael J. Wysocki

Please feel free to add my ACK to the $subject patch, then, if that helps.

Sure. Will do. Thanks, Rafael.

Regards,
Shawn

author
#47 lore raw

PATCH 16/17 ARM: tegra: use machine specific hook for late init

In reply to Shawn Guo
Cc Colin Cross <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Stephen Warren <[email protected]>
---
 arch/arm/mach-tegra/board-dt-tegra20.c |    1 +
 arch/arm/mach-tegra/board-dt-tegra30.c |    1 +
 arch/arm/mach-tegra/board-harmony.c    |    1 +
 arch/arm/mach-tegra/board-paz00.c      |    1 +
 arch/arm/mach-tegra/board-seaboard.c   |    3 +++
 arch/arm/mach-tegra/board-trimslice.c  |    1 +
 arch/arm/mach-tegra/board.h            |   16 ++++++++++++++++
 arch/arm/mach-tegra/clock.c            |    3 +--
 arch/arm/mach-tegra/common.c           |    7 +++++++
 arch/arm/mach-tegra/pinmux.c           |    3 +--
 arch/arm/mach-tegra/powergate.c        |    4 +---
 11 files changed, 34 insertions(+), 7 deletions(-)
arch/arm/mach-tegra/board-dt-tegra20.c +1 -0
index 0952494..0f0da6c 100644
@@ -142,6 +142,7 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
 	.handle_irq	= gic_handle_irq,
 	.timer		= &tegra_timer,
 	.init_machine	= tegra_dt_init,
+	.init_late	= tegra_init_late,
 	.restart	= tegra_assert_system_reset,
 	.dt_compat	= tegra20_dt_board_compat,
 MACHINE_END
arch/arm/mach-tegra/board-dt-tegra30.c +1 -0
index 5f7c03e..09d21b2 100644
@@ -80,6 +80,7 @@ DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
 	.handle_irq	= gic_handle_irq,
 	.timer		= &tegra_timer,
 	.init_machine	= tegra30_dt_init,
+	.init_late	= tegra_init_late,
 	.restart	= tegra_assert_system_reset,
 	.dt_compat	= tegra30_dt_board_compat,
 MACHINE_END
arch/arm/mach-tegra/board-harmony.c +1 -0
index c00aadb..987115a 100644
@@ -191,5 +191,6 @@ MACHINE_START(HARMONY, "harmony")
 	.handle_irq	= gic_handle_irq,
 	.timer          = &tegra_timer,
 	.init_machine   = tegra_harmony_init,
+	.init_late	= tegra_init_late,
 	.restart	= tegra_assert_system_reset,
 MACHINE_END
arch/arm/mach-tegra/board-paz00.c +1 -0
index 330afdf..2e8a4c6 100644
@@ -221,5 +221,6 @@ MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
 	.handle_irq	= gic_handle_irq,
 	.timer          = &tegra_timer,
 	.init_machine   = tegra_paz00_init,
+	.init_late	= tegra_init_late,
 	.restart	= tegra_assert_system_reset,
 MACHINE_END
arch/arm/mach-tegra/board-seaboard.c +3 -0
index d669847..273eaaa 100644
@@ -289,6 +289,7 @@ MACHINE_START(SEABOARD, "seaboard")
 	.handle_irq	= gic_handle_irq,
 	.timer          = &tegra_timer,
 	.init_machine   = tegra_seaboard_init,
+	.init_late	= tegra_init_late,
 	.restart	= tegra_assert_system_reset,
 MACHINE_END
 
@@ -300,6 +301,7 @@ MACHINE_START(KAEN, "kaen")
 	.handle_irq	= gic_handle_irq,
 	.timer          = &tegra_timer,
 	.init_machine   = tegra_kaen_init,
+	.init_late	= tegra_init_late,
 	.restart	= tegra_assert_system_reset,
 MACHINE_END
 
@@ -311,5 +313,6 @@ MACHINE_START(WARIO, "wario")
 	.handle_irq	= gic_handle_irq,
 	.timer          = &tegra_timer,
 	.init_machine   = tegra_wario_init,
+	.init_late	= tegra_init_late,
 	.restart	= tegra_assert_system_reset,
 MACHINE_END
arch/arm/mach-tegra/board-trimslice.c +1 -0
index cd52820..0a2a0e5 100644
@@ -180,5 +180,6 @@ MACHINE_START(TRIMSLICE, "trimslice")
 	.handle_irq	= gic_handle_irq,
 	.timer          = &tegra_timer,
 	.init_machine   = tegra_trimslice_init,
+	.init_late	= tegra_init_late,
 	.restart	= tegra_assert_system_reset,
 MACHINE_END
arch/arm/mach-tegra/board.h +16 -0
index 75d1543..80086c6 100644
@@ -32,5 +32,21 @@ void __init tegra_init_irq(void);
 void __init tegra_dt_init_irq(void);
 int __init tegra_pcie_init(bool init_port0, bool init_port1);
 
+void tegra_init_late(void);
+
+#ifdef CONFIG_DEBUG_FS
+int tegra_clk_debugfs_init(void);
+int tegra_pinmux_debuginit(void);
+#else
+static inline int tegra_clk_debugfs_init(void) { return 0; }
+static inline int tegra_pinmux_debuginit(void) { return 0; }
+#endif
+
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC) && defined(CONFIG_DEBUG_FS)
+int __init tegra_powergate_debugfs_init(void);
+#else
+static inline int tegra_powergate_debugfs_init(void) { return 0; }
+#endif
+
 extern struct sys_timer tegra_timer;
 #endif
arch/arm/mach-tegra/clock.c +1 -2
index 8dad8d1..58f981c 100644
@@ -642,7 +642,7 @@ static int clk_debugfs_register(struct clk *c)
 	return 0;
 }
 
-static int __init clk_debugfs_init(void)
+int __init tegra_clk_debugfs_init(void)
 {
 	struct clk *c;
 	struct dentry *d;
@@ -669,5 +669,4 @@ err_out:
 	return err;
 }
 
-late_initcall(clk_debugfs_init);
 #endif
arch/arm/mach-tegra/common.c +7 -0
index 22df10f..d5301b6 100644
@@ -132,3 +132,10 @@ void __init tegra30_init_early(void)
 	tegra_powergate_init();
 }
 #endif
+
+void __init tegra_init_late(void)
+{
+	tegra_clk_debugfs_init();
+	tegra_pinmux_debuginit();
+	tegra_powergate_debugfs_init();
+}
arch/arm/mach-tegra/pinmux.c +1 -2
index ac35d2b..4cecf38 100644
@@ -975,7 +975,7 @@ static const struct file_operations debug_drive_fops = {
 	.release	= single_release,
 };
 
-static int __init tegra_pinmux_debuginit(void)
+int __init tegra_pinmux_debuginit(void)
 {
 	(void) debugfs_create_file("tegra_pinmux", S_IRUGO,
 					NULL, NULL, &debug_fops);
@@ -983,5 +983,4 @@ static int __init tegra_pinmux_debuginit(void)
 					NULL, NULL, &debug_drive_fops);
 	return 0;
 }
-late_initcall(tegra_pinmux_debuginit);
 #endif
arch/arm/mach-tegra/powergate.c +1 -3
index c238699..f5b12fb 100644
@@ -234,7 +234,7 @@ static const struct file_operations powergate_fops = {
 	.release	= single_release,
 };
 
-static int __init powergate_debugfs_init(void)
+int __init tegra_powergate_debugfs_init(void)
 {
 	struct dentry *d;
 	int err = -ENOMEM;
@@ -247,6 +247,4 @@ static int __init powergate_debugfs_init(void)
 	return err;
 }
 
-late_initcall(powergate_debugfs_init);
-
 #endif
Signature · 1 line
1.7.5.4
#48 lore raw

PATCH 16/17 ARM: tegra: use machine specific hook for late init

On 04/26/2012 09:38 AM, Shawn Guo wrote:

BTW, it'd be useful to CC everyone on the cover letter for context.

I think this mostly looks fine, except for one issue below:

arch/arm/mach-tegra/common.c void __init tegra30_init_early(void) · line 139

Quoted 6 lines
arch/arm/mach-tegra/common.c +4 -0
 
+void __init tegra_init_late(void)
+{
+	tegra_clk_debugfs_init();
+	tegra_pinmux_debuginit();

That function has been removed ...

arch/arm/mach-tegra/pinmux.c

Quoted 4 lines
arch/arm/mach-tegra/common.c +2 -0
+	tegra_powergate_debugfs_init();
+}
arch/arm/mach-tegra/pinmux.c +0 -0

... because this whole file will be deleted in 3.5; see
git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git
gpio-pinmux

I'm not sure if you want to remove that part of this patch to make it merge more easily?

author
#49 lore raw

PATCH 16/17 ARM: tegra: use machine specific hook for late init

Quoted 4 lines · Stephen Warren

On 04/26/2012 09:38 AM, Shawn Guo wrote:

BTW, it'd be useful to CC everyone on the cover letter for context.

Yes, thanks for the reminding. Will do in the future.

Quoted 14 lines

I think this mostly looks fine, except for one issue below:

arch/arm/mach-tegra/common.c void __init tegra30_init_early(void) · line 139

Quoted 6 lines
arch/arm/mach-tegra/common.c +4 -0
 
+void __init tegra_init_late(void)
+{
+	tegra_clk_debugfs_init();
+	tegra_pinmux_debuginit();

That function has been removed ...

Quoted 2 lines
arch/arm/mach-tegra/common.c +2 -0
+	tegra_powergate_debugfs_init();
+}
Quoted 8 lines

arch/arm/mach-tegra/pinmux.c

Quoted 1 line
arch/arm/mach-tegra/pinmux.c +0 -0

... because this whole file will be deleted in 3.5; see
git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git
gpio-pinmux

I'm not sure if you want to remove that part of this patch to make it merge more easily?

Sure. Will remove that part from the patch.

Signature · 2 lines
Regards,
Shawn
author
#50 lore raw

PATCH 17/17 ARM: ux500: use machine specific hook for late init

In reply to Shawn Guo
Cc Srinidhi Kasagar <[email protected]>
Cc Linus Walleij <[email protected]>
---
 arch/arm/mach-ux500/board-mop500.c       |    4 ++++
 arch/arm/mach-ux500/board-u5500.c        |    1 +
 arch/arm/mach-ux500/clock.c              |    6 ++----
 arch/arm/mach-ux500/clock.h              |   12 ++++++++++++
 arch/arm/mach-ux500/cpu.c                |    6 ++++++
 arch/arm/mach-ux500/include/mach/setup.h |    1 +
 6 files changed, 26 insertions(+), 4 deletions(-)
arch/arm/mach-ux500/board-mop500.c +4 -0
index 77d03c1..348ebd9 100644
@@ -722,6 +722,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= mop500_init_machine,
+	.init_late	= ux500_init_late,
 MACHINE_END
 
 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
@@ -731,6 +732,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= hrefv60_init_machine,
+	.init_late	= ux500_init_late,
 MACHINE_END
 
 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
@@ -741,6 +743,7 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= snowball_init_machine,
+	.init_late	= ux500_init_late,
 MACHINE_END
 
 #ifdef CONFIG_MACH_UX500_DT
@@ -830,6 +833,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= u8500_init_machine,
+	.init_late	= ux500_init_late,
 	.dt_compat      = u8500_dt_board_compat,
 MACHINE_END
 #endif
arch/arm/mach-ux500/board-u5500.c +1 -0
index 0ff4be7..c7f5c82 100644
@@ -159,4 +159,5 @@ MACHINE_START(U5500, "ST-Ericsson U5500 Platform")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= u5500_init_machine,
+	.init_late	= ux500_init_late,
 MACHINE_END
arch/arm/mach-ux500/clock.c +2 -4
index ec35f0a..ce00f5e 100644
@@ -633,7 +633,7 @@ static int clk_debugfs_register(struct clk *c)
 	return 0;
 }
 
-static int __init clk_debugfs_init(void)
+int __init clk_debugfs_init(void)
 {
 	struct clk *c;
 	struct dentry *d;
@@ -655,7 +655,6 @@ err_out:
 	return err;
 }
 
-late_initcall(clk_debugfs_init);
 #endif /* defined(CONFIG_DEBUG_FS) */
 
 unsigned long clk_smp_twd_rate = 500000000;
@@ -694,12 +693,11 @@ static struct notifier_block clk_twd_cpufreq_nb = {
 	.notifier_call = clk_twd_cpufreq_transition,
 };
 
-static int clk_init_smp_twd_cpufreq(void)
+int clk_init_smp_twd_cpufreq(void)
 {
 	return cpufreq_register_notifier(&clk_twd_cpufreq_nb,
 				  CPUFREQ_TRANSITION_NOTIFIER);
 }
-late_initcall(clk_init_smp_twd_cpufreq);
 
 #endif
 
arch/arm/mach-ux500/clock.h +12 -0
index d776ada..65d27a1 100644
@@ -150,3 +150,15 @@ struct clk clk_##_name = {						\
 
 int __init clk_db8500_ed_fixup(void);
 int __init clk_init(void);
+
+#ifdef CONFIG_DEBUG_FS
+int clk_debugfs_init(void);
+#else
+static inline int clk_debugfs_init(void) { return 0; }
+#endif
+
+#ifdef CONFIG_CPU_FREQ
+int clk_init_smp_twd_cpufreq(void);
+#else
+static inline int clk_init_smp_twd_cpufreq(void) { return 0; }
+#endif
arch/arm/mach-ux500/cpu.c +6 -0
index d11f389..9856c57 100644
@@ -67,6 +67,12 @@ void __init ux500_init_irq(void)
 	clk_init();
 }
 
+void __init ux500_init_late(void)
+{
+	clk_debugfs_init();
+	clk_init_smp_twd_cpufreq();
+}
+
 static const char * __init ux500_get_machine(void)
 {
 	return kasprintf(GFP_KERNEL, "DB%4x", dbx500_partnumber());
arch/arm/mach-ux500/include/mach/setup.h +1 -0
index 3dc00ff..7b5d865 100644
@@ -22,6 +22,7 @@ extern struct device * __init u5500_init_devices(void);
 extern struct device * __init u8500_init_devices(void);
 
 extern void __init ux500_init_irq(void);
+extern void __init ux500_init_late(void);
 
 extern void __init u5500_sdi_init(struct device *parent);
 
Signature · 1 line
1.7.5.4
#51 lore raw

PATCH 17/17 ARM: ux500: use machine specific hook for late init

Quoted 6 lines · Shawn Guo
Cc Srinidhi Kasagar <[email protected]>
Cc Linus Walleij <[email protected]>
---
 arch/arm/mach-ux500/board-mop500.c       |    4 ++++
 arch/arm/mach-ux500/board-u5500.c        |    1 +

This might collide with Linus W's patch set which removes the u5500 support.

Otherwise, looks ok to me.

Thanks,
Srinidhi

author
#52 lore raw

PATCH 17/17 ARM: ux500: use machine specific hook for late init

Quoted 11 lines · Srinidhi Kasagar
Quoted 6 lines · Shawn Guo
Cc Srinidhi Kasagar <[email protected]>
Cc Linus Walleij <[email protected]>
---
 arch/arm/mach-ux500/board-mop500.c       |    4 ++++
 arch/arm/mach-ux500/board-u5500.c        |    1 +

This might collide with Linus W's patch set which removes the u5500 support.

Then I will drop the changes on board-u5500.c.

Signature · 2 lines
Regards,
Shawn