Topic: Adding Seagate Dockstar to Kirkwood

Hi
There is an increasing focus on using OpenWRT on the Seagate Dockstar.
Ecc and Mazilo provided a HOWTO describing installation but the desire is to make Dockstar builds simpler, ie out of the box.

I volunteered :-( but have some questions as the gory details are not described anywhere that I can find other than in the plethora of .mk files involved in buildroot or gleaning hints from others solutions in target/linux.

My approach is to make this a template to simplify adding the other popular kirkwood based systems such as Guruplug, Pogoplug, etc.

All this takes place in target/linux/kirkwood except adding dockstar-setup.c

Plan:
0. replace Default with Sheevaplug to emphasize that there is no Default, only specific targets/profiles
1. Add profile directory, add profile-Dockstar
2. Add bases-files/etc/config/system.Dockstar this is to set the led functionality, e.g blink on eth0 traffic
3. Add CONFIG_MACH_DOCKSTAR=y
4. Add arch/arm/mach-kirkwood/dockstar-setup.c, clone of sheevaplug-setup.c with ecc's patches. Add to Makefile
5. Modify image/Makefile to include $(PROFILE) in the image output names
6. Add Image/Prepare to cp system.Dockstar to system in $(TARGET_DIR)/etc.....
7. Add config directory with config-sheevaplug and config-dockstar with their specific KConfig settings

questions:
1. For #7 I plan to go back to the original mods from 2009 to get the base KConfig, then set config-sheevaplug accordingly. This should provide a base kirkwood for other boards to work with
2. For #4 how do I update the kernel/arch ? It is a package of course. Or do I fake it through the patches directory in target/.../kirkwood
3. In image/Makefile, Image/Build/squashfs doesn't get called even though I have squashfs set in menuconfig. Squashfs is built instead using image.mk's Image/mkfs/squashfs. How can I change this so that I can add PROFILE to the output name?
4. dumpinfo in TOPDIR/include/target.mk is a nice looking Make target to help during work such as this. How do I use this?

Any guidance is appreciated.

Gerrit

2 (edited by Memphis 2010-08-13 07:30:39)

Re: Adding Seagate Dockstar to Kirkwood

Can't help you really but want to say "thumbs up" to your plan!

2x TP-Link wr1043nd (1x64MB RAM, 1x32MB RAM) - booting from usb sticks (kexec'd kernel)
1x Seagate DockStar booting  from 500GB 2,5" HDD (firststage u-boot with usb boot support)
1x la fonera 2.0 (stock @ backfire)

Re: Adding Seagate Dockstar to Kirkwood

Hi
Issue #3 above is fixed, I had a second (and empty) 'define Image/Build/Kernel' macro at bottom of my image/Makefile. That obviously overrode what ever else I had placed in the macro definition above it :-(

Gerrit

Re: Adding Seagate Dockstar to Kirkwood

Another question:

Are <xx>.mk files in target/linux/<board>/image/ only used if building a SubTarget and not when building from a Profile? I know the Makefile always gets used.

Gerrit

Re: Adding Seagate Dockstar to Kirkwood

Doing the final build testing.

The kirkwood target is now
a) 2 Targets,CloudEngines and GlobalScale, for the 2 board manufacturers that I know of
b) CloudEngines Profile has Dockstar (and should get PogoPlug V1, V2 when someone works on those, perhaps TonidoPlug?)
c) GlobalScale has Sheevaplug and GuruPlug to come (someone is working on this already)

The squashfs for Dockstar is now generated (only root, no uImage) as needed by Eric's instructions in HOWTO for Dockstar.
I have added a rudimentary /etc/config/system file for Dockstar to blink led on network activity.

You no longer need to patch the kernel as described by Eric, this is done when you build for Dockstar and Sheevaplug

I worked for a while to figure out a means to detect the board type at boot time but the only way (my knowledge of the board hw is limited) I could see would rely on the XCE section in CloudEngines u-boot. Since we can't rely on this being present, that approach wouldn't work reliably.

Gerrit

Re: Adding Seagate Dockstar to Kirkwood

This is great progress.  I'm looking forward to seeing it adopted in the official OpenWrt tree.

Just a heads-up: I registered a machine ID for the DockStar (2998) and submitted a trivial patch to the linux-arm maintainers to include a dockstar-setup.c file in the arch/arm/mach-kirkwood directory.  If it's ever accepted, it will require a different arcNumber in u-boot (since that's the only way the kernel can tell what kind of board it's running on).

Re: Adding Seagate Dockstar to Kirkwood

Eric, that is cool. As part of my adaptation I added dockstar-setup.c in kirkwood/files/.... as well as adding a patch to include it in the kernel tree. Great minds, etc. I am still faking it as 2097.

sometime in the future the xxx-setup.c code needs to look at the arcNumber passed in from u-boot. That way the code can see which board it is at boot time.

Testing my builds as we speak, forgot a few settings but easy to deal with....

If you ever need the original .img files, Cloud Engines made them available at pogoplugged.com.

Gerrit

Re: Adding Seagate Dockstar to Kirkwood

Can you also add an option linking USB drivers and file systems into kernel so OpenWRT can be booted from USB memory.

Re: Adding Seagate Dockstar to Kirkwood

z80yyz wrote:

sometime in the future the xxx-setup.c code needs to look at the arcNumber passed in from u-boot. That way the code can see which board it is at boot time.

That's already handled by the MACHINE_START macro -- it registers the init routine and other features corresponding to a given arcNumber value.  The arcNumber is passed by u-boot and used by the assembly-language initialization code (see arch/arm/include/asm/mach/arch.h)

Re: Adding Seagate Dockstar to Kirkwood

Hi Eric
Yes, that is true as far as it goes but the scaling issue is that we compile in a specific xxxx-setup.c for each board. jow recommended that we find a way to detect at run-time what the board is and then adapt the code at that time (ie runtime, not compile time). That way 1 kernel supports multiple boards since they are all related.
This will be easier once ARM approves your unique id request for REDSTONE/Dockstar

Gerrit

Re: Adding Seagate Dockstar to Kirkwood

Yes, that is being done as default

nguyen wrote:

Can you also add an option linking USB drivers and file systems into kernel so OpenWRT can be booted from USB memory.

12

Re: Adding Seagate Dockstar to Kirkwood

z80yyz wrote:

Yes, that is true as far as it goes but the scaling issue is that we compile in a specific xxxx-setup.c for each board. jow recommended that we find a way to detect at run-time what the board is and then adapt the code at that time (ie runtime, not compile time). That way 1 kernel supports multiple boards since they are all related.
This will be easier once ARM approves your unique id request for REDSTONE/Dockstar

OK, I see.  But the mainline Linux kernel seems to be going the other direction. In 2.6.36-rc1, for example:

$ ls arch/arm/mach-kirkwood/*setup.c
db88f6281-bp-setup.c     netxbig_v2-setup.c     sheevaplug-setup.c
guruplug-setup.c         openrd-setup.c         t5325-setup.c
mv88f6281gtw_ge-setup.c  rd88f6192-nas-setup.c  ts219-setup.c
netspace_v2-setup.c      rd88f6281-setup.c      ts41x-setup.c

The DOCKSTAR ID was registered automatically using this page.  But I have no idea if the patch I submitted to the kernel mailing list will be adopted or not ...

Re: Adding Seagate Dockstar to Kirkwood

Hi Eric
I suspect I know why they are using the 'add another file' approach: it is difficult to replace the present and also test a better way. E.g. I only have 1 Dockstar at present (2 more on the way) with it unlikely that I will buy PogoPlug, etc.

The good news:
I submitted a patch to openwrt-dev mailing list today that splits kirkwood into 2 Targets (GlobalScale and CloudEngines), each with one Profile (Sheevaplug and Dockstar respectively). Dockstar is based on your defaults with ntpclient added in.

Dockstar in my build setup also supplies the /etc/config/system and network files with better defaults.

I still can't get the rootfs loaded and working using the serial method, it only works using the 'linux is already running' methods, e.g with boot from /dev/sda1. Using mtd utils to flash /dev/mtd2 always works.

Attached is a link to the gz containing the changes/additions to target/linux/kirkwood directory in case others want to play with it prior to being included in the trunk.

14 (edited by z80yyz 2010-08-22 02:41:49)

Re: Adding Seagate Dockstar to Kirkwood

For those who are tying my new SubTarget/Profiles setup, if you need to add capabilities such as FTDI support, find the correct CONFIG item somewhere and then add select CONFIG<name>
to the profile .mk file. E.g. to add ftdi serial io support for the Dockstar, add 'select CONFIG_USB_SERIAL_FTDI_SIO' to a Image/Profile/Config section in the 100-Dockstar.mk file.

This is a much simpler local modification approach than digging through the make kernel_menuconfig
screens.

If you want to customize file in

/etc/config

, then place those in target/linux/kirkwood/base-files-Dockstar/etc/conf
. Any files placed there will appear in your root.fs image.

The beauty  of this is that these local customizations will survive svn up
operations as well.

Gerrit

15 (edited by z80yyz 2010-08-23 18:17:55)

Re: Adding Seagate Dockstar to Kirkwood

Hi all
Just an FYI, a patch was checked in on Sunday that adds Dockstar to OpenWRT. This patch actually replaces the Sheevaplug config instead of adding it as a Profile as in my proposal.

In parallel a patch for uboot-kirkwood was added which affect u-boot. In iself not an issue but it also adds MACH_TYPE_DOCKSTAR as 2998 (the new Dockstar unique number that ecc requested). This will break things unless you change arcNumber in the u-boot parameters accordingly.

Gerrit

Re: Adding Seagate Dockstar to Kirkwood

FYI to all who were interested: I am not pursuing further the patches I had proposed. OpenWRT for kirkwood SoC's is behaviorally not a mature platform to work with IMO.

Off to debian for something predictable.

Re: Adding Seagate Dockstar to Kirkwood

Hi Gerrit,

Sorry to hear that you too are leaving. I wish you the best and thank you + ECC for your contributions on your works to port OpenWRT to DockStar.

Mazi

Re: Adding Seagate Dockstar to Kirkwood

Gerrit, you did amazing work in so few days. It is a shame OpenWRT for kirkwood managed to piss you off that much. I wish I had not bricked (I hope I can still unbrick it) mine dockstar last week so I could contribute something (I am now console cable hunting). Maybe I will need to find your work on the debian side then.

Re: Adding Seagate Dockstar to Kirkwood

Hi
As long as you haven't overwritten the u-boot then a serial cable will get you out of trouble. The best prices for CA42 or DKU5 cables are on eBay, shipping can take a while though. With a bad u-boot, then jtag is needed. Although we now know the pinout for that, not sure they managed to get it working yet.

The current problem with kirkwood and OpenWRT is that there is one person who ignores what has been done, and does not remotely follow the spirit of OpenWRT in making changes. Submitting your patches on the dev list gets you a bit of discussion (which is good as it refines the solution) and then nothing. Its a pity because I have used OpenWRT for quite a while. I didn't see this arrogant behaviour in other targets. But that is life in the *nix world, experienced it since the 1980's, nothing much has changed except that there is a lot more choice.

Re: Adding Seagate Dockstar to Kirkwood

About my issue, all it happen is I added kmod-usb-printer and rebooted... and it never came back. But, that is besides the subject of this thread; I can open one about it so we keep focused.

About kirkwood and openwrt, I think it is sad it got that way. After all, that reminds me of the fights between openwrt and, say, dd-wrt and  Sveasoft. I can't say I know all the bickering that happened in the *nix word (SCO notwithstanding), but if I can't put openwrt in this dockstar, once I get it happy again, I can try something else. I am not religious about it.

Re: Adding Seagate Dockstar to Kirkwood

I am updating my blog on the debian experience as I go along. So far it installed smoothly and is running fine. I used setenv in place of blparam from those instructions. Just starting the learning about the build env etc. Overall it is much closer to Marvell and kernel.org.

Gerrit

Re: Adding Seagate Dockstar to Kirkwood

Hey Gerrit,

it seems that lars has finally committed your patchset yikes) - come back dude!

memphis

2x TP-Link wr1043nd (1x64MB RAM, 1x32MB RAM) - booting from usb sticks (kexec'd kernel)
1x Seagate DockStar booting  from 500GB 2,5" HDD (firststage u-boot with usb boot support)
1x la fonera 2.0 (stock @ backfire)

Re: Adding Seagate Dockstar to Kirkwood

OT:

I believe OpenWRT developers should consider to support both the 1-stage and 2-stage u-boot for a DockStar. This way, DockStar owners will decide which one to choose. As with me, my preference is to use a 1-stage uboot and not a 2-stage uboot.

The only 1-stage u-boot fod DockStar that I am aware of is from Jeff of Debian. I wonder if DockStar owners here have ever replaced his/her DockStar original u-boot with the u-boot image from Jeff and flash OpenWRT firmware to its mtd1 partition to see if that will work.

Mazi