From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Baatz Date: Tue, 17 Apr 2012 01:03:33 +0200 Subject: [U-Boot] [PATCH v7] kirkwood: add NAS62x0 board support In-Reply-To: <20120414172532.GA20019@w500.iskon.local> References: <20120414172532.GA20019@w500.iskon.local> Message-ID: <4F8CA545.6060701@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, Am 14.04.2012 19:25, schrieb Luka Perkov: > NAS6210 eSATA port is not working from uboot... That is why there are > CONFIG_BOARD_IS_IB_NAS6210 and CONFIG_BOARD_IS_IB_NAS6220 in ib62x0.h > config file. > > I think I have found the reason why the eSATA port is not working on the 6210. I think the second port on the 6220 does not work either. Surprisingly, the reason is completely unrelated to this board and has also been described before (see for example http://www.varkey.in/2011/06/boot-debian-from-sata-seagate-goflex-net/ which states: Shutdown the GoFlex Net, connect the hard disk to the **right** side SATA port. There seems to be a bug in Jeff?s uBoot for GoFlex Net, so within uBoot only the right port works. ) If you compile the patch for the 6220 and use it on the 6210, the first hard disk is detected twice and the second one is not detected at all. The problem is a mismatch in "include/ide.h" and "common/cmd_ide.c". ide.h defines: #define IDE_BUS(dev) (dev >> 1) However, cmd_ide.c uses the following in ide_init(): for (bus = 0; bus < CONFIG_SYS_IDE_MAXBUS; ++bus) { int dev = bus * (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS); In this case CONFIG_SYS_IDE_MAXDEVICE and CONFIG_SYS_IDE_MAXDEVICE are both 2 since there are two SATA ports with max one device each. However, IDE_BUS seems to assume that each bus has two devices and thus returns the first bus even when the second one should be probed. I don't know whether it is the proper fix for this, but #define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS)) in ide.h fixes the problem for me and detects both the internal hard disk and the hard disk@the eSATA port. This also means that the 6210/6220 patch should not make a difference between the two boards. - Simon