17a9d109bSPaul Burton /* 27a9d109bSPaul Burton * Copyright (C) 2013 Gabor Juhos <juhosg@openwrt.org> 37a9d109bSPaul Burton * 47a9d109bSPaul Burton * SPDX-License-Identifier: GPL-2.0 57a9d109bSPaul Burton */ 67a9d109bSPaul Burton 77a9d109bSPaul Burton #include <common.h> 87a9d109bSPaul Burton #include <netdev.h> 97a9d109bSPaul Burton 107a9d109bSPaul Burton #include <asm/addrspace.h> 117a9d109bSPaul Burton #include <asm/io.h> 127a9d109bSPaul Burton #include <asm/malta.h> 137a9d109bSPaul Burton #include <pci_gt64120.h> 147a9d109bSPaul Burton 15*a257f626SPaul Burton #include "superio.h" 16*a257f626SPaul Burton 177a9d109bSPaul Burton phys_size_t initdram(int board_type) 187a9d109bSPaul Burton { 197a9d109bSPaul Burton return CONFIG_SYS_MEM_SIZE; 207a9d109bSPaul Burton } 217a9d109bSPaul Burton 227a9d109bSPaul Burton int checkboard(void) 237a9d109bSPaul Burton { 247a9d109bSPaul Burton puts("Board: MIPS Malta CoreLV (Qemu)\n"); 257a9d109bSPaul Burton return 0; 267a9d109bSPaul Burton } 277a9d109bSPaul Burton 287a9d109bSPaul Burton int board_eth_init(bd_t *bis) 297a9d109bSPaul Burton { 307a9d109bSPaul Burton return pci_eth_init(bis); 317a9d109bSPaul Burton } 327a9d109bSPaul Burton 337a9d109bSPaul Burton void _machine_restart(void) 347a9d109bSPaul Burton { 357a9d109bSPaul Burton void __iomem *reset_base; 367a9d109bSPaul Burton 377a9d109bSPaul Burton reset_base = (void __iomem *)CKSEG1ADDR(MALTA_RESET_BASE); 387a9d109bSPaul Burton __raw_writel(GORESET, reset_base); 397a9d109bSPaul Burton } 407a9d109bSPaul Burton 41*a257f626SPaul Burton int board_early_init_f(void) 42*a257f626SPaul Burton { 43*a257f626SPaul Burton /* setup FDC37M817 super I/O controller */ 44*a257f626SPaul Burton malta_superio_init((void *)CKSEG1ADDR(MALTA_IO_PORT_BASE)); 45*a257f626SPaul Burton 46*a257f626SPaul Burton return 0; 47*a257f626SPaul Burton } 48*a257f626SPaul Burton 497a9d109bSPaul Burton void pci_init_board(void) 507a9d109bSPaul Burton { 517a9d109bSPaul Burton set_io_port_base(CKSEG1ADDR(MALTA_IO_PORT_BASE)); 527a9d109bSPaul Burton 537a9d109bSPaul Burton gt64120_pci_init((void *)CKSEG1ADDR(MALTA_GT_BASE), 547a9d109bSPaul Burton 0x00000000, 0x00000000, CONFIG_SYS_MEM_SIZE, 557a9d109bSPaul Burton 0x10000000, 0x10000000, 128 * 1024 * 1024, 567a9d109bSPaul Burton 0x00000000, 0x00000000, 0x20000); 577a9d109bSPaul Burton } 58