serial: 8250_bcm7271: improve bcm7271 8250 port
Subsystems (2)
PATCH v2 1/1 serial: 8250_bcm7271: improve bcm7271 8250 port
The 8250 BCM7271 UART is not a direct match to PORT_16550A and other generic ports do not match its hardware capabilities. PORT_ALTR matches the rx trigger levels, but its vendor configurations are not compatible. Unfortunately this means we need to create another port to fully capture the hardware capabilities of the BCM7271 UART.
To alleviate some latency pressures, we default the rx trigger level to 8.
--- drivers/tty/serial/8250/8250_bcm7271.c | 4 +--- drivers/tty/serial/8250/8250_port.c | 8 ++++++++ include/uapi/linux/serial_core.h | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-)
drivers/tty/serial/8250/8250_bcm7271.c +1 -3
@@ -1042,7 +1042,7 @@ static int brcmuart_probe(struct platform_device *pdev)dev_dbg (dev,"DMA is %senabled\n" , priv->dma_enabled ?"" :"not " );memset (&up,0 ,sizeof (up)); - up.port.type =PORT_16550A ; + up.port.type =PORT_BCM7271 ; up.port.uartclk = clk_rate; up.port.dev = dev; up.port.mapbase = mapbase;
@@ -1056,8 +1056,6 @@ static int brcmuart_probe(struct platform_device *pdev) | UPF_FIXED_PORT | UPF_FIXED_TYPE; up.port.dev = dev; up.port.private_data = priv; - up.capabilities =UART_CAP_FIFO |UART_CAP_AFE ; - up.port.fifosize =32 ;/* Check for a fixed line number */ ret =of_alias_get_id (np,"serial" );
drivers/tty/serial/8250/8250_port.c +8 -0
@@ -322,6 +322,14 @@ static const struct serial8250_config uart_config[] = { .rxtrig_bytes = {2, 66, 130, 194}, .flags = UART_CAP_FIFO, }, + [PORT_BCM7271] = { + .name ="Broadcom BCM7271 UART" , + .fifo_size = 32, + .tx_loadsz = 32, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_01, + .rxtrig_bytes = {1, 8, 16, 30}, + .flags = UART_CAP_FIFO | UART_CAP_AFE + }, };/* Uart divisor latch read */
include/uapi/linux/serial_core.h +3 -0
@@ -144,6 +144,9 @@/* Blackfin bf5xx */ #define PORT_BFIN 75 +/* Broadcom BCM7271 UART */ +#define PORT_BCM7271 76 +/* Broadcom SB1250, etc. SOC */ #define PORT_SB1250_DUART 77
Signature · 1 line
2.7.4
Quoted 7 lines · Justin Chen
The 8250 BCM7271 UART is not a direct match to
PORT_16550Aand other generic ports do not match its hardware capabilities.PORT_ALTRmatches the rx trigger levels, but its vendor configurations are not compatible. Unfortunately this means we need to create another port to fully capture the hardware capabilities of the BCM7271 UART.To alleviate some latency pressures, we default the rx trigger level to 8.
...
drivers/tty/serial/8250/8250_port.c static const struct serial8250_config uart_config[] = { · line 331
Quoted 1 line
drivers/tty/serial/8250/8250_port.c +1
-0+ .flags = UART_CAP_FIFO | UART_CAP_AFE
Leave trailing comma
...
include/uapi/linux/serial_core.h line 148
Quoted 2 lines
include/uapi/linux/serial_core.h +2
-0+/* Broadcom BCM7271 UART */ +#define PORT_BCM7271 76
13 is free why not using it?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 7 lines · Andy Shevchenko
Quoted 6 lines · Justin Chen
The 8250 BCM7271 UART is not a direct match to
PORT_16550Aand other generic ports do not match its hardware capabilities.PORT_ALTRmatches the rx trigger levels, but its vendor configurations are not compatible. Unfortunately this means we need to create another port to fully capture the hardware capabilities of the BCM7271 UART.
Quoted 8 lines
Quoted 1 line
To alleviate some latency pressures, we default the rx trigger level to 8.
...
drivers/tty/serial/8250/8250_port.c static const struct serial8250_config uart_config[] = { · line 331
Quoted 1 line
drivers/tty/serial/8250/8250_port.c +1
-0+ .flags = UART_CAP_FIFO | UART_CAP_AFELeave trailing comma
Acked
Quoted 7 lines
...
include/uapi/linux/serial_core.h line 148
Quoted 2 lines
include/uapi/linux/serial_core.h +2
-0+/* Broadcom BCM7271 UART */ +#define PORT_BCM7271 7613 is free why not using it?
I was looking for a number close to another Broadcom port. I was prioritizing locality. But I have no issues with 13, I will change in v3.
Thanks,
Justin
Quoted 2 lines · Justin Chen
Quoted 1 line · Andy Shevchenko
On Thu, Aug 17, 2023 at 02:13:18PM -0700, Justin Chen wrote:
...
Quoted 7 lines
Quoted 4 lines
include/uapi/linux/serial_core.h line 148
Quoted 2 lines
include/uapi/linux/serial_core.h +2
-0+/* Broadcom BCM7271 UART */ +#define PORT_BCM7271 7613 is free why not using it?
I was looking for a number close to another Broadcom port. I was prioritizing locality. But I have no issues with 13, I will change in v3.
Please, don't. I realized that they are defined in different file. So, the first gap is 43. but I would like to compress the list first.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Greg Kroah-Hartman
maintainerQuoted 75 lines · Justin Chen
The 8250 BCM7271 UART is not a direct match to
PORT_16550Aand other generic ports do not match its hardware capabilities.PORT_ALTRmatches the rx trigger levels, but its vendor configurations are not compatible. Unfortunately this means we need to create another port to fully capture the hardware capabilities of the BCM7271 UART.To alleviate some latency pressures, we default the rx trigger level to 8.
Signed-off-by Justin Chen <[email protected]>Reviewed-by Florian Fainelli <[email protected]>Acked-by Doug Berger <[email protected]>--- drivers/tty/serial/8250/8250_bcm7271.c | 4 +--- drivers/tty/serial/8250/8250_port.c | 8 ++++++++ include/uapi/linux/serial_core.h | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-)drivers/tty/serial/8250/8250_bcm7271.c +1
-3@@ -1042,7 +1042,7 @@ static int brcmuart_probe(struct platform_device *pdev)dev_dbg (dev,"DMA is %senabled\n" , priv->dma_enabled ?"" :"not " );memset (&up,0 ,sizeof (up)); - up.port.type =PORT_16550A ; + up.port.type =PORT_BCM7271 ; up.port.uartclk = clk_rate; up.port.dev = dev; up.port.mapbase = mapbase;@@ -1056,8 +1056,6 @@ static int brcmuart_probe(struct platform_device *pdev) | UPF_FIXED_PORT | UPF_FIXED_TYPE; up.port.dev = dev; up.port.private_data = priv; - up.capabilities =UART_CAP_FIFO |UART_CAP_AFE ; - up.port.fifosize =32 ;/* Check for a fixed line number */ ret =of_alias_get_id (np,"serial" );drivers/tty/serial/8250/8250_port.c +8
-0@@ -322,6 +322,14 @@ static const struct serial8250_config uart_config[] = { .rxtrig_bytes = {2, 66, 130, 194}, .flags = UART_CAP_FIFO, }, + [PORT_BCM7271] = { + .name ="Broadcom BCM7271 UART" , + .fifo_size = 32, + .tx_loadsz = 32, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_01, + .rxtrig_bytes = {1, 8, 16, 30}, + .flags = UART_CAP_FIFO | UART_CAP_AFE + }, };/* Uart divisor latch read */ include/uapi/linux/serial_core.h +3
-0@@ -144,6 +144,9 @@/* Blackfin bf5xx */ #define PORT_BFIN 75 +/* Broadcom BCM7271 UART */ +#define PORT_BCM7271 76 +/* Broadcom SB1250, etc. SOC */ #define PORT_SB1250_DUART 77Signature · 1 line
2.7.4
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot