[U-Boot] [PATCH 1/1] arm: clean sizes.h

Wolfgang Denk wd at denx.de
Sun May 3 15:23:28 CEST 2009


Dear Jean-Christophe,

in message <20090502215903.894E783420E8 at gemini.denx.de> I wrote:
> 
> > Actually For ARM we ask us tp use it so to simplify the import from linux
> > this "helper" are also imported
> 
> I don't know who "we" is, but you don;t have my ACK for this, and as
> long as it's not even correct youwill not get it.
> 
> > > >  #define SZ_1K                           0x00000400
> > > >  #define SZ_4K                           0x00001000
> > > >  #define SZ_8K                           0x00002000
> > > 
> > > Please keep in mind that "K", "M", and "G" are non-standard prefixes,
> > > and it is not clear if they refer to  decimal  or  binary  multiples.
> > > This makes their use in the code a PITA.

Situation is even worse, if you check existing U-Boot code; for
example:

"include/asm-arm/sizes.h":

	#define SZ_1K                           0x00000400
	#define SZ_4K                           0x00001000
	#define SZ_8K                           0x00002000
	#define SZ_16K                          0x00004000
	#define SZ_64K                          0x00010000
	#define SZ_128K                         0x00020000
	#define SZ_256K                         0x00040000
	#define SZ_512K                         0x00080000
	 
	#define SZ_1M                           0x00100000
	#define SZ_2M                           0x00200000
	#define SZ_4M                           0x00400000
	#define SZ_8M                           0x00800000
	#define SZ_16M                          0x01000000
	#define SZ_32M                          0x02000000
	#define SZ_64M                          0x04000000
	#define SZ_128M                         0x08000000
	#define SZ_256M                         0x10000000

"board/amcc/taishan/init.S",
"board/amcc/yosemite/init.S",
"board/pcs440ep/init.S",
"board/prodrive/alpr/init.S",
"board/prodrive/p3p440/init.S" and many more:

	#define SZ_1K       0x00000000
	#define SZ_4K       0x00000010
	#define SZ_16K      0x00000020
	#define SZ_64K      0x00000030
	#define SZ_256K     0x00000040
	#define SZ_1M       0x00000050
	#define SZ_8M       0x00000060
	#define SZ_16M      0x00000070
	#define SZ_256M     0x00000090

So what is the "easy to read and understand" ``helper'' SZ_1M ?
Is it 1,000,000 or 1,048,576 or ist it eventually just 80 ?

These defines are no ``helpers'', they are Faux Ami, and we should
start to expunge this crap as soon as possible.

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
######## This message was made from 100% recycled electrons. ########


More information about the U-Boot mailing list