<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <pre>In going through code used by a port of an IPQ4019 device, I see that</pre>
    <pre>target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh
in platform_do_upgrade_linksys()
</pre>
    <pre>writes the image using

    get_image "$1" | mtd write - $part_label

This surprises me as I had thought that NAND-based flash should use 
NAND utilities because of the possibility of bad blocks and metadata.

The OEM firmware follows more of what I had expected to see:

ubifs_v1.1.4/usr/sbin/update_defs (Linksys OEM)
in erase_and_program()

                if [ ${FLASH_TYPE} = "MTD_NANDFLASH" ]; then
                        echo -ne "\tErasing... /dev/$2\n" >> /dev/console
                        if [ "$VERBOSE" = "yes" ]; then
                                # flash_eraseall -j /dev/$2
                                flash_erase /dev/$2 0 0
                        else
                                # flash_eraseall -q -j /dev/$2
                                flash_erase -q /dev/$2 0 0
                        fi
                        check_error
                        echo -ne "\tProgramming... /dev/$2\n" >> /dev/console
                        if [ "$VERBOSE" = "yes" ]; then
                                #nandwrite -m -a -p /dev/$2 $3 
                                nandwrite -p /dev/$2 $3
                        else
                                #nandwrite -q -m -a -p /dev/$2 $3
                                nandwrite -q -p /dev/$2 $3
                        fi
                        check_error
                fi


While I don't have any bad blocks in my NAND (yet), should this be changed
to use the NAND-based utilities in a separate patch?


Jeff








</pre>
  </body>
</html>