linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [libata] Set proper ATA UDMA mode for bf548 according to system clock.
@ 2007-11-27  4:47 sonic zhang
  2007-11-29  7:18 ` Sonic Zhang
  2007-12-01 22:36 ` Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: sonic zhang @ 2007-11-27  4:47 UTC (permalink / raw)
  To: Linux IDE, Linux Kernel; +Cc: Jeff Garzik

UDMA Mode - Frequency compatibility

UDMA5 - 100 MB/s   - SCLK  = 133 MHz
UDMA4 - 66 MB/s    - SCLK >=  80 MHz
UDMA3 - 44.4 MB/s  - SCLK >=  50 MHz
UDMA2 - 33 MB/s    - SCLK >=  40 MHz


Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 drivers/ata/pata_bf54x.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 81db405..088a41f 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1489,6 +1489,8 @@ static int __devinit bfin_atapi_probe(st
 	int board_idx = 0;
 	struct resource *res;
 	struct ata_host *host;
+	unsigned int fsclk = get_sclk();
+	int udma_mode = 5;
 	const struct ata_port_info *ppi[] =
 		{ &bfin_port_info[board_idx], NULL };
 
@@ -1507,6 +1509,11 @@ static int __devinit bfin_atapi_probe(st
 	if (res == NULL)
 		return -EINVAL;
 
+	while (bfin_port_info[board_idx].udma_mask>0 && udma_fsclk[udma_mode] > fsclk) {
+		udma_mode--;
+		bfin_port_info[board_idx].udma_mask >>= 1;
+	}
+
 	/*
 	 * Now that that's out of the way, wire up the port..
 	 */
-- 
1.4.3.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [libata] Set proper ATA UDMA mode for bf548 according to system clock.
  2007-11-27  4:47 [PATCH] [libata] Set proper ATA UDMA mode for bf548 according to system clock sonic zhang
@ 2007-11-29  7:18 ` Sonic Zhang
  2007-11-29  9:26   ` Alan Cox
  2007-12-01 22:36 ` Jeff Garzik
  1 sibling, 1 reply; 4+ messages in thread
From: Sonic Zhang @ 2007-11-29  7:18 UTC (permalink / raw)
  To: Linux IDE, Linux Kernel

Any comment?

Thanks

Sonic

On Nov 27, 2007 12:47 PM, sonic zhang <sonic.adi@gmail.com> wrote:
> UDMA Mode - Frequency compatibility
>
> UDMA5 - 100 MB/s   - SCLK  = 133 MHz
> UDMA4 - 66 MB/s    - SCLK >=  80 MHz
> UDMA3 - 44.4 MB/s  - SCLK >=  50 MHz
> UDMA2 - 33 MB/s    - SCLK >=  40 MHz
>
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
>  drivers/ata/pata_bf54x.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
> index 81db405..088a41f 100644
> --- a/drivers/ata/pata_bf54x.c
> +++ b/drivers/ata/pata_bf54x.c
> @@ -1489,6 +1489,8 @@ static int __devinit bfin_atapi_probe(st
>         int board_idx = 0;
>         struct resource *res;
>         struct ata_host *host;
> +       unsigned int fsclk = get_sclk();
> +       int udma_mode = 5;
>         const struct ata_port_info *ppi[] =
>                 { &bfin_port_info[board_idx], NULL };
>
> @@ -1507,6 +1509,11 @@ static int __devinit bfin_atapi_probe(st
>         if (res == NULL)
>                 return -EINVAL;
>
> +       while (bfin_port_info[board_idx].udma_mask>0 && udma_fsclk[udma_mode] > fsclk) {
> +               udma_mode--;
> +               bfin_port_info[board_idx].udma_mask >>= 1;
> +       }
> +
>         /*
>          * Now that that's out of the way, wire up the port..
>          */
> --
> 1.4.3.4
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [libata] Set proper ATA UDMA mode for bf548 according to system clock.
  2007-11-29  7:18 ` Sonic Zhang
@ 2007-11-29  9:26   ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2007-11-29  9:26 UTC (permalink / raw)
  To: Sonic Zhang; +Cc: Linux IDE, Linux Kernel

On Thu, 29 Nov 2007 15:18:24 +0800
"Sonic Zhang" <sonic.adi@gmail.com> wrote:

> Any comment?

Looks fine to me


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [libata] Set proper ATA UDMA mode for bf548 according to system clock.
  2007-11-27  4:47 [PATCH] [libata] Set proper ATA UDMA mode for bf548 according to system clock sonic zhang
  2007-11-29  7:18 ` Sonic Zhang
@ 2007-12-01 22:36 ` Jeff Garzik
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2007-12-01 22:36 UTC (permalink / raw)
  To: sonic zhang; +Cc: Linux IDE, Linux Kernel

sonic zhang wrote:
> UDMA Mode - Frequency compatibility
> 
> UDMA5 - 100 MB/s   - SCLK  = 133 MHz
> UDMA4 - 66 MB/s    - SCLK >=  80 MHz
> UDMA3 - 44.4 MB/s  - SCLK >=  50 MHz
> UDMA2 - 33 MB/s    - SCLK >=  40 MHz
> 
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
>  drivers/ata/pata_bf54x.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)

applied #upstream-fixes



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-01 22:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-27  4:47 [PATCH] [libata] Set proper ATA UDMA mode for bf548 according to system clock sonic zhang
2007-11-29  7:18 ` Sonic Zhang
2007-11-29  9:26   ` Alan Cox
2007-12-01 22:36 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).