mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [RFC 5/5] MIPS: qemu-malta: add YAMON-style GT64120 memory map
Date: Thu, 20 Dec 2012 01:29:55 +0400	[thread overview]
Message-ID: <1355952595-1432-6-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1355952595-1432-1-git-send-email-antonynpavlov@gmail.com>

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@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2012-12-19 21:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 21:29 [RFC 0/5] add ELF support Antony Pavlov
2012-12-19 21:29 ` [RFC 1/5] resource: add create_resource() helper function Antony Pavlov
2012-12-19 21:29 ` [RFC 2/5] bootm: add very basic ELF support (stolen from kexec) Antony Pavlov
2012-12-21  7:49   ` Sascha Hauer
     [not found]     ` <CAA4bVAGk02KAHJH6mOfzoa0-5C=P7_7ADEMtg9jXPSk-Fr5UVw@mail.gmail.com>
2012-12-21 10:59       ` Antony Pavlov
2012-12-19 21:29 ` [RFC 3/5] MIPS: add ELF support Antony Pavlov
2012-12-21  7:53   ` Sascha Hauer
     [not found]     ` <CAA4bVAGki1VfbFXNRpMj+-pcM70W_yZvMCFhDGgbpKAXE6Taag@mail.gmail.com>
2012-12-21 11:00       ` Fwd: " Antony Pavlov
2012-12-19 21:29 ` [RFC 4/5] MIPS: qemu-malta: add board label Antony Pavlov
2012-12-19 21:29 ` Antony Pavlov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355952595-1432-6-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox