Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | 8ca805e | 2012-01-12 11:12:28 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2011 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> |
| 4 | * Copyright (C) 2011 Renesas Solutions Corp. |
Nobuhiro Iwamatsu | 8ca805e | 2012-01-12 11:12:28 +0900 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <asm/io.h> |
| 9 | #include <asm/processor.h> |
| 10 | #include <netdev.h> |
Nobuhiro Iwamatsu | d740555 | 2012-03-02 12:58:33 +0900 | [diff] [blame] | 11 | #include <i2c.h> |
Nobuhiro Iwamatsu | 8ca805e | 2012-01-12 11:12:28 +0900 | [diff] [blame] | 12 | |
Nobuhiro Iwamatsu | 8ca805e | 2012-01-12 11:12:28 +0900 | [diff] [blame] | 13 | #define MODEMR (0xFFCC0020) |
| 14 | #define MODEMR_MASK (0x6) |
| 15 | #define MODEMR_533MHZ (0x2) |
| 16 | |
| 17 | int checkboard(void) |
| 18 | { |
| 19 | u32 r = readl(MODEMR); |
| 20 | if ((r & MODEMR_MASK) & MODEMR_533MHZ) |
| 21 | puts("CPU Clock: 533MHz\n"); |
| 22 | else |
| 23 | puts("CPU Clock: 400MHz\n"); |
| 24 | |
| 25 | puts("BOARD: Renesas Technology Corp. R0P7734C00000RZ\n"); |
| 26 | return 0; |
| 27 | } |
| 28 | |
| 29 | #define MSTPSR1 (0xFFC80044) |
| 30 | #define MSTPCR1 (0xFFC80034) |
| 31 | #define MSTPSR1_GETHER (1 << 14) |
| 32 | |
| 33 | int board_init(void) |
| 34 | { |
| 35 | #if defined(CONFIG_SH_ETHER) |
| 36 | u32 r = readl(MSTPSR1); |
| 37 | if (r & MSTPSR1_GETHER) |
| 38 | writel((r & ~MSTPSR1_GETHER), MSTPCR1); |
| 39 | #endif |
Nobuhiro Iwamatsu | d740555 | 2012-03-02 12:58:33 +0900 | [diff] [blame] | 40 | |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | int board_late_init(void) |
| 45 | { |
Simon Glass | eb5ba3a | 2017-05-12 21:09:49 -0600 | [diff] [blame] | 46 | printf("Cannot get MAC address from I2C\n"); |
Nobuhiro Iwamatsu | d740555 | 2012-03-02 12:58:33 +0900 | [diff] [blame] | 47 | |
Nobuhiro Iwamatsu | 8ca805e | 2012-01-12 11:12:28 +0900 | [diff] [blame] | 48 | return 0; |
| 49 | } |
| 50 | |
Nobuhiro Iwamatsu | 8ca805e | 2012-01-12 11:12:28 +0900 | [diff] [blame] | 51 | #ifdef CONFIG_SMC911X |
| 52 | int board_eth_init(bd_t *bis) |
| 53 | { |
| 54 | int rc = 0; |
| 55 | rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); |
| 56 | return rc; |
| 57 | } |
| 58 | #endif |