From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 12 Jul 2015 13:50:55 +0200 Subject: [U-Boot] [PATCH V2 03/15] imx: mx6ul: Update imx registers head file In-Reply-To: <20150712103227.GB16931@shlinux2> References: <1436602043-9644-1-git-send-email-Peng.Fan@freescale.com> <201507120011.42843.marex@denx.de> <20150712103227.GB16931@shlinux2> Message-ID: <201507121350.55223.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sunday, July 12, 2015 at 12:32:28 PM, Peng Fan wrote: > Hi Marek, > > On Sun, Jul 12, 2015 at 12:11:42AM +0200, Marek Vasut wrote: > >On Saturday, July 11, 2015 at 10:07:11 AM, Peng Fan wrote: > >> 1. Update imx register base address for i.MX6UL. > >> 2. Remove duplicated MXS_APBH/GPMI/BCH_BASE. > >> 3. Remove #ifdef for register addresses that equal to > >> > >> "AIPS2_OFF_BASE_ADDR + 0x34000" for different chips. > >> > >> 4. According fuse map, complete fuse_bank4_regs. > >> 5. Move AIPS3_ARB_BASE_ADDR and AIPS3_ARB_END_ADDR out of #ifdef > >> CONFIG_MX6SX, because we can use runtime check > >> > >> Signed-off-by: Peng Fan > >> --- > > > >[...] > > > >> @@ -309,11 +311,16 @@ > >> > >> #define PWM8_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0xB0000) > >> #endif > >> > >> +/* only for i.MX6SX/UL */ > >> +#define WDOG3_BASE_ADDR (is_cpu_type(MXC_CPU_MX6UL) ? \ > >> + (AIPS2_OFF_BASE_ADDR + 0x64000) : \ > >> + (AIPS3_ARB_BASE_ADDR + 0x88000)) > >> + > > > >This might not work if used in assembler. > > I did not see any scenario that it will be used in assembler now. Does that mean we will be fine with adding code which we know might easily break? > If we truely need it in assembler, then we can not avoid so many "ifdef"s. errr ... ifdef __ASSEMBLY__ would suffice here I guess, but to be really smart about it, I'd say you might want to define something like MX6UL_WDOG3_BASE, MX6S_WDOG3_BASE and then define WDOG3_BASE_ADDR as (is_cpu_type(...) ? MX6UL_WDOG3_BASE : MX6S.... ) . Then you could access the WDOG3 from assembler and from C code with the benefit that from C code, you'd be able to access it in a bit smoother way. I don't know if there's a way to do it easily in asm too, sorry. Best regards, Marek Vasut