LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Start arch/powerpc/boot code reorganization
From: Mark A. Greer @ 2006-09-25 17:53 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Paul Mackerras, Matt Porter, linuxppc-dev
In-Reply-To: <D47FC822-2AB1-459A-B2EC-50A99552DC9A@kernel.crashing.org>

On Sat, Sep 23, 2006 at 12:15:19PM +0200, Segher Boessenkool wrote:
> >All I'm try to say is that "fw,address" is just like the "reg"  
> >property
> >except that it holds the effective addr not the physical addr and the
> >size of the address is determined by the existence of "/cpus/64-bit"
> >not #address-cells.  That's all.
> 
> Sounds good.
> 
> >>Yes.  Except a "cell" is not what you think it is.  A "cell" is the
> >>size of numbers OF deals with internally; just deal with it.  Of
> >>course, there's things like "#address-cells", which really mean
> >>"#-32bit-things-per-address".
> >
> >Okay, well, when I talked about cells I meant "#-32bit-things-per- 
> >address".
> >Obviously it was silly of me to think that "#address-cells" meant  
> >the # of
> >address cells...
> 
> Some background might clear things up (or not)...  A "cell" is the
> unit of data in a Forth system.  When OF was young (and not yet
> called OF), all systems were 32-bit, and the 32-bit-thingies in
> the properties (which weren't yet called properties) in the device
> tree were called cells as well.  When 64-bit came into the picture,
> everything fell apart.  The "correct" name for the property thingies
> now is "integers as encoded with encode-int".  Maybe we can compromise
> on calling it "property cells" or something.

Okay, fair enough.  I think you understand what I was trying to say,
right?  If so, do you have any objections to it?

> The situation is even worse with "package", let's not go there :-)

Heh. :)

Mark

^ permalink raw reply

* Console Stops on NFS root startup
From: Clint Thomas @ 2006-09-25 19:29 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1437 bytes --]

Hey guys,

I have a dev board based loosely off the MPC8540ADS that I am trying to
boot over NFS. After setting up the proper kernel configuration and
sharing the root filesystem over NFS, I boot up the board. Everything
loads up fine, and it even says it mounts the root filesystem, however
this is the output I get.

IP-Config: Complete:
      device=eth0, addr=204.215.226.251, mask=255.255.255.0,
gw=204.215.226.50,
     host=204.215.226.251, domain=, nis-domain=(none),
     bootserver=204.215.226.250, rootserver=204.215.226.250, rootpath=
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Looking up port of RPC 100003/2 on 204.215.226.250
Looking up port of RPC 100005/1 on 204.215.226.250
VFS: Mounted root (nfs filesystem).
Mounted devfs on /dev
Freeing unused kernel memory: 236k init
 
At this point, the serial console no longer displays or accepts input
from the keyboard. The system does not appear to hang, because when I
try to ping it from another point on the network, it responds. It seems
like either init is not executing at this point, or if the console is
being changed to another device. I wanted to know if anybody has had
this problem before. I tried building BusyBox as a static-linked binary,
which has not resolved the issue. I have also tried multiple root file
system builds, which has also not yielded a solution. Thanks for any
assistance with this.
 
Clinton Thomas
 

[-- Attachment #2: Type: text/html, Size: 2170 bytes --]

^ permalink raw reply

* RE: Console Stops on NFS root startup
From: Scott Coulter @ 2006-09-25 19:31 UTC (permalink / raw)
  To: Clint Thomas; +Cc: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 2429 bytes --]

Clint,

 

Check your interrupt setup for the epic.  If something is wrong with the
uart interrupt configuration, you will stop seeing output after "Freeing
unused kernel memory".

 

Scott

 






___________________________________________________________________ 

  Scott N. Coulter 
  Senior Software Engineer 
  
  Cyclone Microsystems          
  370 James Street              Phone:  203.786.5536 ext. 118 
  New Haven, CT 06513-3051      Email:  scott.coulter@cyclone.com 
  U.S.A.                        Web:    http://www.cyclone.com 
___________________________________________________________________ 

________________________________

From: linuxppc-embedded-bounces+scott.coulter=cyclone.com@ozlabs.org
[mailto:linuxppc-embedded-bounces+scott.coulter=cyclone.com@ozlabs.org]
On Behalf Of Clint Thomas
Sent: Monday, September 25, 2006 3:29 PM
To: linuxppc-embedded@ozlabs.org
Subject: Console Stops on NFS root startup

 

Hey guys,

I have a dev board based loosely off the MPC8540ADS that I am trying to
boot over NFS. After setting up the proper kernel configuration and
sharing the root filesystem over NFS, I boot up the board. Everything
loads up fine, and it even says it mounts the root filesystem, however
this is the output I get.

IP-Config: Complete:
      device=eth0, addr=204.215.226.251, mask=255.255.255.0,
gw=204.215.226.50,
     host=204.215.226.251, domain=, nis-domain=(none),
     bootserver=204.215.226.250, rootserver=204.215.226.250, rootpath=
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Looking up port of RPC 100003/2 on 204.215.226.250
Looking up port of RPC 100005/1 on 204.215.226.250
VFS: Mounted root (nfs filesystem).
Mounted devfs on /dev
Freeing unused kernel memory: 236k init

 

At this point, the serial console no longer displays or accepts input
from the keyboard. The system does not appear to hang, because when I
try to ping it from another point on the network, it responds. It seems
like either init is not executing at this point, or if the console is
being changed to another device. I wanted to know if anybody has had
this problem before. I tried building BusyBox as a static-linked binary,
which has not resolved the issue. I have also tried multiple root file
system builds, which has also not yielded a solution. Thanks for any
assistance with this.

 

Clinton Thomas

 


[-- Attachment #2: Type: text/html, Size: 10691 bytes --]

^ permalink raw reply

* ucmpdi2 and cmpdi2
From: Rune Torgersen @ 2006-09-25 20:36 UTC (permalink / raw)
  To: linuxppc-embedded

Hi

I have a function that does a switch statement on a long long or
unsinged long long and get teh follwing compiler warnings when making a
module:

WARNING: "__ucmpdi2"
[/home/runet/source/hardware_1.1/cpu1/src/drivers/test_bug.ko]
undefined!
WARNING: "__cmpdi2"
[/home/runet/source/hardware_1.1/cpu1/src/drivers/test_bug.ko]
undefined!

And of course it fails to load.

The weird thingis that it works if I instead of using a long long, use a
[u]int64_t.
Is this a compiler error or something else?

gcc version: powerpc-604-linux-gnu-gcc (GCC) 3.4.3
target CPU: Freescale 826x.

Here is my module source:
#ifndef __KERNEL__
#  define __KERNEL__
#endif
#ifndef MODULE
#  define MODULE
#endif
#include <linux/config.h>
#include <linux/module.h>

#include <linux/kernel.h>   /* printk() */
#include <linux/types.h>    /* size_t */
#include <linux/ctype.h>

void TestFunc(char val)
{
    long long   t1;
    unsigned long long   t2;
   =20
    t1 =3D 0x100;
    t2 =3D 0x200;

    switch(t1)
    {
        case 0x01:=20
            printk("c1\n");
        break;  =20
        default:
            printk("def1\n");
        break;
    }

    switch(t2)
    {
        case 0x02:=20
            printk("c2\n");
        break;  =20
        default:
            printk("def2\n");
        break;
    }
}

static int __init tmp_init_module(void)
{
    return 0;
}

static void __exit tmp_cleanup_module(void)
{
}

module_init(tmp_init_module);
module_exit(tmp_cleanup_module);

^ permalink raw reply

* Re: [PATCH] adbhid: make KEY_SYSRQ configurable on ADB based machines
From: Aristeu Sergio Rozanski Filho @ 2006-09-25 22:30 UTC (permalink / raw)
  To: Brad Boyer; +Cc: linuxppc-dev
In-Reply-To: <20060920053656.GA28326@cynthia.pants.nu>

Hi Brad,
> The only thing I see is that each ADB keyboard device will have an entry
> in sysfs to change the sysrq key, but they will all set the same global.
> It's a little misleading, but I don't think it's a major issue. And
> before anyone asks, I have in fact had multiple ADB keyboards attached
> to a single machine. It was useful for multi-player games.
what about this updated patch?

-- 
Aristeu

^ permalink raw reply

* Re: [PATCH] adbhid: make KEY_SYSRQ configurable on ADB based machines
From: Aristeu Sergio Rozanski Filho @ 2006-09-25 22:34 UTC (permalink / raw)
  To: Brad Boyer; +Cc: linuxppc-dev
In-Reply-To: <20060925223057.GA23526@cathedrallabs.org>

> Hi Brad,
> > The only thing I see is that each ADB keyboard device will have an entry
> > in sysfs to change the sysrq key, but they will all set the same global.
> > It's a little misleading, but I don't think it's a major issue. And
> > before anyone asks, I have in fact had multiple ADB keyboards attached
> > to a single machine. It was useful for multi-player games.
> what about this updated patch?
If I attach the patch surely will help... :P

--- linus-2.6.orig/drivers/macintosh/adbhid.c	2006-09-25 15:14:58.000000000 -0300
+++ linus-2.6/drivers/macintosh/adbhid.c	2006-09-25 15:16:35.000000000 -0300
@@ -176,7 +176,7 @@
 	/* 0x66 */ KEY_HANJA,		/* 123 */
 	/* 0x67 */ KEY_F11,		/*  87 */
 	/* 0x68 */ KEY_HANGEUL,		/* 122 */
-	/* 0x69 */ KEY_SYSRQ,		/*  99 */
+	/* 0x69 */ 0,
 	/* 0x6a */ 0,
 	/* 0x6b */ KEY_SCROLLLOCK,	/*  70 */
 	/* 0x6c */ 0,
@@ -212,6 +212,7 @@
 	char name[64];
 	char phys[32];
 	int flags;
+	int sysrq_key;
 };
 
 #define FLAG_FN_KEY_PRESSED	0x00000001
@@ -252,6 +253,58 @@
 #define ADBMOUSE_MS_A3		8	/* Mouse systems A3 trackball (handler 3) */
 #define ADBMOUSE_MACALLY2	9	/* MacAlly 2-button mouse */
 
+/* SYSRQ support */
+#ifdef CONFIG_MAGIC_SYSRQ
+#define ADBHID_DEFAULT_SYSRQ 0x69
+#define class_device_to_adbhid(x) ((struct adbhid *)(x->class_data))
+
+static ssize_t adbhid_show_sysrq_key(struct class_device *dev, char *buf)
+{
+	struct adbhid *hid = class_device_to_adbhid(dev);
+
+	return sprintf(buf, "%#x\n", hid->sysrq_key);
+}
+static ssize_t adbhid_store_sysrq_key(struct class_device *dev,
+				      const char *buf, size_t n)
+{
+	int val;
+	struct adbhid *hid = class_device_to_adbhid(dev);
+
+	val = simple_strtol(buf, NULL, 10);
+	if (val > 255)
+		return -EINVAL;
+	hid->sysrq_key = val;
+
+	return n;
+}
+
+static CLASS_DEVICE_ATTR(sysrq_key, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
+			 adbhid_show_sysrq_key, adbhid_store_sysrq_key);
+static inline int adbhid_key_is_sysrq(struct adbhid *hid, int keycode)
+{
+	if (unlikely(keycode == hid->sysrq_key))
+		return KEY_SYSRQ;
+	return 0;
+}
+
+static inline void adbhid_register_sysrq_attr(struct adbhid *hid,
+					      struct class_device *dev)
+{
+	dev->class_data = hid;
+	class_device_create_file(dev, &class_device_attr_sysrq_key);
+}
+#define adbhid_set_sysrq(x) set_bit(KEY_SYSRQ, (x))
+static inline void adbhid_set_default_sysrq(struct adbhid *hid)
+{
+	hid->sysrq_key = ADBHID_DEFAULT_SYSRQ;
+}
+#else	/* !CONFIG_MAGIC_SYSRQ */
+#define adbhid_key_is_sysrq(x, y) (0)
+#define adbhid_register_sysrq_attr(x, y) do { } while(0)
+#define adbhid_set_sysrq(x) do { } while(0)
+#define adbhid_set_default_sysrq(x) do { } while(0)
+#endif	/* CONFIG_MAGIC_SYSRQ */
+
 static void
 adbhid_keyboard_input(unsigned char *data, int nb, struct pt_regs *regs, int apoll)
 {
@@ -275,7 +328,7 @@
 adbhid_input_keycode(int id, int keycode, int repeat, struct pt_regs *regs)
 {
 	struct adbhid *ahid = adbhid[id];
-	int up_flag, key;
+	int up_flag, key = 0;
 
 	up_flag = (keycode & 0x80);
 	keycode &= 0x7f;
@@ -336,7 +389,9 @@
 #endif /* CONFIG_PPC_PMAC */
 	}
 
-	key = adbhid[id]->keycode[keycode];
+	key = adbhid_key_is_sysrq(adbhid[id], keycode);
+	if (!key)
+		key = adbhid[id]->keycode[keycode];
 	if (key) {
 		input_regs(adbhid[id]->input, regs);
 		input_report_key(adbhid[id]->input, key, !up_flag);
@@ -705,6 +760,7 @@
 	hid->current_handler_id = current_handler_id;
 	hid->mouse_kind = mouse_kind;
 	hid->flags = 0;
+	adbhid_set_default_sysrq(hid);
 	input_dev->private = hid;
 	input_dev->name = hid->name;
 	input_dev->phys = hid->phys;
@@ -759,6 +815,7 @@
 		for (i = 0; i < 128; i++)
 			if (hid->keycode[i])
 				set_bit(hid->keycode[i], input_dev->keybit);
+		adbhid_set_sysrq(input_dev->keybit);
 
 		input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
 		input_dev->ledbit[0] = BIT(LED_SCROLLL) | BIT(LED_CAPSL) | BIT(LED_NUML);
@@ -901,6 +958,8 @@
 		adb_get_infos(id, &default_id, &cur_handler_id);
 		reg |= adbhid_input_reregister(id, default_id, org_handler_id,
 					       cur_handler_id, 0);
+
+		adbhid_register_sysrq_attr(adbhid[id], keyboard_ids.device[i]);
 	}
 
 	for (i = 0; i < buttons_ids.nids; i++) {

^ permalink raw reply

* [PATCH]: Powerpc: EEH failure to mark pci slot as frozen.
From: Linas Vepstas @ 2006-09-25 23:01 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: akpm, linuxppc-dev


Paul, 

Resending, this one seems to have fallen through the cracks,
its not yet in 2.6.18-git4 or 2.6.18-mm1 (the others I've
sent have made it in, thanks!).

This patch is needed to make the symbios scsi recovery work 
correctly.  Please apply and forward.  

--linas


Bug fix: when marking a slot as frozen, we forgot to mark
pci device itself as frozen. (we did manage to mark the 
pci children, but forget the parent itself.)

This is needed so that some device drivers can check the 
pci status in critical sections (e.g. in spin loops with 
interrupts disabled). 

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>

----
 arch/powerpc/platforms/pseries/eeh.c |    7 +++++++
 1 file changed, 7 insertions(+)

Index: linux-2.6.18-mm1/arch/powerpc/platforms/pseries/eeh.c
===================================================================
--- linux-2.6.18-mm1.orig/arch/powerpc/platforms/pseries/eeh.c	2006-09-25 17:22:51.000000000 -0500
+++ linux-2.6.18-mm1/arch/powerpc/platforms/pseries/eeh.c	2006-09-25 17:31:55.000000000 -0500
@@ -225,6 +225,7 @@ static void __eeh_mark_slot (struct devi
 
 void eeh_mark_slot (struct device_node *dn, int mode_flag)
 {
+	struct pci_dev *dev;
 	dn = find_device_pe (dn);
 
 	/* Back up one, since config addrs might be shared */
@@ -232,6 +233,12 @@ void eeh_mark_slot (struct device_node *
 		dn = dn->parent;
 
 	PCI_DN(dn)->eeh_mode |= mode_flag;
+
+	/* Mark the pci device too */
+	dev = PCI_DN(dn)->pcidev;
+	if (dev)
+		dev->error_state = pci_channel_io_frozen;
+
 	__eeh_mark_slot (dn->child, mode_flag);
 }
 

^ permalink raw reply

* Re: [PATCH] Start arch/powerpc/boot code reorganization
From: Segher Boessenkool @ 2006-09-25 23:40 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: Paul Mackerras, Matt Porter, linuxppc-dev
In-Reply-To: <20060925175307.GC4971@mag.az.mvista.com>

>>> All I'm try to say is that "fw,address" is just like the "reg"
>>> property
>>> except that it holds the effective addr not the physical addr and  
>>> the
>>> size of the address is determined by the existence of "/cpus/64-bit"
>>> not #address-cells.  That's all.

> Okay, fair enough.  I think you understand what I was trying to say,
> right?  If so, do you have any objections to it?

Yes: don't call it "<whatever>address", when you immediately say it
is more like "reg".  How about "virtual-reg"?

>> The situation is even worse with "package", let's not go there :-)
>
> Heh. :)

Ooh your tempting me :-)


Segher

^ permalink raw reply

* Re: [PATCH] Start arch/powerpc/boot code reorganization
From: Mark A. Greer @ 2006-09-25 23:46 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Paul Mackerras, Matt Porter, linuxppc-dev
In-Reply-To: <4B6C3D97-1872-447A-AEE3-011E0A34298A@kernel.crashing.org>

On Tue, Sep 26, 2006 at 01:40:15AM +0200, Segher Boessenkool wrote:
> >>>All I'm try to say is that "fw,address" is just like the "reg"
> >>>property
> >>>except that it holds the effective addr not the physical addr and  
> >>>the
> >>>size of the address is determined by the existence of "/cpus/64-bit"
> >>>not #address-cells.  That's all.
> 
> >Okay, fair enough.  I think you understand what I was trying to say,
> >right?  If so, do you have any objections to it?
> 
> Yes: don't call it "<whatever>address", when you immediately say it
> is more like "reg".  How about "virtual-reg"?

Anyone have a problem with "virtual-reg"?

^ permalink raw reply

* Re: [PATCH 2.6.19-rc1] ehea firmware interface based on Anton Blanchard's new hvcall interface
From: Jeff Garzik @ 2006-09-26  0:07 UTC (permalink / raw)
  To: Jan-Bernd Themann
  Cc: Thomas Klein, Jan-Bernd Themann, netdev, pmac, linux-kernel,
	linux-ppc, Christoph Raisch, Marcus Eder
In-Reply-To: <200609251550.01514.ossthema@de.ibm.com>

patch does not apply.

also, it would seem like varargs would be appropriate here.

^ permalink raw reply

* [POWERPC] fix spin lock nesting in hvc_iseries
From: Stephen Rothwell @ 2006-09-26  1:54 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev, Alexey Dobriyan, linux-kernel
In-Reply-To: <20060926005838.d0cd5d7e.sfr@canb.auug.org.au>

We had nested spinlocks using the same flags variable, but it turns out
that we don't need the nested locks at all (the lock protects a static
buffer that we aren't using here), so just remove the extra locks.

Spotted by Alexey Dobriyan.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/char/hvc_iseries.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index ea36201..f144a94 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -154,9 +154,7 @@ static int put_chars(uint32_t vtermno, c
 	spin_lock_irqsave(&consolelock, flags);
 
 	if (viochar_is_console(pi) && !viopath_isactive(pi->lp)) {
-		spin_lock_irqsave(&consoleloglock, flags);
 		HvCall_writeLogBuffer(buf, count);
-		spin_unlock_irqrestore(&consoleloglock, flags);
 		sent = count;
 		goto done;
 	}
@@ -172,11 +170,8 @@ static int put_chars(uint32_t vtermno, c
 
 		len = (count > VIOCHAR_MAX_DATA) ? VIOCHAR_MAX_DATA : count;
 
-		if (viochar_is_console(pi)) {
-			spin_lock_irqsave(&consoleloglock, flags);
+		if (viochar_is_console(pi))
 			HvCall_writeLogBuffer(buf, len);
-			spin_unlock_irqrestore(&consoleloglock, flags);
-		}
 
 		init_data_event(viochar, pi->lp);
 
-- 
1.4.2.1

^ permalink raw reply related

* fs_enet - support for SCC on CPM2?
From: Matt Hevern @ 2006-09-26  2:19 UTC (permalink / raw)
  To: Linuxppc-embedded

Hi all,

I am trying to compile for an freescale 82xx (CPM2) series processor, 
with ethernet on an SCC. (kernel 2.6.x)
 From what i can see, in the file drivers/net/fs_enet/fs_enet-main.c, 
the config option "CONFIG_FS_ENET_HAS_SCC"  pulls in "fs_scc_ops" which 
are defined in
drivers/net/fs_enet/mac-scc.c, but this file  does not seem to have 
support for 82xx series, failing with various compile errors:
------errors
drivers/net/fs_enet/mac-scc.c: In function `scc_cr_cmd':
drivers/net/fs_enet/mac-scc.c:94: error: `cpm8xx_t' undeclared (first 
use in this function)
drivers/net/fs_enet/mac-scc.c:94: error: (Each undeclared identifier is 
reported only once
drivers/net/fs_enet/mac-scc.c:94: error: for each function it appears in.)
drivers/net/fs_enet/mac-scc.c:94: error: `immap_t' undeclared (first use 
in this function)
...etc
------end-errors

It seems like these errors are mostly due to the driver being tailored 
for 8xx series.

Are there any patches/fixes for "fs_enet" for ethernet on SCC for 82xx 
series?  - or other options?

Thanks in advance.

Matt

^ permalink raw reply

* RE: [RFC][PATCH] QE device tree node definition
From: Li Tony-r64360 @ 2006-09-26  2:40 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <4517A922.503@freescale.com>

=20
1) Where is the QE embedded interrupt controller ?
I think the interrupt-parent of the QE function should point to it.

2) For the UCC, It is better to make rx-clock and tx-clock as required
properties.
 Almost all functions need this properties

Best Regards
> -----Original Message-----
> From: linuxppc-dev-bounces+tony.li=3Dfreescale.com@ozlabs.org=20
> [mailto:linuxppc-dev-bounces+tony.li=3Dfreescale.com@ozlabs.org]
>  On Behalf Of Li Yang
> Sent: Monday, September 25, 2006 6:02 PM
> To: linuxppc-dev@ozlabs.org
> Subject: [RFC][PATCH] QE device tree node definition
>=20
> Here is OF device tree node spec used in QE/8360 support patches.
>=20
> Signed-off-by: Jiang Bo <Tanya.jiang@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
>=20
> ---
> This is a repost of previous patch to be reviewed together=20
> with QE/8360 support patches.
> Vitaly will add CPM part and maybe post an integrated spec of=20
> QE/CPM later.
>=20
> diff --git a/Documentation/powerpc/booting-without-of.txt=20
> b/Documentation/powerpc/booting-without-of.txt
> index 5c0ba23..b3218a1 100644
> --- a/Documentation/powerpc/booting-without-of.txt
> +++ b/Documentation/powerpc/booting-without-of.txt
> @@ -1442,6 +1442,231 @@ platforms are moved over to use the flat
>         };
> =20
> =20
> +   h) Freescale QUICC Engine module (QE)
> +   This represents qe module that is installed on PowerQUICC II Pro.
> +   Hopefully it will merge backward compatibility with CPM/CPM2.
> +   Basically, it is a bus of devices, that could act more or less
> +   as a complete entity (UCC, USB etc ). All of them should=20
> be siblings on
> +   the "root" qe node, using the common properties from there.
> +   The description below applies to the the qe of MPC8360 and
> +   more nodes and properties would be extended in the future.
> +
> +   i) Root QE device
> +
> +   Required properties:
> +   - device_type : should be "qe";
> +   - model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
> +   - reg : there will be two tuples of "address size".  The=20
> first tuple is
> +     offset and length of the device registers respectively;=20
> the second is
> +     offset and length of the device parameter RAM respectively.
> +   - bus-frequency : the clock frequency for QUICC Engine.
> + =20
> +   Recommended properties
> +   - brg-frequency : the internal clock source frequency for=20
> baud-rate
> +     generators in Hz.
> +
> +   Example:
> +	qe@e0100000 {
> +		#address-cells =3D <1>;
> +		#size-cells =3D <1>;
> +		#interrupt-cells =3D <2>;
> +		device_type =3D "qe";
> +		model =3D "QE";
> +		ranges =3D <0 e0100000 00100000>;
> +		reg =3D <e0100000 480 e0110000 c000>;
> +		brg-frequency =3D <0>;
> +		bus-frequency =3D <179A7B00>;
> +	}
> +
> +
> +   ii) SPI (Serial Peripheral Interface)
> +
> +   Required properties:
> +   - device_type : should be "spi".
> +   - compatible : should be "fsl_spi".
> +   - mode : the spi operation mode, it can be "cpu" or "qe".
> +   - reg : offset to the register set and its length.
> +   - interrupts : <a b> where a is the interrupt number and b is a
> +     field that represents an encoding of the sense and level
> +     information for the interrupt.  This should be encoded based on
> +     the information in section 2) depending on the type of interrupt
> +     controller you have.
> +   - interrupt-parent : the phandle for the interrupt controller that
> +     services interrupts for this device.
> +
> +   Example:
> +	spi@4c0 {
> +		device_type =3D "spi";
> +		compatible =3D "fsl_spi";
> +		reg =3D <4c0 40>;
> +		interrupts =3D <82 0>;
> +		interrupt-parent =3D <700>;
> +		mode =3D "cpu";
> +	};
> +
> +
> +   iii) USB (Universal Serial Bus Controller)
> +
> +   Required properties:
> +   - device_type : should be "usb".
> +   - compatible : could be "qe_udc" or "fhci-hcd".
> +   - mode : the could be "host" or "slave".
> +   - reg : there will be two tuples of "address size".  The=20
> first tuple is
> +     offset and length of the device registers respectively;=20
> the second is
> +     offset and length of the device parameter RAM respectively.
> +   - interrupts : <a b> where a is the interrupt number and b is a
> +     field that represents an encoding of the sense and level
> +     information for the interrupt.  This should be encoded based on
> +     the information in section 2) depending on the type of interrupt
> +     controller you have.
> +   - interrupt-parent : the phandle for the interrupt controller that
> +     services interrupts for this device.
> +
> +   Example(slave):
> +	usb@6c0 {
> +		device_type =3D "usb";
> +		compatible =3D "qe_udc";
> +		reg =3D <6c0 40 8B00 100>;
> +		interrupts =3D <8b 0>;
> +		interrupt-parent =3D <700>;
> +		mode =3D "slave";
> +	};
> +
> +
> +   iv) UCC (Unified Communications Controllers)
> +
> +   Required properties:
> +   - device_type : should be "network", "hldc", "uart", "transparent"
> +    "bisync" or "atm".
> +   - compatible : could be "ucc_geth" or "fsl_atm" and so on.
> +   - model : should be "UCC".
> +   - device-id : the ucc number(1-8), corresponding to UCCx in UM.
> +   - reg : there will be two tuples of "address size".  The=20
> first tuple is
> +     offset and length of the device registers respectively;=20
> the second is
> +     offset and length of the device parameter RAM respectively.
> +   - interrupts : <a b> where a is the interrupt number and b is a
> +     field that represents an encoding of the sense and level
> +     information for the interrupt.  This should be encoded based on
> +     the information in section 2) depending on the type of interrupt
> +     controller you have.
> +   - interrupt-parent : the phandle for the interrupt controller that
> +     services interrupts for this device.
> +   - pio-handle : The phandle for the Parallel I/O port=20
> configuration.
> +
> +   Required properties for network device_type:
> +   - mac-address : list of bytes representing the ethernet address.
> +   - rx-clock : represents the UCC receive clock source.
> +     0x00 : clock source is disabled;
> +     0x1~0x10 : clock source is BRG1~BRG16 respectively;
> +     0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
> +   - t--clock: represents the UCC transmit clock source;
> +     0x00 : clock source is disabled;
> +     0x1~0x10 : clock source is BRG1~BRG16 respectively;
> +     0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
> +   - phy-handle : The phandle for the PHY connected to this=20
> controller.
> +
> +   Example:
> +	ucc@2000 {
> +		device_type =3D "network";
> +		compatible =3D "ucc_geth";
> +		model =3D "UCC";
> +		device-id =3D <1>;
> +		reg =3D <2000 200 8400 100>;
> +		interrupts =3D <a0 0>;
> +		interrupt-parent =3D <700>;
> +		mac-address =3D [ 00 04 9f 00 23 23 ];
> +		rx-clock =3D "none";
> +		tx-clock =3D "clk9";
> +		phy-handle =3D <212000>;
> +		pio-handle =3D <140001>;
> +	};
> +
> +
> +   v) Parallel I/O Ports
> +
> +   This node configures Parallel I/O ports for CPUs with QE support.
> +   The node should reside in the "soc" node of the tree.  For each
> +   device that using parallel I/O ports, a child node should=20
> be created.
> +   See the definition of the Pin configuration nodes below for more
> +   information.
> +
> +   Required properties:
> +   - device_type : should be "par_io".
> +   - reg : offset to the register set and its length.
> +   - num-ports : number of Parallel I/O ports
> +
> +   Example:
> +	par_io@1400 {
> +		reg =3D <1400 100>;
> +		#address-cells =3D <1>;
> +		#size-cells =3D <0>;
> +		device_type =3D "par_io";
> +		num-ports =3D <7>;
> +		ucc_pin@01 {
> +			......
> +		};
> +
> +
> +   vi) Pin configuration nodes
> +
> +   Required properties:
> +   - linux,phandle : phandle of this node; likely referenced by a QE
> +     device.
> +   - pio-map : array of pin configurations.  Each pin is defined by 6
> +     integers.  The six numbers are respectively: port, pin, dir,
> +     open_drain, assignment, has_irq.
> +     - port : port number of the pin; 0-6 represent port A-G in UM.
> +     - pin : pin number in the port.
> +     - dir : direction of the pin, should encode as follows:
> +
> +	0 =3D The pin is disabled
> +	1 =3D The pin is an output
> +	2 =3D The pin is an input
> +	3 =3D The pin is I/O
> +
> +     - open_drain : indicates the pin is normal or wired-OR:
> +
> +	0 =3D The pin is actively driven as an output
> +	1 =3D The pin is an open-drain driver. As an output, the pin is
> +	    driven active-low, otherwise it is three-stated.
> +
> +     - assignment : function number of the pin according to=20
> the Pin Assignment
> +       tables in User Manual.  Each pin can have up to 4=20
> possible functions in
> +       QE and two options for CPM.
> +     - has_irq : indicates if the pin is used as source of exteral
> +       interrupts.
> +
> +   Example:
> +	ucc_pin@01 {
> +		linux,phandle =3D <140001>;
> +		pio-map =3D <
> +		/* port  pin  dir  open_drain  assignment  has_irq */
> +			0  3  1  0  1  0 	/* TxD0 */
> +			0  4  1  0  1  0 	/* TxD1 */
> +			0  5  1  0  1  0 	/* TxD2 */
> +			0  6  1  0  1  0 	/* TxD3 */
> +			1  6  1  0  3  0 	/* TxD4 */
> +			1  7  1  0  1  0 	/* TxD5 */
> +			1  9  1  0  2  0 	/* TxD6 */
> +			1  a  1  0  2  0 	/* TxD7 */
> +			0  9  2  0  1  0 	/* RxD0 */
> +			0  a  2  0  1  0 	/* RxD1 */
> +			0  b  2  0  1  0 	/* RxD2 */
> +			0  c  2  0  1  0 	/* RxD3 */
> +			0  d  2  0  1  0 	/* RxD4 */
> +			1  1  2  0  2  0 	/* RxD5 */
> +			1  0  2  0  2  0 	/* RxD6 */
> +			1  4  2  0  2  0 	/* RxD7 */
> +			0  7  1  0  1  0 	/* TX_EN */
> +			0  8  1  0  1  0 	/* TX_ER */
> +			0  f  2  0  1  0 	/* RX_DV */
> +			0  10 2  0  1  0 	/* RX_ER */
> +			0  0  2  0  1  0 	/* RX_CLK */
> +			2  9  1  0  3  0 	/* GTX_CLK - CLK10 */
> +			2  8  2  0  1  0>;	/* GTX125 - CLK9 */
> +	};
> +
> +
>     More devices will be defined as this spec matures.
> =20
> =20
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>=20

^ permalink raw reply

* [PATCH] update mpc8349_itx_defconfig and remove some debug settings
From: Kim Phillips @ 2006-09-26  2:55 UTC (permalink / raw)
  To: linuxppc-dev

update mpc8349_itx_defconfig and turn off some debug settings

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

---
 arch/powerpc/configs/mpc834x_itx_defconfig |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/configs/mpc834x_itx_defconfig b/arch/powerpc/configs/mpc834x_itx_defconfig
index 8da6a47..ea55bab 100644
--- a/arch/powerpc/configs/mpc834x_itx_defconfig
+++ b/arch/powerpc/configs/mpc834x_itx_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc6
-# Sun Sep 10 10:28:05 2006
+# Linux kernel version: 2.6.18
+# Mon Sep 25 19:41:14 2006
 #
 # CONFIG_PPC64 is not set
 CONFIG_PPC32=y
@@ -21,6 +21,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 CONFIG_PPC_UDBG_16550=y
 # CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
 CONFIG_DEFAULT_UIMAGE=y
 
 #
@@ -61,25 +62,25 @@ CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 # CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=""
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EMBEDDED=y
+CONFIG_SYSCTL=y
 # CONFIG_KALLSYMS is not set
 CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
-CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 # CONFIG_EPOLL is not set
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -259,7 +260,6 @@ # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 
@@ -313,6 +313,7 @@ # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -1277,11 +1278,11 @@ # CONFIG_PROFILING is not set
 #
 # Kernel hacking
 #
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
-CONFIG_LOG_BUF_SHIFT=17
+CONFIG_LOG_BUF_SHIFT=14
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
@@ -1293,15 +1294,15 @@ # CONFIG_DEBUG_RWSEMS is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
-CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_DEBUGGER is not set
 # CONFIG_BDI_SWITCH is not set
-CONFIG_BOOTX_TEXT=y
-CONFIG_SERIAL_TEXT_DEBUG=y
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_SERIAL_TEXT_DEBUG is not set
 # CONFIG_PPC_EARLY_DEBUG is not set
 
 #
@@ -1314,6 +1315,8 @@ #
 # Cryptographic options
 #
 CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+# CONFIG_CRYPTO_MANAGER is not set
 # CONFIG_CRYPTO_HMAC is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
@@ -1323,6 +1326,8 @@ # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
 # CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_CBC is not set
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
-- 
1.4.2.1

^ permalink raw reply related

* [PATCH] Add powerpc get/set_rtc_time interface to new generic rtc class
From: Kim Phillips @ 2006-09-26  2:55 UTC (permalink / raw)
  To: linuxppc-dev

Add powerpc get/set_rtc_time interface to new generic rtc class. This
abstracts rtc chip specific code from the platform code for rtc-over-i2c
platforms.  Specific RTC chip support is now configured under
Device Drivers -> Real Time Clock. Setting time of day from the RTC
on startup is also configurable.

Currently, the only default config in powerpc arch is the 8349 itx.
Other platforms wanting to consolidate code may also use this.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

---
 arch/powerpc/kernel/time.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 7a3c3f7..a231b6d 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1048,6 +1048,50 @@ void __init time_init(void)
 	set_dec(tb_ticks_per_jiffy);
 }
 
+#ifdef CONFIG_RTC_CLASS
+int set_rtc_class_time(struct rtc_time *tm)
+{
+	int err;
+	struct class_device *class_dev =
+		rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
+
+	if (class_dev == NULL)
+		return -ENODEV;
+
+	err = rtc_set_time(class_dev, tm);
+
+	rtc_class_close(class_dev);
+
+	return 0;
+}
+
+void get_rtc_class_time(struct rtc_time *tm)
+{
+	int err;
+	struct class_device *class_dev =
+		rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
+
+	if (class_dev == NULL)
+		return;
+
+	err = rtc_read_time(class_dev, tm);
+
+	rtc_class_close(class_dev);
+
+	return;
+}
+
+static int __init rtc_class_hookup(void)
+{
+	ppc_md.get_rtc_time = get_rtc_class_time;
+	ppc_md.set_rtc_time = set_rtc_class_time;
+
+	return 0;
+}
+
+late_initcall(rtc_class_hookup);
+#endif /* CONFIG_RTC_CLASS */
+
 
 #define FEBRUARY	2
 #define	STARTOFTIME	1970
-- 
1.4.2.1

^ permalink raw reply related

* Re: [PATCH 2.6.19-rc1] ehea firmware interface based on Anton Blanchard's new hvcall interface
From: Benjamin Herrenschmidt @ 2006-09-26  2:53 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Thomas Klein, pmac, netdev, Jan-Bernd Themann, linux-kernel,
	Christoph Raisch, linux-ppc, Marcus Eder
In-Reply-To: <45186F25.9000700@garzik.org>

On Mon, 2006-09-25 at 20:07 -0400, Jeff Garzik wrote:
> patch does not apply.
> 
> also, it would seem like varargs would be appropriate here.

Not really... these are hypervisor calls, their calling convention is
not varargs, thus we would need some conversion layer if using them,
with possible performance loss (it's also hard to do right as we are
passing args by registers, not stack).

Ben.

^ permalink raw reply

* Re: [PATCH] Add powerpc get/set_rtc_time interface to new generic rtc class
From: Benjamin Herrenschmidt @ 2006-09-26  3:13 UTC (permalink / raw)
  To: Kim Phillips; +Cc: linuxppc-dev
In-Reply-To: <20060925215531.3e43be36.kim.phillips@freescale.com>

On Mon, 2006-09-25 at 21:55 -0500, Kim Phillips wrote:
> Add powerpc get/set_rtc_time interface to new generic rtc class. This
> abstracts rtc chip specific code from the platform code for rtc-over-i2c
> platforms.  Specific RTC chip support is now configured under
> Device Drivers -> Real Time Clock. Setting time of day from the RTC
> on startup is also configurable.
> 
> Currently, the only default config in powerpc arch is the 8349 itx.
> Other platforms wanting to consolidate code may also use this.
> 
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

I think we should only get that in if we also adapt the various platform
RTC code to be in drivers/rtc ... right now, enabling that option will
just break everybody.

> ---
>  arch/powerpc/kernel/time.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 44 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
> index 7a3c3f7..a231b6d 100644
> --- a/arch/powerpc/kernel/time.c
> +++ b/arch/powerpc/kernel/time.c
> @@ -1048,6 +1048,50 @@ void __init time_init(void)
>  	set_dec(tb_ticks_per_jiffy);
>  }
>  
> +#ifdef CONFIG_RTC_CLASS
> +int set_rtc_class_time(struct rtc_time *tm)
> +{
> +	int err;
> +	struct class_device *class_dev =
> +		rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
> +
> +	if (class_dev == NULL)
> +		return -ENODEV;
> +
> +	err = rtc_set_time(class_dev, tm);
> +
> +	rtc_class_close(class_dev);
> +
> +	return 0;
> +}
> +
> +void get_rtc_class_time(struct rtc_time *tm)
> +{
> +	int err;
> +	struct class_device *class_dev =
> +		rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
> +
> +	if (class_dev == NULL)
> +		return;
> +
> +	err = rtc_read_time(class_dev, tm);
> +
> +	rtc_class_close(class_dev);
> +
> +	return;
> +}
> +
> +static int __init rtc_class_hookup(void)
> +{
> +	ppc_md.get_rtc_time = get_rtc_class_time;
> +	ppc_md.set_rtc_time = set_rtc_class_time;
> +
> +	return 0;
> +}
> +
> +late_initcall(rtc_class_hookup);
> +#endif /* CONFIG_RTC_CLASS */
> +
>  
>  #define FEBRUARY	2
>  #define	STARTOFTIME	1970

^ permalink raw reply

* [PATCH 1/7] [POWERPC] iSeries: set FW_FEATURE_ISERIES earlier
From: Stephen Rothwell @ 2006-09-26  3:34 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

This will help in the combined kernel as some really early things depend
on being able to check this.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/platforms/iseries/setup.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 7f19530..7cb6b5f 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -655,9 +655,6 @@ static int __init iseries_probe(void)
 	if (!of_flat_dt_is_compatible(root, "IBM,iSeries"))
 		return 0;
 
-	powerpc_firmware_features |= FW_FEATURE_ISERIES;
-	powerpc_firmware_features |= FW_FEATURE_LPAR;
-
 	hpte_init_iSeries();
 
 	return 1;
@@ -687,6 +684,9 @@ void * __init iSeries_early_setup(void)
 {
 	unsigned long phys_mem_size;
 
+	powerpc_firmware_features |= FW_FEATURE_ISERIES;
+	powerpc_firmware_features |= FW_FEATURE_LPAR;
+
 	iSeries_fixup_klimit();
 
 	/*
-- 
1.4.2.1

^ permalink raw reply related

* [PATCH 2/7] [POWERPC] The two vio HVC backends clash
From: Stephen Rothwell @ 2006-09-26  3:35 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev
In-Reply-To: <20060926133413.8ca8142e.sfr@canb.auug.org.au>

Make sure only one of them actually registered as a driver.

Also, remove cast from get_property().

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/char/hvc_iseries.c |    8 ++++++--
 drivers/char/hvc_vio.c     |    4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index 4747729..ea36201 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -29,6 +29,7 @@ #include <linux/console.h>
 #include <asm/hvconsole.h>
 #include <asm/vio.h>
 #include <asm/prom.h>
+#include <asm/firmware.h>
 #include <asm/iseries/vio.h>
 #include <asm/iseries/hv_call.h>
 #include <asm/iseries/hv_lp_config.h>
@@ -493,6 +494,9 @@ static int hvc_vio_init(void)
 	atomic_t wait_flag;
 	int rc;
 
+	if (!firmware_has_feature(FW_FEATURE_ISERIES))
+		return -EIO;
+
 	/* +2 for fudge */
 	rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
 			viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
@@ -567,7 +571,7 @@ static int hvc_find_vtys(void)
 
 	for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL;
 			vty = of_find_node_by_name(vty, "vty")) {
-		uint32_t *vtermno;
+		const uint32_t *vtermno;
 
 		/* We have statically defined space for only a certain number
 		 * of console adapters.
@@ -576,7 +580,7 @@ static int hvc_find_vtys(void)
 				(num_found >= VTTY_PORTS))
 			break;
 
-		vtermno = (uint32_t *)get_property(vty, "reg", NULL);
+		vtermno = get_property(vty, "reg", NULL);
 		if (!vtermno)
 			continue;
 
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index cc95941..f9c0084 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -35,6 +35,7 @@ #include <linux/init.h>
 #include <asm/hvconsole.h>
 #include <asm/vio.h>
 #include <asm/prom.h>
+#include <asm/firmware.h>
 
 #include "hvc_console.h"
 
@@ -120,6 +121,9 @@ static int hvc_vio_init(void)
 {
 	int rc;
 
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return -EIO;
+
 	/* Register as a vio device to receive callbacks */
 	rc = vio_register_driver(&hvc_vio_driver);
 
-- 
1.4.2.1

^ permalink raw reply related

* [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel
From: Stephen Rothwell @ 2006-09-26  3:36 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev
In-Reply-To: <20060926133548.43afd711.sfr@canb.auug.org.au>

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/pci_64.c         |   58 ++++++++++++++++++----------------
 arch/powerpc/platforms/iseries/pci.c |    4 --
 2 files changed, 30 insertions(+), 32 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index c1b1e14..78d3c0f 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -30,6 +30,7 @@ #include <asm/pci-bridge.h>
 #include <asm/byteorder.h>
 #include <asm/machdep.h>
 #include <asm/ppc-pci.h>
+#include <asm/firmware.h>
 
 #ifdef DEBUG
 #include <asm/udbg.h>
@@ -209,7 +210,6 @@ void pcibios_free_controller(struct pci_
 		kfree(phb);
 }
 
-#ifndef CONFIG_PPC_ISERIES
 void __devinit pcibios_claim_one_bus(struct pci_bus *b)
 {
 	struct pci_dev *dev;
@@ -238,10 +238,12 @@ static void __init pcibios_claim_of_setu
 {
 	struct pci_bus *b;
 
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return;
+
 	list_for_each_entry(b, &pci_root_buses, node)
 		pcibios_claim_one_bus(b);
 }
-#endif
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
 static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
@@ -554,9 +556,8 @@ static int __init pcibios_init(void)
 	 */
 	ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
 
-#ifdef CONFIG_PPC_ISERIES
-	iSeries_pcibios_init(); 
-#endif
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		iSeries_pcibios_init();
 
 	printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
 
@@ -566,15 +567,15 @@ #endif
 		pci_bus_add_devices(hose->bus);
 	}
 
-#ifndef CONFIG_PPC_ISERIES
-	if (pci_probe_only)
-		pcibios_claim_of_setup();
-	else
-		/* FIXME: `else' will be removed when
-		   pci_assign_unassigned_resources() is able to work
-		   correctly with [partially] allocated PCI tree. */
-		pci_assign_unassigned_resources();
-#endif /* !CONFIG_PPC_ISERIES */
+	if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
+		if (pci_probe_only)
+			pcibios_claim_of_setup();
+		else
+			/* FIXME: `else' will be removed when
+			   pci_assign_unassigned_resources() is able to work
+			   correctly with [partially] allocated PCI tree. */
+			pci_assign_unassigned_resources();
+	}
 
 	/* Call machine dependent final fixup */
 	if (ppc_md.pcibios_fixup)
@@ -586,8 +587,9 @@ #endif /* !CONFIG_PPC_ISERIES */
 		printk(KERN_DEBUG "ISA bridge at %s\n", pci_name(ppc64_isabridge_dev));
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
-	/* map in PCI I/O space */
-	phbs_remap_io();
+	if (!firmware_has_feature(FW_FEATURE_ISERIES))
+		/* map in PCI I/O space */
+		phbs_remap_io();
 #endif
 
 	printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
@@ -637,13 +639,13 @@ int pcibios_enable_device(struct pci_dev
  */
 int pci_domain_nr(struct pci_bus *bus)
 {
-#ifdef CONFIG_PPC_ISERIES
-	return 0;
-#else
-	struct pci_controller *hose = pci_bus_to_host(bus);
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return 0;
+	else {
+		struct pci_controller *hose = pci_bus_to_host(bus);
 
-	return hose->global_number;
-#endif
+		return hose->global_number;
+	}
 }
 
 EXPORT_SYMBOL(pci_domain_nr);
@@ -651,12 +653,12 @@ EXPORT_SYMBOL(pci_domain_nr);
 /* Decide whether to display the domain number in /proc */
 int pci_proc_domain(struct pci_bus *bus)
 {
-#ifdef CONFIG_PPC_ISERIES
-	return 0;
-#else
-	struct pci_controller *hose = pci_bus_to_host(bus);
-	return hose->buid;
-#endif
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return 0;
+	else {
+		struct pci_controller *hose = pci_bus_to_host(bus);
+		return hose->buid;
+	}
 }
 
 /*
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 3eb1206..e904b36 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -262,10 +262,6 @@ void __init iSeries_pci_final_fixup(void
 	mf_display_src(0xC9000200);
 }
 
-void pcibios_fixup_bus(struct pci_bus *PciBus)
-{
-}
-
 void pcibios_fixup_resources(struct pci_dev *pdev)
 {
 }
-- 
1.4.2.1

^ permalink raw reply related

* [PATCH 4/7] [POWERPC] fix ioremap for a combined kernel
From: Stephen Rothwell @ 2006-09-26  3:37 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev
In-Reply-To: <20060926133651.897ad602.sfr@canb.auug.org.au>

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/mm/pgtable_64.c |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index b1da031..ac64f4a 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -63,32 +63,13 @@ #include <asm/system.h>
 #include <asm/iommu.h>
 #include <asm/abs_addr.h>
 #include <asm/vdso.h>
+#include <asm/firmware.h>
 
 #include "mmu_decl.h"
 
 unsigned long ioremap_bot = IMALLOC_BASE;
 static unsigned long phbs_io_bot = PHBS_IO_BASE;
 
-#ifdef CONFIG_PPC_ISERIES
-
-void __iomem *ioremap(unsigned long addr, unsigned long size)
-{
-	return (void __iomem *)addr;
-}
-
-extern void __iomem *__ioremap(unsigned long addr, unsigned long size,
-		       unsigned long flags)
-{
-	return (void __iomem *)addr;
-}
-
-void iounmap(volatile void __iomem *addr)
-{
-	return;
-}
-
-#else
-
 /*
  * map_io_page currently only called by __ioremap
  * map_io_page adds an entry to the ioremap page table
@@ -161,6 +142,9 @@ void __iomem * __ioremap(unsigned long a
 	unsigned long pa, ea;
 	void __iomem *ret;
 
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return (void __iomem *)addr;
+
 	/*
 	 * Choose an address to map it to.
 	 * Once the imalloc system is running, we use it.
@@ -255,6 +239,9 @@ void iounmap(volatile void __iomem *toke
 {
 	void *addr;
 
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return;
+
 	if (!mem_init_done)
 		return;
 	
@@ -315,8 +302,6 @@ int iounmap_explicit(volatile void __iom
 	return 0;
 }
 
-#endif
-
 EXPORT_SYMBOL(ioremap);
 EXPORT_SYMBOL(__ioremap);
 EXPORT_SYMBOL(iounmap);
-- 
1.4.2.1

^ permalink raw reply related

* [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build
From: Stephen Rothwell @ 2006-09-26  3:39 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev
In-Reply-To: <20060926133756.071a981f.sfr@canb.auug.org.au>

This will build with ISERIES, PSERIES and PMAC64 selected, but will only
boot on iSeries so far.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/Kconfig |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index de1ef2f..a715b28 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -328,20 +328,10 @@ menu "Platform support"
 	depends on PPC64 || CLASSIC32
 
 choice
+	depends on PPC32
 	prompt "Machine type"
 	default PPC_MULTIPLATFORM
 
-config PPC_MULTIPLATFORM
-	bool "Generic desktop/server/laptop"
-	help
-	  Select this option if configuring for an IBM pSeries or
-	  RS/6000 machine, an Apple machine, or a PReP, CHRP,
-	  Maple or Cell-based machine.
-
-config PPC_ISERIES
-	bool "IBM Legacy iSeries"
-	depends on PPC64
-
 config EMBEDDED6xx
 	bool "Embedded 6xx/7xx/7xxx-based board"
 	depends on PPC32 && (BROKEN||BROKEN_ON_SMP)
@@ -355,6 +345,10 @@ config APUS
 	  <http://linux-apus.sourceforge.net/>.
 endchoice
 
+config PPC_MULTIPLATFORM
+	depends on PPC64
+	def_bool y
+
 config PPC_PSERIES
 	depends on PPC_MULTIPLATFORM && PPC64
 	bool "IBM pSeries & new (POWER5-based) iSeries"
@@ -365,6 +359,10 @@ config PPC_PSERIES
 	select PPC_UDBG_16550
 	default y
 
+config PPC_ISERIES
+	bool "IBM Legacy iSeries"
+	depends on PPC_MULTIPLATFORM && PPC64
+
 config PPC_CHRP
 	bool "Common Hardware Reference Platform (CHRP) based machines"
 	depends on PPC_MULTIPLATFORM && PPC32
-- 
1.4.2.1

^ permalink raw reply related

* [PATCH 6/7] [POWERPC] iSeries does not need pcibios_fixup_resources
From: Stephen Rothwell @ 2006-09-26  3:40 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev
In-Reply-To: <20060926133910.23948614.sfr@canb.auug.org.au>

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/platforms/iseries/pci.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index e904b36..4aa165e 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -262,10 +262,6 @@ void __init iSeries_pci_final_fixup(void
 	mf_display_src(0xC9000200);
 }
 
-void pcibios_fixup_resources(struct pci_dev *pdev)
-{
-}
-
 /*
  * Look down the chain to find the matching Device Device
  */
-- 
1.4.2.1

^ permalink raw reply related

* [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION
From: Stephen Rothwell @ 2006-09-26  3:42 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev
In-Reply-To: <20060926134008.45905bff.sfr@canb.auug.org.au>

and use it an all the obvious places in assembler code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/entry_64.S    |   18 +++++++---
 arch/powerpc/kernel/head_64.S     |   28 ++++++++++++++-
 arch/powerpc/kernel/misc_64.S     |   46 +++++++++++++++++++++++++
 arch/powerpc/kernel/vmlinux.lds.S |    8 ++++
 arch/powerpc/mm/slb_low.S         |    3 ++
 include/asm-powerpc/firmware.h    |   67 ++++++++++++++++++++++++-------------
 6 files changed, 137 insertions(+), 33 deletions(-)

This has been booted as a combined kernel on iSeries (and also as just an
iSeries build).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 2cd872b..748e74f 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -27,10 +27,7 @@ #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/cputable.h>
-
-#ifdef CONFIG_PPC_ISERIES
-#define DO_SOFT_DISABLE
-#endif
+#include <asm/firmware.h>
 
 /*
  * System calls.
@@ -91,6 +88,7 @@ system_call_common:
 	ld	r11,exception_marker@toc(r2)
 	std	r11,-16(r9)		/* "regshere" marker */
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	/* Hack for handling interrupts when soft-enabling on iSeries */
 	cmpdi	cr1,r0,0x5555		/* syscall 0x5555 */
 	andi.	r10,r12,MSR_PR		/* from kernel */
@@ -98,6 +96,7 @@ #ifdef CONFIG_PPC_ISERIES
 	beq	hardware_interrupt_entry
 	lbz	r10,PACAPROCENABLED(r13)
 	std	r10,SOFTE(r1)
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 	mfmsr	r11
 	ori	r11,r11,MSR_EE
@@ -462,6 +461,7 @@ #endif
 
 restore:
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	ld	r5,SOFTE(r1)
 	cmpdi	0,r5,0
 	beq	4f
@@ -480,6 +480,7 @@ #ifdef CONFIG_PPC_ISERIES
 	b	.ret_from_except_lite		/* loop back and handle more */
 
 4:	stb	r5,PACAPROCENABLED(r13)
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 
 	ld	r3,_MSR(r1)
@@ -538,18 +539,23 @@ #ifdef CONFIG_PREEMPT
 	lwz	r8,TI_PREEMPT(r9)
 	cmpwi	cr1,r8,0
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	ld	r0,SOFTE(r1)
 	cmpdi	r0,0
-#else
-	andi.	r0,r3,MSR_EE
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
+BEGIN_FW_FTR_SECTION
+	andi.	r0,r3,MSR_EE
+END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
 	crandc	eq,cr1*4+eq,eq
 	bne	restore
 	/* here we are preempting the current task */
 1:
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	li	r0,1
 	stb	r0,PACAPROCENABLED(r13)
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 	ori	r10,r10,MSR_EE
 	mtmsrd	r10,1		/* reenable interrupts */
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 3065b47..645c7f1 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -33,6 +33,7 @@ #include <asm/setup.h>
 #include <asm/hvcall.h>
 #include <asm/iseries/lpar_map.h>
 #include <asm/thread_info.h>
+#include <asm/firmware.h>
 
 #ifdef CONFIG_PPC_ISERIES
 #define DO_SOFT_DISABLE
@@ -365,19 +366,28 @@ label##_iSeries:							\
 
 #ifdef DO_SOFT_DISABLE
 #define DISABLE_INTS				\
+BEGIN_FW_FTR_SECTION;				\
 	lbz	r10,PACAPROCENABLED(r13);	\
 	li	r11,0;				\
 	std	r10,SOFTE(r1);			\
 	mfmsr	r10;				\
 	stb	r11,PACAPROCENABLED(r13);	\
 	ori	r10,r10,MSR_EE;			\
-	mtmsrd	r10,1
+	mtmsrd	r10,1;				\
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 
 #define ENABLE_INTS				\
+BEGIN_FW_FTR_SECTION;				\
 	lbz	r10,PACAPROCENABLED(r13);	\
 	mfmsr	r11;				\
 	std	r10,SOFTE(r1);			\
 	ori	r11,r11,MSR_EE;			\
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES);	\
+BEGIN_FW_FTR_SECTION;				\
+	ld	r12,_MSR(r1);			\
+	mfmsr	r11;				\
+	rlwimi	r11,r12,0,MSR_EE;		\
+END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES);	\
 	mtmsrd	r11,1
 
 #else	/* hard enable/disable interrupts */
@@ -1071,8 +1081,10 @@ _GLOBAL(slb_miss_realmode)
 	ld	r3,PACA_EXSLB+EX_R3(r13)
 	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	ld	r11,PACALPPACAPTR(r13)
 	ld	r11,LPPACASRR0(r11)		/* get SRR0 value */
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif /* CONFIG_PPC_ISERIES */
 
 	mtlr	r10
@@ -1087,8 +1099,10 @@ #endif /* CONFIG_PPC_ISERIES */
 .machine	pop
 
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	mtspr	SPRN_SRR0,r11
 	mtspr	SPRN_SRR1,r12
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif /* CONFIG_PPC_ISERIES */
 	ld	r9,PACA_EXSLB+EX_R9(r13)
 	ld	r10,PACA_EXSLB+EX_R10(r13)
@@ -1301,6 +1315,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 	cmpdi	r3,0			/* see if hash_page succeeded */
 
 #ifdef DO_SOFT_DISABLE
+BEGIN_FW_FTR_SECTION
 	/*
 	 * If we had interrupts soft-enabled at the point where the
 	 * DSI/ISI occurred, and an interrupt came in during hash_page,
@@ -1321,12 +1336,14 @@ #ifdef DO_SOFT_DISABLE
 	ld	r3,SOFTE(r1)
 	bl	.local_irq_restore
 	b	11f
-#else
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
+#endif
+BEGIN_FW_FTR_SECTION
 	beq	fast_exception_return   /* Return from exception on success */
 	ble-	12f			/* Failure return from hash_page */
 
 	/* fall through */
-#endif
+END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
 
 /* Here we have a page fault that hash_page can't handle. */
 _GLOBAL(handle_page_fault)
@@ -1861,7 +1878,9 @@ _GLOBAL(__secondary_start)
 	LOAD_REG_ADDR(r3, .start_secondary_prolog)
 	LOAD_REG_IMMEDIATE(r4, MSR_KERNEL)
 #ifdef DO_SOFT_DISABLE
+BEGIN_FW_FTR_SECTION
 	ori	r4,r4,MSR_EE
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 	mtspr	SPRN_SRR0,r3
 	mtspr	SPRN_SRR1,r4
@@ -1986,6 +2005,7 @@ _STATIC(start_here_common)
 	 */
 	li	r3,0
 	bl	.do_cpu_ftr_fixups
+	bl	.do_fw_ftr_fixups
 
 	/* ptr to current */
 	LOAD_REG_IMMEDIATE(r4, init_task)
@@ -2000,11 +2020,13 @@ _STATIC(start_here_common)
 	/* Load up the kernel context */
 5:
 #ifdef DO_SOFT_DISABLE
+BEGIN_FW_FTR_SECTION
 	li	r5,0
 	stb	r5,PACAPROCENABLED(r13)	/* Soft Disabled */
 	mfmsr	r5
 	ori	r5,r5,MSR_EE		/* Hard Enabled */
 	mtmsrd	r5
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 
 	bl .start_kernel
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index e3ed21c..465a764 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -325,6 +325,52 @@ _GLOBAL(do_cpu_ftr_fixups)
 	isync
 	b	1b
 
+/*
+ * do_fw_ftr_fixups - goes through the list of firmware feature fixups
+ * and writes nop's over sections of code that don't apply for this firmware.
+ * r3 = data offset (not changed)
+ */
+_GLOBAL(do_fw_ftr_fixups)
+	/* Get firmware features */
+	LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features)
+	sub	r6,r6,r3
+	ld	r4,0(r6)
+	/* Get the fixup table */
+	LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup)
+	sub	r6,r6,r3
+	LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup)
+	sub	r7,r7,r3
+	/* Do the fixup */
+1:	cmpld	r6,r7
+	bgelr
+	addi	r6,r6,32
+	ld	r8,-32(r6)	/* mask */
+	and	r8,r8,r4
+	ld	r9,-24(r6)	/* value */
+	cmpld	r8,r9
+	beq	1b
+	ld	r8,-16(r6)	/* section begin */
+	ld	r9,-8(r6)	/* section end */
+	subf.	r9,r8,r9
+	beq	1b
+	/* write nops over the section of code */
+	/* todo: if large section, add a branch at the start of it */
+	srwi	r9,r9,2
+	mtctr	r9
+	sub	r8,r8,r3
+	lis	r0,0x60000000@h	/* nop */
+3:	stw	r0,0(r8)
+BEGIN_FTR_SECTION
+	dcbst	0,r8		/* suboptimal, but simpler */
+	sync
+	icbi	0,r8
+END_FTR_SECTION_IFSET(CPU_FTR_SPLIT_ID_CACHE)
+	addi	r8,r8,4
+	bdnz	3b
+	sync			/* additional sync needed on g4 */
+	isync
+	b	1b
+
 #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
 /*
  * Do an IO access in real mode
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 02665a0..cb0e8d4 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -132,6 +132,14 @@ #endif
 		*(__ftr_fixup)
 		__stop___ftr_fixup = .;
 	}
+#ifdef CONFIG_PPC64
+	. = ALIGN(8);
+	__fw_ftr_fixup : {
+		__start___fw_ftr_fixup = .;
+		*(__fw_ftr_fixup)
+		__stop___fw_ftr_fixup = .;
+	}
+#endif
 
 	. = ALIGN(PAGE_SIZE);
 	.init.ramfs : {
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index dbc1abb..b10e470 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -21,6 +21,7 @@ #include <asm/cputable.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/pgtable.h>
+#include <asm/firmware.h>
 
 /* void slb_allocate_realmode(unsigned long ea);
  *
@@ -183,6 +184,7 @@ slb_finish_load:
  	 * dont have any LRU information to help us choose a slot.
  	 */
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	/*
 	 * On iSeries, the "bolted" stack segment can be cast out on
 	 * shared processor switch so we need to check for a miss on
@@ -194,6 +196,7 @@ #ifdef CONFIG_PPC_ISERIES
 	li	r10,SLB_NUM_BOLTED-1	/* Stack goes in last bolted slot */
 	cmpld	r9,r3
 	beq	3f
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif /* CONFIG_PPC_ISERIES */
 
 	ld	r10,PACASTABRR(r13)
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h
index 77069df..1022737 100644
--- a/include/asm-powerpc/firmware.h
+++ b/include/asm-powerpc/firmware.h
@@ -14,34 +14,36 @@ #define __ASM_POWERPC_FIRMWARE_H
 
 #ifdef __KERNEL__
 
