diff options
author | adrian <adrian@FreeBSD.org> | 2011-11-24 07:32:52 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2011-11-24 07:32:52 +0000 |
commit | 8d1324f4679534b49270e453aa10a9053cf704e9 (patch) | |
tree | 5e3d5d766b2144d5328bf068e8a11021fc7cba58 /sys/mips/atheros | |
parent | 67eb6d865673aedbdc73cba58817d5a209715d3e (diff) | |
download | FreeBSD-src-8d1324f4679534b49270e453aa10a9053cf704e9.zip FreeBSD-src-8d1324f4679534b49270e453aa10a9053cf704e9.tar.gz |
Introduce a new (global, sorry!) option which controls whether
the ar71xx platform code should assume a uboot or redboot environment.
The current code gets very confused (and just crashes) on a uboot
environment, where each attribute=value pair is in a single entry.
Redboot on the other hand stores it as "attribute", "value", "attribute",
"value", ...
This allows the kernel to boot on a TP-LINK TL-WR1043ND from flash,
where the uboot environment gets setup. This didn't show up during a netboot
as "tftpboot" and "go" don't setup the uboot environment variables.
Diffstat (limited to 'sys/mips/atheros')
-rw-r--r-- | sys/mips/atheros/ar71xx_machdep.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/mips/atheros/ar71xx_machdep.c b/sys/mips/atheros/ar71xx_machdep.c index 1789994..bcb5807 100644 --- a/sys/mips/atheros/ar71xx_machdep.c +++ b/sys/mips/atheros/ar71xx_machdep.c @@ -168,8 +168,8 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) { uint64_t platform_counter_freq; - int argc, i; - char **argv, **envp; + int argc = 0, i; + char **argv = NULL, **envp = NULL; vm_offset_t kernend; /* @@ -184,9 +184,18 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, /* Initialize pcpu stuff */ mips_pcpu0_init(); + /* + * Until some more sensible abstractions for uboot/redboot + * environment handling, we have to make this a compile-time + * hack. The existing code handles the uboot environment + * very incorrectly so we should just ignore initialising + * the relevant pointers. + */ +#ifndef AR71XX_ENV_UBOOT argc = a0; argv = (char**)a1; envp = (char**)a2; +#endif /* * Protect ourselves from garbage in registers */ @@ -255,6 +264,9 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, printf(" a2 = %08x\n", a2); printf(" a3 = %08x\n", a3); + /* + * XXX this code is very redboot specific. + */ printf("Cmd line:"); if (MIPS_IS_VALID_PTR(argv)) { for (i = 0; i < argc; i++) { |