Hello,
i have a sitara 4376 and have problems with the devicetree am4372.dtsi. I have 2 Ethernetports (eth0,eth1), where eth0 is directly connected to a marvell-switch and eth1 to a phy. The davinci-MDIO driver is always assuming, that a phy is always directly connected to a eth-port. So this is why I can´t use the davinci-mdio driver, because at eth0 is a marvell-switch.
So I patched my Linux 4.0.5 to add a fake-mdio driver to run the eth-ports. Here is the device-tree part (.dtsi):
mac: ethernet@4a100000 {
compatible = "ti,am4372-cpsw","ti,cpsw";
reg = <0x4a100000 0x800
0x4a101200 0x100>;
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH
GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH
GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH
GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <1>;
ti,hwmods = "cpgmac0";
clocks = <&cpsw_125mhz_gclk>, <&cpsw_cpts_rft_clk>;
clock-names = "fck", "cpts";
status = "disabled";
cpdma_channels = <8>;
ale_entries = <1024>;
bd_ram_size = <0x2000>;
no_bd_ram = <0>;
rx_descs = <64>;
mac_control = <0x20>;
slaves = <1>;
active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
ranges;
emac_arr = <&cpsw_emac1>;
fake_mdio: mdio@4a101000 {
compatible = "generic,fixed_mdio";
reg = <0x4a101000 0x100>;
#address-cells = <1>;
#size-cells = <0>;
// ti,hwmods = "davinci_mdio";
bus_freq = <1000000>;
// status = "disabled";
cpsw_emac1: slave@4a100300 {
compatible = "ethernet-phy-id0141.0cb0",
"ethernet-phy-ieee802.3-c22";
/* Filled in by U-Boot */
speed = <1000>;
full-duplex;
mac-address = [ 00 00 00 00 00 00 ];
reg = <0x00>;
};
};
// cpsw_emac0: slave@4a100200 {
// /* Filled in by U-Boot */
// mac-address = [ 00 00 00 00 00 00 ];
// //fixed-link = <0 1 1000 0 0>;
// //status = "disabled";
// //phy_id=0;
// };
// cpsw_emac1: slave@4a100300 {
// /* Filled in by U-Boot */
// mac-address = [ 00 00 00 00 00 00 ];
// //mii=0x01
// };
phy_sel: cpsw-phy-sel@44e10650 {
compatible = "ti,am43xx-cpsw-phy-sel";
reg= <0x44e10650 0x4>;
reg-names = "gmii-sel";
};
};
but then i get this error code:
0.192924] cpsw 4a100000.ethernet: Random MACID = aa:38:ba:31:ab:75
[ 0.199787]
ss_res->name=/ocp/ethernet@4a100000
[ 166.597483] Unable to handle kernel paging request at virtual address 4a100000
[ 166.605329] pgd = c0004000
[ 166.608232] [4a100000] *pgd=00000000
[ 166.612034] Internal error: Oops: 5 [#1] ARM
[ 166.616551] Modules linked in:
[ 166.619795] CPU: 0 PID: 1 Comm: swapper Not tainted 4.0.5-tim1531 #1
[ 166.626519] Hardware name: Generic AM43 (Flattened Device Tree)
[ 166.632782] task: df458000 ti: df456000 task.ti: df456000
[ 166.638505] PC is at cpsw_probe+0x278/0x87c
[ 166.642943] LR is at rpm_resume+0x7c/0x42c
[ 166.647279] pc : [<c02686b8>] lr : [<c0219784>] psr: 60000153
[ 166.647279] sp : df457d90 ip : 00000000 fp : 00000000
[ 166.659419] r10: df4bd800 r9 : 00000000 r8 : 5ca4a608
[ 166.664942] r7 : df4bd810 r6 : 00000000 r5 : decb4280 r4 : decb4000
[ 166.671847] r3 : 4a100000 r2 : 00000001 r1 : 00000004 r0 : 00000001
[ 166.678757] Flags: nZCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment kernel
[ 166.686583] Control: 10c53c7d Table: 80004059 DAC: 00000015
[ 166.692661] Process swapper (pid: 1, stack limit = 0xdf456208)
[ 166.698830] Stack: (0xdf457d90 to 0xdf458000)
[ 166.876582] [<c02686b8>] (cpsw_probe) from [<c0213fa0>] (platform_drv_probe+0x48/0xa0)
[ 166.884974] [<c0213fa0>] (platform_drv_probe) from [<c0212930>] (really_probe+0xec/0x1ec)
[ 166.893640] [<c0212930>] (really_probe) from [<c0212a78>] (driver_probe_device+0x2c/0x4c)
[ 166.902302] [<c0212a78>] (driver_probe_device) from [<c0212b38>] (__driver_attach+0x60/0x84)
[ 166.911239] [<c0212b38>] (__driver_attach) from [<c02110cc>] (bus_for_each_dev+0x54/0xa0)
[ 166.919896] [<c02110cc>] (bus_for_each_dev) from [<c02125cc>] (driver_attach+0x1c/0x20)
[ 166.928379] [<c02125cc>] (driver_attach) from [<c02120f4>] (bus_add_driver+0xb0/0x1a8)
[ 166.936765] [<c02120f4>] (bus_add_driver) from [<c0212f7c>] (driver_register+0xa8/0xe8)
[ 166.945239] [<c0212f7c>] (driver_register) from [<c0213ef8>] (__platform_driver_register+0x54/0x5c)
[ 166.954834] [<c0213ef8>] (__platform_driver_register) from [<c05fc108>] (cpsw_init+0x14/0x18)
[ 166.963876] [<c05fc108>] (cpsw_init) from [<c00088b8>] (do_one_initcall_debug+0x40/0x8c)
[ 166.972443] [<c00088b8>] (do_one_initcall_debug) from [<c0008958>] (do_one_initcall+0x54/0x134)
[ 166.981663] [<c0008958>] (do_one_initcall) from [<c05e3e38>] (do_initcall_level+0x8c/0xa0)
[ 166.990420] [<c05e3e38>] (do_initcall_level) from [<c05e3e5c>] (do_initcalls+0x10/0x20)
[ 166.998901] [<c05e3e5c>] (do_initcalls) from [<c05e3e8c>] (do_basic_setup+0x20/0x28)
[ 167.007106] [<c05e3e8c>] (do_basic_setup) from [<c05e3ef4>] (kernel_init_freeable+0x54/0xec)
[ 167.016046] [<c05e3ef4>] (kernel_init_freeable) from [<c0436f34>] (kernel_init+0x8/0xf8)
[ 167.024626] [<c0436f34>] (kernel_init) from [<c000e508>] (ret_from_fork+0x14/0x2c)
it looks like the problem is the mac-entry of my device-tree (here the part of my .dts):
&mac {
status = "okay";
dual_emac;
};
&cpsw_emac1 {
phy_id = <&fake_mdio>, <0x00>;
phy-mode = "rgmii";
//phy-mode = "rgmii-txid";
dual_emac_res_vlan = <0>;
};
&phy_sel {
rmii-clock-ext;
};
could somebody help me out with this kind of issue? If there is a question for more detailed information, let me know.
Thanks
R Fritz