[U-Boot] packed attribute problem

Vipin Kumar vipin.kumar at st.com
Mon Oct 4 11:38:29 CEST 2010


Hi All,

I encountered a problem something like

struct xyz {
	int	x;
	int	y;
	int	z[CONST];
} __attribute__ ((packed));

struct xyz *abc;
u32 * status_reg = (u32 *)&abc->z[0];

writel(status, status_reg);

This writel results in writing byte by byte on the address pointed to by status_reg.
This problem is visible with both gcc version 4.4.1 as well as 4.5.0

Incidently, the same code works well with 4.2.4

The problem is visible in the usb host driver which uses the packed structures for 
accessing  device registers.

Regards
Vipin


More information about the U-Boot mailing list