serial: pl01x: Add support for devices with the rate pre-configured.
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the rpi.c file, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.
--- board/raspberrypi/rpi/rpi.c | 3 +-- drivers/serial/serial_pl01x.c | 4 ++++ include/dm/platform_data/serial_pl01x.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)
board/raspberrypi/rpi/rpi.c +1 -2
@@ -35,8 +35,7 @@ static const struct pl01x_serial_platdata serial_platdata = { #else .base = 0x20201000, #endif - .type = TYPE_PL011, - .clock = 3000000, + .type = TYPE_PL01X_PRECONFIGURED, }; U_BOOT_DEVICE(bcm2835_serials) = {
drivers/serial/serial_pl01x.c +4 -0
@@ -83,6 +83,8 @@ static int pl01x_generic_serial_init(struct pl01x_regs *regs,/* disable everything */ writel (0 , ®s->pl011_cr);break ; +case TYPE_PL01X_PRECONFIGURED : +break ;default :return -EINVAL ; }
@@ -172,6 +174,8 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,writel (UART_PL011_CR_UARTEN |UART_PL011_CR_TXE |UART_PL011_CR_RXE |UART_PL011_CR_RTS , ®s->pl011_cr);break ; +case TYPE_PL01X_PRECONFIGURED : +break ; }default :return -EINVAL ;
include/dm/platform_data/serial_pl01x.h +1 -0
@@ -9,6 +9,7 @@enum pl01x_type {TYPE_PL010 ,TYPE_PL011 , +TYPE_PL01X_PRECONFIGURED , };/*
Signature · 1 line
2.7.0
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
Quoted 6 lines · Eric Anholt
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the
rpi.cfile, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.
(With a 6MHz init_uart_clock and with/without init_uart_baud=9600)
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
Quoted 10 lines · Stephen Warren
Quoted 6 lines · Eric Anholt
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the
rpi.cfile, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.Tested-by Stephen Warren <[email protected]>(With a 6MHz
init_uart_clockand with/without init_uart_baud=9600)
Simon/Tom, did this slip through the cracks, or are you deferring it until the next release?
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
Hi Stephen,
Quoted 13 lines · Stephen Warren
Quoted 11 lines · Stephen Warren
Quoted 7 lines · Eric Anholt
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the
rpi.cfile, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.
Quoted 5 lines
Quoted 2 lines
Tested-by Stephen Warren <[email protected]>(With a 6MHz
init_uart_clockand with/without init_uart_baud=9600)Simon/Tom, did this slip through the cracks, or are you deferring it until the next release?
We haven't heard back on the review comments.
I don't really mind if we go the DT approach or this one. But this patch needs a little rework I think.
Regards,
Simon
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
Quoted 20 lines · Simon Glass
Hi Stephen,
Quoted 17 lines · Stephen Warren
Quoted 13 lines · Stephen Warren
Quoted 7 lines · Eric Anholt
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the
rpi.cfile, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.Tested-by Stephen Warren <[email protected]>(With a 6MHz
init_uart_clockand with/without init_uart_baud=9600)
Quoted 6 lines
Quoted 1 line
Simon/Tom, did this slip through the cracks, or are you deferring it until the next release?
We haven't heard back on the review comments.
I don't really mind if we go the DT approach or this one. But this patch needs a little rework I think.
I thought the main review comment was "didn't we try and do this with DT?" ? I'm feeling like we might want to skip doing anything DT related for this part...
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160307/0a942334/attachment.sig>
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
Hi Tom,
Quoted 23 lines · Tom Rini
Quoted 22 lines · Simon Glass
Hi Stephen,
Quoted 18 lines · Stephen Warren
Quoted 11 lines · Stephen Warren
Quoted 7 lines · Eric Anholt
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the
rpi.cfile, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.Quoted 2 lines
Tested-by Stephen Warren <[email protected]>(With a 6MHz
init_uart_clockand with/without init_uart_baud=9600)Simon/Tom, did this slip through the cracks, or are you deferring it until the next release?
Quoted 8 lines
Quoted 4 lines
We haven't heard back on the review comments.
I don't really mind if we go the DT approach or this one. But this patch needs a little rework I think.
I thought the main review comment was "didn't we try and do this with DT?" ? I'm feeling like we might want to skip doing anything DT related for this part...
My comment was on 6 Feb:
Quoted 1 line
+
TYPE_PL01X_PRECONFIGURED,
This seems odd. You are not adding a new UART type.
How about a separate bool flag?
Regards,
Simon
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
In reply to Eric AnholtHi Eric,
Quoted 55 lines · Eric Anholt
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the
rpi.cfile, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.Signed-off-by Eric Anholt <[email protected]>--- board/raspberrypi/rpi/rpi.c | 3 +-- drivers/serial/serial_pl01x.c | 4 ++++ include/dm/platform_data/serial_pl01x.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)board/raspberrypi/rpi/rpi.c +1
-2@@ -35,8 +35,7 @@ static const struct pl01x_serial_platdata serial_platdata = { #else .base = 0x20201000, #endif - .type = TYPE_PL011, - .clock = 3000000, + .type = TYPE_PL01X_PRECONFIGURED, }; U_BOOT_DEVICE(bcm2835_serials) = {drivers/serial/serial_pl01x.c +4
-0@@ -83,6 +83,8 @@ static int pl01x_generic_serial_init(struct pl01x_regs *regs,/* disable everything */ writel (0 , ®s->pl011_cr);break ; +case TYPE_PL01X_PRECONFIGURED : +break ;default :return -EINVAL ; }@@ -172,6 +174,8 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,writel (UART_PL011_CR_UARTEN |UART_PL011_CR_TXE |UART_PL011_CR_RXE |UART_PL011_CR_RTS , ®s->pl011_cr);break ; +case TYPE_PL01X_PRECONFIGURED : +break ; }default :return -EINVAL ;include/dm/platform_data/serial_pl01x.h +0
-0
include/dm/platform_data/serial_pl01x.h line 12
Quoted 4 lines
include/dm/platform_data/serial_pl01x.h +1
-0@@ -9,6 +9,7 @@enum pl01x_type {TYPE_PL010 ,TYPE_PL011 , +TYPE_PL01X_PRECONFIGURED ,
This seems odd. You are not adding a new UART type.
How about a separate bool flag?
Regards,
Simon
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
Quoted 65 lines · Simon Glass
Hi Eric,
Quoted 55 lines · Eric Anholt
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the
rpi.cfile, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.Signed-off-by Eric Anholt <[email protected]>--- board/raspberrypi/rpi/rpi.c | 3 +-- drivers/serial/serial_pl01x.c | 4 ++++ include/dm/platform_data/serial_pl01x.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)board/raspberrypi/rpi/rpi.c +1
-2@@ -35,8 +35,7 @@ static const struct pl01x_serial_platdata serial_platdata = { #else .base = 0x20201000, #endif - .type = TYPE_PL011, - .clock = 3000000, + .type = TYPE_PL01X_PRECONFIGURED, }; U_BOOT_DEVICE(bcm2835_serials) = {drivers/serial/serial_pl01x.c +4
-0@@ -83,6 +83,8 @@ static int pl01x_generic_serial_init(struct pl01x_regs *regs,/* disable everything */ writel (0 , ®s->pl011_cr);break ; +case TYPE_PL01X_PRECONFIGURED : +break ;default :return -EINVAL ; }@@ -172,6 +174,8 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,writel (UART_PL011_CR_UARTEN |UART_PL011_CR_TXE |UART_PL011_CR_RXE |UART_PL011_CR_RTS , ®s->pl011_cr);break ; +case TYPE_PL01X_PRECONFIGURED : +break ; }default :return -EINVAL ;include/dm/platform_data/serial_pl01x.h +0
-0include/dm/platform_data/serial_pl01x.h line 12
Quoted 4 lines
include/dm/platform_data/serial_pl01x.h +1
-0@@ -9,6 +9,7 @@enum pl01x_type {TYPE_PL010 ,TYPE_PL011 , +TYPE_PL01X_PRECONFIGURED ,This seems odd. You are not adding a new UART type.
Quoted 1 line
How about a separate bool flag?
I posted a patch with the same purpose a while ago
http://lists.denx.de/pipermail/u-boot/2015-October/230079.html
Regards,
Sergey
Quoted 7 lines
Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 1/1 serial: pl01x: Add support for devices with the rate pre-configured.
Quoted 66 lines · Sergei Temerkhanov
Quoted 65 lines · Simon Glass
Hi Eric,
Quoted 55 lines · Eric Anholt
For Raspberry Pi, we had the input clock rate to the pl011 fixed in the
rpi.cfile, but it may be changed by firmware due to user changes to config.txt. Since the firmware always sets up the uart (default 115200 output unless the user changes it), we can just skip our own uart init to simplify the boot process and more reliably get serial output.Signed-off-by Eric Anholt <[email protected]>--- board/raspberrypi/rpi/rpi.c | 3 +-- drivers/serial/serial_pl01x.c | 4 ++++ include/dm/platform_data/serial_pl01x.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)board/raspberrypi/rpi/rpi.c +1
-2@@ -35,8 +35,7 @@ static const struct pl01x_serial_platdata serial_platdata = { #else .base = 0x20201000, #endif - .type = TYPE_PL011, - .clock = 3000000, + .type = TYPE_PL01X_PRECONFIGURED, }; U_BOOT_DEVICE(bcm2835_serials) = {drivers/serial/serial_pl01x.c +4
-0@@ -83,6 +83,8 @@ static int pl01x_generic_serial_init(struct pl01x_regs *regs,/* disable everything */ writel (0 , ®s->pl011_cr);break ; +case TYPE_PL01X_PRECONFIGURED : +break ;default :return -EINVAL ; }@@ -172,6 +174,8 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,writel (UART_PL011_CR_UARTEN |UART_PL011_CR_TXE |UART_PL011_CR_RXE |UART_PL011_CR_RTS , ®s->pl011_cr);break ; +case TYPE_PL01X_PRECONFIGURED : +break ; }default :return -EINVAL ;include/dm/platform_data/serial_pl01x.h +0
-0include/dm/platform_data/serial_pl01x.h line 12
Quoted 4 lines
include/dm/platform_data/serial_pl01x.h +1
-0@@ -9,6 +9,7 @@enum pl01x_type {TYPE_PL010 ,TYPE_PL011 , +TYPE_PL01X_PRECONFIGURED ,This seems odd. You are not adding a new UART type.
Quoted 4 lines
Quoted 1 line
How about a separate bool flag?
I posted a patch with the same purpose a while ago
http://lists.denx.de/pipermail/u-boot/2015-October/230079.html
And then we got bogged down in "make a DT binding that's accepted" hell.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160208/e3c87ccd/attachment.sig>