diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig index ba4694f2964..2716844b259 100644 --- a/arch/arm/mach-stm32mp/Kconfig +++ b/arch/arm/mach-stm32mp/Kconfig @@ -170,6 +170,7 @@ config STM32_ECDSA_VERIFY config STM32MP_TAMP_NVMEM bool "STM32 TAMP backup registers via NVMEM API" + select DEVRES select NVMEM default y help diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index 185da2b5cfc..461b5a9fc83 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -265,6 +265,7 @@ config SYS_64BIT_LBA config RKMTD bool "Rockchip rkmtd virtual block device" + select DEVRES select RANDOM_UUID help Enable "rkmtd" class and driver to create a virtual block device diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 85cc472b4cb..ae783254008 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -3,6 +3,7 @@ menu "Clock" config CLK bool "Enable clock driver support" depends on DM + select DEVRES help This allows drivers to be provided for clock generators, including oscillators and PLLs. Devices can use a common clock API to request diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 6b4330fe4ea..c9253099e6e 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -197,6 +197,7 @@ config DM_DMA config REGMAP bool "Support register maps" depends on DM + select DEVRES help Hardware peripherals tend to have one or more sets of registers which can be accessed to control the hardware. A register map @@ -271,16 +272,17 @@ config VPL_SYSCON assigning a unique number to each. config DEVRES - bool "Managed device resources" + bool depends on DM help This option enables the Managed device resources core support. Device resources managed by the devres framework are automatically released whether initialization fails half-way or the device gets - detached. + detached. This is most often used via devm_kmalloc and family and + is expected to work in a manner analogous to the Linux Kernel. - If this option is disabled, devres functions fall back to - non-managed variants. For example, devres_alloc() to kzalloc(), + This option is disabled in xPL phases and devres functions fall back + to non-managed variants. For example, devres_alloc() to kzalloc(), devm_kmalloc() to kmalloc(), etc. config DEBUG_DEVRES diff --git a/drivers/dma/ti/Kconfig b/drivers/dma/ti/Kconfig index 87c026e0490..5cec6ddd3e3 100644 --- a/drivers/dma/ti/Kconfig +++ b/drivers/dma/ti/Kconfig @@ -5,6 +5,7 @@ if ARCH_K3 config TI_K3_NAVSS_UDMA bool "Texas Instruments UDMA" depends on ARCH_K3 + select DEVRES select DMA select TI_K3_NAVSS_RINGACC select TI_K3_NAVSS_PSILCFG diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index a094e6c3afe..220de731950 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -16,6 +16,7 @@ config ARM_PSCI_FW config TI_SCI_PROTOCOL tristate "TI System Control Interface (TISCI) Message Protocol" depends on K3_SEC_PROXY + select DEVRES select FIRMWARE select SPL_FIRMWARE if SPL help diff --git a/drivers/firmware/arm-ffa/Kconfig b/drivers/firmware/arm-ffa/Kconfig index d75f8b53fd8..3706a889305 100644 --- a/drivers/firmware/arm-ffa/Kconfig +++ b/drivers/firmware/arm-ffa/Kconfig @@ -6,6 +6,7 @@ config ARM_FFA_TRANSPORT select ARM_SMCCC if !SANDBOX select ARM_SMCCC_FEATURES if !SANDBOX imply CMD_ARMFFA + select DEVRES select LIB_UUID select DEVRES help diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 18ca8ad4cac..60c5c54688e 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -19,6 +19,7 @@ if GPIO config DM_GPIO bool "Enable Driver Model for GPIO drivers" depends on DM + select DEVRES help Enable driver model for GPIO access. The standard GPIO interface (gpio_get_value(), etc.) is then implemented by @@ -151,6 +152,7 @@ config CORTINA_GPIO config DWAPB_GPIO bool "DWAPB GPIO driver" depends on DM && DM_GPIO + select DEVRES help Support for the Designware APB GPIO driver. @@ -253,6 +255,7 @@ config IMX_RGPIO2P config IPROC_GPIO bool "Broadcom iProc GPIO driver(without pinconf)" + select DEVRES help The Broadcom iProc based SoCs- Cygnus, NS2, NS3, NSP and Stingray, use the same GPIO Controller IP hence this driver could be used diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig index 65319bb6fd8..3b1220b2105 100644 --- a/drivers/i2c/muxes/Kconfig +++ b/drivers/i2c/muxes/Kconfig @@ -51,6 +51,7 @@ config I2C_MUX_PCA954x config I2C_MUX_GPIO tristate "GPIO-based I2C multiplexer" depends on I2C_MUX && DM_GPIO + select DEVRES help If you say yes to this option, support will be included for a GPIO based I2C multiplexer. This driver provides access to diff --git a/drivers/i3c/Kconfig b/drivers/i3c/Kconfig index d877a744353..48341f9b873 100644 --- a/drivers/i3c/Kconfig +++ b/drivers/i3c/Kconfig @@ -1,6 +1,7 @@ menuconfig I3C tristate "I3C support" select I2C + select DEVRES help I3C is a serial protocol standardized by the MIPI alliance. diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig index cfd2a3be3fd..f45e611c966 100644 --- a/drivers/mailbox/Kconfig +++ b/drivers/mailbox/Kconfig @@ -31,6 +31,7 @@ config IMX_MU_MBOX config MPFS_MBOX bool "Enable MPFS system controller support" depends on DM_MAILBOX && ARCH_RV64I + select DEVRES help Enable support for the mailboxes that provide a communication channel with the system controller integrated on PolarFire SoC. diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index 5e4d1c0a937..e0ff28cb21b 100644 --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -51,6 +51,7 @@ config DM_NAND_ATMEL bool "Support Atmel NAND controller with DM support" depends on ARCH_AT91 select ATMEL_EBI + select DEVRES select SYS_NAND_SELF_INIT imply SYS_NAND_USE_FLASH_BBT help @@ -74,6 +75,7 @@ config ATMEL_NAND_HWECC config ATMEL_NAND_HW_PMECC bool "Atmel Programmable Multibit ECC (PMECC)" select ATMEL_NAND_HWECC + select DEVRES help The Programmable Multibit ECC (PMECC) controller is a programmable binary BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder. @@ -118,6 +120,7 @@ config NAND_BRCMNAND bool "Support Broadcom NAND controller" depends on OF_CONTROL && DM && DM_MTD depends on ARCH_BCMBCA || ARCH_BMIPS || TARGET_BCMNS || TARGET_BCMNS3 + select DEVRES select SYS_NAND_SELF_INIT help Enable the driver for NAND flash on platforms using a Broadcom NAND @@ -197,6 +200,7 @@ config SPL_NAND_LOAD config NAND_CADENCE bool "Support Cadence NAND controller as a DT device" depends on OF_CONTROL && DM_MTD && ARCH_SOCFPGA + select DEVRES select SYS_NAND_SELF_INIT select SPL_SYS_NAND_SELF_INIT select SPL_NAND_BASE @@ -211,6 +215,7 @@ config NAND_CADENCE config NAND_DENALI bool + select DEVRES select SYS_NAND_SELF_INIT select SYS_NAND_ONFI_DETECTION if TARGET_SOCFPGA_SOC64 imply CMD_NAND diff --git a/drivers/mtd/nand/spi/Kconfig b/drivers/mtd/nand/spi/Kconfig index 0777dfdf0a7..1124dada950 100644 --- a/drivers/mtd/nand/spi/Kconfig +++ b/drivers/mtd/nand/spi/Kconfig @@ -1,6 +1,7 @@ menuconfig MTD_SPI_NAND bool "SPI NAND device Support" depends on DM_MTD && DM_SPI + select DEVRES select MTD_NAND_CORE select SPI_MEM help diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index ca60a425ba3..a13c7fc60e6 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -3,6 +3,7 @@ menu "SPI Flash Support" config DM_SPI_FLASH bool "Enable Driver Model for SPI flash" depends on DM_SPI + select DEVRES imply SPI_FLASH help Enable driver model for SPI flash. This SPI flash interface diff --git a/drivers/mux/Kconfig b/drivers/mux/Kconfig index 2b95eb02177..de74e5d5e4e 100644 --- a/drivers/mux/Kconfig +++ b/drivers/mux/Kconfig @@ -3,6 +3,7 @@ menu "Multiplexer drivers" config MULTIPLEXER bool "Multiplexer Support" depends on DM + select DEVRES help The mux framework is a minimalistic subsystem that handles multiplexer controllers. It provides the same API as Linux and mux drivers should diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index f382a7752d5..13e631c55dc 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -125,6 +125,7 @@ config AIROHA_ETH bool "Airoha Ethernet QDMA Driver" depends on ARCH_AIROHA select PHYLIB + select DEVRES select DM_RESET select MDIO_MT7531 help @@ -359,6 +360,7 @@ config ETH_SANDBOX_RAW config ETH_DESIGNWARE bool "Synopsys Designware Ethernet MAC" + select DEVRES select PHYLIB imply ETH_DESIGNWARE_SOCFPGA if ARCH_SOCFPGA help @@ -555,6 +557,7 @@ config MVNETA config MVPP2 bool "Marvell Armada 375/7K/8K network interface support" depends on ARMADA_375 || ARMADA_8K + select DEVRES select PHYLIB select MVMDIO select DM_MDIO diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index d0aab0b8fe8..709f1c91eb2 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -182,6 +182,7 @@ config PHY_MARVELL config PHY_MARVELL_10G bool "Marvell Alaska 10Gbit PHYs" + select DEVRES help Support for the Marvell Alaska MV88X3310 and compatible PHYs. @@ -245,6 +246,7 @@ config PHY_NATSEMI config PHY_NXP_C45_TJA11XX tristate "NXP C45 TJA11XX PHYs" + select DEVRES help Enable support for NXP C45 TJA11XX PHYs. Currently supports only the TJA1103 PHY. diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index ea9868425d0..8fc57895a78 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -131,6 +131,7 @@ config PCIE_APPLE bool "Enable Apple PCIe driver" depends on ARCH_APPLE imply PCI_INIT_R + select DEVRES select SYS_PCI_64BIT default y help @@ -264,6 +265,7 @@ config PCI_XILINX config PCIE_LAYERSCAPE bool + select DEVRES config PCIE_LAYERSCAPE_RC bool "Layerscape PCIe Root Complex mode support" @@ -361,6 +363,7 @@ config PCI_KEYSTONE config PCIE_MEDIATEK bool "MediaTek PCIe Gen2 controller" depends on ARCH_MEDIATEK + select DEVRES help Say Y here if you want to enable Gen2 PCIe controller, which could be found on MT7623 SoC family. diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 420d7c7a44d..87729b479bd 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -4,6 +4,7 @@ menu "PHY Subsystem" config PHY bool "PHY Core" depends on DM + select DEVRES help PHY support. diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 48119694031..ea90713ec6c 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -294,6 +294,7 @@ config PINCTRL_SANDBOX config PINCTRL_SINGLE bool "Single register pin-control and pin-multiplex driver" depends on DM + select DEVRES help This enables pinctrl driver for systems using a single register for pin configuration and multiplexing. TI's AM335X SoCs are examples of diff --git a/drivers/pinctrl/mscc/Kconfig b/drivers/pinctrl/mscc/Kconfig index aab67fabd2c..567c93f404c 100644 --- a/drivers/pinctrl/mscc/Kconfig +++ b/drivers/pinctrl/mscc/Kconfig @@ -2,6 +2,7 @@ config PINCTRL_MSCC bool + select DEVRES config PINCTRL_MSCC_OCELOT depends on SOC_OCELOT && PINCTRL_FULL && OF_CONTROL diff --git a/drivers/pinctrl/mvebu/Kconfig b/drivers/pinctrl/mvebu/Kconfig index 7c51d138c8b..10ba440f246 100644 --- a/drivers/pinctrl/mvebu/Kconfig +++ b/drivers/pinctrl/mvebu/Kconfig @@ -9,6 +9,7 @@ config PINCTRL_ARMADA_38X config PINCTRL_ARMADA_37XX depends on ARMADA_3700 && PINCTRL_FULL + select DEVRES bool "Armada 37xx pin control driver" help Support pin multiplexing and pin configuration control on diff --git a/drivers/pinctrl/renesas/Kconfig b/drivers/pinctrl/renesas/Kconfig index ac40b31dbfa..171da88cfcf 100644 --- a/drivers/pinctrl/renesas/Kconfig +++ b/drivers/pinctrl/renesas/Kconfig @@ -166,6 +166,7 @@ config PINCTRL_RZG2L depends on PINCTRL depends on PINCTRL_GENERIC depends on PINCONF + select DEVRES help Support the pinctrl functionality of the pin function controller (PFC) on the Renesas RZ/G2L SoC family. diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig index c6da459a212..bd9ccd26981 100644 --- a/drivers/power/regulator/Kconfig +++ b/drivers/power/regulator/Kconfig @@ -228,6 +228,7 @@ config DM_REGULATOR_GPIO config DM_REGULATOR_QCOM_RPMH bool "Enable driver model for Qualcomm RPMh regulator" depends on DM_REGULATOR && QCOM_RPMH + select DEVRES ---help--- Enable support for the Qualcomm RPMh regulator. The driver implements get/set api for a limited set of regulators used diff --git a/drivers/reboot-mode/Kconfig b/drivers/reboot-mode/Kconfig index bb518935188..72b33d71223 100644 --- a/drivers/reboot-mode/Kconfig +++ b/drivers/reboot-mode/Kconfig @@ -9,6 +9,7 @@ menu "Reboot Mode Support" config DM_REBOOT_MODE bool "Enable reboot mode using Driver Model" depends on DM + select DEVRES help Enable support for reboot mode control. This will allow users to adjust the boot process based on reboot mode parameter diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 74c267dfc4e..2fd91d6299c 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -3,6 +3,7 @@ menu "Reset Controller Support" config DM_RESET bool "Enable reset controllers using Driver Model" depends on DM && OF_CONTROL + select DEVRES help Enable support for the reset controller driver class. Many hardware modules are equipped with a reset signal, typically driven by some diff --git a/drivers/smem/Kconfig b/drivers/smem/Kconfig index 73d51b3a7a4..e5d7dcc81b1 100644 --- a/drivers/smem/Kconfig +++ b/drivers/smem/Kconfig @@ -16,6 +16,7 @@ config MSM_SMEM bool "Qualcomm Shared Memory Manager (SMEM)" depends on DM depends on ARCH_SNAPDRAGON || ARCH_IPQ40XX + select DEVRES help Enable support for the Qualcomm Shared Memory Manager. The driver provides an interface to items in a heap shared among all diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig index 0ee21f99048..36129cb72f6 100644 --- a/drivers/soc/ti/Kconfig +++ b/drivers/soc/ti/Kconfig @@ -8,6 +8,7 @@ if SOC_TI config TI_K3_NAVSS_RINGACC bool "K3 Ring accelerator Sub System" depends on ARCH_K3 + select DEVRES select MISC help Say y here to support the K3 AM65x Ring accelerator module. diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index e31db9d4e31..50d22bf3fc4 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -35,6 +35,7 @@ config DM_SPI config SPI_MEM bool "SPI memory extension" + select DEVRES help Enable this option if you want to enable the SPI memory extension. This extension is meant to simplify interaction with SPI memories @@ -343,6 +344,7 @@ config MT7621_SPI config MTK_SNOR bool "Mediatek SPI-NOR controller driver" depends on SPI_MEM + select DEVRES help Enable the Mediatek SPINOR controller driver. This driver has better read/write performance with NOR. diff --git a/drivers/usb/cdns3/Kconfig b/drivers/usb/cdns3/Kconfig index 1d5e4afac6c..7964f3f41d5 100644 --- a/drivers/usb/cdns3/Kconfig +++ b/drivers/usb/cdns3/Kconfig @@ -1,6 +1,7 @@ config USB_CDNS3 tristate "Cadence USB3 Dual-Role Controller" depends on USB_XHCI_HCD || USB_GADGET + select DEVRES help Say Y here if your system has a Cadence USB3 dual-role controller. It supports: Host-only, and Peripheral-only. diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index 744dfa90463..27fcae54b22 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -1,6 +1,7 @@ config USB_DWC3 bool "DesignWare USB3 DRD Core Support" depends on USB_XHCI_HCD || USB_GADGET + select DEVRES help Say Y here if your system has a Dual Role SuperSpeed USB controller based on the DesignWare USB3 IP Core. diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 99f381db9f9..54df4264a44 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -367,6 +367,7 @@ config USB_OHCI_GENERIC config USB_OHCI_DA8XX bool "Support for da850 OHCI USB controller" depends on ARCH_DAVINCI + select DEVRES help Enable support for the da850 USB controller. diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index b5777da5218..2c67d089492 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -831,6 +831,7 @@ config BACKLIGHT_LM3533 config BACKLIGHT_LP855x bool "Backlight Driver for LP855x" depends on BACKLIGHT + select DEVRES select DM_I2C help Say Y to enable the backlight driver for National Semiconductor / TI diff --git a/include/dm/devres.h b/include/dm/devres.h index 27761deb6d1..406d18686f4 100644 --- a/include/dm/devres.h +++ b/include/dm/devres.h @@ -207,7 +207,8 @@ void devm_kfree(struct udevice *dev, void *ptr); /* Get basic stats on allocations */ void devres_get_stats(const struct udevice *dev, struct devres_stats *stats); -#else /* ! DEVRES */ +#elif IS_ENABLED(CONFIG_DEVRES) && defined(CONFIG_XPL_BUILD) +/* Allow these to be dummy functions in xPL builds. */ static inline void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp) {