From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380147; b=QR6O6zMyhYK/uhJEOaBh9V0xEmV8f59INb9LkiNxa2yipmz0S7s/mSnxubJKSzuwERUf p5G/mTIFE3Us5puL28Fzpk938VJwW5Xfqqy3g11QzlBp2V3IIoK0xtvLVqXO/ucWN2S5U o6dD/J/wlxM2uXdtPdwvhE4tPuU/cFm6uzLzaa3uyg0NeloZAR0NjtVU9pldlXZdYSdh9 zwonwr9MWk64DdwuF1eWMbVdLTBGdAzT953NYuY4SsvFCNBS3tw9cB1FCgcZOEgjt11t2 OH+yyuy3j1EGXtfq1L09n3fOqnNDxThg3x1/du8XmqIMUrIfr8XeZ+yq2FnY7jQqDpw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380147; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:Subject:Date: Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding: X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer; bh=1NjAQS6EovJ97cf/W+wN+b3pY9qQxoiYZ1PXeX45G9o=; b=RjCDwBm9CjhBNFpsb99fwTIrA2LNgK40vjAW3oHDTC7kYM/TChHlm+9OzTl3ov5BZ0a6 Bsyz941l8pnb0jUgqjYkC6xt3mYDRBBBDZLVisn2RENBCQ72BGp8pj5KM4Y2ShcD+W4RM S+DnjvXErKuGYBimGSZ7rcx4lvnoiI0EePH7rRLVYG9EhCK7Cqpst+l9AX7x/6qmEnT8V 8z2fXitN5rl8/UQ19MqDA+fFIV2VPoUCocXouShqVNJkvxBIgt7CNfrnVCMDKSOYUZCal SuzYTeMSjZpqSWDQklntXIvZ4x0seGtrzYNO8pby7QK4PqCaOvAACeqOzWJ6zpIFN9A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=LiNZpNOD; arc=none smtp.remote-ip=209.85.210.45 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 784FF606A339 for ; Fri, 4 Dec 2026 10:29:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 784FF606A339 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=LiNZpNOD Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-85a5455bd3cso478388a34.3 for ; Fri, 04 Dec 2026 02:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796380145; x=1796984945; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=1NjAQS6EovJ97cf/W+wN+b3pY9qQxoiYZ1PXeX45G9o=; b=LiNZpNODX3ssztDfcyYx/i94gA70MNYJyqnxdoppkKwYqdDlkwhK/BLjCczGBjYMIS RgCWsdPqBwgZ3AwBdZQv6IaqixCqsLKoyIBKLS2Eyp/iCbmKhcbRRQTYaN8hLB9TYPwf tDyszYxDr74DSkHsKy4Q3HVCEw/9v2Mx7ED3IGmJTuHaG2O4LIO/SyMzBxWILvlGDEP8 enMEpyWPqMR1DeWk07QpzCZ30AkuAHQAcfw5zgru/2thMD/ECOvTC92vZusqF9wJuCLp vL6Xrhfe1F1A1hb3auc2hcYEBYk5JVUfz88NelXBJe3g2UtudP9psBG5QsAx1s+lroji sQYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796380145; x=1796984945; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=1NjAQS6EovJ97cf/W+wN+b3pY9qQxoiYZ1PXeX45G9o=; b=yHTBK82DqVIBDPcOL//x159qMTQ9mCd1h88NZLnJOpiLX8TYD9eQAPAI2kIfC2TTYf I7CCa9qHAmEG26Q56qx5/R1ZDinrfPy19iYuuH4+azGb9nx8l2ZFANsTH8V8MSmJhVOe u+D394juoRd4lU3Tm0ojnvA5ox2DzcNKcngHIWIxFzT099PCi0q3Yx/LpFz2HmJA8jk3 HMi45fgEcjg2drnokbK9z0SYU1B1LMfjTmQXcz+G/ElyiPB6J9VdfCjcD2ibT0Wz9YGi BzkYS+PDdvsOYoO2Z1rTcURnDv+x9LtPaS7VYKqE1n0K9CPc4nuFseWdrSH7v0ybadb9 Eq5Q== X-Gm-Message-State: APuU4Z/ApRcMA0wjbwH2e0P3NBhY023g/aoRWaWFaeMsVuuy/q1vx0eU N5ky+Oz7lfePRmoOXtn95L+jVgOEMxbkeR1cIXe4CQPvB4g9mm1vl27n X-Gm-Gg: AZFdTZd3zE8s315u0b0F1xYNDEUZOlCfgGVUQd1b637rMhEvHQLE+WKxJMRkZPT1ghy AuEm9ev1BOXMDlYT+1b0dR01wiRopUQWSzmdBzVOtwYSe6iZJwmKuVOLiKUK8WMfi5ueFYzLxws oDaV3qJ9rbmlefaFsm5JqHwWFgSbrY0oi4Af1iDJj38yGoWN/Xd6fZeit53Nrn5f6U2De9oD+uv 9iM/yOdd5kEMG1/9JZ9D5PRnOHAp0HughXWL/vFsJyirSWC+5BMLZxLt9Zo0OzSpo27O+Ch6hj+ Zc9vZ4N0NHNNqir0+zAdIaADljH/4QtW06UjQevMR54c20AOvw/3M3fraBA53UjAQalYZPck0UN 0HRAdKCg0emrJ3jal1Hs7Gaq0aGOM+sUzMDe4x4d9opOb4n0+Ad3oA/VvAHvTxmQQxSg7z/SWSA /VYkGRB8rJRgFzRVFpx28OtJovLrAgnprAdXlPBkgFiU8Pjh3Ukn151bDbjukJkueJ3MPL+rtic lSm8WzBtU7t6g0ATw+ocdSZMHB6GfYo+/THlNIqEqQnxanc3uzxcN6iWiqf0Z5o7z3Sz1+ac8ak BLZOARMyPEKwmHdpDQ/D2KnaVUDoFXSKiEnQM6DgP7kYRNz/lWrWQYk0YLvv83Wow5+gFG+YPn6 aFDkAtX6ZFLBT9TlAN5hfahAFfUQMPNKISYRWRBSQ/BBZNSKYFNzCerC+enHaRsJHTf9w+27ytH HWn/77F19SY28aaRbU0ZGF26cXF2Q70RWUtb/zSWLwdawhtxh82D0ySQ== X-Received: by 2002:a05:6830:2e13:b0:806:9a8d:4b9b with SMTP id 46e09a7af769-863f89ae9eemr1930179a34.15.1796380145289; Fri, 04 Dec 2026 02:29:05 -0800 (PST) Received: from [127.0.1.1] (174-29-20-82.hlrn.qwest.net. [174.29.20.82]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-863f81fad14sm1747533a34.9.2026.12.04.02.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 02:29:04 -0800 (PST) From: James Hilliard Subject: [PATCH v10 00/11] serial: 8250_dw: share RX trigger setup and describe Allwinner UARTs Date: Fri, 04 Dec 2026 03:28:45 -0700 Message-Id: <20261204-submit-h616-uart-fifo-v1-v10-0-1a9fb4f79635@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/43T2a7TMBAA0F+p/IzB23jpE/+BeBhvt0a3zSVJC +iq/844FSJKRYSUFyfOGXuWdzaVsZWJHQ/vbCy3NrXhQgspPhxYOuHlpfCW6QVTQlkplOLTNZ7 bzE9WWn7Fcea11YHfJE+ANeVaIEXB6Pe3sdT2c7G/fH2s6d9vJc3d6ztObZqH8dcS/Cb7vj9h9 L/D0CN4MagjFlUi+s8vZ2yvH9NwZj3MTf0vpAjCKiBoEMZq2EJ6DZkdSBOkvK1JRp90klvIrCG 3AxmCsnZFSF+zQLuFYA2FHQgIAh2N1lhirE85sn8hknYg26/WCxu1sVGkLeTW0F6yHUEpFGV8t h6ec+TXEOxAniBpqCBZRelN3EJhDe3lKBCkq9DByozF4xq6P/p1LN+vNBLzo4lZxKlw+k7g8VC LrdVnyNZBEtIFHQM1k8zSCoCcDaIDZQxbT9LxsO3LPn/4yr0CKv0PnhvN4DD2A0KV1oeSBaA/U un7kXBOp4UJGHSA5CQkFauLMWGBmCk4ah2yqwqrVTYsOVnOHUe8pFMfvcfFPj2lRLD7/TcQuD0 VEQQAAA== X-Change-ID: 20261022-submit-h616-uart-fifo-v1-c5afcdfe5cb0 To: Andy Shevchenko , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard , Krzysztof Kozlowski X-Mailer: b4 0.17-dev DesignWare UART receive thresholds are one byte, one quarter full, one half full and two bytes below full. Describe this mapping in dwlib so CPR-described DW and LPSS ports use their actual FIFO depth when reporting or setting rx_trig_bytes. Widen the 8250 threshold tables, setter byte counts and sysfs parser to 16 bits to support larger DW FIFOs, including the 2 KiB configuration. Enable the same interface for Octeon using its fixed 64-byte FIFO depth. Expose rx_trig_bytes for ports supplying both trigger callbacks, including port types without a static trigger table. Retain Octeon's special register accessors, optional-register probe bypass and existing DMA selection. Reuse the same trigger setup for the Allwinner integrations. H616 has fixed 256-byte FIFOs without a readable FIFO-depth register. A523, A527 and T527 have different depths across their UARTs and report each port's depth in the FIFO Clock Control register. Select the fixed platform-data depth when provided, otherwise read FCC, and validate the depth before building the threshold table. Dedicated compatibles select the Allwinner configuration without probing overlapping optional DesignWare registers. Keep PORT_16550A, configure automatic flow control, preserve BUSY-safe integer divisor programming and keep the UART clock gate enabled during termios changes. The sunxi setup uses PIO. The series first prepares setup error propagation and platform callbacks, then widens and shares the 8250 trigger conversion, enables callback-based sysfs controls, and adds common DW setup and Allwinner bindings and driver support. The SoC DTS changes are deferred for a separate submission through the platform tree. Based on tty-next with the RX trigger callback-lifetime and DesignWare BUSY-safe divisor fixes. Platform setup runs before installing the BUSY-safe divisor setter. Signed-off-by: James Hilliard --- Changes in v10: - Rebase on current tty-next and the rebased BUSY-safe divisor fix. - Kryštof Černý tested the CPR-derived thresholds on RK3328 with v8 [0]. Arun Iyengar tested v6 patches 1–7 on H616 [1]. - Link to v9: https://patch.msgid.link/20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com [0] https://lore.kernel.org/r/873c22a2-fd3f-4927-a06f-16a73c30de86@gmail.com/ [1] https://lore.kernel.org/r/179534023971.231108.3039673113639895699@gmail.com/ Changes in v9: - Keep the conditional setup call and place its error check outside the conditional in the preparatory patch, following Andy's review. - Use FIELD_MODIFY() to update the RX trigger field, converting the FCR encoding back to its field value first. - Collect Andy's Reviewed-by for setup error propagation. - Link to v8: https://patch.msgid.link/20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com Changes in v8: - Defer the H616 and A523 DTS changes for separate submission through the platform tree, following Krzysztof's review. - Separate the dw8250_setup_port() return-type conversion and caller error handling into a preparatory patch before the platform setup refactor, following Andy's review. - Place the RX trigger table first in the hardware-configuration members of dw8250_port_data, following Andy's review. - Group and comment the fixed-depth/FCC selection, and use the conditional operator for Octeon's default FIFO depth, following Andy's review. - Carry Andy's Reviewed-by for the H616 driver configuration. - Link to v7: https://patch.msgid.link/20261103-submit-h616-uart-fifo-v1-v7-0-c9e248d685c1@gmail.com Changes in v7: - Rebase onto tty-next at 6628e7d4c6b2 (7.4-rc1), keeping the latest posted DW divisor v4 and RX trigger lifetime prerequisites. - Keep the shared conversion internal to 8250_base now that both callers are linked there. - Move callback-based sysfs exposure ahead of the common DW trigger setup. - Expose rx_trig_bytes when a port supplies both trigger callbacks, even when its port type has no static threshold table. - Initialize Octeon's FIFO-relative thresholds from its fixed depth while preserving register access and DMA selection. - Widen the 8250 RX trigger tables, setter callback and sysfs parser to 16-bit byte counts for the larger FIFO depths supported by DesignWare. - Move FIFO-relative threshold construction and the trigger callbacks into dwlib, and use them for CPR-described DW and LPSS ports as well as the Allwinner integrations, following Andy's review. - Share FIFO-depth validation and propagate setup failures through the DW and LPSS probe paths before registering a port. - Keep the existing integer loop in the extracted conversion helper, following Andy's review. - Use explicit fixed-depth and FCC-discovery branches in sunxi setup, following Andy's review. - Clarify that FIFO-relative RX triggers are shared DesignWare behavior; describe Allwinner FIFO discovery and register-layout details separately. - Link to v6: https://patch.msgid.link/20261102-submit-h616-uart-fifo-v1-v6-0-25afcb346b0c@gmail.com Changes in v6: - Export the shared RX trigger conversion in the SERIAL_8250 namespace and explain how driver callbacks avoid new legacy port types. - Lead the H616 trigger description with the FIFO-relative mapping and include array_size.h explicitly. - Name the trigger divisors and full-FIFO margin, reusing them for FCC depth validation. Explain that the upper bound follows the current byte-sized 8250 interface and can be widened with it. - Describe the fixed-depth platform-data field independently of sunxi. - Carry Ilpo's setup/helper review tags and Krzysztof's A523 binding ack. - Link to v5: https://patch.msgid.link/20261029-submit-h616-uart-fifo-v1-v5-0-53b433aebbf8@gmail.com Changes in v5: - Reject FIFO depths that cannot produce positive, byte-sized RX trigger thresholds, report the invalid size and propagate setup errors to probe. - Add the A523 UART compatible and use it for the shared CPUX UART nodes, including those inherited by the A527 and T527 boards. - Read the FIFO depth from FCC when sunxi platform data has no fixed depth, preserving the fixed H616 configuration and FCC clock controls. - Explain why the per-port trigger table is derived from the FIFO depth; use the same sunxi helper for the FCC-discovered A523-family ports. - Move the shared RX trigger conversion helper into 8250_port.c and export it, following Ilpo's review; retain Andy's review tags. - Use FIELD_PREP() and an intermediate trigger value when building the sunxi table, following Ilpo's review. - Select the DMA setup helper directly for the 64-bit-only Octeon platform and match the single-line comment style, following Andy's review. - Carry Krzysztof's Acked-by for the unchanged H616 binding addition. - Link to v4: https://patch.msgid.link/20261027-submit-h616-uart-fifo-v1-v4-0-d37e018fd0a6@gmail.com 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@gmail.com 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@gmail.com 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@gmail.com To: Andy Shevchenko To: Ilpo Järvinen To: Greg Kroah-Hartman To: Jiri Slaby To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley Cc: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: devicetree@vger.kernel.org --- James Hilliard (11): serial: 8250_dw: allow port setup to report errors serial: 8250_dw: select port setup through platform data serial: 8250: widen RX trigger byte counts to 16 bits serial: 8250: share the RX trigger conversion helper serial: 8250: expose RX trigger controls for custom callbacks serial: 8250_dw: derive RX trigger thresholds from the FIFO depth dt-bindings: serial: snps-dw-apb-uart: add Allwinner H616 serial: 8250_dw: configure the Allwinner H616 UART dt-bindings: serial: snps-dw-apb-uart: add Allwinner A523 serial: 8250_dw: discover Allwinner A523 FIFO depths through FCC serial: 8250_dw: configure RX trigger thresholds for Octeon .../bindings/serial/snps-dw-apb-uart.yaml | 2 + drivers/tty/serial/8250/8250.h | 4 +- drivers/tty/serial/8250/8250_dw.c | 116 +++++++++++++++++++-- drivers/tty/serial/8250/8250_dwlib.c | 93 ++++++++++++++++- drivers/tty/serial/8250/8250_dwlib.h | 4 +- drivers/tty/serial/8250/8250_lpss.c | 4 +- drivers/tty/serial/8250/8250_mxpcie.c | 2 +- drivers/tty/serial/8250/8250_port.c | 27 +++-- include/linux/serial_core.h | 2 +- 9 files changed, 226 insertions(+), 28 deletions(-) --- base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next change-id: 20261022-submit-h616-uart-fifo-v1-c5afcdfe5cb0 prerequisite-change-id: 20261023-submit-serial-8250-dw-divisor-v1-5f1689ed05a8:v5 prerequisite-patch-id: 17e55383e9d50a46fc5f93a8df2be4a8c7d0d067 prerequisite-patch-id: 9a9395c715c2bf7bbcae5bdd16a339d7f2af6269 Best regards, -- James Hilliard