[U-Boot] Blackfin: cdef register accessor defines: missing 16-bit variants for SPORT RX/TX

The Blackfin SPORT RX/TX registers have to be accessed as 16-bit or 32-bit only, depending on the configured SPORT data word length. Everything else leads to an exception.
In the various cdef headers arch/blackfin/include/asm/mach-bfXXX/BFXXX_cdef.h there are only 32-bit variants.
The manual states e.g. for SPORTx_TX register: DAB/PAB writes must match their size to the data word length. For word length up to and including 16 bits, use a 16-bit write. Use a 32-bit write for word length greater than 16 bits.
Of course, one could use a simple "bfin_write16(SPORT1_TX, val)" instead of the macros, but I would suggest extending the cdef macros. The current Linux headers provide them like this: #define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX,val) #define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX,val) #define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX,val)
The U-Boot Blackfin cdef headers seem to be generated externally: /* DO NOT EDIT THIS FILE * Automatically generated by generate-cdef-headers.xsl * DO NOT EDIT THIS FILE */ Hence I did not prepare a patch. Mr. Frysinger, I suppose the generator is under your control ? May I ask you to update it accordingly ?
No idea about the other registers, only came across the SPORT RX/TX.
BTW, as a minor (somewhat cosmetic) issue, there are also read accessors for the TX register (and vice versa for RX), which is illegal according to the documentation. Both in Linux and in U-Boot. Admittedly, not a real issue.
Thanks in advance, A. Pretzsch
participants (1)
-
Andreas Pretzsch