[PATCH] fdt/sunxi: Remove OF_STDOUT_PATH

65 views
Skip to first unread message

Andre Przywara

unread,
Feb 14, 2021, 7:35:02 AM2/14/21
to Simon Glass, Tom Rini, Jagan Teki, u-b...@lists.denx.de, Tobias Schramm, Marek Vasut, Michal Simek, linux...@googlegroups.com
OF_STDOUT_PATH was meant to hold the devicetree path to the serial
console, to be put into the linux,stdout-path property of the chosen node.

The only user of that was sunxi, and it was actually wrong for years
there: the paths hardcoded in sunxi_common.h were not matching the DTs,
evident by the leading 0's in nodenames, which have been removed years
ago.

On top of that, "linux,stdout-path" is now deprecated for a while (Linux
commit 2a9d832cc9aae from November 2014), and also all modern DTs
(including those included in U-Boot) carry a "stdout-path" property
already.

So remove the stanza from sunxi_common.h, and, since this was the last
user, also remove the associated bits from the rest of U-Boot.

Signed-off-by: Andre Przywara <andre.p...@arm.com>
---
README | 1 -
common/fdt_support.c | 9 +--------
include/configs/sunxi-common.h | 18 ------------------
scripts/config_whitelist.txt | 1 -
4 files changed, 1 insertion(+), 28 deletions(-)

diff --git a/README b/README
index f7f9aa56196..b962ba7c2f7 100644
--- a/README
+++ b/README
@@ -575,7 +575,6 @@ The following options need to be configured:
* The bootm command automatically updates the fdt

OF_TBCLK - The timebase frequency.
- OF_STDOUT_PATH - The path to the console device

boards with QUICC Engines require OF_QE to set UCC MAC
addresses
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 638eca983e8..4fa1e9f1aee 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -127,14 +127,7 @@ int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name)
return offset;
}

-/* rename to CONFIG_OF_STDOUT_PATH ? */
-#if defined(OF_STDOUT_PATH)
-static int fdt_fixup_stdout(void *fdt, int chosenoff)
-{
- return fdt_setprop(fdt, chosenoff, "linux,stdout-path",
- OF_STDOUT_PATH, strlen(OF_STDOUT_PATH) + 1);
-}
-#elif defined(CONFIG_OF_STDOUT_VIA_ALIAS) && defined(CONFIG_CONS_INDEX)
+#if defined(CONFIG_OF_STDOUT_VIA_ALIAS) && defined(CONFIG_CONS_INDEX)
static int fdt_fixup_stdout(void *fdt, int chosenoff)
{
int err;
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 000f3864702..8c1fce9929a 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -238,24 +238,6 @@ extern int soft_i2c_gpio_scl;
defined CONFIG_SY8106A_POWER
#endif

-#ifdef CONFIG_REQUIRE_SERIAL_CONSOLE
-#if CONFIG_CONS_INDEX == 1
-#ifdef CONFIG_MACH_SUN9I
-#define OF_STDOUT_PATH "/soc/serial@07000000:115200"
-#else
-#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28000:115200"
-#endif
-#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I)
-#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200"
-#elif CONFIG_CONS_INDEX == 3 && defined(CONFIG_MACH_SUN8I)
-#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28800:115200"
-#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I)
-#define OF_STDOUT_PATH "/soc@01c00000/serial@01f02800:115200"
-#else
-#error Unsupported console port nr. Please fix stdout-path in sunxi-common.h.
-#endif
-#endif /* ifdef CONFIG_REQUIRE_SERIAL_CONSOLE */
-
#ifdef CONFIG_VIDEO_SUNXI
/*
* The amount of RAM to keep free at the top of RAM when relocating u-boot,
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index c6a83124956..b39cdab96c1 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1182,7 +1182,6 @@ CONFIG_NUM_PAMU
CONFIG_ODROID_REV_AIN
CONFIG_OFF_PADCONF
CONFIG_OF_
-CONFIG_OF_STDOUT_PATH
CONFIG_OMAP_EHCI_PHY1_RESET_GPIO
CONFIG_OMAP_EHCI_PHY2_RESET_GPIO
CONFIG_OMAP_EHCI_PHY3_RESET_GPIO
--
2.17.5

Tom Rini

unread,
Feb 14, 2021, 9:27:23 AM2/14/21
to Andre Przywara, Simon Glass, Jagan Teki, u-b...@lists.denx.de, Tobias Schramm, Marek Vasut, Michal Simek, linux...@googlegroups.com
On Sun, Feb 14, 2021 at 12:33:58PM +0000, Andre Przywara wrote:

> OF_STDOUT_PATH was meant to hold the devicetree path to the serial
> console, to be put into the linux,stdout-path property of the chosen node.
>
> The only user of that was sunxi, and it was actually wrong for years
> there: the paths hardcoded in sunxi_common.h were not matching the DTs,
> evident by the leading 0's in nodenames, which have been removed years
> ago.
>
> On top of that, "linux,stdout-path" is now deprecated for a while (Linux
> commit 2a9d832cc9aae from November 2014), and also all modern DTs
> (including those included in U-Boot) carry a "stdout-path" property
> already.
>
> So remove the stanza from sunxi_common.h, and, since this was the last
> user, also remove the associated bits from the rest of U-Boot.
>
> Signed-off-by: Andre Przywara <andre.p...@arm.com>

Reviewed-by: Tom Rini <tr...@konsulko.com>

--
Tom
signature.asc

Simon Glass

unread,
Feb 17, 2021, 11:45:43 PM2/17/21
to Andre Przywara, Tom Rini, Jagan Teki, U-Boot Mailing List, Tobias Schramm, Marek Vasut, Michal Simek, linux-sunxi
On Sun, 14 Feb 2021 at 05:35, Andre Przywara <andre.p...@arm.com> wrote:
>
> OF_STDOUT_PATH was meant to hold the devicetree path to the serial
> console, to be put into the linux,stdout-path property of the chosen node.
>
> The only user of that was sunxi, and it was actually wrong for years
> there: the paths hardcoded in sunxi_common.h were not matching the DTs,
> evident by the leading 0's in nodenames, which have been removed years
> ago.
>
> On top of that, "linux,stdout-path" is now deprecated for a while (Linux
> commit 2a9d832cc9aae from November 2014), and also all modern DTs
> (including those included in U-Boot) carry a "stdout-path" property
> already.
>
> So remove the stanza from sunxi_common.h, and, since this was the last
> user, also remove the associated bits from the rest of U-Boot.
>
> Signed-off-by: Andre Przywara <andre.p...@arm.com>
> ---
> README | 1 -
> common/fdt_support.c | 9 +--------
> include/configs/sunxi-common.h | 18 ------------------
> scripts/config_whitelist.txt | 1 -
> 4 files changed, 1 insertion(+), 28 deletions(-)
>

You should teach a class in how to write commit messages :-)

Reviewed-by: Simon Glass <s...@chromium.org>

Andre Przywara

unread,
Feb 18, 2021, 11:03:14 AM2/18/21
to Simon Glass, Tom Rini, Jagan Teki, U-Boot Mailing List, Tobias Schramm, Marek Vasut, Michal Simek, linux-sunxi
On Wed, 17 Feb 2021 21:45:29 -0700
Simon Glass <s...@chromium.org> wrote:

Hi Simon,
Thanks :blush:

> Reviewed-by: Simon Glass <s...@chromium.org>

Thanks, shall I take this patch through the sunxi tree (I have a PR
ready anyway), or do you want to take it?

Cheers,
Andre

Simon Glass

unread,
Feb 18, 2021, 11:52:40 PM2/18/21
to Andre Przywara, Tom Rini, Jagan Teki, U-Boot Mailing List, Tobias Schramm, Marek Vasut, Michal Simek, linux-sunxi
Hi Andre,
Please go ahead with sunxi.

Regards,
Simon
Reply all
Reply to author
Forward
0 new messages