[U-Boot] [PATCH 15/57] x86: ivybridge: Add an init() method for the bd82x6x LPC
Bin Meng
bmeng.cn at gmail.com
Sun Dec 13 13:53:26 CET 2015
Hi Simon,
On Tue, Dec 8, 2015 at 11:38 AM, Simon Glass <sjg at chromium.org> wrote:
> Add an empty method for now. We will add more to it in future patches.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> arch/x86/cpu/ivybridge/cpu.c | 11 ++++++++++-
> arch/x86/cpu/ivybridge/lpc.c | 11 +++++++++++
> 2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c
> index b7cdae1..276ae50 100644
> --- a/arch/x86/cpu/ivybridge/cpu.c
> +++ b/arch/x86/cpu/ivybridge/cpu.c
> @@ -15,6 +15,7 @@
> #include <dm.h>
> #include <errno.h>
> #include <fdtdec.h>
> +#include <lpc.h>
> #include <pch.h>
> #include <asm/cpu.h>
> #include <asm/io.h>
> @@ -212,7 +213,7 @@ int print_cpuinfo(void)
> {
> enum pei_boot_mode_t boot_mode = PEI_BOOT_NONE;
> char processor_name[CPU_MAX_NAME_LEN];
> - struct udevice *dev;
> + struct udevice *dev, *lpc;
> const char *name;
> uint32_t pm1_cnt;
> uint16_t pm1_sts;
> @@ -254,6 +255,14 @@ int print_cpuinfo(void)
> if (ret)
> return ret;
>
> + ret = uclass_first_device(UCLASS_LPC, &lpc);
> + if (ret)
> + return ret;
> + if (!dev)
> + return -ENODEV;
> + ret = lpc_init(lpc);
> + if (ret)
> + return ret;
> sandybridge_early_init(SANDYBRIDGE_MOBILE);
>
> /* Check PM1_STS[15] to see if we are waking from Sx */
> diff --git a/arch/x86/cpu/ivybridge/lpc.c b/arch/x86/cpu/ivybridge/lpc.c
> index f124de6..dd7b788 100644
> --- a/arch/x86/cpu/ivybridge/lpc.c
> +++ b/arch/x86/cpu/ivybridge/lpc.c
> @@ -10,6 +10,7 @@
> #include <dm.h>
> #include <errno.h>
> #include <fdtdec.h>
> +#include <lpc.h>
> #include <rtc.h>
> #include <pci.h>
> #include <asm/acpi.h>
> @@ -618,6 +619,11 @@ void lpc_enable(pci_dev_t dev)
> setbits_le32(RCB_REG(FD2), PCH_ENABLE_DBDF);
> }
>
> +static int bd82x6x_lpc_init(struct udevice *dev)
> +{
> + return 0;
> +}
> +
> static int bd82x6x_lpc_probe(struct udevice *dev)
> {
> int ret;
> @@ -634,6 +640,10 @@ static int bd82x6x_lpc_probe(struct udevice *dev)
> return 0;
> }
>
> +static struct lpc_ops bd82x6x_lpc_ops = {
> + .init = bd82x6x_lpc_init,
> +};
> +
> static const struct udevice_id bd82x6x_lpc_ids[] = {
> { .compatible = "intel,bd82x6x-lpc" },
> { }
> @@ -644,4 +654,5 @@ U_BOOT_DRIVER(bd82x6x_lpc_drv) = {
> .id = UCLASS_LPC,
> .of_match = bd82x6x_lpc_ids,
> .probe = bd82x6x_lpc_probe,
> + .ops = &bd82x6x_lpc_ops,
> };
> --
Simliar comments for lpc_init() in previous patches..
Regards,
Bin
More information about the U-Boot
mailing list