Linux-OMAP Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] Few clean-up patches after dropping legacy data
@ 2021-03-12  9:25 Tony Lindgren
  2021-03-12  9:25 ` [PATCH 1/2] ARM: OMAP2+: Stop building legacy code for dra7 and omap4/5 Tony Lindgren
  2021-03-12  9:25 ` [PATCH 2/2] bus: ti-sysc: Warn about old dtb " Tony Lindgren
  0 siblings, 2 replies; 3+ messages in thread
From: Tony Lindgren @ 2021-03-12  9:25 UTC (permalink / raw)
  To: linux-omap
  Cc: Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman, Grygorii Strashko,
	Keerthy, Nishanth Menon, Suman Anna, linux-kernel,
	linux-arm-kernel

Hi all,

Here are few clean-up patches after we are dropping the legacy data for
omap4/5 and dra7. These are against my omap-for-v5.13/genpd-drop-legacy
branch at [0].

Regards,

Tony


[0] https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git/log/?h=omap-for-v5.13/genpd-drop-legacy

Tony Lindgren (2):
  ARM: OMAP2+: Stop building legacy code for dra7 and omap4/5
  bus: ti-sysc: Warn about old dtb for dra7 and omap4/5

 arch/arm/mach-omap2/Makefile       |  8 ++++----
 arch/arm/mach-omap2/io.c           |  7 ++++++-
 arch/arm/mach-omap2/omap_hwmod.h   | 13 +++++++++++++
 arch/arm/mach-omap2/pdata-quirks.c |  2 +-
 arch/arm/mach-omap2/sr_device.c    |  7 +++++++
 drivers/bus/ti-sysc.c              |  3 +++
 6 files changed, 34 insertions(+), 6 deletions(-)

-- 
2.30.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] ARM: OMAP2+: Stop building legacy code for dra7 and omap4/5
  2021-03-12  9:25 [PATCH 0/2] Few clean-up patches after dropping legacy data Tony Lindgren
@ 2021-03-12  9:25 ` Tony Lindgren
  2021-03-12  9:25 ` [PATCH 2/2] bus: ti-sysc: Warn about old dtb " Tony Lindgren
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2021-03-12  9:25 UTC (permalink / raw)
  To: linux-omap
  Cc: Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman, Grygorii Strashko,
	Keerthy, Nishanth Menon, Suman Anna, linux-kernel,
	linux-arm-kernel

With the recent changes we are now booting am3/4, dra7, and omap4/5
without legacy data using devicetree, simple-pm-bus and genpd. Let's not
initialize and build the legacy data unless CONFIG_OMAP_HWMOD is selected
based on the SoCs enabled in .config.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Makefile       |  8 ++++----
 arch/arm/mach-omap2/io.c           |  7 ++++++-
 arch/arm/mach-omap2/omap_hwmod.h   | 13 +++++++++++++
 arch/arm/mach-omap2/pdata-quirks.c |  2 +-
 arch/arm/mach-omap2/sr_device.c    |  7 +++++++
 5 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -20,14 +20,14 @@ secure-common				= omap-smc.o omap-secure.o
 
 obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
-obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common)
+obj-$(CONFIG_ARCH_OMAP4) += $(secure-common)
 obj-$(CONFIG_SOC_AM33XX) += $(secure-common)
-obj-$(CONFIG_SOC_OMAP5)  += $(hwmod-common) $(secure-common)
+obj-$(CONFIG_SOC_OMAP5)  += $(secure-common)
 obj-$(CONFIG_SOC_AM43XX) += $(secure-common)
-obj-$(CONFIG_SOC_DRA7XX) += $(hwmod-common) $(secure-common)
+obj-$(CONFIG_SOC_DRA7XX) += $(secure-common)
 
 ifneq ($(CONFIG_SND_SOC_OMAP_MCBSP),)
-obj-y += mcbsp.o
+obj-$(CONFIG_OMAP_HWMOD) += mcbsp.o
 endif
 
 obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -402,6 +402,7 @@ static int __init _omap2_init_reprogram_sdrc(void)
 	return v;
 }
 
+#ifdef CONFIG_OMAP_HWMOD
 static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
 {
 	return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
@@ -414,6 +415,11 @@ static void __init __maybe_unused omap_hwmod_init_postsetup(void)
 	/* Set the default postsetup state for all hwmods */
 	omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
 }
