[POWERPC] QE: UCC nodes cleanup
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Fri, 11 Apr 2008 16:06:54 +0000 (20:06 +0400)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 17 Apr 2008 06:01:38 +0000 (01:01 -0500)
- get rid of `model = "UCC"' in the ucc nodes
  It isn't used anywhere, so remove it. If we'll ever need something
  like this, we'll use compatible property instead.
- replace last occurrences of device-id with cell-index.
  Drivers are modified for backward compatibility's sake.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Timur Tabi <timur@freescale.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
drivers/net/ucc_geth.c
drivers/net/ucc_geth_mii.c
drivers/serial/ucc_uart.c

index 528b4822f451adfcd91c36e578492f21e2663ea7..4cc780024e6c81b02cb3ccc6720655da85e33064 100644 (file)
@@ -1645,8 +1645,7 @@ platforms are moved over to use the flattened-device-tree model.
    - device_type : should be "network", "hldc", "uart", "transparent"
      "bisync", "atm", or "serial".
    - compatible : could be "ucc_geth" or "fsl_atm" and so on.
-   - model : should be "UCC".
-   - device-id : the ucc number(1-8), corresponding to UCCx in UM.
+   - cell-index : the ucc number(1-8), corresponding to UCCx in UM.
    - reg : Offset and length of the register set for the device
    - interrupts : <a b> where a is the interrupt number and b is a
      field that represents an encoding of the sense and level
@@ -1699,8 +1698,7 @@ platforms are moved over to use the flattened-device-tree model.
        ucc@2000 {
                device_type = "network";
                compatible = "ucc_geth";
-               model = "UCC";
-               device-id = <1>;
+               cell-index = <1>;
                reg = <2000 200>;
                interrupts = <a0 0>;
                interrupt-parent = <700>;
index 9bb408371bcd555fd46e4fc0aeb16fc3561db27b..539e02fb35266e12d21bf1327b3e8675ca0d3dfe 100644 (file)
                enet0: ucc@2200 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <3>;
-                       device-id = <3>;
                        reg = <0x2200 0x200>;
                        interrupts = <34>;
                        interrupt-parent = <&qeic>;
                enet1: ucc@3200 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <4>;
-                       device-id = <4>;
                        reg = <0x3200 0x200>;
                        interrupts = <35>;
                        interrupt-parent = <&qeic>;
                ucc@2400 {
                        device_type = "serial";
                        compatible = "ucc_uart";
-                       model = "UCC";
-                       device-id = <5>;        /* The UCC number, 1-7*/
+                       cell-index = <5>;       /* The UCC number, 1-7*/
                        port-number = <0>;      /* Which ttyQEx device */
                        soft-uart;              /* We need Soft-UART */
                        reg = <0x2400 0x200>;
index 94f93d209de82e10660eda645d23d8ba0155aab3..179c81c6a7acb5272866919ada396c4a46990971 100644 (file)
                enet0: ucc@3000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <2>;
-                       device-id = <2>;
                        reg = <0x3000 0x200>;
                        interrupts = <33>;
                        interrupt-parent = <&qeic>;
                enet1: ucc@2200 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <3>;
-                       device-id = <3>;
                        reg = <0x2200 0x200>;
                        interrupts = <34>;
                        interrupt-parent = <&qeic>;
index 55f03e8dc97f3f7f0d0ff7c140b48a9d09ba0217..8160ff24e87ed811f425a068cec1b4f757a081d2 100644 (file)
                enet0: ucc@2000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <1>;
-                       device-id = <1>;
                        reg = <0x2000 0x200>;
                        interrupts = <32>;
                        interrupt-parent = <&qeic>;
                enet1: ucc@3000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <2>;
-                       device-id = <2>;
                        reg = <0x3000 0x200>;
                        interrupts = <33>;
                        interrupt-parent = <&qeic>;
index 97bc048f2158cef52f6f265344df9a976dbb8054..df4b5e89d7e456b94cc2f562d68d7aadeee8e860 100644 (file)
                enet2: ucc@2000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <1>;
-                       device-id = <1>;
                        reg = <2000 200>;
                        interrupts = <20>;
                        interrupt-parent = <&qeic>;
                enet3: ucc@3000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <2>;
-                       device-id = <2>;
                        reg = <3000 200>;
                        interrupts = <21>;
                        interrupt-parent = <&qeic>;
index 8cc316653a397cff04cae39951cf8183333260e8..ed84182c682808f70236fbae94e683740d3b96a1 100644 (file)
@@ -3852,7 +3852,13 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
 
-       prop = of_get_property(np, "device-id", NULL);
+       prop = of_get_property(np, "cell-index", NULL);
+       if (!prop) {
+               prop = of_get_property(np, "device-id", NULL);
+               if (!prop)
+                       return -ENODEV;
+       }
+
        ucc_num = *prop - 1;
        if ((ucc_num < 0) || (ucc_num > 7))
                return -ENODEV;
index c69e654d539fcaae8df42cd7065af9e857c8d292..8a48ddb1e866d9062b0e7c09224546f3ee13fcc9 100644 (file)
@@ -203,9 +203,14 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma
                if ((res.start >= tempres.start) &&
                    (res.end <= tempres.end)) {
                        /* set this UCC to be the MII master */
-                       const u32 *id = of_get_property(tempnp, "device-id", NULL);
-                       if (id == NULL)
-                               goto bus_register_fail;
+                       const u32 *id;
+
+                       id = of_get_property(tempnp, "cell-index", NULL);
+                       if (!id) {
+                               id = of_get_property(tempnp, "device-id", NULL);
+                               if (!id)
+                                       goto bus_register_fail;
+                       }
 
                        ucc_set_qe_mux_mii_mng(*id - 1);
 
index e0994f0610018838310cc43196632c5d24045540..5e4310ccd5914ecc26983a8ad51bc3bd5fd61624 100644 (file)
@@ -1270,10 +1270,18 @@ static int ucc_uart_probe(struct of_device *ofdev,
 
        /* Get the UCC number (device ID) */
        /* UCCs are numbered 1-7 */
-       iprop = of_get_property(np, "device-id", NULL);
-       if (!iprop || (*iprop < 1) || (*iprop > UCC_MAX_NUM)) {
-               dev_err(&ofdev->dev,
-                       "missing or invalid UCC specified in device tree\n");
+       iprop = of_get_property(np, "cell-index", NULL);
+       if (!iprop) {
+               iprop = of_get_property(np, "device-id", NULL);
+               if (!iprop) {
+                       dev_err(&ofdev->dev, "UCC is unspecified in "
+                               "device tree\n");
+                       return -EINVAL;
+               }
+       }
+
+       if ((*iprop < 1) || (*iprop > UCC_MAX_NUM)) {
+               dev_err(&ofdev->dev, "no support for UCC%u\n", *iprop);
                kfree(qe_port);
                return -ENODEV;
        }