[OpenWrt-Devel] [PATCH] ar71xx: add support for EnGenius ESR1750

Jon Suphammer (林書詠) jon at suphammer.net
Wed Jul 2 04:54:04 EDT 2014


Answers inline.

On Tue, Jul 1, 2014 at 3:16 PM, John Crispin <john at phrozen.org> wrote:
> On 01/07/2014 13:44, Jon Suphammer wrote:
>> "0t 1" +      part=$(find_mtd_part u-boot-env) +      mac=$(strings $part |
>> sed -n 's/^'"ethaddr"'=//p' |sed 's/\"//g') +
>> mac_lan=$(macaddr_canonicalize $mac) +        [ -n "$mac_lan" ] &&
>> ucidef_set_interface_macaddr "lan" "$mac_lan" +
>> mac_wan=$(mtd_get_mac_ascii u-boot-env wanaddr) +     [ -n "$mac_wan" ]
>> && ucidef_set_interface_macaddr "wan" "$mac_wan" +
>> mac_wifi2=$(macaddr_add $mac_lan 1) + ;; +
>
> package/kernel/uboot-env/ can solve this problem for you i believe
The reason for doing it this was is that macaddr_canonicalize will see
LAN mac address as invalid as the string includes quotation marks
which makes the string greater than 17 chars.

A more correct fix for this would be to strip quotation marks in
macaddr_canonicalize. By doing this we can use mtd_get_mac_ascii to
retrieve LAN mac address as we do for WAN mac address.

I suggest we add: mac=$(echo ${mac} | sed 's/\"//g') at top of
macaddr_canonicalize function. I can send a separate patch for this if
you prefer this approach.


>> + +static void __init esr1750_gmac_setup(void) +{ +   void __iomem
>> *base; +      u32 t; + +      base = ioremap(QCA955X_GMAC_BASE,
>> QCA955X_GMAC_SIZE); + +       t = __raw_readl(base +
>> QCA955X_GMAC_REG_ETH_CFG); + +        t &= ~(QCA955X_ETH_CFG_RGMII_EN |
>> QCA955X_ETH_CFG_GE0_SGMII); + t |= QCA955X_ETH_CFG_RGMII_EN; + +
>> __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); + +
>> iounmap(base); +} +
>
> this function looks wrong. are you sure this cannot be fixed with
> existing code ?
There is currently no ath79_setup_qca955x_eth_cfg function. However I
have made this function in dev_eth now, so I can submit this as a
separate patch. Is this ok ?

If the above solutions is acceptable, I will resubmit this patch once
the two above mentioned patches is accepted.

-- 
Best regards,
Jon
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list