xref: /openbmc/u-boot/drivers/core/Kconfig (revision 41c7f664b92acf81a7e3fd703cdb45097fc41eed)
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
2491a91ff8SSimon Glassconfig DM_WARN
2591a91ff8SSimon Glass	bool "Enable warnings in driver model"
26d648964fSMasahiro Yamada	depends on DM
27d648964fSMasahiro Yamada	default y
2891a91ff8SSimon Glass	help
2991a91ff8SSimon Glass	  The dm_warn() function can use up quite a bit of space for its
3091a91ff8SSimon Glass	  strings. By default this is disabled for SPL builds to save space.
3191a91ff8SSimon Glass	  This will cause dm_warn() to be compiled out - it will do nothing
3291a91ff8SSimon Glass	  when called.
3391a91ff8SSimon Glass
3491a91ff8SSimon Glassconfig DM_DEVICE_REMOVE
3591a91ff8SSimon Glass	bool "Support device removal"
36d648964fSMasahiro Yamada	depends on DM
37d648964fSMasahiro Yamada	default y
3891a91ff8SSimon Glass	help
3991a91ff8SSimon Glass	  We can save some code space by dropping support for removing a
4091a91ff8SSimon Glass	  device. This is not normally required in SPL, so by default this
4191a91ff8SSimon Glass	  option is disabled for SPL.
4291a91ff8SSimon Glass
43e5c4564eSHans de Goede	  Note that this may have undesirable results in the USB subsystem as
44e5c4564eSHans de Goede	  it causes unplugged devices to linger around in the dm-tree, and it
45e5c4564eSHans de Goede	  causes USB host controllers to not be stopped when booting the OS.
46e5c4564eSHans de Goede
4791a91ff8SSimon Glassconfig DM_STDIO
4891a91ff8SSimon Glass	bool "Support stdio registration"
49d648964fSMasahiro Yamada	depends on DM
50d648964fSMasahiro Yamada	default y
5191a91ff8SSimon Glass	help
5291a91ff8SSimon Glass	  Normally serial drivers register with stdio so that they can be used
5391a91ff8SSimon Glass	  as normal output devices. In SPL we don't normally use stdio, so
5491a91ff8SSimon Glass	  we can omit this feature.
5536fa61dcSSimon Glass
5636fa61dcSSimon Glassconfig DM_SEQ_ALIAS
5736fa61dcSSimon Glass	bool "Support numbered aliases in device tree"
5836fa61dcSSimon Glass	depends on DM
5936fa61dcSSimon Glass	default y
6036fa61dcSSimon Glass	help
6136fa61dcSSimon Glass	  Most boards will have a '/aliases' node containing the path to
6236fa61dcSSimon Glass	  numbered devices (e.g. serial0 = &serial0). This feature can be
6336fa61dcSSimon Glass	  disabled if it is not required, to save code space in SPL.
6412dc8e75SSimon Glass
6512dc8e75SSimon Glassconfig REGMAP
6612dc8e75SSimon Glass	bool "Support register maps"
6712dc8e75SSimon Glass	depends on DM
6812dc8e75SSimon Glass	help
6912dc8e75SSimon Glass	  Hardware peripherals tend to have one or more sets of registers
7012dc8e75SSimon Glass	  which can be accessed to control the hardware. A register map
7112dc8e75SSimon Glass	  models this with a simple read/write interface. It can in principle
7212dc8e75SSimon Glass	  support any bus type (I2C, SPI) but so far this only supports
7312dc8e75SSimon Glass	  direct memory access.
7412dc8e75SSimon Glass
75*41c7f664Shuang linconfig SPL_REGMAP
76*41c7f664Shuang lin	bool "Support register maps in SPL"
77*41c7f664Shuang lin	depends on DM
78*41c7f664Shuang lin	help
79*41c7f664Shuang lin	  Hardware peripherals tend to have one or more sets of registers
80*41c7f664Shuang lin	  which can be accessed to control the hardware. A register map
81*41c7f664Shuang lin	  models this with a simple read/write interface. It can in principle
82*41c7f664Shuang lin	  support any bus type (I2C, SPI) but so far this only supports
83*41c7f664Shuang lin	  direct memory access.
84*41c7f664Shuang lin
8512dc8e75SSimon Glassconfig SYSCON
8612dc8e75SSimon Glass	bool "Support system controllers"
8712dc8e75SSimon Glass	depends on REGMAP
8812dc8e75SSimon Glass	help
8912dc8e75SSimon Glass	  Many SoCs have a number of system controllers which are dealt with
9012dc8e75SSimon Glass	  as a group by a single driver. Some common functionality is provided
9112dc8e75SSimon Glass	  by this uclass, including accessing registers via regmap and
9212dc8e75SSimon Glass	  assigning a unique number to each.
93608f26c5SMasahiro Yamada
94*41c7f664Shuang linconfig SPL_SYSCON
95*41c7f664Shuang lin	bool "Support system controllers in SPL"
96*41c7f664Shuang lin	depends on REGMAP
97*41c7f664Shuang lin	help
98*41c7f664Shuang lin	  Many SoCs have a number of system controllers which are dealt with
99*41c7f664Shuang lin	  as a group by a single driver. Some common functionality is provided
100*41c7f664Shuang lin	  by this uclass, including accessing registers via regmap and
101*41c7f664Shuang lin	  assigning a unique number to each.
102*41c7f664Shuang lin
103e2282d70SMasahiro Yamadaconfig DEVRES
104e2282d70SMasahiro Yamada	bool "Managed device resources"
105e2282d70SMasahiro Yamada	depends on DM
106e2282d70SMasahiro Yamada	help
107e2282d70SMasahiro Yamada	  This option enables the Managed device resources core support.
108e2282d70SMasahiro Yamada	  Device resources managed by the devres framework are automatically
109e2282d70SMasahiro Yamada	  released whether initialization fails half-way or the device gets
110e2282d70SMasahiro Yamada	  detached.
111e2282d70SMasahiro Yamada
112e2282d70SMasahiro Yamada	  If this option is disabled, devres functions fall back to
113e2282d70SMasahiro Yamada	  non-managed variants.  For example, devres_alloc() to kzalloc(),
114e2282d70SMasahiro Yamada	  devm_kmalloc() to kmalloc(), etc.
115e2282d70SMasahiro Yamada
116608f26c5SMasahiro Yamadaconfig DEBUG_DEVRES
11740b6f2d0SMasahiro Yamada	bool "Managed device resources debugging functions"
118e2282d70SMasahiro Yamada	depends on DEVRES
119608f26c5SMasahiro Yamada	help
120608f26c5SMasahiro Yamada	  If this option is enabled, devres debug messages are printed.
12140b6f2d0SMasahiro Yamada	  Also, a function is available to dump a list of device resources.
122608f26c5SMasahiro Yamada	  Select this if you are having a problem with devres or want to
123608f26c5SMasahiro Yamada	  debug resource management for a managed device.
124608f26c5SMasahiro Yamada
125608f26c5SMasahiro Yamada	  If you are unsure about this, Say N here.
1260b11dbf7SMasahiro Yamada
127628d792cSMarek Vasutconfig SIMPLE_BUS
128628d792cSMarek Vasut	bool "Support simple-bus driver"
129628d792cSMarek Vasut	depends on DM && OF_CONTROL
130628d792cSMarek Vasut	default y
131628d792cSMarek Vasut	help
132628d792cSMarek Vasut	  Supports the 'simple-bus' driver, which is used on some systems.
133628d792cSMarek Vasut
134628d792cSMarek Vasutconfig SPL_SIMPLE_BUS
135628d792cSMarek Vasut	bool "Support simple-bus driver in SPL"
136628d792cSMarek Vasut	depends on SPL_DM && SPL_OF_CONTROL
137628d792cSMarek Vasut	default n
138628d792cSMarek Vasut	help
139628d792cSMarek Vasut	  Supports the 'simple-bus' driver, which is used on some systems
140628d792cSMarek Vasut	  in SPL.
141628d792cSMarek Vasut
142ef5cd330SStefan Roeseconfig OF_TRANSLATE
143ef5cd330SStefan Roese	bool "Translate addresses using fdt_translate_address"
144ef5cd330SStefan Roese	depends on DM && OF_CONTROL
145ef5cd330SStefan Roese	default y
146ef5cd330SStefan Roese	help
147ef5cd330SStefan Roese	  If this option is enabled, the reg property will be translated
148ef5cd330SStefan Roese	  using the fdt_translate_address() function. This is necessary
149ef5cd330SStefan Roese	  on some platforms (e.g. MVEBU) using complex "ranges"
150ef5cd330SStefan Roese	  properties in many nodes. As this translation is not handled
151ef5cd330SStefan Roese	  correctly in the default simple_bus_translate() function.
152ef5cd330SStefan Roese
153ef5cd330SStefan Roese	  If this option is not enabled, simple_bus_translate() will be
154ef5cd330SStefan Roese	  used for the address translation. This function is faster and
155ef5cd330SStefan Roese	  smaller in size than fdt_translate_address().
156ef5cd330SStefan Roese
157ef5cd330SStefan Roeseconfig SPL_OF_TRANSLATE
158ef5cd330SStefan Roese	bool "Translate addresses using fdt_translate_address"
159ef5cd330SStefan Roese	depends on SPL_DM && SPL_OF_CONTROL
160ef5cd330SStefan Roese	default n
161ef5cd330SStefan Roese	help
162ef5cd330SStefan Roese	  If this option is enabled, the reg property will be translated
163ef5cd330SStefan Roese	  using the fdt_translate_address() function. This is necessary
164ef5cd330SStefan Roese	  on some platforms (e.g. MVEBU) using complex "ranges"
165ef5cd330SStefan Roese	  properties in many nodes. As this translation is not handled
166ef5cd330SStefan Roese	  correctly in the default simple_bus_translate() function.
167ef5cd330SStefan Roese
168ef5cd330SStefan Roese	  If this option is not enabled, simple_bus_translate() will be
169ef5cd330SStefan Roese	  used for the address translation. This function is faster and
170ef5cd330SStefan Roese	  smaller in size than fdt_translate_address().
171ef5cd330SStefan Roese
1720b11dbf7SMasahiro Yamadaendmenu
173