
Hi Fabio,
On 30/06/2017 13:21, Fabio Estevam wrote:
Hi Stefano,
On Fri, Jun 30, 2017 at 5:51 AM, Stefano Babic sbabic@denx.de wrote:
But if this is the case, should we not also add a dependency in Kconfig for NAND_MXS, selecting automatically APBH_DMA ?
config NAND_MXS bool "MXS NAND support" depends on MX6 || MX7
select APBH_DMA
Doing like this still causes the build to fail:
arch/arm/cpu/armv7/built-in.o: In function `arch_cpu_init': /home/fabio/u-boot/arch/arm/cpu/armv7/mx6/soc.c:432: undefined reference to `mxs_dma_init' LD u-boot scripts/Makefile.spl:333: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1382: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2 make: *** Waiting for unfinished jobs....
SPL builds arch/arm/cpu/armv7/mx6/soc.c, but does not build the APBH_DMA driver, which provides mxs_dma_init().
That's why I thought in removing mxs_dma_init() from soc.c and put it inside the mxs_nand.c driver.
Agree on this - my concern is if NAND_MXS is set, but APBH_DMA not. I see that APBH_DMA is not in Kconfig, and there are some other options that are really set by all MX6-MX7 boards:
#define CONFIG_APBH_DMA #define CONFIG_APBH_DMA_BURST #define CONFIG_APBH_DMA_BURST8
I understand now that we can do this with a follow-up patch. The best way will be if, activating NAND_MXS, all 3 above are set for i.MX6 and i.MX7 but just CONFIG_APBH_DMA for MX23-MX28, dropping them from include/configs/<board>
If there is some other alternative, please let me know.
I agree with you, the rest requires more cleanup and should be done in separate patches.
Regards, Stefano