[OpenWrt-Devel] [PATCH] [RFC] ath79: ag71xx: apply interface mode to MII0/1_CNTL on ar71xx/ar913x

Mathias Kresin dev at kresin.me
Fri Aug 17 18:06:29 EDT 2018


08/17/2018 09:45 PM, Martin Blumenstingl:
> On Thu, Aug 16, 2018 at 5:06 AM Chuanhong Guo <gch981213 at gmail.com> wrote:
>>
>> Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
>> ---
>> RFC:
>> Previous discussion about this patch can be found on GitHub PR#1271.
>> This patch applies correct interface mode to MII0/1_CNTL register at 0x18070000/
>> 0x18070004. But there is a small difference in values for these two registers:
>> | GMAC0    | GMAC1   |
>> |----------|---------|
>> | 0 GMII   | 0 RGMII |
>> | 1 MII    | 1 RMII  |
>> | 2 RGMII  |         |
>> | 3 RMII   |         |
>> I currently have 4 ways of dealing with this:
>> 1. Use a bool value in dts indicating whether this is the second GMAC. This one
>>     is pretty dirty and I dropped it.
>> 2. Split MII_CNTL into separated dt node and use different compatible for them
>>     like we did for ETH_CFG (gmac node) on ar933x and later SoCs. After some discussion
>>     on GitHub it turns out to be unreasonable to treat those in separated nodes.
>> 3. Use ar7100-eth0/ar7100-eth1 as compatible string. This is what I've done in
>>     this patch I sent here. But I think my way of using compatible string here is ugly :(
>>     A possible cleaner implementation would be introducing ar7100-eth0/ar7100-eth1/
>>     ar9130-eth0/ar9130-eth1 to replace ar7100-eth/ar9130-eth. But I doubt whether
>>     introducing 4 new compatible strings for such a slight difference is worthy.
> I think the naming "ar7100-eth0" / "ar7100-eth1" was my idea
> maybe it's not super intuitive since it reads as if the target
> Ethernet device will be called "eth0" or "eth1" - this is not what I
> meant with this naming.

Yeah, I don't like the naming exactly because for the reason of easy 
misinterpreting.

> I wonder if "ar7100-mii0-eth" /
> "ar7100-mii1-eth" is any better.

This one I like.

> other ideas are highly welcome

Haha, nice try!

Mathias

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list