From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Tue, 16 Jun 2015 07:21:06 +0200 Subject: [U-Boot] [PATCH 1/4] spl, common, serial: build SPL without serial support In-Reply-To: <20150615153213.GX1728@bill-the-cat> References: <1434370862-8203-1-git-send-email-hs@denx.de> <1434370862-8203-2-git-send-email-hs@denx.de> <20150615153213.GX1728@bill-the-cat> Message-ID: <557FB242.8080804@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 Hello Tom, Am 15.06.2015 17:32, schrieb Tom Rini: > On Mon, Jun 15, 2015 at 02:20:59PM +0200, Heiko Schocher wrote: > >> This patch enables building SPL without >> CONFIG_SPL_SERIAL_SUPPORT support. >> >> Signed-off-by: Heiko Schocher > > I like that we're starting down this path. But can you explain why we > need each of these changes: I try it ... The determining change is in "include/common.h", which twist the putc, puts, printf and vprintf functions to /dev/null ... so the compiler/linker can drop all them ... all other changes are only fixing compiler warnings, as for example vars no longer used ... >> arch/arm/lib/interrupts.c | 4 ++-- >> arch/arm/mach-at91/arm926ejs/cpu.c | 2 +- >> common/cli_readline.c | 2 +- >> common/cli_simple.c | 2 +- >> lib/display_options.c | 4 ++-- > > Having gone down the path of disabling output in SPL before due to size > constraints I didn't need to modify those files (but it was on an older > version) Do you have a patch? >> common/image.c | 8 ++++++-- > > In this case I just said we only need those functions (and their > strings!) when we have SPL_SERIAL available. It may be worth > re-checking what parts of this file we really need available in SPL > even. Hmm... my change is only to get rid of compiler warning "var defined but not used" with marking this vars with "__maybe_unused" ... so it is the less intrusive way ... If we have a header before the kernel image, we need functions from here in SPL, and maybe FIT is sometime supported/used in SPL ... maybe someone wants to print header info in SPL before booting it ... so I do not know if this would be an easy job ... >> common/spl/spl.c | 9 +++++++++ > > We should be able to be fine without a preloader_console_init() func I > think. I just defined a version for the non serial case, at this place there is already this function ... I only set: gd->bd = &bdata; gd->have_console = 0; which seems not to bad to me ... ok, "gd->have_console" should be 0. And why is in preloader_console_init() "gd->bd = &bdata;" ... this seems not the right place to me, as it has nothing to do with "console init" ... so maybe we really can drop it, but it gets called from: $ grep -lr preloader_console_init . ./arch/microblaze/cpu/spl.c ./arch/powerpc/cpu/ppc4xx/spl_boot.c ./arch/powerpc/cpu/mpc5xxx/spl_boot.c ./arch/arm/mach-davinci/spl.c ./arch/arm/mach-uniphier/spl.c ./arch/arm/mach-mvebu/spl.c ./arch/arm/mach-at91/spl_at91.c ./arch/arm/mach-at91/spl_atmel.c ./arch/arm/mach-tegra/spl.c ./arch/arm/mach-zynq/spl.c ./arch/arm/cpu/armv7/omap-common/boot-common.c ./arch/arm/cpu/armv7/omap-common/boot-common.c.orig ./arch/arm/cpu/armv7/sunxi/board.c ./arch/arm/cpu/armv7/omap3/board.c ./arch/arm/mach-socfpga/spl.c ./20150615/0004-spl-common-serial-build-SPL-without-serial-support.patch ./board/compulab/cm_fx6/spl.c ./board/gateworks/gw_ventana/gw_ventana_spl.c ./board/solidrun/mx6cuboxi/mx6cuboxi.c ./board/barco/platinum/spl_titanium.c ./board/barco/platinum/spl_picon.c ./board/kosagi/novena/novena_spl.c ./board/ti/ks2_evm/board.c ./board/LaCie/edminiv2/edminiv2.c ./board/wandboard/spl.c ./board/freescale/mx6sxsabresd/mx6sxsabresd.c ./board/freescale/ls1021aqds/ls1021aqds.c ./board/freescale/ls1021atwr/ls1021atwr.c ./board/freescale/mx6sabresd/mx6sabresd.c ./board/bachmann/ot1200/ot1200_spl.c ./board/work-microwave/work_92105/work_92105_spl.c ./board/woodburn/woodburn.c so ... we need a dummy function ... or? Thanks for your comments! bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany