Welcome! Log In Create A New Profile

Advanced

Debian on Shuttle KD20 (PLX OXNAS 7821)

Posted by Peacemaker 
Debian on Shuttle KD20 (PLX OXNAS 7821)
September 20, 2014 04:46AM
So, I tried to set up on the KD20 a proper small NAS/Homeserver based on Debian.

As it is the same SoC as the PogoPro / Classic i thougt it would be much easyer :-), so this thread is more to get maybe some more people with this device, and some progress to get everything working.

So far what I have done so far is:

Set up a Wheezy_Rootfs, initrd, with a patched vendors Kernel, and booted kernel & initrd over tftp (or nand) and rootfs from USB (SATA is working as well) with vendors U-Boot.

I uploaded the files to my Dropbox, if someone is interrested.

The Kernel is still the 2.6.31.14, but I patched it like Ingmar with a fake 2.6.32 id, accept4- and devtmpfs-support.

Whats not working is the whole GPIO, so LED is blinking all the time, hotplug buttons do not work,...
The next thing I'd like to do is a sligt overclock if possible to 850mhz or so, but haved looked much into the U-boot.

So If someone have a few tips for the GPIO or U-Boot, I'm happy for any Input.

Overall I'm not quite happy with the patched Kernel 2.6:
But Krefs Oxnas Kernel works well with the .dts from the openwrt-oxnas-projekt, but only with one sata port.

So as I'd like to use both sata, and have not a clue how to activate the 2 ports ( just change the emmu form maxports form 1 to 2 dont work :-| ) or add the old sata driver to the 3.1X kernel. The kernel is jet not the right for my purpose.


Last I looked much to these page and repos, for my work:
https://gitorious.org/openwrt-oxnas/pages/omninas-kd20
https://github.com/ingmar-k/2.6.31.14_OXNAS_kernel
https://github.com/kref/linux-oxnas
And thanks to crosser, for some additional infos
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 20, 2014 05:23AM
Peacemaker,

For some info about GPIO and U-Boot take a look at 2013.10 U-Boot for Pogoplug V3 (OXNAS). I've added some code to control the LED during booting.

