On Tue, 2014-09-23 at 20:07 +0800, Chen-Yu Tsai wrote: > On Tue, Sep 23, 2014 at 7:54 PM, Ian Campbell <i...@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.
Yep, sounds good. You could also consider just #if defined(CONFIG_SUN6I) u32 res2[100]; #endif after the existing res1. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot