* [PATCH 0/3] MIPS Malta serial port fixups
@ 2015-02-13 5:53 Antony Pavlov
2015-02-13 5:53 ` [PATCH 1/3] MIPS: qemu-malta_defconfig: set BAUDRATE=38400 Antony Pavlov
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Antony Pavlov @ 2015-02-13 5:53 UTC (permalink / raw)
To: barebox
Yesterday I tested qemu-malta barebox on a real MIPS Malta board.
Barebox runs on real board with some limitations.
This patchseries fixes trivial serial port errors
found during barebox real board experiments.
real Malta pico-howto
=====================
There are several configurations for Malta board.
The Malta board at my disposal is a rather new board
with MIPS ROC-it2 system controller. But qemu emulates
the board with old GT64120 system controller.
So additional workaround is needed:
we have to disable GT64120 initialization in pbl and
change serial port base addresses; also PCI has to be disabled
in the .config.
Here is the patch:
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 5c15372..7975044 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
@@ -60,6 +60,7 @@ __start:
/* cpu specific setup ... */
/* ... absent */
+#if 0
/*
* Load BAR registers of GT64120 as done by YAMON
*
@@ -93,6 +94,7 @@ __start:
sw t0, GT_PCI0M1LD_OFS(t1)
li t0, GT_LD(0x1bdfffff)
sw t0, GT_PCI0M1HD_OFS(t1)
+#endif
mips_nmon
diff --git a/arch/mips/boards/qemu-malta/include/board/debug_ll.h b/arch/mips/boards/qemu-malta/include/board/debug_ll.h
index abeee53..e6ae9b5 100644
--- a/arch/mips/boards/qemu-malta/include/board/debug_ll.h
+++ b/arch/mips/boards/qemu-malta/include/board/debug_ll.h
@@ -20,7 +20,7 @@
#include <mach/hardware.h>
-#define DEBUG_LL_UART_ADDR MALTA_PIIX4_UART0
+#define DEBUG_LL_UART_ADDR 0xbb0003f8
#define DEBUG_LL_UART_SHIFT 0
#define DEBUG_LL_UART_CLK 1843200
diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
index 9b0c594..ece7555 100644
--- a/arch/mips/dts/qemu-malta.dts
+++ b/arch/mips/dts/qemu-malta.dts
@@ -19,7 +19,7 @@
uart0: serial@180003f8 {
compatible = "ns16550a";
- reg = <0x180003f8 0x08>;
+ reg = <0x1b0003f8 0x08>;
reg-shift = <0>;
/* no matter for emulated port */
clock-frequency = <1843200>;
Using YAMON to run barebox
--------------------------
YAMON can be used to load barebox from tftp-server:
YAMON> setenv ipaddr 10.0.0.177
YAMON> setenv subnetmask 255.255.255.0
YAMON> ping 10.0.0.1
64 bytes ICMP-ECHO-REPLY user data received from 10.0.0.1
YAMON> fread tftp://10.0.0.1/antony/zbarebox.bin 0xa0100000
YAMON> go 0xa0100000
Please see http://www.jackslab.org/?p=274 for more YAMON usage examples.
Antony Pavlov (3):
MIPS: qemu-malta_defconfig: set BAUDRATE=38400
MIPS: qemu-malta: debug_ll: fix serial port speed
MIPS: add gxemul-malta_defconfig
Documentation/boards/mips/qemu-malta.rst | 17 +++++--
.../boards/qemu-malta/include/board/debug_ll.h | 5 +-
arch/mips/configs/gxemul-malta_defconfig | 57 ++++++++++++++++++++++
arch/mips/configs/qemu-malta_defconfig | 4 +-
4 files changed, 76 insertions(+), 7 deletions(-)
create mode 100644 arch/mips/configs/gxemul-malta_defconfig
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] MIPS: qemu-malta_defconfig: set BAUDRATE=38400
2015-02-13 5:53 [PATCH 0/3] MIPS Malta serial port fixups Antony Pavlov
@ 2015-02-13 5:53 ` Antony Pavlov
2015-02-13 5:53 ` [PATCH 2/3] MIPS: qemu-malta: debug_ll: fix serial port speed Antony Pavlov
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Antony Pavlov @ 2015-02-13 5:53 UTC (permalink / raw)
To: barebox
MIPS Malta's YAMON PROM monitor uses serial port speed=38400
(see Malta(tm) User's Manual for details).
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/configs/qemu-malta_defconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
index a5af258..62b5e76 100644
--- a/arch/mips/configs/qemu-malta_defconfig
+++ b/arch/mips/configs/qemu-malta_defconfig
@@ -2,8 +2,8 @@ CONFIG_BUILTIN_DTB=y
CONFIG_BUILTIN_DTB_NAME="qemu-malta"
CONFIG_PBL_IMAGE=y
CONFIG_STACK_SIZE=0x7000
-CONFIG_BROKEN=y
CONFIG_EXPERIMENTAL=y
+CONFIG_BAUDRATE=38400
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
@@ -38,9 +38,9 @@ CONFIG_CMD_PING=y
CONFIG_CMD_TFTP=y
CONFIG_CMD_ECHO_E=y
CONFIG_CMD_EDIT=y
+CONFIG_CMD_LOGIN=y
CONFIG_CMD_MENU=y
CONFIG_CMD_MENU_MANAGEMENT=y
-CONFIG_CMD_LOGIN=y
CONFIG_CMD_PASSWD=y
CONFIG_CMD_READLINE=y
CONFIG_CMD_TIMEOUT=y
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] MIPS: qemu-malta: debug_ll: fix serial port speed
2015-02-13 5:53 [PATCH 0/3] MIPS Malta serial port fixups Antony Pavlov
2015-02-13 5:53 ` [PATCH 1/3] MIPS: qemu-malta_defconfig: set BAUDRATE=38400 Antony Pavlov
@ 2015-02-13 5:53 ` Antony Pavlov
2015-02-13 5:53 ` [PATCH 3/3] MIPS: add gxemul-malta_defconfig Antony Pavlov
2015-02-16 5:32 ` [PATCH 0/3] MIPS Malta serial port fixups Sascha Hauer
3 siblings, 0 replies; 6+ messages in thread
From: Antony Pavlov @ 2015-02-13 5:53 UTC (permalink / raw)
To: barebox
qemu-malta.dts uses clock-frequency = <1843200>,
but debug_ll.h for Malta uses another value.
This patch fixes this inconsistency.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/boards/qemu-malta/include/board/debug_ll.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/mips/boards/qemu-malta/include/board/debug_ll.h b/arch/mips/boards/qemu-malta/include/board/debug_ll.h
index 1e56040..abeee53 100644
--- a/arch/mips/boards/qemu-malta/include/board/debug_ll.h
+++ b/arch/mips/boards/qemu-malta/include/board/debug_ll.h
@@ -22,6 +22,9 @@
#define DEBUG_LL_UART_ADDR MALTA_PIIX4_UART0
#define DEBUG_LL_UART_SHIFT 0
-#define DEBUG_LL_UART_DIVISOR 1843200 /* no matter for emulated port */
+
+#define DEBUG_LL_UART_CLK 1843200
+#define DEBUG_LL_UART_BPS CONFIG_BAUDRATE
+#define DEBUG_LL_UART_DIVISOR (DEBUG_LL_UART_CLK / DEBUG_LL_UART_BPS)
#endif /* __INCLUDE_BOARD_DEBUG_LL_QEMU_MALTA_H__ */
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/3] MIPS: add gxemul-malta_defconfig
2015-02-13 5:53 [PATCH 0/3] MIPS Malta serial port fixups Antony Pavlov
2015-02-13 5:53 ` [PATCH 1/3] MIPS: qemu-malta_defconfig: set BAUDRATE=38400 Antony Pavlov
2015-02-13 5:53 ` [PATCH 2/3] MIPS: qemu-malta: debug_ll: fix serial port speed Antony Pavlov
@ 2015-02-13 5:53 ` Antony Pavlov
2015-02-16 5:32 ` [PATCH 0/3] MIPS Malta serial port fixups Sascha Hauer
3 siblings, 0 replies; 6+ messages in thread
From: Antony Pavlov @ 2015-02-13 5:53 UTC (permalink / raw)
To: barebox
GXemul supports MIPS Malta but with some limitations.
The most notable problems:
* PCI-enabled barebox just hangs under GXemul;
* by default gxemul uses 5Kc processor,
so we have to force MIPS32R1 processor usage.
To fix these problems the special gxemul-malta_defconfig
is introduced and the board's documentation is updated.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
Documentation/boards/mips/qemu-malta.rst | 17 +++++++---
arch/mips/configs/gxemul-malta_defconfig | 57 ++++++++++++++++++++++++++++++++
2 files changed, 70 insertions(+), 4 deletions(-)
create mode 100644 arch/mips/configs/gxemul-malta_defconfig
diff --git a/Documentation/boards/mips/qemu-malta.rst b/Documentation/boards/mips/qemu-malta.rst
index 22da600..0c4d639 100644
--- a/Documentation/boards/mips/qemu-malta.rst
+++ b/Documentation/boards/mips/qemu-malta.rst
@@ -10,10 +10,6 @@ QEMU run string::
-nographic -serial stdio -monitor null \
-bios barebox-flash-image
-Also you can use GXemul::
-
- gxemul -Q -x -e maltabe -M 256 0xbfc00000:barebox-flash-image
-
Little-endian mode
------------------
@@ -35,6 +31,19 @@ QEMU run string::
-bios barebox-flash-image
+Using GXemul
+------------
+
+GXemul supports MIPS Malta except PCI stuff.
+You can use GXemul to run little-endian barebox (use gxemul-malta_defconfig).
+
+N.B. There is no need to swap words in ``zbarebox.bin`` for little-endian GXemul!
+
+GXemul run string::
+
+ gxemul -Q -e malta -M 256 0xbfc00000:barebox-flash-image
+
+
Links
-----
diff --git a/arch/mips/configs/gxemul-malta_defconfig b/arch/mips/configs/gxemul-malta_defconfig
new file mode 100644
index 0000000..2352d38
--- /dev/null
+++ b/arch/mips/configs/gxemul-malta_defconfig
@@ -0,0 +1,57 @@
+CONFIG_BUILTIN_DTB=y
+CONFIG_BUILTIN_DTB_NAME="qemu-malta"
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32_R1=y
+CONFIG_PBL_IMAGE=y
+CONFIG_STACK_SIZE=0x7000
+CONFIG_EXPERIMENTAL=y
+CONFIG_BAUDRATE=38400
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_MENU=y
+CONFIG_PARTITION=y
+# CONFIG_DEFAULT_ENVIRONMENT is not set
+CONFIG_POLLER=y
+CONFIG_LONGHELP=y
+CONFIG_CMD_IOMEM=y
+CONFIG_CMD_IMD=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_BOOTM_SHOW_TYPE=y
+CONFIG_CMD_GO=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_LOADY=y
+CONFIG_CMD_RESET=y
+CONFIG_CMD_PARTITION=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_LOADENV=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_MD5SUM=y
+CONFIG_CMD_SHA1SUM=y
+CONFIG_CMD_SHA256SUM=y
+CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_GETOPT=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_LOGIN=y
+CONFIG_CMD_MENU=y
+CONFIG_CMD_MENU_MANAGEMENT=y
+CONFIG_CMD_PASSWD=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_OF_NODE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_TIME=y
+CONFIG_OFDEVICE=y
+CONFIG_OF_BAREBOX_DRIVERS=y
+# CONFIG_SPI is not set
+CONFIG_FS_CRAMFS=y
+CONFIG_FS_FAT=y
+CONFIG_FS_FAT_WRITE=y
+CONFIG_FS_FAT_LFN=y
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] MIPS Malta serial port fixups
2015-02-13 5:53 [PATCH 0/3] MIPS Malta serial port fixups Antony Pavlov
` (2 preceding siblings ...)
2015-02-13 5:53 ` [PATCH 3/3] MIPS: add gxemul-malta_defconfig Antony Pavlov
@ 2015-02-16 5:32 ` Sascha Hauer
2015-02-16 10:02 ` Antony Pavlov
3 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2015-02-16 5:32 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
Hi Antony,
On Fri, Feb 13, 2015 at 08:53:11AM +0300, Antony Pavlov wrote:
> Yesterday I tested qemu-malta barebox on a real MIPS Malta board.
> Barebox runs on real board with some limitations.
> This patchseries fixes trivial serial port errors
> found during barebox real board experiments.
Applied all, thanks.
Do you plan to add real hardware support?
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] 6+ messages in thread
* Re: [PATCH 0/3] MIPS Malta serial port fixups
2015-02-16 5:32 ` [PATCH 0/3] MIPS Malta serial port fixups Sascha Hauer
@ 2015-02-16 10:02 ` Antony Pavlov
0 siblings, 0 replies; 6+ messages in thread
From: Antony Pavlov @ 2015-02-16 10:02 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On Mon, 16 Feb 2015 06:32:42 +0100
Sascha Hauer <s.hauer@pengutronix.de> wrote:
> Hi Antony,
>
> On Fri, Feb 13, 2015 at 08:53:11AM +0300, Antony Pavlov wrote:
> > Yesterday I tested qemu-malta barebox on a real MIPS Malta board.
> > Barebox runs on real board with some limitations.
> > This patchseries fixes trivial serial port errors
> > found during barebox real board experiments.
>
> Applied all, thanks.
>
> Do you plan to add real hardware support?
It depends on aviability of real hardware and my free time.
Just now I can work with this Malta board remotly from time to time.
YAMON-02.22 sources are available at official MIPS site,
so some information on system controller can be obtained there.
Full YAMON replacement may be difficult but I think I can try to add
PCI support on real hardware.
--
Best regards,
Antony Pavlov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-02-16 9:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-13 5:53 [PATCH 0/3] MIPS Malta serial port fixups Antony Pavlov
2015-02-13 5:53 ` [PATCH 1/3] MIPS: qemu-malta_defconfig: set BAUDRATE=38400 Antony Pavlov
2015-02-13 5:53 ` [PATCH 2/3] MIPS: qemu-malta: debug_ll: fix serial port speed Antony Pavlov
2015-02-13 5:53 ` [PATCH 3/3] MIPS: add gxemul-malta_defconfig Antony Pavlov
2015-02-16 5:32 ` [PATCH 0/3] MIPS Malta serial port fixups Sascha Hauer
2015-02-16 10:02 ` Antony Pavlov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox