Welcome! Log In Create A New Profile

Advanced

Kirkwood U-boot - Getting all supported Kirkwoods on-board

Posted by WarheadsSE 
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 13, 2014 04:00PM
@Warhead,

More progress! I've looked at board/zyxel/nsa325/kwbimage.cfg file and realized that we are using DDR2 definition (it does not seem right). So I looked in the stock U-Boot build, and there is a file dramregs_533ddr3db_A.txt which contains DDR3 definition! so I used this file to build the UART image using the build raw u-boot.bin. It seems this was the cause for the failed start (we probably need to incorporate these values into board/zyxel/nsa325/kwbimage.cfg).

Here are 2 tests with nsa325 build and dramregs_533ddr3db_A.txt.

1. UART with warmboot

root@Dockstar:/localdisk/linux/uboot# ./kwboot-tool/kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2013.10-bodhi-1-uart.nsa325.test.kwb 
Sending boot message. Please reboot the target...\
Sending boot image...
  0 % [......................................................................]
  3 % [......................................................................]

 93 % [......................................................................]
 96 % [......................................................................]
 99 % [.................]
[Type Ctrl-\ + c to quit]


U-Boot 2013.10-bodhi-1 (Aug 13 2014 - 12:56:57)
ZyXEL NSA325 2-Bay Power Media Server


DEBUG: Booting UART, print_cpuinfo ...
SoC:   Kirkwood 88F6282_??
DRAM:  512 MiB
WARNING: Caches not enabled
board_init: initialized NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Warning: failed to set MAC address

MV88E1318 PHY initialized on egiga0

DEBUG: start main_loop

DEBUG: main_loop entered: bootdelay=3

NSA325> ?

Result: the box got shutdown here. Did not seem because of the watchdog. Just shutdown instead of reset.

2. UART with cold boot

root@Dockstar:/localdisk/linux/uboot# ./kwboot-tool/kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2013.10-bodhi-1-uart.nsa325.test.kwb 
Sending boot message. Please reboot the target...-
Sending boot image...
  0 % [......................................................................]
  3 % [......................................................................]
  6 % [......................................................................]
  ...
 93 % [......................................................................]
 96 % [......................................................................]
 99 % [.................]
[Type Ctrl-\ + c to quit]


U-Boot 2013.10-bodhi-1 (Aug 13 2014 - 12:56:57)
ZyXEL NSA325 2-Bay Power Media Server


DEBUG: Booting UART, print_cpuinfo ...
SoC:   Kirkwood 88F6282_??
DRAM:  512 MiB
WARNING: Caches not enabled
board_init: initialized NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Warning: failed to set MAC address

MV88E1318 PHY initialized on egiga0

DEBUG: start main_loop

DEBUG: main_loop entered: bootdelay=3

NSA325> ?
         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__| 
 ** MARVELL BOARD: DB-88F6282A-BP LE 

U-Boot 1.1.4 (Jul 18 2013 - 10:47:29) Marvell version: 3.5.9

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6282 A1CPU running @ 1600Mhz L2 running @ 533Mhz
SysClock = 533Mhz , TClock = 200Mhz 

DRAM (DDR3) CAS Latency = 7 tRP = 8 tRAS = 24 tRCD=8
DRAM CS[0] base 0x00000000   size 512MB 
DRAM Total size 512MB  16bit width
Addresses 10M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (10M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)
Kernel address is 0x4640000.

Streaming disabled 
Write allocate disabled


USB 0: host mode
	[BlueDBG] reseting SoC Pex[0]  0 ...
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
	[BlueDBG] reseting SoC Pex[1]  0 ...
	[BlueDBG] reseting SoC Pex[1]  1 ...
	[BlueDBG] reseting SoC Pex[1]  2 ...
	[BlueDBG] reseting SoC Pex[1]  3 ...
	[BlueDBG] reseting SoC Pex[1]  4 ...
	[BlueDBG] reseting SoC Pex[1]  5 ...
	[BlueDBG] reseting SoC Pex[1]  6 ...
	[BlueDBG] reseting SoC Pex[1]  7 ...
	[BlueDBG] reseting SoC Pex[1]  8 ...
	[BlueDBG] reseting SoC Pex[1]  9 ...
	[BlueDBG] reseting SoC Pex[1]  10 ...
PEX 1: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0

Result: So the cold start u-boot executed until main loop and was rebooted, it seems the watchdog did it.

Observation:

Note the debug output
board_init: initialized
..
DEBUG: main_loop entered: bootdelay=3
We have executed that board_init and then waiting at the main loop. Perhaps the watchdog came in and reset it (to make sure I run a clean test, I've removed all my attempts to poke the watchdog GPIO from this build. So it is the same code out of GitHub, except for those debug printfs).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - dramregs_533ddr3db_A.txt.new (969 bytes)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 13, 2014 04:05PM
And the changes to the kwbimage.cfg ;)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 13, 2014 04:14PM
Result 1: wait, why would it have shut down
Result 2: Okay, now if we can get the phy_init stuff working for it, we might actually be able to shut off the watchdog.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 13, 2014 04:18PM
WarheadsSE Wrote:
-------------------------------------------------------
> And the changes to the kwbimage.cfg ;)

Oops! I've attached it above. It looks ugly w/o comments but works :)

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



Edited 1 time(s). Last edit at 08/13/2014 04:19PM by bodhi.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 13, 2014 04:30PM
Result 1: wait, why would it have shut down
I guess the warm start had some remnants of stock u-boot in memory, and it did not jive with new u-boot copy.
Result 2: Okay, now if we can get the phy_init stuff working for it, we might actually be able to shut off the watchdog.
OK, back to you.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 14, 2014 04:16PM
@Warhead,

I found why it was shutdown: typo in nsa325.h (16 is Power Off).
#define WATCHDOG_SIGNAL     (1 << 16)
should be
#define WATCHDOG_SIGNAL     (1 << 14)

Here is the warm start UART boot:
U-Boot 2013.10-bodhi-1 (Aug 14 2014 - 13:48:08)
ZyXEL NSA325 2-Bay Power Media Server


DEBUG: Booting UART, print_cpuinfo ...
SoC:   Kirkwood 88F6282_??
DRAM:  512 MiB
WARNING: Caches not enabled
DEBUG: board_init: initialized
NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Warning: failed to set MAC address

MV88E1318 PHY initialized on egiga0

DEBUG: start main_loop

DEBUG: main_loop entered: bootdelay=3

NSA325> printenv
baudrate=115200
bootdelay=3
ethact=egiga0
stderr=serial
stdin=serial
stdout=serial

Environment size: 96/131068 bytes
NSA325> mw.l f1010100 0020c000
NSA325> usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
NSA325> ext2ls usb 0:1 /boot
<DIR>       4096 .
<DIR>       4096 ..
         2460768 uImage.3.14.0-kirkwood-tld-3
         6362624 uInitrd.3.14.0-kirkwood-tld-3
         2707144 uImage
         5994381 uInitrd
         2460704 vmlinuz-3.14.0-kirkwood-tld-3
         1737398 System.map-3.14.0-kirkwood-tld-3
         2707080 vmlinuz-3.16.0-kirkwood-tld-1
          123040 config-3.14.0-kirkwood-tld-3
         6362560 initrd.img-3.14.0-kirkwood-tld-3
         1903139 System.map-3.16.0-kirkwood-tld-1
          126024 config-3.16.0-kirkwood-tld-1
         5994317 initrd.img-3.16.0-kirkwood-tld-1
NSA325>

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 14, 2014 04:18PM
bahaahah .. d'oh



Edited 1 time(s). Last edit at 08/14/2014 04:18PM by WarheadsSE.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 14, 2014 04:20PM
I know fat fingers. It's 14 in the kernel correctly :))

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 14, 2014 08:53PM
Warhead,

I've killed watchdog successfully with just setting the GPIO 14 in board_init.

I'm going to clean up a bit and attach the patch here.

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



Edited 1 time(s). Last edit at 08/15/2014 12:14AM by bodhi.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 15, 2014 08:33AM
With or without the PHY init?
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 15, 2014 01:57PM
Without the PHY init, I just set GPIO 14 to 1.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 15, 2014 02:31PM
@Warhead,

It looks like the kernel set mtd0 to read-only. Was it intentional?

grep -5 MTD arch/arm/mach-kirkwood/nsa325-setup.c.org 

static struct mtd_partition nsa325_nand_parts[] = {
       {
               .name = "uboot",
               .offset = 0,
               .size = SZ_1M,
               .mask_flags = MTD_WRITEABLE
       }, {

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



Edited 1 time(s). Last edit at 08/15/2014 02:31PM by bodhi.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 15, 2014 02:33PM
Copy pasta?
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 15, 2014 02:42PM
I see, we need to remove the mask to make mtd0 writeable then.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 15, 2014 03:43PM
Attached here is the test patch for NSAxxx U-Boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - u-boot-2013.10.nsa3xx-test.patch (11.9 KB)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 15, 2014 04:58PM
I looked at the patch. Most of these changes I will make without issue. If it is really down to a typo on the pin number, LOL.

Some of these are a matter of white space changes, which make either no sense, or are un-needed/don't conform to the stylings in u-boot.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 15, 2014 05:07PM
WarheadsSE Wrote:
-------------------------------------------------------
> I looked at the patch. Most of these changes I
> will make without issue. If it is really down to a
> typo on the pin number, LOL.
>
> Some of these are a matter of white space changes,
> which make either no sense, or are un-needed/don't
> conform to the stylings in u-boot.

By all means! It's a diff really not a real patch:) yup! All because of pin typo. LOL. And the ddr 2/3 stuff that we assumed (wrongly) the watchdog caused the failed start.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 16, 2014 05:34PM
Is 2014.07 stable for the NSA320??

Herb
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 16, 2014 05:47PM
I have not released it, since nobody has reported test result. Here is the UART booting version (not ready to flash to NAND):

http://forum.doozan.com/read.php?3,12381,16787#msg-16787

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 17, 2014 04:44PM
@Warhead,

We also need to change the env location to 0xC0000, to be consistent with other Kirkwood U-Boot, and more importantly: common Kirkwood rootfs.

./include/configs/nsa325.h 

#define CONFIG_ENV_ADDR		0xc0000
#define CONFIG_ENV_OFFSET	0xc0000	/* env starts here */

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 19, 2014 11:56AM
I've been to busy to work with this as of yet. Sorry
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
August 19, 2014 06:14PM
OK Warhead. Got to earn a paycheck right:)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
September 09, 2014 04:52PM
I have a Buffalo LS-WVL/E nas that I'd like to dump the Buffalo software (and u-boot) and get a U-boot from this thread and use Debian on.
The problem I have is that this LS-WVL has flash on board so it boots and runs the Kernel from flash. That kernel WILL NOT allow me to use non RAID disks on it. This makes recovery difficult.
Besides, I just like the simplest solution!

The LS-WVL is based on the same chip as the NSA325 and this should be possible ;-)
Bodhi sent me a test u-boot to try to load u0boot and see if there was enough compatibility with the NSA325.
Well I tried but it looks to me like the u-boot on the LS-WVL does NOT support the xmodem protocol like the NSA32x's do.
Attached is the serial console from my LS-WVL which shows the kwboot interaction.

I know I can overwrite the u-boot environment with the environment that the nsa32x's use and simply boot debian.
This does not get me a u-boot that allows the newer support that bodhi and warheadse have put into u-boot.

Anybody have any ideas?????

Herb
Attachments:
open | download - kwboot-on-LS-WVL-E.txt (2.3 KB)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
September 09, 2014 04:55PM
It's really not "that" simple. But, if it is just close enough, it might "mostly" work.

I'll have a look.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
September 09, 2014 04:57PM
Okay -- when did you start kwboot? This should be started BEFORE the device is powered on, and yes, not all of the devices has support for it.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
September 09, 2014 05:13PM
@herb,

The bootROM might give an indicator. However, the NSA325 does not have bootROM version at location ff00003c (so I could not tell at first), but UART booting works.
md ff00003c
I think it's best if you post the attempt UART boot log after doing what Warhead said: start kwboot first, and power on. The type of error shown might give a hint of what happened.The log you've posted was the serial console after stock u-boot has booted.

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



Edited 2 time(s). Last edit at 09/09/2014 05:18PM by bodhi.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
September 11, 2014 08:46AM
@WarheadsSE,

It's time for NSA325 GitHub? I think we've done testing out the functionalities. The only thing we have not tried is booting SATA >2TB rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
September 11, 2014 09:56AM
I'd say it is looking well. Did we ever setting into a good default Env that works for Arch & Debian?
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
September 11, 2014 03:38PM
Ah! that I did not try. I always flash a default env image from here:
Quote

a. Download the default u-boot envs at Dropbox:

uboot.2014.07-tld-1.environment.img.bodhi.tar
md5
c5921e3ea0a07a859878339ffb771088

So I forgot :) But yes, we do need this in case of bad blocks. I'll will incorporate a default set to boot USB.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
September 12, 2014 03:38PM
@WarheadsSE,

Here is the patch for ./include/configs/nsa325.h. The evns will boot USB and then SATA. It's been tested for booting the USB rootfs when the envs location 0xC0000 has not been written before.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - nsa325.h.patch (3.6 KB)
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: