LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: 2.6.31-git5 kernel boot hangs on powerpc
From: Tejun Heo @ 2009-09-17 15:53 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Linux/PPC Development, David Miller
In-Reply-To: <1253185994.8375.352.camel@pasglop>

Hello,

Benjamin Herrenschmidt wrote:
> On Thu, 2009-09-17 at 16:21 +0530, Sachin Sant wrote:
>> The problem seems to have been introduced with
>> commit ada3fa15057205b7d3f727bba5cd26b5912e350f.
>>
>> Specifically this patch : 
>> powerpc64: convert to dynamic percpu allocator
>>
>> If i revert this patch i am able to boot latest git
>> on a powerpc box.
>>
>> The kernel is configured with 64K pages.
>> Have again attached the config file used.
> 
> Thanks for tracking the commit down. I've tried it today but your config
> has everything as modules and that didn't work out very well with my
> netboot setup. I'll dig a bit more tomorrow.
> 
> It's probably my fault for not properly getting the time to test Tejun
> patches... oh well, that's what being too busy does to you.

Ah... sorry about that.  Sachin, is it possible for you to build the
kernel with debug info and ask gdb where the stalling NIP is in the c
file?

Thanks.

-- 
tejun

^ permalink raw reply

* [PATCH] fix ppc64 build failure on fedora
From: Kyle McMartin @ 2009-09-17 17:41 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel

From: Kyle McMartin <kyle@redhat.com>

For some reason or another (newer gcc?) on Fedora 12 koji builders we're
seeing _restgpr0_$n symbols instead of _restgpr_$n as handled in the
prom_init_check.sh file:
Checking prom_init.o symbol '_restgpr0_14'
Error: External symbol '_restgpr0_14' referenced from prom_init.c
Checking prom_init.o symbol '_restgpr0_17'

Add cases to handle this to the filter portion of the script.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
---

diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
index 1ac136b..9f82f49 100644
--- a/arch/powerpc/kernel/prom_init_check.sh
+++ b/arch/powerpc/kernel/prom_init_check.sh
@@ -52,12 +52,18 @@ do
 	if [ "${UNDEF:0:9}" = "_restgpr_" ]; then
 		OK=1
 	fi
+	if [ "${UNDEF:0:10}" = "_restgpr0_" ]; then
+		OK=1
+	fi
 	if [ "${UNDEF:0:11}" = "_rest32gpr_" ]; then
 		OK=1
 	fi
 	if [ "${UNDEF:0:9}" = "_savegpr_" ]; then
 		OK=1
 	fi
+	if [ "${UNDEF:0:10}" = "_savegpr0_" ]; then
+		OK=1
+	fi
 	if [ "${UNDEF:0:11}" = "_save32gpr_" ]; then
 		OK=1
 	fi

^ permalink raw reply related

* Re: [PATCH] fix ppc64 build failure on fedora
From: Kyle McMartin @ 2009-09-17 17:57 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20090917174144.GA11961@bombadil.infradead.org>

On Thu, Sep 17, 2009 at 01:41:44PM -0400, Kyle McMartin wrote:
> For some reason or another (newer gcc?) on Fedora 12 koji builders we're
> seeing _restgpr0_$n symbols instead of _restgpr_$n as handled in the
> prom_init_check.sh file:
> Checking prom_init.o symbol '_restgpr0_14'
> Error: External symbol '_restgpr0_14' referenced from prom_init.c
> Checking prom_init.o symbol '_restgpr0_17'
> 
> Add cases to handle this to the filter portion of the script.
> 

Sorry, after reading the gcc code for this, I've realized this is
clearly wrong and must be a toolchain defect...

Apologies for the noise.

cheers, Kyle

^ permalink raw reply

* drivers/mfd/ab3100-core.c
From: Andrew Morton @ 2009-09-18  0:20 UTC (permalink / raw)
  To: Samuel Ortiz, Benjamin Herrenschmidt; +Cc: linuxppc-dev

This:

static const struct ab3100_init_setting __initdata
ab3100_init_settings[] = {

causes this:

drivers/mfd/ab3100-core.c:651: error: ab3100_init_settings causes a section type conflict

on ppc64.

I keep forgetting why.  Did MFD do something wrong or is powerpc borked
or did my compiler version expire?

^ permalink raw reply

* Re: drivers/mfd/ab3100-core.c
From: Andrew Morton @ 2009-09-18  1:30 UTC (permalink / raw)
  To: avorontsov; +Cc: sameo, linuxppc-dev
In-Reply-To: <20090918012213.GA31463@oksana.dev.rtsoft.ru>

On Fri, 18 Sep 2009 05:22:13 +0400
Anton Vorontsov <avorontsov@ru.mvista.com> wrote:

> On Thu, Sep 17, 2009 at 05:20:58PM -0700, Andrew Morton wrote:
> > This:
> > 
> > static const struct ab3100_init_setting __initdata
> > ab3100_init_settings[] = {
> 
> Looks like it should be __initconst, otherwise it's ambiguous.
> 
> > causes this:
> > 
> > drivers/mfd/ab3100-core.c:651: error: ab3100_init_settings causes a section type conflict
> > 
> > on ppc64.
> > 
> > I keep forgetting why.  Did MFD do something wrong or is powerpc borked
> > or did my compiler version expire?
> 

doh, OK, I forgot about initconst.  I'll try it..

^ permalink raw reply

* Re: [PATCH] fix ppc64 build failure on fedora
From: Benjamin Herrenschmidt @ 2009-09-18  1:50 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20090917174144.GA11961@bombadil.infradead.org>

On Thu, 2009-09-17 at 13:41 -0400, Kyle McMartin wrote:
> From: Kyle McMartin <kyle@redhat.com>
> 
> For some reason or another (newer gcc?) on Fedora 12 koji builders we're
> seeing _restgpr0_$n symbols instead of _restgpr_$n as handled in the
> prom_init_check.sh file:
> Checking prom_init.o symbol '_restgpr0_14'
> Error: External symbol '_restgpr0_14' referenced from prom_init.c
> Checking prom_init.o symbol '_restgpr0_17'
> 
> Add cases to handle this to the filter portion of the script.

My concern tho is if one of thse is actually called ... we implement
them in arch/powerpc/lib/crtsaveres.S but with the "other" names..

Ben.

> Signed-off-by: Kyle McMartin <kyle@redhat.com>
> ---
> 
> diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
> index 1ac136b..9f82f49 100644
> --- a/arch/powerpc/kernel/prom_init_check.sh
> +++ b/arch/powerpc/kernel/prom_init_check.sh
> @@ -52,12 +52,18 @@ do
>  	if [ "${UNDEF:0:9}" = "_restgpr_" ]; then
>  		OK=1
>  	fi
> +	if [ "${UNDEF:0:10}" = "_restgpr0_" ]; then
> +		OK=1
> +	fi
>  	if [ "${UNDEF:0:11}" = "_rest32gpr_" ]; then
>  		OK=1
>  	fi
>  	if [ "${UNDEF:0:9}" = "_savegpr_" ]; then
>  		OK=1
>  	fi
> +	if [ "${UNDEF:0:10}" = "_savegpr0_" ]; then
> +		OK=1
> +	fi
>  	if [ "${UNDEF:0:11}" = "_save32gpr_" ]; then
>  		OK=1
>  	fi
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply

* Re: drivers/mfd/ab3100-core.c
From: Anton Vorontsov @ 2009-09-18  1:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Samuel Ortiz, linuxppc-dev
In-Reply-To: <20090917172058.902474da.akpm@linux-foundation.org>

On Thu, Sep 17, 2009 at 05:20:58PM -0700, Andrew Morton wrote:
> This:
> 
> static const struct ab3100_init_setting __initdata
> ab3100_init_settings[] = {

Looks like it should be __initconst, otherwise it's ambiguous.

> causes this:
> 
> drivers/mfd/ab3100-core.c:651: error: ab3100_init_settings causes a section type conflict
> 
> on ppc64.
> 
> I keep forgetting why.  Did MFD do something wrong or is powerpc borked
> or did my compiler version expire?

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH] fix ppc64 build failure on fedora
From: Kyle McMartin @ 2009-09-18  2:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Kyle McMartin, linuxppc-dev, linux-kernel
In-Reply-To: <1253238606.4932.23.camel@pasglop>

On Fri, Sep 18, 2009 at 11:50:06AM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2009-09-17 at 13:41 -0400, Kyle McMartin wrote:
> > From: Kyle McMartin <kyle@redhat.com>
> > 
> > For some reason or another (newer gcc?) on Fedora 12 koji builders we're
> > seeing _restgpr0_$n symbols instead of _restgpr_$n as handled in the
> > prom_init_check.sh file:
> > Checking prom_init.o symbol '_restgpr0_14'
> > Error: External symbol '_restgpr0_14' referenced from prom_init.c
> > Checking prom_init.o symbol '_restgpr0_17'
> > 
> > Add cases to handle this to the filter portion of the script.
> 
> My concern tho is if one of thse is actually called ... we implement
> them in arch/powerpc/lib/crtsaveres.S but with the "other" names..
> 

Sorry, this appears to be a GCC "feature" introduced in gcc4.5 which is
generating out of line save/restore on ppc64 at -Os. Thanks to Jakub's
suggestion I ended up working around this by building ppc with -O2 for
now (CC_OPTIMIZE_FOR_SIZE)

In any case, according to the gcc "docs" for this, these functions are
supposed to be provided by the linker in the ppc64 case, so it wasn't
correct to try and add them.

I believe Alan Modra said he'd look at the ld issue with regards to
this.

cheers, Kyle

^ permalink raw reply

* Linux booting issue on powerpc 440x5
From: Sumesh Kaana @ 2009-09-18  9:31 UTC (permalink / raw)
  To: linuxppc-dev

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



Hi,
I am trying to boot linux kernel (2.6.30) on PPC440x5 processor in a custom built board. I am using simple ppc platform.
I have a small bootloader which will only copy the simpleImage.myboard.bin to 0x400000 location of my SRAM from the flash.
SRAM is only 16MB and bootloader creates one and only TLB of 16MB
I am getting "Kernel access of bad area, sig: 11 [#1]" while kernel is booting.
kernel crashes in different places, for different compilation
Bellow given are 2 dumps of kernel crash
In DUMP1, in back trace, execution flow is shown like,
Start_kernel() --> sort_main_extable() --> sort_extable(). and sort extable calls some functions whose name is not mentioned.
Why is it not able to get the name of the function.?
i went through the 'objdump' of the kernel, I don't know whether it can help me somehow, it looked like this
--c018c730:   48 00 71 9d     bl      c01938cc <sort_main_extable>c018c734:   48 00 3e 3d     bl      c0190570 <trap_init>--c01938e8:   4b f7 10 f1     bl      c01049d8 <sort_extable>c01938ec:   80 01 00 14     lwz     r0,20(r1)--c01049fc:   48 00 8d 99     bl      c010d794 <sort>c0104a00:   80 01 00 14     lwz     r0,20(r1)--c016b99c:   42 6f 6f 74     bc+     18,4*cr3+so,c0172910 <kallsyms_token_index+0x7400>--
Could this be problem with "kallsyms"..? Because sort_extable() calls sort() which is an exported function defined in linux-2.6.30\lib\sort.c
when i checked 'objdump' of the kernel, i could see the usage of a preserved opcode of ppc440x5 (code: eciwx).
I tried compiling the kernel with "kallsyms" disabled, that also did not work.
In DUMP2, backtrace is not able to identify the name of 'caller' of unflatten_device_tree(). The caller is mentioned as "[00000000] (null)"
Could this be a stack problem, like stack pointer getting corrupted.?
At last, could this be a hardware problem(expecting to be memory problem)..?
Can you tell me if i am missing something.?
thanks,Shyju. N

-------------------------DUMP 1------------------------------------id mach(): doneMMU:enterMMU:hw initMMU:mapinMMU:setioMMU:exitbootmemarch: exit<7>Top of RAM: 0x1000000, Total RAM: 0x1000000Zone PFN ranges:  DMA      0x00000000 -> 0x00001000  Normal   0x00001000 -> 0x00001000Movable zone start PFN for each nodeearly_node_map[1] active PFN ranges    0: 0x00000000 -> 0x00001000MMU: Allocated 1088 bytes of context maps for 255 contextsBuilt 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064Kernel command line: console=ttyS0 root=/dev/ramUnable to handle kernel paging request for data at address 0x00021000Faulting instruction address: 0xc010a7c4Oops: Kernel access of bad area, sig: 11 [#1]PREEMPT PowerPC 44x PlatformModules linked in:NIP: c010a7c4 LR: c010dc50 CTR: 00000000REGS: c01bfeb0 TRAP: 0300   Not tainted  (2.6.30)MSR: 00021000 <ME,CE>  CR: 24000044  XER: 00000000DEAR: 00021000, ESR: 00000000TASK = c01a94b8[0] 'swapper' THREAD: c01be000GPR00: 00001180 c01bff60 c01a94b8 00021000 00000025 00000008 c0104968 00000000 GPR08: 2f72616d c0110000 c0155938 c01a0000 22000024 00000000 fffff104 00000000 GPR16: 00000000 00000000 00000000 00000000 fffffff8 000008b8 c010d758 c0104968 GPR24: 00001198 00001190 c018a001 c01c5498 000008c0 00001188 00021000 c01c42f0 NIP [c010a7c4] strchr+0x0/0x3cLR [c010dc50] match_token+0x138/0x228Call Trace:[c01bff60] [c016b99c] 0xc016b99c (unreliable)[c01bffa0] [c0104a00] sort_extable+0x28/0x38[c01bffb0] [c01938ec] sort_main_extable+0x20/0x30[c01bffc0] [c018c734] start_kernel+0x140/0x288[c01bfff0] [c0000200] skpinv+0x190/0x1ccInstruction dump:7ca903a6 88040000 38a5ffff 38840001 2f800000 98090000 39290001 419e0010 4200ffe4 98a90000 4e800020 4e800020 <88030000> 5484063e 7f802000 4d9e0020 ---[ end trace 31fd0ba7d8756001 ]---Kernel panic - not syncing: Attempted to kill the idle task!Call Trace:[c01bfd90] [c0005d5c] show_stack+0x4c/0x16c (unreliable)[c01bfdd0] [c002f17c] panic+0xa0/0x168[c01bfe20] [c0032eb8] do_exit+0x61c/0x638[c01bfe60] [c000b60c] kernel_bad_stack+0x0/0x4c[c01bfe90] [c000f310] bad_page_fault+0x90/0xd8[c01bfea0] [c000e184] handle_page_fault+0x7c/0x80[c01bff60] [c016b99c] 0xc016b99c[c01bffa0] [c0104a00] sort_extable+0x28/0x38[c01bffb0] [c01938ec] sort_main_extable+0x20/0x30[c01bffc0] [c018c734] start_kernel+0x140/0x288[c01bfff0] [c0000200] skpinv+0x190/0x1ccRebooting in 180 seconds..-------------------------------------------------------------------
-------------------------DUMP 2------------------------------------id mach(): doneMMU:enterMMU:hw initMMU:mapinMMU:setioMMU:exit<1>Unable to handle kernel paging request for data at address 0x40ee8053Faulting instruction address: 0xc018ff44Oops: Kernel access of bad area, sig: 11 [#1]PREEMPT PowerPC 44x PlatformModules linked in:NIP: c018ff44 LR: c018ff20 CTR: 00000000REGS: c01bfe10 TRAP: 0300   Not tainted  (2.6.30)MSR: 00021000 <ME,CE>  CR: 44088024  XER: 00000000DEAR: 40ee8053, ESR: 00800000TASK = c01a94b8[0] 'swapper' THREAD: c01be000GPR00: c0ffea58 c01bfec0 c01a94b8 c0ffea6e c04eb3aa 00000003 c0ffea74 00000000 GPR08: 00000000 40ee802f c04eb3a0 c01bfec8 24082022 00000000 fffff104 00000000 GPR16: 00000000 c016cfe8 c016cfd8 c0170cbc c01bfec8 c0ffea24 c04eb3a4 c04eb3a0 GPR24: 00000008 c01bff8c c04eb33c c0ffea2c 00000007 c01bff88 c0ffe984 c0ffea6d NIP [c018ff44] unflatten_dt_node+0x158/0x520LR [c018ff20] unflatten_dt_node+0x134/0x520Call Trace:[c01bff20] [c019023c] unflatten_dt_node+0x450/0x520[c01bff80] [c01903b4] unflatten_device_tree+0xa8/0x13c[c01bffb0] [00000000] (null)Instruction dump:7f85e378 7ec4b378 4be81b55 81390000 381b002c 93690000 90190000 4192001c 813e0028 93db001c 2f890000 419e03b4 <93690024> 937e0028 387b0034 3abb0014 ---[ end trace 31fd0ba7d8756001 ]---Kernel panic - not syncing: Attempted to kill the idle task!Call Trace:[c01bfcf0] [c0005d5c] show_stack+0x4c/0x16c (unreliable)[c01bfd30] [c002f17c] panic+0xa0/0x168[c01bfd80] [c0032eb8] do_exit+0x61c/0x638[c01bfdc0] [c000b60c] kernel_bad_stack+0x0/0x4c[c01bfdf0] [c000f310] bad_page_fault+0x90/0xd8[c01bfe00] [c000e184] handle_page_fault+0x7c/0x80[c01bfec0] [00000000] (null)[c01bff20] [c019023c] unflatten_dt_node+0x450/0x520[c01bff80] [c01903b4] unflatten_device_tree+0xa8/0x13c[c01bffb0] [00000000] (null)-------------------------------------------------------------------



_________________________________________________________________
Need a place to rent, buy or share? Let us find your next place for you! 
http://clk.atdmt.com/NMN/go/157631292/direct/01/

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

^ permalink raw reply

* linux distro recommendation
From: Marc Soleda @ 2009-09-18  9:40 UTC (permalink / raw)
  To: LinuxPPC

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

Hi all,
please apologise me if this is not the appropiate list where to point this question. If it isn't, please let me know which is the best list/site where to send it:
 
I'd like to know if it's possible and if it's stable enough to install a Linux distrib with a MPC5121E. In that case, which Linux distribution would you recommend me?
 
Thanks in advance,
Marc Soleda


      

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

^ permalink raw reply

* Re: [PATCH] char/hvc: adding __init macro to char/hvc_vio.c
From: Jiri Kosina @ 2009-09-18 10:25 UTC (permalink / raw)
  To: Peter Huewe
  Cc: Stephen Rothwell, Mike Frysinger, Nicolas Palix, kernel-janitors,
	linux-kernel, linuxppc-dev, Paul Mackerras
In-Reply-To: <200909170238.40051.PeterHuewe@gmx.de>

On Thu, 17 Sep 2009, Peter Huewe wrote:

> > Please have a look at the small patch and either pull it through
> > your tree, or please ack' it so Jiri can pull it through the trivial tree.
> >
> > linux version 2.6.31-rc6 - linus git tree, Do 20. Aug 22:26:06 CEST 2009
> >
> > Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> 
> Hi Jiri,
> this one got merged by Benjamin, so you can drop it from your queue :)
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=948c28fe3001f2c9d852dff2a0b2c69fe7cec91b

Dropped, thanks for letting me know.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply

* Re: FPGA access over PCI-E on MPC8536
From: Grant Likely @ 2009-09-18 13:44 UTC (permalink / raw)
  To: Felix Radensky; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40909180636jb2f8676k94a50b176319c249@mail.gmail.com>

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

Can you access fpga memory from u-boot?

Could very well be an fpga problem.  Same thing can happen on xilinx parts
when accessing an undefined register address via pci bridge --> plb bus -->
ipif register block --> bad address.  The pci core goes into some kind of
retry loop with the plb bus (I'm wasn't the one to look at the pci analyzer,
so I don't know the details), and it completely locks up.

g.

On Sep 16, 2009 11:02 PM, "Felix Radensky" <felix@embedded-sol.com> wrote:

Hi,

On my custom MPC8536 based board running 2.6.31 kernel
FPGA is connected via x2 PCI-E lane. FPGA is identified
during PCI scan and is visible via lspci.

0000:01:00.0 Class ff00: Altera Corporation Unknown device 0004 (rev 01)
       Subsystem: Altera Corporation Unknown device 0004
       Flags: fast devsel, IRQ 16
       Memory at 98000000 (32-bit, non-prefetchable) [disabled] [size=1M]
       Capabilities: [50] Message Signalled Interrupts: Mask+ 64bit+
Queue=0/5 Enable-
       Capabilities: [78] Power Management version 3
       Capabilities: [80] Express Endpoint IRQ 0
       Capabilities: [100] Virtual Channel


However when I attempt to access FPGA memory my mmapping it in userspace the
read hangs. The same happens in kernel space. Does it happen because FPGA
memory is marked as disabled, or because FPGA code is doing something wrong
?

Another question is what can cause PCI device memory be marked as
disabled.

Thanks a lot.

Felix.

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

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

^ permalink raw reply

* [PATCH 0/5 v2] kernel handling of dynamic logical partitioning
From: Nathan Fontenot @ 2009-09-18 14:56 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel

The Dynamic Logical Partitioning (DLPAR) capabilities of the powerpc pseries
platform allows for the addition and removal of resources (i.e. cpus,
memory, pci devices) from a partition. The removal of a resource involves
removing the resource's node from the device tree and then returning the
resource to firmware via the rtas set-indicator call.  To add a resource, it
is first obtained from firmware via the rtas set-indicator call and then a
new device tree node is created using the ibm,configure-connector rtas call
and added to the device tree.

The following set of patches implements the needed infrastructure to have the
kernel handle the DLPAR addition and removal of memory and cpus (other
DLPAR'able items to follow in future patches).  The framework for this is
to create a set of probe/release sysfs files in pseries that will add or
remove the cpu or memory to the system.

The majority of the code is powerpc/pseries specific except for PATCH 3/5, so
I am cc'ing lkml.

Patches include in this set:
1/5 - DLPAR infracstructure for powerpc/pseries platform.
2/5 - Move the of_drconf_cell struct to prom.h
3/5 - Export the memory sysdev class
4/5 - Memory DLPAR handling
5/5 - CPU DLPAR handling

This also includes the following suggested fixes from the first version of the
patches sent out.
- Correct initialization of workarea_lock and reconfig notifier chain.
- Add cc_workarea struct to help understand the work buffer layout.
- Fix memory leak in cpu_probe_store()
- Use strict_strtoul
- Correct checkpatch failures.

-Nathan Fontenot

^ permalink raw reply

* [PATCH 1/5 v2] dynamic logical partitioning infrastructure
From: Nathan Fontenot @ 2009-09-18 14:59 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel
In-Reply-To: <4AB39FB3.1020608@austin.ibm.com>

This patch provides the kernel DLPAR infrastructure in a new filed named
dlpar.c.  The functionality provided is for acquiring and releasing a 
resource from firmware and the parsing of information returned from the
ibm,configure-connector rtas call.  Additionally this exports the 
pSeries reconfiguration notifier chain so that it can be invoked when
device tree updates are made.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: powerpc/arch/powerpc/platforms/pseries/dlpar.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ powerpc/arch/powerpc/platforms/pseries/dlpar.c	2009-09-17 11:32:22.000000000 -0500
@@ -0,0 +1,416 @@
+/*
+ * dlpar.c - support for dynamic reconfiguration (including PCI
+ * Hotplug and Dynamic Logical Partitioning on RPA platforms).
+ *
+ * Copyright (C) 2009 Nathan Fontenot
+ * Copyright (C) 2009 IBM Corporation
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/kref.h>
+#include <linux/notifier.h>
+#include <linux/proc_fs.h>
+#include <linux/spinlock.h>
+
+#include <asm/prom.h>
+#include <asm/machdep.h>
+#include <asm/uaccess.h>
+#include <asm/rtas.h>
+#include <asm/pSeries_reconfig.h>
+
+#define CFG_CONN_WORK_SIZE	4096
+static char workarea[CFG_CONN_WORK_SIZE];
+static DEFINE_SPINLOCK(workarea_lock);
+
+struct cc_workarea {
+	u32	drc_index;
+	u32	zero;
+	u32	name_offset;
+	u32	prop_length;
+	u32	prop_offset;
+};
+
+static struct property *parse_cc_property(char *workarea)
+{
+	struct property *prop;
+	struct cc_workarea *ccwa;
+	char *name;
+	char *value;
+
+	prop = kzalloc(sizeof(*prop), GFP_KERNEL);
+	if (!prop)
+		return NULL;
+
+	ccwa = (struct cc_workarea *)workarea;
+	name = workarea + ccwa->name_offset;
+	prop->name = kzalloc(strlen(name) + 1, GFP_KERNEL);
+	if (!prop->name) {
+		kfree(prop);
+		return NULL;
+	}
+
+	strcpy(prop->name, name);
+
+	prop->length = ccwa->prop_length;
+	value = workarea + ccwa->prop_offset;
+	prop->value = kzalloc(prop->length, GFP_KERNEL);
+	if (!prop->value) {
+		kfree(prop->name);
+		kfree(prop);
+		return NULL;
+	}
+
+	memcpy(prop->value, value, prop->length);
+	return prop;
+}
+
+static void free_property(struct property *prop)
+{
+	kfree(prop->name);
+	kfree(prop->value);
+	kfree(prop);
+}
+
+static struct device_node *parse_cc_node(char *work_area)
+{
+	struct device_node *dn;
+	struct cc_workarea *ccwa;
+	char *name;
+
+	dn = kzalloc(sizeof(*dn), GFP_KERNEL);
+	if (!dn)
+		return NULL;
+
+	ccwa = (struct cc_workarea *)work_area;
+	name = work_area + ccwa->name_offset;
+	dn->full_name = kzalloc(strlen(name) + 1, GFP_KERNEL);
+	if (!dn->full_name) {
+		kfree(dn);
+		return NULL;
+	}
+
+	strcpy(dn->full_name, name);
+	return dn;
+}
+
+static void free_one_cc_node(struct device_node *dn)
+{
+	struct property *prop;
+
+	while (dn->properties) {
+		prop = dn->properties;
+		dn->properties = prop->next;
+		free_property(prop);
+	}
+
+	kfree(dn->full_name);
+	kfree(dn);
+}
+
+static void free_cc_nodes(struct device_node *dn)
+{
+	if (dn->child)
+		free_cc_nodes(dn->child);
+
+	if (dn->sibling)
+		free_cc_nodes(dn->sibling);
+
+	free_one_cc_node(dn);
+}
+
+#define NEXT_SIBLING    1
+#define NEXT_CHILD      2
+#define NEXT_PROPERTY   3
+#define PREV_PARENT     4
+#define MORE_MEMORY     5
+#define CALL_AGAIN	-2
+#define ERR_CFG_USE     -9003
+
+struct device_node *configure_connector(u32 drc_index)
+{
+	struct device_node *dn;
+	struct device_node *first_dn = NULL;
+	struct device_node *last_dn = NULL;
+	struct property *property;
+	struct property *last_property = NULL;
+	struct cc_workarea *ccwa;
+	int cc_token;
+	int rc;
+
+	cc_token = rtas_token("ibm,configure-connector");
+	if (cc_token == RTAS_UNKNOWN_SERVICE)
+		return NULL;
+
+	spin_lock(&workarea_lock);
+
+	ccwa = (struct cc_workarea *)&workarea[0];
+	ccwa->drc_index = drc_index;
+	ccwa->zero = 0;
+
+	rc = rtas_call(cc_token, 2, 1, NULL, workarea, NULL);
+	while (rc) {
+		switch (rc) {
+		case NEXT_SIBLING:
+			dn = parse_cc_node(workarea);
+			if (!dn)
+				goto cc_error;
+
+			dn->parent = last_dn->parent;
+			last_dn->sibling = dn;
+			last_dn = dn;
+			break;
+
+		case NEXT_CHILD:
+			dn = parse_cc_node(workarea);
+			if (!dn)
+				goto cc_error;
+
+			if (!first_dn)
+				first_dn = dn;
+			else {
+				dn->parent = last_dn;
+				if (last_dn)
+					last_dn->child = dn;
+			}
+
+			last_dn = dn;
+			break;
+
+		case NEXT_PROPERTY:
+			property = parse_cc_property(workarea);
+			if (!property)
+				goto cc_error;
+
+			if (!last_dn->properties)
+				last_dn->properties = property;
+			else
+				last_property->next = property;
+
+			last_property = property;
+			break;
+
+		case PREV_PARENT:
+			last_dn = last_dn->parent;
+			break;
+
+		case CALL_AGAIN:
+			break;
+
+		case MORE_MEMORY:
+		case ERR_CFG_USE:
+		default:
+			printk(KERN_ERR "Unexpected Error (%d) "
+			       "returned from configure-connector\n", rc);
+			goto cc_error;
+		}
+
+		rc = rtas_call(cc_token, 2, 1, NULL, workarea, NULL);
+	}
+
+	spin_unlock(&workarea_lock);
+	return first_dn;
+
+cc_error:
+	spin_unlock(&workarea_lock);
+
+	if (first_dn)
+		free_cc_nodes(first_dn);
+
+	return NULL;
+}
+
+static struct device_node *derive_parent(const char *path)
+{
+	struct device_node *parent;
+	char parent_path[128];
+	int parent_path_len;
+
+	parent_path_len = strrchr(path, '/') - path + 1;
+	strlcpy(parent_path, path, parent_path_len);
+
+	parent = of_find_node_by_path(parent_path);
+
+	return parent;
+}
+
+static int add_one_node(struct device_node *dn)
+{
+	struct proc_dir_entry *ent;
+	int rc;
+
+	of_node_set_flag(dn, OF_DYNAMIC);
+	kref_init(&dn->kref);
+	dn->parent = derive_parent(dn->full_name);
+
+	rc = blocking_notifier_call_chain(&pSeries_reconfig_chain,
+					  PSERIES_RECONFIG_ADD, dn);
+	if (rc == NOTIFY_BAD) {
+		printk(KERN_ERR "Failed to add device node %s\n",
+		       dn->full_name);
+		return -ENOMEM; /* For now, safe to assume kmalloc failure */
+	}
+
+	of_attach_node(dn);
+
+#ifdef CONFIG_PROC_DEVICETREE
+	ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde);
+	if (ent)
+		proc_device_tree_add_node(dn, ent);
+#endif
+
+	of_node_put(dn->parent);
+	return 0;
+}
+
+int add_device_tree_nodes(struct device_node *dn)
+{
+	struct device_node *child = dn->child;
+	struct device_node *sibling = dn->sibling;
+	int rc;
+
+	dn->child = NULL;
+	dn->sibling = NULL;
+	dn->parent = NULL;
+
+	rc = add_one_node(dn);
+	if (rc)
+		return rc;
+
+	if (child) {
+		rc = add_device_tree_nodes(child);
+		if (rc)
+			return rc;
+	}
+
+	if (sibling)
+		rc = add_device_tree_nodes(sibling);
+
+	return rc;
+}
+
+static int remove_one_node(struct device_node *dn)
+{
+	struct device_node *parent = dn->parent;
+	struct property *prop = dn->properties;
+
+#ifdef CONFIG_PROC_DEVICETREE
+	while (prop) {
+		remove_proc_entry(prop->name, dn->pde);
+		prop = prop->next;
+	}
+
+	if (dn->pde)
+		remove_proc_entry(dn->pde->name, parent->pde);
+#endif
+
+	blocking_notifier_call_chain(&pSeries_reconfig_chain,
+			    PSERIES_RECONFIG_REMOVE, dn);
+	of_detach_node(dn);
+
+	of_node_put(parent);
+	of_node_put(dn); /* Must decrement the refcount */
+
+	return 0;
+}
+
+static int _remove_device_tree_nodes(struct device_node *dn)
+{
+	int rc;
+
+	if (dn->child) {
+		rc = _remove_device_tree_nodes(dn->child);
+		if (rc)
+			return rc;
+	}
+
+	if (dn->sibling) {
+		rc = _remove_device_tree_nodes(dn->sibling);
+		if (rc)
+			return rc;
+	}
+
+	rc = remove_one_node(dn);
+	return rc;
+}
+
+int remove_device_tree_nodes(struct device_node *dn)
+{
+	int rc;
+
+	if (dn->child) {
+		rc = _remove_device_tree_nodes(dn->child);
+		if (rc)
+			return rc;
+	}
+
+	rc = remove_one_node(dn);
+	return rc;
+}
+
+#define DR_ENTITY_SENSE		9003
+#define DR_ENTITY_PRESENT	1
+#define DR_ENTITY_UNUSABLE	2
+#define ALLOCATION_STATE	9003
+#define ALLOC_UNUSABLE		0
+#define ALLOC_USABLE		1
+#define ISOLATION_STATE		9001
+#define ISOLATE			0
+#define UNISOLATE		1
+
+int acquire_drc(u32 drc_index)
+{
+	int dr_status, rc;
+
+	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
+		       DR_ENTITY_SENSE, drc_index);
+	if (rc || dr_status != DR_ENTITY_UNUSABLE)
+		return -1;
+
+	rc = rtas_set_indicator(ALLOCATION_STATE, drc_index, ALLOC_USABLE);
+	if (rc)
+		return rc;
+
+	rc = rtas_set_indicator(ISOLATION_STATE, drc_index, UNISOLATE);
+	if (rc) {
+		rtas_set_indicator(ALLOCATION_STATE, drc_index, ALLOC_UNUSABLE);
+		return rc;
+	}
+
+	return 0;
+}
+
+int release_drc(u32 drc_index)
+{
+	int dr_status, rc;
+
+	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
+		       DR_ENTITY_SENSE, drc_index);
+	if (rc || dr_status != DR_ENTITY_PRESENT)
+		return -1;
+
+	rc = rtas_set_indicator(ISOLATION_STATE, drc_index, ISOLATE);
+	if (rc)
+		return rc;
+
+	rc = rtas_set_indicator(ALLOCATION_STATE, drc_index, ALLOC_UNUSABLE);
+	if (rc) {
+		rtas_set_indicator(ISOLATION_STATE, drc_index, UNISOLATE);
+		return rc;
+	}
+
+	return 0;
+}
+
+static int pseries_dlpar_init(void)
+{
+	if (!machine_is(pseries))
+		return 0;
+
+	return 0;
+}
+device_initcall(pseries_dlpar_init);
Index: powerpc/arch/powerpc/platforms/pseries/Makefile
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/Makefile	2009-09-11 12:43:39.000000000 -0500
+++ powerpc/arch/powerpc/platforms/pseries/Makefile	2009-09-11 12:51:52.000000000 -0500
@@ -8,7 +8,7 @@
 
 obj-y			:= lpar.o hvCall.o nvram.o reconfig.o \
 			   setup.o iommu.o ras.o rtasd.o \
-			   firmware.o power.o
+			   firmware.o power.o dlpar.o
 obj-$(CONFIG_SMP)	+= smp.o
 obj-$(CONFIG_XICS)	+= xics.o
 obj-$(CONFIG_SCANLOG)	+= scanlog.o
Index: powerpc/arch/powerpc/include/asm/pSeries_reconfig.h
===================================================================
--- powerpc.orig/arch/powerpc/include/asm/pSeries_reconfig.h	2009-09-11 12:43:39.000000000 -0500
+++ powerpc/arch/powerpc/include/asm/pSeries_reconfig.h	2009-09-11 12:51:52.000000000 -0500
@@ -17,6 +17,7 @@
 #ifdef CONFIG_PPC_PSERIES
 extern int pSeries_reconfig_notifier_register(struct notifier_block *);
 extern void pSeries_reconfig_notifier_unregister(struct notifier_block *);
+extern struct blocking_notifier_head pSeries_reconfig_chain;
 #else /* !CONFIG_PPC_PSERIES */
 static inline int pSeries_reconfig_notifier_register(struct notifier_block *nb)
 {
Index: powerpc/arch/powerpc/platforms/pseries/reconfig.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/reconfig.c	2009-09-11 12:43:39.000000000 -0500
+++ powerpc/arch/powerpc/platforms/pseries/reconfig.c	2009-09-15 14:18:38.000000000 -0500
@@ -95,7 +95,7 @@
 	return parent;
 }
 
-static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain);
+BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain);
 
 int pSeries_reconfig_notifier_register(struct notifier_block *nb)
 {

^ permalink raw reply

* [PATCH 2/5 v2] move of_drconf_cell definition to prom.h
From: Nathan Fontenot @ 2009-09-18 15:01 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel
In-Reply-To: <4AB39FB3.1020608@austin.ibm.com>

Move the definition of the of_drconf_cell struct from numa.c to prom.h.  This
is needed so that we can parse the ibm,dynamic-memory device-tree property
when DLPAR adding and removing memory.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: powerpc/arch/powerpc/include/asm/prom.h
===================================================================
--- powerpc.orig/arch/powerpc/include/asm/prom.h	2009-09-15 14:52:14.000000000 -0500
+++ powerpc/arch/powerpc/include/asm/prom.h	2009-09-15 14:53:26.000000000 -0500
@@ -349,6 +349,18 @@
  */
 extern void __iomem *of_iomap(struct device_node *device, int index);
 
+struct of_drconf_cell {
+	u64	base_addr;
+	u32	drc_index;
+	u32	reserved;
+	u32	aa_index;
+	u32	flags;
+};
+
+#define DRCONF_MEM_ASSIGNED	0x00000008
+#define DRCONF_MEM_AI_INVALID	0x00000040
+#define DRCONF_MEM_RESERVED	0x00000080
+
 /*
  * NB:  This is here while we transition from using asm/prom.h
  * to linux/of.h
Index: powerpc/arch/powerpc/mm/numa.c
===================================================================
--- powerpc.orig/arch/powerpc/mm/numa.c	2009-09-15 14:52:14.000000000 -0500
+++ powerpc/arch/powerpc/mm/numa.c	2009-09-15 14:53:26.000000000 -0500
@@ -296,18 +296,6 @@
 	return result;
 }
 
-struct of_drconf_cell {
-	u64	base_addr;
-	u32	drc_index;
-	u32	reserved;
-	u32	aa_index;
-	u32	flags;
-};
-
-#define DRCONF_MEM_ASSIGNED	0x00000008
-#define DRCONF_MEM_AI_INVALID	0x00000040
-#define DRCONF_MEM_RESERVED	0x00000080
-
 /*
  * Read the next lmb list entry from the ibm,dynamic-memory property
  * and return the information in the provided of_drconf_cell structure.

^ permalink raw reply

* [PATCH 3/5 v2] Export memory_sysdev_class
From: Nathan Fontenot @ 2009-09-18 15:02 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel
In-Reply-To: <4AB39FB3.1020608@austin.ibm.com>

Export the memory_sysdev_class structure.  This is needed so we can create
a 'release' file in sysfs in addition to the existing 'probe' file in
order to support DLPAR removal of memory on the powerpc/pseries platform.
The new 'release' file will be powerpc/pseries only.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: powerpc/drivers/base/memory.c
===================================================================
--- powerpc.orig/drivers/base/memory.c	2009-09-15 14:52:12.000000000 -0500
+++ powerpc/drivers/base/memory.c	2009-09-15 14:53:32.000000000 -0500
@@ -28,9 +28,10 @@
 
 #define MEMORY_CLASS_NAME	"memory"
 
-static struct sysdev_class memory_sysdev_class = {
+struct sysdev_class memory_sysdev_class = {
 	.name = MEMORY_CLASS_NAME,
 };
+EXPORT_SYMBOL(memory_sysdev_class);
 
 static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
 {
Index: powerpc/include/linux/memory_hotplug.h
===================================================================
--- powerpc.orig/include/linux/memory_hotplug.h	2009-09-15 14:52:12.000000000 -0500
+++ powerpc/include/linux/memory_hotplug.h	2009-09-15 14:53:32.000000000 -0500
@@ -12,6 +12,8 @@
 
 #ifdef CONFIG_MEMORY_HOTPLUG
 
+extern struct sysdev_class memory_sysdev_class;
+
 /*
  * Types for free bootmem.
  * The normal smallest mapcount is -1. Here is smaller value than it.

^ permalink raw reply

* [PATCH 4/5 v2] kernel handling of memory DLPAR
From: Nathan Fontenot @ 2009-09-18 15:03 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel
In-Reply-To: <4AB39FB3.1020608@austin.ibm.com>

This adds the capability to DLPAR add and remove memory from the kernel.  The
patch extends the powerpc handling of memory_add_physaddr_to_nid(), which is
called from the sysfs memory 'probe' file to first ensure that the memory
has been added to the system.  This is done by creating a platform specific
callout from the routine.  The pseries implementation of this handles the
DLPAR work to add the memory to the system and update the device tree.

The patch also creates a pseries only 'release' sys file,
/sys/devices/system/memory/release.  This file handles the DLPAR release of
memory back to firmware and updating of the device-tree.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: powerpc/arch/powerpc/platforms/pseries/dlpar.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/dlpar.c	2009-09-17 11:32:22.000000000 -0500
+++ powerpc/arch/powerpc/platforms/pseries/dlpar.c	2009-09-17 11:33:00.000000000 -0500
@@ -16,6 +16,10 @@
 #include <linux/notifier.h>
 #include <linux/proc_fs.h>
 #include <linux/spinlock.h>
+#include <linux/memory_hotplug.h>
+#include <linux/sysdev.h>
+#include <linux/sysfs.h>
+
 
 #include <asm/prom.h>
 #include <asm/machdep.h>
@@ -406,11 +410,163 @@
 	return 0;
 }
 
+static struct property *clone_property(struct property *old_prop)
+{
+	struct property *new_prop;
+
+	new_prop = kzalloc((sizeof *new_prop), GFP_KERNEL);
+	if (!new_prop)
+		return NULL;
+
+	new_prop->name = kzalloc(strlen(old_prop->name) + 1, GFP_KERNEL);
+	new_prop->value = kzalloc(old_prop->length + 1, GFP_KERNEL);
+	if (!new_prop->name || !new_prop->value) {
+		free_property(new_prop);
+		return NULL;
+	}
+
+	strcpy(new_prop->name, old_prop->name);
+	memcpy(new_prop->value, old_prop->value, old_prop->length);
+	new_prop->length = old_prop->length;
+
+	return new_prop;
+}
+
+int platform_probe_memory(u64 phys_addr)
+{
+	struct device_node *dn;
+	struct property *new_prop, *old_prop;
+	struct property *lmb_sz_prop;
+	struct of_drconf_cell *drmem;
+	u64 lmb_size;
+	int num_entries, i, rc;
+
+	if (!phys_addr)
+		return -EINVAL;
+
+	dn = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
+	if (!dn)
+		return -EINVAL;
+
+	lmb_sz_prop = of_find_property(dn, "ibm,lmb-size", NULL);
+	lmb_size = *(u64 *)lmb_sz_prop->value;
+
+	old_prop = of_find_property(dn, "ibm,dynamic-memory", NULL);
+
+	num_entries = *(u32 *)old_prop->value;
+	drmem = (struct of_drconf_cell *)
+				((char *)old_prop->value + sizeof(u32));
+
+	for (i = 0; i < num_entries; i++) {
+		u64 lmb_end_addr = drmem[i].base_addr + lmb_size;
+		if (phys_addr >= drmem[i].base_addr
+		    && phys_addr < lmb_end_addr)
+			break;
+	}
+
+	if (i >= num_entries) {
+		of_node_put(dn);
+		return -EINVAL;
+	}
+
+	if (drmem[i].flags & DRCONF_MEM_ASSIGNED) {
+		of_node_put(dn);
+		return 0;
+	}
+
+	rc = acquire_drc(drmem[i].drc_index);
+	if (rc) {
+		of_node_put(dn);
+		return -1;
+	}
+
+	new_prop = clone_property(old_prop);
+	drmem = (struct of_drconf_cell *)
+				((char *)new_prop->value + sizeof(u32));
+
+	drmem[i].flags |= DRCONF_MEM_ASSIGNED;
+	prom_update_property(dn, new_prop, old_prop);
+
+	rc = blocking_notifier_call_chain(&pSeries_reconfig_chain,
+					  PSERIES_DRCONF_MEM_ADD,
+					  &drmem[i].base_addr);
+	if (rc == NOTIFY_BAD) {
+		prom_update_property(dn, old_prop, new_prop);
+		release_drc(drmem[i].drc_index);
+	}
+
+	of_node_put(dn);
+	return rc == NOTIFY_BAD ? -1 : 0;
+}
+
+static ssize_t memory_release_store(struct class *class, const char *buf,
+				    size_t count)
+{
+	unsigned long drc_index;
+	struct device_node *dn;
+	struct property *new_prop, *old_prop;
+	struct of_drconf_cell *drmem;
+	int num_entries;
+	int i, rc;
+
+	rc = strict_strtoul(buf, 0, &drc_index);
+	if (rc)
+		return -EINVAL;
+
+	dn = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
+	if (!dn)
+		return 0;
+
+	old_prop = of_find_property(dn, "ibm,dynamic-memory", NULL);
+	new_prop = clone_property(old_prop);
+
+	num_entries = *(u32 *)new_prop->value;
+	drmem = (struct of_drconf_cell *)
+				((char *)new_prop->value + sizeof(u32));
+
+	for (i = 0; i < num_entries; i++) {
+		if (drmem[i].drc_index == drc_index)
+			break;
+	}
+
+	if (i >= num_entries) {
+		free_property(new_prop);
+		of_node_put(dn);
+		return -EINVAL;
+	}
+
+	drmem[i].flags &= ~DRCONF_MEM_ASSIGNED;
+	prom_update_property(dn, new_prop, old_prop);
+
+	rc = blocking_notifier_call_chain(&pSeries_reconfig_chain,
+					  PSERIES_DRCONF_MEM_REMOVE,
+					  &drmem[i].base_addr);
+	if (rc != NOTIFY_BAD)
+		rc = release_drc(drc_index);
+
+	if (rc)
+		prom_update_property(dn, old_prop, new_prop);
+
+	of_node_put(dn);
+	return rc ? -1 : count;
+}
+
+static struct class_attribute class_attr_mem_release =
+			__ATTR(release, S_IWUSR, NULL, memory_release_store);
+
 static int pseries_dlpar_init(void)
 {
+	int rc;
+
 	if (!machine_is(pseries))
 		return 0;
 
+	rc = sysfs_create_file(&memory_sysdev_class.kset.kobj,
+			       &class_attr_mem_release.attr);
+	if (rc)
+		printk(KERN_INFO "DLPAR: Could not create sysfs memory "
+		       "release file\n");
+
 	return 0;
 }
 device_initcall(pseries_dlpar_init);
Index: powerpc/arch/powerpc/mm/mem.c
===================================================================
--- powerpc.orig/arch/powerpc/mm/mem.c	2009-09-17 11:17:57.000000000 -0500
+++ powerpc/arch/powerpc/mm/mem.c	2009-09-17 11:33:00.000000000 -0500
@@ -111,8 +111,19 @@
 #ifdef CONFIG_MEMORY_HOTPLUG
 
 #ifdef CONFIG_NUMA
+int __attribute ((weak)) platform_probe_memory(u64 start)
+{
+	return 0;
+}
+
 int memory_add_physaddr_to_nid(u64 start)
 {
+	int rc;
+
+	rc = platform_probe_memory(start);
+	if (rc)
+		return rc;
+
 	return hot_add_scn_to_nid(start);
 }
 #endif

^ permalink raw reply

* [PATCH 5/5 v2] kernel handling of CPU DLPAR
From: Nathan Fontenot @ 2009-09-18 15:04 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel
In-Reply-To: <4AB39FB3.1020608@austin.ibm.com>

This adds the capability to DLPAR add and remove CPUs from the kernel. The
creates two new files /sys/devices/system/cpu/probe and
/sys/devices/system/cpu/release to handle the DLPAR addition and removal of
CPUs respectively.

CPU DLPAR add is accomplished by writing the drc-index of the CPU to the
probe file, and removal is done by writing the device-tree path of the cpu
to the release file.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: powerpc/arch/powerpc/platforms/pseries/dlpar.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/dlpar.c	2009-09-17 11:33:00.000000000 -0500
+++ powerpc/arch/powerpc/platforms/pseries/dlpar.c	2009-09-17 11:33:06.000000000 -0500
@@ -1,11 +1,11 @@
 /*
- * dlpar.c - support for dynamic reconfiguration (including PCI
- * Hotplug and Dynamic Logical Partitioning on RPA platforms).
+ * dlpar.c - support for dynamic reconfiguration (including PCI,
+ * Memory, and CPU Hotplug and Dynamic Logical Partitioning on
+ * PAPR platforms).
  *
  * Copyright (C) 2009 Nathan Fontenot
  * Copyright (C) 2009 IBM Corporation
  *
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License version
  * 2 as published by the Free Software Foundation.
@@ -19,6 +19,7 @@
 #include <linux/memory_hotplug.h>
 #include <linux/sysdev.h>
 #include <linux/sysfs.h>
+#include <linux/cpu.h>
 
 
 #include <asm/prom.h>
@@ -551,8 +552,85 @@
 	return rc ? -1 : count;
 }
 
+static ssize_t cpu_probe_store(struct class *class, const char *buf,
+			       size_t count)
+{
+	struct device_node *dn;
+	unsigned long drc_index;
+	char *cpu_name;
+	int rc;
+
+	rc = strict_strtoul(buf, 0, &drc_index);
+	if (rc)
+		return -EINVAL;
+
+	rc = acquire_drc(drc_index);
+	if (rc)
+		return rc;
+
+	dn = configure_connector(drc_index);
+	if (!dn) {
+		release_drc(drc_index);
+		return rc;
+	}
+
+	/* fixup dn name */
+	cpu_name = kzalloc(strlen(dn->full_name) + strlen("/cpus/") + 1,
+			   GFP_KERNEL);
+	if (!cpu_name) {
+		free_cc_nodes(dn);
+		release_drc(drc_index);
+		return -ENOMEM;
+	}
+
+	sprintf(cpu_name, "/cpus/%s", dn->full_name);
+	kfree(dn->full_name);
+	dn->full_name = cpu_name;
+
+	rc = add_device_tree_nodes(dn);
+	if (rc)
+		release_drc(drc_index);
+
+	return rc ? rc : count;
+}
+
+static ssize_t cpu_release_store(struct class *class, const char *buf,
+				 size_t count)
+{
+	struct device_node *dn;
+	u32 *drc_index;
+	int rc;
+
+	dn = of_find_node_by_path(buf);
+	if (!dn)
+		return -EINVAL;
+
+	drc_index = (u32 *)of_get_property(dn, "ibm,my-drc-index", NULL);
+	if (!drc_index) {
+		of_node_put(dn);
+		return -EINVAL;
+	}
+
+	rc = release_drc(*drc_index);
+	if (rc) {
+		of_node_put(dn);
+		return rc;
+	}
+
+	rc = remove_device_tree_nodes(dn);
+	if (rc)
+		acquire_drc(*drc_index);
+
+	of_node_put(dn);
+	return rc ? rc : count;
+}
+
 static struct class_attribute class_attr_mem_release =
 			__ATTR(release, S_IWUSR, NULL, memory_release_store);
+static struct class_attribute class_attr_cpu_probe =
+			__ATTR(probe, S_IWUSR, NULL, cpu_probe_store);
+static struct class_attribute class_attr_cpu_release =
+			__ATTR(release, S_IWUSR, NULL, cpu_release_store);
 
 static int pseries_dlpar_init(void)
 {
@@ -567,6 +645,18 @@
 		printk(KERN_INFO "DLPAR: Could not create sysfs memory "
 		       "release file\n");
 
+	rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
+			       &class_attr_cpu_probe.attr);
+	if (rc)
+		printk(KERN_INFO "DLPAR: Could not create sysfs cpu "
+		       "probe file\n");
+
+	rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
+			       &class_attr_cpu_release.attr);
+	if (rc)
+		printk(KERN_INFO "DLPAR: Could not create sysfs cpu "
+		       "release file\n");
+
 	return 0;
 }
 device_initcall(pseries_dlpar_init);

^ permalink raw reply

* Powerpc Kernel 2.6.26.5 boot panic when call cfi_probe_chip()
From: g r1x @ 2009-09-18 15:37 UTC (permalink / raw)
  To: linuxppc-dev

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

I'm working on a 440GX demo board with a flash chip s29gl256p(128k sector
size, 32M total, CFI). I have tried 2 ways to add mtd partiton to the
kernel, but failed with kernel panic. (kernel version: 2.6.26.5)
1. device tree, based on taishan board's dts.
 /dts-v1/;

