PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Change bootargs in 7.27 U_boot,



kader_73
19.04.2020, 16:32
Hello ,

I would like to change the bootagrs in 7.27 loader of my hs7819 box; so as to load the kernel "uImage" in the first partition "FAT" then mount the image located in the second partition ext4 to run it

the goal is to be able to test new built image before flashing it.

can someone lend a hand to do that.

Regards

Audioniek
20.04.2020, 16:44
If you mean how to edit the bootargs, this is the way todo it:


Connect the receiver to a PC through RS-232;
Run a terminal program on the PC (baudrate is 115200, 8bit, no parity 1 stop bit);
Power the receiver on, and immediately start pressing the Enter key on the PC repeatedly until you see the prompt HDK7111>;
You are now in the bootloader environment;
To show the available commands, type printenv <Enter>
To edit a bootarg, enter setenv <bootarg name> <bootarg value>. If the <bootarg value> contains spaces, surround it with double quotes.
To check the changed value, do a printenv;
If everything is OK, write the bootargs back by entering saveenv <enter>
Restart the receiver.


Some notes: The bootarg for booting USB is fixed in code and cannot be edited. Be sure to switch USB boot off. Remember also that Fortis receivers cannot flash their bootargs. To put the originals back edit them back to their original values, or destroy the checksum. When the checksum is not correct, the default bootargs are written back on the next restart with USB boot switched off. Hint: to quickly work, I found it handy to use copy/paste from pre-entered text in an editor.

To give you an idea of how others have solved this, here are the bootargs of TDT MaxiBoot loader for an FS9000:

bootdelay=1
baudrate=115200
autoload=n
board=Twin
ethaddr=00:1E:B8:00:57:24
ipaddr=192.168.178.79
netmask=255.255.255.0
gatewayip=192.168.178.1
mtdargs=set bootargs console=ttyAS1,115200 nwhwconf=device:eth0,hwaddr:${ethaddr} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask} root=/dev/mtdblock3 rootfstype=squashfs bigphysarea=4060 stmmaceth=msglvl:0,watchdog:4000,rxsize:16 loglevel=0
usbargs=set bootargs console=ttyAS1,115200 nwhwconf=device:eth0,hwaddr:${ethaddr} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:$ {board}:eth0:off root=/dev/sd${sdx}${par} rw mem=128m coprocessor_mem=4m@0x10000000,4m@0x10400000 rootdelay=5 init=/bin/devinit
sdxconf=if test $hdd -eq 0 -a $usb -eq 0; then set sdx a; elif test $hdd -eq 1 -a $usb -eq 1; then set sdx c; else set sdx b; fi
backup=erase a0300000 a1ffffff; cp.b a5000000 a0300000 1d00000; run mtdargs; bootm a0300000
usbtool=usb reset; sleep 3; if fatload usb 0:1 a5000000 /uImage; then bootm a5000000; elif fatload usb 0:1 a5000000 /uBackup_${board}; then run backup; fi; run mtdargs; bootm a0300000
bootcmd=bootmenu $menutimeout $default
bootdesc_0=---Flash---
bootcmd_0=run mtdargs; bootm a0300000
bootdesc_1=--USB1 P1--
bootcmd_1=set usb 0; set par 1; run usbload; run sdxconf; run usbargs; bootm a5000000
bootdesc_2=--USB1 P2--
bootcmd_2=set usb 0; set par 2; run usbload; run sdxconf; run usbargs; bootm a5000000
bootdesc_3=--USB1 P3--
bootcmd_3=set usb 0; set par 3; run usbload; run sdxconf; run usbargs; bootm a5000000
bootdesc_4=--USB1 P4--
bootcmd_4=set usb 0; set par 4; run usbload; run sdxconf; run usbargs; bootm a5000000
bootdesc_5=--USB2 P1--
bootcmd_5=set usb 1; set par 1; run usbload; run sdxconf; run usbargs; bootm a5000000
bootdesc_6=--USB2 P2--
bootcmd_6=set usb 1; set par 2; run usbload; run sdxconf; run usbargs; bootm a5000000
bootdesc_7=--USB2 P3--
bootcmd_7=set usb 1; set par 3; run usbload; run sdxconf; run usbargs; bootm a5000000
bootdesc_8=--USB2 P4--
bootcmd_8=set usb 1; set par 4; run usbload; run sdxconf; run usbargs; bootm a5000000
bootdesc_9=--USB 112--
bootcmd_9=set usb 0; set par 2; run sdxconf; run usbargs; run usbtool
menutimeout=3000
hdd=1
usbload=usb reset; sleep 3; if fatload usb $usb:1 a5000000 /uImage; then; elif ext2load usb $usb: a5000000 /boot/uImage; then; fi
default=0
stdin=serial
stdout=serial
stderr=serial


