diff loadtools/flash.h @ 55:278052b6afda

loadtools: started laying the foundation for flash support
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 23 Jun 2013 20:13:59 +0000
parents
children 99c234bf6a9b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadtools/flash.h	Sun Jun 23 20:13:59 2013 +0000
@@ -0,0 +1,39 @@
+/* this header file contains definitions for fc-loadtool flash support */
+
+/*
+ * The following structures represent an "abstract"
+ * description of flash devices.
+ *
+ * A "region" is a consecutive group of erase units of the same size.
+ */
+
+struct flash_region_desc {
+	uint32_t	sector_size;
+	unsigned	nsectors;
+};
+
+struct flash_bank_desc {
+	struct flash_region_desc	*regions;
+	uint32_t			prog_base_mask;
+};
+
+struct flash_device_desc {
+	char			*name;
+	struct flash_bank_desc	*bank_desc;
+	unsigned		nbanks;
+};
+
+/* the following structures describe flash banks as accessible to us */
+
+struct sector_info {
+	uint32_t	start;
+	uint32_t	size;
+};
+
+struct flash_bank_info {
+	uint32_t		base_addr;
+	uint32_t		total_size;
+	struct flash_bank_desc	*bank_desc;
+	struct sector_info	*sectors;
+	unsigned		nsectors;
+};