LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* #PPC: timeout while waiting for freeze
From: Bheemappa @ 2007-11-22  6:11 UTC (permalink / raw)
  To: linuxppc-embedded



 

Hello
      I am using BDI2000 debugger to debug our custom board which has 
MPC7457 processor and Marvell's discovery-ii(MV64360) as host bridge. I 
have 
connectd target board to BDI using JTAG.I am getting the BDI prompt and 
also its reading PVR number correctly, but when I am  trying to access 
any memory location i.e 0xf1000000 using below command its giving below 
error.



BDI> md 0xf1000000
#PPC: timeout while waiting for freeze

  Why this error is coming ? , can you give us more detailed description
for this error message , so that we can trace the source of error mssage.
Below is my mail id plz send any suggestions.

 bheemappa@rasstechnologies.com

 Regards
 Bheema
 RASS Tech Pvt Ltd
 Bangalore

^ permalink raw reply

* Re: dtc: RFC: Fix some lexical problems with references
From: David Gibson @ 2007-11-22  6:23 UTC (permalink / raw)
  To: Jon Loeliger, linuxppc-dev
In-Reply-To: <20071122061007.GA22888@localhost.localdomain>

On Thu, Nov 22, 2007 at 05:10:07PM +1100, David Gibson wrote:
> The recent change to the lexer to only recognize property and node
> names in the appropriate context removed a number of lexical warts in
> our language that would have gotten ugly as we add expression support
> and so forth.
> 
> But there's one nasty one remaining: references can contain a full
> path, including the various problematic node name characters (',', '+'
> and '-', for example).  This would cause trouble with expressions, and
> it also causes trouble with the patch I'm working on to allow
> expanding references to paths rather than phandles.  This patch
> therefore reworks the lexer to mitigate these problems.
> 
> 	- References to labels cause no problems.  These are now
> recognized separately from references to full paths.  No syntax change
> here.
> 
> 	- References to full paths, including problematic characters
> are allowed by "quoting" the path with braces
> e.g. &{/pci@10000/somedevice@3,8000}.  The braces protect any internal
> problematic characters from being confused with operators or whatever.
> 
> 	- For compatibility with existing dts files, in v0 dts files
> we allow bare references to paths as before &/foo/bar/whatever - but
> *only* if the path contains no troublesome characters.  Specifically
> only [a-zA-Z0-9_@/] are allowed.
> 
> This is an incompatible change to the dts-v1 format, but since AFAIK
> no-one has yet switched to dts-v1 files, I think we can get away with
> it.  Better to make the transition when people to convert to v1, and
> get rid of the problematic old syntax.
> 
> Strictly speaking, it's also an incompatible change to the v0 format,
> since some path references that were allowed before are no longer
> allowed.  I suspect no-one has been using the no-longer-supported
> forms (certainly none of the kernel dts files will cause trouble).  We
> might need to think about this harder, though.

Just to note: we need to do something here, but there are approaches
other than the one above (hence the RFC).  For example, if we just
separate the lexical recognition of refs-to-labels from refs-to-paths
then we can continue to recognize full bare path references.  However,
in some circumstances it might be necessary to add whitespace in the
dts to correctly mark the end of the path (in the case '/' and ' '
would essentially take the place of the braces for delimiting the
path).  That maintains full compatibility, and avoids the arguably
ugly &{/foo} syntax, but it does mean there are some odd situations
like the fact that (once string references are implemented):
		&label1, &label2
	and	&label1 , &label2
would be equivalent, but the following two:
		&/node1, &/node2
		&/node1 , &/node2
would not be equivalent (depending on context one or both of them
could be syntax errors).  The first is a reference to the node
"/node1," then a reference to the node "/node2", the second is a
reference to the node "/node1" then a comma then a reference to the
node "/node2".

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Initramfs problem on virtex4fx
From: schardt @ 2007-11-22  8:18 UTC (permalink / raw)
  To: Linux PPC Linux PPC

Hi all,

i try to run linux from flash with the initramfs as root filesystem.
i wrote a simple hello_world as init to test the initramfs.

the kernel boots normaly, but instead of the complete "Hello World" i
see only "He"
and the system hangs.

Does anyone have similar problems ? And solved it ? ;)

Regards
Georg


-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Jülich GmbH
52425 Jülich

Sitz der Gesellschaft: Jülich
Eingetragen im Handelsregister des Amtsgerichts Düren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDirig'in Bärbel Brumme-Bothe
Geschäftsführung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------

^ permalink raw reply

* Re: Firmware Support for USB Hub
From: Misbah khan @ 2007-11-22  9:53 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <474468C5.8080402@freescale.com>


