Hi Heiko

I'm struggling somewhat with getting our mpc8309-derived board converted
to DM_ETH. I just get

Net:   No ethernet found.

where I used to get

Net:   UEC0, UEC1, UEC2

and there's no errors or other diagnostics printed (I've also tried
adding #define DEBUG 1 to the .c files under drivers/net/qe/, still
nothing).

The board already used OF_CONTROL, so I've tried extending the
device-tree based partly on you changes for the km boards, partly from
our linux device tree - the two mostly agree:

@@ -25,6 +25,8 @@
                i2c0 = &i2c0;
                i2c1 = &i2c1;
                spi0 = &spi0;
+               ethernet0 = &enet0;
+               ethernet2 = &enet2;
        };

        chosen {
@@ -315,6 +317,95 @@
                        clocks = <&clocks MPC83XX_CLK_SDHC>;
                        clock-names = "per";
                };
+
+               ipic: pic@700 {
+                       compatible = "fsl,ipic";
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       #interrupt-cells = <2>;
+                       reg = <0x700 0x100>;
+                       device_type = "ipic";
+               };
        };
-};

+       qe: qe@e0100000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               device_type = "qe";
+               compatible = "fsl,qe";
+               ranges = <0x0 0xe0100000 0x00100000>;
+               reg = <0xe0100000 0x480>;
+               brg-frequency = <0>;
+               bus-frequency = <396000000>;
+
+               muram@10000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "fsl,qe-muram", "fsl,cpm-muram";
+                       ranges = <0x0 0x00010000 0x00004000>;
+
+                       data-only@0 {
+                               compatible = "fsl,qe-muram-data",
+                                            "fsl,cpm-muram-data";
+                               reg = <0x0 0x4000>;
+                       };
+               };
+
+               qeic: interrupt-controller@80 {
+                       interrupt-controller;
+                       compatible = "fsl,qe-ic";
+                       #address-cells = <0>;
+                       #interrupt-cells = <1>;
+                       reg = <0x80 0x80>;
+                       big-endian;
+                       interrupts = <32 8 33 8>;
+                       interrupt-parent = <&ipic>;
+               };
+
+               enet0: ethernet@2000 {
+                       device_type = "network";
+                       compatible = "ucc_geth";
+                       cell-index = <1>;
+                       reg = <0x2000 0x200>;
+                       interrupts = <32>;
+                       interrupt-parent = <&qeic>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       rx-clock-name = "clk9";
+                       tx-clock-name = "clk10";
+                       fixed-link = <1 1 100 0 0>;
+               };
+
+               enet2: ethernet@2200 {
+                       device_type = "network";
+                       compatible = "ucc_geth";
+                       cell-index = <3>;
+                       reg = <0x2200 0x200>;
+                       interrupts = <34>;
+                       interrupt-parent = <&qeic>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       rx-clock-name = "clk11";
+                       tx-clock-name = "clk12";
+                       phy-handle = <&phy1>;
+                       phy-connection-type = "mii";
+               };
+
+               mdio0: mdio@2120 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x2120 0x18>;
+                       compatible = "fsl,ucc-mdio";
+
+                       phy0: ethernet-phy@00 {
+                               reg = <0x01>;
+                               device_type = "ethernet-phy";
+                       };
+                       phy1: ethernet-phy@01 {
+                               reg = <0x02>;
+                               device_type = "ethernet-phy";
+                       };
+               };
+
+
+       };
+
+};

The defconfig is updated with

 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_PHYLIB=y
 CONFIG_PHY_MARVELL=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
+CONFIG_DM_ETH_PHY=y
 CONFIG_MII=y
+CONFIG_QE_UEC=y

and finally I've removed the UEC_ETH definitions from the board config
header:

-/*
- * Ethernet setup
- */
-
-/* enable uec ethernet */
-#define CONFIG_UEC_ETH
-
-/* eth1 */
-#define CONFIG_UEC_ETH1
-#define CONFIG_SYS_UEC1_UCC_NUM                0
-#define CONFIG_SYS_UEC1_RX_CLK         QE_CLK9
-#define CONFIG_SYS_UEC1_TX_CLK         QE_CLK10
-#define CONFIG_SYS_UEC1_ETH_TYPE       FAST_ETH
-#define CONFIG_SYS_UEC1_PHY_ADDR       0x11
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
-#define CONFIG_SYS_UEC1_INTERFACE_SPEED        100
-
-/* eth2 */
-#define CONFIG_UEC_ETH2
-#define CONFIG_SYS_UEC2_UCC_NUM                1
-#define CONFIG_SYS_UEC2_RX_CLK         QE_CLK7
-#define CONFIG_SYS_UEC2_TX_CLK         QE_CLK8
-#define CONFIG_SYS_UEC2_ETH_TYPE       FAST_ETH
-#define CONFIG_SYS_UEC2_PHY_ADDR       0x13
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
-#define CONFIG_SYS_UEC2_INTERFACE_SPEED        100
-
-/* eth3 */
-#define CONFIG_UEC_ETH3
-#define CONFIG_SYS_UEC3_UCC_NUM                2
-#define CONFIG_SYS_UEC3_RX_CLK         QE_CLK11
-#define CONFIG_SYS_UEC3_TX_CLK         QE_CLK12
-#define CONFIG_SYS_UEC3_ETH_TYPE       FAST_ETH
-#define CONFIG_SYS_UEC3_PHY_ADDR       0x12
-#define CONFIG_SYS_UEC3_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
-#define CONFIG_SYS_UEC3_INTERFACE_SPEED        100
-

I only define two ethernet devices in DT above - the third (middle one)
is used for ethercat and irrelevant in U-Boot.

I have not set CONFIG_PINCTRL{,_QE} since our qe_iop_conf_tab is just

const qe_iop_conf_t qe_iop_conf_tab[] = {
       {0,  0, 0, 0, QE_IOP_TAB_END}, /* END of table */
};

so config_qe_ioports() should be a no-op.

Can you see something obviously wrong with the above, and/or do you have
some hints as for what I can do to figure out why the drivers apparently
do not pick up the devices from DT? 'dm drivers' does list

ucc_geth                  033 eth                  <none>
qe_uec_mdio               051 mdio                 <none>

Thanks,
Rasmus

Reply via email to