Quantcast
Channel: Linux Device Hacking - uBoot
Viewing all articles
Browse latest Browse all 903

DS411j uboot and kernel boot (2 replies)

$
0
0
now that the system has been testet and working ok with bodhi kernel(5.13.6-kirkwood-tld-1)and stock uboot(ancient)

Im willing to try to use new uboot to make this box permanent auto-boot

after loading the uboot with kwboot and applying variables as per tutorial using uboot.2017.07-tld-1.goflexhome.mtd0.kwb
kwboot version 2022.01+dfsg-2ubuntu2.4
Patching image boot signature to UART
Aligning image header to Xmodem block size
Sending boot message. Please reboot the target...\
Waiting 2s and flushing tty
Sending boot image header (512 bytes)...
 25 % [....                                                                  ]
Done
Sending boot image data (502068 bytes)...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  7 % [......................................................................]
  8 % [......................................................................]
 10 % [......................................................................]
 12 % [......................................................................]
 14 % [......................................................................]
 16 % [......................................................................]
 17 % [......................................................................]
 19 % [......................................................................]
 21 % [......................................................................]
 23 % [......................................................................]
 25 % [......................................................................]
 26 % [......................................................................]
 28 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 33 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 48 % [......................................................................]
 49 % [......................................................................]
 51 % [......................................................................]
 53 % [......................................................................]
 55 % [......................................................................]
 57 % [......................................................................]
 58 % [......................................................................]
 60 % [......................................................................]
 62 % [......................................................................]
 64 % [......................................................................]
 66 % [......................................................................]
 67 % [......................................................................]
 69 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 74 % [......................................................................]
 76 % [......................................................................]
 78 % [......................................................................]
 80 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 85 % [......................................................................]
 87 % [......................................................................]
 89 % [......................................................................]
 91 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 96 % [......................................................................]
 98 % [......................................................................]
 99 % [...                                                                   ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)
Seagate GoFlex Home

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  0 MiB
*** Warning - readenv() failed, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
PHY reset timed out
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0 
GoFlexHome>


setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd 'usb reset; run usb_bootcmd; usb stop; reset'
boot

kernel boots and finds all the drives(4) but spams the console/dmesg with:
[ 2424.503559] ata1: failed to resume link (SControl FFFFFFFF)
[ 2424.883561] ata4: failed to resume link (SControl FFFFFFFF)
[ 2425.103561] ata2: failed to resume link (SControl FFFFFFFF)
[ 2425.109897] ata3: failed to resume link (SControl FFFFFFFF)
[ 2425.603555] ata1: failed to resume link (SControl FFFFFFFF)
[ 2425.993554] ata4: failed to resume link (SControl FFFFFFFF)
[ 2426.213560] ata3: failed to resume link (SControl FFFFFFFF)
[ 2426.219902] ata2: failed to resume link (SControl FFFFFFFF)
[ 2426.703551] ata1: failed to resume link (SControl FFFFFFFF)
[ 2427.103552] ata4: failed to resume link (SControl FFFFFFFF)
[ 2427.323557] ata2: failed to resume link (SControl FFFFFFFF)
[ 2427.329897] ata3: failed to resume link (SControl FFFFFFFF)
[ 2427.803549] ata1: failed to resume link (SControl FFFFFFFF)
[ 2428.213554] ata4: failed to resume link (SControl FFFFFFFF)
[ 2428.433567] ata3: failed to resume link (SControl FFFFFFFF)
[ 2428.439921] ata2: failed to resume link (SControl FFFFFFFF)
[ 2428.903548] ata1: failed to resume link (SControl FFFFFFFF)
[ 2429.323573] ata4: failed to resume link (SControl FFFFFFFF)
[ 2429.543570] ata2: failed to resume link (SControl FFFFFFFF)
[ 2429.550025] ata3: failed to resume link (SControl FFFFFFFF

dmesg output:
root@debian:~# dmesg | grep sd 
[    9.324742] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[   10.874652] sd 0:0:0:0: [sda] 250069680 512-byte logical blocks: (128 GB/119 GiB)
[   10.883911] sd 0:0:0:0: [sda] Write Protect is off
[   10.889480] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[   10.889613] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   10.901241]  sda: sda1
[   10.905982] sd 0:0:0:0: [sda] Attached SCSI disk
[   11.479694] sd 1:0:0:0: [sdb] 250069680 512-byte logical blocks: (128 GB/119 GiB)
[   11.504587] sd 1:0:0:0: [sdb] Write Protect is off
[   11.510110] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[   11.510240] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   11.545262]  sdb: sdb1 sdb2 sdb3 sdb4
[   11.557400] sd 1:0:0:0: [sdb] Attached SCSI disk
[   12.812251] sd 2:0:0:0: [sdc] 468862128 512-byte logical blocks: (240 GB/224 GiB)
[   12.820522] sd 2:0:0:0: [sdc] 4096-byte physical blocks
[   12.826573] sd 2:0:0:0: [sdc] Write Protect is off
[   12.832119] sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[   12.832246] sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   12.849201]  sdc: sdc1
[   12.859411] sd 2:0:0:0: [sdc] Attached SCSI disk
[   13.861836] sd 3:0:0:0: [sde] 468862128 512-byte logical blocks: (240 GB/224 GiB)
[   13.870113] sd 3:0:0:0: [sde] 4096-byte physical blocks
[   13.876163] sd 3:0:0:0: [sde] Write Protect is off
[   13.881711] sd 3:0:0:0: [sde] Mode Sense: 00 3a 00 00
[   13.881838] sd 3:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   13.899252]  sde: sde1 sde2 < sde5 sde6 >
[   13.911935] sd 3:0:0:0: [sde] Attached SCSI disk
[   14.604632] sd 6:0:0:0: [sdd] 15663104 512-byte logical blocks: (8.02 GB/7.47 GiB)
[   14.613493] sd 6:0:0:0: [sdd] Write Protect is off
[   14.619017] sd 6:0:0:0: [sdd] Mode Sense: 23 00 00 00
[   14.619492] sd 6:0:0:0: [sdd] No Caching mode page found
[   14.625568] sd 6:0:0:0: [sdd] Assuming drive cache: write through
[   16.133137]  sdd: sdd1
[   16.139001] sd 6:0:0:0: [sdd] Attached SCSI removable disk
[   29.685555] EXT4-fs (sdd1): mounting ext3 file system using the ext4 subsystem
[   29.816904] EXT4-fs (sdd1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[   33.094841] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   33.161810] sd 1:0:0:0: Attached scsi generic sg1 type 0
[   33.178368] sd 2:0:0:0: Attached scsi generic sg2 type 0
[   33.324379] sd 6:0:0:0: Attached scsi generic sg3 type 0
[   33.377057] sd 3:0:0:0: Attached scsi generic sg4 type 0
[  153.578565] EXT4-fs (sdd1): re-mounted. Opts: errors=remount-ro. Quota mode: none.
[  366.620697] [<80792f50>] (scsi_block_when_processing_errors) from [<807a4644>] (sd_open+0x58/0x174)
[  366.630722] [<807a4644>] (sd_open) from [<802c34a0>] (__blkdev_get+0x1bc/0x1fc)
[  367.299675] [<80792f50>] (scsi_block_when_processing_errors) from [<807a4644>] (sd_open+0x58/0x174)
[  367.309704] [<807a4644>] (sd_open) from [<802c34a0>] (__blkdev_get+0x1bc/0x1fc)
[  367.468418] [<80792f50>] (scsi_block_when_processing_errors) from [<807a4644>] (sd_open+0x58/0x174)
[  367.478448] [<807a4644>] (sd_open) from [<802c34a0>] (__blkdev_get+0x1bc/0x1fc)
[  367.636981] [<80792f50>] (scsi_block_when_processing_errors) from [<807a4644>] (sd_open+0x58/0x174)
[  367.647034] [<807a4644>] (sd_open) from [<802c34a0>] (__blkdev_get+0x1bc/0x1fc)

lspci:
01:00.0 SCSI storage controller: Marvell Technology Group Ltd. 88SX7042 PCI-e 4-port SATA-II (rev 02)
	Subsystem: Marvell Technology Group Ltd. 88SX7042 PCI-e 4-port SATA-II
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Interrupt: pin A routed to IRQ 37
	Region 0: Memory at e0000000 (64-bit, non-prefetchable) [disabled] [size=1M]
	Region 2: I/O ports at 10000 [virtual] [size=256]
	Capabilities: [40] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [60] Express (v1) Legacy Endpoint, MSI 00
		DevCap:	MaxPayload 256 bytes, PhantFunc 0, Latency L0s <256ns, L1 <1us
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-
		DevCtl:	CorrErr- NonFatalErr- FatalErr- UnsupReq-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- NonFatalErr+ FatalErr- UnsupReq+ AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x4, ASPM L0s, Exit Latency L0s <256ns
			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
		LnkCtl:	ASPM Disabled; RCB 128 bytes, Disabled- CommClk-
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s (ok), Width x1 (downgraded)
			TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
	Capabilities: [100 v1] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP+ SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr+ BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
		AERCap:	First Error Pointer: 14, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn-
			MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
		HeaderLog: 00000001 0108000f e0028030 1d897473
	Kernel driver in use: sata_mv

default args for goflexhome:
GoFlexHome> printenv
arcNumber=3338
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=console=ttyS0,115200
device=0:1
devices=usb ide
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-goflexhome.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
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
partition=nand0,2
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 $scan_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: 2898/131068 bytes
GoFlexHome>

what could be the reason for this?

EDIT:
after changing some variables and removed all but 1 drive, it managed to boot without spamming message:
changed variables:
GoFlexHome> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
GoFlexHome> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
GoFlexHome> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
GoFlexHome> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
GoFlexHome> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
GoFlexHome> setenv bootcmd 'usb reset; run usb_bootcmd; usb stop; reset'
GoFlexHome> setenv devices usb sata 
GoFlexHome> setenv dtb_file /boot/dts/kirkwood-ds411j.dtb

what is the a proper way to boot bodhi kernel with new uboot?

Viewing all articles
Browse latest Browse all 903

Latest Images

Trending Articles



Latest Images