linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix CPM1 uart console
@ 2007-08-29 17:04 Jochen Friedrich
  2007-09-12 22:57 ` Kumar Gala
  0 siblings, 1 reply; 2+ messages in thread
From: Jochen Friedrich @ 2007-08-29 17:04 UTC (permalink / raw)
  To: Linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 646 bytes --]

The powerpc version of commproc.c doesn't export cpm_dpram_phys due to
a typo. The ppc version of cpm_dpram_addr returns a usable virtual address
mapped to a physical address at the same location. cpm_dpram_phys returns
complete garbage as it tries to calculate an offset based on an otherwise
unused virtual adress returned by ioremap.

This patch fixes the typo for powerpc and removes the unnecessary ioremap
and corresponding virtual address for ppc.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
 arch/powerpc/sysdev/commproc.c |    2 +-
 arch/ppc/8xx_io/commproc.c     |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

[-- Attachment #2: 60d3d5feb1e51a5c0d839c4b7b2b683b82b43fee.diff --]
[-- Type: text/x-patch, Size: 1161 bytes --]

diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 4f67b89..dd5417a 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -395,4 +395,4 @@ uint cpm_dpram_phys(u8* addr)
 {
 	return (dpram_pbase + (uint)(addr - dpram_vbase));
 }
-EXPORT_SYMBOL(cpm_dpram_addr);
+EXPORT_SYMBOL(cpm_dpram_phys);
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 7088428..593b939 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -379,14 +379,12 @@ static rh_block_t cpm_boot_dpmem_rh_block[16];
 static rh_info_t cpm_dpmem_info;
 
 #define CPM_DPMEM_ALIGNMENT	8
-static u8* dpram_vbase;
 static uint dpram_pbase;
 
 void m8xx_cpm_dpinit(void)
 {
 	spin_lock_init(&cpm_dpmem_lock);
 
-	dpram_vbase = immr_map_size(im_cpm.cp_dpmem, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE);
 	dpram_pbase = (uint)&((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem;
 
 	/* Initialize the info header */
@@ -465,6 +463,6 @@ EXPORT_SYMBOL(cpm_dpram_addr);
 
 uint cpm_dpram_phys(u8* addr)
 {
-	return (dpram_pbase + (uint)(addr - dpram_vbase));
+	return (uint)addr;
 }
 EXPORT_SYMBOL(cpm_dpram_phys);


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

* Re: [PATCH] Fix CPM1 uart console
  2007-08-29 17:04 [PATCH] Fix CPM1 uart console Jochen Friedrich
@ 2007-09-12 22:57 ` Kumar Gala
  0 siblings, 0 replies; 2+ messages in thread
From: Kumar Gala @ 2007-09-12 22:57 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: Linuxppc-embedded


On Aug 29, 2007, at 12:04 PM, Jochen Friedrich wrote:

> The powerpc version of commproc.c doesn't export cpm_dpram_phys due to
> a typo. The ppc version of cpm_dpram_addr returns a usable virtual  
> address
> mapped to a physical address at the same location. cpm_dpram_phys  
> returns
> complete garbage as it tries to calculate an offset based on an  
> otherwise
> unused virtual adress returned by ioremap.
>
> This patch fixes the typo for powerpc and removes the unnecessary  
> ioremap
> and corresponding virtual address for ppc.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---
>  arch/powerpc/sysdev/commproc.c |    2 +-
>  arch/ppc/8xx_io/commproc.c     |    4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/ 
> commproc.c
> index 4f67b89..dd5417a 100644
> --- a/arch/powerpc/sysdev/commproc.c
> +++ b/arch/powerpc/sysdev/commproc.c
> @@ -395,4 +395,4 @@ uint cpm_dpram_phys(u8* addr)
>  {
>  	return (dpram_pbase + (uint)(addr - dpram_vbase));
>  }
> -EXPORT_SYMBOL(cpm_dpram_addr);
> +EXPORT_SYMBOL(cpm_dpram_phys);
> diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
> index 7088428..593b939 100644
> --- a/arch/ppc/8xx_io/commproc.c
> +++ b/arch/ppc/8xx_io/commproc.c
> @@ -379,14 +379,12 @@ static rh_block_t cpm_boot_dpmem_rh_block[16];
>  static rh_info_t cpm_dpmem_info;
>
>  #define CPM_DPMEM_ALIGNMENT	8
> -static u8* dpram_vbase;
>  static uint dpram_pbase;
>
>  void m8xx_cpm_dpinit(void)
>  {
>  	spin_lock_init(&cpm_dpmem_lock);
>
> -	dpram_vbase = immr_map_size(im_cpm.cp_dpmem, CPM_DATAONLY_BASE +  
> CPM_DATAONLY_SIZE);
>  	dpram_pbase = (uint)&((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem;
>
>  	/* Initialize the info header */
> @@ -465,6 +463,6 @@ EXPORT_SYMBOL(cpm_dpram_addr);
>
>  uint cpm_dpram_phys(u8* addr)
>  {
> -	return (dpram_pbase + (uint)(addr - dpram_vbase));
> +	return (uint)addr;

this doesn't seem quite right.

>  }
>  EXPORT_SYMBOL(cpm_dpram_phys);
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 17:04 [PATCH] Fix CPM1 uart console Jochen Friedrich
2007-09-12 22:57 ` Kumar Gala

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).