xref: /openbmc/u-boot/arch/sh/cpu/sh4/cpu.c (revision 02b3bf39)
1 /*
2  * (C) Copyright 2007
3  * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #include <common.h>
9 #include <command.h>
10 #include <netdev.h>
11 #include <asm/processor.h>
12 #include <asm/cache.h>
13 
14 int checkcpu(void)
15 {
16 #ifdef CONFIG_SH4A
17 	puts("CPU: SH-4A\n");
18 #else
19 	puts("CPU: SH4\n");
20 #endif
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 
35 int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
36 {
37 	disable_interrupts();
38 	reset_cpu (0);
39 	return 0;
40 }
41 
42 void flush_cache (unsigned long addr, unsigned long size)
43 {
44 	invalidate_dcache_range(addr , addr + size);
45 }
46 
47 void icache_enable (void)
48 {
49 	cache_control(0);
50 }
51 
52 void icache_disable (void)
53 {
54 	cache_control(1);
55 }
56 
57 int icache_status (void)
58 {
59 	return 0;
60 }
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 }
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 }
82