On Sep 22, 2009, at 3:05 PM, Wolfgang Denk wrote: > Dear Kumar Gala, > > In message <1253307595-28655-3-git-send-email-ga...@kernel.crashing.org > > you wrote: >> On CoreNet based platforms the LAW address is split between an high & >> low register and we no longer shift the address. Also, the target >> IDs >> on CoreNet platforms have been completely re-assigned. >> >> Additionally, added a new find_law() API to which LAW an address >> hits in. >> This is need for the CoreNet style boot release code since it will >> need >> to determine what the target ID should be set to for boot window >> translation. >> >> Signed-off-by: Kumar Gala <ga...@kernel.crashing.org> >> --- >> drivers/misc/fsl_law.c | 99 +++++++++++++++++++++++++++++++++++ >> +++++++++- >> include/asm-ppc/fsl_law.h | 29 +++++++++++++ >> 2 files changed, 127 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c >> index aa877c6..fba16ed 100644 >> --- a/drivers/misc/fsl_law.c >> +++ b/drivers/misc/fsl_law.c >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright 2008 Freescale Semiconductor, Inc. >> + * Copyright 2008-2009 Freescale Semiconductor, Inc. >> * >> * (C) Copyright 2000 >> * Wolfgang Denk, DENX Software Engineering, w...@denx.de. >> @@ -48,6 +48,24 @@ DECLARE_GLOBAL_DATA_PTR; >> >> void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum >> law_trgt_if id) >> { >> +#ifdef CONFIG_FSL_CORENET >> + volatile ccsr_local_t *ccm; >> + volatile u32 *base, *lawbarh, *lawbarl, *lawar; >> + >> + ccm = (void *)(CONFIG_SYS_FSL_CORENET_CCM_ADDR); >> + >> + base = &(ccm->lawbarh0); >> + lawbarh = base + idx * 4; >> + lawbarl = lawbarh + 1; >> + lawar = lawbarl + 1; >> + >> + gd->used_laws |= (1 << idx); >> + >> + out_be32(lawar, 0); >> + out_be32(lawbarh, ((u64)addr >> 32)); >> + out_be32(lawbarl, addr & 0xffffffff); >> + out_be32(lawar, LAWAR_EN | ((u32)id << 20) | (u32)sz); >> +#else >> volatile u32 *base = (volatile u32 *)(CONFIG_SYS_IMMR + 0xc08); >> volatile u32 *lawbar = base + 8 * idx; >> volatile u32 *lawar = base + 8 * idx + 2; > > This is ugly. Now we have code and variable declarations intermixed. > Please don't. Especially not when it's the same variables.
Will fix this in a subsequent patch. - k _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot