title: Qemu versatilepb booting u-boot from flash
body: <p>I am new in qemu an I want to learn something about it.
  I am running an u-boot in qemu using kernel parameter like this way:</p>
  
  <p>buldung uboot: <br></p>
  
  <pre><code>make versatileqemu_config
  </code></pre>
  
  <p>running qemu: <br></p>
  
  <pre><code>qemu-system-arm -M versatilepb -m 128M -serial stdio -kernel u-boot.bin -display none
  </code></pre>
  
  <p>An all is working fine, but now I want to run uboot from flash.
  Creating flash image in this way:</p>
  
  <pre><code>dd if=/dev/zero of=flash.bin bs=256k count=256
  dd if=u-boot.bin of=flash.bin bs=256k conv=notrunc
  </code></pre>
  
  <p>An try to run it:<br></p>
  
  <pre><code>qemu-system-arm -M versatilepb -m 128M -serial stdio -pflash flash.bin -display none
  </code></pre>
  
  <p>Efect is that there is crash, it seems that u-boot is not loaded:</p>
  
  <pre><code>qemu: fatal: Trying to execute code outside RAM or ROM at 0x08000000
  
  R00=00000000 R01=00000000 R02=00000000 R03=00000000
  R04=00000000 R05=00000000 R06=00000000 R07=00000000
  R08=00000000 R09=00000000 R10=00000000 R11=00000000
  R12=00000000 R13=00000000 R14=00000000 R15=08000000
  PSR=400001d3 -Z-- A svc32
  s00=00000000 s01=00000000 d00=0000000000000000
  s02=00000000 s03=00000000 d01=0000000000000000
  s04=00000000 s05=00000000 d02=0000000000000000
  s06=00000000 s07=00000000 d03=0000000000000000
  s08=00000000 s09=00000000 d04=0000000000000000
  s10=00000000 s11=00000000 d05=0000000000000000
  s12=00000000 s13=00000000 d06=0000000000000000
  s14=00000000 s15=00000000 d07=0000000000000000
  s16=00000000 s17=00000000 d08=0000000000000000
  s18=00000000 s19=00000000 d09=0000000000000000
  s20=00000000 s21=00000000 d10=0000000000000000
  s22=00000000 s23=00000000 d11=0000000000000000
  s24=00000000 s25=00000000 d12=0000000000000000
  s26=00000000 s27=00000000 d13=0000000000000000
  s28=00000000 s29=00000000 d14=0000000000000000
  s30=00000000 s31=00000000 d15=0000000000000000
  FPSCR: 00000000
  Aborted (core dumped)
  </code></pre>
  
  <p>What am I doing wrong?</p>