xref: /openbmc/u-boot/drivers/core/Kconfig (revision c4d323793ba2e0616d93ca104e1e2b9a9fbccf9b)
10b11dbf7SMasahiro Yamadamenu "Generic Driver Options"
20b11dbf7SMasahiro Yamada
3da333ae7SMasahiro Yamadaconfig DM
4da333ae7SMasahiro Yamada	bool "Enable Driver Model"
5da333ae7SMasahiro Yamada	help
6f94a1bedSSimon Glass	  This config option enables Driver Model. This brings in the core
7f94a1bedSSimon Glass	  support, including scanning of platform data on start-up. If
8f94a1bedSSimon Glass	  CONFIG_OF_CONTROL is enabled, the device tree will be scanned also
9f94a1bedSSimon Glass	  when available.
1091a91ff8SSimon Glass
1191a91ff8SSimon Glassconfig SPL_DM
1291a91ff8SSimon Glass	bool "Enable Driver Model for SPL"
1391a91ff8SSimon Glass	depends on DM && SPL
1491a91ff8SSimon Glass	help
1591a91ff8SSimon Glass	  Enable driver model in SPL. You will need to provide a
1691a91ff8SSimon Glass	  suitable malloc() implementation. If you are not using the
1791a91ff8SSimon Glass	  full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START,
1891a91ff8SSimon Glass	  consider using CONFIG_SYS_MALLOC_SIMPLE. In that case you
19f1896c45SAndy Yan	  must provide CONFIG_SPL_SYS_MALLOC_F_LEN to set the size.
2091a91ff8SSimon Glass	  In most cases driver model will only allocate a few uclasses
2191a91ff8SSimon Glass	  and devices in SPL, so 1KB should be enable. See
22f1896c45SAndy Yan	  CONFIG_SPL_SYS_MALLOC_F_LEN for more details on how to enable it.
2391a91ff8SSimon Glass
245a6f06f6SSimon Glassconfig TPL_DM
255a6f06f6SSimon Glass	bool "Enable Driver Model for TPL"
265a6f06f6SSimon Glass	depends on DM && TPL
275a6f06f6SSimon Glass	help
285a6f06f6SSimon Glass	  Enable driver model in TPL. You will need to provide a
295a6f06f6SSimon Glass	  suitable malloc() implementation. If you are not using the
305a6f06f6SSimon Glass	  full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START,
315a6f06f6SSimon Glass	  consider using CONFIG_SYS_MALLOC_SIMPLE. In that case you
32f1896c45SAndy Yan	  must provide CONFIG_SPL_SYS_MALLOC_F_LEN to set the size.
335a6f06f6SSimon Glass	  In most cases driver model will only allocate a few uclasses
345a6f06f6SSimon Glass	  and devices in SPL, so 1KB should be enough. See
35f1896c45SAndy Yan	  CONFIG_SPL_SYS_MALLOC_F_LEN for more details on how to enable it.
365a6f06f6SSimon Glass	  Disable this for very small implementations.
375a6f06f6SSimon Glass
3891a91ff8SSimon Glassconfig DM_WARN
3991a91ff8SSimon Glass	bool "Enable warnings in driver model"
40d648964fSMasahiro Yamada	depends on DM
41d648964fSMasahiro Yamada	default y
4291a91ff8SSimon Glass	help
4391a91ff8SSimon Glass	  The dm_warn() function can use up quite a bit of space for its
4491a91ff8SSimon Glass	  strings. By default this is disabled for SPL builds to save space.
4591a91ff8SSimon Glass	  This will cause dm_warn() to be compiled out - it will do nothing
4691a91ff8SSimon Glass	  when called.
4791a91ff8SSimon Glass
48ceb91909SMasahiro Yamadaconfig DM_DEBUG
49ceb91909SMasahiro Yamada	bool "Enable debug messages in driver model core"
50ceb91909SMasahiro Yamada	depends on DM
51ceb91909SMasahiro Yamada	help
52ceb91909SMasahiro Yamada	  Say Y here if you want to compile in debug messages in DM core.
53ceb91909SMasahiro Yamada
5491a91ff8SSimon Glassconfig DM_DEVICE_REMOVE
5591a91ff8SSimon Glass	bool "Support device removal"
56d648964fSMasahiro Yamada	depends on DM
57d648964fSMasahiro Yamada	default y
5891a91ff8SSimon Glass	help
5991a91ff8SSimon Glass	  We can save some code space by dropping support for removing a
6085e51be9SJean-Jacques Hiblot	  device.
6191a91ff8SSimon Glass
62e5c4564eSHans de Goede	  Note that this may have undesirable results in the USB subsystem as
63e5c4564eSHans de Goede	  it causes unplugged devices to linger around in the dm-tree, and it
64e5c4564eSHans de Goede	  causes USB host controllers to not be stopped when booting the OS.
65e5c4564eSHans de Goede
6685e51be9SJean-Jacques Hiblotconfig SPL_DM_DEVICE_REMOVE
6785e51be9SJean-Jacques Hiblot	bool "Support device removal in SPL"
6885e51be9SJean-Jacques Hiblot	depends on SPL_DM
6985e51be9SJean-Jacques Hiblot	default n
7085e51be9SJean-Jacques Hiblot	help
7185e51be9SJean-Jacques Hiblot	  We can save some code space by dropping support for removing a
7285e51be9SJean-Jacques Hiblot	  device. This is not normally required in SPL, so by default this
7385e51be9SJean-Jacques Hiblot	  option is disabled for SPL.
7485e51be9SJean-Jacques Hiblot
7591a91ff8SSimon Glassconfig DM_STDIO
7691a91ff8SSimon Glass	bool "Support stdio registration"
77d648964fSMasahiro Yamada	depends on DM
78d648964fSMasahiro Yamada	default y
7991a91ff8SSimon Glass	help
8091a91ff8SSimon Glass	  Normally serial drivers register with stdio so that they can be used
8191a91ff8SSimon Glass	  as normal output devices. In SPL we don't normally use stdio, so
8291a91ff8SSimon Glass	  we can omit this feature.
8336fa61dcSSimon Glass
8436fa61dcSSimon Glassconfig DM_SEQ_ALIAS
8536fa61dcSSimon Glass	bool "Support numbered aliases in device tree"
8636fa61dcSSimon Glass	depends on DM
8736fa61dcSSimon Glass	default y
8836fa61dcSSimon Glass	help
8936fa61dcSSimon Glass	  Most boards will have a '/aliases' node containing the path to
9036fa61dcSSimon Glass	  numbered devices (e.g. serial0 = &serial0). This feature can be
914f627c5aSNathan Rossi	  disabled if it is not required.
924f627c5aSNathan Rossi
934f627c5aSNathan Rossiconfig SPL_DM_SEQ_ALIAS
944f627c5aSNathan Rossi	bool "Support numbered aliases in device tree in SPL"
954f627c5aSNathan Rossi	depends on DM
964f627c5aSNathan Rossi	default n
974f627c5aSNathan Rossi	help
984f627c5aSNathan Rossi	  Most boards will have a '/aliases' node containing the path to
994f627c5aSNathan Rossi	  numbered devices (e.g. serial0 = &serial0). This feature can be
10036fa61dcSSimon Glass	  disabled if it is not required, to save code space in SPL.
10112dc8e75SSimon Glass
10212dc8e75SSimon Glassconfig REGMAP
10312dc8e75SSimon Glass	bool "Support register maps"
10412dc8e75SSimon Glass	depends on DM
10512dc8e75SSimon Glass	help
10612dc8e75SSimon Glass	  Hardware peripherals tend to have one or more sets of registers
10712dc8e75SSimon Glass	  which can be accessed to control the hardware. A register map
10812dc8e75SSimon Glass	  models this with a simple read/write interface. It can in principle
10912dc8e75SSimon Glass	  support any bus type (I2C, SPI) but so far this only supports
11012dc8e75SSimon Glass	  direct memory access.
11112dc8e75SSimon Glass
11241c7f664Shuang linconfig SPL_REGMAP
11341c7f664Shuang lin	bool "Support register maps in SPL"
1149c447370SPhilipp Tomsich	depends on SPL_DM
11541c7f664Shuang lin	help
11641c7f664Shuang lin	  Hardware peripherals tend to have one or more sets of registers
11741c7f664Shuang lin	  which can be accessed to control the hardware. A register map
11841c7f664Shuang lin	  models this with a simple read/write interface. It can in principle
11941c7f664Shuang lin	  support any bus type (I2C, SPI) but so far this only supports
12041c7f664Shuang lin	  direct memory access.
12141c7f664Shuang lin
122c6ac6c1bSPhilipp Tomsichconfig TPL_REGMAP
123c6ac6c1bSPhilipp Tomsich	bool "Support register maps in TPL"
124c6ac6c1bSPhilipp Tomsich	depends on TPL_DM
125c6ac6c1bSPhilipp Tomsich	help
126c6ac6c1bSPhilipp Tomsich	  Hardware peripherals tend to have one or more sets of registers
127c6ac6c1bSPhilipp Tomsich	  which can be accessed to control the hardware. A register map
128c6ac6c1bSPhilipp Tomsich	  models this with a simple read/write interface. It can in principle
129c6ac6c1bSPhilipp Tomsich	  support any bus type (I2C, SPI) but so far this only supports
130c6ac6c1bSPhilipp Tomsich	  direct memory access.
131c6ac6c1bSPhilipp Tomsich
13212dc8e75SSimon Glassconfig SYSCON
13312dc8e75SSimon Glass	bool "Support system controllers"
13412dc8e75SSimon Glass	depends on REGMAP
13512dc8e75SSimon Glass	help
13612dc8e75SSimon Glass	  Many SoCs have a number of system controllers which are dealt with
13712dc8e75SSimon Glass	  as a group by a single driver. Some common functionality is provided
13812dc8e75SSimon Glass	  by this uclass, including accessing registers via regmap and
13912dc8e75SSimon Glass	  assigning a unique number to each.
140608f26c5SMasahiro Yamada
14141c7f664Shuang linconfig SPL_SYSCON
14241c7f664Shuang lin	bool "Support system controllers in SPL"
1439c447370SPhilipp Tomsich	depends on SPL_REGMAP
14441c7f664Shuang lin	help
14541c7f664Shuang lin	  Many SoCs have a number of system controllers which are dealt with
14641c7f664Shuang lin	  as a group by a single driver. Some common functionality is provided
14741c7f664Shuang lin	  by this uclass, including accessing registers via regmap and
14841c7f664Shuang lin	  assigning a unique number to each.
14941c7f664Shuang lin
150c6ac6c1bSPhilipp Tomsichconfig TPL_SYSCON
151c6ac6c1bSPhilipp Tomsich	bool "Support system controllers in TPL"
152c6ac6c1bSPhilipp Tomsich	depends on TPL_REGMAP
153c6ac6c1bSPhilipp Tomsich	help
154c6ac6c1bSPhilipp Tomsich	  Many SoCs have a number of system controllers which are dealt with
155c6ac6c1bSPhilipp Tomsich	  as a group by a single driver. Some common functionality is provided
156c6ac6c1bSPhilipp Tomsich	  by this uclass, including accessing registers via regmap and
157c6ac6c1bSPhilipp Tomsich	  assigning a unique number to each.
158c6ac6c1bSPhilipp Tomsich
159e2282d70SMasahiro Yamadaconfig DEVRES
160e2282d70SMasahiro Yamada	bool "Managed device resources"
161e2282d70SMasahiro Yamada	depends on DM
162e2282d70SMasahiro Yamada	help
163e2282d70SMasahiro Yamada	  This option enables the Managed device resources core support.
164e2282d70SMasahiro Yamada	  Device resources managed by the devres framework are automatically
165e2282d70SMasahiro Yamada	  released whether initialization fails half-way or the device gets
166e2282d70SMasahiro Yamada	  detached.
167e2282d70SMasahiro Yamada
168e2282d70SMasahiro Yamada	  If this option is disabled, devres functions fall back to
169e2282d70SMasahiro Yamada	  non-managed variants.  For example, devres_alloc() to kzalloc(),
170e2282d70SMasahiro Yamada	  devm_kmalloc() to kmalloc(), etc.
171e2282d70SMasahiro Yamada
172608f26c5SMasahiro Yamadaconfig DEBUG_DEVRES
17340b6f2d0SMasahiro Yamada	bool "Managed device resources debugging functions"
174e2282d70SMasahiro Yamada	depends on DEVRES
175608f26c5SMasahiro Yamada	help
176608f26c5SMasahiro Yamada	  If this option is enabled, devres debug messages are printed.
17740b6f2d0SMasahiro Yamada	  Also, a function is available to dump a list of device resources.
178608f26c5SMasahiro Yamada	  Select this if you are having a problem with devres or want to
179608f26c5SMasahiro Yamada	  debug resource management for a managed device.
180608f26c5SMasahiro Yamada
181608f26c5SMasahiro Yamada	  If you are unsure about this, Say N here.
1820b11dbf7SMasahiro Yamada
183628d792cSMarek Vasutconfig SIMPLE_BUS
184628d792cSMarek Vasut	bool "Support simple-bus driver"
185628d792cSMarek Vasut	depends on DM && OF_CONTROL
186628d792cSMarek Vasut	default y
187628d792cSMarek Vasut	help
188628d792cSMarek Vasut	  Supports the 'simple-bus' driver, which is used on some systems.
189628d792cSMarek Vasut
190628d792cSMarek Vasutconfig SPL_SIMPLE_BUS
191628d792cSMarek Vasut	bool "Support simple-bus driver in SPL"
192628d792cSMarek Vasut	depends on SPL_DM && SPL_OF_CONTROL
1938bebf03cSMichal Simek	default y
194628d792cSMarek Vasut	help
195628d792cSMarek Vasut	  Supports the 'simple-bus' driver, which is used on some systems
196628d792cSMarek Vasut	  in SPL.
197628d792cSMarek Vasut
198ef5cd330SStefan Roeseconfig OF_TRANSLATE
199ef5cd330SStefan Roese	bool "Translate addresses using fdt_translate_address"
200ef5cd330SStefan Roese	depends on DM && OF_CONTROL
201ef5cd330SStefan Roese	default y
202ef5cd330SStefan Roese	help
203ef5cd330SStefan Roese	  If this option is enabled, the reg property will be translated
204ef5cd330SStefan Roese	  using the fdt_translate_address() function. This is necessary
205ef5cd330SStefan Roese	  on some platforms (e.g. MVEBU) using complex "ranges"
206ef5cd330SStefan Roese	  properties in many nodes. As this translation is not handled
207ef5cd330SStefan Roese	  correctly in the default simple_bus_translate() function.
208ef5cd330SStefan Roese
209ef5cd330SStefan Roese	  If this option is not enabled, simple_bus_translate() will be
210ef5cd330SStefan Roese	  used for the address translation. This function is faster and
211ef5cd330SStefan Roese	  smaller in size than fdt_translate_address().
212ef5cd330SStefan Roese
213ef5cd330SStefan Roeseconfig SPL_OF_TRANSLATE
2147b98a3b6SStefan Roese	bool "Translate addresses using fdt_translate_address in SPL"
215ef5cd330SStefan Roese	depends on SPL_DM && SPL_OF_CONTROL
216ef5cd330SStefan Roese	default n
217ef5cd330SStefan Roese	help
218ef5cd330SStefan Roese	  If this option is enabled, the reg property will be translated
219ef5cd330SStefan Roese	  using the fdt_translate_address() function. This is necessary
220ef5cd330SStefan Roese	  on some platforms (e.g. MVEBU) using complex "ranges"
221ef5cd330SStefan Roese	  properties in many nodes. As this translation is not handled
222ef5cd330SStefan Roese	  correctly in the default simple_bus_translate() function.
223ef5cd330SStefan Roese
224ef5cd330SStefan Roese	  If this option is not enabled, simple_bus_translate() will be
225ef5cd330SStefan Roese	  used for the address translation. This function is faster and
226ef5cd330SStefan Roese	  smaller in size than fdt_translate_address().
227ef5cd330SStefan Roese
2280a222d53SPaul Burtonconfig OF_ISA_BUS
2290a222d53SPaul Burton	bool
2300a222d53SPaul Burton	depends on OF_TRANSLATE
2310a222d53SPaul Burton	help
2320a222d53SPaul Burton	  Is this option is enabled then support for the ISA bus will
2330a222d53SPaul Burton	  be included for addresses read from DT. This is something that
2340a222d53SPaul Burton	  should be known to be required or not based upon the board
235*83e7a4d5SChris Packham	  being targeted, and whether or not it makes use of an ISA bus.
2360a222d53SPaul Burton
2370a222d53SPaul Burton	  The bus is matched based upon its node name equalling "isa". The
2380a222d53SPaul Burton	  busses #address-cells should equal 2, with the first cell being
2390a222d53SPaul Burton	  used to hold flags & flag 0x1 indicating that the address range
2400a222d53SPaul Burton	  should be accessed using I/O port in/out accessors. The second
2410a222d53SPaul Burton	  cell holds the offset into ISA bus address space. The #size-cells
2420a222d53SPaul Burton	  property should equal 1, and of course holds the size of the
2430a222d53SPaul Burton	  address range used by a device.
2440a222d53SPaul Burton
2450a222d53SPaul Burton	  If this option is not enabled then support for the ISA bus is
2460a222d53SPaul Burton	  not included and any such busses used in DT will be treated as
2470a222d53SPaul Burton	  typical simple-bus compatible busses. This will lead to
2480a222d53SPaul Burton	  mistranslation of device addresses, so ensure that this is
2490a222d53SPaul Burton	  enabled if your board does include an ISA bus.
2500a222d53SPaul Burton
251f11c7ab9SSimon Glassconfig DM_DEV_READ_INLINE
252f11c7ab9SSimon Glass	bool
253f11c7ab9SSimon Glass	default y if !OF_LIVE
254f11c7ab9SSimon Glass
2550b11dbf7SMasahiro Yamadaendmenu
256