LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* mmu_hash_lock deadlock causes kernel stuck at 2.6.21 SMP powerpc 32bit
From: Gaash Hazan @ 2008-03-30 11:47 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: gaash-ppclnx, gilad

Hello PPC SMP MM experts,

mmu_hash_lock (arch/powerpc/mm/hash_low_32.S) is a
(non-standard) spin lock that protects the CPU MMU
hashing table. It exists and used only with SMP
configurations.

In some scenarios, the spin lock is taken when
interrupts are *enabled* causing kernel deadlock at
the next take attempt in the same CPU.

The deadlock happened on 2.6.21 kernel, Powerpc 32 bit
with SMP enabled. At this moment system had one active
CPU. The sequence I saw was:

do_exit (program termination) 
exit_mm
mmput 
exit_mmap 
free_pgtables
free_pgd_range
unmap_vmas 
pte_free
hash_page_sync (takes mmu_hash_lock. Note: interrupts
are enabled)

timer_interrupt (timer interrupts occurs during
hash_page_sync, lock is taken)
irq_exit
do_softirq
__do_softirq
net_rx_action (packet received from network)
( ... omitted ... )
xdr_skb_read_bits
skb_copy_bits
memcpy - memcpy causes DSI exception(0x300). This is
OK. 
DSI exception handler calls hash_page
hash_page waits for mmu_mash_lock. It waits forever
since the lock is already taken. 
Deadlock! with interrupts disabled. kernel is dead.

I think the rout cause of the problem is
hash_page_sync() taking the mmu_hash_lock spin lock
without disabling interrupts. This leads to the
deadlock.

To verify the theory, hash_page_sync() was wrapped
with interrupts disabled code and problem never
occurred again. Of course this is temporary workaround
as there are several places needed to be fixed.

What do you think?

Thanks,

Gaash

^ permalink raw reply

* black screen problem
From: 刘小双 @ 2008-03-30 13:14 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <e81b2fb40803292139u3f59c64fv9c04612c56d45500@mail.gmail.com>

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

 hi,all

I  compiled linux-2.6.12 for mpc8540 with DENX eldk4.0, my plabtform is
custom mpc8540 board, mb86296 video card, eldk4.0 ppc_85xx file sysytem.
Accelerated  driver is x11_mb86290 offered by DENX .  I compiled XFree86
4.3.0, then I ran startx, the screen was black for a few seconds and it
turned to text mode.

there are some hints in XFree86.0.log:


fbdevHW: MapVidmem 0
 fbdevHW: LinearOffset 0
 fbdevHW: Save 0
 fbdevHW: ModeInit 0
 xfree init mode: 50000   1024 1024 1024 1024   768 768 768 768
 fbdev init mode: 20000   1024 0 0 0   768 0 0 0   16 5:5:5
 fbdevHW: AdjustFrame 0
 (==) MB86290(0): Backing store disabled
 (II) MB86290(0): Using XFree86 Acceleration Architecture (XAA)
  Screen to screen bit blits
  Solid filled rectangles
  8x8 mono pattern filled rectangles
  Indirect CPU to Screen color expansion
  Solid Lines
  Dashed Lines
 (II) MB86290(0): Acceleration enabled
 fbdevHW: ModeInit 0

 Fatal server error:
 AddScreen/ScreenInit failed for driver 0


 When reporting a problem related to a server crash, please send
 the full server output, not just the last messages.
 This can be found in the log file "/var/log/XFree86.0.log".
 Please report problems to xfree86@xfree86.org.

 fbdevHW: LeaveVT 0
 fbdevHW: Restore 0

then I changed configuration file as follows:

Section "Device"


  Identifier "CoralP"
  Driver  "mb86290"
  Option "Video" "no"  --forbid I2c bus

EndSection

then I run startx, the screen was black forever and there was no
MousePointer, and  here is output of XFree86.0.log:

XFree86 Version 4.3.0
Release Date: 27 February 2003
X Protocol Version 11, Revision 0, Release 6.6
Build Operating System: Linux 2.6.12.6 ppc [ELF]
Build Date: 17 March 2008
 Before reporting problems, check
http://www.XFree86.Org/<http://www.xfree86.org/>
 to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Wed Mar 19 17:24:36 2008
(==) Using config file: "/etc/X11/XF86Config-4"
(==) ServerLayout "Default Layout"
(**) |-->Screen "Default Screen" (0)
(**) |   |-->Monitor "Generic Monitor"
(**) |   |-->Device "CoralP"
(**) |-->Input Device "Generic Keyboard"
(**) Option "XkbRules" "xfree86"
(**) XKB: rules: "xfree86"
(**) Option "XkbModel" "macintosh"
(**) XKB: model: "macintosh"
(**) Option "XkbLayout" "us"
(**) XKB: layout: "us"
(==) Keyboard: CustomKeycode disabled
(**) |-->Input Device "Configured Mouse"
(WW) The directory "/usr/lib/X11/fonts/misc" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/cyrillic" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/100dpi/" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/75dpi/" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/Type1" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/CID" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/Speedo" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/100dpi" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/75dpi" does not exist.
 Entry deleted from font path.
(WW) FontPath is completely invalid.  Using compiled-in default.
(==) FontPath set to
"/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,/usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/CID/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/100dpi/"
(==) RgbPath set to "/usr/X11R6/lib/X11/rgb"
(==) ModulePath set to "/usr/X11R6/lib/modules"
(--) using VT number 2

(WW) Open APM failed (/dev/apm_bios) (No such file or directory)
(II) Module ABI versions:
 XFree86 ANSI C Emulation: 0.2
 XFree86 Video Driver: 0.6
 XFree86 XInput driver : 0.4
 XFree86 Server Extension : 0.2
 XFree86 Font Renderer : 0.4
(II) Loader running on linux
(II) LoadModule: "bitmap"
(II) Loading /usr/X11R6/lib/modules/fonts/libbitmap.a
(II) Module bitmap: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 Module class: XFree86 Font Renderer
 ABI class: XFree86 Font Renderer, version 0.4
(II) Loading font Bitmap
(II) LoadModule: "pcidata"
(II) Loading /usr/X11R6/lib/modules/libpcidata.a
(II) Module pcidata: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 ABI class: XFree86 Video Driver, version 0.6
(II) PCI: PCI scan (all values are in hex)
(II) PCI: 00:12:0: chip 10cf,201e card 0000,0000 rev 01 class 03,80,00 hdr
00
(II) PCI: 00:13:0: chip 1095,0680 card 1095,0680 rev 02 class 01,01,85 hdr
00
(II) PCI: 00:14:0: chip 10b5,6540 card 0000,0000 rev cb class 06,04,00 hdr
01
(II) PCI: End of PCI scan
(II) PCI-to-PCI bridge:
(II) Bus 1: bridge is at (0:20:0), (0,1,1), BCTRL: 0x0000 (VGA_EN is
cleared)
(II) Bus 1 I/O range:
 [0] -1 0 0x00ffe000 - 0x00ffefff (0x1000) IX[B]
(II) Bus 1 non-prefetchable memory range:
 [0] -1 0 0x9be00000 - 0x9befffff (0x100000) MX[B]
(II) Bus 1 prefetchable memory range:
 [0] -1 0 0x9bd00000 - 0x9bdfffff (0x100000) MX[B]
(II) Host-to-PCI bridge:
(II) Bus 0: bridge is at (0:0:0), (-1,0,0), BCTRL: 0x0008 (VGA_EN is set)
(II) Bus 0 I/O range:
 [0] -1 0 0x00000000 - 0x0000ffff (0x10000) IX[B]
(II) Bus 0 non-prefetchable memory range:
 [0] -1 0 0x00000000 - 0xffffffff (0x0) MX[B]
(II) Bus 0 prefetchable memory range:
 [0] -1 0 0x00000000 - 0xffffffff (0x0) MX[B]
(--) PCI:*(0:18:0) unknown vendor (0x10cf) unknown chipset (0x201e) rev 1,
Mem @ 0x9c000000/26
(II) Addressable bus resource ranges are
 [0] -1 0 0x00000000 - 0xffffffff (0x0) MX[B]
 [1] -1 0 0x00000000 - 0x0000ffff (0x10000) IX[B]
(II) OS-reported resource ranges:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [3] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
(II) Active PCI resource ranges:
 [0] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [1] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [2] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [3] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [4] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [5] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [6] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
(II) Active PCI resource ranges after removing overlaps:
 [0] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [1] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [2] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [3] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [4] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [5] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [6] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
(II) OS-reported resource ranges after removing overlaps with PCI:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [3] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
(II) All system resource ranges:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [3] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [4] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [5] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
 [6] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [7] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [8] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [9] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [10] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
(II) LoadModule: "bitmap"
(II) Reloading /usr/X11R6/lib/modules/fonts/libbitmap.a
(II) Loading font Bitmap
(II) LoadModule: "dbe"
(II) Loading /usr/X11R6/lib/modules/extensions/libdbe.a
(II) Module dbe: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 Module class: XFree86 Server Extension
 ABI class: XFree86 Server Extension, version 0.2
(II) Loading extension DOUBLE-BUFFER
(II) LoadModule: "ddc"
(II) Loading /usr/X11R6/lib/modules/libddc.a
(II) Module ddc: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 ABI class: XFree86 Video Driver, version 0.6
(II) LoadModule: "extmod"
(II) Loading /usr/X11R6/lib/modules/extensions/libextmod.a
(II) Module extmod: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 Module class: XFree86 Server Extension
 ABI class: XFree86 Server Extension, version 0.2
(II) Loading extension SHAPE
(II) Loading extension MIT-SUNDRY-NONSTANDARD
(II) Loading extension BIG-REQUESTS
(II) Loading extension SYNC
(II) Loading extension MIT-SCREEN-SAVER
(II) Loading extension XC-MISC
(II) Loading extension XFree86-VidModeExtension
(II) Loading extension XFree86-Misc
(II) Loading extension XFree86-DGA
(II) Loading extension DPMS
(II) Loading extension FontCache
(II) Loading extension TOG-CUP
(II) Loading extension Extended-Visual-Information
(II) Loading extension XVideo
(II) Loading extension XVideo-MotionCompensation
(II) Loading extension X-Resource
(II) LoadModule: "freetype"
(II) Loading /usr/X11R6/lib/modules/fonts/libfreetype.a
(II) Module freetype: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 2.0.2
 Module class: XFree86 Font Renderer
 ABI class: XFree86 Font Renderer, version 0.4
(II) Loading font FreeType
(II) LoadModule: "speedo"
(II) Loading /usr/X11R6/lib/modules/fonts/libspeedo.a
(II) Module speedo: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.1
 Module class: XFree86 Font Renderer
 ABI class: XFree86 Font Renderer, version 0.4
(II) Loading font Speedo
(II) LoadModule: "type1"
(II) Loading /usr/X11R6/lib/modules/fonts/libtype1.a
(II) Module type1: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.2
 Module class: XFree86 Font Renderer
 ABI class: XFree86 Font Renderer, version 0.4
(II) Loading font Type1
(II) LoadModule: "vbe"
(II) Loading /usr/X11R6/lib/modules/libvbe.a
(II) Module vbe: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.1.0
 ABI class: XFree86 Video Driver, version 0.6
(II) LoadModule: "mb86290"
(II) Loading /usr/X11R6/lib/modules/drivers/mb86290_drv.o
(II) Module mb86290: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 0.1.0
 Module class: XFree86 Video Driver
 ABI class: XFree86 Video Driver, version 0.6
(II) LoadModule: "mouse"
(II) Loading /usr/X11R6/lib/modules/input/mouse_drv.o
(II) Module mouse: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 Module class: XFree86 XInput Driver
 ABI class: XFree86 XInput driver, version 0.4
(II) MB86290: Fujitsu chip: mb86290
(II) Primary Device is: PCI 00:12:0
(II) Loading sub module "fbdevhw"
(II) LoadModule: "fbdevhw"
(II) Loading /usr/X11R6/lib/modules/linux/libfbdevhw.a
(II) Module fbdevhw: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 0.0.2
 ABI class: XFree86 Video Driver, version 0.6
(--) Assigning device section with no busID to primary device
(--) Chipset mb86290 found
(II) resource ranges after xf86ClaimFixedResources() call:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [3] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [4] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [5] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
 [6] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [7] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [8] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [9] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [10] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
(II) resource ranges after probing:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [3] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [4] 0 0 0x000a0000 - 0x000affff (0x10000) MS[B]
 [5] 0 0 0x000b0000 - 0x000b7fff (0x8000) MS[B]
 [6] 0 0 0x000b8000 - 0x000bffff (0x8000) MS[B]
 [7] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [8] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
 [9] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [10] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [11] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [12] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [13] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
 [14] 0 0 0x000003b0 - 0x000003bb (0xc) IS[B]
 [15] 0 0 0x000003c0 - 0x000003df (0x20) IS[B]
(II) Setting vga for screen 0.
fbdevHW: Init 0
(==) MB86290(0): Depth 15, (==) framebuffer bpp 16
(==) MB86290(0): RGB weight 555
(==) MB86290(0): Default visual is TrueColor
(==) MB86290(0): Using gamma correction (1.0, 1.0, 1.0)
(**) MB86290(0): Option "accel" "no"
(**) MB86290(0): Option "video" "no"
fbdevHW: UseBuildinMode 0
(--) MB86290(0): Virtual size is 1024x768 (pitch 1024)
(**) MB86290(0):  Built-in mode "current": 50.0 MHz, 48.8 kHz, 63.6 Hz
(II) MB86290(0): Modeline "current"   50.00  1024 1024 1024 1024  768 768
768 768 -hsync -vsync -csync
(==) MB86290(0): DPI set to (75, 75)
(II) Loading sub module "mb86290_fb"
(II) LoadModule: "mb86290_fb"
(II) Loading /usr/X11R6/lib/modules/libmb86290_fb.a
(II) Module mb86290_fb: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 ABI class: XFree86 ANSI C Emulation, version 0.2
(II) do I need RAC?  No, I don't.
(II) resource ranges after preInit:
 [0] 0 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B]
 [1] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [2] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [3] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [4] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [5] 0 0 0x000a0000 - 0x000affff (0x10000) MS[B]
 [6] 0 0 0x000b0000 - 0x000b7fff (0x8000) MS[B]
 [7] 0 0 0x000b8000 - 0x000bffff (0x8000) MS[B]
 [8] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [9] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
 [10] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [11] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [12] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [13] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [14] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
 [15] 0 0 0x000003b0 - 0x000003bb (0xc) IS[B]
 [16] 0 0 0x000003c0 - 0x000003df (0x20) IS[B]
fbdevHW: MapVidmem 0
fbdevHW: LinearOffset 0
fbdevHW: Save 0
fbdevHW: ModeInit 0
xfree init mode: 50000   1024 1024 1024 1024   768 768 768 768
fbdev init mode: 20000   1024 0 0 0   768 0 0 0   16 5:5:5
fbdevHW: AdjustFrame 0
(==) MB86290(0): Backing store disabled
(II) MB86290(0): Acceleration disabled
fbdevHW: ModeInit 0

 Thanks,
