]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC: r226995, r227042
authormarius <marius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 6 Nov 2011 21:09:10 +0000 (21:09 +0000)
committermarius <marius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 6 Nov 2011 21:09:10 +0000 (21:09 +0000)
commitc76dfddfd032e8187dcc53e44f23773ebff515e4
tree9a58e0753fe03942c9731d1dc3e12e3522afac2b
parentcf9b8e1cb1f2757226a4354864511fb619d95fb0
MFC: r226995, r227042

- Import the common MII bitbang'ing code from NetBSD and convert drivers to
  take advantage of it instead of duplicating it. This reduces the size of
  the i386 GENERIC kernel by about 8k. The only potential in-tree users left
  unconverted are ed(4) and xe(4). Xe(4) generally should be changed to use
  miibus(4) instead of implementing PHY handling on its own, as otherwise it
  makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to it
  just for the MII bitbang'ing code. Ed(4) has some chip specific things
  interwinded with the MII bitbang'ing code and it's unclear whether it can
  be converted to common code, at least not without thorough testing of all
  the various chips supported by ed(4).
  The common MII bitbang'ing code also is useful in the embedded space for
  using GPIO pins to implement MII access.
- Based on lessons learnt with dc(4) (see r185750), add bus barriers to the
  MII bitbang read and write functions of the other drivers converted in
  order to ensure the intended ordering. Given that register access via an
  index register as well as register bank/window switching is subject to the
  same problem, also add bus barriers to the respective functions of smc(4),
  tl(4) and xl(4).
- Sprinkle some const.

Thanks to the following testers:
Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4))
Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4).

Reviewed by: yongari (subset of drivers)
Approved by: re (kib)
Obtained from: NetBSD (partially)

git-svn-id: svn://svn.freebsd.org/base/stable/9@227277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
28 files changed:
sys/arm/conf/GUMSTIX
sys/conf/NOTES
sys/conf/files
sys/dev/bm/if_bm.c
sys/dev/bm/if_bmreg.h
sys/dev/bm/if_bmvar.h
sys/dev/dc/if_dc.c
sys/dev/dc/if_dcreg.h
sys/dev/mii/mii_bitbang.c [new file with mode: 0644]
sys/dev/mii/mii_bitbang.h [new file with mode: 0644]
sys/dev/nge/if_nge.c
sys/dev/nge/if_ngereg.h
sys/dev/sis/if_sis.c
sys/dev/sis/if_sisreg.h
sys/dev/smc/if_smc.c
sys/dev/ste/if_ste.c
sys/dev/ste/if_stereg.h
sys/dev/stge/if_stge.c
sys/dev/stge/if_stgereg.h
sys/dev/tl/if_tl.c
sys/dev/tl/if_tlreg.h
sys/dev/wb/if_wb.c
sys/dev/wb/if_wbreg.h
sys/dev/xl/if_xl.c
sys/dev/xl/if_xlreg.h
sys/modules/mii/Makefile
sys/pci/if_rl.c
sys/pci/if_rlreg.h