]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/jffs2/load_kernel.h
Merge branch 'tx28-update-2016-02-03' into karo-tx6
[karo-tx-uboot.git] / include / jffs2 / load_kernel.h
index d8b4240766e6a9164f64482f1e58b740333d0a22..dd0d23fa52a48fafab5ea2d29c56c9771ef8afc0 100644 (file)
@@ -8,57 +8,44 @@
  * Description:   header for load kernel modules
  *-----------------------------------------------------------------------*/
 /*
- *
- * This program 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 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
-/* this struct is very similar to mtd_info */
-struct part_info {
-       u32 size;        /* Total size of the Partition */
-
-       /* "Major" erase size for the device. Naïve users may take this
-        * to be the only erase size available, or may use the more detailed
-        * information below if they desire
-        */
-       u32 erasesize;
+#include <linux/list.h>
 
-       /* Where in memory does this partition start? */
-       char *offset;
+/* mtd device types */
+#define MTD_DEV_TYPE_NOR       0x0001
+#define MTD_DEV_TYPE_NAND      0x0002
+#define MTD_DEV_TYPE_ONENAND   0x0004
 
-       /* used by jffs2 set to NULL */
-       void *jffs2_priv;
+#define MTD_DEV_TYPE(type) ((type == MTD_DEV_TYPE_NAND) ? "nand" :     \
+                       (type == MTD_DEV_TYPE_ONENAND) ? "onenand" : "nor")
 
-       /* private filed used by user */
-       void *usr_priv;
+struct mtd_device {
+       struct list_head link;
+       struct mtdids *id;              /* parent mtd id entry */
+       u16 num_parts;                  /* number of partitions on this device */
+       struct list_head parts;         /* partitions */
 };
 
-struct part_info*
-jffs2_part_info(int part_num);
-
-struct kernel_loader {
-
-       /* Return true if there is a kernel contained at src */
-       int (* check_magic)(struct part_info *part);
-
-       /* load the kernel from the partition part to dst, return the number
-        * of bytes copied if successful, zero if not */
-       u32 (* load_kernel)(u32 *dst, struct part_info *part, const char *kernel_filename);
+struct part_info {
+       struct list_head link;
+       char *name;                     /* partition name */
+       u8 auto_name;                   /* set to 1 for generated name */
+       u64 size;                       /* total size of the partition */
+       u64 offset;                     /* offset within device */
+       void *jffs2_priv;               /* used internaly by jffs2 */
+       u32 mask_flags;                 /* kernel MTD mask flags */
+       u32 sector_size;                /* size of sector */
+       struct mtd_device *dev;         /* parent device */
+};
 
-       /* A brief description of the module (ie, "cramfs") */
-       char *name;
+struct mtdids {
+       struct list_head link;
+       u8 type;                        /* device type */
+       u8 num;                         /* device number */
+       u64 size;                       /* device size */
+       char *mtd_id;                   /* linux kernel device id */
 };
 
 #define ldr_strlen     strlen
@@ -73,4 +60,10 @@ struct kernel_loader {
 #define putLabeledWord(x, y)   printf("%s %08x\n", x, (unsigned int)y)
 #define led_blink(x, y, z, a)
 
+/* common/cmd_jffs2.c */
+extern int mtdparts_init(void);
+extern int find_dev_and_part(const char *id, struct mtd_device **dev,
+                               u8 *part_num, struct part_info **part);
+extern struct mtd_device *device_find(u8 type, u8 num);
+
 #endif /* load_kernel_h */