
In message OF34DF8405.50E611E8-ON85256FEB.0051A68A-85256FEB.00522DF9@smsc.com you wrote:
We are using u-boot for proprietary ARM board with NS16550 compatible serial controller. It is configured as 4bytes access to serial controller, so set CFG_NS16550_REG_SIZE to 4. But, because of "__attribute__ ((packed))" of struct NS16550, all register accesses to NS16550 are generated to byte access (LDRB, STRB in ARM).
No, this staement makes no sense to me.
I think it should NOT have __attribute__ ((packed)) if NS16550 is configured as 4bytes access. Am I missed something?
I think so.
"__attribute__ ((packed))" only affects the alignment of the entries in the structure. It has no influence on how to access these entries. If your access is a 32 bit read or write access then it will not be changed whether there is a "__attribute__ ((packed))" in place or not.
Best regards,
Wolfgang Denk