LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* PPC arch and spinlocks
From: Garcia Jérémie @ 2005-06-08 14:29 UTC (permalink / raw)
  To: linuxppc-dev

Hi everybody, I need your help one more time.
I'm new to kernel device driver (linux newbie) and I'd like to control =
concurrent access
to our hardware resources. (I'm working on a ppc405EP platform =
uniprocessor)
Reading the Allessandro Rubini book (Linux device drivers) and many =
lists and guides on the web,
I concluded that spinlocks were very adapted to my expectations.
So, I decided to declare a spinlock in my module and offer, via ioctl, =
the possibilty to user
space programs to handle it with spin_trylock(), spin_lock() and =
spin_unlock().
Unfortunately I saw that was not working properly and so, I wanted to =
debug the "spinlock-process"
printing the value of it after calling one of the above routine:=20

spinlock_t my_spinlock =3D SPIN_UNLOCKED;
[...]
spin_try_lock(&my_spinlock);
printk("value: %d\n",my_spinlock.lock);
[...]

At compile time, I had an error that told me no "lock" member for this =
type of structure.
And it was write, cause I investigated and noticed that the definition =
used for "spinlock_t"=20
structure was the following in <linux/spinlock.h>:

#if (__GNUC__ > 2 || __GNUC_MINOR__ > 95) =20
  typedef struct { } spinlock_t;
  #define SPIN_LOCK_UNLOCKED (spinlock_t) { }   //  empty structure...
[...]

I don't understand cause I thought that spinlocks were recommended for =
SMP platforms but could be
safely used in uni-processor platforms too.=20
So did I miss something to be able to use them (in config?? is it =
specific to PPC arch??)?
If not, is there a way to get a similar behavior with others technics =
(mutex??). I saw Posix mutex? Are they
usable in kernel mode?
I really need to have an equivalent of the spin_trylock() routine in =
order not to have the processus waiting till
the semaphore is available when tryin to get it. (ask and take if =
available, but not sleep).

Please give me some tips.
Tks a lot for your precious help!!
Jeremie

^ permalink raw reply

* Re: MPC8272 runs application with segmentation fault
From: Kumar Gala @ 2005-06-08 13:52 UTC (permalink / raw)
  To: Nai-Hsien; +Cc: linuxppc-embedded
In-Reply-To: <010301c56c2f$7fbb4810$0102000a@loop.com.tw>

A few questions, where did you get the kernel for the 8272 you are 
using?  Can you report back what libc version you are running with.  
Also, can see what entry in arch/ppc/kernel/cputable.c has a pvr_value 
of 0x00820000 and report that back as well.

- kumar

On Jun 8, 2005, at 8:39 AM, Nai-Hsien wrote:

> Andrew,
> I believe I already modify my u-boot to detect the processor.
>
> If I statically link my program, I find that the program can run
> on my MPC8272 platform properly, so I think maybe the problem
> is caused by shared library. However, the same file system (of course,
> same shared library) can run on my MPC8245 platform.
>
> With the observation, I think my kernel is not handling shared library
> properly. Is there any part of the kernel I should check?
>
> I added some code in do_page_fault() to dump some information, shown
> as below, when my program get problem.
>
> PID=34(console): Trap=300, NIP=0x0ffc6d90, LR=0x0ffc6d20, VM: 
> (start=0x30000000,
> end=0x30017000, flags=0x00000875), addr=0x2e313056
> Segmentation fault
>
> Thank you
> Dennis
>
>
> ----- Original Message -----
> From: Andrew  <mailto:awilliam@nortel.com> Williams
> To: Nai-Hsien <mailto:dennis@loop.com.tw>  ; 
> linuxppc-embedded@ozlabs.org
> Sent: Tuesday, June 07, 2005 10:17 PM
> Subject: RE: MPC8272 runs application with segmentation fault
>
> Take a alook at the checkcpu() routine in /cpu/mpc8260/cpu.c .
> Validate that your CPU is correctly being identified, and thus 
> initialized.
> We had identical symptoms with the 8270.
>
> We added the following after the case for the PVR_8260_HIP7:
>
>         case PVR_8280a_HIP7:
>         case PVR_8280_HIP7:
>                 k = 7;
>                 printf (CPU_ID_STR " (HiP%d Rev %02x, Mask ", k, rev);
>                 break;
>
> include/asm-ppc/processor.h
>
>     #define PVR_8280_HIP7   0x80822013
>     #define PVR_8280a_HIP7   0x80822014
>
> A.
>
> -----Original Message-----
> From: linuxppc-embedded-bounces@ozlabs.org 
> [mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Nai-Hsien
> Sent: June 7, 2005 9:11 AM
> To: linuxppc-embedded@ozlabs.org
> Subject: MPC8272 runs application with segmentation fault
>
>
> Dear experts,
>
> I have two hardware boards, one uses MPC8245 and the other one uses 
> MPC8272.
> Initially, I use the MPC8245 board to port Linux 2.4.20 and write some 
> applications.
> I already do a lot of test on the MPC8245 board and all my application 
> programs work
> fine.
>
> After this, I use the same kernel configuration and same file system 
> that are being used
> by the MPC8245 board to port the whole system to my MPC8272.
> Now, I can boot the kernel and run busybox well. However, when
> I run my application programs, I always get segmentation fault. 
> Following is a strace
> dump. Could anybody give me some idea?
>
> Thank you
> Dennis
>
> ====================================================
> execve("sbin/console", ["sbin/console"], [/* 6 vars */]) = 0
> uname({sys="Linux", node="6200_linux", ...}) = 0
> brk(0)                                  = 0x10059134
> open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or 
> directory)
> open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or 
> directory)
> open("/lib/libncurses.so.5", O_RDONLY)  = 3
> read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\001"..., 
> 1024) = 1024
> fstat64(0x3, 0x7ffff098)                = 0
> mmap(0xff97000, 362628, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
> 0xff97000
> mprotect(0xffd4000, 112772, PROT_NONE)  = 0
> mmap(0xffd7000, 86016, PROT_READ|PROT_WRITE|PROT_EXEC, 
> MAP_PRIVATE|MAP_FIXED, 3, 0x30000) = 0xffd7000
> mmap(0xffec000, 14468, PROT_READ|PROT_WRITE|PROT_EXEC, 
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffec000
> close(3)                                = 0
> open("/lib/libdl.so.2", O_RDONLY)       = 3
> read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\34"..., 
> 1024) = 1024
> fstat64(0x3, 0x7ffff078)                = 0
> mmap(0xff74000, 74812, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
> 0xff74000
> mprotect(0xff77000, 62524, PROT_NONE)   = 0
> mmap(0xff84000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC, 
> MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xff84000
> close(3)                                = 0
> open("/lib/libnsl.so.1", O_RDONLY)      = 3
> read(3, 
> "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0A\274"..., 1024) 
> = 1024
> fstat64(0x3, 0x7ffff058)                = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
> 0) = 0x30017000
> mmap(0xff3e000, 152068, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
> 0xff3e000
> mprotect(0xff51000, 74244, PROT_NONE)   = 0
> mmap(0xff5e000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC, 
> MAP_PRIVATE|MAP_FIXED, 3, 0x10000) = 0xff5e000
> mmap(0xff61000, 8708, PROT_READ|PROT_WRITE|PROT_EXEC, 
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff61000
> close(3)                                = 0
> open("/lib/libc.so.6", O_RDONLY)        = 3
> read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\322"..., 
> 1024) = 1024
> fstat64(0x3, 0x7ffff038)                = 0
> mmap(0xfddd000, 1379388, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
> 0xfddd000
> mprotect(0xff16000, 97340, PROT_NONE)   = 0
> mmap(0xff1d000, 61440, PROT_READ|PROT_WRITE|PROT_EXEC, 
> MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0xff1d000
> mmap(0xff2c000, 7228, PROT_READ|PROT_WRITE|PROT_EXEC, 
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff2c000
> close(3)                                = 0
> brk(0)                                  = 0x10059134
> brk(0x1005a134)                         = 0x1005a134
> brk(0x1005b000)                         = 0x1005b000
> write(2, "before init_ncurses()\n", 22) = 22
> write(2, "before initscr()\n", 17)      = 17
> access("/usr/share/terminfo/v/vt100", R_OK) = 0
> open("/usr/share/terminfo/v/vt100", O_RDONLY) = 3
> read(3, "\32\1,\0\25\0\7\0\16\1\3\2", 12) = 12
> read(3, "vt100|vt100-am|dec vt100 (w/adva"..., 44) = 44
> read(3, "\0\1\0\0\1\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\1", 21) = 21
> read(3, "\0", 1)                        = 1
> read(3, "P\0\10\0\30\0\377\377\377\377\377\377\3\0", 14) = 14
> read(3, "\377\377\0\0\2\0\4\0\25\0\32\0&\0.\0\377\377\377\3777\0"..., 
> 540) = 540
> read(3, "\7\0\r\0\33[%i%p1%d;%p2%dr\0\33[3g\0\33[H\33[J"..., 515) = 515
> read(3, "", 1)                          = 0
> read(3, "", 10)                         = 0
> close(3)                                = 0
> -- SIGSEGV (Segmentation fault) @ 0 (0) ---
> +++ killed by SIGSEGV +++
> Segmentation fault
>
>
>
> <ATT169162.txt>

^ permalink raw reply

* RE: Getting ownership for various boards/platforms configs
From: Baxter, Robert @ 2005-06-08 13:45 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list, Linux PPC Embedded list

> -----Original Message-----
> From: Paul Mackerras [mailto:paulus@samba.org]=20
> Sent: Tuesday, June 07, 2005 9:43 PM
> To: Baxter, Robert
> Cc: Linux PPC Embedded list; linuxppc-dev list
> Subject: RE: Getting ownership for various boards/platforms configs
>=20
> Baxter, Robert writes:
>=20
> > > gemini
> >=20
> > I'll take this one.
>=20
> Great!  There are some changes to head.S that I have been wanting to
> make for a while: specifically I want to remove the special case for
> starting the second processor on gemini and the call to
> gemini_prom_init.
>=20
> Does current 2.6 work on gemini?
>=20
> Paul.
>=20

Yes, you may remove the special case for starting the second processor
and the call to gemini_prom_init.  I'm currenting in the middle of
getting our stuff over to 2.6, so the current answer would be no.

--
-Rob

^ permalink raw reply

* Re: MPC8272 runs application with segmentation fault
From: Nai-Hsien @ 2005-06-08 13:39 UTC (permalink / raw)
  To: Andrew Williams, linuxppc-embedded
In-Reply-To: <713043CE8B8E1348AF3C546DBE02C1B403AC5D5C@zcarhxm2.corp.nortel.com>

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

MessageAndrew,
I believe I already modify my u-boot to detect the processor.

If I statically link my program, I find that the program can run
on my MPC8272 platform properly, so I think maybe the problem
is caused by shared library. However, the same file system (of course,
same shared library) can run on my MPC8245 platform.

With the observation, I think my kernel is not handling shared library
properly. Is there any part of the kernel I should check?

I added some code in do_page_fault() to dump some information, shown
as below, when my program get problem.

PID=34(console): Trap=300, NIP=0x0ffc6d90, LR=0x0ffc6d20, VM: (start=0x30000000,
end=0x30017000, flags=0x00000875), addr=0x2e313056
Segmentation fault

Thank you
Dennis

  ----- Original Message ----- 
  From: Andrew Williams 
  To: Nai-Hsien ; linuxppc-embedded@ozlabs.org 
  Sent: Tuesday, June 07, 2005 10:17 PM
  Subject: RE: MPC8272 runs application with segmentation fault


  Take a alook at the checkcpu() routine in /cpu/mpc8260/cpu.c .
  Validate that your CPU is correctly being identified, and thus initialized. 
  We had identical symptoms with the 8270. 

  We added the following after the case for the PVR_8260_HIP7:
     
          case PVR_8280a_HIP7:
          case PVR_8280_HIP7:
                  k = 7;
                  printf (CPU_ID_STR " (HiP%d Rev %02x, Mask ", k, rev);
                  break;

  include/asm-ppc/processor.h

      #define PVR_8280_HIP7   0x80822013 
      #define PVR_8280a_HIP7   0x80822014 

  A.
    -----Original Message-----
    From: linuxppc-embedded-bounces@ozlabs.org [mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Nai-Hsien
    Sent: June 7, 2005 9:11 AM
    To: linuxppc-embedded@ozlabs.org
    Subject: MPC8272 runs application with segmentation fault


    Dear experts,

    I have two hardware boards, one uses MPC8245 and the other one uses MPC8272.
    Initially, I use the MPC8245 board to port Linux 2.4.20 and write some applications.
    I already do a lot of test on the MPC8245 board and all my application programs work
    fine.

    After this, I use the same kernel configuration and same file system that are being used
    by the MPC8245 board to port the whole system to my MPC8272.
    Now, I can boot the kernel and run busybox well. However, when
    I run my application programs, I always get segmentation fault. Following is a strace
    dump. Could anybody give me some idea?

    Thank you
    Dennis

    ====================================================
    execve("sbin/console", ["sbin/console"], [/* 6 vars */]) = 0
    uname({sys="Linux", node="6200_linux", ...}) = 0
    brk(0)                                  = 0x10059134
    open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or directory)
    open("/lib/libncurses.so.5", O_RDONLY)  = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\001"..., 1024) = 1024
    fstat64(0x3, 0x7ffff098)                = 0
    mmap(0xff97000, 362628, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff97000
    mprotect(0xffd4000, 112772, PROT_NONE)  = 0
    mmap(0xffd7000, 86016, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x30000) = 0xffd7000
    mmap(0xffec000, 14468, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffec000
    close(3)                                = 0
    open("/lib/libdl.so.2", O_RDONLY)       = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\34"..., 1024) = 1024
    fstat64(0x3, 0x7ffff078)                = 0
    mmap(0xff74000, 74812, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff74000
    mprotect(0xff77000, 62524, PROT_NONE)   = 0
    mmap(0xff84000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xff84000
    close(3)                                = 0
    open("/lib/libnsl.so.1", O_RDONLY)      = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0A\274"..., 1024) = 1024
    fstat64(0x3, 0x7ffff058)                = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30017000
    mmap(0xff3e000, 152068, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff3e000
    mprotect(0xff51000, 74244, PROT_NONE)   = 0
    mmap(0xff5e000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x10000) = 0xff5e000
    mmap(0xff61000, 8708, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff61000
    close(3)                                = 0
    open("/lib/libc.so.6", O_RDONLY)        = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\322"..., 1024) = 1024
    fstat64(0x3, 0x7ffff038)                = 0
    mmap(0xfddd000, 1379388, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xfddd000
    mprotect(0xff16000, 97340, PROT_NONE)   = 0
    mmap(0xff1d000, 61440, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0xff1d000
    mmap(0xff2c000, 7228, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff2c000
    close(3)                                = 0
    brk(0)                                  = 0x10059134
    brk(0x1005a134)                         = 0x1005a134
    brk(0x1005b000)                         = 0x1005b000
    write(2, "before init_ncurses()\n", 22) = 22
    write(2, "before initscr()\n", 17)      = 17
    access("/usr/share/terminfo/v/vt100", R_OK) = 0
    open("/usr/share/terminfo/v/vt100", O_RDONLY) = 3
    read(3, "\32\1,\0\25\0\7\0\16\1\3\2", 12) = 12
    read(3, "vt100|vt100-am|dec vt100 (w/adva"..., 44) = 44
    read(3, "\0\1\0\0\1\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\1", 21) = 21
    read(3, "\0", 1)                        = 1
    read(3, "P\0\10\0\30\0\377\377\377\377\377\377\3\0", 14) = 14
    read(3, "\377\377\0\0\2\0\4\0\25\0\32\0&\0.\0\377\377\377\3777\0"..., 540) = 540
    read(3, "\7\0\r\0\33[%i%p1%d;%p2%dr\0\33[3g\0\33[H\33[J"..., 515) = 515
    read(3, "", 1)                          = 0
    read(3, "", 10)                         = 0
    close(3)                                = 0
    -- SIGSEGV (Segmentation fault) @ 0 (0) ---
    +++ killed by SIGSEGV +++
    Segmentation fault


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

^ permalink raw reply

* consistent_alloc() on 82xx
From: Alex Zeffertt @ 2005-06-08  9:29 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

I need to allocate un-cached memory on an 82xx and consistent_alloc() in
arch/ppc/mm/cachemap.c appears to be the thing I need.  However, this
code only seems to be built for 8xx and 4xx platforms, and not 6xx
platforms. Specifically, it is built if CONFIG_NOT_COHERENT_CACHE is
defined, which is the case if

	CONFIG_8xx = y, or
	CONFIG_4xx = y, but not if
	CONFIG_6xx = y

Does anybody know why it isn't built for 6xx cores?

I'm working on the ATM driver and it seems that certain external memory
areas accessed by the PQII CPM by-pass the cache.  So it would seem to
me that CONFIG_NOT_COHERENT_CACHE would actually be applicable for these
processors too....

Alex

^ permalink raw reply

* Re: [UPDATE] Getting ownership for various boards/platforms configs
From: Gabriel Paubert @ 2005-06-08  9:24 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list, Linux PPC Embedded list
In-Reply-To: <d0e588f233a722f3175a48a7fe146c0f@freescale.com>

On Tue, Jun 07, 2005 at 04:47:35PM -0500, Kumar Gala wrote:
> The following boards have no owners and if they dont get one the plan 
> is to kill them:
> 
> ep405
> mvme5100
> pcore

Actually mvme5100 and pplus could easily be merged with generic
PreP IIRC. At least I wrote a bootloader that remapped my
MVME2400/2600/2700 to look like an MVME5100 (CHRP memory map
but residual data and no OF). This allows much larger
windows to map to the VME bus (which is often very
sparsely populated).

The only real difference at boot between MVME5100 and
pplus is the mapping of physical addresses to PCI
I/O and memory space, and perhaps also the way to access
the console device. But I don't have any MVME5100 nor
do I plan do buy one (perhaps an MVME6100 but the host
bridge is completely different).

The question is whether we want a residual data to 
pseudo OF device-tree translator in the bootloader
or another way of passing board data to the kernel.
 
	Gabriel

^ permalink raw reply

* Re: [PATCH][4/5] RapidIO support: ppc32
From: Matt Porter @ 2005-06-08  5:52 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linux-kernel, linuxppc-embedded
In-Reply-To: <3648449bcd3a154bcf9b92930f74f3d9@freescale.com>

On Tue, Jun 07, 2005 at 11:43:26PM -0500, Kumar Gala wrote:
> Two questions:
> 1. how well does will all of this handle > 32-bit phys addr?

It does and it doesn't handle > 32-bit phys addr. It depends on which
configuration you are talking about.  If you are talking about I/O
>32-bit, it's no problem.  If you are talking about handling DMA >32-bit,
then we need to handle a 64-bit DMA addr in the ppc32 implementations and
also extend the arch messaging interface to let callers know when an
implementation can handle high DMA (system memory >4GB). This is all
pretty easy to handle once we need to support such a processor. So
far, nothing is available publicly. :)

For RIO MMIO purposes (which is functionality I'm working on now),
it has the similar issues that PCI memory space has on processors with
I/O above 4GB.  However, on RIO our resources hold a bus address since
a physical address doesn't make sense since address spaces our per-device.
If we ever support a 66-bit address space device on 32-bit processor, we
might need a u64 resource.

> 2. can we make any of this a platform driver?

Hrm, so you would rather see RIO host bridges look like a driver
on another "bus"?  I have seen them as a component just like PCI
host bridges.  That is, they are instantiated by arch-code and
then initialized by a subsys initcall. This does mean that we
will be enumerating much later (during driver initcalls), but
it might be a better model if we ever see a rumored PCIE->RIO
bridge. Supporting that as a RIO master port would require driver
time init of the RIO fabric. There's some ordering issues that we'd
have to see about working out. None of this is needed right now,
though.
 
> I would prefer if we could have the memory offsets and irq's not be 
> straight from the #define's

I think this and #2 are separate issues. We can pass the mpc85xx
rio init code some parameters to abstract things to different
parts. This is similar to how we init different SoC's PCI host
bridges with some common code on PPC32 (marvell, 85xx, etc). 

I was just looking at doing this to support RIO on the 8548. At
the time I wrote this 85xx support there wasn't any info on the
8548 available, but it's an easy thing to extend.

-Matt

^ permalink raw reply

* Re: [PATCH][4/5] RapidIO support: ppc32
From: Kumar Gala @ 2005-06-08  4:43 UTC (permalink / raw)
  To: Matt Porter; +Cc: linux-kernel, linuxppc-embedded
In-Reply-To: <11180976151080@foobar.com>

Two questions:
1. how well does will all of this handle > 32-bit phys addr?
2. can we make any of this a platform driver?

I would prefer if we could have the memory offsets and irq's not be 
straight from the #define's

- kumar

On Jun 6, 2005, at 5:40 PM, Matt Porter wrote:

> Adds PPC32 RIO support.  Init code for the MPC85xx RIO ports
> and glue for the STx GP3 board to use it.
>
> Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
>
> diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
> --- a/arch/ppc/Kconfig
> +++ b/arch/ppc/Kconfig
> @@ -1177,6 +1177,14 @@ source "drivers/pci/Kconfig"
>
>  source "drivers/pcmcia/Kconfig"
>
> +config RAPIDIO
> +	bool "RapidIO support" if MPC8540 || MPC8560
> +	help
> +	  If you say Y here, the kernel will include drivers and
> +	  infrastructure code to support RapidIO interconnect devices.
> +
> +source "drivers/rio/Kconfig"
> +
>  endmenu
>
>  menu "Advanced setup"
> diff --git a/arch/ppc/configs/stx_gp3_defconfig 
> b/arch/ppc/configs/stx_gp3_defconfig
> --- a/arch/ppc/configs/stx_gp3_defconfig
> +++ b/arch/ppc/configs/stx_gp3_defconfig
> @@ -1,7 +1,7 @@
>  #
>  # Automatically generated make config: don't edit
> -# Linux kernel version: 2.6.11-rc2
> -# Wed Jan 26 14:32:58 2005
> +# Linux kernel version: 2.6.12-rc4
> +# Tue May 24 18:11:04 2005
>  #
>  CONFIG_MMU=y
>  CONFIG_GENERIC_HARDIRQS=y
> @@ -11,6 +11,7 @@ CONFIG_HAVE_DEC_LOCK=y
>  CONFIG_PPC=y
>  CONFIG_PPC32=y
>  CONFIG_GENERIC_NVRAM=y
> +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
>
>  #
>  # Code maturity level options
> @@ -18,6 +19,7 @@ CONFIG_GENERIC_NVRAM=y
>  CONFIG_EXPERIMENTAL=y
>  CONFIG_CLEAN_COMPILE=y
>  CONFIG_BROKEN_ON_SMP=y
> +CONFIG_INIT_ENV_ARG_LIMIT=32
>
>  #
>  # General setup
> @@ -29,7 +31,6 @@ CONFIG_SYSVIPC=y
>  # CONFIG_BSD_PROCESS_ACCT is not set
>  CONFIG_SYSCTL=y
>  # CONFIG_AUDIT is not set
> -CONFIG_LOG_BUF_SHIFT=14
>  CONFIG_HOTPLUG=y
>  CONFIG_KOBJECT_UEVENT=y
>  # CONFIG_IKCONFIG is not set
> @@ -37,6 +38,9 @@ CONFIG_EMBEDDED=y
>  CONFIG_KALLSYMS=y
>  # CONFIG_KALLSYMS_ALL is not set
>  # CONFIG_KALLSYMS_EXTRA_PASS is not set
> +CONFIG_PRINTK=y
> +CONFIG_BUG=y
> +CONFIG_BASE_FULL=y
>  CONFIG_FUTEX=y
>  CONFIG_EPOLL=y
>  # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
> @@ -46,6 +50,7 @@ CONFIG_CC_ALIGN_LABELS=0
>  CONFIG_CC_ALIGN_LOOPS=0
>  CONFIG_CC_ALIGN_JUMPS=0
>  # CONFIG_TINY_SHMEM is not set
> +CONFIG_BASE_SMALL=0
>
>  #
>  # Loadable module support
> @@ -69,9 +74,11 @@ CONFIG_KMOD=y
>  CONFIG_E500=y
>  CONFIG_BOOKE=y
>  CONFIG_FSL_BOOKE=y
> +# CONFIG_PHYS_64BIT is not set
>  # CONFIG_SPE is not set
>  CONFIG_MATH_EMULATION=y
>  # CONFIG_CPU_FREQ is not set
> +# CONFIG_PM is not set
>  CONFIG_85xx=y
>  CONFIG_PPC_INDIRECT_PCI_BE=y
>
> @@ -96,6 +103,7 @@ CONFIG_HIGHMEM=y
>  CONFIG_BINFMT_ELF=y
>  CONFIG_BINFMT_MISC=m
>  # CONFIG_CMDLINE_BOOL is not set
> +CONFIG_ISA_DMA_API=y
>
>  #
>  # Bus options
> @@ -104,15 +112,15 @@ CONFIG_PCI=y
>  CONFIG_PCI_DOMAINS=y
>  # CONFIG_PCI_LEGACY_PROC is not set
>  # CONFIG_PCI_NAMES is not set
> +# CONFIG_PCI_DEBUG is not set
>
>  #
>  # PCCARD (PCMCIA/CardBus) support
>  #
>  # CONFIG_PCCARD is not set
> -
> -#
> -# PC-card bridges
> -#
> +CONFIG_RAPIDIO=y
> +CONFIG_RAPIDIO_8_BIT_TRANSPORT=y
> +CONFIG_RAPIDIO_DISC_TIMEOUT=30
>
>  #
>  # Advanced setup
> @@ -152,7 +160,7 @@ CONFIG_PARPORT=m
>  CONFIG_PARPORT_PC=m
>  # CONFIG_PARPORT_PC_FIFO is not set
>  # CONFIG_PARPORT_PC_SUPERIO is not set
> -# CONFIG_PARPORT_OTHER is not set
> +# CONFIG_PARPORT_GSC is not set
>  # CONFIG_PARPORT_1284 is not set
>
>  #
> @@ -264,7 +272,6 @@ CONFIG_SCSI_CONSTANTS=y
>  # CONFIG_SCSI_BUSLOGIC is not set
>  # CONFIG_SCSI_DMX3191D is not set
>  # CONFIG_SCSI_EATA is not set
> -# CONFIG_SCSI_EATA_PIO is not set
>  # CONFIG_SCSI_FUTURE_DOMAIN is not set
>  # CONFIG_SCSI_GDTH is not set
>  # CONFIG_SCSI_IPS is not set
> @@ -274,7 +281,6 @@ CONFIG_SCSI_CONSTANTS=y
>  # CONFIG_SCSI_IMM is not set
>  # CONFIG_SCSI_SYM53C8XX_2 is not set
>  # CONFIG_SCSI_IPR is not set
> -# CONFIG_SCSI_QLOGIC_ISP is not set
>  # CONFIG_SCSI_QLOGIC_FC is not set
>  # CONFIG_SCSI_QLOGIC_1280 is not set
>  CONFIG_SCSI_QLA2XXX=m
> @@ -283,6 +289,7 @@ CONFIG_SCSI_QLA2XXX=m
>  # CONFIG_SCSI_QLA2300 is not set
>  # CONFIG_SCSI_QLA2322 is not set
>  # CONFIG_SCSI_QLA6312 is not set
> +# CONFIG_SCSI_LPFC is not set
>  # CONFIG_SCSI_DC395x is not set
>  # CONFIG_SCSI_DC390T is not set
>  # CONFIG_SCSI_NSP32 is not set
> @@ -322,7 +329,6 @@ CONFIG_NET=y
>  #
>  CONFIG_PACKET=y
>  # CONFIG_PACKET_MMAP is not set
> -# CONFIG_NETLINK_DEV is not set
>  CONFIG_UNIX=y
>  # CONFIG_NET_KEY is not set
>  CONFIG_INET=y
> @@ -431,7 +437,7 @@ CONFIG_IP_NF_NAT_FTP=m
>  #
>  # Network testing
>  #
> -# CONFIG_NET_PKTGEN is not set
> +CONFIG_NET_PKTGEN=y
>  # CONFIG_NETPOLL is not set
>  # CONFIG_NET_POLL_CONTROLLER is not set
>  # CONFIG_HAMRADIO is not set
> @@ -499,6 +505,7 @@ CONFIG_GFAR_NAPI=y
>  # Wan interfaces
>  #
>  # CONFIG_WAN is not set
> +CONFIG_RIONET=y
>  # CONFIG_FDDI is not set
>  # CONFIG_HIPPI is not set
>  # CONFIG_PLIP is not set
> @@ -536,20 +543,6 @@ CONFIG_INPUT_EVDEV=m
>  # CONFIG_INPUT_EVBUG is not set
>
>  #
> -# Input I/O drivers
> -#
> -# CONFIG_GAMEPORT is not set
> -CONFIG_SOUND_GAMEPORT=y
> -CONFIG_SERIO=y
> -CONFIG_SERIO_I8042=y
> -CONFIG_SERIO_SERPORT=y
> -# CONFIG_SERIO_CT82C710 is not set
> -# CONFIG_SERIO_PARKBD is not set
> -# CONFIG_SERIO_PCIPS2 is not set
> -CONFIG_SERIO_LIBPS2=y
> -# CONFIG_SERIO_RAW is not set
> -
> -#
>  # Input Device Drivers
>  #
>  CONFIG_INPUT_KEYBOARD=y
> @@ -567,6 +560,19 @@ CONFIG_MOUSE_PS2=y
>  # CONFIG_INPUT_MISC is not set
>
>  #
> +# Hardware I/O ports
> +#
> +CONFIG_SERIO=y
> +CONFIG_SERIO_I8042=y
> +CONFIG_SERIO_SERPORT=y
> +# CONFIG_SERIO_PARKBD is not set
> +# CONFIG_SERIO_PCIPS2 is not set
> +CONFIG_SERIO_LIBPS2=y
> +# CONFIG_SERIO_RAW is not set
> +# CONFIG_GAMEPORT is not set
> +CONFIG_SOUND_GAMEPORT=y
> +
> +#
>  # Character devices
>  #
>  # CONFIG_VT is not set
> @@ -590,6 +596,7 @@ CONFIG_SERIAL_CPM_SCC2=y
>  # CONFIG_SERIAL_CPM_SCC4 is not set
>  # CONFIG_SERIAL_CPM_SMC1 is not set
>  # CONFIG_SERIAL_CPM_SMC2 is not set
> +# CONFIG_SERIAL_JSM is not set
>  CONFIG_UNIX98_PTYS=y
>  CONFIG_LEGACY_PTYS=y
>  CONFIG_LEGACY_PTY_COUNT=256
> @@ -626,6 +633,11 @@ CONFIG_DRM=m
>  # CONFIG_RAW_DRIVER is not set
>
>  #
> +# TPM devices
> +#
> +# CONFIG_TCG_TPM is not set
> +
> +#
>  # I2C support
>  #
>  CONFIG_I2C=m
> @@ -648,12 +660,12 @@ CONFIG_I2C_ALGOBIT=m
>  # CONFIG_I2C_AMD8111 is not set
>  # CONFIG_I2C_I801 is not set
>  # CONFIG_I2C_I810 is not set
> +# CONFIG_I2C_PIIX4 is not set
>  # CONFIG_I2C_ISA is not set
>  # CONFIG_I2C_MPC is not set
>  # CONFIG_I2C_NFORCE2 is not set
>  # CONFIG_I2C_PARPORT is not set
>  # CONFIG_I2C_PARPORT_LIGHT is not set
> -# CONFIG_I2C_PIIX4 is not set
>  # CONFIG_I2C_PROSAVAGE is not set
>  # CONFIG_I2C_SAVAGE4 is not set
>  # CONFIG_SCx200_ACB is not set
> @@ -677,7 +689,9 @@ CONFIG_I2C_ALGOBIT=m
>  # CONFIG_SENSORS_ASB100 is not set
>  # CONFIG_SENSORS_DS1621 is not set
>  # CONFIG_SENSORS_FSCHER is not set
> +# CONFIG_SENSORS_FSCPOS is not set
>  # CONFIG_SENSORS_GL518SM is not set
> +# CONFIG_SENSORS_GL520SM is not set
>  # CONFIG_SENSORS_IT87 is not set
>  # CONFIG_SENSORS_LM63 is not set
>  # CONFIG_SENSORS_LM75 is not set
> @@ -688,9 +702,11 @@ CONFIG_I2C_ALGOBIT=m
>  # CONFIG_SENSORS_LM85 is not set
>  # CONFIG_SENSORS_LM87 is not set
>  # CONFIG_SENSORS_LM90 is not set
> +# CONFIG_SENSORS_LM92 is not set
>  # CONFIG_SENSORS_MAX1619 is not set
>  # CONFIG_SENSORS_PC87360 is not set
>  # CONFIG_SENSORS_SMSC47B397 is not set
> +# CONFIG_SENSORS_SIS5595 is not set
>  # CONFIG_SENSORS_SMSC47M1 is not set
>  # CONFIG_SENSORS_VIA686A is not set
>  # CONFIG_SENSORS_W83781D is not set
> @@ -700,10 +716,12 @@ CONFIG_I2C_ALGOBIT=m
>  #
>  # Other I2C Chip support
>  #
> +# CONFIG_SENSORS_DS1337 is not set
>  # CONFIG_SENSORS_EEPROM is not set
>  # CONFIG_SENSORS_PCF8574 is not set
>  # CONFIG_SENSORS_PCF8591 is not set
>  # CONFIG_SENSORS_RTC8564 is not set
> +# CONFIG_SENSORS_M41T00 is not set
>  # CONFIG_I2C_DEBUG_CORE is not set
>  # CONFIG_I2C_DEBUG_ALGO is not set
>  # CONFIG_I2C_DEBUG_BUS is not set
> @@ -732,7 +750,6 @@ CONFIG_I2C_ALGOBIT=m
>  # Graphics support
>  #
>  # CONFIG_FB is not set
> -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
>
>  #
>  # Sound
> @@ -752,13 +769,9 @@ CONFIG_SOUND=m
>  #
>  # USB support
>  #
> -# CONFIG_USB is not set
>  CONFIG_USB_ARCH_HAS_HCD=y
>  CONFIG_USB_ARCH_HAS_OHCI=y
> -
> -#
> -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be 
> needed; see USB_STORAGE Help for more information
> -#
> +# CONFIG_USB is not set
>
>  #
>  # USB Gadget Support
> @@ -789,6 +802,10 @@ CONFIG_JBD_DEBUG=y
>  CONFIG_FS_MBCACHE=y
>  # CONFIG_REISERFS_FS is not set
>  # CONFIG_JFS_FS is not set
> +
> +#
> +# XFS support
> +#
>  # CONFIG_XFS_FS is not set
>  # CONFIG_MINIX_FS is not set
>  # CONFIG_ROMFS_FS is not set
> @@ -859,7 +876,6 @@ CONFIG_NFS_V3=y
>  CONFIG_ROOT_NFS=y
>  CONFIG_LOCKD=y
>  CONFIG_LOCKD_V4=y
> -# CONFIG_EXPORTFS is not set
>  CONFIG_SUNRPC=y
>  # CONFIG_RPCSEC_GSS_KRB5 is not set
>  # CONFIG_RPCSEC_GSS_SPKM3 is not set
> @@ -942,8 +958,10 @@ CONFIG_ZLIB_INFLATE=m
>  #
>  # Kernel hacking
>  #
> +# CONFIG_PRINTK_TIME is not set
>  CONFIG_DEBUG_KERNEL=y
>  # CONFIG_MAGIC_SYSRQ is not set
> +CONFIG_LOG_BUF_SHIFT=14
>  # CONFIG_SCHEDSTATS is not set
>  # CONFIG_DEBUG_SLAB is not set
>  # CONFIG_DEBUG_SPINLOCK is not set
> diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
> --- a/arch/ppc/kernel/Makefile
> +++ b/arch/ppc/kernel/Makefile
> @@ -22,6 +22,7 @@ obj-$(CONFIG_POWER4)		+= cpu_setup_power
>  obj-$(CONFIG_MODULES)		+= module.o ppc_ksyms.o
>  obj-$(CONFIG_NOT_COHERENT_CACHE)	+= dma-mapping.o
>  obj-$(CONFIG_PCI)		+= pci.o
> +obj-$(CONFIG_RAPIDIO)		+= rio.o
>  obj-$(CONFIG_KGDB)		+= ppc-stub.o
>  obj-$(CONFIG_SMP)		+= smp.o smp-tbsync.o
>  obj-$(CONFIG_TAU)		+= temp.o
> diff --git a/arch/ppc/kernel/rio.c b/arch/ppc/kernel/rio.c
> new file mode 100644
> --- /dev/null
> +++ b/arch/ppc/kernel/rio.c
> @@ -0,0 +1,52 @@
> +/*
> + * RapidIO PPC32 support
> + *
> + * Copyright 2005 MontaVista Software, Inc.
> + * Matt Porter <mporter@kernel.crashing.org>
> + *
> + * 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
> + * Free Software Foundation;  either version 2 of the  License, or 
> (at your
> + * option) any later version.
> + */
> +
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/rio.h>
> +
> +#include <asm/rio.h>
> +
> +/**
> + * platform_rio_init - Do platform specific RIO init
> + *
> + * Any platform specific initialization of RapdIO
> + * hardware is done here as well as registration
> + * of any active master ports in the system.
> + */
> +void __attribute__ ((weak))
> +    platform_rio_init(void)
> +{
> +	printk(KERN_WARNING "RIO: No platform_rio_init() present\n");
> +}
> +
> +/**
> + * ppc_rio_init - Do PPC32 RIO init
> + *
> + * Calls platform-specific RIO init code and then calls
> + * rio_init_mports() to initialize any master ports that
> + * have been registered with the RIO subsystem.
> + */
> +static int __init ppc_rio_init(void)
> +{
> +	printk(KERN_INFO "RIO: RapidIO init\n");
> +
> +	/* Platform specific initialization */
> +	platform_rio_init();
> +
> +	/* Enumerate all registered ports */
> +	rio_init_mports();
> +
> +	return 0;
> +}
> +
> +subsys_initcall(ppc_rio_init);
> diff --git a/arch/ppc/platforms/85xx/stx_gp3.c 
> b/arch/ppc/platforms/85xx/stx_gp3.c
> --- a/arch/ppc/platforms/85xx/stx_gp3.c
> +++ b/arch/ppc/platforms/85xx/stx_gp3.c
> @@ -38,6 +38,7 @@
>  #include <linux/module.h>
>  #include <linux/fsl_devices.h>
>  #include <linux/interrupt.h>
> +#include <linux/rio.h>
>
>  #include <asm/system.h>
>  #include <asm/pgtable.h>
> @@ -59,6 +60,7 @@
>
>  #include <syslib/cpm2_pic.h>
>  #include <syslib/ppc85xx_common.h>
> +#include <syslib/ppc85xx_rio.h>
>
>  extern void cpm2_reset(void);
>
> @@ -200,7 +202,6 @@ static struct irqaction cpm2_irqaction =
>  static void __init
>  gp3_init_IRQ(void)
>  {
> -	int i;
>  	bd_t *binfo = (bd_t *) __res;
>
>  	/*
> @@ -297,6 +298,18 @@ int mpc85xx_exclude_device(u_char bus, u
>  }
>  #endif /* CONFIG_PCI */
>
> +#ifdef CONFIG_RAPIDIO
> +void
> +platform_rio_init(void)
> +{
> +	/*
> +	 * The STx firmware configures the RapidIO Local Access Window
> +	 * at 0xc0000000 with a size of 512MB.
> +	 */
> +	mpc85xx_rio_setup(0xc0000000, 0x20000000);
> +}
> +#endif /* CONFIG_RAPIDIO */
> +
>  void __init
>  platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
>  	      unsigned long r6, unsigned long r7)
> diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
> --- a/arch/ppc/syslib/Makefile
> +++ b/arch/ppc/syslib/Makefile
> @@ -101,6 +101,7 @@ obj-$(CONFIG_85xx)		+= open_pic.o ppc85x
>  					mpc85xx_devices.o
>  ifeq ($(CONFIG_85xx),y)
>  obj-$(CONFIG_PCI)		+= indirect_pci.o pci_auto.o
> +obj-$(CONFIG_RAPIDIO)		+= ppc85xx_rio.o
>  endif
>  obj-$(CONFIG_83xx)		+= ipic.o ppc83xx_setup.o ppc_sys.o \
>  					mpc83xx_sys.o mpc83xx_devices.o
> diff --git a/arch/ppc/syslib/ppc85xx_rio.c 
> b/arch/ppc/syslib/ppc85xx_rio.c
> new file mode 100644
> --- /dev/null
> +++ b/arch/ppc/syslib/ppc85xx_rio.c
> @@ -0,0 +1,867 @@
> +/*
> + * MPC85xx RapidIO support
> + *
> + * Copyright 2005 MontaVista Software, Inc.
> + * Matt Porter <mporter@kernel.crashing.org>
> + *
> + * 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
> + * Free Software Foundation;  either version 2 of the  License, or 
> (at your
> + * option) any later version.
> + */
> +
> +#include <linux/config.h>
> +#include <linux/init.h>
> +#include <linux/module.h>
> +#include <linux/types.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/interrupt.h>
> +#include <linux/rio.h>
> +#include <linux/rio_drv.h>
> +
> +#include <asm/io.h>
> +
> +#define RIO_REGS_BASE		(CCSRBAR + 0xc0000)
> +#define RIO_ATMU_REGS_OFFSET	0x10c00
> +#define RIO_MSG_REGS_OFFSET	0x11000
> +#define RIO_MAINT_WIN_SIZE	0x400000
> +#define RIO_DBELL_WIN_SIZE	0x1000
> +
> +#define RIO_MSG_OMR_MUI		0x00000002
> +#define RIO_MSG_OSR_TE		0x00000080
> +#define RIO_MSG_OSR_QOI		0x00000020
> +#define RIO_MSG_OSR_QFI		0x00000010
> +#define RIO_MSG_OSR_MUB		0x00000004
> +#define RIO_MSG_OSR_EOMI	0x00000002
> +#define RIO_MSG_OSR_QEI		0x00000001
> +
> +#define RIO_MSG_IMR_MI		0x00000002
> +#define RIO_MSG_ISR_TE		0x00000080
> +#define RIO_MSG_ISR_QFI		0x00000010
> +#define RIO_MSG_ISR_DIQI	0x00000001
> +
> +#define RIO_MSG_DESC_SIZE	32
> +#define RIO_MIN_TX_RING_SIZE	2
> +#define RIO_MAX_TX_RING_SIZE	2048
> +#define RIO_MIN_RX_RING_SIZE	2
> +#define RIO_MAX_RX_RING_SIZE	2048
> +
> +#define DOORBELL_DMR_DI		0x00000002
> +#define DOORBELL_DSR_TE		0x00000080
> +#define DOORBELL_DSR_QFI	0x00000010
> +#define DOORBELL_DSR_DIQI	0x00000001
> +#define DOORBELL_TID_OFFSET	0x03
> +#define DOORBELL_SID_OFFSET	0x05
> +#define DOORBELL_INFO_OFFSET	0x06
> +
> +#define DOORBELL_MESSAGE_SIZE	0x08
> +#define DBELL_SID(x)		(*(u8 *)(x + DOORBELL_SID_OFFSET))
> +#define DBELL_TID(x)		(*(u8 *)(x + DOORBELL_TID_OFFSET))
> +#define DBELL_INF(x)		(*(u16 *)(x + DOORBELL_INFO_OFFSET))
> +
> +#define is_power_of_2(x)	(((x) & ((x) - 1)) == 0)
> +
> +struct rio_atmu_regs {
> +	u32 rowtar;
> +	u32 pad1;
> +	u32 rowbar;
> +	u32 pad2;
> +	u32 rowar;
> +	u32 pad3[3];
> +};
> +
> +struct rio_msg_regs {
> +	u32 omr;
> +	u32 osr;
> +	u32 pad1;
> +	u32 odqdpar;
> +	u32 pad2;
> +	u32 osar;
> +	u32 odpr;
> +	u32 odatr;
> +	u32 odcr;
> +	u32 pad3;
> +	u32 odqepar;
> +	u32 pad4[13];
> +	u32 imr;
> +	u32 isr;
> +	u32 pad5;
> +	u32 ifqdpar;
> +	u32 pad6;
> +	u32 ifqepar;
> +	u32 pad7[250];
> +	u32 dmr;
> +	u32 dsr;
> +	u32 pad8;
> +	u32 dqdpar;
> +	u32 pad9;
> +	u32 dqepar;
> +	u32 pad10[26];
> +	u32 pwmr;
> +	u32 pwsr;
> +	u32 pad11;
> +	u32 pwqbar;
> +};
> +
> +struct rio_tx_desc {
> +	u32 res1;
> +	u32 saddr;
> +	u32 dport;
> +	u32 dattr;
> +	u32 res2;
> +	u32 res3;
> +	u32 dwcnt;
> +	u32 res4;
> +};
> +
> +static u32 regs_win;
> +static struct rio_atmu_regs *atmu_regs;
> +static struct rio_atmu_regs *maint_atmu_regs;
> +static struct rio_atmu_regs *dbell_atmu_regs;
> +static u32 dbell_win;
> +static u32 maint_win;
> +static struct rio_msg_regs *msg_regs;
> +
> +static struct rio_dbell_ring {
> +	void *virt;
> +	dma_addr_t phys;
> +} dbell_ring;
> +
> +static struct rio_msg_tx_ring {
> +	void *virt;
> +	dma_addr_t phys;
> +	void *virt_buffer[RIO_MAX_TX_RING_SIZE];
> +	dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
> +	int tx_slot;
> +	int size;
> +} msg_tx_ring;
> +
> +static struct rio_msg_rx_ring {
> +	void *virt;
> +	dma_addr_t phys;
> +	void *virt_buffer[RIO_MAX_RX_RING_SIZE];
> +	int rx_slot;
> +	int size;
> +} msg_rx_ring;
> +
> +/**
> + * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
> + * @index: ID of RapidIO interface
> + * @destid: Destination ID of target device
> + * @data: 16-bit info field of RapidIO doorbell message
> + *
> + * Sends a MPC85xx doorbell message. Returns %0 on success or
> + * %-EINVAL on failure.
> + */
> +static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
> +{
> +	pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n",
> +		 index, destid, data);
> +	out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22);
> +	out_be16((void *)(dbell_win), data);
> +
> +	return 0;
> +}
> +
> +/**
> + * mpc85xx_local_config_read - Generate a MPC85xx local config space 
> read
> + * @index: ID of RapdiIO interface
> + * @offset: Offset into configuration space
> + * @len: Length (in bytes) of the maintenance transaction
> + * @data: Value to be read into
> + *
> + * Generates a MPC85xx local configuration space read. Returns %0 on
> + * success or %-EINVAL on failure.
> + */
> +static int mpc85xx_local_config_read(int index, u32 offset, int len, 
> u32 * data)
> +{
> +	pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index,
> +		 offset);
> +	*data = in_be32((void *)(regs_win + offset));
> +
> +	return 0;
> +}
> +
> +/**
> + * mpc85xx_local_config_write - Generate a MPC85xx local config space 
> write
> + * @index: ID of RapdiIO interface
> + * @offset: Offset into configuration space
> + * @len: Length (in bytes) of the maintenance transaction
> + * @data: Value to be written
> + *
> + * Generates a MPC85xx local configuration space write. Returns %0 on
> + * success or %-EINVAL on failure.
> + */
> +static int mpc85xx_local_config_write(int index, u32 offset, int len, 
> u32 data)
> +{
> +	pr_debug
> +	    ("mpc85xx_local_config_write: index %d offset %8.8x data 
> %8.8x\n",
> +	     index, offset, data);
> +	out_be32((void *)(regs_win + offset), data);
> +
> +	return 0;
> +}
> +
> +/**
> + * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance 
> transaction
> + * @index: ID of RapdiIO interface
> + * @destid: Destination ID of transaction
> + * @hopcount: Number of hops to target device
> + * @offset: Offset into configuration space
> + * @len: Length (in bytes) of the maintenance transaction
> + * @val: Location to be read into
> + *
> + * Generates a MPC85xx read maintenance transaction. Returns %0 on
> + * success or %-EINVAL on failure.
> + */
> +static int
> +mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 
> offset, int len,
> +			u32 * val)
> +{
> +	u8 *data;
> +
> +	pr_debug
> +	    ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset 
> %8.8x len %d\n",
> +	     index, destid, hopcount, offset, len);
> +	out_be32((void *)&maint_atmu_regs->rowtar,
> +		 (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
> +
> +	data = (u8 *) maint_win + offset;
> +	switch (len) {
> +	case 1:
> +		*val = in_8((u8 *) data);
> +		break;
> +	case 2:
> +		*val = in_be16((u16 *) data);
> +		break;
> +	default:
> +		*val = in_be32((u32 *) data);
> +		break;
> +	}
> +
> +	return 0;
> +}
> +
> +/**
> + * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance 
> transaction
> + * @index: ID of RapdiIO interface
> + * @destid: Destination ID of transaction
> + * @hopcount: Number of hops to target device
> + * @offset: Offset into configuration space
> + * @len: Length (in bytes) of the maintenance transaction
> + * @val: Value to be written
> + *
> + * Generates an MPC85xx write maintenance transaction. Returns %0 on
> + * success or %-EINVAL on failure.
> + */
> +static int
> +mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 
> offset,
> +			 int len, u32 val)
> +{
> +	u8 *data;
> +	pr_debug
> +	    ("mpc85xx_rio_config_write: index %d destid %d hopcount %d 
> offset %8.8x len %d val %8.8x\n",
> +	     index, destid, hopcount, offset, len, val);
> +	out_be32((void *)&maint_atmu_regs->rowtar,
> +		 (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
> +
> +	data = (u8 *) maint_win + offset;
> +	switch (len) {
> +	case 1:
> +		out_8((u8 *) data, val);
> +		break;
> +	case 2:
> +		out_be16((u16 *) data, val);
> +		break;
> +	default:
> +		out_be32((u32 *) data, val);
> +		break;
> +	}
> +
> +	return 0;
> +}
> +
> +/**
> + * rio_hw_add_outb_message - Add message to the MPC85xx outbound 
> message queue
> + * @mport: Master port with outbound message queue
> + * @rdev: Target of outbound message
> + * @mbox: Outbound mailbox
> + * @buffer: Message to add to outbound queue
> + * @len: Length of message
> + *
> + * Adds the @buffer message to the MPC85xx outbound message queue. 
> Returns
> + * %0 on success or %-EINVAL on failure.
> + */
> +int
> +rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev 
> *rdev, int mbox,
> +			void *buffer, size_t len)
> +{
> +	u32 omr;
> +	struct rio_tx_desc *desc =
> +	    (struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
> +	int ret = 0;
> +
> +	pr_debug(KERN_INFO
> +		 "RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x 
> len %8.8x\n",
> +		 rdev->destid, mbox, (int)buffer, len);
> +
> +	if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	/* Copy and clear rest of buffer */
> +	memcpy(msg_tx_ring.virt_buffer[msg_tx_ring.tx_slot], buffer, len);
> +	if (len < (RIO_MAX_MSG_SIZE - 4))
> +		memset((void *)((u32) msg_tx_ring.
> +				virt_buffer[msg_tx_ring.tx_slot] + len), 0,
> +		       RIO_MAX_MSG_SIZE - len);
> +
> +	/* Set mbox field for message */
> +	desc->dport = mbox & 0x3;
> +
> +	/* Enable EOMI interrupt, set priority, and set destid */
> +	desc->dattr = 0x28000000 | (rdev->destid << 2);
> +
> +	/* Set transfer size aligned to next power of 2 (in double words) */
> +	desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
> +
> +	/* Set snooping and source buffer address */
> +	desc->saddr = 0x00000004 | 
> msg_tx_ring.phys_buffer[msg_tx_ring.tx_slot];
> +
> +	/* Increment enqueue pointer */
> +	omr = in_be32((void *)&msg_regs->omr);
> +	out_be32((void *)&msg_regs->omr, omr | RIO_MSG_OMR_MUI);
> +
> +	/* Go to next descriptor */
> +	if (++msg_tx_ring.tx_slot == msg_tx_ring.size)
> +		msg_tx_ring.tx_slot = 0;
> +
> +      out:
> +	return ret;
> +}
> +
> +EXPORT_SYMBOL_GPL(rio_hw_add_outb_message);
> +
> +/**
> + * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler
> + * @irq: Linux interrupt number
> + * @dev_instance: Pointer to interrupt-specific data
> + * @regs: Register context
> + *
> + * Handles outbound message interrupts. Executes a register outbound
> + * mailbox event handler and acks the interrupt occurence.
> + */
> +static irqreturn_t
> +mpc85xx_rio_tx_handler(int irq, void *dev_instance, struct pt_regs 
> *regs)
> +{
> +	int osr;
> +	struct rio_mport *port = (struct rio_mport *)dev_instance;
> +
> +	osr = in_be32((void *)&msg_regs->osr);
> +
> +	if (osr & RIO_MSG_OSR_TE) {
> +		printk(KERN_INFO "RIO: outbound message transmission error\n");
> +		out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
> +		goto out;
> +	}
> +
> +	if (osr & RIO_MSG_OSR_QOI) {
> +		printk(KERN_INFO "RIO: outbound message queue overflow\n");
> +		out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
> +		goto out;
> +	}
> +
> +	if (osr & RIO_MSG_OSR_EOMI) {
> +		u32 dqp = in_be32((void *)&msg_regs->odqdpar);
> +		int slot = (dqp - msg_tx_ring.phys) >> 5;
> +		port->outb_msg[0].mcback(port, -1, slot);
> +
> +		/* Ack the end-of-message interrupt */
> +		out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_EOMI);
> +	}
> +
> +      out:
> +	return IRQ_HANDLED;
> +}
> +
> +/**
> + * rio_open_outb_mbox - Initialize MPC85xx outbound mailbox
> + * @mport: Master port implementing the outbound message unit
> + * @mbox: Mailbox to open
> + * @entries: Number of entries in the outbound mailbox ring
> + *
> + * Initializes buffer ring, request the outbound message interrupt,
> + * and enables the outbound message unit. Returns %0 on success or
> + * %-EINVAL on failure.
> + */
> +int rio_open_outb_mbox(struct rio_mport *mport, int mbox, int entries)
> +{
> +	int i, rc = 0;
> +
> +	if ((entries < RIO_MIN_TX_RING_SIZE) ||
> +	    (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
> +		rc = -EINVAL;
> +		goto out;
> +	}
> +
> +	/* Initialize shadow copy ring */
> +	msg_tx_ring.size = entries;
> +
> +	for (i = 0; i < msg_tx_ring.size; i++) {
> +		msg_tx_ring.virt_buffer[i] =
> +		    (void *)__get_free_page(GFP_KERNEL);
> +		msg_tx_ring.phys_buffer[i] =
> +		    (dma_addr_t) __pa(msg_tx_ring.virt_buffer[i]);
> +	}
> +
> +	/* Initialize outbound message descriptor ring */
> +	msg_tx_ring.virt = dma_alloc_coherent(NULL,
> +					      msg_tx_ring.size *
> +					      RIO_MSG_DESC_SIZE,
> +					      &msg_tx_ring.phys, GFP_KERNEL);
> +	memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
> +	msg_tx_ring.tx_slot = 0;
> +
> +	/* Point dequeue/enqueue pointers at first entry in ring */
> +	out_be32((void *)&msg_regs->odqdpar, msg_tx_ring.phys);
> +	out_be32((void *)&msg_regs->odqepar, msg_tx_ring.phys);
> +
> +	/* Configure for snooping */
> +	out_be32((void *)&msg_regs->osar, 0x00000004);
> +
> +	/* Clear interrupt status */
> +	out_be32((void *)&msg_regs->osr, 0x000000b3);
> +
> +	/* Hook up outbound message handler */
> +	request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0, "msg_tx",
> +		    (void *)mport);
> +
> +	/*
> +	 * Configure outbound message unit
> +	 *      Snooping
> +	 *      Interrupts (all enabled, except QEIE)
> +	 *      Chaining mode
> +	 *      Disable
> +	 */
> +	out_be32((void *)&msg_regs->omr, 0x00100220);
> +
> +	/* Set number of entries */
> +	out_be32((void *)&msg_regs->omr,
> +		 in_be32((void *)&msg_regs->omr) |
> +		 ((get_bitmask_order(entries) - 2) << 12));
> +
> +	/* Now enable the unit */
> +	out_be32((void *)&msg_regs->omr, in_be32((void *)&msg_regs->omr) | 
> 0x1);
> +
> +      out:
> +	return rc;
> +}
> +
> +/**
> + * rio_close_outb_mbox - Shut down MPC85xx outbound mailbox
> + * @mport: Master port implementing the outbound message unit
> + * @mbox: Mailbox to close
> + *
> + * Disables the outbound message unit, free all buffers, and
> + * frees the outbound message interrupt.
> + */
> +void rio_close_outb_mbox(struct rio_mport *mport, int mbox)
> +{
> +	/* Disable inbound message unit */
> +	out_be32((void *)&msg_regs->omr, 0);
> +
> +	/* Free ring */
> +	dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
> +			  msg_tx_ring.virt, msg_tx_ring.phys);
> +
> +	/* Free interrupt */
> +	free_irq(MPC85xx_IRQ_RIO_TX, (void *)mport);
> +}
> +
> +/**
> + * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler
> + * @irq: Linux interrupt number
> + * @dev_instance: Pointer to interrupt-specific data
> + * @regs: Register context
> + *
> + * Handles inbound message interrupts. Executes a registered inbound
> + * mailbox event handler and acks the interrupt occurence.
> + */
> +static irqreturn_t
> +mpc85xx_rio_rx_handler(int irq, void *dev_instance, struct pt_regs 
> *regs)
> +{
> +	int isr;
> +	struct rio_mport *port = (struct rio_mport *)dev_instance;
> +
> +	isr = in_be32((void *)&msg_regs->isr);
> +
> +	if (isr & RIO_MSG_ISR_TE) {
> +		printk(KERN_INFO "RIO: inbound message reception error\n");
> +		out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
> +		goto out;
> +	}
> +
> +	/* XXX Need to check/dispatch until queue empty */
> +	if (isr & RIO_MSG_ISR_DIQI) {
> +		/*
> +		 * We implement *only* mailbox 0, but can receive messages
> +		 * for any mailbox/letter to that mailbox destination. So,
> +		 * make the callback with an unknown/invalid mailbox number
> +		 * argument.
> +		 */
> +		port->inb_msg[0].mcback(port, -1, -1);
> +
> +		/* Ack the queueing interrupt */
> +		out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_DIQI);
> +	}
> +
> +      out:
> +	return IRQ_HANDLED;
> +}
> +
> +/**
> + * rio_open_inb_mbox - Initialize MPC85xx inbound mailbox
> + * @mport: Master port implementing the inbound message unit
> + * @mbox: Mailbox to open
> + * @entries: Number of entries in the inbound mailbox ring
> + *
> + * Initializes buffer ring, request the inbound message interrupt,
> + * and enables the inbound message unit. Returns %0 on success
> + * or %-EINVAL on failure.
> + */
> +int rio_open_inb_mbox(struct rio_mport *mport, int mbox, int entries)
> +{
> +	int i, rc = 0;
> +
> +	if ((entries < RIO_MIN_RX_RING_SIZE) ||
> +	    (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
> +		rc = -EINVAL;
> +		goto out;
> +	}
> +
> +	/* Initialize client buffer ring */
> +	msg_rx_ring.size = entries;
> +	msg_rx_ring.rx_slot = 0;
> +	for (i = 0; i < msg_rx_ring.size; i++)
> +		msg_rx_ring.virt_buffer[i] = NULL;
> +
> +	/* Initialize inbound message ring */
> +	msg_rx_ring.virt = dma_alloc_coherent(NULL,
> +					      msg_rx_ring.size *
> +					      RIO_MAX_MSG_SIZE,
> +					      &msg_rx_ring.phys, GFP_KERNEL);
> +
> +	/* Point dequeue/enqueue pointers at first entry in ring */
> +	out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
> +	out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);
> +
> +	/* Clear interrupt status */
> +	out_be32((void *)&msg_regs->isr, 0x00000091);
> +
> +	/* Hook up inbound message handler */
> +	request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0, "msg_rx",
> +		    (void *)mport);
> +
> +	/*
> +	 * Configure inbound message unit:
> +	 *      Snooping
> +	 *      4KB max message size
> +	 *      Unmask all interrupt sources
> +	 *      Disable
> +	 */
> +	out_be32((void *)&msg_regs->imr, 0x001b0060);
> +
> +	/* Set number of queue entries */
> +	out_be32((void *)&msg_regs->imr,
> +		 in_be32((void *)&msg_regs->imr) |
> +		 ((get_bitmask_order(entries) - 2) << 12));
> +
> +	/* Now enable the unit */
> +	out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 
> 0x1);
> +
> +      out:
> +	return rc;
> +}
> +
> +/**
> + * rio_close_inb_mbox - Shut down MPC85xx inbound mailbox
> + * @mport: Master port implementing the inbound message unit
> + * @mbox: Mailbox to close
> + *
> + * Disables the inbound message unit, free all buffers, and
> + * frees the inbound message interrupt.
> + */
> +void rio_close_inb_mbox(struct rio_mport *mport, int mbox)
> +{
> +	/* Disable inbound message unit */
> +	out_be32((void *)&msg_regs->imr, 0);
> +
> +	/* Free ring */
> +	dma_free_coherent(NULL, msg_rx_ring.size * RIO_MAX_MSG_SIZE,
> +			  msg_rx_ring.virt, msg_rx_ring.phys);
> +
> +	/* Free interrupt */
> +	free_irq(MPC85xx_IRQ_RIO_RX, (void *)mport);
> +}
> +
> +/**
> + * rio_hw_add_inb_buffer - Add buffer to the MPC85xx inbound message 
> queue
> + * @mport: Master port implementing the inbound message unit
> + * @mbox: Inbound mailbox number
> + * @buf: Buffer to add to inbound queue
> + *
> + * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
> + * %0 on success or %-EINVAL on failure.
> + */
> +int rio_hw_add_inb_buffer(struct rio_mport *mport, int mbox, void 
> *buf)
> +{
> +	int rc = 0;
> +
> +	pr_debug("RIO: rio_hw_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
> +		 msg_rx_ring.rx_slot);
> +
> +	if (msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot]) {
> +		printk(KERN_ERR
> +		       "RIO: error adding inbound buffer %d, buffer exists\n",
> +		       msg_rx_ring.rx_slot);
> +		rc = -EINVAL;
> +		goto out;
> +	}
> +
> +	msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot] = buf;
> +	if (++msg_rx_ring.rx_slot == msg_rx_ring.size)
> +		msg_rx_ring.rx_slot = 0;
> +
> +      out:
> +	return rc;
> +}
> +
> +EXPORT_SYMBOL_GPL(rio_hw_add_inb_buffer);
> +
> +/**
> + * rio_hw_get_inb_message - Fetch inbound message from the MPC85xx 
> message unit
> + * @mport: Master port implementing the inbound message unit
> + * @mbox: Inbound mailbox number
> + *
> + * Gets the next available inbound message from the inbound message 
> queue.
> + * A pointer to the message is returned on success or NULL on failure.
> + */
> +void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox)
> +{
> +	u32 imr;
> +	u32 phys_buf, virt_buf;
> +	void *buf = NULL;
> +	int buf_idx;
> +
> +	phys_buf = in_be32((void *)&msg_regs->ifqdpar);
> +
> +	/* If no more messages, then bail out */
> +	if (phys_buf == in_be32((void *)&msg_regs->ifqepar))
> +		goto out2;
> +
> +	virt_buf = (u32) msg_rx_ring.virt + (phys_buf - msg_rx_ring.phys);
> +	buf_idx = (phys_buf - msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
> +	buf = msg_rx_ring.virt_buffer[buf_idx];
> +
> +	if (!buf) {
> +		pr_debug(KERN_ERR
> +			 "RIO: inbound message copy failed, no buffers\n");
> +		goto out1;
> +	}
> +
> +	/* Copy max message size, caller is expected to allocate that big */
> +	memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
> +
> +	/* Clear the available buffer */
> +	msg_rx_ring.virt_buffer[buf_idx] = NULL;
> +
> +      out1:
> +	imr = in_be32((void *)&msg_regs->imr);
> +	out_be32((void *)&msg_regs->imr, imr | RIO_MSG_IMR_MI);
> +
> +      out2:
> +	return buf;
> +}
> +
> +EXPORT_SYMBOL_GPL(rio_hw_get_inb_message);
> +
> +/**
> + * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler
> + * @irq: Linux interrupt number
> + * @dev_instance: Pointer to interrupt-specific data
> + * @regs: Register context
> + *
> + * Handles doorbell interrupts. Parses a list of registered
> + * doorbell event handlers and executes a matching event handler.
> + */
> +static irqreturn_t
> +mpc85xx_rio_dbell_handler(int irq, void *dev_instance, struct pt_regs 
> *regs)
> +{
> +	int dsr;
> +	struct rio_mport *port = (struct rio_mport *)dev_instance;
> +
> +	dsr = in_be32((void *)&msg_regs->dsr);
> +
> +	if (dsr & DOORBELL_DSR_TE) {
> +		printk(KERN_INFO "RIO: doorbell reception error\n");
> +		out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
> +		goto out;
> +	}
> +
> +	if (dsr & DOORBELL_DSR_QFI) {
> +		printk(KERN_INFO "RIO: doorbell queue full\n");
> +		out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
> +		goto out;
> +	}
> +
> +	/* XXX Need to check/dispatch until queue empty */
> +	if (dsr & DOORBELL_DSR_DIQI) {
> +		u32 dmsg =
> +		    (u32) dbell_ring.virt +
> +		    (in_be32((void *)&msg_regs->dqdpar) & 0xfff);
> +		u32 dmr;
> +		struct rio_dbell *dbell;
> +		int found = 0;
> +
> +		pr_debug(KERN_INFO
> +			 "RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
> +			 DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
> +
> +		list_for_each_entry(dbell, &port->dbells, node) {
> +			if ((dbell->res->start <= DBELL_INF(dmsg)) &&
> +			    (dbell->res->end >= DBELL_INF(dmsg))) {
> +				found = 1;
> +				break;
> +			}
> +		}
> +		if (found) {
> +			dbell->dinb(port, DBELL_SID(dmsg), DBELL_TID(dmsg),
> +				    DBELL_INF(dmsg));
> +		} else {
> +			pr_debug(KERN_INFO
> +				 "RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
> +				 DBELL_SID(dmsg), DBELL_TID(dmsg),
> +				 DBELL_INF(dmsg));
> +		}
> +		dmr = in_be32((void *)&msg_regs->dmr);
> +		out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
> +		out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_DIQI);
> +	}
> +
> +      out:
> +	return IRQ_HANDLED;
> +}
> +
> +/**
> + * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init
> + * @mport: Master port implementing the inbound doorbell unit
> + *
> + * Initializes doorbell unit hardware and inbound DMA buffer
> + * ring. Called from mpc85xx_rio_setup().
> + */
> +static void mpc85xx_rio_doorbell_init(struct rio_mport *mport)
> +{
> +	/* Map outbound doorbell window immediately after maintenance window 
> */
> +	dbell_win =
> +	    (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
> +			  RIO_DBELL_WIN_SIZE);
> +
> +	/* Initialize inbound doorbells */
> +	dbell_ring.virt = dma_alloc_coherent(NULL,
> +					     512 * DOORBELL_MESSAGE_SIZE,
> +					     &dbell_ring.phys, GFP_KERNEL);
> +
> +	/* Point dequeue/enqueue pointers at first entry in ring */
> +	out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
> +	out_be32((void *)&msg_regs->dqepar, (u32) dbell_ring.phys);
> +
> +	/* Clear interrupt status */
> +	out_be32((void *)&msg_regs->dsr, 0x00000091);
> +
> +	/* Hook up doorbell handler */
> +	request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
> +		    "dbell_rx", (void *)mport);
> +
> +	/* Configure doorbells for snooping, 512 entries, and enable */
> +	out_be32((void *)&msg_regs->dmr, 0x00108161);
> +}
> +
> +static char *cmdline = NULL;
> +
> +static int mpc85xx_rio_get_hdid(int index)
> +{
> +	/* XXX Need to parse multiple entries in some format */
> +	if (!cmdline)
> +		return -1;
> +
> +	return simple_strtol(cmdline, NULL, 0);
> +}
> +
> +static int mpc85xx_rio_get_cmdline(char *s)
> +{
> +	if (!s)
> +		return 0;
> +
> +	cmdline = s;
> +	return 1;
> +}
> +
> +__setup("riohdid=", mpc85xx_rio_get_cmdline);
> +
> +/**
> + * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface
> + * @law_start: Starting physical address of RapidIO LAW
> + * @law_size: Size of RapidIO LAW
> + *
> + * Initializes MPC85xx RapidIO hardware interface, configures
> + * master port with system-specific info, and registers the
> + * master port with the RapidIO subsystem.
> + */
> +void mpc85xx_rio_setup(int law_start, int law_size)
> +{
> +	struct rio_ops *ops;
> +	struct rio_mport *port;
> +
> +	ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
> +	ops->lcread = mpc85xx_local_config_read;
> +	ops->lcwrite = mpc85xx_local_config_write;
> +	ops->cread = mpc85xx_rio_config_read;
> +	ops->cwrite = mpc85xx_rio_config_write;
> +	ops->dsend = mpc85xx_rio_doorbell_send;
> +
> +	port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL);
> +	port->id = 0;
> +	port->index = 0;
> +	INIT_LIST_HEAD(&port->dbells);
> +	port->iores.start = law_start;
> +	port->iores.end = law_start + law_size;
> +	port->iores.flags = IORESOURCE_MEM;
> +
> +	rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
> +	rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
> +	rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
> +	strcpy(port->name, "RIO0 mport");
> +
> +	port->ops = ops;
> +	port->host_deviceid = mpc85xx_rio_get_hdid(port->id);
> +
> +	rio_register_mport(port);
> +
> +	regs_win = (u32) ioremap(RIO_REGS_BASE, 0x20000);
> +	atmu_regs = (struct rio_atmu_regs *)(regs_win + 
> RIO_ATMU_REGS_OFFSET);
> +	maint_atmu_regs = atmu_regs + 1;
> +	dbell_atmu_regs = atmu_regs + 2;
> +	msg_regs = (struct rio_msg_regs *)(regs_win + RIO_MSG_REGS_OFFSET);
> +
> +	/* Configure maintenance transaction window */
> +	out_be32((void *)&maint_atmu_regs->rowbar, 0x000c0000);
> +	out_be32((void *)&maint_atmu_regs->rowar, 0x80077015);
> +
> +	maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
> +
> +	/* Configure outbound doorbell window */
> +	out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400);
> +	out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b);
> +	mpc85xx_rio_doorbell_init(port);
> +}
> diff --git a/arch/ppc/syslib/ppc85xx_rio.h 
> b/arch/ppc/syslib/ppc85xx_rio.h
> new file mode 100644
> --- /dev/null
> +++ b/arch/ppc/syslib/ppc85xx_rio.h
> @@ -0,0 +1,21 @@
> +/*
> + * MPC85xx RapidIO definitions
> + *
> + * Copyright 2005 MontaVista Software, Inc.
> + * Matt Porter <mporter@kernel.crashing.org>
> + *
> + * 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
> + * Free Software Foundation;  either version 2 of the  License, or 
> (at your
> + * option) any later version.
> + */
> +
> +#ifndef __PPC_SYSLIB_PPC85XX_RIO_H
> +#define __PPC_SYSLIB_PPC85XX_RIO_H
> +
> +#include <linux/config.h>
> +#include <linux/init.h>
> +
> +extern void mpc85xx_rio_setup(int law_start, int law_size);
> +
> +#endif				/* __PPC_SYSLIB_PPC85XX_RIO_H */
> diff --git a/include/asm-ppc/rio.h b/include/asm-ppc/rio.h
> new file mode 100644
> --- /dev/null
> +++ b/include/asm-ppc/rio.h
> @@ -0,0 +1,18 @@
> +/*
> + * RapidIO architecture support
> + *
> + * Copyright 2005 MontaVista Software, Inc.
> + * Matt Porter <mporter@kernel.crashing.org>
> + *
> + * 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
> + * Free Software Foundation;  either version 2 of the  License, or 
> (at your
> + * option) any later version.
> + */
> +
> +#ifndef ASM_PPC_RIO_H
> +#define ASM_PPC_RIO_H
> +
> +extern void platform_rio_init(void);
> +
> +#endif				/* ASM_PPC_RIO_H */
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* RE: Getting ownership for various boards/platforms configs
From: Paul Mackerras @ 2005-06-08  4:42 UTC (permalink / raw)
  To: Baxter, Robert; +Cc: linuxppc-dev list, Linux PPC Embedded list
In-Reply-To: <2A059D6F07F8054294EFC0BD7808FC6D3BE3E1@sdgexch01>

Baxter, Robert writes:

> > gemini
> 
> I'll take this one.

Great!  There are some changes to head.S that I have been wanting to
make for a while: specifically I want to remove the special case for
starting the second processor on gemini and the call to
gemini_prom_init.

Does current 2.6 work on gemini?

Paul.

^ permalink raw reply

* Re: Discuss: Adding OF Flat Dev Tree to ppc32
From: Benjamin Herrenschmidt @ 2005-06-08  3:06 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc64-dev, linuxppc-embedded@ozlabs.org
In-Reply-To: <1117819176.6517.290.camel@cashmere.sps.mot.com>

On Fri, 2005-06-03 at 12:19 -0500, Jon Loeliger wrote:
> Ben and Folks,

Hi Jon !

> I've read through ppc64/kernel/prom.c and done some minor
> call-chain analysis rooted at the two functions:
>     early_init_devtree()
>     unflatten_device_tree()
> as they are apparently the only two referenced in the
> initial early boot up process.

Yes. The first one is called very early on ppc64 with MMU still
off (the ppc64 kernel can happily run C code without translation
due to a "feature" where the top 2 bits of addresses are ignored
in real mode, ppc32 will need to be a bit smarter here). 

It's basically used to extract some infos directly from the flattened
tree in order to construct the LMB list (list of memory blocks,
equivalent of ppc32's mem_pieces), get the platform number (though we
are thinking about killing that platform number thing) and get a few
other things that are used very early during boot.

It uses functions that iterate the flattened device-tree directly that
are currently not exported outside of prom.c but that may change,
especially if we remove the platform number, we may let the
ppc_md.probe() function use those to look at the device-tree
model/compatible properties.

The other function is called much later, with MMU enabled, to do the
actual expansion of the tree into a pointer based tree that can be more
easily walked & manipulated.

> My notion was to take the portion of prom.c rooted at
> these two functions and add them to the ppc32 line.
> 
> First, what portions of pp64/kernel/prom.c are obsolete?
> Anything?  You alluded to cleaning this up some, but I
> am not too familiar with it to know where that was headed.

Well, I want to remove pretty much all of the stuff done in
finish_device_tree(). That is the pre-parsed n_addrs/addrs and
n_intrs/intrs fields of struct device_node, and all the functions
involved in this parsing. I would then provide a better function to be
called externally to "on-demand" map an interrupt, and eventually to
process "reg" properties properly.

I also want to move the other unrelated stuff from struct device_node
like PCI gunk that we have on ppc64 to some separate structure that is
only used by PCI or VIO devices.

> Second, there is already a fairly similar prom.c file
> hanging out over in ppc32 land.  I _think_ it houses
> roughly the complementary code out of ppc64's prom.c
> that is NOT derived from the call chain derived from
> the above two functions.

Yes.

> Which leads me to the questions:  Is there, or should
> we create, a plan to factor the flat-dev-tree handling
> code into common or shared ppc code?  

Hrm... There is lot of code duplication in ppc vs. ppc64 land (and in
some case, we do actually use the same headers, that is,
include/asm-ppc64/something.h may just itself include the "asm-ppc"
version. Steven Rothwell here is working on patches to make that more
systematic for things that really should be identical, like termios.h
etc...

Regarding code in arch/ppc*, I'm not sure what the right approach would
be. I'd say first copy things around, and we'll what we end up with.

> I am reluctant
> to just outright clone and copy that code if it will
> ultimately "be the same" or even "mostly the same".
> It seems that the early_init_devtree() might then need
> to be refactored or duplicated for ppc32-land.

Sort-of. We don't run in the same context though. We need to call this
before MMU_init() on ppc32. Depending on the processor type that code
runs mapped by BATs or bolted TLBs or whatever trick is used that early
during boot and may not be able to access all of RAM. So you may need to
add additional restrictions on the location of the device-tree in memory
or run code in real mode if possible or whatever. We need the BookE
folks for example to look at this closely. On 6xx & friends, I think
only 16Mb. On POWER4 runninng 32 bits, RAM is bolted in the hash table
by prom_init.c but that's just a gross hack. etc...

> Are you anticipating the same r3,r4,r5 interface outlined
> in your 0.4 rev of the ppc4 OF spec to be used by the
> ppc32 world as well?  Seems like it just might...

Yes.

> Naturally, I'm willing to jump in here, just looking
> for a bit of global-direction from you. :-)

No problem :) We'll also want to refactor prom_init to be much more like
the ppc64 version, that is cut all ties between it and the rest of the
kernel (so it doesn't share any global) and so that it generates a
flattened tree and passes that to the kernel.

Ben.
 

^ permalink raw reply

* how to remove from  this maillist?
From: likun @ 2005-06-08  1:34 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-embedded

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

hi all:
 how to remove from  this maillist? 

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

^ permalink raw reply

* how to remove from  this maillist
From: likun @ 2005-06-08  1:33 UTC (permalink / raw)
  To: linux-kernel, linuxppc-embedded

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

hi:

  how to remove from  this maillist?


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

^ permalink raw reply

* [PATCH] rapidio: core updates
From: Matt Porter @ 2005-06-08  1:31 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, linuxppc-embedded

Addresses issues raised with the 2.6.12-rc6-mm1 RIO support.
Fix dma_mask init, shrink some code, general cleanup.

Signed-off-by: Matt Porter <mporter@kernel.crashing.org>

diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <linux/init.h>
 #include <linux/rio.h>
 #include <linux/rio_drv.h>
@@ -33,7 +34,8 @@ static LIST_HEAD(rio_switches);
 
 static void rio_enum_timeout(unsigned long);
 
-spinlock_t rio_global_list_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(rio_global_list_lock);
+
 static int next_destid = 0;
 static int next_switchid = 0;
 static int next_net = 0;
@@ -55,9 +57,6 @@ static int rio_sport_phys_table[] = {
 	-1,
 };
 
-extern struct rio_route_ops __start_rio_route_ops[];
-extern struct rio_route_ops __end_rio_route_ops[];
-
 /**
  * rio_get_device_id - Get the base/extended device id for a device
  * @port: RIO master port 
@@ -85,8 +84,7 @@ static u16 rio_get_device_id(struct rio_
  *
  * Writes the base/extended device id from a device.
  */
-static void
-rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u16 did)
+static void rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u16 did)
 {
 	rio_mport_write_config_32(port, destid, hopcount, RIO_DID_CSR,
 				  RIO_SET_DID(did));
@@ -192,23 +190,9 @@ static int rio_enum_host(struct rio_mpor
 static int rio_device_has_destid(struct rio_mport *port, int src_ops,
 				 int dst_ops)
 {
-	if (((src_ops & RIO_SRC_OPS_READ) ||
-	     (src_ops & RIO_SRC_OPS_WRITE) ||
-	     (src_ops & RIO_SRC_OPS_ATOMIC_TST_SWP) ||
-	     (src_ops & RIO_SRC_OPS_ATOMIC_INC) ||
-	     (src_ops & RIO_SRC_OPS_ATOMIC_DEC) ||
-	     (src_ops & RIO_SRC_OPS_ATOMIC_SET) ||
-	     (src_ops & RIO_SRC_OPS_ATOMIC_CLR)) &&
-	    ((dst_ops & RIO_DST_OPS_READ) ||
-	     (dst_ops & RIO_DST_OPS_WRITE) ||
-	     (dst_ops & RIO_DST_OPS_ATOMIC_TST_SWP) ||
-	     (dst_ops & RIO_DST_OPS_ATOMIC_INC) ||
-	     (dst_ops & RIO_DST_OPS_ATOMIC_DEC) ||
-	     (dst_ops & RIO_DST_OPS_ATOMIC_SET) ||
-	     (dst_ops & RIO_DST_OPS_ATOMIC_CLR))) {
-		return 1;
-	} else
-		return 0;
+	u32 mask = RIO_OPS_READ | RIO_OPS_WRITE | RIO_OPS_ATOMIC_TST_SWP | RIO_OPS_ATOMIC_INC | RIO_OPS_ATOMIC_DEC | RIO_OPS_ATOMIC_SET | RIO_OPS_ATOMIC_CLR;
+
+	return !!((src_ops | dst_ops) & mask);
 }
 
 /**
@@ -383,8 +367,9 @@ static struct rio_dev *rio_setup_device(
 	rdev->dev.release = rio_release_dev;
 	rio_dev_get(rdev);
 
-	rdev->dev.dma_mask = (u64 *) 0xffffffff;
-	rdev->dev.coherent_dma_mask = 0xffffffffULL;
+	rdev->dma_mask = DMA_32BIT_MASK;
+	rdev->dev.dma_mask = &rdev->dma_mask;
+	rdev->dev.coherent_dma_mask = DMA_32BIT_MASK;
 
 	if ((rdev->pef & RIO_PEF_INB_DOORBELL) &&
 	    (rdev->dst_ops & RIO_DST_OPS_DOORBELL))
diff --git a/drivers/rapidio/rio.h b/drivers/rapidio/rio.h
--- a/drivers/rapidio/rio.h
+++ b/drivers/rapidio/rio.h
@@ -26,6 +26,9 @@ extern int rio_disc_mport(struct rio_mpo
 extern struct device_attribute rio_dev_attrs[];
 extern spinlock_t rio_global_list_lock;
 
+extern struct rio_route_ops __start_rio_route_ops[];
+extern struct rio_route_ops __end_rio_route_ops[];
+
 /* Helpers internal to the RIO core code */
 #define DECLARE_RIO_ROUTE_SECTION(section, vid, did, add_hook, get_hook)  \
         static struct rio_route_ops __rio_route_ops __attribute_used__   \
diff --git a/include/linux/rio.h b/include/linux/rio.h
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -91,6 +91,7 @@ struct rio_mport;
  * @swpinfo: Switch port info
  * @src_ops: Source operation capabilities
  * @dst_ops: Destination operation capabilities
+ * @dma_mask: Mask of bits of RIO address this device implements
  * @rswitch: Pointer to &struct rio_switch if valid for this device
  * @driver: Driver claiming this device
  * @dev: Device model device
@@ -112,6 +113,7 @@ struct rio_dev {
 	u32 swpinfo;		/* Only used for switches */
 	u32 src_ops;
 	u32 dst_ops;
+	u64 dma_mask;
 	struct rio_switch *rswitch;	/* RIO switch info */
 	struct rio_driver *driver;	/* RIO driver claiming this device */
 	struct device dev;	/* LDM device structure */
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
--- a/include/linux/rio_regs.h
+++ b/include/linux/rio_regs.h
@@ -78,6 +78,19 @@
 #define  RIO_DST_OPS_ATOMIC_CLR		0x00000010	/* [I] Atomic clr op */
 #define  RIO_DST_OPS_PORT_WRITE		0x00000004	/* [I] Port-write op */
 
+#define  RIO_OPS_READ			0x00008000	/* [I] Read op */
+#define  RIO_OPS_WRITE			0x00004000	/* [I] Write op */
+#define  RIO_OPS_STREAM_WRITE		0x00002000	/* [I] Str-write op */
+#define  RIO_OPS_WRITE_RESPONSE		0x00001000	/* [I] Write/resp op */
+#define  RIO_OPS_DATA_MSG		0x00000800	/* [II] Data msg op */
+#define  RIO_OPS_DOORBELL		0x00000400	/* [II] Doorbell op */
+#define  RIO_OPS_ATOMIC_TST_SWP		0x00000100	/* [I] Atomic TAS op */
+#define  RIO_OPS_ATOMIC_INC		0x00000080	/* [I] Atomic inc op */
+#define  RIO_OPS_ATOMIC_DEC		0x00000040	/* [I] Atomic dec op */
+#define  RIO_OPS_ATOMIC_SET		0x00000020	/* [I] Atomic set op */
+#define  RIO_OPS_ATOMIC_CLR		0x00000010	/* [I] Atomic clr op */
+#define  RIO_OPS_PORT_WRITE		0x00000004	/* [I] Port-write op */
+
 					/* 0x20-0x3c *//* Reserved */
 
 #define RIO_MBOX_CSR		0x40	/* [II] Mailbox CSR */

^ permalink raw reply

* Re: syntax for clobber list with inline assembly
From: Hollis Blanchard @ 2005-06-08  1:02 UTC (permalink / raw)
  To: Chris Friesen; +Cc: Linux PPC Dev
In-Reply-To: <4b474e026a1d6040f1ec24466d8ff6a8@kernel.crashing.org>

On Jun 7, 2005, at 10:00 AM, Segher Boessenkool wrote:

>> I'm writing some inline assembly for ppc.  To specify that r3 is 
>> used, I know I need to list it in the clobbered list.
>>
>> When doing this, do I specify it as "3" or "r3", or are both valid?
>
> Both work.

But it should be said that much better style is to let the compiler 
choose registers for you, i.e. don't hardcode register numbers at all. 
For example (well, it's contrived, but I hope you get the idea):

	int out;
	asm("mfmsr r3\n"
		"ori %0, r3, 0x1\n"
		: "=r"(out)
		:
		: "r3");

would be better written as

	int out, tmp;
	asm("mfmsr %1\n"
		"ori %0, %1, 0x1\n"
		: "=r"(out),  "=r"(tmp)
		:
		: );

Be careful about using "r" constraints when dealing with instructions 
that treat r0 as a special case, such as addi or lwz (use "b" instead).

Also be careful about gcc arranging outputs and inputs in the same 
register; it looks different when you're writing "%0" and "%1" in your 
assembly, but it's not.

Inline assembly is very subtle. If you mess up your constraints now, 
you might never know until you rebuild with a different compiler 
version and things fall apart.

-Hollis

^ permalink raw reply

* Re: root fs mount issue: Xilinx System ACE on PCI bus
From: Peter Ryser @ 2005-06-07 21:50 UTC (permalink / raw)
  To: Sanjay Bajaj; +Cc: linuxppc-embedded
In-Reply-To: <0007F077BB3476449151699150E8FEA21A7BA4@exchange.tsi-telsys.com>

Is "Root on NFS" disabled?

- Peter


Sanjay Bajaj wrote:

>Hi! Gurus,
>
>Need some help in understanding root fs mounting. The setup we have here is our hardware has Xilinx Virtex II pro chip that has System ACE hardware connected to a compact flash. The Virtex II Pro is connected to Local PCI bus which is run by PPC 440GX processor. I have ported the driver for xsysace from ml300 config to our hardware (From OPB to PCI). When I boot over nfs, I can easily mount the partictions on the compact flash. The nodes in /dev directory are:
>
>brw-r--r--    1 root     root     254,   0 Jun  3 13:04 xsysacea
>brw-r--r--    1 root     root     254,   1 Jun  3 13:04 xsysacea1
>brw-r--r--    1 root     root     254,   2 Jun  3 13:04 xsysacea2
>
>When I try to boot from the commpact flash, the kernel panics. The edited boot listing is as follows:
>
>=> bootm
>...
>...
>Kernel command line: root=/dev/xsysacea2 rw console=ttyS0,9600 mem=128M
>...
>...
>Partition check:
> xsysacea: xsysacea1 xsysacea2
>System ACE at 0xFFFC1000 mapped to 0xD2070000, irq=26, 500472KB
>...
>...
>VFS: Cannot open root device "xsysacea2" or 00:00
>Please append a correct "root=" boot option
>Kernel panic: VFS: Unable to mount root fs on 00:00
> <0>Rebooting in 180 seconds..
>
>-------
>
>What am I missing here? Any help is appreciated.
>Thanks,
>Sanjay
>_______________________________________________
>Linuxppc-embedded mailing list
>Linuxppc-embedded@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
>  
>

^ permalink raw reply

* RE: MPC8272 runs application with segmentation fault
From: Andrew Williams @ 2005-06-07 21:54 UTC (permalink / raw)
  To: Nai-Hsien, linuxppc-embedded

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

I should have specified:
 
  These files are from inside U-boot (1.0.0).
 
Back to your regularly scheduled mail-list.
 
Andrew

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

^ permalink raw reply

* Re: [UPDATE] Getting ownership for various boards/platforms configs
From: Kumar Gala @ 2005-06-07 21:47 UTC (permalink / raw)
  To: Linux PPC Embedded list, linuxppc-dev list
In-Reply-To: <9ba88cc4d574475630c7a819ed75b0de@onz.com>

The following boards have no owners and if they dont get one the plan 
is to kill them:

ep405
mvme5100
pcore

The following boards are schedule to be removed, please scream now if 
you have an issue:

adir			dead (Michael Sokolov)
cedar		dead (Matt Porter)
k2			dead (Matt Porter, Mark Greer)
mcpn765		dead (Mark Greer)
menf1		dead (Matt Porter, Mark Greer)
oak			dead (Matt Porter)
rainier		dead (Matt Porter)
redwood		dead (Matt Porter)
SM850		dead (Wolfgang Denk)
SPD823TS		dead (Wolfgang Denk)

- kumar

^ permalink raw reply

* Re: [PATCH][3/5] RapidIO support: core enum
From: Matt Porter @ 2005-06-07 21:14 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: linux-kernel, gregkh, linuxppc-embedded
In-Reply-To: <Pine.LNX.4.61.0506062302440.10441@montezuma.fsmlabs.com>

On Mon, Jun 06, 2005 at 11:19:50PM -0600, Zwane Mwaikambo wrote:
> On Mon, 6 Jun 2005, Matt Porter wrote:
> 
> > +spinlock_t rio_global_list_lock = SPIN_LOCK_UNLOCKED;
> 
> spin_lock_init?

How about DEFINE_SPINLOCK() as they do the same thing (except the 
difference in amount of babble)? This is what PCI is doing, for
example. I use the same init method in the static locks found
in rio-access.c, FWIW.

> > +extern struct rio_route_ops __start_rio_route_ops[];
> > +extern struct rio_route_ops __end_rio_route_ops[];
> 
> rio.h?

Yep, will move.

> > +static void
> > +rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u16 did)
> 
> Shouldn't those be on the same line?

Yes, will fix.
 
> > +static int rio_device_has_destid(struct rio_mport *port, int src_ops,
> > +				 int dst_ops)
> > +{
> > +	if (((src_ops & RIO_SRC_OPS_READ) ||
> > +	     (src_ops & RIO_SRC_OPS_WRITE) ||
> > +	     (src_ops & RIO_SRC_OPS_ATOMIC_TST_SWP) ||
> > +	     (src_ops & RIO_SRC_OPS_ATOMIC_INC) ||
> > +	     (src_ops & RIO_SRC_OPS_ATOMIC_DEC) ||
> > +	     (src_ops & RIO_SRC_OPS_ATOMIC_SET) ||
> > +	     (src_ops & RIO_SRC_OPS_ATOMIC_CLR)) &&
> > +	    ((dst_ops & RIO_DST_OPS_READ) ||
> > +	     (dst_ops & RIO_DST_OPS_WRITE) ||
> > +	     (dst_ops & RIO_DST_OPS_ATOMIC_TST_SWP) ||
> > +	     (dst_ops & RIO_DST_OPS_ATOMIC_INC) ||
> > +	     (dst_ops & RIO_DST_OPS_ATOMIC_DEC) ||
> > +	     (dst_ops & RIO_DST_OPS_ATOMIC_SET) ||
> > +	     (dst_ops & RIO_DST_OPS_ATOMIC_CLR))) {
> > +		return 1;
> 
> Why not just;
> 
> mask = (RIO_DST_OPS_READ | RIO_DST_OPS_WRITE....)
> return !!((dst_ops & mask) && (src_ops & mask))

Yes, that's good. I already had that comment from an IRC discussion
and neglected to address it in the last updates. Will do.

> > +	rdev->dev.dma_mask = (u64 *) 0xffffffff;
> > +	rdev->dev.coherent_dma_mask = 0xffffffffULL;
> 
> Shouldn't that be dma_set_mask?

There is a problem there, yes, but it shouldn't use dma_set_mask().
dma_set_mask() needs [struct device]->dma_mask to be non-zero
(initialized to something) to do anything in all the copied
implementations I've seen.  I need to do something like the
following to initialize the struct device dma_mask properly:

	rdev->dma_mask = 0xffffffffULL;
	rdev->dev.dma_mask = &rdev->dma_mask;

-Matt

^ permalink raw reply

* RE: root fs mount issue: Xilinx System ACE on PCI bus
From: Sanjay Bajaj @ 2005-06-07 17:02 UTC (permalink / raw)
  To: Mark Chambers; +Cc: linuxppc-embedded

Hi! Mark,

I did put in "rootfs=3Dext3", but, the result is still the same.

Sanjay

-----Original Message-----
From: Mark Chambers [mailto:markc@mail.com]
Sent: Tuesday, June 07, 2005 11:51 AM
To: Sanjay Bajaj
Subject: Re: root fs mount issue: Xilinx System ACE on PCI bus


Well, I'm no guru, but you could try adding a 'rootfs=3D" option to your
kernel command line (rootfs=3Djffs2, for instance, or ext2).  Perhaps =
the
kernel is not able to automatically determine the filesystem.  When you
'mount' you explicitly tell the kernel what kind of file system is on =
the
device.

Mark Chambers

----- Original Message -----=20
From: "Sanjay Bajaj" <sbajaj@tsi-telsys.com>
To: <linuxppc-embedded@ozlabs.org>
Sent: Tuesday, June 07, 2005 11:05 AM
Subject: root fs mount issue: Xilinx System ACE on PCI bus


Hi! Gurus,

Need some help in understanding root fs mounting. The setup we have here =
is
our hardware has Xilinx Virtex II pro chip that has System ACE hardware
connected to a compact flash. The Virtex II Pro is connected to Local =
PCI
bus which is run by PPC 440GX processor. I have ported the driver for
xsysace from ml300 config to our hardware (From OPB to PCI). When I boot
over nfs, I can easily mount the partictions on the compact flash. The =
nodes
in /dev directory are:

brw-r--r--    1 root     root     254,   0 Jun  3 13:04 xsysacea
brw-r--r--    1 root     root     254,   1 Jun  3 13:04 xsysacea1
brw-r--r--    1 root     root     254,   2 Jun  3 13:04 xsysacea2

When I try to boot from the commpact flash, the kernel panics. The =
edited
boot listing is as follows:

=3D> bootm
...
...
Kernel command line: root=3D/dev/xsysacea2 rw console=3DttyS0,9600 =
mem=3D128M
...
...
Partition check:
 xsysacea: xsysacea1 xsysacea2
System ACE at 0xFFFC1000 mapped to 0xD2070000, irq=3D26, 500472KB
...
...
VFS: Cannot open root device "xsysacea2" or 00:00
Please append a correct "root=3D" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00
 <0>Rebooting in 180 seconds..

-------

What am I missing here? Any help is appreciated.
Thanks,
Sanjay
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* root fs mount issue: Xilinx System ACE on PCI bus
From: Sanjay Bajaj @ 2005-06-07 15:05 UTC (permalink / raw)
  To: linuxppc-embedded

Hi! Gurus,

Need some help in understanding root fs mounting. The setup we have here =
is our hardware has Xilinx Virtex II pro chip that has System ACE =
hardware connected to a compact flash. The Virtex II Pro is connected to =
Local PCI bus which is run by PPC 440GX processor. I have ported the =
driver for xsysace from ml300 config to our hardware (From OPB to PCI). =
When I boot over nfs, I can easily mount the partictions on the compact =
flash. The nodes in /dev directory are:

brw-r--r--    1 root     root     254,   0 Jun  3 13:04 xsysacea
brw-r--r--    1 root     root     254,   1 Jun  3 13:04 xsysacea1
brw-r--r--    1 root     root     254,   2 Jun  3 13:04 xsysacea2

When I try to boot from the commpact flash, the kernel panics. The =
edited boot listing is as follows:

=3D> bootm
...
...
Kernel command line: root=3D/dev/xsysacea2 rw console=3DttyS0,9600 =
mem=3D128M
...
...
Partition check:
 xsysacea: xsysacea1 xsysacea2
System ACE at 0xFFFC1000 mapped to 0xD2070000, irq=3D26, 500472KB
...
...
VFS: Cannot open root device "xsysacea2" or 00:00
Please append a correct "root=3D" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00
 <0>Rebooting in 180 seconds..

-------

What am I missing here? Any help is appreciated.
Thanks,
Sanjay

^ permalink raw reply

* Re: syntax for clobber list with inline assembly
From: Segher Boessenkool @ 2005-06-07 15:00 UTC (permalink / raw)
  To: Chris Friesen; +Cc: linuxppc-dev
In-Reply-To: <42A5B3E6.9030401@nortel.com>

> I'm writing some inline assembly for ppc.  To specify that r3 is used, 
> I know I need to list it in the clobbered list.
>
> When doing this, do I specify it as "3" or "r3", or are both valid?

Both work.


Segher

^ permalink raw reply

* syntax for clobber list with inline assembly
From: Chris Friesen @ 2005-06-07 14:49 UTC (permalink / raw)
  To: linuxppc-dev


I'm writing some inline assembly for ppc.  To specify that r3 is used, I 
know I need to list it in the clobbered list.

When doing this, do I specify it as "3" or "r3", or are both valid?

Thanks,

Chris

^ permalink raw reply

* RE: MPC8272 runs application with segmentation fault
From: Andrew Williams @ 2005-06-07 14:17 UTC (permalink / raw)
  To: Nai-Hsien, linuxppc-embedded

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

Take a alook at the checkcpu() routine in /cpu/mpc8260/cpu.c .
Validate that your CPU is correctly being identified, and thus initialized. 
We had identical symptoms with the 8270. 
 
We added the following after the case for the PVR_8260_HIP7:
   
        case PVR_8280a_HIP7:
        case PVR_8280_HIP7:
                k = 7;
                printf (CPU_ID_STR " (HiP%d Rev %02x, Mask ", k, rev);
                break;
 
include/asm-ppc/processor.h
 
    #define PVR_8280_HIP7   0x80822013 
    #define PVR_8280a_HIP7   0x80822014 
 
A.

-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Nai-Hsien
Sent: June 7, 2005 9:11 AM
To: linuxppc-embedded@ozlabs.org
Subject: MPC8272 runs application with segmentation fault


Dear experts,
 
I have two hardware boards, one uses MPC8245 and the other one uses MPC8272.
Initially, I use the MPC8245 board to port Linux 2.4.20 and write some
applications.
I already do a lot of test on the MPC8245 board and all my application
programs work
fine.
 
After this, I use the same kernel configuration and same file system that
are being used
by the MPC8245 board to port the whole system to my MPC8272.
Now, I can boot the kernel and run busybox well. However, when
I run my application programs, I always get segmentation fault. Following is
a strace
dump. Could anybody give me some idea?
 
Thank you
Dennis
 
====================================================
execve("sbin/console", ["sbin/console"], [/* 6 vars */]) = 0
uname({sys="Linux", node="6200_linux", ...}) = 0
brk(0)                                  = 0x10059134
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or
directory)
open("/lib/libncurses.so.5", O_RDONLY)  = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\001"..., 1024) =
1024
fstat64(0x3, 0x7ffff098)                = 0
mmap(0xff97000, 362628, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff97000
mprotect(0xffd4000, 112772, PROT_NONE)  = 0
mmap(0xffd7000, 86016, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x30000) = 0xffd7000
mmap(0xffec000, 14468, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffec000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\34"..., 1024)
= 1024
fstat64(0x3, 0x7ffff078)                = 0
mmap(0xff74000, 74812, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff74000
mprotect(0xff77000, 62524, PROT_NONE)   = 0
mmap(0xff84000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xff84000
close(3)                                = 0
open("/lib/libnsl.so.1", O_RDONLY)      = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0A\274"...,
1024) = 1024
fstat64(0x3, 0x7ffff058)                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x30017000
mmap(0xff3e000, 152068, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff3e000
mprotect(0xff51000, 74244, PROT_NONE)   = 0
mmap(0xff5e000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x10000) = 0xff5e000
mmap(0xff61000, 8708, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff61000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\322"..., 1024)
= 1024
fstat64(0x3, 0x7ffff038)                = 0
mmap(0xfddd000, 1379388, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xfddd000
mprotect(0xff16000, 97340, PROT_NONE)   = 0
mmap(0xff1d000, 61440, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0xff1d000
mmap(0xff2c000, 7228, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff2c000
close(3)                                = 0
brk(0)                                  = 0x10059134
brk(0x1005a134)                         = 0x1005a134
brk(0x1005b000)                         = 0x1005b000
write(2, "before init_ncurses()\n", 22) = 22
write(2, "before initscr()\n", 17)      = 17
access("/usr/share/terminfo/v/vt100", R_OK) = 0
open("/usr/share/terminfo/v/vt100", O_RDONLY) = 3
read(3, "\32\1,\0\25\0\7\0\16\1\3\2", 12) = 12
read(3, "vt100|vt100-am|dec vt100 (w/adva"..., 44) = 44
read(3, "\0\1\0\0\1\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\1", 21) = 21
read(3, "\0", 1)                        = 1
read(3, "P\0\10\0\30\0\377\377\377\377\377\377\3\0", 14) = 14
read(3, "\377\377\0\0\2\0\4\0\25\0\32\0&\0.\0\377\377\377\3777\0"..., 540) =
540
read(3, "\7\0\r\0\33[%i%p1%d;%p2%dr\0\33[3g\0\33[H\33[J"..., 515) = 515
read(3, "", 1)                          = 0
read(3, "", 10)                         = 0
close(3)                                = 0
-- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
 
 


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

^ permalink raw reply

* MPC8272 runs application with segmentation fault
From: Nai-Hsien @ 2005-06-07 13:11 UTC (permalink / raw)
  To: linuxppc-embedded

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

Dear experts,

I have two hardware boards, one uses MPC8245 and the other one uses MPC8272.
Initially, I use the MPC8245 board to port Linux 2.4.20 and write some applications.
I already do a lot of test on the MPC8245 board and all my application programs work
fine.

After this, I use the same kernel configuration and same file system that are being used
by the MPC8245 board to port the whole system to my MPC8272.
Now, I can boot the kernel and run busybox well. However, when
I run my application programs, I always get segmentation fault. Following is a strace
dump. Could anybody give me some idea?

Thank you
Dennis

====================================================
execve("sbin/console", ["sbin/console"], [/* 6 vars */]) = 0
uname({sys="Linux", node="6200_linux", ...}) = 0
brk(0)                                  = 0x10059134
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/lib/libncurses.so.5", O_RDONLY)  = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\001"..., 1024) = 1024
fstat64(0x3, 0x7ffff098)                = 0
mmap(0xff97000, 362628, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff97000
mprotect(0xffd4000, 112772, PROT_NONE)  = 0
mmap(0xffd7000, 86016, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x30000) = 0xffd7000
mmap(0xffec000, 14468, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffec000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\34"..., 1024) = 1024
fstat64(0x3, 0x7ffff078)                = 0
mmap(0xff74000, 74812, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff74000
mprotect(0xff77000, 62524, PROT_NONE)   = 0
mmap(0xff84000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xff84000
close(3)                                = 0
open("/lib/libnsl.so.1", O_RDONLY)      = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0A\274"..., 1024) = 1024
fstat64(0x3, 0x7ffff058)                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30017000
mmap(0xff3e000, 152068, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xff3e000
mprotect(0xff51000, 74244, PROT_NONE)   = 0
mmap(0xff5e000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x10000) = 0xff5e000
mmap(0xff61000, 8708, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff61000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\322"..., 1024) = 1024
fstat64(0x3, 0x7ffff038)                = 0
mmap(0xfddd000, 1379388, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xfddd000
mprotect(0xff16000, 97340, PROT_NONE)   = 0
mmap(0xff1d000, 61440, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0xff1d000
mmap(0xff2c000, 7228, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff2c000
close(3)                                = 0
brk(0)                                  = 0x10059134
brk(0x1005a134)                         = 0x1005a134
brk(0x1005b000)                         = 0x1005b000
write(2, "before init_ncurses()\n", 22) = 22
write(2, "before initscr()\n", 17)      = 17
access("/usr/share/terminfo/v/vt100", R_OK) = 0
open("/usr/share/terminfo/v/vt100", O_RDONLY) = 3
read(3, "\32\1,\0\25\0\7\0\16\1\3\2", 12) = 12
read(3, "vt100|vt100-am|dec vt100 (w/adva"..., 44) = 44
read(3, "\0\1\0\0\1\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\1", 21) = 21
read(3, "\0", 1)                        = 1
read(3, "P\0\10\0\30\0\377\377\377\377\377\377\3\0", 14) = 14
read(3, "\377\377\0\0\2\0\4\0\25\0\32\0&\0.\0\377\377\377\3777\0"..., 540) = 540
read(3, "\7\0\r\0\33[%i%p1%d;%p2%dr\0\33[3g\0\33[H\33[J"..., 515) = 515
read(3, "", 1)                          = 0
read(3, "", 10)                         = 0
close(3)                                = 0
-- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault


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

^ permalink raw reply

* Kernel stack overflow on process 0xc00cd274
From: andreas_schmidt @ 2005-06-07 11:34 UTC (permalink / raw)
  To: linuxppc-embedded

Hi at all

I still try to boot Linux with u-boot. I use Linux 2.4.24.
The problem is that near the begin on startup Kernel the Linux hanks. I find the log
buffer and there are massages folow:

Kernel Stack overflow on process 0xc00c4030
Kernel Stack overflow on process 0xc00c4460

Under this address I found in the System.map that this is the init_stack_union.

Know somebody why this conflict comes?

many thanks,
best regards,

Andreas Schmidt

^ 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