[U-Boot] [PATCH 1/1] qemu_mips: move env storage just after u-boot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- include/configs/qemu-mips.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index faaa889..e46976d 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h @@ -150,7 +150,7 @@ #define CFG_FLASH_USE_BUFFER_WRITE 1
#define CONFIG_ENV_IS_IN_FLASH 1 -#define CONFIG_ENV_ADDR (CFG_FLASH_BASE + 0x40000) +#define CONFIG_ENV_ADDR (CFG_FLASH_BASE + 0x30000)
/* Address and size of Primary Environment Sector */ #define CONFIG_ENV_SIZE 0x8000

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- doc/README.qemu_mips | 67 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 58 insertions(+), 9 deletions(-)
diff --git a/doc/README.qemu_mips b/doc/README.qemu_mips index 2a6f1cf..13c98b9 100644 --- a/doc/README.qemu_mips +++ b/doc/README.qemu_mips @@ -17,7 +17,28 @@ create image: start it: # qemu-system-mips -M mips -pflash flash -monitor null -nographic
-Ide Disk +2) Download kernel + initrd + +On ftp://ftp.denx.de/pub/contrib/Jean-Christophe_Plagniol-Villard/qemu_mips/ +you can downland + +#config to build the kernel +qemu_mips_defconfig +#patch to fix mips interupt init on 2.6.24.y kernel +qemu_mips_kernel.patch +initrd.gz +vmlinux +vmlinux.bin +System.map + +4) Generate uImage + +# tools/mkimage -A mips -O linux -T kernel -C gzip -a 0x80010000 -e 0x80245650 -n "Linux 2.6.24.y" -d vmlinux.bin.gz uImage + +5) Copy uImage to Flash +# dd if=uImage bs=1k conv=notrunc seek=224 of=flash + +6) Generate Ide Disk
# dd of=ide bs=1k cout=100k if=/dev/zero
@@ -30,14 +51,12 @@ unit: sectors ide3 : start= 64260, size= 4128705, Id=83 ide4 : start= 0, size= 0, Id= 0
-# Generate uImage -# tools/mkimage -A mips -O linux -T kernel -C gzip -a 0x80010000 -e 0x80245650 -n "Linux 2.6.24.y" -d vmlinux.bin.gz uImage -# Copy to Flash -# dd if=uImage bs=1k conv=notrunc seek=224 of=flash -# Copy to ide +7) Copy to ide + # dd if=uImage bs=512 conv=notrunc seek=63 of=ide
-# Generate ext2 on part 2 +8) Generate ext2 on part 2 on Copy uImage and initrd.gz + # Attached as loop device ide offset = 32130 * 512 # losetup -o 16450560 -f ide # Format as ext2 ( arg2 : nb blocks) @@ -45,10 +64,40 @@ unit: sectors # losetup -d /dev/loop0 # Mount and copy uImage and initrd.gz to it # mount -o loop,offset=16450560 -t ext2 ide /mnt +# mkdir /mnt/boot +# cp {initrd.gz,uImage} /mnt/boot/ # Umount it # umount /mnt
-Now you can boot from flash, ide, ide+ext2 and tfp +9) Set Environment + +setenv rd_start 0x80800000 +setenv rd_size 2663940 +setenv kernel BFC38000 +setenv oad_addr 80500000 +setenv load_addr2 80F00000 +setenv kernel_flash BFC38000 +setenv load_addr_hello 80200000 +setenv bootargs 'root=/dev/ram0 init=/bin/sh' +setenv load_rd_ext2 'ide res; ext2load ide 0:2 ${rd_start} /boot/initrd.gz' +setenv load_rd_tftp 'tftp ${rd_start} /initrd.gz' +setenv load_kernel_hda 'ide res; diskboot ${load_addr} 0:2' +setenv load_kernel_ext2 'ide res; ext2load ide 0:2 ${load_addr} /boot/uImage' +setenv load_kernel_tftp 'tftp ${load_addr} /qemu_mips/uImage' +setenv boot_ext2_ext2 'run load_rd_ext2; run load_kernel_ext2; run addmisc; bootm ${load_addr}' +setenv boot_ext2_flash 'run load_rd_ext2; run addmisc; bootm ${kernel_flash}' +setenv boot_ext2_hda 'run load_rd_ext2; run load_kernel_hda; run addmisc; bootm ${load_addr}' +setenv boot_ext2_tftp 'run load_rd_ext2; run load_kernel_tftp; run addmisc; bootm ${load_addr}' +setenv boot_tftp_hda 'run load_rd_tftp; run load_kernel_hda; run addmisc; bootm ${load_addr}' +setenv boot_tftp_ext2 'run load_rd_tftp; run load_kernel_ext2; run addmisc; bootm ${load_addr}' +setenv boot_tftp_flash 'run load_rd_tftp; run addmisc; bootm ${kernel_flash}' +setenv boot_tftp_tftp 'run load_rd_tftp; run load_kernel_tftp; run addmisc; bootm ${load_addr}' +setenv load_hello_tftp 'tftp ${load_addr_hello} /examples/hello_world.bin' +setenv go_tftp 'run load_hello_tftp; go ${load_addr_hello}' +setenv addmisc 'setenv bootargs ${bootargs} console=ttyS0,${baudrate} rd_start=${rd_start} rd_size=${rd_size} ethaddr=${ethaddr}' +setenv bootcmd 'run boot_tftp_flash' + +10) Now you can boot from flash, ide, ide+ext2 and tfp
# qemu-system-mips -M mips -pflash flash -monitor null -nographic -net nic -net user -tftp `pwd` -hda ide
@@ -64,7 +113,7 @@ in an other console you start gdb 1) Debugging of U-Boot Before Relocation
Before relocation, the addresses in the ELF file can be used without any problems -buy connecting to the gdb server localhost:1234 +by connecting to the gdb server localhost:1234
# mipsel-unknown-linux-gnu-gdb u-boot GNU gdb 6.6

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 1220905638-9768-1-git-send-email-plagnioj@jcrosoft.com you wrote:
Subject: [PATCH 1/1]
Could you please omit the "1/1" part is this is a single patch that does not belong to some series?
[On the other hand, I kind of feel that this *is* actually part of your qemu series ?]
Best regards,
Wolfgang Denk

On 22:27 Mon 08 Sep , Jean-Christophe PLAGNIOL-VILLARD wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
doc/README.qemu_mips | 67 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 58 insertions(+), 9 deletions(-)
ping
Best Regards, J.

Jean-Christophe PLAGNIOL-VILLARD wrote:
On 22:27 Mon 08 Sep , Jean-Christophe PLAGNIOL-VILLARD wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
doc/README.qemu_mips | 67 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 58 insertions(+), 9 deletions(-)
ping
Hmm, the patch above can't be applied to the current git. Could you confirm it?
diff --git a/doc/README.qemu_mips b/doc/README.qemu_mips index 2a6f1cf..13c98b9 100644 --- a/doc/README.qemu_mips +++ b/doc/README.qemu_mips @@ -17,7 +17,28 @@ create image: start it: # qemu-system-mips -M mips -pflash flash -monitor null -nographic
-Ide Disk
For example, where does this "-Ide Disk" come from?
+2) Download kernel + initrd
+On ftp://ftp.denx.de/pub/contrib/Jean-Christophe_Plagniol-Villard/qemu_mips/ +you can downland
+#config to build the kernel +qemu_mips_defconfig

On 00:02 Wed 10 Dec , Shinya Kuribayashi wrote:
Jean-Christophe PLAGNIOL-VILLARD wrote:
On 22:27 Mon 08 Sep , Jean-Christophe PLAGNIOL-VILLARD wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
doc/README.qemu_mips | 67 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 58 insertions(+), 9 deletions(-)
ping
Hmm, the patch above can't be applied to the current git. Could you confirm it?
this patch apply against the 2 new I've re-send
Best Regards, J.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- include/configs/qemu-mips.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index f028d1a..8444462 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h @@ -150,7 +150,7 @@ #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
#define CONFIG_ENV_IS_IN_FLASH 1 -#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x40000) +#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
/* Address and size of Primary Environment Sector */ #define CONFIG_ENV_SIZE 0x8000

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- doc/README.qemu_mips | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/doc/README.qemu_mips b/doc/README.qemu_mips index 2fdd2b0..8fa4907 100644 --- a/doc/README.qemu_mips +++ b/doc/README.qemu_mips @@ -17,12 +17,47 @@ create image: start it: # qemu-system-mips -M mips -pflash flash -monitor null -nographic
+Ide Disk + +# dd of=ide bs=1k cout=100k if=/dev/zero + +# sfdisk -C 261 -d ide +# partition table of ide +unit: sectors + + ide1 : start= 63, size= 32067, Id=83 + ide2 : start= 32130, size= 32130, Id=83 + ide3 : start= 64260, size= 4128705, Id=83 + ide4 : start= 0, size= 0, Id= 0 + +# Generate uImage +# tools/mkimage -A mips -O linux -T kernel -C gzip -a 0x80010000 -e 0x80245650 -n "Linux 2.6.24.y" -d vmlinux.bin.gz uImage +# Copy to Flash +# dd if=uImage bs=1k conv=notrunc seek=224 of=flash +# Copy to ide +# dd if=uImage bs=512 conv=notrunc seek=63 of=ide + +# Generate ext2 on part 2 +# Attached as loop device ide offset = 32130 * 512 +# losetup -o 16450560 -f ide +# Format as ext2 ( arg2 : nb blocks) +# mke2fs /dev/loop0 16065 +# losetup -d /dev/loop0 +# Mount and copy uImage and initrd.gz to it +# mount -o loop,offset=16450560 -t ext2 ide /mnt +# Umount it +# umount /mnt + +Now you can boot from flash, ide, ide+ext2 and tfp + +# qemu-system-mips -M mips -pflash flash -monitor null -nographic -net nic -net user -tftp `pwd` -hda ide + II) How to debug U-Boot
In order to debug U-Boot you need to start qemu with gdb server support (-s) and waiting the connection to start the CPU (-S)
-# qemu-system-mips -S -s -M mips -pflash flash -monitor null -nographic +# qemu-system-mips -S -s -M mips -pflash flash -monitor null -nographic -net nic -net user -tftp `pwd` -hda ide
in an other console you start gdb

Jean-Christophe PLAGNIOL-VILLARD wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
doc/README.qemu_mips | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-)
Applied and pushed out, thanks.
One comment bellow.
diff --git a/doc/README.qemu_mips b/doc/README.qemu_mips index 2fdd2b0..8fa4907 100644 --- a/doc/README.qemu_mips +++ b/doc/README.qemu_mips @@ -17,12 +17,47 @@ create image: start it: # qemu-system-mips -M mips -pflash flash -monitor null -nographic
+Ide Disk
+# dd of=ide bs=1k cout=100k if=/dev/zero
+# sfdisk -C 261 -d ide +# partition table of ide +unit: sectors
ide1 : start= 63, size= 32067, Id=83
ide2 : start= 32130, size= 32130, Id=83
ide3 : start= 64260, size= 4128705, Id=83
ide4 : start= 0, size= 0, Id= 0
+# Generate uImage +# tools/mkimage -A mips -O linux -T kernel -C gzip -a 0x80010000 -e 0x80245650 -n "Linux 2.6.24.y" -d vmlinux.bin.gz uImage +# Copy to Flash +# dd if=uImage bs=1k conv=notrunc seek=224 of=flash +# Copy to ide +# dd if=uImage bs=512 conv=notrunc seek=63 of=ide
+# Generate ext2 on part 2 +# Attached as loop device ide offset = 32130 * 512 +# losetup -o 16450560 -f ide +# Format as ext2 ( arg2 : nb blocks) +# mke2fs /dev/loop0 16065 +# losetup -d /dev/loop0 +# Mount and copy uImage and initrd.gz to it +# mount -o loop,offset=16450560 -t ext2 ide /mnt +# Umount it +# umount /mnt
Comments are difficult to distinguish from real commands here. It might be readable if we use another comment style, or another command prompt.
And again, thanks for your continued work to improve qemu "getting started" guide.
Shinya

Jean-Christophe PLAGNIOL-VILLARD wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
doc/README.qemu_mips | 67 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 58 insertions(+), 9 deletions(-)
Applied and pushed out, thanks.
By the way, let me nitpick.
diff --git a/doc/README.qemu_mips b/doc/README.qemu_mips index 2a6f1cf..13c98b9 100644 --- a/doc/README.qemu_mips +++ b/doc/README.qemu_mips @@ -17,7 +17,28 @@ create image: start it: # qemu-system-mips -M mips -pflash flash -monitor null -nographic
-Ide Disk
We don't have I-1) and,
+2) Download kernel + initrd
+On ftp://ftp.denx.de/pub/contrib/Jean-Christophe_Plagniol-Villard/qemu_mips/ +you can downland
+#config to build the kernel +qemu_mips_defconfig +#patch to fix mips interupt init on 2.6.24.y kernel +qemu_mips_kernel.patch +initrd.gz +vmlinux +vmlinux.bin +System.map
I-3) here. But this does not prevent me from pushing them out. When you get a chance to update this doc in the future, please correct them.
Thanks!
Shinya
+4) Generate uImage
+# tools/mkimage -A mips -O linux -T kernel -C gzip -a 0x80010000 -e 0x80245650 -n "Linux 2.6.24.y" -d vmlinux.bin.gz uImage
+5) Copy uImage to Flash +# dd if=uImage bs=1k conv=notrunc seek=224 of=flash
+6) Generate Ide Disk
# dd of=ide bs=1k cout=100k if=/dev/zero

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 1220905590-9746-1-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
include/configs/qemu-mips.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index faaa889..e46976d 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h @@ -150,7 +150,7 @@ #define CFG_FLASH_USE_BUFFER_WRITE 1
#define CONFIG_ENV_IS_IN_FLASH 1 -#define CONFIG_ENV_ADDR (CFG_FLASH_BASE + 0x40000) +#define CONFIG_ENV_ADDR (CFG_FLASH_BASE + 0x30000)
Wouldn't it make sense to use something like
(CFG_FLASH_BASE + CFG_MONITOR_LEN)
instead?
Best regards,
Wolfgang Denk

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- Use CFG_MONITOR_LEN instead of value include/configs/qemu-mips.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index faaa889..4f02425 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h @@ -150,7 +150,7 @@ #define CFG_FLASH_USE_BUFFER_WRITE 1
#define CONFIG_ENV_IS_IN_FLASH 1 -#define CONFIG_ENV_ADDR (CFG_FLASH_BASE + 0x40000) +#define CONFIG_ENV_ADDR (CFG_FLASH_BASE + CFG_MONITOR_LEN)
/* Address and size of Primary Environment Sector */ #define CONFIG_ENV_SIZE 0x8000

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 1220909525-14187-1-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
Use CFG_MONITOR_LEN instead of value include/configs/qemu-mips.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Does not apply:
Applying qemu_mips: move env storage just after u-boot error: patch failed: include/configs/qemu-mips.h:150 error: include/configs/qemu-mips.h: patch does not apply fatal: sha1 information is lacking or useless (include/configs/qemu-mips.h). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001.
Please rebase and resubmit.
Best regards,
Wolfgang Denk

Jean-Christophe PLAGNIOL-VILLARD wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
Use CFG_MONITOR_LEN instead of value include/configs/qemu-mips.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h index faaa889..4f02425 100644 --- a/include/configs/qemu-mips.h +++ b/include/configs/qemu-mips.h @@ -150,7 +150,7 @@ #define CFG_FLASH_USE_BUFFER_WRITE 1
#define CONFIG_ENV_IS_IN_FLASH 1 -#define CONFIG_ENV_ADDR (CFG_FLASH_BASE + 0x40000) +#define CONFIG_ENV_ADDR (CFG_FLASH_BASE + CFG_MONITOR_LEN)
Now we have CONFIG_SYS_* instead of CFG_* in this area. Could you update and re-send the patch, please?
Thanks in advance,
Shinya
participants (3)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Shinya Kuribayashi
-
Wolfgang Denk