Thread (32 messages) 32 messages, 5 authors, 2025-11-05

RE: [PATCH v6 4/6] arm64: dts: aspeed: Add initial AST2700 SoC device tree

From: Ryan Chen <ryan_chen@aspeedtech.com>
Date: 2025-10-25 03:15:55
Also in: linux-aspeed, linux-devicetree, lkml

Subject: Re: [PATCH v6 4/6] arm64: dts: aspeed: Add initial AST2700 SoC device
tree

On Thu, 23 Oct 2025 at 22:11, Arnd Bergmann [off-list ref] wrote:
quoted
On Thu, Oct 23, 2025, at 09:37, Ryan Chen wrote:
quoted
quoted
quoted
+  aliases {
+          serial0 = &uart0;
+          serial1 = &uart1;
+          serial2 = &uart2;
+          serial3 = &uart3;
+          serial4 = &uart4;
+          serial5 = &uart5;
+          serial6 = &uart6;
+          serial7 = &uart7;
+          serial8 = &uart8;
+          serial9 = &uart9;
+          serial10 = &uart10;
+          serial11 = &uart11;
+          serial12 = &uart12;
+          serial13 = &uart13;
+          serial14 = &uart14;
+  };
This looks like you just list all the uarts that are present on the
chip, which is not how the aliases are meant to be used. Move this
block into the board specific file and only list the ones that are
actually enabled on that particular board.

In particular, the alias names are meant to be local to the board
and don't usually correspond to the numbering inside of the chip.
In the defconfig, we currently set CONFIG_SERIAL_8250_NR_UARTS=8,
which is enough for any board we support so far, but that means
only the first
8 aliases in the list will actually work.
Understood. I'll move the aliases block from the SoC dtsi into the
EVB board dts. For the EVB, UART12 is used as the default console,
and the board labels match the SoC numbering, so I plan to keep:

Does that look acceptable?
ast2700-evb.dts
      aliases {
              serial0 = &uart0;
              serial1 = &uart1;
              serial2 = &uart2;
              serial3 = &uart3;
              serial4 = &uart4;
              serial5 = &uart5;
              serial6 = &uart6;
              serial7 = &uart7;
              serial8 = &uart8;
              serial9 = &uart9;
              serial10 = &uart10;
              serial11 = &uart11;
              serial12 = &uart12;
              serial13 = &uart13;
              serial14 = &uart14;
}
I think this would be broken for the defconfig if the consol is on
serial12. I would recommend using serial0 as the console, like

aliases {
       serial0 = &uart12;
}

in this case. If additional uarts are enabled, add those as further
aliases.
Indeed. Are all these serial ports exposed on the board?
Aliases is mean to list only the ones that are exposed, and the alias number
should match the label on the board/port ("serialN", "debugN", ...), ideally.

Typically only a few ports are exposed, so you may end up with something like:

arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi:           serial0 = &scif1;
arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi:           serial1 = &scif3;
arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi:           serial3 = &scif0;

I deliberately picked this example, as it shows how the serialN numbering does
not need to match the scifM (or uartM) numbering.

Gr{oetje,eeting}s,

                        Geert

--
Hi Geert,

Thanks for the clarification and the Renesas example — that helps a lot.

Yes, on the AST2700 EVB only a few UARTs are actually routed out,
and UART12 is used as the main console port.

I’ll update the EVB DTS accordingly to list only the exposed ports, e.g.:
aliases {
    serial0 = &uart12; /* console */
};

> Geert Uytterhoeven -- There's lots of Linux beyond ia32 --
> geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help