Correct thing would be to initalize the values better in ifxmips_mii_chip_init, so that filtering is not on, or to change filter in set_mac?
The first way should be easy. Maybe quickest work-around is turn off that filter ? #define ENETS_CFG ((u32 *)(IFXMIPS_PPE32_MEM_MAP + 0x1850)) at end of ifxmips_mii_chip_init: ifxmips_w32(ifxmips_r32(ENETS_CFG) & ~(1<<28), ENETS_CFG); Better way would to know the hardware and the default value for this register... R, Scott On Thu, Nov 4, 2010 at 7:25 PM, Luca Olivetti <[email protected]> wrote: > Al 04/11/10 23:04, En/na Jonas Gorski ha escrit: >> >> On 4 November 2010 19:44, Luca Olivetti<[email protected]> wrote: >>> >>> It turns out that the mac was different than the one set in u-boot. >>> For some reason the switch doesn't accept a different mac than the >>> initial >>> one (though in u-boot I can change the mac at will, once it boots linux >>> it >>> has to be the same mac). >>> Is this a "feature" of the ar8216, a bug or an error on my part? >> >> This sounds more like the ethernet mac uses a different mac than linux >> thinks it does, so the outgoing frames have the "wrong" linux source >> address and the replies get silently dropped (assuming the ethernet >> mac has a non-promiscuous mode or something like that). > > Ah, I think I know what happens. Most probably the default for the ethernet > port in the danube chip is to not do any mac filtering, but during > initialization u-boot sets the mac address *and* sets the mac filtering > (from ifx_etop.c, ENET_MAC_DA0, ENET_MAC_DA1 and ENETS_CFG appears to be > registers of the danube chip): > > static int lq_eth_init(struct eth_device *dev, bd_t * bis) > { > int i; > uchar *enetaddr = dev->enetaddr; > > debug("lq_eth_init %x:%x:%x:%x:%x:%x\n", > enetaddr[0], enetaddr[1], enetaddr[2], enetaddr[3], > enetaddr[4], enetaddr[5]); > > *ENET_MAC_DA0 = (enetaddr[0]<<24) + (enetaddr[1]<<16) + > (enetaddr[2]<< 8) + enetaddr[3]; > *ENET_MAC_DA1 = (enetaddr[4]<<24) + (enetaddr[5]<<16); > *ENETS_CFG |= 1<<28; /* enable filter for unicast packets */ > > > but in the linux driver .ndo_set_mac_address = eth_mac_addr, so changing the > mac in linux does nothing to the chip, hence the filtering with the mac set > in u-boot takes place. > If u-boot doesn't touch the network, the linux driver will work regardless > of the mac because there's no hardware filtering. > > Unfortunately I don't know how to modify the driver to do the right thing. > > Bye > -- > Luca > _______________________________________________ > openwrt-devel mailing list > [email protected] > https://lists.openwrt.org/mailman/listinfo/openwrt-devel > _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
