From: michael <trimarchi@gandalf.sssup.it>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] ide support on arm
Date: Sat, 09 Feb 2008 19:28:19 +0100 [thread overview]
Message-ID: <47ADF0C3.7090808@gandalf.sssup.it> (raw)
In-Reply-To: <20080203192742.C561C24D13@gemini.denx.de>
Hi,
Wolfgang Denk wrote:
> In message <20080203165731.63cn9koo2s4c4wwc@feanor.sssup.it> you wrote:
>
>>> Indeed. There is no magic way for your code to make it into the
>>> public source tree without you posting proper patches first.
>>>
>>>
>> I have two patches pending:
>> - ide arm
>> - ixp465 patch (posted one year ago)
>>
>
> I can't find them. Please rebase and resubmit.
>
> Best regards,
>
> Wolfgang Denk
>
>
this is the patch and how to use it:
+#define CONFIG_DOS_PARTITION
+#define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
+#define CFG_IDE_MAXDEVICE 1 /* max. 2 drives per IDE bus */
+
+#define CFG_ATA_IDE0_OFFSET (0)
+
+#define CFG_ATA_BASE_ADDR (0x10000000)
+
+/* Offset for data I/O */
+#define CFG_ATA_DATA_OFFSET (0)
+
+/* Offset for normal register accesses */
+#define CFG_ATA_REG_OFFSET (0)
+
+/* Offset for alternate registers */
+#define CFG_ATA_ALT_OFFSET (0)
+
+/* Interval between
registers */
+#define CFG_ATA_STRIDE (1<<21)
+#define __io
+
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index c38be4f..5b0b738 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -934,7 +934,14 @@ output_data(int dev, ulong *sect_buf, int words)
static void
output_data(int dev, ulong *sect_buf, int words)
{
+#ifndef __ARM__
outsw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words<<1);
+#else
+ int i = words;
+ u16 *buf = (u16 *) sect_buf;
+ for (i=0; i < (words << 1); i++, buf++)
+ outw(ATA_CURR_BASE(dev)+ATA_DATA_REG, buf);
+#endif
}
#endif /* __PPC__ */
@@ -992,7 +999,14 @@ input_data(int dev, ulong *sect_buf, int words)
static void
input_data(int dev, ulong *sect_buf, int words)
{
+#ifndef __ARM__
insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words << 1);
+#else
+ int i;
+ volatile u16 *buf = (u16 *) sect_buf;
+ for(i = 0; i < (words<<1); i++, buf++)
+ *buf = inw(ATA_CURR_BASE(dev)+ATA_DATA_REG);
+#endif
}
diff --git a/lib_arm/board.c b/lib_arm/board.c
index 7e7a282..ddf4d5f 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -435,6 +435,12 @@ extern void dm644x_eth_set_mac_addr (const u_int8_t
*addr);
reset_phy();
#endif
#endif
+
+#if defined(CONFIG_CMD_IDE)
+ puts("IDE: ");
+ ide_init();
+#endif
+
/* main_loop() can return to retry autoboot, if so just run it
again. */
for (;;) {
main_loop ();
next prev parent reply other threads:[~2008-02-09 18:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-03 4:55 [U-Boot-Users] 答复: [U-Boot-Users] Re: 答复: [U-Boot-Users] HELP: How to make PPC booting easier tony liu
2008-02-03 8:10 ` Wolfgang Denk
2008-02-03 11:25 ` [U-Boot-Users] ide support on arm trimarchi at gandalf.sssup.it
2008-02-03 15:47 ` Wolfgang Denk
2008-02-03 15:57 ` trimarchi at gandalf.sssup.it
2008-02-03 18:08 ` Jean-Christophe PLAGNIOL-VILLARD
2008-02-03 19:27 ` Wolfgang Denk
2008-02-09 18:28 ` michael [this message]
2008-02-10 20:23 ` 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=47ADF0C3.7090808@gandalf.sssup.it \
--to=trimarchi@gandalf.sssup.it \
--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