Thank you for your reply.

Even i think that there is only out-of-tree driver for CPM USB. i would like
to know that some body used this driver and what is the problem that could
come and how could we customize for our requirement for the PPC-8248. 

Could you tell me what is the reason for not using inbuilt USB controler for
8248 than going for External controller.

If any body has already done USB driver than could you please share your
experience.

----misbah <><





Scott Wood-2 wrote:
> 
> Misbah khan wrote:
>> Hi all,
>> 
>> I am using a 8248 processor which has a USB controller and i need to
>> connect
>> a USB Hub to it, iam using Montavista Linux .I need to know that what are
>> the support i need form Montavista or Open source to have an interface
>> with
>> Usb hub. ???
>> 
>> Is there any driver that we need to make if so what type ???
> 
> I don't believe a driver currently exists for CPM USB.
> 
> -Scott
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

-- 
View this message in context: http://www.nabble.com/Firmware-Support-for-USB-Hub-tf4850180.html#a13893889
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: Initramfs problem on virtex4fx
From: schardt @ 2007-11-22 10:01 UTC (permalink / raw)
  To: schardt; +Cc: Linux PPC Linux PPC
In-Reply-To: <47453B63.6010100@fz-juelich.de>

additional i tried a initramfs rootfs with busybox

Freeing unused kernel memory: 1944k init
init started: BusyBox v1.7.0 (2007-11-07 14:29:33 CET)
starting pid 152eth0: XTemac: Options: 0xb8f2
eth0: XTemac: We renegotiated the speed to: 1000
eth0: XTemac: speed set to 1000Mb/s
, tty '': '/etc/init.d/

this looks very strange to me....

Georg

schardt wrote:
> Hi all,
>
> i try to run linux from flash with the initramfs as root filesystem.
> i wrote a simple hello_world as init to test the initramfs.
>
> the kernel boots normaly, but instead of the complete "Hello World" i
> see only "He"
> and the system hangs.
>
> Does anyone have similar problems ? And solved it ? ;)
>
> Regards
> Georg
>
>
> -------------------------------------------------------------------
> -------------------------------------------------------------------
> Forschungszentrum J=FClich GmbH
> 52425 J=FClich
>
> Sitz der Gesellschaft: J=FClich
> Eingetragen im Handelsregister des Amtsgerichts D=FCren Nr. HR B 3498
> Vorsitzende des Aufsichtsrats: MinDirig'in B=E4rbel Brumme-Bothe
> Gesch=E4ftsf=FChrung: Prof. Dr. Achim Bachem (Vorsitzender),
> Dr. Ulrich Krafft (stellv. Vorsitzender), Dr. Sebastian M. Schmidt
> -------------------------------------------------------------------
> -------------------------------------------------------------------
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>  =20



-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum J=FClich GmbH
52425 J=FClich

Sitz der Gesellschaft: J=FClich
Eingetragen im Handelsregister des Amtsgerichts D=FCren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDirig'in B=E4rbel Brumme-Bothe
Gesch=E4ftsf=FChrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------

^ permalink raw reply

* [PATCH] IB/ehca: Fix static rate regression
From: Joachim Fenkes @ 2007-11-22 10:26 UTC (permalink / raw)
  To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
  Cc: Stefan Roscher, Christoph Raisch, Marcus Eder

Wrong choice of port number caused modify_qp() to fail -- fixed.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
Please apply this for 2.6.24-rc4 as it fixes a regression introduced in rc3.
Thanks!

 drivers/infiniband/hw/ehca/ehca_qp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index 2e3e654..dd12668 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -1203,7 +1203,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
 		mqpcb->service_level = attr->ah_attr.sl;
 		update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SERVICE_LEVEL, 1);
 
-		if (ehca_calc_ipd(shca, my_qp->init_attr.port_num,
+		if (ehca_calc_ipd(shca, mqpcb->prim_phys_port,
 				  attr->ah_attr.static_rate,
 				  &mqpcb->max_static_rate)) {
 			ret = -EINVAL;
@@ -1302,7 +1302,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
 		mqpcb->source_path_bits_al = attr->alt_ah_attr.src_path_bits;
 		mqpcb->service_level_al = attr->alt_ah_attr.sl;
 
-		if (ehca_calc_ipd(shca, my_qp->init_attr.port_num,
+		if (ehca_calc_ipd(shca, mqpcb->alt_phys_port,
 				  attr->alt_ah_attr.static_rate,
 				  &mqpcb->max_static_rate_al)) {
 			ret = -EINVAL;
-- 
1.5.2

^ permalink raw reply related

* Re: Firmware Support for USB Hub
From: Misbah khan @ 2007-11-22 10:27 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <200711211830.02997.laurentp@cse-semaphore.com>






Laurent Pinchart-4 wrote:
>=20
> On Wednesday 21 November 2007 18:20, Scott Wood wrote:
>> Misbah khan wrote:
>> > Hi all,
>> >
>> > I am using a 8248 processor which has a USB controller and i need to
>> > connect a USB Hub to it, iam using Montavista Linux .I need to know
>> that
>> > what are the support i need form Montavista or Open source to have an
>> > interface with Usb hub. ???
>> >
>> > Is there any driver that we need to make if so what type ???
>>
>> I don't believe a driver currently exists for CPM USB.
>=20
> There's an experimental out-of-tree driver available at=20
> http://cpm2usb.sourceforge.net/
>=20
> The code is outdated and doesn't work, but that's a starting point.
>=20
> can you suggest me the problems both in terms of H/W S/W and Montavista
> ????
>=20
> If I remember correctly, CPM2 USB host support requires the host to creat=
e
> SOF=20
> packets in software. High system loads will probably mess the bus up. A=
=20
> colleague of mines was told by Freescale to use an external USB controlle=
r=20
> instead of the MPC8248 bundled one.
>=20
> I have posted this quarry to freescale. Anyway if you get more informatio=
n
> could you please share with me ??
>=20
>=20
> ---Misbah <><
> --=20
> Laurent Pinchart
> CSE Semaphore Belgium
>=20
> Chauss=C3=A9e de Bruxelles, 732A
> B-1410 Waterloo
> Belgium
>=20
> T +32 (2) 387 42 59
> F +32 (2) 387 42 75
>=20
> =20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>=20

--=20
View this message in context: http://www.nabble.com/Firmware-Support-for-US=
B-Hub-tf4850180.html#a13894278
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: Firmware Support for USB Hub
From: Clemens Koller @ 2007-11-22 11:16 UTC (permalink / raw)
  To: Misbah khan; +Cc: linuxppc-embedded
In-Reply-To: <13894278.post@talk.nabble.com>

Misbah khan schrieb:
 > Laurent Pinchart-4 wrote:
 >> On Wednesday 21 November 2007 18:20, Scott Wood wrote:
 >>
 >> If I remember correctly, CPM2 USB host support requires the host to create
 >> SOF
 >> packets in software. High system loads will probably mess the bus up. A
 >> colleague of mines was told by Freescale to use an external USB controller
 >> instead of the MPC8248 bundled one.
 >>
 >> I have posted this quarry to freescale. Anyway if you get more information
 >> could you please share with me ??

Well... can you post the source of this information. I would expect having
effects like this documented in the user manual or if it's really erratic
behaviour (and not a mess in an unmaintained piece of software) in an errata
sheet.

Please update.

Regards,

Clemens Koller
__________________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Straße 45/1
Linhof Werksgelände
D-81379 München
Tel.089-741518-50
Fax 089-741518-19
http://www.anagramm-technology.com

^ permalink raw reply

* Re: Xilinx Linux git server available
From: Peter Korsgaard @ 2007-11-22 13:48 UTC (permalink / raw)
  To: Wolfgang Reissnegger; +Cc: linuxppc-dev
In-Reply-To: <20071114015615.12B9B1528050@mail173-sin.bigfish.com>

>>>>> "Wolfgang" == Wolfgang Reissnegger <wolfgang.reissnegger@xilinx.com> writes:

Hi,

 Wolfgang> The kernel includes drivers to support the following Xilinx IP cores:
 Wolfgang>   * EMAC, EMACLITE, TEMAC, LLTEMAC
 Wolfgang>   * UART, UARTLITE

Why another uartlite driver? What's wrong with mine in mainline?

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: Xilinx Linux git server available
From: Grant Likely @ 2007-11-22 14:35 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev, Wolfgang Reissnegger
In-Reply-To: <8763zufl29.fsf@macbook.be.48ers.dk>

On 11/22/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> >>>>> "Wolfgang" == Wolfgang Reissnegger <wolfgang.reissnegger@xilinx.com> writes:
>
> Hi,
>
>  Wolfgang> The kernel includes drivers to support the following Xilinx IP cores:
>  Wolfgang>   * EMAC, EMACLITE, TEMAC, LLTEMAC
>  Wolfgang>   * UART, UARTLITE
>
> Why another uartlite driver? What's wrong with mine in mainline?

Relax; he's talking about your driver.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* 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


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox