This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
CYG_IO_SET_CONFIG_FLASH_FIS_NAME
- From: David Woodhouse <dwmw2 at infradead dot org>
- To: ecos-patches at sources dot redhat dot com
- Date: Thu, 27 Nov 2003 15:04:45 +0000
- Subject: CYG_IO_SET_CONFIG_FLASH_FIS_NAME
Allows setting the FIS partition to be used by the flash block device at
run time. Which is especially useful given that the current
implementation seems to go looking for FIS info before the relevant
virtual vectors are set up, and never actually finds the partition it's
looking for.
--
dwmw2
Index: io/common/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/common/current/ChangeLog,v
retrieving revision 1.19
diff -u -p -r1.19 ChangeLog
--- io/common/current/ChangeLog 6 Nov 2003 11:19:37 -0000 1.19
+++ io/common/current/ChangeLog 27 Nov 2003 15:03:16 -0000
@@ -1,3 +1,7 @@
+2003-11-27 David Woodhouse <dwmw2@infradead.org>
+
+ * include/config_keys.h: Add CYG_IO_SET_CONFIG_FLASH_FIS_NAME
+
2003-11-06 Billy <billy@babababa.net>
* doc/io.sgml: In the TTY section swap "\n\r" to "\r\n" to match
Index: io/common/current/include/config_keys.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/common/current/include/config_keys.h,v
retrieving revision 1.8
diff -u -p -r1.8 config_keys.h
--- io/common/current/include/config_keys.h 25 Mar 2003 02:46:53 -0000 1.8
+++ io/common/current/include/config_keys.h 27 Nov 2003 15:03:16 -0000
@@ -121,6 +121,8 @@
#define CYG_IO_GET_CONFIG_FLASH_DEVSIZE 0x605
#define CYG_IO_GET_CONFIG_FLASH_BLOCKSIZE 0x606
+#define CYG_IO_SET_CONFIG_FLASH_FIS_NAME 0x680
+
// ======== 0x1000 Generic ===================================================
// Get/Set configuration 'key' values that can apply to more than one
// class of device.
Index: io/flash/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/ChangeLog,v
retrieving revision 1.34
diff -u -p -r1.34 ChangeLog
--- io/flash/current/ChangeLog 25 Nov 2003 09:05:31 -0000 1.34
+++ io/flash/current/ChangeLog 27 Nov 2003 15:03:17 -0000
@@ -1,3 +1,8 @@
+2003-11-27 David Woodhouse <dwmw2@infradead.org>
+
+ * src/flashiodev.c: Enable set_config() and implement
+ CYG_IO_SET_CONFIG_FLASH_FIS_NAME.
+
2003-11-25 Andrew Lunn <andrew.lunn@ascom.ch>
* src/flash.c: gcc 3.x vs gcc 2.x problems.
Index: io/flash/current/src/flashiodev.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/flashiodev.c,v
retrieving revision 1.6
diff -u -p -r1.6 flashiodev.c
--- io/flash/current/src/flashiodev.c 24 Nov 2003 11:38:59 -0000 1.6
+++ io/flash/current/src/flashiodev.c 27 Nov 2003 15:03:17 -0000
@@ -238,7 +238,6 @@ flashiodev_get_config( cyg_io_handle_t h
}
} // flashiodev_get_config()
-#if 0
static Cyg_ErrNo
flashiodev_set_config( cyg_io_handle_t handle,
cyg_uint32 key,
@@ -249,11 +248,28 @@ flashiodev_set_config( cyg_io_handle_t h
struct flashiodev_priv_t *dev = (struct flashiodev_priv_t *)tab->priv;
switch (key) {
+#ifdef CYGNUM_IO_FLASH_BLOCK_CFG_FIS_1
+ case CYG_IO_SET_CONFIG_FLASH_FIS_NAME:
+ {
+ CYG_ADDRESS flash_base;
+ unsigned long size;
+
+ if(!CYGACC_CALL_IF_FLASH_FIS_OP(CYGNUM_CALL_IF_FLASH_FIS_GET_FLASH_BASE,
+ (char *)buf, &flash_base))
+ return -ENOENT;
+ if(!CYGACC_CALL_IF_FLASH_FIS_OP(CYGNUM_CALL_IF_FLASH_FIS_GET_SIZE,
+ (char *)buf, &size))
+ return -ENOENT;
+
+ dev->start = (char *)flash_base;
+ dev->end = (char *)flash_base + size;
+ return ENOERR;
+ }
+#endif
default:
return -EINVAL;
}
} // flashiodev_set_config()
-#endif
// get_config/set_config should be added later to provide the other flash
// operations possible, like erase etc.
@@ -263,7 +279,7 @@ BLOCK_DEVIO_TABLE( cyg_io_flashdev1_ops,
&flashiodev_bread,
0, // no select
&flashiodev_get_config,
- 0 // &flashiodev_set_config
+ &flashiodev_set_config
);