Date: Mon, 29 Jul 2013 10:49:02 -0700 From: hiren panchasara <hiren.panchasara@gmail.com> To: Aleksandr Rybalko <ray@ddteam.net>, Adrian Chadd <adrian@freebsd.org> Cc: freebsd-embedded <freebsd-embedded@freebsd.org> Subject: Re: Making Picostation m2HP work Message-ID: <CALCpEUEXGrazTbMUUA5jkarr8vH_a9TU-QUy9=w7TFU8ND8B_Q@mail.gmail.com> In-Reply-To: <20130729151943.70ce473e14d88588337e57ba@ddteam.net> References: <CALCpEUHxqyZb1Y5WqsuxjvwY2Pd_xN2%2BoTgsew0DwdRMC6=5Nw@mail.gmail.com> <CALCpEUE%2BDMq9KYBNZfJLx6DTxAY%2B1gv3uLQ3OtO-N1W1zRKL=Q@mail.gmail.com> <CAJ-VmokNR6VzdG7EC0jpEQN40He%2BUR=Y99dmzakXMfO3ojHjqw@mail.gmail.com> <CALCpEUFiQp-UrZHe9X-zxneQUc9p%2BX1Ojbp0F865a1QTPicp%2Bg@mail.gmail.com> <CALCpEUGbk8mCFqOUp6WxfdcH-kveudG-f4S0muUg4aYy0uqBtA@mail.gmail.com> <CAJ-VmomsSBSs9QumGc6z=aYQ0OUqjGcxBnnsy%2B1NR_F83KUzxg@mail.gmail.com> <CALCpEUG4FR2qugb-ZYHG%2BJ7xcOL34edkPx41yOwU7qK-BynGOw@mail.gmail.com> <CAJ-VmokPNDgkdziRFr3-MnDZudskGb0ykRk9jfY1nWhrxBZEKw@mail.gmail.com> <CAB=2f8yPSSpOZBwOv8Xr5=OtM%2BMq0-h-%2B9-tKTgjR7LvCfX6jQ@mail.gmail.com> <CALCpEUFi6qr8Cox9PpzmkPk69gb0hrhM1vepE81gqot2cVy7tQ@mail.gmail.com> <CAJ-VmonxVF6GQXEZod9XajAK00i9ZP6=s3SSCDEL%2BJR6kgLVWQ@mail.gmail.com> <CALCpEUHEPRDAiCZ2-hFwD1sPPQHqmNVA=E8sJREm5qmB%2BxF5cA@mail.gmail.com> <CAJ-VmokDUhJxN7oWOr0t7T1Zq-Odf43mM9qO%2B5TDyv1DnKAJuQ@mail.gmail.com> <CALCpEUGC1NrWfNZ5%2BfAnbaCvFVpKNCOMZ9Yh6XFYFBqCWehE0Q@mail.gmail.com> <20130729151943.70ce473e14d88588337e57ba@ddteam.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 29, 2013 at 5:19 AM, Aleksandr Rybalko <ray@ddteam.net> wrote: > On Sun, 28 Jul 2013 11:51:09 -0700 > hiren panchasara <hiren.panchasara@gmail.com> wrote: > >> On Fri, Jul 19, 2013 at 12:41 PM, Adrian Chadd <adrian@freebsd.org> wrote: >> > So here's the fun bit: >> > >> > mtdparts=mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),1024k(kernel),5760k(rootfs),256k(cfg),64k(EEPROM) >> > >> > Now, strictly speaking, you don't _have_ to obey the kernel/rootfs >> > split. But the default 'boot' line executes a boot image from the >> > offset in flash where 'kernel' is. >> > >> > What I tend to do, if I can: >> > >> > * leave uboot and uboot-env where they are >> > * kernel is the first partition, good, so start it there but make it >> > 1.5mb so you have a chance in hell of fitting an lzma'ed uboot kernel >> > image in there >> > * you don't need a 256kb cfg partition, only 64k >> > * the last 64k (EEPROM) _MUST NEVER BE OVERWRITTEN_ as it contains the >> > calibration/config data for the wifi chip. >> > >> > So look at an existing hints file with the 'map' entries, and write up >> > a new set of map entries for the agreed flash layout. >> > >> > Once you've done that, post it here for sanity checking. >> Here is the hints file I am using: >> >> # mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),1024k(kernel),6528k(rootfs),256k(cfg),64k(EEPROM) >> >> hint.map.0.at="flash/spi0" >> hint.map.0.start=0x00000000 >> hint.map.0.end=0x00040000 # 256k u-boot >> hint.map.0.name="u-boot" >> hint.map.0.readonly=1 >> >> hint.map.1.at="flash/spi0" >> hint.map.1.start=0x00040000 >> hint.map.1.end=0x00050000 # 64k u-boot-env >> hint.map.1.name="u-boot-env" >> hint.map.1.readonly=1 >> >> hint.map.2.at="flash/spi0" >> hint.map.2.start=0x00050000 >> hint.map.2.end=0x00150000 # 1024k kernel >> hint.map.2.name="kernel" >> hint.map.2.readonly=1 >> >> hint.map.3.at="flash/spi0" >> hint.map.3.start=0x00150000 >> hint.map.3.end=0x006f0000 # 6528k rootfs >> hint.map.3.name="rootfs" >> hint.map.3.readonly=0 >> >> hint.map.4.at="flash/spi0" >> hint.map.4.start=0x006f0000 >> hint.map.4.end=0x00730000 # 256k config >> hint.map.4.name="config" >> hint.map.4.readonly=1 >> >> hint.map.5.at="flash/spi0" >> hint.map.5.start=0x00730000 >> hint.map.5.end=0x00740000 # 64k EEPROM >> hint.map.5.name="art" >> hint.map.5.readonly=1 > > Looks like you have mistake somewhere. Sum of mtd sizes give us 8M, but > last block you define end on 0x00740000, but must be 0x00800000 Thanks for catching that. I've updated that. > > # 256k(u-boot) > start=0x00000000 > end=0x00040000 > # 64k(u-boot-env) > start=0x00040000 > end=0x00050000 > # 1024k(kernel) > start=0x00050000 > end=0x00150000 > # 6528k(rootfs) > start=0x00150000 > end=0x007b0000 > # 256k(cfg) > start=0x007b0000 > end=0x007f0000 > # 64k(EEPROM) > start=0x007f0000 > end=0x00800000 > > Also, to not depend on kernel size limit you can back kernel and rootfs > into single image, but align rootfs offset to block size (64k here) > Than you will be able to replace kernel.end and rootfs.start with > "search" value: > hint.map.2.end="search:0x00100000:0x10000:.!/bin/sh" > hint.map.3.start="search:0x00100000:0x10000:.!/bin/sh" > > In that case geom_map will search for ".!/bin/sh" ("." is single-char > wildcard) starting at offset 0x00100000 (1MB) with 0x10000 (64k) step > til end of media. > > kernel must be packed, but format depend on what is supported by loader. > uboot can be compiled with gzip, bzip2 and lzma support, but every > compressor is optional. > > If everything too bad with loader uncompressor, you can use un-gzip > support in out trampoline. Maybe even extend it with embedded lzma which > already in sys/contrib. I am not completely following you here (as I do not understand very many things :-)) But currently I am trying to use adrian's scripts to generate image. I have following things: 1) AP91.initial.img - filesystem img 6.2M (generated by ubnt-mkfwimage/mkfwimage.c) 2) mfsroot-ap91.img.ulzma - mfsroot img 4.8M 3) kernel.AP91 - the kernel 3.5M Where/how should I load these files? Thanks, Hiren > >> > >> > (Then the next trick will be building a kernel and rootfs image that >> > will fit in those flash partitions.. then you write up a config file >> > for adrian's build scripts that enforce those size limits so you don't >> > generate overly large images, then we do a test erase/flash.) >> >> Kernel that is being generated is of 3.5M. Need to understand how to >> prepare complete image with your scripts. >> >> Thanks a lot, >> Hiren <skip>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALCpEUEXGrazTbMUUA5jkarr8vH_a9TU-QUy9=w7TFU8ND8B_Q>