Fix cpsw_detach() to not panic when called from cpsw_attach().

For an unkown reason (at moment), sometimes if_cpsw cannot read from PHY
and fails to attach calling cpsw_detach() which end up in a panic.

Fix it by doing the proper check before detach the miibus and also fix the
leak of few variables.

And to actually make it work, ether_ifattach() has to be moved to the end
of cpsw_attach() to avoid a race where calling ether_ifdetach() before
domain_init() (which will only run later on) would make it crash at
INP_INFO_RLOCK() on in_pcbpurgeif0().

Tested on:	BBB (am335x)
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@273606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a sysctl to control the HPET allow_write behaviour.

Requested by:	kib


git-svn-id: svn+ssh://svn.freebsd.org/base/head@273607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f