Hope this all gives some clues.

Regards,

Audioniek.

sadaghiani
24.04.2020, 11:54
Is it possible to customize the third generation Fortis bootloader so that it can be multiboot via usb and like other devices installed by tar.gz file ?

kader_73
24.04.2020, 23:52
hello ;

thank you "Audioniek" for all explanations.

In last few days i was traying a diffirent combinations of "usbootargs" ,in particular one of sh1008se+ (pkt bootargs found on the forum). Using an old E2 ( HAARP v3) on tar.gz form . because the kernel build from your git don't start after been reading . my be due to somthing changed in the config file ?.

So here is the new bootargs env :

HDK7111> pri
bootdelay=0
baudrate=115200
board=hdk7111_INPUT_CLOCK_RATE
targetname=muso
hwnfconf=setenv nwhwnet device:eth0,hwaddr:$ethaddr
nfsserverconf=setenv nfs_server nfsroot=$serverip
ipconf=setenv ipaddrcfg ip=$ipaddr:$serverip:$gateway:$netmask:sdk:eth0:of f
cramfsbootargs=run hwnfconf;run ipconf;setenv bootargs console=ttyAS0,115200 root=/dev/mtdblock2 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs $ipaddrcfg nwhwconf=$nwhwnet bigphysarea=5000 stb7111:eth0:off stmmaceth=msglvl:0,phyaddr:2,watchdog:4000,rxsize: 16 $MTD loglevel=0
nfsbootargs=run hwnfconf;run nfsserverconf;run ipconf;setenv bootargs console=ttyAS0,115200 root=/dev/nfs $nfs_server:/opt/STM/STLinux-2.3/devkit/sh4/target,nfsvers=2,rsize=4096,wsize=8192,nolock,tcp nwhwconf=$nwhwnet $ipaddrcfg stmmaceth=msglvl:0,phyaddr:2,watchdog:4000,rxsize: 16 bigphysarea=5000
ipaddr=192.168.6.253
serverip=192.168.6.111
updt_all=nand erase clean;vfd updt_ker;updt_img
updt_boot=vfd LD;tftp 0x80000000 u-boot.bin;nand erase 0x00000000 0x00040000;nand write.jffs2 0x80000000 0x00000000 $filesize;vfd _End
updt_ker=vfd LD;tftp 0x80000000 vmlinux.ub.cram;nand erase 0x00500000 0x00300000;nand write.jffs2 0x80000000 0x00500000 $filesize;vfd _End
updt_img=vfd LD;tftp 0x80000000 root_ubi.img;nand erase 0x00800000 0x6000000;nand write.jffs2 0x80000000 0x00800000 $filesize;vfd _End
erase_config=nand erase 0x00400000 0x00100000
erase_eeprom=mw.b 80000000 ff 1000;eeprom_i2c write 0x80000000 0 0x001000
erase_env=nand erase 0x060000 0x20000
bootcmd=vfd Scan; sleep 2; if usb reset; then run usbboot; fi; vfd flash; nand read.jffs2 0x80000000 0x00500000 0x00300000; bootm 0x80000000
stdin=serial
stdout=serial
stderr=serial
ethaddr=00:1e:b8:0a:ae:a3
usbboot=if fatload usb 0:1 84000000 uImage; then vfd USB; run usbbootargs; bootm 84000000; fi
usbbootargs=run hwnfconf; run ipconf; setenv bootargs console=ttyAS0,115200 printk=0 root=/dev/sda2 rw rootdelay=5 bigphysarea=6000 coprocessor_mem=4m@0x40000000,4m@0x40400000 init=/bin/devinit
stmmaceth=stmmaceth=msglvl:0,phyaddr:2,watchdog:40 00,rxsize:16


Environment size: 2047/131068 bytes

and here is putty log after runing bootcmd :


HDK7111> run bootcmd
(Re)start USB...
Front USB: scanning bus for devices... 3 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
reading uImage
.................................................. .................................................. .................................................. .................................................. .................................................. .


2578408 bytes read
Linux version 2.6.23.17_stm23_0123 (root@djcrash) (gcc version 4.3.4 20091123 (STMicroelectronics/Linux Base) ) #1 PREEMPT Mon Oct 17 23 29 CEST 2011
Booting machvec: sat7111
Node 0: start_pfn = 0x40000, low = 0x48000
Zone PFN ranges:
Normal 262144 -> 294912
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 262144 -> 294912
STMicroelectronics sat7111 initialisation
STx7111 version 3.x
stx7111_configure_asc[0] port[2]
stx7111_configure_asc[1] port[3]
bpa2: partition spans low memory boundary
bpa2: failed to create 'bigphysarea' partition
bpa2: 'bigphysarea' partition skipped
bpa2: partition 'LMI_IO' created at 0x4a000000, size 98304 kB (0x06000000 B)
Built 1 zonelists in Zone order. Total pages: 32512
Kernel command line: console=ttyAS0,115200 printk=0 root=/dev/sda2 rw rootdelay=5 bigphysarea=6000 coprocessor_mem=4m@0x40000000,4m@0x40400000 init=/bin/devinit


as you can see , the process hangs on kernel command line.


Regards .

Audioniek
25.04.2020, 13:56
Is it possible to customize the third generation Fortis bootloader so that it can be multiboot via usb and like other devices installed by tar.gz file ?

This is exactly what this thread is about. Currently there is little to be gained by this approach. It involves extra work because the USB has to be partitioned with at least a FAT32 partition for the kernel and and ext3 partition for the rootsfs, whereas the current setup work with a "standard" partitioning with just one FAT32 partition. The only two advantages I see with this approach are more reliable booting and the possibility to change E2/Neutrino more easily.

Regards,

Audioniek.

- - - Aktualisiert - - -


...because the kernel build from your git don't start after been reading . my be due to somthing changed in the config file ?

You do not mention what version of the kernel you have built: the flash version or the USB version. You need the flash version for this approach. I think the cause of the hang can be read a few lines before the end in the log: the BPA2 partitioning runs into problems. The command line contains a bigphysarea specification that may conflict with the one in the kernel setup (see the setup patch file in patches/build-enigma2/linux-sh4-hs7819_setup_stm24_0217.patch, or the already patched setup.c in build_tmp/..linux../arch/sh/board/arch/sh/boards/mach-hdk7111

While working on the adb_box, I noticed strange things happening when bigphysarea= is used on the command line including stopping serial output. Try leaving it out and playing with the BPA2 setup in setup.c of the board.

Regards,

Audioniek.

kader_73
26.04.2020, 12:56
hello ,

The kernel used is the flash version ,

in the patch mentioned above , the "bigphysarea" setting is as follow:

+static struct bpa2_partition_desc bpa2_parts_table[] = {
+ {
+ .name = "bigphysarea",
+ .start = 0x48000000,
+ .size = 0x02000000, /* 32 Mb */
+ .flags = 0,
+ .aka = NULL

which value should be set in usbbootargs parameters to create "bigphysarea" partition correctly.

Edit: new test done with OpenVision "uImage" built from the git , kernel start and bigphysarea created properly ; with same command line .


Booting machvec: STx7111 HDKNode 0: start_pfn = 0x40000, low = 0x50000
Zone PFN ranges:
Normal 0x00040000 -> 0x00050000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00040000 -> 0x00050000
Fortis HS7819 main board initialisation
STx7111 version 3.x
bpa2: partition 'bigphysarea' created at 0x48000000, size 32768 kB (0x02000000 B)
bpa2: partition 'LMI_IO' created at 0x4a000000, size 98304 kB (0x06000000 B)
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: console=ttyAS0,115200 printk=0 root=/dev/sda2 rw rootdelay=5 bigphysarea=6000 coprocessor_mem=4m@0x40000000,4m@0x40400000 init=/bin/devinit

I think it's related to kernel config, not to the bigphysarea argument.

Regards