From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Mon, 08 Sep 2008 21:58:40 -0400 Subject: [U-Boot] CFG_64BIT_xxx and friends In-Reply-To: <20080908142326.73df4141@hskinnemo-gx745.norway.atmel.com> References: <200809041609.26474.matthias.fuchs@esd-electronics.com> <200809080943.45406.sr@denx.de> <20080908130046.63a779ba@hskinnemo-gx745.norway.atmel.com> <200809081327.06175.matthias.fuchs@esd-electronics.com> <20080908135421.302190b9@hskinnemo-gx745.norway.atmel.com> <20080908142326.73df4141@hskinnemo-gx745.norway.atmel.com> Message-ID: <48C5D850.100@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Haavard Skinnemoen wrote: > Haavard Skinnemoen wrote: >> That's a bit more than expected. Is this with or without --gc-sections? >> Linking with --gc-sections should make simple_strtoull() go away unless >> it's actually used. > > That's assuming the fdt and image code doesn't interpret > CFG_64BIT_VSPRINTF as CFG_BLOAT_ME_HARDER, which it does. So enabling > CFG_64BIT_VSPRINTF does increase the code size even with --gc-sections. > > I think fdt and common/image.c should stop abusing CFG_64BIT_VSPRINTF > and get its own symbol instead, e.g. CFG_64BIT_PHYS_ADDR, and perhaps a > nice str_to_addr() wrapper which selects between strtoul and strtoull > based on this symbol. Hi Haavard, fdt and common.image.c don't use CFG_64BIT_VSPRINTF: $ find . -name "*.c" | xargs grep CFG_64BIT_VSPRINTF ./disk/part.c:#if defined(CFG_64BIT_LBA) && defined(CFG_64BIT_VSPRINTF) ./common/cmd_ide.c:#if defined(CFG_64BIT_LBA) && defined(CFG_64BIT_VSPRINTF) ./common/cmd_ide.c:#if defined(CFG_64BIT_LBA) && defined(CFG_64BIT_VSPRINTF) ./lib_generic/vsprintf.c:#ifdef CFG_64BIT_VSPRINTF ./lib_generic/vsprintf.c:#ifdef CFG_64BIT_VSPRINTF ./lib_generic/vsprintf.c:#ifdef CFG_64BIT_VSPRINTF ./lib_generic/vsprintf.c:#ifdef CFG_64BIT_VSPRINTF ...they use CFG_64BIT_STRTOUL. If a config defines CFG_64BIT_STRTOUL, it is reasonable that the code uses it. I don't see any disadvantage of this vs. creating a new CFG_64BIT_PHYS_ADDR (although I would not object to that being created). Only a select set of PowerPC targets actually define CFG_64BIT_STRTOUL: $ find . -name "*.[ch]" | xargs grep CFG_64BIT_STRTOUL ./cpu/mpc85xx/mp.c:#ifdef CFG_64BIT_STRTOUL ./include/configs/MPC8540ADS.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8572DS.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8536DS.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8548CDS.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8568MDS.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8541CDS.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8610HPCD.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8641HPCN.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/sbc8641d.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8555CDS.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8560ADS.h:#define CFG_64BIT_STRTOUL 1 ./include/configs/MPC8544DS.h:#define CFG_64BIT_STRTOUL 1 ./include/ppc4xx.h:#define CFG_64BIT_STRTOUL ./common/cmd_fdt.c:#ifdef CFG_64BIT_STRTOUL ./common/cmd_fdt.c:#ifdef CFG_64BIT_STRTOUL ./common/image.c:#ifdef CFG_64BIT_STRTOUL ./lib_generic/vsprintf.c:#ifdef CFG_64BIT_STRTOUL ./lib_generic/vsprintf.c:#endif /* CFG_64BIT_STRTOUL */ [snip] Best regards, gvb