+#if defined CFG_JFFS_CUSTOM_PART
+
+/**
+ * jffs2_part_info - get information about a JFFS2 partition
+ *
+ * @part_num: number of the partition you want to get info about
+ * @return: struct part_info* in case of success, 0 if failure
+ */
+
+static struct part_info part;
+
+#ifdef CONFIG_MTD_INNOKOM_16MB
+#ifdef CONFIG_MTD_INNOKOM_64MB
+#error Please define only one CONFIG_MTD_INNOKOM_XXMB option.
+#endif
+struct part_info* jffs2_part_info(int part_num) {
+
+ PRINTK2("jffs2_part_info: part_num=%i\n",part_num);
+
+ /* u-boot partition */
+ if(part_num==0){
+ if(part.usr_priv==(void*)1) return ∂
+
+ memset(&part, 0, sizeof(part));
+
+ part.offset=(char*)0x00000000;
+ part.size=256*1024;
+
+ /* Mark the struct as ready */
+ part.usr_priv=(void*)1;
+
+ PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
+ PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
+ return ∂
+ }
+
+ /* primary OS+firmware partition */
+ if(part_num==1){
+ if(part.usr_priv==(void*)1) return ∂
+
+ memset(&part, 0, sizeof(part));
+
+ part.offset=(char*)0x00040000;
+ part.size=768*1024;
+
+ /* Mark the struct as ready */
+ part.usr_priv=(void*)1;
+
+ PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
+ PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
+ return ∂
+ }
+
+ /* secondary OS+firmware partition */
+ if(part_num==2){
+ if(part.usr_priv==(void*)1) return ∂
+
+ memset(&part, 0, sizeof(part));
+
+ part.offset=(char*)0x00100000;
+ part.size=8*1024*1024;
+
+ /* Mark the struct as ready */
+ part.usr_priv=(void*)1;
+
+ PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
+ PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
+ return ∂
+ }
+
+ /* data partition */
+ if(part_num==3){
+ if(part.usr_priv==(void*)1) return ∂
+
+ memset(&part, 0, sizeof(part));
+
+ part.offset=(char*)0x00900000;
+ part.size=7*1024*1024;
+
+ /* Mark the struct as ready */
+ part.usr_priv=(void*)1;
+
+ PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
+ PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
+
+ return ∂
+ }
+
+ PRINTK("jffs2_part_info: end of partition table\n");
+ return 0;
+}
+#endif /* CONFIG_MTD_INNOKOM_16MB */
+
+#ifdef CONFIG_MTD_INNOKOM_64MB
+#ifdef CONFIG_MTD_INNOKOM_16MB
+#error Please define only one CONFIG_MTD_INNOKOM_XXMB option.
+#endif
+struct part_info* jffs2_part_info(int part_num) {
+
+ PRINTK2("jffs2_part_info: part_num=%i\n",part_num);
+
+ /* u-boot partition */
+ if(part_num==0){
+ if(part.usr_priv==(void*)1) return ∂
+
+ memset(&part, 0, sizeof(part));
+
+ part.offset=(char*)0x00000000;
+ part.size=256*1024;
+
+ /* Mark the struct as ready */
+ part.usr_priv=(void*)1;
+
+ PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
+ PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
+ return ∂
+ }
+
+ /* primary OS+firmware partition */
+ if(part_num==1){
+ if(part.usr_priv==(void*)1) return ∂
+
+ memset(&part, 0, sizeof(part));
+
+ part.offset=(char*)0x00040000;
+ part.size=16*1024*1024-128*1024;
+
+ /* Mark the struct as ready */
+ part.usr_priv=(void*)1;
+
+ PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
+ PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
+ return ∂
+ }
+
+ /* secondary OS+firmware partition */
+ if(part_num==2){
+ if(part.usr_priv==(void*)1) return ∂
+
+ memset(&part, 0, sizeof(part));
+
+ part.offset=(char*)0x01020000;
+ part.size=16*1024*1024-128*1024;
+
+ /* Mark the struct as ready */
+ part.usr_priv=(void*)1;
+
+ PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
+ PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
+ return ∂
+ }
+
+ /* data partition */
+ if(part_num==3){
+ if(part.usr_priv==(void*)1) return ∂
+
+ memset(&part, 0, sizeof(part));
+
+ part.offset=(char*)0x02000000;
+ part.size=32*1024*1024;
+
+ /* Mark the struct as ready */
+ part.usr_priv=(void*)1;
+
+ PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
+ PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
+
+ return ∂
+ }
+
+ PRINTK("jffs2_part_info: end of partition table\n");
+ return 0;
+}
+#endif /* CONFIG_MTD_INNOKOM_64MB */
+#endif /* defined CFG_JFFS_CUSTOM_PART */
+
+