[U-Boot] [PATCH 0/9] Remove use of gdata for global_data

Simon Glass sjg at chromium.org
Tue Dec 23 20:04:50 CET 2014


Some ARM boards use global_data in SPL before it set up by crt0.S. To
achieve this they use a separate global_data variable called gdata which
resides in the data section. The one set up by crt0.S is generally ignored.

This prevents crt0.S from setting up things like the early malloc() pool.
It therefore prevents driver model from being used in SPL.

However gdata really isn't needed. In fact lowlevel_init() is called just
before board_init_f() so, for SPL at least, there is no point in doing
anything before board_init_f(). The one slightly messy area is that SPL
may want to move the stack from SRAM to SDRAM at some point. But this should
be done at the end of board_init_f() (or before board_init_r() is called)
and is not a reason to init DRAM before board_init_f().

It isn't that difficult to get rid of gdata. This series builds on Tom Rini's
recent series for omap3, and extends it to the other offenders: imx, sunxi
and zynq.

I have tested so far only on sunxi. This series is available at u-boot-dm
branch 'gd-working'.


Simon Glass (9):
  arm: Add warnings about using gdata
  sunxi: Move SPL s_init() code to board_init_f()
  sunxi: Drop use of lowlevel_init()
  arm: Reduce the scope of lowlevel_init()
  zynq: Remove reference to gdata
  imx: cm_fx6: Remove reference to gdata
  imx: woodburn: Remove reference to gdata
  imx: ls102xa: Remove reference to gdata
  arm: Drop gdata global_data variable in SPL

 arch/arm/cpu/armv7/lowlevel_init.S      | 23 +++++++-----
 arch/arm/cpu/armv7/sunxi/board.c        | 66 ++++++++++++++++-----------------
 arch/arm/cpu/armv7/zynq/spl.c           |  3 --
 arch/arm/include/asm/spl.h              |  2 -
 arch/arm/lib/spl.c                      | 11 +++---
 board/compulab/cm_fx6/spl.c             |  1 -
 board/freescale/ls1021aqds/ls1021aqds.c |  3 --
 board/freescale/ls1021atwr/ls1021atwr.c |  3 --
 board/woodburn/woodburn.c               |  3 --
 include/configs/sunxi-common.h          |  1 +
 10 files changed, 53 insertions(+), 63 deletions(-)

-- 
2.2.0.rc0.207.ga3a616c



More information about the U-Boot mailing list