imx-weim.c ignores status from devicetree

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx-weim.c ignores status from devicetree

941 Views
wolnet
Contributor III

Dear all,

I found out that function weim_parse_dt() parsed all elements from the devicetree andrunning the setup function, it ignors the status for the elements.

Because of this the settings for the eim registers in imx6 are set to the last element found.

Without the patch in the following devicetree snippet the registers will be set for mram and not for sram as expected because this is enabled.

/*

* EIM

*/

&weim {

   ...

    status = "okay";

    sram@0,0 {

        /* SRAM 256kB */

        compatible = "stek,sigmatek-sram";

        reg = <3 0 0x40000>;

        fsl,weim-cs-timing = <

                EIM_GCR1_SRAM_256K

                EIM_GCR2_SRAM_256K

                EIM_RCR1_SRAM_256K

                EIM_RCR2_SRAM_256K

                EIM_WCR1_SRAM_256K

                EIM_WCR2_SRAM_256K

            >;

        status = "okay";

    };

    mram@0,0 {

        /* MRAM 256kB */

        compatible = "stek,sigmatek-sram";

        reg = <3 0 0x40000>;

        fsl,weim-cs-timing = <

                EIM_GCR1_MRAM_128K

                EIM_GCR2_MRAM_128K

                EIM_RCR1_MRAM_128K

                EIM_RCR2_MRAM_128K

                EIM_WCR1_MRAM_128K

                EIM_WCR2_MRAM_128K

            >;

        status = "disabled";

    };

};

please find attached the patch.

--- a/drivers/bus/imx-weim.c

+++ b/drivers/bus/imx-weim.c

@@ -216,7 +216,7 @@ static int __init weim_parse_dt(struct platform_device *pdev,

                        return ret;

        }

-       for_each_child_of_node(pdev->dev.of_node, child) {

+       for_each_available_child_of_node(pdev->dev.of_node, child) {

                if (!child->name)

                        continue;

Kind regards

Wolfgang

Labels (5)
Tags (4)
0 Kudos
0 Replies