mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-30 00:20:44 +09:00
dm: core: Allow sequence alias support to be removed for SPL
In many cases SPL only uses a single serial port and there is no need for alias sequence support. We will just use the serial port pointed to by stdout-path in the /chosen node. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
ab9fd2e83a
commit
36fa61dc61
@ -46,3 +46,12 @@ config DM_STDIO
|
|||||||
Normally serial drivers register with stdio so that they can be used
|
Normally serial drivers register with stdio so that they can be used
|
||||||
as normal output devices. In SPL we don't normally use stdio, so
|
as normal output devices. In SPL we don't normally use stdio, so
|
||||||
we can omit this feature.
|
we can omit this feature.
|
||||||
|
|
||||||
|
config DM_SEQ_ALIAS
|
||||||
|
bool "Support numbered aliases in device tree"
|
||||||
|
depends on DM
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Most boards will have a '/aliases' node containing the path to
|
||||||
|
numbered devices (e.g. serial0 = &serial0). This feature can be
|
||||||
|
disabled if it is not required, to save code space in SPL.
|
||||||
|
@ -56,21 +56,23 @@ int device_bind(struct udevice *parent, const struct driver *drv,
|
|||||||
|
|
||||||
dev->seq = -1;
|
dev->seq = -1;
|
||||||
dev->req_seq = -1;
|
dev->req_seq = -1;
|
||||||
#ifdef CONFIG_OF_CONTROL
|
if (IS_ENABLED(CONFIG_OF_CONTROL) && IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) {
|
||||||
/*
|
/*
|
||||||
* Some devices, such as a SPI bus, I2C bus and serial ports are
|
* Some devices, such as a SPI bus, I2C bus and serial ports
|
||||||
* numbered using aliases.
|
* are numbered using aliases.
|
||||||
*
|
*
|
||||||
* This is just a 'requested' sequence, and will be
|
* This is just a 'requested' sequence, and will be
|
||||||
* resolved (and ->seq updated) when the device is probed.
|
* resolved (and ->seq updated) when the device is probed.
|
||||||
*/
|
*/
|
||||||
if (uc->uc_drv->flags & DM_UC_FLAG_SEQ_ALIAS) {
|
if (uc->uc_drv->flags & DM_UC_FLAG_SEQ_ALIAS) {
|
||||||
if (uc->uc_drv->name && of_offset != -1) {
|
if (uc->uc_drv->name && of_offset != -1) {
|
||||||
fdtdec_get_alias_seq(gd->fdt_blob, uc->uc_drv->name,
|
fdtdec_get_alias_seq(gd->fdt_blob,
|
||||||
of_offset, &dev->req_seq);
|
uc->uc_drv->name, of_offset,
|
||||||
|
&dev->req_seq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
if (!dev->platdata && drv->platdata_auto_alloc_size) {
|
if (!dev->platdata && drv->platdata_auto_alloc_size) {
|
||||||
dev->flags |= DM_FLAG_ALLOC_PDATA;
|
dev->flags |= DM_FLAG_ALLOC_PDATA;
|
||||||
dev->platdata = calloc(1, drv->platdata_auto_alloc_size);
|
dev->platdata = calloc(1, drv->platdata_auto_alloc_size);
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#undef CONFIG_DM_WARN
|
#undef CONFIG_DM_WARN
|
||||||
#undef CONFIG_DM_DEVICE_REMOVE
|
#undef CONFIG_DM_DEVICE_REMOVE
|
||||||
|
#undef CONFIG_DM_SEQ_ALIAS
|
||||||
#undef CONFIG_DM_STDIO
|
#undef CONFIG_DM_STDIO
|
||||||
|
|
||||||
#endif /* CONFIG_SPL_BUILD */
|
#endif /* CONFIG_SPL_BUILD */
|
||||||
|
Loading…
Reference in New Issue
Block a user