Skip to contentSkip to conversation

MIPS:Target support for qemu -M mips

PATCH Superseded Vlad Lungu 4 participants 5 messages Jan 16, 2008 – Jan 29, 2008

Subsystems (2)
lore
Share & tools
lore

Vlad Lungu

author
#0 lore raw

PATCH v2 1/1 MIPS:Target support for qemu -M mips

With serial, NE2000, IDE support. Tested in big-endian mode. Memory size hard-coded to 128M for now, so don't play with the -m option.

---
 MAINTAINERS                     |    3 +
 MAKEALL                         |    1 +
 Makefile                        |    6 ++
 board/qemu-mips/Makefile        |   45 +++++++++++
 board/qemu-mips/README          |   11 +++
 board/qemu-mips/config.mk       |   10 +++
 board/qemu-mips/flash.c         |   40 ++++++++++
 board/qemu-mips/lowlevel_init.S |   41 ++++++++++
 board/qemu-mips/qemu-mips.c     |   89 +++++++++++++++++++++
 board/qemu-mips/u-boot.lds      |   72 +++++++++++++++++
 include/configs/qemu-mips.h     |  164 +++++++++++++++++++++++++++++++++++++++
 11 files changed, 482 insertions(+), 0 deletions(-)
 create mode 100644 board/qemu-mips/Makefile
 create mode 100644 board/qemu-mips/README
 create mode 100644 board/qemu-mips/config.mk
 create mode 100644 board/qemu-mips/flash.c
 create mode 100644 board/qemu-mips/lowlevel_init.S
 create mode 100644 board/qemu-mips/qemu-mips.c
 create mode 100644 board/qemu-mips/u-boot.lds
 create mode 100644 include/configs/qemu-mips.h
MAINTAINERS +3 -0
index 40b2b51..ac46786 100644
@@ -578,6 +578,9 @@ Thomas Lange <[email protected]>
 	dbau1x00		MIPS32 Au1000
 	gth2			MIPS32 Au1000
 
+Vlad Lungu <[email protected]>
+	qemu_mips		MIPS32
+
 #########################################################################
 # Nios-32 Systems:							#
 #									#
MAKEALL +1 -0
index bec3541..817fbe6 100755
@@ -541,6 +541,7 @@ LIST_arm="		\
 
 LIST_mips4kc="		\
 	incaip		\
+	qemu_mips	\
 "
 
 LIST_mips5kc="		\
Makefile +6 -0
index 8a888b9..283f7f2 100644
@@ -2595,6 +2595,12 @@ pb1000_config		:	unconfig
 	@echo "#define CONFIG_PB1000 1" >>$(obj)include/config.h
 	@$(MKCONFIG) -a pb1x00 mips mips pb1x00
 
+qemu_mips_config: unconfig
+	@mkdir -p $(obj)include
+	@ >$(obj)include/config.h
+	@echo "#define CONFIG_QEMU_MIPS 1" >>$(obj)include/config.h
+	@$(MKCONFIG) -a qemu-mips mips mips qemu-mips
+
 #########################################################################
 ## MIPS64 5Kc
 #########################################################################
board/qemu-mips/Makefile new file +45 -0

45 lines not on this page · raw message

board/qemu-mips/README new file +11 -0
new file mode 100644
index 0000000..39570b1
@@ -0,0 +1,11 @@
+By Vlad Lungu vlad at comsys.ro 2007-Oct-01
+----------------------------------------
+Qemu is a full system emulator. See
+
+http://fabrice.bellard.free.fr/qemu
+
+Limitations & comments
+----------------------
+Supports the "-m mips" configuration of qemu: serial,NE2000,IDE.
+Support is big endian only for now (or at least this is what I tested).
+Derived from au1x00 with a lot of things cut out.
board/qemu-mips/config.mk new file +10 -0
new file mode 100644
index 0000000..4d4078a
@@ -0,0 +1,10 @@
+#
+# Qemu -M mips system emulator
+# See http://fabrice.bellard.free.fr/qemu
+#
+
+# ROM version
+TEXT_BASE = 0xbfc00000
+
+# RAM version
+#TEXT_BASE = 0x80001000
board/qemu-mips/flash.c new file +40 -0
new file mode 100644
index 0000000..e988272
@@ -0,0 +1,40 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+/*-----------------------------------------------------------------------
+ * flash_init()
+ *
+ * sets up flash_info and returns size of FLASH (bytes)
+ */
+unsigned long flash_init(void)
+{
+	printf("Skipping flash_init\n");
+	return(0);
+}
+
+int write_buff(void *info, uchar *src, ulong addr, ulong cnt)
+{
+	printf("write_buff not implemented\n");
+	return(-1);
+}
board/qemu-mips/lowlevel_init.S new file +41 -0

41 lines not on this page · raw message

board/qemu-mips/qemu-mips.c new file +89 -0

89 lines not on this page · raw message

board/qemu-mips/u-boot.lds new file +72 -0

72 lines not on this page · raw message

include/configs/qemu-mips.h new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
1.5.2.2
#1 lore raw

PATCH v2 1/1 MIPS:Target support for qemu -M mips

Quoted 19 lines · Vlad Lungu

With serial, NE2000, IDE support. Tested in big-endian mode. Memory size hard-coded to 128M for now, so don't play with the -m option.

---

MAINTAINERS                     |    3 +
MAKEALL                         |    1 +
Makefile                        |    6 ++
board/qemu-mips/Makefile        |   45 +++++++++++
board/qemu-mips/README          |   11 +++
board/qemu-mips/config.mk       |   10 +++
board/qemu-mips/flash.c         |   40 ++++++++++
board/qemu-mips/lowlevel_init.S |   41 ++++++++++
board/qemu-mips/qemu-mips.c     |   89 +++++++++++++++++++++
board/qemu-mips/u-boot.lds      |   72 +++++++++++++++++
include/configs/qemu-mips.h     |  164 
+++++++++++++++++++++++++++++++++++++++
11 files changed, 482 insertions(+), 0 deletions(-)
Quoted 8 lines

create mode 100644 board/qemu-mips/Makefile create mode 100644 board/qemu-mips/README create mode 100644 board/qemu-mips/config.mk create mode 100644 board/qemu-mips/flash.c create mode 100644 board/qemu-mips/lowlevel_init.S create mode 100644 board/qemu-mips/qemu-mips.c create mode 100644 board/qemu-mips/u-boot.lds create mode 100644 include/configs/qemu-mips.h

Thanks, applied.

I fixed checkboard() wrong indentations and removed trailing whitespaces from u-boot.lds.

Thanks,

Shinya

#2 lore raw

PATCH v2 1/1 MIPS:Target support for qemu -M mips

In reply to Vlad Lungu

Hi,

Quoted 3 lines · Vlad Lungu

With serial, NE2000, IDE support. Tested in big-endian mode. Memory size hard-coded to 128M for now, so don't play with the -m option.

Just FYI, Qemu platform has been removed from Linux kernel. Reasons are summarized in following commit:
http://www.linux-mips.org/g/linux/3fbfb704

Would it make sense to do the same?

Best regards,
Ladislav Michl

#3 lore raw

PATCH v2 1/1 MIPS:Target support for qemu -M mips

Quoted 3 lines · Ladislav Michl

Just FYI, Qemu platform has been removed from Linux kernel. Reasons are summarized in following commit:
http://www.linux-mips.org/g/linux/3fbfb704

Yeah, summarized also on this thread:

http://www.linux-mips.org/archives/linux-mips/2008-01/msg00121.html

I know this in real-time, and that is a part of the reason why I wan't going to push in rush. I wanted to see how things go for a while.

Quoted 1 line

Would it make sense to do the same?

Hmm, U-Boot doesn't have Malta supported, so I don't think the same. FWIW if we're going to drop the current qemu-mips target, it would be interesting to have QEMU Malta target supported instead.

Shinya

author
#4 lore raw

PATCH v2 1/1 MIPS:Target support for qemu -M mips

Quoted 12 lines · Shinya Kuribayashi
Quoted 4 lines · Ladislav Michl

Just FYI, Qemu platform has been removed from Linux kernel. Reasons are summarized in following commit:
http://www.linux-mips.org/g/linux/3fbfb704

Yeah, summarized also on this thread:

http://www.linux-mips.org/archives/linux-mips/2008-01/msg00121.html

That's a bunch of crap, if you'll excuse my french. The Qemu-Malta implements (not very exactly) support
for the Malta/CoreLV variant, which uses in real-life a (buggy) Galileo GT64120 PCI northbridge, which you can't
get documentation for, unless you probably sign an NDA or something, and it's apparently EOL-ed, and Galileo was
bought by Marvell anyway. So if you want to use network or mass storage, you're SOL if the PCI doesn't work, and it usually
doesn't unless you use Linux 2.6.x for very specific values of x. I used a (recent) VxWorks bootrom image with latest Qemu and
the network simply won't work because of endianness issues with the PCI. And yes, I have the sources. I ported U-Boot to it and
I had to hack the PCI driver like crazy, I'm too embarassed to show it on the mailing list and too disgusted to rework it.

The Qemu platform (as in qemu -M mips) is underfeatured, but it just works. And that's a big plus for me.

Quoted 4 lines

I know this in real-time, and that is a part of the reason why I wan't going to push in rush. I wanted to see how things go for a while.

Quoted 8 lines
Quoted 2 lines

Would it make sense to do the same?

Hmm, U-Boot doesn't have Malta supported, so I don't think the same. FWIW if we're going to drop the current qemu-mips target, it would be interesting to have QEMU Malta target supported instead.

See above for Malta support. I don't have a Malta board available and I won't submit board support that doesn't work
on the real board, but if anyone has a Malta/CoreLV and is willing to add the missing bits and pieces like SDRAM init and
flash and stuff, I'll send him (or her) what I have. Privately.

Vlad