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