]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
x86: ivybridge: Move CPU init code into the driver
authorSimon Glass <sjg@chromium.org>
Sun, 17 Jan 2016 23:11:24 +0000 (16:11 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Sun, 24 Jan 2016 04:08:17 +0000 (12:08 +0800)
Use the CPU driver's probe() method to perform the CPU init. This will happen
automatically when the first CPU is probed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/ivybridge/bd82x6x.c
arch/x86/cpu/ivybridge/model_206ax.c
arch/x86/include/asm/arch-ivybridge/bd82x6x.h

index c71596d0739995046fcbc04be76a617604023506..149c1d23f12c5f5e54ef37438e63b1625f173454 100644 (file)
@@ -61,7 +61,6 @@ static int bd82x6x_probe(struct udevice *dev)
 {
        const void *blob = gd->fdt_blob;
        struct pci_controller *hose;
-       struct x86_cpu_priv *cpu;
        int sata_node, gma_node;
        int ret;
 
@@ -81,11 +80,6 @@ static int bd82x6x_probe(struct udevice *dev)
        bd82x6x_usb_ehci_init(PCH_EHCI1_DEV);
        bd82x6x_usb_ehci_init(PCH_EHCI2_DEV);
 
-       cpu = calloc(1, sizeof(*cpu));
-       if (!cpu)
-               return -ENOMEM;
-       model_206ax_init(cpu);
-
        gma_node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_GMA);
        if (gma_node < 0) {
                debug("%s: Cannot find GMA node\n", __func__);
index 9fa1226b1ffde0b605de4284aabf163172e3c3a0..6ab6edec20d75eeec2ab62c902b8a0005557aa65 100644 (file)
@@ -403,7 +403,7 @@ static void configure_mca(void)
 static unsigned ehci_debug_addr;
 #endif
 
-int model_206ax_init(struct x86_cpu_priv *cpu)
+static int model_206ax_init(void)
 {
        int ret;
 
@@ -480,6 +480,9 @@ static int model_206ax_get_count(struct udevice *dev)
 
 static int cpu_x86_model_206ax_probe(struct udevice *dev)
 {
+       if (dev->seq == 0)
+               model_206ax_init();
+
        return 0;
 }
 
index d76cb8dd7894a736b797c6803fe4d74a9d5d2ccd..fc7fc6d14bb04df1d86ee583b94472eff05c7f16 100644 (file)
@@ -15,19 +15,4 @@ void bd82x6x_usb_xhci_init(pci_dev_t dev);
 int gma_func0_init(struct udevice *dev, const void *blob, int node);
 int bd82x6x_init_extra(void);
 
-/**
- * struct x86_cpu_priv - Information about a single CPU
- *
- * @apic_id: Advanced Programmable Interrupt Controller Identifier, which is
- * just a number representing the CPU core
- *
- * TODO: Move this to driver model once lifecycle is understood
- */
-struct x86_cpu_priv {
-       int apic_id;
-       int start_err;
-};
-
-int model_206ax_init(struct x86_cpu_priv *cpu);
-
 #endif