Commit 914d14db authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL

Fix UART TX FIFO thresholds

HAL_UARTFIFOSize was incorrectly returning the TX FIFO size, instead of
the number of characters that can be written when the TX empty IRQ is
received. This was causing data loss when DualSerial drives the
interface at high speed (> 19200 baud).

Fix this by programming a sensible trigger level at startup, and
returning the correct value from HAL_UARTFIFOSize.

Version 0.13. Tagged as 'HAL_OMAP5-0_13'
parent 212101c3
/* (0.12)
/* (0.13)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.12
#define Module_MajorVersion_CMHG 0.13
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Jul 2019
#define Module_Date_CMHG 08 Feb 2020
#define Module_MajorVersion "0.12"
#define Module_Version 12
#define Module_MajorVersion "0.13"
#define Module_Version 13
#define Module_MinorVersion ""
#define Module_Date "20 Jul 2019"
#define Module_Date "08 Feb 2020"
#define Module_ApplicationDate "20-Jul-19"
#define Module_ApplicationDate "08-Feb-20"
#define Module_ComponentName "HAL_OMAP5"
#define Module_FullVersion "0.12"
#define Module_HelpVersion "0.12 (20 Jul 2019)"
#define Module_LibraryVersionInfo "0:12"
#define Module_FullVersion "0.13"
#define Module_HelpVersion "0.13 (08 Feb 2020)"
#define Module_LibraryVersionInfo "0:13"
......@@ -125,10 +125,15 @@ HAL_UARTStartUp
MOV a2, #(UART_SYSC_AUTOIDLE + UART_SYSC_IDLEMODE_SMART)
STRB a2, [a1, #UART_SYSC]
MOV a2, #0
STRB a2, [a3, #:INDEX:UARTFCRSoftCopy]
MOV a2, #&BF
STRB a2, [a1, #UART_LCR] ; Switch to config mode B for EFR access
MOV a2, #1<<4
STRB a2, [a1, #UART_EFR] ; Enable TX threshold programming
MOV a2, #UART_LCR_CHAR_LENGTH_8
STRB a2, [a1, #UART_LCR]
STRB a2, [a1, #UART_LCR] ; Back to operational mode, default word length
MOV a2, #UART_FCR_TX_FIFO_TRIG_32 ; 32 byte TX threshold should be fine
STRB a2, [a3, #:INDEX:UARTFCRSoftCopy]
STRB a2, [a1, #UART_FCR]
MOV pc, lr
; int Features(int port)
......@@ -300,6 +305,7 @@ HAL_UARTFIFOSize
MOV a1, #64
TEQ a2, #0
STRNE a1, [a2]
MOV a1, #32
TEQ a3, #0
STRNE a1, [a3]
MOV pc, lr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment