From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SxBT1-0008Fo-42 for barebox@lists.infradead.org; Fri, 03 Aug 2012 06:34:35 +0000 Date: Fri, 3 Aug 2012 08:34:33 +0200 From: Sascha Hauer Message-ID: <20120803063433.GH1451@pengutronix.de> References: <20120730100022.GD19759@game.jcrosoft.org> <1343642565-32257-1-git-send-email-plagnioj@jcrosoft.com> <1343642565-32257-5-git-send-email-plagnioj@jcrosoft.com> <20120802153032.GE1451@pengutronix.de> <20120802153422.GL19759@game.jcrosoft.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120802153422.GL19759@game.jcrosoft.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 05/12] Add compressed image support To: Jean-Christophe PLAGNIOL-VILLARD Cc: barebox@lists.infradead.org On Thu, Aug 02, 2012 at 05:34:22PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 17:30 Thu 02 Aug , Sascha Hauer wrote: > > On Mon, Jul 30, 2012 at 12:02:38PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > From: Sascha Hauer > > > + > > > void barebox_pbl(uint32_t offset) > > > { > > > + uint32_t compressed_start, compressed_end, len; > > > + void (*uncompress)(void *compressed_start, unsigned int len); > > > + > > > + compressed_start = (uint32_t)&input_data - offset; > > > + compressed_end = (uint32_t)&input_data_end - offset; > > > + len = compressed_end - compressed_start; > > > + > > > + /* > > > + * Check if the compressed binary will be overwritten > > > + * by the uncompressed binary > > > + */ > > > + if (compressed_start >= TEXT_BASE && > > > + compressed_start < TEXT_BASE + len * 4 ) { > > > + /* > > > + * copy compressed binary to its link address > > > + */ > > > + memcpy(&input_data, (void *)compressed_start, len); > > > + compressed_start = (uint32_t)&input_data; > > > + } > > > + > > > + uncompress = barebox_uncompress; > > > + > > > + /* call barebox_uncompress with its absolute address */ > > > + __asm__ __volatile__( > > > + "mov r0, %1\n" > > > + "mov r1, %2\n" > > > + "mov pc, %0\n" > > > + : > > > + : "r"(uncompress), "r"(compressed_start), "r"(len) > > > + : "r0", "r1"); > > > > When the pbl code runs at its correct address, then we can simply do a > > barebox_uncompress() here. > > > > Fixed this before applying. > the code in start does not do this > > we just do a call to barebox_pbl See my other mails to the other patches. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox