Show U-Boot variables

AmigaOne X5000 platform specific issues related to Linux only.
Post Reply
User avatar
xeno74
Posts: 9385
Joined: Fri Mar 23, 2012 7:58 am

Show U-Boot variables

Post by xeno74 »

Package: u-boot-tools (Ubuntu, MintPPC etc.)

Command: fw_printenv

Edit the file fw_env.config in /etc. To create this file, you need to know information about where U-Boot stores its env variables. Specifically, you need the mmcblk device name, the device offset, the env size and the flash sector size.

fw_env.config file:

Code: Select all

  # Configuration file for fw_(printenv/setenv) utility.
  # Up to two entries are valid, in this case the redundant
  # environment sector is assumed present.
  # MTD device name       Device offset   Env. size       Flash sector size
        /dev/mmcblk0     0x99C00          0x4000         0x100
Unfortunately we don't know the device offset, the env size and the flash sector size.
Last edited by xeno74 on Sat Dec 18, 2021 10:46 am, edited 1 time in total.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1716
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Show U-Boot variables

Post by nbache »

The comments in the file you show above mention also an fw_setenv utility.

Does this work under Linux on your X5000? Both /20 and /40?

Best regards,

Niels
User avatar
xeno74
Posts: 9385
Joined: Fri Mar 23, 2012 7:58 am

Re: Show U-Boot variables

Post by xeno74 »

I get the U-Boot variables with PuTTY via a null modem RS-232 serial cable.

Image

PuTTY log: PuTTY_X5000_40_U-Boot.log
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9385
Joined: Fri Mar 23, 2012 7:58 am

Re: Show U-Boot variables

Post by xeno74 »

nbache wrote: Fri Dec 17, 2021 9:47 pm The comments in the file you show above mention also an fw_setenv utility.

Does this work under Linux on your X5000? Both /20 and /40?

Best regards,

Niels
No, it doesn't because I don't know the device offset, the env size and the flash sector size.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1716
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Show U-Boot variables

Post by nbache »

@xeno74:

Try contacting Tony Wyatt directly - I believe he can't read the Linux groups here. But I'm relatively sure he can help.

Best regards,

Niels
User avatar
xeno74
Posts: 9385
Joined: Fri Mar 23, 2012 7:58 am

Re: Show U-Boot variables

Post by xeno74 »

Maybe this fw_env.config file works:

Code: Select all

  # Configuration file for fw_(printenv/setenv) utility.
  # Up to two entries are valid, in this case the redundant
  # environment sector is assumed present.
  # MTD device name       Device offset   Env. size       Flash sector size
        /dev/mmcblk0     0x89200          0x2000         0x200
Thanks a lot to Skateman and Jamie Krueger for the values.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
Skateman
Posts: 864
Joined: Thu Aug 10, 2017 8:36 pm
Location: The Netherlands

Re: Show U-Boot variables

Post by Skateman »

I have tried the Values but did not work on my machine... (might be due to the 2018 Olson U-Boot version)

With a "stock" u-boot version that came with the X5K the above values could work.
(would be nice if that could be tried by someone)

Further investigation needed regarding the later 2018 Olson u-boot.
AmigaOne X5000 -> 2GHz / 16GB RAM / Radeon RX 570 / Radeon X1950 / M-Audio 5.1 -> AmigaOS / Linux
Amiga 1200 -> Recapped / 68ec020 ACA 1221ec / CF HDD / RetroNET connected to the world
Vampire 4SA - RPi4 Running AmiKitXE Full
User avatar
xeno74
Posts: 9385
Joined: Fri Mar 23, 2012 7:58 am

Re: Show U-Boot variables

Post by xeno74 »

xeno74 wrote: Tue Dec 21, 2021 5:52 am Maybe this fw_env.config file works:

Code: Select all

  # Configuration file for fw_(printenv/setenv) utility.
  # Up to two entries are valid, in this case the redundant
  # environment sector is assumed present.
  # MTD device name       Device offset   Env. size       Flash sector size
        /dev/mmcblk0     0x89200          0x2000         0x200
Thanks a lot to Skateman and Jamie Krueger for the values.
It works with MintPPC on my X5000/40! :-) Version: U-Boot aeon-2020-11-14 (Nov 14 2020 - 23:49:16)

fw_printenv --version

Code: Select all

0.3.2
fw_printenv

Output:

Code: Select all

amigaboot_quiet=n
amigabootmenu_animate=1
amigabootmenu_animcycles=10
amigabootmenu_default=2
amigabootmenu_delay=1
amigabootmenu_timeout=0
baudrate=115200
bdev=sda3
bootargs=root=/dev/sda2 mem=3500M console=ttyS0,115200 console=tty0
bootargs_live=root=/dev/ramdisk boot=casper mem=3500M ro --
bootargs_live_debug=root=/dev/ramdisk boot=casper mem=3500M ro break debug
bootcmd=setenv bootargs root=/dev/$bdev rw console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
bootdelay=10
bootdvd=scsi reset ; load scsi 0 2000000 boot_dvd ; bootm 2000000
bootfile=uImage
consoledev=ttyS0
eth1addr=00:1E:C0:F8:01:59
ethact=FM1@DTSEC5
ethaddr=00:04:A3:6B:41:65
ethernetboot=echo Running Ethernet Boot
ethprime=FM1@DTSEC4
fdtaddr=c00000
fman_ucode=7fe87128
harddiskboot=echo Running Hard Disk Boot
hwconfig=fsl_ddr:ctlr_intlv=cacheline,bank_intlv=cs0_cs1;usb1:dr_mode=host,phy_type=utmi;usb2:dr_mode=host,phy_type=utmi
linuxboot=setenv bootargs root=/dev/sda4 ; load sata 1:1 1000000 uImage-5.10 ; load sata 1:1 2000000 cyrus-p5040.dtb ; bootm 1000000 - 2000000
liveusb=usb start ; setenv bootargs_live_debug ; ext2load usb 1:1 2000000 boot_dvd ; bootm 2000000
loadaddr=1000000
massboot=echo Running Mass Storage Boot
mos=bootmorphos
netdev=eth0
nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
opticalboot=echo Running Optical Boot
os4_bootdevice=auto
os4_commandline=debug munge debuglevel=0
preboot=ami
ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr
ramdiskaddr=2000000
ramdiskfile=ramdisk.uboot
rootpath=/opt/nfsroot
scsidevs=1
stdin=usbkbd,serial
stdout=serial,vga
uboot=u-boot.bin
ubootaddr=0xFFF80000
Image

It seems, that we need different values for each U-Boot version.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
Skateman
Posts: 864
Joined: Thu Aug 10, 2017 8:36 pm
Location: The Netherlands

Re: Show U-Boot variables

Post by Skateman »

Great!!! Good thing it works on your machine.
AmigaOne X5000 -> 2GHz / 16GB RAM / Radeon RX 570 / Radeon X1950 / M-Audio 5.1 -> AmigaOS / Linux
Amiga 1200 -> Recapped / 68ec020 ACA 1221ec / CF HDD / RetroNET connected to the world
Vampire 4SA - RPi4 Running AmiKitXE Full
Post Reply