RFC: replace device_type with new "class" property?

Yoder Stuart-B08248 stuart.yoder at freescale.com
Tue Oct 30 06:34:40 EST 2007


Here's an example of what I'm trying to get at-- take 
a node from a FSL device tree.  The ideas I've heard
for expressing the class are like this--

#1  don't express any class at all:

  ucc at 2200 {
        compatible = "fsl,ucc_geth";
        model = "UCC";
        device-id = <3>;
        reg = <2200 200>;
        interrupts = <22>;
        interrupt-parent = < &qeic >;
        mac-address = [ 00 00 00 00 00 00 ];
        local-mac-address = [ 00 00 00 00 00 00 ];
        rx-clock = <19>;
        tx-clock = <1a>;
        phy-handle = < &phy3 >;
        pio-handle = < &pio3 >;
  

  > This is bad IMHO because the human reader has to
  > infer the class of device.  Can the human reader
  > tell if it implements a standardized binding or
  > not??

#2 use device_type

  ucc at 2200 {
        device_type = "network";
        compatible = "fsl,ucc_geth";
        model = "UCC";
        device-id = <3>;
        reg = <2200 200>;
        interrupts = <22>;
        interrupt-parent = < &qeic >;
        mac-address = [ 00 00 00 00 00 00 ];
        local-mac-address = [ 00 00 00 00 00 00 ];
        rx-clock = <19>;
        tx-clock = <1a>;
        phy-handle = < &phy3 >;
        pio-handle = < &pio3 >;
  };

  > This is better...I can tell it implments the network
  > binding.   The problem is the past abuse and OF
  > connotations.

#3 use a new "class" property

  ucc at 2200 {
        class = "network";
        compatible = "fsl,ucc_geth";
        model = "UCC";
        device-id = <3>;
        reg = <2200 200>;
        interrupts = <22>;
        interrupt-parent = < &qeic >;
        mac-address = [ 00 00 00 00 00 00 ];
        local-mac-address = [ 00 00 00 00 00 00 ];
        rx-clock = <19>;
        tx-clock = <1a>;
        phy-handle = < &phy3 >;
        pio-handle = < &pio3 >;
  };

  > This is good...I can tell it implments the "network"
  > binding.   There is no association with the abused
  > OF device_type.

#4 use "compatible"

  ucc at 2200 {
        compatible = "fsl,ucc_geth","[official spec],network";
        model = "UCC";
        device-id = <3>;
        reg = <2200 200>;
        interrupts = <22>;
        interrupt-parent = < &qeic >;
        mac-address = [ 00 00 00 00 00 00 ];
        local-mac-address = [ 00 00 00 00 00 00 ];
        rx-clock = <19>;
        tx-clock = <1a>;
        phy-handle = < &phy3 >;
        pio-handle = < &pio3 >;
  };

  > I don't like this...we are overloading "compatible" with
  > stuff that is not specifying a programming interface.  compatible
  > is supposed to be specifying a programming interface which
  > the device complies to.


Stuart



More information about the Linuxppc-dev mailing list