change log for rtems (2011-02-25)
rtems-vc at rtems.org
rtems-vc at rtems.org
Fri Feb 25 14:11:01 UTC 2011
*sh*:
2011-02-25 Sebastian Huber <sebastian.huber at embedded-brains.de>
* mpc83xx/network/tsec.c: New default MAC configuration. Set MDIO
clock according to actual CCB frequency. Print media info only if we
have a PHY. Avoid infinite loop in media adaption.
M 1.380 c/src/lib/libcpu/powerpc/ChangeLog
M 1.12 c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c
diff -u rtems/c/src/lib/libcpu/powerpc/ChangeLog:1.379 rtems/c/src/lib/libcpu/powerpc/ChangeLog:1.380
--- rtems/c/src/lib/libcpu/powerpc/ChangeLog:1.379 Thu Feb 17 05:19:42 2011
+++ rtems/c/src/lib/libcpu/powerpc/ChangeLog Fri Feb 25 07:34:41 2011
@@ -1,3 +1,9 @@
+2011-02-25 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * mpc83xx/network/tsec.c: New default MAC configuration. Set MDIO
+ clock according to actual CCB frequency. Print media info only if we
+ have a PHY. Avoid infinite loop in media adaption.
+
2011-02-17 Sebastian Huber <sebastian.huber at embedded-brains.de>
* new-exceptions/bspsupport/vectors.h: Added defines PPC_EXC_GPR_TYPE,
diff -u rtems/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c:1.11 rtems/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c:1.12
--- rtems/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c:1.11 Fri Jan 14 04:48:56 2011
+++ rtems/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c Fri Feb 25 07:34:41 2011
@@ -279,6 +279,7 @@
* init MACCFG2 register
*/
reg_ptr->maccfg2 = ((reg_ptr->maccfg2 & TSEC_MACCFG2_IFMODE_MSK)
+ | TSEC_MACCFG2_IFMODE_BYT
| TSEC_MACCFG2_PRELEN( 7)
| TSEC_MACCFG2_FULLDUPLEX);
@@ -330,13 +331,21 @@
| <none> |
\*=========================================================================*/
{
+ static const uint8_t divider [] = { 64, 64, 96, 128, 160, 224, 320, 448 };
+ size_t n = sizeof(divider) / sizeof(divider [0]);
+ size_t i = 0;
+ uint32_t clock = UINT32_MAX;
/* Set TSEC registers for MDIO communication */
/*
* set clock divider
*/
- sc->mdio_ptr->miimcfg = 3;
+ for (i = 0; i < n && clock > 2500000; ++i) {
+ clock = BSP_bus_frequency / divider [i];
+ }
+
+ sc->mdio_ptr->miimcfg = i;
}
/*=========================================================================*\
@@ -1557,19 +1566,23 @@
| <none> |
\*=========================================================================*/
{
- int media;
- int result;
- /*
- * fetch/print media info
- */
- media = IFM_MAKEWORD(0,0,0,sc->phy_default); /* fetch from default phy */
-
- result = tsec_ioctl(&(sc->arpcom.ac_if),
- SIOCGIFMEDIA,
- (caddr_t)&media);
- if (result == 0) {
- rtems_ifmedia2str(media,NULL,0);
- printf ("\n");
+ if (sc->phy_default >= 0) {
+ int media;
+ int result;
+ /*
+ * fetch/print media info
+ */
+ media = IFM_MAKEWORD(0,0,0,sc->phy_default); /* fetch from default phy */
+
+ result = tsec_ioctl(&(sc->arpcom.ac_if),
+ SIOCGIFMEDIA,
+ (caddr_t)&media);
+ if (result == 0) {
+ rtems_ifmedia2str(media,NULL,0);
+ printf ("\n");
+ } else {
+ printf ("PHY communication error\n");
+ }
}
#if 0 /* print all PHY registers */
{
@@ -1740,15 +1753,13 @@
return result;
}
/*
- * wait for auto-negotiation to terminate
+ * check auto-negotiation status
*/
- do {
- media = IFM_MAKEWORD(0,0,0,sc->phy_default);
- result = tsec_ioctl(ifp,SIOCGIFMEDIA,(caddr_t)&media);
- if (result != 0) {
- return result;
- }
- } while (IFM_NONE == IFM_SUBTYPE(media));
+ media = IFM_MAKEWORD(0,0,0,sc->phy_default);
+ result = tsec_ioctl(ifp,SIOCGIFMEDIA,(caddr_t)&media);
+ if (result != 0 || IFM_NONE == IFM_SUBTYPE(media)) {
+ return result;
+ }
}
/*
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110225/5a8cd836/attachment-0001.html>
More information about the vc
mailing list