From: Jochen Friedrich <jochen@scram.de>
To: Linuxppc-embedded@ozlabs.org
Subject: [PATCH] Fix CPM1 uart console
Date: Wed, 29 Aug 2007 19:04:21 +0200 [thread overview]
Message-ID: <46D5A715.7090802@scram.de> (raw)
[-- 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);
next reply other threads:[~2007-08-29 17:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-29 17:04 Jochen Friedrich [this message]
2007-09-12 22:57 ` [PATCH] Fix CPM1 uart console Kumar Gala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46D5A715.7090802@scram.de \
--to=jochen@scram.de \
--cc=Linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).