]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: Set up a shared syscon numbering schema
authorSimon Glass <sjg@chromium.org>
Sun, 17 Jan 2016 23:11:58 +0000 (16:11 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Sun, 24 Jan 2016 04:09:42 +0000 (12:09 +0800)
Each system controller can have a number to identify it. It can then be
accessed using syscon_get_by_driver_data(). Put this in a shared header
file and update the only current user.

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

index 612c9103e37e7ab964e32c11faab5483151a83ad..f0d68990065fcea88fa27cca0f2a9e760f77888a 100644 (file)
@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <asm/pci.h>
+#include <asm/cpu.h>
 #include <asm/processor.h>
 #include <asm/arch/me.h>
 #include <asm/arch/pch.h>
@@ -189,7 +190,7 @@ int intel_early_me_init_done(struct udevice *dev, struct udevice *me_dev,
 }
 
 static const struct udevice_id ivybridge_syscon_ids[] = {
-       { .compatible = "intel,me", },
+       { .compatible = "intel,me", .data = X86_SYSCON_ME },
        { }
 };
 
index 3e5be4e0a09888f1931c8147fd0e9b65315486dc..e23c422cd0ada61ff55189c6bc6390f0afa32226 100644 (file)
@@ -18,6 +18,8 @@
 #include <rtc.h>
 #include <spi.h>
 #include <spi_flash.h>
+#include <syscon.h>
+#include <asm/cpu.h>
 #include <asm/processor.h>
 #include <asm/gpio.h>
 #include <asm/global_data.h>
@@ -739,11 +741,9 @@ int dram_init(void)
                return ret;
        if (!dev)
                return -ENODEV;
-       ret = uclass_first_device(UCLASS_SYSCON, &me_dev);
+       ret = syscon_get_by_driver_data(X86_SYSCON_ME, &me_dev);
        if (ret)
                return ret;
-       if (!me_dev)
-               return -ENODEV;
        debug("Boot mode %d\n", gd->arch.pei_boot_mode);
        debug("mrc_input %p\n", pei_data.mrc_input);
        pei_data.boot_mode = gd->arch.pei_boot_mode;
index c70183ccefffba8effd9fdb080210328285b03a3..76cdf4750981ef381adcc9cbea5f2c14774755bc 100644 (file)
@@ -45,6 +45,15 @@ enum {
        GDT_BASE_HIGH_MASK      = 0xf,
 };
 
+/*
+ * System controllers in an x86 system. We mostly need to just find these and
+ * use them on PCI. At some point these might have their own uclass.
+ */
+enum {
+       X86_NONE,
+       X86_SYSCON_ME,          /* Intel Management Engine */
+};
+
 struct cpuid_result {
        uint32_t eax;
        uint32_t ebx;
index 17a94f8f1e91cb0bce1b80fdb454aa622377757d..e4a38210479b6c5f7d9ec5d7bfe6dc0984bb606d 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_CMD_BOOTSTAGE=y
 CONFIG_CMD_TPM=y
 CONFIG_CMD_TPM_TEST=y
 CONFIG_OF_CONTROL=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
 CONFIG_CMD_CROS_EC=y
 CONFIG_CROS_EC=y
 CONFIG_CROS_EC_LPC=y