This is the mail archive of the ecos-maintainers@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AT91EB55 and DataFlash


Andrew Lunn <andrew.lunn@ascom.ch> writes:

> On Thu, Feb 12, 2009 at 01:56:02PM +0100, Andrew Lunn wrote:
> > On Thu, Feb 12, 2009 at 12:08:26PM +0000, John Dallaway wrote:
> > > eCos maintainers
> > > 
> > > Building RedBoot for the AT91EB55 target (eb55) is currently failing due to:
> > > 
> > > a) CYGPKG_ERROR missing in the RedBoot .ecm files. It is required by
> > > CYGPKG_DEVS_FLASH_ATMEL_DATAFLASH.
> > 
> > I think this is because of the inclusion of IO_SPI in all targets
> > which have SPI. The dataflash CDL contains:
> > 
> > cdl_package CYGPKG_DEVS_FLASH_ATMEL_DATAFLASH {
> >     display       "Atmel DataFlash parts support"
> >     description   "Support for Atmel DataFlash"
> >     active_if     CYGPKG_IO_SPI
> >     requires      CYGPKG_ERROR    
> > 
> > I think just adding
> > 
> >     active_if     CYGPKG_IO_FLASH
> 
> Ah, not so easy afterall. From the Changelog:
> 
> 2005-06-29  Jani Monoses <ani@iv.ro>
> 
>         * include/dataflash.h: Allow the package to be compiled without
>         io/flash. Return correct value from cyg_dataflash_get_page_count()
> 
> It looks like the requires statement is wrong, CYGPKG_ERROR is not
> needed by dataflash. This fixes this problem, but it then explodes
> later.
> 
> I think somebody from eCosCentric needs to look at this and compare
> with there working code in their private branch.

All of the redboot ECM files for our boards with dataflash contain
CYGPKG_ERROR. CYGPKG_DEVS_FLASH_ATMEL_DATAFLASH does not, but the AT91
SPI driver needs it.

So adding CYGPKG_ERROR to the ECM file seems the simplest option.

There are also some link problems with the EB55 dataflash code.
The following fixes all of this. I'll check it in with suitable
ChangeLogs:



Index: devs/flash/arm/eb55/current/src/eb55_flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/eb55/current/src/eb55_flash.c,v
retrieving revision 1.4
diff -u -5 -r1.4 eb55_flash.c
--- devs/flash/arm/eb55/current/src/eb55_flash.c	29 Jan 2009 17:48:21 -0000	1.4
+++ devs/flash/arm/eb55/current/src/eb55_flash.c	12 Feb 2009 14:24:12 -0000
@@ -72,11 +72,11 @@
 #include <cyg/io/dataflash.h>
 
 __externC cyg_spi_at91_device_t spi_dataflash_dev0;
 
 CYG_DATAFLASH_FLASH_DRIVER( cyg_eb55_dataflash,
-                            cyg_spi_dataflash_dev0,
+                            &spi_dataflash_dev0,
                             0x08000000,
                             0,
                             16 );
 
 #endif
Index: devs/spi/arm/eb55/current/src/spi_eb55.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/spi/arm/eb55/current/src/spi_eb55.c,v
retrieving revision 1.2
diff -u -5 -r1.2 spi_eb55.c
--- devs/spi/arm/eb55/current/src/spi_eb55.c	29 Jan 2009 17:48:45 -0000	1.2
+++ devs/spi/arm/eb55/current/src/spi_eb55.c	12 Feb 2009 14:24:12 -0000
@@ -55,11 +55,11 @@
 
 // -------------------------------------------------------------------------
 // AT91EB55 SPI exported devices 
 
 // AT45DB321B DataFlash
-static cyg_spi_at91_device_t spi_dataflash_dev0 CYG_SPI_DEVICE_ON_BUS(0) = 
+cyg_spi_at91_device_t spi_dataflash_dev0 CYG_SPI_DEVICE_ON_BUS(0) = 
 {
     .spi_device.spi_bus = &cyg_spi_at91_bus.spi_bus,
 
     .dev_num     = 0,       // Device number
     .cl_pol      = 1,       // Clock polarity (0 or 1)
@@ -68,9 +68,7 @@
     .cs_up_udly  = 1,       // Delay in usec between CS up and transfer start
     .cs_dw_udly  = 1,       // Delay in usec between transfer end and CS down
     .tr_bt_udly  = 1        // Delay in usec between two transfers
 };
 
-cyg_spi_device *cyg_spi_dataflash_dev0 = &spi_dataflash_dev0.spi_device;
-
 // -------------------------------------------------------------------------
 // EOF spi_eb55.c
Index: hal/arm/at91/eb55/current/misc/redboot_RAM.ecm
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb55/current/misc/redboot_RAM.ecm,v
retrieving revision 1.1
diff -u -5 -r1.1 redboot_RAM.ecm
--- hal/arm/at91/eb55/current/misc/redboot_RAM.ecm	13 May 2003 18:27:59 -0000	1.1
+++ hal/arm/at91/eb55/current/misc/redboot_RAM.ecm	12 Feb 2009 14:24:13 -0000
@@ -7,10 +7,11 @@
 cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value };
 cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value };
 
 cdl_configuration eCos {
     package CYGPKG_IO_FLASH current ;
+    package CYGPKG_ERROR current ;
 };
 
 cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
     user_value 6144
 };
Index: hal/arm/at91/eb55/current/misc/redboot_ROM.ecm
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb55/current/misc/redboot_ROM.ecm,v
retrieving revision 1.1
diff -u -5 -r1.1 redboot_ROM.ecm
--- hal/arm/at91/eb55/current/misc/redboot_ROM.ecm	13 May 2003 18:27:59 -0000	1.1
+++ hal/arm/at91/eb55/current/misc/redboot_ROM.ecm	12 Feb 2009 14:24:13 -0000
@@ -7,10 +7,11 @@
 cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value };
 cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value };
 
 cdl_configuration eCos {
     package CYGPKG_IO_FLASH current ;
+    package CYGPKG_ERROR current ;
 };
 
 cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
     user_value 6144
 };



-- 
Nick Garnett                                        eCos Kernel Architect
eCosCentric Limited    http://www.eCosCentric.com        The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales:                          Reg No: 4422071
Besuchen Sie uns vom 3.-5.03.09 auf der Embedded World 2009, Stand 11-300
Visit us at Embedded World 2009, NÃrnberg, Germany, 3-5 Mar, Stand 11-300


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]