From: Matthias Ludwig Date: Fri, 8 May 2009 10:42:34 +0200 Subject: [U-Boot] [PATCH] OMAP3EVM: net_chip uses CS5 not CS6 In-Reply-To: <20090507185817.EDBFB83420E8@gemini.denx.de> References: <1241614855-8087-1-git-send-email-mludwig@ultratronik.de> <4A01A4CD.2060605@googlemail.com> <19F8576C6E063C45BE387C64729E739404323ED93C@dbde02.ent.ti.com> <20090507071155.GA8961@ultratronik.de> <20090507083634.5ECB883420E8@gemini.denx.de> <4A02FB34.2090907@googlemail.com> <20090507185817.EDBFB83420E8@gemini.denx.de> Message-ID: <20090508084234.GA6403@ultratronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang, Dirk, cause for this patch was originally the plan to bring my company's new omap3-based platform into U-Boot. As we do use other CS for a network chip this patch was intended to be the starting point (otherwise our patchset will not apply). I can prepare a big #define -> c_struct patch for omap next week. The only problem i see, my following patches will be rebased onto that and will only apply after the transition #define -> c_struct is done. If this is ok for you i will submit this mid/end of next week. best regards, Matthias On Thu, May 07, 2009 at 08:58:17PM +0200, Wolfgang Denk wrote: > Dear Dirk, > > In message <4A02FB34.2090907@googlemail.com> you wrote: > > > > > Please provide proper C structs! > > > > Would you like to have a look to the code snippet visible in Matthias' > > patch > > > > http://lists.denx.de/pipermail/u-boot/2009-May/052157.html > > > > ? > > Done. > > > It's my understanding that what's in code > > > > writel(NET_GPMC_CONFIG1, &gpmc_cs5_base->config1); > > > > is what you want? I.e. as I understand it, the code is correct (we use > > It is only part of what I want to see. There are still deficiencies. > > Yes, we have a struct gpmc_csx, that's good. > > Note though that using such typedef's not in line with the Coding > Style, which says: "It's a _mistake_ to use typedef for structures > and pointers." Also, checkpatch.pl complains about this. > > The next problem is that the entries in these structs are declared as > "unsigned int", which just happens to work by chance. "u32" would be > more reliable. > > Finally, and this is what I really compalin about, is that there is no > big structure which includes all the blocks that make up the CPU into > one big structure (as it's done for example for PowerPC systems in the > include/asm-ppc/*immap* files) - you still use code like > > gpmc_csx_t *gpmc_cs5_base = (gpmc_csx_t *)GPMC_CONFIG_CS5_BASE; > > to locate each of the individual C structs in the memory map; instead, > onle one single pointer to the internal memory should be needed. > > > Sorry if I missed something, just correct then ;) > > Done. Thanks. > > 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 > Winners never talk about glorious victories. That's because they're > the ones who see what the battlefield looks like afterwards. It's > only the losers who have glorious victories. > - Terry Pratchett, _Small Gods_ -- Matthias Ludwig, Software Development Ultratronik Entwicklungs GmbH, Gewerbestrasse 52, 82211 Herrsching, Germany http://www.ultratronik.de Tel: +49 8152 3709-356 Fax: +49 8152 5183 Registergericht Muenchen, HRB 55584