public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon Baatz <gmbnomis@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v7] kirkwood: add NAS62x0 board support
Date: Tue, 17 Apr 2012 01:03:33 +0200	[thread overview]
Message-ID: <4F8CA545.6060701@gmail.com> (raw)
In-Reply-To: <20120414172532.GA20019@w500.iskon.local>

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

  parent reply	other threads:[~2012-04-16 23:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-14 17:25 [U-Boot] [PATCH v7] kirkwood: add NAS62x0 board support Luka Perkov
2012-04-15 10:41 ` Marek Vasut
2012-04-15 14:08   ` Luka Perkov
2012-04-16 23:03 ` Simon Baatz [this message]
2012-04-17  9:14   ` Prafulla Wadaskar
2012-04-17 18:47     ` Luka Perkov
2012-04-17 19:19       ` David Purdy
2012-04-17 19:41         ` Luka Perkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F8CA545.6060701@gmail.com \
    --to=gmbnomis@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox