xref: /OK3568_Linux_fs/u-boot/drivers/core/Kconfig (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunmenu "Generic Driver Options"
2*4882a593Smuzhiyun
3*4882a593Smuzhiyunconfig DM
4*4882a593Smuzhiyun	bool "Enable Driver Model"
5*4882a593Smuzhiyun	help
6*4882a593Smuzhiyun	  This config option enables Driver Model. This brings in the core
7*4882a593Smuzhiyun	  support, including scanning of platform data on start-up. If
8*4882a593Smuzhiyun	  CONFIG_OF_CONTROL is enabled, the device tree will be scanned also
9*4882a593Smuzhiyun	  when available.
10*4882a593Smuzhiyun
11*4882a593Smuzhiyunconfig SPL_DM
12*4882a593Smuzhiyun	bool "Enable Driver Model for SPL"
13*4882a593Smuzhiyun	depends on DM && SPL
14*4882a593Smuzhiyun	help
15*4882a593Smuzhiyun	  Enable driver model in SPL. You will need to provide a
16*4882a593Smuzhiyun	  suitable malloc() implementation. If you are not using the
17*4882a593Smuzhiyun	  full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START,
18*4882a593Smuzhiyun	  consider using CONFIG_SYS_MALLOC_SIMPLE. In that case you
19*4882a593Smuzhiyun	  must provide CONFIG_SPL_SYS_MALLOC_F_LEN to set the size.
20*4882a593Smuzhiyun	  In most cases driver model will only allocate a few uclasses
21*4882a593Smuzhiyun	  and devices in SPL, so 1KB should be enable. See
22*4882a593Smuzhiyun	  CONFIG_SPL_SYS_MALLOC_F_LEN for more details on how to enable it.
23*4882a593Smuzhiyun
24*4882a593Smuzhiyunconfig TPL_DM
25*4882a593Smuzhiyun	bool "Enable Driver Model for TPL"
26*4882a593Smuzhiyun	depends on DM && TPL
27*4882a593Smuzhiyun	help
28*4882a593Smuzhiyun	  Enable driver model in TPL. You will need to provide a
29*4882a593Smuzhiyun	  suitable malloc() implementation. If you are not using the
30*4882a593Smuzhiyun	  full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START,
31*4882a593Smuzhiyun	  consider using CONFIG_SYS_MALLOC_SIMPLE. In that case you
32*4882a593Smuzhiyun	  must provide CONFIG_SPL_SYS_MALLOC_F_LEN to set the size.
33*4882a593Smuzhiyun	  In most cases driver model will only allocate a few uclasses
34*4882a593Smuzhiyun	  and devices in SPL, so 1KB should be enough. See
35*4882a593Smuzhiyun	  CONFIG_SPL_SYS_MALLOC_F_LEN for more details on how to enable it.
36*4882a593Smuzhiyun	  Disable this for very small implementations.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyunconfig DM_WARN
39*4882a593Smuzhiyun	bool "Enable warnings in driver model"
40*4882a593Smuzhiyun	depends on DM
41*4882a593Smuzhiyun	default y
42*4882a593Smuzhiyun	help
43*4882a593Smuzhiyun	  The dm_warn() function can use up quite a bit of space for its
44*4882a593Smuzhiyun	  strings. By default this is disabled for SPL builds to save space.
45*4882a593Smuzhiyun	  This will cause dm_warn() to be compiled out - it will do nothing
46*4882a593Smuzhiyun	  when called.
47*4882a593Smuzhiyun
48*4882a593Smuzhiyunconfig DM_DEBUG
49*4882a593Smuzhiyun	bool "Enable debug messages in driver model core"
50*4882a593Smuzhiyun	depends on DM
51*4882a593Smuzhiyun	help
52*4882a593Smuzhiyun	  Say Y here if you want to compile in debug messages in DM core.
53*4882a593Smuzhiyun
54*4882a593Smuzhiyunconfig DM_DEVICE_REMOVE
55*4882a593Smuzhiyun	bool "Support device removal"
56*4882a593Smuzhiyun	depends on DM
57*4882a593Smuzhiyun	default y
58*4882a593Smuzhiyun	help
59*4882a593Smuzhiyun	  We can save some code space by dropping support for removing a
60*4882a593Smuzhiyun	  device. This is not normally required in SPL, so by default this
61*4882a593Smuzhiyun	  option is disabled for SPL.
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun	  Note that this may have undesirable results in the USB subsystem as
64*4882a593Smuzhiyun	  it causes unplugged devices to linger around in the dm-tree, and it
65*4882a593Smuzhiyun	  causes USB host controllers to not be stopped when booting the OS.
66*4882a593Smuzhiyun
67*4882a593Smuzhiyunconfig DM_STDIO
68*4882a593Smuzhiyun	bool "Support stdio registration"
69*4882a593Smuzhiyun	depends on DM
70*4882a593Smuzhiyun	default y
71*4882a593Smuzhiyun	help
72*4882a593Smuzhiyun	  Normally serial drivers register with stdio so that they can be used
73*4882a593Smuzhiyun	  as normal output devices. In SPL we don't normally use stdio, so
74*4882a593Smuzhiyun	  we can omit this feature.
75*4882a593Smuzhiyun
76*4882a593Smuzhiyunconfig DM_SEQ_ALIAS
77*4882a593Smuzhiyun	bool "Support numbered aliases in device tree"
78*4882a593Smuzhiyun	depends on DM
79*4882a593Smuzhiyun	default y
80*4882a593Smuzhiyun	help
81*4882a593Smuzhiyun	  Most boards will have a '/aliases' node containing the path to
82*4882a593Smuzhiyun	  numbered devices (e.g. serial0 = &serial0). This feature can be
83*4882a593Smuzhiyun	  disabled if it is not required.
84*4882a593Smuzhiyun
85*4882a593Smuzhiyunconfig SPL_DM_SEQ_ALIAS
86*4882a593Smuzhiyun	bool "Support numbered aliases in device tree in SPL"
87*4882a593Smuzhiyun	depends on DM
88*4882a593Smuzhiyun	default n
89*4882a593Smuzhiyun	help
90*4882a593Smuzhiyun	  Most boards will have a '/aliases' node containing the path to
91*4882a593Smuzhiyun	  numbered devices (e.g. serial0 = &serial0). This feature can be
92*4882a593Smuzhiyun	  disabled if it is not required, to save code space in SPL.
93*4882a593Smuzhiyun
94*4882a593Smuzhiyunconfig REGMAP
95*4882a593Smuzhiyun	bool "Support register maps"
96*4882a593Smuzhiyun	depends on DM
97*4882a593Smuzhiyun	help
98*4882a593Smuzhiyun	  Hardware peripherals tend to have one or more sets of registers
99*4882a593Smuzhiyun	  which can be accessed to control the hardware. A register map
100*4882a593Smuzhiyun	  models this with a simple read/write interface. It can in principle
101*4882a593Smuzhiyun	  support any bus type (I2C, SPI) but so far this only supports
102*4882a593Smuzhiyun	  direct memory access.
103*4882a593Smuzhiyun
104*4882a593Smuzhiyunconfig SPL_REGMAP
105*4882a593Smuzhiyun	bool "Support register maps in SPL"
106*4882a593Smuzhiyun	depends on SPL_DM
107*4882a593Smuzhiyun	help
108*4882a593Smuzhiyun	  Hardware peripherals tend to have one or more sets of registers
109*4882a593Smuzhiyun	  which can be accessed to control the hardware. A register map
110*4882a593Smuzhiyun	  models this with a simple read/write interface. It can in principle
111*4882a593Smuzhiyun	  support any bus type (I2C, SPI) but so far this only supports
112*4882a593Smuzhiyun	  direct memory access.
113*4882a593Smuzhiyun
114*4882a593Smuzhiyunconfig TPL_REGMAP
115*4882a593Smuzhiyun	bool "Support register maps in TPL"
116*4882a593Smuzhiyun	depends on TPL_DM
117*4882a593Smuzhiyun	help
118*4882a593Smuzhiyun	  Hardware peripherals tend to have one or more sets of registers
119*4882a593Smuzhiyun	  which can be accessed to control the hardware. A register map
120*4882a593Smuzhiyun	  models this with a simple read/write interface. It can in principle
121*4882a593Smuzhiyun	  support any bus type (I2C, SPI) but so far this only supports
122*4882a593Smuzhiyun	  direct memory access.
123*4882a593Smuzhiyun
124*4882a593Smuzhiyunconfig SYSCON
125*4882a593Smuzhiyun	bool "Support system controllers"
126*4882a593Smuzhiyun	depends on REGMAP
127*4882a593Smuzhiyun	help
128*4882a593Smuzhiyun	  Many SoCs have a number of system controllers which are dealt with
129*4882a593Smuzhiyun	  as a group by a single driver. Some common functionality is provided
130*4882a593Smuzhiyun	  by this uclass, including accessing registers via regmap and
131*4882a593Smuzhiyun	  assigning a unique number to each.
132*4882a593Smuzhiyun
133*4882a593Smuzhiyunconfig SPL_SYSCON
134*4882a593Smuzhiyun	bool "Support system controllers in SPL"
135*4882a593Smuzhiyun	depends on SPL_REGMAP
136*4882a593Smuzhiyun	help
137*4882a593Smuzhiyun	  Many SoCs have a number of system controllers which are dealt with
138*4882a593Smuzhiyun	  as a group by a single driver. Some common functionality is provided
139*4882a593Smuzhiyun	  by this uclass, including accessing registers via regmap and
140*4882a593Smuzhiyun	  assigning a unique number to each.
141*4882a593Smuzhiyun
142*4882a593Smuzhiyunconfig TPL_SYSCON
143*4882a593Smuzhiyun	bool "Support system controllers in TPL"
144*4882a593Smuzhiyun	depends on TPL_REGMAP
145*4882a593Smuzhiyun	help
146*4882a593Smuzhiyun	  Many SoCs have a number of system controllers which are dealt with
147*4882a593Smuzhiyun	  as a group by a single driver. Some common functionality is provided
148*4882a593Smuzhiyun	  by this uclass, including accessing registers via regmap and
149*4882a593Smuzhiyun	  assigning a unique number to each.
150*4882a593Smuzhiyun
151*4882a593Smuzhiyunconfig DEVRES
152*4882a593Smuzhiyun	bool "Managed device resources"
153*4882a593Smuzhiyun	depends on DM
154*4882a593Smuzhiyun	help
155*4882a593Smuzhiyun	  This option enables the Managed device resources core support.
156*4882a593Smuzhiyun	  Device resources managed by the devres framework are automatically
157*4882a593Smuzhiyun	  released whether initialization fails half-way or the device gets
158*4882a593Smuzhiyun	  detached.
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun	  If this option is disabled, devres functions fall back to
161*4882a593Smuzhiyun	  non-managed variants.  For example, devres_alloc() to kzalloc(),
162*4882a593Smuzhiyun	  devm_kmalloc() to kmalloc(), etc.
163*4882a593Smuzhiyun
164*4882a593Smuzhiyunconfig DEBUG_DEVRES
165*4882a593Smuzhiyun	bool "Managed device resources debugging functions"
166*4882a593Smuzhiyun	depends on DEVRES
167*4882a593Smuzhiyun	help
168*4882a593Smuzhiyun	  If this option is enabled, devres debug messages are printed.
169*4882a593Smuzhiyun	  Also, a function is available to dump a list of device resources.
170*4882a593Smuzhiyun	  Select this if you are having a problem with devres or want to
171*4882a593Smuzhiyun	  debug resource management for a managed device.
172*4882a593Smuzhiyun
173*4882a593Smuzhiyun	  If you are unsure about this, Say N here.
174*4882a593Smuzhiyun
175*4882a593Smuzhiyunconfig SIMPLE_BUS
176*4882a593Smuzhiyun	bool "Support simple-bus driver"
177*4882a593Smuzhiyun	depends on DM && OF_CONTROL
178*4882a593Smuzhiyun	default y
179*4882a593Smuzhiyun	help
180*4882a593Smuzhiyun	  Supports the 'simple-bus' driver, which is used on some systems.
181*4882a593Smuzhiyun
182*4882a593Smuzhiyunconfig SPL_SIMPLE_BUS
183*4882a593Smuzhiyun	bool "Support simple-bus driver in SPL"
184*4882a593Smuzhiyun	depends on SPL_DM && SPL_OF_CONTROL
185*4882a593Smuzhiyun	default y
186*4882a593Smuzhiyun	help
187*4882a593Smuzhiyun	  Supports the 'simple-bus' driver, which is used on some systems
188*4882a593Smuzhiyun	  in SPL.
189*4882a593Smuzhiyun
190*4882a593Smuzhiyunconfig OF_TRANSLATE
191*4882a593Smuzhiyun	bool "Translate addresses using fdt_translate_address"
192*4882a593Smuzhiyun	depends on DM && OF_CONTROL
193*4882a593Smuzhiyun	default y
194*4882a593Smuzhiyun	help
195*4882a593Smuzhiyun	  If this option is enabled, the reg property will be translated
196*4882a593Smuzhiyun	  using the fdt_translate_address() function. This is necessary
197*4882a593Smuzhiyun	  on some platforms (e.g. MVEBU) using complex "ranges"
198*4882a593Smuzhiyun	  properties in many nodes. As this translation is not handled
199*4882a593Smuzhiyun	  correctly in the default simple_bus_translate() function.
200*4882a593Smuzhiyun
201*4882a593Smuzhiyun	  If this option is not enabled, simple_bus_translate() will be
202*4882a593Smuzhiyun	  used for the address translation. This function is faster and
203*4882a593Smuzhiyun	  smaller in size than fdt_translate_address().
204*4882a593Smuzhiyun
205*4882a593Smuzhiyunconfig SPL_OF_TRANSLATE
206*4882a593Smuzhiyun	bool "Translate addresses using fdt_translate_address in SPL"
207*4882a593Smuzhiyun	depends on SPL_DM && SPL_OF_CONTROL
208*4882a593Smuzhiyun	default n
209*4882a593Smuzhiyun	help
210*4882a593Smuzhiyun	  If this option is enabled, the reg property will be translated
211*4882a593Smuzhiyun	  using the fdt_translate_address() function. This is necessary
212*4882a593Smuzhiyun	  on some platforms (e.g. MVEBU) using complex "ranges"
213*4882a593Smuzhiyun	  properties in many nodes. As this translation is not handled
214*4882a593Smuzhiyun	  correctly in the default simple_bus_translate() function.
215*4882a593Smuzhiyun
216*4882a593Smuzhiyun	  If this option is not enabled, simple_bus_translate() will be
217*4882a593Smuzhiyun	  used for the address translation. This function is faster and
218*4882a593Smuzhiyun	  smaller in size than fdt_translate_address().
219*4882a593Smuzhiyun
220*4882a593Smuzhiyunconfig OF_ISA_BUS
221*4882a593Smuzhiyun	bool
222*4882a593Smuzhiyun	depends on OF_TRANSLATE
223*4882a593Smuzhiyun	help
224*4882a593Smuzhiyun	  Is this option is enabled then support for the ISA bus will
225*4882a593Smuzhiyun	  be included for addresses read from DT. This is something that
226*4882a593Smuzhiyun	  should be known to be required or not based upon the board
227*4882a593Smuzhiyun	  being targetted, and whether or not it makes use of an ISA bus.
228*4882a593Smuzhiyun
229*4882a593Smuzhiyun	  The bus is matched based upon its node name equalling "isa". The
230*4882a593Smuzhiyun	  busses #address-cells should equal 2, with the first cell being
231*4882a593Smuzhiyun	  used to hold flags & flag 0x1 indicating that the address range
232*4882a593Smuzhiyun	  should be accessed using I/O port in/out accessors. The second
233*4882a593Smuzhiyun	  cell holds the offset into ISA bus address space. The #size-cells
234*4882a593Smuzhiyun	  property should equal 1, and of course holds the size of the
235*4882a593Smuzhiyun	  address range used by a device.
236*4882a593Smuzhiyun
237*4882a593Smuzhiyun	  If this option is not enabled then support for the ISA bus is
238*4882a593Smuzhiyun	  not included and any such busses used in DT will be treated as
239*4882a593Smuzhiyun	  typical simple-bus compatible busses. This will lead to
240*4882a593Smuzhiyun	  mistranslation of device addresses, so ensure that this is
241*4882a593Smuzhiyun	  enabled if your board does include an ISA bus.
242*4882a593Smuzhiyun
243*4882a593Smuzhiyunconfig DM_DEV_READ_INLINE
244*4882a593Smuzhiyun	bool
245*4882a593Smuzhiyun	default y if !OF_LIVE
246*4882a593Smuzhiyun
247*4882a593Smuzhiyunendmenu
248