I'll do this tonight (GMT). My envs are as per your default env, with one change, I've set it to run a custom macro to boot NetBSD first thing in the boot order. If that fails run through the default boot sequence you've provided. I'll bypass that when doing tests tonight. So are the HDD on a EHCI bus, i.e. USB?? What did you change between tld-1 and tld-2 that made thby Micky Wicky - uBoot
U-Boot 2015.10-tld-2-rc2 (Feb 23 2016 - 21:41:13 -0800) ZyXEL NSA310S/320S 1/2-Bay Power Media Server SoC: Kirkwood 88F6702_A1 DRAM: 256 MiB (ECC not enabled) WARNING: Caches not enabled NAND: 128 MiB In: serial Out: serial Err: serial Net: egiga0 MV88E1318 PHY initialized on egiga0 Hit any key to stop autoboot: 0 NSA3x0S> ide info IDE device 0: device type unkby Micky Wicky - uBoot
same thing with Debian I poked (and with this build, the 2nd HDD spins up immediately) setenv devices usb run scan_disk run bootexec_cmd check that no ide reset is contained in any of the macros that way Debian boots like NetBSD, until it tries to find the root fs: Unknown command 'scan_disk' - try 'help' NSA3x0S> run scan_disk running scan_disk ... Scan deby Micky Wicky - uBoot
I did a bit more digging, there's possibly a regression on the USB front. By doing a usb reset manually I can read files with fatls and fatload, but something about the USB is not initialised correctly. My Debian pen drive doesn't work either (both work with tld-1) Once I've loaded the kernel both OSes fails to initialise the USB - since their roots are on USB, well.... you geby Micky Wicky - uBoot
Manually doing a usb reset and then bootm, NetBSD boots but breaks on the USB too. On the plus side - it can see both disks!!! mvsata0 port 0: device present, speed: 3.0Gb/s mvsata0 port 1: device present, speed: 3.0Gb/s wd0 at atabus0 drive 0 wd0: <WDC WD20EZRX-00D8PB0> wd0: 1863 GB, 3876021 cyl, 16 head, 63 sec, 512 bytes/sect x 3907029168 sectors wd1 at atabus1 drive 0 wd1: &by Micky Wicky - uBoot
No luck with the USB error. But it seems bodhi has done it again and cracked the big problem! I'm doing this: usb start; mw.l f1010104 c70e0ffd; ide reset; setenv bootargs rootdev=sd0a; setenv netbsd_en yes; fatload usb 0 0x800000 /netbsd.ub; bootm 0x800000 The only difference with the previous (working with tld-1) boot macro is the addition of the poke. As it is it can boot neitherby Micky Wicky - uBoot
U-Boot 2015.10tld-2 (Feb 23 2016 - 02:17:09 -0800) ZyXEL NSA310S/320S 1/2-Bay Power Media Server SoC: Kirkwood 88F6702_A1 DRAM: 256 MiB (ECC not enabled) WARNING: Caches not enabled NAND: 128 MiB In: serial Out: serial Err: serial Net: egiga0 MV88E1318 PHY initialized on egiga0 Hit any key to stop autoboot: 0 NSA3x0S> mw.l f1010104 c70e0ffd; ide reset Reset IDEby Micky Wicky - uBoot
*Victory dance* Will post some more shortly, but that last uboot + a good old-fashioned poke seems to have done the trickby Micky Wicky - uBoot
No immediate change, what is different about this build? NSA3x0S> ide reset Reset IDE: Bus 0: OK Bus 1: not available Device 0: Model: WDC WD20EZRX-00D8PB0 Firm: 80.00A80 Ser#: WD-WCC4MHECYZUX Type: Hard Disk Supports 48-bit addressing Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512) NSA3x0S> ide info IDE device 0: Model: WDC WD20Eby Micky Wicky - uBoot
I had to compile kwboot for my OS X from sources though. Funny, I was playing around trying to get it to work under NetBSD. it compiles no problems, and seems to run but always fails instead of initiating the xmodem upload. Anyway, I digress... trying this now with Linux kwbootby Micky Wicky - uBoot
There's a chance you fry something. I'd say it's a very small chance, buy don't say I didn't warn you. At the very least make sure you have backups of whatever is on your hdd's.by Micky Wicky - uBoot
I've got the sources, but I was focusing on Marvell's fork of u-boot (stock u-boot) rather than the Linux kernel. Simple reason is, the stock u-boot initialises the 2nd SATA port before loading the Linux kernel. Ergo, the key must be in there, but as you can see in this thread, it's not as simple as it could be. (happy to be corrected... as long as I get the ^&%^$&! thinby Micky Wicky - uBoot
So there's two things to consider here: 1. MadAdmin's kernel patch looks like this: + + sata1_power: regulator@2 { + compatible = "regulator-fixed"; + reg = <2>; + regulator-name = "SATA1 Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; +by Micky Wicky - uBoot
I suspected as much... The next question is, how to tell the SoC to use the higher voltage? I know there was a similar issue with the usb, but that actually works fine out of the bus with the new uboot.by Micky Wicky - uBoot
on stock u-boot it looks like this initially: f1010104: c70e0fff 00000000 00000000 1343c080 so changing it from c70e0fff to c70e0ffd is what we're looking at... With new u-boot this could mean changing cfde5fff to cfde5ffd --> tried it, makes no differenceby Micky Wicky - uBoot
NSA3x0S> md f1010104 f1010104: cfde5fff 00000000 00000000 13224080 ._...........@". f1010114: 132e4fb0 00000000 00000000 00000000 .O.............. f1010124: 00000000 00000000 00000000 00000000 ................ f1010134: 00000000 00000000 00000000 00000002 ................ f1010144: fffffff9 00000000 00000000 00000000 ................ f1010154: 00000000 00000000 0000by Micky Wicky - uBoot
Looking at MadAdmin's kernel patch here : I note that: it uses the sata0/sata1 and hdd1/hdd2 naming conventions so we need to look for sata1 or hdd2 He looks to GPIO33 for sata1 power: pmx_pwr_sata1: pmx-pwr-sata1 { + marvell,pins = "mpp33"; + marvell,function = "gpio"; + }; and both USB and SATA1 have separate regulators defined: regulators { +by Micky Wicky - uBoot
oh it came straight from MadAdmin: http://www.madadmin.com/zyxel-nsa320s-es-debian-linux-4-resz/ I found it strange that the 2nd HDD required a poke to initialise, but since stock uboot doesn't seem to do it by itself... maybe the stock kernel takes care of that through some crazy workaround? MadAdmin said he couldn't get hold of Zyxel's kernel sources, so this is quite puzzlingby Micky Wicky - uBoot
Couldn't see it anywhere else than Orion and Kirkwood board defs: ~/src//trunk/sysapps/u-boot-3.6.0_STG326/board$ grep -R hddPowerBit * mv_feroceon/mv_orion/mv_main.c: MV_32 hddPowerBit = mvBoarGpioPinNumGet(BOARD_DEV_HDD0_POWER); mv_feroceon/mv_orion/mv_main.c: MV_REG_BIT_SET(GPP_DATA_OUT_REG(0),(1<<hddPowerBit)); mv_feroceon/mv_orion/mv_main.c:by Micky Wicky - uBoot
Hmmm pin 16?? MV_BOARD_GPP_INFO rd88f6192AInfoBoardGppInfo[] = /* {{MV_BOARD_GPP_CLASS devClass, MV_U8 gppPinNum}} */ { {BOARD_GPP_USB_VBUS_EN, 10}, {BOARD_GPP_USB_HOST_DEVICE, 11}, {BOARD_GPP_RESET, 14}, {BOARD_GPP_POWER_ON_LED, 15}, {BOARD_GPP_HDD_POWER, 16}, {BOARD_GPP_WPS_BUTTON, 24}, {BOARD_GPP_TS_BUTTON_C, 25}, {BOARD_GPP_USB_VBUS, 26}, {BOARD_GPP_USB_OC, 27},by Micky Wicky - uBoot
Yes, I just noticed the RD_88F6192A_ID thing... no offence to the Marvells devs, but this isn't the most readable code I can think of :) so I need to find the value of hddHigh and hddPowerbit nowby Micky Wicky - uBoot
Seems like it. So I found a function that would look right in board/mv_feroceon/mv_kw/mv_main.c : You'd think all the boards would use this... not mine by the looks of it: /******************************************************************************* * mvHddPowerCtrl - * * DESCRIPTION: * This function set HDD power on/off acording to env or wait for button push * INPUT:by Micky Wicky - uBoot
extra info: on stock u-boot, note the emphasis. I really think this is what powers the 2nd HDD Marvell>> mw.l f1010104 c70e0ffd;ide reset Reset IDE: Marvell Serial ATA Adapter Integrated Sata device found [0 0 0]: Enable DMA mode (6) Device 0 @ 0 0: Model: WDC WD20EZRX-00D8PB0 Firm: 80.00A80 Ser#: WD-WCC4MHECYZUX Type: Hard Diskby Micky Wicky - uBoot
Thanks, I'll do that tonight probably. In terms of pokes with the stock uboot, this Hungarian chap ported Debian to the 320S with stock uboot (running off USB), and has a few tips: http://www.madadmin.com/zyxel-nsa320s-es-debian-linux-4-resz/ (Google Translate FTW) Onto the stock uboot - I really don't understand the logic behind Marvell having board-specific IDE init support, ANDby Micky Wicky - uBoot
>Could you try kwboot with the new u-boot and do the same mw.l command, see if the behavior is the same? Makes no difference with 2015.10, still only just see the one disk. "Bus 1: Not Available" So, to recap: - stock uboot needs "mw.l f1010104 c70e0ffd;ide reset" to see the second disk - 2015.10 doesn't see the disk, even with the same poke Any other ideaby Micky Wicky - uBoot
So I've booted stock uboot via kwboot (very cool utility), and the second disk only starts if I issue "mw.l f1010104 c70e0ffd;ide reset" A simple "ide reset" only shows the first disk. This is probably not news here, but thought I'd put it out there. I'll keep looking. Conversely, stock uboot won't see my USB drives, but that's another story alby Micky Wicky - uBoot
You're right I just got confused with the numbers... sometimes it's sata0 and sata1 as I expect, other times it's sata1 and sata2... back to the drawing board. FWIW I did something potentially very stupid and inserted my 2nd 3.5'' HDD into the 2nd SATA port while it was running... I clearly heard it (attempt to??) spin up for less than 2 seconds before bad things happeby Micky Wicky - uBoot
Not sure I've been entirely clear... I mean that the only things I can make out in the stock u-boot source code is about GPIO33 being the pin for sata1 power. 2014.07 and 2015.10 must initialise it differently to stock somehowby Micky Wicky - uBoot
RIght, I've not managed to find out anything beyond GPIO33... But in the stock u-boot it is definitely the one - maybe u-boot 2015.10 is missing something else?by Micky Wicky - uBoot