From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ip2.televic.com ([81.82.194.222]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R3RI5-00079K-Ra for barebox@lists.infradead.org; Tue, 13 Sep 2011 11:36:38 +0000 From: Vanhauwaert Wouter Date: Tue, 13 Sep 2011 13:36:31 +0200 Message-ID: Content-Language: en-US MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0631533623==" Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: tftp to flash from linux To: "barebox@lists.infradead.org" --===============0631533623== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_E78BBE677EB9144B8F0A0A29674CD533489C0CDC8ASRVVS06TELEVI_" --_000_E78BBE677EB9144B8F0A0A29674CD533489C0CDC8ASRVVS06TELEVI_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, To update our platform from within a booted linux, we need tftp to write to= the nand-flash (another partition) directly. Which one do I use? /dev/mtdx or /dev/mtdblockx? And what happens with bad = blocks here? Are these bad-block aware? Grtz --_000_E78BBE677EB9144B8F0A0A29674CD533489C0CDC8ASRVVS06TELEVI_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

To u= pdate our platform from within a booted linux, we need tftp to write to the= nand-flash (another partition) directly.

Which one do I use? /dev/mtdx or /dev/mtdblock= x? And what happens with bad blocks here? Are these bad-block aware?

 

Grtz

<= p class=3DMsoNormal> 

= --_000_E78BBE677EB9144B8F0A0A29674CD533489C0CDC8ASRVVS06TELEVI_-- --===============0631533623== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============0631533623==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from tango.tkos.co.il ([62.219.50.35]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R3RPB-0007BS-JN for barebox@lists.infradead.org; Tue, 13 Sep 2011 11:44:02 +0000 Date: Tue, 13 Sep 2011 14:43:53 +0300 From: Baruch Siach Message-ID: <20110913114353.GA25206@sapphire.tkos.co.il> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: tftp to flash from linux To: Vanhauwaert Wouter Cc: "barebox@lists.infradead.org" Hi Wouter, On Tue, Sep 13, 2011 at 01:36:31PM +0200, Vanhauwaert Wouter wrote: > To update our platform from within a booted linux, we need tftp to write to > the nand-flash (another partition) directly. > Which one do I use? /dev/mtdx or /dev/mtdblockx? And what happens with bad > blocks here? Are these bad-block aware? Use the nandwrite utility from the mtd-utils package (there's also a Busybox version), and /dev/mtdx. baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ip2.televic.com ([81.82.194.222]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R3RVl-0007Da-Sm for barebox@lists.infradead.org; Tue, 13 Sep 2011 11:50:50 +0000 From: Vanhauwaert Wouter Date: Tue, 13 Sep 2011 13:50:42 +0200 Message-ID: References: <20110913114353.GA25206@sapphire.tkos.co.il> In-Reply-To: <20110913114353.GA25206@sapphire.tkos.co.il> Content-Language: en-US MIME-Version: 1.0 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: tftp to flash from linux To: Baruch Siach Cc: "barebox@lists.infradead.org" Hello Baruch, Yes, I already thought that this nandwrite command can be used for writing. But problem is I get the image via tftp and my RAM is to little to store it temporary. So I have to write it directly to flash. Can I combine this nandwrite and tftp in any way? I'm using busybox thanks -----Original Message----- From: Baruch Siach [mailto:baruch@tkos.co.il] Sent: dinsdag 13 september 2011 13:44 To: Vanhauwaert Wouter Cc: barebox@lists.infradead.org Subject: Re: tftp to flash from linux Hi Wouter, On Tue, Sep 13, 2011 at 01:36:31PM +0200, Vanhauwaert Wouter wrote: > To update our platform from within a booted linux, we need tftp to > write to the nand-flash (another partition) directly. > Which one do I use? /dev/mtdx or /dev/mtdblockx? And what happens with > bad blocks here? Are these bad-block aware? Use the nandwrite utility from the mtd-utils package (there's also a Busybox version), and a/dev/mtdx. baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox 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 canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R3Rcl-0007FZ-33 for barebox@lists.infradead.org; Tue, 13 Sep 2011 11:58:04 +0000 Message-ID: <4E6F4542.70408@pengutronix.de> Date: Tue, 13 Sep 2011 13:57:54 +0200 From: Marc Kleine-Budde MIME-Version: 1.0 References: <20110913114353.GA25206@sapphire.tkos.co.il> In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1914375216==" Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: tftp to flash from linux To: Vanhauwaert Wouter Cc: "barebox@lists.infradead.org" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============1914375216== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig6EF7EDAE52FDFBBF074498D3" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6EF7EDAE52FDFBBF074498D3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Vanhauwaert, please don't reply to an existing thread if you start a new topic! On 09/13/2011 01:50 PM, Vanhauwaert Wouter wrote: > Yes, I already thought that this nandwrite command can be used for > writing. But problem is I get the image via tftp and my RAM is to > little to store it temporary. So I have to write it directly to > flash. Can I combine this nandwrite and tftp in any way? I'm using > busybox You need a tftp client that supports writing to stdout and a nandwrite that supports reading from stdin. Than it's the usual tftp $server $file | nandwrite /dev/mtdfoo - You probably need to pad the input file with '-p' cheers, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | --------------enig6EF7EDAE52FDFBBF074498D3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5vRUIACgkQjTAFq1RaXHMnyQCbBtSihlPIH9c0z5AMiUayR29a zSQAn2ln/winhmUUw6RDe/F2uQtzYF7D =fG8e -----END PGP SIGNATURE----- --------------enig6EF7EDAE52FDFBBF074498D3-- --===============1914375216== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============1914375216==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from tango.tkos.co.il ([62.219.50.35]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R3Rhg-0007N8-Km for barebox@lists.infradead.org; Tue, 13 Sep 2011 12:03:09 +0000 Date: Tue, 13 Sep 2011 15:03:01 +0300 From: Baruch Siach Message-ID: <20110913120301.GB25206@sapphire.tkos.co.il> References: <20110913114353.GA25206@sapphire.tkos.co.il> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: tftp to flash from linux To: Vanhauwaert Wouter Cc: "barebox@lists.infradead.org" Hi Wouter, On Tue, Sep 13, 2011 at 01:50:42PM +0200, Vanhauwaert Wouter wrote: > Yes, I already thought that this nandwrite command can be used for writing. > But problem is I get the image via tftp and my RAM is to little to store it > temporary. So I have to write it directly to flash. Can I combine this > nandwrite and tftp in any way? I'm using busybox The nandwrite utility (and also the Busybox version) reads data from standard input in the absence of file argument. You can pipe the data stream from the network directly to nandwrite. baruch > -----Original Message----- > From: Baruch Siach [mailto:baruch@tkos.co.il] > Sent: dinsdag 13 september 2011 13:44 > To: Vanhauwaert Wouter > Cc: barebox@lists.infradead.org > Subject: Re: tftp to flash from linux > > Hi Wouter, > > On Tue, Sep 13, 2011 at 01:36:31PM +0200, Vanhauwaert Wouter wrote: > > To update our platform from within a booted linux, we need tftp to > > write to the nand-flash (another partition) directly. > > Which one do I use? /dev/mtdx or /dev/mtdblockx? And what happens with > > bad blocks here? Are these bad-block aware? > > Use the nandwrite utility from the mtd-utils package (there's also a Busybox > version), and a/dev/mtdx. > > baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ip2.televic.com ([81.82.194.222]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R3qzW-0003jY-CR for barebox@lists.infradead.org; Wed, 14 Sep 2011 15:03:10 +0000 From: Vanhauwaert Wouter Date: Wed, 14 Sep 2011 17:03:07 +0200 Message-ID: References: <20110913114353.GA25206@sapphire.tkos.co.il> <4E6F4542.70408@pengutronix.de> In-Reply-To: <4E6F4542.70408@pengutronix.de> Content-Language: en-US MIME-Version: 1.0 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: tftp to flash from linux To: Marc Kleine-Budde Cc: "barebox@lists.infradead.org" > please don't reply to an existing thread if you start a new topic! > Ok (did I do that?) > You need a tftp client that supports writing to stdout and a nandwrite that > supports reading from stdin. > > Than it's the usual > > tftp $server $file | nandwrite /dev/mtdfoo - > I try mx27iat# tftp -g -l /proc/self/fd/1 -r zImage_iat_3.0.11_0.02-dbg1 10.0.56.4 | nandwrite -p /dev/mtd4 - But this doesn't work. Gives some output, from which: open input file: No such file or directory The same command without the pipe at the end works (output to stdout) _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from tango.tkos.co.il ([62.219.50.35]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R3sZB-0005sd-37 for barebox@lists.infradead.org; Wed, 14 Sep 2011 16:44:06 +0000 Date: Wed, 14 Sep 2011 19:43:54 +0300 From: Baruch Siach Message-ID: <20110914164353.GA27520@sapphire.tkos.co.il> References: <20110913114353.GA25206@sapphire.tkos.co.il> <4E6F4542.70408@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: tftp to flash from linux To: Vanhauwaert Wouter Cc: "barebox@lists.infradead.org" On Wed, Sep 14, 2011 at 05:03:07PM +0200, Vanhauwaert Wouter wrote: > > You need a tftp client that supports writing to stdout and a nandwrite > > that > > supports reading from stdin. > > > > Than it's the usual > > > > tftp $server $file | nandwrite /dev/mtdfoo - > > I try > mx27iat# tftp -g -l /proc/self/fd/1 -r zImage_iat_3.0.11_0.02-dbg1 10.0.56.4 | nandwrite -p /dev/mtd4 - > > But this doesn't work. Gives some output, from which: > open input file: No such file or directory > The same command without the pipe at the end works (output to stdout) Try passing the data via a named pipe: mkfifo nand_pipe tftp -g -l nand_pipe -r zImage 10.0.56.4 & nandwrite -p /dev/mtd4 nand_pipe baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ip2.televic.com ([81.82.194.222]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R47SP-0007Ag-RU for barebox@lists.infradead.org; Thu, 15 Sep 2011 08:38:06 +0000 From: Vanhauwaert Wouter Date: Thu, 15 Sep 2011 10:38:02 +0200 Message-ID: References: <20110913114353.GA25206@sapphire.tkos.co.il> <4E6F4542.70408@pengutronix.de> <20110914164353.GA27520@sapphire.tkos.co.il> In-Reply-To: <20110914164353.GA27520@sapphire.tkos.co.il> Content-Language: en-US MIME-Version: 1.0 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: tftp to flash from linux To: Baruch Siach Cc: "barebox@lists.infradead.org" > > I try > > mx27iat# tftp -g -l /proc/self/fd/1 -r zImage_iat_3.0.11_0.02-dbg1 > > 10.0.56.4 | nandwrite -p /dev/mtd4 - > > > > But this doesn't work. Gives some output, from which: > > open input file: No such file or directory The same command without > > the pipe at the end works (output to stdout) > > Try passing the data via a named pipe: > > mkfifo nand_pipe > tftp -g -l nand_pipe -r zImage 10.0.56.4 & nandwrite -p /dev/mtd4 nand_pipe > Doesn't work: mx27iat# mkfifo nand_pipe mx27iat# tftp -g -l nand_pipe -r output 10.56.114 | nandwrite -p /dev/mtd4 nand_pipe tftp: using blksize 512MTD_open MTD_ioctl using server '10.0.56.114:69', rMTD_ioctl emote_file 'output', local_file MTD_write 'nand_pipe' sending 15 bytes 00 01 6f 75 74 70 75 74 00 6f 63 MTD_close 74 65 74 00 Writing data to block 0 sending 15 bytes 00 01 6f 75 74 70 75 74 00 6f 63 74 65 74 00 received 516 bytes: 0003 0001 End then it quits, no error, no warning, but file should be 128kB _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ip2.televic.com ([81.82.194.222]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R48Qv-0008DZ-9U for barebox@lists.infradead.org; Thu, 15 Sep 2011 09:40:37 +0000 From: Vanhauwaert Wouter Date: Thu, 15 Sep 2011 11:40:32 +0200 Message-ID: References: <20110913114353.GA25206@sapphire.tkos.co.il> <4E6F4542.70408@pengutronix.de> <20110914164353.GA27520@sapphire.tkos.co.il> In-Reply-To: Content-Language: en-US MIME-Version: 1.0 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: tftp to flash from linux To: Vanhauwaert Wouter , Baruch Siach Cc: "barebox@lists.infradead.org" > Doesn't work: > > mx27iat# mkfifo nand_pipe > mx27iat# tftp -g -l nand_pipe -r output 10.56.114 | nandwrite -p /dev/mtd4 > nand_pipe > tftp: using blksize 512MTD_open > MTD_ioctl I did some further testing, and apparantly, the nandwrite closes after writing 1 buffer Did the test with one console "nandwrite -p /dev/mtd4 nand_pipe" and from another echo this is a test > nand_pipe: mx27iat# nandwrite -p /dev/mtd4 nand_pipe MTD_open MTD_ioctl Writing data to block 0MTD_ioctl MTD_write MTD_close _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox