Found some more issues.
4. ethernetif.c enet_init() blocks until a link comes up or it times out (default 0xFFF). That takes quite a while, and seems silly, being that you can boot a board without a cable plugged in. Sure I can override the timeout, but I'm not sure this is sensible for default behaviour.
5. ethernetif.c enet_init() calls ENET_Init() (that seems slightly confusing in itself) with the default enet_config_t (except for linux speed and duplex, if there's a link). So on my custom board I'm using MII mode. There is no way to set MII mode rather than RMII mode. I'll patch ethernetif.c and .h to base this off a define. I may have to do this for some other of the enet_config_t members too.
6. The mac address gets set by a series of defines. I can override this defines. However in general you don't want to use a hardcoded MAC in your source files, since it'd be the same for every board you use. I feel instead a function should be called to get the mac, the user then has to provide this function. Sure I can do this with some defines in lwipopts.h to call functions / read it from an array, but replacing the code in low_level_init() from:
/* set MAC hardware address */
netif->hwaddr[0] = configMAC_ADDR0;
netif->hwaddr[1] = configMAC_ADDR1;
netif->hwaddr[2] = configMAC_ADDR2;
netif->hwaddr[3] = configMAC_ADDR3;
netif->hwaddr[4] = configMAC_ADDR4;
netif->hwaddr[5] = configMAC_ADDR5;
to:
get_mac_addr(netif, netif->hwaddr);
The user can then provide get_mac_addr and look at netif->num or netif->name or netif->state or whatever to work out which interface it is (if there's more than one).
You could also add a "weak" implementation of this function in ethernetif.c that uses the static defines, so that it compiles easier, however I think it's much more obvious to the user that they can set the MAC address and how, when they get a link error for missing symbol get_mac_addr().
Andy