[U-Boot] [PATCH v3] spl: kconfig: separate sysreset and firmware drivers from misc

Simon Goldschmidt simon.k.r.goldschmidt at gmail.com
Tue Jul 16 11:47:19 UTC 2019


On Tue, Jul 16, 2019 at 6:57 AM Lokesh Vutla <lokeshvutla at ti.com> wrote:
>
>
>
> On 16/07/19 1:06 AM, Simon Goldschmidt wrote:
> > This adds separate kconfig options for drivers/sysreset and
> > drivers/firmware.
> >
> > Up to now, CONFIG_SPL_DRIVERS_MISC_SUPPORT added drivers/misc to SPL
> > build but also added drivers/firmware and drivers/sysreset at the same
> > time.
> >
> > Since that is confusing, this patch uses CONFIG_SPL_SYSRESET for
> > drivers/sysreset and adds CONFIG_SPL_FIRMWARE for
> > drivers/firmware (and accordingly for the TPL options).
> >
> > CONFIG_SPL_DRIVERS_MISC_SUPPORT stays for including drivers/misc into
> > the SPL build (and accordingly for TPL) since there are boards using
> > non-DM (non UCLASS_MISC) files from drivers/misc. Such boards don't
> > have CONFIG_SPL_MISC enabled, so cannot use this to include
> > drivers/misc into the SPL build.
> >
> > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
> > ---
> >
> > Changes in v3:
> > - Revert to keeping CONFIG_SPL_DRIVERS_MISC_SUPPORT as there are boards
> >   that need to include drivers/misc without UCLASS_MISC being enabled
> > - Only CONFIG_SPL_FIRMWARE is added as new config symbol. To ensure no
> >   arch Kconfig files need to be changed, add dependencies to ensure this
> >   is enabled where required.
> >
> > Changes in v2:
> > - adapt config names to match the non-SPL config options:
> > - changed CONFIG_SPL_SYSRESET_SUPPORT to CONFIG_SPL_SYSRESET
> > - changed CONFIG_SPL_DRIVERS_FIRMWARE_SUPPORT to CONFIG_SPL_FIRMWARE
> > - changed CONFIG_SPL_DRIVERS_MISC_SUPPORT to CONFIG_SPL_MISC
> >
> >  configs/evb-rk3036_defconfig   | 1 +
> >  configs/kylin-rk3036_defconfig | 1 +
> >  configs/sandbox_spl_defconfig  | 1 +
> >  drivers/Makefile               | 7 ++++++-
> >  drivers/firmware/Kconfig       | 7 ++++++-
> >  drivers/sysreset/Kconfig       | 1 +
> >  6 files changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/configs/evb-rk3036_defconfig b/configs/evb-rk3036_defconfig
> > index 5e6bb54551..0eb7384340 100644
> > --- a/configs/evb-rk3036_defconfig
> > +++ b/configs/evb-rk3036_defconfig
> > @@ -47,6 +47,7 @@ CONFIG_SPI_FLASH=y
> >  CONFIG_SF_DEFAULT_SPEED=20000000
> >  CONFIG_PINCTRL=y
> >  # CONFIG_SPL_DM_SERIAL is not set
> > +# CONFIG_SPL_SYSRESET is not set
> >  CONFIG_DEBUG_UART_SHIFT=2
> >  CONFIG_SYSRESET=y
> >  CONFIG_USB=y
> > diff --git a/configs/kylin-rk3036_defconfig b/configs/kylin-rk3036_defconfig
> > index 921af0d476..a76ae9d326 100644
> > --- a/configs/kylin-rk3036_defconfig
> > +++ b/configs/kylin-rk3036_defconfig
> > @@ -49,6 +49,7 @@ CONFIG_SF_DEFAULT_SPEED=20000000
> >  CONFIG_PINCTRL=y
> >  CONFIG_DM_REGULATOR_FIXED=y
> >  # CONFIG_SPL_DM_SERIAL is not set
> > +# CONFIG_SPL_SYSRESET is not set
> >  CONFIG_DEBUG_UART_SHIFT=2
> >  CONFIG_SYSRESET=y
> >  CONFIG_USB=y
> > diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
> > index 27034cfaa9..5b7dae9be6 100644
> > --- a/configs/sandbox_spl_defconfig
> > +++ b/configs/sandbox_spl_defconfig
> > @@ -3,6 +3,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
> >  CONFIG_SPL_LIBGENERIC_SUPPORT=y
> >  CONFIG_SPL_SERIAL_SUPPORT=y
> >  CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
> > +CONFIG_SPL_FIRMWARE=y
> >  CONFIG_NR_DRAM_BANKS=1
> >  CONFIG_SPL=y
> >  CONFIG_BOOTSTAGE_STASH_ADDR=0x0
> > diff --git a/drivers/Makefile b/drivers/Makefile
> > index 603aa98590..1f225bc2ca 100644
> > --- a/drivers/Makefile
> > +++ b/drivers/Makefile
> > @@ -4,7 +4,6 @@ obj-$(CONFIG_$(SPL_TPL_)CLK) += clk/
> >  obj-$(CONFIG_$(SPL_TPL_)DM) += core/
> >  obj-$(CONFIG_$(SPL_TPL_)DFU) += dfu/
> >  obj-$(CONFIG_$(SPL_TPL_)GPIO_SUPPORT) += gpio/
> > -obj-$(CONFIG_$(SPL_TPL_)DRIVERS_MISC_SUPPORT) += misc/ sysreset/ firmware/
>
> why can't the following be added instead of adding SPL and TPL options separately?
>
> obj-$(CONFIG_$(SPL_TPL_)FIRMWARE) += firmware/
> obj-$(CONFIG_$(SPL_TPL_)SYSRESET) += sysreset/

I thought it didn't work as both directories are unconditionally included
further below for the non-SPL, non-TPL case. However, travis still works when
including conditional for all three cases. I'll send v4...

Regards,
Simon

>
> Thanks and regards,
> Lokesh
>
> >  obj-$(CONFIG_$(SPL_TPL_)I2C_SUPPORT) += i2c/
> >  obj-$(CONFIG_$(SPL_TPL_)INPUT) += input/
> >  obj-$(CONFIG_$(SPL_TPL_)LED) += led/
> > @@ -58,6 +57,9 @@ obj-$(CONFIG_SPL_SATA_SUPPORT) += ata/ scsi/
> >  obj-$(CONFIG_HAVE_BLOCK_DEVICE) += block/
> >  obj-$(CONFIG_SPL_FPGA_SUPPORT) += fpga/
> >  obj-$(CONFIG_SPL_THERMAL) += thermal/
> > +obj-$(CONFIG_SPL_DRIVERS_MISC_SUPPORT) += misc/
> > +obj-$(CONFIG_SPL_SYSRESET) += sysreset/
> > +obj-$(CONFIG_SPL_FIRMWARE) +=firmware/
> >
> >  endif
> >  endif
> > @@ -65,6 +67,9 @@ endif
> >  ifdef CONFIG_TPL_BUILD
> >
> >  obj-$(CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT) += ddr/fsl/
> > +obj-$(CONFIG_TPL_DRIVERS_MISC_SUPPORT) += misc/
> > +obj-$(CONFIG_TPL_SYSRESET) += sysreset/
> > +obj-$(CONFIG_TPL_FIRMWARE) += firmware/
> >
> >  endif
> >
> > diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
> > index 7d8f161b26..873bc8c796 100644
> > --- a/drivers/firmware/Kconfig
> > +++ b/drivers/firmware/Kconfig
> > @@ -1,9 +1,13 @@
> >  config FIRMWARE
> >       bool "Enable Firmware driver support"
> >
> > +config SPL_FIRMWARE
> > +     bool "Enable Firmware driver support in SPL"
> > +     depends on FIRMWARE
> > +
> >  config SPL_ARM_PSCI_FW
> >       bool
> > -     select FIRMWARE
> > +     select SPL_FIRMWARE
> >
> >  config ARM_PSCI_FW
> >       bool
> > @@ -13,6 +17,7 @@ config TI_SCI_PROTOCOL
> >       tristate "TI System Control Interface (TISCI) Message Protocol"
> >       depends on K3_SEC_PROXY
> >       select FIRMWARE
> > +     select SPL_FIRMWARE if SPL
> >       help
> >         TI System Control Interface (TISCI) Message Protocol is used to manage
> >         compute systems such as ARM, DSP etc with the system controller in
> > diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> > index 30aed2c4c1..a69b74cee2 100644
> > --- a/drivers/sysreset/Kconfig
> > +++ b/drivers/sysreset/Kconfig
> > @@ -50,6 +50,7 @@ config SYSRESET_MICROBLAZE
> >  config SYSRESET_PSCI
> >       bool "Enable support for PSCI System Reset"
> >       depends on ARM_PSCI_FW
> > +     select SPL_ARM_PSCI_FW if SPL
> >       help
> >         Enable PSCI SYSTEM_RESET function call.  To use this, PSCI firmware
> >         must be running on your system.
> >


More information about the U-Boot mailing list