New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

uboot update needed.

Got problems with your B2 or B3? Share and get helped!
Stryker
Posts: 56
Joined: 17 Oct 2013, 11:03

Re: uboot update needed.

Post by Stryker »

In light of the recent Heartbleed-Bug I feel a little uncomfortable with my B3 running Mouette's 3.0.xyz Custom Wheezy Kernel which is unable to update OpenSSL to a safe version.
So I would like to come back to the idea of getting the B3 to work with newer Kernels.
I will just lay out my thoughts and you guys please correct me when I am wrong:

The B3-Device has some special features, that require additional program-code to be added (patched) to a default-kernel.
Therefore, if you want a newer kernel on your B3, you will have to take the kernel-sourcecode, apply the B3-patches and then compile it for ARM-architecture.

Now there is this issue with the buggy uboot-Bootloader, that makes it unable to boot any kernel >= 3.1, because they use the CONFIG_ARM_PATCH_PHYS_VIRT-Flag.
So you would have to patch the uboot as well to make it work, but not for kernels after 3.15?
Patching the uboot seems to be the true solution, while making the kernel do some magic seems to be a workaround.

The uboot resides in the three mtd-flashmemories on the board, that can be accessed (only?) via serial console.
You patch them by writing the new image to the memory itself.
Where do I get the "new" image?
Is it just a stock uboot, that I can take or do I just download the buggy one, correct the buggy lines and then write it back memory?
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: uboot update needed.

Post by johannes »

Just a note about uboot, we once made an experimental update to uboot:

https://github.com/Excito/uboot-updated

Also you _can_ access the flash memory (i.e. to program a new uboot) from within Linux, but if you fail and it doesn't boot, you need a serial port to use the hardware bootloader to flash a new uboot.
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
asl
Posts: 23
Joined: 07 Feb 2011, 14:17

Re: uboot update needed.

Post by asl »

Stryker wrote:In light of the recent Heartbleed-Bug I feel a little uncomfortable with my B3 running Mouette's 3.0.xyz Custom Wheezy Kernel which is unable to update OpenSSL to a safe version.
There should be no relationship between kernel version and openssl version. You should be able to upgrade OpenSSL, (or downgrade to an older version before heartbleed) without changing the kernel.
Stryker wrote: So I would like to come back to the idea of getting the B3 to work with newer Kernels.
Mainline version 3.15 has support for B3. If you have the old version of uboot, and don't want to upgrade uboot, just append the needed machine code instructions to disable the cache to the start of the kernel. This is well documented, and there is a link in the v3.15 sources.
Stryker wrote: The B3-Device has some special features, that require additional program-code to be added (patched) to a default-kernel.
There a three "features" which mainline does not have:

The Ethernet LEDs probably don't have the right flashing patterns/link states

There is no hack in the wireless driver to use wireless frequencies which your region does not allow. You should not be doing this anyway, and the FCC, BAKOM, etc, won't be happy you are using the wrong bands

There is no support for hardware driven flashing of the LEDs. However software can still flash them.
Damarus
Posts: 4
Joined: 02 Jun 2014, 07:38

Re: uboot update needed.

Post by Damarus »

Now that Kernel 3.15 has been released, what is needed to get it running on the B3? I would prefer to use Arch Linux, so can I just flash the Kirkwood mainline package from the archlinuxarm site via USB and be good to go?
asl
Posts: 23
Joined: 07 Feb 2011, 14:17

Re: uboot update needed.

Post by asl »

It depends on how old your uboot is. If it is too old, you need to put a wrapper around the kernel. See:

http://lists.debian.org/debian-arm/2012 ... 00128.html

You also need to enable CONFIG_ARM_APPENDED_DTB and make sure the .dtb file is appended to the kernel. I've not used archlinux so i have no idea if that is supported. Debians flash-kernel does support this, if you have the correct entries in its database.

Sorry i cannot help too much. Being a kernel hacker i tend to build and boot the kernel by hand, and not use distribution methods.
Henri
Posts: 62
Joined: 14 Jul 2009, 07:56

Re: uboot update needed.

Post by Henri »

Nice to see that someone is still trying to fix this uboot problem and update Kernel.
I hope it works out. Unfortunately I have no knowleadge or skills to help.

As a mobile 4G user, I hear that more recent Kernels has built in support for Qualcom QMI driver. QMI is needed to switch 4G modem from serial port device to Ethernet over USB mode and get more bandwidth out of it.
asl
Posts: 23
Joined: 07 Feb 2011, 14:17

Re: uboot update needed.

Post by asl »

What would be nice is if excito invested some time to really test this kernel, and package it up cleanly in a Debian package and put out an experimental update to use it.

There is talk of a new long term kernel coming soon, maybe v3.16 or v3.17, which Debian would adopt. It would be nice if B3 was supported in Debian upstream by then.
switchgott
Posts: 21
Joined: 12 Jun 2014, 17:00

Re: uboot update needed.

Post by switchgott »

Hi,
where can i get the neweset uboot for oure B3?
asl
Posts: 23
Joined: 07 Feb 2011, 14:17

Re: uboot update needed.

Post by asl »

Upgrading uboot has its risks. Unless you really know what you are doing, it is probably safer to put the wrapper around the kernel as described in the Debian email i included a link to.
switchgott
Posts: 21
Joined: 12 Jun 2014, 17:00

Re: uboot update needed.

Post by switchgott »

Hi,

so how can i see which is the neweset version from uboot installed on b3?

Thanks
misty soul
Posts: 12
Joined: 06 Oct 2013, 07:45

Re: uboot update needed.

Post by misty soul »

switchgott wrote:Hi,

so how can i see which is the neweset version from uboot installed on b3?

Thanks
One tricky way to look at this is to search for some strings directly from the flash memory.
So get root access on your B3 (for axample using SSH from another machine) and run the following command:

Code: Select all

strings /dev/mtd0 | grep "^U-Boot "
If you see something like:

Code: Select all

U-Boot 2010.06-rc2-00064-gf41e8d8-dirty (Sep 08 2010 - 13:06:20)
then you have a very old u-boot from a B3 several years ago.

If you see something like:

Code: Select all

U-Boot 2010.06 (Jun 10 2011 - 09:06:51)
then you have a u-boot set up by excito to support 3 terabytes disks, but still not supporting recent kernels (I got this version in a B3 I purchased a few weeks ago, and checked it is exactly the same you get from update.excito.net/install/b3/uboot/).

If you see something like:

Code: Select all

U-Boot 2013.01-rc1-g64525a2 (---some random date here---)
then you have a custom-compiled u-boot corresponding to the link Johannes gave in this thread back in November. The random date would correspond to the date at which this u-boot was compiled (for me its today!). This u-boot does include the patch for L2cache.
paulchany
Posts: 123
Joined: 10 Jul 2009, 15:48
Location: Serbia
Contact:

Re: uboot update needed.

Post by paulchany »

Hi,

I red this very interesting topic from the beginning, but I'm not quite sure what should I do with my Bubba2 to get on it a running kernel version 3.2.51?

I run as root the command on my Bubba2:

Code: Select all

strings /dev/mtd0 | grep "U-Boot "
and get the output:
VU-Boot 1.3.4-00056-gf6f51b1-dirty (Nov 4 2008 - 18:48:46) MPC83XX

Can anybody advices me what step is needed to achieve this goal?
Best, Pali
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: uboot update needed.

Post by Gordon »

Just reviewing this thread, I found a very interesting article that explains why the MAC addresses are lost with the experimental uboot (is this the one posted by Johannes on 05 Nov 2013, 10:27?).

So essentially this means that you need to have the serial console access to be able to upgrade uboot and thus it is not for the faint-hearted to prep their B3 for running a 3.x kernel.
misty soul
Posts: 12
Joined: 06 Oct 2013, 07:45

Re: uboot update needed.

Post by misty soul »

Gordon wrote:Just reviewing this thread, I found a very interesting article that explains why the MAC addresses are lost with the experimental uboot (is this the one posted by Johannes on 05 Nov 2013, 10:27?).
I am not sure it will work.
I did upgrade my u-bott a few days ago. I did it the hard way, as I was not able to simply put the new u-boot in a USB stick (this implied compiling the source Johannes gave a link to, installing mtd-utils to be able to erase and write on the flash memory from Linux, and almost bricking my device). Once this new u-boot was installed, I did experience the MAX adress reset problem. I solved it by mounting the disk on another computer and modifying the interface definition for eth1 in /etc/network/interfaces to include a line

Code: Select all

hwaddress ether 00:22:02:00:xx:xx
where 00:22:02:00:xx:xx was my initial MAC adress. This works (and should even work beter if you update /etc/network/interface before rebooting so you don't have to unplug your disk).

However, if I look at the flash environment using fw_printenv, I see the initial MAC adresses are still there! So I'm not sure setting them from u-boot would help as in my case they are already set but not used. I see it clearly because both MAC address (one for the WAN port and one for the LAN port) are set, but since my /etc/network/interfaces only set up one, a the end I still do not have the second MAC. So the adresses are already known, but for some reason Linux does not see them. Looking carefully to the /var/log/messages file for boot messages, I see that at the very beginning, when kernel starts, it sees adresses 00:00:00:00:00:00, so the adress for eth1 is reset properly at a much later time in the boot sequence, when network is set up and the /etc/network/interfaces file is read, where I did put the address for eth1 only.

Do someone know why the old u-boot did take the u-boot environment variables ethaddr and eth1addr into account and the new one from Excito github does not?
Gordon wrote:So essentially this means that you need to have the serial console access to be able to upgrade uboot and thus it is not for the faint-hearted to prep their B3 for running a 3.x kernel.
Well, you can upgrade u-boot without serial console (I did it, and even without USB), but I would not recommend it to anyone.

I would really much like to understand (and fix) this MAC adress resetting problem. Any help would be welcome!
paulchany
Posts: 123
Joined: 10 Jul 2009, 15:48
Location: Serbia
Contact:

Re: uboot update needed.

Post by paulchany »

Gordon wrote:So essentially this means that you need to have the serial console access to be able to upgrade uboot and thus it is not for the faint-hearted to prep their B3 for running a 3.x kernel.
Can I use this image bellow for my Bubba2 too, to connect to the serial port?
http://wiki.mybubba.org/wiki/index.php? ... cess_on_B3
Last edited by paulchany on 05 May 2015, 10:27, edited 2 times in total.
Best, Pali
Post Reply