public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* flash_olpcx2294_v2 package
@ 2008-11-30 12:23 Sergei Gavrikov
  2008-11-30 12:50 ` Sergei Gavrikov
  2008-12-02 20:12 ` Andrew Lunn
  0 siblings, 2 replies; 13+ messages in thread
From: Sergei Gavrikov @ 2008-11-30 12:23 UTC (permalink / raw)
  To: eCos patches list; +Cc: Andrew Lunn

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

Hello

This is flash v2 driver for Olimex LPC-X2294 boards on top of strata_v2
flash driver. Tested on Olimex LPC-H2294 board. Redboot's FIS works fine
with the driver.

SYNOPSYS

	ecosconfig remove flash_olpcx2294
	ecosconfig add strata_v2 flash_olpcx2294_v2 flash

RFC: I described and the bottom boot blocks in the driver. What is a
practic, to hide or show it? It seemed for me what I could describe
flash geometry and as 64 x 0x10000.

RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 21:04:09, Nov 29 2008

Platform: Olimex LPC-H2294 header board (ARM7TDMI-S) 
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Copyright (C) 2003, 2004, 2005, 2006 eCosCentric Limited

RAM: 0x81000000-0x81100000, [0x81005838-0x810ed000] available
FLASH: 0x80000000-0x803fffff, 8 x 0x2000 blocks, 63 x 0x10000 blocks
RedBoot> 


Sergei

[-- Attachment #2: flash_olpcx2294_v2.diff --]
[-- Type: text/x-diff, Size: 7877 bytes --]

--- /dev/null	2008-04-29 00:50:54.000000000 +0300
+++ devs/flash/arm/olpcx2294v2/current/ChangeLog	2008-11-28 14:47:49.000000000 +0200
@@ -0,0 +1,4 @@
+2008-11-22  Sergei Gavrikov <sergei.gavrikov@gmail.com>
+
+	* Flash driver v2 for LPC-E2294, LPC-H2294, LPC-L2294-1M boards
+	* cdl/flash_olpcx2294.cdl, src/arm_olpcx2294_flash.c: New files.
--- /dev/null	2008-04-29 00:50:54.000000000 +0300
+++ devs/flash/arm/olpcx2294v2/current/cdl/flash_olpcx2294.cdl	2008-11-28 15:32:44.000000000 +0200
@@ -0,0 +1,70 @@
+# ====================================================================
+#
+#      flash_olpcx2294.cdl
+#
+#      FLASH memory - Hardware support on Olimex LPC-X2294 boards
+#
+# ====================================================================
+#####ECOSGPLCOPYRIGHTBEGIN####
+## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+## Copyright (C) 2008 eCosCentric Limited
+##
+## 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.
+##
+## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+## WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with eCos; if not, write to the Free Software Foundation, Inc.,
+## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+##
+## As a special exception, if other files instantiate templates or use macros
+## or inline functions from this file, or you compile this file and link it
+## with other works to produce a work based on this file, this file does not
+## by itself cause the resulting work to be covered by the GNU General Public
+## License. However the source code for this file must still be made available
+## in accordance with section (3) of the GNU General Public License.
+##
+## This exception does not invalidate any other reasons why a work based on
+## this file might be covered by the GNU General Public License.
+## -------------------------------------------
+#####ECOSGPLCOPYRIGHTEND####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      Sergei Gavrikov
+# Contributors:   Sergei Gavrikov
+# Date:           2008-11-28
+#
+#####DESCRIPTIONEND####
+#
+# ====================================================================
+
+cdl_package CYGPKG_DEVS_FLASH_ARM_OLPCX2294_V2 {
+    display       "Support for FLASH memory parts on OLPC-X2294 boards."
+
+    compile       -library=libextras.a arm_olpcx2294_flash.c
+
+    parent        CYGPKG_IO_FLASH
+    active_if     CYGPKG_IO_FLASH
+
+    requires      (CYGPKG_HAL_ARM_LPC2XXX_OLPCE2294 || \
+                   CYGPKG_HAL_ARM_LPC2XXX_OLPCH2294 || \
+                   CYGPKG_HAL_ARM_LPC2XXX_OLPCL2294)
+
+    requires      CYGPKG_DEVS_FLASH_STRATA_V2
+
+    implements    CYGHWR_IO_FLASH_BLOCK_LOCKING
+
+    description "
+        Olimex LPC-X2294 boards all have strata family 28FxxxC3 flash
+        memory parts. These parts have boot blocks. There is no buffered
+        write capability. Individual blocks can be locked and unlocked
+        in software"
+
+}
+
--- /dev/null	2008-04-29 00:50:54.000000000 +0300
+++ devs/flash/arm/olpcx2294v2/current/src/arm_olpcx2294_flash.c	2008-11-29 23:50:44.000000000 +0200
@@ -0,0 +1,112 @@
+//==========================================================================
+//
+//      arm_olpcx2294_flash.c
+//
+//      Flash programming for Intel FlashFile devices on Olimex LPC-X2294
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2008 eCosCentric Limited
+//
+// 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.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     Sergei Gavrikov
+// Contributors:  Sergei Gavrikov
+// Date:          2008-11-28
+// Purpose:
+// Description:
+//
+//####DESCRIPTIONEND####
+//
+//========================================================================*/
+
+#include <pkgconf/system.h>
+
+#if !defined(CYGPKG_HAL_ARM_LPC2XXX_OLPCE2294) && \
+    !defined(CYGPKG_HAL_ARM_LPC2XXX_OLPCH2294) && \
+    !defined(CYGPKG_HAL_ARM_LPC2XXX_OLPCL2294)
+# error Unsupported target
+#endif
+
+#ifdef CYGPKG_DEVS_FLASH_STRATA_V2
+
+#include <cyg/io/flash.h>
+#include <cyg/io/strata_dev.h>
+
+// Olimex LPC-E2294 development board and Olimex LPC-H2294 header board both
+// have 28F320C3-B flash memory part, Olimex LPC-L2294-1M development board has
+// 28F160C3-B flash memory part. All boards have 16-bit access to it's flash
+// devices.
+static const CYG_FLASH_FUNS(hal_olpcx2294_flash_strata_funs,
+    &cyg_strata_init_check_devid_16,
+    &cyg_flash_devfn_query_nop,
+    &cyg_strata_erase_16,
+    &cyg_strata_program_16,
+    (int (*)(struct cyg_flash_dev*, const cyg_flashaddr_t, void*, size_t))0,
+    &cyg_strata_lock_k3_16,
+    &cyg_strata_unlock_k3_16);
+
+static const cyg_strata_dev hal_olpcx2294_flash_priv = {
+    .manufacturer_code = CYG_FLASH_STRATA_MANUFACTURER_INTEL,
+#ifdef CYGPKG_HAL_ARM_LPC2XXX_OLPCL2294 
+    .device_code = 0x88c3, /* 16-Mbit x 16-B, 28F160C3-B */
+#else
+    .device_code = 0x88c5, /* 32-Mbit x 16-B, 28F320C3-B */
+#endif
+    .bufsize    = 1,
+    .block_info = {
+#ifdef CYGPKG_HAL_ARM_LPC2XXX_OLPCL2294 
+        { 0x00002000,  8 },/* boot bottom 8 x 8K blocks */
+        { 0x00010000, 31 } /* 31 x 64K blocks */
+#else
+        { 0x00002000,  8 },/* boot bottom 8 x 8K blocks */
+        { 0x00010000, 63 } /* 63 x 64K blocks */
+#endif
+    }
+};
+
+CYG_FLASH_DRIVER(hal_olpcx2294_flash,
+                 &hal_olpcx2294_flash_strata_funs,
+                 0,
+                 0x80000000,
+#ifdef CYGPKG_HAL_ARM_LPC2XXX_OLPCL2294 
+                 0x801fffff,
+#else
+                 0x803fffff,
+#endif
+                 2,
+                 hal_olpcx2294_flash_priv.block_info,
+                 &hal_olpcx2294_flash_priv
+);
+
+#endif//CYGPKG_DEVS_FLASH_STRATA_V2
+// ------------------------------------------------------------------------
+// EOF arm_olpcx2294_flash.c

[-- Attachment #3: flash_olpcx2294_v2.ecos.db --]
[-- Type: text/plain, Size: 503 bytes --]

package CYGPKG_DEVS_FLASH_ARM_OLPCX2294_V2 {
        alias           { "External Flash memory support for OLPCE2294, OLPCH2294, OLPCL2294" flash_olpcx2294_v2 }
        directory       devs/flash/arm/olpcx2294v2
        script          flash_olpcx2294.cdl
        hardware
        description "
            The flash_olpcx2294_v2 provides hardware support for external
            flash memory parts on the Olimex LPC-E2294, LPC-H2294,
            and LPC-L2294-1M boards. It uses eCos Flash v2 API."
}


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

* Re: flash_olpcx2294_v2 package
  2008-11-30 12:23 flash_olpcx2294_v2 package Sergei Gavrikov
@ 2008-11-30 12:50 ` Sergei Gavrikov
  2008-12-02  6:18   ` Andrew Lunn
  2008-12-02 20:12 ` Andrew Lunn
  1 sibling, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2008-11-30 12:50 UTC (permalink / raw)
  To: eCos patches list; +Cc: Andrew Lunn

Sergei Gavrikov wrote:
> Hello
> 
> This is flash v2 driver for Olimex LPC-X2294 boards on top of strata_v2
> flash driver. Tested on Olimex LPC-H2294 board. Redboot's FIS works fine
> with the driver.
> 
> SYNOPSYS
> 
> 	ecosconfig remove flash_olpcx2294
> 	ecosconfig add strata_v2 flash_olpcx2294_v2 flash
> 
> RFC: I described and the bottom boot blocks in the driver. What is a
> practic, to hide or show it? It seemed for me what I could describe
> flash geometry and as 64 x 0x10000.

I forgot ask about the second commentary. To compile v2 flash driver
it's need to define CYGARC_UNCACHED_ADDRESS macro. I put that in the
targets plf_io.h, but, it seems, that macro can be placed in lpc2xxx
variant, but, where to place the macro? I see 2 places: either var's
hal_cache.h or var_io.h. What will be the best a place? What is your
opinion?

Thanks,

Sergei

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

* Re: flash_olpcx2294_v2 package
  2008-11-30 12:50 ` Sergei Gavrikov
@ 2008-12-02  6:18   ` Andrew Lunn
  2008-12-02  6:54     ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2008-12-02  6:18 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos patches list, Andrew Lunn

On Sun, Nov 30, 2008 at 02:49:43PM +0200, Sergei Gavrikov wrote:
> Sergei Gavrikov wrote:
> > Hello
> > 
> > This is flash v2 driver for Olimex LPC-X2294 boards on top of strata_v2
> > flash driver. Tested on Olimex LPC-H2294 board. Redboot's FIS works fine
> > with the driver.
> > 
> > SYNOPSYS
> > 
> > 	ecosconfig remove flash_olpcx2294
> > 	ecosconfig add strata_v2 flash_olpcx2294_v2 flash
> > 
> > RFC: I described and the bottom boot blocks in the driver. What is a
> > practic, to hide or show it? It seemed for me what I could describe
> > flash geometry and as 64 x 0x10000.
> 
> I forgot ask about the second commentary. To compile v2 flash driver
> it's need to define CYGARC_UNCACHED_ADDRESS macro. I put that in the
> targets plf_io.h, but, it seems, that macro can be placed in lpc2xxx
> variant, but, where to place the macro? I see 2 places: either var's
> hal_cache.h or var_io.h. What will be the best a place? What is your
> opinion?

packages/hal$ find . -name "*.h" | xargs grep -l CYGARC_UNCACHED_ADDRESS

./arm/xscale/iop310/current/include/var_io.h
./arm/xscale/iq80321/current/include/plf_io.h
./arm/xscale/ixdp425/current/include/plf_io.h
./arm/xscale/ixp425/current/include/var_io.h
./arm/xscale/picasso/current/include/plf_io.h
./arm/xscale/uE250/current/include/plf_io.h
./i386/arch/current/include/hal_arch.h
./mips/arch/current/include/hal_arch.h
./mips/atlas/current/include/plf_io.h
./mips/malta/current/include/plf_io.h
./mips/rm7000/ocelot/current/include/plf_io.h
./mn10300/asb2305/current/include/plf_io.h
./powerpc/csb281/current/include/plf_io.h
./powerpc/ppc40x/current/include/var_cache.h
./sh/arch/current/include/hal_var_bank.h
./sh/arch/current/include/hal_var_sp.h
./sh/hs7729pci/current/include/plf_io.h
./sh/se7751/current/include/plf_io.h
./fr30/arch/current/include/hal_arch.h

So var_io.h seems like the correct place.

   Andrew

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

* Re: flash_olpcx2294_v2 package
  2008-12-02  6:18   ` Andrew Lunn
@ 2008-12-02  6:54     ` Sergei Gavrikov
  2008-12-02  7:25       ` Sergei Gavrikov
  2008-12-02  7:27       ` Andrew Lunn
  0 siblings, 2 replies; 13+ messages in thread
From: Sergei Gavrikov @ 2008-12-02  6:54 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos patches list

Andrew Lunn writes:
> On Sun, Nov 30, 2008 at 02:49:43PM +0200, Sergei Gavrikov wrote:
> > Sergei Gavrikov wrote:
> > > Hello
> > > 
> > > This is flash v2 driver for Olimex LPC-X2294 boards on top of strata_v2
> > > flash driver. Tested on Olimex LPC-H2294 board. Redboot's FIS works fine
> > > with the driver.
> > > 
> > > SYNOPSYS
> > > 
> > > 	ecosconfig remove flash_olpcx2294
> > > 	ecosconfig add strata_v2 flash_olpcx2294_v2 flash
> > > 
> > > RFC: I described and the bottom boot blocks in the driver. What is a
> > > practic, to hide or show it? It seemed for me what I could describe
> > > flash geometry and as 64 x 0x10000.
> > 
> > I forgot ask about the second commentary. To compile v2 flash driver
> > it's need to define CYGARC_UNCACHED_ADDRESS macro. I put that in the
> > targets plf_io.h, but, it seems, that macro can be placed in lpc2xxx
> > variant, but, where to place the macro? I see 2 places: either var's
> > hal_cache.h or var_io.h. What will be the best a place? What is your
> > opinion?
> 
> packages/hal$ find . -name "*.h" | xargs grep -l CYGARC_UNCACHED_ADDRESS

I'm sorry. I told badly about. Find? I did it :-) The main part of the
question was, variant or target io.h?  It seemed for me that do tweak of
every plf_io.h is not good idea (perhaps it is a wrong guess). 

I thought, if I will place the lines the below in
lpc2xxx/var/currunt/include/var_io.h

#define CYGARC_CACHED_ADDRESS(x)                       (x)
#define CYGARC_UNCACHED_ADDRESS(x)                     (x)
#define CYGARC_PHYSICAL_ADDRESS(x)                     (x)
#define CYGARC_VIRTUAL_ADDRESS(x)                      (x)

Does a chance exist to break something?

Thank you,

SErgei

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

* Re: flash_olpcx2294_v2 package
  2008-12-02  6:54     ` Sergei Gavrikov
@ 2008-12-02  7:25       ` Sergei Gavrikov
  2008-12-02  7:30         ` Andrew Lunn
  2008-12-02  7:27       ` Andrew Lunn
  1 sibling, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2008-12-02  7:25 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos patches list

[-- Attachment #1: Type: text/plain, Size: 2048 bytes --]

Sergei Gavrikov wrote:
> Andrew Lunn writes:
> > On Sun, Nov 30, 2008 at 02:49:43PM +0200, Sergei Gavrikov wrote:
> > > Sergei Gavrikov wrote:
> > > > Hello
> > > > 
> > > > This is flash v2 driver for Olimex LPC-X2294 boards on top of strata_v2
> > > > flash driver. Tested on Olimex LPC-H2294 board. Redboot's FIS works fine
> > > > with the driver.
> > > > 
> > > > SYNOPSYS
> > > > 
> > > > 	ecosconfig remove flash_olpcx2294
> > > > 	ecosconfig add strata_v2 flash_olpcx2294_v2 flash
> > > > 
> > > > RFC: I described and the bottom boot blocks in the driver. What is a
> > > > practic, to hide or show it? It seemed for me what I could describe
> > > > flash geometry and as 64 x 0x10000.
> > > 
> > > I forgot ask about the second commentary. To compile v2 flash driver
> > > it's need to define CYGARC_UNCACHED_ADDRESS macro. I put that in the
> > > targets plf_io.h, but, it seems, that macro can be placed in lpc2xxx
> > > variant, but, where to place the macro? I see 2 places: either var's
> > > hal_cache.h or var_io.h. What will be the best a place? What is your
> > > opinion?
> > 
> > packages/hal$ find . -name "*.h" | xargs grep -l CYGARC_UNCACHED_ADDRESS
> 
> I'm sorry. I told badly about. Find? I did it :-) The main part of the
> question was, variant or target io.h?  It seemed for me that do tweak of
> every plf_io.h is not good idea (perhaps it is a wrong guess). 
> 
> I thought, if I will place the lines the below in
> lpc2xxx/var/currunt/include/var_io.h
> 
> #define CYGARC_CACHED_ADDRESS(x)                       (x)
> #define CYGARC_UNCACHED_ADDRESS(x)                     (x)
> #define CYGARC_PHYSICAL_ADDRESS(x)                     (x)
> #define CYGARC_VIRTUAL_ADDRESS(x)                      (x)
> 
> Does a chance exist to break something?

..Hm, and this morning it seemed for me that the best place would be
var_arch.h. lpc2xxx's var_io.h has a lot of defines and those in mainly
are I/O macros. IMHO, memory access is something another, isn't it? If
my morning opinion is right, a patch is provided.

Sergei

[-- Attachment #2: lpc2xxx_var.diff --]
[-- Type: text/x-diff, Size: 1985 bytes --]

Index: hal/arm/lpc2xxx/var/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/lpc2xxx/var/current/ChangeLog,v
retrieving revision 1.9
diff -u -5 -r1.9 ChangeLog
--- hal/arm/lpc2xxx/var/current/ChangeLog	22 Jul 2008 18:52:16 -0000	1.9
+++ hal/arm/lpc2xxx/var/current/ChangeLog	2 Dec 2008 07:21:36 -0000
@@ -1,5 +1,9 @@
+2008-12-02  Sergei Gavrikov  <sergei.gavrikov@gmail.com>
+
+	* include/var_arch.h: Memory access macros added.
+
 2008-07-21  Uwe Kindler <uwe_kindler@web.de>
 
 	* cdl/hal_arm_lpc2xxx.cdl: Added option
 	CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION to identify the variant version 
 	because some on-chip peripherals changed slightly in newer veriants.
Index: hal/arm/lpc2xxx/var/current/include/var_arch.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/lpc2xxx/var/current/include/var_arch.h,v
retrieving revision 1.2
diff -u -5 -r1.2 var_arch.h
--- hal/arm/lpc2xxx/var/current/include/var_arch.h	7 May 2006 18:36:18 -0000	1.2
+++ hal/arm/lpc2xxx/var/current/include/var_arch.h	2 Dec 2008 07:21:40 -0000
@@ -51,10 +51,19 @@
 //
 //=============================================================================
 
 #include <pkgconf/hal.h>
 #include <cyg/hal/hal_io.h>
+
+//--------------------------------------------------------------------------
+// Memory access macros
+
+#define CYGARC_CACHED_ADDRESS(x)                       (x)
+#define CYGARC_UNCACHED_ADDRESS(x)                     (x)
+#define CYGARC_PHYSICAL_ADDRESS(x)                     (x)
+#define CYGARC_VIRTUAL_ADDRESS(x)                      (x)
+
 //--------------------------------------------------------------------------
 // Idle thread code.
 // This macro is called in the idle thread loop, and gives the HAL the
 // chance to insert code. Typical idle thread behaviour might be to halt the
 // processor. These implementations halt the system core clock.

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

* Re: flash_olpcx2294_v2 package
  2008-12-02  6:54     ` Sergei Gavrikov
  2008-12-02  7:25       ` Sergei Gavrikov
@ 2008-12-02  7:27       ` Andrew Lunn
  1 sibling, 0 replies; 13+ messages in thread
From: Andrew Lunn @ 2008-12-02  7:27 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos patches list

> I'm sorry. I told badly about. Find? I did it :-) The main part of the
> question was, variant or target io.h?  It seemed for me that do tweak of
> every plf_io.h is not good idea (perhaps it is a wrong guess). 
> 
> I thought, if I will place the lines the below in
> lpc2xxx/var/currunt/include/var_io.h
> 
> #define CYGARC_CACHED_ADDRESS(x)                       (x)
> #define CYGARC_UNCACHED_ADDRESS(x)                     (x)
> #define CYGARC_PHYSICAL_ADDRESS(x)                     (x)
> #define CYGARC_VIRTUAL_ADDRESS(x)                      (x)
> 
> Does a chance exist to break something?

It is better to have

#ifndef CYGARC_CACHED_ADDRES
#define CYGARC_CACHED_ADDRESS(x)                       (x)
...
...

So that the platform can override it if necessary.

   Andrew

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

* Re: flash_olpcx2294_v2 package
  2008-12-02  7:25       ` Sergei Gavrikov
@ 2008-12-02  7:30         ` Andrew Lunn
  2008-12-02  8:00           ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2008-12-02  7:30 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos patches list

> ..Hm, and this morning it seemed for me that the best place would be
> var_arch.h. lpc2xxx's var_io.h has a lot of defines and those in mainly
> are I/O macros. IMHO, memory access is something another, isn't it? If
> my morning opinion is right, a patch is provided.

You are using these macros for memory mapped IO. So var_io.h seems
correct to me. However, as the find(1) showed, there is no 100%
correct answer.

        Andrew

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

* Re: flash_olpcx2294_v2 package
  2008-12-02  7:30         ` Andrew Lunn
@ 2008-12-02  8:00           ` Sergei Gavrikov
  2008-12-02 10:57             ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2008-12-02  8:00 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Sergei Gavrikov, eCos patches list

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

On Tue, Dec 02, 2008 at 08:29:43AM +0100, Andrew Lunn wrote:
> > ..Hm, and this morning it seemed for me that the best place would be
> > var_arch.h. lpc2xxx's var_io.h has a lot of defines and those in mainly
> > are I/O macros. IMHO, memory access is something another, isn't it? If
> > my morning opinion is right, a patch is provided.
> 
> You are using these macros for memory mapped IO. So var_io.h seems
> correct to me. However, as the find(1) showed, there is no 100%
> correct answer.

Thank you for a feedback. I fully trust your experience. As you suggest
it placed in a right place and there are ifdef there.

Sergei

[-- Attachment #2: lpc2xxx_var.diff --]
[-- Type: text/x-diff, Size: 2038 bytes --]

Index: hal/arm/lpc2xxx/var/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/lpc2xxx/var/current/ChangeLog,v
retrieving revision 1.9
diff -u -5 -r1.9 ChangeLog
--- hal/arm/lpc2xxx/var/current/ChangeLog	22 Jul 2008 18:52:16 -0000	1.9
+++ hal/arm/lpc2xxx/var/current/ChangeLog	2 Dec 2008 07:52:38 -0000
@@ -1,5 +1,10 @@
+2008-12-02  Sergei Gavrikov  <sergei.gavrikov@gmail.com>
+            Andrew Lunn      <andrew@lunn.ch>
+
+	* include/var_io.h: Memory access macros added.
+
 2008-07-21  Uwe Kindler <uwe_kindler@web.de>
 
 	* cdl/hal_arm_lpc2xxx.cdl: Added option
 	CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION to identify the variant version 
 	because some on-chip peripherals changed slightly in newer veriants.
Index: hal/arm/lpc2xxx/var/current/include/var_io.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/lpc2xxx/var/current/include/var_io.h,v
retrieving revision 1.2
diff -u -5 -r1.2 var_io.h
--- hal/arm/lpc2xxx/var/current/include/var_io.h	7 May 2006 18:36:18 -0000	1.2
+++ hal/arm/lpc2xxx/var/current/include/var_io.h	2 Dec 2008 07:52:38 -0000
@@ -52,10 +52,26 @@
 
 #include <pkgconf/hal_arm_lpc2xxx.h>  // variant chip model selection.
 #include <cyg/hal/plf_io.h>
 
 //=============================================================================
+// Memory access macros
+
+#ifndef CYGARC_CACHED_ADDRESS
+#  define CYGARC_CACHED_ADDRESS(x)                      (x)
+#endif
+#ifndef CYGARC_UNCACHED_ADDRESS
+#  define CYGARC_UNCACHED_ADDRESS(x)                    (x)
+#endif
+#ifndef CYGARC_PHYSICAL_ADDRESS
+#  define CYGARC_PHYSICAL_ADDRESS(x)                    (x)
+#endif
+#ifndef
+#  define CYGARC_VIRTUAL_ADDRESS(x)                     (x)
+#endif
+
+//=============================================================================
 // Watchdog (WD)
 
 #define CYGARC_HAL_LPC2XXX_REG_WD_BASE                   0xE0000000
 
 // Registers are offsets from base of this subsystem

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

* Re: flash_olpcx2294_v2 package
  2008-12-02  8:00           ` Sergei Gavrikov
@ 2008-12-02 10:57             ` Sergei Gavrikov
  0 siblings, 0 replies; 13+ messages in thread
From: Sergei Gavrikov @ 2008-12-02 10:57 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Sergei Gavrikov, eCos patches list

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

Sergei Gavrikov wrote:
> On Tue, Dec 02, 2008 at 08:29:43AM +0100, Andrew Lunn wrote:
> > > ..Hm, and this morning it seemed for me that the best place would be
> > > var_arch.h. lpc2xxx's var_io.h has a lot of defines and those in mainly
> > > are I/O macros. IMHO, memory access is something another, isn't it? If
> > > my morning opinion is right, a patch is provided.
> > 
> > You are using these macros for memory mapped IO. So var_io.h seems
> > correct to me. However, as the find(1) showed, there is no 100%
> > correct answer.
> 
> Thank you for a feedback. I fully trust your experience. As you suggest
> it placed in a right place and there are ifdef there.

I'm sorry, quick patching break things. There was 1 #ifndef without
argument :-( Fixed.

Sergei

[-- Attachment #2: lpc2xxx_var.diff --]
[-- Type: text/x-diff, Size: 2061 bytes --]

Index: hal/arm/lpc2xxx/var/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/lpc2xxx/var/current/ChangeLog,v
retrieving revision 1.9
diff -u -5 -r1.9 ChangeLog
--- hal/arm/lpc2xxx/var/current/ChangeLog	22 Jul 2008 18:52:16 -0000	1.9
+++ hal/arm/lpc2xxx/var/current/ChangeLog	2 Dec 2008 07:52:38 -0000
@@ -1,5 +1,10 @@
+2008-12-02  Sergei Gavrikov  <sergei.gavrikov@gmail.com>
+            Andrew Lunn      <andrew@lunn.ch>
+
+	* include/var_io.h: Memory access macros added.
+
 2008-07-21  Uwe Kindler <uwe_kindler@web.de>
 
 	* cdl/hal_arm_lpc2xxx.cdl: Added option
 	CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION to identify the variant version 
 	because some on-chip peripherals changed slightly in newer veriants.
Index: hal/arm/lpc2xxx/var/current/include/var_io.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/lpc2xxx/var/current/include/var_io.h,v
retrieving revision 1.2
diff -u -5 -r1.2 var_io.h
--- hal/arm/lpc2xxx/var/current/include/var_io.h	7 May 2006 18:36:18 -0000	1.2
+++ hal/arm/lpc2xxx/var/current/include/var_io.h	2 Dec 2008 07:52:38 -0000
@@ -52,10 +52,26 @@
 
 #include <pkgconf/hal_arm_lpc2xxx.h>  // variant chip model selection.
 #include <cyg/hal/plf_io.h>
 
 //=============================================================================
+// Memory access macros
+
+#ifndef CYGARC_CACHED_ADDRESS
+#  define CYGARC_CACHED_ADDRESS(x)                      (x)
+#endif
+#ifndef CYGARC_UNCACHED_ADDRESS
+#  define CYGARC_UNCACHED_ADDRESS(x)                    (x)
+#endif
+#ifndef CYGARC_PHYSICAL_ADDRESS
+#  define CYGARC_PHYSICAL_ADDRESS(x)                    (x)
+#endif
+#ifndef CYGARC_VIRTUAL_ADDRESS
+#  define CYGARC_VIRTUAL_ADDRESS(x)                     (x)
+#endif
+
+//=============================================================================
 // Watchdog (WD)
 
 #define CYGARC_HAL_LPC2XXX_REG_WD_BASE                   0xE0000000
 
 // Registers are offsets from base of this subsystem

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

* Re: flash_olpcx2294_v2 package
  2008-11-30 12:23 flash_olpcx2294_v2 package Sergei Gavrikov
  2008-11-30 12:50 ` Sergei Gavrikov
@ 2008-12-02 20:12 ` Andrew Lunn
  2008-12-02 20:26   ` Sergei Gavrikov
  1 sibling, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2008-12-02 20:12 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos patches list

On Sun, Nov 30, 2008 at 02:23:09PM +0200, Sergei Gavrikov wrote:
> Hello
> 
> This is flash v2 driver for Olimex LPC-X2294 boards on top of strata_v2
> flash driver. Tested on Olimex LPC-H2294 board. Redboot's FIS works fine
> with the driver.

Thanks. I have committed it.

> 
> SYNOPSYS
> 
> 	ecosconfig remove flash_olpcx2294
> 	ecosconfig add strata_v2 flash_olpcx2294_v2 flash

Do you want to submit a patch which changes platforms to use the v2
driver?
 
> RFC: I described and the bottom boot blocks in the driver. What is a
> practic, to hide or show it? It seemed for me what I could describe
> flash geometry and as 64 x 0x10000.

Show it. It allows things like reboot to make more efficient use of
these small blocks. Maybe your application also wants to use the small
blocks. With the v1 API this was difficult but the v2 API makes the
usable.

        Andrew

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

* Re: flash_olpcx2294_v2 package
  2008-12-02 20:12 ` Andrew Lunn
@ 2008-12-02 20:26   ` Sergei Gavrikov
  2008-12-02 20:58     ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2008-12-02 20:26 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos patches list

On Tue, Dec 02, 2008 at 09:11:55PM +0100, Andrew Lunn wrote:
> On Sun, Nov 30, 2008 at 02:23:09PM +0200, Sergei Gavrikov wrote:
> > Hello
> > 
> > This is flash v2 driver for Olimex LPC-X2294 boards on top of strata_v2
> > flash driver. Tested on Olimex LPC-H2294 board. Redboot's FIS works fine
> > with the driver.
> 
> Thanks. I have committed it.

Thank you for flash v2 branch distribution! It does things (and our
life) simpler.
 
> > 
> > SYNOPSYS
> > 
> > 	ecosconfig remove flash_olpcx2294 ecosconfig add strata_v2
> > 	flash_olpcx2294_v2 flash
> 
> Do you want to submit a patch which changes platforms to use the v2
> driver?

I will do. I will send it after testing.

> > RFC: I described and the bottom boot blocks in the driver. What is a
> > practic, to hide or show it? It seemed for me what I could describe
> > flash geometry and as 64 x 0x10000.
> 
> Show it. It allows things like reboot to make more efficient use of
> these small blocks. Maybe your application also wants to use the small
> blocks. With the v1 API this was difficult but the v2 API makes the
> usable.

Thank you,

Sergei

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

* Re: flash_olpcx2294_v2 package
  2008-12-02 20:26   ` Sergei Gavrikov
@ 2008-12-02 20:58     ` Sergei Gavrikov
  2008-12-08 20:17       ` Andrew Lunn
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2008-12-02 20:58 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos patches list

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

On Tue, Dec 02, 2008 at 10:25:27PM +0200, Sergei Gavrikov wrote:
> On Tue, Dec 02, 2008 at 09:11:55PM +0100, Andrew Lunn wrote:
> > On Sun, Nov 30, 2008 at 02:23:09PM +0200, Sergei Gavrikov wrote:
> > > SYNOPSYS
> > > 
> > > 	ecosconfig remove flash_olpcx2294 ecosconfig add strata_v2
> > > 	flash_olpcx2294_v2 flash
> > 
> > Do you want to submit a patch which changes platforms to use the v2
> > driver?
> 
> I will do. I will send it after testing.

Done. The builds were tested for all targets. Live testing was done on
olpch2294 target. No ChangeLog, because only ecos.db has been tweaked.

Sergei

[-- Attachment #2: ecos.db.diff --]
[-- Type: text/x-diff, Size: 3156 bytes --]

Index: ecos.db
===================================================================
RCS file: /cvs/ecos/ecos/packages/ecos.db,v
retrieving revision 1.186
diff -u -5 -r1.186 ecos.db
--- ecos.db	23 Nov 2008 13:13:35 -0000	1.186
+++ ecos.db	2 Dec 2008 20:47:59 -0000
@@ -892,10 +892,21 @@
         description "
         This package contains hardware support for flash memory parts
         on the Olimex LPC-E2294, LPC-H2294 LPC-L2294-1M platforms."
 }
 
+package CYGPKG_DEVS_FLASH_ARM_OLPCX2294_V2 {
+        alias           { "Support for Flash memory on OLPCE2294, OLPCH2294, OLPCL2294" flash_olpcx2294_v2 }
+        directory       devs/flash/arm/olpcx2294v2
+        script          flash_olpcx2294.cdl
+        hardware
+        description "
+            The flash_olpcx2294_v2 provides hardware support for external
+            flash memory parts on the Olimex LPC-E2294, LPC-H2294,
+            and LPC-L2294-1M boards. It uses eCos Flash v2 API."
+}
+
 package CYGPKG_DEVS_TOUCH_IPAQ {
 	alias 		{ "Touch screen support for iPAQ" touch_ipaq }
 	directory	devs/touch/arm/ipaq
 	script		touch_ipaq.cdl
 	hardware
@@ -4920,12 +4931,12 @@
 target olpch2294 {
         alias { "Olimex LPC-H2294 header board" olpch2294 }
         packages { CYGPKG_HAL_ARM
                    CYGPKG_HAL_ARM_LPC2XXX
                    CYGPKG_HAL_ARM_LPC2XXX_OLPCH2294
-                   CYGPKG_DEVS_FLASH_INTEL_28FXXX
-                   CYGPKG_DEVS_FLASH_ARM_OLPCX2294
+                   CYGPKG_DEVS_FLASH_STRATA_V2
+                   CYGPKG_DEVS_FLASH_ARM_OLPCX2294_V2
                    CYGPKG_IO_SERIAL_GENERIC_16X5X
                    CYGPKG_IO_SERIAL_ARM_LPC2XXX
                    CYGPKG_DEVICES_WATCHDOG_ARM_LPC2XXX
         }
         description "
@@ -4937,12 +4948,12 @@
 target olpce2294 {
         alias { "Olimex LPC-E2294 development board" olpce2294 }
         packages { CYGPKG_HAL_ARM
                    CYGPKG_HAL_ARM_LPC2XXX
                    CYGPKG_HAL_ARM_LPC2XXX_OLPCE2294
-                   CYGPKG_DEVS_FLASH_INTEL_28FXXX
-                   CYGPKG_DEVS_FLASH_ARM_OLPCX2294
+                   CYGPKG_DEVS_FLASH_STRATA_V2
+                   CYGPKG_DEVS_FLASH_ARM_OLPCX2294_V2
                    CYGPKG_DEVS_ETH_CL_CS8900A
                    CYGPKG_DEVS_ETH_ARM_OLPCE2294
                    CYGPKG_IO_SERIAL_GENERIC_16X5X
                    CYGPKG_IO_SERIAL_ARM_LPC2XXX
                    CYGPKG_DEVICES_WATCHDOG_ARM_LPC2XXX
@@ -4955,12 +4966,12 @@
 target olpcl2294 {
         alias { "Olimex LPC-L2294-1MB development board" olpcl2294 }
         packages { CYGPKG_HAL_ARM
                    CYGPKG_HAL_ARM_LPC2XXX
                    CYGPKG_HAL_ARM_LPC2XXX_OLPCL2294
-                   CYGPKG_DEVS_FLASH_INTEL_28FXXX
-                   CYGPKG_DEVS_FLASH_ARM_OLPCX2294
+                   CYGPKG_DEVS_FLASH_STRATA_V2
+                   CYGPKG_DEVS_FLASH_ARM_OLPCX2294_V2
                    CYGPKG_DEVS_ETH_CL_CS8900A
                    CYGPKG_DEVS_ETH_ARM_OLPCL2294
                    CYGPKG_IO_SERIAL_GENERIC_16X5X
                    CYGPKG_IO_SERIAL_ARM_LPC2XXX
                    CYGPKG_DEVICES_WATCHDOG_ARM_LPC2XXX

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

* Re: flash_olpcx2294_v2 package
  2008-12-02 20:58     ` Sergei Gavrikov
@ 2008-12-08 20:17       ` Andrew Lunn
  0 siblings, 0 replies; 13+ messages in thread
From: Andrew Lunn @ 2008-12-08 20:17 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos patches list

On Tue, Dec 02, 2008 at 10:57:27PM +0200, Sergei Gavrikov wrote:
> On Tue, Dec 02, 2008 at 10:25:27PM +0200, Sergei Gavrikov wrote:
> > On Tue, Dec 02, 2008 at 09:11:55PM +0100, Andrew Lunn wrote:
> > > On Sun, Nov 30, 2008 at 02:23:09PM +0200, Sergei Gavrikov wrote:
> > > > SYNOPSYS
> > > > 
> > > > 	ecosconfig remove flash_olpcx2294 ecosconfig add strata_v2
> > > > 	flash_olpcx2294_v2 flash
> > > 
> > > Do you want to submit a patch which changes platforms to use the v2
> > > driver?
> > 
> > I will do. I will send it after testing.
> 
> Done. The builds were tested for all targets. Live testing was done on
> olpch2294 target. No ChangeLog, because only ecos.db has been tweaked.

Committed,
        Andrew

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

end of thread, other threads:[~2008-12-08 20:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-30 12:23 flash_olpcx2294_v2 package Sergei Gavrikov
2008-11-30 12:50 ` Sergei Gavrikov
2008-12-02  6:18   ` Andrew Lunn
2008-12-02  6:54     ` Sergei Gavrikov
2008-12-02  7:25       ` Sergei Gavrikov
2008-12-02  7:30         ` Andrew Lunn
2008-12-02  8:00           ` Sergei Gavrikov
2008-12-02 10:57             ` Sergei Gavrikov
2008-12-02  7:27       ` Andrew Lunn
2008-12-02 20:12 ` Andrew Lunn
2008-12-02 20:26   ` Sergei Gavrikov
2008-12-02 20:58     ` Sergei Gavrikov
2008-12-08 20:17       ` Andrew Lunn

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