Welcome! Log In Create A New Profile

Advanced

uBoot does not count down in Serial Console (Pogo E02) [SOLVED]

Posted by bodhi 
uBoot does not count down in Serial Console (Pogo E02) [SOLVED]
April 14, 2013 10:47PM
I'm running davy's uBoot on my Pogo E02:

Netconsole:
U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
Pogoplug E02
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot: 10

I have serial console connected to this E02 and it is strange that I don't see the count down.
U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
Pogoplug E02

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Using egiga0 device
host 192.168.0.220 is alive

uBoot env for boot delay:

bootdelay=3

Anybody knows why? if you have serial console on Pogo E02, does yours have a countdown?



Edited 4 time(s). Last edit at 04/16/2013 02:28AM by bodhi.
Re: uBoot does not count down in Serial Console (Pogo E02)
April 15, 2013 04:55PM
I presume it's because, even though you have a connection to the serial console, you still are directing uBoot to use the netconsole. So, the initial uBoot info comes out on the serial console, up to the point where the uBoot executes the "preboot" command ("run if_netconsole start_netconsole", which redirects stdin, stdout, and stderr) and after that the remaining output is sent to the netconsole.

Unset the "preboot" variable and see if this changes things. Or, you could try disconnecting either the box serving as the net console or the Pogoplug itself from your LAN, which should theoretically prevent the "start_netconsole" command and keep the output on the serial console. (If you do the latter, replug the Pogoplug after you see the countdown commence so that Linux can initialize the ethernet when it comes up.)
Re: uBoot does not count down in Serial Console (Pogo E02)
April 16, 2013 12:18AM
Thanks restamp,

That was awesome! The problem was just exactly what you've diagnosed :) I have netconsole and serial console connected from the same server! Unset preboot env and got the uBoot prompt again. Now I can go on to testing uBoot.

- bodhi
Re: uBoot does not count down in Serial Console (Pogo E02)
April 16, 2013 09:50AM
On my e02, I confirmed that uboot output its log to either netconsole or serial console:

First to serial console:
U-Boot 2011.12 (Jun 08 2012 - 11:41:39)
Pogoplug E02

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Using egiga0 device
host ... is alive

Then to the netconsole:
U-Boot 2011.12 (Jun 08 2012 - 11:41:39)
Pogoplug E02
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  0
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 6 USB Device(s) found
       scanning bus for storage devices... 2 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
.
.
.
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.6.11-20130403-141642
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1740328 Bytes = 1.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-3.6.11-20130403-141642
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6379187 Bytes = 6.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Last back to serial console:
Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.6.11-20130403-141642 (root@pink) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 PREEMPT Wed Apr 3 15:30:47 CDT 2013
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: Pogoplug E02
.
.
.
Debian GNU/Linux 7.0 punk ttyS0

punk login:

So the count down is in the netconsole if netconsole is set up. I also use davy's newer version of uboot which warrants e02's arcNumber without the need of machid.

-syong
Re: uBoot does not count down in Serial Console (Pogo E02)
April 16, 2013 02:32PM
Hi syong,

Thanks! did you flash davy's e02 new version right away to NAND, or did you try running it from RAM first this way:

Interrupt uBoot at the cound down, and at the prompt:

mw 0x600000 0 1 
usb start
ext2load usb 0:1 0x600000 /uboot.pogoplugE02-L2Coff-arcNumFixed.kwb 
go 0x600200
or
mw 0x800000 0 1 
usb start
ext2load usb 0:1 0x800000 /uboot.pogoplugE02-L2Coff-arcNumFixed.kwb 
go 0x800200

I'm very interested to know if you can run it from RAM like described above. Note that the uBoot image should be copied to the root directory of your rootfs USB drive first. If it hang, then recycle the power to reboot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 04/16/2013 02:41PM by bodhi.
Re: uBoot does not count down in Serial Console (Pogo E02)
April 16, 2013 04:42PM
bodhi,

With faith in luck, I flashed davy's e02 new version right away to NAND.

-syong
Re: uBoot does not count down in Serial Console (Pogo E02)
April 16, 2013 10:06PM
With my e02 beside me, I have tested the new uboot. Here is my finding:

  • Loading uboot to 0x800000 works, to 0x600000 failed.
  • I have succeeded without `mw 0x800000 0 1'. Is it a test?
  • tftp works as well as usb load.
  • To stop counting down in netconsole, the return key works as well as C-j.

-syong
Re: uBoot does not count down in Serial Console (Pogo E02)
April 16, 2013 11:02PM
@syong,

Thanks, it's good to know. It would confirm Davy's finding of whether we can run in RAM: uBoot version must be almost identical. In your test and rpress test, you both loaded the same uBoot image in RAM and run it. I've only tried a new version in my tests. I think that's what I am going to test next, make sure I can run the same version. It won't help in testing a new uBoot build for Pogo E02 and Dockstar, though (for recovery purpose there's UART booting, but it only works for certain Kirkwood boxes).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: uBoot does not count down in Serial Console (Pogo E02)
April 16, 2013 11:33PM
@bodhi,

You are right. I vaguely remembered failed to load new boot to RAM when I used the old uboot.

-syong
Re: uBoot does not count down in Serial Console (Pogo E02)
April 17, 2013 02:13AM
syong,

> [*] I have succeeded without `mw 0x800000 0 1'. Is
> it a test?

This is just to clear memory for warm start (mw for memory write).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: uBoot does not count down in Serial Console (Pogo E02)
April 17, 2013 09:37AM
Thanks.

As a uboot newbie, I am still wondering why only clean 4 bytes starting at 0x800000? How does this relate to warm start?

-syong
Re: uBoot does not count down in Serial Console (Pogo E02)
April 19, 2013 02:14AM
Syong,

I'm as much a newbie as you are :) we all learn from Jeff, Davy, and Pazos, and a few others.

If you look at the Kirkwood header code, the first byte is the boot option/command:

#ifndef _KWBIMAGE_H_
#define _KWBIMAGE_H_

#include <stdint.h>

#define KWBIMAGE_MAX_CONFIG	((0x1dc - 0x20)/sizeof(struct reg_config))
#define MAX_TEMPBUF_LEN		32

/* NAND ECC Mode */
#define IBR_HDR_ECC_DEFAULT		0x00
#define IBR_HDR_ECC_FORCED_HAMMING	0x01
#define IBR_HDR_ECC_FORCED_RS  		0x02
#define IBR_HDR_ECC_DISABLED  		0x03

/* Boot Type - block ID */
#define IBR_HDR_I2C_ID			0x4D
#define IBR_HDR_SPI_ID			0x5A
#define IBR_HDR_NAND_ID			0x8B
#define IBR_HDR_SATA_ID			0x78
#define IBR_HDR_PEX_ID			0x9C
#define IBR_HDR_UART_ID			0x69
#define IBR_DEF_ATTRIB	 		0x00

enum kwbimage_cmd {
	CMD_INVALID,
	CMD_BOOT_FROM,
	CMD_NAND_ECC_MODE,
	CMD_NAND_PAGE_SIZE,
	CMD_SATA_PIO_MODE,
	CMD_DDR_INIT_DELAY,
	CMD_DATA
};

enum kwbimage_cmd_types {
	CFG_INVALID = -1,
	CFG_COMMAND,
	CFG_DATA0,
	CFG_DATA1
};

/* typedefs */
typedef struct bhr_t {
	uint8_t blockid;		/*0     */
	uint8_t nandeccmode;		/*1     */
	uint16_t nandpagesize;		/*2-3   */
	uint32_t blocksize;		/*4-7   */
	uint32_t rsvd1;			/*8-11  */
	uint32_t srcaddr;		/*12-15 */
	uint32_t destaddr;		/*16-19 */
	uint32_t execaddr;		/*20-23 */
	uint8_t satapiomode;		/*24    */
	uint8_t rsvd3;			/*25    */
	uint16_t ddrinitdelay;		/*26-27 */
	uint16_t rsvd2;			/*28-29 */
	uint8_t ext;			/*30    */
	uint8_t checkSum;		/*31    */
} bhr_t, *pbhr_t;

struct reg_config {
	uint32_t raddr;
	uint32_t rdata;
};

typedef struct extbhr_t {
	uint32_t dramregsoffs;
	uint8_t rsrvd1[0x20 - sizeof(uint32_t)];
	struct reg_config rcfg[KWBIMAGE_MAX_CONFIG];
	uint8_t rsrvd2[7];
	uint8_t checkSum;
} extbhr_t, *pextbhr_t;

struct kwb_header {
	bhr_t kwb_hdr;
	extbhr_t kwb_exthdr;
};

/*
 * functions
 */
void init_kwb_image_type (void);

#endif /* _KWBIMAGE_H_ */



Edited 1 time(s). Last edit at 04/19/2013 02:17AM by bodhi.
Re: uBoot does not count down in Serial Console (Pogo E02)
April 19, 2013 03:28PM
Thanks, bodhi. The header file is really informative!

Here is what I found in Jeff's patch to e02 in mach-pinkpogo.patch:

+  /* Zero the first bit at 0x800000 to clear any old image still in RAM after a warm reboot */\ 
+  "usb_load_uimage=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage\0"\

However, my question still remains: does the following ext2load sufficient to clear any old image? If not, why?

-syong
Re: uBoot does not count down in Serial Console (Pogo E02)
May 04, 2013 06:00PM
@syong,

I don't think it matters to do this anymore. At one point there must have been a problem with ext2load. Just out of habit/convention, we do clear this bit. I have one plug that has u-Boot env that loads uImage and never clear this bit withtthout any problem.

The same thing with rootfstype, we tend to set it to ext2 or ext3. But if you just remove the env for rootfstype and from the kernel bootargs list, it will boot ext2 or ext3 rootfs just fine.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 05/04/2013 06:58PM by bodhi.
Re: uBoot does not count down in Serial Console (Pogo E02)
May 04, 2013 11:49PM
@bodhi,

Can we call it trace of hacking? :)

-syong
Re: uBoot does not count down in Serial Console (Pogo E02)
May 05, 2013 12:34AM
@syong,

:) you bet! whatever works, right? hard to keep track of what people has fixed. And sometime the fixes introduce new bug :) I'm struggling to find out why netconsole is broken in u-boot.2013.01. A lot of code changes from the Davy's version to this 2013.01 in netconsole. Epspecially I've never read this code before until now.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: uBoot does not count down in Serial Console (Pogo E02)
May 05, 2013 10:10AM
@bodhi,

I found e02 is officially supported by uboot and Davy is the maintainer. He cleaned the env a bit and there is reset_phy() function might be relevant to the netconsole problem.

I just got a buspirate but have not play it yet. What kind of jtag cable do you use to test uboot?

-syong



Edited 1 time(s). Last edit at 05/05/2013 10:13AM by syong.
Re: uBoot does not count down in Serial Console (Pogo E02)
May 05, 2013 03:37PM
Syong,

Yes indeed, and Davy's Pogo E02 works fine in my test with non-FDT kernel http://forum.doozan.com/read.php?2,8177,12343#msg-12343. Perhaps I should start a different uBoot thread to get the info in one place.

Re the netconsole problem (lost 2nd character in command) , I'm seeing in both GoFlex Net and Pogo E02 build. So it seems to point to something common, either in general or Kirkwood? I'm not sure yet.

I don't have JTAG with me to test atm (not sure what I have). I'm testing all u-Boot builds on a GoFlex Net using UART booting.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: