2008-03-11 03:55:12 +00:00
|
|
|
/*
|
2008-03-12 09:02:57 +00:00
|
|
|
* Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
|
2008-03-11 03:55:12 +00:00
|
|
|
* Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2008-03-11 03:55:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <ide.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/pci.h>
|
2008-08-31 16:49:42 +00:00
|
|
|
#include <netdev.h>
|
2008-03-11 03:55:12 +00:00
|
|
|
#include "r7780mp.h"
|
|
|
|
|
2010-12-21 01:27:51 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2008-03-11 03:55:12 +00:00
|
|
|
int checkboard(void)
|
|
|
|
{
|
|
|
|
#if defined(CONFIG_R7780MP)
|
|
|
|
puts("BOARD: Renesas Solutions R7780MP\n");
|
|
|
|
#else
|
|
|
|
puts("BOARD: Renesas Solutions R7780RP\n");
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int board_init(void)
|
|
|
|
{
|
|
|
|
/* SCIF Enable */
|
2008-06-17 07:27:41 +00:00
|
|
|
writew(0x0, PHCR);
|
2008-03-11 03:55:12 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-06-17 07:27:41 +00:00
|
|
|
int dram_init(void)
|
2008-03-11 03:55:12 +00:00
|
|
|
{
|
2008-10-16 13:01:15 +00:00
|
|
|
gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
|
|
|
|
gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
|
|
|
|
printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
|
2008-03-11 03:55:12 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-06-17 07:27:41 +00:00
|
|
|
void led_set_state(unsigned short value)
|
2008-03-11 03:55:12 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-06-17 07:27:41 +00:00
|
|
|
void ide_set_reset(int idereset)
|
2008-03-11 03:55:12 +00:00
|
|
|
{
|
|
|
|
/* if reset = 1 IDE reset will be asserted */
|
2008-06-17 07:27:41 +00:00
|
|
|
if (idereset) {
|
|
|
|
writew(0x432, FPGA_CFCTL);
|
2008-03-11 03:55:12 +00:00
|
|
|
#if defined(CONFIG_R7780MP)
|
2008-06-17 07:27:41 +00:00
|
|
|
writew(inw(FPGA_CFPOW)|0x01, FPGA_CFPOW);
|
2008-03-11 03:55:12 +00:00
|
|
|
#else
|
2008-06-17 07:27:41 +00:00
|
|
|
writew(inw(FPGA_CFPOW)|0x02, FPGA_CFPOW);
|
2008-03-11 03:55:12 +00:00
|
|
|
#endif
|
2008-06-17 07:27:41 +00:00
|
|
|
writew(0x01, FPGA_CFCDINTCLR);
|
2008-03-11 03:55:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct pci_controller hose;
|
|
|
|
void pci_init_board(void)
|
|
|
|
{
|
2008-06-17 07:27:41 +00:00
|
|
|
pci_sh7780_init(&hose);
|
2008-03-11 03:55:12 +00:00
|
|
|
}
|
2008-08-31 16:49:42 +00:00
|
|
|
|
|
|
|
int board_eth_init(bd_t *bis)
|
|
|
|
{
|
2011-10-20 10:56:59 +00:00
|
|
|
/* return >= 0 if a chip is found, the board's AX88796L is n2k-based */
|
|
|
|
return ne2k_register() + pci_eth_init(bis);
|
2008-08-31 16:49:42 +00:00
|
|
|
}
|