Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 1 | /* |
2 | * (C) Copyright 2007 | ||||
3 | * Nobuhiro Iwamatsu <iwamatsu@nigauri.org> | ||||
4 | * | ||||
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 6 | */ |
7 | |||||
8 | #include <common.h> | ||||
9 | #include <command.h> | ||||
Nobuhiro Iwamatsu | fe77115 | 2009-02-27 18:35:41 +0900 | [diff] [blame] | 10 | #include <netdev.h> |
Nobuhiro Iwamatsu | 547b67f | 2007-09-23 02:12:30 +0900 | [diff] [blame] | 11 | #include <asm/processor.h> |
Nobuhiro Iwamatsu | 65335f8 | 2008-03-12 12:15:29 +0900 | [diff] [blame] | 12 | #include <asm/cache.h> |
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 13 | |
14 | int checkcpu(void) | ||||
15 | { | ||||
Yoshihiro Shimoda | 1d01319 | 2012-07-23 14:53:42 +0000 | [diff] [blame] | 16 | #ifdef CONFIG_SH4A |
17 | puts("CPU: SH-4A\n"); | ||||
18 | #else | ||||
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 19 | puts("CPU: SH4\n"); |
Yoshihiro Shimoda | 1d01319 | 2012-07-23 14:53:42 +0000 | [diff] [blame] | 20 | #endif |
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 21 | return 0; |
22 | } | ||||
23 | |||||
24 | int cpu_init (void) | ||||
25 | { | ||||
26 | return 0; | ||||
27 | } | ||||
28 | |||||
29 | int cleanup_before_linux (void) | ||||
30 | { | ||||
31 | disable_interrupts(); | ||||
32 | return 0; | ||||
33 | } | ||||
34 | |||||
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 35 | int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 36 | { |
37 | disable_interrupts(); | ||||
38 | reset_cpu (0); | ||||
39 | return 0; | ||||
40 | } | ||||
41 | |||||
Nobuhiro Iwamatsu | 547b67f | 2007-09-23 02:12:30 +0900 | [diff] [blame] | 42 | void flush_cache (unsigned long addr, unsigned long size) |
43 | { | ||||
Nobuhiro Iwamatsu | 65335f8 | 2008-03-12 12:15:29 +0900 | [diff] [blame] | 44 | dcache_invalid_range( addr , addr + size ); |
Nobuhiro Iwamatsu | 547b67f | 2007-09-23 02:12:30 +0900 | [diff] [blame] | 45 | } |
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 46 | |
47 | void icache_enable (void) | ||||
48 | { | ||||
Nobuhiro Iwamatsu | 547b67f | 2007-09-23 02:12:30 +0900 | [diff] [blame] | 49 | cache_control(0); |
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 50 | } |
51 | |||||
52 | void icache_disable (void) | ||||
53 | { | ||||
Nobuhiro Iwamatsu | 547b67f | 2007-09-23 02:12:30 +0900 | [diff] [blame] | 54 | cache_control(1); |
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 55 | } |
56 | |||||
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 57 | int icache_status (void) |
58 | { | ||||
Wolfgang Denk | 0a5c214 | 2007-12-27 01:52:50 +0100 | [diff] [blame] | 59 | return 0; |
Nobuhiro Iwamatsu | 970dc33 | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 60 | } |
Nobuhiro Iwamatsu | 547b67f | 2007-09-23 02:12:30 +0900 | [diff] [blame] | 61 | |
62 | void dcache_enable (void) | ||||
63 | { | ||||
64 | } | ||||
65 | |||||
66 | void dcache_disable (void) | ||||
67 | { | ||||
68 | } | ||||
69 | |||||
70 | int dcache_status (void) | ||||
71 | { | ||||
72 | return 0; | ||||
73 | } | ||||
Nobuhiro Iwamatsu | d8f5d50 | 2008-11-21 12:04:18 +0900 | [diff] [blame] | 74 | |
75 | int cpu_eth_init(bd_t *bis) | ||||
76 | { | ||||
77 | #ifdef CONFIG_SH_ETHER | ||||
78 | sh_eth_initialize(bis); | ||||
79 | #endif | ||||
80 | return 0; | ||||
81 | } |