Received: from [82.119.242.94] (helo=mail.suse.cz) by linuxtogo.org with esmtp (Exim 4.69) (envelope-from ) id 1LNo0L-0000TG-Ng for openembedded-devel@lists.openembedded.org; Fri, 16 Jan 2009 13:40:53 +0100 Received: from [10.20.1.86] (hammer.suse.cz [10.20.1.86]) by mail.suse.cz (Postfix) with ESMTP id 7F79662805D for ; Fri, 16 Jan 2009 13:34:10 +0100 (CET) From: Stanislav Brabec To: openembedded-devel@lists.openembedded.org In-Reply-To: References: Date: Fri, 16 Jan 2009 13:34:09 +0100 Message-Id: <1232109249.4988.2686.camel@hammer.suse.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1.1 Subject: Re: ARM bootloaders (Zaurus) and CMDLINE X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: openembedded-devel@lists.openembedded.org List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 12:40:54 -0000 Content-Type: text/plain Content-Transfer-Encoding: 7bit Andrea Adami wrote: > Other solution would be a raw read of the nand addresses and a > subsequent edit of the CMDLINE params passed by the kexecboot kernel > to the launched kernel. This is not as raw as it sounds. It is stored in the configuration area of the NAND. There is a command nandlogical (package survive), which is able to read these values. Some time ago I tried to decode these areas. It would solve not only this problem, but also differentiating between SL-C3100 and SL-C3200, which have different NAND partitioning, but no other significant differences, and finally create flashing utility, which would create correct checksums (now NAND diag checks fail). Flexible part of the command line is stored in Model array, offset 0x1000 (starting by "EQUIPMENT"). Fixed part is probably generated by the bootloader, using partition info in PartitionInfo* records. console=ttyS0 root=/dev/mtdblock2 mtdparts=sharpsl-nand:7168k@0k(smf),44032k@7168k(root),-(home) jffs2_orphaned_inodes=delete EQUIPMENT=5 LOGOLANG=1 DEFYEAR=2007 LOGO=1 LAUNCH=q #!/bin/sh nandcfg() { ./nandlogical /dev/mtd0 READ $1 0x4000 nanddecode.$2 } nandcfg 0x00040000 AdjValue nandcfg 0x00044000 BootFlag nandcfg 0x00048000 Version nandcfg 0x0004c000 Clock nandcfg 0x00050000 ROMount nandcfg 0x00054000 RWMount nandcfg 0x00058000 RSV_58 nandcfg 0x0005c000 RSV_5C nandcfg 0x00060000 PartitionInfo1 nandcfg 0x00064000 PartitionInfo2 nandcfg 0x00068000 Model nandcfg 0x0006c000 RSV_6C nandcfg 0x00070000 MVersion nandcfg 0x00074000 RSV_74 nandcfg 0x00078000 RSV_78 --- nandlogical.c 2006-06-09 17:06:48.000000000 +0200 +++ nandlogical.c 2008-04-30 00:26:26.000000000 +0200 @@ -135,7 +135,7 @@ oob.start = offset; ret = ioctl(fd, MEMREADOOB, &oob); - //ret = nand_read_raw(nand, oobuf, offset, nand->oobblock, nand->oobsize); + //ret = nand_read_raw(nand, oobuf, offset, nand->writesize, nand->oobsize); if (!ret) { int log_no = nand_get_logical_no(oobbuf); if (((int)log_no >= 0) && (log_no < blocks)) { @@ -276,20 +276,20 @@ } /* Make sure device page sizes are valid */ - if (!(meminfo.oobsize == 64 && meminfo.oobblock == 2048) && - !(meminfo.oobsize == 16 && meminfo.oobblock == 512) && - !(meminfo.oobsize == 8 && meminfo.oobblock == 256)) { + if (!(meminfo.oobsize == 64 && meminfo.writesize == 2048) && + !(meminfo.oobsize == 16 && meminfo.writesize == 512) && + !(meminfo.oobsize == 8 && meminfo.writesize == 256)) { fprintf(stderr, "Unknown flash (not normal NAND)\n"); close(fd); exit(1); } - //printf("erasesize %x\noobblock %x\noobsize %x\nsize %x\n", meminfo.erasesize, meminfo.oobblock, meminfo.oobsize, meminfo.size); + //printf("erasesize %x\nwritesize %x\noobsize %x\nsize %x\n", meminfo.erasesize, meminfo.writesize, meminfo.oobsize, meminfo.size); blocks = NAND_LOGICAL_SIZE / meminfo.erasesize; log2phy = (unsigned long *) malloc(blocks * sizeof(unsigned long)); readbuf = (char *)malloc(meminfo.erasesize); - oobbuf = (char *)malloc(meminfo.oobblock); + oobbuf = (char *)malloc(meminfo.writesize); oob.ptr = oobbuf; scan_logical(blocks, meminfo.erasesize); @@ -297,7 +297,7 @@ //printf("Start: %x\nEnd: %x\n", start_addr, length); end_addr = start_addr + length; - bs = meminfo.oobblock; + bs = meminfo.writesize; for (ofs = start_addr; ofs < end_addr ; ofs+=bs) { int new_logical_added = 0; Stanislav Brabec http://www.penguin.cz/~utx/zaurus