Skip to contentSkip to conversation

revised word alignment fixes for word aligned NS16550 UART

PATCH New jean-paul.saman at philips.com 2 participants 2 messages Mar 1, 2005 – Mar 12, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 revised word alignment fixes for word aligned NS16550 UART

The patch is created against current CVS 2005 march 1st and fixes problems

for boards that only have word access to the NS16550 UART.

OBSOLETES:
From: Jean-Paul Saman
Date: 23-02-2005
Subject: [PATCH] word alignment fixes for word aligned NS16550 UART peripheral

CHANGELOG:
* Patch by Jean-Paul Saman, 23 Feb 2005

- 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-20050301-ns16550-jpsaman-1.patch
Type: application/octet-stream
Size: 1414 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050301/1a70f188/attachment.obj

#1 lore raw

PATCH 1/1 revised word alignment fixes for word aligned NS16550 UART

Quoted 4 lines · In message <OFF26F609C.4348B979-ONC1256FB7.004C4EC9-C1256FB7.0058F5C8@philips.c…

CHANGELOG:
* Patch by Jean-Paul Saman, 23 Feb 2005

Quoted 8 lines

- 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.

Applied. Thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Misquotation is, in fact, the pride and privilege of the  learned.  A
widely-read  man  never  quotes  accurately,  for  the rather obvious
reason that he has read too widely.
                - Hesketh Pearson _Common Misquotations_ introduction