From owner-svn-src-all@FreeBSD.ORG Tue Aug 25 09:47:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57B6E106568B; Tue, 25 Aug 2009 09:47:13 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46DA38FC15; Tue, 25 Aug 2009 09:47:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7P9lD8t022466; Tue, 25 Aug 2009 09:47:13 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7P9lDpM022463; Tue, 25 Aug 2009 09:47:13 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200908250947.n7P9lDpM022463@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 25 Aug 2009 09:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196534 - in head/sys: conf dev/mge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 09:47:13 -0000 Author: raj Date: Tue Aug 25 09:47:12 2009 New Revision: 196534 URL: http://svn.freebsd.org/changeset/base/196534 Log: Introduce MII_ADDR_BASE option on ARM, which allows to override the default per platform requirements. Notes: - Only used by mge(4) at the moment. - This is very simplified approach and should be replaced by some long-term solution for managing the board/platform configuration (among others the MAC-PHY binding info). Submitted by: Michal Hajduk Obtained from: Semihalf Modified: head/sys/conf/options.arm head/sys/dev/mge/if_mge.c Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Tue Aug 25 09:39:11 2009 (r196533) +++ head/sys/conf/options.arm Tue Aug 25 09:47:12 2009 (r196534) @@ -24,6 +24,7 @@ KERNVIRTADDR opt_global.h LOADERRAMADDR opt_global.h PHYSADDR opt_global.h PHYSMEM_SIZE opt_global.h +MII_ADDR_BASE opt_global.h SKYEYE_WORKAROUNDS opt_global.h SOC_MV_DISCOVERY opt_global.h SOC_MV_KIRKWOOD opt_global.h Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Tue Aug 25 09:39:11 2009 (r196533) +++ head/sys/dev/mge/if_mge.c Tue Aug 25 09:47:12 2009 (r196534) @@ -69,7 +69,9 @@ __FBSDID("$FreeBSD$"); #include #include -#define MV_PHY_ADDR_BASE 8 +#ifndef MII_ADDR_BASE +#define MII_ADDR_BASE 8 +#endif #include #include @@ -1264,14 +1266,15 @@ mge_miibus_readreg(device_t dev, int phy /* * We assume static PHY address <=> device unit mapping: - * PHY Address = MV_PHY_ADDR_BASE + devce unit. + * PHY Address = MII_ADDR_BASE + devce unit. * This is true for most Marvell boards. * * Code below grants proper PHY detection on each device * unit. */ - if ((MV_PHY_ADDR_BASE + device_get_unit(dev)) != phy) + + if ((MII_ADDR_BASE + device_get_unit(dev)) != phy) return (0); MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & @@ -1292,7 +1295,7 @@ mge_miibus_writereg(device_t dev, int ph { uint32_t retries; - if ((MV_PHY_ADDR_BASE + device_get_unit(dev)) != phy) + if ((MII_ADDR_BASE + device_get_unit(dev)) != phy) return (0); MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff &