blob: e2c5c5ba937c9c8726d1ce42a4413418d243fafb [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>
9#include <asm/processor.h>
10#include <asm/io.h>
11#include <asm/pci.h>
Ben Warren26425a62008-08-31 09:49:42 -070012#include <netdev.h>
Yusuke Godacf236022008-03-11 12:55:12 +090013#include "r7780mp.h"
14
15int checkboard(void)
16{
17#if defined(CONFIG_R7780MP)
18 puts("BOARD: Renesas Solutions R7780MP\n");
19#else
20 puts("BOARD: Renesas Solutions R7780RP\n");
21#endif
22 return 0;
23}
24
25int board_init(void)
26{
27 /* SCIF Enable */
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090028 writew(0x0, PHCR);
Yusuke Godacf236022008-03-11 12:55:12 +090029
Yusuke Godacf236022008-03-11 12:55:12 +090030 return 0;
31}
32
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090033void led_set_state(unsigned short value)
Yusuke Godacf236022008-03-11 12:55:12 +090034{
35
36}
37
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090038void ide_set_reset(int idereset)
Yusuke Godacf236022008-03-11 12:55:12 +090039{
40 /* if reset = 1 IDE reset will be asserted */
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090041 if (idereset) {
42 writew(0x432, FPGA_CFCTL);
Yusuke Godacf236022008-03-11 12:55:12 +090043#if defined(CONFIG_R7780MP)
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090044 writew(inw(FPGA_CFPOW)|0x01, FPGA_CFPOW);
Yusuke Godacf236022008-03-11 12:55:12 +090045#else
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090046 writew(inw(FPGA_CFPOW)|0x02, FPGA_CFPOW);
Yusuke Godacf236022008-03-11 12:55:12 +090047#endif
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090048 writew(0x01, FPGA_CFCDINTCLR);
Yusuke Godacf236022008-03-11 12:55:12 +090049 }
50}
51
Yusuke Godacf236022008-03-11 12:55:12 +090052static struct pci_controller hose;
53void pci_init_board(void)
54{
Nobuhiro Iwamatsu9aa0bd72008-06-17 16:27:41 +090055 pci_sh7780_init(&hose);
Yusuke Godacf236022008-03-11 12:55:12 +090056}
Ben Warren26425a62008-08-31 09:49:42 -070057
58int board_eth_init(bd_t *bis)
59{
Bernhard Kaindladb18ea2011-10-20 10:56:59 +000060 /* return >= 0 if a chip is found, the board's AX88796L is n2k-based */
61 return ne2k_register() + pci_eth_init(bis);
Ben Warren26425a62008-08-31 09:49:42 -070062}