Skip to contentSkip to conversation

ARM: shmobile: r8a7740/armadillo800eva legacy PM domain support

PATCH New Geert Uytterhoeven 3 participants 21 messages Oct 23, 2014 – Oct 27, 2014

Subsystems (4)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

v3 cover ARM: shmobile: r8a7740/armadillo800eva legacy PM domain support

Hi Simon, Magnus,

This series improves PM domain support for r8a7740/armadillo800eva legacy, mimicking (parts of) the existing PM domain support for sh7372/mackerel.

More specifically, it
- Adds missing devices to existing PM domains,
- Adds missing PM domains, hooking up devices and subdomains.

This series is based on renesas-devel-20141016-v3.17, but working resume from s2ram depends on a fix for sh_mobile_hdmi which is only in v3.18-rc1.

Changes in v3:
- Keep D4 PM domain powered, until the ARM debug/perf code uses resource management with runtime PM support.

Changes in v2:
- Dropped FIXMes on behavior that turned out to be expected,
- Hook up the HDMI-Link hardware block,
- Really add the A4MP and D4 PM domains, as fixes are available,
- Move special CPU domain handling from A4S to A3SM.

Please apply, after merging in v3.18-rc1.

Thanks!

Geert Uytterhoeven (11):
ARM: shmobile: r8a7740: Add missing A3SP pm domain devices
ARM: shmobile: r8a7740: Add missing A4S pm domain devices
ARM: shmobile: armadillo800eva legacy: Add missing A3SP pm domain
devices
ARM: shmobile: armadillo800eva legacy: Add missing A4S pm domain
devices
ARM: shmobile: r8a7740: Add A3RV pm domain support
ARM: shmobile: r8a7740: Add A3SG pm domain support
ARM: shmobile: r8a7740/armadillo legacy: Add A4MP pm domain support
ARM: shmobile: r8a7740: Add D4 pm domain support
ARM: shmobile: r8a7740/armadillo legacy: Add A4R pm domain support
ARM: shmobile: r8a7740: Add A4SU pm domain support
ARM: shmobile: r8a7740: Add A3SM pm domain support

 arch/arm/mach-shmobile/board-armadillo800eva.c | 12 ++++++-
 arch/arm/mach-shmobile/pm-r8a7740.c            | 44 +++++++++++++++++++++++---
 arch/arm/mach-shmobile/setup-r8a7740.c         | 11 +++++++
 3 files changed, 62 insertions(+), 5 deletions(-)
Signature · 12 lines
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH v3 1/11 ARM: shmobile: r8a7740: Add missing A3SP pm domain devices

Commit 802a5639aa7041b2 ("ARM: shmobile: r8a7740: add A3SP pm domain support") added the A3SP power domain, but forgot to hook up the IPPMU, DMAC0/1/2, and USBDMAC hardware blocks.

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/setup-r8a7740.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-shmobile/setup-r8a7740.c +5 -0
index 8894e1b7ab0e65bb..6992d4013ef013da 100644
@@ -756,6 +756,11 @@ void __init r8a7740_add_standard_devices(void)
 		{ "A3SP", &scif7_device },
 		{ "A3SP", &scif8_device },
 		{ "A3SP", &i2c1_device },
+		{ "A3SP", &ipmmu_device },
+		{ "A3SP", &dma0_device },
+		{ "A3SP", &dma1_device },
+		{ "A3SP", &dma2_device },
+		{ "A3SP", &usb_dma_device },
 	};
 
 	/* I2C work-around */
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 1/11 ARM: shmobile: r8a7740: Add missing A3SP pm domain devices

Quoted 5 lines · Geert Uytterhoeven

Commit 802a5639aa7041b2 ("ARM: shmobile: r8a7740: add A3SP pm domain support") added the A3SP power domain, but forgot to hook up the IPPMU, DMAC0/1/2, and USBDMAC hardware blocks.

Quoted 8 lines

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/setup-r8a7740.c | 5 +++++
 1 file changed, 5 insertions(+)

Thanks, I have queued this up.

Quoted 20 lines
arch/arm/mach-shmobile/setup-r8a7740.c +5 -0
index 8894e1b7ab0e65bb..6992d4013ef013da 100644
@@ -756,6 +756,11 @@ void __init r8a7740_add_standard_devices(void)
 		{ "A3SP", &scif7_device },
 		{ "A3SP", &scif8_device },
 		{ "A3SP", &i2c1_device },
+		{ "A3SP", &ipmmu_device },
+		{ "A3SP", &dma0_device },
+		{ "A3SP", &dma1_device },
+		{ "A3SP", &dma2_device },
+		{ "A3SP", &usb_dma_device },
 	};
 
 	/* I2C work-around */
Signature · 1 line
1.9.1
author maintainer
#3 lore raw

PATCH v3 2/11 ARM: shmobile: r8a7740: Add missing A4S pm domain devices

In reply to Geert Uytterhoeven

Commit 8459293c27bcd13a ("ARM: shmobile: r8a7740: add A4S pm domain support") added the A4S power domain, but forgot to hook up the INTCA hardware block.

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/setup-r8a7740.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-shmobile/setup-r8a7740.c +4 -0
index 6992d4013ef013da..dbf8a93ccc4f412d 100644
@@ -746,6 +746,10 @@ static void r8a7740_i2c_workaround(struct platform_device *pdev)
 void __init r8a7740_add_standard_devices(void)
 {
 	static struct pm_domain_device domain_devices[] __initdata = {
+		{ "A4S",  &irqpin0_device },
+		{ "A4S",  &irqpin1_device },
+		{ "A4S",  &irqpin2_device },
+		{ "A4S",  &irqpin3_device },
 		{ "A3SP", &scif0_device },
 		{ "A3SP", &scif1_device },
 		{ "A3SP", &scif2_device },
Signature · 1 line
1.9.1
#4 lore raw

PATCH v3 2/11 ARM: shmobile: r8a7740: Add missing A4S pm domain devices

Quoted 5 lines · Geert Uytterhoeven

Commit 8459293c27bcd13a ("ARM: shmobile: r8a7740: add A4S pm domain support") added the A4S power domain, but forgot to hook up the INTCA hardware block.

Thanks, I have queued this up.

Quoted 27 lines

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/setup-r8a7740.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-shmobile/setup-r8a7740.c +4 -0
index 6992d4013ef013da..dbf8a93ccc4f412d 100644
@@ -746,6 +746,10 @@ static void r8a7740_i2c_workaround(struct platform_device *pdev)
 void __init r8a7740_add_standard_devices(void)
 {
 	static struct pm_domain_device domain_devices[] __initdata = {
+		{ "A4S",  &irqpin0_device },
+		{ "A4S",  &irqpin1_device },
+		{ "A4S",  &irqpin2_device },
+		{ "A4S",  &irqpin3_device },
 		{ "A3SP", &scif0_device },
 		{ "A3SP", &scif1_device },
 		{ "A3SP", &scif2_device },
Signature · 1 line
1.9.1
author maintainer
#5 lore raw

PATCH v3 3/11 ARM: shmobile: armadillo800eva legacy: Add missing A3SP pm domain devices

In reply to Geert Uytterhoeven

Commit 802a5639aa7041b2 ("ARM: shmobile: r8a7740: add A3SP pm domain support") added the A3SP power domain, but forgot to hook up the TPU, SDHI0/1, and MMCIF hardware blocks.

Note: As the default PM QoS latency constraint for SDHI is only 100 ?s (cfr. commit c419e611c3c59c0e ("tmio_mmc / PM: Use PM QoS latency constraint"), while DEFAULT_DEV_LATENCY_NS is 250000, suspend fails with -EBUSY, unless the constraint is increased first to more than 500 ?s using e.g.

echo 501 > /sys/devices/platform/sh_mobile_sdhi.0/power/pm_qos_resume_latency_us

---
v3:
- No changes,
v2:
- Converted FIXME to Note, as this is expected behavior.

---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/board-armadillo800eva.c +7 -1
index f19459a8c3edbb77..64a68450c28a072c 100644
@@ -1234,8 +1234,11 @@ static void __init eva_init(void)
 	static struct pm_domain_device domain_devices[] __initdata = {
 		{ "A4LC", &lcdc0_device },
 		{ "A4LC", &hdmi_lcdc_device },
+		{ "A3SP", &pwm_device },
+		{ "A3SP", &sdhi0_device },
+		{ "A3SP", &sh_mmcif_device },
 	};
-	struct platform_device *usb = NULL;
+	struct platform_device *usb = NULL, *sdhi1 = NULL;
 
 	regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
 				     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
@@ -1304,6 +1307,7 @@ static void __init eva_init(void)
 
 		platform_device_register(&vcc_sdhi1);
 		platform_device_register(&sdhi1_device);
+		sdhi1 = &sdhi1_device;
 	}
 
 
@@ -1324,6 +1328,8 @@ static void __init eva_init(void)
 				       ARRAY_SIZE(domain_devices));
 	if (usb)
 		rmobile_add_device_to_domain("A3SP", usb);
+	if (sdhi1)
+		rmobile_add_device_to_domain("A3SP", sdhi1);
 
 	r8a7740_pm_init();
 }
Signature · 1 line
1.9.1
author maintainer
#6 lore raw

PATCH v3 4/11 ARM: shmobile: armadillo800eva legacy: Add missing A4S pm domain devices

In reply to Geert Uytterhoeven

Commit 8459293c27bcd13a ("ARM: shmobile: r8a7740: add A4S pm domain support") added the A4S power domain, but forgot to hook up the GbEther hardware block.

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +1 -0
index 64a68450c28a072c..735036038951868d 100644
@@ -1234,6 +1234,7 @@ static void __init eva_init(void)
 	static struct pm_domain_device domain_devices[] __initdata = {
 		{ "A4LC", &lcdc0_device },
 		{ "A4LC", &hdmi_lcdc_device },
+		{ "A4S",  &sh_eth_device },
 		{ "A3SP", &pwm_device },
 		{ "A3SP", &sdhi0_device },
 		{ "A3SP", &sh_mmcif_device },
Signature · 1 line
1.9.1
#7 lore raw

PATCH v3 4/11 ARM: shmobile: armadillo800eva legacy: Add missing A4S pm domain devices

Quoted 5 lines · Geert Uytterhoeven

Commit 8459293c27bcd13a ("ARM: shmobile: r8a7740: add A4S pm domain support") added the A4S power domain, but forgot to hook up the GbEther hardware block.

Thanks, I have queued this up.

Quoted 24 lines

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +1 -0
index 64a68450c28a072c..735036038951868d 100644
@@ -1234,6 +1234,7 @@ static void __init eva_init(void)
 	static struct pm_domain_device domain_devices[] __initdata = {
 		{ "A4LC", &lcdc0_device },
 		{ "A4LC", &hdmi_lcdc_device },
+		{ "A4S",  &sh_eth_device },
 		{ "A3SP", &pwm_device },
 		{ "A3SP", &sdhi0_device },
 		{ "A3SP", &sh_mmcif_device },
Signature · 1 line
1.9.1
#8 lore raw

PATCH v3 4/11 ARM: shmobile: armadillo800eva legacy: Add missing A4S pm domain devices

Quoted 8 lines · Simon Horman
Quoted 5 lines · Geert Uytterhoeven

Commit 8459293c27bcd13a ("ARM: shmobile: r8a7740: add A4S pm domain support") added the A4S power domain, but forgot to hook up the GbEther hardware block.

Thanks, I have queued this up.

Sorry, my mistake, I have not queued this up as I would like to get all the soc changes in place before adding the board changes.

Quoted 29 lines
Quoted 24 lines

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +1 -0
index 64a68450c28a072c..735036038951868d 100644
@@ -1234,6 +1234,7 @@ static void __init eva_init(void)
 	static struct pm_domain_device domain_devices[] __initdata = {
 		{ "A4LC", &lcdc0_device },
 		{ "A4LC", &hdmi_lcdc_device },
+		{ "A4S",  &sh_eth_device },
 		{ "A3SP", &pwm_device },
 		{ "A3SP", &sdhi0_device },
 		{ "A3SP", &sh_mmcif_device },
Signature · 1 line
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#9 lore raw

PATCH v3 5/11 ARM: shmobile: r8a7740: Add A3RV pm domain support

In reply to Geert Uytterhoeven

Add support for the A3RV power domain.
This domain contains the VPU5F and VCP1 hardware blocks, which are currently not used by any driver.

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-shmobile/pm-r8a7740.c +3 -0
index e3f1464482371bb4..1d916038660d4b8a 100644
@@ -37,6 +37,9 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.genpd.name	= "A4LC",
 		.bit_shift	= 1,
 	}, {
+		.genpd.name	= "A3RV",
+		.bit_shift	= 6,
+	}, {
 		.genpd.name	= "A4S",
 		.bit_shift	= 10,
 		.gov		= &pm_domain_always_on_gov,
Signature · 1 line
1.9.1
#10 lore raw

PATCH v3 5/11 ARM: shmobile: r8a7740: Add A3RV pm domain support

Quoted 5 lines · Geert Uytterhoeven

Add support for the A3RV power domain.
This domain contains the VPU5F and VCP1 hardware blocks, which are currently not used by any driver.

Thanks, I have queued this up.

Quoted 26 lines

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-shmobile/pm-r8a7740.c +3 -0
index e3f1464482371bb4..1d916038660d4b8a 100644
@@ -37,6 +37,9 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.genpd.name	= "A4LC",
 		.bit_shift	= 1,
 	}, {
+		.genpd.name	= "A3RV",
+		.bit_shift	= 6,
+	}, {
 		.genpd.name	= "A4S",
 		.bit_shift	= 10,
 		.gov		= &pm_domain_always_on_gov,
Signature · 1 line
1.9.1
author maintainer
#11 lore raw

PATCH v3 6/11 ARM: shmobile: r8a7740: Add A3SG pm domain support

In reply to Geert Uytterhoeven

Add support for the A3SG power domain, and hook it up as a subdomain of A4S.
This domain contains the SGX540 hardware block, which is currently not used by any driver.

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-shmobile/pm-r8a7740.c +4 -0
index 1d916038660d4b8a..932c2a621e81ac26 100644
@@ -51,6 +51,9 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.gov		= &pm_domain_always_on_gov,
 		.no_debug	= true,
 		.suspend	= r8a7740_pd_a3sp_suspend,
+	}, {
+		.genpd.name	= "A3SG",
+		.bit_shift	= 13,
 	},
 };
 
@@ -58,6 +61,7 @@ void __init r8a7740_init_pm_domains(void)
 {
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
+	pm_genpd_add_subdomain_names("A4S", "A3SG");
 }
 #endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
 
Signature · 1 line
1.9.1
#12 lore raw

PATCH v3 6/11 ARM: shmobile: r8a7740: Add A3SG pm domain support

Quoted 6 lines · Geert Uytterhoeven

Add support for the A3SG power domain, and hook it up as a subdomain of A4S.
This domain contains the SGX540 hardware block, which is currently not used by any driver.

Thanks, I have queued this up.

Quoted 34 lines

---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-shmobile/pm-r8a7740.c +4 -0
index 1d916038660d4b8a..932c2a621e81ac26 100644
@@ -51,6 +51,9 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.gov		= &pm_domain_always_on_gov,
 		.no_debug	= true,
 		.suspend	= r8a7740_pd_a3sp_suspend,
+	}, {
+		.genpd.name	= "A3SG",
+		.bit_shift	= 13,
 	},
 };
 
@@ -58,6 +61,7 @@ void __init r8a7740_init_pm_domains(void)
 {
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
+	pm_genpd_add_subdomain_names("A4S", "A3SG");
 }
 #endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
 
Signature · 1 line
1.9.1
author maintainer
#13 lore raw

PATCH v3 7/11 ARM: shmobile: r8a7740/armadillo legacy: Add A4MP pm domain support

In reply to Geert Uytterhoeven

Add support for the A4MP power domain, and hook up the HDMI-Link and FSI hardware blocks.
This domain also contains the SPU2, FMSI, and BBIF2 hardware blocks, but these are currently not used by any driver.

---
v3:
- No changes,
v2:
- Also hook up HDMI-Link, which was not documented in the datasheet as belonging to A4MP,
- Really add A4MP and drop the FIXME, as a fix for the interrupt storm is available.

---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 2 ++
 arch/arm/mach-shmobile/pm-r8a7740.c            | 3 +++
 2 files changed, 5 insertions(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +2 -0
index 735036038951868d..c37d7b697a35322d 100644
@@ -1234,6 +1234,8 @@ static void __init eva_init(void)
 	static struct pm_domain_device domain_devices[] __initdata = {
 		{ "A4LC", &lcdc0_device },
 		{ "A4LC", &hdmi_lcdc_device },
+		{ "A4MP", &hdmi_device },
+		{ "A4MP", &fsi_device },
 		{ "A4S",  &sh_eth_device },
 		{ "A3SP", &pwm_device },
 		{ "A3SP", &sdhi0_device },
arch/arm/mach-shmobile/pm-r8a7740.c +3 -0
index 932c2a621e81ac26..081a4f9726a0c909 100644
@@ -37,6 +37,9 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.genpd.name	= "A4LC",
 		.bit_shift	= 1,
 	}, {
+		.genpd.name	= "A4MP",
+		.bit_shift	= 2,
+	}, {
 		.genpd.name	= "A3RV",
 		.bit_shift	= 6,
 	}, {
Signature · 1 line
1.9.1
#14 lore raw

PATCH v3 7/11 ARM: shmobile: r8a7740/armadillo legacy: Add A4MP pm domain support

Quoted 6 lines · Geert Uytterhoeven

Add support for the A4MP power domain, and hook up the HDMI-Link and FSI hardware blocks.
This domain also contains the SPU2, FMSI, and BBIF2 hardware blocks, but these are currently not used by any driver.

Is it possible to split this into two patches.

A board patch (that touches board-armadillo800eva.c) and an SoC patch (the rest). Likewise for any remaining patches in this series that touch both board and SoC code.

The reason for this is that it would make the patches fit the branch scheme that arm-soc people like. In particular splitting patches between soc and boards branches.

Please note that I have queued up four of the SoC earlier patches in the series. You don't need to repost them.

Quoted 43 lines

---
v3:
- No changes,
v2:
- Also hook up HDMI-Link, which was not documented in the datasheet as belonging to A4MP,
- Really add A4MP and drop the FIXME, as a fix for the interrupt storm is available.

---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 2 ++
 arch/arm/mach-shmobile/pm-r8a7740.c            | 3 +++
 2 files changed, 5 insertions(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +2 -0
index 735036038951868d..c37d7b697a35322d 100644
@@ -1234,6 +1234,8 @@ static void __init eva_init(void)
 	static struct pm_domain_device domain_devices[] __initdata = {
 		{ "A4LC", &lcdc0_device },
 		{ "A4LC", &hdmi_lcdc_device },
+		{ "A4MP", &hdmi_device },
+		{ "A4MP", &fsi_device },
 		{ "A4S",  &sh_eth_device },
 		{ "A3SP", &pwm_device },
 		{ "A3SP", &sdhi0_device },
arch/arm/mach-shmobile/pm-r8a7740.c +3 -0
index 932c2a621e81ac26..081a4f9726a0c909 100644
@@ -37,6 +37,9 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.genpd.name	= "A4LC",
 		.bit_shift	= 1,
 	}, {
+		.genpd.name	= "A4MP",
+		.bit_shift	= 2,
+	}, {
 		.genpd.name	= "A3RV",
 		.bit_shift	= 6,
 	}, {
Signature · 1 line
1.9.1
#15 lore raw

PATCH v3 7/11 ARM: shmobile: r8a7740/armadillo legacy: Add A4MP pm domain support

Hi Simon,

Quoted 10 lines · Simon Horman
Quoted 6 lines · Geert Uytterhoeven

Add support for the A4MP power domain, and hook up the HDMI-Link and FSI hardware blocks.
This domain also contains the SPU2, FMSI, and BBIF2 hardware blocks, but these are currently not used by any driver.

Is it possible to split this into two patches.

Quoted 7 lines

A board patch (that touches board-armadillo800eva.c) and an SoC patch (the rest). Likewise for any remaining patches in this series that touch both board and SoC code.

The reason for this is that it would make the patches fit the branch scheme that arm-soc people like. In particular splitting patches between soc and boards branches.

I kept them together as adding the PM domain without the devices will cause regressions (the PM domain core will power down the PM domain as it doesn't know about the to-be-added devices, and thus thinks it's unused).

As the link from a device to a PM domain is a name string, and not a C reference, I could split them in two parts: first the board part that adds some
devices, and then the SoC part that adds the PM domain and more devices. But only if you can guarantee that the SoC part will be merged first, also by arm-soc and Linus.

Still, I prefer to keep them together. Hooking up devices to PM domains is SoC-specific, not board specific (for DT it lives in the .dtsi). It's unfortunate this code is in the board-specific C files due to board-specific configuration (cfr. .dts overriding/extending .dtsi).

What do you think? Do you agree?

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#16 lore raw

PATCH v3 7/11 ARM: shmobile: r8a7740/armadillo legacy: Add A4MP pm domain support

Quoted 32 lines · Geert Uytterhoeven

Hi Simon,

Quoted 10 lines · Simon Horman
Quoted 6 lines · Geert Uytterhoeven

Add support for the A4MP power domain, and hook up the HDMI-Link and FSI hardware blocks.
This domain also contains the SPU2, FMSI, and BBIF2 hardware blocks, but these are currently not used by any driver.

Is it possible to split this into two patches.

Quoted 7 lines

A board patch (that touches board-armadillo800eva.c) and an SoC patch (the rest). Likewise for any remaining patches in this series that touch both board and SoC code.

The reason for this is that it would make the patches fit the branch scheme that arm-soc people like. In particular splitting patches between soc and boards branches.

I kept them together as adding the PM domain without the devices will cause regressions (the PM domain core will power down the PM domain as it doesn't know about the to-be-added devices, and thus thinks it's unused).

As the link from a device to a PM domain is a name string, and not a C reference, I could split them in two parts: first the board part that adds some
devices, and then the SoC part that adds the PM domain and more devices. But only if you can guarantee that the SoC part will be merged first, also by arm-soc and Linus.

Quoted 6 lines

Still, I prefer to keep them together. Hooking up devices to PM domains is SoC-specific, not board specific (for DT it lives in the .dtsi). It's unfortunate this code is in the board-specific C files due to board-specific configuration (cfr. .dts overriding/extending .dtsi).

What do you think? Do you agree?

Hi Geert, thanks for the explanation. I agree that it makes sense to keep things together. I'll see about queuing-up your series as-is.

author maintainer
#17 lore raw

PATCH v3 8/11 ARM: shmobile: r8a7740: Add D4 pm domain support

In reply to Geert Uytterhoeven

Add support for the D4 power domain.
This domain contains the Coresight-ETM hardware block.

As long as the ARM debug/perf code doesn't use resource management with runtime PM support, the D4 power domain must be kept powered to avoid a crash during resume from s2ram (dbg_cpu_pm_notify() calls reset_ctrl_regs() unconditionally, causing an undefined instruction oops).

---
v3:
- Always keep D4 powered, until the new Coresight code handles runtime

    PM,
v2:
  - Really add D4 and drop the FIXME, as a fix for the crash is
    available.
---
 arch/arm/mach-shmobile/pm-r8a7740.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/mach-shmobile/pm-r8a7740.c +15 -0
index 081a4f9726a0c909..8b1af2a585ab99d4 100644
@@ -32,6 +32,16 @@ static int r8a7740_pd_a3sp_suspend(void)
 	return console_suspend_enabled ? 0 : -EBUSY;
 }
 
+static int r8a7740_pd_d4_suspend(void)
+{
+	/*
+	 * The D4 domain contains the Coresight-ETM hardware block and
+	 * therefore it should only be turned off if the debug module is
+	 * not in use.
+	 */
+	return -EBUSY;
+}
+
 static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 	{
 		.genpd.name	= "A4LC",
@@ -40,6 +50,11 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.genpd.name	= "A4MP",
 		.bit_shift	= 2,
 	}, {
+		.genpd.name	= "D4",
+		.bit_shift	= 3,
+		.gov		= &pm_domain_always_on_gov,
+		.suspend	= r8a7740_pd_d4_suspend,
+	}, {
 		.genpd.name	= "A3RV",
 		.bit_shift	= 6,
 	}, {
Signature · 1 line
1.9.1
author maintainer
#18 lore raw

PATCH v3 9/11 ARM: shmobile: r8a7740/armadillo legacy: Add A4R pm domain support

In reply to Geert Uytterhoeven

Add support for the A4R power domain, and hook up the A3RV subdomain, and the CEU0, TMU0, and IIC0 hardware blocks.
This domain also contains the Realtime CPU (SH-4A), Realtime CPU debug modules, H-UDI, RT-SHwy, INTCS, RT-HPB, VIO6C, JPU, RTDMAC1/2, SSP, MSIOF0, CMT0, ICB, DREQPAK (RT), 2DDMAC, IPMMUI, and 2DG hardware blocks, but these are currently not used by any driver.
---
v3:
- No changes,
v2:
- No changes.

---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 1 +
 arch/arm/mach-shmobile/pm-r8a7740.c            | 4 ++++
 arch/arm/mach-shmobile/setup-r8a7740.c         | 2 ++
 3 files changed, 7 insertions(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +1 -0
index c37d7b697a35322d..2632beaad6c838c2 100644
@@ -1236,6 +1236,7 @@ static void __init eva_init(void)
 		{ "A4LC", &hdmi_lcdc_device },
 		{ "A4MP", &hdmi_device },
 		{ "A4MP", &fsi_device },
+		{ "A4R",  &ceu0_device },
 		{ "A4S",  &sh_eth_device },
 		{ "A3SP", &pwm_device },
 		{ "A3SP", &sdhi0_device },
arch/arm/mach-shmobile/pm-r8a7740.c +4 -0
index 8b1af2a585ab99d4..74e6a67a28d3c336 100644
@@ -55,6 +55,9 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.gov		= &pm_domain_always_on_gov,
 		.suspend	= r8a7740_pd_d4_suspend,
 	}, {
+		.genpd.name	= "A4R",
+		.bit_shift	= 5,
+	}, {
 		.genpd.name	= "A3RV",
 		.bit_shift	= 6,
 	}, {
@@ -78,6 +81,7 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 void __init r8a7740_init_pm_domains(void)
 {
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
+	pm_genpd_add_subdomain_names("A4R", "A3RV");
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 	pm_genpd_add_subdomain_names("A4S", "A3SG");
 }
arch/arm/mach-shmobile/setup-r8a7740.c +2 -0
index dbf8a93ccc4f412d..b77c226ab891a5dd 100644
@@ -746,6 +746,8 @@ static void r8a7740_i2c_workaround(struct platform_device *pdev)
 void __init r8a7740_add_standard_devices(void)
 {
 	static struct pm_domain_device domain_devices[] __initdata = {
+		{ "A4R",  &tmu0_device },
+		{ "A4R",  &i2c0_device },
 		{ "A4S",  &irqpin0_device },
 		{ "A4S",  &irqpin1_device },
 		{ "A4S",  &irqpin2_device },
Signature · 1 line
1.9.1
author maintainer
#19 lore raw

PATCH v3 10/11 ARM: shmobile: r8a7740: Add A4SU pm domain support

In reply to Geert Uytterhoeven

Add support for the A4SU power domain.
This domain contains the USBPHY hardware block, which is currently not used by any driver.

---
v3:
- No changes,
v2:
- Drop FIXME about hooking up USB platform devices, as the Armadillo platform code doesn't register a USB host device anyway?

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-shmobile/pm-r8a7740.c +3 -0
index 74e6a67a28d3c336..27117a8a49ad8556 100644
@@ -75,6 +75,9 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 	}, {
 		.genpd.name	= "A3SG",
 		.bit_shift	= 13,
+	}, {
+		.genpd.name	= "A4SU",
+		.bit_shift	= 20,
 	},
 };
 
Signature · 1 line
1.9.1
author maintainer
#20 lore raw

PATCH v3 11/11 ARM: shmobile: r8a7740: Add A3SM pm domain support

In reply to Geert Uytterhoeven

Add support for the A3SM power domain, and hook it up as a subdomain of A4S.

This domain contains the System CPU (Cortex-A9) hardware block. Hence move the special CPU handling from A4S to A3SM.

---
v3:
- No changes,
v2:
- Move special CPU domain handling from A4S to A3SM,
- Drop FIXME about not powering down A4S, as this is expected behavior.

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
arch/arm/mach-shmobile/pm-r8a7740.c +8 -4
index 27117a8a49ad8556..ac2eecd6f5ea5d9f 100644
@@ -14,10 +14,10 @@
 #include "pm-rmobile.h"
 
 #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
-static int r8a7740_pd_a4s_suspend(void)
+static int r8a7740_pd_a3sm_suspend(void)
 {
 	/*
-	 * The A4S domain contains the CPU core and therefore it should
+	 * The A3SM domain contains the CPU core and therefore it should
 	 * only be turned off if the CPU is not in use.
 	 */
 	return -EBUSY;
@@ -63,9 +63,7 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 	}, {
 		.genpd.name	= "A4S",
 		.bit_shift	= 10,
-		.gov		= &pm_domain_always_on_gov,
 		.no_debug	= true,
-		.suspend	= r8a7740_pd_a4s_suspend,
 	}, {
 		.genpd.name	= "A3SP",
 		.bit_shift	= 11,
@@ -73,6 +71,11 @@ static struct rmobile_pm_domain r8a7740_pm_domains[] = {
 		.no_debug	= true,
 		.suspend	= r8a7740_pd_a3sp_suspend,
 	}, {
+		.genpd.name	= "A3SM",
+		.bit_shift	= 12,
+		.gov		= &pm_domain_always_on_gov,
+		.suspend	= r8a7740_pd_a3sm_suspend,
+	}, {
 		.genpd.name	= "A3SG",
 		.bit_shift	= 13,
 	}, {
@@ -86,6 +89,7 @@ void __init r8a7740_init_pm_domains(void)
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4R", "A3RV");
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
+	pm_genpd_add_subdomain_names("A4S", "A3SM");
 	pm_genpd_add_subdomain_names("A4S", "A3SG");
 }
 #endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
Signature · 1 line
1.9.1