1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2007,2008
4  * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5  */
6 
7 #include <ide.h>
8 #include <init.h>
9 #include <net.h>
10 #include <netdev.h>
11 #include <asm/processor.h>
12 #include <asm/io.h>
13 
checkboard(void)14 int checkboard(void)
15 {
16 	puts("BOARD: Renesas Solutions R2D Plus\n");
17 	return 0;
18 }
19 
board_late_init(void)20 int board_late_init(void)
21 {
22 	return 0;
23 }
24 
25 #define FPGA_BASE		0xA4000000
26 #define FPGA_CFCTL		(FPGA_BASE + 0x04)
27 #define CFCTL_EN		(0x432)
28 #define FPGA_CFPOW		(FPGA_BASE + 0x06)
29 #define CFPOW_ON		(0x02)
30 #define FPGA_CFCDINTCLR	(FPGA_BASE + 0x2A)
31 #define CFCDINTCLR_EN	(0x01)
32 
ide_set_reset(int idereset)33 void ide_set_reset(int idereset)
34 {
35 	/* if reset = 1 IDE reset will be asserted */
36 	if (idereset) {
37 		outw(CFCTL_EN, FPGA_CFCTL);	/* CF enable */
38 		outw(inw(FPGA_CFPOW)|CFPOW_ON, FPGA_CFPOW); /* Power OM */
39 		outw(CFCDINTCLR_EN, FPGA_CFCDINTCLR); /* Int clear */
40 	}
41 }
42 
43 #ifndef CONFIG_DM_ETH
board_eth_init(struct bd_info * bis)44 int board_eth_init(struct bd_info *bis)
45 {
46 	return pci_eth_init(bis);
47 }
48 #endif
49