From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Fri, 18 Sep 2009 16:55:05 -0500 Subject: [U-Boot] [PATCH 2/7] ppc/p4080: Add support for CoreNet style platform LAWs In-Reply-To: <1253307595-28655-3-git-send-email-galak@kernel.crashing.org> References: <1253307595-28655-1-git-send-email-galak@kernel.crashing.org> <1253307595-28655-2-git-send-email-galak@kernel.crashing.org> <1253307595-28655-3-git-send-email-galak@kernel.crashing.org> Message-ID: <4AB401B9.2090103@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Kumar Gala wrote: > 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; We don't really need the volatile... > void disable_law(u8 idx) > { > +#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); Use in_be32(). Likewise in find_law. > +struct law_entry find_law(phys_addr_t addr) > +{ > + struct law_entry entry; > + int i; > + > + entry.index = -1; > + entry.addr = 0; > + entry.size = 0; > + entry.trgt_id = 0; > + > + for(i = 0; i < FSL_HW_NUM_LAWS; i++) { > + > + u64 upper; > + u32 temp; > +#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 + i * 4; > + lawbarl = lawbarh + 1; > + lawar = lawbarl + 1; So the consequence of not using an array in the reg struct, is that we don't use the reg struct. :-( -Scott