blob: 396e4b6db3584b9037c7e428dbbe5cfedc015991 [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 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
19 */
20
21#include <common.h>
22#include <ide.h>
23#include <asm/processor.h>
24#include <asm/io.h>
25#include <asm/pci.h>
Ben Warren02d69892008-08-31 09:49:42 -070026#include <netdev.h>
Yusuke Godac133c1f2008-03-11 12:55:12 +090027#include "r7780mp.h"
28
29int checkboard(void)
30{
31#if defined(CONFIG_R7780MP)
32 puts("BOARD: Renesas Solutions R7780MP\n");
33#else
34 puts("BOARD: Renesas Solutions R7780RP\n");
35#endif
36 return 0;
37}
38
39int board_init(void)
40{
41 /* SCIF Enable */
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090042 writew(0x0, PHCR);
Yusuke Godac133c1f2008-03-11 12:55:12 +090043
Yusuke Godac133c1f2008-03-11 12:55:12 +090044 return 0;
45}
46
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090047int dram_init(void)
Yusuke Godac133c1f2008-03-11 12:55:12 +090048{
49 DECLARE_GLOBAL_DATA_PTR;
50
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020051 gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
52 gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
53 printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
Yusuke Godac133c1f2008-03-11 12:55:12 +090054 return 0;
55}
56
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090057void led_set_state(unsigned short value)
Yusuke Godac133c1f2008-03-11 12:55:12 +090058{
59
60}
61
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090062void ide_set_reset(int idereset)
Yusuke Godac133c1f2008-03-11 12:55:12 +090063{
64 /* if reset = 1 IDE reset will be asserted */
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090065 if (idereset) {
66 writew(0x432, FPGA_CFCTL);
Yusuke Godac133c1f2008-03-11 12:55:12 +090067#if defined(CONFIG_R7780MP)
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090068 writew(inw(FPGA_CFPOW)|0x01, FPGA_CFPOW);
Yusuke Godac133c1f2008-03-11 12:55:12 +090069#else
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090070 writew(inw(FPGA_CFPOW)|0x02, FPGA_CFPOW);
Yusuke Godac133c1f2008-03-11 12:55:12 +090071#endif
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090072 writew(0x01, FPGA_CFCDINTCLR);
Yusuke Godac133c1f2008-03-11 12:55:12 +090073 }
74}
75
Yusuke Godac133c1f2008-03-11 12:55:12 +090076static struct pci_controller hose;
77void pci_init_board(void)
78{
Nobuhiro Iwamatsu4ec7e912008-06-17 16:27:41 +090079 pci_sh7780_init(&hose);
Yusuke Godac133c1f2008-03-11 12:55:12 +090080}
Ben Warren02d69892008-08-31 09:49:42 -070081
82int board_eth_init(bd_t *bis)
83{
84 return pci_eth_init(bis);
85}