Open main menu

DAVE Developer's Wiki β

Changes

Recovery U-Boot Image (Naon)

1,922 bytes added, 15:54, 7 February 2013
m
UART Recovery
{{AppliesToNaon}}
{{InfoBoxBottom}}
 
{{WorkInProgress}}
=== Introduction ===
For different reason, starting from image corruption due power loss during upgrade or unrecoverable bug while developing a new U-Boot feature, the user will need, sooner or later, to recover his/her [[:Category:Naon|Naon]] SOM without using U-Boot itself.
In this article we'll see a few useful option for [[wwikipedia:Bare-metal restore|Bare-metal restore]] of a [[:Category:Naon|Naon]] module.
As prerequisite, we suggest an in-depth read of [[Boot sequence (Naon)|Naon boot sequence and options]], [[Memory organization (Naon)|Naon memory organization]] and [[Flashing Images (Naon)|Naon Flashing images]] because all this topic are required to understand the followings.
==== Lauterbach ICD Naon booting ====
[[File:naon-u-boot-sram.cmm|This]] The following script for [http://www.arm.com/community/partners/display_product/rw/ProductId/3084 Lauterbach ICD for ARM Cortex-A8] allow the user to:
* configure T32 correctly
* establish a connection with the target (which should already be powered on)
At this point the user should be able to run commands from U-Boot serial console.
<pre>; T32 script to download u-boot 1st stage into the internal SRAM break.delete /all SYStem.RESetSYStem.CPU DM8148SYStem.JtagClock 10MhzSYStem.Mode Attach ; we assume that there's bootrom running. Stop it to allow binary load break  data.load.binary MLO 0x40300000 R.S PC 0x40300000 go enddo</pre> As a more advance example, [[File:naon-u-boot-sram-2nd.cmm|This]] the next script, after loading the 1st stage and have it run until RAM initialization, also load 2nd stage (at 0x81000000). This is faster that loading the 2nd stage via serial protocol. After executing the script, the user should just type <code>go 81000000</code> from U-Boot 1st stage prompt, to run the 2nd stage:
<pre class="board-terminal">
Hit any key to stop autoboot: 0
NAON#
</pre>
 
 
Here it is:
 
<pre>
; T32 script to download u-boot 1st stage into the internal SRAM and,
; after the 1st stage initilize it, it loads also the 2nd stage in DRAM
 
break.delete /all
 
SYStem.RESet
SYStem.CPU DM8148
SYStem.JtagClock 10Mhz
SYStem.Mode Attach
 
; we assume that there's bootrom running. Stop it to allow binary load
break
 
data.load.binary MLO 0x40300000
 
R.S PC 0x40300000
 
go
;wait a bit, so U-Boot starts and initialize everything
wait 2s
break
 
data.load.binary ../u-boot/u-boot.git/u-boot.bin 0x81000000
go
 
enddo
</pre>
=== UART Recovery ===
UART recovery does not requires any specialized hardware, apart except for  * a PC (Windows or Linux based) and * a DB9 serial cross cable* the binary image of the 1st stage bootloader (u-boot.min.uart) with UART support (if this file is not available, please see [[Recovery U-Boot Image (Naon)#Getting the u-boot.min.uart | Getting the u-boot.min.uart]])
If not already available, configure [[Boot sequence (Naon)|Naon boot sequence]] to include UART boot.
When the 2nd stage is running follow [[Flashing Images (Naon)|this]] article for instructions on how to update U-Boot in flash
 
==== Getting the u-boot.min.uart ====
 
To build the 1st stage bootloader with UART support:
 
* configure the file Rules.make file contained into the ''EZSDK_INSTALL_DIR'', modifying the <code>MIN_UBOOT_CONFIG</code> and <code>MIN_UBOOT_IMAGE</code> variables, choosing the ''uart'' variant:
<pre>
MIN_UBOOT_CONFIG=naon_min_uart
MIN_UBOOT_IMAGE=u-boot.min.uart
</pre>
 
* build u-boot launching the <code>make u-boot</code> command, as described in [[Development_Environment_HowTo_(NELK)#Build.2Fconfigure_U-Boot_only | Build/configure U-Boot only]]
* enter the ''EZSDK_INSTALL_DIR/board-support/u-boot.git'' directory and launch the following command, which removes the MLO header (first 8 bytes):
 
<pre>
dd if=MLO of=u-boot.min.uart bs=1 skip=8
</pre>
 
<code>u-boot.min.uart</code> is the file that must be sent through the serial line to load the 1st stage bootloader on the board.
=== MMC Recovery ===