public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add SDTI device for the OMAP3 and unify address definitions.
@ 2008-05-28 12:17 Roman Tereshonkov
  2008-05-28 15:22 ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Tereshonkov @ 2008-05-28 12:17 UTC (permalink / raw)
  To: linux-omap; +Cc: Roman Tereshonkov


Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
---
 arch/arm/mach-omap2/devices.c |   23 ++++++++++++++++++++++-
 drivers/misc/sti/sti.c        |    2 +-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index d02e9e5..d8fb3f8 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -92,7 +92,9 @@ static inline void omap_init_mbox(void) { }
 
 #if defined(CONFIG_OMAP_STI)
 
-#define OMAP2_STI_BASE		IO_ADDRESS(0x48068000)
+#if defined(CONFIG_ARCH_OMAP2)
+
+#define OMAP2_STI_BASE		0x48068000
 #define OMAP2_STI_CHANNEL_BASE	0x54000000
 #define OMAP2_STI_IRQ		4
 
@@ -112,6 +114,25 @@ static struct resource sti_resources[] = {
 		.flags		= IORESOURCE_IRQ,
 	}
 };
+#elif defined(CONFIG_ARCH_OMAP3)
+
+#define OMAP3_SDTI_BASE		0x54500000
+#define OMAP3_SDTI_CHANNEL_BASE	0x54600000
+
+static struct resource sti_resources[] = {
+	{
+		.start		= OMAP3_SDTI_BASE,
+		.end		= OMAP3_SDTI_BASE + 0xFFF,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3_SDTI_CHANNEL_BASE,
+		.end		= OMAP3_SDTI_CHANNEL_BASE + SZ_1M - 1,
+		.flags		= IORESOURCE_MEM,
+	}
+};
+
+#endif
 
 static struct platform_device sti_device = {
 	.name		= "sti",
diff --git a/drivers/misc/sti/sti.c b/drivers/misc/sti/sti.c
index e828860..880c34b 100644
--- a/drivers/misc/sti/sti.c
+++ b/drivers/misc/sti/sti.c
@@ -356,7 +356,7 @@ static int __devinit sti_probe(struct platform_device *pdev)
 	if (unlikely(ret != 0))
 		goto err;
 
-	sti_base = res->start;
+	sti_base = io_p2v(res->start);
 
 	/*
 	 * OMAP 16xx keeps channels in a relatively sane location,
-- 
1.5.5.1


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

* Re: [PATCH] Add SDTI device for the OMAP3 and unify address definitions.
  2008-05-28 12:17 [PATCH] Add SDTI device for the OMAP3 and unify address definitions Roman Tereshonkov
@ 2008-05-28 15:22 ` Tony Lindgren
  2008-05-28 15:52   ` [PATCH] Add SDTI device for the OMAP3 and unify addressdefinitions roman.tereshonkov
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2008-05-28 15:22 UTC (permalink / raw)
  To: Roman Tereshonkov; +Cc: linux-omap

* Roman Tereshonkov <roman.tereshonkov@nokia.com> [080528 05:17]:
> 
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> ---
>  arch/arm/mach-omap2/devices.c |   23 ++++++++++++++++++++++-
>  drivers/misc/sti/sti.c        |    2 +-
>  2 files changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index d02e9e5..d8fb3f8 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -92,7 +92,9 @@ static inline void omap_init_mbox(void) { }
>  
>  #if defined(CONFIG_OMAP_STI)
>  
> -#define OMAP2_STI_BASE		IO_ADDRESS(0x48068000)
> +#if defined(CONFIG_ARCH_OMAP2)
> +
> +#define OMAP2_STI_BASE		0x48068000
>  #define OMAP2_STI_CHANNEL_BASE	0x54000000
>  #define OMAP2_STI_IRQ		4
>  
> @@ -112,6 +114,25 @@ static struct resource sti_resources[] = {
>  		.flags		= IORESOURCE_IRQ,
>  	}
>  };
> +#elif defined(CONFIG_ARCH_OMAP3)
> +
> +#define OMAP3_SDTI_BASE		0x54500000
> +#define OMAP3_SDTI_CHANNEL_BASE	0x54600000
> +
> +static struct resource sti_resources[] = {
> +	{
> +		.start		= OMAP3_SDTI_BASE,
> +		.end		= OMAP3_SDTI_BASE + 0xFFF,
> +		.flags		= IORESOURCE_MEM,
> +	},
> +	{
> +		.start		= OMAP3_SDTI_CHANNEL_BASE,
> +		.end		= OMAP3_SDTI_CHANNEL_BASE + SZ_1M - 1,
> +		.flags		= IORESOURCE_MEM,
> +	}
> +};
> +
> +#endif
>  
>  static struct platform_device sti_device = {
>  	.name		= "sti",
> diff --git a/drivers/misc/sti/sti.c b/drivers/misc/sti/sti.c
> index e828860..880c34b 100644
> --- a/drivers/misc/sti/sti.c
> +++ b/drivers/misc/sti/sti.c
> @@ -356,7 +356,7 @@ static int __devinit sti_probe(struct platform_device *pdev)
>  	if (unlikely(ret != 0))
>  		goto err;
>  
> -	sti_base = res->start;
> +	sti_base = io_p2v(res->start);
>  
>  	/*
>  	 * OMAP 16xx keeps channels in a relatively sane location,

Hmm, so does this still work for 16xx and 24xx? To me it looks like
mach-omap1/devices.c mach-omap2/devices.c are both passing a
virtual address?

So maybe change mach-omap1/devices.c to pass physical address for both
STI_BASE and CHANNEL_BASE, and then change mach-omap2/devices.c to pass
physical address for OMAP2_STI_BASE. Looks like OMAP2_STI_CHANNEL_BASE
is already a physical address as it needs to be ioremapped.

To add to the confusion, 

Regards,

Tony

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

* RE: [PATCH] Add SDTI device for the OMAP3 and unify addressdefinitions.
  2008-05-28 15:22 ` Tony Lindgren
@ 2008-05-28 15:52   ` roman.tereshonkov
  0 siblings, 0 replies; 3+ messages in thread
From: roman.tereshonkov @ 2008-05-28 15:52 UTC (permalink / raw)
  To: tony; +Cc: linux-omap


You are right. OMAP1 device.c has been forgotten. I will fix that.

Roman
 

-----Original Message-----
From: ext Tony Lindgren [mailto:tony@atomide.com] 
Sent: 28 May, 2008 18:23
To: Tereshonkov Roman (Nokia-D/Helsinki)
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH] Add SDTI device for the OMAP3 and unify
addressdefinitions.

* Roman Tereshonkov <roman.tereshonkov@nokia.com> [080528 05:17]:
> 
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> ---
>  arch/arm/mach-omap2/devices.c |   23 ++++++++++++++++++++++-
>  drivers/misc/sti/sti.c        |    2 +-
>  2 files changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/devices.c
b/arch/arm/mach-omap2/devices.c
> index d02e9e5..d8fb3f8 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -92,7 +92,9 @@ static inline void omap_init_mbox(void) { }
>  
>  #if defined(CONFIG_OMAP_STI)
>  
> -#define OMAP2_STI_BASE		IO_ADDRESS(0x48068000)
> +#if defined(CONFIG_ARCH_OMAP2)
> +
> +#define OMAP2_STI_BASE		0x48068000
>  #define OMAP2_STI_CHANNEL_BASE	0x54000000
>  #define OMAP2_STI_IRQ		4
>  
> @@ -112,6 +114,25 @@ static struct resource sti_resources[] = {
>  		.flags		= IORESOURCE_IRQ,
>  	}
>  };
> +#elif defined(CONFIG_ARCH_OMAP3)
> +
> +#define OMAP3_SDTI_BASE		0x54500000
> +#define OMAP3_SDTI_CHANNEL_BASE	0x54600000
> +
> +static struct resource sti_resources[] = {
> +	{
> +		.start		= OMAP3_SDTI_BASE,
> +		.end		= OMAP3_SDTI_BASE + 0xFFF,
> +		.flags		= IORESOURCE_MEM,
> +	},
> +	{
> +		.start		= OMAP3_SDTI_CHANNEL_BASE,
> +		.end		= OMAP3_SDTI_CHANNEL_BASE + SZ_1M - 1,
> +		.flags		= IORESOURCE_MEM,
> +	}
> +};
> +
> +#endif
>  
>  static struct platform_device sti_device = {
>  	.name		= "sti",
> diff --git a/drivers/misc/sti/sti.c b/drivers/misc/sti/sti.c
> index e828860..880c34b 100644
> --- a/drivers/misc/sti/sti.c
> +++ b/drivers/misc/sti/sti.c
> @@ -356,7 +356,7 @@ static int __devinit sti_probe(struct
platform_device *pdev)
>  	if (unlikely(ret != 0))
>  		goto err;
>  
> -	sti_base = res->start;
> +	sti_base = io_p2v(res->start);
>  
>  	/*
>  	 * OMAP 16xx keeps channels in a relatively sane location,

Hmm, so does this still work for 16xx and 24xx? To me it looks like
mach-omap1/devices.c mach-omap2/devices.c are both passing a
virtual address?

So maybe change mach-omap1/devices.c to pass physical address for both
STI_BASE and CHANNEL_BASE, and then change mach-omap2/devices.c to pass
physical address for OMAP2_STI_BASE. Looks like OMAP2_STI_CHANNEL_BASE
is already a physical address as it needs to be ioremapped.

To add to the confusion, 

Regards,

Tony

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

end of thread, other threads:[~2008-05-28 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 12:17 [PATCH] Add SDTI device for the OMAP3 and unify address definitions Roman Tereshonkov
2008-05-28 15:22 ` Tony Lindgren
2008-05-28 15:52   ` [PATCH] Add SDTI device for the OMAP3 and unify addressdefinitions roman.tereshonkov

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