diff mbox series

[V2,6/6] imx8: Replace SC_R_LAST with SC_R_NONE in DTB

Message ID 20200504131654.17085-6-peng.fan@nxp.com
State New
Headers show
Series [V2,1/6] dt-bindings: imx_rsrc: add SC_R_NONE | expand

Commit Message

Peng Fan May 4, 2020, 1:16 p.m. UTC
From: Leonard Crestez <leonard.crestez at nxp.com>

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan at nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---

V2:
 fix dtsi

 arch/arm/dts/fsl-imx8dx.dtsi                    | 6 +++---
 arch/arm/dts/fsl-imx8qm.dtsi                    | 6 +++---
 arch/arm/mach-imx/imx8/cpu.c                    | 1 -
 drivers/power/domain/imx8-power-domain-legacy.c | 6 +++---
 4 files changed, 9 insertions(+), 10 deletions(-)

Comments

Stefano Babic May 11, 2020, 10:17 a.m. UTC | #1
> From: Leonard Crestez <leonard.crestez at nxp.com>
> We are currently using SC_R_LAST as a marker for imx8 power domain tree
> nodes without a resource attached. This value is compiled into dtb as
> part of the linux build and used by uboot.
> The SC_R_LAST constant changes frequently as SCFW resources are added
> (by design) and every time we need to update linux and uboot headers
> together or boot can fail.
> Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
> defined to be 0xFFF0.
> Reviewed-by: Peng Fan <peng.fan at nxp.com>
> Signed-off-by: Leonard Crestez <leonard.crestez at nxp.com>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/dts/fsl-imx8dx.dtsi b/arch/arm/dts/fsl-imx8dx.dtsi
index ae1d1f460b..7d95cf0b7d 100644
--- a/arch/arm/dts/fsl-imx8dx.dtsi
+++ b/arch/arm/dts/fsl-imx8dx.dtsi
@@ -131,7 +131,7 @@ 
 
 		pd_lsio: PD_LSIO {
 			compatible = "nxp,imx8-pd";
-			reg = <SC_R_LAST>;
+			reg = <SC_R_NONE>;
 			#power-domain-cells = <0>;
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -180,7 +180,7 @@ 
 
 		pd_conn: PD_CONN {
 			compatible = "nxp,imx8-pd";
-			reg = <SC_R_LAST>;
+			reg = <SC_R_NONE>;
 			#power-domain-cells = <0>;
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -214,7 +214,7 @@ 
 
 		pd_dma: PD_DMA {
 			compatible = "nxp,imx8-pd";
-			reg = <SC_R_LAST>;
+			reg = <SC_R_NONE>;
 			#power-domain-cells = <0>;
 			#address-cells = <1>;
 			#size-cells = <0>;
diff --git a/arch/arm/dts/fsl-imx8qm.dtsi b/arch/arm/dts/fsl-imx8qm.dtsi
index 6808f68f9d..2e887add79 100644
--- a/arch/arm/dts/fsl-imx8qm.dtsi
+++ b/arch/arm/dts/fsl-imx8qm.dtsi
@@ -88,7 +88,7 @@ 
 
 		pd_lsio: PD_LSIO {
 			compatible = "nxp,imx8-pd";
-			reg = <SC_R_LAST>;
+			reg = <SC_R_NONE>;
 			#power-domain-cells = <0>;
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -137,7 +137,7 @@ 
 
 		pd_conn: PD_CONN {
 			compatible = "nxp,imx8-pd";
-			reg = <SC_R_LAST>;
+			reg = <SC_R_NONE>;
 			#power-domain-cells = <0>;
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -173,7 +173,7 @@ 
 
 		pd_dma: PD_DMA {
 			compatible = "nxp,imx8-pd";
-			reg = <SC_R_LAST>;
+			reg = <SC_R_NONE>;
 			#power-domain-cells = <0>;
 			#address-cells = <1>;
 			#size-cells = <0>;
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index 2110380957..f87276e8ea 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -536,4 +536,3 @@  u32 get_cpu_rev(void)
 
 	return (id << 12) | rev;
 }
-
diff --git a/drivers/power/domain/imx8-power-domain-legacy.c b/drivers/power/domain/imx8-power-domain-legacy.c
index a5f2f8a445..f679df9e5d 100644
--- a/drivers/power/domain/imx8-power-domain-legacy.c
+++ b/drivers/power/domain/imx8-power-domain-legacy.c
@@ -90,7 +90,7 @@  static int imx8_power_domain_on(struct power_domain *power_domain)
 	if (ppriv->state_on)
 		return 0;
 
-	if (pdata->resource_id != SC_R_LAST) {
+	if (pdata->resource_id != SC_R_NONE) {
 		if (!sc_rm_is_resource_owned(-1, pdata->resource_id))
 			printf("%s [%d] not owned by curr partition\n", dev->name, pdata->resource_id);
 
@@ -139,7 +139,7 @@  static int imx8_power_domain_off_node(struct power_domain *power_domain)
 		}
 	}
 
-	if (pdata->resource_id != SC_R_LAST) {
+	if (pdata->resource_id != SC_R_NONE) {
 		ret = sc_pm_set_resource_power_mode(-1, pdata->resource_id,
 						    SC_PM_PW_MODE_OFF);
 		if (ret) {
@@ -202,7 +202,7 @@  static int imx8_power_domain_off_parentnodes(struct power_domain *power_domain)
 		}
 
 		/* power off parent */
-		if (pdata->resource_id != SC_R_LAST) {
+		if (pdata->resource_id != SC_R_NONE) {
 			ret = sc_pm_set_resource_power_mode(-1,
 							    pdata->resource_id,
 							    SC_PM_PW_MODE_OFF);