This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: FW: Adding flash device using the flash v2 drivers
Hi again
I'm still struggeling with the use of flash v2.
In my install directory I see: #define CYGHWR_IO_FLASH_DEVICE 2 , i.e. expects 2 devices. What is causing this define? My .ecc has an entry:
# >
# Hardware FLASH device drivers
# This calculated option gives the number of flash devices
# on the current platform. The generic flash support requires
# at least one device.
#
cdl_interface CYGHWR_IO_FLASH_DEVICE {
# Implemented by CYGPKG_DEVS_FLASH_POWERPC_PYTHON, active, enabled
# Implemented by CYGPKG_DEVS_FLASH_AMD_AM29XXXXX_V2, active, enabled
# This value cannot be modified here.
# Flavor: data
# Current_value: 2
# Requires: CYGHWR_IO_FLASH_DEVICE >= 1
# CYGHWR_IO_FLASH_DEVICE == 2
# --> 1
# The following properties are affected by this value
# interface CYGHWR_IO_FLASH_DEVICE
# Requires: CYGHWR_IO_FLASH_DEVICE >= 1
# option CYGSEM_IO_FLASH_VERIFY_PROGRAM
# ActiveIf: CYGHWR_IO_FLASH_INDIRECT_READS < CYGHWR_IO_FLASH_DEVICE
};
Where does the number 2 come from? If I change it to 1 it will still be defined as 2 in my install/include directory
mw-dev@ubuntu-alex:/mnt/hgfs/SW_root/Drivers/App/Source/Sw/kernel/MW2_install$ grep -r CYGHWR_IO_FLASH_DEVICE *
include/cyg/io/flash.h:#if defined(CYGSEM_IO_FLASH_LEGACY_API) || defined(CYGHWR_IO_FLASH_DEVICE_LEGACY)
include/cyg/io/flash_dev.h:#if (CYGHWR_IO_FLASH_DEVICE > 1)
include/cyg/io/flash_dev.h:#ifdef CYGHWR_IO_FLASH_DEVICE_LEGACY
include/cyg/io/flash_dev.h:#endif // CYGHWR_IO_FLASH_DEVICE_LEGACY
include/pkgconf/io_flash.h:#define CYGHWR_IO_FLASH_DEVICE 2
include/pkgconf/io_flash.h:#define CYGHWR_IO_FLASH_DEVICE_2
include/pkgconf/io_flash.h:#define CYGHWR_IO_FLASH_DEVICE_NEEDS_CACHE_HANDLED 1
include/pkgconf/io_flash.h:#define CYGHWR_IO_FLASH_DEVICE_NEEDS_CACHE_HANDLED_1
I'm still confused........
BR
Alex Lindeijer
3D Perception - Senior System Designer
-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Alex Lindeijer
Sent: 19. desember 2008 20:25
To: Andrew Lunn
Cc: ecos-discuss@sourceware.org
Subject: RE: [ECOS] FW: Adding flash device using the flash v2 drivers
Hi
Thanks, for the fast response. I found the documentation and added
#include "cyg/io/am29xxxxx_dev.h"
#ifdef CYGPKG_DEVS_FLASH_AMD_AM29XXXXX_V2
#include "cyg/io/flash.h"
#include "cyg/io/flash_dev.h"
static const CYG_FLASH_FUNS(hal_mw2_flash_amd_funs,
cyg_am29xxxxx_init_cfi_16,
cyg_flash_devfn_query_nop,
cyg_am29xxxxx_erase_16,
cyg_am29xxxxx_program_16,
(int (*)(struct cyg_flash_dev*, const cyg_flashaddr_t, void*, size_t))0,
cyg_flash_devfn_lock_nop,
cyg_flash_devfn_unlock_nop);
static cyg_am29xxxxx_dev hal_mw2_flash_priv;
CYG_FLASH_DRIVER(hal_mw2_flash,
&hal_mw2_flash_amd_funs,
0,
0xF0000000,
0xFFFFFFFF,
1,
hal_mw2_flash_priv.block_info,
&hal_mw2_flash_priv
);
#endif
In my board specific flash code mw2_flash.c and the following in the board specific cdl in the dev/flash tree
cdl_package CYGPKG_DEVS_FLASH_POWERPC_MW2 {
display "3DP MW2 FLASH memory support"
parent CYGPKG_IO_FLASH
active_if CYGPKG_IO_FLASH
requires CYGPKG_HAL_POWERPC_MW2
implements CYGHWR_IO_FLASH_DEVICE
compile mw2_flash.c
# Arguably this should do in the generic package
# but then there is a logic loop so you can never enable it.
cdl_interface CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED {
display "Generic AMD flash driver required"
}
implements CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED
}
And I have set CYGHWR_IO_FLASH_DEVICE to 1
But still I gett he "incorrect number of devices" assert
I find the hal_mw2_flash back in the ecos library (grep) so it was included........
I assume that the error message is an result of not correctly adding an entry to the flash device table.
Br
Alex Lindeijer
3D Perception - Senior System Designer
Solbråveien 41, PO.?Box 455
N-1373 Asker, Norway
-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch]
Sent: 19. desember 2008 15:31
To: Alex Lindeijer
Cc: ecos-discuss@sourceware.org
Subject: Re: [ECOS] FW: Adding flash device using the flash v2 drivers
On Fri, Dec 19, 2008 at 02:33:49PM +0100, Alex Lindeijer wrote:
>
> Hi
> We have a controller card with a MPC8541 on it and a spansion S29GL512
> flash. We used the Python eval board from A&M to start the ecos based
> development. The ecos supplied was base don the legacy v1 flash drivers.
> We are experiencing some verification problems on certain higher
> addresses when accessing it from our application but everything is OK
> when writing to flash from Redboot.
I would check your memory controller configuration. Maybe it is not
driving the top address line, so it is left floating. Just an idea.
> Therefore I wanted to tryt he v2 flasher driver to see whether that
> makes a difference.. It seems I have (almost) everything in place but
> get at startup
>
> ASSERT FAIL: <4>flash.c[231]cyg_flash_init() incorrect number of flash
> devices
>
> Question is now: how do I add the flash device to the cyg_flashdevtab? I
> suppose I have to do this in the board specific python.c under
> devs/flash/....
>
> When adding an extra ethernet port it was quit clear how to add it to
> the netdevtab using the NETDEVTAB_ENTRY macro. Is there something
> similar for adding a flash device?
Yes, CYG_FLASH_DRIVER(). The am29xxxxxv2 has good documentation. Take
a look at that as an example.
> And: can I run flash v2 in my applicattion and the legacy in my
> redboot(ROMRAM)?
Yes, that will work.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss