blob: 09da9eae511ea411a541a2908449af9e3c851042 [file] [log] [blame]
Gabor Juhos02c754a2013-05-22 03:57:37 +00001/*
2 * Copyright (C) 2013 Gabor Juhos <juhosg@openwrt.org>
3 *
Tom Rinifba23012013-07-24 09:34:30 -04004 * SPDX-License-Identifier: GPL-2.0
Gabor Juhos02c754a2013-05-22 03:57:37 +00005 */
6
7#include <common.h>
Gabor Juhos439c50c2013-05-22 03:57:44 +00008#include <netdev.h>
Gabor Juhos02c754a2013-05-22 03:57:37 +00009
Gabor Juhos652ccee2013-05-22 03:57:42 +000010#include <asm/addrspace.h>
Gabor Juhosaed4fa42013-05-22 03:57:38 +000011#include <asm/io.h>
12#include <asm/malta.h>
Gabor Juhos652ccee2013-05-22 03:57:42 +000013#include <pci_gt64120.h>
Gabor Juhosaed4fa42013-05-22 03:57:38 +000014
Paul Burton7fb05072013-11-08 11:18:49 +000015#include "superio.h"
16
Gabor Juhos02c754a2013-05-22 03:57:37 +000017phys_size_t initdram(int board_type)
18{
19 return CONFIG_SYS_MEM_SIZE;
20}
21
22int checkboard(void)
23{
24 puts("Board: MIPS Malta CoreLV (Qemu)\n");
25 return 0;
26}
Gabor Juhosaed4fa42013-05-22 03:57:38 +000027
Gabor Juhos439c50c2013-05-22 03:57:44 +000028int board_eth_init(bd_t *bis)
29{
30 return pci_eth_init(bis);
31}
32
Gabor Juhosaed4fa42013-05-22 03:57:38 +000033void _machine_restart(void)
34{
35 void __iomem *reset_base;
36
37 reset_base = (void __iomem *)CKSEG1ADDR(MALTA_RESET_BASE);
38 __raw_writel(GORESET, reset_base);
39}
Gabor Juhos652ccee2013-05-22 03:57:42 +000040
Paul Burton7fb05072013-11-08 11:18:49 +000041int board_early_init_f(void)
42{
43 /* setup FDC37M817 super I/O controller */
44 malta_superio_init((void *)CKSEG1ADDR(MALTA_IO_PORT_BASE));
45
46 return 0;
47}
48
Gabor Juhos652ccee2013-05-22 03:57:42 +000049void pci_init_board(void)
50{
51 set_io_port_base(CKSEG1ADDR(MALTA_IO_PORT_BASE));
52
53 gt64120_pci_init((void *)CKSEG1ADDR(MALTA_GT_BASE),
54 0x00000000, 0x00000000, CONFIG_SYS_MEM_SIZE,
55 0x10000000, 0x10000000, 128 * 1024 * 1024,
56 0x00000000, 0x00000000, 0x20000);
57}