Skip to contentSkip to conversation

barebox tftp to 2k pagesize NAND

DISCUSSION Eric Bénard 3 participants 5 messages May 25, 2010 – May 26, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

while running barebox on a i.MX25 which has 2k pagesize nand, I noticed it's not possible to do a tftp directly to NAND (tftp barebox.bin /dev/nand0.barebox for example).

tftp try to write 512bytes packets to the NAND thus we get :
offset 0x00000200 not page aligned
when it tries to write the second packet.

The workaround is :
tftp to ram
cp ram => nand

Do you have any idea on how tof ix this problem ?

Thanks,
Eric

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw
Quoted 10 lines · Eric Bénard

Hi,

while running barebox on a i.MX25 which has 2k pagesize nand, I noticed it's not possible to do a tftp directly to NAND (tftp barebox.bin /dev/nand0.barebox for example).

tftp try to write 512bytes packets to the NAND thus we get :
offset 0x00000200 not page aligned
when it tries to write the second packet.

Quoted 5 lines

The workaround is :
tftp to ram
cp ram => nand

Do you have any idea on how tof ix this problem ?

Use /dev/nand0.barebox.bb instead. You are not supposed to use the non bad block aware devices directly.

Sascha

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw
In reply to Eric Bénard

On Tue, May 25, 2010 at 2:14 PM, Eric Bénard <[email protected]> wrote:
[...]

Quoted 3 lines

while running barebox on a i.MX25 which has 2k pagesize nand, I noticed it's not possible to do a tftp directly to NAND (tftp barebox.bin /dev/nand0.barebox for example).

[...]

Eric,

Are you able to boot from 2k pagesize NAND ?

I only have 512byte pagesize NAND, but shouldn't
nand_imx.c:imx_nand_load_image(..) have something like:

#ifdef CONFIG_ARCH_IMX25
        if (readl(IMX_CCM_BASE + CCM_RCSR) & (1 << 8))
                host.pagesize_2k = 1;
        else
                host.pagesize_2k = 0;

#endif

(For mainline inclusion, I'd propose to rework that part, to group i.MX25 with i.MX35, and i.MX21 with i.MX27)

Best regards,

Ivo.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#4 lore raw

Hi Ivo,

Quoted 11 lines · Ivo Clarysse

On Tue, May 25, 2010 at 2:14 PM, Eric Bénard<[email protected]> wrote:
[...]

Quoted 3 lines

while running barebox on a i.MX25 which has 2k pagesize nand, I noticed it's not possible to do a tftp directly to NAND (tftp barebox.bin /dev/nand0.barebox for example).

[...]

Eric,

Are you able to boot from 2k pagesize NAND ?

yes but I'm using internal boot mode.

Quoted 11 lines

I only have 512byte pagesize NAND, but shouldn't
nand_imx.c:imx_nand_load_image(..) have something like:

#ifdef CONFIG_ARCH_IMX25
         if (readl(IMX_CCM_BASE + CCM_RCSR)&  (1<<  8))
                 host.pagesize_2k = 1;
         else
                 host.pagesize_2k = 0;

#endif

yes something like this should be necessary for direct NAND boot.

Eric

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox