Flashing NOR

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (Write NOR (GTA02))
(Write NOR (GTA02))
Line 9: Line 9:
 
You have to using debug board to pull high the write enable. You could use Flashing script in follwoing address
 
You have to using debug board to pull high the write enable. You could use Flashing script in follwoing address
  
[http://people.openmoko.org/tony_tu/GTA02/images/20080321_gta02_rc1/ Flashing NOR script sample]
+
 
   
+
'''N.B.:''' This link is broken as of 20090108. ''iceworm''
+
  
 
GTA02 A5 DVT1 units (in prototypes page, comes without write protection nor, you could re-flash it anytime)
 
GTA02 A5 DVT1 units (in prototypes page, comes without write protection nor, you could re-flash it anytime)

Revision as of 14:57, 18 February 2009

Contents

GTA02 FreeRunner

NOR on GTA02

GTA02 has 2 MB of NOR flash for emergency boot or other usage.

Write NOR (GTA02)

You have to using debug board to pull high the write enable. You could use Flashing script in follwoing address


GTA02 A5 DVT1 units (in prototypes page, comes without write protection nor, you could re-flash it anytime)

Flashing script

    #!/bin/sh -e
    #
    # flashnor - Flash a file into NOR (M58WR016KB)
    #
    # Copyright (C) 2008 by Openmoko, Inc.
    # Written by Werner Almesberger <werner@openmoko.org>
    # All Rights Reserved
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    #
    DEV=/dev/mtd0
    usage()
    {
        echo "usage: $0 nor.bin" 1>&2
        exit 1
    }
    check()
    {
        nor=`dd if=$DEV bs=$size count=1 | md5sum`
        [ "$nor" = "$ref" ]
    }
    empty()
    {
        ff=`dd if=/dev/zero bs=$size count=1 | tr '\000' '\377' | md5sum`
        [ "$ff" = "$nor" ]
    }
    [ -z "$1" -o ! -z "$2" ] && usage
    size=`ls -l "$1" | awk '{ print $5 }'`
    if [ $size -lt 65536 ]; then
        blocks=`expr \( $size + 8191 \) / 8192`
    else
        blocks=`expr \( $size - 65536 + 65535 \) / 65536 + 8`
    fi
    ref=`md5sum <"$1"`
    check && exit
    flash_unlock $DEV
    empty || flash_erase $DEV 0 $blocks
    cat "$1" >$DEV
    flash_lock /dev/mtd0 0 -1
    check


NOR image

You could check the NOR image sample in following address:

GTA02 NOR image sample

Personal tools

GTA02 FreeRunner

NOR on GTA02

GTA02 has 2 MB of NOR flash for emergency boot or other usage.

Write NOR (GTA02)

You have to using debug board to pull high the write enable. You could use Flashing script in follwoing address

Flashing NOR script sample

N.B.: This link is broken as of 20090108. iceworm

GTA02 A5 DVT1 units (in prototypes page, comes without write protection nor, you could re-flash it anytime)

Flashing script

    #!/bin/sh -e
    #
    # flashnor - Flash a file into NOR (M58WR016KB)
    #
    # Copyright (C) 2008 by Openmoko, Inc.
    # Written by Werner Almesberger <werner@openmoko.org>
    # All Rights Reserved
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    #
    DEV=/dev/mtd0
    usage()
    {
        echo "usage: $0 nor.bin" 1>&2
        exit 1
    }
    check()
    {
        nor=`dd if=$DEV bs=$size count=1 | md5sum`
        [ "$nor" = "$ref" ]
    }
    empty()
    {
        ff=`dd if=/dev/zero bs=$size count=1 | tr '\000' '\377' | md5sum`
        [ "$ff" = "$nor" ]
    }
    [ -z "$1" -o ! -z "$2" ] && usage
    size=`ls -l "$1" | awk '{ print $5 }'`
    if [ $size -lt 65536 ]; then
        blocks=`expr \( $size + 8191 \) / 8192`
    else
        blocks=`expr \( $size - 65536 + 65535 \) / 65536 + 8`
    fi
    ref=`md5sum <"$1"`
    check && exit
    flash_unlock $DEV
    empty || flash_erase $DEV 0 $blocks
    cat "$1" >$DEV
    flash_lock /dev/mtd0 0 -1
    check


NOR image

You could check the NOR image sample in following address:

GTA02 NOR image sample