From ed8c977e2fb3c525868411a270a5d57fe0105611 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Mon, 26 Apr 2021 22:31:05 +0100 Subject: [PATCH] x1000: Fix stupid bug in the SPL This overwrote the first 2 instructions of crt0 in the bootloader! I'm really not sure how this *didn't* cause a fatal exception. This address isn't special as far as I know, so just move it to the TCSM by making it a static variable. Change-Id: I58e1486804aeb2b68325e8de2aa1874c97abef19 --- firmware/target/mips/ingenic_x1000/spl-x1000.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firmware/target/mips/ingenic_x1000/spl-x1000.c b/firmware/target/mips/ingenic_x1000/spl-x1000.c index e6d87066b5..36ef25f60d 100644 --- a/firmware/target/mips/ingenic_x1000/spl-x1000.c +++ b/firmware/target/mips/ingenic_x1000/spl-x1000.c @@ -262,6 +262,9 @@ static int nandwrite(uint32_t addr, uint32_t size, void* buffer) return rc; } +/* Kernel command line arguments */ +static char* argv[2]; + void main(void) { if(!(SPL_ARGUMENTS->flags & SPL_FLAG_SKIP_INIT)) @@ -289,7 +292,6 @@ void main(void) * saves an unnecessary branch. */ entry_fn entry = (entry_fn)opt->exec_addr; - char** argv = (char**)0x80004000; argv[0] = 0; argv[1] = (char*)opt->cmdline;