Part Number: TDA2SX
Dear TI,
I am working with our TDA2SX custom board, the vision sdk revision i used is 3.6 and the related bsp release.
I need two emac port work simultaneously. I want to know how does the kernel get mac address as the mac-address defined in the dts file are all null.
I get a problem that the eth0 and eth1 have the same mac address returned by ifconfig.
For debug i add some printk in the kernel source cpsw.c as:
This is what i get when kernel boot:
Q1:
We can see that eth slave 0 get the valid address "a8:e2:c1:db:c8:7b" from the dtb file by property name "mac-address".
While the mac_address was not assigned in my dts file, when it was inserted in the dtb?
Q2:
The eth slave 1 failed to get a valid mac address from all the three possible properties. But it get a totally same address by call the function ti_cm_get_macid() instead.
I think i have missed some configuration that lead to the slave 1 failed to get a different address from by the "mac-address" ? Is that right?
If yes, what shoud i do to make slave 1 get the right mac-address from the register as slave 0?
This is the emac related nodes decompiled from my dtb file:
ethernet@48484000 {
compatible = "ti,dra7-cpsw", "ti,cpsw";
ti,hwmods = "gmac";
clocks = <0x11c 0x11d>;
clock-names = "fck", "cpts";
cpdma_channels = <0x8>;
ale_entries = <0x400>;
bd_ram_size = <0x2000>;
mac_control = <0x20>;
slaves = <0x2>;
active_slave = <0x0>;
cpts_clock_mult = <0x784cfe14>;
cpts_clock_shift = <0x1d>;
reg = <0x48484000 0x1000 0x48485200 0x2e00>;
#address-cells = <0x1>;
#size-cells = <0x1>;
ti,no-idle;
interrupts = <0x0 0x14e 0x4 0x0 0x14f 0x4 0x0 0x150 0x4 0x0 0x151 0x4>;
ranges;
syscon = <0x8>;
status = "okay";
dual_emac;
mdio@48485000 {
compatible = "ti,cpsw-mdio";
#address-cells = <0x1>;
#size-cells = <0x0>;
ti,hwmods = "davinci_mdio";
bus_freq = <0xf4240>;
reg = <0x48485000 0x100>;
linux,phandle = <0x11e>;
phandle = <0x11e>;
};
slave@48480200 {
mac-address = [02 00 00 00 10 39];
phy-mode = "rmii";
dual_emac_res_vlan = <0x1>;
local-mac-address = [02 00 00 00 10 39];
fixed-link {
speed = <0x64>;
full-duplex;
};
};
slave@48480300 {
mac-address = [00 00 00 00 00 00];
phy_id = <0x11e 0x1>;
phy-mode = "mii";
dual_emac_res_vlan = <0x2>;
};
cpsw-phy-sel@4a002554 {
compatible = "ti,dra7xx-cpsw-phy-sel";
reg = <0x4a002554 0x4>;
reg-names = "gmii-sel";
};
};
Regards,
Liu Gan


