blob: de259f502b4c174401f5414af1b88d1e47aa38ab [file] [log] [blame]
Yusuke Godacf236022008-03-11 12:55:12 +09001/*
Nobuhiro Iwamatsud76619d2008-03-12 18:02:57 +09002 * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Yusuke Godacf236022008-03-11 12:55:12 +09003 * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Yusuke Godacf236022008-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 Warren26425a62008-08-31 09:49:42 -070013#include <netdev.h>
Yusuke Godacf236022008-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 Iwamatsu9aa0bd72008-06-17 16:27:41 +090029 writew(0x0, PHCR);
Yusuke Godacf236022008-03-11 12:55:12 +090030
Yusuke Godacf236022008-03-11 12:55:12 +090031 return 0;
32}
33
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090034void led_set_state(unsigned short value)
Yusuke Godacf236022008-03-11 12:55:12 +090035{
36
37}
38
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090039void ide_set_reset(int idereset)
Yusuke Godacf236022008-03-11 12:55:12 +090040{
41 /* if reset = 1 IDE reset will be asserted */
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090042 if (idereset) {
43 writew(0x432, FPGA_CFCTL);
Yusuke Godacf236022008-03-11 12:55:12 +090044#if defined(CONFIG_R7780MP)
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090045 writew(inw(FPGA_CFPOW)|0x01, FPGA_CFPOW);
Yusuke Godacf236022008-03-11 12:55:12 +090046#else
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090047 writew(inw(FPGA_CFPOW)|0x02, FPGA_CFPOW);
Yusuke Godacf236022008-03-11 12:55:12 +090048#endif
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090049 writew(0x01, FPGA_CFCDINTCLR);
Yusuke Godacf236022008-03-11 12:55:12 +090050 }
51}
52
Yusuke Godacf236022008-03-11 12:55:12 +090053static struct pci_controller hose;
54void pci_init_board(void)
55{
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090056 pci_sh7780_init(&hose);
Yusuke Godacf236022008-03-11 12:55:12 +090057}
Ben Warren26425a62008-08-31 09:49:42 -070058
59int board_eth_init(bd_t *bis)
60{
Bernhard Kaindladb18ea2011-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 Warren26425a62008-08-31 09:49:42 -070063}