blob: 8dbeeb6e680c3e31c8cc230115de3ec0f96b1bab [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Yusuke Godac133c1f2008-03-11 12:55:12 +09002/*
Nobuhiro Iwamatsuf309fa32008-03-12 18:02:57 +09003 * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Yusuke Godac133c1f2008-03-11 12:55:12 +09004 * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
Yusuke Godac133c1f2008-03-11 12:55:12 +09005 */
6
7#include <common.h>
8#include <ide.h>
Simon Glass2cf431c2019-11-14 12:57:47 -07009#include <init.h>
Yusuke Godac133c1f2008-03-11 12:55:12 +090010#include <asm/processor.h>
11#include <asm/io.h>
12#include <asm/pci.h>
Ben Warren02d69892008-08-31 09:49:42 -070013#include <netdev.h>
Yusuke Godac133c1f2008-03-11 12:55:12 +090014#include "r7780mp.h"
15
16int checkboard(void)
17{
18#if defined(CONFIG_R7780MP)
19 puts("BOARD: Renesas Solutions R7780MP\n");
20#else
21 puts("BOARD: Renesas Solutions R7780RP\n");
22#endif
23 return 0;
24}
25
26int board_init(void)
27{
28 /* SCIF Enable */
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090029 writew(0x0, PHCR);
Yusuke Godac133c1f2008-03-11 12:55:12 +090030
Yusuke Godac133c1f2008-03-11 12:55:12 +090031 return 0;
32}
33
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090034void led_set_state(unsigned short value)
Yusuke Godac133c1f2008-03-11 12:55:12 +090035{
36
37}
38
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090039void ide_set_reset(int idereset)
Yusuke Godac133c1f2008-03-11 12:55:12 +090040{
41 /* if reset = 1 IDE reset will be asserted */
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090042 if (idereset) {
43 writew(0x432, FPGA_CFCTL);
Yusuke Godac133c1f2008-03-11 12:55:12 +090044#if defined(CONFIG_R7780MP)
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090045 writew(inw(FPGA_CFPOW)|0x01, FPGA_CFPOW);
Yusuke Godac133c1f2008-03-11 12:55:12 +090046#else
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090047 writew(inw(FPGA_CFPOW)|0x02, FPGA_CFPOW);
Yusuke Godac133c1f2008-03-11 12:55:12 +090048#endif
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090049 writew(0x01, FPGA_CFCDINTCLR);
Yusuke Godac133c1f2008-03-11 12:55:12 +090050 }
51}
52
Yusuke Godac133c1f2008-03-11 12:55:12 +090053static struct pci_controller hose;
54void pci_init_board(void)
55{
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090056 pci_sh7780_init(&hose);
Yusuke Godac133c1f2008-03-11 12:55:12 +090057}
Ben Warren02d69892008-08-31 09:49:42 -070058
59int board_eth_init(bd_t *bis)
60{
Bernhard Kaindld0201692011-10-20 10:56:59 +000061 /* return >= 0 if a chip is found, the board's AX88796L is n2k-based */
62 return ne2k_register() + pci_eth_init(bis);
Ben Warren02d69892008-08-31 09:49:42 -070063}