All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support
Date: Wed, 04 Aug 2010 22:35:39 +0200	[thread overview]
Message-ID: <4C59CF1B.6050904@free.fr> (raw)
In-Reply-To: <F766E4F80769BD478052FB6533FA745D19A6576A01@SC-VEXCH4.marvell.com>

Some thoughts, and then a question for Wolfgang regarding IDE config macros

Le 04/08/2010 08:08, Prafulla Wadaskar a ?crit :

> I have two more suggestion,
> 1. put ide_preinit function in mvsata driver, define CONFIG_IDE_PREINIT in board config file

This could help reducing the source code size, because then we don't 
need an mvsata_ide.h any more as mvsata_ide_initialize_port() would 
become a static function ov mvsata_ide.c, called by ide_preinit().

One issue is that ide_preinit() should initialize only those ports that 
exist and are used in a given board. If we put it in mvsata_ide.c, then 
we need to rely on config macros to tell ide_preinit() where port 0 is, 
and if port 1 exists/is used, where it is too.

Note that this info is exactly the same as that given in configs for 
cmd_ide.

For instance, for ED Mini V2 (uses port 1 only) we'd have something like

/* ATA registers base is at SATA controller base */
#define CONFIG_SYS_ATA_BASE_ADDR	ORION5X_SATA_BASE
/* ATA bus 0 is orion5x port 1 on ED Mini V2 */
#define CONFIG_SYS_ATA_IDE0_OFFSET	ORION5X_SATA_PORT1_OFFSET

... and for OpenRD, which has two SATA ports:

/* ATA registers base is at SATA controller base */
#define CONFIG_SYS_ATA_BASE_ADDR	KW_SATA_BASE
/* ATA bus 0 is orion5x port 1 on ED Mini V2 */
#define CONFIG_SYS_ATA_IDE0_OFFSET	KW_SATA_PORT0_OFFSET
#define CONFIG_SYS_ATA_IDE1_OFFSET	KW_SATA_PORT1_OFFSET

Theoretically I should create a similar set of macros for mvsata_ide, 
but it seems to be that since mvsata_ide is intended to always be used 
along with cmd_ide, it would be simpler to use the cmd_ide macros 
CONFIG_SYS_ATA_x macros in mvsata_ide.c to determine port0's address 
and, if port1 exists, port1's address.

Wolfgang, would it be allowable for mvsata_ide to use macros intended 
for cmd_ide?

Amicalement,
-- 
Albert.

  parent reply	other threads:[~2010-08-04 20:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 12:02 [U-Boot] [PATCH V5 1/4] ide: add configuration CONFIG_IDE_SWAP_IO Albert Aribaud
2010-07-13 12:02 ` [U-Boot] [PATCH V5 2/4] ide: add mvsata_ide driver Albert Aribaud
2010-07-13 12:02   ` [U-Boot] [PATCH V5 3/4] cmd_ide: add support for orion5x Albert Aribaud
2010-07-13 12:02     ` [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support Albert Aribaud
2010-07-19  7:31       ` Prafulla Wadaskar
2010-07-21 10:26       ` Prafulla Wadaskar
2010-07-23 10:50         ` Albert ARIBAUD
2010-08-01 16:48           ` Prafulla Wadaskar
2010-08-01 17:34             ` Albert ARIBAUD
2010-08-02  3:35               ` Prafulla Wadaskar
2010-08-02  6:13                 ` Albert ARIBAUD
2010-08-03 12:01                   ` Albert ARIBAUD
2010-08-03 12:10                     ` Prafulla Wadaskar
2010-08-04  6:08                     ` Prafulla Wadaskar
2010-08-04  7:23                       ` Albert ARIBAUD
2010-08-04 20:03                         ` Albert ARIBAUD
2010-08-05  5:23                           ` Prafulla Wadaskar
2010-08-04 20:35                       ` Albert ARIBAUD [this message]
2010-08-05  5:27                         ` Prafulla Wadaskar
2010-08-05 12:35                           ` Albert ARIBAUD
2010-08-07 21:15                         ` Wolfgang Denk
2010-07-21 10:17     ` [U-Boot] [PATCH V5 3/4] cmd_ide: add support for orion5x Prafulla Wadaskar
2010-07-21 10:16   ` [U-Boot] [PATCH V5 2/4] ide: add mvsata_ide driver Prafulla Wadaskar
2010-07-21 17:04     ` Albert ARIBAUD
2010-07-14 15:03 ` [U-Boot] [PATCH V5 1/4] ide: add configuration CONFIG_IDE_SWAP_IO Albert ARIBAUD
2010-07-20 13:43   ` Wolfgang Denk

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=4C59CF1B.6050904@free.fr \
    --to=albert.aribaud@free.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.