[U-Boot] [PATCH 7/9] imx: esdhc: Needed to use in imx-regs.h defined address

Stefano Babic sbabic at denx.de
Wed Apr 18 17:05:19 CEST 2012


On 18/04/2012 13:05, Timo Ketola wrote:

>>
>> fsl_esdhc.c includes config.h. If your board configuration file includes
>> imx-regs.h, as most i.MX boards do, the file is automatically included,
>> I suppose.
> 
> I tried that but then:
> 
> .../u-boot-imx/build-exe4026/include/asm/arch/imx-regs.h:43:2: error:
> expected specifier-qualifier-list before ‘u32’
> 
> when compiling
> 
> arch/arm/cpu/arm926ejs/cpu.o

Well, I have not said that there cannot be other issues. At first glance
you must include asm/types.h, in cpu.c or in imx-regs.h.

>>> PPC seems to use a predefined macro from asm/immap_8xxx.h files. Where
>>> is that file included?
>>
>> It is a different way. The board configuration file includes the
>> register description file, so for example immap_86xx.h, immap_85xx.h,
> 
> Where? I don't see an example.

For PPC86xx I can see at least:

arch/powerpc/cpu/mpc86xx/mpc8641_serdes.c:#include <asm/immap_86xx.h>
arch/powerpc/cpu/mpc86xx/mpc8610_serdes.c:#include <asm/immap_86xx.h>
board/freescale/mpc8610hpcd/mpc8610hpcd.c:#include <asm/immap_86xx.h>
board/freescale/mpc8641hpcn/mpc8641hpcn.c:#include <asm/immap_86xx.h>

> But I see them included in common.h.
> Should there be also imx-regs? Seems to work if I do so.

No, this is wrong.

> 
>> or
>> imx-regs.h, and defines CONFIG_SYS_FSL_ESDHC_ADDR using its own specific
>> macro, if any, for example:
>>
>> #define CONFIG_SYS_FSL_ESDHC_ADDR       CONFIG_SYS_MPC85xx_ESDHC_ADDR
>>
>> Why is it not enough for you to set in your board configuration file:
>>
>> #define CONFIG_SYS_FSL_ESDHC_ADDR       IMX_MMC_SDHC1_BASE
> 
> I tried also exactly that, but then:
> 
> fsl_esdhc.c:544:20: error: ‘IMX_MMC_SDHC1_BASE’ undeclared (first use in
> this function)

...then imx-regs.h was not included...

> 
> fsl_esdhc.c seems not to see imx-regs.h file.
> 
> Then I tried to include imx-regs.h in fsl_esdhc.c and 'MAKEALL -a arm'
> was happy.
> 
> Maybe the right fix is to include imx-regs in common.h?

No. common.h, as the name suggests, is for all architectures, not only
for i.MX. We cannot fix i:MX and break other boards.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list