Re: [PATCH v4 0/5] serial: 8250_dw: describe the Allwinner H616 UART configuration

From: James Hilliard

Date: Wed Oct 28 2026 - 05:09:32 EST


On Wed, Oct 28, 2026 at 2:57 AM Andre Przywara <andre.przywara@xxxxxxx> wrote:
>
> Hi,
>
> On 10/28/26 00:05, James Hilliard wrote:
> > H616 has 256-byte UART FIFOs, but lacks the DesignWare component parameter
> > register used to discover their capacity. Its debug-divisor and RS485
> > registers also overlap offsets used to probe optional DesignWare features.
>
> that affects almost all Allwinner SoCs, not just the H616, so should be
> solved universally, not just for one SoC.

Some Allwinner SoC's can read fifo size from a non-standard
register from the looks of it.

This approach at least allows for just adding SoC appropriate
compatibles with their fifo-size tied to the compatible. Or the
fifo-size can be pulled via that FCC register on the fly and
reuse the code paths here probably by tying that logic to
the compatibles as well.

>
> IIUC Chen-Yu has a patch to attribute the right FIFO size, in each
> .dtsi, which I consider the best solution to this problem.
>
> I'd say we wait for -rc1 and then work on top of his patch.
>
> Cheers,
> Andre
>
> >
> > Add an H616 compatible for the integration-specific setup. Keep the
> > existing 16550A port type and describe its fixed FIFO depth in platform
> > data. Use common Allwinner helpers to configure the transmit load and
> > receive thresholds from that depth. Configure automatic flow control,
> > preserve the BUSY-safe integer divisor path and keep the UART gate enabled
> > during termios changes. The H616 configuration uses PIO.
> >
> > The series first introduces platform setup callbacks and a shared RX
> > trigger conversion helper, then adds the binding, H616 setup and SoC DTS
> > changes. Based on tty-next at 6b4b543fa187 with the posted RX
> > trigger callback-lifetime fix [0] and DW BUSY-safe divisor fix v4 [1].
> > Platform setup runs before installing the BUSY-safe divisor setter.
> >
> > [0] https://lore.kernel.org/r/20261024-submit-serial-8250-rxtrig-lifetime-v1-v1-1-731b78d5003d@xxxxxxxxx
> > [1] https://lore.kernel.org/r/20261027-submit-serial-8250-dw-divisor-v1-v4-1-41714a75e15a@xxxxxxxxx
> >
> > Assisted-by: Codex:gpt-6-astra
> > Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
> > ---
> > Changes in v4:
> > - Introduce common Allwinner setup helpers with the fixed FIFO depth
> > supplied by compatible-specific platform data.
> > - Rebase onto tty-next at 6b4b543fa187 and the posted DW divisor v4 fix,
> > installing the BUSY-safe setter after platform setup.
> > - Use an early return for FIFO-less DMA setup, following Andy's review.
> > - Default to generic setup when platform data has no setup callback.
> > - Select Octeon's optional-register discovery with IS_ENABLED() in its
> > setup helper, preserving the existing 32-bit and 64-bit behavior.
> > - Extract the shared 8250 bytes-to-FCR conversion, including the
> > unsupported-table check, into a preparatory patch and use it for
> > H616, following Andy's review.
> > - Set the fixed 256-byte FIFO depth in H616 platform data and omit
> > fifo-size from its binding and DTS, following Krzysztof's review.
> > - Precompute the Allwinner RX thresholds during setup and retain the
> > sunxi FIFO-depth helper for filling the table. Use named FCR encodings
> > in the helper, following Jiri's review.
> > - Share threshold-table initialization and callback assignment through
> > a sunxi RX trigger setup helper.
> > - Group and comment the H616 trigger and RS485 setup.
> > - Link to v3: https://patch.msgid.link/20261024-submit-h616-uart-fifo-v1-v3-0-286fc1b8c3c1@xxxxxxxxx
> >
> > Changes in v3:
> > - Introduce a platform-data setup callback in a preparatory patch,
> > replacing skip_autocfg and preserving the existing Octeon setup.
> > - Describe each H616 UART's FIFO capacity with the standard fifo-size DT
> > property and use the value already read by uart_read_port_properties().
> > - Derive the Allwinner RX trigger thresholds from the FIFO depth.
> > - Use an unsigned trigger index and conditional runtime PM guard,
> > preserving error propagation when the device cannot resume.
> > - Rebase onto tty-next, replacing the earlier DMA prerequisites with the
> > posted RX trigger callback-lifetime fix.
> > - Separate DMA enablement into follow-up work, retaining PIO operation
> > for the H616 FIFO configuration.
> > - Link to v2: https://lore.kernel.org/r/20261023-submit-h616-uart-fifo-v1-v2-0-af0593504635@xxxxxxxxx
> >
> > Changes in v2:
> > - Keep PORT_16550A and set the FIFO size, transmit load and capabilities
> > during setup, following Andy's review.
> > - Select H616 setup through the matched platform-data pointer and remove
> > the type and DMA burst-size platform-data members.
> > - Use get_rxtrig/set_rxtrig for the 1/64/128/254-byte receive thresholds,
> > with port locking and runtime PM around register updates. Keep the
> > standard half-full FCR default, selecting 128 bytes on H616.
> > - Advertise UART_CAP_AFE so CRTSCTS enables hardware automatic flow control.
> > - Rebase onto next-20261023 and declare the posted sun6i pause/lifetime
> > fixes and their prerequisites for DMA enablement.
> > - Link to v1: https://lore.kernel.org/r/20261023-submit-h616-uart-fifo-v1-v1-0-e4a3bae2eba8@xxxxxxxxx
> >
> > To: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > To: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
> > To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > To: Jiri Slaby <jirislaby@xxxxxxxxxx>
> > To: Rob Herring <robh@xxxxxxxxxx>
> > To: Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>
> > To: Conor Dooley <conor+dt@xxxxxxxxxx>
> > To: Chen-Yu Tsai <wens@xxxxxxxxxx>
> > To: Jernej Skrabec <jernej.skrabec@xxxxxxxxx>
> > To: Samuel Holland <samuel@xxxxxxxxxxxx>
> > Cc: linux-kernel@xxxxxxxxxxxxxxx
> > Cc: linux-serial@xxxxxxxxxxxxxxx
> > Cc: devicetree@xxxxxxxxxxxxxxx
> > Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> > Cc: linux-sunxi@xxxxxxxxxxxxxxx
> >
> > ---
> > James Hilliard (5):
> > serial: 8250_dw: select port setup through platform data
> > serial: 8250: share the RX trigger conversion helper
> > dt-bindings: serial: snps-dw-apb-uart: add Allwinner H616
> > serial: 8250_dw: configure the Allwinner H616 UART
> > arm64: dts: allwinner: h616: describe the UART integration
> >
> > .../bindings/serial/snps-dw-apb-uart.yaml | 1 +
> > arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi | 12 +-
> > drivers/tty/serial/8250/8250.h | 16 +++
> > drivers/tty/serial/8250/8250_dw.c | 138 +++++++++++++++++++--
> > drivers/tty/serial/8250/8250_port.c | 12 +-
> > 5 files changed, 151 insertions(+), 28 deletions(-)
> > ---
> > base-commit: 6b4b543fa18757297ac756a6fe6e64f506b7844a
> > change-id: 20261022-submit-h616-uart-fifo-v1-c5afcdfe5cb0
> > prerequisite-message-id: <20261027-submit-serial-8250-dw-divisor-v1-v4-1-41714a75e15a@xxxxxxxxx>
> > prerequisite-patch-id: d8219673210dac82d3adab41578ff2f76f5862c9
> > prerequisite-message-id: <20261024-submit-serial-8250-rxtrig-lifetime-v1-v1-1-731b78d5003d@xxxxxxxxx>
> > prerequisite-patch-id: 9a9395c715c2bf7bbcae5bdd16a339d7f2af6269
> >
> > Best regards,
> > --
> > James Hilliard <james.hilliard1@xxxxxxxxx>
>