xref: /openbmc/u-boot/board/renesas/r7780mp/r7780mp.c (revision 78a88f79)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4  * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
5  */
6 
7 #include <common.h>
8 #include <ide.h>
9 #include <asm/processor.h>
10 #include <asm/io.h>
11 #include <asm/pci.h>
12 #include <netdev.h>
13 #include "r7780mp.h"
14 
15 int checkboard(void)
16 {
17 #if defined(CONFIG_R7780MP)
18 	puts("BOARD: Renesas Solutions R7780MP\n");
19 #else
20 	puts("BOARD: Renesas Solutions R7780RP\n");
21 #endif
22 	return 0;
23 }
24 
25 int board_init(void)
26 {
27 	/* SCIF Enable */
28 	writew(0x0, PHCR);
29 
30 	return 0;
31 }
32 
33 void led_set_state(unsigned short value)
34 {
35 
36 }
37 
38 void ide_set_reset(int idereset)
39 {
40 	/* if reset = 1 IDE reset will be asserted */
41 	if (idereset) {
42 		writew(0x432, FPGA_CFCTL);
43 #if defined(CONFIG_R7780MP)
44 		writew(inw(FPGA_CFPOW)|0x01, FPGA_CFPOW);
45 #else
46 		writew(inw(FPGA_CFPOW)|0x02, FPGA_CFPOW);
47 #endif
48 		writew(0x01, FPGA_CFCDINTCLR);
49 	}
50 }
51 
52 static struct pci_controller hose;
53 void pci_init_board(void)
54 {
55 	pci_sh7780_init(&hose);
56 }
57 
58 int board_eth_init(bd_t *bis)
59 {
60 	/* return >= 0 if a chip is found, the board's AX88796L is n2k-based */
61 	return ne2k_register() + pci_eth_init(bis);
62 }
63