blob: de259f502b4c174401f5414af1b88d1e47aa38ab [file] [log] [blame]
Yusuke Godac133c1f2008-03-11 12:55:12 +09001/*
Nobuhiro Iwamatsuf309fa32008-03-12 18:02:57 +09002 * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Yusuke Godac133c1f2008-03-11 12:55:12 +09003 * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Yusuke Godac133c1f2008-03-11 12:55:12 +09006 */
7
8#include <common.h>
9#include <ide.h>
10#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}