[U-Boot-Users] [PATCH] word alignment fixes for word aligned NS16550 UART peripheral

jean-paul.saman at philips.com jean-paul.saman at philips.com
Wed Feb 23 12:01:29 CET 2005

The patch is created against current CVS 2005 feb. 23 and fixes problems 
for boards that only have word access to the NS16550 UART peripheral.

* Patch by Jean-Paul Saman, 23 Feb 2005
  common/cmd_bdinfo.c - fixes bug with negative baudrate:
                        correct use of unsigned long datatype for 
                                properly cast bd_t *bd = (bd_t*) gd->bd;
                                make information more clear: 
print_num("DRAM bank nr",       i);
  include/asm-arm/u-boot.h - fixes bug with negative baudrate:
                        use of unsigned long for bi_baudrate and 
                        adding an unsigned char pad[2] makes the struct 
word aligned
                        changed ulong into unsigned long for consistency
  include/ns16550.h - fixes alignement bug with UART that only supports 
word aligned access:
                      removed "__attribute__ ((packed));" for 
"(CFG_NS16550_REG_SIZE == 4)"
                      GCC generates bytes access when it encounters the 
packed attribute regardless
                      if the struct is already word 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.

Kind greetings,

Jean-Paul Saman

Philips Semiconductors CTO/RTG
Philips HighTech Campus, building WDB 3.29
Professor van den Holstlaan 4
5655 AA Eindhoven
tel: +31 (0)40 27 45131
-------------- next part --------------
A non-text attachment was scrubbed...
Name: u-boot-20050223-alignment-jpsaman-1.patch
Type: application/octet-stream
Size: 4199 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050223/738d6358/attachment.obj 

More information about the U-Boot mailing list