<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.3">
</HEAD>
<BODY>
<BR>
Il giorno mer, 02/04/2008 alle 14.57 -0700, Avinash Vijayvergia ha scritto:
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Hi Luigi</FONT><BR>
<BR>
<FONT COLOR="#000000">Thank you for your mail and comments. I should have explain why I want to compress u-boot. My target processor is Atmel AT91SAM9260. I am having a 64Mb Dataflash which is interfaced on SPI bus. The Atmel ARM9 copies the first 4kB to internal SRAM and then boots from there. So we need a loader of size <4kb which will be copied to SRAM. I have got this loader. This loader will invoke u-boot, and u-boot will invoke kernel. So I can compress loader and it will still work.</FONT><BR>
<BR>
<FONT COLOR="#000000">I'll compare nrv2b and lzma and then will be in a better position to comment. I chose nrv2b because I need a compression algo which can be as small as 600B (I have size restriction of 4kB).</FONT><BR>
<BR>
</BLOCKQUOTE>
<BR>
Ok. Now I understand the problem. U-boot is a pure binary file, you need to compile it fixing the TEXT_BASE address in order to fit your RAM. Your "pre-bootloader" should setup the ram and the dataflash in order to decompress/copy u-boot (vetctors+text+data) from the dataflash space addresses to the ram addresses. After the copy/decompress just jump to u-boot address. To achieve this you needn't to know the u-boot header structure.<BR>
You should analyze the board/atmel/at91rm9200dk/u-boot.lds and cpu/arm920t/start.S files to understand how u-boot works (at initialization time).<BR>
<BR>
Best regards,<BR>
<BR>
luigi<BR>
<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Thanks</FONT><BR>
<FONT COLOR="#000000">Avinash</FONT><BR>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">----- Original Message ----</FONT><BR>
<FONT COLOR="#000000">From: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com></FONT><BR>
<FONT COLOR="#000000">To: Avinash Vijayvergia <avinashs36@yahoo.com></FONT><BR>
<FONT COLOR="#000000">Cc: u-boot-users@lists.sourceforge.net</FONT><BR>
<FONT COLOR="#000000">Sent: Wednesday, April 2, 2008 2:37:20 PM</FONT><BR>
<FONT COLOR="#000000">Subject: Re: [U-Boot-Users] help - u-boot header & compression</FONT><BR>
<BR>
<FONT COLOR="#000000">Hi Avinash,</FONT><BR>
<BR>
<FONT COLOR="#000000">see inline.</FONT><BR>
<BR>
<FONT COLOR="#000000">Il giorno mer, 02/04/2008 alle 14.26 -0700, Avinash Vijayvergia ha scritto: </FONT><BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Hi Luig</FONT><FONT COLOR="#000000"><B>I</B></FONT><BR>
<BR>
</BLOCKQUOTE>
<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Thank you for your mail. I actually have two questions: </FONT>
<OL TYPE=1>
<LI TYPE=1 VALUE=1><FONT COLOR="#000000">What is the format of u-boot header? Can you refer me to some documentation? </FONT>
</OL>
</BLOCKQUOTE>
<BR>
<FONT COLOR="#000000">What do you intend for "u-boot header"? U-boot uses the uImage format for the kernels images. You can check the file include/image.h (row 175) to understand the (old) uImage format. See this link: </FONT><BR>
<FONT COLOR="#000000"><A HREF="http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=include/image.h;h=36143e25acfe3684a751a4ee6a5cf945524ef424;hb=74d1e66d22dac91388bc538b2fe19f735edc5b82">http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=include/image.h;h=36143e25acfe3684a751a4ee6a5cf945524ef424;hb=74d1e66d22dac91388bc538b2fe19f735edc5b82</A></FONT><BR>
<BR>
<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<OL TYPE=1>
<LI TYPE=1 VALUE=1><FONT COLOR="#000000">I want to compress u-boot. I have picked up nrv2b.c from <A HREF="http://Koders.com">Koders.com</A> which is in use by many people :). I couldn't understand how it does encoding and decoding. I wanted to use this algo and do compression and decompression of my binaries. You can search google for nrv2b.c and you will get it from <A HREF="http://Koder.com">Koder.com</A>. </FONT>
</OL>
</BLOCKQUOTE>
<BR>
<FONT COLOR="#000000">U-boot is the object code, the bootloader... how can you compress it? it is a non-sense for me. Anyway, if you need to compress the kernel image, you need to use the uImage format and the utility mkimage (see tools directory). I recently posted a patch to support the lzma compression algorithm (that works better than bzip2 and gzip): you can search in the mailing list archive to retrieve this patch.</FONT><BR>
<BR>
<FONT COLOR="#000000">Are you sure that nrv2b is better than powerful lzma or bzip2? Do you have benchmarks on this point? If you demonstrate me that nrv2b is a good choice I can consider to make the patch for the community... I have an application that has a very small flash memory... nrv2b should be a choice...</FONT><BR>
<BR>
<FONT COLOR="#000000">Best regards,</FONT><BR>
<BR>
<FONT COLOR="#000000">luigi</FONT><BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Thanks for your help</FONT><BR>
<FONT COLOR="#000000">Avinash</FONT><BR>
<BR>
<FONT COLOR="#000000">----- Original Message ----</FONT><BR>
<FONT COLOR="#000000">From: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com></FONT><BR>
<FONT COLOR="#000000">To: Avinash Vijayvergia <avinashs36@yahoo.com></FONT><BR>
<FONT COLOR="#000000">Cc: u-boot-users@lists.sourceforge.net</FONT><BR>
<FONT COLOR="#000000">Sent: Wednesday, April 2, 2008 2:19:36 PM</FONT><BR>
<FONT COLOR="#000000">Subject: Re: [U-Boot-Users] help - u-boot header & compression</FONT><BR>
<BR>
<FONT COLOR="#000000">Hi Avinash,</FONT><BR>
<BR>
<FONT COLOR="#000000">I'm not undestanding if you want compress the U-Boot code or if you want compress the uImage image.</FONT><BR>
<FONT COLOR="#000000">Anyway, I don't know the nrv2b algorithm, can you give me any links?</FONT><BR>
<BR>
<FONT COLOR="#000000">thanks,</FONT><BR>
<BR>
<FONT COLOR="#000000">luigi</FONT><BR>
<BR>
<FONT COLOR="#000000">Il giorno mer, 02/04/2008 alle 13.54 -0700, Avinash Vijayvergia ha scritto: </FONT><BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Hi All</FONT><BR>
<BR>
<FONT COLOR="#000000">I am working on AT91SAM9260 ARM9 core. I have very small flash memory and hence need to compress the u-boot. I have picked nrv2b algo for that. Can someone suggest me how to put the compression info in the u-boot header. I want to know the details of u-boot header too.</FONT><BR>
<BR>
<FONT COLOR="#000000">Thanks</FONT><BR>
<FONT COLOR="#000000">Avinash</FONT><BR>
<BR>
<HR SIZE="1">
<BR>
<BR>
<BR>
<FONT COLOR="#000000">You rock. That's why Blockbuster's offering you <A HREF="http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com">one month of Blockbuster Total Access</A>, No Cost. </FONT>
<PRE>
<FONT COLOR="#000000">-------------------------------------------------------------------------</FONT>
<FONT COLOR="#000000">Check out the new <A HREF="http://SourceForge.net">SourceForge.net</A> Marketplace.</FONT>
<FONT COLOR="#000000">It's the best place to buy or sell services for</FONT>
<FONT COLOR="#000000">just about anything Open Source.</FONT>
<FONT COLOR="#000000"><A HREF="http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace">http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace</A></FONT>
<FONT COLOR="#000000">_______________________________________________ U-Boot-Users mailing list <A HREF="mailto:U-Boot-Users@lists.sourceforge.net">U-Boot-Users@lists.sourceforge.net</A> <A HREF="https://lists.sourceforge.net/lists/listinfo/u-boot-users">https://lists.sourceforge.net/lists/listinfo/u-boot-users</A></FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<TABLE CELLSPACING="9" CELLPADDING="0">
<TR>
<TD>
<BR>
<BR>
</TD>
<TD>
<B>Ing. Luigi Mantellini</B><BR>
Industrie Dial Face S.p.A.<BR>
Via Canzo, 4 <BR>
20068 Peschiera Borromeo (MI)<BR>
Tel.: +39 02 5167 2813<BR>
Fax: +39 02 5167 2459<BR>
E-mail: <A HREF="mailto:luigi.mantellini@idf-hit.com">luigi.mantellini@idf-hit.com</A>
</TD>
</TR>
</TABLE>
<BR>
<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
<BR>
<BR>
<BR>
<HR SIZE="1">
<BR>
<BR>
<FONT COLOR="#000000">You rock. That's why Blockbuster's offering you <A HREF="http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com">one month of Blockbuster Total Access</A>, No Cost.</FONT><BR>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<TABLE CELLSPACING="9" CELLPADDING="0">
<TR>
<TD>
<BR>
</TD>
<TD>
<B>Ing. Luigi Mantellini</B><BR>
Industrie Dial Face S.p.A.<BR>
Via Canzo, 4 <BR>
20068 Peschiera Borromeo (MI)<BR>
Tel.: +39 02 5167 2813<BR>
Fax: +39 02 5167 2459<BR>
E-mail: <A HREF="mailto:luigi.mantellini@idf-hit.com">luigi.mantellini@idf-hit.com</A>
</TD>
</TR>
</TABLE>
<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
<HR SIZE="1">
<BR>
<FONT COLOR="#000000">You rock. That's why Blockbuster's offering you <A HREF="http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com">one month of Blockbuster Total Access</A>, No Cost.</FONT><BR>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<TABLE CELLSPACING="9" CELLPADDING="0">
<TR>
<TD>
<A HREF="http://www.idf-hit.com"><IMG SRC="file:///home/comio/Desktop/IDF/indDialFace_pulito.gif" ALIGN="bottom" BORDER="0"></A>
</TD>
<TD>
<B>Ing. Luigi Mantellini</B><BR>
Industrie Dial Face S.p.A.<BR>
Via Canzo, 4 <BR>
20068 Peschiera Borromeo (MI)<BR>
Tel.: +39 02 5167 2813<BR>
Fax: +39 02 5167 2459<BR>
E-mail: <A HREF="mailto:luigi.mantellini@idf-hit.com">luigi.mantellini@idf-hit.com</A>
</TD>
</TR>
</TABLE>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>