blob: 249c35f3a2c681d530a631e9eeac2280351a6601 [file] [log] [blame]
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +09001/*
2 * Copyright (C) 2007,2008
3 * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +09006 */
7
8#include <common.h>
9#include <ide.h>
Nobuhiro Iwamatsu3c094b62008-09-11 17:28:18 +090010#include <netdev.h>
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090011#include <asm/processor.h>
Nobuhiro Iwamatsu5cd5b2c2008-06-17 16:27:44 +090012#include <asm/io.h>
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090013#include <asm/pci.h>
14
John Rigby29565322010-12-20 18:27:51 -070015DECLARE_GLOBAL_DATA_PTR;
16
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090017int checkboard(void)
18{
19 puts("BOARD: Renesas Solutions R2D Plus\n");
20 return 0;
21}
22
23int board_init(void)
24{
25 return 0;
26}
27
Nobuhiro Iwamatsu5cd5b2c2008-06-17 16:27:44 +090028int dram_init(void)
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090029{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020030 gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
31 gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
32 printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090033 return 0;
34}
35
36int board_late_init(void)
37{
38 return 0;
39}
40
Nobuhiro Iwamatsu5cd5b2c2008-06-17 16:27:44 +090041#define FPGA_BASE 0xA4000000
42#define FPGA_CFCTL (FPGA_BASE + 0x04)
43#define CFCTL_EN (0x432)
44#define FPGA_CFPOW (FPGA_BASE + 0x06)
45#define CFPOW_ON (0x02)
46#define FPGA_CFCDINTCLR (FPGA_BASE + 0x2A)
47#define CFCDINTCLR_EN (0x01)
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090048
Nobuhiro Iwamatsu5cd5b2c2008-06-17 16:27:44 +090049void ide_set_reset(int idereset)
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090050{
51 /* if reset = 1 IDE reset will be asserted */
Nobuhiro Iwamatsu5cd5b2c2008-06-17 16:27:44 +090052 if (idereset) {
53 outw(CFCTL_EN, FPGA_CFCTL); /* CF enable */
54 outw(inw(FPGA_CFPOW)|CFPOW_ON, FPGA_CFPOW); /* Power OM */
55 outw(CFCDINTCLR_EN, FPGA_CFCDINTCLR); /* Int clear */
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090056 }
57}
58
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090059static struct pci_controller hose;
60void pci_init_board(void)
61{
Nobuhiro Iwamatsu5cd5b2c2008-06-17 16:27:44 +090062 pci_sh7751_init(&hose);
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090063}
Ben Warren0b252f52008-08-31 21:41:08 -070064
65int board_eth_init(bd_t *bis)
66{
67 return pci_eth_init(bis);
68}