819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 1b00d871c9aaa05583b50abb5ba7dfb4ed8bc4f1 Mon Sep 17 00:00:00 2001
  2. From: Peng Fan <[email protected]>
  3. Date: Mon, 16 Dec 2019 15:53:00 +0800
  4. Subject: [PATCH] LF-484 tty: serial: lpuart: support UPIO_MEM32 for lpuart32
  5. "earlycon" no need to specify the value string since it uses
  6. stdout-path parameters. However when earlycon and normal console
  7. are not using the same uart port, we need specify value string
  8. to earlycon, this is what we need to do when support dual linux
  9. using jailhouse hypervisor. The 2nd linux will use the uart
  10. of the 1st linux as earlycon.
  11. earlycon=lpuart32,mmio32,0x5a060010,115200 not work for i.MX8QXP.
  12. It is because lpuart32_early_console_setup not support little endian.
  13. Since the original code is to support UPIO_MEM32BE, so if not
  14. UPIO_MEM32, we still take it as UPIO_MEM32BE
  15. Acked-by: Fugang Duan <[email protected]>
  16. Signed-off-by: Peng Fan <[email protected]>
  17. ---
  18. drivers/tty/serial/fsl_lpuart.c | 4 +++-
  19. 1 file changed, 3 insertions(+), 1 deletion(-)
  20. --- a/drivers/tty/serial/fsl_lpuart.c
  21. +++ b/drivers/tty/serial/fsl_lpuart.c
  22. @@ -2598,7 +2598,9 @@ static int __init lpuart32_early_console
  23. if (!device->port.membase)
  24. return -ENODEV;
  25. - device->port.iotype = UPIO_MEM32BE;
  26. + if (device->port.iotype != UPIO_MEM32)
  27. + device->port.iotype = UPIO_MEM32BE;
  28. +
  29. device->con->write = lpuart32_early_write;
  30. return 0;
  31. }