LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Clock running fast on Mac Mini?
From: Brent Cook @ 2006-04-24 22:06 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <E1FY8kd-0000mH-PO@owl.grunz.lu>

On Monday 24 April 2006 16:37, Mich Lanners wrote:
> Hello all,
>
> I have a problem on my Mac Mini with the kernel clock, which is running
> fast.
>
> In fact, it is gaining 10 ms every 5 seconds, as can be seen here, with
> ntpdate called every 5 seconds:
>

I can confirm this. I can also trigger make's 'File has future modification 
date' warning message when compiling a file on the local filesystem.

 - Brent

^ permalink raw reply

* [PATCH] Use check_legacy_ioport() on ppc32 too.
From: David Woodhouse @ 2006-04-24 22:22 UTC (permalink / raw)
  To: paulus, benh; +Cc: linuxppc-dev

Some people report that we die on some Macs when we are expecting to
catch machine checks after poking at some random I/O address. I'd seen
it happen on my dual G4 with serial ports until we fixed those to use
OF, but now other users are reporting it with i8042.

This expands the use of check_legacy_ioport() to avoid that situation
even on 32-bit kernels.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 1d93e73..684ab1d 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -516,3 +516,11 @@ void probe_machine(void)
 
 	printk(KERN_INFO "Using %s machine description\n", ppc_md.name);
 }
+
+int check_legacy_ioport(unsigned long base_port)
+{
+	if (ppc_md.check_legacy_ioport == NULL)
+		return 0;
+	return ppc_md.check_legacy_ioport(base_port);
+}
+EXPORT_SYMBOL(check_legacy_ioport);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 13e91c4..4467c49 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -594,14 +594,6 @@ void ppc64_terminate_msg(unsigned int sr
 	printk("[terminate]%04x %s\n", src, msg);
 }
 
-int check_legacy_ioport(unsigned long base_port)
-{
-	if (ppc_md.check_legacy_ioport == NULL)
-		return 0;
-	return ppc_md.check_legacy_ioport(base_port);
-}
-EXPORT_SYMBOL(check_legacy_ioport);
-
 void cpu_die(void)
 {
 	if (ppc_md.cpu_die)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index bedb689..dff1e67 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4301,7 +4301,7 @@ #endif
 	}
 
 	use_virtual_dma = can_use_virtual_dma & 1;
