[U-Boot] [PATCH 2/7] ppc/p4080: Add support for CoreNet style platform LAWs

Scott Wood scottwood at freescale.com
Fri Sep 18 23:55:05 CEST 2009


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


More information about the U-Boot mailing list