[PATCH v5 084/101] x86: apl: Add PMC driver

Simon Glass sjg at chromium.org
Thu Dec 5 05:28:13 CET 2019


Hi BIn,
On Sun, 1 Dec 2019 at 22:26, Bin Meng <bmeng.cn at gmail.com> wrote:
>
> Hi Simon,
>
> On Mon, Nov 25, 2019 at 12:12 PM Simon Glass <sjg at chromium.org> wrote:
> >
> > Add a driver for the Apollo Lake SoC. It supports the basic operations and
> > can use device tree or of-platdata.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > Changes in v5: None
> > Changes in v4:
> > - Fix Makefile copyright message
> > - Fix incorrect mask check in pmc_gpe_init()
> > - Switch over to use pinctrl for pad init/config
> > - Tidy up header guards
> > - Use pci_ofplat_get_devfn()
> > - apollolake -> Apollo Lake
> >
> > Changes in v3:
> > - Use pci_get_devfn()
> >
> > Changes in v2: None
> >
> >  arch/x86/cpu/apollolake/Makefile          |   5 +
> >  arch/x86/cpu/apollolake/pmc.c             | 216 ++++++++++++++++++++++
> >  arch/x86/include/asm/arch-apollolake/pm.h |  19 ++
> >  drivers/power/acpi_pmc/acpi-pmc-uclass.c  |  56 ++++++
> >  4 files changed, 296 insertions(+)
> >  create mode 100644 arch/x86/cpu/apollolake/Makefile
> >  create mode 100644 arch/x86/cpu/apollolake/pmc.c
> >  create mode 100644 arch/x86/include/asm/arch-apollolake/pm.h
> >

[..]

> > diff --git a/drivers/power/acpi_pmc/acpi-pmc-uclass.c b/drivers/power/acpi_pmc/acpi-pmc-uclass.c
> > index 653c71b948..d43de87126 100644
> > --- a/drivers/power/acpi_pmc/acpi-pmc-uclass.c
> > +++ b/drivers/power/acpi_pmc/acpi-pmc-uclass.c
> > @@ -9,6 +9,9 @@
> >  #include <acpi_s3.h>
> >  #include <dm.h>
> >  #include <log.h>
> > +#ifdef CONFIG_X86
> > +#include <asm/intel_pinctrl.h>
> > +#endif
> >  #include <asm/io.h>
> >  #include <power/acpi_pmc.h>
> >
> > @@ -34,6 +37,59 @@ enum {
> >         TCO1_CNT_HLT                    = 1 << 11,
> >  };
> >
> > +#ifdef CONFIG_X86
> > +static int gpe0_shift(struct acpi_pmc_upriv *upriv, int regnum)
> > +{
> > +       return upriv->gpe0_dwx_shift_base + regnum * 4;
> > +}
> > +
> > +int pmc_gpe_init(struct udevice *dev)
>
> Where is this function called? and why should this be put in the
> acpi-pmc-uclass driver?

It is called from cpu_spl.c - it is here because this driver the GPE
information.

Regards,
Simon


More information about the U-Boot mailing list