diff options
author | Simon Glass <sjg@chromium.org> | 2015-04-29 22:26:01 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-30 16:13:48 -0600 |
commit | bcb0c61e1a7f2a418e986044a9ade06561f8f8a8 (patch) | |
tree | f99022b998eeee57503e250bc8c9c022d0599f4e /arch/x86/cpu | |
parent | 86196c65acd7f4a524c4d8d34fd4d9a6afe040c2 (diff) | |
download | u-boot-imx-bcb0c61e1a7f2a418e986044a9ade06561f8f8a8.zip u-boot-imx-bcb0c61e1a7f2a418e986044a9ade06561f8f8a8.tar.gz u-boot-imx-bcb0c61e1a7f2a418e986044a9ade06561f8f8a8.tar.bz2 |
x86: Allow CPUs to be set up after relocation
This permits init of additional CPU cores after relocation and when driver
model is ready.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu')
-rw-r--r-- | arch/x86/cpu/cpu.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 78eb3fe..bb4a110 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -21,6 +21,8 @@ #include <common.h> #include <command.h> +#include <cpu.h> +#include <dm.h> #include <errno.h> #include <malloc.h> #include <asm/control_regs.h> @@ -518,6 +520,16 @@ char *cpu_get_name(char *name) return ptr; } +int x86_cpu_get_desc(struct udevice *dev, char *buf, int size) +{ + if (size < CPU_MAX_NAME_LEN) + return -ENOSPC; + + cpu_get_name(buf); + + return 0; +} + int default_print_cpuinfo(void) { printf("CPU: %s, vendor %s, device %xh\n", @@ -600,3 +612,29 @@ int last_stage_init(void) return 0; } #endif + +__weak int x86_init_cpus(void) +{ + return 0; +} + +int cpu_init_r(void) +{ + return x86_init_cpus(); +} + +static const struct cpu_ops cpu_x86_ops = { + .get_desc = x86_cpu_get_desc, +}; + +static const struct udevice_id cpu_x86_ids[] = { + { .compatible = "cpu-x86" }, + { } +}; + +U_BOOT_DRIVER(cpu_x86_drv) = { + .name = "cpu_x86", + .id = UCLASS_CPU, + .of_match = cpu_x86_ids, + .ops = &cpu_x86_ops, +}; |