| 0ee80f35 | 15-Nov-2021 |
Pali Rohár <pali@kernel.org> |
fix(plat/marvell/a3720/uart): do external reset during initialization
Sometimes when changing UART clock from TBG to XTAL, UART HW enters into some broken state. It does not transit characters from
fix(plat/marvell/a3720/uart): do external reset during initialization
Sometimes when changing UART clock from TBG to XTAL, UART HW enters into some broken state. It does not transit characters from TX FIFO anymore and TX FIFO stays always empty. TX FIFO reset does not recover UART HW from this broken state.
Experiments show that external reset can fix UART HW from this broken state.
TF-A fatal error handler calls console_a3700_core_init() function to initialize UART HW. This handler may be called anytime during CPU runtime, also when kernel is running.
U-Boot or Linux kernel may change UART clock to TBG to achieve higher baudrates. During initialization, console_a3700_core_init() resets UART configuration to default settings, which means that it also changes UART clock from TBG to XTAL.
Do an external reset of UART via North Bridge Peripheral reset register to prevent this UART hangup.
Signed-off-by: Pali Rohár <pali@kernel.org> Change-Id: I8990bce24d1a6fd8ccc47a2cd0a5ff932fcfcf14
show more ...
|
| 15546dbf | 15-Nov-2021 |
Pali Rohár <pali@kernel.org> |
fix(plat/marvell/a3720/uart): configure UART after TX FIFO reset
If TX FIFO is not empty, do not touch UART settings and let UART HW transmit remaining bytes from TX FIFO. New UART settings are then
fix(plat/marvell/a3720/uart): configure UART after TX FIFO reset
If TX FIFO is not empty, do not touch UART settings and let UART HW transmit remaining bytes from TX FIFO. New UART settings are then set only after TX FIFO is reset.
Signed-off-by: Pali Rohár <pali@kernel.org> Change-Id: I2976c0a4fbb841d3a79d42ef67c06e70174afc3b
show more ...
|
| b9185c75 | 13-May-2021 |
Pali Rohár <pali@kernel.org> |
fix(plat/marvell/a3720/uart): fix configuring UART clock
When configuring the UART_BAUD_REG register, the function console_a3700_core_init() currently only changes the baud divisor field, leaving ot
fix(plat/marvell/a3720/uart): fix configuring UART clock
When configuring the UART_BAUD_REG register, the function console_a3700_core_init() currently only changes the baud divisor field, leaving other fields to their previous value.
This is incorrect, because the baud divisor is computed with the assumption that the parent clock rate is 25 MHz, and since the other fields in this register configure the parent clock, which could have been changed by U-Boot or Linux.
Fix this function to also configure the other fields so that the UART parent clock is selected to be the xtal clock.
For example without this change TF-A prints only
ERROR: a3700_system_off needs to be implemented
followed by garbage after plat_crash_console_init() is called.
After applying this change instead of garbage it also print crash info:
PANIC at PC : 0x0000000004023800
Signed-off-by: Pali Rohár <pali@kernel.org> Change-Id: I72f338355cc60d939b8bb978d9c7fdd576416b81
show more ...
|
| 0d06b058 | 16-Feb-2021 |
Pali Rohár <pali@kernel.org> |
marvell: uart: a3720: Increase TX FIFO EMPTY timeout from 2ms to 3ms
TX FIFO has space for 32 characters. With default UART baudrate 115200 it takes more than 2ms to transmit all 32 characters, so w
marvell: uart: a3720: Increase TX FIFO EMPTY timeout from 2ms to 3ms
TX FIFO has space for 32 characters. With default UART baudrate 115200 it takes more than 2ms to transmit all 32 characters, so wait at least 3ms before flushing TX FIFO.
If WTMI firmware transmitted something via UART before TF-A was booted, some characters may still wait in TX FIFO when TF-A is initializing UART driver. So wait at least 3ms to ensure that HW has enough time to transmit all characters waiting in TX FIFO.
This fixes an issue where sometimes characters transmitted on UART by our custom WTMI image are lost.
Signed-off-by: Pali Rohár <pali@kernel.org> Change-Id: I8ea4ea58e4ba3e0c0d7f47e679171b9b94442f19
show more ...
|
| 98641515 | 16-Feb-2021 |
Pali Rohár <pali@kernel.org> |
marvell: uart: a3720: Update delay code to be compatible with 1200 MHz CPU
Console initialization function needs to wait at least minimal specified time. The fastest Armada 3720 CPU is 1200 MHz so i
marvell: uart: a3720: Update delay code to be compatible with 1200 MHz CPU
Console initialization function needs to wait at least minimal specified time. The fastest Armada 3720 CPU is 1200 MHz so increase loop delay to wait at least for 100 us on 1200 MHz variant too. The slowest Armada 3720 CPU is 600 MHz and in this case delay loop would take just 2 times more, which is not a problem.
Signed-off-by: Pali Rohár <pali@kernel.org> Change-Id: I1f0b4aabd0e08b7696feec631419f7f7c7ec17d2
show more ...
|
| b8e637f4 | 18-Jan-2021 |
Pali Rohár <pali@kernel.org> |
marvell: uart: a3720: Fix macro name for 6th bit of Status Register
This patch does not change code, it only updates comments and macro name for 6th bit of Status Register. So TF-A binary stay same.
marvell: uart: a3720: Fix macro name for 6th bit of Status Register
This patch does not change code, it only updates comments and macro name for 6th bit of Status Register. So TF-A binary stay same.
6th bit of the Status Register is named TX EMPTY and is set to 1 when both Transmitter Holding Register (THR) or Transmitter Shift Register (TSR) are empty. It is when all characters were already transmitted.
There is also TX FIFO EMPTY bit in the Status Register which is set to 1 only when THR is empty.
In both console_a3700_core_init() and console_a3700_core_flush() functions we should wait until both THR and TSR are empty therefore we should check 6th bit of the Status Register.
So current code is correct, just had misleading macro names and comments. This change fixes this "documentation" issue, fixes macro name for 6th bit of the Status Register and also updates comments.
Signed-off-by: Pali Rohár <pali@kernel.org> Change-Id: I19e4e7f53a90bcfb318e6dd1b1249b6cbf81c4d3
show more ...
|