[U-Boot] [PATCH 5/7] ARM: sunxi-mmc: Add mmc support for sun6i / A31

Chen-Yu Tsai wens at csie.org
Tue Sep 23 14:07:13 CEST 2014


On Tue, Sep 23, 2014 at 7:54 PM, Ian Campbell <ijc at hellion.org.uk> wrote:
> On Tue, 2014-09-23 at 19:50 +0800, Chen-Yu Tsai wrote:
>> Ian, include/configs/sun?i.h and sunxi-common.h only have config
>> related #defines. Are we sure this is the place for something
>> like register offsets?
>
> I guess not ;-)
>
>> For reference, drivers/i2c/mvtwsi.c has sunxi specific register
>> offsets wrapped in a #define in the file itself.
>
> How about either ./arch/arm/include/asm/arch-sunxi/mmc.h or near the top
> of this C file (i.e. outside the code itself)?

Adding it to the register definitions in ./arch/arm/include/asm/arch-sunxi/mmc.h
seems like a good choice. The last bit of struct sunxi_mmc would be like:

        u32 idie;               /* 0x8c internal DMA interrupt enable */
        u32 chda;               /* 0x90 */
        u32 cbda;               /* 0x94 */
#if defined(CONFIG_SUN6I)
        u32 res1[126];
#else
        u32 res1[26];
#endif
        u32 fifo;               /* 0x100 (0x200 on sun6i) FIFO access address */
 };

And have

    mmchost->database = &mmchost->reg->fifo;

Or just get rid of ->database and use ->reg->fifo directly.
The latter seems better.


ChenYu


More information about the U-Boot mailing list