]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Word alignment fixes for word aligned NS16550 UART
authorWolfgang Denk <wd@pollux.denx.de>
Sun, 12 Mar 2006 00:21:19 +0000 (01:21 +0100)
committerWolfgang Denk <wd@pollux.denx.de>
Sun, 12 Mar 2006 00:21:19 +0000 (01:21 +0100)
Patch by Jean-Paul Saman, 01 Mar 2005

CHANGELOG
include/ns16550.h

index db50b57e85bace7c034f6fd83a0bb0422451b858..e3003e0ddad60f6c64d0bfde06523860d9d9736b 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,18 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
+* Word alignment fixes for word aligned NS16550 UART
+  Patch by Jean-Paul Saman, 01 Mar 2005
+
+  Fixes bug with UART that only supports word aligned access: removed
+  "__attribute__ ((packed));" for "(CFG_NS16550_REG_SIZE == 4)" some
+  (broken!) versions of GCC generate byte accesses when encountering
+  the packed attribute regardless if the struct is already correctly
+  aligned for a platform. Peripherals that can only handle word
+  aligned access won't work properly when accessed with byte access.
+  The struct NS16550 is already word aligned for REG_SIZE = 4, so
+  there is no need to packed the struct in that case.
+
 * Fix behaviour if gatewayip is not set
   Patch by Robin Gilks, 23 Dec 2004
 
index e17a11edca614a4e513668ddacf2d1c10073912c..d987a8b7edb21ab66142f35c70e8f07a250b6d0e 100644 (file)
@@ -45,15 +45,15 @@ struct NS16550 {
 } __attribute__ ((packed));
 #elif (CFG_NS16550_REG_SIZE == 4)
 struct NS16550 {
-       unsigned long rbr;              /* 0 */
-       unsigned long ier;              /* 1 */
-       unsigned long fcr;              /* 2 */
-       unsigned long lcr;              /* 3 */
-       unsigned long mcr;              /* 4 */
-       unsigned long lsr;              /* 5 */
-       unsigned long msr;              /* 6 */
-       unsigned long scr;              /* 7 */
-} __attribute__ ((packed));
+       unsigned long rbr;              /* 0 r  */
+       unsigned long ier;              /* 1 rw */
+       unsigned long fcr;              /* 2 w  */
+       unsigned long lcr;              /* 3 rw */
+       unsigned long mcr;              /* 4 rw */
+       unsigned long lsr;              /* 5 r  */
+       unsigned long msr;              /* 6 r  */
+       unsigned long scr;              /* 7 rw */
+}; /* No need to pack an already aligned struct */
 #elif (CFG_NS16550_REG_SIZE == -4)
 struct NS16550 {
        unsigned char rbr;              /* 0 */
@@ -102,7 +102,7 @@ typedef volatile struct NS16550 *NS16550_t;
 #define MCR_DMA_EN      0x04
 #define MCR_TX_DFR      0x08
 
-#define LCR_WLS_MSK    0x03            /* character length slect mask */
+#define LCR_WLS_MSK    0x03            /* character length select mask */
 #define LCR_WLS_5      0x00            /* 5 bit character length */
 #define LCR_WLS_6      0x01            /* 6 bit character length */
 #define LCR_WLS_7      0x02            /* 7 bit character length */