diff options
author | Mario Six | 2018-08-06 03:23:41 -0500 |
---|---|---|
committer | Simon Glass | 2018-11-14 11:16:27 -0600 |
commit | 5d6c61ac404c5c7c463ea6ee216145f29a603f60 (patch) | |
tree | b6df389996f0550fcf271563eaf2d5e9d1f8deee /common | |
parent | 208ecbad2ea83333e8f3c9933213867addf16f4a (diff) | |
download | u-boot-5d6c61ac404c5c7c463ea6ee216145f29a603f60.tar.gz u-boot-5d6c61ac404c5c7c463ea6ee216145f29a603f60.tar.xz u-boot-5d6c61ac404c5c7c463ea6ee216145f29a603f60.zip |
board_f: Use static print_cpuinfo if CONFIG_CPU is active
When the DM CPU drivers are active, printing information about a CPU
should be delegated to a matching driver.
Hence, add a static print_cpuinfo that implements this delegation when
DM CPU drivers are active.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Changed condition to CONFIG_IS_ENABLED(CPU):
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/board_f.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c index afafec5e4d..213d044066 100644 --- a/common/board_f.c +++ b/common/board_f.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <common.h> | 12 | #include <common.h> |
13 | #include <console.h> | 13 | #include <console.h> |
14 | #include <cpu.h> | ||
14 | #include <dm.h> | 15 | #include <dm.h> |
15 | #include <environment.h> | 16 | #include <environment.h> |
16 | #include <fdtdec.h> | 17 | #include <fdtdec.h> |
@@ -165,6 +166,33 @@ static int print_resetinfo(void) | |||
165 | } | 166 | } |
166 | #endif | 167 | #endif |
167 | 168 | ||
169 | #if defined(CONFIG_DISPLAY_CPUINFO) && CONFIG_IS_ENABLED(CPU) | ||
170 | static int print_cpuinfo(void) | ||
171 | { | ||
172 | struct udevice *dev; | ||
173 | char desc[512]; | ||
174 | int ret; | ||
175 | |||
176 | ret = uclass_first_device_err(UCLASS_CPU, &dev); | ||
177 | if (ret) { | ||
178 | debug("%s: Could not get CPU device (err = %d)\n", | ||
179 | __func__, ret); | ||
180 | return ret; | ||
181 | } | ||
182 | |||
183 | ret = cpu_get_desc(dev, desc, sizeof(desc)); | ||
184 | if (ret) { | ||
185 | debug("%s: Could not get CPU description (err = %d)\n", | ||
186 | dev->name, ret); | ||
187 | return ret; | ||
188 | } | ||
189 | |||
190 | printf("%s", desc); | ||
191 | |||
192 | return 0; | ||
193 | } | ||
194 | #endif | ||
195 | |||
168 | static int announce_dram_init(void) | 196 | static int announce_dram_init(void) |
169 | { | 197 | { |
170 | puts("DRAM: "); | 198 | puts("DRAM: "); |