From 5a4dcfac1e05f7c025a465d3372a1c1425004c2b Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Wed, 22 May 2013 03:57:37 +0000 Subject: MIPS: qemu-malta: add support for emulated MIPS Malta board Add minimal support for the MIPS Malta CoreLV board emulated by Qemu. The only supported peripherial is the UART. This is enough to boot U-Boot to the command prompt both in little and big endian mode. Signed-off-by: Gabor Juhos Cc: Daniel Schwierzeck --- board/qemu-malta/qemu-malta.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 board/qemu-malta/qemu-malta.c (limited to 'board/qemu-malta/qemu-malta.c') diff --git a/board/qemu-malta/qemu-malta.c b/board/qemu-malta/qemu-malta.c new file mode 100644 index 0000000..9ba711d --- /dev/null +++ b/board/qemu-malta/qemu-malta.c @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 Gabor Juhos + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include + +phys_size_t initdram(int board_type) +{ + return CONFIG_SYS_MEM_SIZE; +} + +int checkboard(void) +{ + puts("Board: MIPS Malta CoreLV (Qemu)\n"); + return 0; +} -- cgit v1.1 From 015643152aee4c333e3f95d153347f50b7e92ea7 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Wed, 22 May 2013 03:57:38 +0000 Subject: MIPS: qemu-malta: add reset support The MIPS Malta board has a SOFTRES register. Writing a magic value into that register initiates a board reset. Use this feature to implement reset support. Signed-off-by: Gabor Juhos Cc: Daniel Schwierzeck --- board/qemu-malta/qemu-malta.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'board/qemu-malta/qemu-malta.c') diff --git a/board/qemu-malta/qemu-malta.c b/board/qemu-malta/qemu-malta.c index 9ba711d..449da9c 100644 --- a/board/qemu-malta/qemu-malta.c +++ b/board/qemu-malta/qemu-malta.c @@ -8,6 +8,9 @@ #include +#include +#include + phys_size_t initdram(int board_type) { return CONFIG_SYS_MEM_SIZE; @@ -18,3 +21,11 @@ int checkboard(void) puts("Board: MIPS Malta CoreLV (Qemu)\n"); return 0; } + +void _machine_restart(void) +{ + void __iomem *reset_base; + + reset_base = (void __iomem *)CKSEG1ADDR(MALTA_RESET_BASE); + __raw_writel(GORESET, reset_base); +} -- cgit v1.1 From feaa60662768dcc97fdf7c593583876ce4e1564c Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Wed, 22 May 2013 03:57:42 +0000 Subject: MIPS: qemu-malta: add PCI support Qemu emulates the Galileo GT64120 System Controller which provides a CPU bus to PCI bus bridge. The patch adds driver for this bridge and enables PCI support for the emulated Malta board. Signed-off-by: Gabor Juhos Cc: Daniel Schwierzeck --- board/qemu-malta/qemu-malta.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'board/qemu-malta/qemu-malta.c') diff --git a/board/qemu-malta/qemu-malta.c b/board/qemu-malta/qemu-malta.c index 449da9c..e3a733f 100644 --- a/board/qemu-malta/qemu-malta.c +++ b/board/qemu-malta/qemu-malta.c @@ -8,8 +8,10 @@ #include +#include #include #include +#include phys_size_t initdram(int board_type) { @@ -29,3 +31,13 @@ void _machine_restart(void) reset_base = (void __iomem *)CKSEG1ADDR(MALTA_RESET_BASE); __raw_writel(GORESET, reset_base); } + +void pci_init_board(void) +{ + set_io_port_base(CKSEG1ADDR(MALTA_IO_PORT_BASE)); + + gt64120_pci_init((void *)CKSEG1ADDR(MALTA_GT_BASE), + 0x00000000, 0x00000000, CONFIG_SYS_MEM_SIZE, + 0x10000000, 0x10000000, 128 * 1024 * 1024, + 0x00000000, 0x00000000, 0x20000); +} -- cgit v1.1 From f1957499ea545c0ee6d2cbedd3dbc36edc26508d Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Wed, 22 May 2013 03:57:44 +0000 Subject: MIPS: qemu-malta: bring up ethernet Qemu emulates a PCNET PCI card for the Malta CoreLV board. Enable the pcnet driver and add board specific ethernet initialization function to bring it up. Also enable the CONFIG_CMD_NET and CONFIG_CMD_PING options. Signed-off-by: Gabor Juhos Cc: Daniel Schwierzeck --- board/qemu-malta/qemu-malta.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'board/qemu-malta/qemu-malta.c') diff --git a/board/qemu-malta/qemu-malta.c b/board/qemu-malta/qemu-malta.c index e3a733f..4cbd736 100644 --- a/board/qemu-malta/qemu-malta.c +++ b/board/qemu-malta/qemu-malta.c @@ -7,6 +7,7 @@ */ #include +#include #include #include @@ -24,6 +25,11 @@ int checkboard(void) return 0; } +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} + void _machine_restart(void) { void __iomem *reset_base; -- cgit v1.1