2013.01.06. 23:10 keltezéssel, Michel Stempin írta:

<...>
>>> But it looks like the default for id 0 in ath79_register_eth(id) is to set 
>>> bit 4 in mask, which is wrong if we swap PHY 0 and 4, is it?
>>
>> Erm, the 'false, false' in the phy4_switch call above ensures that we don't 
>> swap
>> the phy address. It was 'false, true' in the original patch.
> 
> Oh, yes, so BIT(0) is only required if 'false, true' is used, all right!

Yes.

<...>

>> First of all, the built-in switch has no MAC5 interface, the datasheet is 
>> simply
>> wrong about that IMHO.
> 
> An MII (or GMII) interface connects a MAC to a PHY or a MAC to a MAC in
> Reversed MII configuration, so actually, I think there is a MAC indeed on the
> CPU side of GE0, which I guess they called MAC5, and I bet for MAC6 for the 
> one
> on the CPU side of GE1... But I agree that the datasheet is not clear about 
> it,
> and it is not mentioned anywhere else.

The SoC has two ethernet MACs which are GE0 and GE1 (aka. GMAC0 and GMAC1), and
the built-in switch has five MACs.

<...>

>> The original patch clears the PHY_SWAP bit and sets the PHY_ADDR_SWAP bit. So
>> MAC1 of the siwtch will be connected to PHY0 and GE0 will be connected to 
>> PHY4.
>> Because the PHY_ADDR_SWAP bit is still set, the PHY4 of the switch uses phy
>> address 0 and that is the reason why you had to change the default phy_mask 
>> as
>> well. The connection type of GE0 and GE1 interfaces are not changed by the 
>> patch.
> 
> So basically if I understand you correctly, both configs with:
>  - PHY_SWAP=false, PHY_ADDR_SWAP=true, phy_mask=BIT(0) on one hand and
>  - PHY_SWAP=false, PHY_ADDR_SWAP=false, phy_mask=BIT(4) (default) on the 
> other hand
> are equivalent?

Yes. At least on devices which has only one ethernet port connected to GE0.

> Then what do you suggest:
>  - apply the more complex TL-MR3020/TL-MR3040/TL-MR11U existing patch to 
> TL-WR703N for consistency as I originally proposed
>  - apply your simpler solution to all
>  - or just apply your solution to TL-WR703N only and not being consistent 
> with others?

I have applied the simpler solution to all boards.

> Anyway, thank you for these explanations!

You are welcome!

-Gabor
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to