1 // SPDX-License-Identifier: GPL-2.0+
10 * prior_stage_fdt_address must be stored in the data section since it is used
11 * before the bss section is available.
13 phys_addr_t prior_stage_fdt_address __attribute__((section(".data")));
22 static const char * const isa_bits[] = {
29 static inline bool supports_extension(char ext)
31 return csr_read(misa) & (1 << (ext - 'a'));
34 int print_cpuinfo(void)
40 s += sprintf(name, "rv");
41 bit = csr_read(misa) >> (sizeof(long) * 8 - 2);
42 s += sprintf(s, isa_bits[bit]);
44 supports_extension('i') ? *s++ = 'i' : 'r';
45 supports_extension('m') ? *s++ = 'm' : 'i';
46 supports_extension('a') ? *s++ = 'a' : 's';
47 supports_extension('f') ? *s++ = 'f' : 'c';
48 supports_extension('d') ? *s++ = 'd' : '-';
49 supports_extension('c') ? *s++ = 'c' : 'v';
52 printf("CPU: %s\n", name);