[En-Nut-Discussion] FIX in pppdebug
Ole Reinhardt
ole.reinhardt at embedded-it.de
Mon Apr 29 16:46:13 CEST 2013
Hi!
> Nice :)
> And what about that:
>
>> On Jan, 2013, Krzysztof Sawicki wrote:
>> another bug found by my job's colleague Pawel Nowak:
>>
>> http://sourceforge.net/tracker/?func=detail&aid=3602500&group_id=34079&atid=410689
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?
Bye,
Ole
--
kernel concepts GmbH Tel: +49-271-771091-14
Sieghuetter Hauptweg 48 Mob: +49-177-7420433
D-57072 Siegen
http://www.embedded-it.de
http://www.kernelconcepts.de
More information about the En-Nut-Discussion
mailing list