xref: /openbmc/u-boot/drivers/core/Kconfig (revision f11c7ab94d2db2cce3601cdbcb4f6208f2a0bee4)
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
1991a91ff8SSimon Glass	  must provide CONFIG_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
2291a91ff8SSimon Glass	  CONFIG_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
325a6f06f6SSimon Glass	  must provide CONFIG_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
355a6f06f6SSimon Glass	  CONFIG_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
4891a91ff8SSimon Glassconfig DM_DEVICE_REMOVE
4991a91ff8SSimon Glass	bool "Support device removal"
50d648964fSMasahiro Yamada	depends on DM
51d648964fSMasahiro Yamada	default y
5291a91ff8SSimon Glass	help
5391a91ff8SSimon Glass	  We can save some code space by dropping support for removing a
5491a91ff8SSimon Glass	  device. This is not normally required in SPL, so by default this
5591a91ff8SSimon Glass	  option is disabled for SPL.
5691a91ff8SSimon Glass
57e5c4564eSHans de Goede	  Note that this may have undesirable results in the USB subsystem as
58e5c4564eSHans de Goede	  it causes unplugged devices to linger around in the dm-tree, and it
59e5c4564eSHans de Goede	  causes USB host controllers to not be stopped when booting the OS.
60e5c4564eSHans de Goede
6191a91ff8SSimon Glassconfig DM_STDIO
6291a91ff8SSimon Glass	bool "Support stdio registration"
63d648964fSMasahiro Yamada	depends on DM
64d648964fSMasahiro Yamada	default y
6591a91ff8SSimon Glass	help
6691a91ff8SSimon Glass	  Normally serial drivers register with stdio so that they can be used
6791a91ff8SSimon Glass	  as normal output devices. In SPL we don't normally use stdio, so
6891a91ff8SSimon Glass	  we can omit this feature.
6936fa61dcSSimon Glass
7036fa61dcSSimon Glassconfig DM_SEQ_ALIAS
7136fa61dcSSimon Glass	bool "Support numbered aliases in device tree"
7236fa61dcSSimon Glass	depends on DM
7336fa61dcSSimon Glass	default y
7436fa61dcSSimon Glass	help
7536fa61dcSSimon Glass	  Most boards will have a '/aliases' node containing the path to
7636fa61dcSSimon Glass	  numbered devices (e.g. serial0 = &serial0). This feature can be
774f627c5aSNathan Rossi	  disabled if it is not required.
784f627c5aSNathan Rossi
794f627c5aSNathan Rossiconfig SPL_DM_SEQ_ALIAS
804f627c5aSNathan Rossi	bool "Support numbered aliases in device tree in SPL"
814f627c5aSNathan Rossi	depends on DM
824f627c5aSNathan Rossi	default n
834f627c5aSNathan Rossi	help
844f627c5aSNathan Rossi	  Most boards will have a '/aliases' node containing the path to
854f627c5aSNathan Rossi	  numbered devices (e.g. serial0 = &serial0). This feature can be
8636fa61dcSSimon Glass	  disabled if it is not required, to save code space in SPL.
8712dc8e75SSimon Glass
8812dc8e75SSimon Glassconfig REGMAP
8912dc8e75SSimon Glass	bool "Support register maps"
9012dc8e75SSimon Glass	depends on DM
9112dc8e75SSimon Glass	help
9212dc8e75SSimon Glass	  Hardware peripherals tend to have one or more sets of registers
9312dc8e75SSimon Glass	  which can be accessed to control the hardware. A register map
9412dc8e75SSimon Glass	  models this with a simple read/write interface. It can in principle
9512dc8e75SSimon Glass	  support any bus type (I2C, SPI) but so far this only supports
9612dc8e75SSimon Glass	  direct memory access.
9712dc8e75SSimon Glass
9841c7f664Shuang linconfig SPL_REGMAP
9941c7f664Shuang lin	bool "Support register maps in SPL"
10041c7f664Shuang lin	depends on DM
10141c7f664Shuang lin	help
10241c7f664Shuang lin	  Hardware peripherals tend to have one or more sets of registers
10341c7f664Shuang lin	  which can be accessed to control the hardware. A register map
10441c7f664Shuang lin	  models this with a simple read/write interface. It can in principle
10541c7f664Shuang lin	  support any bus type (I2C, SPI) but so far this only supports
10641c7f664Shuang lin	  direct memory access.
10741c7f664Shuang lin
10812dc8e75SSimon Glassconfig SYSCON
10912dc8e75SSimon Glass	bool "Support system controllers"
11012dc8e75SSimon Glass	depends on REGMAP
11112dc8e75SSimon Glass	help
11212dc8e75SSimon Glass	  Many SoCs have a number of system controllers which are dealt with
11312dc8e75SSimon Glass	  as a group by a single driver. Some common functionality is provided
11412dc8e75SSimon Glass	  by this uclass, including accessing registers via regmap and
11512dc8e75SSimon Glass	  assigning a unique number to each.
116608f26c5SMasahiro Yamada
11741c7f664Shuang linconfig SPL_SYSCON
11841c7f664Shuang lin	bool "Support system controllers in SPL"
11941c7f664Shuang lin	depends on REGMAP
12041c7f664Shuang lin	help
12141c7f664Shuang lin	  Many SoCs have a number of system controllers which are dealt with
12241c7f664Shuang lin	  as a group by a single driver. Some common functionality is provided
12341c7f664Shuang lin	  by this uclass, including accessing registers via regmap and
12441c7f664Shuang lin	  assigning a unique number to each.
12541c7f664Shuang lin
126e2282d70SMasahiro Yamadaconfig DEVRES
127e2282d70SMasahiro Yamada	bool "Managed device resources"
128e2282d70SMasahiro Yamada	depends on DM
129e2282d70SMasahiro Yamada	help
130e2282d70SMasahiro Yamada	  This option enables the Managed device resources core support.
131e2282d70SMasahiro Yamada	  Device resources managed by the devres framework are automatically
132e2282d70SMasahiro Yamada	  released whether initialization fails half-way or the device gets
133e2282d70SMasahiro Yamada	  detached.
134e2282d70SMasahiro Yamada
135e2282d70SMasahiro Yamada	  If this option is disabled, devres functions fall back to
136e2282d70SMasahiro Yamada	  non-managed variants.  For example, devres_alloc() to kzalloc(),
137e2282d70SMasahiro Yamada	  devm_kmalloc() to kmalloc(), etc.
138e2282d70SMasahiro Yamada
139608f26c5SMasahiro Yamadaconfig DEBUG_DEVRES
14040b6f2d0SMasahiro Yamada	bool "Managed device resources debugging functions"
141e2282d70SMasahiro Yamada	depends on DEVRES
142608f26c5SMasahiro Yamada	help
143608f26c5SMasahiro Yamada	  If this option is enabled, devres debug messages are printed.
14440b6f2d0SMasahiro Yamada	  Also, a function is available to dump a list of device resources.
145608f26c5SMasahiro Yamada	  Select this if you are having a problem with devres or want to
146608f26c5SMasahiro Yamada	  debug resource management for a managed device.
147608f26c5SMasahiro Yamada
148608f26c5SMasahiro Yamada	  If you are unsure about this, Say N here.
1490b11dbf7SMasahiro Yamada
150628d792cSMarek Vasutconfig SIMPLE_BUS
151628d792cSMarek Vasut	bool "Support simple-bus driver"
152628d792cSMarek Vasut	depends on DM && OF_CONTROL
153628d792cSMarek Vasut	default y
154628d792cSMarek Vasut	help
155628d792cSMarek Vasut	  Supports the 'simple-bus' driver, which is used on some systems.
156628d792cSMarek Vasut
157628d792cSMarek Vasutconfig SPL_SIMPLE_BUS
158628d792cSMarek Vasut	bool "Support simple-bus driver in SPL"
159628d792cSMarek Vasut	depends on SPL_DM && SPL_OF_CONTROL
1608bebf03cSMichal Simek	default y
161628d792cSMarek Vasut	help
162628d792cSMarek Vasut	  Supports the 'simple-bus' driver, which is used on some systems
163628d792cSMarek Vasut	  in SPL.
164628d792cSMarek Vasut
165ef5cd330SStefan Roeseconfig OF_TRANSLATE
166ef5cd330SStefan Roese	bool "Translate addresses using fdt_translate_address"
167ef5cd330SStefan Roese	depends on DM && OF_CONTROL
168ef5cd330SStefan Roese	default y
169ef5cd330SStefan Roese	help
170ef5cd330SStefan Roese	  If this option is enabled, the reg property will be translated
171ef5cd330SStefan Roese	  using the fdt_translate_address() function. This is necessary
172ef5cd330SStefan Roese	  on some platforms (e.g. MVEBU) using complex "ranges"
173ef5cd330SStefan Roese	  properties in many nodes. As this translation is not handled
174ef5cd330SStefan Roese	  correctly in the default simple_bus_translate() function.
175ef5cd330SStefan Roese
176ef5cd330SStefan Roese	  If this option is not enabled, simple_bus_translate() will be
177ef5cd330SStefan Roese	  used for the address translation. This function is faster and
178ef5cd330SStefan Roese	  smaller in size than fdt_translate_address().
179ef5cd330SStefan Roese
180ef5cd330SStefan Roeseconfig SPL_OF_TRANSLATE
1817b98a3b6SStefan Roese	bool "Translate addresses using fdt_translate_address in SPL"
182ef5cd330SStefan Roese	depends on SPL_DM && SPL_OF_CONTROL
183ef5cd330SStefan Roese	default n
184ef5cd330SStefan Roese	help
185ef5cd330SStefan Roese	  If this option is enabled, the reg property will be translated
186ef5cd330SStefan Roese	  using the fdt_translate_address() function. This is necessary
187ef5cd330SStefan Roese	  on some platforms (e.g. MVEBU) using complex "ranges"
188ef5cd330SStefan Roese	  properties in many nodes. As this translation is not handled
189ef5cd330SStefan Roese	  correctly in the default simple_bus_translate() function.
190ef5cd330SStefan Roese
191ef5cd330SStefan Roese	  If this option is not enabled, simple_bus_translate() will be
192ef5cd330SStefan Roese	  used for the address translation. This function is faster and
193ef5cd330SStefan Roese	  smaller in size than fdt_translate_address().
194ef5cd330SStefan Roese
1950a222d53SPaul Burtonconfig OF_ISA_BUS
1960a222d53SPaul Burton	bool
1970a222d53SPaul Burton	depends on OF_TRANSLATE
1980a222d53SPaul Burton	help
1990a222d53SPaul Burton	  Is this option is enabled then support for the ISA bus will
2000a222d53SPaul Burton	  be included for addresses read from DT. This is something that
2010a222d53SPaul Burton	  should be known to be required or not based upon the board
2020a222d53SPaul Burton	  being targetted, and whether or not it makes use of an ISA bus.
2030a222d53SPaul Burton
2040a222d53SPaul Burton	  The bus is matched based upon its node name equalling "isa". The
2050a222d53SPaul Burton	  busses #address-cells should equal 2, with the first cell being
2060a222d53SPaul Burton	  used to hold flags & flag 0x1 indicating that the address range
2070a222d53SPaul Burton	  should be accessed using I/O port in/out accessors. The second
2080a222d53SPaul Burton	  cell holds the offset into ISA bus address space. The #size-cells
2090a222d53SPaul Burton	  property should equal 1, and of course holds the size of the
2100a222d53SPaul Burton	  address range used by a device.
2110a222d53SPaul Burton
2120a222d53SPaul Burton	  If this option is not enabled then support for the ISA bus is
2130a222d53SPaul Burton	  not included and any such busses used in DT will be treated as
2140a222d53SPaul Burton	  typical simple-bus compatible busses. This will lead to
2150a222d53SPaul Burton	  mistranslation of device addresses, so ensure that this is
2160a222d53SPaul Burton	  enabled if your board does include an ISA bus.
2170a222d53SPaul Burton
218*f11c7ab9SSimon Glassconfig DM_DEV_READ_INLINE
219*f11c7ab9SSimon Glass	bool
220*f11c7ab9SSimon Glass	default y if !OF_LIVE
221*f11c7ab9SSimon Glass
2220b11dbf7SMasahiro Yamadaendmenu
223