[En-Nut-Discussion] FIX in pppdebug

Krzysztof Sawicki krzysztof.sawicki at mobile.put.edu.pl
Tue Apr 30 14:42:29 CEST 2013


W dniu 2013-04-29 16:46, Ole Reinhardt napisał(a):
> I reviewd that one as well. For reference, here is the patch:
>
> Index: nut/arch/arm/dev/atmel/at91_efc.c
> ===================================================================
> --- nut/arch/arm/dev/atmel/at91_efc.c	(revision 4958)
> +++ nut/arch/arm/dev/atmel/at91_efc.c	(working copy)
> @@ -237,7 +237,7 @@
>          /* Clear NEBP in mode register for automatic erasure. */
>          outr(MC_FMR, (i = inr(MC_FMR)) & ~MC_NEBP);
>          /* Execute page write command. */
> -        rc = At91EfcCmd((off & MC_PAGEN_MASK) | MC_FCMD_WP,
> EFC_WRITE_WAIT);
> +        rc = At91EfcCmd((((off / PAGE_SIZE) << 8) & MC_PAGEN_MASK) |
> MC_FCMD_WP, EFC_WRITE_WAIT);
>          /* Restore mode register. */
>          outr(MC_FMR, i);
>      } else {
>
>
> I don't see any problem with the page offset calculation in the 
> current
> trunk. The patch would change
>
> off & MC_PAGEN_MASK
> to
> ((off / PAGE_SIZE) << 8) & MC_PAGEN_MASK
>
> Problem:
> PAGE_SIZE is not defined in this context.
> However, the PAGE_SIZE of the At91 efc is 256 bytes, so
>
> ((off / PAGE_SIZE) << 8) & MC_PAGEN_MASK
> Is exactly the same as
> off & MC_PAGEN_MASK
> is'nt it?

Not always, for example AT91SAM7S64 has page size of 128 bytes.

-- 
Krzysztof Sawicki
Mobile Systems Research Labs, Poznan University of Technology


More information about the En-Nut-Discussion mailing list