driver: core/input: treat 'u-boot,dm-spl' as 'u-boot,dm-pre-reloc'

It works when CONFIG_USING_KERNEL_DTB is enabled, because we can
set either 'u-boot,dm-spl' or 'u-boot,dm-pre-reloc' for the node
that we can to leave in the u-boot.dtb.

Change-Id: Id3cec0c64ee55ca9bc1e5871e7ad5a2ebb4b1b6a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-10-24 08:59:55 +08:00
parent f988e29580
commit 930ceb12e0
4 changed files with 12 additions and 4 deletions

View File

@ -70,7 +70,8 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv,
list_for_each_entry_safe(dev, n, &uc->dev_head, uclass_node) { list_for_each_entry_safe(dev, n, &uc->dev_head, uclass_node) {
if (!strcmp(name, dev->name) && if (!strcmp(name, dev->name) &&
dev_read_bool(dev, "u-boot,dm-pre-reloc")) { (dev_read_bool(dev, "u-boot,dm-pre-reloc") ||
dev_read_bool(dev, "u-boot,dm-spl"))) {
if (drv->id == UCLASS_SERIAL || drv->id == UCLASS_CRYPTO) { if (drv->id == UCLASS_SERIAL || drv->id == UCLASS_CRYPTO) {
/* Always use serial node from U-Boot dtb */ /* Always use serial node from U-Boot dtb */
debug("%s do not delete uboot dev: %s\n", debug("%s do not delete uboot dev: %s\n",

View File

@ -35,7 +35,8 @@ static void show_devices(struct udevice *dev, int depth, int last_flag)
} }
printf("%s %s\n", dev->name, printf("%s %s\n", dev->name,
dev_read_bool(dev, "u-boot,dm-pre-reloc") ? "*" : ""); dev_read_bool(dev, "u-boot,dm-pre-reloc") ||
dev_read_bool(dev, "u-boot,dm-spl") ? "*" : "");
list_for_each_entry(child, &dev->child_head, sibling_node) { list_for_each_entry(child, &dev->child_head, sibling_node) {
is_last = list_is_last(&child->sibling_node, &dev->child_head); is_last = list_is_last(&child->sibling_node, &dev->child_head);

View File

@ -224,7 +224,12 @@ static int dm_scan_fdt_live(struct udevice *parent,
for (np = node_parent->child; np; np = np->sibling) { for (np = node_parent->child; np; np = np->sibling) {
if (pre_reloc_only && if (pre_reloc_only &&
!of_find_property(np, "u-boot,dm-pre-reloc", NULL)) #ifdef CONFIG_USING_KERNEL_DTB
(!of_find_property(np, "u-boot,dm-pre-reloc", NULL) ||
!of_find_property(np, "u-boot,dm-spl", NULL)))
#else
!of_find_property(np, "u-boot,dm-pre-reloc", NULL))
#endif
continue; continue;
if (!of_device_is_available(np)) { if (!of_device_is_available(np)) {
pr_debug(" - ignoring disabled device\n"); pr_debug(" - ignoring disabled device\n");

View File

@ -263,7 +263,8 @@ static int key_post_probe(struct udevice *dev)
return -ENXIO; return -ENXIO;
/* True from U-Boot key node */ /* True from U-Boot key node */
uc_key->pre_reloc = dev_read_bool(dev, "u-boot,dm-pre-reloc"); uc_key->pre_reloc = dev_read_bool(dev, "u-boot,dm-pre-reloc") ||
dev_read_bool(dev, "u-boot,dm-spl");
if (uc_key->type == ADC_KEY) { if (uc_key->type == ADC_KEY) {
uc_key->max = uc_key->adcval + margin; uc_key->max = uc_key->adcval + margin;