From owner-p4-projects@FreeBSD.ORG Thu May 4 20:41:10 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2D4F016A404; Thu, 4 May 2006 20:41:10 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D69616A403 for ; Thu, 4 May 2006 20:41:10 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD8AB43D48 for ; Thu, 4 May 2006 20:41:09 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k44Kf9UG092478 for ; Thu, 4 May 2006 20:41:09 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k44Kf9M7092472 for perforce@freebsd.org; Thu, 4 May 2006 20:41:09 GMT (envelope-from imp@freebsd.org) Date: Thu, 4 May 2006 20:41:09 GMT Message-Id: <200605042041.k44Kf9M7092472@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 96670 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2006 20:41:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=96670 Change 96670 by imp@imp_hammer on 2006/05/04 20:40:52 support RMII, minor optimizations to save 32 bytes Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#12 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#12 (text+ko) ==== @@ -406,7 +406,13 @@ pEmac->EMAC_CTL = 0; - if(!(pEmac->EMAC_SR & AT91C_EMAC_LINK)) + pEmac->EMAC_CFG = (pEmac->EMAC_CFG & ~(AT91C_EMAC_CLK)) | + AT91C_EMAC_CLK_HCLK_32 | AT91C_EMAC_CAF +#ifdef BOOT_TSC + | AT91C_EMAC_RMII +#endif + ; + if (!(pEmac->EMAC_SR & AT91C_EMAC_LINK)) MII_GetLinkSpeed(pEmac); // the sequence write EMAC_SA1L and write EMAC_SA1H must be respected @@ -415,10 +421,7 @@ pEmac->EMAC_RBQP = (unsigned) p_rxBD; pEmac->EMAC_RSR |= (AT91C_EMAC_OVR | AT91C_EMAC_REC | AT91C_EMAC_BNA); - pEmac->EMAC_CFG |= AT91C_EMAC_CAF; - pEmac->EMAC_CFG = (pEmac->EMAC_CFG & ~(AT91C_EMAC_CLK)) | - AT91C_EMAC_CLK_HCLK_32; - pEmac->EMAC_CTL |= (AT91C_EMAC_TE | AT91C_EMAC_RE); + pEmac->EMAC_CTL = AT91C_EMAC_TE | AT91C_EMAC_RE; pEmac->EMAC_TAR = (unsigned)transmitBuffer; } @@ -544,6 +547,7 @@ AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 | AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC | AT91C_PA7_ETXCK_EREFCK; +#ifdef BOOT_MB920X /* Really !RMII */ AT91C_BASE_PIOB->PIO_BSR = AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER | AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV | @@ -552,6 +556,7 @@ AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER | AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV | AT91C_PB18_ECOL | AT91C_PB19_ERXCK; +#endif MAC_init = 1; }