summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/mtrr.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-02-07 11:51:34 -0700
committerSimon Glass <sjg@chromium.org>2015-02-12 10:35:29 -0700
commit74d0186766a3899d3838286dcdb40fd6bdcbd49a (patch)
tree9334b4f54bf84cc86693d36852477273113a58f5 /arch/x86/cpu/mtrr.c
parent2c8571703a3aacfb09defc35c42c6250a6746d58 (diff)
downloadu-boot-imx-74d0186766a3899d3838286dcdb40fd6bdcbd49a.zip
u-boot-imx-74d0186766a3899d3838286dcdb40fd6bdcbd49a.tar.gz
u-boot-imx-74d0186766a3899d3838286dcdb40fd6bdcbd49a.tar.bz2
Introduce board_init_f_mem() to handle early memory layout
At present on some architectures we set up the following before calling board_init_f(): - global_data - stack - early malloc memory Adding the code to support early malloc and global data setup to every arch's assembler start-up is a pain. Also this code is not actually architecture-specific. We can use common code for all architectures and with a bit of care we can write this code in C. Add a new function to deal with this. It should be called after memory is available, with a pointer to the top of the area that should be used before relocation. The function will set things up and return the lowest memory address that it allocated/used. That can then be set as the top of the stack. Note that on some archs this function will use the stack, so the stack pointer should be set to same value as is pased to board_init_f_mem(). A margin of 128 bytes will be left for this stack, so that it is not overwritten. This means that 64 bytes is wasted by this early call. This is not strictly necessary on several more modern archs, so we could remove this at the cost of some arch-dependent code. With this function there is no-longer any need for the assembler code to zero global_data or set up the early malloc pointers. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/cpu/mtrr.c')
0 files changed, 0 insertions, 0 deletions