mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Allow use platform_ide driver without ALT-registers
@ 2012-04-18 18:25 Alexander Shiyan
  2012-04-18 18:43 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2012-04-18 18:25 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/ata/intf_platform_ide.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/intf_platform_ide.c b/drivers/ata/intf_platform_ide.c
index 1955a9c..af20e05 100644
--- a/drivers/ata/intf_platform_ide.c
+++ b/drivers/ata/intf_platform_ide.c
@@ -64,10 +64,16 @@ static void platform_ide_setup_port(void *reg_base, void *alt_base,
 	ioaddr->status_addr = reg_base + (IDE_REG_STATUS << shift);
 	ioaddr->command_addr = reg_base + (IDE_REG_CMD << shift);
 
-	ioaddr->altstatus_addr = alt_base + (IDE_REG_ALT_STATUS << shift);
-	ioaddr->ctl_addr = alt_base + (IDE_REG_DEV_CTL << shift);
-
-	ioaddr->alt_dev_addr = alt_base + (IDE_REG_DRV_ADDR << shift);
+	if (alt_base) {
+		ioaddr->altstatus_addr = alt_base + (IDE_REG_ALT_STATUS << shift);
+		ioaddr->ctl_addr = alt_base + (IDE_REG_DEV_CTL << shift);
+
+		ioaddr->alt_dev_addr = alt_base + (IDE_REG_DRV_ADDR << shift);
+	} else {
+		ioaddr->altstatus_addr = ioaddr->status_addr;
+		ioaddr->ctl_addr = ioaddr->status_addr;
+		/* ioaddr->alt_dev_addr not used in driver */
+	}
 }
 
 static int platform_ide_probe(struct device_d *dev)
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] Allow use platform_ide driver without ALT-registers
  2012-04-18 18:25 [PATCH] Allow use platform_ide driver without ALT-registers Alexander Shiyan
@ 2012-04-18 18:43 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2012-04-18 18:43 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Wed, Apr 18, 2012 at 10:25:10PM +0400, Alexander Shiyan wrote:
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Applied, thanks

Sascha

> ---
>  drivers/ata/intf_platform_ide.c |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/intf_platform_ide.c b/drivers/ata/intf_platform_ide.c
> index 1955a9c..af20e05 100644
> --- a/drivers/ata/intf_platform_ide.c
> +++ b/drivers/ata/intf_platform_ide.c
> @@ -64,10 +64,16 @@ static void platform_ide_setup_port(void *reg_base, void *alt_base,
>  	ioaddr->status_addr = reg_base + (IDE_REG_STATUS << shift);
>  	ioaddr->command_addr = reg_base + (IDE_REG_CMD << shift);
>  
> -	ioaddr->altstatus_addr = alt_base + (IDE_REG_ALT_STATUS << shift);
> -	ioaddr->ctl_addr = alt_base + (IDE_REG_DEV_CTL << shift);
> -
> -	ioaddr->alt_dev_addr = alt_base + (IDE_REG_DRV_ADDR << shift);
> +	if (alt_base) {
> +		ioaddr->altstatus_addr = alt_base + (IDE_REG_ALT_STATUS << shift);
> +		ioaddr->ctl_addr = alt_base + (IDE_REG_DEV_CTL << shift);
> +
> +		ioaddr->alt_dev_addr = alt_base + (IDE_REG_DRV_ADDR << shift);
> +	} else {
> +		ioaddr->altstatus_addr = ioaddr->status_addr;
> +		ioaddr->ctl_addr = ioaddr->status_addr;
> +		/* ioaddr->alt_dev_addr not used in driver */
> +	}
>  }
>  
>  static int platform_ide_probe(struct device_d *dev)
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-04-18 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-18 18:25 [PATCH] Allow use platform_ide driver without ALT-registers Alexander Shiyan
2012-04-18 18:43 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox