<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-02-25)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-02-25 Sebastian Huber <sebastian.huber@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.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libcpu/powerpc/ChangeLog.diff?r1=text&tr1=1.379&r2=text&tr2=1.380&diff_format=h">M</a></td><td width='1%'>1.380</td><td width='100%'>c/src/lib/libcpu/powerpc/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c.diff?r1=text&tr1=1.11&r2=text&tr2=1.12&diff_format=h">M</a></td><td width='1%'>1.12</td><td width='100%'>c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c</td></tr>
</table>
<pre>
<font color='#006600'>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
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-02-25 Sebastian Huber <sebastian.huber@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.
+
</font> 2011-02-17 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/vectors.h: Added defines PPC_EXC_GPR_TYPE,
<font color='#006600'>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
</font><font color='#997700'>@@ -279,6 +279,7 @@
</font> * init MACCFG2 register
*/
reg_ptr->maccfg2 = ((reg_ptr->maccfg2 & TSEC_MACCFG2_IFMODE_MSK)
<font color='#000088'>+ | TSEC_MACCFG2_IFMODE_BYT
</font> | TSEC_MACCFG2_PRELEN( 7)
| TSEC_MACCFG2_FULLDUPLEX);
<font color='#997700'>@@ -330,13 +331,21 @@
</font> | <none> |
\*=========================================================================*/
{
<font color='#000088'>+ 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;
</font>
/* Set TSEC registers for MDIO communication */
/*
* set clock divider
*/
<font color='#880000'>- sc->mdio_ptr->miimcfg = 3;
</font><font color='#000088'>+ for (i = 0; i < n && clock > 2500000; ++i) {
+ clock = BSP_bus_frequency / divider [i];
+ }
+
+ sc->mdio_ptr->miimcfg = i;
</font> }
/*=========================================================================*\
<font color='#997700'>@@ -1557,19 +1566,23 @@
</font> | <none> |
\*=========================================================================*/
{
<font color='#880000'>- 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");
</font><font color='#000088'>+ 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 */
+<span style="background-color: #FF0000"> </span>
+ result = tsec_ioctl(&(sc->arpcom.ac_if),
+<span style="background-color: #FF0000"> </span> SIOCGIFMEDIA,
+<span style="background-color: #FF0000"> </span> (caddr_t)&media);
+ if (result == 0) {
+ rtems_ifmedia2str(media,NULL,0);
+ printf ("\n");
+ } else {
+ printf ("PHY communication error\n");
+ }
</font> }
#if 0 /* print all PHY registers */
{
<font color='#997700'>@@ -1740,15 +1753,13 @@
</font> return result;
}
/*
<font color='#880000'>- * wait for auto-negotiation to terminate
</font><font color='#000088'>+ * check auto-negotiation status
</font> */
<font color='#880000'>- 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));
</font><font color='#000088'>+ 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;
+ }
</font> }
/*
</pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>