+#else
+static inline void omap_hwmod_init_postsetup(void)
+{
+}
+#endif
 
 #ifdef CONFIG_SOC_OMAP2420
 void __init omap2420_init_early(void)
@@ -615,7 +621,6 @@ void __init omap4430_init_early(void)
 	omap44xx_voltagedomains_init();
 	omap44xx_powerdomains_init();
 	omap44xx_clockdomains_init();
-	omap_hwmod_init_postsetup();
 	omap_l2_cache_init();
 	omap_clk_soc_init = omap4xxx_dt_clk_init;
 	omap_secure_init();
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -607,6 +607,8 @@ struct omap_hwmod {
 	struct omap_hwmod		*parent_hwmod;
 };
 
+#ifdef CONFIG_OMAP_HWMOD
+
 struct device_node;
 
 struct omap_hwmod *omap_hwmod_lookup(const char *name);
@@ -656,6 +658,17 @@ extern void __init omap_hwmod_init(void);
 
 const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
 
+#else	/* CONFIG_OMAP_HWMOD */
+
+static inline int
+omap_hwmod_for_each_by_class(const char *classname,
+			     int (*fn)(struct omap_hwmod *oh, void *user),
+			     void *user)
+{
+	return 0;
+}
+#endif	/* CONFIG_OMAP_HWMOD */
+
 /*
  *
  */
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -443,7 +443,7 @@ void omap_auxdata_legacy_init(struct device *dev)
 	dev->platform_data = &twl_gpio_auxdata;
 }
 
-#if IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP)
+#if defined(CONFIG_ARCH_OMAP3) && IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP)
 static struct omap_mcbsp_platform_data mcbsp_pdata;
 static void __init omap3_mcbsp_init(void)
 {
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -152,6 +152,7 @@ static int __init sr_init_by_name(const char *name, const char *voltdm)
 	return 0;
 }
 
+#ifdef CONFIG_OMAP_HWMOD
 static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
 {
 	struct omap_smartreflex_dev_attr *sr_dev_attr;
@@ -165,6 +166,12 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
 
 	return sr_init_by_name(oh->name, sr_dev_attr->sensor_voltdm_name);
 }
+#else
+static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
+{
+	return -EINVAL;
+}
+#endif
 
 /*
  * API to be called from board files to enable smartreflex
-- 
2.30.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] bus: ti-sysc: Warn about old dtb for dra7 and omap4/5
  2021-03-12  9:25 [PATCH 0/2] Few clean-up patches after dropping legacy data Tony Lindgren
  2021-03-12  9:25 ` [PATCH 1/2] ARM: OMAP2+: Stop building legacy code for dra7 and omap4/5 Tony Lindgren
@ 2021-03-12  9:25 ` Tony Lindgren
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2021-03-12  9:25 UTC (permalink / raw)
  To: linux-omap
  Cc: Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman, Grygorii Strashko,
	Keerthy, Nishanth Menon, Suman Anna, linux-kernel,
	linux-arm-kernel

Let's warn if an old incomplete dtb is detected. We now assume the dtb
is complete and does not depend on the legacy platform data.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/bus/ti-sysc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -2886,6 +2886,9 @@ static int sysc_init_soc(struct sysc *ddata)
 	switch (sysc_soc->soc) {
 	case SOC_AM3:
 	case SOC_AM4:
+	case SOC_4430 ... SOC_4470:
+	case SOC_5430:
+	case SOC_DRA7:
 		np = of_find_node_by_path("/ocp");
 		WARN_ONCE(np && of_device_is_compatible(np, "simple-bus"),
 			  "ti-sysc: Incomplete old dtb, please update\n");
-- 
2.30.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12  9:25 [PATCH 0/2] Few clean-up patches after dropping legacy data Tony Lindgren
2021-03-12  9:25 ` [PATCH 1/2] ARM: OMAP2+: Stop building legacy code for dra7 and omap4/5 Tony Lindgren
2021-03-12  9:25 ` [PATCH 2/2] bus: ti-sysc: Warn about old dtb " Tony Lindgren

Linux-OMAP Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-omap/0 linux-omap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-omap linux-omap/ https://lore.kernel.org/linux-omap \
		linux-omap@vger.kernel.org
	public-inbox-index linux-omap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-omap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git