* Re: [PATCH] PPC: trivial fix of missed increment on counter
From: Olof Johansson @ 2007-11-22 15:20 UTC (permalink / raw)
To: Cyrill Gorcunov; +Cc: linuxppc-dev, Paul Mackerras, LKML
In-Reply-To: <aa79d98a0711210258t3e6f5532oe710c04b93b06c8@mail.gmail.com>
On Wed, Nov 21, 2007 at 01:58:06PM +0300, Cyrill Gorcunov wrote:
> On 11/21/07, Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> > This patch does fix missed increment on counter
> >
> > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> > ---
> > Sorry for that nonstandart patch submission - I've only access
> > to gmail with Internet Explorer on my work. If that is not OK - will resend
> > the patch today evening with mutt.
> >
> >
> Oops - it seems the patch is corrupted a bit. Drop it please - will
> resend today evening. Sorry.
Thanks for the fix, but please cc the maintainer (me) next time, as well
as the arch list (linuxppc-dev@ozlabs.org)?
That loop could actually even easier be converted to a
for_each_compatible_node() iteration. There's never more than one
interface on the current boards but it's still nicer coding.
Thanks,
-Olof
^ permalink raw reply
* Re: Xilinx Linux git server available
From: Peter Korsgaard @ 2007-11-22 15:30 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, Wolfgang Reissnegger
In-Reply-To: <fa686aa40711220635g1aa7dcc9w823de6a8c2d5832a@mail.gmail.com>
>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
Hi,
>> Why another uartlite driver? What's wrong with mine in mainline?
Grant> Relax; he's talking about your driver.
Ok, I had a quick look at the tree and saw a uartlite-alternative.c -
What's that about?
--
Bye, Peter Korsgaard
^ permalink raw reply
* Re: [PATCH] PPC: trivial fix of missed increment on counter
From: Cyrill Gorcunov @ 2007-11-22 15:38 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev, Paul Mackerras, LKML
In-Reply-To: <20071122152029.GA7678@lixom.net>
[Olof Johansson - Thu, Nov 22, 2007 at 09:20:29AM -0600]
| On Wed, Nov 21, 2007 at 01:58:06PM +0300, Cyrill Gorcunov wrote:
| > On 11/21/07, Cyrill Gorcunov <gorcunov@gmail.com> wrote:
| > > This patch does fix missed increment on counter
| > >
| > > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| > > ---
| > > Sorry for that nonstandart patch submission - I've only access
| > > to gmail with Internet Explorer on my work. If that is not OK - will resend
| > > the patch today evening with mutt.
| > >
| > >
| > Oops - it seems the patch is corrupted a bit. Drop it please - will
| > resend today evening. Sorry.
|
| Thanks for the fix, but please cc the maintainer (me) next time, as well
| as the arch list (linuxppc-dev@ozlabs.org)?
|
| That loop could actually even easier be converted to a
| for_each_compatible_node() iteration. There's never more than one
| interface on the current boards but it's still nicer coding.
|
| Thanks,
|
| -Olof
|
Sorry Olof for missing you. Will cc you and a list next time.
I'm trying to convert all for(;;) cycles to for_each_.. macro
now (actually during the convertation I found a few potential NULL
pointer dereferences so they are going first to list as I've done on them).
So as only I have it done I'll send it to a list (and you too ;) Thanks.
Cyrill
^ permalink raw reply
* Re: Xilinx Linux git server available
From: Grant Likely @ 2007-11-22 15:39 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: linuxppc-dev, Wolfgang Reissnegger
In-Reply-To: <871waifgbf.fsf@macbook.be.48ers.dk>
On 11/22/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> >>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
>
> Hi,
>
> >> Why another uartlite driver? What's wrong with mine in mainline?
>
> Grant> Relax; he's talking about your driver.
>
> Ok, I had a quick look at the tree and saw a uartlite-alternative.c -
> What's that about?
What directory is that in? I had looked in drivers/serial and only
saw uartlite.c:
http://git.xilinx.com/cgi-bin/gitweb.cgi?p=linux-2.6-xlnx.git;a=tree;f=drivers/serial;h=c8732c1f044a73cf58fa457ee106d4b042da8308;hb=4f231e89006726aea321c7d710045d37e904914e
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* [PATCH 00/10] powerpc: Add kexec/kdump support for ppc32
From: Dale Farnsworth @ 2007-11-22 15:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <foo@xyzzy.farnsworth.org>
This patch series adds kexec and kdump support for ppc32 in arch/powerpc.
It has been successfully tested on the mpc8548_cds and prpmc2800 platforms.
Mark Greer and I are preparing patches to the kexec-tools package as
well.
These patches apply to current powerpc.git.
Dale Farnsworth
^ permalink raw reply
* [PATCH 01/10] powerpc: Set up OF properties for ppc32 kexec
From: Dale Farnsworth @ 2007-11-22 15:45 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
Refactor the setting of kexec OF properties, moving the common code
from machine_kexec_64.c to machine_kexec.c where it can be used on
both ppc64 and ppc32. This is needed for kexec to work on ppc32
platforms.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/kernel/machine_kexec.c | 63 ++++++++++++++++++++++++++++++
arch/powerpc/kernel/machine_kexec_64.c | 67 +++----------------------------
2 files changed, 70 insertions(+), 60 deletions(-)
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index c0c8e8c..691dba7 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -12,8 +12,11 @@
#include <linux/kexec.h>
#include <linux/reboot.h>
#include <linux/threads.h>
+#include <linux/of.h>
#include <asm/machdep.h>
#include <asm/lmb.h>
+#include <asm/sections.h> /* _end */
+#include <asm/prom.h>
void machine_crash_shutdown(struct pt_regs *regs)
{
@@ -115,3 +118,63 @@ int overlaps_crashkernel(unsigned long start, unsigned long size)
{
return (start + size) > crashk_res.start && start <= crashk_res.end;
}
+
+/* Values we need to export to the second kernel via the device tree. */
+static unsigned long kernel_end;
+
+static struct property kernel_end_prop = {
+ .name = "linux,kernel-end",
+ .length = sizeof(unsigned long),
+ .value = &kernel_end,
+};
+
+static struct property crashk_base_prop = {
+ .name = "linux,crashkernel-base",
+ .length = sizeof(unsigned long),
+ .value = &crashk_res.start, };
+
+static unsigned long crashk_size;
+
+static struct property crashk_size_prop = {
+ .name = "linux,crashkernel-size",
+ .length = sizeof(unsigned long),
+ .value = &crashk_size,
+};
+
+static void __init export_crashk_values(void)
+{
+ struct device_node *node;
+ struct property *prop;
+
+ node = of_find_node_by_path("/chosen");
+ if (!node)
+ return;
+
+ kernel_end = __pa(_end);
+ prom_add_property(node, &kernel_end_prop);
+
+ /* There might be existing crash kernel properties, but we can't
+ * be sure what's in them, so remove them. */
+ prop = of_find_property(node, "linux,crashkernel-base", NULL);
+ if (prop)
+ prom_remove_property(node, prop);
+
+ prop = of_find_property(node, "linux,crashkernel-size", NULL);
+ if (prop)
+ prom_remove_property(node, prop);
+
+ if (crashk_res.start != 0) {
+ prom_add_property(node, &crashk_base_prop);
+ crashk_size = crashk_res.end - crashk_res.start + 1;
+ prom_add_property(node, &crashk_size_prop);
+ }
+
+ of_node_put(node);
+}
+
+static int __init kexec_setup(void)
+{
+ export_crashk_values();
+ return 0;
+}
+__initcall(kexec_setup);
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 704375b..a4bddb7 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -289,7 +289,7 @@ void default_machine_kexec(struct kimage *image)
}
/* Values we need to export to the second kernel via the device tree. */
-static unsigned long htab_base, kernel_end;
+static unsigned long htab_base;
static struct property htab_base_prop = {
.name = "linux,htab-base",
@@ -303,81 +303,28 @@ static struct property htab_size_prop = {
.value = &htab_size_bytes,
};
-static struct property kernel_end_prop = {
- .name = "linux,kernel-end",
- .length = sizeof(unsigned long),
- .value = &kernel_end,
-};
-
static void __init export_htab_values(void)
{
struct device_node *node;
- node = of_find_node_by_path("/chosen");
- if (!node)
- return;
-
- kernel_end = __pa(_end);
- prom_add_property(node, &kernel_end_prop);
-
/* On machines with no htab htab_address is NULL */
if (NULL == htab_address)
- goto out;
-
- htab_base = __pa(htab_address);
- prom_add_property(node, &htab_base_prop);
- prom_add_property(node, &htab_size_prop);
-
- out:
- of_node_put(node);
-}
-
-static struct property crashk_base_prop = {
- .name = "linux,crashkernel-base",
- .length = sizeof(unsigned long),
- .value = &crashk_res.start,
-};
-
-static unsigned long crashk_size;
-
-static struct property crashk_size_prop = {
- .name = "linux,crashkernel-size",
- .length = sizeof(unsigned long),
- .value = &crashk_size,
-};
-
-static void __init export_crashk_values(void)
-{
- struct device_node *node;
- struct property *prop;
+ return;
node = of_find_node_by_path("/chosen");
if (!node)
return;
- /* There might be existing crash kernel properties, but we can't
- * be sure what's in them, so remove them. */
- prop = of_find_property(node, "linux,crashkernel-base", NULL);
- if (prop)
- prom_remove_property(node, prop);
-
- prop = of_find_property(node, "linux,crashkernel-size", NULL);
- if (prop)
- prom_remove_property(node, prop);
-
- if (crashk_res.start != 0) {
- prom_add_property(node, &crashk_base_prop);
- crashk_size = crashk_res.end - crashk_res.start + 1;
- prom_add_property(node, &crashk_size_prop);
- }
+ htab_base = __pa(htab_address);
+ prom_add_property(node, &htab_base_prop);
+ prom_add_property(node, &htab_size_prop);
of_node_put(node);
}
-static int __init kexec_setup(void)
+static int __init kexec_setup_64(void)
{
export_htab_values();
- export_crashk_values();
return 0;
}
-__initcall(kexec_setup);
+__initcall(kexec_setup_64);
--
1.5.3.4
^ permalink raw reply related
* [PATCH 02/10] powerpc: Cleanup CONFIG_KEXEC dependency
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
KEXEC's dependency on PPC_PRPMC2800 is redundant, since PPC_MULTIPLATFORM
is now set for the prpmc2800 platform. Remove the dependency.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 18f397c..191cc2c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -236,7 +236,7 @@ config ARCH_ENABLE_MEMORY_HOTPLUG
config KEXEC
bool "kexec system call (EXPERIMENTAL)"
- depends on (PPC_PRPMC2800 || PPC_MULTIPLATFORM) && EXPERIMENTAL
+ depends on PPC_MULTIPLATFORM && EXPERIMENTAL
help
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
--
1.5.3.4
^ permalink raw reply related
* Re: Xilinx Linux git server available
From: Peter Korsgaard @ 2007-11-22 15:45 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, Wolfgang Reissnegger
In-Reply-To: <fa686aa40711220739i3e950a59w5becd19125c23ff1@mail.gmail.com>
>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
Hi,
>> Ok, I had a quick look at the tree and saw a uartlite-alternative.c -
>> What's that about?
Grant> What directory is that in? I had looked in drivers/serial and only
Grant> saw uartlite.c:
It's gone now (I accidently ended up browsing an earlier version
before):
http://git.xilinx.com/cgi-bin/gitweb.cgi?p=linux-2.6-xlnx.git;a=commit;h=9912d5bf98f969324e1d4f12210adccd1530de68
--
Bye, Peter Korsgaard
^ permalink raw reply
* [PATCH 03/10] powerpc: Add kexec support for PPC_85xx platforms
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
Book E processors need some extra setup in relocate_new_kernel,
because the MMU can't be turned off. Add the code to create
the required one-to-one memory map.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc/kernel/misc_32.S | 69 +++++++++++++++++++++++++++++
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 6 +++
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 6 +++
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 6 +++
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 6 +++
6 files changed, 94 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 191cc2c..9e9581a 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -236,7 +236,7 @@ config ARCH_ENABLE_MEMORY_HOTPLUG
config KEXEC
bool "kexec system call (EXPERIMENTAL)"
- depends on PPC_MULTIPLATFORM && EXPERIMENTAL
+ depends on (PPC_MULTIPLATFORM || PPC_85xx) && EXPERIMENTAL
help
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 8b642ab..db0e749 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -816,6 +816,75 @@ relocate_new_kernel:
/* r4 = reboot_code_buffer */
/* r5 = start_address */
+#ifdef CONFIG_E500
+ /*
+ * Since we can't turn off the MMU, we must create an identity
+ * map for kernel low memory. We start by invalidating the
+ * TLB entries we don't need.
+ *
+ * First, invalidate the TLB0 entries
+ */
+ li r6, 0x04
+ tlbivax 0, r6
+#ifdef CONFIG_SMP
+ tlbsync
+#endif
+ msync
+
+ /*
+ * Kernel low memory is mapped by TLB1 entries 0, 1, and 2.
+ * Preserve these, but invalidate all other TLB1 entries.
+ */
+ li r7, 3 /* first TLB1 entry */
+ mfspr r6, SPRN_TLB1CFG
+ andi. r6, r6, 0xfff
+ mr r8, r6
+ subf r6, r7, r6
+ mtctr r6
+1:
+ rlwinm r6, r7, 16, 12, 15
+ oris r6, r6, 0x1000
+ mtspr SPRN_MAS0, r6
+ tlbre
+ mfspr r6, SPRN_MAS1
+ rlwinm r6, r6, 0, 2, 31 /* Clear MAS1 Valid and IPROT */
+ mtspr SPRN_MAS1, r6
+ tlbwe
+ isync
+ addi r7, r7, 1
+ bdnz 1b
+
+ /*
+ * Using TLB1 entries 3, 4, and 5, identity-map kernel low
+ * memory by copying and modifying the contents of TLB1
+ * entries 0, 1 and 2, respectively.
+ */
+ li r7, 0 /* source TLB entry */
+ li r8, 3 /* destination TLB entry */
+ li r6, 3 /* number of TLBs to copy */
+ mtctr r6
+1:
+ rlwinm r6, r7, 16, 12, 15
+ oris r6, r6, 0x1000
+ mtspr SPRN_MAS0, r6
+ tlbre
+
+ mfspr r6, SPRN_MAS2
+ lis r0, PAGE_OFFSET@h
+ subf r6, r0, r6 /* identity map */
+ mtspr SPRN_MAS2, r6
+
+ rlwinm r6, r8, 16, 12, 15
+ oris r6, r6, 0x1000
+ mtspr SPRN_MAS0, r6
+ tlbwe
+ sync
+ isync
+ addi r7, r7, 1
+ addi r8, r8, 1
+ bdnz 1b
+#endif /* CONFIG_E500 */
+
li r0, 0
/*
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index bccdc25..1ade3dd 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -18,6 +18,7 @@
#include <linux/delay.h>
#include <linux/seq_file.h>
#include <linux/of_platform.h>
+#include <linux/kexec.h>
#include <asm/system.h>
#include <asm/time.h>
@@ -259,6 +260,11 @@ define_machine(mpc85xx_ads) {
.show_cpuinfo = mpc85xx_ads_show_cpuinfo,
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
+#ifdef CONFIG_KEXEC
+ .machine_kexec_prepare = default_machine_kexec_prepare,
+ .machine_kexec = default_machine_kexec,
+ .machine_crash_shutdown = default_machine_crash_shutdown,
+#endif
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 4d063ee..b8a5ed2 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -26,6 +26,7 @@
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/fsl_devices.h>
+#include <linux/kexec.h>
#include <asm/system.h>
#include <asm/pgtable.h>
@@ -352,6 +353,11 @@ define_machine(mpc85xx_cds) {
#else
.restart = fsl_rstcr_restart,
#endif
+#ifdef CONFIG_KEXEC
+ .machine_kexec_prepare = default_machine_kexec_prepare,
+ .machine_kexec = default_machine_kexec,
+ .machine_crash_shutdown = default_machine_crash_shutdown,
+#endif
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 59c121a..4c106b6 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -19,6 +19,7 @@
#include <linux/delay.h>
#include <linux/seq_file.h>
#include <linux/interrupt.h>
+#include <linux/kexec.h>
#include <asm/system.h>
#include <asm/time.h>
@@ -224,6 +225,11 @@ define_machine(mpc8572_ds) {
#endif
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
+#ifdef CONFIG_KEXEC
+ .machine_kexec_prepare = default_machine_kexec_prepare,
+ .machine_kexec = default_machine_kexec,
+ .machine_crash_shutdown = default_machine_crash_shutdown,
+#endif
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 61b3eed..49f55c1 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -30,6 +30,7 @@
#include <linux/initrd.h>
#include <linux/module.h>
#include <linux/fsl_devices.h>
+#include <linux/kexec.h>
#include <asm/of_device.h>
#include <asm/of_platform.h>
@@ -202,6 +203,11 @@ define_machine(mpc85xx_mds) {
.init_IRQ = mpc85xx_mds_pic_init,
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
+#ifdef CONFIG_KEXEC
+ .machine_kexec_prepare = default_machine_kexec_prepare,
+ .machine_kexec = default_machine_kexec,
+ .machine_crash_shutdown = default_machine_crash_shutdown,
+#endif
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
#ifdef CONFIG_PCI
--
1.5.3.4
^ permalink raw reply related
* [PATCH 04/10] powerpc: Add crash kernel support for classic ppc
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
Add the ability for a classic ppc kernel to be loaded at
an address of 32MB. This done by fixing a few places that
assume we are loaded at address 0, and by changing several
uses of KERNELBASE to use PAGE_OFFSET, instead. We also
wire up the trampoline code for ppc32 to relay exceptions
from the vectors at address 0 to vectors at address 32MB.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc/kernel/crash_dump.c | 1 +
arch/powerpc/kernel/head_32.S | 11 ++++++-----
arch/powerpc/kernel/setup_32.c | 2 ++
arch/powerpc/kernel/vmlinux.lds.S | 4 +---
arch/powerpc/mm/init_32.c | 2 +-
arch/powerpc/mm/pgtable_32.c | 4 ++--
arch/powerpc/mm/ppc_mmu_32.c | 8 ++++----
include/asm-powerpc/ppc_asm.h | 4 ++--
9 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9e9581a..805b4d1 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -253,7 +253,7 @@ config KEXEC
config CRASH_DUMP
bool "Build a kdump crash kernel (EXPERIMENTAL)"
- depends on PPC_MULTIPLATFORM && PPC64 && EXPERIMENTAL
+ depends on PPC_MULTIPLATFORM && EXPERIMENTAL
help
Build a kernel suitable for use as a kdump capture kernel.
The kernel will be linked at a different address than normal, and
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 29ff77c..77c0376 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -40,6 +40,7 @@ static void __init create_trampoline(unsigned long addr)
* branch to "addr" we jump to ("addr" + 32 MB). Although it requires
* two instructions it doesn't require any registers.
*/
+ addr += PAGE_OFFSET;
create_instruction(addr, 0x60000000); /* nop */
create_branch(addr + 4, addr + PHYSICAL_START, 0);
}
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index a5b13ae..a9b50ab 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -175,7 +175,8 @@ __after_mmu_off:
bl reloc_offset
mr r26,r3
addis r4,r3,KERNELBASE@h /* current address of _start */
- cmpwi 0,r4,0 /* are we already running at 0? */
+ lis r5,PHYSICAL_START@h
+ cmplw 0,r4,r5 /* already running at PHYSICAL_START? */
bne relocate_kernel
/*
* we now have the 1st 16M of ram mapped with the bats.
@@ -818,13 +819,13 @@ giveup_altivec:
/*
* This code is jumped to from the startup code to copy
- * the kernel image to physical address 0.
+ * the kernel image to physical address PHYSICAL_START.
*/
relocate_kernel:
addis r9,r26,klimit@ha /* fetch klimit */
lwz r25,klimit@l(r9)
addis r25,r25,-KERNELBASE@h
- li r3,0 /* Destination base address */
+ lis r3,PHYSICAL_START@h /* Destination base address */
li r6,0 /* Destination offset */
li r5,0x4000 /* # bytes of memory to copy */
bl copy_and_flush /* copy the first 0x4000 bytes */
@@ -1186,11 +1187,11 @@ mmu_off:
/*
* Use the first pair of BAT registers to map the 1st 16MB
- * of RAM to KERNELBASE. From this point on we can't safely
+ * of RAM to PAGE_OFFSET. From this point on we can't safely
* call OF any more.
*/
initial_bats:
- lis r11,KERNELBASE@h
+ lis r11,PAGE_OFFSET@h
mfspr r9,SPRN_PVR
rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
cmpwi 0,r9,1
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index cd870a8..bbb4caf 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -128,6 +128,8 @@ void __init machine_init(unsigned long dt_ptr, unsigned long phys)
probe_machine();
+ setup_kdump_trampoline();
+
#ifdef CONFIG_6xx
if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
cpu_has_feature(CPU_FTR_CAN_NAP))
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index f66fa5d..242f17d 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -1,11 +1,9 @@
#ifdef CONFIG_PPC64
-#include <asm/page.h>
#define PROVIDE32(x) PROVIDE(__unused__##x)
#else
-#define PAGE_SIZE 4096
-#define KERNELBASE CONFIG_KERNEL_START
#define PROVIDE32(x) PROVIDE(x)
#endif
+#include <asm/page.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/cache.h>
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 977cb1e..a25d3d7 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -48,7 +48,7 @@
#if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL)
/* The ammount of lowmem must be within 0xF0000000 - KERNELBASE. */
-#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - KERNELBASE))
+#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - PAGE_OFFSET))
#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_START_KERNEL"
#endif
#endif
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 6448872..e7505ea 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -275,7 +275,7 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
}
/*
- * Map in all of physical memory starting at KERNELBASE.
+ * Map in all of physical memory starting at PAGE_OFFSET.
*/
void __init mapin_ram(void)
{
@@ -283,7 +283,7 @@ void __init mapin_ram(void)
int ktext;
s = mmu_mapin_ram();
- v = KERNELBASE + s;
+ v = PAGE_OFFSET + s;
p = PPC_MEMSTART + s;
for (; s < total_lowmem; s += PAGE_SIZE) {
ktext = ((char *) v >= _stext && (char *) v < etext);
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index 5c45d47..6316895 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -105,16 +105,16 @@ unsigned long __init mmu_mapin_ram(void)
break;
}
- setbat(2, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
- done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
+ setbat(2, PAGE_OFFSET, PPC_MEMSTART, bl, _PAGE_RAM);
+ done = (unsigned long)bat_addrs[2].limit - PAGE_OFFSET + 1;
if ((done < tot) && !bat_addrs[3].limit) {
/* use BAT3 to cover a bit more */
tot -= done;
for (bl = 128<<10; bl < max_size; bl <<= 1)
if (bl * 2 > tot)
break;
- setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
- done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
+ setbat(3, PAGE_OFFSET+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
+ done = (unsigned long)bat_addrs[3].limit - PAGE_OFFSET + 1;
}
return done;
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index 2dbd4e7..f8943ec 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -382,14 +382,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
#define fromreal(rd) tovirt(rd,rd)
#define tophys(rd,rs) \
-0: addis rd,rs,-KERNELBASE@h; \
+0: addis rd,rs,-PAGE_OFFSET@h; \
.section ".vtop_fixup","aw"; \
.align 1; \
.long 0b; \
.previous
#define tovirt(rd,rs) \
-0: addis rd,rs,KERNELBASE@h; \
+0: addis rd,rs,PAGE_OFFSET@h; \
.section ".ptov_fixup","aw"; \
.align 1; \
.long 0b; \
--
1.5.3.4
^ permalink raw reply related
* [PATCH 05/10] powerpc: Add crash kernel support for 85xx
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
Add the ability to build a ppc_85xx kernel to run at a physical
address of 32MB.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc/kernel/head_fsl_booke.S | 23 ++++++++++++++++++-----
arch/powerpc/mm/fsl_booke_mmu.c | 6 +++---
3 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 805b4d1..d405298 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -253,7 +253,7 @@ config KEXEC
config CRASH_DUMP
bool "Build a kdump crash kernel (EXPERIMENTAL)"
- depends on PPC_MULTIPLATFORM && EXPERIMENTAL
+ depends on (PPC_MULTIPLATFORM || PPC_85xx) && EXPERIMENTAL
help
Build a kernel suitable for use as a kdump capture kernel.
The kernel will be linked at a different address than normal, and
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 4b98227..1c9685f 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -41,6 +41,12 @@
#include <asm/asm-offsets.h>
#include "head_booke.h"
+#ifdef CONFIG_CRASH_DUMP
+#define INITIAL_BOOKE_PAGESZ (BOOKE_PAGESZ_64M)
+#else
+#define INITIAL_BOOKE_PAGESZ (BOOKE_PAGESZ_16M)
+#endif
+
/* As with the other PowerPC ports, it is expected that when code
* execution begins here, the following registers contain valid, yet
* optional, information:
@@ -75,6 +81,7 @@ _ENTRY(_start);
* boot loader and load a single entry in TLB1[0] to map the
* first 16M of kernel memory. Any boot info passed from the
* bootloader needs to live in this first 16M.
+ * Note that for crash (kdump) kernels, the first 64M is mapped.
*
* Requirement on bootloader:
* - The page we're executing in needs to reside in TLB1 and
@@ -167,7 +174,7 @@ skpinv: addi r6,r6,1 /* Increment */
mtspr SPRN_MAS0,r7
tlbre
- /* Just modify the entry ID and EPN for the temp mapping */
+ /* Just modify the entry ID, EPN and RPN for the temp mapping */
lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */
rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */
mtspr SPRN_MAS0,r7
@@ -177,9 +184,12 @@ skpinv: addi r6,r6,1 /* Increment */
ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l
mtspr SPRN_MAS1,r6
mfspr r6,SPRN_MAS2
- li r7,0 /* temp EPN = 0 */
+ lis r7,PHYSICAL_START@h
rlwimi r7,r6,0,20,31
mtspr SPRN_MAS2,r7
+ mfspr r6,SPRN_MAS3
+ rlwimi r7,r6,0,20,31
+ mtspr SPRN_MAS3,r7
tlbwe
xori r6,r4,1
@@ -222,11 +232,11 @@ skpinv: addi r6,r6,1 /* Increment */
lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */
mtspr SPRN_MAS0,r6
lis r6,(MAS1_VALID|MAS1_IPROT)@h
- ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_16M))@l
+ ori r6,r6,(MAS1_TSIZE(INITIAL_BOOKE_PAGESZ))@l
mtspr SPRN_MAS1,r6
li r7,0
- lis r6,KERNELBASE@h
- ori r6,r6,KERNELBASE@l
+ lis r6,PAGE_OFFSET@h
+ ori r6,r6,PAGE_OFFSET@l
rlwimi r6,r7,0,20,31
mtspr SPRN_MAS2,r6
li r7,(MAS3_SX|MAS3_SW|MAS3_SR)
@@ -234,6 +244,9 @@ skpinv: addi r6,r6,1 /* Increment */
tlbwe
/* 7. Jump to KERNELBASE mapping */
+ lis r6,KERNELBASE@h
+ ori r6,r6,KERNELBASE@l
+ rlwimi r6,r7,0,20,31
lis r7,MSR_KERNEL@h
ori r7,r7,MSR_KERNEL@l
bl 1f /* Find our address */
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index 17139da..c93a966 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -165,15 +165,15 @@ void invalidate_tlbcam_entry(int index)
void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1,
unsigned long cam2)
{
- settlbcam(0, KERNELBASE, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
+ settlbcam(0, PAGE_OFFSET, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
tlbcam_index++;
if (cam1) {
tlbcam_index++;
- settlbcam(1, KERNELBASE+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
+ settlbcam(1, PAGE_OFFSET+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
}
if (cam2) {
tlbcam_index++;
- settlbcam(2, KERNELBASE+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
+ settlbcam(2, PAGE_OFFSET+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
}
}
--
1.5.3.4
^ permalink raw reply related
* [PATCH 06/10] powerpc: Fix bogus crash kernel messages
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
Commit edd8ce67, Use extended crashkernel command line on ppc64,
resulted in reserve_crashkernel() attempting to reserve a 1 byte
crashkernel area when no no crashkernel reservation is requested.
This results in the following bogus messages:
Crash kernel location must be 0x2000000
Reserving 0MB of memory at 32MB for crashkernel
The problem is that when crashk_res.start and crashk_res.end are
both 0, the crash_size is computed to be 1 byte.
Revert back to using the value of crashk_res.start to determine
if crashkernel memory is being reserved, rather than the computed
crash_size.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/kernel/machine_kexec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index 691dba7..38c1c1a 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -84,7 +84,7 @@ void __init reserve_crashkernel(void)
crash_size = crashk_res.end - crashk_res.start + 1;
}
- if (crash_size == 0)
+ if (crashk_res.start == 0)
return;
/* We might have got these values via the command line or the
--
1.5.3.4
^ permalink raw reply related
* [PATCH 07/10] powerpc: Implement kmap_atomic_pfn on powerpc
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
This is needed for the ppc32 /dev/oldmem driver of crash dump.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
include/asm-powerpc/highmem.h | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/asm-powerpc/highmem.h b/include/asm-powerpc/highmem.h
index f7b21ee..88d9e05 100644
--- a/include/asm-powerpc/highmem.h
+++ b/include/asm-powerpc/highmem.h
@@ -117,6 +117,24 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
pagefault_enable();
}
+/* This is the same as kmap_atomic() but can map memory that doesn't
+ * have a struct page associated with it.
+ */
+static inline void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
+{
+ unsigned int idx;
+ unsigned long vaddr;
+
+ pagefault_disable();
+
+ idx = type + KM_TYPE_NR * smp_processor_id();
+ vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE;
+ set_pte_at(&init_mm, vaddr, kmap_pte+idx, pfn_pte(pfn, kmap_prot));
+ flush_tlb_page(NULL, vaddr);
+
+ return (void*) vaddr;
+}
+
static inline struct page *kmap_atomic_to_page(void *ptr)
{
unsigned long idx, vaddr = (unsigned long) ptr;
--
1.5.3.4
^ permalink raw reply related
* [PATCH 08/10] powerpc: Implement crash dump support on ppc32
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
Implement /dev/oldmem and /proc/vmcore support for ppc32.
It is used to provide crash dumps of the previously running kernel.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/kernel/crash_dump.c | 67 ++++++++++++++++++++++++++++++++++++++
include/asm-powerpc/kexec.h | 62 +++++++++++++++++++++++++++++++++--
2 files changed, 126 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 77c0376..39a3d92 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -13,6 +13,7 @@
#include <linux/crash_dump.h>
#include <linux/bootmem.h>
+#include <linux/highmem.h>
#include <asm/kdump.h>
#include <asm/lmb.h>
#include <asm/firmware.h>
@@ -83,6 +84,7 @@ static int __init parse_savemaxmem(char *p)
}
__setup("savemaxmem=", parse_savemaxmem);
+#ifdef CONFIG_PPC64
/**
* copy_oldmem_page - copy one page from "oldmem"
* @pfn: page frame number to be copied
@@ -117,3 +119,68 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
iounmap(vaddr);
return csize;
}
+
+#else /* CONFIG_PPC64 */
+
+static void *kdump_buf_page;
+
+/**
+ * copy_oldmem_page - copy one page from "oldmem"
+ * @pfn: page frame number to be copied
+ * @buf: target memory address for the copy; this can be in kernel address
+ * space or user address space (see @userbuf)
+ * @csize: number of bytes to copy
+ * @offset: offset in bytes into the page (based on pfn) to begin the copy
+ * @userbuf: if set, @buf is in user address space, use copy_to_user(),
+ * otherwise @buf is in kernel address space, use memcpy().
+ *
+ * Copy a page from "oldmem". For this page, there is no pte mapped
+ * in the current kernel.
+ *
+ * Calling copy_to_user() in atomic context is not desirable. Hence first
+ * copying the data to a pre-allocated kernel page and then copying to user
+ * space in non-atomic context.
+ */
+ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
+ size_t csize, unsigned long offset, int userbuf)
+{
+ void *vaddr;
+
+ if (!csize)
+ return 0;
+
+ vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
+
+ if (!userbuf) {
+ memcpy(buf, (vaddr + offset), csize);
+ kunmap_atomic(vaddr, KM_PTE0);
+ } else {
+ if (!kdump_buf_page) {
+ printk(KERN_WARNING "Kdump: Kdump buffer page not"
+ " allocated\n");
+ return -EFAULT;
+ }
+ copy_page(kdump_buf_page, vaddr);
+ kunmap_atomic(vaddr, KM_PTE0);
+ if (copy_to_user(buf, (kdump_buf_page + offset), csize))
+ return -EFAULT;
+ }
+
+ return csize;
+}
+
+static int __init kdump_buf_page_init(void)
+{
+ int ret = 0;
+
+ kdump_buf_page = kmalloc(PAGE_SIZE, GFP_KERNEL);
+ if (!kdump_buf_page) {
+ printk(KERN_WARNING "Kdump: Failed to allocate kdump buffer"
+ " page\n");
+ ret = -ENOMEM;
+ }
+
+ return ret;
+}
+arch_initcall(kdump_buf_page_init);
+#endif /* CONFIG_PPC64 */
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index b6f817b..8c213c0 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -101,11 +101,67 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
}
#else
/*
- * Provide a dummy definition to avoid build failures. Will remain
- * empty till crash dump support is enabled.
+ * This function is responsible for capturing register states if coming
+ * via panic or invoking dump using sysrq-trigger.
*/
static inline void crash_setup_regs(struct pt_regs *newregs,
- struct pt_regs *oldregs) { }
+ struct pt_regs *oldregs)
+{
+ if (oldregs)
+ memcpy(newregs, oldregs, sizeof(*newregs));
+ else {
+ /* FIXME Merge this with xmon_save_regs ?? */
+ unsigned long tmp1, tmp2;
+ __asm__ __volatile__ (
+ "stw 0,0(%2)\n"
+ "stw 1,4(%2)\n"
+ "stw 2,8(%2)\n"
+ "stw 3,12(%2)\n"
+ "stw 4,16(%2)\n"
+ "stw 5,20(%2)\n"
+ "stw 6,24(%2)\n"
+ "stw 7,28(%2)\n"
+ "stw 8,32(%2)\n"
+ "stw 9,36(%2)\n"
+ "stw 10,40(%2)\n"
+ "stw 11,44(%2)\n"
+ "stw 12,48(%2)\n"
+ "stw 13,52(%2)\n"
+ "stw 14,56(%2)\n"
+ "stw 15,60(%2)\n"
+ "stw 16,64(%2)\n"
+ "stw 17,68(%2)\n"
+ "stw 18,72(%2)\n"
+ "stw 19,76(%2)\n"
+ "stw 20,80(%2)\n"
+ "stw 21,84(%2)\n"
+ "stw 22,88(%2)\n"
+ "stw 23,92(%2)\n"
+ "stw 24,96(%2)\n"
+ "stw 25,100(%2)\n"
+ "stw 26,104(%2)\n"
+ "stw 27,108(%2)\n"
+ "stw 28,112(%2)\n"
+ "stw 29,116(%2)\n"
+ "stw 30,120(%2)\n"
+ "stw 31,124(%2)\n"
+ "mfmsr %0\n"
+ "stw %0,132(%2)\n"
+ "mfctr %0\n"
+ "stw %0,140(%2)\n"
+ "mflr %0\n"
+ "stw %0,144(%2)\n"
+ "bl 1f\n"
+ "1: mflr %1\n"
+ "stw %1,128(%2)\n"
+ "mtlr %0\n"
+ "mfxer %0\n"
+ "stw %0,148(%2)\n"
+ : "=&r" (tmp1), "=&r" (tmp2)
+ : "b" (newregs)
+ : "memory");
+ }
+}
#endif /* !__powerpc64 __ */
extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
--
1.5.3.4
^ permalink raw reply related
* [PATCH 09/10] powepc: Remove unnecessary of_get_flat_dt_prop casts
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
of_get_flat_dt_prop returns a void*. There is no need to cast its
value when assigning to a pointer variable. This also avoids warnings
on ppc32 where unsigned long is 32 bits.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/kernel/prom.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index acc0d24..e2e7d9c 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -790,11 +790,11 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
#endif
#ifdef CONFIG_KEXEC
- lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
+ lprop = of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
if (lprop)
crashk_res.start = *lprop;
- lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL);
+ lprop = of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL);
if (lprop)
crashk_res.end = crashk_res.start + *lprop - 1;
#endif
--
1.5.3.4
^ permalink raw reply related
* [PATCH 10/10] powerpc: Make crashkernels ignore crashkernel reservations
From: Dale Farnsworth @ 2007-11-22 15:46 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071122154159.GA24711@xyzzy.farnsworth.org>
If a user requests a crash kernel to reserve crashkernel memory,
the kernel fails to boot. While the user shouldn't do that, it
is easy to check for and makes it possible to use the same command
line for crash kernels as for the initial kernel.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/kernel/machine_kexec.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index 38c1c1a..733726a 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -94,6 +94,14 @@ void __init reserve_crashkernel(void)
printk("Crash kernel location must be 0x%x\n",
KDUMP_KERNELBASE);
+ if (PHYSICAL_START == KDUMP_KERNELBASE) {
+ printk("Already running a crashkernel, "
+ "ignoring crashkernel reservation\n");
+ crashk_res.start = 0;
+ crashk_res.end = 0;
+ return;
+ }
+
crashk_res.start = KDUMP_KERNELBASE;
crash_size = PAGE_ALIGN(crash_size);
crashk_res.end = crashk_res.start + crash_size - 1;
--
1.5.3.4
^ permalink raw reply related
* [PATCH resend 3/4] powerpc: Add EXPORT_SYMBOL for symbols required by fs_enet and cpm_uart
From: Jochen Friedrich @ 2007-11-22 16:54 UTC (permalink / raw)
To: linuxppc-dev
fs_enet and cpm_uart need symbols from commproc.c (for CPM1) or
cpm2_common.c. Add EXPORT_SYMBOL for cpmp, cpm_setbrg and cpm2_immr, so
the drivers can be compiled as modules.
Building modules, stage 2.
MODPOST 5 modules
ERROR: "cpm2_immr" [drivers/net/fs_enet/fs_enet.ko] undefined!
ERROR: "cpmp" [drivers/net/fs_enet/fs_enet.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Scott Wood <scottwood@freescale.com>
---
arch/powerpc/sysdev/commproc.c | 3 +++
arch/powerpc/sysdev/cpm2_common.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index f6a6378..d5a0dcf 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -51,6 +51,8 @@ static void m8xx_cpm_dpinit(void);
static uint host_buffer; /* One page of host buffer */
static uint host_end; /* end + 1 */
cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */
+EXPORT_SYMBOL(cpmp);
+
immap_t __iomem *mpc8xx_immr;
static cpic8xx_t __iomem *cpic_reg;
@@ -302,6 +304,7 @@ cpm_setbrg(uint brg, uint rate)
out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
CPM_BRG_EN | CPM_BRG_DIV16);
}
+EXPORT_SYMBOL(cpm_setbrg);
#ifndef CONFIG_PPC_CPM_NEW_BINDING
/*
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index 859362f..4ed5df6 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -51,11 +51,13 @@ static void cpm2_dpinit(void);
#endif
cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
+EXPORT_SYMBOL(cpmp);
/* We allocate this here because it is used almost exclusively for
* the communication processor devices.
*/
cpm2_map_t __iomem *cpm2_immr;
+EXPORT_SYMBOL(cpm2_immr);
#define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount
of space for CPM as it is larger
@@ -117,6 +119,7 @@ cpm_setbrg(uint brg, uint rate)
cpm2_unmap(bp);
}
+EXPORT_SYMBOL(cpm_setbrg);
/* This function is used to set high speed synchronous baud rate
* clocks.
--
1.5.3.4
^ permalink raw reply related
* [PATCH resend 2/4] powerpc: kill non-existent symbols from ksyms and commproc.h
From: Jochen Friedrich @ 2007-11-22 16:53 UTC (permalink / raw)
To: linuxppc-dev
Remove exports of __res and cpm_install_handler/cpm_free_handler. Remove
cpm_install_handler/cpm_free_handler from the commproc.h as well. Both
were used for ARCH=ppc and aren't defined for ARCH=powerpc.
CC arch/powerpc/kernel/ppc_ksyms.o
arch/powerpc/kernel/ppc_ksyms.c:180: error: '__res' undeclared here (not in a function)
arch/powerpc/kernel/ppc_ksyms.c:180: warning: type defaults to 'int' in declaration of '__res'
make[1]: *** [arch/powerpc/kernel/ppc_ksyms.o] Error 1
make: *** [arch/powerpc/kernel] Error 2
LD .tmp_vmlinux1
arch/powerpc/kernel/built-in.o:(__ksymtab+0x198): undefined reference to `cpm_free_handler'
arch/powerpc/kernel/built-in.o:(__ksymtab+0x1a0): undefined reference to `cpm_install_handler'
make: *** [.tmp_vmlinux1] Error 1
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/powerpc/kernel/ppc_ksyms.c | 12 ------------
include/asm-powerpc/commproc.h | 3 ---
2 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index c6b1aa3..13ebeb2 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -45,10 +45,6 @@
#include <asm/signal.h>
#include <asm/dcr.h>
-#ifdef CONFIG_8xx
-#include <asm/commproc.h>
-#endif
-
#ifdef CONFIG_PPC64
EXPORT_SYMBOL(local_irq_restore);
#endif
@@ -172,14 +168,6 @@ EXPORT_SYMBOL(console_drivers);
EXPORT_SYMBOL(cacheable_memcpy);
#endif
-#ifdef CONFIG_8xx
-EXPORT_SYMBOL(cpm_install_handler);
-EXPORT_SYMBOL(cpm_free_handler);
-#endif /* CONFIG_8xx */
-#if defined(CONFIG_8xx)
-EXPORT_SYMBOL(__res);
-#endif
-
#ifdef CONFIG_PPC32
EXPORT_SYMBOL(next_mmu_context);
EXPORT_SYMBOL(set_context);
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index a2328b8..2ee59d7 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/commproc.h
@@ -698,9 +698,6 @@ typedef struct risc_timer_pram {
#define CICR_IEN ((uint)0x00000080) /* Int. enable */
#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
-extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id);
-extern void cpm_free_handler(int vec);
-
#define IMAP_ADDR (get_immrbase())
#define CPM_PIN_INPUT 0
--
1.5.3.4
^ permalink raw reply related
* [PATCH resend 1/4] powerpc: fix typo #ifdef -> #ifndef
From: Jochen Friedrich @ 2007-11-22 16:53 UTC (permalink / raw)
To: linuxppc-dev
fpi->cp_command should be overwritten only if CONFIG_PPC_CPM_NEW_BINDING
is NOT set. Otherwise it is already set from the device tree.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/fs_enet/mac-scc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index 03134f4..48f2f30 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -158,7 +158,7 @@ static int setup_data(struct net_device *dev)
{
struct fs_enet_private *fep = netdev_priv(dev);
-#ifdef CONFIG_PPC_CPM_NEW_BINDING
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
struct fs_platform_info *fpi = fep->fpi;
fep->scc.idx = fs_get_scc_index(fpi->fs_no);
--
1.5.3.4
^ permalink raw reply related
* [PATCH resend 4/4] powerpc: Add support for PORTA and PORTB odr registers
From: Jochen Friedrich @ 2007-11-22 16:54 UTC (permalink / raw)
To: linuxppc-dev
PORTA and PORTB have odr registers, as well. However, the PORTB odr
register is only 16bit.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Scott Wood <scottwood@freescale.com>
---
arch/powerpc/sysdev/commproc.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index d5a0dcf..c0d00c2 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -411,7 +411,7 @@ EXPORT_SYMBOL(cpm_dpram_phys);
#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
struct cpm_ioport16 {
- __be16 dir, par, sor, dat, intr;
+ __be16 dir, par, odr_sor, dat, intr;
__be16 res[3];
};
@@ -441,6 +441,13 @@ static void cpm1_set_pin32(int port, int pin, int flags)
else
clrbits32(&iop->par, pin);
+ if (port == CPM_PORTB) {
+ if (flags & CPM_PIN_OPENDRAIN)
+ setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
+ else
+ clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
+ }
+
if (port == CPM_PORTE) {
if (flags & CPM_PIN_SECONDARY)
setbits32(&iop->sor, pin);
@@ -474,11 +481,17 @@ static void cpm1_set_pin16(int port, int pin, int flags)
else
clrbits16(&iop->par, pin);
+ if (port == CPM_PORTA) {
+ if (flags & CPM_PIN_OPENDRAIN)
+ setbits16(&iop->odr_sor, pin);
+ else
+ clrbits16(&iop->odr_sor, pin);
+ }
if (port == CPM_PORTC) {
if (flags & CPM_PIN_SECONDARY)
- setbits16(&iop->sor, pin);
+ setbits16(&iop->odr_sor, pin);
else
- clrbits16(&iop->sor, pin);
+ clrbits16(&iop->odr_sor, pin);
}
}
--
1.5.3.4
^ permalink raw reply related
* [PATCH resend 0/4] powerpc fixes for 2.6.24
From: Jochen Friedrich @ 2007-11-22 16:53 UTC (permalink / raw)
To: linuxppc-dev
Hi,
this is a resend of 4 patches i've sent to linuxppc-embedded before. Later i found the MAINTAINERS entry has been updated.
The series can be pulled from git://git.bocc.de/dbox2.git for-2.6.24
Thanks,
Jochen
^ permalink raw reply
* Re: [PATCH resend 3/4] powerpc: Add EXPORT_SYMBOL for symbols required by fs_enet and cpm_uart
From: Grant Likely @ 2007-11-22 17:18 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: linuxppc-dev
In-Reply-To: <4745B42B.8050201@scram.de>
On 11/22/07, Jochen Friedrich <jochen@scram.de> wrote:
> fs_enet and cpm_uart need symbols from commproc.c (for CPM1) or
> cpm2_common.c. Add EXPORT_SYMBOL for cpmp, cpm_setbrg and cpm2_immr, so
> the drivers can be compiled as modules.
>
> Building modules, stage 2.
> MODPOST 5 modules
> ERROR: "cpm2_immr" [drivers/net/fs_enet/fs_enet.ko] undefined!
> ERROR: "cpmp" [drivers/net/fs_enet/fs_enet.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> Acked-by: Scott Wood <scottwood@freescale.com>
> ---
> arch/powerpc/sysdev/commproc.c | 3 +++
> arch/powerpc/sysdev/cpm2_common.c | 3 +++
> 2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
> index f6a6378..d5a0dcf 100644
> --- a/arch/powerpc/sysdev/commproc.c
> +++ b/arch/powerpc/sysdev/commproc.c
> @@ -51,6 +51,8 @@ static void m8xx_cpm_dpinit(void);
> static uint host_buffer; /* One page of host buffer */
> static uint host_end; /* end + 1 */
> cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */
> +EXPORT_SYMBOL(cpmp);
> +
Is this really a good idea? A globally accessable pointer to the region?
The driver should either have a copy of the pointer in its private
data or operations on the region should be performed by helpers (the
choice of course depends on how varied the operations on the region
are). I know 8xx is old and crusty, but it is possible for a board to
have multiple CPMs (ie. a second 8xx with the ppc core disabled).
> immap_t __iomem *mpc8xx_immr;
> static cpic8xx_t __iomem *cpic_reg;
>
> @@ -302,6 +304,7 @@ cpm_setbrg(uint brg, uint rate)
> out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
> CPM_BRG_EN | CPM_BRG_DIV16);
> }
> +EXPORT_SYMBOL(cpm_setbrg);
EXPORT_SYMBOL_GPL?
>
> #ifndef CONFIG_PPC_CPM_NEW_BINDING
> /*
> diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
> index 859362f..4ed5df6 100644
> --- a/arch/powerpc/sysdev/cpm2_common.c
> +++ b/arch/powerpc/sysdev/cpm2_common.c
> @@ -51,11 +51,13 @@ static void cpm2_dpinit(void);
> #endif
>
> cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
> +EXPORT_SYMBOL(cpmp);
ditto to first comment.
>
> /* We allocate this here because it is used almost exclusively for
> * the communication processor devices.
> */
> cpm2_map_t __iomem *cpm2_immr;
> +EXPORT_SYMBOL(cpm2_immr);
ditto
>
> #define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount
> of space for CPM as it is larger
> @@ -117,6 +119,7 @@ cpm_setbrg(uint brg, uint rate)
>
> cpm2_unmap(bp);
> }
> +EXPORT_SYMBOL(cpm_setbrg);
>
> /* This function is used to set high speed synchronous baud rate
> * clocks.
> --
> 1.5.3.4
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* [RFC/PATCH] powerpc: Move CPM command handling into the cpm drivers
From: Jochen Friedrich @ 2007-11-22 17:24 UTC (permalink / raw)
To: linuxppc-dev
This patch moves the CPM command handling into commproc.c
for CPM1 and cpm2_common.c. This is yet another preparation
to get rid of drivers accessing the CPM via the global cpmp.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
arch/powerpc/sysdev/commproc.c | 20 ++++++++++++++++++++
arch/powerpc/sysdev/cpm2_common.c | 17 +++++++++++++++++
drivers/net/fs_enet/mac-fcc.c | 10 +---------
drivers/net/fs_enet/mac-scc.c | 11 +----------
drivers/serial/cpm_uart/cpm_uart_cpm1.c | 6 +-----
drivers/serial/cpm_uart/cpm_uart_cpm2.c | 8 +-------
include/asm-powerpc/cpm.h | 1 +
7 files changed, 42 insertions(+), 31 deletions(-)
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index f6a6378..2bddbde 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -240,6 +240,26 @@ void __init cpm_reset(void)
#endif
}
+#define MAX_CR_CMD_LOOPS 10000
+
+int cpm_command(u32 command, u8 opcode)
+{
+ int i;
+
+ if (command & 0xffffff0f)
+ return -EINVAL;
+
+ out_be16(&cpmp->cp_cpcr, command | CPM_CR_FLG | (opcode << 8));
+ for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
+ if ((in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
+ return 0;
+
+ printk(KERN_ERR "%s(): Not able to issue CPM command\n",
+ __FUNCTION__);
+ return -EIO;
+}
+EXPORT_SYMBOL(cpm_command);
+
/* We used to do this earlier, but have to postpone as long as possible
* to ensure the kernel VM is now running.
*/
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index 859362f..9e36b6b 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -83,6 +83,23 @@ cpm2_reset(void)
cpmp = &cpm2_immr->im_cpm;
}
+#define MAX_CR_CMD_LOOPS 10000
+
+int cpm_command(u32 command, u8 opcode)
+{
+ int i;
+
+ out_be32(&cpmp->cp_cpcr, command | opcode | CPM_CR_FLG);
+ for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
+ if ((in_be32(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
+ return 0;
+
+ printk(KERN_ERR "%s(): Not able to issue CPM command\n",
+ __FUNCTION__);
+ return -EIO;
+}
+EXPORT_SYMBOL(cpm_command);
+
/* Set a baud rate generator. This needs lots of work. There are
* eight BRGs, which can be connected to the CPM channels or output
* as clocks. The BRGs are in two different block of internal
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index da4efbc..e363211 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -81,16 +81,8 @@
static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op)
{
const struct fs_platform_info *fpi = fep->fpi;
- int i;
-
- W32(cpmp, cp_cpcr, fpi->cp_command | op | CPM_CR_FLG);
- for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
- if ((R32(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
- return 0;
- printk(KERN_ERR "%s(): Not able to issue CPM command\n",
- __FUNCTION__);
- return 1;
+ return cpm_command(fpi->cp_command, op);
}
static int do_pd_setup(struct fs_enet_private *fep)
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index 03134f4..5ff856d 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -89,21 +89,12 @@
* Delay to wait for SCC reset command to complete (in us)
*/
#define SCC_RESET_DELAY 50
-#define MAX_CR_CMD_LOOPS 10000
static inline int scc_cr_cmd(struct fs_enet_private *fep, u32 op)
{
const struct fs_platform_info *fpi = fep->fpi;
- int i;
-
- W16(cpmp, cp_cpcr, fpi->cp_command | CPM_CR_FLG | (op << 8));
- for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
- if ((R16(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
- return 0;
- printk(KERN_ERR "%s(): Not able to issue CPM command\n",
- __FUNCTION__);
- return 1;
+ return cpm_command(fpi->cp_command, op);
}
static int do_pd_setup(struct fs_enet_private *fep)
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 52fb044..6ea0366 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -52,11 +52,7 @@
#ifdef CONFIG_PPC_CPM_NEW_BINDING
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
{
- u16 __iomem *cpcr = &cpmp->cp_cpcr;
-
- out_be16(cpcr, port->command | (cmd << 8) | CPM_CR_FLG);
- while (in_be16(cpcr) & CPM_CR_FLG)
- ;
+ cpm_command(port->command, cmd);
}
#else
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index 882dbc1..def0158 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -52,13 +52,7 @@
#ifdef CONFIG_PPC_CPM_NEW_BINDING
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
{
- cpm_cpm2_t __iomem *cp = cpm2_map(im_cpm);
-
- out_be32(&cp->cp_cpcr, port->command | cmd | CPM_CR_FLG);
- while (in_be32(&cp->cp_cpcr) & CPM_CR_FLG)
- ;
-
- cpm2_unmap(cp);
+ cpm_command(port->command, cmd);
}
#else
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h
index 48df9f3..fae83b1 100644
--- a/include/asm-powerpc/cpm.h
+++ b/include/asm-powerpc/cpm.h
@@ -10,5 +10,6 @@ int cpm_muram_free(unsigned long offset);
unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
void __iomem *cpm_muram_addr(unsigned long offset);
dma_addr_t cpm_muram_dma(void __iomem *addr);
+int cpm_command(u32 command, u8 opcode);
#endif
--
1.5.3.4
^ permalink raw reply related
* Re: [PATCH resend 3/4] powerpc: Add EXPORT_SYMBOL for symbols required by fs_enet and cpm_uart
From: Jochen Friedrich @ 2007-11-22 17:27 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40711220918l2c7c021euf9ed1e29798e8bc3@mail.gmail.com>
Hi Grant,
> Is this really a good idea? A globally accessable pointer to the region?
No it's not. But drivers are actually using the pointer and due to the
missing export, they currently don't compile as module.
>> +EXPORT_SYMBOL(cpm_setbrg);
>
> EXPORT_SYMBOL_GPL?
Agreed.
Thanks,
Jochen
^ permalink raw reply
* [PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart
From: Jochen Friedrich @ 2007-11-22 17:35 UTC (permalink / raw)
To: linuxppc-dev
fs_enet and cpm_uart need symbols from commproc.c (for CPM1) or
cpm2_common.c. Add EXPORT_SYMBOL_GPL for cpmp, cpm_setbrg and cpm2_immr,
so the drivers can be compiled as modules.
Building modules, stage 2.
MODPOST 5 modules
ERROR: "cpm2_immr" [drivers/net/fs_enet/fs_enet.ko] undefined!
ERROR: "cpmp" [drivers/net/fs_enet/fs_enet.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Scott Wood <scottwood@freescale.com>
---
arch/powerpc/sysdev/commproc.c | 3 +++
arch/powerpc/sysdev/cpm2_common.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index f6a6378..ddbe138 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -51,6 +51,8 @@ static void m8xx_cpm_dpinit(void);
static uint host_buffer; /* One page of host buffer */
static uint host_end; /* end + 1 */
cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */
+EXPORT_SYMBOL_GPL(cpmp);
+
immap_t __iomem *mpc8xx_immr;
static cpic8xx_t __iomem *cpic_reg;
@@ -302,6 +304,7 @@ cpm_setbrg(uint brg, uint rate)
out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
CPM_BRG_EN | CPM_BRG_DIV16);
}
+EXPORT_SYMBOL_GPL(cpm_setbrg);
#ifndef CONFIG_PPC_CPM_NEW_BINDING
/*
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index 859362f..b878a67 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -51,11 +51,13 @@ static void cpm2_dpinit(void);
#endif
cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
+EXPORT_SYMBOL_GPL(cpmp);
/* We allocate this here because it is used almost exclusively for
* the communication processor devices.
*/
cpm2_map_t __iomem *cpm2_immr;
+EXPORT_SYMBOL_GPL(cpm2_immr);
#define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount
of space for CPM as it is larger
@@ -117,6 +119,7 @@ cpm_setbrg(uint brg, uint rate)
cpm2_unmap(bp);
}
+EXPORT_SYMBOL_GPL(cpm_setbrg);
/* This function is used to set high speed synchronous baud rate
* clocks.
--
1.5.3.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox