avr with u-boot on ls hg
- Hi experts,
I'm trying to install u-boot on my LinkStation HG. I've got everything
working but one detail: When running u-boot as a RAM build using
uloader.o the AVR isn't initialized by either u-boot or the booted
kernel. It can't be initialized manually either. Commands sent to
it are ignored and the machine reboots after about 5 minutes.
Is this supposed to happen and will be all right once the flash build is
flashed or is something wrong with my setup? I'm reluctant to try
flashing it because I don't have a serial console or JTAG for the box.
- current Gentoo ~ppc with glibc-2.3.6 and gcc-4.1.1
- kernel 2.6.20 ppc-based started using loader.o
- uloader.o for stock kernel 2.4.20_mvl31-ppc_linkstation compiled using
- kernel 188.8.131.52 ppc-based
- kernel 2.6.20 powerpc-fdt-based
- u-boot-1.1.4 with LS patch 2.1.0
- u-boot-86xx git current with Guennadi Liakhovetski's patches
What I've tried so far:
- ppc-based kernel with u-boot-1.1.4
- powerpc-based kernel with u-boot-86xx-git
- powerpc-based kernel with u-boot-86xx-git compiled using gcc-3.4.6
- flboot of stock kernel using u-boot-86xx-git
- sending commands to different ttys (ttyS0 [no change], ttyS2 [i/o
In all cases the power led keeps blinking rapidly, commands sent to the
AVR are ignored and the machine reboots after a few minutes. Also the
minimal console using the power button doesn't work. Otherwise
everything behaves as expected: netconsole works in u-boot, loading of
uImage kernels works for ppc-based and powerpc-fdt-based kernels,
netconsole works for the kernel and the system runs normally.
I've seen that the RAM build doesn't initialise the UARTs in
early_init.S. Does this have something to do with my observations?
Any help would be greatly appreciated because this is the last obstacle
in switching to u-boot.
I like Kaba!
- On Sun, Feb 18, 2007 at 10:23:46PM +0100, Michael Weiser wrote:
> In all cases the power led keeps blinking rapidly, commands sent to theAddendum: When loading a 2.6.20 ppc-based kernel using loader.o, the avr
> AVR are ignored and the machine reboots after a few minutes. Also the
> minimal console using the power button doesn't work. Otherwise
can be initialised manually using echo -n "[[[[" >/dev/ttyS1 and the
like. The problem seems to be uboot-specific, not hardware-related.
- On Mon, Feb 19, 2007 at 01:05:32PM +0100, Michael Weiser wrote:
> > In all cases the power led keeps blinking rapidly, commands sent to thePrivate mail from linuxnotincluded gives the answer:
> > AVR are ignored and the machine reboots after a few minutes. Also the
> > minimal console using the power button doesn't work. Otherwise
> Addendum: When loading a 2.6.20 ppc-based kernel using loader.o, the avr
> can be initialised manually using echo -n "[[[[" >/dev/ttyS1 and the
> like. The problem seems to be uboot-specific, not hardware-related.
What appears to happen to your setup is that the AVR receives the reboot
command from the kernel before passing the control to u-boot. Once the
reboot command is issued to the AVR, there is no going back. The AVR
_will_ reboot the LinkStation. The power LED blinking fast is what shows
that the AVR is in this state.
The problem with uloader is that it attempts to leave as much as
possible from the shutdown to happen in order for the disks to be shut
down properly but before the reboot string is sent to the AVR. Depending
on the original kernel, the assumptions made by uloader may be
I will have to look again at the sources about the UART initialisation
but, as I said before, the AVR will ignore any commands once it receives
the reboot command. This is why the minimal console doesn't work. The
buttons are read by the AVR which passes the information to u-boot (or
to the kernel).
This doesn't happen when u-boot is in flash because u-boot takes over
the LinkStation when the AVR has been re-armed and ready to accept
If the AVR is your only problem and everything else works for you, then
the risk of flashing u-boot is small. Lots of people have done it and I
haven't heard of any problems. Unfortunately, there are no absolute
guarantees. Even if you u-boot build is fine, there is always the risk
of power loss during the flash and there have been reports of defective
flash chips, fortunately not in the u-boot area.
If you take the chance and something goes wrong, you can still find
somebody in your area willing to fix your box for you. You can post the
question in the Linstationwiki forums and see if there is anyone in your
So I patched uloader:
--- uloader_mod.c.orig 2006-08-26 15:07:23.000000000 +0200
+++ uloader_mod.c 2007-02-22 00:18:41.000000000 +0100
@@ -207,7 +207,8 @@
if((err = read_file(uboot, &uboot_buf)))
+ load_uboot(va2pa(load_uboot), va2pa(uboot_buf), laddr);
and tried again. The RAM build worked nicely then, so I was comfortable
flashing the flash build. I've got the box running now with Guennadi's
powerpc-based 2.6.20 kernel and everything seems to be just fine.