diff options
author | H. Nikolaus Schaller <hns@goldelico.com> | 2012-03-26 20:55:28 +0200 |
---|---|---|
committer | H. Nikolaus Schaller <hns@goldelico.com> | 2012-03-26 20:55:28 +0200 |
commit | 92988a21ad4c4c9504295ccb580c9f806134471b (patch) | |
tree | 5effc9f14170112450de05c67dafbe8d5034d595 /u-boot/board/qemu-mips | |
parent | ca2b506783b676c95762c54ea24dcfdaae1947c9 (diff) | |
download | bootable_bootloader_goldelico_gta04-92988a21ad4c4c9504295ccb580c9f806134471b.zip bootable_bootloader_goldelico_gta04-92988a21ad4c4c9504295ccb580c9f806134471b.tar.gz bootable_bootloader_goldelico_gta04-92988a21ad4c4c9504295ccb580c9f806134471b.tar.bz2 |
added boot script files to repository
Diffstat (limited to 'u-boot/board/qemu-mips')
-rw-r--r-- | u-boot/board/qemu-mips/Makefile | 45 | ||||
-rw-r--r-- | u-boot/board/qemu-mips/README | 15 | ||||
-rw-r--r-- | u-boot/board/qemu-mips/config.mk | 10 | ||||
-rw-r--r-- | u-boot/board/qemu-mips/lowlevel_init.S | 40 | ||||
-rw-r--r-- | u-boot/board/qemu-mips/qemu-mips.c | 89 | ||||
-rw-r--r-- | u-boot/board/qemu-mips/u-boot.lds | 72 |
6 files changed, 271 insertions, 0 deletions
diff --git a/u-boot/board/qemu-mips/Makefile b/u-boot/board/qemu-mips/Makefile new file mode 100644 index 0000000..6251bb8 --- /dev/null +++ b/u-boot/board/qemu-mips/Makefile @@ -0,0 +1,45 @@ +# +# (C) Copyright 2003-2006 +# Wolfgang Denk, DENX Software Engineering, wd@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 $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS = $(BOARD).o +SOBJS = lowlevel_init.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/u-boot/board/qemu-mips/README b/u-boot/board/qemu-mips/README new file mode 100644 index 0000000..565241b --- /dev/null +++ b/u-boot/board/qemu-mips/README @@ -0,0 +1,15 @@ +By Vlad Lungu vlad.lungu@windriver.com 2007-Oct-01 +---------------------------------------- +Qemu is a full system emulator. See + +http://www.nongnu.org/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. + +Supports emulated flash (patch Jean-Christophe PLAGNIOL-VILLARD) with +recent qemu versions. When using emulated flash, launch with +-pflash <filename> and erase mips_bios.bin. diff --git a/u-boot/board/qemu-mips/config.mk b/u-boot/board/qemu-mips/config.mk new file mode 100644 index 0000000..27cd34a --- /dev/null +++ b/u-boot/board/qemu-mips/config.mk @@ -0,0 +1,10 @@ +# +# Qemu -M mips system emulator +# See http://fabrice.bellard.free.fr/qemu +# + +# ROM version +CONFIG_SYS_TEXT_BASE = 0xbfc00000 + +# RAM version +#CONFIG_SYS_TEXT_BASE = 0x80001000 diff --git a/u-boot/board/qemu-mips/lowlevel_init.S b/u-boot/board/qemu-mips/lowlevel_init.S new file mode 100644 index 0000000..b0f7072 --- /dev/null +++ b/u-boot/board/qemu-mips/lowlevel_init.S @@ -0,0 +1,40 @@ +/* Memory sub-system initialization code */ + +#include <config.h> +#include <asm/regdef.h> +#include <asm/mipsregs.h> + + .text + .set noreorder + .set mips32 + + .globl lowlevel_init +lowlevel_init: + + /* + * Step 2) Establish Status Register + * (set BEV, clear ERL, clear EXL, clear IE) + */ + li t1, 0x00400000 + mtc0 t1, CP0_STATUS + + /* + * Step 3) Establish CP0 Config0 + * (set K0=3) + */ + li t1, 0x00000003 + mtc0 t1, CP0_CONFIG + + /* + * Step 7) Establish Cause + * (set IV bit) + */ + li t1, 0x00800000 + mtc0 t1, CP0_CAUSE + + /* Establish Wired (and Random) */ + mtc0 zero, CP0_WIRED + nop + + jr ra + nop diff --git a/u-boot/board/qemu-mips/qemu-mips.c b/u-boot/board/qemu-mips/qemu-mips.c new file mode 100644 index 0000000..7a69a00 --- /dev/null +++ b/u-boot/board/qemu-mips/qemu-mips.c @@ -0,0 +1,89 @@ +/* + * (C) Copyright 2007 + * Vlad Lungu vlad.lungu@windriver.com + * + * 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> +#include <command.h> +#include <asm/mipsregs.h> +#include <asm/io.h> + +phys_size_t initdram(int board_type) +{ + /* Sdram is setup by assembler code */ + /* If memory could be changed, we should return the true value here */ + return MEM_SIZE*1024*1024; +} + +int checkboard(void) +{ + u32 proc_id; + u32 config1; + + proc_id = read_c0_prid(); + printf("Board: Qemu -M mips CPU: "); + switch (proc_id) { + case 0x00018000: + printf("4Kc"); + break; + case 0x00018400: + printf("4KEcR1"); + break; + case 0x00019000: + printf("4KEc"); + break; + case 0x00019300: + config1 = read_c0_config1(); + if (config1 & 1) + printf("24Kf"); + else + printf("24Kc"); + break; + case 0x00019500: + printf("34Kf"); + break; + case 0x00000400: + printf("R4000"); + break; + case 0x00018100: + config1 = read_c0_config1(); + if (config1 & 1) + printf("5Kf"); + else + printf("5Kc"); + break; + case 0x000182a0: + printf("20Kc"); + break; + + default: + printf("unknown"); + } + printf(" proc_id=0x%x\n", proc_id); + + return 0; +} + +int misc_init_r(void) +{ + set_io_port_base(0); + return 0; +} diff --git a/u-boot/board/qemu-mips/u-boot.lds b/u-boot/board/qemu-mips/u-boot.lds new file mode 100644 index 0000000..bd16786 --- /dev/null +++ b/u-boot/board/qemu-mips/u-boot.lds @@ -0,0 +1,72 @@ +/* + * (C) Copyright 2003 + * Wolfgang Denk Engineering, <wd@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 + */ + +/* +OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips") +*/ +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips") +OUTPUT_ARCH(mips) +ENTRY(_start) +SECTIONS +{ + . = 0x00000000; + + . = ALIGN(4); + .text : + { + *(.text) + } + + . = ALIGN(4); + .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } + + . = ALIGN(4); + .data : { *(.data) } + + . = .; + _gp = ALIGN(16) +0x7ff0; + + .got : { + __got_start = .; + *(.got) + __got_end = .; + } + + . = ALIGN(4); + .sdata : { *(.sdata) } + + . = .; + .u_boot_cmd : { + __u_boot_cmd_start = .; + *(.u_boot_cmd) + __u_boot_cmd_end = .; + } + + uboot_end_data = .; + num_got_entries = (__got_end - __got_start) >> 2; + + . = ALIGN(4); + .sbss : { *(.sbss) } + .bss : { *(.bss) . = ALIGN(4); } + uboot_end = .; +} |