Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 21, 2023 06:48PM |
Registered: 1 year ago Posts: 9 |
root@debian:/boot# cat /proc/mtd dev: size erasesize name mtd0: 00080000 00010000 "uboot" mtd1: 00040000 00010000 "sdd_firmware" mtd2: 00010000 00010000 "uboot_env" mtd3: 00010000 00010000 "permanent_uboot_env" mtd4: 00010000 00010000 "hp_env"
root@debian:/boot# flash_unlock /dev/mtd2 flash_unlock: error!: could not unlock device: /dev/mtd2 error 22 (Invalid argument) root@debian:/boot# flashcp -v uboot.2016.05-tld-1.environment.64K.img /dev/mtd2 Erasing blocks: 1/1 (100%) Writing data: 64k/64k (100%) Verifying data: 10k/64k (15%) File does not seem to match flash data. First mismatch at 0x00000000-0x00002800
root@debian:/boot# cat log execve("/usr/sbin/flash_unlock", ["flash_unlock", "/dev/mtd2"], 0x7ee0bde4 /* 14 vars */) = 0 brk(NULL) = 0x9d5000 uname({sysname="Linux", nodename="debian", ...}) = 0 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=13745, ...}) = 0 mmap2(NULL, 13745, PROT_READ, MAP_PRIVATE, 3, 0) = 0x76f1c000 close(3) = 0 openat(AT_FDCWD, "/lib/arm-linux-gnueabi/libc.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\354\255\1\0004\0\0\0"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1341968, ...}) = 0 mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f1a000 mmap2(NULL, 1411240, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76d96000 mprotect(0x76eda000, 61440, PROT_NONE) = 0 mmap2(0x76ee9000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x143000) = 0x76ee9000 mmap2(0x76eed000, 6312, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76eed000 close(3) = 0 set_tls(0x76f1ac00) = 0 mprotect(0x76ee9000, 8192, PROT_READ) = 0 mprotect(0x4c1000, 4096, PROT_READ) = 0 mprotect(0x76f20000, 4096, PROT_READ) = 0 munmap(0x76f1c000, 13745) = 0 openat(AT_FDCWD, "/dev/mtd2", O_RDWR) = 3 ioctl(3, MIXER_READ(1) or MEMGETINFO, {type=MTD_NORFLASH, flags=MTD_WRITEABLE|MTD_BIT_WRITEABLE, size=0x10000, erasesize=0x10000, writesize=0x1, oobsize=0, padding=0}) = 0 ioctl(3, MIXER_WRITE(6) or MEMUNLOCK, {start=0, length=0x10000}) = -1 EINVAL (Invalid argument) write(2, "flash_unlock: error!: could not "..., 58flash_unlock: error!: could not unlock device: /dev/mtd2 ) = 58 write(2, " error 22 (Invalid "..., 42 error 22 (Invalid argument) ) = 42 exit_group(-1) = ? +++ exited with 255 +++
U-Boot 2017.07-tld-1 (Nov 01 2017 - 00:58:19 -0700) HP Thin Client T5325 SoC: Kirkwood 88F6281_A1 SPI: ready DRAM: 512 MiB WARNING: Caches not enabled MMC: SF: Detected m25p80 with page size 256 Bytes, erase size 64 KiB, total 1 MiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: egiga0 88E3016 Initialized on egiga0
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 21, 2023 08:22PM |
Admin Registered: 13 years ago Posts: 19,102 |
setenv mtdparts 'mtdparts=spi0.0:512K(uboot),256K(sdd_firmware),64K(uboot_env),64K(permanent_uboot_env),64K(hp_env)' setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial'And then
boot
dmesg cat /proc/mtdNow you should see
dev: size erasesize name mtd0: 00080000 00010000 "uboot" mtd1: 00040000 00010000 "sdd_firmware" mtd2: 00010000 00010000 "uboot_env" mtd3: 00010000 00010000 "permanent_uboot_env" mtd4: 00010000 00010000 "hp_env"
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 21, 2023 08:24PM |
Admin Registered: 13 years ago Posts: 19,102 |
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 22, 2023 11:33AM |
Registered: 1 year ago Posts: 9 |
U-Boot 2017.07-tld-1 (Nov 01 2017 - 00:58:19 -0700) HP Thin Client T5325 SoC: Kirkwood 88F6281_A1 SPI: ready DRAM: 512 MiB WARNING: Caches not enabled MMC: SF: Detected m25p80 with page size 256 Bytes, erase size 64 KiB, total 1 MiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: egiga0 88E3016 Initialized on egiga0 Hit any key to stop autoboot: 0 T5325> printenv arcNumber=2846 baudrate=115200 bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm$load_ uimage_addr; fi; fi bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi bootdelay=10 bootdev=usb console=ttyS0,115200 device=0:1 devices=usb ide disks=0 1 2 3 dtb_file=/boot/dts/kirkwood-t5325.dtb ethact=egiga0 ethaddr=52:3b:20:9c:11:51 if_netconsole=ping $serverip ipaddr=192.168.0.231 led_error=orange blinking led_exit=green off led_init=green blinking load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file load_dtb_addr=0x1c00000 load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd load_initrd_addr=0x1100000 load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage load_uimage_addr=0x800000 mainlineLinux=yes mtdparts=mtdparts=spi0.0:512K(uboot),256K(sdd_firmware),64K(uboot_env),64K(permanent_uboot_env),64K(hp_env) preboot_nc=run if_netconsole start_netconsole scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $sca n_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done serverip=192.168.0.220 set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version; stderr=serial stdin=serial stdout=serial uenv_addr=0x810000 uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done; uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in 0; do run uenv_read_disk; done; done; uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi usb_ready_retry=15 Environment size: 2876/65532 bytes
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 22, 2023 01:18PM |
Admin Registered: 13 years ago Posts: 19,102 |
Quote
I just need to see your dmesg to explain why. Your kernel bootargs was probably messed up.
cat /proc/mtd
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 27, 2023 01:33PM |
Registered: 1 year ago Posts: 9 |
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 27, 2023 02:07PM |
Admin Registered: 13 years ago Posts: 19,102 |
root@debian:~# flash_unlock /dev/mtd2 flash_unlock: error!: could not unlock device: /dev/mtd2This error should be ignored. Nowadays Linux does not care to lock the flash anymore.
helpCheck flash protection
flinfoif you see
Write Protection : AllUnprotect the flash (this probably is the right syntax, it's been a long time I'm not sure I remember correctly).
protect off allAnd then
resetAfter stock u-boot restart, interrupt the countdown , and check the flash protection again. If it shows
Write Protection : AllDo
protect off alland then boot all the way into Debian.
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 27, 2023 03:14PM |
Registered: 1 year ago Posts: 9 |
HP>> flinfo Bank # 1: Flash Base Address : 0xf8000000 Flash Model : Numonyx-25P80 Manufacturer ID : 0x20 Device Id : 0x2014 Sector Size : 64K Number of sectors : 16 Page Size : 256 Write Protection : Upper 1 of 8 HP>> protect off all Un-Protect Flash Bank # 1 ................ done HP>> flinfo Bank # 1: Flash Base Address : 0xf8000000 Flash Model : Numonyx-25P80 Manufacturer ID : 0x20 Device Id : 0x2014 Sector Size : 64K Number of sectors : 16 Page Size : 256 Write Protection : Off
echo -e "reset\n" > /dev/ttyUSB0 && kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.t5325.mtd0.kwb
root@debian:/boot# flash_unlock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x80000 Lock status: unlocked Return code: 0 root@debian:/boot# flash_unlock -i /dev/mtd2 Device: /dev/mtd2 Start: 0 Len: 0x10000 Lock status: unlocked root@debian:/boot# flashcp -v uboot.2017.07-tld-1.t5325.mtd0.kwb /dev/mtd0 Erasing blocks: 8/8 (100%) Writing data: 512k/512k (100%) Verifying data: 512k/512k (100%) root@debian:/boot# flashcp -v uboot.2016.05-tld-1.environment.64K.img /dev/mtd2 Erasing blocks: 1/1 (100%) Writing data: 64k/64k (100%) Verifying data: 64k/64k (100%)
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 27, 2023 03:24PM |
Admin Registered: 13 years ago Posts: 19,102 |
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 27, 2023 04:04PM |
Registered: 1 year ago Posts: 9 |
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 September 27, 2023 05:11PM |
Admin Registered: 13 years ago Posts: 19,102 |
Quote
C. Add uEnv.txt to /boot directory (Optional)
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 October 03, 2023 02:45PM |
Registered: 1 year ago Posts: 9 |
T5325> setenv dtb_file /boot/dts/kirkwood-t5325.dtb T5325> saveenv Saving Environment to SPI Flash... SF: Detected m25p80 with page size 256 Bytes, erase size 64 KiB, total 1 MiB Erasing SPI flash...Writing to SPI flash...done
Re: HP T5325 Thin Client U-Boot-2017.07-tld-1 October 03, 2023 04:18PM |
Admin Registered: 13 years ago Posts: 19,102 |
Quote
6. And add fw_env.config to your stock OS. And then reference your saved current_envs.txt in step 2 to restore box specific info in u-boot envs.
a. Add fw_env.config to your stock OS.
echo "/dev/mtd0 0x00000 0x10000 0x10000" > /etc/fw_env.config
b. Modify envs and also setup netconsole. Replace xx below with your box specific settings.
Note that the mtdparts layout are changed in the following fw_setenv commands. So when you reboot into Debian roots, the mtdparts will have a new layout.
/tmp/sdb1/usr/bin/fw_setenv arcNumber '2846'
/tmp/sdb1/usr/bin/fw_setenv mtdparts 'mtdparts=spi0.0:512K(uboot),256K(sdd_firmware),64K(uboot_env),64K(permanent_uboot_env),64K(hp_env)'
/tmp/sdb1/usr/bin/fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
/tmp/sdb1/usr/bin/fw_setenv devices 'usb ide'
/tmp/sdb1/usr/bin/fw_setenv dtb_file '/boot/dts/kirkwood-t5325.dtb'