And I've updated the SPL to 850MHz:
http://forum.doozan.com/read.php?3,16017,page=3

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 09/20/2014 05:26AM by bodhi.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 20, 2014 10:57AM
Thx for this, but oob it is not working :-|, and only working without ethernet :-(
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 20, 2014 05:35PM
Peacemaker Wrote:
-------------------------------------------------------
> Thx for this, but oob it is not working :-|, and
> only working without ethernet :-(

Sorry, I don't get what you meant to say! what problem are you trying to solve? If you ask a specific question, I might be able to help.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 21, 2014 07:22AM
I' see.
I just meant, just flash or boot your SPL and your U-Boot, it don't work out of the box.

So I need to do some changes to the U-Boot, as set Ram to 256, maybe fix the ethernet.

And somehow I can't load my patched 2.6.31 Kernel & Initrd



Edited 1 time(s). Last edit at 09/21/2014 09:08AM by Peacemaker.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 21, 2014 11:40AM
Okay, maybe someone has an idea what is wrong here, this this kernel boot perfect with vendors uboot, but with bodhi's or kref's Uboot I got this:

OX820 # ide reset

Reset IDE: Bus 0: OK
  Device 0: Model: SAMSUNG HD204UI  Firm: 1AQ10001 Ser#: S2H7J9CB207281
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
OX820 # fatload ide 0:1 64000000 uImage_2.6.32_fake
reading uImage_2.6.32_fake
3011344 bytes read in 412 ms (7 MiB/s)
OX820 # bootm 64000000
## Booting kernel from Legacy Image at 64000000 ...
   Image Name:   Linux-2.6.32.fake+
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3011280 Bytes = 2.9 MiB
   Load Address: 60008000
   Entry Point:  60008000
   Verifying Checksum ... Bad Data CRC

Or if I tried to boot this Kernel from nand:
OX820 # nand  read.e 0x60500000 840000 300000

NAND read: device 0 offset 0x840000, size 0x300000
NAND read from offset 840000 failed -74
 0 bytes read: ERROR
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 21, 2014 02:35PM
Peacemaker,

So did you compile either mine or kref's u-boot? if you did, try to regenerate your Linux-2.6.32.fake+ uImage with tools/mkimage from that u-boot build. This error usually caused by a badly generated uImage (file system was not sync properly, nfs timeout, mismatched checksum,…).

If you don't have 2013.10 u-boot mkimage, I'll post the binary here.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 22, 2014 08:51AM
Because machine to machine, the memory timings might be different as well as which pins are attached to what.

u-boot is not grub+bios.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 22, 2014 09:48AM
Thanks for your help, but:
Quote
So did you compile either mine or kref's u-boot? if you did, try to regenerate your Linux-2.6.32.fake+ uImage with tools/mkimage from that u-boot build. This error usually caused by a badly generated uImage (file system was not sync properly, nfs timeout, mismatched checksum,…). If you don't have 2013.10 u-boot mkimage, I'll post the binary here.

I compiled kref's U-Boot, and generated the uImage with debian's (wheezy) mkimage and with the binary from kref's git.
And both of it don't work, and the filesystem seams OK.

@Warhead
Reading from fat to ram, writing from ram to nand works perfect so far. But I don't get why reading from nand is not working and booting from fat.
The next is u-Boot only activates 128mb Ram and not the full 256mb.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 22, 2014 10:17AM
Peacemaker Wrote:
-------------------------------------------------------
> Okay, maybe someone has an idea what is wrong
> here, this this kernel boot perfect with vendors
> uboot, but with bodhi's or kref's Uboot I got
> this:
>
>
> OX820 # ide reset
> 
> Reset IDE: Bus 0: OK
>   Device 0: Model: SAMSUNG HD204UI  Firm: 1AQ10001
> Ser#: S2H7J9CB207281
>             Type: Hard Disk
>             Supports 48-bit addressing
>             Capacity: 1907729.0 MB = 1863.0 GB
> (-387938128 x 512)
> OX820 # fatload ide 0:1 64000000
> uImage_2.6.32_fake
> reading uImage_2.6.32_fake
> 3011344 bytes read in 412 ms (7 MiB/s)
> OX820 # bootm 64000000
> ## Booting kernel from Legacy Image at 64000000
> ...
>    Image Name:   Linux-2.6.32.fake+
>    Image Type:   ARM Linux Kernel Image
> (uncompressed)
>    Data Size:    3011280 Bytes = 2.9 MiB
>    Load Address: 60008000
>    Entry Point:  60008000
>    Verifying Checksum ... Bad Data CRC
>

Try loading uImage to address 0x60500000.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 22, 2014 10:29AM
Nope, allready tried this and not working :-(
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 22, 2014 10:35AM
Quote
Peacemaker
The next is u-Boot only activates 128mb Ram and not the full 256mb.

Again, this are things that are board specific. These are things that you can only really get if you get the GPL tarballs from the manufacturer and we can recompile with these settings!
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 22, 2014 10:42AM
Ok, now I see what you mean.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 23, 2014 01:24PM
@WarheadsSE
So I got now all the sources from Shuttle: http://data.shuttle.eu/~upload/omninas/KD20_20121127.zip

Okay, do you think it is better to use the "new" uboot with the vendors settings.
Or modifiy the "old" Vendor U boot ?
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 23, 2014 02:45PM
Best to take the settings from the old uboot, and work them into the new uboot. I did plenty of work in that old u-boot pile of trash. Ouch.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 23, 2014 10:32PM
EDIT: removed.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 2 time(s). Last edit at 09/24/2014 10:15AM by bodhi.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 24, 2014 04:19AM
Bodhi, do you really think this will work? The nas320 is a krikwood divice and not like the kd20 a oxnas?

I think I'll just use for the first time the Vendor stage1+uboot. As the new U-Boot need's a lot of changes as well (and I'm not realy good in modifying kernel/uboot jet) , but I see this would be a better choice.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 24, 2014 08:41AM
I think that was meant for a different post.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 24, 2014 10:14AM
Peacemaker Wrote:
-------------------------------------------------------
> Bodhi, do you really think this will work? The
> nas320 is a krikwood divice and not like the kd20
> a oxnas?
>
> I think I'll just use for the first time the
> Vendor stage1+uboot. As the new U-Boot need's a
> lot of changes as well (and I'm not realy good in
> modifying kernel/uboot jet) , but I see this would
> be a better choice.

Warhead was right! sorry I replied to the wrong post :)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 24, 2014 10:32AM
Peacemaker Wrote:
-------------------------------------------------------
> Bodhi, do you really think this will work? The
> nas320 is a krikwood divice and not like the kd20
> a oxnas?
>
> I think I'll just use for the first time the
> Vendor stage1+uboot. As the new U-Boot need's a
> lot of changes as well (and I'm not realy good in
> modifying kernel/uboot jet) , but I see this would
> be a better choice.

I'd agree. I think once you got the new kernel running correctly then you will have an easier time with u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 25, 2014 10:52AM
I tested a bit the old U-Boot:
I got it working booting stage1 + uboot dirct from hdd, but the uboot don't init the hdd, to load kernel & initrd from hdd.

Maybe someone has an idea what I forgot, within the compiling.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 25, 2014 02:28PM
Peacemaker,

> I tested a bit the old U-Boot:
> I got it working booting stage1 + uboot dirct from
> hdd, but the uboot don't init the hdd, to load
> kernel & initrd from hdd.

How about interrupting u-boot and look at the envs? it could be as simple as that.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 26, 2014 03:03AM
Are there more envs the the normal Bootargs?
If I interupt the boot process and try to set up:

RStage-1 Bootloader 2014-09.24-14:52:42
Attempting to set PLLA to 875MHz ...
  plla_ctrl0 : 0x0000020A
  plla_ctrl1 : 0x00348000
  plla_ctrl2 : 0x0068008B
  plla_ctrl3 : 0x000000F8
PLLA Set

Setup memory, testing
Reading disk 00
  Sector : 0x0000009A
  Hdr len: 0x00027E98
  Hdr CRC: 0xF55097E9
 OK

     _           _   _   _
    | |         | | | | | |
 ___| |__  _   _| |_| |_| | ___
/ __| '_ \| | | | __| __| |/ _ \
\__ \ | | | |_| | |_| |_| |  __/
|___/_| |_|\__,_|\__|\__|_|\___|
          _   _     ____              _
         | | | |   | __ )  ___   ___ | |_
         | | | |___|  _ \ / _ \ / _ \| __|
         | |_| |___| |_) | (_) | (_) | |_
          \___/    |____/ \___/ \___/ \__|

U-Boot 1.1.2 (May  2 2012 - 21:38:52)

U-Boot code: 60D00000 -> 60D27E98  BSS: -> 60D3ABC0
IRQ Stack: 60cddf7c
FIQ Stack: 60cdcf7c
RAM Configuration:
        Bank #0: 60000000 256 MB
SRAM Configuration:
        64KB at 0x50000000
NAND:128 MiB
In:    serial
Out:   serial
Err:   serial
Setting Linux mem= boot arg value
Hit any key to stop autoboot:  0

                              Boot Menu
==============================================================================
0: Enter Command Line Interface             1: Reboot
2: Start the Kernel Code                    T: GPIO Test Function

=> Select:
Shuttle>> idereset
Unknown command 'idereset' - try 'help'
Shuttle>> ide reset

Reset IDE: Detecting SATA busses:
Bus 0: No devices found
Shuttle>>

If I load the vendors uboot from nand that is working
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 26, 2014 08:12AM
>> printenv
>> help

My immediate thought is that your recompiled uboot doesn't have the necessary options to enable the power lines? Does the drive spin up? If not, that is a possibility. I have also seen vendor variants the the GPL tarball doesn't have features enabled, and it takes a small amount of digging to find the necessary items to enable.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 26, 2014 10:04AM
The disk is not spinning up, but it is running anywhy as I boot from the disk.

Quote
My immediate thought is that your recompiled uboot doesn't have the necessary options to enable the power lines?
Somethink like this is are my thoughts as well, as I got within the compiling with only sata boot enable an error:
/u-boot-vendor/u-boot-256M/u-boot/board/oxnas/ox820.c:178: undefined reference to `sata_power_control'
make: *** [u-boot] Fehler 1
With sata & nand enablend I dont get an compiling error. But I dont have any Idea how to fix this error.
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 27, 2014 03:32PM
Peacemaker,

> The disk is not spinning up, but it is running
> anywhy as I boot from the disk.

Strange, meaning you have only one SATA disk plugged in and you can boot from that?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 28, 2014 08:50AM
Yes, I booted the stage1 und uboot from the HDD, and then I can't activated & boot from Sata/HDD
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 28, 2014 03:01PM
@Peacemaker,

Quote

Overall I'm not quite happy with the patched Kernel 2.6:
But Krefs Oxnas Kernel works well with the .dts from the openwrt-oxnas-projekt, but only with one sata port.

So as I'd like to use both sata, and have not a clue how to activate the 2 ports ( just change the emmu form maxports form 1 to 2 dont work :-| ) or add the old sata driver to the 3.1X kernel. The kernel is jet not the right for my purpose.

If your goal is to run new kernel, then I think the best approach is to get new kernel working first, even with 1 SATA port. New u-boot is nice, but probably not necessary to boot new kernel.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 28, 2014 03:36PM
Year, I thought maybe, I can set up first booting: up everything direct from HDD, so there is no need modify the nand.
But that I get this is harder than expected.

The new kernel (Kref's) is running, but I need both SATA.
I tried to patch in the vendor-sata driver, but its linked many other files, so not quite easy.
And with the new Sata driver direct from Kref's repo I don't have any idea how to start.

I see maybe I have to buy another - easier to customice - device for my purpose :-|
Re: Debian on Shuttle KD20 (PLX OXNAS 7821)
September 28, 2014 03:43PM
Peacemaker,

I think you could start with the DTS. You already made the change to 2 SATA ports in the driver. But the DTS needs another entry for the 2nd port. The things to look for is the settings in that entry. I don't know how hard it is to find it in the GPL for this box, but I assume it is possible.

./arch/arm/boot/dts/ox820.dtsi

	sata@45900000 {
		compatible = "plxtech,nas782x-sata";
			/*	port		sgdma		core	*/
		reg = <0x45900000 0x100>, <0x459B0000 0x10>, <0x459E0000 0x2000>,
			/*	phy		descriptors (optional)	*/
			<0x44900000 0x0C>, <0x50000000 0x1000>;
		interrupts = <0 18 0x304>;
		clocks = <&stdclk 4>;
		resets = <&rst 11>, <&rst 12>, <&rst 13>;
		reset-names = "sata", "link", "phy";
		status = "disabled";
	};

:) and if you had a Kirkwood device, then it would have been a lot easier.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 09/28/2014 03:47PM by bodhi.
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 14 plus 6?
Message: