Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Chris Zankel | 1387dab | 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 | 1387dab | 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 | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 13 | #include <init.h> |
Simon Glass | f5c208d | 2019-11-14 12:57:20 -0700 | [diff] [blame] | 14 | #include <vsprintf.h> |
Chris Zankel | 1387dab | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 15 | #include <linux/stringify.h> |
| 16 | #include <asm/global_data.h> |
| 17 | #include <asm/cache.h> |
| 18 | #include <asm/string.h> |
| 19 | #include <asm/misc.h> |
| 20 | |
| 21 | DECLARE_GLOBAL_DATA_PTR; |
| 22 | |
Marek BehĂșn | 4bebdd3 | 2021-05-20 13:23:52 +0200 | [diff] [blame] | 23 | gd_t *gd __section(".data"); |
Chris Zankel | 1387dab | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 24 | |
| 25 | #if defined(CONFIG_DISPLAY_CPUINFO) |
| 26 | /* |
| 27 | * Print information about the CPU. |
| 28 | */ |
| 29 | |
| 30 | int print_cpuinfo(void) |
| 31 | { |
| 32 | char buf[120], mhz[8]; |
| 33 | uint32_t id0, id1; |
| 34 | |
| 35 | asm volatile ("rsr %0, 176\n" |
| 36 | "rsr %1, 208\n" |
| 37 | : "=r"(id0), "=r"(id1)); |
| 38 | |
| 39 | sprintf(buf, "CPU: Xtensa %s (id: %08x:%08x) at %s MHz\n", |
| 40 | XCHAL_CORE_ID, id0, id1, strmhz(mhz, gd->cpu_clk)); |
| 41 | puts(buf); |
| 42 | return 0; |
| 43 | } |
| 44 | #endif |
| 45 | |
| 46 | int arch_cpu_init(void) |
| 47 | { |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 48 | gd->ram_size = CFG_SYS_SDRAM_SIZE; |
Chris Zankel | 1387dab | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 49 | return 0; |
| 50 | } |
Simon Glass | d35f338 | 2017-04-06 12:47:05 -0600 | [diff] [blame] | 51 | |
| 52 | int dram_init(void) |
| 53 | { |
| 54 | return 0; |
| 55 | } |