-#ifndef __ASSEMBLY__
+#include <asm/asm-compat.h>
 
 /* firmware feature bitmask values */
 #define FIRMWARE_MAX_FEATURES 63
 
-#define FW_FEATURE_PFT		(1UL<<0)
-#define FW_FEATURE_TCE		(1UL<<1)
-#define FW_FEATURE_SPRG0	(1UL<<2)
-#define FW_FEATURE_DABR		(1UL<<3)
-#define FW_FEATURE_COPY		(1UL<<4)
-#define FW_FEATURE_ASR		(1UL<<5)
-#define FW_FEATURE_DEBUG	(1UL<<6)
-#define FW_FEATURE_TERM		(1UL<<7)
-#define FW_FEATURE_PERF		(1UL<<8)
-#define FW_FEATURE_DUMP		(1UL<<9)
-#define FW_FEATURE_INTERRUPT	(1UL<<10)
-#define FW_FEATURE_MIGRATE	(1UL<<11)
-#define FW_FEATURE_PERFMON	(1UL<<12)
-#define FW_FEATURE_CRQ		(1UL<<13)
-#define FW_FEATURE_VIO		(1UL<<14)
-#define FW_FEATURE_RDMA		(1UL<<15)
-#define FW_FEATURE_LLAN		(1UL<<16)
-#define FW_FEATURE_BULK		(1UL<<17)
-#define FW_FEATURE_XDABR	(1UL<<18)
-#define FW_FEATURE_MULTITCE	(1UL<<19)
-#define FW_FEATURE_SPLPAR	(1UL<<20)
-#define FW_FEATURE_ISERIES	(1UL<<21)
-#define FW_FEATURE_LPAR		(1UL<<22)
+#define FW_FEATURE_PFT		ASM_CONST(0x0000000000000001)
+#define FW_FEATURE_TCE		ASM_CONST(0x0000000000000002)
+#define FW_FEATURE_SPRG0	ASM_CONST(0x0000000000000004)
+#define FW_FEATURE_DABR		ASM_CONST(0x0000000000000008)
+#define FW_FEATURE_COPY		ASM_CONST(0x0000000000000010)
+#define FW_FEATURE_ASR		ASM_CONST(0x0000000000000020)
+#define FW_FEATURE_DEBUG	ASM_CONST(0x0000000000000040)
+#define FW_FEATURE_TERM		ASM_CONST(0x0000000000000080)
+#define FW_FEATURE_PERF		ASM_CONST(0x0000000000000100)
+#define FW_FEATURE_DUMP		ASM_CONST(0x0000000000000200)
+#define FW_FEATURE_INTERRUPT	ASM_CONST(0x0000000000000400)
+#define FW_FEATURE_MIGRATE	ASM_CONST(0x0000000000000800)
+#define FW_FEATURE_PERFMON	ASM_CONST(0x0000000000001000)
+#define FW_FEATURE_CRQ		ASM_CONST(0x0000000000002000)
+#define FW_FEATURE_VIO		ASM_CONST(0x0000000000004000)
+#define FW_FEATURE_RDMA		ASM_CONST(0x0000000000008000)
+#define FW_FEATURE_LLAN		ASM_CONST(0x0000000000010000)
+#define FW_FEATURE_BULK		ASM_CONST(0x0000000000020000)
+#define FW_FEATURE_XDABR	ASM_CONST(0x0000000000040000)
+#define FW_FEATURE_MULTITCE	ASM_CONST(0x0000000000080000)
+#define FW_FEATURE_SPLPAR	ASM_CONST(0x0000000000100000)
+#define FW_FEATURE_ISERIES	ASM_CONST(0x0000000000200000)
+#define FW_FEATURE_LPAR		ASM_CONST(0x0000000000400000)
+
+#ifndef __ASSEMBLY__
 
 enum {
 #ifdef CONFIG_PPC64
@@ -94,6 +96,23 @@ extern void machine_check_fwnmi(void);
 /* This is true if we are using the firmware NMI handler (typically LPAR) */
 extern int fwnmi_active;
 
+#else /* __ASSEMBLY__ */
+
+#define BEGIN_FW_FTR_SECTION		96:
+
+#define END_FW_FTR_SECTION(msk, val)		\
+97:						\
+	.section __fw_ftr_fixup,"a";		\
+	.align 3;				\
+	.llong msk;				\
+	.llong val;				\
+	.llong 96b;				\
+	.llong 97b;				\
+	.previous
+
+#define END_FW_FTR_SECTION_IFSET(msk)	END_FW_FTR_SECTION((msk), (msk))
+#define END_FW_FTR_SECTION_IFCLR(msk)	END_FW_FTR_SECTION((msk), 0)
+
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* __ASM_POWERPC_FIRMWARE_H */
-- 
1.4.2.1

^ permalink raw reply related

* [POWERPC] iSeries has no legacy I/O
From: Stephen Rothwell @ 2006-09-26  3:57 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/platforms/iseries/setup.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 7cb6b5f..a0ff7ba 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -649,6 +649,15 @@ #ifndef CONFIG_PCI
 void __init iSeries_init_IRQ(void) { }
 #endif
 
+/*
+ * iSeries has no legacy IO, anything calling this function has to
+ * fail or bad things will happen
+ */
+static int iseries_check_legacy_ioport(unsigned int baseport)
+{
+	return -ENODEV;
+}
+
 static int __init iseries_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
@@ -677,6 +686,7 @@ define_machine(iseries) {
 	.calibrate_decr	= generic_calibrate_decr,
 	.progress	= iSeries_progress,
 	.probe		= iseries_probe,
+	.check_legacy_ioport	= iseries_check_legacy_ioport,
 	/* XXX Implement enable_pmcs for iSeries */
 };
 
-- 
1.4.2.1

^ 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