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

Andreas Pretzsch apr at cn-eng.de
Tue Jan 4 23:30:12 CET 2011


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

-- 

carpe noctem engineering
Ingenieurbuero fuer Hard- & Software-Entwicklung Andreas Pretzsch
Dipl.-Ing. (FH) Andreas Pretzsch          Tel. +49-(0)731-5521572
Hahnengasse 3                             Fax: +49-(0)731-5521573
89073 Ulm, Germany                        email: apr at cn-eng.de



More information about the U-Boot mailing list