Skip to contentSkip to conversation

ARM: OMAP2+: reset controller support

PATCH New Tero Kristo 3 participants 22 messages Sep 24, 2015 – Nov 30, 2015

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover ARM: OMAP2+: reset controller support

Hi,

This series adds reset controller support on top of the existing PRM/PRCM code. All the currently defined reset sources in hwmod databases are moved over to DT, and all except OMAP3 hwmod resets are also removed. OMAP3 hwmod reset data can be removed once OMAP3 is DT only.

Reboot support is also converted to use the new reset controller nodes, and a new DT node is introduced for this purpose; system_reset.

I guess the main question regarding this series is whether the DT changes are okay, I was forced to create a few top level ocp nodes for IVA/DSP etc. which were missing, and a couple of peripheral nodes for AMx3xx to host the reset data. DSP/IVA nodes should be created for OMAP5+ also to support the resets for these, but currently these are completely missing so I did not bother adding them.

One motivation for this series is to get rid of the hwmod database reset info, which eventually allows getting rid of the hwmod data completely (read: moved over to DT.)

Boot tested on omap3-beagle, omap4-panda-es, omap5-uevm, dra7-evm, beagle-x15, sdp2430, sdp3430, beaglebone-white, beaglebone-black, am43xx-gp-evm.

Reboot tested on omap3-beagle, omap4-panda-es, omap5-uevm, beagle-x15. Reboot on amx3xx does not seem functional in base 4.3-rc2 so wasn't able to test this.

Testing branch pushed at:
tree: https://github.com/t-kristo/linux-pm.git
branch: 4.3-rc2-prcm-reset-fwk

Tero Kristo (17):
ARM: OMAP2+: PRM: add support for reset controller
ARM: OMAP2+: hwmod: parse also soc hierarchy for hwmod compatible
nodes
ARM: dts: omap3: add reset data
ARM: dts: omap4: add reset data
ARM: dts: omap5: add reset data
ARM: dts: dra7: add reset data
ARM: dts: am4372: add reset data
ARM: dts: am33xx: add reset data
ARM: dts: OMAP24xx: add reset data
ARM: OMAP2+: hwmod: parse reset information from DT
ARM: OMAP2+: use system reset info from device tree data
ARM: OMAP4: hwmod_data: remove reset data
ARM: OMAP5: hwmod_data: remove reset data
ARM: OMAP2: hwmod: AMx3xx: remove redundant reset info
ARM: OMAP24xx: hwmod: remove reset data from hwmod database
ARM: OMAP2+: hwmod: remove obsolete support for some hardreset logic
ARM: OMAP2+: PRM: remove redundant system reset code

 arch/arm/boot/dts/am33xx.dtsi                      |   24 +++
 arch/arm/boot/dts/am4372.dtsi                      |   24 +++
 arch/arm/boot/dts/dra7.dtsi                        |    7 +
 arch/arm/boot/dts/omap2420.dtsi                    |   24 +++
 arch/arm/boot/dts/omap2430.dtsi                    |   17 ++
 arch/arm/boot/dts/omap3.dtsi                       |   21 ++
 arch/arm/boot/dts/omap4.dtsi                       |   27 +++
 arch/arm/boot/dts/omap5.dtsi                       |   11 ++
 arch/arm/mach-omap2/Kconfig                        |    1 +
 arch/arm/mach-omap2/Makefile                       |    6 -
 arch/arm/mach-omap2/am33xx-restart.c               |   27 ---
 arch/arm/mach-omap2/board-generic.c                |   16 +-
 arch/arm/mach-omap2/common.c                       |   29 +++
 arch/arm/mach-omap2/common.h                       |    2 +
 arch/arm/mach-omap2/omap2-restart.c                |    2 +-
 arch/arm/mach-omap2/omap3-restart.c                |    2 +-
 arch/arm/mach-omap2/omap4-restart.c                |   27 ---
 arch/arm/mach-omap2/omap_hwmod.c                   |  203 ++++++++++----------
 arch/arm/mach-omap2/omap_hwmod.h                   |   12 +-
 arch/arm/mach-omap2/omap_hwmod_2420_data.c         |   13 --
 arch/arm/mach-omap2/omap_hwmod_2430_data.c         |    7 -
 .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |   30 ---
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c         |    8 -
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c         |    8 -
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c         |   48 +----
 arch/arm/mach-omap2/omap_hwmod_54xx_data.c         |   14 --
 arch/arm/mach-omap2/prm2xxx.c                      |   15 --
 arch/arm/mach-omap2/prm33xx.c                      |   18 --
 arch/arm/mach-omap2/prm44xx.c                      |    1 -
 arch/arm/mach-omap2/prm_common.c                   |  167 ++++++++++++++++
 arch/arm/mach-omap2/prminst44xx.c                  |   20 --
 arch/arm/mach-omap2/ti81xx-restart.c               |   34 ----
 32 files changed, 476 insertions(+), 389 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/am33xx-restart.c
 delete mode 100644 arch/arm/mach-omap2/omap4-restart.c
 delete mode 100644 arch/arm/mach-omap2/ti81xx-restart.c

bloat-o-meter:
add/remove: 13/24 grow/shrink: 20/579 up/down: 1732/-3020 (-1288)
function old new delta

ti_reset_xlate                                 -     456    +456
_init                                       1012    1380    +368
_dt_assert_hardreset                           -     128    +128
omap2_prm_reset_controller_register            -     108    +108
__omap_init_restart                            -     100    +100
__func__                                   23717   23805     +88
_dt_is_hardreset_asserted                      -      64     +64
_dt_deassert_hardreset                         -      64     +64
ti_reset_deassert                              -      60     +60
omap_restart                                   -      32     +32
ti_reset_status                                -      28     +28
ti_reset_assert                                -      28     +28
omap4_prminst_rmw_inst_reg_bits               76     100     +24
omap_prcm_init                               120     140     +20
_lookup_hardreset                            124     144     +20
ti_reset_ops                                   -      16     +16
omap2xxx_restart                              40      56     +16
vermagic                                      49      64     +15
omap3xxx_restart                              28      40     +12
omap3xxx_iva_resets                           24      36     +12
_setup                                      1016    1028     +12
omap3xxx_sad2d_resets                         16      24      +8
_shutdown                                    548     556      +8
_omap4_disable_module                        252     260      +8
_are_all_hardreset_lines_asserted.part        88      96      +8
prm_was_any_context_lost_old                 108     112      +4
omap_reset_control                             -       4      +4
omap_prm_vp_clear_txdone                     100     104      +4
omap_hwmod_disable_wakeup                    248     252      +4
omap3xxx_mmu_iva_resets                        8      12      +4
_set_master_standbymode                      144     148      +4
__initcall___omap_init_restart7                -       4      +4
__warned                                    2006    2007      +1
omap_prm_deassert_hardreset                  136     132      -4
omap54xx_wd_timer2_hwmod                     168     164      -4
omap54xx_usb_tll_hs_hwmod                    168     164      -4
omap54xx_usb_otg_ss_hwmod                    168     164      -4
omap54xx_usb_host_hs_hwmod                   168     164      -4
omap54xx_uart6_hwmod                         168     164      -4
...<snip>...
am33xx_aes0_hwmod                            168     164      -4
am33xx_adc_tsc_hwmod                         168     164      -4
_write_sysconfig                             164     160      -4
_enable_wakeup                               256     252      -4
_enable_sysc                                 576     572      -4
_clear_softreset                             128     124      -4
omap54xx_mmu_ipu_resets                        8       -      -8
omap54xx_mmu_dsp_resets                        8       -      -8
omap44xx_mmu_ipu_resets                        8       -      -8
omap44xx_mmu_dsp_resets                        8       -      -8
omap44xx_dsp_resets                            8       -      -8
omap2420_iva_resets                            8       -      -8
am33xx_pruss_resets                            8       -      -8
am33xx_gfx_resets                              8       -      -8
omap44xx_prm_resets                           16       -     -16
omap44xx_ipu_resets                           16       -     -16
omap2430_iva_resets                           16       -     -16
omap2420_dsp_resets                           16       -     -16
am33xx_wkup_m3_resets                         16       -     -16
omap_hwmod_init                              492     468     -24
omap_hwmod_am33xx_reg                        664     640     -24
omap44xx_iva_resets                           24       -     -24
ti81xx_restart                                28       -     -28
omap2xxx_prm_dpll_reset                       32       -     -32
am33xx_prm_global_warm_sw_reset               32       -     -32
omap_hwmod_am43xx_reg                        680     644     -36
_omap4_is_hardreset_asserted                  48       -     -48
_omap4_assert_hardreset                       48       -     -48
_am33xx_deassert_hardreset                    64       -     -64
omap4_prminst_global_warm_sw_reset            84       -     -84

_omap4_deassert_hardreset 120 - -120

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/17 ARM: OMAP2+: PRM: add support for reset controller

PRM driver now supports reset controller for the defined reset lines. Reset configurations are provided through device tree. Later, functionality like hwmod and system reboot will be changed to use the generic framework.

---
 arch/arm/mach-omap2/Kconfig      |    1 +
 arch/arm/mach-omap2/prm_common.c |  167 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 168 insertions(+)
arch/arm/mach-omap2/Kconfig +1 -0
index 07d2e10..ac3ef43 100644
@@ -92,6 +92,7 @@ config ARCH_OMAP2PLUS
 	select SOC_BUS
 	select TI_PRIV_EDMA
 	select OMAP_IRQCHIP
+	select RESET_CONTROLLER
 	help
 	  Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
 
arch/arm/mach-omap2/prm_common.c +167 -0

191 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#2 lore raw

PATCH 1/17 ARM: OMAP2+: PRM: add support for reset controller

Quoted 3 lines · Tero Kristo

PRM driver now supports reset controller for the defined reset lines. Reset configurations are provided through device tree. Later, functionality like hwmod and system reboot will be changed to use the generic framework.

This approach seems good to me in general. This should have the related reset driver documentation too for the binding though.

Regards,

Tony

maintainer
#3 lore raw

PATCH 1/17 ARM: OMAP2+: PRM: add support for reset controller

Quoted 7 lines · Tony Lindgren
Quoted 3 lines · Tero Kristo

PRM driver now supports reset controller for the defined reset lines. Reset configurations are provided through device tree. Later, functionality like hwmod and system reboot will be changed to use the generic framework.

This approach seems good to me in general. This should have the related reset driver documentation too for the binding though.

Also, with the initcall changes I just posted, it seems this can become just a regular device driver that gets initialized at core_initcall level.

Regards,

Tony

#4 lore raw

PATCH 2/17 ARM: OMAP2+: hwmod: parse also soc hierarchy for hwmod compatible nodes

In reply to Tero Kristo

Previously the code was only parsing ocp hierarchy, which misses mpu and iva/dsp nodes at least, which still contain hwmod support. Parse also the soc hierarchy to include these.

---
 arch/arm/mach-omap2/omap_hwmod.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +12 -3
index cc8a987..f53ebc6 100644
@@ -2467,15 +2467,24 @@ static int __init _init(struct omap_hwmod *oh, void *data)
 
 	if (of_have_populated_dt()) {
 		struct device_node *bus;
+		struct device_node *soc;
 
 		bus = of_find_node_by_name(NULL, "ocp");
 		if (!bus)
 			return -ENODEV;
 
 		r = of_dev_hwmod_lookup(bus, oh, &index, &np);
-		if (r)
-			pr_debug("omap_hwmod: %s missing dt data\n", oh->name);
-		else if (np && index)
+		if (r) {
+			soc = of_find_node_by_name(NULL, "soc");
+			if (soc)
+				r = of_dev_hwmod_lookup(soc, oh, &index, &np);
+
+			if (r)
+				pr_debug("omap_hwmod: %s missing dt data\n",
+					 oh->name);
+		}
+
+		if (np && index)
 			pr_warn("omap_hwmod: %s using broken dt data from %s\n",
 				oh->name, np->name);
 	}
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 3/17 ARM: dts: omap3: add reset data

In reply to Tero Kristo

Copy over the reset data from hwmod database to DT. After this is taken into use, the data in hwmod database can be removed.

A new node has been also added for sad2d to support sad2d resets.

---
 arch/arm/boot/dts/omap3.dtsi |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/omap3.dtsi +21 -0
index 69a40cf..5be9aaa 100644
@@ -64,11 +64,23 @@
 		iva: iva {
 			compatible = "ti,iva2.2";
 			ti,hwmods = "iva";
+			reset-names = "logic", "seq0", "seq1";
+			resets = <&prm 0x0000 0 0 0 8>,
+				 <&prm 0x0000 0 1 0 9>,
+				 <&prm 0x0000 0 2 0 10>;
 
 			dsp {
 				compatible = "ti,omap3-c64";
 			};
 		};
+
+		sad2d: sad2d {
+			compatible = "ti,sad2d";
+			ti,hwmods = "sad2d";
+			reset-names = "rst_modem_sw", "rst_modem_pwron_sw";
+			resets = <&prm 0x0a00 0 0 0 8>,
+				 <&prm 0x0a00 0 1 0 9>;
+		};
 	};
 
 	/*
@@ -154,6 +166,7 @@
 			compatible = "ti,omap3-prm";
 			reg = <0x48306000 0x4000>;
 			interrupts = <11>;
+			#reset-cells = <5>;
 
 			prm_clocks: clocks {
 				#address-cells = <1>;
@@ -162,6 +175,12 @@
 
 			prm_clockdomains: clockdomains {
 			};
+
+			system_reset: system_reset {
+				compatible = "ti,system-reset";
+				reset-names = "system";
+				resets = <&prm 0x1200 0 2 0 0>;
+			};
 		};
 
 		cm: cm at 48004000 {
@@ -471,6 +490,8 @@
 			interrupts = <28>;
 			ti,hwmods = "mmu_iva";
 			status = "disabled";
+			reset-names = "mmu";
+			resets = <&prm 0x0000 0 1 0 9>;
 		};
 
 		wdt2: wdt at 48314000 {
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 4/17 ARM: dts: omap4: add reset data

In reply to Tero Kristo

Copy over the reset data from hwmod database to DT. After this is taken into use, the data in hwmod database can be removed.

A new node has been also added for ipu to support ipu resets.

---
 arch/arm/boot/dts/omap4.dtsi |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm/boot/dts/omap4.dtsi +27 -0
index abc4473..d14c485 100644
@@ -97,11 +97,25 @@
 		dsp {
 			compatible = "ti,omap3-c64";
 			ti,hwmods = "dsp";
+			reset-names = "dsp";
+			resets = <&prm 0x0400 0x10 0 0x14 0>;
 		};
 
 		iva {
 			compatible = "ti,ivahd";
 			ti,hwmods = "iva";
+			reset-names = "seq0", "seq1", "logic";
+			resets = <&prm 0x0f00 0x10 0 0x14 0>,
+				 <&prm 0x0f00 0x10 1 0x14 1>,
+				 <&prm 0x0f00 0x10 2 0x14 2>;
+		};
+
+		ipu {
+			compatible = "ti,omap4-ipu";
+			ti,hwmods = "ipu";
+			reset-names = "cpu0", "cpu1";
+			resets = <&prm 0x0700 0x210 0 0x214 0>,
+				 <&prm 0x0700 0x210 1 0x214 1>;
 		};
 	};
 
@@ -226,6 +240,7 @@
 					compatible = "ti,omap4-prm";
 					reg = <0x6000 0x3000>;
 					interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+					#reset-cells = <5>;
 
 					prm_clocks: clocks {
 						#address-cells = <1>;
@@ -234,6 +249,14 @@
 
 					prm_clockdomains: clockdomains {
 					};
+
+					system_reset: system_reset {
+						compatible = "ti,system-reset";
+						reset-names = "system",
+							      "cold_sw";
+						resets = <&prm 0x1b00 0 0 4 0>,
+							 <&prm 0x1b00 0 1 4 1>;
+					};
 				};
 
 				scrm: scrm at a000 {
@@ -553,6 +576,8 @@
 			interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
 			ti,hwmods = "mmu_dsp";
 			#iommu-cells = <0>;
+			reset-names = "mmu_cache";
+			resets = <&prm 0x400 0x10 1 0x14 1>;
 		};
 
 		mmu_ipu: mmu at 55082000 {
@@ -562,6 +587,8 @@
 			ti,hwmods = "mmu_ipu";
 			#iommu-cells = <0>;
 			ti,iommu-bus-err-back;
+			reset-names = "mmu_cache";
+			resets = <&prm 0x700 0x210 2 0x214 2>;
 		};
 
 		wdt2: wdt at 4a314000 {
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 5/17 ARM: dts: omap5: add reset data

In reply to Tero Kristo

Copy over the reset data from hwmod database to DT. After this is taken into use, the data in hwmod database can be removed.

---
 arch/arm/boot/dts/omap5.dtsi |   11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/boot/dts/omap5.dtsi +11 -0
index 4205a8a..631a8ae 100644
@@ -242,6 +242,7 @@
 				compatible = "ti,omap5-prm";
 				reg = <0x6000 0x3000>;
 				interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+				#reset-cells = <5>;
 
 				prm_clocks: clocks {
 					#address-cells = <1>;
@@ -250,6 +251,12 @@
 
 				prm_clockdomains: clockdomains {
 				};
+
+				system_reset: system_reset {
+					compatible = "ti,system-reset";
+					reset-names = "system";
+					resets = <&prm 0x1c00 0 0 4 0>;
+				};
 			};
 
 			scrm: scrm at a000 {
@@ -614,6 +621,8 @@
 			interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
 			ti,hwmods = "mmu_dsp";
 			#iommu-cells = <0>;
+			reset-names = "mmu_cache";
+			resets = <&prm 0x400 0x10 1 0x14 1>;
 		};
 
 		mmu_ipu: mmu at 55082000 {
@@ -623,6 +632,8 @@
 			ti,hwmods = "mmu_ipu";
 			#iommu-cells = <0>;
 			ti,iommu-bus-err-back;
+			reset-names = "mmu_cache";
+			resets = <&prm 0x700 0x210 2 0x214 2>;
 		};
 
 		keypad: keypad at 4ae1c000 {
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 6/17 ARM: dts: dra7: add reset data

In reply to Tero Kristo

Copy over the reset data from kernel to DT. Currently, only system reset has been defined, but rest can be added later once needed.

---
 arch/arm/boot/dts/dra7.dtsi |    7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/dra7.dtsi +7 -0
index 5d65db9..e299b07 100644
@@ -199,6 +199,7 @@
 				compatible = "ti,dra7-prm";
 				reg = <0x6000 0x3000>;
 				interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+				#reset-cells = <5>;
 
 				prm_clocks: clocks {
 					#address-cells = <1>;
@@ -207,6 +208,12 @@
 
 				prm_clockdomains: clockdomains {
 				};
+
+				system_reset: system_reset {
+					compatible = "ti,system-reset";
+					reset-names = "system";
+					resets = <&prm 0x1d00 0 0 4 0>;
+				};
 			};
 		};
 
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH 7/17 ARM: dts: am4372: add reset data

In reply to Tero Kristo

Add reset data for pruss, gfx, wkup-m3 and system reset.

---
 arch/arm/boot/dts/am4372.dtsi |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/boot/dts/am4372.dtsi +24 -0
index 0447c04a..fcc8d31 100644
@@ -116,12 +116,15 @@
 				reg-names = "umem", "dmem";
 				ti,hwmods = "wkup_m3";
 				ti,pm-firmware = "am335x-pm-firmware.elf";
+				reset-names = "wkup_m3";
+				resets = <&prcm 0x2000 0x10 3 0x14 5>;
 			};
 
 			prcm: prcm at 1f0000 {
 				compatible = "ti,am4-prcm";
 				reg = <0x1f0000 0x11000>;
 				interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+				#reset-cells = <5>;
 
 				prcm_clocks: clocks {
 					#address-cells = <1>;
@@ -130,6 +133,12 @@
 
 				prcm_clockdomains: clockdomains {
 				};
+
+				system_reset: system_reset {
+					compatible = "ti,system-reset";
+					reset-names = "system";
+					reset-cells = <&prcm 0x4000 0 0 4 0>;
+				};
 			};
 
 			scm: scm at 210000 {
@@ -1053,6 +1062,21 @@
 			ti,hwmods = "vpfe1";
 			status = "disabled";
 		};
+
+		gfx: gfx at 56000000 {
+			compatible = "ti,am4376-sgx530", "img,sgx530";
+			ti,hwmods = "gfx";
+			status = "disabled";
+			reset-names = "gfx";
+			resets = <&prcm 0x400 0x10 0 0x14 0>;
+		};
+
+		pruss: pruss at 54400000 {
+			compatible = "ti,am4372-pruss";
+			ti,hwmods = "pruss";
+			reset-names = "pruss";
+			resets = <&prcm 0x800 0x10 1 0x14 0>;
+		};
 	};
 };
 
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 7/17 ARM: dts: am4372: add reset data

Hi Tero,

Quoted 28 lines · Tero Kristo

Add reset data for pruss, gfx, wkup-m3 and system reset.

---
 arch/arm/boot/dts/am4372.dtsi |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/boot/dts/am4372.dtsi +3 -0
index 0447c04a..fcc8d31 100644
@@ -116,12 +116,15 @@
 				reg-names = "umem", "dmem";
 				ti,hwmods = "wkup_m3";
 				ti,pm-firmware = "am335x-pm-firmware.elf";
+				reset-names = "wkup_m3";
+				resets = <&prcm 0x2000 0x10 3 0x14 5>;
 			};
 
 			prcm: prcm at 1f0000 {
 				compatible = "ti,am4-prcm";
 				reg = <0x1f0000 0x11000>;
 				interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+				#reset-cells = <5>;
 
 				prcm_clocks: clocks {
 					#address-cells = <1>;

arch/arm/boot/dts/am4372.dtsi line 140

Quoted 8 lines
arch/arm/boot/dts/am4372.dtsi +5 -0
@@ -130,6 +133,12 @@
 
 				prcm_clockdomains: clockdomains {
 				};
+
+				system_reset: system_reset {
+					compatible = "ti,system-reset";
+					reset-names = "system";
+					reset-cells = <&prcm 0x4000 0 0 4 0>;

This should be resets instead of reset-cells. With this change, reboot is functional on AM437x GP evm.

Thanks and regards,
Lokesh

#11 lore raw

PATCH 7/17 ARM: dts: am4372: add reset data

Quoted 32 lines · Lokesh Vutla

Hi Tero,

Quoted 29 lines · Tero Kristo

Add reset data for pruss, gfx, wkup-m3 and system reset.

---
  arch/arm/boot/dts/am4372.dtsi |   24 ++++++++++++++++++++++++
  1 file changed, 24 insertions(+)
arch/arm/boot/dts/am4372.dtsi +3 -0
index 0447c04a..fcc8d31 100644
@@ -116,12 +116,15 @@
  				reg-names = "umem", "dmem";
  				ti,hwmods = "wkup_m3";
  				ti,pm-firmware = "am335x-pm-firmware.elf";
+				reset-names = "wkup_m3";
+				resets = <&prcm 0x2000 0x10 3 0x14 5>;
  			};
 
  			prcm: prcm at 1f0000 {
  				compatible = "ti,am4-prcm";
  				reg = <0x1f0000 0x11000>;
  				interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+				#reset-cells = <5>;
 
  				prcm_clocks: clocks {
  					#address-cells = <1>;
@@ -130,6 +133,12 @@
 
Quoted 9 lines

arch/arm/boot/dts/am4372.dtsi line 140

Quoted 7 lines
arch/arm/boot/dts/am4372.dtsi +5 -0
  				prcm_clockdomains: clockdomains {
  				};
+
+				system_reset: system_reset {
+					compatible = "ti,system-reset";
+					reset-names = "system";
+					reset-cells = <&prcm 0x4000 0 0 4 0>;

This should be resets instead of reset-cells. With this change, reboot is functional on AM437x GP evm.

Oops, nasty typo there. Thanks for catching.

-Tero

Quoted 4 lines

Thanks and regards,
Lokesh

#12 lore raw

PATCH 8/17 ARM: dts: am33xx: add reset data

In reply to Tero Kristo

Add reset data for pruss, gfx, wkup-m3, and system reset.

---
 arch/arm/boot/dts/am33xx.dtsi |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/boot/dts/am33xx.dtsi +24 -0
index d23e252..3974c3b 100644
@@ -110,11 +110,14 @@
 				reg-names = "umem", "dmem";
 				ti,hwmods = "wkup_m3";
 				ti,pm-firmware = "am335x-pm-firmware.elf";
+				reset-names = "wkup_m3";
+				resets = <&prcm 0xd00 0 3 0xc 5>;
 			};
 
 			prcm: prcm at 200000 {
 				compatible = "ti,am3-prcm";
 				reg = <0x200000 0x4000>;
+				#reset-cells = <5>;
 
 				prcm_clocks: clocks {
 					#address-cells = <1>;
@@ -123,6 +126,12 @@
 
 				prcm_clockdomains: clockdomains {
 				};
+
+				system_reset: system_reset {
+					compatible = "ti,system-reset";
+					reset-names = "system";
+					resets = <&prcm 0xf00 0 0 8 1>;
+				};
 			};
 
 			scm: scm at 210000 {
@@ -879,6 +888,21 @@
 			reg = <0x48310000 0x2000>;
 			interrupts = <111>;
 		};
+
+		pruss: pruss at 4a300000 {
+			compatible = "ti,am3352-pruss";
+			ti,hwmods = "pruss";
+			reset-names = "pruss";
+			resets = <&prcm 0xc00 0 1 0 1>;
+		};
+
+		gfx: gfx at 56000000 {
+			compatible = "ti,am3352-sgx530", "img,sgx530";
+			ti,hwmods = "gfx";
+			status = "disabled";
+			reset-names = "gfx";
+			resets = <&prcm 0x1100 0x4 0 0x14 0>;
+		};
 	};
 };
 
Signature · 1 line
1.7.9.5
#13 lore raw

PATCH 9/17 ARM: dts: OMAP24xx: add reset data

In reply to Tero Kristo

Add iva, dsp and system reset control as DT data..

---
 arch/arm/boot/dts/omap2420.dtsi |   24 ++++++++++++++++++++++++
 arch/arm/boot/dts/omap2430.dtsi |   17 +++++++++++++++++
 2 files changed, 41 insertions(+)
arch/arm/boot/dts/omap2420.dtsi +24 -0
index 5b9a376..cfb802d 100644
@@ -13,6 +13,23 @@
 / {
 	compatible = "ti,omap2420", "ti,omap2";
 
+	soc {
+		iva {
+			compatible = "ti,omap2420-iva";
+			ti,hwmods = "iva";
+			reset-names = "iva";
+			resets = <&prcm 0x800 0 8 0 8>;
+		};
+
+		dsp {
+			ti,hwmods = "dsp";
+			compatible = "ti,omap2420-dsp";
+			reset-names = "logic", "mmu";
+			resets = <&prcm 0x800 0 0 0 4>,
+				 <&prcm 0x800 0 1 0 5>;
+		};
+	};
+
 	ocp {
 		l4: l4 at 48000000 {
 			compatible = "ti,omap2-l4", "simple-bus";
@@ -23,6 +40,7 @@
 			prcm: prcm at 8000 {
 				compatible = "ti,omap2-prcm";
 				reg = <0x8000 0x1000>;
+				#reset-cells = <5>;
 
 				prcm_clocks: clocks {
 					#address-cells = <1>;
@@ -31,6 +49,12 @@
 
 				prcm_clockdomains: clockdomains {
 				};
+
+				system_reset: system_reset {
+					compatible = "ti,system-reset";
+					reset-names = "system";
+					resets = <&prcm 0x400 0 2 0 0>;
+				};
 			};
 
 			scm: scm at 0 {
arch/arm/boot/dts/omap2430.dtsi +17 -0
index 2390f38..0d5f0d6 100644
@@ -13,6 +13,16 @@
 / {
 	compatible = "ti,omap2430", "ti,omap2";
 
+	soc {
+		iva {
+			compatible = "ti,iva2.1";
+			ti,hwmods = "iva";
+			reset-names = "logic", "mmu";
+			resets = <&prcm 0x800 0 0 0 4>,
+				 <&prcm 0x800 0 1 0 5>;
+		};
+	};
+
 	ocp {
 		l4_wkup: l4_wkup at 49000000 {
 			compatible = "ti,omap2-l4-wkup", "simple-bus";
@@ -23,6 +33,7 @@
 			prcm: prcm at 6000 {
 				compatible = "ti,omap2-prcm";
 				reg = <0x6000 0x1000>;
+				#reset-cells = <5>;
 
 				prcm_clocks: clocks {
 					#address-cells = <1>;
@@ -31,6 +42,12 @@
 
 				prcm_clockdomains: clockdomains {
 				};
+
+				system_reset: system_reset {
+					compatible = "ti,system-reset";
+					reset-names = "system";
+					resets = <&prcm 0x400 0 2 0 0>;
+				};
 			};
 
 			scm: scm at 2000 {
Signature · 1 line
1.7.9.5
#14 lore raw

PATCH 10/17 ARM: OMAP2+: hwmod: parse reset information from DT

In reply to Tero Kristo

DT can now be used to provide reset information, so parse this to avoid the need to have reset info under hwmod data. This patch disables the support for existing reset data under hwmod data, so shall be applied only after the DT reset conversion.

---
 arch/arm/mach-omap2/omap_hwmod.c |  104 +++++++++++++++++++++++++++++++++++++-
 arch/arm/mach-omap2/omap_hwmod.h |    8 +--
 2 files changed, 107 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +102 -2
index f53ebc6..974260a 100644
@@ -142,6 +142,7 @@
 #include <linux/cpu.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/reset.h>
 
 #include <asm/system_misc.h>
 
@@ -1611,9 +1612,10 @@ static int _lookup_hardreset(struct omap_hwmod *oh, const char *name,
 		if (!strcmp(rst_line, name)) {
 			ohri->rst_shift = oh->rst_lines[i].rst_shift;
 			ohri->st_shift = oh->rst_lines[i].st_shift;
-			pr_debug("omap_hwmod: %s: %s: %s: rst %d st %d\n",
+			ohri->rc = oh->rst_lines[i].rc;
+			pr_debug("omap_hwmod: %s: %s: %s: rst %d st %d rc %x\n",
 				 oh->name, __func__, rst_line, ohri->rst_shift,
-				 ohri->st_shift);
+				 ohri->st_shift, (u32)ohri->rc);
 
 			return 0;
 		}
@@ -2445,6 +2447,58 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
 }
 
 /**
+ * _init_resets - initialize internal reset data for hwmod @oh
+ * @oh: struct omap_hwmod *
+ * @np: device node pointer for this hwmod
+ *
+ * Look up the reset info for this hwmod from device tree.
+ */
+static int __init _init_resets(struct omap_hwmod *oh, struct device_node *np)
+{
+	int num;
+	int i;
+	int ret;
+	const char *reset_name;
+	struct reset_control *rc;
+
+	num = of_property_count_strings(np, "reset-names");
+	if (num < 1)
+		return 0;
+
+	oh->rst_lines = kcalloc(num, sizeof(struct omap_hwmod_rst_info),
+				GFP_KERNEL);
+
+	for (i = 0; i < num; i++) {
+		ret = of_property_read_string_index(np, "reset-names", i,
+						    &reset_name);
+		if (ret)
+			goto cleanup;
+
+		rc = of_reset_control_get(np, reset_name);
+		if (IS_ERR(rc)) {
+			ret = PTR_ERR(rc);
+			goto cleanup;
+		}
+
+		oh->rst_lines[i].name = kstrdup(reset_name, GFP_KERNEL);
+		oh->rst_lines[i].rc = rc;
+	}
+
+	oh->rst_lines_cnt = num;
+
+	return ret;
+
+cleanup:
+	for (i = 0; i < num; i++) {
+		if (oh->rst_lines[i].rc)
+			reset_control_put(oh->rst_lines[i].rc);
+	}
+	kfree(oh->rst_lines);
+	oh->rst_lines = NULL;
+	return ret;
+}
+
+/**
  * _init - initialize internal data for the hwmod @oh
  * @oh: struct omap_hwmod *
  * @n: (unused)
@@ -2507,6 +2561,13 @@ static int __init _init(struct omap_hwmod *oh, void *data)
 			oh->flags |= HWMOD_INIT_NO_RESET;
 		if (of_find_property(np, "ti,no-idle-on-init", NULL))
 			oh->flags |= HWMOD_INIT_NO_IDLE;
+
+		r = _init_resets(oh, np);
+		if (r < 0) {
+			WARN(1, "omap_hwmod: %s: couldn't init reset\n",
+			     oh->name);
+			return -EINVAL;
+		}
 	}
 
 	oh->_state = _HWMOD_STATE_INITIALIZED;
@@ -3108,6 +3169,39 @@ static int _am33xx_deassert_hardreset(struct omap_hwmod *oh,
 					   oh->prcm.omap4.rstst_offs);
 }
 
+static int _dt_assert_hardreset(struct omap_hwmod *oh,
+				struct omap_hwmod_rst_info *ohri)
+{
+	if (!ohri->rc) {
+		pr_err("%s: %s: missing rc\n", __func__, oh->name);
+		WARN_ONCE(1, "missing rc\n");
+		return 0;
+	}
+
+	return reset_control_assert(ohri->rc);
+}
+
+static int _dt_deassert_hardreset(struct omap_hwmod *oh,
+				  struct omap_hwmod_rst_info *ohri)
+{
+	if (!ohri->rc) {
+		pr_err("%s: %s: missing rc\n", __func__, oh->name);
+		return 0;
+	}
+
+	return reset_control_deassert(ohri->rc);
+}
+
+static int _dt_is_hardreset_asserted(struct omap_hwmod *oh,
+				     struct omap_hwmod_rst_info *ohri)
+{
+	if (!ohri->rc) {
+		pr_err("%s: %s: missing rc\n", __func__, oh->name);
+		return 0;
+	}
+	return reset_control_status(ohri->rc);
+}
+
 /* Public functions */
 
 u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs)
@@ -3922,6 +4016,12 @@ void __init omap_hwmod_init(void)
 		WARN(1, "omap_hwmod: unknown SoC type\n");
 	}
 
+	if (of_have_populated_dt()) {
+		soc_ops.assert_hardreset = _dt_assert_hardreset;
+		soc_ops.deassert_hardreset = _dt_deassert_hardreset;
+		soc_ops.is_hardreset_asserted = _dt_is_hardreset_asserted;
+	}
+
 	inited = true;
 }
 
arch/arm/mach-omap2/omap_hwmod.h +5 -3
index ca6df1a..a6f3ac2 100644
@@ -199,14 +199,16 @@ struct omap_hwmod_dma_info {
  * @name: name of the reset line (module local name)
  * @rst_shift: Offset of the reset bit
  * @st_shift: Offset of the reset status bit (OMAP2/3 only)
+ * @rc: reset control handle for the reset
  *
  * @name should be something short, e.g., "cpu0" or "rst". It is defined
  * locally to the hwmod.
  */
 struct omap_hwmod_rst_info {
-	const char	*name;
-	u8		rst_shift;
-	u8		st_shift;
+	const char		*name;
+	u8			rst_shift;
+	u8			st_shift;
+	struct reset_control	*rc;
 };
 
 /**
Signature · 1 line
1.7.9.5
#15 lore raw

PATCH 11/17 ARM: OMAP2+: use system reset info from device tree data

In reply to Tero Kristo

System reset mapping used by reboot is now provided through DT data and a reset controller. Use this instead of the hardcoded PRM API.

---
 arch/arm/mach-omap2/Makefile         |    6 ------
 arch/arm/mach-omap2/am33xx-restart.c |   27 ---------------------------
 arch/arm/mach-omap2/board-generic.c  |   16 ++++++++--------
 arch/arm/mach-omap2/common.c         |   29 +++++++++++++++++++++++++++++
 arch/arm/mach-omap2/common.h         |    2 ++
 arch/arm/mach-omap2/omap2-restart.c  |    2 +-
 arch/arm/mach-omap2/omap3-restart.c  |    2 +-
 arch/arm/mach-omap2/omap4-restart.c  |   27 ---------------------------
 arch/arm/mach-omap2/ti81xx-restart.c |   34 ----------------------------------
 9 files changed, 41 insertions(+), 104 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/am33xx-restart.c
 delete mode 100644 arch/arm/mach-omap2/omap4-restart.c
 delete mode 100644 arch/arm/mach-omap2/ti81xx-restart.c
arch/arm/mach-omap2/Makefile +0 -6
index 9358696..491dc6e 100644
@@ -57,13 +57,7 @@ AFLAGS_sram34xx.o			:=-Wa,-march=armv7-a
 # Restart code (OMAP4/5 currently in omap4-common.c)
 obj-$(CONFIG_SOC_OMAP2420)		+= omap2-restart.o
 obj-$(CONFIG_SOC_OMAP2430)		+= omap2-restart.o
-obj-$(CONFIG_SOC_TI81XX)		+= ti81xx-restart.o
-obj-$(CONFIG_SOC_AM33XX)		+= am33xx-restart.o
-obj-$(CONFIG_SOC_AM43XX)		+= omap4-restart.o
 obj-$(CONFIG_ARCH_OMAP3)		+= omap3-restart.o
-obj-$(CONFIG_ARCH_OMAP4)		+= omap4-restart.o
-obj-$(CONFIG_SOC_OMAP5)			+= omap4-restart.o
-obj-$(CONFIG_SOC_DRA7XX)		+= omap4-restart.o
 
 # Pin multiplexing
 obj-$(CONFIG_ARCH_OMAP3)		+= mux34xx.o
arch/arm/mach-omap2/am33xx-restart.c deleted +0 -27
deleted file mode 100644
index 5bace6a..0000000
@@ -1,27 +0,0 @@
-/*
- * am33xx-restart.c - Code common to all AM33xx machines.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/kernel.h>
-#include <linux/reboot.h>
-
-#include "common.h"
-#include "prm.h"
-
-/**
- * am3xx_restart - trigger a software restart of the SoC
- * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
- * @cmd: passed from the userspace program rebooting the system (if provided)
- *
- * Resets the SoC.  For @cmd, see the 'reboot' syscall in
- * kernel/sys.c.  No return value.
- */
-void am33xx_restart(enum reboot_mode mode, const char *cmd)
-{
-	/* TODO: Handle mode and cmd if necessary */
-
-	omap_prm_reset_system();
-}
arch/arm/mach-omap2/board-generic.c +8 -8
index 24c9afc..6a82a9c 100644
@@ -177,7 +177,7 @@ DT_MACHINE_START(TI814X_DT, "Generic ti814x (Flattened Device Tree)")
 	.init_late	= ti81xx_init_late,
 	.init_time	= omap3_gptimer_timer_init,
 	.dt_compat	= ti814x_boards_compat,
-	.restart	= ti81xx_restart,
+	.restart	= omap_restart,
 MACHINE_END
 
 static const char *const ti816x_boards_compat[] __initconst = {
@@ -194,7 +194,7 @@ DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)")
 	.init_late	= ti81xx_init_late,
 	.init_time	= omap3_gptimer_timer_init,
 	.dt_compat	= ti816x_boards_compat,
-	.restart	= ti81xx_restart,
+	.restart	= omap_restart,
 MACHINE_END
 #endif
 
@@ -212,7 +212,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
 	.init_late	= am33xx_init_late,
 	.init_time	= omap3_gptimer_timer_init,
 	.dt_compat	= am33xx_boards_compat,
-	.restart	= am33xx_restart,
+	.restart	= omap_restart,
 MACHINE_END
 #endif
 
@@ -237,7 +237,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
 	.init_late	= omap4430_init_late,
 	.init_time	= omap4_local_timer_init,
 	.dt_compat	= omap4_boards_compat,
-	.restart	= omap44xx_restart,
+	.restart	= omap_restart,
 MACHINE_END
 #endif
 
@@ -259,7 +259,7 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
 	.init_late	= omap5_init_late,
 	.init_time	= omap5_realtime_timer_init,
 	.dt_compat	= omap5_boards_compat,
-	.restart	= omap44xx_restart,
+	.restart	= omap_restart,
 MACHINE_END
 #endif
 
@@ -281,7 +281,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
 	.init_machine	= omap_generic_init,
 	.init_time	= omap3_gptimer_timer_init,
 	.dt_compat	= am43_boards_compat,
-	.restart	= omap44xx_restart,
+	.restart	= omap_restart,
 MACHINE_END
 #endif
 
@@ -304,7 +304,7 @@ DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
 	.init_machine	= omap_generic_init,
 	.init_time	= omap5_realtime_timer_init,
 	.dt_compat	= dra74x_boards_compat,
-	.restart	= omap44xx_restart,
+	.restart	= omap_restart,
 MACHINE_END
 
 static const char *const dra72x_boards_compat[] __initconst = {
@@ -323,6 +323,6 @@ DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
 	.init_machine	= omap_generic_init,
 	.init_time	= omap5_realtime_timer_init,
 	.dt_compat	= dra72x_boards_compat,
-	.restart	= omap44xx_restart,
+	.restart	= omap_restart,
 MACHINE_END
 #endif
arch/arm/mach-omap2/common.c +29 -0
index 484cdad..8afb4ac 100644
@@ -14,9 +14,13 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/reset.h>
 
 #include "common.h"
 #include "omap-secure.h"
+#include "soc.h"
+
+static struct reset_control *omap_reset_control;
 
 /*
  * Stub function for OMAP2 so that common files
@@ -32,3 +36,28 @@ void __init omap_reserve(void)
 	omap_secure_ram_reserve_memblock();
 	omap_barrier_reserve_memblock();
 }
+
+void omap_restart(enum reboot_mode mode, const char *cmd)
+{
+	if (omap_reset_control)
+		reset_control_assert(omap_reset_control);
+
+	while (1)
+		;
+}
+
+static int __init omap_init_restart(void)
+{
+	struct device_node *np;
+
+	np = of_find_node_by_name(NULL, "system_reset");
+	omap_reset_control = of_reset_control_get(np, "system");
+	if (IS_ERR(omap_reset_control)) {
+		pr_err("%s: no reset controller, reboot not functional.\n",
+		       __func__);
+		omap_reset_control = NULL;
+	}
+
+	return 0;
+}
+omap_late_initcall(omap_init_restart);
arch/arm/mach-omap2/common.h +2 -0
index 92e92cf..51d6068 100644
@@ -148,6 +148,8 @@ static inline void omap_soc_device_init(void)
 }
 #endif
 
+void omap_restart(enum reboot_mode mode, const char *cmd);
+
 #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
 void omap2xxx_restart(enum reboot_mode mode, const char *cmd);
 #else
arch/arm/mach-omap2/omap2-restart.c +1 -1
index d937b2e..f6dd4fc 100644
@@ -40,7 +40,7 @@ void omap2xxx_restart(enum reboot_mode mode, const char *cmd)
 
 	/* XXX Should save the cmd argument for use after the reboot */
 
-	omap_prm_reset_system();
+	omap_restart(mode, cmd);
 }
 
 /**
arch/arm/mach-omap2/omap3-restart.c +1 -1
index 4bdd22e..5669137 100644
@@ -31,5 +31,5 @@
 void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
 {
 	omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
-	omap_prm_reset_system();
+	omap_restart(mode, cmd);
 }
arch/arm/mach-omap2/omap4-restart.c deleted +0 -27
deleted file mode 100644
index e17136a..0000000
@@ -1,27 +0,0 @@
-/*
- * omap4-restart.c - Common to OMAP4 and OMAP5
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/types.h>
-#include <linux/reboot.h>
-#include "common.h"
-#include "prm.h"
-
-/**
- * omap44xx_restart - trigger a software restart of the SoC
- * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
- * @cmd: passed from the userspace program rebooting the system (if provided)
- *
- * Resets the SoC.  For @cmd, see the 'reboot' syscall in
- * kernel/sys.c.  No return value.
- */
-void omap44xx_restart(enum reboot_mode mode, const char *cmd)
-{
-	/* XXX Should save 'cmd' into scratchpad for use after reboot */
-	omap_prm_reset_system();
-}
arch/arm/mach-omap2/ti81xx-restart.c deleted +0 -34
deleted file mode 100644
index 6c3ce7c..0000000
@@ -1,34 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/reboot.h>
-
-#include "iomap.h"
-#include "common.h"
-#include "control.h"
-#include "prm3xxx.h"
-
-#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
-#define TI81XX_GLOBAL_RST_COLD		BIT(1)
-
-/**
- * ti81xx_restart - trigger a software restart of the SoC
- * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
- * @cmd: passed from the userspace program rebooting the system (if provided)
- *
- * Resets the SoC.  For @cmd, see the 'reboot' syscall in
- * kernel/sys.c.  No return value.
- *
- * NOTE: Warm reset does not seem to work, may require resetting
- * clocks to bypass mode.
- */
-void ti81xx_restart(enum reboot_mode mode, const char *cmd)
-{
-	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
-				   TI81XX_PRM_DEVICE_RSTCTRL);
-	while (1);
-}
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH 12/17 ARM: OMAP4: hwmod_data: remove reset data

In reply to Tero Kristo

This is provided via DT and no longer needed under the hwmod database.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   48 +++-------------------------
 1 file changed, 5 insertions(+), 43 deletions(-)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -43
index 43eebf2..0447ba9 100644
@@ -535,21 +535,14 @@ static struct omap_hwmod_class omap44xx_dsp_hwmod_class = {
 };
 
 /* dsp */
-static struct omap_hwmod_rst_info omap44xx_dsp_resets[] = {
-	{ .name = "dsp", .rst_shift = 0 },
-};
-
 static struct omap_hwmod omap44xx_dsp_hwmod = {
 	.name		= "dsp",
 	.class		= &omap44xx_dsp_hwmod_class,
 	.clkdm_name	= "tesla_clkdm",
-	.rst_lines	= omap44xx_dsp_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap44xx_dsp_resets),
 	.main_clk	= "dpll_iva_m4x2_ck",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_offs = OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET,
-			.rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET,
 			.context_offs = OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET,
 			.modulemode   = MODULEMODE_HWCTRL,
 		},
@@ -1414,22 +1407,14 @@ static struct omap_hwmod_class omap44xx_ipu_hwmod_class = {
 };
 
 /* ipu */
-static struct omap_hwmod_rst_info omap44xx_ipu_resets[] = {
-	{ .name = "cpu0", .rst_shift = 0 },
-	{ .name = "cpu1", .rst_shift = 1 },
-};
-
 static struct omap_hwmod omap44xx_ipu_hwmod = {
 	.name		= "ipu",
 	.class		= &omap44xx_ipu_hwmod_class,
 	.clkdm_name	= "ducati_clkdm",
-	.rst_lines	= omap44xx_ipu_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap44xx_ipu_resets),
 	.main_clk	= "ducati_clk_mux_ck",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_offs = OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET,
-			.rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
 			.context_offs = OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET,
 			.modulemode   = MODULEMODE_HWCTRL,
 		},
@@ -1497,23 +1482,14 @@ static struct omap_hwmod_class omap44xx_iva_hwmod_class = {
 };
 
 /* iva */
-static struct omap_hwmod_rst_info omap44xx_iva_resets[] = {
-	{ .name = "seq0", .rst_shift = 0 },
-	{ .name = "seq1", .rst_shift = 1 },
-	{ .name = "logic", .rst_shift = 2 },
-};
-
 static struct omap_hwmod omap44xx_iva_hwmod = {
 	.name		= "iva",
 	.class		= &omap44xx_iva_hwmod_class,
 	.clkdm_name	= "ivahd_clkdm",
-	.rst_lines	= omap44xx_iva_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap44xx_iva_resets),
 	.main_clk	= "dpll_iva_m5x2_ck",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_offs = OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET,
-			.rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET,
 			.context_offs = OMAP4_RM_IVAHD_IVAHD_CONTEXT_OFFSET,
 			.modulemode   = MODULEMODE_HWCTRL,
 		},
@@ -2093,9 +2069,6 @@ static struct omap_mmu_dev_attr mmu_ipu_dev_attr = {
 };
 
 static struct omap_hwmod omap44xx_mmu_ipu_hwmod;
-static struct omap_hwmod_rst_info omap44xx_mmu_ipu_resets[] = {
-	{ .name = "mmu_cache", .rst_shift = 2 },
-};
 
 static struct omap_hwmod_addr_space omap44xx_mmu_ipu_addrs[] = {
 	{
@@ -2119,13 +2092,10 @@ static struct omap_hwmod omap44xx_mmu_ipu_hwmod = {
 	.name		= "mmu_ipu",
 	.class		= &omap44xx_mmu_hwmod_class,
 	.clkdm_name	= "ducati_clkdm",
-	.rst_lines	= omap44xx_mmu_ipu_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap44xx_mmu_ipu_resets),
 	.main_clk	= "ducati_clk_mux_ck",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_offs = OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET,
-			.rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
 			.context_offs = OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET,
 			.modulemode   = MODULEMODE_HWCTRL,
 		},
@@ -2140,9 +2110,6 @@ static struct omap_mmu_dev_attr mmu_dsp_dev_attr = {
 };
 
 static struct omap_hwmod omap44xx_mmu_dsp_hwmod;
-static struct omap_hwmod_rst_info omap44xx_mmu_dsp_resets[] = {
-	{ .name = "mmu_cache", .rst_shift = 1 },
-};
 
 static struct omap_hwmod_addr_space omap44xx_mmu_dsp_addrs[] = {
 	{
@@ -2166,13 +2133,10 @@ static struct omap_hwmod omap44xx_mmu_dsp_hwmod = {
 	.name		= "mmu_dsp",
 	.class		= &omap44xx_mmu_hwmod_class,
 	.clkdm_name	= "tesla_clkdm",
-	.rst_lines	= omap44xx_mmu_dsp_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap44xx_mmu_dsp_resets),
 	.main_clk	= "dpll_iva_m4x2_ck",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_offs = OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET,
-			.rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET,
 			.context_offs = OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET,
 			.modulemode   = MODULEMODE_HWCTRL,
 		},
@@ -2320,16 +2284,14 @@ static struct omap_hwmod omap44xx_cm_core_hwmod = {
 };
 
 /* prm */
-static struct omap_hwmod_rst_info omap44xx_prm_resets[] = {
-	{ .name = "rst_global_warm_sw", .rst_shift = 0 },
-	{ .name = "rst_global_cold_sw", .rst_shift = 1 },
-};
-
 static struct omap_hwmod omap44xx_prm_hwmod = {
 	.name		= "prm",
 	.class		= &omap44xx_prcm_hwmod_class,
-	.rst_lines	= omap44xx_prm_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap44xx_prm_resets),
+	.prcm = {
+		.omap4 = {
+			.flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
+		},
+	},
 };
 
 /*
Signature · 1 line
1.7.9.5
#17 lore raw

PATCH 13/17 ARM: OMAP5: hwmod_data: remove reset data

In reply to Tero Kristo

This is provided via DT, and no longer needed in the hwmod database.

---
 arch/arm/mach-omap2/omap_hwmod_54xx_data.c |   14 --------------
 1 file changed, 14 deletions(-)
arch/arm/mach-omap2/omap_hwmod_54xx_data.c +0 -14
index 7c3fac0..9e33ac8 100644
@@ -1378,21 +1378,14 @@ static struct omap_hwmod_class omap54xx_mmu_hwmod_class = {
 	.sysc = &omap54xx_mmu_sysc,
 };
 
-static struct omap_hwmod_rst_info omap54xx_mmu_dsp_resets[] = {
-	{ .name = "mmu_cache", .rst_shift = 1 },
-};
-
 static struct omap_hwmod omap54xx_mmu_dsp_hwmod = {
 	.name		= "mmu_dsp",
 	.class		= &omap54xx_mmu_hwmod_class,
 	.clkdm_name	= "dsp_clkdm",
-	.rst_lines	= omap54xx_mmu_dsp_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap54xx_mmu_dsp_resets),
 	.main_clk	= "dpll_iva_h11x2_ck",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_offs = OMAP54XX_CM_DSP_DSP_CLKCTRL_OFFSET,
-			.rstctrl_offs = OMAP54XX_RM_DSP_RSTCTRL_OFFSET,
 			.context_offs = OMAP54XX_RM_DSP_DSP_CONTEXT_OFFSET,
 			.modulemode   = MODULEMODE_HWCTRL,
 		},
@@ -1400,21 +1393,14 @@ static struct omap_hwmod omap54xx_mmu_dsp_hwmod = {
 };
 
 /* mmu ipu */
-static struct omap_hwmod_rst_info omap54xx_mmu_ipu_resets[] = {
-	{ .name = "mmu_cache", .rst_shift = 2 },
-};
-
 static struct omap_hwmod omap54xx_mmu_ipu_hwmod = {
 	.name		= "mmu_ipu",
 	.class		= &omap54xx_mmu_hwmod_class,
 	.clkdm_name	= "ipu_clkdm",
-	.rst_lines	= omap54xx_mmu_ipu_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap54xx_mmu_ipu_resets),
 	.main_clk	= "dpll_core_h22x2_ck",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_offs = OMAP54XX_CM_IPU_IPU_CLKCTRL_OFFSET,
-			.rstctrl_offs = OMAP54XX_RM_IPU_RSTCTRL_OFFSET,
 			.context_offs = OMAP54XX_RM_IPU_IPU_CONTEXT_OFFSET,
 			.modulemode   = MODULEMODE_HWCTRL,
 		},
Signature · 1 line
1.7.9.5
#18 lore raw

PATCH 14/17 ARM: OMAP2: hwmod: AMx3xx: remove redundant reset info

In reply to Tero Kristo

AMx3xx reset info is now parsed from DT, so the data under hwmod database can be removed.

---
 .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |   30 --------------------
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c         |    8 ------
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c         |    8 ------
 3 files changed, 46 deletions(-)
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c +0 -30
index 907a452b..7405e78 100644
@@ -27,8 +27,6 @@
 #include "common.h"
 
 #define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
-#define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
-#define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
 
 /*
  * 'l3' class
@@ -143,10 +141,6 @@ static struct omap_hwmod_class am33xx_pruss_hwmod_class = {
 	.name	= "pruss",
 };
 
-static struct omap_hwmod_rst_info am33xx_pruss_resets[] = {
-	{ .name = "pruss", .rst_shift = 1 },
-};
-
 /* pru-icss */
 /* Pseudo hwmod for reset control purpose only */
 struct omap_hwmod am33xx_pruss_hwmod = {
@@ -159,8 +153,6 @@ struct omap_hwmod am33xx_pruss_hwmod = {
 			.modulemode	= MODULEMODE_SWCTRL,
 		},
 	},
-	.rst_lines	= am33xx_pruss_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(am33xx_pruss_resets),
 };
 
 /* gfx */
@@ -169,10 +161,6 @@ static struct omap_hwmod_class am33xx_gfx_hwmod_class = {
 	.name	= "gfx",
 };
 
-static struct omap_hwmod_rst_info am33xx_gfx_resets[] = {
-	{ .name = "gfx", .rst_shift = 0, .st_shift = 0},
-};
-
 struct omap_hwmod am33xx_gfx_hwmod = {
 	.name		= "gfx",
 	.class		= &am33xx_gfx_hwmod_class,
@@ -183,8 +171,6 @@ struct omap_hwmod am33xx_gfx_hwmod = {
 			.modulemode	= MODULEMODE_SWCTRL,
 		},
 	},
-	.rst_lines	= am33xx_gfx_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(am33xx_gfx_resets),
 };
 
 /*
@@ -1397,17 +1383,9 @@ static void omap_hwmod_am33xx_clkctrl(void)
 	CLKCTRL(am33xx_aes0_hwmod , AM33XX_CM_PER_AES0_CLKCTRL_OFFSET);
 }
 
-static void omap_hwmod_am33xx_rst(void)
-{
-	RSTCTRL(am33xx_pruss_hwmod, AM33XX_RM_PER_RSTCTRL_OFFSET);
-	RSTCTRL(am33xx_gfx_hwmod, AM33XX_RM_GFX_RSTCTRL_OFFSET);
-	RSTST(am33xx_gfx_hwmod, AM33XX_RM_GFX_RSTST_OFFSET);
-}
-
 void omap_hwmod_am33xx_reg(void)
 {
 	omap_hwmod_am33xx_clkctrl();
-	omap_hwmod_am33xx_rst();
 }
 
 static void omap_hwmod_am43xx_clkctrl(void)
@@ -1470,15 +1448,7 @@ static void omap_hwmod_am43xx_clkctrl(void)
 	CLKCTRL(am33xx_aes0_hwmod , AM43XX_CM_PER_AES0_CLKCTRL_OFFSET);
 }
 
-static void omap_hwmod_am43xx_rst(void)
-{
-	RSTCTRL(am33xx_pruss_hwmod, AM43XX_RM_PER_RSTCTRL_OFFSET);
-	RSTCTRL(am33xx_gfx_hwmod, AM43XX_RM_GFX_RSTCTRL_OFFSET);
-	RSTST(am33xx_gfx_hwmod, AM43XX_RM_GFX_RSTST_OFFSET);
-}
-
 void omap_hwmod_am43xx_reg(void)
 {
 	omap_hwmod_am43xx_clkctrl();
-	omap_hwmod_am43xx_rst();
 }
arch/arm/mach-omap2/omap_hwmod_33xx_data.c +0 -8
index cc0791d..e4fc8b3 100644
@@ -64,10 +64,6 @@ static struct omap_hwmod am33xx_l4_hs_hwmod = {
 	},
 };
 
-static struct omap_hwmod_rst_info am33xx_wkup_m3_resets[] = {
-	{ .name = "wkup_m3", .rst_shift = 3, .st_shift = 5 },
-};
-
 /* wkup_m3  */
 static struct omap_hwmod am33xx_wkup_m3_hwmod = {
 	.name		= "wkup_m3",
@@ -79,13 +75,9 @@ static struct omap_hwmod am33xx_wkup_m3_hwmod = {
 	.prcm		= {
 		.omap4	= {
 			.clkctrl_offs	= AM33XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET,
-			.rstctrl_offs	= AM33XX_RM_WKUP_RSTCTRL_OFFSET,
-			.rstst_offs	= AM33XX_RM_WKUP_RSTST_OFFSET,
 			.modulemode	= MODULEMODE_SWCTRL,
 		},
 	},
-	.rst_lines	= am33xx_wkup_m3_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(am33xx_wkup_m3_resets),
 };
 
 /*
arch/arm/mach-omap2/omap_hwmod_43xx_data.c +0 -8
index e97a894..d486c42 100644
@@ -52,10 +52,6 @@ static struct omap_hwmod am43xx_l4_hs_hwmod = {
 	},
 };
 
-static struct omap_hwmod_rst_info am33xx_wkup_m3_resets[] = {
-	{ .name = "wkup_m3", .rst_shift = 3, .st_shift = 5 },
-};
-
 static struct omap_hwmod am43xx_wkup_m3_hwmod = {
 	.name		= "wkup_m3",
 	.class		= &am33xx_wkup_m3_hwmod_class,
@@ -66,13 +62,9 @@ static struct omap_hwmod am43xx_wkup_m3_hwmod = {
 	.prcm		= {
 		.omap4	= {
 			.clkctrl_offs	= AM43XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET,
-			.rstctrl_offs	= AM43XX_RM_WKUP_RSTCTRL_OFFSET,
-			.rstst_offs	= AM43XX_RM_WKUP_RSTST_OFFSET,
 			.modulemode	= MODULEMODE_SWCTRL,
 		},
 	},
-	.rst_lines	= am33xx_wkup_m3_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(am33xx_wkup_m3_resets),
 };
 
 static struct omap_hwmod am43xx_control_hwmod = {
Signature · 1 line
1.7.9.5
#19 lore raw

PATCH 15/17 ARM: OMAP24xx: hwmod: remove reset data from hwmod database

In reply to Tero Kristo

These are now parsed from DT, so not needed under the hwmod database anymore.

---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   13 -------------
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |    7 -------
 2 files changed, 20 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +0 -13
index 65b1647..5db681d 100644
@@ -49,16 +49,10 @@ static struct omap_hwmod_class iva1_hwmod_class = {
 	.name		= "iva1",
 };
 
-static struct omap_hwmod_rst_info omap2420_iva_resets[] = {
-	{ .name = "iva", .rst_shift = 8 },
-};
-
 static struct omap_hwmod omap2420_iva_hwmod = {
 	.name		= "iva",
 	.class		= &iva1_hwmod_class,
 	.clkdm_name	= "iva1_clkdm",
-	.rst_lines	= omap2420_iva_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap2420_iva_resets),
 	.main_clk	= "iva1_ifck",
 };
 
@@ -67,17 +61,10 @@ static struct omap_hwmod_class dsp_hwmod_class = {
 	.name		= "dsp",
 };
 
-static struct omap_hwmod_rst_info omap2420_dsp_resets[] = {
-	{ .name = "logic", .rst_shift = 0 },
-	{ .name = "mmu", .rst_shift = 1 },
-};
-
 static struct omap_hwmod omap2420_dsp_hwmod = {
 	.name		= "dsp",
 	.class		= &dsp_hwmod_class,
 	.clkdm_name	= "dsp_clkdm",
-	.rst_lines	= omap2420_dsp_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap2420_dsp_resets),
 	.main_clk	= "dsp_fck",
 };
 
arch/arm/mach-omap2/omap_hwmod_2430_data.c +0 -7
index 79127b3..cc0cfaf 100644
@@ -44,17 +44,10 @@
  */
 
 /* IVA2 (IVA2) */
-static struct omap_hwmod_rst_info omap2430_iva_resets[] = {
-	{ .name = "logic", .rst_shift = 0 },
-	{ .name = "mmu", .rst_shift = 1 },
-};
-
 static struct omap_hwmod omap2430_iva_hwmod = {
 	.name		= "iva",
 	.class		= &iva_hwmod_class,
 	.clkdm_name	= "dsp_clkdm",
-	.rst_lines	= omap2430_iva_resets,
-	.rst_lines_cnt	= ARRAY_SIZE(omap2430_iva_resets),
 	.main_clk	= "dsp_fck",
 };
 
Signature · 1 line
1.7.9.5
#20 lore raw

PATCH 16/17 ARM: OMAP2+: hwmod: remove obsolete support for some hardreset logic

In reply to Tero Kristo

OMAP4+ prcm struct no longer requires the support for the rstctrl / rstst offsets, as the data is parsed from DT for all platforms. Remove also the obsolete hardreset support functions from the hwmod code.

---
 arch/arm/mach-omap2/omap_hwmod.c |  108 --------------------------------------
 arch/arm/mach-omap2/omap_hwmod.h |    4 --
 2 files changed, 112 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +0 -108
index 974260a..9d7a034 100644
@@ -3069,106 +3069,6 @@ static int _omap2_is_hardreset_asserted(struct omap_hwmod *oh,
 					      oh->prcm.omap2.module_offs, 0);
 }
 
