public inbox for ecos-maintainers@sourceware.org
 help / color / mirror / Atom feed
* AT91EB55 and DataFlash
@ 2009-02-12 12:08 John Dallaway
  2009-02-12 12:56 ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: John Dallaway @ 2009-02-12 12:08 UTC (permalink / raw)
  To: ecos-maintainers

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.

and

b) A compilation error when declaring the DataFlash part:

> /var/local/ecos-test/packages/devs/flash/arm/eb55/current/src/eb55_flash.c:76: error: initializer element is not constant
> /var/local/ecos-test/packages/devs/flash/arm/eb55/current/src/eb55_flash.c:76: error: (near initialization for ‘cyg_dataflash_priv_cyg_eb55_dataflash.dev.spi_dev’)

It looks like CYGPKG_DEVS_FLASH_EB55 requires some minor updating to
work with the current DataFlash API.

The AT91EB55 is the only example of a target which uses Atmel DataFlash
in the repository so it would be useful to fix this up. Could someone
who is not on the critical path for eCos 3.0 beta 1 volunteer to take a
look please?

John Dallaway

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AT91EB55 and DataFlash
  2009-02-12 12:08 AT91EB55 and DataFlash John Dallaway
@ 2009-02-12 12:56 ` Andrew Lunn
  2009-02-12 13:50   ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2009-02-12 12:56 UTC (permalink / raw)
  To: John Dallaway; +Cc: ecos-maintainers

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

will solve the problem. 

Also the redboot.ecm files need CYGPKG_ERROR adding.

I can make a patch for this...

  Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AT91EB55 and DataFlash
  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:27     ` Nick Garnett
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Lunn @ 2009-02-12 13:50 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: John Dallaway, ecos-maintainers

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.

     Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AT91EB55 and DataFlash
  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:27     ` Nick Garnett
  1 sibling, 1 reply; 9+ messages in thread
From: John Dallaway @ 2009-02-12 14:23 UTC (permalink / raw)
  To: Andrew Lunn, Nick Garnett; +Cc: ecos-maintainers

Andrew Lunn wrote:

> 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.

Andrew, many thanks for looking at this. It appears that the data type
expected in the second parameter of the CYG_DATAFLASH_FLASH_DRIVER()
macro has changed.

Nick, it looks like you were the one who added the DataFlash
declarations for AT91EB55 originally. Do you have any time to
investigate this build failure at present?

> /var/local/ecos-test/packages/devs/flash/arm/eb55/current/src/eb55_flash.c:76: error: initializer element is not constant
> /var/local/ecos-test/packages/devs/flash/arm/eb55/current/src/eb55_flash.c:76: error: (near initialization for ‘cyg_dataflash_priv_cyg_eb55_dataflash.dev.spi_dev’)

Please let me know either way, so I can plan accordingly.

Thanks

John Dallaway

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AT91EB55 and DataFlash
  2009-02-12 13:50   ` Andrew Lunn
  2009-02-12 14:23     ` John Dallaway
@ 2009-02-12 14:27     ` Nick Garnett
  2009-02-12 14:32       ` Andrew Lunn
  1 sibling, 1 reply; 9+ messages in thread
From: Nick Garnett @ 2009-02-12 14:27 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: John Dallaway, ecos-maintainers

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AT91EB55 and DataFlash
  2009-02-12 14:23     ` John Dallaway
@ 2009-02-12 14:31       ` Nick Garnett
  2009-02-12 14:38         ` John Dallaway
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Garnett @ 2009-02-12 14:31 UTC (permalink / raw)
  To: John Dallaway; +Cc: Andrew Lunn, ecos-maintainers

John Dallaway <john@dallaway.org.uk> writes:

> Andrew Lunn wrote:
> 
> > 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.
> 
> Andrew, many thanks for looking at this. It appears that the data type
> expected in the second parameter of the CYG_DATAFLASH_FLASH_DRIVER()
> macro has changed.
> 
> Nick, it looks like you were the one who added the DataFlash
> declarations for AT91EB55 originally. Do you have any time to
> investigate this build failure at present?
> 
> > /var/local/ecos-test/packages/devs/flash/arm/eb55/current/src/eb55_flash.c:76: error: initializer element is not constant
> > /var/local/ecos-test/packages/devs/flash/arm/eb55/current/src/eb55_flash.c:76: error: (near initialization for ‘cyg_dataflash_priv_cyg_eb55_dataflash.dev.spi_dev’)
> 
> Please let me know either way, so I can plan accordingly.


Done!

Our emails crossed in the post. Expect to see some checkins
imminently.


-- 
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AT91EB55 and DataFlash
  2009-02-12 14:27     ` Nick Garnett
@ 2009-02-12 14:32       ` Andrew Lunn
  2009-02-12 14:43         ` Nick Garnett
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2009-02-12 14:32 UTC (permalink / raw)
  To: Nick Garnett; +Cc: Andrew Lunn, John Dallaway, ecos-maintainers

On Thu, Feb 12, 2009 at 02:27:13PM +0000, Nick Garnett wrote:
> 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.

Yep, that was were it exploded. However, it should of been at
ecosconfig time it complained. The AT91 SPI driver is missing a
requires statement for CYGPKG_ERROR. I guess the error package should
be added to all targets which use the AT91 SPI driver.

   Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AT91EB55 and DataFlash
  2009-02-12 14:31       ` Nick Garnett
@ 2009-02-12 14:38         ` John Dallaway
  0 siblings, 0 replies; 9+ messages in thread
From: John Dallaway @ 2009-02-12 14:38 UTC (permalink / raw)
  To: Nick Garnett; +Cc: ecos-maintainers

Nick Garnett wrote:

>> Nick, it looks like you were the one who added the DataFlash
>> declarations for AT91EB55 originally. Do you have any time to
>> investigate this build failure at present?
>>
>>> /var/local/ecos-test/packages/devs/flash/arm/eb55/current/src/eb55_flash.c:76: error: initializer element is not constant
>>> /var/local/ecos-test/packages/devs/flash/arm/eb55/current/src/eb55_flash.c:76: error: (near initialization for ‘cyg_dataflash_priv_cyg_eb55_dataflash.dev.spi_dev’)
>> Please let me know either way, so I can plan accordingly.
> 
> Done!
> 
> Our emails crossed in the post. Expect to see some checkins
> imminently.

Excellent! Many thanks, Nick...

John

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AT91EB55 and DataFlash
  2009-02-12 14:32       ` Andrew Lunn
@ 2009-02-12 14:43         ` Nick Garnett
  0 siblings, 0 replies; 9+ messages in thread
From: Nick Garnett @ 2009-02-12 14:43 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: John Dallaway, ecos-maintainers

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

> On Thu, Feb 12, 2009 at 02:27:13PM +0000, Nick Garnett wrote:
> > 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.
> 
> Yep, that was were it exploded. However, it should of been at
> ecosconfig time it complained. The AT91 SPI driver is missing a
> requires statement for CYGPKG_ERROR.

Yes, I can add that easily enough.

> I guess the error package should
> be added to all targets which use the AT91 SPI driver.

That's a bit tricky, since it would require CYGPKG_ERROR to be added
to the target in ecos.db. Which is not really right. I guess normally
we rely on CYGPKG_ERROR being in the template to resolve this.


-- 
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-02-12 14:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-12 12:08 AT91EB55 and DataFlash 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
2009-02-12 14:32       ` Andrew Lunn
2009-02-12 14:43         ` Nick Garnett

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).