blob: 18479a4c40f3b6ddaafc771e7d6823791dce4e8f [file] [log] [blame]
Nobuhiro Iwamatsu6ad43d02008-08-31 22:48:33 +09001/*
2 * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 * Copyright (C) 2008 Renesas Solutions Corp.
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsu6ad43d02008-08-31 22:48:33 +09006 */
7
8#include <common.h>
9#include <command.h>
10#include <asm/processor.h>
11#include <asm/io.h>
12
13#define STBCR4 0xFFFE040C
14#define cmt_clock_enable() do {\
15 writeb(readb(STBCR4) & ~0x04, STBCR4);\
16 } while (0)
17#define scif0_enable() do {\
18 writeb(readb(STBCR4) & ~0x80, STBCR4);\
19 } while (0)
Phil Edworthy7fbeb642011-06-01 07:35:13 +010020#define scif3_enable() do {\
21 writeb(readb(STBCR4) & ~0x10, STBCR4);\
22 } while (0)
Nobuhiro Iwamatsu6ad43d02008-08-31 22:48:33 +090023
24int checkcpu(void)
25{
26#if defined(CONFIG_SH2A)
27 puts("CPU: SH2A\n");
28#else
29 puts("CPU: SH2\n");
30#endif
31 return 0;
32}
33
34int cpu_init(void)
35{
36 /* SCIF enable */
Phil Edworthy7fbeb642011-06-01 07:35:13 +010037#if defined(CONFIG_CONS_SCIF3)
38 scif3_enable();
39#else
Nobuhiro Iwamatsu6ad43d02008-08-31 22:48:33 +090040 scif0_enable();
Phil Edworthy7fbeb642011-06-01 07:35:13 +010041#endif
Nobuhiro Iwamatsu6ad43d02008-08-31 22:48:33 +090042 /* CMT clock enable */
43 cmt_clock_enable() ;
44 return 0;
45}
46
47int cleanup_before_linux(void)
48{
49 disable_interrupts();
50 return 0;
51}
52
Wolfgang Denk54841ab2010-06-28 22:00:46 +020053int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Nobuhiro Iwamatsu6ad43d02008-08-31 22:48:33 +090054{
55 disable_interrupts();
56 reset_cpu(0);
57 return 0;
58}
59
60void flush_cache(unsigned long addr, unsigned long size)
61{
62
63}
64
65void icache_enable(void)
66{
67}
68
69void icache_disable(void)
70{
71}
72
73int icache_status(void)
74{
75 return 0;
76}
77
78void dcache_enable(void)
79{
80}
81
82void dcache_disable(void)
83{
84}
85
86int dcache_status(void)
87{
88 return 0;
89}