From: Wolfgang Denk Date: Tue, 04 Aug 2009 23:12:03 +0200 Subject: [U-Boot] bitbang phy driver In-Reply-To: <4A789D2F.1050405@gmail.com> References: <4A789D2F.1050405@gmail.com> Message-ID: <20090804211203.C45B78340728@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Darius Augulis, In message <4A789D2F.1050405@gmail.com> you wrote: > > I see that miiphybb.c driver is used only with PPC architecture yet. > I would like to use it with ARM. Would be it reasonable to make this > driver arch independent? I have small patch and it changes defined ports > and pins with function calls, which should be provided by each CPU. I Hm... I fail to see why such a change is needed. > attached this patch for RFC. If it is suitable, I may need help with > changing all > 20 PPC boards using this driver, because I don't have > experience with PPC. Would be there some volunteers willing to help? Or Sure. The plan (to make this architecture independent) makes a lot sense. ... > - MDIO_ACTIVE; > - MDIO (1); > + mii_mdio_active(1); > + mii_mdio_set(1); > for (j = 0; j < 32; j++) { > - MDC (0); > + mii_mdc_set(0); > MIIDELAY; > - MDC (1); > + mii_mdc_set(1); > MIIDELAY; Why are these changes necessary? Why cannot you simple add this to your board config file: #define MDIO_ACTIVE mii_mdio_active(1) #define MDIO(x) mii_mdio_set(x) #define MDC(x) mii_mdc_set(x) ... ? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A year spent in artificial intelligence is enough to make one believe in God.