Commit ac12984d authored by Gabor Juhos's avatar Gabor Juhos Committed by Tom Rini
Browse files

MIPS: qemu-malta: setup GT64120 registers as done by YAMON

Move the GT64120 register base to 0x1be00000
and setup PCI BAR registers as done by the
original YAMON bootloader.

This is needed for running Linux kernel.
Signed-off-by: default avatarGabor Juhos <>
Cc: Daniel Schwierzeck <>
parent 52caee0f
......@@ -9,10 +9,12 @@
#define MALTA_IO_PORT_BASE 0x10000000
#define MALTA_IO_PORT_BASE 0x18000000
#define MALTA_GT_BASE 0x1be00000
#define MALTA_RESET_BASE 0x1f000500
#define GORESET 0x42
......@@ -6,7 +6,20 @@
* by the Free Software Foundation.
#include <config.h>
#include <gt64120.h>
#include <asm/addrspace.h>
#include <asm/regdef.h>
#include <asm/malta.h>
#define CPU_TO_GT32(_x) ((_x))
#define CPU_TO_GT32(_x) ( \
(((_x) & 0xff) << 24) | (((_x) & 0xff00) << 8) | \
(((_x) & 0xff0000) >> 8) | (((_x) & 0xff000000) >> 24))
.set noreorder
......@@ -15,5 +28,44 @@
.globl lowlevel_init
* Load BAR registers of GT64120 as done by YAMON
* based on a patch sent by Antony Pavlov <>
* to the barebox mailing list.
* The subject of the original patch:
* 'MIPS: qemu-malta: add YAMON-style GT64120 memory map'
* URL:
* based on write_bootloader() in qemu.git/hw/mips_malta.c
* see GT64120 manual and qemu.git/hw/gt64xxx.c for details
/* move GT64120 registers from 0x14000000 to 0x1be00000 */
li t0, CPU_TO_GT32(0xdf000000)
sw t0, GT_ISD_OFS(t1)
/* setup MEM-to-PCI0 mapping */
/* setup PCI0 io window to 0x18000000-0x181fffff */
li t0, CPU_TO_GT32(0xc0000000)
sw t0, GT_PCI0IOLD_OFS(t1)
li t0, CPU_TO_GT32(0x40000000)
sw t0, GT_PCI0IOHD_OFS(t1)
/* setup PCI0 mem windows */
li t0, CPU_TO_GT32(0x80000000)
sw t0, GT_PCI0M0LD_OFS(t1)
li t0, CPU_TO_GT32(0x3f000000)
sw t0, GT_PCI0M0HD_OFS(t1)
li t0, CPU_TO_GT32(0xc1000000)
sw t0, GT_PCI0M1LD_OFS(t1)
li t0, CPU_TO_GT32(0x5e000000)
sw t0, GT_PCI0M1HD_OFS(t1)
jr ra
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment