[U-Boot] [PATCH 3/3] NAND FSL elbc: Use virt_to_phys to determine which bank is in use

Scott Wood scottwood at freescale.com
Mon Nov 24 17:34:24 CET 2008


Kumar Gala wrote:
> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
> index 367c7d7..3f318e0 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -718,7 +718,7 @@ static void fsl_elbc_ctrl_init(void)
>  int board_nand_init(struct nand_chip *nand)
>  {
>  	struct fsl_elbc_mtd *priv;
> -	uint32_t br, or;
> +	uint32_t br = 0, or = 0;

Which GCC version complains about this?  Seems like it's getting worse 
about false positives.

> @@ -737,11 +737,13 @@ int board_nand_init(struct nand_chip *nand)
>  	 * if we could pass more than one datum to the NAND driver...
>  	 */
>  	for (priv->bank = 0; priv->bank < MAX_BANKS; priv->bank++) {
> +		phys_addr_t base_addr = virt_to_phys(nand->IO_ADDR_R);
> +
>  		br = in_be32(&elbc_ctrl->regs->bank[priv->bank].br);
>  		or = in_be32(&elbc_ctrl->regs->bank[priv->bank].or);
>  
>  		if ((br & BR_V) && (br & BR_MSEL) == BR_MS_FCM &&
> -		    (br & or & BR_BA) == (phys_addr_t)nand->IO_ADDR_R)
> +		    (br & or & BR_BA) == BR_PHYS_ADDR(base_addr))

ACK to go via whichever tree the BR_PHYS_ADDR patch goes through.

-Scott


More information about the U-Boot mailing list