imx8: Replace SC_R_LAST with SC_R_NONE in DTB
authorLeonard Crestez <leonard.crestez@nxp.com>
Mon, 4 May 2020 13:16:54 +0000 (21:16 +0800)
committerStefano Babic <sbabic@denx.de>
Sun, 10 May 2020 18:55:20 +0000 (20:55 +0200)
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@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/dts/fsl-imx8dx.dtsi
arch/arm/dts/fsl-imx8qm.dtsi
arch/arm/mach-imx/imx8/cpu.c
drivers/power/domain/imx8-power-domain-legacy.c

index ae1d1f460b56f160822b5caa576c41b81a380b20..7d95cf0b7dcdc2ae457e5a8b358194e55ac3c0da 100644 (file)
 
                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>;
 
                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>;
 
                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>;
index 6808f68f9d49534258c4ab097022b1efe9086ff0..2e887add7925b30237d84c46ee2976770ab00ad6 100644 (file)
@@ -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>;
 
                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>;
 
                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>;
index 211038095771aac641cd9a02079897b832f89227..f87276e8eab342f988fd93e245de25ff9896a7a2 100644 (file)
@@ -536,4 +536,3 @@ u32 get_cpu_rev(void)
 
        return (id << 12) | rev;
 }
-
index a5f2f8a4457fa1d7ab59c052a9100925df069a76..f679df9e5d1bbe40c0460e916c9308950a31edb9 100644 (file)
@@ -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);