public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x
@ 2007-01-18 17:07 Stefan Roese
  2007-01-18 17:24 ` Sergei Shtylyov
  2007-01-18 23:59 ` Lennert Buytenhek
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Roese @ 2007-01-18 17:07 UTC (permalink / raw)
  To: linux-mtd

[PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x

This patch adds support for 64 bit resources and can be used on
PPC440 platforms to pass the complete 64 bit address from the
platform file to the physmap driver. This is first used on the
AMCC Taishan 440GX evaluation board.

Signed-off-by: Stefan Roese <sr@denx.de>

---
commit 428858620a600f991662969be6d6b3e3720da1ac
tree cf3c861fbdddd841401a1e66f441623f0b3fb83c
parent d637c5644df789f15dfe06550fab1dddb87083ca
author Stefan Roese <sr@denx.de> Thu, 18 Jan 2007 14:40:53 +0100
committer Stefan Roese <sr@denx.de> Thu, 18 Jan 2007 14:40:53 +0100

 drivers/mtd/maps/physmap.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index d171776..23072e3 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -116,7 +116,14 @@ static int physmap_flash_probe(struct platform_device 
*dev)
 	info->map.bankwidth = physmap_data->width;
 	info->map.set_vpp = physmap_data->set_vpp;
 
+#ifdef CONFIG_44x
+	if (sizeof(dev->resource->start) == 4)
+		info->map.virt = ioremap(info->map.phys, info->map.size);
+	else
+		info->map.virt = ioremap64(dev->resource->start, info->map.size);
+#else
 	info->map.virt = ioremap(info->map.phys, info->map.size);
+#endif
 	if (info->map.virt == NULL) {
 		dev_err(&dev->dev, "Failed to ioremap flash region\n");
 		err = EIO;

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

* Re: [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x
  2007-01-18 17:07 [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x Stefan Roese
@ 2007-01-18 17:24 ` Sergei Shtylyov
  2007-01-18 17:46   ` Stefan Roese
  2007-01-18 23:59 ` Lennert Buytenhek
  1 sibling, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2007-01-18 17:24 UTC (permalink / raw)
  To: Stefan Roese; +Cc: linux-mtd

Hello.

Stefan Roese wrote:
> [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x

> This patch adds support for 64 bit resources and can be used on
> PPC440 platforms to pass the complete 64 bit address from the
> platform file to the physmap driver. This is first used on the
> AMCC Taishan 440GX evaluation board.

    Is this board support in arch/ppc/ or arch/powerpc/?

> Signed-off-by: Stefan Roese <sr@denx.de>

> ---
> commit 428858620a600f991662969be6d6b3e3720da1ac
> tree cf3c861fbdddd841401a1e66f441623f0b3fb83c
> parent d637c5644df789f15dfe06550fab1dddb87083ca
> author Stefan Roese <sr@denx.de> Thu, 18 Jan 2007 14:40:53 +0100
> committer Stefan Roese <sr@denx.de> Thu, 18 Jan 2007 14:40:53 +0100
> 
>  drivers/mtd/maps/physmap.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
> index d171776..23072e3 100644
> --- a/drivers/mtd/maps/physmap.c
> +++ b/drivers/mtd/maps/physmap.c
> @@ -116,7 +116,14 @@ static int physmap_flash_probe(struct platform_device 
> *dev)

    And what do you assign to info->map.phys, a meaninglessly truncated 64-bit 
address?
    I think that 'phys' field's type should be changed to a more appropriate 
one, like resource_size_t, instead...

>  	info->map.bankwidth = physmap_data->width;
>  	info->map.set_vpp = physmap_data->set_vpp;

> +#ifdef CONFIG_44x

    Don't think we need this #ifdef at all.

> +	if (sizeof(dev->resource->start) == 4)
> +		info->map.virt = ioremap(info->map.phys, info->map.size);

    This line is meaningless duplication of the existing one (below #else).

> +	else
> +		info->map.virt = ioremap64(dev->resource->start, info->map.size);

    I see -- this is arch/ppc/... :-)
    Wait, ioremap() takes phys_addr_t which should be 64-bit in your case. Is 
there the need to call ioremap64()?

> +#else
>  	info->map.virt = ioremap(info->map.phys, info->map.size);
> +#endif
>  	if (info->map.virt == NULL) {
>  		dev_err(&dev->dev, "Failed to ioremap flash region\n");
>  		err = EIO;

WBR, Sergei

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

* Re: [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x
  2007-01-18 17:24 ` Sergei Shtylyov
@ 2007-01-18 17:46   ` Stefan Roese
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2007-01-18 17:46 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-mtd

Hi Sergei,

On Thursday 18 January 2007 18:24, Sergei Shtylyov wrote:
> > This patch adds support for 64 bit resources and can be used on
> > PPC440 platforms to pass the complete 64 bit address from the
> > platform file to the physmap driver. This is first used on the
> > AMCC Taishan 440GX evaluation board.
>
>     Is this board support in arch/ppc/ or arch/powerpc/?

Not yet in the kernel.org repository. It's right now in the denx repository 
but I plan to sent the board support patches to the lists, even if I know, 
that it most likely won't get included right now, because of the ppc->powerpc 
merge.

And yes, it's still an "arch->ppc" port.

> > Signed-off-by: Stefan Roese <sr@denx.de>
> >
> > ---
> > commit 428858620a600f991662969be6d6b3e3720da1ac
> > tree cf3c861fbdddd841401a1e66f441623f0b3fb83c
> > parent d637c5644df789f15dfe06550fab1dddb87083ca
> > author Stefan Roese <sr@denx.de> Thu, 18 Jan 2007 14:40:53 +0100
> > committer Stefan Roese <sr@denx.de> Thu, 18 Jan 2007 14:40:53 +0100
> >
> >  drivers/mtd/maps/physmap.c |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
> > index d171776..23072e3 100644
> > --- a/drivers/mtd/maps/physmap.c
> > +++ b/drivers/mtd/maps/physmap.c
> > @@ -116,7 +116,14 @@ static int physmap_flash_probe(struct
> > platform_device *dev)
>
>     And what do you assign to info->map.phys, a meaninglessly truncated
> 64-bit address?
>     I think that 'phys' field's type should be changed to a more
> appropriate one, like resource_size_t, instead...

Yes, this makes sense.

> >  	info->map.bankwidth = physmap_data->width;
> >  	info->map.set_vpp = physmap_data->set_vpp;
> >
> > +#ifdef CONFIG_44x
>
>     Don't think we need this #ifdef at all.
>
> > +	if (sizeof(dev->resource->start) == 4)
> > +		info->map.virt = ioremap(info->map.phys, info->map.size);
>
>     This line is meaningless duplication of the existing one (below #else).
>
> > +	else
> > +		info->map.virt = ioremap64(dev->resource->start, info->map.size);
>
>     I see -- this is arch/ppc/... :-)
>     Wait, ioremap() takes phys_addr_t which should be 64-bit in your case.
> Is there the need to call ioremap64()?

Yes, but ioremap() first call fixup_bigphys_addr() and this unfortunately 
corrupts my addresses.

I know this patch is far from perfect, so any suggestions are very welcome.

Thanks.

Best regards,
Stefan

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

* Re: [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x
  2007-01-18 17:07 [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x Stefan Roese
  2007-01-18 17:24 ` Sergei Shtylyov
@ 2007-01-18 23:59 ` Lennert Buytenhek
  2007-01-19  1:29   ` Josh Boyer
  1 sibling, 1 reply; 6+ messages in thread
From: Lennert Buytenhek @ 2007-01-18 23:59 UTC (permalink / raw)
  To: Stefan Roese; +Cc: linux-mtd

On Thu, Jan 18, 2007 at 06:07:53PM +0100, Stefan Roese wrote:

> --- a/drivers/mtd/maps/physmap.c
> +++ b/drivers/mtd/maps/physmap.c
> @@ -116,7 +116,14 @@ static int physmap_flash_probe(struct platform_device 
> *dev)
>  	info->map.bankwidth = physmap_data->width;
>  	info->map.set_vpp = physmap_data->set_vpp;
>  
> +#ifdef CONFIG_44x
> +	if (sizeof(dev->resource->start) == 4)

CONFIG_RESOURCES_64BIT


> +		info->map.virt = ioremap(info->map.phys, info->map.size);
> +	else
> +		info->map.virt = ioremap64(dev->resource->start, info->map.size);
> +#else
>  	info->map.virt = ioremap(info->map.phys, info->map.size);
> +#endif

Ugh.  Do you have crap like this everywhere ioremap() is called?

Why can't you fix ioremap() to take >= 4G addresses instead?

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

* Re: [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x
  2007-01-18 23:59 ` Lennert Buytenhek
@ 2007-01-19  1:29   ` Josh Boyer
  2007-01-19  7:35     ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Josh Boyer @ 2007-01-19  1:29 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: linux-mtd

On 1/18/07, Lennert Buytenhek <buytenh@wantstofly.org> wrote:
> Why can't you fix ioremap() to take >= 4G addresses instead?

That might be something worth looking at.  We could fix it to not do
the big address fixup if CONFIG_RESOURCES_64BIT is enabled.

4xx is in a bit of disrepair and needs some attention.  It also needs
to get merged to arch/powerpc, which is a bit larger change.  I'm
hoping to have some time soon to focus on things like this.

josh

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

* Re: [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x
  2007-01-19  1:29   ` Josh Boyer
@ 2007-01-19  7:35     ` Stefan Roese
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2007-01-19  7:35 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linux-mtd, Lennert Buytenhek

Hi Josh,

On Friday 19 January 2007 02:29, Josh Boyer wrote:
> On 1/18/07, Lennert Buytenhek <buytenh@wantstofly.org> wrote:
> > Why can't you fix ioremap() to take >= 4G addresses instead?
>
> That might be something worth looking at.  We could fix it to not do
> the big address fixup if CONFIG_RESOURCES_64BIT is enabled.

Yes, good idea. I'll send a patch to the ppc list.

The only change needed now is 64bit support in the 'phys' field's. I'll send 
another path for this.

So please drop this patch completely.

Best regards,
Stefan

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

end of thread, other threads:[~2007-01-19  7:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-18 17:07 [PATCH] [MTD] physmap: Add support for 64 bit resources on PPC44x Stefan Roese
2007-01-18 17:24 ` Sergei Shtylyov
2007-01-18 17:46   ` Stefan Roese
2007-01-18 23:59 ` Lennert Buytenhek
2007-01-19  1:29   ` Josh Boyer
2007-01-19  7:35     ` Stefan Roese

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