[U-Boot] Struct SoC access

Mike Frysinger vapier at gentoo.org
Sat Aug 14 22:48:21 CEST 2010


On Sat, Aug 14, 2010 at 3:40 PM, Reinhard Meyer wrote:
> Dear Mike Frysinger,
>> On Sat, Aug 14, 2010 at 3:30 PM, Reinhard Meyer wrote:
>>> #define DBU_ADDR 0xsomething (in a SoC header file)
>>>
>>> dbu_t *dbu = (dbu_t *)DBU_ADDR; (in a function)
>>
>> needs to be volatile ...
>
> Why? The elements are used as parameters to readl/writel functions:
> status = readl(&dbu->sr);

if you use accessor functions and those guarantee volatility, then you
dont need the markings on the pointer

> I am quite sure we are NOT supposed to directly access hardware:
> status = dbu->sr;

it depends on the hardware
-mike


More information about the U-Boot mailing list