]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
[POWERPC] QE: get rid of most device_types and model
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Thu, 24 Jan 2008 15:39:59 +0000 (18:39 +0300)
committerKumar Gala <galak@kernel.crashing.org>
Mon, 28 Jan 2008 14:32:55 +0000 (08:32 -0600)
Now we're searching for "fsl,qe", "fsl,qe-muram", "fsl,qe-muram-data"
and "fsl,qe-ic".

Unfortunately it's still impossible to remove device_type = "qe"
from the existing device trees because older u-boots are looking for it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Documentation/powerpc/booting-without-of.txt
arch/powerpc/boot/dts/mpc832x_mds.dts
arch/powerpc/boot/dts/mpc832x_rdb.dts
arch/powerpc/boot/dts/mpc836x_mds.dts
arch/powerpc/boot/dts/mpc8568mds.dts
arch/powerpc/platforms/83xx/mpc832x_mds.c
arch/powerpc/platforms/83xx/mpc832x_rdb.c
arch/powerpc/platforms/83xx/mpc836x_mds.c
arch/powerpc/platforms/85xx/mpc85xx_mds.c
arch/powerpc/sysdev/fsl_soc.c
arch/powerpc/sysdev/qe_lib/qe.c

index e74a4a65d469d6ba36d5ce1a2ff6033840b774bc..470cbc0cfcebfe45e20e5eda44f37ddc4ae01a10 100644 (file)
@@ -1543,7 +1543,7 @@ platforms are moved over to use the flattened-device-tree model.
    i) Root QE device
 
    Required properties:
-   - device_type : should be "qe";
+   - compatible : should be "fsl,qe";
    - model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
    - reg : offset and length of the device registers.
    - bus-frequency : the clock frequency for QUICC Engine.
@@ -1557,8 +1557,7 @@ platforms are moved over to use the flattened-device-tree model.
                #address-cells = <1>;
                #size-cells = <1>;
                #interrupt-cells = <2>;
-               device_type = "qe";
-               model = "QE";
+               compatible = "fsl,qe";
                ranges = <0 e0100000 00100000>;
                reg = <e0100000 480>;
                brg-frequency = <0>;
@@ -1781,7 +1780,7 @@ platforms are moved over to use the flattened-device-tree model.
    vii) Multi-User RAM (MURAM)
 
    Required properties:
-   - device_type : should be "muram".
+   - compatible : should be "fsl,qe-muram", "fsl,cpm-muram".
    - mode : the could be "host" or "slave".
    - ranges : Should be defined as specified in 1) to describe the
       translation of MURAM addresses.
@@ -1791,10 +1790,12 @@ platforms are moved over to use the flattened-device-tree model.
    Example:
 
        muram@10000 {
-               device_type = "muram";
+               compatible = "fsl,qe-muram", "fsl,cpm-muram";
                ranges = <0 00010000 0000c000>;
 
                data-only@0{
+                       compatible = "fsl,qe-muram-data",
+                                    "fsl,cpm-muram-data";
                        reg = <0 c000>;
                };
        };
index 690252456d3d5b02529afb62eb7791bc8fecbe97..e300df4d3e05d8fc197b74623aeb2fa735491ad9 100644 (file)
                #size-cells = <1>;
                device_type = "qe";
                compatible = "fsl,qe";
-               model = "QE";
                ranges = <0 e0100000 00100000>;
                reg = <e0100000 480>;
                brg-frequency = <0>;
                bus-frequency = <BCD3D80>;
 
                muram@10000 {
-                       device_type = "muram";
+                       compatible = "fsl,qe-muram", "fsl,cpm-muram";
                        ranges = <0 00010000 00004000>;
 
                        data-only@0 {
+                               compatible = "fsl,qe-muram-data",
+                                            "fsl,cpm-muram-data";
                                reg = <0 4000>;
                        };
                };
                        };
                };
 
-               qeic: qeic@80 {
+               qeic: interrupt-controller@80 {
                        interrupt-controller;
-                       device_type = "qeic";
+                       compatible = "fsl,qe-ic";
                        #address-cells = <0>;
                        #interrupt-cells = <1>;
                        reg = <80 80>;
index 10ff7aadf9dcce63335cc1e8640ac4f3e52ee487..4d5cfd32cd7cfdc14f6a35f085b2d6dbf06045e9 100644 (file)
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "qe";
-               model = "QE";
+               compatible = "fsl,qe";
                ranges = <0 e0100000 00100000>;
                reg = <e0100000 480>;
                brg-frequency = <0>;
                bus-frequency = <BCD3D80>;
 
                muram@10000 {
-                       device_type = "muram";
+                       compatible = "fsl,qe-muram", "fsl,cpm-muram";
                        ranges = <0 00010000 00004000>;
 
                        data-only@0 {
+                               compatible = "fsl,qe-muram-data",
+                                            "fsl,cpm-muram-data";
                                reg = <0 4000>;
                        };
                };
                        };
                };
 
-               qeic:qeic@80 {
+               qeic:interrupt-controller@80 {
                        interrupt-controller;
-                       device_type = "qeic";
+                       compatible = "fsl,qe-ic";
                        #address-cells = <0>;
                        #interrupt-cells = <1>;
                        reg = <80 80>;
index 2181d2cdbff2f2f7e13640106d3de7d670caaff3..9a2581b6a1709075bd6f50c523e71a37a530a343 100644 (file)
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "qe";
-               model = "QE";
+               compatible = "fsl,qe";
                ranges = <0 e0100000 00100000>;
                reg = <e0100000 480>;
                brg-frequency = <0>;
                bus-frequency = <179A7B00>;
 
                muram@10000 {
-                       device_type = "muram";
+                       compatible = "fsl,qe-muram", "fsl,cpm-muram";
                        ranges = <0 00010000 0000c000>;
 
                        data-only@0{
+                               compatible = "fsl,qe-muram-data",
+                                            "fsl,cpm-muram-data";
                                reg = <0 c000>;
                        };
                };
                        };
                };
 
-               qeic: qeic@80 {
+               qeic: interrupt-controller@80 {
                        interrupt-controller;
-                       device_type = "qeic";
+                       compatible = "fsl,qe-ic";
                        #address-cells = <0>;
                        #interrupt-cells = <1>;
                        reg = <80 80>;
index 5818a7c861e734c9a1e5dd5d379cb4556a01a48c..04f5c6f682565d9a580d229aa0cea5d0db65f531 100644 (file)
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "qe";
-               model = "QE";
+               compatible = "fsl,qe";
                ranges = <0 e0080000 00040000>;
                reg = <e0080000 480>;
                brg-frequency = <0>;
                bus-frequency = <179A7B00>;
 
                muram@10000 {
-                       device_type = "muram";
+                       compatible = "fsl,qe-muram", "fsl,cpm-muram";
                        ranges = <0 00010000 0000c000>;
 
                        data-only@0{
+                               compatible = "fsl,qe-muram-data",
+                                            "fsl,cpm-muram-data";
                                reg = <0 c000>;
                        };
                };
                        };
                };
 
-               qeic: qeic@80 {
+               qeic: interrupt-controller@80 {
                        interrupt-controller;
-                       device_type = "qeic";
+                       compatible = "fsl,qe-ic";
                        #address-cells = <0>;
                        #interrupt-cells = <1>;
                        reg = <80 80>;
index dbdd4adef6459c8ee996ca0ebd73889d1e25301d..6dbc6eabcb02a9465580e1b683e83f8fbf4c3ca4 100644 (file)
@@ -105,6 +105,7 @@ static struct of_device_id mpc832x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
+       { .compatible = "fsl,qe", },
        {},
 };
 
@@ -134,10 +135,12 @@ static void __init mpc832x_sys_init_IRQ(void)
        of_node_put(np);
 
 #ifdef CONFIG_QUICC_ENGINE
-       np = of_find_node_by_type(NULL, "qeic");
-       if (!np)
-               return;
-
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+       if (!np) {
+               np = of_find_node_by_type(NULL, "qeic");
+               if (!np)
+                       return;
+       }
        qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
        of_node_put(np);
 #endif                         /* CONFIG_QUICC_ENGINE */
index 5fddd2285abb1fc6adcd9d09f88ce841a0740474..9f0fd88b2b1f16e1a6126436fd9635ab2e5f19ae 100644 (file)
@@ -115,6 +115,7 @@ static struct of_device_id mpc832x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
+       { .compatible = "fsl,qe", },
        {},
 };
 
@@ -145,10 +146,12 @@ void __init mpc832x_rdb_init_IRQ(void)
        of_node_put(np);
 
 #ifdef CONFIG_QUICC_ENGINE
-       np = of_find_node_by_type(NULL, "qeic");
-       if (!np)
-               return;
-
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+       if (!np) {
+               np = of_find_node_by_type(NULL, "qeic");
+               if (!np)
+                       return;
+       }
        qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
        of_node_put(np);
 #endif                         /* CONFIG_QUICC_ENGINE */
index db491ec006e0df018353324d4f98cd6f821bfeb3..c2e5de60c055242ac6384402fe177825fd0313cd 100644 (file)
@@ -136,6 +136,7 @@ static struct of_device_id mpc836x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
+       { .compatible = "fsl,qe", },
        {},
 };
 
@@ -165,10 +166,12 @@ static void __init mpc836x_mds_init_IRQ(void)
        of_node_put(np);
 
 #ifdef CONFIG_QUICC_ENGINE
-       np = of_find_node_by_type(NULL, "qeic");
-       if (!np)
-               return;
-
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+       if (!np) {
+               np = of_find_node_by_type(NULL, "qeic");
+               if (!np)
+                       return;
+       }
        qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
        of_node_put(np);
 #endif                         /* CONFIG_QUICC_ENGINE */
index 4fdf5abefffd8384fb24dcfa1724e8350e472acc..25f8bc75e838400de36fbb2f8345513e69afa232 100644 (file)
@@ -94,21 +94,25 @@ static void __init mpc85xx_mds_setup_arch(void)
 #endif
 
 #ifdef CONFIG_QUICC_ENGINE
-       if ((np = of_find_node_by_name(NULL, "qe")) != NULL) {
-               qe_reset();
-               of_node_put(np);
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+       if (!np) {
+               np = of_find_node_by_name(NULL, "qe");
+               if (!np)
+                       return;
        }
 
-       if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
-               struct device_node *ucc = NULL;
+       qe_reset();
+       of_node_put(np);
+
+       np = of_find_node_by_name(NULL, "par_io");
+       if (np) {
+               struct device_node *ucc;
 
                par_io_init(np);
                of_node_put(np);
 
-               for ( ;(ucc = of_find_node_by_name(ucc, "ucc")) != NULL;)
+               for_each_node_by_name(ucc, "ucc")
                        par_io_of_config(ucc);
-
-               of_node_put(ucc);
        }
 
        if (bcsr_regs) {
@@ -131,7 +135,6 @@ static void __init mpc85xx_mds_setup_arch(void)
 
                iounmap(bcsr_regs);
        }
-
 #endif /* CONFIG_QUICC_ENGINE */
 }
 
@@ -139,6 +142,7 @@ static struct of_device_id mpc85xx_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
+       { .compatible = "fsl,qe", },
        {},
 };
 
@@ -176,10 +180,12 @@ static void __init mpc85xx_mds_pic_init(void)
        mpic_init(mpic);
 
 #ifdef CONFIG_QUICC_ENGINE
-       np = of_find_node_by_type(NULL, "qeic");
-       if (!np)
-               return;
-
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+       if (!np) {
+               np = of_find_node_by_type(NULL, "qeic");
+               if (!np)
+                       return;
+       }
        qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL);
        of_node_put(np);
 #endif                         /* CONFIG_QUICC_ENGINE */
index f2c0988a03b8f0fc9789527bd4d6df3a491e5979..26f7d83c4be548c9e379f87d75f528468c0c93dc 100644 (file)
@@ -1276,7 +1276,10 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
        const u32 *sysclk;
 
        /* SPI controller is either clocked from QE or SoC clock */
-       np = of_find_node_by_type(NULL, "qe");
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+       if (!np)
+               np = of_find_node_by_type(NULL, "qe");
+
        if (!np)
                np = of_find_node_by_type(NULL, "soc");
 
index 3925eae9b0f579a4cfd7496af8af14339c9d7369..5ef844da9355c15bcde600ab0121b4e45619f49e 100644 (file)
@@ -65,17 +65,22 @@ static phys_addr_t qebase = -1;
 phys_addr_t get_qe_base(void)
 {
        struct device_node *qe;
+       unsigned int size;
+       const void *prop;
 
        if (qebase != -1)
                return qebase;
 
-       qe = of_find_node_by_type(NULL, "qe");
-       if (qe) {
-               unsigned int size;
-               const void *prop = of_get_property(qe, "reg", &size);
-               qebase = of_translate_address(qe, prop);
-               of_node_put(qe);
-       };
+       qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
+       if (!qe) {
+               qe = of_find_node_by_type(NULL, "qe");
+               if (!qe)
+                       return qebase;
+       }
+
+       prop = of_get_property(qe, "reg", &size);
+       qebase = of_translate_address(qe, prop);
+       of_node_put(qe);
 
        return qebase;
 }
@@ -153,16 +158,26 @@ static unsigned int brg_clk = 0;
 unsigned int get_brg_clk(void)
 {
        struct device_node *qe;
+       unsigned int size;
+       const u32 *prop;
+
        if (brg_clk)
                return brg_clk;
 
-       qe = of_find_node_by_type(NULL, "qe");
-       if (qe) {
-               unsigned int size;
-               const u32 *prop = of_get_property(qe, "brg-frequency", &size);
-               brg_clk = *prop;
-               of_node_put(qe);
-       };
+       qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
+       if (!qe) {
+               qe = of_find_node_by_type(NULL, "qe");
+               if (!qe)
+                       return brg_clk;
+       }
+
+       prop = of_get_property(qe, "brg-frequency", &size);
+       if (!prop || size != sizeof(*prop))
+               return brg_clk;
+
+       brg_clk = *prop;
+       of_node_put(qe);
+
        return brg_clk;
 }
 
@@ -322,7 +337,7 @@ static rh_info_t qe_muram_info;
 static void qe_muram_init(void)
 {
        struct device_node *np;
-       u32 address;
+       const u32 *address;
        u64 size;
        unsigned int flags;
 
@@ -335,11 +350,21 @@ static void qe_muram_init(void)
        /* XXX: This is a subset of the available muram. It
         * varies with the processor and the microcode patches activated.
         */
-       if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) {
-               address = *of_get_address(np, 0, &size, &flags);
-               of_node_put(np);
-               rh_attach_region(&qe_muram_info, address, (int) size);
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe-muram-data");
+       if (!np) {
+               np = of_find_node_by_name(NULL, "data-only");
+               if (!np) {
+                       WARN_ON(1);
+                       return;
+               }
        }
+
+       address = of_get_address(np, 0, &size, &flags);
+       WARN_ON(!address);
+
+       of_node_put(np);
+       if (address)
+               rh_attach_region(&qe_muram_info, *address, (int)size);
 }
 
 /* This function returns an index into the MURAM area.