Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 1 | /* |
Nobuhiro Iwamatsu | f309fa3 | 2008-03-12 18:02:57 +0900 | [diff] [blame] | 2 | * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 3 | * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <ide.h> |
| 10 | #include <asm/processor.h> |
| 11 | #include <asm/io.h> |
| 12 | #include <asm/pci.h> |
Ben Warren | 02d6989 | 2008-08-31 09:49:42 -0700 | [diff] [blame] | 13 | #include <netdev.h> |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 14 | #include "r7780mp.h" |
| 15 | |
| 16 | int checkboard(void) |
| 17 | { |
| 18 | #if defined(CONFIG_R7780MP) |
| 19 | puts("BOARD: Renesas Solutions R7780MP\n"); |
| 20 | #else |
| 21 | puts("BOARD: Renesas Solutions R7780RP\n"); |
| 22 | #endif |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | int board_init(void) |
| 27 | { |
| 28 | /* SCIF Enable */ |
Nobuhiro Iwamatsu | 4ec7e91 | 2008-06-17 16:27:41 +0900 | [diff] [blame] | 29 | writew(0x0, PHCR); |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 30 | |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 31 | return 0; |
| 32 | } |
| 33 | |
Nobuhiro Iwamatsu | 4ec7e91 | 2008-06-17 16:27:41 +0900 | [diff] [blame] | 34 | void led_set_state(unsigned short value) |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 35 | { |
| 36 | |
| 37 | } |
| 38 | |
Nobuhiro Iwamatsu | 4ec7e91 | 2008-06-17 16:27:41 +0900 | [diff] [blame] | 39 | void ide_set_reset(int idereset) |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 40 | { |
| 41 | /* if reset = 1 IDE reset will be asserted */ |
Nobuhiro Iwamatsu | 4ec7e91 | 2008-06-17 16:27:41 +0900 | [diff] [blame] | 42 | if (idereset) { |
| 43 | writew(0x432, FPGA_CFCTL); |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 44 | #if defined(CONFIG_R7780MP) |
Nobuhiro Iwamatsu | 4ec7e91 | 2008-06-17 16:27:41 +0900 | [diff] [blame] | 45 | writew(inw(FPGA_CFPOW)|0x01, FPGA_CFPOW); |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 46 | #else |
Nobuhiro Iwamatsu | 4ec7e91 | 2008-06-17 16:27:41 +0900 | [diff] [blame] | 47 | writew(inw(FPGA_CFPOW)|0x02, FPGA_CFPOW); |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 48 | #endif |
Nobuhiro Iwamatsu | 4ec7e91 | 2008-06-17 16:27:41 +0900 | [diff] [blame] | 49 | writew(0x01, FPGA_CFCDINTCLR); |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 50 | } |
| 51 | } |
| 52 | |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 53 | static struct pci_controller hose; |
| 54 | void pci_init_board(void) |
| 55 | { |
Nobuhiro Iwamatsu | 4ec7e91 | 2008-06-17 16:27:41 +0900 | [diff] [blame] | 56 | pci_sh7780_init(&hose); |
Yusuke Goda | c133c1f | 2008-03-11 12:55:12 +0900 | [diff] [blame] | 57 | } |
Ben Warren | 02d6989 | 2008-08-31 09:49:42 -0700 | [diff] [blame] | 58 | |
| 59 | int board_eth_init(bd_t *bis) |
| 60 | { |
Bernhard Kaindl | d020169 | 2011-10-20 10:56:59 +0000 | [diff] [blame] | 61 | /* return >= 0 if a chip is found, the board's AX88796L is n2k-based */ |
| 62 | return ne2k_register() + pci_eth_init(bis); |
Ben Warren | 02d6989 | 2008-08-31 09:49:42 -0700 | [diff] [blame] | 63 | } |