title: Linux kernel booting stops at Uncompressing Linux... Ok, booting the kernel
body: <p>I have a problem about porting kernel from old SH4 to new SH4. Please let me show the difference between them.</p>
  
  <p>[Old SH4]<br>
  boot loader: redboot v2.0<br>
  kernel version: 2.4<br></p>
  
  <p>[New SH4]<br>
  boot loader: u-boot v2009.03<br>
  kernel version: 2.6<br></p>
  
  <p>In old SH4, a lot of source code is developed based on kernel 2.4, so porting kernel 2.4 to new SH4 looks easier than recompiling source codes in kernel 2.6. So I applied mkimage to the zImage which was developed for old SH4 as shown below.</p>
  
  <pre><code>mkimage -A sh -O linux -T kernel -C none -a 0x8c210000 -e 0x8c210000 -n 'Old kernel' -d zImage uImage
  </code></pre>
  
  <p>This image is loaded on new SH4 as shown below.</p>
  
  <pre><code>tftpboot 8c800000 uImage
  cp.b $(fileaddr) a0100000 $(filesize)
  bootm a0100000
  </code></pre>
  
  <p>However, booting stops after "Uncompressing Linux... Ok, booting the kernel" and hangs. I found that the infinite loop happens at the below lines on kernel/head.S, but I suppose these lines have no problem because kernel/head.S is not customized and it works on old SH4.</p>
  
  <pre><code>   !               Clear BSS area
     mov.l   3f, r1 ! __bss_start
     add     #4, r1
     mov.l   4f, r2 ! _end
     mov     #0, r0
  9: cmp/hs　r2, r1
     bf/s    9b     ! while (r1 &lt r2)
     mov.l　 r0,@-r2
  </code></pre>
  
  <p>Thus, I guess this problem comes from environment difference between old and new SH4. In old SH4, I execute fconfig command and set variables as shown below.</p>
  
  <pre><code>Load Linux Kernel & File System: true
  Linux Kernel Destination address: 0x8c210000
  Linux Kernel Source address: 0x80140000
  Linux Kernel Size: 0x100000
  RAM disk Destination address: 0x8c360000
  RAM disk Source address: 0x80140000
  RAM disk Size: 0x400000
  Modify Linux Kernel Parameter: true
  Linux Kernel base address: 0x8c001000
  Linux Kernel ENTRY address: 0x8c210000
  Linux Kernel INITRD size: 0xc00000
  Linux Kernel INITRD start address: 0x360000
  Linux Kernel loader type: 1
  Linux Kernel mount root read only: 1
  Linux Kernel original root device: 0x100
  Linux Kernel RAM disk flags: 0
  Linux Kernel Enable Virtual Terminal Console: false
  </code></pre>
  
  <p>I think I can set these parameters on new SH4, though u-boot doesn't have fconfig command. But I couldn't find how to set the parameters Linux Kernel Source address and Linux kernel base address. Is this related to the hang problem? Or any advice about what I should check next will be helpful since I am new to Linux embedded system.</p>
  
  <p>Thanks for your help.</p>
  
  <p>[Edited]<br>
  Below infomation is added to show printenv result on u-boot.<br><br>
  bootcmd=icache on<br>
  bootm a0100000<br>
  bootdelay=2<br>
  baudrate=115200<br>
  netmask=255.255.255.0<br>
  ipaddr=192.168.1.2<br>
  serverip=192.168.1.1<br>
  gatewayip=0.0.0.0<br>
  bootargs=console=ttySC1,115200,N,8 mem=32M ether=8,0x1300,0,0,eth0 video=e1356fb:system:ms104sh4,display:crt,bpp:8,800x600@60<br>
  stdin=serial<br>
  stdout=serial<br>
  stderr=serial<br></p>