Hi Waldemar,

On 23/04/16 08:50, Waldemar Brodkorb wrote:
Hi Greg,
Greg Ungerer wrote,

How could I generate the information for you? Do you have
a kernel patch I would need to apply? I can bootup a kernel
and execute code, I just can't type anything into the serial

Attached is a kernel patch that modifies binfmt_flat to print
out the reloc number along with the reloc error. That way we can
map that back to the reloc entry number printed out in the verbose
output from elf2flt at compile time.

Thanks for the patch, will try it.

I am not sure any Qemu Cortex-M3/4 system emulation is
available.

Do you know of any qemu target machines that work out-of-the-box
with a stock linux kernel with MMU disabled?

No.

I used to use the gdb/ARMulator many years ago, but the kernel
target machine (Atmel/at91eb01) is long gone in modern kernel
version.

I tried three different qemu forks, but they all only provide
system level emulation for bare-metal apps. Skyeye crashes for me
and recent GDB doesn't contain the old Armulator stuff.

I tried Qemu mainline to bootup versatilepb/vexpress Linux kernel
without MMU, but get no output.

Looking into the other ARM flat problem, I figured we need to get
this problem solved as well.

Turns out it is not too hard to get a Versatile target built
and running on qemu in no-MMU mode. The only real change required
is the attached patch - which fixes the IO device addressing problem.

With this patch and starting with the versatile_defconfig you
only need a couple of config changes and it will run on the
versatile target in qemu. You need to disable CONFIG_MMU
and set the DRAM sizing (base at 0, size 128MB).

This patch is against a linux-4.4 kernel, and it looks like the
versatile target has gone device tree from 4.5 and newer - so
this patch won't apply or work on them as is.

Regards
Greg


>From b7c1666813424d329868335c8faf8886b0f85b6c Mon Sep 17 00:00:00 2001
From: Greg Ungerer <g...@linux-m68k.org>
Date: Thu, 11 Aug 2016 21:33:11 +1000
Subject: [PATCH] arm: fix versatile platform to work in no-MMU mode

If CONFIG_MMU is disabled then do not carry out the virtual memory address
translation for IO devices.

With this fix in place we can run the ARM Versatile board (including its
qemu emulation) as a no-MMU Linux system.

Signed-off-by: Greg Ungerer <g...@linux-m68k.org>
---
 arch/arm/mach-versatile/include/mach/hardware.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h
index 3e5d425..36c6cd2 100644
--- a/arch/arm/mach-versatile/include/mach/hardware.h
+++ b/arch/arm/mach-versatile/include/mach/hardware.h
@@ -30,8 +30,12 @@
 #define VERSATILE_PCI_VIRT_BASE		(void __iomem *)0xe8000000ul
 #define VERSATILE_PCI_CFG_VIRT_BASE	(void __iomem *)0xe9000000ul
 
+#ifdef CONFIG_MMU
 /* macro to get at MMIO space when running virtually */
 #define IO_ADDRESS(x)		(((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
+#else
+#define IO_ADDRESS(x)		(x)
+#endif
 
 #define __io_address(n)		((void __iomem __force *)IO_ADDRESS(n))
 
-- 
1.9.1

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to