[U-Boot] a question about the source of uboot(for armv8).

Jean-Jacques Hiblot jjhiblot at ti.com
Fri Jul 21 09:56:50 UTC 2017



On 15/02/2017 12:57, 水中有泪 wrote:
> Hi Haikun Wang,
>
> I have a question about the source of uboot.
>
> http://lists.denx.de/pipermail/u-boot/2015-June/217446.html
>> u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
>> val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4);
>   
>
> The question is this,
>
> why does DCFG_RCWSR13 device by 4.
because dcfg_ccsr is defined as u32* (pointer to a 32 bits integer).
If dcfg_ccsr had been declared as a u8* or a void*, then the division by 
4 would have not been needed.
JJ
>
>   
>
> (1)dcfg_ccsr is the base address of Dcfg_ccsr
>
> (2)DCFG_RCWSR13 is the offset of Dcfg_rcwsr13
>
> So I think the next is right
>
>> val = in_le32(dcfg_ccsr + DCFG_RCWSR13);
>
>
>
> Pardon me my clumsiness.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



More information about the U-Boot mailing list