[PATCH] Fix CPM1 uart console
Kumar Gala
galak at kernel.crashing.org
Thu Sep 13 08:57:53 EST 2007
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 at 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 at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
More information about the Linuxppc-embedded
mailing list