Hi Daniel Daniel Helgason wrote:
> Attached is a patch to > > ecos/packages/io/flash/current/src/flashiodevlegacy.c > > to fix bad flash device length when configured to use absolute addresses > for flash devices. > > See line 130 in the same file to check how the 'end' member of the > device private info is computed and how this patch fixes it. Agreed. Fix checked in. Thank you. I've also fixed the absolute start address display strings. Final patch attached. John Dallaway eCos maintainer
Index: ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/io/flash/current/ChangeLog,v retrieving revision 1.53 diff -U5 -r1.53 ChangeLog --- ChangeLog 1 Jul 2009 18:52:09 -0000 1.53 +++ ChangeLog 17 Jan 2010 16:56:44 -0000 @@ -1,5 +1,13 @@ +2010-01-17 John Dallaway <[email protected]> + + * src/flashiodevlegacy.c: Specify flash block device lengths correctly + when using static configuration via absolute addresses. Issue reported + by Daniel Helgason. + * cdl/io_flash.cdl: Fix display strings for + CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_[12]. + 2009-03-02 Sergei Gavrikov <[email protected]> * doc/flash.sgml: Fixed typos in a FLASH API listing. 2009-02-20 Jonathan Larmour <[email protected]> @@ -689,11 +697,11 @@ //=========================================================================== // ####GPLCOPYRIGHTBEGIN#### // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 or (at your option) any // later version. Index: cdl/io_flash.cdl =================================================================== RCS file: /cvs/ecos/ecos/packages/io/flash/current/cdl/io_flash.cdl,v retrieving revision 1.21 diff -U5 -r1.21 io_flash.cdl --- cdl/io_flash.cdl 13 Feb 2009 16:22:38 -0000 1.21 +++ cdl/io_flash.cdl 17 Jan 2010 16:56:44 -0000 @@ -6,11 +6,11 @@ # # ==================================================================== ## ####ECOSGPLCOPYRIGHTBEGIN#### ## ------------------------------------------- ## This file is part of eCos, the Embedded Configurable Operating System. -## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2009, 2010 Free Software Foundation, Inc. ## ## eCos is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free ## Software Foundation; either version 2 or (at your option) any later ## version. @@ -297,11 +297,11 @@ description " This configures the flash block device $::dev with absolute base address and a length" cdl_option CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_$::dev { - display "Start offset from flash base" + display "Start absolute address" flavor data default_value 0xFFFFFFFF requires 0xFFFFFFFF != CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_$::dev description " This gives the absolute address in flash which this Index: src/flashiodevlegacy.c =================================================================== RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/flashiodevlegacy.c,v retrieving revision 1.4 diff -U5 -r1.4 flashiodevlegacy.c --- src/flashiodevlegacy.c 20 Feb 2009 22:06:15 -0000 1.4 +++ src/flashiodevlegacy.c 17 Jan 2010 16:56:45 -0000 @@ -6,11 +6,11 @@ // //========================================================================== // ####ECOSGPLCOPYRIGHTBEGIN#### // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2009 Free Software Foundation, Inc. +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2009, 2010 Free Software Foundation, Inc. // // eCos is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 or (at your option) any later // version. @@ -335,11 +335,11 @@ #endif #ifdef CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_ABSOLUTE_1 static struct flashiodev_priv_t priv1 = CYG_FLASHIODEV_DEV( CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_1, // start - CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_1 + CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_LENGTH_1, + CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_LENGTH_1, // end 0, // use_fis 1, // use_static 0, // use_offset ""); // fis_name #endif @@ -383,11 +383,11 @@ #endif #ifdef CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_ABSOLUTE_2 static struct flashiodev_priv_t priv2 = CYG_FLASHIODEV_DEV( CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_2, // start - CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_2 + CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_LENGTH_2, + CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_LENGTH_2, // end 0, // use_fis 1, // use_static 0, // use_offset ""); // fis_name #endif