-#if defined(CONFIG_PPC64)
+#if defined(CONFIG_PPC_MERGE)
 	if (check_legacy_ioport(FDC1)) {
 		del_timer(&fd_timeout);
 		err = -ENODEV;
diff --git a/drivers/input/serio/i8042-io.h b/drivers/input/serio/i8042-io.h
index 9a92216..cc21914 100644
--- a/drivers/input/serio/i8042-io.h
+++ b/drivers/input/serio/i8042-io.h
@@ -67,14 +67,14 @@ static inline int i8042_platform_init(vo
  * On some platforms touching the i8042 data register region can do really
  * bad things. Because of this the region is always reserved on such boxes.
  */
-#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) && !defined(CONFIG_PPC64)
+#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) && !defined(CONFIG_PPC_MERGE)
 	if (!request_region(I8042_DATA_REG, 16, "i8042"))
 		return -EBUSY;
 #endif
 
         i8042_reset = 1;
 
-#if defined(CONFIG_PPC64)
+#if defined(CONFIG_PPC_MERGE)
 	if (check_legacy_ioport(I8042_DATA_REG))
 		return -EBUSY;
 	if (!request_region(I8042_DATA_REG, 16, "i8042"))
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 68efbea..f1c2469 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -9,6 +9,9 @@ #ifdef __KERNEL__
  * 2 of the License, or (at your option) any later version.
  */
 
+/* Check of existence of legacy devices */
+extern int check_legacy_ioport(unsigned long base_port);
+
 #ifndef CONFIG_PPC64
 #include <asm-ppc/io.h>
 #else
@@ -437,9 +440,6 @@ #define dma_cache_inv(_start,_size)		do 
 #define dma_cache_wback(_start,_size)		do { } while (0)
 #define dma_cache_wback_inv(_start,_size)	do { } while (0)
 
-/* Check of existence of legacy devices */
-extern int check_legacy_ioport(unsigned long base_port);
-
 
 /*
  * Convert a physical pointer to a virtual kernel pointer for /dev/mem

-- 
dwmw2

^ permalink raw reply related

* Re: 85xx FDT updates?
From: Dan Malek @ 2006-04-24 22:31 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <4C61B597-BD91-4D05-BB40-43DE0319F123@kernel.crashing.org>


On Apr 24, 2006, at 5:43 PM, Kumar Gala wrote:

> However, I am against removing the arch/ppc support until the u-boot
> patches are picked up.  I think its bad form to give people a kernel
> they can't easily boot.

What about systems that can't update u-boot, but want to run
a newer kernel?


	-- Dan

^ permalink raw reply

* [PATCH] Wire up *at syscalls
From: Andreas Schwab @ 2006-04-24 22:43 UTC (permalink / raw)
  To: linuxppc-dev

This patch has been tested on ppc64 (using glibc's testsuite, both 32bit
and 64bit), and compile-tested for ppc32 (I have currently no ppc32 system
available, but I expect no problems).

Signed-off-by: Andreas Schwab <schwab@suse.de>

---
 arch/powerpc/kernel/systbl.S                |   13 +++++++++++++
 arch/powerpc/platforms/cell/spu_callbacks.c |   13 +++++++++++++
 fs/stat.c                                   |    2 --
 include/asm-powerpc/unistd.h                |   19 ++++++++++++++++++-
 4 files changed, 44 insertions(+), 3 deletions(-)

Index: linux-2.6.17-rc2-git5/arch/powerpc/kernel/systbl.S
===================================================================
--- linux-2.6.17-rc2-git5.orig/arch/powerpc/kernel/systbl.S	2006-04-24 16:24:47.000000000 +0200
+++ linux-2.6.17-rc2-git5/arch/powerpc/kernel/systbl.S	2006-04-24 19:53:50.000000000 +0200
@@ -324,6 +324,19 @@ COMPAT_SYS(ppoll)
 SYSCALL(unshare)
 SYSCALL(splice)
 SYSCALL(tee)
+COMPAT_SYS(openat)
+SYSCALL(mkdirat)
+SYSCALL(mknodat)
+SYSCALL(fchownat)
+COMPAT_SYS(futimesat)
+SYSX(sys_newfstatat, sys_fstatat64, sys_fstatat64)
+SYSCALL(unlinkat)
+SYSCALL(renameat)
+SYSCALL(linkat)
+SYSCALL(symlinkat)
+SYSCALL(readlinkat)
+SYSCALL(fchmodat)
+SYSCALL(faccessat)
 
 /*
  * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c
Index: linux-2.6.17-rc2-git5/include/asm-powerpc/unistd.h
===================================================================
--- linux-2.6.17-rc2-git5.orig/include/asm-powerpc/unistd.h	2006-04-24 16:24:15.000000000 +0200
+++ linux-2.6.17-rc2-git5/include/asm-powerpc/unistd.h	2006-04-24 18:06:53.000000000 +0200
@@ -303,8 +303,25 @@
 #define __NR_unshare		282
 #define __NR_splice		283
 #define __NR_tee		284
+#define __NR_openat		285
+#define __NR_mkdirat		286
+#define __NR_mknodat		287
+#define __NR_fchownat		288
+#define __NR_futimesat		289
+#ifdef __powerpc64__
+#define __NR_newfstatat		290
+#else
+#define __NR_fstatat64		290
+#endif
+#define __NR_unlinkat		291
+#define __NR_renameat		292
+#define __NR_linkat		293
+#define __NR_symlinkat		294
+#define __NR_readlinkat		295
+#define __NR_fchmodat		296
+#define __NR_faccessat		297
 
-#define __NR_syscalls		285
+#define __NR_syscalls		298
 
 #ifdef __KERNEL__
 #define __NR__exit __NR_exit
Index: linux-2.6.17-rc2-git5/arch/powerpc/platforms/cell/spu_callbacks.c
===================================================================
--- linux-2.6.17-rc2-git5.orig/arch/powerpc/platforms/cell/spu_callbacks.c	2006-04-24 16:24:47.000000000 +0200
+++ linux-2.6.17-rc2-git5/arch/powerpc/platforms/cell/spu_callbacks.c	2006-04-24 18:07:59.000000000 +0200
@@ -318,6 +318,19 @@ void *spu_syscall_table[] = {
 	[__NR_unshare]			sys_unshare,
 	[__NR_splice]			sys_splice,
 	[__NR_tee]			sys_tee,
+	[__NR_openat]			sys_openat,
+	[__NR_mkdirat]			sys_mkdirat,
+	[__NR_mknodat]			sys_mknodat,
+	[__NR_fchownat]			sys_fchownat,
+	[__NR_futimesat]		sys_futimesat,
+	[__NR_newfstatat]		sys_newfstatat,
+	[__NR_unlinkat]			sys_unlinkat,
+	[__NR_renameat]			sys_renameat,
+	[__NR_linkat]			sys_linkat,
+	[__NR_symlinkat]		sys_symlinkat,
+	[__NR_readlinkat]		sys_readlinkat,
+	[__NR_fchmodat]			sys_fchmodat,
+	[__NR_faccessat]		sys_faccessat,
 };
 
 long spu_sys_callback(struct spu_syscall_block *s)
Index: linux-2.6.17-rc2-git5/fs/stat.c
===================================================================
--- linux-2.6.17-rc2-git5.orig/fs/stat.c	2006-04-24 18:05:23.000000000 +0200
+++ linux-2.6.17-rc2-git5/fs/stat.c	2006-04-24 18:05:44.000000000 +0200
@@ -261,7 +261,6 @@ asmlinkage long sys_newlstat(char __user
 	return error;
 }
 
-#ifndef __ARCH_WANT_STAT64
 asmlinkage long sys_newfstatat(int dfd, char __user *filename,
 				struct stat __user *statbuf, int flag)
 {
@@ -282,7 +281,6 @@ asmlinkage long sys_newfstatat(int dfd, 
 out:
 	return error;
 }
-#endif
 
 asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf)
 {

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: Xilinx Virtex-2 PRO FPGA ppc 405 on ML310 board
From: Aidan Williams @ 2006-04-24 23:02 UTC (permalink / raw)
  To: Vincent Winstead; +Cc: linuxppc-embedded list
In-Reply-To: <20060424203047.86885.qmail@web52005.mail.yahoo.com>


After generating a new auto-config.in using the BSP,
you'll need to:

   0. put new auto-config.in into kernel directory
      linux-2.4.x/arch/ppc/platforms/xilinx_auto

   1. change to the top uClinux-dist directory
      (*NOT* the kernel directory)

   2. In "Vendor/Product Selection  --->"
      Choose "Xilinx"
      Choose "powerpc-auto"

   3. In "Kernel/Library/Defaults Selection  --->"
      Choose linux-2.4.x as your kernel, making sure that
      this is a symlink to or copy of the linuxppc-2.4
      tarball from UQ.

   4. In "Kernel/Library/Defaults Selection  --->"
      Choose "[*] Default all settings (lose changes)"

   5. Save and quit..

This process will pull in default Xilinx/powerpc config
files from vendors/Xilinx/powerpc-auto/config.*
for the kernel and for other uClinux components.

It will also generate a new linux-2.4.x/.config
based on your auto-config.in and the defaults
in vendors/Xilinx/powerpc-auto/config.linux-2.4.x.

btw, I don't have an ML310 board.  I have however gotten
the UQ kernel + uclinux to work on a v2pro FF1152 board
and a virtex-4 FX-12 minimodule.

another btw, the linuxppc-2.4 code has an auto-config.in
inside it which, if you follow the above steps (without
doing step 0), should compile.  The supplied auto-config.in
won't match your board, but it should at least compile.

- aidan


Vincent Winstead wrote:
> guess what - I got the BSP to work!  But now I have a problem with the 
> make command.  I put the auto-config.in where it needs to be then I did 
> a make menuconfig to configure it, then I did a make dep, but when I did 
> a make is when  an error came up that I can't seem to figure out:
> 
> In file included from 
> /home/ml310_linux/uClinux-dist/linuxppc-2.4/include/linux/pagemap.h:16,
>                  from 
> /home/ml310_linux/uClinux-dist/linuxppc-2.4/include/linux/locks.h:8,
>                  from 
> /home/ml310_linux/uClinux-dist/linuxppc-2.4/include/linux/blk.h:5,
>                  from init/main.c:25:
> /home/ml310_linux/uClinux-dist/linuxppc-2.4/include/linux/highmem.h: In 
> function `kmap':
> /home/ml310_linux/uClinux-dist/linuxppc-2.4/include/linux/highmem.h:68: 
> error: `CONFIG_KERNEL_START' undeclared (first use in this function)
> init/main.c: In function `start_kernel':
> init/main.c:393: error: `CONFIG_KERNEL_START' undeclared (first use in 
> this function)
> make[1]: *** [init/main.o] Error 1
> make[1]: Leaving directory `/home/ml310_linux/uClinux-dist/linuxppc-2.4'
> make: *** [linux] Error 1
> 
> This CONFIG_KERNEL_START is the problem.  It doesn't seem to be defined 
> anywhere and I guess it needs to be.  Is this something I need to get 
> from somewhere?  Or is it maybe generated along with the BSP so I would 
> have to put a start number into the platform Studio configuration?
> 
> -Vincent
> 
> 
> */Aidan Williams /* wrote:
> 
> 
>     Vincent Winstead wrote:
>      > Now, as far as step 5, am I supposed to have a symbolic link that is
>      > named linux-2.4.x placed into the uClinux-dist directory? Because
>      > there's already a folder named linux-2.4.x which was in there
>     already
>      > when I untarred everything. At the command prompt in the
>     uClinux-dist
>      > directory I entered the following line:
>      >
>      > ln -s ../linuxppc-2.4 linux-2.4.x
>      >
>      > and the result of this operation was to put a symbolic link into my
>      > linuxppc-2.4 directory with the name of linux-2.4.x - is this
>     correct?
>      >
> 
>     First, you'll need to move the existing directory aside using
>     a command like:
> 
>     mv linux-2.4.x linux-2.4.x-dist
> 
>     and then re-run the ln -s command above.
> 
>      > Now on to Step 6 problem.
>      > How am I supposed to make use uClinux EDK Board Support Package 1.0
>      > files? I'm not sure how to go about using them in the Xilinx
>     Platform
>      > Studio in order to generate the necessary auto-config.in file.
>      >
> 
>     See the document below for the general approach:
> 
>      > Even though it is about the microblaze rather than
>      > the PPC, a helpful "getting started" document is:
>      >
>     http://www.itee.uq.edu.au/~wu/downloads/uClinux_ready_Microblaze_design.pdf
>      >
> 
>     Look particularly at the section "Software Platform Settings"
>     on page 29, steps 67,68.
> 
>     If you are not overly familiar with the EDK, it would
>     be best to find someone locally who can help walk you
>     through the process of generating a system.
> 
>     - aidan
> 
> 
>     --------------------------------------------------------------------------
>     This email and any attachments may be confidential. They may contain
>     legally
>     privileged information or copyright material. You should not read, copy,
>     use or disclose them without authorisation. If you are not an intended
>     recipient, please contact us at once by return email and then delete
>     both
>     messages. We do not accept liability in connection with computer virus,
>     data corruption, delay, interruption, unauthorised access or
>     unauthorised
>     amendment. This notice should not be removed.
> 
> 

^ permalink raw reply

* Re: alignment exceptionhandler sleeps in invalid context
From: Paul Mackerras @ 2006-04-24 23:12 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linuxppc-dev
In-Reply-To: <20060424173246.GA22318@suse.de>

Olaf Hering writes:

> I'm not sure where the bug is. Does it mean the network stack does
> something nasty, or is the exception handler itself broken? (probably the latter)
> This is 2.6.16.9 on a p270.

The alignment handler does a get_user to read the instruction.  I
suppose it will have to read the instruction directly if the exception
occurred in kernel mode.

Paul.

^ permalink raw reply

* Re: [PATCH] Wire up *at syscalls
From: Arnd Bergmann @ 2006-04-24 23:31 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <jeu08ippb9.fsf@sykes.suse.de>

QW0gVHVlc2RheSAyNSBBcHJpbCAyMDA2IDAwOjQzIHNjaHJpZWIgQW5kcmVhcyBTY2h3YWI6Cj4g
SW5kZXg6IGxpbnV4LTIuNi4xNy1yYzItZ2l0NS9hcmNoL3Bvd2VycGMvcGxhdGZvcm1zL2NlbGwv
c3B1X2NhbGxiYWNrcy5jCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQo+IC0tLQo+IGxpbnV4LTIuNi4xNy1yYzItZ2l0
NS5vcmlnL2FyY2gvcG93ZXJwYy9wbGF0Zm9ybXMvY2VsbC9zcHVfY2FsbGJhY2tzLmOgoKCgoAo+
oDIwMDYtMDQtMjQgMTY6MjQ6NDcuMDAwMDAwMDAwICswMjAwICsrKwo+IGxpbnV4LTIuNi4xNy1y
YzItZ2l0NS9hcmNoL3Bvd2VycGMvcGxhdGZvcm1zL2NlbGwvc3B1X2NhbGxiYWNrcy5joKCgMjAw
Ni0wNAo+LTI0IDE4OjA3OjU5LjAwMDAwMDAwMCArMDIwMCBAQCAtMzE4LDYgKzMxOCwxOSBAQCB2
b2lkICpzcHVfc3lzY2FsbF90YWJsZVtdCj4gPSB7Cj4goKCgoKCgoKBbX19OUl91bnNoYXJlXaCg
oKCgoKCgoKCgoKCgoKCgoHN5c191bnNoYXJlLAo+IKCgoKCgoKCgW19fTlJfc3BsaWNlXaCgoKCg
oKCgoKCgoKCgoKCgoKBzeXNfc3BsaWNlLAo+IKCgoKCgoKCgW19fTlJfdGVlXaCgoKCgoKCgoKCg
oKCgoKCgoKCgoKBzeXNfdGVlLAo+ICugoKCgoKCgW19fTlJfb3BlbmF0XaCgoKCgoKCgoKCgoKCg
oKCgoKBzeXNfb3BlbmF0LAo+ICugoKCgoKCgW19fTlJfbWtkaXJhdF2goKCgoKCgoKCgoKCgoKCg
oKBzeXNfbWtkaXJhdCwKPiAroKCgoKCgoFtfX05SX21rbm9kYXRdoKCgoKCgoKCgoKCgoKCgoKCg
c3lzX21rbm9kYXQsCj4gK6CgoKCgoKBbX19OUl9mY2hvd25hdF2goKCgoKCgoKCgoKCgoKCgoHN5
c19mY2hvd25hdCwKPiAroKCgoKCgoFtfX05SX2Z1dGltZXNhdF2goKCgoKCgoKCgoKCgoKCgc3lz
X2Z1dGltZXNhdCwKPiAroKCgoKCgoFtfX05SX25ld2ZzdGF0YXRdoKCgoKCgoKCgoKCgoKCgc3lz
X25ld2ZzdGF0YXQsCj4gK6CgoKCgoKBbX19OUl91bmxpbmthdF2goKCgoKCgoKCgoKCgoKCgoHN5
c191bmxpbmthdCwKPiAroKCgoKCgoFtfX05SX3JlbmFtZWF0XaCgoKCgoKCgoKCgoKCgoKCgc3lz
X3JlbmFtZWF0LAo+ICugoKCgoKCgW19fTlJfbGlua2F0XaCgoKCgoKCgoKCgoKCgoKCgoKBzeXNf
bGlua2F0LAo+ICugoKCgoKCgW19fTlJfc3ltbGlua2F0XaCgoKCgoKCgoKCgoKCgoKBzeXNfc3lt
bGlua2F0LAo+ICugoKCgoKCgW19fTlJfcmVhZGxpbmthdF2goKCgoKCgoKCgoKCgoKBzeXNfcmVh
ZGxpbmthdCwKPiAroKCgoKCgoFtfX05SX2ZjaG1vZGF0XaCgoKCgoKCgoKCgoKCgoKCgc3lzX2Zj
aG1vZGF0LAo+ICugoKCgoKCgW19fTlJfZmFjY2Vzc2F0XaCgoKCgoKCgoKCgoKCgoKBzeXNfZmFj
Y2Vzc2F0LAo+IKB9Owo+IKAKClRoZSBzcHUgcGFydHMgbG9vayBmaW5lLCB0aGFua3MuCgo+IKBs
b25nIHNwdV9zeXNfY2FsbGJhY2soc3RydWN0IHNwdV9zeXNjYWxsX2Jsb2NrICpzKQo+IEluZGV4
OiBsaW51eC0yLjYuMTctcmMyLWdpdDUvZnMvc3RhdC5jCj4gPT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQo+IC0tLSBsaW51
eC0yLjYuMTctcmMyLWdpdDUub3JpZy9mcy9zdGF0LmOgoKCgoKCgoDIwMDYtMDQtMjQKPiAxODow
NToyMy4wMDAwMDAwMDAgKzAyMDAgKysrIGxpbnV4LTIuNi4xNy1yYzItZ2l0NS9mcy9zdGF0LmOg
oKCgoDIwMDYtMDQtMjQKPiAxODowNTo0NC4wMDAwMDAwMDAgKzAyMDAgQEAgLTI2MSw3ICsyNjEs
NiBAQCBhc21saW5rYWdlIGxvbmcKPiBzeXNfbmV3bHN0YXQoY2hhciBfX3VzZXIKPiCgoKCgoKCg
oHJldHVybiBlcnJvcjsKPiCgfQo+IKAKPiAtI2lmbmRlZiBfX0FSQ0hfV0FOVF9TVEFUNjQKPiCg
YXNtbGlua2FnZSBsb25nIHN5c19uZXdmc3RhdGF0KGludCBkZmQsIGNoYXIgX191c2VyICpmaWxl
bmFtZSwKPiCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoHN0cnVjdCBzdGF0IF9fdXNl
ciAqc3RhdGJ1ZiwgaW50IGZsYWcpCj4goHsKPiBAQCAtMjgyLDcgKzI4MSw2IEBAIGFzbWxpbmth
Z2UgbG9uZyBzeXNfbmV3ZnN0YXRhdChpbnQgZGZkLAo+IKBvdXQ6Cj4goKCgoKCgoKByZXR1cm4g
ZXJyb3I7Cj4goH0KPiAtI2VuZGlmCj4goAo+IKBhc21saW5rYWdlIGxvbmcgc3lzX25ld2ZzdGF0
KHVuc2lnbmVkIGludCBmZCwgc3RydWN0IHN0YXQgX191c2VyICpzdGF0YnVmKQo+IKB7CgpTaW1w
bHkgcmVtb3ZpbmcgdGhlICNpZmRlZiBsb29rcyB3cm9uZy4gQUZBSUNULCBwb3dlcnBjIGFuZCBp
YTY0IGFyZSB0aGUKb25seSBvbmVzIHRoYXQgd2FudCBib3RoIHN5c19uZXdmc3RhdGF0IGFuZCBz
eXNfZnN0YXRhdDY0LCBtYXliZSB5b3UKY2FuIHNpbXBseSBkbyAKCiNpZiAhZGVmaW5lZChfX0FS
Q0hfV0FOVF9TVEFUNjQpIHx8IGRlZmluZWQoX19BUkNIX1dBTlRfTkVXU1RBVEZTQVQpCgoJQXJu
ZCA8PjwK

^ permalink raw reply

* Re: [PATCH] Wire up *at syscalls
From: Andreas Schwab @ 2006-04-25  0:03 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200604250131.22154.arnd@arndb.de>

Arnd Bergmann <arnd@arndb.de> writes:

> Simply removing the #ifdef looks wrong. AFAICT, powerpc and ia64 are the
> only ones that want both sys_newfstatat and sys_fstatat64, maybe you
> can simply do 
>
> #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_NEWSTATFSAT)

Updated patch below.

Andreas.

Signed-off-by: Andreas Schwab <schwab@suse.de>

---
 arch/powerpc/kernel/systbl.S                |   13 +++++++++++++
 arch/powerpc/platforms/cell/spu_callbacks.c |   13 +++++++++++++
 fs/stat.c                                   |    2 +-
 include/asm-powerpc/unistd.h                |   20 +++++++++++++++++++-
 4 files changed, 46 insertions(+), 2 deletions(-)

Index: linux-2.6.17-rc2-git5/arch/powerpc/kernel/systbl.S
===================================================================
--- linux-2.6.17-rc2-git5.orig/arch/powerpc/kernel/systbl.S	2006-04-24 16:24:47.000000000 +0200
+++ linux-2.6.17-rc2-git5/arch/powerpc/kernel/systbl.S	2006-04-24 19:53:50.000000000 +0200
@@ -324,6 +324,19 @@ COMPAT_SYS(ppoll)
 SYSCALL(unshare)
 SYSCALL(splice)
 SYSCALL(tee)
+COMPAT_SYS(openat)
+SYSCALL(mkdirat)
+SYSCALL(mknodat)
+SYSCALL(fchownat)
+COMPAT_SYS(futimesat)
+SYSX(sys_newfstatat, sys_fstatat64, sys_fstatat64)
+SYSCALL(unlinkat)
+SYSCALL(renameat)
+SYSCALL(linkat)
+SYSCALL(symlinkat)
+SYSCALL(readlinkat)
+SYSCALL(fchmodat)
+SYSCALL(faccessat)
 
 /*
  * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c
Index: linux-2.6.17-rc2-git5/include/asm-powerpc/unistd.h
===================================================================
--- linux-2.6.17-rc2-git5.orig/include/asm-powerpc/unistd.h	2006-04-24 16:24:15.000000000 +0200
+++ linux-2.6.17-rc2-git5/include/asm-powerpc/unistd.h	2006-04-25 01:35:38.000000000 +0200
@@ -303,8 +303,25 @@
 #define __NR_unshare		282
 #define __NR_splice		283
 #define __NR_tee		284
+#define __NR_openat		285
+#define __NR_mkdirat		286
+#define __NR_mknodat		287
+#define __NR_fchownat		288
+#define __NR_futimesat		289
+#ifdef __powerpc64__
+#define __NR_newfstatat		290
+#else
+#define __NR_fstatat64		290
+#endif
+#define __NR_unlinkat		291
+#define __NR_renameat		292
+#define __NR_linkat		293
+#define __NR_symlinkat		294
+#define __NR_readlinkat		295
+#define __NR_fchmodat		296
+#define __NR_faccessat		297
 
-#define __NR_syscalls		285
+#define __NR_syscalls		298
 
 #ifdef __KERNEL__
 #define __NR__exit __NR_exit
@@ -457,6 +474,7 @@ type name(type1 arg1, type2 arg2, type3 
 #ifdef CONFIG_PPC64
 #define __ARCH_WANT_COMPAT_SYS_TIME
 #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_NEWFSTATAT
 #endif
 
 /*
Index: linux-2.6.17-rc2-git5/arch/powerpc/platforms/cell/spu_callbacks.c
===================================================================
--- linux-2.6.17-rc2-git5.orig/arch/powerpc/platforms/cell/spu_callbacks.c	2006-04-24 16:24:47.000000000 +0200
+++ linux-2.6.17-rc2-git5/arch/powerpc/platforms/cell/spu_callbacks.c	2006-04-24 23:51:16.000000000 +0200
@@ -318,6 +318,19 @@ void *spu_syscall_table[] = {
 	[__NR_unshare]			sys_unshare,
 	[__NR_splice]			sys_splice,
 	[__NR_tee]			sys_tee,
+	[__NR_openat]			sys_openat,
+	[__NR_mkdirat]			sys_mkdirat,
+	[__NR_mknodat]			sys_mknodat,
+	[__NR_fchownat]			sys_fchownat,
+	[__NR_futimesat]		sys_futimesat,
+	[__NR_newfstatat]		sys_newfstatat,
+	[__NR_unlinkat]			sys_unlinkat,
+	[__NR_renameat]			sys_renameat,
+	[__NR_linkat]			sys_linkat,
+	[__NR_symlinkat]		sys_symlinkat,
+	[__NR_readlinkat]		sys_readlinkat,
+	[__NR_fchmodat]			sys_fchmodat,
+	[__NR_faccessat]		sys_faccessat,
 };
 
 long spu_sys_callback(struct spu_syscall_block *s)
Index: linux-2.6.17-rc2-git5/fs/stat.c
===================================================================
--- linux-2.6.17-rc2-git5.orig/fs/stat.c	2006-04-24 18:05:23.000000000 +0200
+++ linux-2.6.17-rc2-git5/fs/stat.c	2006-04-25 01:37:06.000000000 +0200
@@ -261,7 +261,7 @@ asmlinkage long sys_newlstat(char __user
 	return error;
 }
 
-#ifndef __ARCH_WANT_STAT64
+#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
 asmlinkage long sys_newfstatat(int dfd, char __user *filename,
 				struct stat __user *statbuf, int flag)
 {

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: [PATCH] Wire up *at syscalls
From: David Woodhouse @ 2006-04-25  0:13 UTC (permalink / raw)
  To: arnd; +Cc: linuxppc-dev
In-Reply-To: <jeu08ippb9.fsf@sykes.suse.de>


>   * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c 

Hm, do we really need that? How about something based on this instead...
note that I used CONFIG_PPC_CELL because dependencies on CONFIG_*_MODULE
in the static kernel are evil.

Syscall 224 is missing from the existing spu_syscall_table, btw.

diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index 8d15226..8371f14 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -18,17 +18,29 @@ #include <linux/config.h>
 #include <asm/ppc_asm.h>
 
 #ifdef CONFIG_PPC64
-#define SYSCALL(func)		.llong	.sys_##func,.sys_##func
-#define COMPAT_SYS(func)	.llong	.sys_##func,.compat_sys_##func
-#define PPC_SYS(func)		.llong	.ppc_##func,.ppc_##func
-#define OLDSYS(func)		.llong	.sys_ni_syscall,.sys_ni_syscall
-#define SYS32ONLY(func)		.llong	.sys_ni_syscall,.compat_sys_##func
-#define SYSX(f, f3264, f32)	.llong	.f,.f3264
+
+#ifdef CONFIG_PPC_CELL
+#define SPU(x) ,x
+#else
+#define SPU(x)
+#endif
+
+#define SYSCALL(func)		.llong	.sys_##func,.sys_##func SPU(.sys_ni_syscall)
+#define SYSCALL_SPU(func)	.llong	.sys_##func,.sys_##func SPU(.sys_##func)
+#define COMPAT_SYS(func)	.llong	.sys_##func,.compat_sys_##func SPU(.sys_ni_syscall)
+#define COMPAT_SYS_SPU(func)	.llong	.sys_##func,.compat_sys_##func SPU(.sys_##func)
+#define PPC_SYS(func)		.llong	.ppc_##func,.ppc_##func SPU(.sys_ni_syscall)
+#define PPC_SYS_SPU(func)	.llong	.ppc_##func,.ppc_##func SPU(.ppc_##func)
+#define OLDSYS(func)		.llong	.sys_ni_syscall,.sys_ni_syscall SPU(.sys_ni_syscall)
+#define SYS32ONLY(func)		.llong	.sys_ni_syscall,.compat_sys_##func SPU(.sys_ni_syscall)
+#define SYSX(f, f3264, f32)	.llong	.f,.f3264 SPU(.f)
 #else
-#define SYSCALL(func)		.long	sys_##func
 #define COMPAT_SYS(func)	.long	sys_##func
+#define COMPAT_SYS_SPU(func)	.long	sys_##func
 #define PPC_SYS(func)		.long	ppc_##func
+#define PPC_SYS_SPU(func)	.long	ppc_##func
 #define OLDSYS(func)		.long	sys_##func
+#define OLDSYS_SPU(func)	.long	sys_##func
 #define SYS32ONLY(func)		.long	sys_##func
 #define SYSX(f, f3264, f32)	.long	f32
 #endif
@@ -42,175 +54,175 @@ _GLOBAL(sys_call_table)
 SYSCALL(restart_syscall)
 SYSCALL(exit)
 PPC_SYS(fork)
-SYSCALL(read)
-SYSCALL(write)
-COMPAT_SYS(open)
-SYSCALL(close)
-COMPAT_SYS(waitpid)
-COMPAT_SYS(creat)
-SYSCALL(link)
-SYSCALL(unlink)
+SYSCALL_SPU(read)
+SYSCALL_SPU(write)
+COMPAT_SYS_SPU(open)
+SYSCALL_SPU(close)
+COMPAT_SYS_SPU(waitpid)
+COMPAT_SYS_SPU(creat)
+SYSCALL_SPU(link)
+SYSCALL_SPU(unlink)
 COMPAT_SYS(execve)
-SYSCALL(chdir)
-COMPAT_SYS(time)
-SYSCALL(mknod)
-SYSCALL(chmod)
-SYSCALL(lchown)
+SYSCALL_SPU(chdir)
+COMPAT_SYS_SPU(time)
+SYSCALL_SPU(mknod)
+SYSCALL_SPU(chmod)
+SYSCALL_SPU(lchown)
 SYSCALL(ni_syscall)
 OLDSYS(stat)
-SYSX(sys_lseek,ppc32_lseek,sys_lseek)
-SYSCALL(getpid)
+SYSX_SPU(sys_lseek,ppc32_lseek,sys_lseek)
+SYSCALL_SPU(getpid)
 COMPAT_SYS(mount)
 SYSX(sys_ni_syscall,sys_oldumount,sys_oldumount)
-SYSCALL(setuid)
-SYSCALL(getuid)
-COMPAT_SYS(stime)
+SYSCALL_SPU(setuid)
+SYSCALL_SPU(getuid)
+COMPAT_SYS_SPU(stime)
 COMPAT_SYS(ptrace)
-SYSCALL(alarm)
+SYSCALL_SPU(alarm)
 OLDSYS(fstat)
 COMPAT_SYS(pause)
 COMPAT_SYS(utime)
 SYSCALL(ni_syscall)
 SYSCALL(ni_syscall)
-COMPAT_SYS(access)
-COMPAT_SYS(nice)
+COMPAT_SYS_SPU(access)
+COMPAT_SYS_SPU(nice)
 SYSCALL(ni_syscall)
-SYSCALL(sync)
-COMPAT_SYS(kill)
-SYSCALL(rename)
-COMPAT_SYS(mkdir)
-SYSCALL(rmdir)
-SYSCALL(dup)
-SYSCALL(pipe)
-COMPAT_SYS(times)
+SYSCALL_SPU(sync)
+COMPAT_SYS_SPU(kill)
+SYSCALL_SPU(rename)
+COMPAT_SYS_SPU(mkdir)
+SYSCALL_SPU(rmdir)
+SYSCALL_SPU(dup)
+SYSCALL_SPU(pipe)
+COMPAT_SYS_SPU(times)
 SYSCALL(ni_syscall)
-SYSCALL(brk)
-SYSCALL(setgid)
-SYSCALL(getgid)
+SYSCALL_SPU(brk)
+SYSCALL_SPU(setgid)
+SYSCALL_SPU(getgid)
 SYSCALL(signal)
-SYSCALL(geteuid)
-SYSCALL(getegid)
+SYSCALL_SPU(geteuid)
+SYSCALL_SPU(getegid)
 SYSCALL(acct)
 SYSCALL(umount)
 SYSCALL(ni_syscall)
-COMPAT_SYS(ioctl)
-COMPAT_SYS(fcntl)
+COMPAT_SYS_SPU(ioctl)
+COMPAT_SYS_SPU(fcntl)
 SYSCALL(ni_syscall)
-COMPAT_SYS(setpgid)
+COMPAT_SYS_SPU(setpgid)
 SYSCALL(ni_syscall)
 SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
-COMPAT_SYS(umask)
-SYSCALL(chroot)
+COMPAT_SYS_SPU(umask)
+SYSCALL_SPU(chroot)
 SYSCALL(ustat)
-SYSCALL(dup2)
-SYSCALL(getppid)
-SYSCALL(getpgrp)
-SYSCALL(setsid)
+SYSCALL_SPU(dup2)
+SYSCALL_SPU(getppid)
+SYSCALL_SPU(getpgrp)
+SYSCALL_SPU(setsid)
 SYS32ONLY(sigaction)
-SYSCALL(sgetmask)
-COMPAT_SYS(ssetmask)
-SYSCALL(setreuid)
-SYSCALL(setregid)
+SYSCALL_SPU(sgetmask)
+COMPAT_SYS_SPU(ssetmask)
+SYSCALL_SPU(setreuid)
+SYSCALL_SPU(setregid)
 SYS32ONLY(sigsuspend)
 COMPAT_SYS(sigpending)
-COMPAT_SYS(sethostname)
-COMPAT_SYS(setrlimit)
+COMPAT_SYS_SPU(sethostname)
+COMPAT_SYS_SPU(setrlimit)
 COMPAT_SYS(old_getrlimit)
-COMPAT_SYS(getrusage)
-COMPAT_SYS(gettimeofday)
-COMPAT_SYS(settimeofday)
-COMPAT_SYS(getgroups)
-COMPAT_SYS(setgroups)
+COMPAT_SYS_SPU(getrusage)
+COMPAT_SYS_SPU(gettimeofday)
+COMPAT_SYS_SPU(settimeofday)
+COMPAT_SYS_SPU(getgroups)
+COMPAT_SYS_SPU(setgroups)
 SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select)
-SYSCALL(symlink)
+SYSCALL_SPU(symlink)
 OLDSYS(lstat)
-COMPAT_SYS(readlink)
+COMPAT_SYS_SPU(readlink)
 SYSCALL(uselib)
 SYSCALL(swapon)
 SYSCALL(reboot)
 SYSX(sys_ni_syscall,old32_readdir,old_readdir)
-SYSCALL(mmap)
-SYSCALL(munmap)
-SYSCALL(truncate)
-SYSCALL(ftruncate)
-SYSCALL(fchmod)
-SYSCALL(fchown)
-COMPAT_SYS(getpriority)
-COMPAT_SYS(setpriority)
+SYSCALL_SPU(mmap)
+SYSCALL_SPU(munmap)
+SYSCALL_SPU(truncate)
+SYSCALL_SPU(ftruncate)
+SYSCALL_SPU(fchmod)
+SYSCALL_SPU(fchown)
+COMPAT_SYS_SPU(getpriority)
+COMPAT_SYS_SPU(setpriority)
 SYSCALL(ni_syscall)
 COMPAT_SYS(statfs)
 COMPAT_SYS(fstatfs)
 SYSCALL(ni_syscall)
-COMPAT_SYS(socketcall)
-COMPAT_SYS(syslog)
-COMPAT_SYS(setitimer)
-COMPAT_SYS(getitimer)
-COMPAT_SYS(newstat)
-COMPAT_SYS(newlstat)
-COMPAT_SYS(newfstat)
+COMPAT_SYS_SPU(socketcall)
+COMPAT_SYS_SPU(syslog)
+COMPAT_SYS_SPU(setitimer)
+COMPAT_SYS_SPU(getitimer)
+COMPAT_SYS_SPU(newstat)
+COMPAT_SYS_SPU(newlstat)
+COMPAT_SYS_SPU(newfstat)
 SYSX(sys_ni_syscall,sys_uname,sys_uname)
 SYSCALL(ni_syscall)
-SYSCALL(vhangup)
+SYSCALL_SPU(vhangup)
 SYSCALL(ni_syscall)
 SYSCALL(ni_syscall)
-COMPAT_SYS(wait4)
+COMPAT_SYS_SPU(wait4)
 SYSCALL(swapoff)
-COMPAT_SYS(sysinfo)
+COMPAT_SYS_SPU(sysinfo)
 COMPAT_SYS(ipc)
-SYSCALL(fsync)
+SYSCALL_SPU(fsync)
 SYS32ONLY(sigreturn)
 PPC_SYS(clone)
-COMPAT_SYS(setdomainname)
-PPC_SYS(newuname)
+COMPAT_SYS_SPU(setdomainname)
+PPC_SYS_SPU(newuname)
 SYSCALL(ni_syscall)
-COMPAT_SYS(adjtimex)
-SYSCALL(mprotect)
+COMPAT_SYS_SPU(adjtimex)
+SYSCALL_SPU(mprotect)
 SYSX(sys_ni_syscall,compat_sys_sigprocmask,sys_sigprocmask)
 SYSCALL(ni_syscall)
 SYSCALL(init_module)
 SYSCALL(delete_module)
 SYSCALL(ni_syscall)
 SYSCALL(quotactl)
-COMPAT_SYS(getpgid)
-SYSCALL(fchdir)
-SYSCALL(bdflush)
+COMPAT_SYS_SPU(getpgid)
+SYSCALL_SPU(fchdir)
+SYSCALL_SPU(bdflush)
 COMPAT_SYS(sysfs)
-SYSX(ppc64_personality,ppc64_personality,sys_personality)
+SYSX_SPU(ppc64_personality,ppc64_personality,sys_personality)
 SYSCALL(ni_syscall)
-SYSCALL(setfsuid)
-SYSCALL(setfsgid)
-SYSCALL(llseek)
-COMPAT_SYS(getdents)
-SYSX(sys_select,ppc32_select,ppc_select)
-SYSCALL(flock)
-SYSCALL(msync)
-COMPAT_SYS(readv)
-COMPAT_SYS(writev)
-COMPAT_SYS(getsid)
-SYSCALL(fdatasync)
+SYSCALL_SPU(setfsuid)
+SYSCALL_SPU(setfsgid)
+SYSCALL_SPU(llseek)
+COMPAT_SYS_SPU(getdents)
+SYSX_SPU(sys_select,ppc32_select,ppc_select)
+SYSCALL_SPU(flock)
+SYSCALL_SPU(msync)
+COMPAT_SYS_SPU(readv)
+COMPAT_SYS_SPU(writev)
+COMPAT_SYS_SPU(getsid)
+SYSCALL_SPU(fdatasync)
 COMPAT_SYS(sysctl)
-SYSCALL(mlock)
-SYSCALL(munlock)
-SYSCALL(mlockall)
-SYSCALL(munlockall)
-COMPAT_SYS(sched_setparam)
-COMPAT_SYS(sched_getparam)
-COMPAT_SYS(sched_setscheduler)
-COMPAT_SYS(sched_getscheduler)
-SYSCALL(sched_yield)
-COMPAT_SYS(sched_get_priority_max)
-COMPAT_SYS(sched_get_priority_min)
-COMPAT_SYS(sched_rr_get_interval)
-COMPAT_SYS(nanosleep)
-SYSCALL(mremap)
-SYSCALL(setresuid)
-SYSCALL(getresuid)
+SYSCALL_SPU(mlock)
+SYSCALL_SPU(munlock)
+SYSCALL_SPU(mlockall)
+SYSCALL_SPU(munlockall)
+COMPAT_SYS_SPU(sched_setparam)
+COMPAT_SYS_SPU(sched_getparam)
+COMPAT_SYS_SPU(sched_setscheduler)
+COMPAT_SYS_SPU(sched_getscheduler)
+SYSCALL_SPU(sched_yield)
+COMPAT_SYS_SPU(sched_get_priority_max)
+COMPAT_SYS_SPU(sched_get_priority_min)
+COMPAT_SYS_SPU(sched_rr_get_interval)
+COMPAT_SYS_SPU(nanosleep)
+SYSCALL_SPU(mremap)
+SYSCALL_SPU(setresuid)
+SYSCALL_SPU(getresuid)
 SYSCALL(ni_syscall)
-SYSCALL(poll)
+SYSCALL_SPU(poll)
 COMPAT_SYS(nfsservctl)
-SYSCALL(setresgid)
-SYSCALL(getresgid)
-COMPAT_SYS(prctl)
+SYSCALL_SPU(setresgid)
+SYSCALL_SPU(getresgid)
+COMPAT_SYS_SPU(prctl)
 COMPAT_SYS(rt_sigreturn)
 COMPAT_SYS(rt_sigaction)
 COMPAT_SYS(rt_sigprocmask)
@@ -218,19 +230,19 @@ COMPAT_SYS(rt_sigpending)
 COMPAT_SYS(rt_sigtimedwait)
 COMPAT_SYS(rt_sigqueueinfo)
 COMPAT_SYS(rt_sigsuspend)
-COMPAT_SYS(pread64)
-COMPAT_SYS(pwrite64)
-SYSCALL(chown)
-SYSCALL(getcwd)
-SYSCALL(capget)
-SYSCALL(capset)
+COMPAT_SYS_SPU(pread64)
+COMPAT_SYS_SPU(pwrite64)
+SYSCALL_SPU(chown)
+SYSCALL_SPU(getcwd)
+SYSCALL_SPU(capget)
+SYSCALL_SPU(capset)
 COMPAT_SYS(sigaltstack)
-SYSX(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
+SYSX_SPU(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
 SYSCALL(ni_syscall)
 SYSCALL(ni_syscall)
 PPC_SYS(vfork)
-COMPAT_SYS(getrlimit)
-COMPAT_SYS(readahead)
+COMPAT_SYS_SPU(getrlimit)
+COMPAT_SYS_SPU(readahead)
 SYS32ONLY(mmap2)
 SYS32ONLY(truncate64)
 SYS32ONLY(ftruncate64)
@@ -241,60 +253,60 @@ SYSCALL(pciconfig_read)
 SYSCALL(pciconfig_write)
 SYSCALL(pciconfig_iobase)
 SYSCALL(ni_syscall)
-SYSCALL(getdents64)
-SYSCALL(pivot_root)
+SYSCALL_SPU(getdents64)
+SYSCALL_SPU(pivot_root)
 SYSX(sys_ni_syscall,compat_sys_fcntl64,sys_fcntl64)
-SYSCALL(madvise)
-SYSCALL(mincore)
-SYSCALL(gettid)
-SYSCALL(tkill)
-SYSCALL(setxattr)
-SYSCALL(lsetxattr)
-SYSCALL(fsetxattr)
-SYSCALL(getxattr)
-SYSCALL(lgetxattr)
-SYSCALL(fgetxattr)
-SYSCALL(listxattr)
-SYSCALL(llistxattr)
-SYSCALL(flistxattr)
-SYSCALL(removexattr)
-SYSCALL(lremovexattr)
-SYSCALL(fremovexattr)
-COMPAT_SYS(futex)
-COMPAT_SYS(sched_setaffinity)
-COMPAT_SYS(sched_getaffinity)
+SYSCALL_SPU(madvise)
+SYSCALL_SPU(mincore)
+SYSCALL_SPU(gettid)
+SYSCALL_SPU(tkill)
+SYSCALL_SPU(setxattr)
+SYSCALL_SPU(lsetxattr)
+SYSCALL_SPU(fsetxattr)
+SYSCALL_SPU(getxattr)
+SYSCALL_SPU(lgetxattr)
+SYSCALL_SPU(fgetxattr)
+SYSCALL_SPU(listxattr)
+SYSCALL_SPU(llistxattr)
+SYSCALL_SPU(flistxattr)
+SYSCALL_SPU(removexattr)
+SYSCALL_SPU(lremovexattr)
+SYSCALL_SPU(fremovexattr)
+COMPAT_SYS_SPU(futex)
+COMPAT_SYS_SPU(sched_setaffinity)
+COMPAT_SYS_SPU(sched_getaffinity)
 SYSCALL(ni_syscall)
 SYSCALL(ni_syscall)
 SYS32ONLY(sendfile64)
-COMPAT_SYS(io_setup)
-SYSCALL(io_destroy)
-COMPAT_SYS(io_getevents)
-COMPAT_SYS(io_submit)
-SYSCALL(io_cancel)
+COMPAT_SYS_SPU(io_setup)
+SYSCALL_SPU(io_destroy)
+COMPAT_SYS_SPU(io_getevents)
+COMPAT_SYS_SPU(io_submit)
+SYSCALL_SPU(io_cancel)
 SYSCALL(set_tid_address)
-SYSX(sys_fadvise64,ppc32_fadvise64,sys_fadvise64)
+SYSX_SPU(sys_fadvise64,ppc32_fadvise64,sys_fadvise64)
 SYSCALL(exit_group)
 SYSX(sys_lookup_dcookie,ppc32_lookup_dcookie,sys_lookup_dcookie)
-SYSCALL(epoll_create)
-SYSCALL(epoll_ctl)
-SYSCALL(epoll_wait)
-SYSCALL(remap_file_pages)
-SYSX(sys_timer_create,compat_sys_timer_create,sys_timer_create)
-COMPAT_SYS(timer_settime)
-COMPAT_SYS(timer_gettime)
-SYSCALL(timer_getoverrun)
-SYSCALL(timer_delete)
-COMPAT_SYS(clock_settime)
-COMPAT_SYS(clock_gettime)
-COMPAT_SYS(clock_getres)
-COMPAT_SYS(clock_nanosleep)
+SYSCALL_SPU(epoll_create)
+SYSCALL_SPU(epoll_ctl)
+SYSCALL_SPU(epoll_wait)
+SYSCALL_SPU(remap_file_pages)
+SYSX_SPU(sys_timer_create,compat_sys_timer_create,sys_timer_create)
+COMPAT_SYS_SPU(timer_settime)
+COMPAT_SYS_SPU(timer_gettime)
+SYSCALL_SPU(timer_getoverrun)
+SYSCALL_SPU(timer_delete)
+COMPAT_SYS_SPU(clock_settime)
+COMPAT_SYS_SPU(clock_gettime)
+COMPAT_SYS_SPU(clock_getres)
+COMPAT_SYS_SPU(clock_nanosleep)
 SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
-COMPAT_SYS(tgkill)
-COMPAT_SYS(utimes)
-COMPAT_SYS(statfs64)
-COMPAT_SYS(fstatfs64)
+COMPAT_SYS_SPU(tgkill)
+COMPAT_SYS_SPU(utimes)
+COMPAT_SYS_SPU(statfs64)
+COMPAT_SYS_SPU(fstatfs64)
 SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
-PPC_SYS(rtas)
+PPC_SYS_SPU(rtas)
 OLDSYS(debug_setcontext)
 SYSCALL(ni_syscall)
 SYSCALL(ni_syscall)
@@ -321,11 +333,6 @@ SYSCALL(spu_run)
 SYSCALL(spu_create)
 COMPAT_SYS(pselect6)
 COMPAT_SYS(ppoll)
-SYSCALL(unshare)
-SYSCALL(splice)
-SYSCALL(tee)
-
-/*
- * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c
- * as well when appropriate.
- */
+SYSCALL_SPU(unshare)
+SYSCALL_SPU(splice)
+SYSCALL_SPU(tee)

-- 
dwmw2

^ permalink raw reply related

* Re: [PATCH 0/7] [RFC] Sizing zones and holes in an architecture independent manner V4
From: KAMEZAWA Hiroyuki @ 2006-04-25  1:48 UTC (permalink / raw)
  To: Mel Gorman
  Cc: davej, tony.luck, linux-mm, mel, ak, bob.picco, linux-kernel,
	linuxppc-dev
In-Reply-To: <20060424202009.20409.89016.sendpatchset@skynet>

On Mon, 24 Apr 2006 21:20:09 +0100 (IST)
Mel Gorman <mel@csn.ul.ie> wrote:

> This is V4 of the patchset to size zones and memory holes in an
> architecture-independent manner.
> 

Could you add some documentation about 'how to use' your generic funcs ?
I think more archs can use your generic routine if well documented.

All initialization path can be written in following way ?
==
for_all_memory_region()
	add_active_range(nid, start, end)
free_area_init_nodes(max_dma, max_dma32, max_low_pfn, max_pfn);
==

And following functions are really needed ?
==
+extern void remove_all_active_ranges(void);
+extern void get_pfn_range_for_nid(unsigned int nid,
+			unsigned long *start_pfn, unsigned long *end_pfn);
+extern unsigned long find_min_pfn_with_active_regions(void);
+extern unsigned long find_max_pfn_with_active_regions(void);
+extern int early_pfn_to_nid(unsigned long pfn);
+extern void free_bootmem_with_active_regions(int nid,
+						unsigned long max_low_pfn);
+extern void sparse_memory_present_with_active_regions(int nid);
+extern unsigned long absent_pages_in_range(unsigned long start_pfn,
+						unsigned long end_pfn);

-Kame

^ permalink raw reply

* Re: Clock running fast on Mac Mini?
From: Benjamin Herrenschmidt @ 2006-04-25  4:14 UTC (permalink / raw)
  To: Mich Lanners; +Cc: linuxppc-dev
In-Reply-To: <E1FY8kd-0000mH-PO@owl.grunz.lu>

On Mon, 2006-04-24 at 23:37 +0200, Mich Lanners wrote:
> Hello all,
> 
> I have a problem on my Mac Mini with the kernel clock, which is running
> fast.
> 
> In fact, it is gaining 10 ms every 5 seconds, as can be seen here, with
> ntpdate called every 5 seconds:
> 
> owl:~# while true; do ntpdate -u be.pool.ntp.org; sleep 5; done
> 24 Apr 23:14:17 ntpdate[2601]: adjust time server 195.47.215.226 offset 0.151197 sec
> 24 Apr 23:14:22 ntpdate[2607]: adjust time server 195.47.215.226 offset 0.160348 sec
> 24 Apr 23:14:28 ntpdate[2613]: adjust time server 195.47.215.226 offset 0.170311 sec
> [...]
> 24 Apr 23:17:15 ntpdate[2813]: adjust time server 195.47.215.226 offset 0.489635 sec
> 24 Apr 23:17:20 ntpdate[2819]: adjust time server 195.47.215.226 offset 0.499386 sec
> 24 Apr 23:17:25 ntpdate[2825]: step time server 195.47.215.226 offset 0.509342 sec
> 24 Apr 23:17:31 ntpdate[2831]: adjust time server 195.47.215.226 offset 0.013693 sec
> 24 Apr 23:17:36 ntpdate[2837]: adjust time server 195.47.215.226 offset 0.021668 sec
> 
> and so on.
> 
> This is with ntpd stopped, after a fresh boot with /etc/adjtime removed
> to make sure hwclock is not falsly tuning the kernel timekeeping (I did
> this because I once had a 2.6.16 kernel running, where clock problems
> have been reported. I thought that may have falsified ntp's drift file
> and/or hwclock's /etc/adjtime).
> 
> All this is with a 2.6.15 kernel.
> 
> My Alu powerbook with a 2.6.15 kernel does not show this problem.

Could be several things... the clock calibration data from the
device-tree incorrect, or a rouding bug we fixed recently... I'd expect
2.6.16 to be good.

Ben

^ permalink raw reply

* Re: 85xx FDT updates?
From: Kumar Gala @ 2006-04-25  6:08 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <17017F03-078C-4B7F-A961-EC371F534E27@embeddedalley.com>


On Apr 24, 2006, at 5:31 PM, Dan Malek wrote:

>
> On Apr 24, 2006, at 5:43 PM, Kumar Gala wrote:
>
>> However, I am against removing the arch/ppc support until the u-boot
>> patches are picked up.  I think its bad form to give people a kernel
>> they can't easily boot.
>
> What about systems that can't update u-boot, but want to run
> a newer kernel?

Does this situation exist for any in tree boards that are supported?

- kumar

^ permalink raw reply

* Re: 85xx FDT updates?
From: Eugene Surovegin @ 2006-04-25  7:49 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <34C11E8A-ED04-490F-B601-841DC1F94AD6@kernel.crashing.org>

On Tue, Apr 25, 2006 at 01:08:00AM -0500, Kumar Gala wrote:
> 
> On Apr 24, 2006, at 5:31 PM, Dan Malek wrote:
> 
> >
> > On Apr 24, 2006, at 5:43 PM, Kumar Gala wrote:
> >
> >> However, I am against removing the arch/ppc support until the u-boot
> >> patches are picked up.  I think its bad form to give people a kernel
> >> they can't easily boot.
> >
> > What about systems that can't update u-boot, but want to run
> > a newer kernel?
> 
> Does this situation exist for any in tree boards that are supported?

Kumar, with all due respect, I don't like this attitude. I can have 
eval board where I don't want to upgrade firmware.

Also, this "let's screw everybody who doesn't have their board support 
in tree" is very counter productive. FYI, almost all my contributed 
kernel work was done on custom hardware, not on reference boards.

It seems some people here lost touch with reality - embedded Linux is 
mostly run on custom hardware, not on evaluation boards.

-- 
Eugene

^ permalink raw reply

* [PATCH] ppc32: add 440GX erratum 440_43 workaround
From: Eugene Surovegin @ 2006-04-25  8:22 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-embedded

This patch adds workaround for PPC 440GX erratum 440_43. According to 
this erratum spurious MachineChecks (caused by L1 cache parity) can 
happen during DataTLB miss processing. We disable L1 cache parity 
checking for 440GX rev.C and rev.F

Signed-off-by: Eugene Surovegin <ebs@ebshome.net>

diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c
index f841972..554776d 100644
--- a/arch/ppc/platforms/4xx/ocotea.c
+++ b/arch/ppc/platforms/4xx/ocotea.c
@@ -331,7 +331,7 @@ static void __init ocotea_init(void)
 void __init platform_init(unsigned long r3, unsigned long r4,
 		unsigned long r5, unsigned long r6, unsigned long r7)
 {
-	ibm44x_platform_init(r3, r4, r5, r6, r7);
+	ibm440gx_platform_init(r3, r4, r5, r6, r7);
 
 	ppc_md.setup_arch = ocotea_setup_arch;
 	ppc_md.show_cpuinfo = ocotea_show_cpuinfo;
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c
index a7dd55f..f6cc168 100644
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ b/arch/ppc/syslib/ibm440gx_common.c
@@ -2,7 +2,7 @@
  * PPC440GX system library
  *
  * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
- * Copyright (c) 2003, 2004 Zultys Technologies
+ * Copyright (c) 2003 - 2006 Zultys Technologies
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -282,3 +282,14 @@ int ibm440gx_show_cpuinfo(struct seq_fil
 	return 0;
 }
 
+void __init ibm440gx_platform_init(unsigned long r3, unsigned long r4,
+				   unsigned long r5, unsigned long r6,
+				   unsigned long r7)
+{
+	/* Erratum 440_43 workaround, disable L1 cache parity checking */
+	if (!strcmp(cur_cpu_spec->cpu_name, "440GX Rev. C") ||
+	    !strcmp(cur_cpu_spec->cpu_name, "440GX Rev. F"))
+		mtspr(SPRN_CCR1, mfspr(SPRN_CCR1) | CCR1_DPC);
+
+	ibm44x_platform_init(r3, r4, r5, r6, r7);
+}
diff --git a/arch/ppc/syslib/ibm440gx_common.h b/arch/ppc/syslib/ibm440gx_common.h
index a2ab9fa..a03ec60 100644
--- a/arch/ppc/syslib/ibm440gx_common.h
+++ b/arch/ppc/syslib/ibm440gx_common.h
@@ -29,6 +29,10 @@ #include <syslib/ibm44x_common.h>
 void ibm440gx_get_clocks(struct ibm44x_clocks*, unsigned int sys_clk,
 	unsigned int ser_clk) __init;
 
+/* common 440GX platform init */
+void ibm440gx_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+			    unsigned long r6, unsigned long r7) __init;
+
 /* Enable L2 cache */
 void ibm440gx_l2c_enable(void) __init;
 
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index 00ad9c7..4944c0f 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -237,6 +237,7 @@ #define SPRN_CSRR1	SPRN_SRR3 /* Critical
 #endif
 
 /* Bit definitions for CCR1. */
+#define	CCR1_DPC	0x00000100 /* Disable L1 I-Cache/D-Cache parity checking */
 #define	CCR1_TCS	0x00000080 /* Timer Clock Select */
 
 /* Bit definitions for the MCSR. */

^ permalink raw reply related

* Re: [PATCH 0/7] [RFC] Sizing zones and holes in an architecture independent manner V4
From: Mel Gorman @ 2006-04-25  9:05 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: davej, tony.luck, linux-mm, ak, bob.picco, linux-kernel,
	linuxppc-dev
In-Reply-To: <20060425104855.42c6ca62.kamezawa.hiroyu@jp.fujitsu.com>

On Tue, 25 Apr 2006, KAMEZAWA Hiroyuki wrote:

> On Mon, 24 Apr 2006 21:20:09 +0100 (IST)
> Mel Gorman <mel@csn.ul.ie> wrote:
>
>> This is V4 of the patchset to size zones and memory holes in an
>> architecture-independent manner.
>>
>
> Could you add some documentation about 'how to use' your generic funcs ?
> I think more archs can use your generic routine if well documented.
>
> All initialization path can be written in following way ?
> ==
> for_all_memory_region()
> 	add_active_range(nid, start, end)
> free_area_init_nodes(max_dma, max_dma32, max_low_pfn, max_pfn);
> ==

Yes, that is accurate. I can write in some documentation.

>
> And following functions are really needed ?

Most of them, yes. Without them, the arch-specific could would need to be 
able to iterate through the list of active regions which would lead to 
more similar-looking code.

> ==

> +extern void remove_all_active_ranges(void);

Used by x86_64 when it finds the SRAT table is bad and needs to rediscover 
active regions in another way. Spontaneous reboots were possible without 
it.

> +extern void get_pfn_range_for_nid(unsigned int nid,
> +			unsigned long *start_pfn, unsigned long *end_pfn);

Currently only used by power when initialising the boot allocator. There 
were no obvious canditates for use elsewhere.

> +extern unsigned long find_min_pfn_with_active_regions(void);

This does not need to be in a header.

> +extern unsigned long find_max_pfn_with_active_regions(void);

Could be dropped, only required by x86_64.

> +extern int early_pfn_to_nid(unsigned long pfn);

Removed two copies of similar functions from power and x86. I thought I 
could replace the IA64 one as well, but the code was unusual enough there 
that I decided not to.

> +extern void free_bootmem_with_active_regions(int nid,
> +						unsigned long max_low_pfn);

Removes similar-looking code from power and x86_64.

> +extern void sparse_memory_present_with_active_regions(int nid);

This is only used by power.

> +extern unsigned long absent_pages_in_range(unsigned long start_pfn,
> +						unsigned long end_pfn);
>

Removes similar looking code from x86_64. For all other architectures, it 
does the job of the existing functions that calculate zholes_size[].

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply

* Question about porting  linux2.6 on mpc860T
From: bharathi kandimalla @ 2006-04-25  9:29 UTC (permalink / raw)
  To: linuxppc-embedded@ozlabs.org; +Cc: linuxppc-embedded@ozlabs.org

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

Hi
  I know there exits a lot of changes in the linux2.6
and i want to know what are the changes 
related to architecture? 
  As mpc860T is a slow processor 
Is it considerably slow for mpc860T on linux 2.6  ?
 
I came to know there are some bugs on mpc860T for linux2.6 
Is there any bugs?
 
what version of linux(2.4/2.6) is good for mpc860T ? 
regards  
thank you.

		
---------------------------------
Yahoo! Mail goes everywhere you do.  Get it on your phone.

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

^ permalink raw reply

* [PATCH] fix cpm_uart driver for PQ1...
From: David Jander @ 2006-04-25  9:55 UTC (permalink / raw)
  To: linuxppc-embedded

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


Hi,

This patch fixes the following three problems:

1. Memory mapping virtual<-->dma is broken in the case that 
CONFIG_CONSISTENT_START > CPM_ADDR.

2. SCC uart sends a break sequence each time it is stopped with the 
CPM_CR_STOP_TX command. That means that each time an application closes the 
serial device, a break is transmitted.

3. Implemented default BRG routing for PQ1 (in the same sense as it is done 
for PQ2).

Signed-off-by: David Jander

Regards,

David.


[-- Attachment #2: cpm_uart_patch.diff --]
[-- Type: text/x-diff, Size: 6578 bytes --]

diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -138,25 +138,33 @@ void smc2_lineif(struct uart_cpm_port *p
 
 void scc1_lineif(struct uart_cpm_port *pinfo)
 {
+	volatile cpm8xx_t *cp = cpmp;
 	/* XXX SCC1: insert port configuration here */
+	cp->cp_sicr = (cp->cp_sicr & ~0x0000003f) | 0x00000000; /* Route BRG1 to SCC1 */
 	pinfo->brg = 1;
 }
 
 void scc2_lineif(struct uart_cpm_port *pinfo)
 {
+	volatile cpm8xx_t *cp = cpmp;
 	/* XXX SCC2: insert port configuration here */
+	cp->cp_sicr = (cp->cp_sicr & ~0x00003f00) | 0x00000900; /* Route BRG2 to SCC2 */
 	pinfo->brg = 2;
 }
 
 void scc3_lineif(struct uart_cpm_port *pinfo)
 {
+	volatile cpm8xx_t *cp = cpmp;
 	/* XXX SCC3: insert port configuration here */
+	cp->cp_sicr = (cp->cp_sicr & ~0x003f0000) | 0x00120000; /* Route BRG3 to SCC3 */
 	pinfo->brg = 3;
 }
 
 void scc4_lineif(struct uart_cpm_port *pinfo)
 {
+	volatile cpm8xx_t *cp = cpmp;
 	/* XXX SCC4: insert port configuration here */
+	cp->cp_sicr = (cp->cp_sicr & ~0x3f000000) | 0x1b000000; /* Route BRG4 to SCC4 */
 	pinfo->brg = 4;
 }
 
@@ -191,11 +199,11 @@ int cpm_uart_allocbuf(struct uart_cpm_po
 		/* was hostalloc but changed cause it blows away the */
 		/* large tlb mapping when pinning the kernel area    */
 		mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
-		dma_addr = 0;
+		dma_addr = (dma_addr_t)mem_addr;
 	} else
 		mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
 					      GFP_KERNEL);
-
+	
 	if (mem_addr == NULL) {
 		cpm_dpfree(dp_offset);
 		printk(KERN_ERR
@@ -206,6 +214,7 @@ int cpm_uart_allocbuf(struct uart_cpm_po
 	pinfo->dp_addr = dp_offset;
 	pinfo->mem_addr = mem_addr;
 	pinfo->dma_addr = dma_addr;
+	pinfo->dma_offset = (dma_addr_t)((unsigned long)dma_addr - (unsigned long)mem_addr);
 
 	pinfo->rx_buf = mem_addr;
 	pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -71,17 +71,19 @@ static void cpm_uart_initbd(struct uart_
 
 /**************************************************************/
 
-static inline unsigned long cpu2cpm_addr(void *addr)
+static inline unsigned long cpu2cpm_addr(void *addr, unsigned long offset)
 {
-	if ((unsigned long)addr >= CPM_ADDR)
-		return (unsigned long)addr;
+	if (((unsigned long)addr >= CPM_ADDR) 
+		|| ((unsigned long)addr >= CONFIG_CONSISTENT_START))
+		return (unsigned long)addr + offset;
 	return virt_to_bus(addr);
 }
 
-static inline void *cpm2cpu_addr(unsigned long addr)
+static inline void *cpm2cpu_addr(unsigned long addr, unsigned long offset)
 {
-	if (addr >= CPM_ADDR)
-		return (void *)addr;
+	if (((unsigned long)(addr - offset) >= CPM_ADDR) 
+		|| ((unsigned long)(addr - offset) >= CONFIG_CONSISTENT_START))
+		return (void *)(addr - offset);
 	return bus_to_virt(addr);
 }
 
@@ -260,7 +262,7 @@ static void cpm_uart_int_rx(struct uart_
 		}
 
 		/* get pointer */
-		cp = cpm2cpu_addr(bdp->cbd_bufaddr);
+		cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo->dma_offset);
 
 		/* loop through the buffer */
 		while (i-- > 0) {
@@ -441,7 +443,8 @@ static void cpm_uart_shutdown(struct uar
 		}
 
 		/* Shut them really down */
-		cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
+		if (IS_SMC(pinfo)) cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
+		else cpm_line_cr_cmd(line, CPM_CR_STOP_TX+1); /* Do graceful stop of SCC uart */
 	}
 }
 
@@ -603,7 +606,7 @@ static int cpm_uart_tx_pump(struct uart_
 		/* Pick next descriptor and fill from buffer */
 		bdp = pinfo->tx_cur;
 
-		p = cpm2cpu_addr(bdp->cbd_bufaddr);
+		p = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo->dma_offset);
 
 		*p++ = xmit->buf[xmit->tail];
 		bdp->cbd_datlen = 1;
@@ -630,7 +633,7 @@ static int cpm_uart_tx_pump(struct uart_
 
 	while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) {
 		count = 0;
-		p = cpm2cpu_addr(bdp->cbd_bufaddr);
+		p = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo->dma_offset);
 		while (count < pinfo->tx_fifosize) {
 			*p++ = xmit->buf[xmit->tail];
 			xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
@@ -668,6 +671,7 @@ static void cpm_uart_initbd(struct uart_
 {
 	int i;
 	u8 *mem_addr;
+	unsigned long dma_offset;
 	volatile cbd_t *bdp;
 
 	pr_debug("CPM uart[%d]:initbd\n", pinfo->port.line);
@@ -677,14 +681,15 @@ static void cpm_uart_initbd(struct uart_
 	 * virtual address for us to work with.
 	 */
 	mem_addr = pinfo->mem_addr;
+	dma_offset = pinfo->dma_offset;
 	bdp = pinfo->rx_cur = pinfo->rx_bd_base;
 	for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) {
-		bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
+		bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, dma_offset);
 		bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
 		mem_addr += pinfo->rx_fifosize;
 	}
 
-	bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
+	bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, dma_offset);
 	bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT;
 
 	/* Set the physical address of the host memory
@@ -694,12 +699,12 @@ static void cpm_uart_initbd(struct uart_
 	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
 	bdp = pinfo->tx_cur = pinfo->tx_bd_base;
 	for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
-		bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
+		bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, dma_offset);
 		bdp->cbd_sc = BD_SC_INTRPT;
 		mem_addr += pinfo->tx_fifosize;
 	}
 
-	bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
+	bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, dma_offset);
 	bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT;
 }
 
@@ -1029,7 +1034,7 @@ static void cpm_uart_console_write(struc
 		 * If the buffer address is in the CPM DPRAM, don't
 		 * convert it.
 		 */
-		cp = cpm2cpu_addr(bdp->cbd_bufaddr);
+		cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo->dma_offset);
 
 		*cp = *s;
 
@@ -1046,7 +1051,7 @@ static void cpm_uart_console_write(struc
 			while ((bdp->cbd_sc & BD_SC_READY) != 0)
 				;
 
-			cp = cpm2cpu_addr(bdp->cbd_bufaddr);
+			cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo->dma_offset);
 
 			*cp = 13;
 			bdp->cbd_datlen = 1;
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h
--- a/drivers/serial/cpm_uart/cpm_uart.h
+++ b/drivers/serial/cpm_uart/cpm_uart.h
@@ -64,6 +64,7 @@ struct uart_cpm_port {
 	uint			 dp_addr;
 	void			*mem_addr;
 	dma_addr_t		 dma_addr;
+	unsigned long	 dma_offset;
 	/* helpers */
 	int			 baud;
 	int			 bits;

^ permalink raw reply

* [RFC 1/2] powerpc: add all the iSeries virtual devices to the device tree
From: Stephen Rothwell @ 2006-04-25 11:54 UTC (permalink / raw)
  To: ppc-dev

We do this by putting them in the flattened device tree at setup time.
This required the flattened device tree blob to be made bigger.

Currently we don't do anything with these.

Also make a function static.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---

 arch/powerpc/platforms/iseries/setup.c |   87 ++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/iseries/vio.c   |    2 -
 2 files changed, 87 insertions(+), 2 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

676ab187518bfb5e48aa4c3cc418456e67a2ed70
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 3c51448..9ce2afc 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -45,6 +45,7 @@ #include <asm/paca.h>
 #include <asm/cache.h>
 #include <asm/sections.h>
 #include <asm/abs_addr.h>
+#include <asm/iseries/hv_types.h>
 #include <asm/iseries/hv_lp_config.h>
 #include <asm/iseries/hv_call_event.h>
 #include <asm/iseries/hv_call_xm.h>
@@ -710,7 +711,7 @@ define_machine(iseries) {
 };
 
 struct blob {
-	unsigned char data[PAGE_SIZE];
+	unsigned char data[PAGE_SIZE * 2];
 	unsigned long next;
 };
 
@@ -911,6 +912,88 @@ void dt_model(struct iseries_flat_dt *dt
 	dt_prop_str(dt, "compatible", "IBM,iSeries");
 }
 
+void dt_vdevices(struct iseries_flat_dt *dt)
+{
+	u32 reg = 0;
+	HvLpIndexMap vlan_map;
+	int i;
+	char buf[32];
+
+	dt_start_node(dt, "vdevice");
+	dt_prop_u32(dt, "#address-cells", 1);
+	dt_prop_u32(dt, "#size-cells", 0);
+
+	snprintf(buf, sizeof(buf), "viocons@%08x", reg);
+	dt_start_node(dt, buf);
+	dt_prop_str(dt, "device_type", "serial");
+	dt_prop_empty(dt, "compatible");
+	dt_prop_u32(dt, "reg", reg);
+	dt_end_node(dt);
+	reg++;
+
+	snprintf(buf, sizeof(buf), "v-scsi@%08x", reg);
+	dt_start_node(dt, buf);
+	dt_prop_str(dt, "device_type", "vscsi");
+	dt_prop_str(dt, "compatible", "IBM,v-scsi");
+	dt_prop_u32(dt, "reg", reg);
+	dt_end_node(dt);
+	reg++;
+
+	vlan_map = HvLpConfig_getVirtualLanIndexMap();
+	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
+		unsigned char mac_addr[6];
+
+		if ((vlan_map & (0x8000 >> i)) == 0)
+			continue;
+		snprintf(buf, 32, "vlan@%08x", reg + i);
+		dt_start_node(dt, buf);
+		dt_prop_str(dt, "device_type", "vlan");
+		dt_prop_empty(dt, "compatible");
+		dt_prop_u32(dt, "reg", reg + i);
+
+		mac_addr[0] = 0x02;
+		mac_addr[1] = 0x01;
+		mac_addr[2] = 0xff;
+		mac_addr[3] = i;
+		mac_addr[4] = 0xff;
+		mac_addr[5] = HvLpConfig_getLpIndex_outline();
+		dt_prop(dt, "local-mac-address", (char *)mac_addr, 6);
+		dt_prop(dt, "mac-address", (char *)mac_addr, 6);
+
+		dt_end_node(dt);
+	}
+	reg += HVMAXARCHITECTEDVIRTUALLANS;
+
+	for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++) {
+		snprintf(buf, 32, "viodasd@%08x", reg + i);
+		dt_start_node(dt, buf);
+		dt_prop_str(dt, "device_type", "viodasd");
+		dt_prop_empty(dt, "compatible");
+		dt_prop_u32(dt, "reg", reg + i);
+		dt_end_node(dt);
+	}
+	reg += HVMAXARCHITECTEDVIRTUALDISKS;
+	for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++) {
+		snprintf(buf, 32, "viocd@%08x", reg + i);
+		dt_start_node(dt, buf);
+		dt_prop_str(dt, "device_type", "viocd");
+		dt_prop_empty(dt, "compatible");
+		dt_prop_u32(dt, "reg", reg + i);
+		dt_end_node(dt);
+	}
+	reg += HVMAXARCHITECTEDVIRTUALCDROMS;
+	for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++) {
+		snprintf(buf, 32, "viotape@%08x", reg + i);
+		dt_start_node(dt, buf);
+		dt_prop_str(dt, "device_type", "viotape");
+		dt_prop_empty(dt, "compatible");
+		dt_prop_u32(dt, "reg", reg + i);
+		dt_end_node(dt);
+	}
+
+	dt_end_node(dt);
+}
+
 void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
 {
 	u64 tmp[2];
@@ -941,6 +1024,8 @@ void build_flat_dt(struct iseries_flat_d
 
 	dt_cpus(dt);
 
+	dt_vdevices(dt);
+
 	dt_end_node(dt);
 
 	dt_push_u32(dt, OF_DT_END);
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
index ad36ab0..22045a2 100644
--- a/arch/powerpc/platforms/iseries/vio.c
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -71,7 +71,7 @@ static struct vio_dev *__init vio_regist
 	return viodev;
 }
 
-void __init probe_bus_iseries(void)
+static void __init probe_bus_iseries(void)
 {
 	HvLpIndexMap vlan_map;
 	struct vio_dev *viodev;
-- 
1.3.1

^ permalink raw reply related

* [RFC 2/2] powerpc: use the device tree for the iSeries vio bus probe
From: Stephen Rothwell @ 2006-04-25 11:59 UTC (permalink / raw)
  To: ppc-dev
In-Reply-To: <20060425215405.648a16e7.sfr@canb.auug.org.au>

As an added bonus, since every vio_dev now has a device_node
associated with it, hotplug now works.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---

 arch/powerpc/kernel/vio.c              |  149 ++++++++++++++++++++++++++------
 arch/powerpc/platforms/iseries/setup.c |    5 +
 arch/powerpc/platforms/iseries/vio.c   |   79 ++++-------------
 arch/powerpc/platforms/pseries/vio.c   |  134 ++---------------------------
 drivers/block/viodasd.c                |    5 +
 drivers/cdrom/viocd.c                  |    5 +
 drivers/char/viotape.c                 |    4 -
 drivers/net/iseries_veth.c             |    7 +-
 include/asm-powerpc/iseries/vio.h      |    5 +
 include/asm-powerpc/vio.h              |    5 -
 10 files changed, 173 insertions(+), 225 deletions(-)

This has been booted on an iSeries 270 and compiled for pSeries.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

a8083bf970bafd0f7139b4b9bbbf12e3ed32e2f7
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 971020c..784528b 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -23,9 +23,6 @@ #include <asm/dma.h>
 #include <asm/vio.h>
 #include <asm/prom.h>
 
-static const struct vio_device_id *vio_match_device(
-		const struct vio_device_id *, const struct vio_dev *);
-
 struct vio_dev vio_bus_device  = { /* fake "parent" device */
 	.name = vio_bus_device.dev.bus_id,
 	.type = "",
@@ -35,6 +32,27 @@ struct vio_dev vio_bus_device  = { /* fa
 
 static struct vio_bus_ops vio_bus_ops;
 
+/**
+ * vio_match_device: - Tell if a VIO device has a matching
+ *			VIO device id structure.
+ * @ids:	array of VIO device id structures to search in
+ * @dev:	the VIO device structure to match against
+ *
+ * Used by a driver to check whether a VIO device present in the
+ * system is in its list of supported devices. Returns the matching
+ * vio_device_id structure or NULL if there is no match.
+ */
+static const struct vio_device_id *vio_match_device(
+		const struct vio_device_id *ids, const struct vio_dev *dev)
+{
+	while (ids->type[0] != '\0') {
+		if (vio_bus_ops.match(ids, dev))
+			return ids;
+		ids++;
+	}
+	return NULL;
+}
+
 /*
  * Convert from struct device to struct vio_dev and pass to driver.
  * dev->driver has already been set by generic code because vio_bus_match
@@ -107,25 +125,70 @@ void vio_unregister_driver(struct vio_dr
 EXPORT_SYMBOL(vio_unregister_driver);
 
 /**
- * vio_match_device: - Tell if a VIO device has a matching
- *			VIO device id structure.
- * @ids:	array of VIO device id structures to search in
- * @dev:	the VIO device structure to match against
+ * vio_register_device_node: - Register a new vio device.
+ * @of_node:	The OF node for this device.
  *
- * Used by a driver to check whether a VIO device present in the
- * system is in its list of supported devices. Returns the matching
- * vio_device_id structure or NULL if there is no match.
+ * Creates and initializes a vio_dev structure from the data in
+ * of_node (dev.platform_data) and adds it to the list of virtual devices.
+ * Returns a pointer to the created vio_dev or NULL if node has
+ * NULL device_type or compatible fields.
  */
-static const struct vio_device_id *vio_match_device(
-		const struct vio_device_id *ids, const struct vio_dev *dev)
+struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
 {
-	while (ids->type[0] != '\0') {
-		if (vio_bus_ops.match(ids, dev))
-			return ids;
-		ids++;
+	struct vio_dev *viodev;
+	unsigned int *unit_address;
+	unsigned int *irq_p;
+
+	/* we need the 'device_type' property, in order to match with drivers */
+	if (of_node->type == NULL) {
+		printk(KERN_WARNING "%s: node %s missing 'device_type'\n",
+				__FUNCTION__,
+				of_node->name ? of_node->name : "<unknown>");
+		return NULL;
 	}
-	return NULL;
+
+	unit_address = (unsigned int *)get_property(of_node, "reg", NULL);
+	if (unit_address == NULL) {
+		printk(KERN_WARNING "%s: node %s missing 'reg'\n",
+				__FUNCTION__,
+				of_node->name ? of_node->name : "<unknown>");
+		return NULL;
+	}
+
+	/* allocate a vio_dev for this node */
+	viodev = kzalloc(sizeof(struct vio_dev), GFP_KERNEL);
+	if (viodev == NULL)
+		return NULL;
+
+	viodev->dev.platform_data = of_node_get(of_node);
+
+	viodev->irq = NO_IRQ;
+	irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
+	if (irq_p) {
+		int virq = virt_irq_create_mapping(*irq_p);
+		if (virq == NO_IRQ) {
+			printk(KERN_ERR "Unable to allocate interrupt "
+			       "number for %s\n", of_node->full_name);
+		} else
+			viodev->irq = irq_offset_up(virq);
+	}
+
+	snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
+	viodev->name = of_node->name;
+	viodev->type = of_node->type;
+	viodev->unit_address = *unit_address;
+	viodev->iommu_table = vio_bus_ops.build_iommu_table(viodev);
+
+	/* register with generic device framework */
+	if (vio_register_device(viodev) == NULL) {
+		/* XXX free TCE table */
+		kfree(viodev);
+		return NULL;
+	}
+
+	return viodev;
 }
+EXPORT_SYMBOL(vio_register_device_node);
 
 /**
  * vio_bus_init: - Initialize the virtual IO bus
@@ -133,6 +196,7 @@ static const struct vio_device_id *vio_m
 int __init vio_bus_init(struct vio_bus_ops *ops)
 {
 	int err;
+	struct device_node *node_vroot;
 
 	vio_bus_ops = *ops;
 
@@ -153,23 +217,54 @@ int __init vio_bus_init(struct vio_bus_o
 		return err;
 	}
 
+	node_vroot = find_devices("vdevice");
+	if (node_vroot) {
+		struct device_node *of_node;
+
+		/*
+		 * Create struct vio_devices for each virtual device in
+		 * the device tree. Drivers will associate with them later.
+		 */
+		for (of_node = node_vroot->child; of_node != NULL;
+				of_node = of_node->sibling) {
+			printk(KERN_DEBUG "%s: processing %p\n",
+					__FUNCTION__, of_node);
+			vio_register_device_node(of_node);
+		}
+	}
+
 	return 0;
 }
 
 /* vio_dev refcount hit 0 */
 static void __devinit vio_dev_release(struct device *dev)
 {
-	if (vio_bus_ops.release_device)
-		vio_bus_ops.release_device(dev);
+	if (dev->platform_data) {
+		/* XXX free TCE table */
+		of_node_put(dev->platform_data);
+	}
 	kfree(to_vio_dev(dev));
 }
 
-static ssize_t viodev_show_name(struct device *dev,
+static ssize_t name_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
 {
 	return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
 }
-DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL);
+
+static ssize_t devspec_show(struct device *dev,
+		struct device_attribute *attr, char *buf)
+{
+	struct device_node *of_node = dev->platform_data;
+
+	return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
+}
+
+static struct device_attribute vio_dev_attrs[] = {
+	__ATTR_RO(name),
+	__ATTR_RO(devspec),
+	__ATTR_NULL
+};
 
 struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev)
 {
@@ -184,16 +279,12 @@ struct vio_dev * __devinit vio_register_
 				__FUNCTION__, viodev->dev.bus_id);
 		return NULL;
 	}
-	device_create_file(&viodev->dev, &dev_attr_name);
 
 	return viodev;
 }
 
 void __devinit vio_unregister_device(struct vio_dev *viodev)
 {
-	if (vio_bus_ops.unregister_device)
-		vio_bus_ops.unregister_device(viodev);
-	device_remove_file(&viodev->dev, &dev_attr_name);
 	device_unregister(&viodev->dev);
 }
 EXPORT_SYMBOL(vio_unregister_device);
@@ -267,22 +358,23 @@ static int vio_hotplug(struct device *de
 			char *buffer, int buffer_size)
 {
 	const struct vio_dev *vio_dev = to_vio_dev(dev);
+	struct device_node *dn = dev->platform_data;
 	char *cp;
 	int length;
 
 	if (!num_envp)
 		return -ENOMEM;
 
-	if (!vio_dev->dev.platform_data)
+	if (!dn)
 		return -ENODEV;
-	cp = (char *)get_property(vio_dev->dev.platform_data, "compatible", &length);
+	cp = (char *)get_property(dn, "compatible", &length);
 	if (!cp)
 		return -ENODEV;
 
 	envp[0] = buffer;
 	length = scnprintf(buffer, buffer_size, "MODALIAS=vio:T%sS%s",
 				vio_dev->type, cp);
-	if (buffer_size - length <= 0)
+	if ((buffer_size - length) <= 0)
 		return -ENOMEM;
 	envp[1] = NULL;
 	return 0;
@@ -290,6 +382,7 @@ static int vio_hotplug(struct device *de
 
 struct bus_type vio_bus_type = {
 	.name = "vio",
+	.dev_attrs = vio_dev_attrs,
 	.uevent = vio_hotplug,
 	.match = vio_bus_match,
 	.probe = vio_bus_probe,
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 9ce2afc..af5609a 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -54,6 +54,7 @@ #include <asm/iseries/mf.h>
 #include <asm/iseries/it_exp_vpd_panel.h>
 #include <asm/iseries/hv_lp_event.h>
 #include <asm/iseries/lpar_map.h>
+#include <asm/iseries/vio.h>
 #include <asm/udbg.h>
 #include <asm/irq.h>
 
@@ -939,6 +940,7 @@ void dt_vdevices(struct iseries_flat_dt 
 	dt_end_node(dt);
 	reg++;
 
+	vio_first_vlan_unit = reg;
 	vlan_map = HvLpConfig_getVirtualLanIndexMap();
 	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
 		unsigned char mac_addr[6];
@@ -964,6 +966,7 @@ void dt_vdevices(struct iseries_flat_dt 
 	}
 	reg += HVMAXARCHITECTEDVIRTUALLANS;
 
+	vio_first_viodasd_unit = reg;
 	for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++) {
 		snprintf(buf, 32, "viodasd@%08x", reg + i);
 		dt_start_node(dt, buf);
@@ -973,6 +976,7 @@ void dt_vdevices(struct iseries_flat_dt 
 		dt_end_node(dt);
 	}
 	reg += HVMAXARCHITECTEDVIRTUALDISKS;
+	vio_first_viocd_unit = reg;
 	for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++) {
 		snprintf(buf, 32, "viocd@%08x", reg + i);
 		dt_start_node(dt, buf);
@@ -982,6 +986,7 @@ void dt_vdevices(struct iseries_flat_dt 
 		dt_end_node(dt);
 	}
 	reg += HVMAXARCHITECTEDVIRTUALCDROMS;
+	vio_first_viotape_unit = reg;
 	for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++) {
 		snprintf(buf, 32, "viotape@%08x", reg + i);
 		dt_start_node(dt, buf);
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
index 22045a2..5cd197b 100644
--- a/arch/powerpc/platforms/iseries/vio.c
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -24,6 +24,15 @@ #include <asm/iseries/hv_call_xm.h>
 
 #include "iommu.h"
 
+int vio_first_vlan_unit;
+EXPORT_SYMBOL(vio_first_vlan_unit);
+int vio_first_viodasd_unit;
+EXPORT_SYMBOL(vio_first_viodasd_unit);
+int vio_first_viocd_unit;
+EXPORT_SYMBOL(vio_first_viocd_unit);
+int vio_first_viotape_unit;
+EXPORT_SYMBOL(vio_first_viotape_unit);
+
 struct device *iSeries_vio_dev = &vio_bus_device.dev;
 EXPORT_SYMBOL(iSeries_vio_dev);
 
@@ -43,58 +52,11 @@ static void __init iommu_vio_init(void)
 		printk("Virtual Bus VIO TCE table failed.\n");
 }
 
-/**
- * vio_register_device_iseries: - Register a new iSeries vio device.
- * @voidev:	The device to register.
- */
-static struct vio_dev *__init vio_register_device_iseries(char *type,
-		uint32_t unit_num)
-{
-	struct vio_dev *viodev;
-
-	/* allocate a vio_dev for this device */
-	viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
-	if (!viodev)
-		return NULL;
-	memset(viodev, 0, sizeof(struct vio_dev));
-
-	snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s%d", type, unit_num);
-
-	viodev->name = viodev->dev.bus_id;
-	viodev->type = type;
-	viodev->unit_address = unit_num;
-	viodev->iommu_table = &vio_iommu_table;
-	if (vio_register_device(viodev) == NULL) {
-		kfree(viodev);
-		return NULL;
-	}
-	return viodev;
-}
-
-static void __init probe_bus_iseries(void)
+static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
 {
-	HvLpIndexMap vlan_map;
-	struct vio_dev *viodev;
-	int i;
-
-	/* there is only one of each of these */
-	vio_register_device_iseries("viocons", 0);
-	vio_register_device_iseries("vscsi", 0);
-
-	vlan_map = HvLpConfig_getVirtualLanIndexMap();
-	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
-		if ((vlan_map & (0x8000 >> i)) == 0)
-			continue;
-		viodev = vio_register_device_iseries("vlan", i);
-		/* veth is special and has it own iommu_table */
-		viodev->iommu_table = &veth_iommu_table;
-	}
-	for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++)
-		vio_register_device_iseries("viodasd", i);
-	for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++)
-		vio_register_device_iseries("viocd", i);
-	for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++)
-		vio_register_device_iseries("viotape", i);
+	if (strcmp(dev->type, "vlan") == 0)
+		return &veth_iommu_table;
+	return &vio_iommu_table;
 }
 
 /**
@@ -109,6 +71,7 @@ static int vio_match_device_iseries(cons
 
 static struct vio_bus_ops vio_bus_ops_iseries = {
 	.match = vio_match_device_iseries,
+	.build_iommu_table = vio_build_iommu_table,
 };
 
 /**
@@ -116,16 +79,10 @@ static struct vio_bus_ops vio_bus_ops_is
  */
 static int __init vio_bus_init_iseries(void)
 {
-	int err;
-
-	err = vio_bus_init(&vio_bus_ops_iseries);
-	if (err == 0) {
-		iommu_vio_init();
-		vio_bus_device.iommu_table = &vio_iommu_table;
-		iSeries_vio_dev = &vio_bus_device.dev;
-		probe_bus_iseries();
-	}
-	return err;
+	iommu_vio_init();
+	vio_bus_device.iommu_table = &vio_iommu_table;
+	iSeries_vio_dev = &vio_bus_device.dev;
+	return vio_bus_init(&vio_bus_ops_iseries);
 }
 
 __initcall(vio_bus_init_iseries);
diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 8e53e04..8f9e3a6 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -26,26 +26,6 @@ #include <asm/tce.h>
 
 extern struct subsystem devices_subsys; /* needed for vio_find_name() */
 
-static void probe_bus_pseries(void)
-{
-	struct device_node *node_vroot, *of_node;
-
-	node_vroot = find_devices("vdevice");
-	if ((node_vroot == NULL) || (node_vroot->child == NULL))
-		/* this machine doesn't do virtual IO, and that's ok */
-		return;
-
-	/*
-	 * Create struct vio_devices for each virtual device in the device tree.
-	 * Drivers will associate with them later.
-	 */
-	for (of_node = node_vroot->child; of_node != NULL;
-			of_node = of_node->sibling) {
-		printk(KERN_DEBUG "%s: processing %p\n", __FUNCTION__, of_node);
-		vio_register_device_node(of_node);
-	}
-}
-
 /**
  * vio_match_device_pseries: - Tell if a pSeries VIO device matches a
  *	vio_device_id
@@ -57,47 +37,6 @@ static int vio_match_device_pseries(cons
 			device_is_compatible(dev->dev.platform_data, id->compat);
 }
 
-static void vio_release_device_pseries(struct device *dev)
-{
-	/* XXX free TCE table */
-	of_node_put(dev->platform_data);
-}
-
-static ssize_t viodev_show_devspec(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct device_node *of_node = dev->platform_data;
-
-	return sprintf(buf, "%s\n", of_node->full_name);
-}
-DEVICE_ATTR(devspec, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_devspec, NULL);
-
-static void vio_unregister_device_pseries(struct vio_dev *viodev)
-{
-	device_remove_file(&viodev->dev, &dev_attr_devspec);
-}
-
-static struct vio_bus_ops vio_bus_ops_pseries = {
-	.match = vio_match_device_pseries,
-	.unregister_device = vio_unregister_device_pseries,
-	.release_device = vio_release_device_pseries,
-};
-
-/**
- * vio_bus_init_pseries: - Initialize the pSeries virtual IO bus
- */
-static int __init vio_bus_init_pseries(void)
-{
-	int err;
-
-	err = vio_bus_init(&vio_bus_ops_pseries);
-	if (err == 0)
-		probe_bus_pseries();
-	return err;
-}
-
-__initcall(vio_bus_init_pseries);
-
 /**
  * vio_build_iommu_table: - gets the dma information from OF and
  *	builds the TCE tree.
@@ -136,73 +75,20 @@ static struct iommu_table *vio_build_iom
 	return iommu_init_table(newTceTable);
 }
 
+static struct vio_bus_ops vio_bus_ops_pseries = {
+	.match = vio_match_device_pseries,
+	.build_iommu_table = vio_build_iommu_table,
+};
+
 /**
- * vio_register_device_node: - Register a new vio device.
- * @of_node:	The OF node for this device.
- *
- * Creates and initializes a vio_dev structure from the data in
- * of_node (dev.platform_data) and adds it to the list of virtual devices.
- * Returns a pointer to the created vio_dev or NULL if node has
- * NULL device_type or compatible fields.
+ * vio_bus_init_pseries: - Initialize the pSeries virtual IO bus
  */
-struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
+static int __init vio_bus_init_pseries(void)
 {
-	struct vio_dev *viodev;
-	unsigned int *unit_address;
-	unsigned int *irq_p;
-
-	/* we need the 'device_type' property, in order to match with drivers */
-	if ((NULL == of_node->type)) {
-		printk(KERN_WARNING
-			"%s: node %s missing 'device_type'\n", __FUNCTION__,
-			of_node->name ? of_node->name : "<unknown>");
-		return NULL;
-	}
-
-	unit_address = (unsigned int *)get_property(of_node, "reg", NULL);
-	if (!unit_address) {
-		printk(KERN_WARNING "%s: node %s missing 'reg'\n", __FUNCTION__,
-			of_node->name ? of_node->name : "<unknown>");
-		return NULL;
-	}
-
-	/* allocate a vio_dev for this node */
-	viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
-	if (!viodev) {
-		return NULL;
-	}
-	memset(viodev, 0, sizeof(struct vio_dev));
-
-	viodev->dev.platform_data = of_node_get(of_node);
-
-	viodev->irq = NO_IRQ;
-	irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
-	if (irq_p) {
-		int virq = virt_irq_create_mapping(*irq_p);
-		if (virq == NO_IRQ) {
-			printk(KERN_ERR "Unable to allocate interrupt "
-			       "number for %s\n", of_node->full_name);
-		} else
-			viodev->irq = irq_offset_up(virq);
-	}
-
-	snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
-	viodev->name = of_node->name;
-	viodev->type = of_node->type;
-	viodev->unit_address = *unit_address;
-	viodev->iommu_table = vio_build_iommu_table(viodev);
-
-	/* register with generic device framework */
-	if (vio_register_device(viodev) == NULL) {
-		/* XXX free TCE table */
-		kfree(viodev);
-		return NULL;
-	}
-	device_create_file(&viodev->dev, &dev_attr_devspec);
-
-	return viodev;
+	return vio_bus_init(&vio_bus_ops_pseries);
 }
-EXPORT_SYMBOL(vio_register_device_node);
+
+__initcall(vio_bus_init_pseries);
 
 /**
  * vio_get_attribute: - get attribute for virtual device
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index f63e07b..1dbcc35 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -718,7 +718,8 @@ static DRIVER_ATTR(probe, S_IWUSR, NULL,
 
 static int viodasd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 {
-	struct viodasd_device *d = &viodasd_devices[vdev->unit_address];
+	struct viodasd_device *d =
+		&viodasd_devices[vdev->unit_address - vio_first_viodasd_unit];
 
 	d->dev = &vdev->dev;
 	probe_disk(d);
@@ -731,7 +732,7 @@ static int viodasd_remove(struct vio_dev
 {
 	struct viodasd_device *d;
 
-	d = &viodasd_devices[vdev->unit_address];
+	d = &viodasd_devices[vdev->unit_address - vio_first_viodasd_unit];
 	if (d->disk) {
 		del_gendisk(d->disk);
 		blk_cleanup_queue(d->disk->queue);
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index c0f817b..8547b35 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -649,7 +649,7 @@ static int viocd_probe(struct vio_dev *v
 	struct cdrom_info *ci;
 	struct request_queue *q;
 
-	deviceno = vdev->unit_address;
+	deviceno = vdev->unit_address - vio_first_viocd_unit;
 	if (deviceno >= viocd_numdev)
 		return -ENODEV;
 
@@ -714,7 +714,8 @@ out:
 
 static int viocd_remove(struct vio_dev *vdev)
 {
-	struct disk_info *d = &viocd_diskinfo[vdev->unit_address];
+	struct disk_info *d =
+		&viocd_diskinfo[vdev->unit_address - vio_first_viocd_unit];
 
 	if (unregister_cdrom(&d->viocd_info) != 0)
 		printk(VIOCD_KERN_WARNING
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index 60aabdb..e2c69f1 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -944,7 +944,7 @@ static void vioHandleTapeEvent(struct Hv
 static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 {
 	char tapename[32];
-	int i = vdev->unit_address;
+	int i = vdev->unit_address - vio_first_viotape_unit;
 	int j;
 
 	if (i >= viotape_numdev)
@@ -974,7 +974,7 @@ static int viotape_probe(struct vio_dev 
 
 static int viotape_remove(struct vio_dev *vdev)
 {
-	int i = vdev->unit_address;
+	int i = vdev->unit_address - vio_first_viotape_unit;
 
 	devfs_remove("iseries/nvt%d", i);
 	devfs_remove("iseries/vt%d", i);
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index f0f04be..1b98915 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -77,6 +77,7 @@ #include <asm/uaccess.h>
 #include <asm/iseries/hv_lp_config.h>
 #include <asm/iseries/hv_types.h>
 #include <asm/iseries/hv_lp_event.h>
+#include <asm/iseries/vio.h>
 #include <asm/iommu.h>
 #include <asm/vio.h>
 
@@ -1577,7 +1578,7 @@ static int veth_remove(struct vio_dev *v
 	struct veth_port *port;
 	int i;
 
-	dev = veth_dev[vdev->unit_address];
+	dev = veth_dev[vdev->unit_address - vio_first_vlan_unit];
 
 	if (! dev)
 		return 0;
@@ -1593,7 +1594,7 @@ static int veth_remove(struct vio_dev *v
 		}
 	}
 
-	veth_dev[vdev->unit_address] = NULL;
+	veth_dev[vdev->unit_address - vio_first_vlan_unit] = NULL;
 	kobject_del(&port->kobject);
 	kobject_put(&port->kobject);
 	unregister_netdev(dev);
@@ -1604,7 +1605,7 @@ static int veth_remove(struct vio_dev *v
 
 static int veth_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 {
-	int i = vdev->unit_address;
+	int i = vdev->unit_address - vio_first_vlan_unit;
 	struct net_device *dev;
 	struct veth_port *port;
 
diff --git a/include/asm-powerpc/iseries/vio.h b/include/asm-powerpc/iseries/vio.h
index 72a97d3..fe073e6 100644
--- a/include/asm-powerpc/iseries/vio.h
+++ b/include/asm-powerpc/iseries/vio.h
@@ -126,4 +126,9 @@ struct device;
 
 extern struct device *iSeries_vio_dev;
 
+extern int vio_first_vlan_unit;
+extern int vio_first_viodasd_unit;
+extern int vio_first_viocd_unit;
+extern int vio_first_viotape_unit;
+
 #endif /* _ASM_POWERPC_ISERIES_VIO_H */
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h
index 0544ece..dea55c7 100644
--- a/include/asm-powerpc/vio.h
+++ b/include/asm-powerpc/vio.h
@@ -66,8 +66,7 @@ struct vio_driver {
 
 struct vio_bus_ops {
 	int (*match)(const struct vio_device_id *id, const struct vio_dev *dev);
-	void (*unregister_device)(struct vio_dev *);
-	void (*release_device)(struct device *);
+	struct iommu_table *(*build_iommu_table)(struct vio_dev *dev);
 };
 
 extern struct dma_mapping_ops vio_dma_ops;
@@ -82,11 +81,11 @@ extern void __devinit vio_unregister_dev
 
 extern int vio_bus_init(struct vio_bus_ops *);
 
-#ifdef CONFIG_PPC_PSERIES
 struct device_node;
 
 extern struct vio_dev * __devinit vio_register_device_node(
 		struct device_node *node_vdev);
+#ifdef CONFIG_PPC_PSERIES
 extern struct vio_dev *vio_find_node(struct device_node *vnode);
 extern const void *vio_get_attribute(struct vio_dev *vdev, void *which,
 		int *length);
-- 
1.3.1

^ permalink raw reply related

* Re: [RFC 1/2] powerpc: add all the iSeries virtual devices to the device tree
From: Michael Ellerman @ 2006-04-25 13:17 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev
In-Reply-To: <20060425215405.648a16e7.sfr@canb.auug.org.au>

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

On Tue, 2006-04-25 at 21:54 +1000, Stephen Rothwell wrote:
> We do this by putting them in the flattened device tree at setup time.
> This required the flattened device tree blob to be made bigger.

Fully sick! As the kids say .. I hear.

We should probably think about allocating the blob at run time, just by
sticking it at klimit. I think I decided that was a good idea, I just
never got around to coding it up.

> 676ab187518bfb5e48aa4c3cc418456e67a2ed70
> diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
> index 3c51448..9ce2afc 100644
> --- a/arch/powerpc/platforms/iseries/setup.c
> +++ b/arch/powerpc/platforms/iseries/setup.c
> @@ -45,6 +45,7 @@ #include <asm/paca.h>
>  #include <asm/cache.h>
>  #include <asm/sections.h>
>  #include <asm/abs_addr.h>
> +#include <asm/iseries/hv_types.h>
>  #include <asm/iseries/hv_lp_config.h>
>  #include <asm/iseries/hv_call_event.h>
>  #include <asm/iseries/hv_call_xm.h>
> @@ -710,7 +711,7 @@ define_machine(iseries) {
>  };
>  
>  struct blob {
> -	unsigned char data[PAGE_SIZE];
> +	unsigned char data[PAGE_SIZE * 2];
>  	unsigned long next;
>  };
>  
> @@ -911,6 +912,88 @@ void dt_model(struct iseries_flat_dt *dt
>  	dt_prop_str(dt, "compatible", "IBM,iSeries");
>  }
>  
> +void dt_vdevices(struct iseries_flat_dt *dt)
> +{
> +	u32 reg = 0;
> +	HvLpIndexMap vlan_map;
> +	int i;
> +	char buf[32];
> +
> +	dt_start_node(dt, "vdevice");
> +	dt_prop_u32(dt, "#address-cells", 1);
> +	dt_prop_u32(dt, "#size-cells", 0);
> +
> +	snprintf(buf, sizeof(buf), "viocons@%08x", reg);
> +	dt_start_node(dt, buf);
> +	dt_prop_str(dt, "device_type", "serial");
> +	dt_prop_empty(dt, "compatible");
> +	dt_prop_u32(dt, "reg", reg);
> +	dt_end_node(dt);
> +	reg++;
> +
> +	snprintf(buf, sizeof(buf), "v-scsi@%08x", reg);
> +	dt_start_node(dt, buf);
> +	dt_prop_str(dt, "device_type", "vscsi");
> +	dt_prop_str(dt, "compatible", "IBM,v-scsi");
> +	dt_prop_u32(dt, "reg", reg);
> +	dt_end_node(dt);
> +	reg++;
> +
> +	vlan_map = HvLpConfig_getVirtualLanIndexMap();
> +	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
> +		unsigned char mac_addr[6];

ETH_ALEN instead of 6 ?

> +
> +		if ((vlan_map & (0x8000 >> i)) == 0)
> +			continue;
> +		snprintf(buf, 32, "vlan@%08x", reg + i);
> +		dt_start_node(dt, buf);
> +		dt_prop_str(dt, "device_type", "vlan");
> +		dt_prop_empty(dt, "compatible");
> +		dt_prop_u32(dt, "reg", reg + i);
> +
> +		mac_addr[0] = 0x02;
> +		mac_addr[1] = 0x01;
> +		mac_addr[2] = 0xff;
> +		mac_addr[3] = i;
> +		mac_addr[4] = 0xff;
> +		mac_addr[5] = HvLpConfig_getLpIndex_outline();
> +		dt_prop(dt, "local-mac-address", (char *)mac_addr, 6);
> +		dt_prop(dt, "mac-address", (char *)mac_addr, 6);

Ditto, ditto.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply

* Re: [RFC 2/2] powerpc: use the device tree for the iSeries vio bus probe
From: Michael Ellerman @ 2006-04-25 13:22 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev
In-Reply-To: <20060425215950.36c01f2b.sfr@canb.auug.org.au>

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

On Tue, 2006-04-25 at 21:59 +1000, Stephen Rothwell wrote:
> As an added bonus, since every vio_dev now has a device_node
> associated with it, hotplug now works.
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

> diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
> index 9ce2afc..af5609a 100644
> --- a/arch/powerpc/platforms/iseries/setup.c
> +++ b/arch/powerpc/platforms/iseries/setup.c
> @@ -54,6 +54,7 @@ #include <asm/iseries/mf.h>
>  #include <asm/iseries/it_exp_vpd_panel.h>
>  #include <asm/iseries/hv_lp_event.h>
>  #include <asm/iseries/lpar_map.h>
> +#include <asm/iseries/vio.h>
>  #include <asm/udbg.h>
>  #include <asm/irq.h>
>  
> @@ -939,6 +940,7 @@ void dt_vdevices(struct iseries_flat_dt 
>  	dt_end_node(dt);
>  	reg++;
>  
> +	vio_first_vlan_unit = reg;
>  	vlan_map = HvLpConfig_getVirtualLanIndexMap();
>  	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
>  		unsigned char mac_addr[6];
> @@ -964,6 +966,7 @@ void dt_vdevices(struct iseries_flat_dt 
>  	}
>  	reg += HVMAXARCHITECTEDVIRTUALLANS;
>  
> +	vio_first_viodasd_unit = reg;
>  	for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++) {
>  		snprintf(buf, 32, "viodasd@%08x", reg + i);
>  		dt_start_node(dt, buf);
> @@ -973,6 +976,7 @@ void dt_vdevices(struct iseries_flat_dt 
>  		dt_end_node(dt);
>  	}
>  	reg += HVMAXARCHITECTEDVIRTUALDISKS;
> +	vio_first_viocd_unit = reg;
>  	for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++) {
>  		snprintf(buf, 32, "viocd@%08x", reg + i);
>  		dt_start_node(dt, buf);
> @@ -982,6 +986,7 @@ void dt_vdevices(struct iseries_flat_dt 
>  		dt_end_node(dt);
>  	}
>  	reg += HVMAXARCHITECTEDVIRTUALCDROMS;
> +	vio_first_viotape_unit = reg;
>  	for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++) {
>  		snprintf(buf, 32, "viotape@%08x", reg + i);
>  		dt_start_node(dt, buf);
> diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
> index 22045a2..5cd197b 100644
> --- a/arch/powerpc/platforms/iseries/vio.c
> +++ b/arch/powerpc/platforms/iseries/vio.c
> @@ -24,6 +24,15 @@ #include <asm/iseries/hv_call_xm.h>
>  
>  #include "iommu.h"
>  
> +int vio_first_vlan_unit;
> +EXPORT_SYMBOL(vio_first_vlan_unit);
> +int vio_first_viodasd_unit;
> +EXPORT_SYMBOL(vio_first_viodasd_unit);
> +int vio_first_viocd_unit;
> +EXPORT_SYMBOL(vio_first_viocd_unit);
> +int vio_first_viotape_unit;
> +EXPORT_SYMBOL(vio_first_viotape_unit);

Why do we need these guys? If we have to have them then I'd rather they
were in the device tree, rather than have the "bootloader" passing info
to the kernel via globals.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply

* maple_defconfig - CONFIG_ALTIVEC is not set
From: Stephen Winiecki @ 2006-04-25 13:29 UTC (permalink / raw)
  To: linuxppc-dev

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





Is there a reason why ALTIVEC is not enabled in maple_defconfig?  Can it be
enabled in future versions?

Thanks,

Steve

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

^ permalink raw reply

* Kernel panic on mpc852.
From: Gautam Borad @ 2006-04-25 13:57 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,
I'm trying to port linux-2.4.21 to mpc852t custom board.
The bootloader (u-boot) works fine and the kernel boots.
The kernel is _VERY_ unstable, in that it gives sig 11
( Oops: kernel access of bad area, sig: 11 ) at random
intervals.
I've created this short test program :

    int *testmem;
    g = atoi(argv[1]);
    if(( testmem =(int*)malloc(1024*g)) == NULL ) {
        printf("mem test failed at iteration : %d",i);
        exit(0);
    }
    bzero(testmem,1024*g);
    printf("mem test at 0x%08x \t i = %d\n",testmem,i);

We have 32MB RAM.The above code never returns cleanly,
it always gives panic with sig 11.
I've added a printk to arch/ppc/mm/fault.c kernel for debugging purpose

    if (!(vma->vm_flags & VM_GROWSDOWN)){
        printk("\nerror : vm_start = 0x%08x  Address = 0x%08x\n 
",vma->vm_start,address);
        goto bad_area;
    }

Sample output:

[root]$ ./b0memtest 64

mem test at 0x10010c60   i = 0
mem test at 0x10020c68   i = 1
....
mem test at 0x10140cf8   i = 19
mem test at 0x10150d00   i = 20
mem test at 0x10160d08   i = 21

<comment> The following is my printk from arch/ppc/mm/fault.c </comment>

vm_start = 0x10000000 vm_end = 0x10001000 Address = 0x00000024  <===== 
Why is it trying to access 0x00000024

 Oops: kernel access of bad area, sig: 11
 NIP: C000B80C XER: 00000000 LR: C000B7F4 SP: C1D59F00 REGS: c1d59e50 
TRAP: 0300    Not tainted
 MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
 DAR: 00000024, DSISR: 0000000B
 TASK = c1d58000[32] 'b0memtest' Last syscall: 4
 last math 00000000 last altivec 00000000
 GPR00: 00000005 C1D59F00 C1D58000 00009032 C1F22C3C C1D59EA0 C0138258 
00000000
 GPR08: C1D58000 00000006 C0136050 00000000 44004082 00000000 00000000 
00000000
 GPR16: 00000000 00000000 00000000 00000000 C0160000 C0140000 C0130000 
C0140000
 GPR24: C00025C0 10000A00 7FFFFB40 00000020 C1D58000 C0144940 00000000 
C1D59F00
 Call backtrace:
 10000A00 C000286C 3003B55E 30068BF8 3006954C 300690F8 3006CA50
 30068024 10000788 300593A4 00000000

[root]$ ./b0memtest 128

mem test at 0x10010c60   i = 0
mem test at 0x10030c68   i = 1
....
mem test at 0x10190cc0   i = 12
mem test at 0x101b0cc8   i = 13

<comment> Again the same address </comment>

vm_start = 0x10000000 vm_end = 0x10001000 Address = 0x00000024   <=====

 Oops: kernel access of bad area, sig: 11
 NIP: C000B80C XER: 00000000 LR: C000B7F4 SP: C1DE1F00 REGS: c1de1e50 
TRAP: 0300    Not tainted
 MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
 DAR: 00000024, DSISR: 0000000B
 TASK = c1de0000[24] 'b0memtest' Last syscall: 45
 last math 00000000 last altivec 00000000
 GPR00: 00000005 C1DE1F00 C1DE0000 00009032 00001032 000000E4 C0138258 
00000000
 GPR08: C1DE0000 00000006 C0136050 00000000 04000084 00000000 00000000 
00000000
 GPR16: 00000000 00000000 00000000 00000000 C0160000 C0140000 C0130000 
C0140000
 GPR24: C0003F78 10000A00 00000002 100004D8 C1DE0000 C0144940 00000000 
C1DE1F00
 Call backtrace:
 C000402C C000286C 30074024 10000728 300593A4 00000000

Thanks in advance.

^ permalink raw reply

* Re: 85xx FDT updates?
From: Kumar Gala @ 2006-04-25 14:05 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <20060425074902.GA20228@gate.ebshome.net>


On Apr 25, 2006, at 2:49 AM, Eugene Surovegin wrote:

> On Tue, Apr 25, 2006 at 01:08:00AM -0500, Kumar Gala wrote:
>>
>> On Apr 24, 2006, at 5:31 PM, Dan Malek wrote:
>>
>>>
>>> On Apr 24, 2006, at 5:43 PM, Kumar Gala wrote:
>>>
>>>> However, I am against removing the arch/ppc support until the u- 
>>>> boot
>>>> patches are picked up.  I think its bad form to give people a  
>>>> kernel
>>>> they can't easily boot.
>>>
>>> What about systems that can't update u-boot, but want to run
>>> a newer kernel?
>>
>> Does this situation exist for any in tree boards that are supported?
>
> Kumar, with all due respect, I don't like this attitude. I can have
> eval board where I don't want to upgrade firmware.
>
> Also, this "let's screw everybody who doesn't have their board support
> in tree" is very counter productive. FYI, almost all my contributed
> kernel work was done on custom hardware, not on reference boards.
>
> It seems some people here lost touch with reality - embedded Linux is
> mostly run on custom hardware, not on evaluation boards.

Well, first all I said was that we shouldn't remove arch/ppc support  
until the u-boot patches are in.  I made no statement about when  
after that we should remove arch/ppc support.

Second, this seems normal like normal kernel development to me.  I  
think its reasonable to pick some time frame after which we will  
remove the support and to let everyone know what that is.  I see this  
as no different than having a driver outside of the kernel tree and  
having it break when APIs change.

- kumar

^ permalink raw reply

* Re: Rebuilding FS MDS 8349 BSP & JFFS2 integration
From: Kumar Gala @ 2006-04-25 14:18 UTC (permalink / raw)
  To: Krawczuk, Victor; +Cc: linuxppc-embedded
In-Reply-To: <64A27FD84D948C48ABF3250BF78446FD01B7DF5D@OTTSVW100.gdcan.com>


On Apr 24, 2006, at 4:30 PM, Krawczuk, Victor wrote:

> Hi,
>
> I am a newbie to Linux but not to embedded PPC. I was hoping =20
> someone could point me to the direction here. I apologize in =20
> advance if this is kindergarten stuff.
>
> I downloaded the MDS-8349 Linux BSP from FreeScale. I was able to =20
> burn the default prebuilt images "uboot" and "jffs2.img" to my =20
> MDS-8349 (PB) board and have uboot tftp the prebuilt "uImage" to my =20=

> PB. I used "tftpboot 200000 uImage" to download and "bootm" to =20
> boot.  As per included instructions, I had "setenv bootargs root=3D/=20=

> dev/mtdblock1 rootfstype=3Djffs2 rw console=3DttyS0,115200" in uboot, =20=

> followed by a "saveenv". The prebuilt Linux (uImage) came up, no =20
> problem.
>
> As I need to include USB Host support to the PPC kernel, I used the =20=

> ltib tool to reconfigure and rebuild Linux, as well as a matching =20
> jffs2 (I would think). Ltib produced vmlinux.gz.uboot and =20
> rootfs.jffs2 for me.  For some reason, rootfs.jffs2 was =20
> significantly smaller than the prebuilt "jffs2.img" (2483184 bytes =20
> vs. 4325376 bytes). I'm not sure why. I then did the following:
Questions regarding the Freescale BSP are best directed at Freescale =20
as they have a custom kernel they are providing with their BSPs.
> bootargs is still set to "root=3D/dev/mtdblock1 rootfstype=3Djffs2 rw =20=

> console=3DttyS0,115200"  in uboot:
>
> Using the same (prebuilt) uboot as before:
>
> - tftpboot 400000 rootfs.jffs2 (rebuilt jffs2)
> - erase fe020000 fe5fffff
> - cp.b 400000 fe020000 25e3f0
>
> - tftpboot 200000 vmlinux.gz.uboot (rebuilt Linux containing USB =20
> Host stuff)
> - bootm
>
> Linux could not boot!  I got the following root FS error:
>
> [stuff deleted=85]
> io scheduler deadline registered
> io scheduler cfq registered
> RAMDISK driver initialized: 16 RAM disks of 32768K size 1024 blocksize
> loop: loaded (max 8 devices)
> eth0: Gianfar Ethernet Controller Version 1.1, 00:04:9f:00:2d:b7
> eth0: Running with NAPI disabled
> eth0: 64/64 RX/TX BD ring size
> eth1: Gianfar Ethernet Controller Version 1.1, 00:04:9f:00:2d:b8
> eth1: Running with NAPI disabled
> eth1: 64/64 RX/TX BD ring size
> i2c /dev entries driver
> NET: Registered protocol family 2
> IP: routing cache hash table of 2048 buckets, 16Kbytes
> TCP established hash table entries: 16384 (order: 5, 131072 bytes)
> TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
> TCP: Hash tables configured (established 16384 bind 16384)
> NET: Registered protocol family 1
> NET: Registered protocol family 17
> Root-NFS: No NFS server available, giving up.
> VFS: Unable to mount root fs via NFS, trying floppy.
> VFS: Cannot open root device "mtdblock1" or unknown-block(2,0)
> Please append a correct "root=3D" boot option
> Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-=20=

> block(2,0)
>  <0>Rebooting in 180 seconds..
>
> Would anybody happen to know what is going wrong?  How am I =20
> supposed to know the correct "root=3D" boot option for a rebuilt =20
> jffs2 using LTIB, if that is my problem?
Where there any messages related to MTD or flash in the boot log?  If =20=

not that would seem to be the first place to look.

- kumar=

^ permalink raw reply


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