Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | 5b6918e | 2008-08-31 22:48:33 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
| 4 | * Copyright (C) 2008 Renesas Solutions Corp. |
Nobuhiro Iwamatsu | 5b6918e | 2008-08-31 22:48:33 +0900 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <command.h> |
| 9 | #include <asm/processor.h> |
| 10 | #include <asm/io.h> |
| 11 | |
| 12 | #define STBCR4 0xFFFE040C |
| 13 | #define cmt_clock_enable() do {\ |
| 14 | writeb(readb(STBCR4) & ~0x04, STBCR4);\ |
| 15 | } while (0) |
| 16 | #define scif0_enable() do {\ |
| 17 | writeb(readb(STBCR4) & ~0x80, STBCR4);\ |
| 18 | } while (0) |
Phil Edworthy | 2b3228d | 2011-06-01 07:35:13 +0100 | [diff] [blame] | 19 | #define scif3_enable() do {\ |
| 20 | writeb(readb(STBCR4) & ~0x10, STBCR4);\ |
| 21 | } while (0) |
Nobuhiro Iwamatsu | 5b6918e | 2008-08-31 22:48:33 +0900 | [diff] [blame] | 22 | |
| 23 | int checkcpu(void) |
| 24 | { |
Nobuhiro Iwamatsu | 5b6918e | 2008-08-31 22:48:33 +0900 | [diff] [blame] | 25 | puts("CPU: SH2\n"); |
Nobuhiro Iwamatsu | 5b6918e | 2008-08-31 22:48:33 +0900 | [diff] [blame] | 26 | return 0; |
| 27 | } |
| 28 | |
| 29 | int cpu_init(void) |
| 30 | { |
| 31 | /* SCIF enable */ |
Phil Edworthy | 2b3228d | 2011-06-01 07:35:13 +0100 | [diff] [blame] | 32 | #if defined(CONFIG_CONS_SCIF3) |
| 33 | scif3_enable(); |
| 34 | #else |
Nobuhiro Iwamatsu | 5b6918e | 2008-08-31 22:48:33 +0900 | [diff] [blame] | 35 | scif0_enable(); |
Phil Edworthy | 2b3228d | 2011-06-01 07:35:13 +0100 | [diff] [blame] | 36 | #endif |
Nobuhiro Iwamatsu | 5b6918e | 2008-08-31 22:48:33 +0900 | [diff] [blame] | 37 | /* CMT clock enable */ |
| 38 | cmt_clock_enable() ; |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | int cleanup_before_linux(void) |
| 43 | { |
| 44 | disable_interrupts(); |
| 45 | return 0; |
| 46 | } |
| 47 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 48 | int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Nobuhiro Iwamatsu | 5b6918e | 2008-08-31 22:48:33 +0900 | [diff] [blame] | 49 | { |
| 50 | disable_interrupts(); |
| 51 | reset_cpu(0); |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | void flush_cache(unsigned long addr, unsigned long size) |
| 56 | { |
| 57 | |
| 58 | } |
| 59 | |
| 60 | void icache_enable(void) |
| 61 | { |
| 62 | } |
| 63 | |
| 64 | void icache_disable(void) |
| 65 | { |
| 66 | } |
| 67 | |
| 68 | int icache_status(void) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | void dcache_enable(void) |
| 74 | { |
| 75 | } |
| 76 | |
| 77 | void dcache_disable(void) |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | int dcache_status(void) |
| 82 | { |
| 83 | return 0; |
| 84 | } |