blob: 8dbeeb6e680c3e31c8cc230115de3ec0f96b1bab [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Yusuke Godacf236022008-03-11 12:55:12 +09002/*
Nobuhiro Iwamatsud76619d2008-03-12 18:02:57 +09003 * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Yusuke Godacf236022008-03-11 12:55:12 +09004 * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
Yusuke Godacf236022008-03-11 12:55:12 +09005 */
6
7#include <common.h>
8#include <ide.h>
Simon Glass18afe102019-11-14 12:57:47 -07009#include <init.h>
Yusuke Godacf236022008-03-11 12:55:12 +090010#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}