diff options
author | Thomas Chou <thomas@wytron.com.tw> | 2014-08-22 11:36:47 +0800 |
---|---|---|
committer | Thomas Chou <thomas@wytron.com.tw> | 2014-08-24 11:28:10 +0800 |
commit | 5ff10aa7e76fc7dbd205ec13381757bfa2c99911 (patch) | |
tree | b61f3a949766cb6cda4f537874bebe7790356c8e /arch/nios2/cpu/cpu.c | |
parent | 70fbc46192dfd52896560f4b31e40daa3d16b99f (diff) |
nios2: add generic board support
This patch implements the generic board init as described in
doc/README.generic-board.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/nios2/cpu/cpu.c')
-rw-r--r-- | arch/nios2/cpu/cpu.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c index e0dcbc201f3..86f94b76fad 100644 --- a/arch/nios2/cpu/cpu.c +++ b/arch/nios2/cpu/cpu.c @@ -10,11 +10,14 @@ #include <nios2-io.h> #include <asm/cache.h> +DECLARE_GLOBAL_DATA_PTR; + #if defined (CONFIG_SYS_NIOS_SYSID_BASE) extern void display_sysid (void); #endif /* CONFIG_SYS_NIOS_SYSID_BASE */ -int checkcpu (void) +#ifdef CONFIG_DISPLAY_CPUINFO +int print_cpuinfo(void) { printf ("CPU : Nios-II\n"); #if !defined(CONFIG_SYS_NIOS_SYSID_BASE) @@ -24,6 +27,7 @@ int checkcpu (void) #endif return (0); } +#endif /* CONFIG_DISPLAY_CPUINFO */ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { @@ -47,3 +51,11 @@ void dcache_disable(void) { flush_dcache(CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_DCACHELINE_SIZE); } + +int arch_cpu_init(void) +{ + gd->cpu_clk = CONFIG_SYS_CLK_FREQ; + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + + return 0; +} |