mbox series

[v4,0/2] 8250: Add driver for Broadcom UART

Message ID 20210308170522.4272-1-alcooperx@gmail.com
Headers show
Series 8250: Add driver for Broadcom UART | expand

Message

Alan Cooper March 8, 2021, 5:05 p.m. UTC
v5 - Changes based on requests from Greg Kroah-Hartman
     - Move sysfs stats to debugfs.
     - Merge the .h file into the .c file.
     - Convert "flags" with only one flag to bool
     - Remove most dev_dbg() messages. Some can be replaced by using
       ftrace and some would cause a crash if the driver was used
       for the console.

v4 - Fix MAINTAINERS
   - Make all changes requested by Jira Slaby. The only functional
     change was to handle errors returned by brcmuart_arbitration()
     in brcmuart_resume().

v3 - remove "disable_dma" module param because it can be done
     by modifying the device tree node instead. Reduce size by
     removing some debug fuctionality that was no longer used.
   - Fix error from yaml compiler in bindings

v2 - remove the patch that modified 8250_of.c to keep it from
     registering before this driver when this driver was deferred
     as it was getting it's "clocks". This was fixed by changing
     the Device Tree entry to remove "clock-frequency". This results
     in both drivers getting "clocks" and getting same the deferral.

Al Cooper (2):
  dt-bindings: Add support for the Broadcom UART driver
  serial: 8250: Add new 8250-core based Broadcom STB driver

 .../bindings/serial/brcm,bcm7271-uart.yaml    |   96 ++
 MAINTAINERS                                   |    8 +
 drivers/tty/serial/8250/8250_bcm7271.c        | 1207 +++++++++++++++++
 drivers/tty/serial/8250/Kconfig               |   10 +
 drivers/tty/serial/8250/Makefile              |    1 +
 5 files changed, 1322 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml
 create mode 100644 drivers/tty/serial/8250/8250_bcm7271.c

Comments

Rob Herring (Arm) March 10, 2021, 2:50 a.m. UTC | #1
On Mon, Mar 08, 2021 at 12:05:21PM -0500, Al Cooper wrote:
> Add DT bindings for the Broadcom 8250 based UART driver. This

> UART is based on an 8250 but adds additional functionality. The

> additional features include the ability to use DMA for transfers and

> a baud rate clock system that is more accurate at high baud rates.

> This UART is backward compatible with the standard 8250 UART.


My comments on the previous v4 still apply.

> 

> Signed-off-by: Al Cooper <alcooperx@gmail.com>

> ---

>  .../bindings/serial/brcm,bcm7271-uart.yaml    | 96 +++++++++++++++++++

>  1 file changed, 96 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml

> 

> diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml b/Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml

> new file mode 100644

> index 000000000000..f3d58e613480

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml

> @@ -0,0 +1,96 @@

> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/serial/brcm,bcm7271-uart.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Broadcom 8250 based serial port devicetree bindings

> +

> +maintainers:

> +  - Al Cooper <alcooperx@gmail.com>

> +

> +description: |+

> +  The Broadcom UART is based on the basic 8250 UART but with

> +  enhancements for more accurate high speed baud rates and support

> +  for DMA.

> +

> +properties:

> +  $nodename:

> +    pattern: "^serial@[0-9a-f]+$"

> +

> +  compatible:

> +    items:

> +      - enum:

> +          - brcm,bcm7271-uart

> +          - brcm,bcm7278-uart

> +  reg:

> +    minItems: 1

> +    maxItems: 5

> +

> +  reg-names:

> +    description: The UART register block and optionally the DMA register blocks.

> +    oneOf:

> +      - items:

> +          - const: uart

> +      - items:

> +          - const: uart

> +          - const: dma_arb

> +          - const: dma_rx

> +          - const: dma_tx

> +          - const: dma_intr2

> +

> +  clocks:

> +    minItems: 1

> +

> +  clock-names:

> +    const: sw_baud

> +

> +  interrupts:

> +    minItems: 1

> +    maxItems: 2

> +

> +  interrupt-names:

> +    description: The UART interrupt and optionally the DMA interrupt.

> +    oneOf:

> +      - items:

> +          - const: uart

> +      - items:

> +          - const: uart

> +          - const: dma

> +

> +required:

> +  - compatible

> +  - reg

> +  - reg-names

> +  - clocks

> +  - clock-names

> +  - interrupts

> +  - interrupt-names

> +

> +additionalProperties: false

> +

> +examples:

> +  - |

> +    serial@840d000 {

> +        compatible = "brcm,bcm7271-uart";

> +        reg = <0x840d000 0x20>;

> +        reg-names = "uart";

> +        interrupts = <0x0 0x62 0x4>;

> +        interrupt-names = "uart";

> +        clocks = <&scmi_clk 190>;

> +        clock-names = "sw_baud";

> +    };

> +

> +    serial@840e000 {

> +        compatible = "brcm,bcm7271-uart";

> +        reg = <0x840e000 0x20>,

> +              <0x840e080 0x8>,

> +              <0x840e100 0xa8>,

> +              <0x840e200 0x4c>,

> +              <0x840e300 0x30>;

> +        reg-names = "uart", "dma_arb", "dma_rx", "dma_tx", "dma_intr2";

> +        interrupts = <0x0 0x62 0x4>, <0x0 0x75 0x4>;

> +        interrupt-names = "uart", "dma";

> +        clocks = <&scmi_clk 190>;

> +        clock-names = "sw_baud";

> +    };

> -- 

> 2.17.1

>