-/**
- * _omap4_assert_hardreset - call OMAP4 PRM hardreset fn with hwmod args
- * @oh: struct omap_hwmod * to assert hardreset
- * @ohri: hardreset line data
- *
- * Call omap4_prminst_assert_hardreset() with parameters extracted
- * from the hwmod @oh and the hardreset line data @ohri.  Only
- * intended for use as an soc_ops function pointer.  Passes along the
- * return value from omap4_prminst_assert_hardreset().  XXX This
- * function is scheduled for removal when the PRM code is moved into
- * drivers/.
- */
-static int _omap4_assert_hardreset(struct omap_hwmod *oh,
-				   struct omap_hwmod_rst_info *ohri)
-{
-	if (!oh->clkdm)
-		return -EINVAL;
-
-	return omap_prm_assert_hardreset(ohri->rst_shift,
-					 oh->clkdm->pwrdm.ptr->prcm_partition,
-					 oh->clkdm->pwrdm.ptr->prcm_offs,
-					 oh->prcm.omap4.rstctrl_offs);
-}
-
-/**
- * _omap4_deassert_hardreset - call OMAP4 PRM hardreset fn with hwmod args
- * @oh: struct omap_hwmod * to deassert hardreset
- * @ohri: hardreset line data
- *
- * Call omap4_prminst_deassert_hardreset() with parameters extracted
- * from the hwmod @oh and the hardreset line data @ohri.  Only
- * intended for use as an soc_ops function pointer.  Passes along the
- * return value from omap4_prminst_deassert_hardreset().  XXX This
- * function is scheduled for removal when the PRM code is moved into
- * drivers/.
- */
-static int _omap4_deassert_hardreset(struct omap_hwmod *oh,
-				     struct omap_hwmod_rst_info *ohri)
-{
-	if (!oh->clkdm)
-		return -EINVAL;
-
-	if (ohri->st_shift)
-		pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
-		       oh->name, ohri->name);
-	return omap_prm_deassert_hardreset(ohri->rst_shift, ohri->rst_shift,
-					   oh->clkdm->pwrdm.ptr->prcm_partition,
-					   oh->clkdm->pwrdm.ptr->prcm_offs,
-					   oh->prcm.omap4.rstctrl_offs,
-					   oh->prcm.omap4.rstctrl_offs +
-					   OMAP4_RST_CTRL_ST_OFFSET);
-}
-
-/**
- * _omap4_is_hardreset_asserted - call OMAP4 PRM hardreset fn with hwmod args
- * @oh: struct omap_hwmod * to test hardreset
- * @ohri: hardreset line data
- *
- * Call omap4_prminst_is_hardreset_asserted() with parameters
- * extracted from the hwmod @oh and the hardreset line data @ohri.
- * Only intended for use as an soc_ops function pointer.  Passes along
- * the return value from omap4_prminst_is_hardreset_asserted().  XXX
- * This function is scheduled for removal when the PRM code is moved
- * into drivers/.
- */
-static int _omap4_is_hardreset_asserted(struct omap_hwmod *oh,
-					struct omap_hwmod_rst_info *ohri)
-{
-	if (!oh->clkdm)
-		return -EINVAL;
-
-	return omap_prm_is_hardreset_asserted(ohri->rst_shift,
-					      oh->clkdm->pwrdm.ptr->
-					      prcm_partition,
-					      oh->clkdm->pwrdm.ptr->prcm_offs,
-					      oh->prcm.omap4.rstctrl_offs);
-}
-
-/**
- * _am33xx_deassert_hardreset - call AM33XX PRM hardreset fn with hwmod args
- * @oh: struct omap_hwmod * to deassert hardreset
- * @ohri: hardreset line data
- *
- * Call am33xx_prminst_deassert_hardreset() with parameters extracted
- * from the hwmod @oh and the hardreset line data @ohri.  Only
- * intended for use as an soc_ops function pointer.  Passes along the
- * return value from am33xx_prminst_deassert_hardreset().  XXX This
- * function is scheduled for removal when the PRM code is moved into
- * drivers/.
- */
-static int _am33xx_deassert_hardreset(struct omap_hwmod *oh,
-				     struct omap_hwmod_rst_info *ohri)
-{
-	return omap_prm_deassert_hardreset(ohri->rst_shift, ohri->st_shift,
-					   oh->clkdm->pwrdm.ptr->prcm_partition,
-					   oh->clkdm->pwrdm.ptr->prcm_offs,
-					   oh->prcm.omap4.rstctrl_offs,
-					   oh->prcm.omap4.rstst_offs);
-}
-
 static int _dt_assert_hardreset(struct omap_hwmod *oh,
 				struct omap_hwmod_rst_info *ohri)
 {
@@ -3984,8 +3884,6 @@ void __init omap_hwmod_init(void)
 {
 	if (cpu_is_omap24xx()) {
 		soc_ops.wait_target_ready = _omap2xxx_3xxx_wait_target_ready;
-		soc_ops.assert_hardreset = _omap2_assert_hardreset;
-		soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
 		soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
 	} else if (cpu_is_omap34xx()) {
 		soc_ops.wait_target_ready = _omap2xxx_3xxx_wait_target_ready;
@@ -3997,9 +3895,6 @@ void __init omap_hwmod_init(void)
 		soc_ops.enable_module = _omap4_enable_module;
 		soc_ops.disable_module = _omap4_disable_module;
 		soc_ops.wait_target_ready = _omap4_wait_target_ready;
-		soc_ops.assert_hardreset = _omap4_assert_hardreset;
-		soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
-		soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
 		soc_ops.init_clkdm = _init_clkdm;
 		soc_ops.update_context_lost = _omap4_update_context_lost;
 		soc_ops.get_context_lost = _omap4_get_context_lost;
@@ -4008,9 +3903,6 @@ void __init omap_hwmod_init(void)
 		soc_ops.enable_module = _omap4_enable_module;
 		soc_ops.disable_module = _omap4_disable_module;
 		soc_ops.wait_target_ready = _omap4_wait_target_ready;
-		soc_ops.assert_hardreset = _omap4_assert_hardreset;
-		soc_ops.deassert_hardreset = _am33xx_deassert_hardreset;
-		soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
 		soc_ops.init_clkdm = _init_clkdm;
 	} else {
 		WARN(1, "omap_hwmod: unknown SoC type\n");
arch/arm/mach-omap2/omap_hwmod.h +0 -4
index a6f3ac2..e1f0b76 100644
@@ -451,10 +451,8 @@ struct omap_hwmod_omap2_prcm {
 /**
  * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
  * @clkctrl_offs: offset of the PRCM clock control register
- * @rstctrl_offs: offset of the XXX_RSTCTRL register located in the PRM
  * @context_offs: offset of the RM_*_CONTEXT register
  * @lostcontext_mask: bitmask for selecting bits from RM_*_CONTEXT register
- * @rstst_reg: (AM33XX only) address of the XXX_RSTST register in the PRM
  * @submodule_wkdep_bit: bit shift of the WKDEP range
  * @flags: PRCM register capabilities for this IP block
  * @modulemode: allowable modulemodes
@@ -467,8 +465,6 @@ struct omap_hwmod_omap2_prcm {
  */
 struct omap_hwmod_omap4_prcm {
 	u16		clkctrl_offs;
-	u16		rstctrl_offs;
-	u16		rstst_offs;
 	u16		context_offs;
 	u32		lostcontext_mask;
 	u8		submodule_wkdep_bit;
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH 17/17 ARM: OMAP2+: PRM: remove redundant system reset code

In reply to Tero Kristo

This is now handled via the reset controller and the provided information from DT, so the legacy support code is no longer needed. OMAP3 version shall be removed once OMAP3 is also DT only.

---
 arch/arm/mach-omap2/prm2xxx.c     |   15 ---------------
 arch/arm/mach-omap2/prm33xx.c     |   18 ------------------
 arch/arm/mach-omap2/prm44xx.c     |    1 -
 arch/arm/mach-omap2/prminst44xx.c |   20 --------------------
 4 files changed, 54 deletions(-)
arch/arm/mach-omap2/prm2xxx.c +0 -15
index 752018ce..70f711b 100644
@@ -101,20 +101,6 @@ static int omap2xxx_pwrst_to_common_pwrst(u8 omap2xxx_pwrst)
 }
 
 /**
- * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC
- *
- * Set the DPLL reset bit, which should reboot the SoC.  This is the
- * recommended way to restart the SoC.  No return value.
- */
-static void omap2xxx_prm_dpll_reset(void)
-{
-	omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, WKUP_MOD,
-				   OMAP2_RM_RSTCTRL);
-	/* OCP barrier */
-	omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTCTRL);
-}
-
-/**
  * omap2xxx_prm_clear_mod_irqs - clear wakeup status bits for a module
  * @module: PRM module to clear wakeups from
  * @regs: register offset to clear
@@ -216,7 +202,6 @@ static struct prm_ll_data omap2xxx_prm_ll_data = {
 	.assert_hardreset = &omap2_prm_assert_hardreset,
 	.deassert_hardreset = &omap2_prm_deassert_hardreset,
 	.is_hardreset_asserted = &omap2_prm_is_hardreset_asserted,
-	.reset_system = &omap2xxx_prm_dpll_reset,
 	.clear_mod_irqs = &omap2xxx_prm_clear_mod_irqs,
 };
 
arch/arm/mach-omap2/prm33xx.c +0 -18
index dcb5001..12b15a2 100644
@@ -336,23 +336,6 @@ static int am33xx_check_vcvp(void)
 	return 0;
 }
 
-/**
- * am33xx_prm_global_warm_sw_reset - reboot the device via warm reset
- *
- * Immediately reboots the device through warm reset.
- */
-static void am33xx_prm_global_warm_sw_reset(void)
-{
-	am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK,
-				AM33XX_RST_GLOBAL_WARM_SW_MASK,
-				AM33XX_PRM_DEVICE_MOD,
-				AM33XX_PRM_RSTCTRL_OFFSET);
-
-	/* OCP barrier */
-	(void)am33xx_prm_read_reg(AM33XX_PRM_DEVICE_MOD,
-				  AM33XX_PRM_RSTCTRL_OFFSET);
-}
-
 struct pwrdm_ops am33xx_pwrdm_operations = {
 	.pwrdm_set_next_pwrst		= am33xx_pwrdm_set_next_pwrst,
 	.pwrdm_read_next_pwrst		= am33xx_pwrdm_read_next_pwrst,
@@ -375,7 +358,6 @@ static struct prm_ll_data am33xx_prm_ll_data = {
 	.assert_hardreset		= am33xx_prm_assert_hardreset,
 	.deassert_hardreset		= am33xx_prm_deassert_hardreset,
 	.is_hardreset_asserted		= am33xx_prm_is_hardreset_asserted,
-	.reset_system			= am33xx_prm_global_warm_sw_reset,
 };
 
 int __init am33xx_prm_init(const struct omap_prcm_init_data *data)
arch/arm/mach-omap2/prm44xx.c +0 -1
index 3076800..76d7e30 100644
@@ -702,7 +702,6 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
 	.assert_hardreset	= omap4_prminst_assert_hardreset,
 	.deassert_hardreset	= omap4_prminst_deassert_hardreset,
 	.is_hardreset_asserted	= omap4_prminst_is_hardreset_asserted,
-	.reset_system		= omap4_prminst_global_warm_sw_reset,
 	.vp_check_txdone	= omap4_prm_vp_check_txdone,
 	.vp_clear_txdone	= omap4_prm_vp_clear_txdone,
 };
arch/arm/mach-omap2/prminst44xx.c +0 -20
index d0b15db..ffed63f 100644
@@ -174,23 +174,3 @@ int omap4_prminst_deassert_hardreset(u8 shift, u8 st_shift, u8 part, s16 inst,
 
 	return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
 }
-
-
-void omap4_prminst_global_warm_sw_reset(void)
-{
-	u32 v;
-	s32 inst = omap4_prmst_get_prm_dev_inst();
-
-	if (inst == PRM_INSTANCE_UNKNOWN)
-		return;
-
-	v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, inst,
-					OMAP4_PRM_RSTCTRL_OFFSET);
-	v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK;
-	omap4_prminst_write_inst_reg(v, OMAP4430_PRM_PARTITION,
-				 inst, OMAP4_PRM_RSTCTRL_OFFSET);
-
-	/* OCP barrier */
-	v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
-				    inst, OMAP4_PRM_RSTCTRL_OFFSET);
-}
Signature · 1 line
1.7.9.5