Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007,2008 |
| 3 | * Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <ide.h> |
Nobuhiro Iwamatsu | 3c094b6 | 2008-09-11 17:28:18 +0900 | [diff] [blame] | 10 | #include <netdev.h> |
Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 11 | #include <asm/processor.h> |
Nobuhiro Iwamatsu | 5cd5b2c | 2008-06-17 16:27:44 +0900 | [diff] [blame] | 12 | #include <asm/io.h> |
Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 13 | #include <asm/pci.h> |
| 14 | |
John Rigby | 2956532 | 2010-12-20 18:27:51 -0700 | [diff] [blame] | 15 | DECLARE_GLOBAL_DATA_PTR; |
| 16 | |
Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 17 | int checkboard(void) |
| 18 | { |
| 19 | puts("BOARD: Renesas Solutions R2D Plus\n"); |
| 20 | return 0; |
| 21 | } |
| 22 | |
| 23 | int board_init(void) |
| 24 | { |
| 25 | return 0; |
| 26 | } |
| 27 | |
Nobuhiro Iwamatsu | 5cd5b2c | 2008-06-17 16:27:44 +0900 | [diff] [blame] | 28 | int dram_init(void) |
Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 29 | { |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 30 | 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 Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | int board_late_init(void) |
| 37 | { |
| 38 | return 0; |
| 39 | } |
| 40 | |
Nobuhiro Iwamatsu | 5cd5b2c | 2008-06-17 16:27:44 +0900 | [diff] [blame] | 41 | #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 Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 48 | |
Nobuhiro Iwamatsu | 5cd5b2c | 2008-06-17 16:27:44 +0900 | [diff] [blame] | 49 | void ide_set_reset(int idereset) |
Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 50 | { |
| 51 | /* if reset = 1 IDE reset will be asserted */ |
Nobuhiro Iwamatsu | 5cd5b2c | 2008-06-17 16:27:44 +0900 | [diff] [blame] | 52 | 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 Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 56 | } |
| 57 | } |
| 58 | |
Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 59 | static struct pci_controller hose; |
| 60 | void pci_init_board(void) |
| 61 | { |
Nobuhiro Iwamatsu | 5cd5b2c | 2008-06-17 16:27:44 +0900 | [diff] [blame] | 62 | pci_sh7751_init(&hose); |
Nobuhiro Iwamatsu | f5e2466 | 2008-03-25 17:11:24 +0900 | [diff] [blame] | 63 | } |
Ben Warren | 0b252f5 | 2008-08-31 21:41:08 -0700 | [diff] [blame] | 64 | |
| 65 | int board_eth_init(bd_t *bis) |
| 66 | { |
| 67 | return pci_eth_init(bis); |
| 68 | } |