From: Martyn Welch <martyn.welch@ge.com>
To: galak@kernel.crashing.org, benh@kernel.crashing.org
Cc: scottwood@freescale.com, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] PowerPC: Remove hardcoded BAT configuration of IMMR in CPM early debug console
Date: Fri, 28 May 2010 16:18:38 +0100 [thread overview]
Message-ID: <20100528151836.5889.10393.stgit@ES-J7S4D2J.amer.consind.ge.com> (raw)
The CPM early debug console hardcodes the BAT to cover the IMMR at
0xf0000000. The IMMR (on the mpc8270 at the very least) can be set to a
number of locations with bootstrap configuration, which are outside the
hardcoded BAT configuration.
This patch determines the correct location at which to configure a BAT
during the boot process from the supplied PPC_EARLY_DEBUG_CPM_ADDR.
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---
arch/powerpc/kernel/head_32.S | 5 +++--
arch/powerpc/sysdev/cpm_common.c | 4 +++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index e025e89..861cace 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -1194,12 +1194,13 @@ setup_disp_bat:
#endif /* CONFIG_BOOTX_TEXT */
#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
+#define PPC_EARLY_DEBUG_CPM_ADDR ASM_CONST(CONFIG_PPC_EARLY_DEBUG_CPM_ADDR)
setup_cpm_bat:
- lis r8, 0xf000
+ lis r8, PPC_EARLY_DEBUG_CPM_ADDR@ha
ori r8, r8, 0x002a
mtspr SPRN_DBAT1L, r8
- lis r11, 0xf000
+ lis r11, PPC_EARLY_DEBUG_CPM_ADDR@ha
ori r11, r11, (BL_1M << 2) | 2
mtspr SPRN_DBAT1U, r11
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 88b9812..984614f 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -57,7 +57,9 @@ void __init udbg_init_cpm(void)
{
if (cpm_udbg_txdesc) {
#ifdef CONFIG_CPM2
- setbat(1, 0xf0000000, 0xf0000000, 1024*1024, PAGE_KERNEL_NCG);
+#define EARLY_DEBUG_CPM_BAT (CONFIG_PPC_EARLY_DEBUG_CPM_ADDR&0xfff00000)
+ setbat(1, EARLY_DEBUG_CPM_BAT, EARLY_DEBUG_CPM_BAT, 1024*1024,
+ PAGE_KERNEL_NCG);
#endif
udbg_putc = udbg_putc_cpm;
}
--
Martyn Welch (Principal Software Engineer) | Registered in England and
GE Intelligent Platforms | Wales (3828642) at 100
T +44(0)127322748 | Barbirolli Square, Manchester,
E martyn.welch@ge.com | M2 3AB VAT:GB 927559189
next reply other threads:[~2010-05-28 15:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-28 15:18 Martyn Welch [this message]
2010-05-28 16:18 ` [PATCH] PowerPC: Remove hardcoded BAT configuration of IMMR in CPM early debug console Scott Wood
2010-05-29 3:37 ` Benjamin Herrenschmidt
2010-06-01 12:52 ` Martyn Welch
2010-06-01 13:43 ` Martyn Welch
2010-06-01 16:06 ` Scott Wood
2010-06-02 8:06 ` Martyn Welch
2010-06-02 16:28 ` Scott Wood
2010-06-03 9:12 ` Martyn Welch
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=20100528151836.5889.10393.stgit@ES-J7S4D2J.amer.consind.ge.com \
--to=martyn.welch@ge.com \
--cc=benh@kernel.crashing.org \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scottwood@freescale.com \
/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).