1 diff -uNr --exclude=.*flags --exclude=*.[ao] --exclude=.*depend /work2/iPAQ/HandHelds.org/cvs/linux/kernel/.config.old ./.config.old
2 --- /work2/iPAQ/HandHelds.org/cvs/linux/kernel/.config.old Wed Dec 31 17:00:00 1969
3 +++ ./.config.old Sat Mar 24 05:12:24 2001
6 +# Automatically generated make config: don't edit
9 +# CONFIG_EISA is not set
10 +# CONFIG_SBUS is not set
11 +# CONFIG_MCA is not set
15 +# Code maturity level options
17 +CONFIG_EXPERIMENTAL=y
18 +# CONFIG_OBSOLETE is not set
21 +# Loadable module support
24 +# CONFIG_MODVERSIONS is not set
30 +# CONFIG_ARCH_ARCA5K is not set
31 +# CONFIG_ARCH_CLPS7500 is not set
32 +# CONFIG_ARCH_CO285 is not set
33 +# CONFIG_ARCH_EBSA110 is not set
34 +# CONFIG_ARCH_L7200 is not set
35 +# CONFIG_ARCH_FOOTBRIDGE is not set
36 +# CONFIG_ARCH_INTEGRATOR is not set
37 +# CONFIG_ARCH_RPC is not set
39 +# CONFIG_ARCH_CLPS711X is not set
42 +# Archimedes/A5000 Implementations
46 +# Archimedes/A5000 Implementations (select only ONE)
50 +# Footbridge Implementations
54 +# SA11x0 Implementations
56 +# CONFIG_SA1100_ASSABET is not set
57 +# CONFIG_SA1100_BRUTUS is not set
58 +# CONFIG_SA1100_CERF is not set
59 +CONFIG_SA1100_BITSY=y
60 +# CONFIG_SA1100_JORNADA720 is not set
61 +# CONFIG_SA1100_EXTENEX1 is not set
62 +# CONFIG_SA1100_FREEBIRD is not set
63 +# CONFIG_SA1100_GRAPHICSCLIENT is not set
64 +# CONFIG_SA1100_HUW_WEBPANEL is not set
65 +# CONFIG_SA1100_LART is not set
66 +# CONFIG_SA1100_OMNIMETER is not set
67 +# CONFIG_SA1100_PLEB is not set
68 +# CONFIG_SA1100_NANOENGINE is not set
69 +# CONFIG_SA1100_PANGOLIN is not set
70 +# CONFIG_SA1100_SHERMAN is not set
71 +# CONFIG_SA1100_VICTOR is not set
72 +# CONFIG_SA1100_XP860 is not set
73 +# CONFIG_SA1100_YOPY is not set
75 +CONFIG_SA1100_USB_NETLINK=m
76 +CONFIG_SA1100_USB_CHAR=m
77 +CONFIG_SA1100_FREQUENCY_SCALE=m
80 +# CLPS711X/EP721X Implementations
82 +# CONFIG_ARCH_ACORN is not set
83 +# CONFIG_FOOTBRIDGE is not set
84 +# CONFIG_FOOTBRIDGE_HOST is not set
85 +# CONFIG_FOOTBRIDGE_ADDIN is not set
87 +# CONFIG_CPU_26 is not set
92 +# CONFIG_CPU_32v3 is not set
94 +# CONFIG_CPU_ARM610 is not set
95 +# CONFIG_CPU_ARM710 is not set
96 +# CONFIG_CPU_ARM720T is not set
97 +# CONFIG_CPU_ARM920T is not set
98 +# CONFIG_CPU_ARM1020 is not set
99 +# CONFIG_CPU_SA110 is not set
101 +CONFIG_DISCONTIGMEM=y
108 +# Please ensure that you have read the help on the next option
110 +# CONFIG_ANGELBOOT is not set
111 +# CONFIG_PCI is not set
112 +# CONFIG_ISA is not set
113 +# CONFIG_ISA_DMA is not set
117 +# PCMCIA/CardBus support
120 +# CONFIG_I82365 is not set
121 +# CONFIG_TCIC is not set
122 +CONFIG_PCMCIA_SA1100=m
123 +CONFIG_MERCURY_BACKPAQ=m
126 +# CONFIG_BSD_PROCESS_ACCT is not set
129 +CONFIG_FPE_FASTFPE=y
131 +# CONFIG_KCORE_AOUT is not set
132 +CONFIG_BINFMT_AOUT=m
134 +# CONFIG_BINFMT_MISC is not set
137 +# CONFIG_ARTHUR is not set
138 +CONFIG_CMDLINE="keepinitrd"
139 +# CONFIG_LEDS is not set
140 +CONFIG_ALIGNMENT_TRAP=y
141 +# CONFIG_UCB1200 is not set
144 +# Parallel port support
146 +# CONFIG_PARPORT is not set
149 +# Memory Technology Devices (MTD)
152 +# CONFIG_MTD_DEBUG is not set
155 +# Disk-On-Chip Device Drivers
157 +# CONFIG_MTD_DOC1000 is not set
158 +# CONFIG_MTD_DOC2000 is not set
159 +# CONFIG_MTD_DOC2001 is not set
160 +# CONFIG_MTD_DOCPROBE is not set
163 +# RAM/ROM Device Drivers
165 +# CONFIG_MTD_SLRAM is not set
166 +# CONFIG_MTD_RAM is not set
167 +# CONFIG_MTD_ROM is not set
168 +# CONFIG_MTD_MTDRAM is not set
171 +# Linearly Mapped Flash Device Drivers
174 +# CONFIG_MTD_CFI_GEOMETRY is not set
175 +CONFIG_MTD_CFI_INTELEXT=y
176 +# CONFIG_MTD_CFI_AMDSTD is not set
177 +# CONFIG_MTD_AMDSTD is not set
178 +# CONFIG_MTD_SHARP is not set
179 +# CONFIG_MTD_PHYSMAP is not set
180 +# CONFIG_MTD_NORA is not set
181 +# CONFIG_MTD_PNC2000 is not set
182 +# CONFIG_MTD_RPXLITE is not set
183 +# CONFIG_MTD_SC520CDP is not set
184 +# CONFIG_MTD_SBC_MEDIAGX is not set
185 +# CONFIG_MTD_ELAN_104NC is not set
187 +# CONFIG_MTD_DC21285 is not set
188 +# CONFIG_MTD_CSTM_CFI_JEDEC is not set
189 +# CONFIG_MTD_JEDEC is not set
192 +# NAND Flash Device Drivers
194 +# CONFIG_MTD_NAND is not set
197 +# User Modules And Translation Layers
201 +# CONFIG_FTL is not set
202 +# CONFIG_NFTL is not set
205 +# Plug and Play configuration
207 +# CONFIG_PNP is not set
212 +# CONFIG_BLK_DEV_FD is not set
213 +CONFIG_BLK_DEV_LOOP=m
214 +CONFIG_BLK_DEV_NBD=m
215 +CONFIG_BLK_DEV_RAM=y
216 +CONFIG_BLK_DEV_RAM_SIZE=4096
217 +CONFIG_BLK_DEV_INITRD=y
220 +# Multi-device support (RAID and LVM)
222 +# CONFIG_MD is not set
225 +# Networking options
228 +CONFIG_PACKET_MMAP=y
229 +# CONFIG_NETLINK is not set
230 +# CONFIG_NETFILTER is not set
231 +# CONFIG_FILTER is not set
234 +# CONFIG_IP_MULTICAST is not set
235 +# CONFIG_IP_ADVANCED_ROUTER is not set
236 +# CONFIG_IP_PNP is not set
237 +# CONFIG_NET_IPIP is not set
238 +# CONFIG_NET_IPGRE is not set
239 +# CONFIG_INET_ECN is not set
240 +# CONFIG_SYN_COOKIES is not set
241 +# CONFIG_IPV6 is not set
242 +# CONFIG_KHTTPD is not set
243 +# CONFIG_ATM is not set
248 +# CONFIG_IPX is not set
249 +# CONFIG_ATALK is not set
250 +# CONFIG_DECNET is not set
251 +# CONFIG_BRIDGE is not set
252 +# CONFIG_X25 is not set
253 +# CONFIG_LAPB is not set
254 +# CONFIG_LLC is not set
255 +# CONFIG_NET_DIVERT is not set
256 +# CONFIG_ECONET is not set
257 +# CONFIG_WAN_ROUTER is not set
258 +# CONFIG_NET_FASTROUTE is not set
259 +# CONFIG_NET_HW_FLOWCONTROL is not set
262 +# QoS and/or fair queueing
264 +# CONFIG_NET_SCHED is not set
267 +# Network device support
274 +# CONFIG_ARCNET is not set
275 +# CONFIG_DUMMY is not set
276 +# CONFIG_BONDING is not set
277 +# CONFIG_EQUALIZER is not set
278 +# CONFIG_TUN is not set
279 +# CONFIG_NET_SB1000 is not set
282 +# Ethernet (10 or 100Mbit)
284 +# CONFIG_NET_ETHERNET is not set
287 +# Ethernet (1000 Mbit)
289 +# CONFIG_ACENIC_OMIT_TIGON_I is not set
290 +# CONFIG_FDDI is not set
291 +# CONFIG_HIPPI is not set
293 +# CONFIG_PPP_MULTILINK is not set
295 +# CONFIG_PPP_SYNC_TTY is not set
296 +CONFIG_PPP_DEFLATE=m
297 +CONFIG_PPP_BSDCOMP=m
298 +# CONFIG_PPPOE is not set
299 +# CONFIG_SLIP is not set
302 +# Wireless LAN (non-hamradio)
304 +# CONFIG_NET_RADIO is not set
307 +# Token Ring devices
309 +# CONFIG_TR is not set
310 +# CONFIG_NET_FC is not set
311 +# CONFIG_RCPCI is not set
312 +# CONFIG_SHAPER is not set
317 +# CONFIG_WAN is not set
320 +# PCMCIA network device support
323 +CONFIG_PCMCIA_3C589=m
324 +CONFIG_PCMCIA_3C574=m
325 +CONFIG_PCMCIA_FMVJ18X=m
326 +CONFIG_PCMCIA_PCNET=m
327 +CONFIG_PCMCIA_NMCLAN=m
328 +CONFIG_PCMCIA_SMC91C92=m
329 +CONFIG_PCMCIA_XIRC2PS=m
330 +# CONFIG_NET_PCMCIA_RADIO is not set
333 +# Amateur Radio support
335 +# CONFIG_HAMRADIO is not set
338 +# IrDA (infrared) support
349 +CONFIG_IRDA_OPTIONS=y
354 +CONFIG_IRDA_CACHE_LAST_LSAP=y
355 +CONFIG_IRDA_FAST_RR=y
359 +# Infrared-port device drivers
363 +# SIR device drivers
365 +# CONFIG_IRTTY_SIR is not set
366 +# CONFIG_IRPORT_SIR is not set
369 +# FIR device drivers
371 +# CONFIG_NSC_FIR is not set
372 +# CONFIG_WINBOND_FIR is not set
373 +# CONFIG_TOSHIBA_FIR is not set
374 +# CONFIG_SMC_IRCC_FIR is not set
380 +# CONFIG_DONGLE is not set
383 +# ATA/IDE/MFM/RLL support
388 +# IDE, ATA and ATAPI Block devices
390 +CONFIG_BLK_DEV_IDE=m
393 +# Please see Documentation/ide.txt for help/info on IDE drives
395 +# CONFIG_BLK_DEV_HD_IDE is not set
396 +# CONFIG_BLK_DEV_HD is not set
397 +CONFIG_BLK_DEV_IDEDISK=m
398 +# CONFIG_IDEDISK_MULTI_MODE is not set
399 +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
400 +# CONFIG_BLK_DEV_COMMERIAL is not set
401 +CONFIG_BLK_DEV_IDECS=m
402 +CONFIG_BLK_DEV_IDECD=m
403 +CONFIG_BLK_DEV_IDETAPE=m
404 +CONFIG_BLK_DEV_IDEFLOPPY=m
407 +# IDE chipset support/bugfixes
409 +# CONFIG_BLK_DEV_CMD640 is not set
410 +# CONFIG_IDE_CHIPSETS is not set
411 +# CONFIG_IDEDMA_AUTO is not set
412 +# CONFIG_DMA_NONPCI is not set
413 +# CONFIG_BLK_DEV_IDE_MODES is not set
418 +# CONFIG_SCSI is not set
421 +# I2O device support
423 +# CONFIG_I2O is not set
428 +# CONFIG_ISDN is not set
431 +# Input core support
433 +# CONFIG_INPUT is not set
440 +CONFIG_SERIAL_SA1100=y
441 +CONFIG_SERIAL_SA1100_CONSOLE=y
442 +CONFIG_SA1100_DEFAULT_BAUDRATE=38400
443 +CONFIG_TOUCHSCREEN_BITSY=m
444 +CONFIG_H3600_SLEEVE=m
446 +# CONFIG_SERIAL_EXTENDED is not set
447 +# CONFIG_SERIAL_NONSTANDARD is not set
449 +CONFIG_SERIAL_CORE=y
450 +CONFIG_SERIAL_CORE_CONSOLE=y
451 +CONFIG_UNIX98_PTYS=y
452 +CONFIG_UNIX98_PTY_COUNT=32
457 +# CONFIG_I2C is not set
462 +# CONFIG_BUSMOUSE is not set
464 +# CONFIG_PSMOUSE is not set
465 +# CONFIG_82C710_MOUSE is not set
466 +# CONFIG_PC110_PAD is not set
477 +# Gameport joysticks
481 +# Serial port support
485 +# Serial port joysticks
489 +# Parallel port joysticks
493 +# Parport support is needed for parallel port joysticks
495 +# CONFIG_QIC02_TAPE is not set
500 +# CONFIG_WATCHDOG is not set
501 +# CONFIG_NVRAM is not set
502 +# CONFIG_RTC is not set
504 +# CONFIG_DTLK is not set
505 +# CONFIG_R3964 is not set
506 +# CONFIG_APPLICOM is not set
509 +# Ftape, the floppy tape device driver
511 +# CONFIG_FTAPE is not set
512 +# CONFIG_AGP is not set
513 +# CONFIG_DRM is not set
514 +CONFIG_PCMCIA_SERIAL=m
517 +# PCMCIA character device support
519 +CONFIG_PCMCIA_SERIAL_CS=m
522 +# Multimedia devices
524 +# CONFIG_VIDEO_DEV is not set
529 +# CONFIG_QUOTA is not set
530 +# CONFIG_AUTOFS_FS is not set
531 +# CONFIG_AUTOFS4_FS is not set
532 +# CONFIG_REISERFS_FS is not set
533 +# CONFIG_ADFS_FS is not set
534 +# CONFIG_AFFS_FS is not set
535 +# CONFIG_HFS_FS is not set
536 +# CONFIG_BFS_FS is not set
538 +# CONFIG_MSDOS_FS is not set
540 +# CONFIG_EFS_FS is not set
541 +# CONFIG_JFFS_FS is not set
543 +CONFIG_JFFS2_FS_DEBUG=1
546 +# CONFIG_ISO9660_FS is not set
547 +# CONFIG_MINIX_FS is not set
548 +# CONFIG_NTFS_FS is not set
549 +# CONFIG_HPFS_FS is not set
552 +# CONFIG_DEVFS_MOUNT is not set
553 +# CONFIG_DEVFS_DEBUG is not set
555 +# CONFIG_QNX4FS_FS is not set
556 +# CONFIG_ROMFS_FS is not set
558 +# CONFIG_SYSV_FS is not set
559 +# CONFIG_UDF_FS is not set
560 +# CONFIG_UFS_FS is not set
563 +# Network File Systems
565 +# CONFIG_CODA_FS is not set
567 +# CONFIG_NFS_V3 is not set
568 +# CONFIG_NFSD is not set
572 +# CONFIG_SMB_NLS_DEFAULT is not set
573 +# CONFIG_NCP_FS is not set
578 +# CONFIG_PARTITION_ADVANCED is not set
579 +CONFIG_MSDOS_PARTITION=y
584 +# Native Language Support
586 +CONFIG_NLS_DEFAULT="iso8859-1"
587 +# CONFIG_NLS_CODEPAGE_437 is not set
588 +# CONFIG_NLS_CODEPAGE_737 is not set
589 +# CONFIG_NLS_CODEPAGE_775 is not set
590 +# CONFIG_NLS_CODEPAGE_850 is not set
591 +# CONFIG_NLS_CODEPAGE_852 is not set
592 +# CONFIG_NLS_CODEPAGE_855 is not set
593 +# CONFIG_NLS_CODEPAGE_857 is not set
594 +# CONFIG_NLS_CODEPAGE_860 is not set
595 +# CONFIG_NLS_CODEPAGE_861 is not set
596 +# CONFIG_NLS_CODEPAGE_862 is not set
597 +# CONFIG_NLS_CODEPAGE_863 is not set
598 +# CONFIG_NLS_CODEPAGE_864 is not set
599 +# CONFIG_NLS_CODEPAGE_865 is not set
600 +# CONFIG_NLS_CODEPAGE_866 is not set
601 +# CONFIG_NLS_CODEPAGE_869 is not set
602 +# CONFIG_NLS_CODEPAGE_874 is not set
603 +# CONFIG_NLS_CODEPAGE_932 is not set
604 +# CONFIG_NLS_CODEPAGE_936 is not set
605 +# CONFIG_NLS_CODEPAGE_949 is not set
606 +# CONFIG_NLS_CODEPAGE_950 is not set
607 +# CONFIG_NLS_ISO8859_1 is not set
608 +# CONFIG_NLS_ISO8859_2 is not set
609 +# CONFIG_NLS_ISO8859_3 is not set
610 +# CONFIG_NLS_ISO8859_4 is not set
611 +# CONFIG_NLS_ISO8859_5 is not set
612 +# CONFIG_NLS_ISO8859_6 is not set
613 +# CONFIG_NLS_ISO8859_7 is not set
614 +# CONFIG_NLS_ISO8859_8 is not set
615 +# CONFIG_NLS_ISO8859_9 is not set
616 +# CONFIG_NLS_ISO8859_14 is not set
617 +# CONFIG_NLS_ISO8859_15 is not set
618 +# CONFIG_NLS_KOI8_R is not set
619 +# CONFIG_NLS_UTF8 is not set
625 +# CONFIG_VGA_CONSOLE is not set
629 +# Frame-buffer support
632 +CONFIG_DUMMY_CONSOLE=y
634 +# CONFIG_FB_VIRTUAL is not set
635 +CONFIG_FBCON_ADVANCED=y
636 +# CONFIG_FBCON_MFB is not set
637 +# CONFIG_FBCON_CFB2 is not set
638 +# CONFIG_FBCON_CFB4 is not set
639 +# CONFIG_FBCON_CFB8 is not set
640 +CONFIG_FBCON_CFB16=y
641 +# CONFIG_FBCON_CFB24 is not set
642 +# CONFIG_FBCON_CFB32 is not set
643 +# CONFIG_FBCON_AFB is not set
644 +# CONFIG_FBCON_ILBM is not set
645 +# CONFIG_FBCON_IPLAN2P2 is not set
646 +# CONFIG_FBCON_IPLAN2P4 is not set
647 +# CONFIG_FBCON_IPLAN2P8 is not set
648 +# CONFIG_FBCON_MAC is not set
649 +# CONFIG_FBCON_VGA_PLANES is not set
650 +# CONFIG_FBCON_VGA is not set
651 +# CONFIG_FBCON_HGA is not set
652 +CONFIG_FBCON_FONTWIDTH8_ONLY=y
653 +CONFIG_FBCON_FONTS=y
655 +# CONFIG_FONT_8x16 is not set
656 +# CONFIG_FONT_SUN8x16 is not set
657 +# CONFIG_FONT_PEARL_8x8 is not set
658 +# CONFIG_FONT_ACORN_8x8 is not set
664 +CONFIG_SOUND_UDA1341=m
665 +# CONFIG_SOUND_SA1100_SSP is not set
666 +# CONFIG_SOUND_CMPCI is not set
667 +# CONFIG_SOUND_EMU10K1 is not set
668 +# CONFIG_SOUND_FUSION is not set
669 +# CONFIG_SOUND_CS4281 is not set
670 +# CONFIG_SOUND_ES1370 is not set
671 +# CONFIG_SOUND_ES1371 is not set
672 +# CONFIG_SOUND_ESSSOLO1 is not set
673 +# CONFIG_SOUND_MAESTRO is not set
674 +# CONFIG_SOUND_SONICVIBES is not set
675 +# CONFIG_SOUND_TRIDENT is not set
676 +# CONFIG_SOUND_MSNDCLAS is not set
677 +# CONFIG_SOUND_MSNDPIN is not set
678 +# CONFIG_SOUND_OSS is not set
683 +# CONFIG_USB is not set
688 +# CONFIG_NO_FRAME_POINTER is not set
689 +# CONFIG_DEBUG_ERRORS is not set
690 +# CONFIG_DEBUG_USER is not set
691 +# CONFIG_DEBUG_INFO is not set
692 +# CONFIG_MAGIC_SYSRQ is not set
693 +# CONFIG_DEBUG_LL is not set
694 diff -uNr --exclude=.*flags --exclude=*.[ao] --exclude=.*depend /work2/iPAQ/HandHelds.org/cvs/linux/kernel/drivers/mtd/Makefile ./drivers/mtd/Makefile
695 --- /work2/iPAQ/HandHelds.org/cvs/linux/kernel/drivers/mtd/Makefile Thu Mar 22 20:04:59 2001
696 +++ ./drivers/mtd/Makefile Fri Mar 23 05:26:31 2001
698 obj-$(CONFIG_MTD_SC520CDP) += sc520cdp.o
699 obj-$(CONFIG_MTD_SBC_MEDIAGX) += sbc_mediagx.o mtdpart.o
700 obj-$(CONFIG_MTD_ELAN_104NC) += elan-104nc.o mtdpart.o
701 -obj-$(CONFIG_MTD_SA1100) += sa1100-flash.o mtdpart.o
702 +obj-$(CONFIG_MTD_SA1100) += sa1100-flash.o mtdpart.o redboot.o
703 obj-$(CONFIG_MTD_DC21285) += dc21285.o mtdpart.o
704 obj-$(CONFIG_MTD_IQ80310) += iq80310.o mtdpart.o
706 diff -uNr --exclude=.*flags --exclude=*.[ao] --exclude=.*depend /work2/iPAQ/HandHelds.org/cvs/linux/kernel/drivers/mtd/sa1100-flash.c ./drivers/mtd/sa1100-flash.c
707 --- /work2/iPAQ/HandHelds.org/cvs/linux/kernel/drivers/mtd/sa1100-flash.c Thu Mar 22 20:05:13 2001
708 +++ ./drivers/mtd/sa1100-flash.c Fri Mar 23 20:06:24 2001
710 #define NB_OF(x) (sizeof(x)/sizeof(x[0]))
712 static struct mtd_info *mymtd;
713 +extern int parse_redboot_partitions(struct mtd_info *master, struct mtd_partition **pparts);
715 int __init sa1100_mtd_init(void)
717 @@ -485,14 +486,36 @@
720 mymtd = do_cfi_probe(&sa1100_map);
722 - mymtd->module = THIS_MODULE;
723 - add_mtd_partitions(mymtd, parts, nb_parts);
724 - printk(KERN_NOTICE "SA1100 flash access initialized\n");
730 +#define CONFIG_SA1100_REDBOOT_PARTITIONS
731 +#ifdef CONFIG_SA1100_REDBOOT_PARTITIONS
733 + int redboot_nr_parts;
734 + struct mtd_partitions *redboot_parts;
737 + redboot_nr_parts = parse_redboot_partitions(mymtd, &redboot_parts);
738 + if (nb_parts > 0) {
741 + parts = redboot_parts;
742 + nb_parts = redboot_nr_parts;
743 + for (i=0; i<nb_parts; i++) {
744 + printk("RedBoot Partition: \"%s\", 0x%08lx-0x%08lx\n", parts[i].name, parts[i].offset, parts[i].offset+parts[i].size);
753 + mymtd->module = THIS_MODULE;
754 + add_mtd_partitions(mymtd, parts, nb_parts);
755 + printk(KERN_NOTICE "SA1100 flash access initialized\n");
759 static void __exit sa1100_mtd_cleanup(void)
760 diff -uNr /work2/iPAQ/HandHelds.org/cvs/linux/kernel/drivers/mtd/redboot.c drivers/mtd/redboot.c
761 --- /work2/iPAQ/HandHelds.org/cvs/linux/kernel/drivers/mtd/redboot.c Wed Dec 31 17:00:00 1969
762 +++ drivers/mtd/redboot.c Fri Mar 23 20:11:37 2001
765 + * $Id: redboot.c,v 1.2 2001/03/14 13:19:47 dwmw2 Exp $
767 + * Parse RedBoot-style Flash Image System (FIS) tables and
768 + * produce a Linux partition array to match.
771 +#include <linux/kernel.h>
772 +#include <linux/slab.h>
774 +#include <linux/mtd/mtd.h>
775 +#include <linux/mtd/partitions.h>
777 +struct fis_image_desc {
778 + unsigned char name[16]; // Null terminated name
779 + unsigned long flash_base; // Address within FLASH of image
780 + unsigned long mem_base; // Address in memory where it executes
781 + unsigned long size; // Length of image
782 + unsigned long entry_point; // Execution entry point
783 + unsigned long data_length; // Length of actual data
784 + unsigned char _pad[256-(16+7*sizeof(unsigned long))];
785 + unsigned long desc_cksum; // Checksum over image descriptor
786 + unsigned long file_cksum; // Checksum over image data
790 + struct fis_image_desc *img;
791 + struct fis_list *next;
794 +static inline int redboot_checksum(struct fis_image_desc *img)
796 + /* RedBoot doesn't actually write the desc_cksum field yet AFAICT */
800 +int parse_redboot_partitions(struct mtd_info *master, struct mtd_partition **pparts)
803 + struct fis_image_desc *buf;
804 + struct mtd_partition *parts;
805 + struct fis_list *fl = NULL, *tmp_fl;
811 + buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
816 + /* Read the start of the last erase block */
817 + ret = master->read(master, master->size - master->erasesize,
818 + PAGE_SIZE, &retlen, (void *)buf);
823 + if (retlen != PAGE_SIZE) {
828 + if (memcmp(buf, "RedBoot", 8)) {
833 + for (i = 0; i < PAGE_SIZE / sizeof(struct fis_image_desc); i++) {
834 + struct fis_list *new_fl, **prev;
836 + if (buf[i].name[0] == 0xff)
838 + if (!redboot_checksum(&buf[i]))
841 + new_fl = kmalloc(sizeof(struct fis_list), GFP_KERNEL);
842 + namelen += strlen(buf[i].name)+1;
847 + new_fl->img = &buf[i];
848 + buf[i].flash_base &= master->size-1;
850 + /* I'm sure the JFFS2 code has done me permanent damage.
851 + * I now think the following is _normal_
854 + while(*prev && (*prev)->img->flash_base < new_fl->img->flash_base)
855 + prev = &(*prev)->next;
856 + new_fl->next = *prev;
861 + if (fl->img->flash_base)
864 + for (tmp_fl = fl; tmp_fl->next; tmp_fl = tmp_fl->next) {
865 + if (tmp_fl->img->flash_base + tmp_fl->img->size + master->erasesize < tmp_fl->next->img->flash_base)
868 + parts = kmalloc(sizeof(*parts)*nrparts + namelen, GFP_KERNEL);
874 + names = &parts[nrparts];
875 + memset(parts, 0, sizeof(*parts)*nrparts + namelen);
878 + if (fl->img->flash_base) {
879 + parts[0].name = "unallocated space";
880 + parts[0].size = fl->img->flash_base;
881 + parts[0].offset = 0;
883 + for ( ; i<nrparts; i++) {
884 + parts[i].size = fl->img->size;
885 + parts[i].offset = fl->img->flash_base;
886 + parts[i].name = names;
888 + strcpy(names, fl->img->name);
889 + names += strlen(names)+1;
891 + if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize < fl->next->img->flash_base) {
893 + parts[i].offset = parts[i-1].size + parts[i-1].offset;
894 + parts[i].size = fl->next->img->flash_base - parts[i].offset;
895 + parts[i].name = "unallocated space";
905 + struct fis_list *old = fl;