/ {
#address-cells = <2>;
#size-cells = <1>;
model = "amcc,cerberus";
compatible = "amcc,cerberus";
dcr-parent = <&{/cpus/cpu@0}>;

aliases {
ethernet0 = &EMAC2;
ethernet1 = &EMAC3;
serial0 = &UART0;
serial1 = &UART1;
};

cpus {
#address-cells = <1>;
#size-cells = <0>;

cpu@0 {
device_type = "cpu";
model = "PowerPC,440GX";
reg = <0x00000000>;
clock-frequency = <0x1DCD6500>; // 500MHz, 2FAF0800 800MHz
timebase-frequency = <0>; // Fix Me
i-cache-line-size = <0x32>;
d-cache-line-size = <0x32>;
i-cache-size = <0x8000>; /* 32 kB */
d-cache-size = <0x8000>; /* 32 kB */
dcr-controller;
dcr-access-method = "native";
};
};

memory {
device_type = "memory";
reg = <0x00000000 0x00000000 0x10000000>; // Fix me
};


UICB0: interrupt-controller-base {
compatible = "ibm,uic-440gx", "ibm,uic";
interrupt-controller;
cell-index = <0x3>;
dcr-reg = <0x200 0x009>;
#address-cells = <0>;
#size-cells = <0>;
#interrupt-cells = <0x2>;
};


UIC0: interrupt-controller0 {
compatible = "ibm,uic-440gx", "ibm,uic";
interrupt-controller;
cell-index = <0>;
dcr-reg = <0x0c0 0x009>;
#address-cells = <0>;
#size-cells = <0>;
#interrupt-cells = <2>;
interrupts = <0x1 0x4 0x0 0x4>; /* cascade - first non-critical */
interrupt-parent = <&UICB0>;

};

UIC1: interrupt-controller1 {
compatible = "ibm,uic-440gx", "ibm,uic";
interrupt-controller;
cell-index = <1>;
dcr-reg = <0x0d0 0x009>;
#address-cells = <0>;
#size-cells = <0>;
#interrupt-cells = <2>;
interrupts = <0x3 0x4 0x2 0x4>; /* cascade */
interrupt-parent = <&UICB0>;
};

UIC2: interrupt-controller2 {
compatible = "ibm,uic-440gx", "ibm,uic";
interrupt-controller;
cell-index = <2>; /* was 1 */
dcr-reg = <0x210 0x009>;
#address-cells = <0>;
#size-cells = <0>;
#interrupt-cells = <2>;
interrupts = <0x5 0x4 0x4 0x4>; /* cascade */
interrupt-parent = <&UICB0>;
};


CPC0: cpc {
compatible = "ibm,cpc-440gp";
dcr-reg = <0x0b0 0x003 0x0e0 0x010>;
// FIXME: anything else?
};

L2C0: l2c {
compatible = "ibm,l2-cache-440gx", "ibm,l2-cache";
dcr-reg = <0x020 0x008 /* Internal SRAM DCR's */
   0x030 0x008>; /* L2 cache DCR's */
cache-line-size = <0x20>; /* 32 bytes */
cache-size = <0x40000>; /* L2, 256K */
interrupt-parent = <&UIC2>;
interrupts = <0x17 0x1>;
};

plb {
compatible = "ibm,plb-440gx", "ibm,plb4";
#address-cells = <2>;
#size-cells = <1>;
ranges;
clock-frequency = <0x9896800>; // 160MHz, fixed me

SDRAM0: memory-controller {
compatible = "ibm,sdram-440gp";
dcr-reg = <0x010 0x002>;
// FIXME: anything else?
};

SRAM0: sram {
compatible = "ibm,sram-440gp";
dcr-reg = <0x020 0x008 0x00a 0x001>;
};

DMA0: dma {
// FIXME: ???
compatible = "ibm,dma-440gp";
dcr-reg = <0x100 0x027>;
};

MAL0: mcmal {
compatible = "ibm,mcmal-440gx", "ibm,mcmal2";
dcr-reg = <0x180 0x062>;
num-tx-chans = <4>;
num-rx-chans = <4>;
interrupt-parent = <&MAL0>;
interrupts = <0x0 0x1 0x2 0x3 0x4>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4
   /*RXEOB*/ 0x1 &UIC0 0xb 0x4
 /*SERR*/  0x2 &UIC1 0x0 0x4
 /*TXDE*/  0x3 &UIC1 0x1 0x4
 /*RXDE*/  0x4 &UIC1 0x2 0x4>;
interrupt-map-mask = <0xffffffff>;
};

PCIDMA: pci_dma {
compatible = "ibm,pci_dma_440gx","ibm,pci_dma";
interrupt-parent = <&PCIDMA>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
interrupts = <0x0 0x1 0x2 0x3>;
interrupt-map = < /* PCI MSG IN  */ 0x0 &UIC0 0x4  0x4
                  /* DMAChannel0 */ 0x1 &UIC0 0xc  0x4
  /* DMAChannel1 */ 0x2 &UIC0 0xd  0x4
  /* IRQ5        */ 0x3 &UIC0 0x1c 0x3>;
interrupt-map-mask = <0xffffffff>;
};

POB0: opb {
compatible = "ibm,opb-440gx", "ibm,opb";
#address-cells = <1>;
#size-cells = <1>;
/* Wish there was a nicer way of specifying a full 32-bit
   range */
ranges = <0x00000000 0x00000001 0x00000000 0x80000000
     0x80000000 0x00000001 0x80000000 0x80000000>;
dcr-reg = <0x090 0x00b>;
interrupt-parent = <&UIC1>;
interrupts = <0x7 0x4>;
clock-frequency = <0x4C4B400>; // 80MHz


EBC0: ebc {
compatible = "ibm,ebc-440gx", "ibm,ebc";
dcr-reg = <0x012 0x002>;
#address-cells = <2>;
#size-cells = <1>;
clock-frequency = <0x4C4B400>; // 80MHz

/* ranges property is supplied by zImage
 * based on firmware's configuration of the
 * EBC bridge */

interrupts = <0x5 0x4>;
interrupt-parent = <&UIC1>;

nor_flash@0,0 {
compatible = "cfi-flash";
bank-width = <2>;
device-width = <1>;
#address-cells = <1>;
#size-cells = <1>;
reg = <0x0 0x0 0x2000000>;
partition@0 {
label = "user";
reg = <0x0 0x1000000>;
};
partition@1000000 {
label = "root";
reg = <0x1000000 0xB00000>;
};
partition@1B00000 {
label = "kernel";
reg = <0x1B00000 0x480000>;
};
partition@1F80000 {
label = "fdt";
reg = <0x1F80000 0x20000>;
};
partition@1FA0000 {
label = "env";
reg = <0x1FA0000 0x20000>;
};
partition@1FC0000 {
label = "u-boot";
reg = <0x1fc0000 0x40000>;
};
};

};



UART0: serial@40000200 {
device_type = "serial";
compatible = "ns16550";
reg = <0x40000200 0x00000008>;
virtual-reg = <0xe0000200>;
  clock-frequency = <0xA8C000>;
current-speed = <0x1C200>; /* 115200 */
interrupt-parent = <&UIC0>;
interrupts = <0x0 0x4>;
};

UART1: serial@40000300 {
device_type = "serial";
compatible = "ns16550";
reg = <0x40000300 0x00000008>;
virtual-reg = <0xe0000300>;
clock-frequency = <0xA8C000>;
current-speed = <0x1C200>; /* 115200 */
interrupt-parent = <&UIC0>;
interrupts = <0x1 0x4>;
};

IIC0: i2c@40000400 {
/* FIXME */
compatible = "ibm,iic-440gp", "ibm,iic";
reg = <0x40000400 0x00000014>;
interrupt-parent = <&UIC0>;
interrupts = <0x2 0x4>;
index = <0>;
/* clock-frequency = <0x186a0>; */
};
IIC1: i2c@40000500 {
/* FIXME */
compatible = "ibm,iic-440gp", "ibm,iic";
reg = <0x40000500 0x00000014>;
interrupt-parent = <&UIC0>;
interrupts = <0x3 0x4>;
index = <1>;
#address-cells = <0x1>;
#size-cells = <0>;
rtc@68 {
compatible = "dallas,ds1338";
reg = <0x68>;
};
};

GPIO0: gpio@40000700 {
/* FIXME */
compatible = "ibm,gpio-440gp";
reg = <0x40000700 0x00000020>;
};

ZMII0: emac-zmii@40000780 {
compatible = "ibm,zmii-440gx", "ibm,zmii";
reg = <0x40000780 0x0000000c>;
};

RGMII0: emac-rgmii@40000790 {
compatible = "ibm,rgmii";
reg = <0x40000790 0x00000008>;
};

TAH0: emac-tah@40000b50 {
compatible = "ibm,tah-440gx", "ibm,tah";
reg = <0x40000b50 0x00000030>;
};

TAH1: emac-tah@40000d50 {
compatible = "ibm,tah-440gx", "ibm,tah";
reg = <0x40000d50 0x00000030>;
};

EMAC0: ethernet@40000800 {
unused = <0x1>;
device_type = "network";
compatible = "ibm,emac-440gx", "ibm,emac4";
interrupt-parent = <&UIC1>;
interrupts = <0x1c 0x4 0x1d 0x4>;
reg = <0x40000800 0x00000074>;
local-mac-address = [000000000000]; // Fill me
mal-device = <&MAL0>;
mal-tx-channel = <0>;
mal-rx-channel = <0>;
cell-index = <0>;
max-frame-size = <0x5DC>;
rx-fifo-size = <0x1000>;
tx-fifo-size = <0x800>;
phy-mode = "rmii";
phy-map = <0x00000004>;
zmii-device = <&ZMII0>;
zmii-channel = <0>;
};

 EMAC1: ethernet@40000900 {
unused = <0x1>;
device_type = "network";
compatible = "ibm,emac-440gx", "ibm,emac4";
interrupt-parent = <&UIC1>;
interrupts = <0x1e 0x4 0x1f 0x4>;
reg = <0x40000900 0x00000074>;
local-mac-address = [000000000000]; // Fill me
mal-device = <&MAL0>;
mal-tx-channel = <1>;
mal-rx-channel = <1>;
cell-index = <1>;
max-frame-size = <0x5DC>;
rx-fifo-size = <0x1000>;
tx-fifo-size = <0x800>;
phy-mode = "rmii";
phy-map = <0x00000003>;
  zmii-device = <&ZMII0>;
zmii-channel = <1>;
};

 EMAC2: ethernet@40000c00 {
// unused = <0x1>;
device_type = "network";
compatible = "ibm,emac-440gx", "ibm,emac4";
interrupt-parent = <&UIC2>;
interrupts = <0x0 0x4 0x1 0x4>;
reg = <0x40000c00 0x00000074>;
local-mac-address = [000000000000]; // Fill me
mal-device = <&MAL0>;
mal-tx-channel = <2>;
mal-rx-channel = <2>;
cell-index = <2>;
max-frame-size = <0x2328>;
rx-fifo-size = <0x1000>;
tx-fifo-size = <0x800>;
phy-mode = "rgmii";
phy-map = <0x00000002>;
rgmii-device = <&RGMII0>;
rgmii-channel = <0>;
  zmii-device = <&ZMII0>;
zmii-channel = <2>;
tah-device = <&TAH0>;
tah-channel = <0>;
};

 EMAC3: ethernet@40000e00 {
device_type = "network";
compatible = "ibm,emac-440gx", "ibm,emac4";
interrupt-parent = <&UIC2>;
interrupts = <0x2 0x4 0x3 0x4>;
reg = <0x40000e00 0x00000074>;
local-mac-address = [000000000000]; // Fill me
mal-device = <&MAL0>;
mal-tx-channel = <3>;
mal-rx-channel = <3>;
cell-index = <3>;
max-frame-size = <0x2328>;
rx-fifo-size = <0x1000>;
tx-fifo-size = <0x800>;
phy-mode = "rgmii";
phy-map = <0x00000001>;
rgmii-device = <&RGMII0>;
rgmii-channel = <1>;
  zmii-device = <&ZMII0>;
zmii-channel = <3>;
tah-device = <&TAH1>;
tah-channel = <0>;
};


GPT0: gpt@40000a00 {
/* FIXME */
reg = <0x40000a00 0x000000d4>;
interrupt-parent = <&UIC0>;
interrupts = <0x12 0x4 0x13 0x4 0x14 0x4 0x15 0x4 0x16 0x4>;
};

};

PCIX0: pci@20ec00000 {
device_type = "pci";
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
compatible = "ibm,plb440gp-pcix", "ibm,plb-pcix";
primary;
large-inbound-windows;
enable-msi-hole;
reg = <0x00000002 0x0ec00000 0x00000008 /* Config space access */
       0x00000000 0x00000000 0x00000000 /* no IACK cycles */
       0x00000002 0x0ed00000 0x00000004   /* Special cycles */
       0x00000002 0x0ec80000 0x00000100 /* Internal registers */
       0x00000002 0x0ec80100 0x000000fc>; /* Internal messaging registers */

/* Outbound ranges, one memory and one IO,
 * later cannot be changed
 */
 /*     Type          PCIAddr          PLBAddr          Size
  *   PCI Memory      0x80000000      0x380000000        2GB
  *       I/O         0x0             0x208000000        64KB
  */
ranges = <0x02000000 0x00000000 0x80000000 0x00000003 0x80000000 0x00000000
0x80000000
     0x01000000 0x00000000 0x00000000 0x00000002 0x08000000 0x00000000
0x00010000>;

/* Inbound 2GB range starting at 0 */
          /*     Type          PCIAddr          PLBAddr          Size
  *   PCI Memory         0x0              0x0            2GB
  *  (prefetchable)  (Fixed in linux?)
  */
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;

interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
interrupt-map = <
/* IDSEL 1 */
0x0800 0x0 0x0 0x1 &UIC0 0x17 0x8
0x0800 0x0 0x0 0x2 &UIC0 0x18 0x8
0x0800 0x0 0x0 0x3 &UIC0 0x19 0x8
0x0800 0x0 0x0 0x4 &UIC0 0x1a 0x8

/* IDSEL 2 */
0x1000 0x0 0x0 0x1 &UIC0 0x18 0x8
0x1000 0x0 0x0 0x2 &UIC0 0x19 0x8
0x1000 0x0 0x0 0x3 &UIC0 0x1a 0x8
0x1000 0x0 0x0 0x4 &UIC0 0x17 0x8
>;
};


};
When kernel boots, panic happens

2. As I doubt error exists in dts, so I add a mtd map driver for the board
instead, but kernel boots panic all the same
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#define CFG_FLASH_BUS_WIDTH     2
#define CFG_FLASH_SIZE          0x2000000       /* Bytes */
#define CFG_FLASH_ADDR          0x1FE000000ULL

#define FLASH_MSG_PREFIX        "S29GL-NOR:"
#define MTD_ID                  "s29gl-nor"


struct map_info s29gl_map = {
        .name = "Nor Flash on Cerberus",
        .size = CFG_FLASH_SIZE,
        .bankwidth = CFG_FLASH_BUS_WIDTH,
};


static struct mtd_partition cerberus_partition[] = {
        {
         .name = "user",
         .offset = 0x0,
         .size = 0x1000000,
         },
        {
         .name = "root",
         .offset = 0x1000000,
         .size = 0xB00000,
         },
        {
         .name = "kernel",
         .offset = 0x1B00000,
         .size = 0x480000,
         },
        {
         .name = "fdt",
         .offset = 0x1F80000,
         .size = 0x20000,
         },
        {
         .name = "env",
         .offset = 0x1FA0000,
         .size = 0x20000,
         },
        {
         .name = "u-boot",
         .offset = 0x1FC0000,
         .size = 0x40000,
        }
};


static struct mtd_info *s29gl_mtd_info;
static struct mtd_partition *mtd_parts = 0;

int __init s29gl_init(void)
{
        phys_addr_t flash_base = CFG_FLASH_ADDR;
        printk(KERN_NOTICE FLASH_MSG_PREFIX "0x%08x at 0x%llx\n",
               CFG_FLASH_SIZE,CFG_FLASH_ADDR);
        s29gl_map.phys = flash_base;
        s29gl_map.virt=ioremap(CFG_FLASH_ADDR,CFG_FLASH_SIZE);
        if (!s29gl_map.virt){
                printk(KERN_ERR FLASH_MSG_PREFIX"failed to ioremap\n");
                return -EIO;
        }
        simple_map_init(&s29gl_map);
        s29gl_mtd_info = do_map_probe("cfi_probe",&s29gl_map);
        if (s29gl_mtd_info){
                s29gl_mtd_info->owner=THIS_MODULE;
                add_mtd_partitions(s29gl_mtd_info,cerberus_partition,
                                   ARRAY_SIZE(cerberus_partition));
        } else {
                printk(KERN_ERR FLASH_MSG_PREFIX"Map probe failed\n");
                iounmap((void*)s29gl_map.virt);
                s29gl_map.virt=0;
        }
}

static void __exit s29gl_exit(void)
{
        if(s29gl_mtd_info){
                del_mtd_partitions(s29gl_mtd_info);
                map_destroy(s29gl_mtd_info);
        }
        if(s29gl_map.virt){
                iounmap((void*)s29gl_map.virt);
                s29gl_map.virt=0;
        }
}

module_init(s29gl_init);
module_exit(s29gl_exit);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("MTD map and partition for 440GX boards");

---------------------kernel panic log------------------
/plb/opb/emac-rgmii@40000790: input 0 in RGMII mode
eth0: EMAC-2 /plb/opb/ethernet@40000c00, MAC 00:22:33:44:55:66
eth0: found Generic MII PHY (0x00)
/plb/opb/emac-rgmii@40000790: input 1 in RGMII mode
eth1: EMAC-3 /plb/opb/ethernet@40000e00, MAC 00:33:44:55:66:77
eth1: found Marvell 88E1111 Ethernet PHY (0x03)
S29GL-NOR:0x02000000 at 0x1fe000000
HERE1
Machine check in kernel mode.
Data Write PLB Error
Oops: Machine check, sig: 7 [#1]
Cerberus
Modules linked in:
NIP: c01943f8 LR: c018e5c8 CTR: c01943a0
REGS: c02daf50 TRAP: 0214   Not tainted  (2.6.26.5)
MSR: 00029000 <EE,ME>  CR: 42344a22  XER: 00000000
TASK = cf828000[1] 'swapper' THREAD: cf82c000
GPR00: 0000f0f0 cf82de50 cf828000 c02cd1a0 cf82de58 00000000 cf82de98 000000
GPR08: 00000000 d1180000 00000002 00000001 82344a22 40350100 c0256850 c02568
GPR16: c0256828 c0256810 cf82df98 c02b5de0 c02b0000 00000000 cf82de58 c02b00
GPR24: cf82df58 c02b5d7c 00000000 c02cd1a0 cf82de98 00000000 c02ccd1c c02cd1
NIP [c01943f8] simple_map_write+0x58/0x60
LR [c018e5c8] cfi_probe_chip+0xcc/0xeb4
Call Trace:
[cf82de50] [c001d5b4] printk+0x50/0x60 (unreliable)
[cf82de90] [c019404c] mtd_do_chip_probe+0xa4/0x3ac
[cf82df00] [c018e4ec] cfi_probe+0x1c/0x2c
[cf82df10] [c018e25c] do_map_probe+0x34/0x90
[cf82df30] [c02ac28c] s29gl_init+0x74/0xf0
[cf82df50] [c02971b0] kernel_init+0xa8/0x28c
[cf82dff0] [c000c3dc] kernel_thread+0x44/0x60
Instruction dump:
81230010 7c05492e 7c0004ac 4e800020 81230010 5400063e 7c0549ae 7c0004ac
4e800020 81230010 5400043e 7c054b2e <7c0004ac> 4e800020 81230018 2b890004
---[ end trace 5fac80aef6224e66 ]---
Kernel panic - not syncing: Attempted to kill init!
Rebooting in 180 seconds..

The above panic log prints "HERE1" 'cause I changed mtd_do_chip_probe() as
follows.
struct mtd_info *mtd_do_chip_probe(struct map_info *map, struct chip_probe
*cp)
{
        struct mtd_info *mtd = NULL;
        struct cfi_private *cfi;
        printk(KERN_WARNING "HERE1\n");
        /* First probe the map to see if we have CFI stuff there. */
        cfi = genprobe_ident_chips(map, cp);
        printk(KERN_WARNING "HERE2\n");

        if (!cfi)
                return NULL;
        printk(KERN_WARNING "HERE3\n");

        map->fldrv_priv = cfi;
        /* OK we liked it. Now find a driver for the command set it talks */

        mtd = check_cmd_set(map, 1); /* First the primary cmdset */
        printk(KERN_WARNING "HERE4\n");

        if (!mtd){
                mtd = check_cmd_set(map, 0); /* Then the secondary */
                printk(KERN_WARNING "HERE5\n");
        }
        if (mtd) {
                if (mtd->size > map->size) {
                        printk(KERN_WARNING "Reducing visibility of %ldKiB
chip to %ldKiB\n",
                               (unsigned long)mtd->size >> 10,
                               (unsigned long)map->size >> 10);
                        mtd->size = map->size;
                }
        printk(KERN_WARNING "HERE6\n");

                return mtd;
        }

        printk(KERN_WARNING"gen_probe: No supported Vendor Command Set
found\n");

        kfree(cfi->cfiq);
        kfree(cfi);
        map->fldrv_priv = NULL;
        return NULL;
}
EXPORT_SYMBOL(mtd_do_chip_probe)

---------------------------------
Follow is my .config
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.25-rc2
# Fri Feb 15 21:40:44 2008
#
# CONFIG_PPC64 is not set

#
# Processor support
#
# CONFIG_6xx is not set
# CONFIG_PPC_85xx is not set
# CONFIG_PPC_8xx is not set
# CONFIG_40x is not set
CONFIG_44x=y
# CONFIG_E200 is not set
CONFIG_4xx=y
CONFIG_BOOKE=y
CONFIG_PTE_64BIT=y
CONFIG_PHYS_64BIT=y
# CONFIG_PPC_MM_SLICES is not set
CONFIG_NOT_COHERENT_CACHE=y
CONFIG_PPC32=y
CONFIG_WORD_SIZE=32
CONFIG_PPC_MERGE=y
CONFIG_MMU=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_HARDIRQS=y
# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
CONFIG_IRQ_PER_CPU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_ILOG2_U32=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
CONFIG_PPC=y
CONFIG_EARLY_PRINTK=y
CONFIG_GENERIC_NVRAM=y
CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_PPC_OF=y
CONFIG_OF=y
CONFIG_PPC_UDBG_16550=y
# CONFIG_GENERIC_TBSYNC is not set
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
# CONFIG_DEFAULT_UIMAGE is not set
CONFIG_PPC_DCR_NATIVE=y
# CONFIG_PPC_DCR_MMIO is not set
CONFIG_PPC_DCR=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_AUDIT is not set
CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_CGROUPS is not set
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_USER_SCHED=y
# CONFIG_CGROUP_SCHED is not set
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_RELAY is not set
# CONFIG_NAMESPACES is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_COMPAT_BRK=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
# CONFIG_MARKERS is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
CONFIG_HAVE_KPROBES=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y
CONFIG_BLOCK=y
CONFIG_LBD=y
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_LSF is not set
# CONFIG_BLK_DEV_BSG is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_DEADLINE is not set
# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="anticipatory"
CONFIG_CLASSIC_RCU=y
# CONFIG_PREEMPT_RCU is not set
# CONFIG_PPC4xx_PCI_EXPRESS is not set

#
# Platform support
#
# CONFIG_PPC_MPC512x is not set
# CONFIG_PPC_MPC5121 is not set
# CONFIG_PPC_CELL is not set
# CONFIG_PPC_CELL_NATIVE is not set
# CONFIG_PQ2ADS is not set
# CONFIG_BAMBOO is not set
# CONFIG_EBONY is not set
# CONFIG_SEQUOIA is not set
# CONFIG_GALAXY=y is not set
CONFIG_CERBERUS=y

# CONFIG_KATMAI is not set
# CONFIG_RAINIER is not set
# CONFIG_WARP is not set
CONFIG_440GX=y
# CONFIG_IPIC is not set
# CONFIG_MPIC is not set
# CONFIG_MPIC_WEIRD is not set
# CONFIG_PPC_I8259 is not set
# CONFIG_PPC_RTAS is not set
# CONFIG_MMIO_NVRAM is not set
# CONFIG_PPC_MPC106 is not set
# CONFIG_PPC_970_NAP is not set
# CONFIG_PPC_INDIRECT_IO is not set
# CONFIG_GENERIC_IOMAP is not set
# CONFIG_CPU_FREQ is not set
# CONFIG_FSL_ULI1575 is not set

#
# Kernel options
#
# CONFIG_HIGHMEM is not set
# CONFIG_TICK_ONESHOT is not set
# CONFIG_NO_HZ is not set
# CONFIG_HIGH_RES_TIMERS is not set
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
# CONFIG_SCHED_HRTICK is not set
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
CONFIG_RCU_TRACE=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_MATH_EMULATION is not set
# CONFIG_IOMMU_HELPER is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_HAS_WALK_MEMORY=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_PROC_DEVICETREE=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE=""
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y

#
# Bus options (PCI etc.)
#
# CONFIG_PCI is not set
# CONFIG_PCI_GOBIOS is not set
# CONFIG_PCI_GOMMCONFIG is not set
# CONFIG_PCI_GODIRECT is not set
# CONFIG_PCI_GOOLPC is not set
# CONFIG_PCI_GOANY is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
# CONFIG_ISA is not set
# CONFIG_MCA is not set
# CONFIG_SCx200 is not set
# CONFIG_OLPC is not set
# CONFIG_PCCARD is not set


#

# Advanced setup
#
# CONFIG_ADVANCED_OPTIONS is not set

#
# Default settings for advanced configuration options are used
#
CONFIG_HIGHMEM_START=0xfe000000
CONFIG_LOWMEM_SIZE=0x30000000
CONFIG_KERNEL_START=0xc0000000
CONFIG_TASK_SIZE=0xc0000000
CONFIG_CONSISTENT_START=0xff100000
CONFIG_CONSISTENT_SIZE=0x00200000
CONFIG_BOOT_LOAD=0x01000000

#
# Networking
#
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
CONFIG_SYN_COOKIES=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_LRO is not set
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
# CONFIG_NETWORK_SECMARK is not set
CONFIG_NETFILTER=y
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_SCHED is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set

#
# Wireless
#
# CONFIG_CFG80211 is not set
# CONFIG_WIRELESS_EXT is not set
# CONFIG_MAC80211 is not set
# CONFIG_IEEE80211 is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set

#
# Device Drivers
#
#Allow userspace driver core code to be built
CONFIG_UIO=y
#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y
CONFIG_MTD=y
CONFIG_MTD_JEDECPROB=y
CONFIG_MTD_CFI=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_OF_PARTS=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=3
# CONFIG_MTD_CERBERUS is not set
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_AMDSTD_RETRY=0
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_NOSWAP=y
CONFIG_MTD_COMPLEX_MAPPINGS=y

CONFIG_OF_DEVICE=y
# CONFIG_PARPORT is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SX8 is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=35000
# CONFIG_BLK_DEV_XIP is not set
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
# CONFIG_XILINX_SYSACE is not set
CONFIG_MISC_DEVICES=y
# CONFIG_PHANTOM is not set
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_SGI_IOC4 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HAVE_IDE
# CONFIG_IDE is not set

#
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
# CONFIG_SCSI is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SCSI_NETLINK is not set
# CONFIG_ATA is not set
# CONFIG_MD is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
# CONFIG_FIREWIRE is not set
# CONFIG_IEEE1394 is not set
# CONFIG_I2O is not set
# CONFIG_MACINTOSH_DRIVERS is not set
# CONFIG_MAC_EMUMOUSEBTN is not set
# CONFIG_WINDFARM is not set
CONFIG_NETDEVICES=y
# CONFIG_NETDEVICES_MULTIQUEUE is not set
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
# CONFIG_VETH is not set
# CONFIG_ARCNET is not set
CONFIG_PHYLIB=y
CONFIG_MARVELL_PHY=y
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_TULIP is not set
# CONFIG_HP100 is not set
CONFIG_IBM_NEW_EMAC=y
CONFIG_IBM_NEW_EMAC_RXB=128
CONFIG_IBM_NEW_EMAC_TXB=64
CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
# CONFIG_IBM_NEW_EMAC_DEBUG is not set
CONFIG_IBM_NEW_EMAC_ZMII=y
CONFIG_IBM_NEW_EMAC_RGMII=y
CONFIG_IBM_NEW_EMAC_TAH=y
CONFIG_IBM_NEW_EMAC_EMAC4=y
# CONFIG_NET_PCI is not set
# CONFIG_B44 is not set
CONFIG_NETDEV_1000=y
# CONFIG_ACENIC is not set
# CONFIG_DL2K is not set
# CONFIG_E1000 is not set
# CONFIG_E1000E is not set
# CONFIG_E1000E_ENABLED is not set
# CONFIG_IP1000 is not set
# CONFIG_IGB is not set
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SIS190 is not set
# CONFIG_SKGE is not set
# CONFIG_SKY2 is not set
# CONFIG_SK98LIN is not set
# CONFIG_VIA_VELOCITY is not set
# CONFIG_TIGON3 is not set
# CONFIG_BNX2 is not set
# CONFIG_QLA3XXX is not set
# CONFIG_ATL1 is not set
CONFIG_NETDEV_10000=y
# CONFIG_CHELSIO_T1 is not set
# CONFIG_CHELSIO_T3 is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGB is not set
# CONFIG_S2IO is not set
# CONFIG_MYRI10GE is not set
# CONFIG_NETXEN_NIC is not set
# CONFIG_NIU is not set
# CONFIG_MLX4_CORE is not set
# CONFIG_TEHUTI is not set
# CONFIG_BNX2X is not set
# CONFIG_TR is not set

#
# Wireless LAN
#
# CONFIG_WLAN_PRE80211 is not set
# CONFIG_WLAN_80211 is not set
# CONFIG_WAN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_ISDN is not set
# CONFIG_PHONE is not set

#
# Input device support
#
# CONFIG_INPUT is not set

#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
# CONFIG_VT is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_NOZOMI is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
# CONFIG_SERIAL_8250_PCI is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
# CONFIG_SERIAL_8250_MANY_PORTS is not set
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_RSA is not set
CONFIG_SERIAL_TEXT_DEBUG=y

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_NVRAM is not set
# CONFIG_GEN_RTC is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
CONFIG_DEVPORT=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_IBM_IIC=y
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_CHIP=y
CONFIG_I2C_DEBUG_BUS=y
#
# SPI support
#
# CONFIG_SPI is not set
# CONFIG_SPI_MASTER is not set
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
# CONFIG_WATCHDOG is not set

#
# Sonics Silicon Backplane
#
CONFIG_SSB_POSSIBLE=y
# CONFIG_SSB is not set

#
# Multifunction device drivers
#
# CONFIG_MFD_SM501 is not set

#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
# CONFIG_DVB_CORE is not set
# CONFIG_DAB is noet set

#
# Graphics support
#
# CONFIG_AGP is not set
# CONFIG_DRM is not set
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
# CONFIG_FB is not set
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set

#
# Display device support
#
# CONFIG_DISPLAY_SUPPORT is not set

#
# Sound
#
# CONFIG_SOUND is not set
# CONFIG_USB_SUPPORT is not set
# CONFIG_USB_ARCH_HAS_HCD is not set
# CONFIG_USB_ARCH_HAS_OHCI is not set
# CONFIG_USB_ARCH_HAS_EHCI is not set
# CONFIG_USB is not set

#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
#
# CONFIG_USB_GADGET is not set
# CONFIG_MMC is not set
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
# CONFIG_INFINIBAND is not set
# CONFIG_EDAC is not set
CONFIG_RTC_CLASS=y
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_RTC_DEBUG=y
CONFIG_RTC_DRV_TEST=y
CONFIG_RTC_DRV_PPC=y
#
# Userspace I/O
#
# CONFIG_UIO is not set

#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set
# CONFIG_EXT3_FS is not set
# CONFIG_EXT4DEV_FS is not set
# CONFIG_REISERFS_FS is not set
CONFIG_JFS_FS=y
# CONFIG_FS_POSIX_ACL is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
CONFIG_DNOTIFY=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_CONFIGFS_FS is not set

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
CONFIG_CRAMFS=y
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
# CONFIG_NFSD is not set
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_BIND34 is not set
# CONFIG_RPCSEC_GSS_KRB5 is not set
# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
CONFIG_CIFS=y
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
# CONFIG_NLS is not set
# CONFIG_DLM is not set

#
# Library routines
#
CONFIG_BITREVERSE=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_DMADEVICES=y

#
# Kernel hacking
#
CONFIG_PRINTK_TIME is not set
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
CONFIG_DETECT_SOFTLOCKUP=y
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set
# CONFIG_SLUB_DEBUG_ON is not set
# CONFIG_SLUB_STATS is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_SAMPLES is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_DEBUGGER=y
CONFIG_KGDB=y
CONFIG_KGDB_TTYS0=y
# CONFIG_KGDB is not set
# CONFIG_XMON is not set
CONFIG_VIRQ_DEBUG is not set
# CONFIG_BDI_SWITCH is not set
#CONFIG_PPC_EARLY_DEBUG=y
CONFIG_EARLY_PRINTK=y
#CONFIG_PPC_EARLY_DEBUG_44x=y
#CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0x40000200

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITY_FILE_CAPABILITIES is not set
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_BLKCIPHER=y
# CONFIG_CRYPTO_SEQIV is not set
CONFIG_CRYPTO_MANAGER=y
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_WP512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_GF128MUL is not set
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_PCBC=y
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_XTS is not set
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_CRYPTD is not set
CONFIG_CRYPTO_DES=y
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_ANUBIS is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_TEST is not set
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_LZO is not set
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_HIFN_795X is not set
# CONFIG_PPC_CLOCK is not set
CONFIG_SENSORS_EEPROM=y

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

^ permalink raw reply

* PPC_4xx synopsy USB driver
From: Cote, Sylvain @ 2009-09-18 15:50 UTC (permalink / raw)
  To: linuxppc-dev@lists.ozlabs.org

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

Hi,

I am trying the new USB dwc-otg Synopsys driver on my powerpc 405ex board.  I am using the kernel 2.6.30.3 from denx git (head 2.6.30 stable 2009-09-04 snapshot).  Previously I was using the USB driver from 2.6.25 kernel.  The driver was unstable and was only working when I enabled some debug prints.

I am moving to the new kernel to get improvement on that USB driver. However, I have some problems with it.  My problem is that probe function is never called (dwc_otg_driver_probe).  The driver init call is done and I can see the debug print "dwc_otg: version 2.60a 22-NOV-2006" but no more call (n.b. I enabled all debug print).  Initialisation is done in probe function, so, my usb dwc_otg controller is not initialized.  In theory, when module is inserted, init is called (dwc_otg_driver_init).  This init call, register the driver (platform_driver_register) and, in this registration, configured the probe function to call (dwc_otg_driver_probe).  But as I said, probe is never called.

First, in my setup, I want to use USB in host mode.

My usb-otg portion of my dts file is:

USBOTG0: usbotg@ef6c0000 {
                                    compatible = "amcc,usb-otg-405ex", "amcc,usb-otg";
                                    reg = <0xef6c0000 0x10000>;
                                    interrupt-parent = <&USBOTG0>;
                                    interrupts = <0 1 2>;
                                    #interrupt-cells = <1>;
                                    #address-cells = <0>;
                                    #size-cells = <0>;
                                    interrupt-map = </* USB-OTG */ 0 &UIC2 0x1e 4
                                                             /* HIGH-POWER */ 1 &UIC1 0x1a 8
                                                             /* DMA */ 2 &UIC0 0xc 4>;
                                    interrupt-map-mask = <0xffffffff>;
                        };

My USB potion of my kernel config (menuconfig)

Support for host-side USB -> y
USB announce new devices --> y
USB device filesystem --> y
USB device class-devices --> y
USB dynamic USB minor allocation --> y

USB mass storage support --> y

USB gadget support --> y
            Maximum VBUS power usage = 500
            Synopsys DWC OTG controller
            Synopsys DWC OTG internal DMA mode --> y
            USB gadget --> M
            gadget zero --> M
            Ethernet Gadget --> M
            RNDIS support --> y

Any help will be appreciated

Thank you,

Sylvain

This electronic message may contain proprietary and confidential information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or
entity(ies) named above.  If you are not the intended recipient (or authorized to receive this e-mail for the intended recipient), you may not use, copy, disclose or distribute to anyone this message or any information contained in this message.  If you have received this electronic message in error, please notify us by replying to this e-mail.
\r

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

^ permalink raw reply

* Re: Powerpc Kernel 2.6.26.5 boot panic when call cfi_probe_chip()
From: g r1x @ 2009-09-18 16:29 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <8abf57fa0909180837sc3864bcwb0cc2cb7b211c17d@mail.gmail.com>

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

2009/9/18 g r1x <gr1xmail@gmail.com>

> I'm working on a 440GX demo board with a flash chip s29gl256p(128k sector
> size, 32M total, CFI). I have tried 2 ways to add mtd partiton to the
> kernel, but failed with kernel panic. (kernel version: 2.6.26.5)
>
 S29GL256p is pin strapped as a 16bit width
so in dts, I wrote:
bank-width = <2>;
device-width = <1>;

In OF driver:
#define CFG_FLASH_BUS_WIDTH     2
struct map_info s29gl_map = {
        .name = "Nor Flash on Cerberus",
        .size = CFG_FLASH_SIZE,
        .bankwidth = CFG_FLASH_BUS_WIDTH,
};

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

^ permalink raw reply

* [patch 1/1] powerpc: Sky CPU: redundant or incorrect tests on unsigned
From: akpm @ 2009-09-18 19:46 UTC (permalink / raw)
  To: benh; +Cc: waite, roel.kluin, gorcunov, linuxppc-dev, galak, akpm

From: Roel Kluin <roel.kluin@gmail.com>

count is unsigned and cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Brian Waite <waite@skycomputers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/misc/hdpuftrs/hdpu_cpustate.c |    5 -----
 1 file changed, 5 deletions(-)

diff -puN drivers/misc/hdpuftrs/hdpu_cpustate.c~powerpc-sky-cpu-redundant-or-incorrect-tests-on-unsigned drivers/misc/hdpuftrs/hdpu_cpustate.c
--- a/drivers/misc/hdpuftrs/hdpu_cpustate.c~powerpc-sky-cpu-redundant-or-incorrect-tests-on-unsigned
+++ a/drivers/misc/hdpuftrs/hdpu_cpustate.c
@@ -121,8 +121,6 @@ static ssize_t cpustate_read(struct file
 {
 	unsigned char data;
 
-	if (count < 0)
-		return -EFAULT;
 	if (count == 0)
 		return 0;
 
@@ -137,9 +135,6 @@ static ssize_t cpustate_write(struct fil
 {
 	unsigned char data;
 
-	if (count < 0)
-		return -EFAULT;
-
 	if (count == 0)
 		return 0;
 
_

^ permalink raw reply

* Re: 2.6.31-git5 kernel boot hangs on powerpc
From: Sachin Sant @ 2009-09-19  8:54 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Linux/PPC Development, David Miller
In-Reply-To: <4AB266AF.9080705@in.ibm.com>

Sachin Sant wrote:
> Tejun Heo wrote:
>> Ah... sorry about that.  Sachin, is it possible for you to build the
>> kernel with debug info and ask gdb where the stalling NIP is in the c
>> file?
>>   
> <6>NET: Registered protocol family 10
> <3>BUG: soft lockup - CPU#2 stuck for 61s! [modprobe:1865]
> <4>Modules linked in: ipv6(+) fuse loop dm_mod sg sd_mod crc_t10dif 
> ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
> <4>NIP: c00000000004198c LR: c00000000015dac8 CTR: 0000000000000040
> <4>REGS: c0000000fbdbb6f0 TRAP: 0901   Not tainted  (2.6.31-git5)
> <4>MSR: 8000000000009032 <EE,ME,IR,DR>  CR: 44224420  XER: 20000001
> <4>TASK = c0000000fbd57840[1865] 'modprobe' THREAD: c0000000fbdb8000 
> CPU: 2
> <4>GPR00: 0000000000000040 c0000000fbdbb970 c000000000a96d08 
> d00007fffff00000
> <4>GPR04: 0000000000000000 0000000000000000 d00007fffff00000 
> d00007fffff00000
> <4>GPR08: 0000000000000000 c000000001020180 c000000000b6b4e8 
> 00000000000003c0
> <4>GPR12: 0000000048224428 c000000000b82a00
> <4>NIP [c00000000004198c] .memset+0x60/0xfc
> <4>LR [c00000000015dac8] .pcpu_alloc+0x758/0x960
> <4>Call Trace:
> <4>[c0000000fbdbb970] [c00000000015da58] .pcpu_alloc+0x6e8/0x960 
> (unreliable)
> <4>[c0000000fbdbba90] [c000000000565664] .snmp_mib_init+0x34/0x9c
> <4>[c0000000fbdbbb20] [d00000000212e130] .ipv6_add_dev+0x1cc/0x3dc [ipv6]
> <4>[c0000000fbdbbbc0] [d0000000021598ac] .addrconf_init+0x6c/0x194 [ipv6]
> <4>[c0000000fbdbbc50] [d00000000215967c] .inet6_init+0x1bc/0x34c [ipv6]
> <4>[c0000000fbdbbce0] [c0000000000097a4] .do_one_initcall+0x88/0x1bc
> <4>[c0000000fbdbbd90] [c0000000000c84dc] .SyS_init_module+0x11c/0x29c
> <4>[c0000000fbdbbe30] [c0000000000085b4] syscall_exit+0x0/0x40
> <4>Instruction dump:
> <4>98860000 38c60001 409e000c b0860000 38c60002 409d000c 90860000 
> 38c60004
> <4>78a0d183 78a506a0 7c0903a6 4182002c <f8860000> f8860008 f8860010 
> f8860018
Latest git (2.6.31-git9:78f28b7c555359c67c2a0d23f7436e915329421e)
still has this bug. 

Thanks
-Sachin

> 2:mon> r
> R00 = 0000000000000040   R07 = d00007fffff00000
> R01 = c0000000fbdbb970   R08 = 0000000000000000
> R02 = c000000000a96d08   R09 = c000000001020180
> R03 = d00007fffff00000   R10 = c000000000b6b4e8
> R04 = 0000000000000000   R11 = 00000000000003c0
> R05 = 0000000000000000   R12 = 0000000048224428
> R06 = d00007fffff00000   R13 = c000000000b82a00
> pc  = c00000000004198c .memset+0x60/0xfc
> lr  = c00000000015dac8 .pcpu_alloc+0x758/0x960
> msr = 8000000000009032   cr  = 44224420
> ctr = 0000000000000040   xer = 0000000020000001   trap =  501
> 2:mon>
>
> The corresponding c code is :
>
> pcpu_populate_chunk():
> /home/sachin/work/linux-2.6.31/mm/percpu.c:978
>
>        /* commit new bitmap */
>        bitmap_copy(chunk->populated, populated, pcpu_unit_pages);
> clear:
>        for_each_possible_cpu(cpu)
>                memset((void *)pcpu_chunk_addr(chunk, cpu, 0) + off, 0, 
> size);
>    1aa0:       e9 3f 00 38     ld      r9,56(r31)
>    1aa4:       7b a0 1f 24     rldicr  r0,r29,3,60
>    1aa8:       e8 7b 00 18     ld      r3,24(r27)
>    1aac:       38 80 00 00     li      r4,0
>    1ab0:       e8 a1 00 88     ld      r5,136(r1)
>    1ab4:       7c 09 00 2a     ldx     r0,r9,r0
>    1ab8:       7c 63 02 14     add     r3,r3,r0
>    1abc:       7c 63 b2 14     add     r3,r3,r22
>    1ac0:       48 00 00 01     bl      1ac0 <.pcpu_alloc+0x754>
>    1ac4:       60 00 00 00     nop
>
> Thanks
> -Sachin
>
>


-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

^ permalink raw reply

* Re: FPGA access over PCI-E on MPC8536
From: Felix Radensky @ 2009-09-19 15:52 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1253176993.8375.345.camel@pasglop>

Hi, Benjamin

Benjamin Herrenschmidt wrote:
>>> However when I attempt to access FPGA memory my mmapping it in  
>>> userspace the read hangs. The same happens in kernel space. Does it  
>>> happen because FPGA memory is marked as disabled, or because FPGA  
>>> code is doing something wrong ?
>> Can you access the device in u-boot?  That would possible tell you if  
>> the HW is functioning or not.
>>
>>> Another question is what can cause PCI device memory be marked as
>>> disabled.
>> Good question, no idea how lspci decided to print [disabled].  Take a  
>> look at lspci source and see :)
> 
> Maybe the memory enable in the PCI command register isn't set ?
> 
> If you don't have a kernel driver that sets it (by calling
> pci_enable_device) and u-boot doesn't set it then it's going
> to be off and you'll get hangs or machine checks trying to
> access the device...
> 
> Just an idea...

Yes, that was my problem exactly ! Setting this bit via setpci
fixed it.

Thanks a lot for your help.

Felix

^ permalink raw reply

* [PATCH][v2] powerpc/85xx: Create dts for each core in CAMP mode for P2020RDB
From: Poonam Aggrwal @ 2009-09-19 17:13 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Poonam Aggrwal

This patch creates the dts files for each core and splits the devices between
the two cores for P2020RDB.

core0 has memory, L2, i2c, spi, dma1, usb, eth0, eth1, crypto, global-util, pci0
core1 has L2, dma2, eth0, pci1, msi.

MPIC is shared between two cores but each core will protect its
interrupts from other core by using "protected-sources" of mpic.

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
---
- based on http://www.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git
- branch->next
- Removed interrupt properties for serial ports to make them work in polling mode.
 arch/powerpc/boot/dts/p2020rdb_camp_core0.dts |  363 +++++++++++++++++++++++++
 arch/powerpc/boot/dts/p2020rdb_camp_core1.dts |  184 +++++++++++++
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c     |   10 +-
 3 files changed, 556 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/p2020rdb_camp_core0.dts
 create mode 100644 arch/powerpc/boot/dts/p2020rdb_camp_core1.dts

diff --git a/arch/powerpc/boot/dts/p2020rdb_camp_core0.dts b/arch/powerpc/boot/dts/p2020rdb_camp_core0.dts
new file mode 100644
index 0000000..0fe93d0
--- /dev/null
+++ b/arch/powerpc/boot/dts/p2020rdb_camp_core0.dts
@@ -0,0 +1,363 @@
+/*
+ * P2020 RDB  Core0 Device Tree Source in CAMP mode.
+ *
+ * In CAMP mode, each core needs to have its own dts. Only mpic and L2 cache
+ * can be shared, all the other devices must be assigned to one core only.
+ * This dts file allows core0 to have memory, l2, i2c, spi, gpio, dma1, usb,
+ * eth1, eth2, sdhc, crypto, global-util, pci0.
+ *
+ * Copyright 2009 Freescale Semiconductor Inc.
+ *
+ * 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.
+ */
+
+/dts-v1/;
+/ {
+	model = "fsl,P2020";
+	compatible = "fsl,P2020RDB", "fsl,MPC85XXRDB-CAMP";
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		ethernet1 = &enet1;
+		ethernet2 = &enet2;
+		serial0 = &serial0;
+		pci0 = &pci0;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,P2020@0 {
+			device_type = "cpu";
+			reg = <0x0>;
+			next-level-cache = <&L2>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+	};
+
+	soc@ffe00000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "soc";
+		compatible = "fsl,p2020-immr", "simple-bus";
+		ranges = <0x0  0x0 0xffe00000 0x100000>;
+		bus-frequency = <0>;		// Filled out by uboot.
+
+		ecm-law@0 {
+			compatible = "fsl,ecm-law";
+			reg = <0x0 0x1000>;
+			fsl,num-laws = <12>;
+		};
+
+		ecm@1000 {
+			compatible = "fsl,p2020-ecm", "fsl,ecm";
+			reg = <0x1000 0x1000>;
+			interrupts = <17 2>;
+			interrupt-parent = <&mpic>;
+		};
+
+		memory-controller@2000 {
+			compatible = "fsl,p2020-memory-controller";
+			reg = <0x2000 0x1000>;
+			interrupt-parent = <&mpic>;
+			interrupts = <18 2>;
+		};
+
+		i2c@3000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			cell-index = <0>;
+			compatible = "fsl-i2c";
+			reg = <0x3000 0x100>;
+			interrupts = <43 2>;
+			interrupt-parent = <&mpic>;
+			dfsrr;
+			rtc@68 {
+				compatible = "dallas,ds1339";
+				reg = <0x68>;
+			};
+		};
+
+		i2c@3100 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			cell-index = <1>;
+			compatible = "fsl-i2c";
+			reg = <0x3100 0x100>;
+			interrupts = <43 2>;
+			interrupt-parent = <&mpic>;
+			dfsrr;
+		};
+
+		serial0: serial@4500 {
+			cell-index = <0>;
+			device_type = "serial";
+			compatible = "ns16550";
+			reg = <0x4500 0x100>;
+			clock-frequency = <0>;
+		};
+
+		spi@7000 {
+			cell-index = <0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,espi";
+			reg = <0x7000 0x1000>;
+			interrupts = <59 0x2>;
+			interrupt-parent = <&mpic>;
+			mode = "cpu";
+
+			fsl_m25p80@0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "fsl,espi-flash";
+				reg = <0>;
+				linux,modalias = "fsl_m25p80";
+				modal = "s25sl128b";
+				spi-max-frequency = <50000000>;
+				mode = <0>;
+
+				partition@0 {
+					/* 512KB for u-boot Bootloader Image */
+					reg = <0x0 0x00080000>;
+					label = "SPI (RO) U-Boot Image";
+					read-only;
+				};
+
+				partition@80000 {
+					/* 512KB for DTB Image */
+					reg = <0x00080000 0x00080000>;
+					label = "SPI (RO) DTB Image";
+					read-only;
+				};
+
+				partition@100000 {
+					/* 4MB for Linux Kernel Image */
+					reg = <0x00100000 0x00400000>;
+					label = "SPI (RO) Linux Kernel Image";
+					read-only;
+				};
+
+				partition@500000 {
+					/* 4MB for Compressed RFS Image */
+					reg = <0x00500000 0x00400000>;
+					label = "SPI (RO) Compressed RFS Image";
+					read-only;
+				};
+
+				partition@900000 {
+					/* 7MB for JFFS2 based RFS */
+					reg = <0x00900000 0x00700000>;
+					label = "SPI (RW) JFFS2 RFS";
+				};
+			};
+		};
+
+		gpio: gpio-controller@f000 {
+			#gpio-cells = <2>;
+			compatible = "fsl,mpc8572-gpio";
+			reg = <0xf000 0x100>;
+			interrupts = <47 0x2>;
+			interrupt-parent = <&mpic>;
+			gpio-controller;
+		};
+
+		L2: l2-cache-controller@20000 {
+			compatible = "fsl,p2020-l2-cache-controller";
+			reg = <0x20000 0x1000>;
+			cache-line-size = <32>;	// 32 bytes
+			cache-size = <0x80000>; // L2,512K
+			interrupt-parent = <&mpic>;
+			interrupts = <16 2>;
+		};
+
+		dma@21300 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,eloplus-dma";
+			reg = <0x21300 0x4>;
+			ranges = <0x0 0x21100 0x200>;
+			cell-index = <0>;
+			dma-channel@0 {
+				compatible = "fsl,eloplus-dma-channel";
+				reg = <0x0 0x80>;
+				cell-index = <0>;
+				interrupt-parent = <&mpic>;
+				interrupts = <20 2>;
+			};
+			dma-channel@80 {
+				compatible = "fsl,eloplus-dma-channel";
+				reg = <0x80 0x80>;
+				cell-index = <1>;
+				interrupt-parent = <&mpic>;
+				interrupts = <21 2>;
+			};
+			dma-channel@100 {
+				compatible = "fsl,eloplus-dma-channel";
+				reg = <0x100 0x80>;
+				cell-index = <2>;
+				interrupt-parent = <&mpic>;
+				interrupts = <22 2>;
+			};
+			dma-channel@180 {
+				compatible = "fsl,eloplus-dma-channel";
+				reg = <0x180 0x80>;
+				cell-index = <3>;
+				interrupt-parent = <&mpic>;
+				interrupts = <23 2>;
+			};
+		};
+
+		usb@22000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl-usb2-dr";
+			reg = <0x22000 0x1000>;
+			interrupt-parent = <&mpic>;
+			interrupts = <28 0x2>;
+			phy_type = "ulpi";
+		};
+
+		mdio@24520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-mdio";
+			reg = <0x24520 0x20>;
+
+			phy0: ethernet-phy@0 {
+				interrupt-parent = <&mpic>;
+				interrupts = <3 1>;
+				reg = <0x0>;
+			};
+			phy1: ethernet-phy@1 {
+				interrupt-parent = <&mpic>;
+				interrupts = <3 1>;
+				reg = <0x1>;
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		enet1: ethernet@25000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			cell-index = <1>;
+			device_type = "network";
+			model = "eTSEC";
+			compatible = "gianfar";
+			reg = <0x25000 0x1000>;
+			ranges = <0x0 0x25000 0x1000>;
+			local-mac-address = [ 00 00 00 00 00 00 ];
+			interrupts = <35 2 36 2 40 2>;
+			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
+			phy-handle = <&phy0>;
+			phy-connection-type = "sgmii";
+
+		};
+
+		enet2: ethernet@26000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			cell-index = <2>;
+			device_type = "network";
+			model = "eTSEC";
+			compatible = "gianfar";
+			reg = <0x26000 0x1000>;
+			ranges = <0x0 0x26000 0x1000>;
+			local-mac-address = [ 00 00 00 00 00 00 ];
+			interrupts = <31 2 32 2 33 2>;
+			interrupt-parent = <&mpic>;
+			phy-handle = <&phy1>;
+			phy-connection-type = "rgmii-id";
+		};
+
+		sdhci@2e000 {
+			compatible = "fsl,p2020-esdhc", "fsl,esdhc";
+			reg = <0x2e000 0x1000>;
+			interrupts = <72 0x2>;
+			interrupt-parent = <&mpic>;
+			/* Filled in by U-Boot */
+			clock-frequency = <0>;
+		};
+
+		crypto@30000 {
+			compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4",
+				     "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
+			reg = <0x30000 0x10000>;
+			interrupts = <45 2 58 2>;
+			interrupt-parent = <&mpic>;
+			fsl,num-channels = <4>;
+			fsl,channel-fifo-len = <24>;
+			fsl,exec-units-mask = <0xbfe>;
+			fsl,descriptor-types-mask = <0x3ab0ebf>;
+		};
+
+		mpic: pic@40000 {
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <2>;
+			reg = <0x40000 0x40000>;
+			compatible = "chrp,open-pic";
+			device_type = "open-pic";
+			protected-sources = <
+			42 76 77 78 79 /* serial1 , dma2 */
+			29 30 34 26 /* enet0, pci1 */
+			0xe0 0xe1 0xe2 0xe3 /* msi */
+			0xe4 0xe5 0xe6 0xe7
+			>;
+		};
+
+		global-utilities@e0000 {
+			compatible = "fsl,p2020-guts";
+			reg = <0xe0000 0x1000>;
+			fsl,has-rstcr;
+		};
+	};
+
+	pci0: pcie@ffe09000 {
+		compatible = "fsl,mpc8548-pcie";
+		device_type = "pci";
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		reg = <0 0xffe09000 0 0x1000>;
+		bus-range = <0 255>;
+		ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
+			  0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>;
+		clock-frequency = <33333333>;
+		interrupt-parent = <&mpic>;
+		interrupts = <25 2>;
+		pcie@0 {
+			reg = <0x0 0x0 0x0 0x0 0x0>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			device_type = "pci";
+			ranges = <0x2000000 0x0 0xa0000000
+				  0x2000000 0x0 0xa0000000
+				  0x0 0x20000000
+
+				  0x1000000 0x0 0x0
+				  0x1000000 0x0 0x0
+				  0x0 0x100000>;
+		};
+	};
+};
diff --git a/arch/powerpc/boot/dts/p2020rdb_camp_core1.dts b/arch/powerpc/boot/dts/p2020rdb_camp_core1.dts
new file mode 100644
index 0000000..e95a512
--- /dev/null
+++ b/arch/powerpc/boot/dts/p2020rdb_camp_core1.dts
@@ -0,0 +1,184 @@
+/*
+ * P2020 RDB Core1 Device Tree Source in CAMP mode.
+ *
+ * In CAMP mode, each core needs to have its own dts. Only mpic and L2 cache
+ * can be shared, all the other devices must be assigned to one core only.
+ * This dts allows core1 to have l2, dma2, eth0, pci1, msi.
+ *
+ * Please note to add "-b 1" for core1's dts compiling.
+ *
+ * Copyright 2009 Freescale Semiconductor Inc.
+ *
+ * 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.
+ */
+
+/dts-v1/;
+/ {
+	model = "fsl,P2020";
+	compatible = "fsl,P2020RDB", "fsl,MPC85XXRDB-CAMP";
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		ethernet0 = &enet0;
+		serial0 = &serial0;
+		pci1 = &pci1;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,P2020@1 {
+			device_type = "cpu";
+			reg = <0x1>;
+			next-level-cache = <&L2>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+	};
+
+	soc@ffe00000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "soc";
+		compatible = "fsl,p2020-immr", "simple-bus";
+		ranges = <0x0  0x0 0xffe00000 0x100000>;
+		bus-frequency = <0>;		// Filled out by uboot.
+
+		serial0: serial@4600 {
+			cell-index = <1>;
+			device_type = "serial";
+			compatible = "ns16550";
+			reg = <0x4600 0x100>;
+			clock-frequency = <0>;
+		};
+
+		dma@c300 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,eloplus-dma";
+			reg = <0xc300 0x4>;
+			ranges = <0x0 0xc100 0x200>;
+			cell-index = <1>;
+			dma-channel@0 {
+				compatible = "fsl,eloplus-dma-channel";
+				reg = <0x0 0x80>;
+				cell-index = <0>;
+				interrupt-parent = <&mpic>;
+				interrupts = <76 2>;
+			};
+			dma-channel@80 {
+				compatible = "fsl,eloplus-dma-channel";
+				reg = <0x80 0x80>;
+				cell-index = <1>;
+				interrupt-parent = <&mpic>;
+				interrupts = <77 2>;
+			};
+			dma-channel@100 {
+				compatible = "fsl,eloplus-dma-channel";
+				reg = <0x100 0x80>;
+				cell-index = <2>;
+				interrupt-parent = <&mpic>;
+				interrupts = <78 2>;
+			};
+			dma-channel@180 {
+				compatible = "fsl,eloplus-dma-channel";
+				reg = <0x180 0x80>;
+				cell-index = <3>;
+				interrupt-parent = <&mpic>;
+				interrupts = <79 2>;
+			};
+		};
+
+		L2: l2-cache-controller@20000 {
+			compatible = "fsl,p2020-l2-cache-controller";
+			reg = <0x20000 0x1000>;
+			cache-line-size = <32>;	// 32 bytes
+			cache-size = <0x80000>; // L2,512K
+			interrupt-parent = <&mpic>;
+		};
+
+
+		enet0: ethernet@24000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			cell-index = <0>;
+			device_type = "network";
+			model = "eTSEC";
+			compatible = "gianfar";
+			reg = <0x24000 0x1000>;
+			ranges = <0x0 0x24000 0x1000>;
+			local-mac-address = [ 00 00 00 00 00 00 ];
+			interrupts = <29 2 30 2 34 2>;
+			interrupt-parent = <&mpic>;
+			fixed-link = <1 1 1000 0 0>;
+			phy-connection-type = "rgmii-id";
+
+		};
+
+		mpic: pic@40000 {
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <2>;
+			reg = <0x40000 0x40000>;
+			compatible = "chrp,open-pic";
+			device_type = "open-pic";
+			protected-sources = <
+			17 18 43 42 59 47 /*ecm, mem, i2c, serial0, spi,gpio */
+			16 20 21 22 23 28 	/* L2, dma1, USB */
+			03 35 36 40 31 32 33 	/* mdio, enet1, enet2 */
+			72 45 58 25 		/* sdhci, crypto , pci */
+			>;
+		};
+
+		msi@41600 {
+			compatible = "fsl,p2020-msi", "fsl,mpic-msi";
+			reg = <0x41600 0x80>;
+			msi-available-ranges = <0 0x100>;
+			interrupts = <
+				0xe0 0
+				0xe1 0
+				0xe2 0
+				0xe3 0
+				0xe4 0
+				0xe5 0
+				0xe6 0
+				0xe7 0>;
+			interrupt-parent = <&mpic>;
+		};
+	};
+
+	pci1: pcie@ffe0a000 {
+		compatible = "fsl,mpc8548-pcie";
+		device_type = "pci";
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		reg = <0 0xffe0a000 0 0x1000>;
+		bus-range = <0 255>;
+		ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
+			  0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
+		clock-frequency = <33333333>;
+		interrupt-parent = <&mpic>;
+		interrupts = <26 2>;
+		pcie@0 {
+			reg = <0x0 0x0 0x0 0x0 0x0>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			device_type = "pci";
+			ranges = <0x2000000 0x0 0xc0000000
+				  0x2000000 0x0 0xc0000000
+				  0x0 0x20000000
+
+				  0x1000000 0x0 0x0
+				  0x1000000 0x0 0x0
+				  0x0 0x100000>;
+		};
+	};
+};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index c8468de..d173164 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -44,6 +44,7 @@ void __init mpc85xx_rdb_pic_init(void)
 	struct mpic *mpic;
 	struct resource r;
 	struct device_node *np;
+	unsigned long root = of_get_flat_dt_root();
 
 	np = of_find_node_by_type(NULL, "open-pic");
 	if (np == NULL) {
@@ -57,11 +58,18 @@ void __init mpc85xx_rdb_pic_init(void)
 		return;
 	}
 
-	mpic = mpic_alloc(np, r.start,
+	if (of_flat_dt_is_compatible(root, "fsl,85XXRDB-CAMP")) {
+		mpic = mpic_alloc(np, r.start,
+			MPIC_PRIMARY |
+			MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
+			0, 256, " OpenPIC  ");
+	} else {
+		mpic = mpic_alloc(np, r.start,
 		  MPIC_PRIMARY | MPIC_WANTS_RESET |
 		  MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
 		  MPIC_SINGLE_DEST_CPU,
 		  0, 256, " OpenPIC  ");
+	}
 
 	BUG_ON(mpic == NULL);
 	of_node_put(np);
-- 
1.5.6.5

^ permalink raw reply related


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