When pressing the reset button on boot the system will enter the
recovery mode, this is done by setting a preboot command. Inside the
preboot command we will sleep and then check if the button is still
pressed, then tftp will be used to download the image and flash it. If
something fails after the DHCP state the network console will be
enabled.
recovery: Make it possible to force the recovery
For factory flashing it is the easiest if we can force the
recovery process. Parse the "force" from a potential second
argument and then skip the timeout.
We now need to preifx ubi: to the filesystem to be mounted. This
means some users need to clear the environment. The following command
can be executed to delete the environment:
sysmoBTSv2 > mtdpart default; nand erase.part U-Boot-Environment
You need to clear the environment when you get this. The sysmocom
recovery will clear the environment as well.
UBIFS error (pid 0): ubifs_get_sb: cannot open "sysmobts-v2-rootfs", error -22
UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'sysmobts-v2-rootfs' errno=-22!
ubifsmount - mount UBIFS volume
LED0 is the "RF Active"/Yellow LED on the sysmobts-v2. We are not
using the 'yellow' LED alias as one needs to provide two functions
that call __led_set on led_yellow_on and led_yellow_off. Initialize
the GPIO direction in the board routine as the status_led code will
not be used.
The only ARM/kernel visible change is the change of the EEPROM. U-Boot
sadly does not support to select EEPROM with different page sizes and
address length. This is why we need to patch the common epprom code.
Introduce a new command to allow dynamic configuration of the EEPROM,
move the eeprom parameters into variables and change the code. This sadly
copies the SPI_X code as well. The address creation could be moved to
a different variable.
This code has been tested on RevC and RevD hardware and an IP address
could be obtained in both cases.
Re-worked for eeprom.c changes and only patched the address code
sysmobts-v2: Increase the malloc length to 10MB for ubifs recovery
Sometimes the ubifs can not be recovered and this is due not being
able to allocate enough memory. Increase the RAM size to something
that is hopefully 10MB of RAM.