From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timo Ketola Date: Wed, 18 Apr 2012 14:05:23 +0300 Subject: [U-Boot] [PATCH 7/9] imx: esdhc: Needed to use in imx-regs.h defined address In-Reply-To: <4F8E97DF.5060700@denx.de> References: <1334223234-23383-1-git-send-email-timo@exertus.fi> <1334735852-23415-1-git-send-email-timo@exertus.fi> <1334735852-23415-8-git-send-email-timo@exertus.fi> <4F8E7ECC.3000507@denx.de> <4F8E8529.30809@exertus.fi> <4F8E97DF.5060700@denx.de> Message-ID: <4F8E9FF3.8050805@exertus.fi> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 18.04.2012 13:30, Stefano Babic wrote: > On 18/04/2012 11:11, Timo Ketola wrote: > >> >> Ok, I was afraid about something like that and tried first to include it >> in board configuration but that broke something else (at least arm926ejs >> didn't compile any more). >> >>> By the way, why do you need it if you do not use that macro ? >> >> I use it in my board (support of which I'm preparing to send) >> configuration file and I think it is annoying to write a literal >> constant there which is already defined in imx-regs.h. > > 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 > >> >> 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. But I see them included in common.h. Should there be also imx-regs? Seems to work if I do so. > 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) 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? What would be the right expression for #ifdef? -- Timo