Skip to content
Snippets Groups Projects
  1. Jan 04, 2017
    • Andre Przywara's avatar
      SPL: tiny-printf: add "l" modifier · a28e1d98
      Andre Przywara authored
      
      tiny-printf does not know about the "l" modifier so far, which breaks
      the crash dump on AArch64, because it uses %lx to print the registers.
      Add an easy way of handling longs correctly.
      
      Using a relatively decent compiler (GCC 5.3.0) this does _not_ increase
      the code size of tiny-printf.o for 32-bit builds (where long and int
      are actually the same), actually it looses three (ARM Thumb2) instructions
      from the actual SPL (numbers for orangepi_plus_defconfig):
        text    data     bss     dec     hex filename
         758       0       0     758     2f6 spl/lib/tiny-printf.o	before
       18839     488     232   19559    4c67 spl/u-boot-spl		before
         758       0       0     758     2f6 spl/lib/tiny-printf.o	after
       18833     488     232   19553    4c61 spl/u-boot-spl		after
      
      This adds some substantial amount of code to a 64-bit build, though:
      (taken after a later commit, which enables the ARM64 SPL build for sunxi)
        text    data     bss     dec     hex filename
        1542       0       0    1542     606 spl/lib/tiny-printf.o	before
       25830     392     360   26582    67d6 spl/u-boot-spl		before
        1758       0       0    1758     6de spl/lib/tiny-printf.o	after
       26040     392     360   26792    68a8 spl/u-boot-spl		after
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarJagan Teki <jagan@openedev.com>
      a28e1d98
  2. Aug 08, 2016
  3. Jul 15, 2016
    • Simon Glass's avatar
      tiny-printf: Support assert() · e2409139
      Simon Glass authored
      
      At present assert() is not supported with tiny-printf, so when DEBUG is
      enabled a build error is generated for each assert().
      
      Add an __assert_fail() function to correct this. It prints a message and
      then hangs.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      e2409139
  4. Jul 08, 2016
    • Andre Przywara's avatar
      SPL: tiny-printf: avoid any BSS usage · 59d07ee0
      Andre Przywara authored
      
      As printf calls may be executed quite early, we should avoid using any
      BSS stored variables, since some boards put BSS in DRAM, which may not
      have been initialised yet.
      Explicitly mark those "static global" variables as belonging to the
      .data section, to keep tiny-printf clear of any BSS usage.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      59d07ee0
  5. Jun 20, 2016
  6. Jun 09, 2016
  7. Jun 03, 2016
  8. May 27, 2016
  9. Jan 21, 2016
  10. Dec 14, 2015
  11. Nov 23, 2015
    • Stefan Roese's avatar
      lib/tiny-printf.c: Support numbers bigger than 0xffff and misc updates · a5ecdd08
      Stefan Roese authored
      
      With this patch now, the tiny printf() function also supports numbers
      bigger than 0xffff. Additionally the code is simplified a bit and
      some static variables are moved to function parameters. Also the
      upper case hex variable output support is removed, as its not really
      needed in this simple printf version. And removing it reduces the
      complexity and the code size again a bit.
      
      Here the new numbers, again on the db-mv784mp-gp (Armada XP):
      
      Without this patch:
        56542   18536    1956   77034   12cea ./spl/u-boot-spl
      
      With this patch:
        56446   18536    1936   76918   12c76 ./spl/u-boot-spl
      
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Albert Aribaud <albert.u.boot@aribaud.net>
      a5ecdd08
    • Stefan Roese's avatar
      lib/tiny-printf.c: Add tiny printf function for space limited environments · 7d9cde10
      Stefan Roese authored
      This patch adds a small printf() version that supports all basic formats.
      Its intented to be used in U-Boot SPL versions on platforms with very
      limited internal RAM sizes.
      
      To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This
      will result in the SPL using this tiny function and the main U-Boot
      still using the full-blown printf() function.
      
      This code was copied from:
      http://www.sparetimelabs.com/printfrevisited
      
      
      With mostly only coding style related changes so that its checkpatch
      clean.
      
      The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp
      (Marvell AXP) SPL:
      
      Without this patch:
        58963   18536    1928   79427   13643 ./spl/u-boot-spl
      
      With this patch:
        56542   18536    1956   77034   12cea ./spl/u-boot-spl
      
      Note:
      To make it possible to compile tiny-printf.c instead of vsprintf.c when
      CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are
      moved from common/console.c into vsprintf.c in this patch.
      
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Albert Aribaud <albert.u.boot@aribaud.net>
      7d9cde10
Loading