From 5dc68b07e75d4695a554b60135d70f1847885bd2 Mon Sep 17 00:00:00 2001 From: Eugen Hristev Date: Thu, 28 Jan 2021 10:14:11 +0200 Subject: ARM: dts: at91: sama7g5ek: enable pull-up for serial debug line If the serial tx/rx are floating, it can happen that bogus characters are detected on the line at boot time. This leads to U-boot accidentally thinking someone pressed a key to stop autoboot, thus stopping booting process. This can happen if the serial cable is not connected. There are hardware pull-ups on the board connected to serial cable VBUS. To solve this when the cable is not plugged, enable internal pull-ups as well for the tx/rx lines. Signed-off-by: Eugen Hristev --- arch/arm/dts/sama7g5ek.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/sama7g5ek.dts b/arch/arm/dts/sama7g5ek.dts index ff9c9eb..3a4fdd3 100644 --- a/arch/arm/dts/sama7g5ek.dts +++ b/arch/arm/dts/sama7g5ek.dts @@ -122,7 +122,7 @@ pinctrl_flx3_default: flx3_default { pinmux = , ; - bias-disable; + bias-pull-up; }; pinctrl_sdmmc0_cmd_data_default: sdmmc0_cmd_data_default { -- cgit v1.1 From 65bde1c087f847a2e279501e27eeaddba16e3b51 Mon Sep 17 00:00:00 2001 From: Eugen Hristev Date: Tue, 2 Feb 2021 10:47:58 +0200 Subject: clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()" Revert changes in at91 compat.c that cause u-boot to fail booting on sama5d4_xplained and sama5d2_xplained Log below: No serial driver found Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Fixes: a2703ce10c ("dm: Remove uses of device_bind_offset()") Cc: Simon Glass Signed-off-by: Eugen Hristev Reviewed-by: Simon Glass --- drivers/clk/at91/compat.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/clk/at91/compat.c b/drivers/clk/at91/compat.c index e514f26..dfdc3a6 100644 --- a/drivers/clk/at91/compat.c +++ b/drivers/clk/at91/compat.c @@ -62,30 +62,34 @@ static int at91_pmc_core_probe(struct udevice *dev) */ int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name) { - ofnode parent = dev_ofnode(dev); - ofnode node; + const void *fdt = gd->fdt_blob; + int offset = dev_of_offset(dev); bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC); const char *name; int ret; - ofnode_for_each_subnode(node, parent) { - if (pre_reloc_only && !ofnode_pre_reloc(node)) + for (offset = fdt_first_subnode(fdt, offset); + offset > 0; + offset = fdt_next_subnode(fdt, offset)) { + if (pre_reloc_only && + !ofnode_pre_reloc(offset_to_ofnode(offset))) continue; /* * If this node has "compatible" property, this is not * a clock sub-node, but a normal device. skip. */ - if (ofnode_read_prop(node, "compatible", NULL)) + fdt_get_property(fdt, offset, "compatible", &ret); + if (ret >= 0) continue; if (ret != -FDT_ERR_NOTFOUND) return ret; - name = ofnode_get_name(node); + name = fdt_get_name(fdt, offset, NULL); if (!name) return -EINVAL; - ret = device_bind_driver_to_node(dev, drv_name, name, node, - NULL); + ret = device_bind_driver_to_node(dev, drv_name, name, + offset_to_ofnode(offset), NULL); if (ret) return ret; } -- cgit v1.1