mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/5] misc qemu-malta patches
@ 2013-10-26  9:15 Antony Pavlov
  2013-10-26  9:15 ` [PATCH 1/5] MIPS: qemu-malta: doc: drop broken mips.com link Antony Pavlov
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Antony Pavlov @ 2013-10-26  9:15 UTC (permalink / raw)
  To: barebox

[PATCH 1/5] MIPS: qemu-malta: doc: drop broken mips.com link
[PATCH 2/5] MIPS: qemu-malta: don't use BoardID address for
[PATCH 3/5] MIPS: qemu-malta: update qemu-malta.dox
[PATCH 4/5] MIPS: qemu-malta: use YAMON-style GT64120 memory map
[PATCH 5/5] MIPS: qemu-malta: doc: add gxemul documentation

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] MIPS: qemu-malta: doc: drop broken mips.com link
  2013-10-26  9:15 [PATCH 0/5] misc qemu-malta patches Antony Pavlov
@ 2013-10-26  9:15 ` Antony Pavlov
  2013-10-26  9:15 ` [PATCH 2/5] MIPS: qemu-malta: don't use BoardID address for executable code Antony Pavlov
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2013-10-26  9:15 UTC (permalink / raw)
  To: barebox

On 8 February 2013 MIPS Technologies was acquired
by Imagination Technologies. Now the http://www.mips.com/ site
is redirected to http://www.imgtec.com/, the Malta development
board page is unreachable.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/boards/qemu-malta/qemu-malta.dox | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/mips/boards/qemu-malta/qemu-malta.dox b/arch/mips/boards/qemu-malta/qemu-malta.dox
index 2e03636..2f2ae51 100644
--- a/arch/mips/boards/qemu-malta/qemu-malta.dox
+++ b/arch/mips/boards/qemu-malta/qemu-malta.dox
@@ -8,7 +8,6 @@ qemu-system-mips -nodefaults -M malta -m 256 -nographic -serial stdio -monitor n
 @endverbatim
 
 Links:
-@li http://www.mips.com/products/development-kits/malta/
 @li http://www.linux-mips.org/wiki/Mips_Malta
 @li http://www.qemu.org/
 
-- 
1.8.4.rc3


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/5] MIPS: qemu-malta: don't use BoardID address for executable code
  2013-10-26  9:15 [PATCH 0/5] misc qemu-malta patches Antony Pavlov
  2013-10-26  9:15 ` [PATCH 1/5] MIPS: qemu-malta: doc: drop broken mips.com link Antony Pavlov
@ 2013-10-26  9:15 ` Antony Pavlov
  2013-10-26  9:15 ` [PATCH 3/5] MIPS: qemu-malta: update qemu-malta.dox Antony Pavlov
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2013-10-26  9:15 UTC (permalink / raw)
  To: barebox

On MIPS Technologies boards 0x1fc00010 address
is reserved for BoardID. The hardware or emulator
intercepts accesses to this address and we can't use
this address for storing code.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/boards/qemu-malta/include/board/board_pbl_start.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

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 bcd9789..a5f29e5 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
@@ -24,6 +24,18 @@
 	.set	push
 	.set	noreorder
 
+	b	__start
+	 nop
+
+	/*
+	   On MIPS Technologies boards
+	   0x1fc00010 address is reserved for BoardID
+	*/
+	.org	0x10
+	.word	0xffffffff
+	.word	0xffffffff
+
+__start:
 	mips_disable_interrupts
 
 	/* cpu specific setup ... */
-- 
1.8.4.rc3


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/5] MIPS: qemu-malta: update qemu-malta.dox
  2013-10-26  9:15 [PATCH 0/5] misc qemu-malta patches Antony Pavlov
  2013-10-26  9:15 ` [PATCH 1/5] MIPS: qemu-malta: doc: drop broken mips.com link Antony Pavlov
  2013-10-26  9:15 ` [PATCH 2/5] MIPS: qemu-malta: don't use BoardID address for executable code Antony Pavlov
@ 2013-10-26  9:15 ` Antony Pavlov
  2013-10-26  9:15 ` [PATCH 4/5] MIPS: qemu-malta: use YAMON-style GT64120 memory map Antony Pavlov
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2013-10-26  9:15 UTC (permalink / raw)
  To: barebox

Only PBL-enabled barebox-flash-image can correctly
get round BoadrID address (0x1fc00010), so let's
recommend barebox-flash-image.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/boards/qemu-malta/qemu-malta.dox | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/boards/qemu-malta/qemu-malta.dox b/arch/mips/boards/qemu-malta/qemu-malta.dox
index 2f2ae51..accb56a 100644
--- a/arch/mips/boards/qemu-malta/qemu-malta.dox
+++ b/arch/mips/boards/qemu-malta/qemu-malta.dox
@@ -4,7 +4,7 @@ Specific to this emulated board is, it does not require any setup code to bring
 
 Emulator run string:
 @verbatim
-qemu-system-mips -nodefaults -M malta -m 256 -nographic -serial stdio -monitor null -bios barebox.bin
+qemu-system-mips -nodefaults -M malta -m 256 -nographic -serial stdio -monitor null -bios barebox-flash-image
 @endverbatim
 
 Links:
-- 
1.8.4.rc3


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/5] MIPS: qemu-malta: use YAMON-style GT64120 memory map
  2013-10-26  9:15 [PATCH 0/5] misc qemu-malta patches Antony Pavlov
                   ` (2 preceding siblings ...)
  2013-10-26  9:15 ` [PATCH 3/5] MIPS: qemu-malta: update qemu-malta.dox Antony Pavlov
@ 2013-10-26  9:15 ` Antony Pavlov
  2013-10-26  9:15 ` [PATCH 5/5] MIPS: qemu-malta: doc: add gxemul documentation Antony Pavlov
  2013-10-28  8:02 ` [PATCH 0/5] misc qemu-malta patches Sascha Hauer
  5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2013-10-26  9:15 UTC (permalink / raw)
  To: barebox

There are some reasons for using YAMON-style memory map:
* we can run Linux kernel from barebox;
* we can use GXemul for running barebox.

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

The files gt64120.h and mach-gt64120.h are imported from Linux.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 .../qemu-malta/include/board/board_pbl_start.h     | 53 ++++++++++++++++++++++
 arch/mips/dts/qemu-malta.dts                       |  4 +-
 arch/mips/include/asm/gt64120.h                    | 37 +++++++++++++++
 arch/mips/mach-malta/include/mach/hardware.h       |  2 +-
 arch/mips/mach-malta/include/mach/mach-gt64120.h   | 13 ++++++
 5 files changed, 106 insertions(+), 3 deletions(-)
 create mode 100644 arch/mips/include/asm/gt64120.h
 create mode 100644 arch/mips/mach-malta/include/mach/mach-gt64120.h

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 a5f29e5..5c15372 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
@@ -20,6 +20,25 @@
 #include <asm/pbl_macros.h>
 #include <asm/pbl_nmon.h>
 
+#include <asm/addrspace.h>
+#include <asm/gt64120.h>
+#include <mach/mach-gt64120.h>
+
+#ifdef CONFIG_CPU_LITTLE_ENDIAN
+#define GT_CPU_TO_LE32(x) (x)
+#elif defined CONFIG_CPU_BIG_ENDIAN
+#define GT_CPU_TO_LE32(x) ( \
+	(((x) & 0x000000ff) << 24) |	\
+	(((x) & 0x0000ff00) <<  8) |	\
+	(((x) & 0x00ff0000) >>  8) |	\
+	(((x) & 0xff000000) >> 24))
+#else
+#error "could not determine byte order"
+#endif
+
+#define	GT_LD(x)	(GT_CPU_TO_LE32(((x) >> 21) & 0x7fff))
+#define	GT_HD(x)	(GT_CPU_TO_LE32(((x) >> 21) & 0x7f))
+
 	.macro	board_pbl_start
 	.set	push
 	.set	noreorder
@@ -41,6 +60,40 @@ __start:
 	/* cpu specific setup ... */
 	/* ... absent */
 
+	/*
+	 * Load BAR registers of GT64120 as done by YAMON
+	 *
+	 * based on write_bootloader() in qemu.git/hw/mips/mips_malta.c
+	 * see GT64120 manual and qemu.git/hw/mips/gt64xxx_pci.c for details
+	 */
+
+	/* move GT64120 registers to 0x1be00000 */
+	li	t1, KSEG1ADDR(GT_DEF_BASE)
+	li	t0, GT_LD(MIPS_GT_BASE)
+	sw	t0, GT_ISD_OFS(t1)
+
+	/*
+	 * setup MEM-to-PCI0 mapping
+	 */
+	li	t1, KSEG1ADDR(MIPS_GT_BASE)
+
+	/* setup PCI0 io window */
+	li	t0, GT_LD(0x18000000)
+	sw	t0, GT_PCI0IOLD_OFS(t1)
+	li	t0, GT_HD(0x181fffff)
+	sw	t0, GT_PCI0IOHD_OFS(t1)
+
+	/* setup PCI0 mem windows */
+	li	t0, GT_LD(0x10000000)
+	sw	t0, GT_PCI0M0LD_OFS(t1)
+	li	t0, GT_HD(0x17efffff)
+	sw	t0, GT_PCI0M0HD_OFS(t1)
+
+	li	t0, GT_LD(0x18200000)
+	sw	t0, GT_PCI0M1LD_OFS(t1)
+	li	t0, GT_LD(0x1bdfffff)
+	sw	t0, GT_PCI0M1HD_OFS(t1)
+
 	mips_nmon
 
 	copy_to_link_location	pbl_start
diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
index 4057729..b6b69c4 100644
--- a/arch/mips/dts/qemu-malta.dts
+++ b/arch/mips/dts/qemu-malta.dts
@@ -17,9 +17,9 @@
 		reg = <0x00000000 0x10000000>;
 	};
 
-	uart0: serial@b00003f8 {
+	uart0: serial@b80003f8 {
 		compatible = "ns16550a";
-		reg = <0xb00003f8 0x08>;
+		reg = <0xb80003f8 0x08>;
 		reg-shift = <0>;
 		/* no matter for emulated port */
 		clock-frequency = <1843200>;
diff --git a/arch/mips/include/asm/gt64120.h b/arch/mips/include/asm/gt64120.h
new file mode 100644
index 0000000..6b2ad0f
--- /dev/null
+++ b/arch/mips/include/asm/gt64120.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2000, 2004, 2005  MIPS Technologies, Inc.
+ *	All rights reserved.
+ *	Authors: Carsten Langgaard <carstenl@mips.com>
+ *		 Maciej W. Rozycki <macro@mips.com>
+ * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope it will be useful, but WITHOUT
+ *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ *  for more details.
+ *
+ */
+#ifndef _ASM_GT64120_H
+#define _ASM_GT64120_H
+
+#define GT_DEF_BASE		0x14000000
+
+/*
+ *  Register offset addresses
+ */
+
+/* CPU Address Decode.	*/
+#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
+
+#endif /* _ASM_GT64120_H */
diff --git a/arch/mips/mach-malta/include/mach/hardware.h b/arch/mips/mach-malta/include/mach/hardware.h
index affb4ea..9345a67 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 MALTA_PIIX4_UART0	0xb00003f8
+#define MALTA_PIIX4_UART0	0xb80003f8
 
 /*
  * Reset register.
diff --git a/arch/mips/mach-malta/include/mach/mach-gt64120.h b/arch/mips/mach-malta/include/mach/mach-gt64120.h
new file mode 100644
index 0000000..ed1e23e
--- /dev/null
+++ b/arch/mips/mach-malta/include/mach/mach-gt64120.h
@@ -0,0 +1,13 @@
+/*
+ *  This is a direct copy of the ev96100.h file, with a global
+ * search and replace.	The numbers are the same.
+ *
+ *  The reason I'm duplicating this is so that the 64120/96100
+ * defines won't be confusing in the source code.
+ */
+#ifndef _ASM_MACH_MIPS_MACH_GT64120_DEP_H
+#define _ASM_MACH_MIPS_MACH_GT64120_DEP_H
+
+#define MIPS_GT_BASE	0x1be00000
+
+#endif /* _ASM_MACH_MIPS_MACH_GT64120_DEP_H */
-- 
1.8.4.rc3


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 5/5] MIPS: qemu-malta: doc: add gxemul documentation
  2013-10-26  9:15 [PATCH 0/5] misc qemu-malta patches Antony Pavlov
                   ` (3 preceding siblings ...)
  2013-10-26  9:15 ` [PATCH 4/5] MIPS: qemu-malta: use YAMON-style GT64120 memory map Antony Pavlov
@ 2013-10-26  9:15 ` Antony Pavlov
  2013-10-28  8:02 ` [PATCH 0/5] misc qemu-malta patches Sascha Hauer
  5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2013-10-26  9:15 UTC (permalink / raw)
  To: barebox

GXemul is another MIPS emulator with Malta board support.
As opposed to qemu GXemul supports only fixed GT64120
YAMON-compatible PCI mapping.

As now barebox uses YAMON-style mapping  we can
use GXemul for barebox run.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/boards/qemu-malta/qemu-malta.dox | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/mips/boards/qemu-malta/qemu-malta.dox b/arch/mips/boards/qemu-malta/qemu-malta.dox
index accb56a..bf10244 100644
--- a/arch/mips/boards/qemu-malta/qemu-malta.dox
+++ b/arch/mips/boards/qemu-malta/qemu-malta.dox
@@ -7,8 +7,14 @@ Emulator run string:
 qemu-system-mips -nodefaults -M malta -m 256 -nographic -serial stdio -monitor null -bios barebox-flash-image
 @endverbatim
 
+Also you can use GXemul:
+@verbatim
+gxemul -Q -x -e maltabe -M 256 0xbfc00000:barebox-flash-image
+@endverbatim
+
 Links:
 @li http://www.linux-mips.org/wiki/Mips_Malta
 @li http://www.qemu.org/
+@li http://gxemul.sourceforge.net/
 
 */
-- 
1.8.4.rc3


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] misc qemu-malta patches
  2013-10-26  9:15 [PATCH 0/5] misc qemu-malta patches Antony Pavlov
                   ` (4 preceding siblings ...)
  2013-10-26  9:15 ` [PATCH 5/5] MIPS: qemu-malta: doc: add gxemul documentation Antony Pavlov
@ 2013-10-28  8:02 ` Sascha Hauer
  5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-10-28  8:02 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Sat, Oct 26, 2013 at 01:15:02PM +0400, Antony Pavlov wrote:
> [PATCH 1/5] MIPS: qemu-malta: doc: drop broken mips.com link
> [PATCH 2/5] MIPS: qemu-malta: don't use BoardID address for
> [PATCH 3/5] MIPS: qemu-malta: update qemu-malta.dox
> [PATCH 4/5] MIPS: qemu-malta: use YAMON-style GT64120 memory map
> [PATCH 5/5] MIPS: qemu-malta: doc: add gxemul documentation

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-28  8:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-26  9:15 [PATCH 0/5] misc qemu-malta patches Antony Pavlov
2013-10-26  9:15 ` [PATCH 1/5] MIPS: qemu-malta: doc: drop broken mips.com link Antony Pavlov
2013-10-26  9:15 ` [PATCH 2/5] MIPS: qemu-malta: don't use BoardID address for executable code Antony Pavlov
2013-10-26  9:15 ` [PATCH 3/5] MIPS: qemu-malta: update qemu-malta.dox Antony Pavlov
2013-10-26  9:15 ` [PATCH 4/5] MIPS: qemu-malta: use YAMON-style GT64120 memory map Antony Pavlov
2013-10-26  9:15 ` [PATCH 5/5] MIPS: qemu-malta: doc: add gxemul documentation Antony Pavlov
2013-10-28  8:02 ` [PATCH 0/5] misc qemu-malta patches Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox