[OpenWrt-Devel] [PATCH 3/5] generic: improve kexec support of MIPS.

Yousong Zhou yszhou4tech at gmail.com
Fri Feb 13 06:43:00 EST 2015


On 12 February 2015 at 19:59, John Crispin <blogic at openwrt.org> wrote:
> Hi,
>
> found something while merging the patches. see below ...
>
> On 10/02/2015 13:10, Yousong Zhou wrote:
>>  - Allow --command-line parameters of kexec-tools be parsed and used by
>>    the kernel.
>>  - For malta machine, mark kernel code and kernel data segments as
>>    "System RAM" instead of "reserved" in /proc/iomem, otherwise
>>    kexec-tools will complain that program segments in ELF kernel file
>>    are invalid.
>>
>> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>
> [...]
>
>> diff --git a/target/linux/generic/patches-3.19/330-MIPS-Malta-Mark-kernel-code-and-kernel-data-segments.patch b/target/linux/generic/patches-3.19/330-MIPS-Malta-Mark-kernel-code-and-kernel-data-segments.patch
>> new file mode 100644
>> index 0000000..4457d75
>> --- /dev/null
>> +++ b/target/linux/generic/patches-3.19/330-MIPS-Malta-Mark-kernel-code-and-kernel-data-segments.patch
>> @@ -0,0 +1,39 @@
>> +From 79c7301c922f5023f85805a4ba969ce55f51d0ca Mon Sep 17 00:00:00 2001
>> +From: Yousong Zhou <yszhou4tech at gmail.com>
>> +Date: Sat, 31 Jan 2015 15:13:12 +0800
>> +Subject: [PATCH 330/331] MIPS: Malta: Mark kernel code and kernel data
>> + segments as BOOT_MEM_RAM.
>> +
>> +Kexec-tools requires those segments listed as "System RAM" in
>> +/proc/iomem, otherwise, an error message of "Invalid memory segment"
>> +will be emitted when trying to load the ELF kernel image.
>> +
>> +Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>> +---
>> + arch/mips/mti-malta/malta-memory.c |    9 ++-------
>> + 1 file changed, 2 insertions(+), 7 deletions(-)
>> +
>> +diff --git a/arch/mips/mti-malta/malta-memory.c b/arch/mips/mti-malta/malta-memory.c
>> +index 8fddd2cd..1d562f0 100644
>> +--- a/arch/mips/mti-malta/malta-memory.c
>> ++++ b/arch/mips/mti-malta/malta-memory.c
>> +@@ -106,14 +106,9 @@ fw_memblock_t * __init fw_getmdesc(int eva)
>> +     mdesc[2].base = mdesc[0].base + 0x000f0000UL;
>> +     mdesc[2].size = 0x00010000;
>> +
>> +-    mdesc[3].type = fw_dontuse;
>> ++    mdesc[3].type = fw_free;
>> +     mdesc[3].base = mdesc[0].base + 0x00100000UL;
>> +-    mdesc[3].size = CPHYSADDR(PFN_ALIGN((unsigned long)&_end)) -
>> +-            0x00100000UL;
>> +-
>> +-    mdesc[4].type = fw_free;
>> +-    mdesc[4].base = mdesc[0].base + CPHYSADDR(PFN_ALIGN(&_end));
>> +-    mdesc[4].size = memsize - CPHYSADDR(mdesc[4].base);
>> ++    mdesc[3].size = memsize - CPHYSADDR(mdesc[3].base);
>> +
>
> will the CPHYSADDR() call work on 64bit systems ?  64bit userland is
> currenty broken and disbaled in openwrt, we should however try to fix
> this before we send the patch upstream to ralf
>

Not sure what Malta's physical address map will look like in 64bit
mode, but I tend to believe the patch should work...  If that is not
the case, then I guess another patch to fix the CPHYSADDR() problem
will be needed before this one.

               yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list