I.mx28 9 bit data UART linux drivers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I.mx28 9 bit data UART linux drivers

1,421 Views
desmondcorreia
Contributor I

Hi,

Has anyone implemented a 9 bit data UART driver under linux for the I.mx28. I have been reviewing the "MCIMX28RM" document and as far as I see it's not possible to read the 9bit from the UART register since the hardware just tells you the status of the parity bit.

Does anyone have any idea how I could do this. I need to know what the 9bit is since I am trying to interface the I.mx28 with a UART that uses 9bit data for UART

Thanks

Labels (1)
0 Kudos
4 Replies

917 Views
lategoodbye
Senior Contributor I

Hi Desmond,

i think your thoughts should be okay. I think the tricky part is to detect the parity errors with termios. Maybe the flag PARMRK should do the trick.

0 Kudos

917 Views
desmondcorreia
Contributor I

Hi Stefan,

Thanks for response. I don't want to write 9bit data I need to read it. I came up with a scenario to derive the 9th bit. See below and give me your thoughts.

  1. Imx28 is setup to use even parity checking
  2. We calculate the parity error on 8 bits using even parity checking and always using the 9th bit as 0
  3. We take our parity error flag XOR with imx28 parity error flag
  4. The result is the 9th bit
0 Kudos

917 Views
lategoodbye
Senior Contributor I

Hi Desmond,

in case you don't need 9 bit + parity it's possible to emulate bit 9 with parity (like here: https://viereck.ch/linux-mark-space-parity/ ).

Based on this similiar patch: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=bb70002cb7430252c6c8e3b1...

i attached one for mxs-auart from Mainline Linux 4.5. I only compile tested this patch.

0 Kudos

917 Views
igorpadykov
NXP Employee
NXP Employee

Hi Desmond

you are right i.MX28 uart hardware does not support 9 data bits.

Best regards

igor

0 Kudos