[RFC 5/5] MIPS: qemu-malta: add YAMON-style GT64120 memory map

Antony Pavlov antonynpavlov at gmail.com
Wed Dec 19 16:29:55 EST 2012


YAMON-style GT64120 memory map make move UART to the new position.

We need YAMON-style GT64120 memory for running Linux kernel from
barebox.

Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
---
 .../qemu-malta/include/board/board_pbl_start.h     |   42 ++++++++++++++++++++
 arch/mips/mach-malta/include/mach/hardware.h       |    2 +-
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/arch/mips/boards/qemu-malta/include/board/board_pbl_start.h b/arch/mips/boards/qemu-malta/include/board/board_pbl_start.h
index a6c55c7..d993c2f 100644
--- a/arch/mips/boards/qemu-malta/include/board/board_pbl_start.h
+++ b/arch/mips/boards/qemu-malta/include/board/board_pbl_start.h
@@ -19,6 +19,15 @@
 
 #include <asm/pbl_macros.h>
 
+#define GT_PCI0IOLD_OFS		0x048
+#define GT_PCI0IOHD_OFS		0x050
+#define GT_PCI0M0LD_OFS		0x058
+#define GT_PCI0M0HD_OFS		0x060
+#define GT_ISD_OFS		0x068
+
+#define GT_PCI0M1LD_OFS		0x080
+#define GT_PCI0M1HD_OFS		0x088
+
 	.macro	board_pbl_start
 	.set	push
 	.set	noreorder
@@ -39,6 +48,39 @@ __start:
 
 	mips_disable_interrupts
 
+	/*
+	 * Load BAR registers of GT64120 as done by YAMON
+	 *
+	 * based on write_bootloader() in qemu.git/hw/mips_malta.c
+	 * see GT64120 manual and qemu.git/hw/gt64xxx.c for details
+	 *
+	 * This is big-endian version of code!
+	 */
+
+	/* move GT64120 registers to 0x1be00000 */
+	li	t1, 0xb4000000
+	li	t0, 0xdf000000
+	sw	t0, GT_ISD_OFS(t1)
+
+	/* setup MEM-to-PCI0 mapping */
+	li	t1, 0xbbe00000
+
+	/* setup PCI0 io window to 0x18000000-0x181fffff */
+	li	t0, 0xc0000000
+	sw	t0, GT_PCI0IOLD_OFS(t1)
+	li	t0, 0x40000000
+	sw	t0, GT_PCI0IOHD_OFS(t1)
+
+	/* setup PCI0 mem windows */
+	li	t0, 0x80000000
+	sw	t0, GT_PCI0M0LD_OFS(t1)
+	li	t0, 0x3f000000
+	sw	t0, GT_PCI0M0HD_OFS(t1)
+	li	t0, 0xc1000000
+	sw	t0, GT_PCI0M1LD_OFS(t1)
+	li	t0, 0x5e000000
+	sw	t0, GT_PCI0M1HD_OFS(t1)
+
 	/* cpu specific setup ... */
 	/* ... absent */
 
diff --git a/arch/mips/mach-malta/include/mach/hardware.h b/arch/mips/mach-malta/include/mach/hardware.h
index 5e8e276..f6294b2 100644
--- a/arch/mips/mach-malta/include/mach/hardware.h
+++ b/arch/mips/mach-malta/include/mach/hardware.h
@@ -18,7 +18,7 @@
 #ifndef __INCLUDE_ARCH_HARDWARE_H__
 #define   __INCLUDE_ARCH_HARDWARE_H__
 
-#define DEBUG_LL_UART_ADDR	0xb00003f8
+#define DEBUG_LL_UART_ADDR	0xb80003f8
 #define DEBUG_LL_UART_SHIFT	0
 
 /*
-- 
1.7.10.4




More information about the barebox mailing list