public inbox for ecos-maintainers@sourceware.org
 help / color / mirror / Atom feed
From: Nick Garnett <nickg@ecoscentric.com>
To: Andrew Lunn <andrew.lunn@ascom.ch>
Cc: John Dallaway <john@dallaway.org.uk>,
		  ecos-maintainers@ecos.sourceware.org
Subject: Re: AT91EB55 and DataFlash
Date: Thu, 12 Feb 2009 14:27:00 -0000	[thread overview]
Message-ID: <m3skmjspby.fsf@xl5.calivar.com> (raw)
In-Reply-To: <20090212134950.GL24614@donkey.ma.tech.ascom.ch>

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

  parent reply	other threads:[~2009-02-12 14:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-12 12:08 John Dallaway
2009-02-12 12:56 ` Andrew Lunn
2009-02-12 13:50   ` Andrew Lunn
2009-02-12 14:23     ` John Dallaway
2009-02-12 14:31       ` Nick Garnett
2009-02-12 14:38         ` John Dallaway
2009-02-12 14:27     ` Nick Garnett [this message]
2009-02-12 14:32       ` Andrew Lunn
2009-02-12 14:43         ` Nick Garnett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3skmjspby.fsf@xl5.calivar.com \
    --to=nickg@ecoscentric.com \
    --cc=andrew.lunn@ascom.ch \
    --cc=ecos-maintainers@ecos.sourceware.org \
    --cc=john@dallaway.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).