liuxs

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

^ permalink raw reply

* black screen problem
From: 刘小双 @ 2008-03-30 13:16 UTC (permalink / raw)
  To: linuxppc-embedded

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

hi,all

I  compiled linux-2.6.12 for mpc8540 with DENX eldk4.0, my plabtform is
custom mpc8540 board, mb86296 video card, eldk4.0 ppc_85xx file sysytem.
Accelerated  driver is x11_mb86290 offered by DENX .  I compiled XFree86
4.3.0, then I ran startx, the screen was black for a few seconds and it
turned to text mode.

there are some hints in XFree86.0.log:


fbdevHW: MapVidmem 0
 fbdevHW: LinearOffset 0
 fbdevHW: Save 0
 fbdevHW: ModeInit 0
 xfree init mode: 50000   1024 1024 1024 1024   768 768 768 768
 fbdev init mode: 20000   1024 0 0 0   768 0 0 0   16 5:5:5
 fbdevHW: AdjustFrame 0
 (==) MB86290(0): Backing store disabled
 (II) MB86290(0): Using XFree86 Acceleration Architecture (XAA)
  Screen to screen bit blits
  Solid filled rectangles
  8x8 mono pattern filled rectangles
  Indirect CPU to Screen color expansion
  Solid Lines
  Dashed Lines
 (II) MB86290(0): Acceleration enabled
 fbdevHW: ModeInit 0

 Fatal server error:
 AddScreen/ScreenInit failed for driver 0


 When reporting a problem related to a server crash, please send
 the full server output, not just the last messages.
 This can be found in the log file "/var/log/XFree86.0.log".
 Please report problems to xfree86@xfree86.org.

 fbdevHW: LeaveVT 0
 fbdevHW: Restore 0

then I changed configuration file as follows:

Section "Device"


  Identifier "CoralP"
  Driver  "mb86290"
  Option "Video" "no"  --forbid I2c bus

EndSection

then I run startx, the screen was black forever and there was no
MousePointer, and  here is output of XFree86.0.log:

XFree86 Version 4.3.0
Release Date: 27 February 2003
X Protocol Version 11, Revision 0, Release 6.6
Build Operating System: Linux 2.6.12.6 ppc [ELF]
Build Date: 17 March 2008
 Before reporting problems, check
http://www.XFree86.Org/<http://www.xfree86.org/>
 to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Wed Mar 19 17:24:36 2008
(==) Using config file: "/etc/X11/XF86Config-4"
(==) ServerLayout "Default Layout"
(**) |-->Screen "Default Screen" (0)
(**) |   |-->Monitor "Generic Monitor"
(**) |   |-->Device "CoralP"
(**) |-->Input Device "Generic Keyboard"
(**) Option "XkbRules" "xfree86"
(**) XKB: rules: "xfree86"
(**) Option "XkbModel" "macintosh"
(**) XKB: model: "macintosh"
(**) Option "XkbLayout" "us"
(**) XKB: layout: "us"
(==) Keyboard: CustomKeycode disabled
(**) |-->Input Device "Configured Mouse"
(WW) The directory "/usr/lib/X11/fonts/misc" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/cyrillic" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/100dpi/" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/75dpi/" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/Type1" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/CID" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/Speedo" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/100dpi" does not exist.
 Entry deleted from font path.
(WW) The directory "/usr/lib/X11/fonts/75dpi" does not exist.
 Entry deleted from font path.
(WW) FontPath is completely invalid.  Using compiled-in default.
(==) FontPath set to
"/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,/usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/CID/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/100dpi/"
(==) RgbPath set to "/usr/X11R6/lib/X11/rgb"
(==) ModulePath set to "/usr/X11R6/lib/modules"
(--) using VT number 2

(WW) Open APM failed (/dev/apm_bios) (No such file or directory)
(II) Module ABI versions:
 XFree86 ANSI C Emulation: 0.2
 XFree86 Video Driver: 0.6
 XFree86 XInput driver : 0.4
 XFree86 Server Extension : 0.2
 XFree86 Font Renderer : 0.4
(II) Loader running on linux
(II) LoadModule: "bitmap"
(II) Loading /usr/X11R6/lib/modules/fonts/libbitmap.a
(II) Module bitmap: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 Module class: XFree86 Font Renderer
 ABI class: XFree86 Font Renderer, version 0.4
(II) Loading font Bitmap
(II) LoadModule: "pcidata"
(II) Loading /usr/X11R6/lib/modules/libpcidata.a
(II) Module pcidata: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 ABI class: XFree86 Video Driver, version 0.6
(II) PCI: PCI scan (all values are in hex)
(II) PCI: 00:12:0: chip 10cf,201e card 0000,0000 rev 01 class 03,80,00 hdr
00
(II) PCI: 00:13:0: chip 1095,0680 card 1095,0680 rev 02 class 01,01,85 hdr
00
(II) PCI: 00:14:0: chip 10b5,6540 card 0000,0000 rev cb class 06,04,00 hdr
01
(II) PCI: End of PCI scan
(II) PCI-to-PCI bridge:
(II) Bus 1: bridge is at (0:20:0), (0,1,1), BCTRL: 0x0000 (VGA_EN is
cleared)
(II) Bus 1 I/O range:
 [0] -1 0 0x00ffe000 - 0x00ffefff (0x1000) IX[B]
(II) Bus 1 non-prefetchable memory range:
 [0] -1 0 0x9be00000 - 0x9befffff (0x100000) MX[B]
(II) Bus 1 prefetchable memory range:
 [0] -1 0 0x9bd00000 - 0x9bdfffff (0x100000) MX[B]
(II) Host-to-PCI bridge:
(II) Bus 0: bridge is at (0:0:0), (-1,0,0), BCTRL: 0x0008 (VGA_EN is set)
(II) Bus 0 I/O range:
 [0] -1 0 0x00000000 - 0x0000ffff (0x10000) IX[B]
(II) Bus 0 non-prefetchable memory range:
 [0] -1 0 0x00000000 - 0xffffffff (0x0) MX[B]
(II) Bus 0 prefetchable memory range:
 [0] -1 0 0x00000000 - 0xffffffff (0x0) MX[B]
(--) PCI:*(0:18:0) unknown vendor (0x10cf) unknown chipset (0x201e) rev 1,
Mem @ 0x9c000000/26
(II) Addressable bus resource ranges are
 [0] -1 0 0x00000000 - 0xffffffff (0x0) MX[B]
 [1] -1 0 0x00000000 - 0x0000ffff (0x10000) IX[B]
(II) OS-reported resource ranges:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [3] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
(II) Active PCI resource ranges:
 [0] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [1] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [2] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [3] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [4] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [5] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [6] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
(II) Active PCI resource ranges after removing overlaps:
 [0] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [1] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [2] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [3] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [4] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [5] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [6] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
(II) OS-reported resource ranges after removing overlaps with PCI:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [3] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
(II) All system resource ranges:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [3] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [4] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [5] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
 [6] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [7] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [8] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [9] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [10] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
(II) LoadModule: "bitmap"
(II) Reloading /usr/X11R6/lib/modules/fonts/libbitmap.a
(II) Loading font Bitmap
(II) LoadModule: "dbe"
(II) Loading /usr/X11R6/lib/modules/extensions/libdbe.a
(II) Module dbe: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 Module class: XFree86 Server Extension
 ABI class: XFree86 Server Extension, version 0.2
(II) Loading extension DOUBLE-BUFFER
(II) LoadModule: "ddc"
(II) Loading /usr/X11R6/lib/modules/libddc.a
(II) Module ddc: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 ABI class: XFree86 Video Driver, version 0.6
(II) LoadModule: "extmod"
(II) Loading /usr/X11R6/lib/modules/extensions/libextmod.a
(II) Module extmod: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 Module class: XFree86 Server Extension
 ABI class: XFree86 Server Extension, version 0.2
(II) Loading extension SHAPE
(II) Loading extension MIT-SUNDRY-NONSTANDARD
(II) Loading extension BIG-REQUESTS
(II) Loading extension SYNC
(II) Loading extension MIT-SCREEN-SAVER
(II) Loading extension XC-MISC
(II) Loading extension XFree86-VidModeExtension
(II) Loading extension XFree86-Misc
(II) Loading extension XFree86-DGA
(II) Loading extension DPMS
(II) Loading extension FontCache
(II) Loading extension TOG-CUP
(II) Loading extension Extended-Visual-Information
(II) Loading extension XVideo
(II) Loading extension XVideo-MotionCompensation
(II) Loading extension X-Resource
(II) LoadModule: "freetype"
(II) Loading /usr/X11R6/lib/modules/fonts/libfreetype.a
(II) Module freetype: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 2.0.2
 Module class: XFree86 Font Renderer
 ABI class: XFree86 Font Renderer, version 0.4
(II) Loading font FreeType
(II) LoadModule: "speedo"
(II) Loading /usr/X11R6/lib/modules/fonts/libspeedo.a
(II) Module speedo: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.1
 Module class: XFree86 Font Renderer
 ABI class: XFree86 Font Renderer, version 0.4
(II) Loading font Speedo
(II) LoadModule: "type1"
(II) Loading /usr/X11R6/lib/modules/fonts/libtype1.a
(II) Module type1: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.2
 Module class: XFree86 Font Renderer
 ABI class: XFree86 Font Renderer, version 0.4
(II) Loading font Type1
(II) LoadModule: "vbe"
(II) Loading /usr/X11R6/lib/modules/libvbe.a
(II) Module vbe: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.1.0
 ABI class: XFree86 Video Driver, version 0.6
(II) LoadModule: "mb86290"
(II) Loading /usr/X11R6/lib/modules/drivers/mb86290_drv.o
(II) Module mb86290: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 0.1.0
 Module class: XFree86 Video Driver
 ABI class: XFree86 Video Driver, version 0.6
(II) LoadModule: "mouse"
(II) Loading /usr/X11R6/lib/modules/input/mouse_drv.o
(II) Module mouse: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 Module class: XFree86 XInput Driver
 ABI class: XFree86 XInput driver, version 0.4
(II) MB86290: Fujitsu chip: mb86290
(II) Primary Device is: PCI 00:12:0
(II) Loading sub module "fbdevhw"
(II) LoadModule: "fbdevhw"
(II) Loading /usr/X11R6/lib/modules/linux/libfbdevhw.a
(II) Module fbdevhw: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 0.0.2
 ABI class: XFree86 Video Driver, version 0.6
(--) Assigning device section with no busID to primary device
(--) Chipset mb86290 found
(II) resource ranges after xf86ClaimFixedResources() call:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [3] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [4] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [5] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
 [6] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [7] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [8] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [9] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [10] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
(II) resource ranges after probing:
 [0] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [1] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [2] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [3] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [4] 0 0 0x000a0000 - 0x000affff (0x10000) MS[B]
 [5] 0 0 0x000b0000 - 0x000b7fff (0x8000) MS[B]
 [6] 0 0 0x000b8000 - 0x000bffff (0x8000) MS[B]
 [7] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [8] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
 [9] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [10] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [11] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [12] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [13] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
 [14] 0 0 0x000003b0 - 0x000003bb (0xc) IS[B]
 [15] 0 0 0x000003c0 - 0x000003df (0x20) IS[B]
(II) Setting vga for screen 0.
fbdevHW: Init 0
(==) MB86290(0): Depth 15, (==) framebuffer bpp 16
(==) MB86290(0): RGB weight 555
(==) MB86290(0): Default visual is TrueColor
(==) MB86290(0): Using gamma correction (1.0, 1.0, 1.0)
(**) MB86290(0): Option "accel" "no"
(**) MB86290(0): Option "video" "no"
fbdevHW: UseBuildinMode 0
(--) MB86290(0): Virtual size is 1024x768 (pitch 1024)
(**) MB86290(0):  Built-in mode "current": 50.0 MHz, 48.8 kHz, 63.6 Hz
(II) MB86290(0): Modeline "current"   50.00  1024 1024 1024 1024  768 768
768 768 -hsync -vsync -csync
(==) MB86290(0): DPI set to (75, 75)
(II) Loading sub module "mb86290_fb"
(II) LoadModule: "mb86290_fb"
(II) Loading /usr/X11R6/lib/modules/libmb86290_fb.a
(II) Module mb86290_fb: vendor="The XFree86 Project"
 compiled for 4.3.0, module version = 1.0.0
 ABI class: XFree86 ANSI C Emulation, version 0.2
(II) do I need RAC?  No, I don't.
(II) resource ranges after preInit:
 [0] 0 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B]
 [1] -1 0 0xffffffff - 0xffffffff (0x1) MX[B]
 [2] -1 0 0x00000000 - 0x00000000 (0x1) MX[B]
 [3] -1 0 0x9bffff00 - 0x9bffffff (0x100) MX[B]
 [4] -1 0 0x9c000000 - 0x9fffffff (0x4000000) MX[B](B)
 [5] 0 0 0x000a0000 - 0x000affff (0x10000) MS[B]
 [6] 0 0 0x000b0000 - 0x000b7fff (0x8000) MS[B]
 [7] 0 0 0x000b8000 - 0x000bffff (0x8000) MS[B]
 [8] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
 [9] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
 [10] -1 0 0x00ffffd0 - 0x00ffffdf (0x10) IX[B]
 [11] -1 0 0x00ffffe4 - 0x00ffffe7 (0x4) IX[B]
 [12] -1 0 0x00ffffe8 - 0x00ffffef (0x8) IX[B]
 [13] -1 0 0x00fffff4 - 0x00fffff7 (0x4) IX[B]
 [14] -1 0 0x00fffff8 - 0x00ffffff (0x8) IX[B]
 [15] 0 0 0x000003b0 - 0x000003bb (0xc) IS[B]
 [16] 0 0 0x000003c0 - 0x000003df (0x20) IS[B]
fbdevHW: MapVidmem 0
fbdevHW: LinearOffset 0
fbdevHW: Save 0
fbdevHW: ModeInit 0
xfree init mode: 50000   1024 1024 1024 1024   768 768 768 768
fbdev init mode: 20000   1024 0 0 0   768 0 0 0   16 5:5:5
fbdevHW: AdjustFrame 0
(==) MB86290(0): Backing store disabled
(II) MB86290(0): Acceleration disabled
fbdevHW: ModeInit 0

Thanks,

liuxs

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

^ permalink raw reply

* RE: Xilinx LLTEMAC driver issues
From: Stephen Neuendorffer @ 2008-03-30 17:02 UTC (permalink / raw)
  To: Magnus Hjorth, John Linn; +Cc: git, linuxppc-embedded
In-Reply-To: <1206802234.5247.19.camel@magnus-desktop>

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


I did have trouble with the 1.00 versions of the core,  if you can get EDK 10.1 with version 1.01a of the ll_temac core, that's probably worth a try.

Steve

-----Original Message-----
From: Magnus Hjorth [mailto:mh@omnisys.se]
Sent: Sat 3/29/2008 7:50 AM
To: John Linn
Cc: git; linuxppc-embedded@ozlabs.org
Subject: RE: Xilinx LLTEMAC driver issues
 
Hi John,

Thanks for the very fast reply! Right now I'm not at work so I don't
have the board or EDK here to test anything. 

I'm using checksum offload, but I don't know if DRE is enabled or not. I
can't recall seeing any setting to enable/disable DRE.. 

A few things that crossed my mind:

Last year I did a design with EDK 8.2, back then there was an issue with
the ML403 boards having an old revision of the FPGA which wasn't
compatible with some versions of the IP core. There are no such version
issues with the xps_ll_temac? 

I don't think that I had phy-addr set in the DTS file. Will test that on
Monday. 

Best regards,
Magnus


On Sat, 2008-03-29 at 07:58 -0600, John Linn wrote:
> Hi Magnus,
> 
> Sorry to hear you're having problems with it.
> 
> I am doing testing on an ML405 which is the same board but with a bigger FPGA, but with ppc arch and I don't see this issue. I have done limited testing with powerpc arch and the LL TEMAC, but I didn't see this issue there either.  Powerpc arch is definitely less mature in my experience than the ppc arch. I'll do a quick test with my powerpc arch and make sure again I'm not seeing it.
> 
> My kernel is from the Xilinx Git tree, but there have been a number of changes we have pushed out so I don't know how long ago you pulled from the Git tree.
> 
> My EDK project is 10.1 so it's a little newer. I am using LL TEMAC 1.01a so it's a little newer.  I reviewed the change log for the LL TEMAC and don't see any big problems that were fixed in the newer versions, more new features.  I'll check with some others here to see if I missed something there.
> 
> I am using DMA also, but no DRE or checksum offload.  You didn't say anything about those. I'm going to insert my mhs file that describes my system to let you compare your system configuration. It's not clear to me yet if you have a h/w or s/w problem.  
> 
> I'll also insert some of my device tree with the LL TEMAC so you can compare (ignore 16550 stuff as we are still working on that).
> 
> Since you can't ping reliably I would probably focus on that since it's simpler than the other issues you're seeing.
> 
> Thanks,
> John
> 
> 
> 
> # ##############################################################################
> # Created by Base System Builder Wizard for Xilinx EDK 10.1.1 Build EDK_K_SP1.1
> # Thu Feb 14 14:11:12 2008
> # Target Board:  Xilinx Virtex 4 ML405 Evaluation Platform Rev 1
> # Family:    virtex4
> # Device:    xc4vfx20
> # Package:   ff672
> # Speed Grade:  -10
> # Processor: ppc405_0
> # Processor clock frequency: 300.00 MHz
> # Bus clock frequency: 100.00 MHz
> # On Chip Memory :   8 KB
> # Total Off Chip Memory : 128 MB
> # - DDR_SDRAM = 128 MB
> # ##############################################################################
>  PARAMETER VERSION = 2.1.0
> 
> 
>  PORT fpga_0_RS232_Uart_sin_pin = fpga_0_RS232_Uart_sin, DIR = I
>  PORT fpga_0_RS232_Uart_sout_pin = fpga_0_RS232_Uart_sout, DIR = O
>  PORT fpga_0_LEDs_4Bit_GPIO_IO_pin = fpga_0_LEDs_4Bit_GPIO_IO, DIR = IO, VEC = [0:3]
>  PORT fpga_0_IIC_EEPROM_Scl_pin = fpga_0_IIC_EEPROM_Scl, DIR = IO
>  PORT fpga_0_IIC_EEPROM_Sda_pin = fpga_0_IIC_EEPROM_Sda, DIR = IO
>  PORT fpga_0_SysACE_CompactFlash_SysACE_CLK_pin = fpga_0_SysACE_CompactFlash_SysACE_CLK, DIR = I
>  PORT fpga_0_SysACE_CompactFlash_SysACE_MPA_pin = fpga_0_SysACE_CompactFlash_SysACE_MPA, DIR = O, VEC = [6:1]
>  PORT fpga_0_SysACE_CompactFlash_SysACE_MPD_pin = fpga_0_SysACE_CompactFlash_SysACE_MPD, DIR = IO, VEC = [15:0]
>  PORT fpga_0_SysACE_CompactFlash_SysACE_CEN_pin = fpga_0_SysACE_CompactFlash_SysACE_CEN, DIR = O
>  PORT fpga_0_SysACE_CompactFlash_SysACE_OEN_pin = fpga_0_SysACE_CompactFlash_SysACE_OEN, DIR = O
>  PORT fpga_0_SysACE_CompactFlash_SysACE_WEN_pin = fpga_0_SysACE_CompactFlash_SysACE_WEN, DIR = O
>  PORT fpga_0_SysACE_CompactFlash_SysACE_MPIRQ_pin = fpga_0_SysACE_CompactFlash_SysACE_MPIRQ, DIR = I
>  PORT fpga_0_DDR_SDRAM_DDR_Clk_pin = fpga_0_DDR_SDRAM_DDR_Clk, DIR = O
>  PORT fpga_0_DDR_SDRAM_DDR_Clk_n_pin = fpga_0_DDR_SDRAM_DDR_Clk_n, DIR = O
>  PORT fpga_0_DDR_SDRAM_DDR_Addr_pin = fpga_0_DDR_SDRAM_DDR_Addr, DIR = O, VEC = [12:0]
>  PORT fpga_0_DDR_SDRAM_DDR_BankAddr_pin = fpga_0_DDR_SDRAM_DDR_BankAddr, DIR = O, VEC = [1:0]
>  PORT fpga_0_DDR_SDRAM_DDR_CAS_n_pin = fpga_0_DDR_SDRAM_DDR_CAS_n, DIR = O
>  PORT fpga_0_DDR_SDRAM_DDR_CE_pin = fpga_0_DDR_SDRAM_DDR_CE, DIR = O
>  PORT fpga_0_DDR_SDRAM_DDR_CS_n_pin = fpga_0_DDR_SDRAM_DDR_CS_n, DIR = O
>  PORT fpga_0_DDR_SDRAM_DDR_RAS_n_pin = fpga_0_DDR_SDRAM_DDR_RAS_n, DIR = O
>  PORT fpga_0_DDR_SDRAM_DDR_WE_n_pin = fpga_0_DDR_SDRAM_DDR_WE_n, DIR = O
>  PORT fpga_0_DDR_SDRAM_DDR_DM_pin = fpga_0_DDR_SDRAM_DDR_DM, DIR = O, VEC = [3:0]
>  PORT fpga_0_DDR_SDRAM_DDR_DQS = fpga_0_DDR_SDRAM_DDR_DQS, DIR = IO, VEC = [3:0]
>  PORT fpga_0_DDR_SDRAM_DDR_DQ = fpga_0_DDR_SDRAM_DDR_DQ, DIR = IO, VEC = [31:0]
>  PORT fpga_0_TriMode_MAC_GMII_GMII_TXD_0_pin = fpga_0_TriMode_MAC_GMII_GMII_TXD_0, DIR = O, VEC = [7:0]
>  PORT fpga_0_TriMode_MAC_GMII_GMII_TX_EN_0_pin = fpga_0_TriMode_MAC_GMII_GMII_TX_EN_0, DIR = O
>  PORT fpga_0_TriMode_MAC_GMII_GMII_TX_ER_0_pin = fpga_0_TriMode_MAC_GMII_GMII_TX_ER_0, DIR = O
>  PORT fpga_0_TriMode_MAC_GMII_GMII_TX_CLK_0_pin = fpga_0_TriMode_MAC_GMII_GMII_TX_CLK_0, DIR = O
>  PORT fpga_0_TriMode_MAC_GMII_GMII_RXD_0_pin = fpga_0_TriMode_MAC_GMII_GMII_RXD_0, DIR = I, VEC = [7:0]
>  PORT fpga_0_TriMode_MAC_GMII_GMII_RX_DV_0_pin = fpga_0_TriMode_MAC_GMII_GMII_RX_DV_0, DIR = I
>  PORT fpga_0_TriMode_MAC_GMII_GMII_RX_ER_0_pin = fpga_0_TriMode_MAC_GMII_GMII_RX_ER_0, DIR = I
>  PORT fpga_0_TriMode_MAC_GMII_GMII_RX_CLK_0_pin = fpga_0_TriMode_MAC_GMII_GMII_RX_CLK_0, DIR = I
>  PORT fpga_0_TriMode_MAC_GMII_MII_TX_CLK_0_pin = fpga_0_TriMode_MAC_GMII_MII_TX_CLK_0, DIR = I
>  PORT fpga_0_TriMode_MAC_GMII_MDIO_0_pin = fpga_0_TriMode_MAC_GMII_MDIO_0, DIR = IO
>  PORT fpga_0_TriMode_MAC_GMII_MDC_0_pin = fpga_0_TriMode_MAC_GMII_MDC_0, DIR = O
>  PORT fpga_0_TriMode_MAC_GMII_TemacPhy_RST_n_pin = fpga_0_TriMode_MAC_GMII_TemacPhy_RST_n, DIR = O
>  PORT sys_clk_pin = dcm_clk_s, DIR = I, SIGIS = CLK, CLK_FREQ = 100000000
>  PORT sys_rst_pin = sys_rst_s, DIR = I, RST_POLARITY = 0, SIGIS = RST
> 
> 
> BEGIN ppc405_virtex4
>  PARAMETER INSTANCE = ppc405_0
>  PARAMETER HW_VER = 2.01.a
>  PARAMETER C_FASTEST_PLB_CLOCK = DPLB1
>  PARAMETER C_IDCR_BASEADDR = 0b0100000000
>  PARAMETER C_IDCR_HIGHADDR = 0b0111111111
>  BUS_INTERFACE JTAGPPC = jtagppc_0_0
>  BUS_INTERFACE IPLB0 = plb
>  BUS_INTERFACE DPLB0 = plb
>  BUS_INTERFACE IPLB1 = ppc405_0_iplb1
>  BUS_INTERFACE DPLB1 = ppc405_0_dplb1
>  BUS_INTERFACE RESETPPC = ppc_reset_bus
>  PORT CPMC405CLOCK = proc_clk_s
>  PORT EICC405EXTINPUTIRQ = EICC405EXTINPUTIRQ
> END
> 
> BEGIN jtagppc_cntlr
>  PARAMETER INSTANCE = jtagppc_0
>  PARAMETER HW_VER = 2.01.a
>  BUS_INTERFACE JTAGPPC0 = jtagppc_0_0
> END
> 
> BEGIN plb_v46
>  PARAMETER INSTANCE = plb
>  PARAMETER C_DCR_INTFCE = 0
>  PARAMETER C_NUM_CLK_PLB2OPB_REARB = 100
>  PARAMETER HW_VER = 1.02.a
>  PORT PLB_Clk = sys_clk_s
>  PORT SYS_Rst = sys_bus_reset
> END
> 
> BEGIN xps_bram_if_cntlr
>  PARAMETER INSTANCE = xps_bram_if_cntlr_1
>  PARAMETER HW_VER = 1.00.a
>  PARAMETER C_SPLB_NATIVE_DWIDTH = 64
>  PARAMETER C_BASEADDR = 0xffffe000
>  PARAMETER C_HIGHADDR = 0xffffffff
>  BUS_INTERFACE SPLB = plb
>  BUS_INTERFACE PORTA = xps_bram_if_cntlr_1_port
> END
> 
> BEGIN bram_block
>  PARAMETER INSTANCE = plb_bram_if_cntlr_1_bram
>  PARAMETER HW_VER = 1.00.a
>  BUS_INTERFACE PORTA = xps_bram_if_cntlr_1_port
> END
> 
> BEGIN xps_uart16550
>  PARAMETER INSTANCE = RS232_Uart
>  PARAMETER HW_VER = 2.00.a
>  PARAMETER C_IS_A_16550 = 1
>  PARAMETER C_BASEADDR = 0x83e00000
>  PARAMETER C_HIGHADDR = 0x83e0ffff
>  BUS_INTERFACE SPLB = plb
>  PORT sin = fpga_0_RS232_Uart_sin
>  PORT sout = fpga_0_RS232_Uart_sout
>  PORT IP2INTC_Irpt = RS232_Uart_IP2INTC_Irpt
> END
> 
> BEGIN xps_gpio
>  PARAMETER INSTANCE = LEDs_4Bit
>  PARAMETER HW_VER = 1.00.a
>  PARAMETER C_INTERRUPT_PRESENT = 1
>  PARAMETER C_GPIO_WIDTH = 4
>  PARAMETER C_IS_DUAL = 0
>  PARAMETER C_IS_BIDIR = 1
>  PARAMETER C_ALL_INPUTS = 0
>  PARAMETER C_BASEADDR = 0x81400000
>  PARAMETER C_HIGHADDR = 0x8140ffff
>  BUS_INTERFACE SPLB = plb
>  PORT GPIO_IO = fpga_0_LEDs_4Bit_GPIO_IO
>  PORT IP2INTC_Irpt = LEDs_4Bit_IP2INTC_Irpt
> END
> 
> BEGIN xps_iic
>  PARAMETER INSTANCE = IIC_EEPROM
>  PARAMETER HW_VER = 2.00.a
>  PARAMETER C_CLK_FREQ = 100000000
>  PARAMETER C_IIC_FREQ = 100000
>  PARAMETER C_TEN_BIT_ADR = 0
>  PARAMETER C_BASEADDR = 0x81600000
>  PARAMETER C_HIGHADDR = 0x8160ffff
>  BUS_INTERFACE SPLB = plb
>  PORT Scl = fpga_0_IIC_EEPROM_Scl
>  PORT Sda = fpga_0_IIC_EEPROM_Sda
>  PORT IIC2INTC_Irpt = IIC_EEPROM_IIC2INTC_Irpt
> END
> 
> BEGIN xps_sysace
>  PARAMETER INSTANCE = SysACE_CompactFlash
>  PARAMETER HW_VER = 1.00.a
>  PARAMETER C_MEM_WIDTH = 16
>  PARAMETER C_BASEADDR = 0x83600000
>  PARAMETER C_HIGHADDR = 0x8360ffff
>  BUS_INTERFACE SPLB = plb
>  PORT SysACE_CLK = fpga_0_SysACE_CompactFlash_SysACE_CLK
>  PORT SysACE_MPA = fpga_0_SysACE_CompactFlash_SysACE_MPA_split
>  PORT SysACE_MPD = fpga_0_SysACE_CompactFlash_SysACE_MPD
>  PORT SysACE_CEN = fpga_0_SysACE_CompactFlash_SysACE_CEN
>  PORT SysACE_OEN = fpga_0_SysACE_CompactFlash_SysACE_OEN
>  PORT SysACE_WEN = fpga_0_SysACE_CompactFlash_SysACE_WEN
>  PORT SysACE_MPIRQ = fpga_0_SysACE_CompactFlash_SysACE_MPIRQ
>  PORT SysACE_IRQ = SysACE_CompactFlash_SysACE_IRQ
> END
> 
> BEGIN mpmc
>  PARAMETER INSTANCE = DDR_SDRAM
>  PARAMETER HW_VER = 4.00.a
>  PARAMETER C_NUM_PORTS = 3
>  PARAMETER C_MEM_PARTNO = HYB25D512160BE-5
>  PARAMETER C_MEM_DATA_WIDTH = 32
>  PARAMETER C_MEM_DQS_WIDTH = 4
>  PARAMETER C_MEM_DM_WIDTH = 4
>  PARAMETER C_MEM_TYPE = DDR
>  PARAMETER C_NUM_IDELAYCTRL = 2
>  PARAMETER C_IDELAYCTRL_LOC = IDELAYCTRL_X0Y3-IDELAYCTRL_X0Y2
>  PARAMETER C_PIM0_BASETYPE = 2
>  PARAMETER C_PIM1_BASETYPE = 2
>  PARAMETER C_PIM2_BASETYPE = 3
>  PARAMETER C_MPMC_CLK0_PERIOD_PS = 10000
>  PARAMETER C_SDMA2_PI2LL_CLK_RATIO = 1
>  PARAMETER C_MPMC_BASEADDR = 0x00000000
>  PARAMETER C_MPMC_HIGHADDR = 0x07ffffff
>  PARAMETER C_SDMA_CTRL_BASEADDR = 0x84600000
>  PARAMETER C_SDMA_CTRL_HIGHADDR = 0x8460ffff
>  BUS_INTERFACE SPLB0 = ppc405_0_iplb1
>  BUS_INTERFACE SPLB1 = ppc405_0_dplb1
>  BUS_INTERFACE SDMA_LL2 = TriMode_MAC_GMII_LLINK0
>  BUS_INTERFACE SDMA_CTRL2 = plb
>  PORT DDR_Addr = fpga_0_DDR_SDRAM_DDR_Addr
>  PORT DDR_BankAddr = fpga_0_DDR_SDRAM_DDR_BankAddr
>  PORT DDR_CAS_n = fpga_0_DDR_SDRAM_DDR_CAS_n
>  PORT DDR_CE = fpga_0_DDR_SDRAM_DDR_CE
>  PORT DDR_CS_n = fpga_0_DDR_SDRAM_DDR_CS_n
>  PORT DDR_RAS_n = fpga_0_DDR_SDRAM_DDR_RAS_n
>  PORT DDR_WE_n = fpga_0_DDR_SDRAM_DDR_WE_n
>  PORT DDR_DM = fpga_0_DDR_SDRAM_DDR_DM
>  PORT DDR_DQS = fpga_0_DDR_SDRAM_DDR_DQS
>  PORT DDR_DQ = fpga_0_DDR_SDRAM_DDR_DQ
>  PORT DDR_Clk = fpga_0_DDR_SDRAM_DDR_Clk
>  PORT DDR_Clk_n = fpga_0_DDR_SDRAM_DDR_Clk_n
>  PORT MPMC_Clk0 = sys_clk_s
>  PORT MPMC_Clk90 = DDR_SDRAM_mpmc_clk_90_s
>  PORT SDMA2_Clk = sys_clk_s
>  PORT MPMC_Clk_200MHz = clk_200mhz_s
>  PORT MPMC_Rst = sys_periph_reset
>  PORT SDMA2_Rx_IntOut = DDR_SDRAM_SDMA2_Rx_IntOut
>  PORT SDMA2_Tx_IntOut = DDR_SDRAM_SDMA2_Tx_IntOut
> END
> 
> BEGIN xps_ll_temac
>  PARAMETER INSTANCE = TriMode_MAC_GMII
>  PARAMETER HW_VER = 1.01.a
>  PARAMETER C_SPLB_CLK_PERIOD_PS = 10000
>  PARAMETER C_PHY_TYPE = 1
>  PARAMETER C_NUM_IDELAYCTRL = 4
>  PARAMETER C_IDELAYCTRL_LOC = IDELAYCTRL_X1Y1-IDELAYCTRL_X1Y3-IDELAYCTRL_X2Y2-IDELAYCTRL_X2Y3
>  PARAMETER C_TEMAC_TYPE = 1
>  PARAMETER C_BUS2CORE_CLK_RATIO = 1
>  PARAMETER C_BASEADDR = 0x81c00000
>  PARAMETER C_HIGHADDR = 0x81c0ffff
>  BUS_INTERFACE SPLB = plb
>  BUS_INTERFACE LLINK0 = TriMode_MAC_GMII_LLINK0
>  PORT GMII_TXD_0 = fpga_0_TriMode_MAC_GMII_GMII_TXD_0
>  PORT GMII_TX_EN_0 = fpga_0_TriMode_MAC_GMII_GMII_TX_EN_0
>  PORT GMII_TX_ER_0 = fpga_0_TriMode_MAC_GMII_GMII_TX_ER_0
>  PORT GMII_TX_CLK_0 = fpga_0_TriMode_MAC_GMII_GMII_TX_CLK_0
>  PORT GMII_RXD_0 = fpga_0_TriMode_MAC_GMII_GMII_RXD_0
>  PORT GMII_RX_DV_0 = fpga_0_TriMode_MAC_GMII_GMII_RX_DV_0
>  PORT GMII_RX_ER_0 = fpga_0_TriMode_MAC_GMII_GMII_RX_ER_0
>  PORT GMII_RX_CLK_0 = fpga_0_TriMode_MAC_GMII_GMII_RX_CLK_0
>  PORT MII_TX_CLK_0 = fpga_0_TriMode_MAC_GMII_MII_TX_CLK_0
>  PORT MDIO_0 = fpga_0_TriMode_MAC_GMII_MDIO_0
>  PORT MDC_0 = fpga_0_TriMode_MAC_GMII_MDC_0
>  PORT TemacPhy_RST_n = fpga_0_TriMode_MAC_GMII_TemacPhy_RST_n
>  PORT GTX_CLK_0 = temac_clk_s
>  PORT REFCLK = clk_200mhz_s
>  PORT LlinkTemac0_CLK = sys_clk_s
>  PORT TemacIntc0_Irpt = TriMode_MAC_GMII_TemacIntc0_Irpt
> END
> 
> BEGIN util_bus_split
>  PARAMETER INSTANCE = SysACE_CompactFlash_util_bus_split_0
>  PARAMETER HW_VER = 1.00.a
>  PARAMETER C_SIZE_IN = 7
>  PARAMETER C_LEFT_POS = 0
>  PARAMETER C_SPLIT = 6
>  PORT Sig = fpga_0_SysACE_CompactFlash_SysACE_MPA_split
>  PORT Out1 = fpga_0_SysACE_CompactFlash_SysACE_MPA
> END
> 
> BEGIN plb_v46
>  PARAMETER INSTANCE = ppc405_0_iplb1
>  PARAMETER HW_VER = 1.02.a
>  PORT PLB_Clk = sys_clk_s
>  PORT SYS_Rst = sys_bus_reset
> END
> 
> BEGIN plb_v46
>  PARAMETER INSTANCE = ppc405_0_dplb1
>  PARAMETER HW_VER = 1.02.a
>  PORT PLB_Clk = sys_clk_s
>  PORT SYS_Rst = sys_bus_reset
> END
> 
> BEGIN clock_generator
>  PARAMETER INSTANCE = clock_generator_0
>  PARAMETER HW_VER = 2.00.a
>  PARAMETER C_EXT_RESET_HIGH = 1
>  PARAMETER C_CLKIN_FREQ = 100000000
>  PARAMETER C_CLKOUT0_FREQ = 100000000
>  PARAMETER C_CLKOUT0_BUF = TRUE
>  PARAMETER C_CLKOUT0_PHASE = 0
>  PARAMETER C_CLKOUT0_GROUP = DCM0
>  PARAMETER C_CLKOUT1_FREQ = 100000000
>  PARAMETER C_CLKOUT1_BUF = TRUE
>  PARAMETER C_CLKOUT1_PHASE = 90
>  PARAMETER C_CLKOUT1_GROUP = DCM0
>  PARAMETER C_CLKOUT2_FREQ = 300000000
>  PARAMETER C_CLKOUT2_BUF = TRUE
>  PARAMETER C_CLKOUT2_PHASE = 0
>  PARAMETER C_CLKOUT2_GROUP = DCM0
>  PARAMETER C_CLKOUT3_FREQ = 200000000
>  PARAMETER C_CLKOUT3_BUF = TRUE
>  PARAMETER C_CLKOUT3_PHASE = 0
>  PARAMETER C_CLKOUT3_GROUP = NONE
>  PARAMETER C_CLKOUT4_FREQ = 125000000
>  PARAMETER C_CLKOUT4_BUF = TRUE
>  PARAMETER C_CLKOUT4_PHASE = 0
>  PARAMETER C_CLKOUT4_GROUP = NONE
>  PORT CLKOUT0 = sys_clk_s
>  PORT CLKOUT1 = DDR_SDRAM_mpmc_clk_90_s
>  PORT CLKOUT2 = proc_clk_s
>  PORT CLKOUT3 = clk_200mhz_s
>  PORT CLKOUT4 = temac_clk_s
>  PORT CLKIN = dcm_clk_s
>  PORT LOCKED = Dcm_all_locked
>  PORT RST = net_gnd
> END
> 
> BEGIN proc_sys_reset
>  PARAMETER INSTANCE = proc_sys_reset_0
>  PARAMETER HW_VER = 2.00.a
>  PARAMETER C_EXT_RESET_HIGH = 0
>  BUS_INTERFACE RESETPPC0 = ppc_reset_bus
>  PORT Slowest_sync_clk = sys_clk_s
>  PORT Dcm_locked = Dcm_all_locked
>  PORT Ext_Reset_In = sys_rst_s
>  PORT Bus_Struct_Reset = sys_bus_reset
>  PORT Peripheral_Reset = sys_periph_reset
> END
> 
> BEGIN xps_intc
>  PARAMETER INSTANCE = xps_intc_0
>  PARAMETER HW_VER = 1.00.a
>  PARAMETER C_BASEADDR = 0x81800000
>  PARAMETER C_HIGHADDR = 0x8180ffff
>  BUS_INTERFACE SPLB = plb
>  PORT Irq = EICC405EXTINPUTIRQ
>  PORT Intr = RS232_Uart_IP2INTC_Irpt & LEDs_4Bit_IP2INTC_Irpt & IIC_EEPROM_IIC2INTC_Irpt & SysACE_CompactFlash_SysACE_IRQ & TriMode_MAC_GMII_TemacIntc0_Irpt & DDR_SDRAM_SDMA2_Rx_IntOut & DDR_SDRAM_SDMA2_Tx_IntOut
> END
> 
> 
> 
> 	#address-cells = <1>;
> 	#size-cells = <1>;
> 	compatible = "xlnx,virtex";
> 	model = "testing";
> 	DDR_SDRAM: memory@0 {
> 		device_type = "memory";
> 		reg = < 0 8000000 >;
> 	} ;
> 	chosen {
> 		bootargs = "console=ttyS0,9600 ip=on nfsroot=172.16.40.76:/v2pclients/jhl26,tcp"; 
> 		linux,stdout-path = "/plb@0/serial@83e00000";
> 	} ;
> 	cpus {
> 		#address-cells = <1>;
> 		#cpus = <1>;
> 		#size-cells = <0>;
> 		ppc405_0: cpu@0 {
> 			clock-frequency = <11e1a300>;
> 			compatible = "PowerPC,405", "ibm,ppc405";
> 			d-cache-line-size = <20>;
> 			d-cache-size = <4000>;
> 			device_type = "cpu";
> 			i-cache-line-size = <20>;
> 			i-cache-size = <4000>;
> 			model = "PowerPC,405";
> 			reg = <0>;
> 			timebase-frequency = <11e1a300>;
> 			xlnx,apu-control = <de00>;
> 			xlnx,apu-udi-1 = <a18983>;
> 			xlnx,apu-udi-2 = <a38983>;
> 			xlnx,apu-udi-3 = <a589c3>;
> 			xlnx,apu-udi-4 = <a789c3>;
> 			xlnx,apu-udi-5 = <a98c03>;
> 			xlnx,apu-udi-6 = <ab8c03>;
> 			xlnx,apu-udi-7 = <ad8c43>;
> 			xlnx,apu-udi-8 = <af8c43>;
> 			xlnx,deterministic-mult = <0>;
> 			xlnx,disable-operand-forwarding = <1>;
> 			xlnx,fastest-plb-clock = "DPLB0";
> 			xlnx,generate-plb-timespecs = <1>;
> 			xlnx,mmu-enable = <1>;
> 			xlnx,pvr-high = <0>;
> 			xlnx,pvr-low = <0>;
> 		} ;
> 	} ;
> 	plb: plb@0 {
> 		#address-cells = <1>;
> 		#size-cells = <1>;
> 		compatible = "xlnx,plb-v46-1.02.a";
> 		ranges ;
> 		IIC_EEPROM: i2c@81600000 {
> 			compatible = "xlnx,xps-iic-2.00.a";
> 			interrupt-parent = <&xps_intc_0>;
> 			interrupts = < 4 2 >;
> 			reg = < 81600000 10000 >;
> 			xlnx,clk-freq = <5f5e100>;
> 			xlnx,family = "virtex4";
> 			xlnx,gpo-width = <1>;
> 			xlnx,iic-freq = <186a0>;
> 			xlnx,scl-inertial-delay = <0>;
> 			xlnx,sda-inertial-delay = <0>;
> 			xlnx,ten-bit-adr = <0>;
> 		} ;
> 		LEDs_4Bit: gpio@81400000 {
> 			compatible = "xlnx,xps-gpio-1.00.a";
> 			interrupt-parent = <&xps_intc_0>;
> 			interrupts = < 5 2 >;
> 			reg = < 81400000 10000 >;
> 			xlnx,all-inputs = <0>;
> 			xlnx,all-inputs-2 = <0>;
> 			xlnx,dout-default = <0>;
> 			xlnx,dout-default-2 = <0>;
> 			xlnx,family = "virtex4";
> 			xlnx,gpio-width = <4>;
> 			xlnx,interrupt-present = <1>;
> 			xlnx,is-bidir = <1>;
> 			xlnx,is-bidir-2 = <1>;
> 			xlnx,is-dual = <0>;
> 			xlnx,tri-default = <ffffffff>;
> 			xlnx,tri-default-2 = <ffffffff>;
> 		} ;
> 		RS232_Uart: serial@83e00000 {
> 			compatible = "xlnx,xps-uart16550-2.00.a";
> //			compatible = "ns16550"; 
> 			device_type = "serial";
> 			interrupt-parent = <&xps_intc_0>; 
> 			interrupts = < 6 2 >; 
> 			reg = < 83e00000 10000 >;
> 			current-speed = <d#9600>;
> 			clock-frequency = <d#100000000>;  /* added by jhl */
> 			reg-shift = <2>;
> 			xlnx,family = "virtex4";
> 			xlnx,has-external-rclk = <0>;
> 			xlnx,has-external-xin = <0>;
> 			xlnx,is-a-16550 = <1>;
> 		} ;
> 		SysACE_CompactFlash: sysace@83600000 {
> 			compatible = "xlnx,xps-sysace-1.00.a";
> 			interrupt-parent = <&xps_intc_0>;
> 			interrupts = < 3 2 >;
> 			reg = < 83600000 10000 >;
> 			xlnx,family = "virtex4";
> 			xlnx,mem-width = <10>;
> 		} ;
> 		TriMode_MAC_GMII: xps-ll-temac@81c00000 {
> 			#address-cells = <1>;
> 			#size-cells = <1>;
> 			compatible = "xlnx,compound";
> 			ethernet@81c00000 {
> 				compatible = "xlnx,xps-ll-temac-1.01.a";
> 				device_type = "network";
> 				interrupt-parent = <&xps_intc_0>;
> 				interrupts = < 2 2 >;
> 				llink-connected = <&PIM2>;
> 				local-mac-address = [ 02 00 00 00 00 01 ];
> 				reg = < 81c00000 40 >;
> 				xlnx,bus2core-clk-ratio = <1>;
> 				xlnx,phy-type = <1>;
> 				xlnx,phyaddr = <1>;
> 				xlnx,rxcsum = <0>;
> 				xlnx,rxfifo = <1000>;
> 				xlnx,temac-type = <1>;
> 				xlnx,txcsum = <0>;
> 				xlnx,txfifo = <1000>;
> 			} ;
> 		} ;
> 		mpmc@0 {
> 			#address-cells = <1>;
> 			#size-cells = <1>;
> 			compatible = "xlnx,mpmc-4.00.a";
> 			PIM2: sdma@84600100 {
> 				compatible = "xlnx,ll-dma-1.00.a";
> 				interrupt-parent = <&xps_intc_0>;
> 				interrupts = < 1 2 0 2 >;
> 				reg = < 84600100 80 >;
> 			} ;
> 		} ;
> 		xps_bram_if_cntlr_1: xps-bram-if-cntlr@ffffe000 {
> 			compatible = "xlnx,xps-bram-if-cntlr-1.00.a";
> 			reg = < ffffe000 2000 >;
> 			xlnx,family = "virtex4";
> 		} ;
> 		xps_intc_0: interrupt-controller@81800000 {
> 			#interrupt-cells = <2>;
> 			compatible = "xlnx,xps-intc-1.00.a";
> 			interrupt-controller ;
> 			reg = < 81800000 10000 >;
> 			xlnx,num-intr-inputs = <7>;
> 		} ;
> 	} ;
> 	ppc405_0_dplb1: plb@1 {
> 		#address-cells = <1>;
> 		#size-cells = <1>;
> 		compatible = "xlnx,plb-v46-1.02.a";
> 		ranges ;
> 	} ;
> }  ;
> 
> 
> 
> -----Original Message-----
> From: Magnus Hjorth [mailto:mh@omnisys.se] 
> Sent: Saturday, March 29, 2008 6:54 AM
> To: git
> Cc: linuxppc-embedded@ozlabs.org
> Subject: Xilinx LLTEMAC driver issues
> 
> Hi,
> 
> I'm having some networking troubles with the Xilinx LLTEMAC driver from the
> Xilinx Linux git tree (powerpc arch) on an ML403 board. EDK9.2SP2,
> xps_ll_temac v1.00.b 
> 
> The weird thing is, that it sort of half works. It successfully makes a DHCP
> request and gets its IP address. I tried setting up a tftpd server, and I can
> see UDP requests coming in but the response doesn't seem to come out. I also
> tried running a TCP server on the board, and it can see and accept incoming
> connections but after that no data seems to get through. I can ping out and
> get around 40% packet loss.
> 
> Looking at /proc/interrupts, I can see both TxDma interrupts and RxDma
> interrupts. No eth0 interrupts but that seems to be OK judging by the driver
> source comments. Ifconfig shows no collistions, no dropped packets, no errors,
> so the system seems to think that everything is OK. 
> 
> Clues anyone? I'm starting to run out of ideas...
> 
> Best regards,
> Magnus
> 
> 
> --
> 
> Magnus Hjorth, M.Sc.
> Omnisys Instruments AB
> Gruvgatan 8
> SE-421 30  Västra Frölunda, SWEDEN
> Phone: +46 31 734 34 09
> Fax: +46 31 734 34 29
> http://www.omnisys.se




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

^ permalink raw reply

* Re: U-boot + Linux 2.6 + Avnet FX12 MM (based on ML403 config)
From: Mirek23 @ 2008-03-30 17:21 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <10201070.post@talk.nabble.com>


Hi Guillaume,

I was facing the same problem with my Avent (virtex 4 FX12) evaluation
board. Originally I have built successfully u-boot 1.2.0  and linux 2.6.21
but I was not able to boot kernel 2.6.21 from u-boot 1.2.0. Kernel 2.6.22
(uImage) onwards can be booted with u-boot 1.2 and higher. Currently I use
u-boot 1.2.0 and kernel 2.6.23 without any problems. My recommendation is to
use at least the kernel version 2.6.22 otherwise you will have kernel panic
problem.

Best Regards

Mirek


Guillaume Berthelom wrote:
> 
> Hi,
> 
> I'm trying to port Linux 2.6 on Avnet FX12 MM board with U-Boot and the
> help of xilinx ML403 config.
> 
> I have generate my costum xparameters.h file with EDK 8.2i.
> I use ELDK 4.1 and Linux 2.6.20.x.
> I have modified ml403.h u-boot's config file to adapt it for my board and
> I have no problem to boot u-boot.
> I use the right board_info structure from <asm/ppcboot.h> and not the one
> in xilinx_ml403.h.
> 
> When I load the zImage directly with xilinx xmd debugger, the kernel start
> without problem (if I don't have KGDB or SERIAL_TEXT_DEBUG option in my
> kernel config). But when I try to load the uImage with u-boot, the kernel
> start but crach befor I can see something on output.
> 
> The kernel start because I debug it and the platform_init is ok,
> setup_arch too and it crach after ppc4xx_setup_arch at  printk(KERN_INFO
> "Xilinx ML403 Reference System (Virtex-4 FX)\n") line  when the kernel
> access in printk.c.
> 
> I suppose the serial init have problem but I have no idea what is the
> cause of the problem. I use the opb_uart16550 IP in my Xilinx design and
> the associat drivers in u-boot and linux.
> 
> Thanks,
> Guillaume Berthelom
> 
> 

-- 
View this message in context: http://www.nabble.com/U-boot-%2B-Linux-2.6-%2B-Avnet-FX12-MM-%28based-on-ML403-config%29-tp10201070p16384525.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: [PATCH 3/5] leds: implement OpenFirmare GPIO LEDs driver
From: Segher Boessenkool @ 2008-03-30 18:08 UTC (permalink / raw)
  To: avorontsov; +Cc: linuxppc-dev, Richard Purdie
In-Reply-To: <20080327171045.GA3266@localhost.localdomain>

> Here is updated patch with new linux,brightness OF property (needed for
> MPC8349E-mITX board -- pwr led should be "on" by default).
>
> p.s. I tend to do documentation as a separate patch: I don't want this
> patch to depend on the booting-without-of.txt -- it may produce
> conflicts easily.

We need to see that documentation first though: it is not documenting
this code, it is defining the device binding!  Without it, we can
only guess whether this code is correct or not.  Also, it is important
to decide on a binding before accepting this code.

If patches to booting-without-of.txt conflict often, we should split
it into a directory of files.


Segher

^ permalink raw reply

* Re: OF compatible MTD platform RAM driver ?
From: Segher Boessenkool @ 2008-03-30 18:12 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: ben, linuxppc-dev, linux-mtd, David Gibson
In-Reply-To: <47EA6E88.5050109@ru.mvista.com>

>> "memory-mapped-memory" perhaps :-)
>
>> Or, just "memory".  Although that one might play havoc with some
>
>    I'd suggest "ram" and "rom" then. Luckily the device trees don't 
> contain binding for the real RAM chips yet. :-)
>
>> not-quite-correct main memory probing code.
>
>    You mean the there's parsers that search the "compatible" prop for 
> "memory" as well as "device_type" prop?

There are parsers that make all kinds of mistakes, sure.

The code that figures out what region of ram to use should look at the
node pointed to by /chosen/memory, it's shouldn't look for anything
with a certain "compatible", and it shouldn't look at "device_type"
_at all_.


Segher

^ permalink raw reply

* Re: OF compatible MTD platform RAM driver ?
From: Segher Boessenkool @ 2008-03-30 18:15 UTC (permalink / raw)
  To: David Gibson; +Cc: ben, linuxppc-dev, linux-mtd
In-Reply-To: <20080327100304.GC10397@localhost.localdomain>

>> Could we agree on a name ? I'd like to submit a new patch.
>
> For ROMs I think just plain "rom" should be sufficient.

Yes.

> For RAMs we
> need something to indicate that it's memory but intended for secondary
> storage, not as main memory.

How it is intended to be used is not a property of the hardware, so
that information doesn't belong in the device tree at all.  The Linux
platform code should handle this, I imagine.


Segher

^ permalink raw reply

* Re: [PATCH 4/9] [POWERPC] mv64x60: Fix FDT compatible names: mv64x60 => mv64360
From: Segher Boessenkool @ 2008-03-30 19:20 UTC (permalink / raw)
  To: Olof Johansson; +Cc: paulus, linuxppc-dev
In-Reply-To: <20080329215753.GA27226@lixom.net>

>> Compatible names should refer to a specific version of the hardware,
>> without wildcards.  Change each instance of mv64x60 to mv64360, which
>> is the oldest version we currently support.
>
> Actually, it's normal to have more than one compatible field, from
> specific to generic. So it should make sense to have both (with the
> 64360 entry first).

The normal use is to have the exact device first, and older devices
that the device is compatible to after that.

There is no such thing as a "generic" device, in general.  It's a
mistake to define generic "compatible" values [*], that's like
trying to predict the future -- how can you guarantee that all
future devices in a device family will be compatible?


Segher


[*] In certain cases, like usb-ohci, there _is_ a defined interface
for all future devices.  Also, "legacy" devices have a de facto such
interface.

^ permalink raw reply

* Re: OF compatible MTD platform RAM driver ?
From: Paul Mackerras @ 2008-03-30 21:16 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: ben, linuxppc-dev, linux-mtd, David Gibson
In-Reply-To: <7c44646510c3b98075de9aa57cad0bce@kernel.crashing.org>

Segher Boessenkool writes:

> > For RAMs we
> > need something to indicate that it's memory but intended for secondary
> > storage, not as main memory.
> 
> How it is intended to be used is not a property of the hardware, so
> that information doesn't belong in the device tree at all.  The Linux
> platform code should handle this, I imagine.

There must be some reason why it is not intended to be used as main
memory.  Presumably it has something different about it compared to
"normal" RAM, and that difference could perfectly well be expressed in
the device tree.

Paul.

^ permalink raw reply

* mmu_hash_lock deadlock causes kernel stuck at 2.6.21 SMP powerpc 32bit
From: Gaash Hazan @ 2008-03-30 21:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: gaash-ppclnx, Gilad Ben-Yossef

(reposting)

Hello PPC SMP MM experts,

mmu_hash_lock (arch/powerpc/mm/hash_low_32.S) is a
(non-standard) spin lock that protects the CPU MMU
hashing table. It exists and used only with SMP
configurations.

In some scenarios, the spin lock is taken when
interrupts are *enabled* causing kernel deadlock at
the next take attempt in the same CPU.

The deadlock happened on 2.6.21 kernel, Powerpc 32 bit
with SMP enabled. At this moment system had one active
CPU. The sequence I saw was:

do_exit (program termination)
exit_mm
mmput
exit_mmap
free_pgtables
free_pgd_range
unmap_vmas
pte_free
hash_page_sync (takes mmu_hash_lock. Note: interrupts
are enabled)

timer_interrupt (timer interrupts occurs during
hash_page_sync, lock is taken) irq_exit do_softirq
__do_softirq net_rx_action (packet received from
network) ( ... omitted ... ) xdr_skb_read_bits
skb_copy_bits memcpy - memcpy causes DSI
exception(0x300). This is OK. 
DSI exception handler calls hash_page
hash_page waits for mmu_mash_lock. It waits forever
since the lock is already taken. 
Deadlock! with interrupts disabled. kernel is dead.

I think the rout cause of the problem is
hash_page_sync() taking the mmu_hash_lock spin lock
without disabling interrupts. This leads to the
deadlock.

To verify the theory, hash_page_sync() was wrapped
with interrupts disabled code and problem never
occurred again. Of course this is temporary workaround
as there are several places needed to be fixed.

What do you think?

Thanks,

Gaash

^ permalink raw reply

* Re: mmu_hash_lock deadlock causes kernel stuck at 2.6.21 SMP powerpc 32bit
From: Benjamin Herrenschmidt @ 2008-03-30 21:40 UTC (permalink / raw)
  To: gaash-ppclnx; +Cc: linuxppc-dev, Gilad Ben-Yossef
In-Reply-To: <90380.16819.qm@web39603.mail.mud.yahoo.com>


On Sun, 2008-03-30 at 14:28 -0700, Gaash Hazan wrote:
> To verify the theory, hash_page_sync() was wrapped
> with interrupts disabled code and problem never
> occurred again. Of course this is temporary workaround
> as there are several places needed to be fixed.

It is definitely a bug in hash_page_sync() which should
clear MSR:EE while holding the lock.

I'll do a patch.

Thanks for finding that out !

Cheers,
Ben.

^ permalink raw reply

* [PATCH] powerpc: Fix deadlock with mmu_hash_lock in hash_page_sync
From: Benjamin Herrenschmidt @ 2008-03-30 21:49 UTC (permalink / raw)
  To: gaash-ppclnx; +Cc: linuxppc-dev, Paul Mackerras, Gilad Ben-Yossef
In-Reply-To: <90380.16819.qm@web39603.mail.mud.yahoo.com>

hash_page_sync() takes and releases the low level mmu hash
lock in order to sync with other processors disposing of page
tables. Because that lock can be needed to service hash misses
triggered by interrupt handler, taking it must be done with
interrupts off. However, hash_page_sync() appear to be called
with interrupts enabled, thus causing occasional deadlocks.

We fix it by making sure hash_page_sync() masks interrupts while
holding the lock.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

Please test and report asap thought it's probably too late for
2.6.25, it can still go into stable later on.

Index: linux-work/arch/powerpc/mm/hash_low_32.S
===================================================================
--- linux-work.orig/arch/powerpc/mm/hash_low_32.S	2008-03-31 08:42:56.000000000 +1100
+++ linux-work/arch/powerpc/mm/hash_low_32.S	2008-03-31 08:45:05.000000000 +1100
@@ -44,6 +44,9 @@ mmu_hash_lock:
 #ifdef CONFIG_SMP
 	.text
 _GLOBAL(hash_page_sync)
+	mfmsr   r10
+	rlwinm  r0,r10,0,17,15          /* clear bit 16 (MSR_EE) */
+	mtmsr   r0
 	lis	r8,mmu_hash_lock@h
 	ori	r8,r8,mmu_hash_lock@l
 	lis	r0,0x0fff
@@ -60,8 +63,9 @@ _GLOBAL(hash_page_sync)
 	eieio
 	li	r0,0
 	stw	r0,0(r8)
-	blr	
-#endif
+	mtmsr	r10
+	blr
+#endif /* CONFIG_SMP */
 
 /*
  * Load a PTE into the hash table, if possible.

^ permalink raw reply

* Re: [PATCH 1/5] [v2][POWERPC] refactor dcr code
From: Benjamin Herrenschmidt @ 2008-03-30 22:02 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev
In-Reply-To: <20080328162616.61AEF15006B@mail199-sin.bigfish.com>


On Fri, 2008-03-28 at 09:23 -0700, Stephen Neuendorffer wrote:
> Previously, dcr support was configured at compile time to either using
> MMIO or native dcr instructions.  Although this works for most
> platforms, it fails on FPGA platforms:
> 
> 1) Systems may include more than one dcr bus.
> 2) Systems may be native dcr capable and still use memory mapped dcr interface.
> 
> This patch provides runtime support based on the device trees for the
> case where CONFIG_PPC_DCR_MMIO and CONFIG_PPC_DCR_NATIVE are both
> selected.  Previously, this was a poorly defined configuration, which
> happened to provide NATIVE support.  The runtime selection is made
> based on the dcr slave device having a 'dcr-access-method' attribute
> in the device tree.  If only one of the above options is selected,
> then the code uses #defines to select only the used code in order to
> avoid interoducing overhead in existing usage.
> 
> Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>

Looks good. Haven't had a chance to test it yet, but tentatively

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Initially, I thought about using function pointers but the if/else will
probably end up being more efficient. The only thing maybe to ponder
is whether we could avoid the dcr-generic.h file completely, and have
the generic wrappers be inline, though considering how slow DCRs are,
it may not be that useful in practice and less clean...

Cheers,
Ben. 


> ---
>  arch/powerpc/sysdev/dcr.c         |   91 ++++++++++++++++++++++++++++++++-----
>  include/asm-powerpc/dcr-generic.h |   49 ++++++++++++++++++++
>  include/asm-powerpc/dcr-mmio.h    |   20 +++++---
>  include/asm-powerpc/dcr-native.h  |   16 ++++---
>  include/asm-powerpc/dcr.h         |   36 ++++++++++++++-
>  5 files changed, 186 insertions(+), 26 deletions(-)
>  create mode 100644 include/asm-powerpc/dcr-generic.h
> 
> diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
> index 437e48d..d3de0ff 100644
> --- a/arch/powerpc/sysdev/dcr.c
> +++ b/arch/powerpc/sysdev/dcr.c
> @@ -23,6 +23,68 @@
>  #include <asm/prom.h>
>  #include <asm/dcr.h>
>  
> +#if defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO)
> +
> +bool dcr_map_ok_generic(dcr_host_t host)
> +{
> +	if (host.type == INVALID)
> +		return 0;
> +	else if (host.type == NATIVE)
> +		return dcr_map_ok_native(host.host.native);
> +	else
> +		return dcr_map_ok_mmio(host.host.mmio);
> +}
> +EXPORT_SYMBOL_GPL(dcr_map_ok_generic);
> +
> +dcr_host_t dcr_map_generic(struct device_node *dev,
> +			   unsigned int dcr_n,
> +			   unsigned int dcr_c)
> +{
> +	dcr_host_t host;
> +	const char *prop = of_get_property(dev, "dcr-access-method", NULL);
> +
> +	if (!strcmp(prop, "native")) {
> +		host.type = NATIVE;
> +		host.host.native = dcr_map_native(dev, dcr_n, dcr_c);
> +	} else if (!strcmp(prop, "mmio")) {
> +		host.type = MMIO;
> +		host.host.mmio = dcr_map_mmio(dev, dcr_n, dcr_c);
> +	} else
> +		host.type = INVALID;
> +
> +	return host;
> +}
> +EXPORT_SYMBOL_GPL(dcr_map_generic);
> +
> +void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c)
> +{
> +	if (host.type == NATIVE)
> +		dcr_unmap_native(host.host.native, dcr_c);
> +	else
> +		dcr_unmap_mmio(host.host.mmio, dcr_c);
> +}
> +EXPORT_SYMBOL_GPL(dcr_unmap_generic);
> +
> +u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n)
> +{
> +	if (host.type == NATIVE)
> +		return dcr_read_native(host.host.native, dcr_n);
> +	else
> +		return dcr_read_mmio(host.host.mmio, dcr_n);
> +}
> +EXPORT_SYMBOL_GPL(dcr_read_generic);
> +
> +void dcr_write_generic(dcr_host_t host, unsigned int dcr_n, u32 value)
> +{
> +	if (host.type == NATIVE)
> +		dcr_write_native(host.host.native, dcr_n, value);
> +	else
> +		dcr_write_mmio(host.host.mmio, dcr_n, value);
> +}
> +EXPORT_SYMBOL_GPL(dcr_write_generic);
> +
> +#endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */
> +
>  unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
>  {
>  	unsigned int ds;
> @@ -47,7 +109,7 @@ unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
>  }
>  EXPORT_SYMBOL_GPL(dcr_resource_len);
>  
> -#ifndef CONFIG_PPC_DCR_NATIVE
> +#ifdef CONFIG_PPC_DCR_MMIO
>  
>  static struct device_node * find_dcr_parent(struct device_node * node)
>  {
> @@ -101,18 +163,19 @@ u64 of_translate_dcr_address(struct device_node *dev,
>  	return ret;
>  }
>  
> -dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
> -		   unsigned int dcr_c)
> +dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
> +			     unsigned int dcr_n,
> +			     unsigned int dcr_c)
>  {
> -	dcr_host_t ret = { .token = NULL, .stride = 0, .base = dcr_n };
> +	dcr_host_mmio_t ret = { .token = NULL, .stride = 0, .base = dcr_n };
>  	u64 addr;
>  
>  	pr_debug("dcr_map(%s, 0x%x, 0x%x)\n",
>  		 dev->full_name, dcr_n, dcr_c);
>  
>  	addr = of_translate_dcr_address(dev, dcr_n, &ret.stride);
> -	pr_debug("translates to addr: 0x%lx, stride: 0x%x\n",
> -		 addr, ret.stride);
> +	pr_debug("translates to addr: 0x%llx, stride: 0x%x\n",
> +		 (unsigned long long) addr, ret.stride);
>  	if (addr == OF_BAD_ADDR)
>  		return ret;
>  	pr_debug("mapping 0x%x bytes\n", dcr_c * ret.stride);
> @@ -124,11 +187,11 @@ dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
>  	ret.token -= dcr_n * ret.stride;
>  	return ret;
>  }
> -EXPORT_SYMBOL_GPL(dcr_map);
> +EXPORT_SYMBOL_GPL(dcr_map_mmio);
>  
> -void dcr_unmap(dcr_host_t host, unsigned int dcr_c)
> +void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c)
>  {
> -	dcr_host_t h = host;
> +	dcr_host_mmio_t h = host;
>  
>  	if (h.token == NULL)
>  		return;
> @@ -136,7 +199,11 @@ void dcr_unmap(dcr_host_t host, unsigned int dcr_c)
>  	iounmap(h.token);
>  	h.token = NULL;
>  }
> -EXPORT_SYMBOL_GPL(dcr_unmap);
> -#else	/* defined(CONFIG_PPC_DCR_NATIVE) */
> +EXPORT_SYMBOL_GPL(dcr_unmap_mmio);
> +
> +#endif /* defined(CONFIG_PPC_DCR_MMIO) */
> +
> +#ifdef CONFIG_PPC_DCR_NATIVE
>  DEFINE_SPINLOCK(dcr_ind_lock);
> -#endif	/* !defined(CONFIG_PPC_DCR_NATIVE) */
> +#endif	/* defined(CONFIG_PPC_DCR_NATIVE) */
> +
> diff --git a/include/asm-powerpc/dcr-generic.h b/include/asm-powerpc/dcr-generic.h
> new file mode 100644
> index 0000000..0ee74fb
> --- /dev/null
> +++ b/include/asm-powerpc/dcr-generic.h
> @@ -0,0 +1,49 @@
> +/*
> + * (c) Copyright 2006 Benjamin Herrenschmidt, IBM Corp.
> + *                    <benh@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.
> + *
> + *   This program is distributed in the hope that it will be useful,
> + *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
> + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
> + *   the GNU General Public License for more details.
> + *
> + *   You should have received a copy of the GNU General Public License
> + *   along with this program;  if not, write to the Free Software
> + *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> + */
> +
> +#ifndef _ASM_POWERPC_DCR_GENERIC_H
> +#define _ASM_POWERPC_DCR_GENERIC_H
> +#ifdef __KERNEL__
> +#ifndef __ASSEMBLY__
> +
> +enum host_type_t {MMIO, NATIVE, INVALID};
> +
> +typedef struct {
> +	enum host_type_t type;
> +	union {
> +		dcr_host_mmio_t mmio;
> +		dcr_host_native_t native;
> +	} host;
> +} dcr_host_t;
> +
> +extern bool dcr_map_ok_generic(dcr_host_t host);
> +
> +extern dcr_host_t dcr_map_generic(struct device_node *dev, unsigned int dcr_n,
> +			  unsigned int dcr_c);
> +extern void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c);
> +
> +extern u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n);
> +
> +extern void dcr_write_generic(dcr_host_t host, unsigned int dcr_n, u32 value);
> +
> +#endif /* __ASSEMBLY__ */
> +#endif /* __KERNEL__ */
> +#endif /* _ASM_POWERPC_DCR_GENERIC_H */
> +
> +
> diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h
> index 08532ff..acd491d 100644
> --- a/include/asm-powerpc/dcr-mmio.h
> +++ b/include/asm-powerpc/dcr-mmio.h
> @@ -27,20 +27,26 @@ typedef struct {
>  	void __iomem *token;
>  	unsigned int stride;
>  	unsigned int base;
> -} dcr_host_t;
> +} dcr_host_mmio_t;
>  
> -#define DCR_MAP_OK(host)	((host).token != NULL)
> +static inline bool dcr_map_ok_mmio(dcr_host_mmio_t host)
> +{
> +	return host.token != NULL;
> +}
>  
> -extern dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
> -			  unsigned int dcr_c);
> -extern void dcr_unmap(dcr_host_t host, unsigned int dcr_c);
> +extern dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
> +				    unsigned int dcr_n,
> +				    unsigned int dcr_c);
> +extern void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c);
>  
> -static inline u32 dcr_read(dcr_host_t host, unsigned int dcr_n)
> +static inline u32 dcr_read_mmio(dcr_host_mmio_t host, unsigned int dcr_n)
>  {
>  	return in_be32(host.token + ((host.base + dcr_n) * host.stride));
>  }
>  
> -static inline void dcr_write(dcr_host_t host, unsigned int dcr_n, u32 value)
> +static inline void dcr_write_mmio(dcr_host_mmio_t host,
> +				  unsigned int dcr_n,
> +				  u32 value)
>  {
>  	out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
>  }
> diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
> index be6c879..67832e5 100644
> --- a/include/asm-powerpc/dcr-native.h
> +++ b/include/asm-powerpc/dcr-native.h
> @@ -26,14 +26,18 @@
>  
>  typedef struct {
>  	unsigned int base;
> -} dcr_host_t;
> +} dcr_host_native_t;
>  
> -#define DCR_MAP_OK(host)	(1)
> +static inline bool dcr_map_ok_native(dcr_host_native_t host)
> +{
> +	return 1;
> +}
>  
> -#define dcr_map(dev, dcr_n, dcr_c)	((dcr_host_t){ .base = (dcr_n) })
> -#define dcr_unmap(host, dcr_c)		do {} while (0)
> -#define dcr_read(host, dcr_n)		mfdcr(dcr_n + host.base)
> -#define dcr_write(host, dcr_n, value)	mtdcr(dcr_n + host.base, value)
> +#define dcr_map_native(dev, dcr_n, dcr_c) \
> +	((dcr_host_native_t){ .base = (dcr_n) })
> +#define dcr_unmap_native(host, dcr_c)		do {} while (0)
> +#define dcr_read_native(host, dcr_n)		mfdcr(dcr_n + host.base)
> +#define dcr_write_native(host, dcr_n, value)	mtdcr(dcr_n + host.base, value)
>  
>  /* Device Control Registers */
>  void __mtdcr(int reg, unsigned int val);
> diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h
> index 9338d50..6b86322 100644
> --- a/include/asm-powerpc/dcr.h
> +++ b/include/asm-powerpc/dcr.h
> @@ -20,14 +20,47 @@
>  #ifndef _ASM_POWERPC_DCR_H
>  #define _ASM_POWERPC_DCR_H
>  #ifdef __KERNEL__
> +#ifndef __ASSEMBLY__
>  #ifdef CONFIG_PPC_DCR
>  
>  #ifdef CONFIG_PPC_DCR_NATIVE
>  #include <asm/dcr-native.h>
> -#else
> +#endif
> +
> +#ifdef CONFIG_PPC_DCR_MMIO
>  #include <asm/dcr-mmio.h>
>  #endif
>  
> +#if defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO)
> +
> +#include <asm/dcr-generic.h>
> +
> +#define DCR_MAP_OK(host)	dcr_map_ok_generic(host)
> +#define dcr_map(dev, dcr_n, dcr_c) dcr_map_generic(dev, dcr_n, dcr_c)
> +#define dcr_unmap(host, dcr_c) dcr_unmap_generic(host, dcr_c)
> +#define dcr_read(host, dcr_n) dcr_read_generic(host, dcr_n)
> +#define dcr_write(host, dcr_n, value) dcr_write_generic(host, dcr_n, value)
> +
> +#else
> +
> +#ifdef CONFIG_PPC_DCR_NATIVE
> +typedef dcr_host_native_t dcr_host_t;
> +#define DCR_MAP_OK(host)	dcr_map_ok_native(host)
> +#define dcr_map(dev, dcr_n, dcr_c) dcr_map_native(dev, dcr_n, dcr_c)
> +#define dcr_unmap(host, dcr_c) dcr_unmap_native(host, dcr_c)
> +#define dcr_read(host, dcr_n) dcr_read_native(host, dcr_n)
> +#define dcr_write(host, dcr_n, value) dcr_write_native(host, dcr_n, value)
> +#else
> +typedef dcr_host_mmio_t dcr_host_t;
> +#define DCR_MAP_OK(host)	dcr_map_ok_mmio(host)
> +#define dcr_map(dev, dcr_n, dcr_c) dcr_map_mmio(dev, dcr_n, dcr_c)
> +#define dcr_unmap(host, dcr_c) dcr_unmap_mmio(host, dcr_c)
> +#define dcr_read(host, dcr_n) dcr_read_mmio(host, dcr_n)
> +#define dcr_write(host, dcr_n, value) dcr_write_mmio(host, dcr_n, value)
> +#endif
> +
> +#endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */
> +
>  /*
>   * On CONFIG_PPC_MERGE, we have additional helpers to read the DCR
>   * base from the device-tree
> @@ -41,5 +74,6 @@ extern unsigned int dcr_resource_len(struct device_node *np,
>  #endif /* CONFIG_PPC_MERGE */
>  
>  #endif /* CONFIG_PPC_DCR */
> +#endif /* __ASSEMBLY__ */
>  #endif /* __KERNEL__ */
>  #endif /* _ASM_POWERPC_DCR_H */

^ permalink raw reply

* Re: [PATCH 3/5] [POWERPC] explicit dcr support
From: Benjamin Herrenschmidt @ 2008-03-30 22:04 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev
In-Reply-To: <20080328162617.E9E3017A008F@mail170-dub.bigfish.com>


On Fri, 2008-03-28 at 09:23 -0700, Stephen Neuendorffer wrote:
> Added literal mapping support if no device-tree support.  Added
> CONFIG_OF to guard device-tree parts, since literal support works for
> arch=ppc.
> 
> Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>

I'll let others decide whether they want to do that addition
to arch/ppc (which is really what it is) or not ... I'd rather
not myself considering that arch/ppc is scheduled to go away
soon now.

Cheers,
Ben.

> ---
>  arch/powerpc/sysdev/dcr.c         |   82 ++++++++++++++++++++++++++++---------
>  include/asm-powerpc/dcr-generic.h |    2 +
>  include/asm-powerpc/dcr-mmio.h    |   11 +++++
>  include/asm-powerpc/dcr-native.h  |    8 ++++
>  include/asm-powerpc/dcr.h         |   24 +++++++++++
>  5 files changed, 108 insertions(+), 19 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
> index d3de0ff..2ccae80 100644
> --- a/arch/powerpc/sysdev/dcr.c
> +++ b/arch/powerpc/sysdev/dcr.c
> @@ -20,9 +20,34 @@
>  #undef DEBUG
>  
>  #include <linux/kernel.h>
> +#include <linux/module.h>
>  #include <asm/prom.h>
>  #include <asm/dcr.h>
>  
> +#ifdef CONFIG_OF
> +static struct device_node *find_dcr_parent(struct device_node *node)
> +{
> +	struct device_node *par, *tmp;
> +	const u32 *p;
> +
> +	for (par = of_node_get(node); par;) {
> +		if (of_get_property(par, "dcr-controller", NULL))
> +			break;
> +		p = of_get_property(par, "dcr-parent", NULL);
> +		tmp = par;
> +		if (p == NULL)
> +			par = of_get_parent(par);
> +		else
> +			par = of_find_node_by_phandle(*p);
> +		of_node_put(tmp);
> +	}
> +	return par;
> +}
> +#endif /* CONFIG_OF */
> +
> +
> +/* Indirection layer for providing both NATIVE and MMIO support. */
> +
>  #if defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO)
>  
>  bool dcr_map_ok_generic(dcr_host_t host)
> @@ -36,12 +61,24 @@ bool dcr_map_ok_generic(dcr_host_t host)
>  }
>  EXPORT_SYMBOL_GPL(dcr_map_ok_generic);
>  
> +#ifdef CONFIG_OF
>  dcr_host_t dcr_map_generic(struct device_node *dev,
>  			   unsigned int dcr_n,
>  			   unsigned int dcr_c)
>  {
>  	dcr_host_t host;
> -	const char *prop = of_get_property(dev, "dcr-access-method", NULL);
> +	struct device_node *dp;
> +
> +	dp = find_dcr_parent(dev);
> +	if (dp == NULL) {
> +		host.type = INVALID;
> +		return host;
> +	}
> +
> +	const char *prop = of_get_property(dp, "dcr-access-method", NULL);
> +
> +	pr_debug("dcr_map_generic(dcr-access-method = %s)\n",
> +		 prop);
>  
>  	if (!strcmp(prop, "native")) {
>  		host.type = NATIVE;
> @@ -56,6 +93,8 @@ dcr_host_t dcr_map_generic(struct device_node *dev,
>  }
>  EXPORT_SYMBOL_GPL(dcr_map_generic);
>  
> +#endif /* CONFIG_OF */
> +
>  void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c)
>  {
>  	if (host.type == NATIVE)
> @@ -85,9 +124,10 @@ EXPORT_SYMBOL_GPL(dcr_write_generic);
>  
>  #endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */
>  
> +#ifdef CONFIG_OF
>  unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
>  {
> -	unsigned int ds;
> +	int ds;
>  	const u32 *dr = of_get_property(np, "dcr-reg", &ds);
>  
>  	if (dr == NULL || ds & 1 || index >= (ds / 8))
> @@ -99,7 +139,7 @@ EXPORT_SYMBOL_GPL(dcr_resource_start);
>  
>  unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
>  {
> -	unsigned int ds;
> +	int ds;
>  	const u32 *dr = of_get_property(np, "dcr-reg", &ds);
>  
>  	if (dr == NULL || ds & 1 || index >= (ds / 8))
> @@ -109,26 +149,28 @@ unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
>  }
>  EXPORT_SYMBOL_GPL(dcr_resource_len);
>  
> +#endif /* CONFIG_OF */
> +
> +
> +
> +/* Support for MMIO */
>  #ifdef CONFIG_PPC_DCR_MMIO
>  
> -static struct device_node * find_dcr_parent(struct device_node * node)
> +dcr_host_mmio_t dcr_map_mmio_literal_mmio(resource_size_t mmio_start,
> +					  unsigned int stride,
> +					  unsigned int dcr_n,
> +					  unsigned int dcr_c)
>  {
> -	struct device_node *par, *tmp;
> -	const u32 *p;
> -
> -	for (par = of_node_get(node); par;) {
> -		if (of_get_property(par, "dcr-controller", NULL))
> -			break;
> -		p = of_get_property(par, "dcr-parent", NULL);
> -		tmp = par;
> -		if (p == NULL)
> -			par = of_get_parent(par);
> -		else
> -			par = of_find_node_by_phandle(*p);
> -		of_node_put(tmp);
> -	}
> -	return par;
> +	dcr_host_mmio_t host;
> +	host.stride = stride;
> +	host.token = ioremap(mmio_start, dcr_c * stride);
> +	host.token -= dcr_n * stride;
> +	host.base = dcr_n;
> +	return host;
>  }
> +EXPORT_SYMBOL_GPL(dcr_map_mmio_literal_mmio);
> +
> +#ifdef CONFIG_OF
>  
>  u64 of_translate_dcr_address(struct device_node *dev,
>  			     unsigned int dcr_n,
> @@ -189,6 +231,8 @@ dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
>  }
>  EXPORT_SYMBOL_GPL(dcr_map_mmio);
>  
> +#endif /* CONFIG_OF */
> +
>  void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c)
>  {
>  	dcr_host_mmio_t h = host;
> diff --git a/include/asm-powerpc/dcr-generic.h b/include/asm-powerpc/dcr-generic.h
> index 0ee74fb..8032795 100644
> --- a/include/asm-powerpc/dcr-generic.h
> +++ b/include/asm-powerpc/dcr-generic.h
> @@ -34,8 +34,10 @@ typedef struct {
>  
>  extern bool dcr_map_ok_generic(dcr_host_t host);
>  
> +#ifdef CONFIG_OF
>  extern dcr_host_t dcr_map_generic(struct device_node *dev, unsigned int dcr_n,
>  			  unsigned int dcr_c);
> +#endif
>  extern void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c);
>  
>  extern u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n);
> diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h
> index acd491d..b12d291 100644
> --- a/include/asm-powerpc/dcr-mmio.h
> +++ b/include/asm-powerpc/dcr-mmio.h
> @@ -34,9 +34,18 @@ static inline bool dcr_map_ok_mmio(dcr_host_mmio_t host)
>  	return host.token != NULL;
>  }
>  
> +extern dcr_host_mmio_t dcr_map_mmio_literal_mmio(resource_size_t mmio_start,
> +						 unsigned int stride,
> +						 unsigned int dcr_n,
> +						 unsigned int dcr_c);
> +
> +
> +#ifdef CONFIG_OF
>  extern dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
>  				    unsigned int dcr_n,
>  				    unsigned int dcr_c);
> +#endif
> +
>  extern void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c);
>  
>  static inline u32 dcr_read_mmio(dcr_host_mmio_t host, unsigned int dcr_n)
> @@ -51,9 +60,11 @@ static inline void dcr_write_mmio(dcr_host_mmio_t host,
>  	out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
>  }
>  
> +#ifdef CONFIG_OF
>  extern u64 of_translate_dcr_address(struct device_node *dev,
>  				    unsigned int dcr_n,
>  				    unsigned int *stride);
> +#endif
>  
>  #endif /* __KERNEL__ */
>  #endif /* _ASM_POWERPC_DCR_MMIO_H */
> diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
> index 67832e5..9b3e255 100644
> --- a/include/asm-powerpc/dcr-native.h
> +++ b/include/asm-powerpc/dcr-native.h
> @@ -33,6 +33,14 @@ static inline bool dcr_map_ok_native(dcr_host_native_t host)
>  	return 1;
>  }
>  
> +static inline
> +dcr_host_native_t dcr_map_native_literal_native(unsigned int dcr_n)
> +{
> +	dcr_host_native_t host;
> +	host.base = dcr_n;
> +	return host;
> +}
> +
>  #define dcr_map_native(dev, dcr_n, dcr_c) \
>  	((dcr_host_native_t){ .base = (dcr_n) })
>  #define dcr_unmap_native(host, dcr_c)		do {} while (0)
> diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h
> index 6b86322..dfd1c24 100644
> --- a/include/asm-powerpc/dcr.h
> +++ b/include/asm-powerpc/dcr.h
> @@ -35,6 +35,27 @@
>  
>  #include <asm/dcr-generic.h>
>  
> +static inline
> +dcr_host_t dcr_map_mmio_literal(resource_size_t mmio_start,
> +				unsigned int stride,
> +				unsigned int dcr_n,
> +				unsigned int dcr_c)
> +{
> +	dcr_host_t host;
> +	host.type = MMIO;
> +	host.host.mmio =
> +		dcr_map_mmio_literal_mmio(mmio_start, stride, dcr_n, dcr_c);
> +	return host;
> +}
> +static inline
> +dcr_host_t dcr_map_native_literal(unsigned int dcr_n)
> +{
> +	dcr_host_t host;
> +	host.type = NATIVE;
> +	host.host.native = dcr_map_native_literal_native(dcr_n);
> +	return host;
> +}
> +
>  #define DCR_MAP_OK(host)	dcr_map_ok_generic(host)
>  #define dcr_map(dev, dcr_n, dcr_c) dcr_map_generic(dev, dcr_n, dcr_c)
>  #define dcr_unmap(host, dcr_c) dcr_unmap_generic(host, dcr_c)
> @@ -45,6 +66,7 @@
>  
>  #ifdef CONFIG_PPC_DCR_NATIVE
>  typedef dcr_host_native_t dcr_host_t;
> +#define dcr_map_native_literal(dcr_n) dcr_map_native_literal_native(dcr_n)
>  #define DCR_MAP_OK(host)	dcr_map_ok_native(host)
>  #define dcr_map(dev, dcr_n, dcr_c) dcr_map_native(dev, dcr_n, dcr_c)
>  #define dcr_unmap(host, dcr_c) dcr_unmap_native(host, dcr_c)
> @@ -52,6 +74,8 @@ typedef dcr_host_native_t dcr_host_t;
>  #define dcr_write(host, dcr_n, value) dcr_write_native(host, dcr_n, value)
>  #else
>  typedef dcr_host_mmio_t dcr_host_t;
> +#define dcr_map_mmio_literal(mmio_start, stride, dcr_n, dcr_c) \
> +	dcr_map_mmio_literal_mmio(mmio_start, stride, dcr_n, dcr_c)
>  #define DCR_MAP_OK(host)	dcr_map_ok_mmio(host)
>  #define dcr_map(dev, dcr_n, dcr_c) dcr_map_mmio(dev, dcr_n, dcr_c)
>  #define dcr_unmap(host, dcr_c) dcr_unmap_mmio(host, dcr_c)

^ permalink raw reply

* Re: OF compatible MTD platform RAM driver ?
From: Segher Boessenkool @ 2008-03-30 22:39 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: ben, linuxppc-dev, linux-mtd, David Gibson
In-Reply-To: <18416.813.635397.559197@cargo.ozlabs.ibm.com>

>>> For RAMs we
>>> need something to indicate that it's memory but intended for 
>>> secondary
>>> storage, not as main memory.
>>
>> How it is intended to be used is not a property of the hardware, so
>> that information doesn't belong in the device tree at all.  The Linux
>> platform code should handle this, I imagine.
>
> There must be some reason why it is not intended to be used as main
> memory.  Presumably it has something different about it compared to
> "normal" RAM, and that difference could perfectly well be expressed in
> the device tree.

Sure, that's a different thing.  It might sit on a bus that doesn't
do cache coherency, or maybe it's just slow (or sits on a slow bus).
All these things can be usefully expressed in the device tree (but
typically are not, it is left to the client code to know this stuff
implicitly).

It's still the (platform) probe code its responsibility to figure
out what (if anything) to do with any device.  And "main memory"
is probed differently (via /chosen/memory, for example) anyway.
Well, actually, Linux searches for all nodes with device_type "memory",
which should work fine as well [*].

So, all in all, I think we should just give these "auxiliary memory"
devices a name of "ram" c.q. "rom", and some "reg", and that should
be all that is needed: the main memory probe stuff won't consider
these nodes, and the (platform) device probe code can do whatever it
wants (create mtd devices, I guess).


Segher


[*] It seems to me the longtrail workaround code in prom_init.c is
incorrect though: it will match any node with name "memory" that
doesn't have a device_type?

^ permalink raw reply

* [2.6 patch] powerpc: remove the non-functional PPC_PREP bits
From: Adrian Bunk @ 2008-03-30 22:40 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev, linux-kernel

Back in November 2005, the PPC_PREP bits under arch/powerpc/ were marked 
as BROKEN due to not being working.

It doesn't seem to make much sense to keep this rudimentary support even 
longer.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 arch/powerpc/Kconfig                |    5 +---
 arch/powerpc/kernel/setup-common.c  |    6 -----
 arch/powerpc/platforms/Kconfig      |    3 --
 arch/powerpc/platforms/prep/Kconfig |   31 ----------------------------
 include/asm-powerpc/processor.h     |    7 ------
 5 files changed, 3 insertions(+), 49 deletions(-)

75e5883ddd71921318afb01dd7d2402528f3b8e5 diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 1189d8d..380b7a0 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -309,7 +309,6 @@ config CRASH_DUMP
 
 config PPCBUG_NVRAM
 	bool "Enable reading PPCBUG NVRAM during boot" if PPLUS || LOPEC
-	default y if PPC_PREP
 
 config IRQ_ALL_CPUS
 	bool "Distribute interrupts on all CPUs by default"
@@ -453,7 +452,7 @@ menu "Bus options"
 
 config ISA
 	bool "Support for ISA-bus hardware"
-	depends on PPC_PREP || PPC_CHRP
+	depends on PPC_CHRP
 	select PPC_I8259
 	help
 	  Find out whether you have ISA slots on your motherboard.  ISA is the
@@ -635,7 +634,7 @@ config TASK_SIZE_BOOL
 
 config TASK_SIZE
 	hex "Size of user task space" if TASK_SIZE_BOOL
-	default "0x80000000" if PPC_PREP || PPC_8xx
+	default "0x80000000" if PPC_8xx
 	default "0xc0000000"
 
 config CONSISTENT_START_BOOL
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 6adb5a1..fc32f53 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -570,12 +570,6 @@ int check_legacy_ioport(unsigned long base_port)
 	case FDC_BASE: /* FDC1 */
 		np = of_find_node_by_type(NULL, "fdc");
 		break;
-#ifdef CONFIG_PPC_PREP
-	case _PIDXR:
-	case _PNPWRP:
-	case PNPBIOS_BASE:
-		/* implement me */
-#endif
 	default:
 		/* ipmi is supposed to fail here */
 		break;
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index a578b96..3a2954d 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -42,7 +42,6 @@ source "arch/powerpc/platforms/chrp/Kconfig"
 source "arch/powerpc/platforms/512x/Kconfig"
 source "arch/powerpc/platforms/52xx/Kconfig"
 source "arch/powerpc/platforms/powermac/Kconfig"
-source "arch/powerpc/platforms/prep/Kconfig"
 source "arch/powerpc/platforms/maple/Kconfig"
 source "arch/powerpc/platforms/pasemi/Kconfig"
 source "arch/powerpc/platforms/celleb/Kconfig"
@@ -210,7 +209,7 @@ endmenu
 
 config PPC601_SYNC_FIX
 	bool "Workarounds for PPC601 bugs"
-	depends on 6xx && (PPC_PREP || PPC_PMAC)
+	depends on 6xx && PPC_PMAC
 	help
 	  Some versions of the PPC601 (the first PowerPC chip) have bugs which
 	  mean that extra synchronization instructions are required near
diff --git a/arch/powerpc/platforms/prep/Kconfig b/arch/powerpc/platforms/prep/Kconfig
deleted file mode 100644
index 29d4112..0000000
--- a/arch/powerpc/platforms/prep/Kconfig
+++ /dev/null
@@ -1,31 +0,0 @@
-config PPC_PREP
-	bool "PowerPC Reference Platform (PReP) based machines"
-	depends on PPC_MULTIPLATFORM && PPC32 && BROKEN
-	select MPIC
-	select PPC_I8259
-	select PPC_INDIRECT_PCI
-	select PPC_UDBG_16550
-	select PPC_NATIVE
-	default n
-
-config PREP_RESIDUAL
-	bool "Support for PReP Residual Data"
-	depends on PPC_PREP
-	help
-	  Some PReP systems have residual data passed to the kernel by the
-	  firmware.  This allows detection of memory size, devices present and
-	  other useful pieces of information.  Sometimes this information is
-	  not present or incorrect, in which case it could lead to the machine 
-	  behaving incorrectly.  If this happens, either disable PREP_RESIDUAL
-	  or pass the 'noresidual' option to the kernel.
-
-	  If you are running a PReP system, say Y here, otherwise say N.
-
-config PROC_PREPRESIDUAL
-	bool "Support for reading of PReP Residual Data in /proc"
-	depends on PREP_RESIDUAL && PROC_FS
-	help
-	  Enabling this option will create a /proc/residual file which allows
-	  you to get at the residual data on PReP systems.  You will need a tool
-	  (lsresidual) to parse it.  If you aren't on a PReP system, you don't
-	  want this.
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index fd98ca9..077bcbd 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -38,13 +38,6 @@
 
 extern int _chrp_type;
 
-#ifdef CONFIG_PPC_PREP
-
-/* what kind of prep workstation we are */
-extern int _prep_type;
-
-#endif /* CONFIG_PPC_PREP */
-
 #endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */
 
 /*

^ permalink raw reply related

* Re: [PATCH 1/9] [POWERPC] mv64x60: change FDT compatible prefix to mrvl
From: David Gibson @ 2008-03-30 23:44 UTC (permalink / raw)
  To: Grant Likely; +Cc: paulus, linuxppc-dev
In-Reply-To: <fa686aa40803281647y4ccc4605n1507f9c1868d4c0f@mail.gmail.com>

On Fri, Mar 28, 2008 at 05:47:25PM -0600, Grant Likely wrote:
> On Fri, Mar 28, 2008 at 5:42 PM, Dale Farnsworth <dale@farnsworth.org> wrote:
> > From: Dale Farnsworth <dale@farnsworth.org>
> >
> >  Follow the convention that compatible names are prefixed by the
> >  vendor's stock ticker symbol.  For Marvell Technology Group Ltd.,
> >  that's MRVL.
> >
> >  Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
> >  Acked-by: Mark A. Greer <mgreer@mvista.com>
> 
> Are there any boards "in the wild" using the old string?  If so are
> does changing this string risk complicating upgrades to a new kernel
> version?

In particular are there any pre-flattened-tree real-OF systems in the
wild using "marvell" as the vendor prefix (there might be Apple or IBM
systems out there with Marvell PHYs for example).

Existing practice trumps "use stock ticker" for the standard vendor
prefix.

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

^ permalink raw reply

* Re: OF compatible MTD platform RAM driver ?
From: Paul Mackerras @ 2008-03-31  0:42 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: ben, linuxppc-dev, linux-mtd, David Gibson
In-Reply-To: <56851566f85e117c42b078dd2d6a2028@kernel.crashing.org>

Segher Boessenkool writes:

> It's still the (platform) probe code its responsibility to figure
> out what (if anything) to do with any device.  And "main memory"
> is probed differently (via /chosen/memory, for example) anyway.
> Well, actually, Linux searches for all nodes with device_type "memory",
> which should work fine as well [*].
> 
> So, all in all, I think we should just give these "auxiliary memory"
> devices a name of "ram" c.q. "rom", and some "reg", and that should
> be all that is needed: the main memory probe stuff won't consider
> these nodes, and the (platform) device probe code can do whatever it
> wants (create mtd devices, I guess).

Sounds reasonable.

> [*] It seems to me the longtrail workaround code in prom_init.c is
> incorrect though: it will match any node with name "memory" that
> doesn't have a device_type?

It only matches on children of the root node, and it's that way
because the /memory node in the longtrail device tree doesn't have a
device_type.  Actually we could probably remove the longtrail stuff
now; I think mine has stopped working, and I only know of 2 others in
existence. :)

Paul.

^ permalink raw reply

* Re: [2.6 patch] powerpc: remove the non-functional PPC_PREP bits
From: Paul Mackerras @ 2008-03-31  0:44 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20080330224012.GD28445@cs181133002.pp.htv.fi>

Adrian Bunk writes:

> Back in November 2005, the PPC_PREP bits under arch/powerpc/ were marked 
> as BROKEN due to not being working.
> 
> It doesn't seem to make much sense to keep this rudimentary support even 
> longer.

NAK - I have some patches that get ARCH=powerpc working on at least
some PRePs, and I plan to get them in before arch/ppc goes away.

Paul.

^ permalink raw reply

* Re: OF compatible MTD platform RAM driver ?
From: Segher Boessenkool @ 2008-03-31  0:59 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: ben, linuxppc-dev, linux-mtd, David Gibson
In-Reply-To: <18416.13196.812280.794832@cargo.ozlabs.ibm.com>

>> [*] It seems to me the longtrail workaround code in prom_init.c is
>> incorrect though: it will match any node with name "memory" that
>> doesn't have a device_type?
>
> It only matches on children of the root node,

Oh okay, I misread that then.

> and it's that way
> because the /memory node in the longtrail device tree doesn't have a
> device_type.

Yeah.

> Actually we could probably remove the longtrail stuff
> now; I think mine has stopped working, and I only know of 2 others in
> existence. :)

I'll prepare a patch.


Segher

^ permalink raw reply

* Fwd: [PATCH] Fix missed hardware breakpoints across multiple threads
From: Michael Ellerman @ 2008-03-31  1:07 UTC (permalink / raw)
  To: linuxppc-dev list

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

From: Michael Ellerman <michael@ellerman.id.au>
Subject: [PATCH] Fix missed hardware breakpoints across multiple threads

There is a bug in the powerpc DABR (data access breakpoint) handling,
which can result in us missing breakpoints if several threads are trying
to break on the same address.

The circumstances are that do_page_fault() calls do_dabr(), this clears
the DABR (sets it to 0) and sets up the signal which will report to
userspace that the DABR was hit. The do_signal() code will restore the DABR
value on the way out to userspace.

If we reschedule before calling do_signal(), __switch_to() will check the
cached DABR value and compare it to the new thread's value, if they match
we don't set the DABR in hardware.

So if two threads have the same DABR value, and we schedule from one to
the other after taking the interrupt for the first thread hitting the DABR,
the second thread will run without the DABR set in hardware.

The cleanest fix is to move the cache update into set_dabr(), that way we
can't forget to do it.

Reported-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/kernel/process.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)


Sorry all, I forgot to CC this to the list in my rush to get out of the
office on Friday night, sorry! :)


diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 59311ec..4ec6055 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -241,8 +241,12 @@ void discard_lazy_cpu_state(void)
 }
 #endif /* CONFIG_SMP */
 
+static DEFINE_PER_CPU(unsigned long, current_dabr);
+
 int set_dabr(unsigned long dabr)
 {
+	__get_cpu_var(current_dabr) = dabr;
+
 #ifdef CONFIG_PPC_MERGE		/* XXX for now */
 	if (ppc_md.set_dabr)
 		return ppc_md.set_dabr(dabr);
@@ -259,8 +263,6 @@ int set_dabr(unsigned long dabr)
 DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array);
 #endif
 
-static DEFINE_PER_CPU(unsigned long, current_dabr);
-
 struct task_struct *__switch_to(struct task_struct *prev,
 	struct task_struct *new)
 {
@@ -325,10 +327,8 @@ struct task_struct *__switch_to(struct task_struct *prev,
 
 #endif /* CONFIG_SMP */
 
-	if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) {
+	if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr))
 		set_dabr(new->thread.dabr);
-		__get_cpu_var(current_dabr) = new->thread.dabr;
-	}
 
 	new_thread = &new->thread;
 	old_thread = &current->thread;
-- 
1.5.2.rc1.1884.g59b20



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

^ permalink raw reply related

* Re: OF compatible MTD platform RAM driver ?
From: Segher Boessenkool @ 2008-03-31  1:24 UTC (permalink / raw)
  To: Segher Boessenkool
  Cc: ben, linuxppc-dev@ozlabs.org list, Paul Mackerras, David Gibson
In-Reply-To: <b393df3f814388b5cd5ae2f3b2b7fd66@kernel.crashing.org>

[Removed linux-mtd from cc:]

>>> [*] It seems to me the longtrail workaround code in prom_init.c is
>>> incorrect though: it will match any node with name "memory" that
>>> doesn't have a device_type?
>>
>> It only matches on children of the root node,
>
> Oh okay, I misread that then.

...No, I did not.  prom_next_node() does a depth-first tree traversal.

>> Actually we could probably remove the longtrail stuff
>> now; I think mine has stopped working, and I only know of 2 others in
>> existence. :)
>
> I'll prepare a patch.

...Actually, that's a lot of code to rip out, and I can't test this at 
all,
so I'll have to pass on this.


Segher

^ permalink raw reply

* Re: OF compatible MTD platform RAM driver ?
From: Laurent Pinchart @ 2008-03-31  8:21 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: ben, linux-mtd, Paul Mackerras, David Gibson
In-Reply-To: <56851566f85e117c42b078dd2d6a2028@kernel.crashing.org>

On Monday 31 March 2008 00:39, Segher Boessenkool wrote:
> >>> For RAMs we
> >>> need something to indicate that it's memory but intended for=20
> >>> secondary
> >>> storage, not as main memory.
> >>
> >> How it is intended to be used is not a property of the hardware, so
> >> that information doesn't belong in the device tree at all.  The Linux
> >> platform code should handle this, I imagine.
> >
> > There must be some reason why it is not intended to be used as main
> > memory.  Presumably it has something different about it compared to
> > "normal" RAM, and that difference could perfectly well be expressed in
> > the device tree.
>=20
> Sure, that's a different thing.  It might sit on a bus that doesn't
> do cache coherency, or maybe it's just slow (or sits on a slow bus).
> All these things can be usefully expressed in the device tree (but
> typically are not, it is left to the client code to know this stuff
> implicitly).
>=20
> It's still the (platform) probe code its responsibility to figure
> out what (if anything) to do with any device.  And "main memory"
> is probed differently (via /chosen/memory, for example) anyway.
> Well, actually, Linux searches for all nodes with device_type "memory",
> which should work fine as well [*].
>=20
> So, all in all, I think we should just give these "auxiliary memory"
> devices a name of "ram" c.q. "rom", and some "reg", and that should
> be all that is needed: the main memory probe stuff won't consider
> these nodes, and the (platform) device probe code can do whatever it
> wants (create mtd devices, I guess).

Ok, I get your point. I'll prepare a new documentation patch; changes to=20
physmap_of.c will go away.

If I understand you correctly, there should be no "compatible" property on =
the=20
ram and rom devices. Should the "non-volatile", "slow" and "static ram"=20
properties still be expressed in the device tree ?

=2D-=20
Laurent Pinchart
CSE Semaphore Belgium

Chauss=E9e de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
=46 +32 (2) 387 42 75

^ permalink raw reply

* Re: [PATCH] powerpc: Fix deadlock with mmu_hash_lock in hash_page_sync
From: Gaash Hazan @ 2008-03-31  8:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linuxppc-dev, Paul Mackerras, gaash-ppclnx, Gilad Ben-Yossef
In-Reply-To: <8C22373EA650AF40928EEA0C188D62D206C71041@xmb-ams-338.emea.cisco.com>


> -----Original Message-----
> From: Benjamin Herrenschmidt
> [mailto:benh@kernel.crashing.org] 
> Sent: Monday, March 31, 2008 0:49
> To: gaash-ppclnx@gaashh.com
> Cc: linuxppc-dev@ozlabs.org; Gilad Ben-Yossef; Paul
> Mackerras
> Subject: [PATCH] powerpc: Fix deadlock with
> mmu_hash_lock in
> hash_page_sync
> 
> hash_page_sync() takes and releases the low level
> mmu hash lock in order
> to sync with other processors disposing of page
> tables. Because that
> lock can be needed to service hash misses triggered
> by interrupt
> handler, taking it must be done with interrupts off.
> However,
> hash_page_sync() appear to be called with interrupts
> enabled, thus
> causing occasional deadlocks.
> 
> We fix it by making sure hash_page_sync() masks
> interrupts while holding
> the lock.
> 
> Signed-off-by: Benjamin Herrenschmidt
> <benh@kernel.crashing.org>
> ---
> 
> Please test and report asap thought it's probably
> too late for 2.6.25,
> it can still go into stable later on.
> 

Thank you for the quick acknowledgment and patch. 

Patch works well.

Thanks,
Gaash

^ 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