mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-28 01:51:33 +00:00
MIPS: bootm: add support for LMB
This is required for init ramdisk relocation and device tree support. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
This commit is contained in:
parent
c4b37847d3
commit
f66cc1e348
2 changed files with 23 additions and 0 deletions
|
@ -7,4 +7,6 @@
|
||||||
#ifndef _ASM_CONFIG_H_
|
#ifndef _ASM_CONFIG_H_
|
||||||
#define _ASM_CONFIG_H_
|
#define _ASM_CONFIG_H_
|
||||||
|
|
||||||
|
#define CONFIG_LMB
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -27,6 +27,27 @@ static int linux_env_idx;
|
||||||
static void linux_params_init(ulong start, char *commandline);
|
static void linux_params_init(ulong start, char *commandline);
|
||||||
static void linux_env_set(char *env_name, char *env_val);
|
static void linux_env_set(char *env_name, char *env_val);
|
||||||
|
|
||||||
|
static ulong arch_get_sp(void)
|
||||||
|
{
|
||||||
|
ulong ret;
|
||||||
|
|
||||||
|
__asm__ __volatile__("move %0, $sp" : "=r"(ret) : );
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void arch_lmb_reserve(struct lmb *lmb)
|
||||||
|
{
|
||||||
|
ulong sp;
|
||||||
|
|
||||||
|
sp = arch_get_sp();
|
||||||
|
debug("## Current stack ends at 0x%08lx\n", sp);
|
||||||
|
|
||||||
|
/* adjust sp by 4K to be safe */
|
||||||
|
sp -= 4096;
|
||||||
|
lmb_reserve(lmb, sp, CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp);
|
||||||
|
}
|
||||||
|
|
||||||
static void boot_prep_linux(bootm_headers_t *images)
|
static void boot_prep_linux(bootm_headers_t *images)
|
||||||
{
|
{
|
||||||
char *commandline = getenv("bootargs");
|
char *commandline = getenv("bootargs");
|
||||||
|
|
Loading…
Add table
Reference in a new issue