Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2008 - 2013 Tensilica Inc. |
| 4 | * (C) Copyright 2014 - 2016 Cadence Design Systems Inc. |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * CPU specific code |
| 9 | */ |
| 10 | |
| 11 | #include <common.h> |
| 12 | #include <command.h> |
Simon Glass | 2189d5f | 2019-11-14 12:57:20 -0700 | [diff] [blame] | 13 | #include <vsprintf.h> |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 14 | #include <linux/stringify.h> |
| 15 | #include <asm/global_data.h> |
| 16 | #include <asm/cache.h> |
| 17 | #include <asm/string.h> |
| 18 | #include <asm/misc.h> |
| 19 | |
| 20 | DECLARE_GLOBAL_DATA_PTR; |
| 21 | |
| 22 | gd_t *gd __attribute__((section(".data"))); |
| 23 | |
| 24 | #if defined(CONFIG_DISPLAY_CPUINFO) |
| 25 | /* |
| 26 | * Print information about the CPU. |
| 27 | */ |
| 28 | |
| 29 | int print_cpuinfo(void) |
| 30 | { |
| 31 | char buf[120], mhz[8]; |
| 32 | uint32_t id0, id1; |
| 33 | |
| 34 | asm volatile ("rsr %0, 176\n" |
| 35 | "rsr %1, 208\n" |
| 36 | : "=r"(id0), "=r"(id1)); |
| 37 | |
| 38 | sprintf(buf, "CPU: Xtensa %s (id: %08x:%08x) at %s MHz\n", |
| 39 | XCHAL_CORE_ID, id0, id1, strmhz(mhz, gd->cpu_clk)); |
| 40 | puts(buf); |
| 41 | return 0; |
| 42 | } |
| 43 | #endif |
| 44 | |
| 45 | int arch_cpu_init(void) |
| 46 | { |
| 47 | gd->ram_size = CONFIG_SYS_SDRAM_SIZE; |
| 48 | return 0; |
| 49 | } |
Simon Glass | f1683aa | 2017-04-06 12:47:05 -0600 | [diff] [blame] | 50 | |
| 51 | int dram_init(void) |
| 52 | { |
| 53 | return 0; |
| 54 | } |