Welcome! Log In Create A New Profile

Advanced

Is possible to chainload Bodhi's Uboot from stock Uboot?

Posted by bobafetthotmail 
Is possible to chainload Bodhi's Uboot from stock Uboot?
June 29, 2015 05:22PM
I did an automated installer script to install debian and OMV into Zyxel NAS boxes from nsa310 onwards.

For nsa325 and the v2 it's not possible to disable reliably the watchdog without flashing your new uboot, and this is a bit of a problem for most of the intended audience of my installer.

I was wondering how to make a Uboot I could chainload from the stock Uboot to deal with these things.

This new Uboot should stay in an ext2 partition in either a Sata or a USB drive.

Otherwise a Uboot Standalone Application to disable the watchdog from stock Uboot
http://www.denx.de/wiki/view/DULG/UBootStandalone

Any idea?
Re: Is possible to chainload Bodhi's Uboot from stock Uboot?
June 29, 2015 05:59PM
bobafetthotmail,

No, it is not possible to chainload new u-boot from stock u-boot. This is due to the structural differences between the old and new u-boot code.

Note that it is possible to chainload some stock u-boot from the new u-boot. This is due to the way older u-boot versions were coded.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is possible to chainload Bodhi's Uboot from stock Uboot?
June 29, 2015 06:26PM
ok, what about the Uboot Standalone Application or Program? http://www.denx.de/wiki/U-Bootdoc/StandalonePrograms

I have the "go" command in stock Uboot (to run such applications).

I only need something to have the stock uboot write things to GPIO so it can disable the watchdog.
Re: Is possible to chainload Bodhi's Uboot from stock Uboot?
June 29, 2015 07:32PM
> ok, what about the Uboot Standalone Application or
> Program?
> http://www.denx.de/wiki/U-Bootdoc/StandaloneProgra
> ms
>
> I have the "go" command in stock Uboot (to run
> such applications).

Yes, it would work.

>
> I only need something to have the stock uboot
> write things to GPIO so it can disable the
> watchdog.

So if I understood it correctly, you only want to run stock u-boot with new Linux kernel? (I have not yet looked at your installer script).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is possible to chainload Bodhi's Uboot from stock Uboot?
June 30, 2015 12:58AM
Yes, I only need something I can place in a ext2 partition that can be used to disable the NSA325 watchdog before booting the kernel, without flashing a new Uboot.
I don't like the idea of flashing a new Uboot and then its envs with a script run by a crappy firmware without human intervention and a serial connection.
If my script fails no permanent damage is done (as even in worst case it will just waste time trying to boot from sata and USB before going back to boot its own firmware).
I think it would be perfectly possible to script the uboot upgrade though.

As for functionality, stock uboot is enough for zyxel 310 onwards.
Stock nsa310 Uboot can boot from USB drive, booting a dtb kernel works fine if the dtb is in the zImage (as you described in the kernel thread), and I can run your latest rootfs on my 310 (that has stock Uboot) from Sata and from USB.
I can live with a small ext2 /boot partition on system drive and most of the people that will use my installer script will probably never use netconsole.

I had to flash your Uboot in my nsa325v2 because the damn watchdog was pissing me off.

Zyxel NAS boxes have a very convenient backdoor that allows anyone to run on boot an arbitrary script from a specially prepared USB (usually used to install third party ffp package system), my installer script is similar to Arch ARM's installer but I made it smarter and safer. Posted it in the Debian section of this forum where I describe it in more detail (it is also heavily commented).

I think that with small modifications it would work as automated installer for most other kirkwood devices, once you get SSH access to them so you can wget the script and the boot/rootfs archives from the internet.




Also, if someone writes the uboot applications in some unused part of the NAND or places them in a ext2 or fat partition, could this help add functionality to a crappy stock Uboot, like ext4load or f2fsload or true netconsole or the thing that reads uEnv.txt? Or the ability to boot with dts files without embedding them in zImage (an updated bootm?).
Or booting from USB?
I would prefer this way, less risk of bricking if something goes wrong, so it can be automated with a script.

Maybe it's also easier than developing a new uboot for each box you plan to support as you are just adding a few functionality blobs on top of something that works already.

Point is, I only know what Google found, so I don't really know how much work would such "uboot standalone application" require. :)
I have decent linux knowledge, I can write or compile some things on my own too if given some directions.

But yeah, feel free to tell me you don't feel like doing it, I'm fine with it in any case.



Edited 9 time(s). Last edit at 06/30/2015 04:20AM by bobafetthotmail.
Re: Is possible to chainload Bodhi's Uboot from stock Uboot?
June 30, 2015 04:17AM
bobafetthotmail,

What you described is a big part of u-boot :) i.e. some function is not possible implement without bringing in a large part of u-boot.

Quote

Also, if someone writes the uboot applications in some unused part of the NAND or places them in a ext2 or fat partition, could this help add functionality to a crappy stock Uboot, like ext4load or f2fsload or true netconsole or the thing that reads uEnv.txt? Or the ability to boot with dts files without embedding them in zImage (an updated bootm?).
Could this theoretically be useful for boxes where the Uboot sucks and cannot boot from USB?
Useful as in "less risk of bricking if something goes wrong", so it can be automated with a script.

I think it is doable with a stand alone u-boot app to perform a utility like killing the watchdog. However, I don't think the benefit is worthy for the effort, i.e it is not reusable in other Kirkwood boxes.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is possible to chainload Bodhi's Uboot from stock Uboot?
June 30, 2015 04:26AM
Ok, thanks for the info.

I'm trying anyway though.

Can you tell me what is the command to kill the watchdog from Uboot?

Any other info on how to make the uboot application is welcome, but I can probably find that on my own too.
Re: Is possible to chainload Bodhi's Uboot from stock Uboot?
June 30, 2015 06:12AM
bobafetthotmail,

> Can you tell me what is the command to kill the
> watchdog from Uboot?

It is killed in the NSA325 board initialization code:
https://github.com/mibodhi/u-boot-kirkwood/blob/2014.07.c-kirkwood/board/zyxel/nsa325/nsa325.c#L123

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is possible to chainload Bodhi's Uboot from stock Uboot?
June 30, 2015 04:04PM
Cool.

Thanks again :-D
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: