Re: [PATCH 3/3] powerpc: allow 256kB pages with SHMEM

2009-04-07 Thread Hugh Dickins
On Tue, 7 Apr 2009, Paul Mackerras wrote:
 Hugh Dickins writes:
 
  Now that shmem's divisions by zero and SHMEM_MAX_BYTES are fixed,
  let powerpc 256kB pages coexist with CONFIG_SHMEM again.
  
  Signed-off-by: Hugh Dickins h...@veritas.com
  ---
  Added linuxppc-dev and some other Cc's for this 3/3: sorry
  if you didn't see 1/3 and 2/3, they were just in mm/shmem.c.
 
 Looks OK - what path are you using to get the series upstream?
 (I.e. should I be putting 3/3 in the powerpc tree or are you going to
 push it along with the others?)

If it's OK with you (and you're saying it is), I think the best
would be for it to sit alongside 1/3 and 2/3 in Andrew's tree,
hopefully get an Ack from Yuri (I don't have any powerpc 256kB
pages myself to test it fully), and then go on into 2.6.30.

Hugh
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc: Add support for early tlbilx opcode

2009-04-07 Thread Kumar Gala
During the ISA 2.06 development the opcode for tlbilx changed and some
early implementations used to old opcode.  Add support for a MMU_FTR
fixup to deal with this.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 arch/powerpc/include/asm/mmu.h|6 ++
 arch/powerpc/include/asm/ppc-opcode.h |   11 ++-
 arch/powerpc/kernel/cputable.c|2 +-
 arch/powerpc/mm/tlb_nohash_low.S  |   14 +-
 4 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index cbf1543..86d2366 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -52,6 +52,12 @@
  */
 #define MMU_FTR_NEED_DTLB_SW_LRU   ASM_CONST(0x0020)
 
+/* This indicates that the processor uses the wrong opcode for tlbilx
+ * instructions.  During the ISA 2.06 development the opcode for tlbilx
+ * changed and some early implementations used to old opcode
+ */
+#define MMU_FTR_TLBILX_EARLY_OPCODEASM_CONST(0x0040)
+
 #ifndef __ASSEMBLY__
 #include asm/cputable.h
 
diff --git a/arch/powerpc/include/asm/ppc-opcode.h 
b/arch/powerpc/include/asm/ppc-opcode.h
index 640ccbb..ef4da37 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -44,6 +44,7 @@
 #define PPC_INST_STSWI 0x7c0005aa
 #define PPC_INST_STSWX 0x7c00052a
 #define PPC_INST_TLBILX0x7c24
+#define PPC_INST_TLBILX_EARLY  0x7c000626
 #define PPC_INST_WAIT  0x7c7c
 
 /* macros to insert fields into opcodes */
@@ -63,10 +64,18 @@
 #define PPC_RFDI   stringify_in_c(.long PPC_INST_RFDI)
 #define PPC_RFMCI  stringify_in_c(.long PPC_INST_RFMCI)
 #define PPC_TLBILX(t, a, b)stringify_in_c(.long PPC_INST_TLBILX | \
-   __PPC_T_TLB(t) | __PPC_RA(a) | 
__PPC_RB(b))
+   __PPC_T_TLB(t) | \
+   __PPC_RA(a) | __PPC_RB(b))
 #define PPC_TLBILX_ALL(a, b)   PPC_TLBILX(0, a, b)
 #define PPC_TLBILX_PID(a, b)   PPC_TLBILX(1, a, b)
 #define PPC_TLBILX_VA(a, b)PPC_TLBILX(3, a, b)
+
+#define PPC_TLBILX_EARLY(t, a, b) stringify_in_c(.long PPC_INST_TLBILX_EARLY | 
\
+   __PPC_T_TLB(t) | \
+   __PPC_RA(a) | __PPC_RB(b))
+#define PPC_TLBILX_ALL_EARLY(a, b) PPC_TLBILX_EARLY(0, a, b)
+#define PPC_TLBILX_PID_EARLY(a, b) PPC_TLBILX_EARLY(1, a, b)
+#define PPC_TLBILX_VA_EARLY(a, b)  PPC_TLBILX_EARLY(3, a, b)
 #define PPC_WAIT(w)stringify_in_c(.long PPC_INST_WAIT | \
__PPC_WC(w))
 
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index cd1b687..57db50f 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1766,7 +1766,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.cpu_features   = CPU_FTRS_E500MC,
.cpu_user_features  = COMMON_USER_BOOKE | 
PPC_FEATURE_HAS_FPU,
.mmu_features   = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS 
|
-   MMU_FTR_USE_TLBILX,
+   MMU_FTR_USE_TLBILX | MMU_FTR_TLBILX_EARLY_OPCODE,
.icache_bsize   = 64,
.dcache_bsize   = 64,
.num_pmcs   = 4,
diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S
index 788b87c..45fed36 100644
--- a/arch/powerpc/mm/tlb_nohash_low.S
+++ b/arch/powerpc/mm/tlb_nohash_low.S
@@ -138,7 +138,11 @@ BEGIN_MMU_FTR_SECTION
andi.   r3,r3,mmucsr0_tl...@l
bne 1b
 MMU_FTR_SECTION_ELSE
-   PPC_TLBILX_ALL(0,0)
+  BEGIN_MMU_FTR_SECTION_NESTED(96)
+   PPC_TLBILX_ALL(0,r3)
+  MMU_FTR_SECTION_ELSE_NESTED(96)
+   PPC_TLBILX_ALL_EARLY(0,r3)
+  ALT_MMU_FTR_SECTION_END_NESTED_IFCLR(MMU_FTR_TLBILX_EARLY_OPCODE, 96)
 ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_TLBILX)
msync
isync
@@ -151,7 +155,11 @@ BEGIN_MMU_FTR_SECTION
wrteei  0
mfspr   r4,SPRN_MAS6/* save MAS6 */
mtspr   SPRN_MAS6,r3
+  BEGIN_MMU_FTR_SECTION_NESTED(96)
PPC_TLBILX_PID(0,0)
+  MMU_FTR_SECTION_ELSE_NESTED(96)
+   PPC_TLBILX_PID_EARLY(0,0)
+  ALT_MMU_FTR_SECTION_END_NESTED_IFCLR(MMU_FTR_TLBILX_EARLY_OPCODE, 96)
mtspr   SPRN_MAS6,r4/* restore MAS6 */
wrtee   r10
 MMU_FTR_SECTION_ELSE
@@ -185,7 +193,11 @@ BEGIN_MMU_FTR_SECTION
mtspr   SPRN_MAS1,r4
tlbwe
 MMU_FTR_SECTION_ELSE
+  BEGIN_MMU_FTR_SECTION_NESTED(96)
PPC_TLBILX_VA(0,r3)
+  MMU_FTR_SECTION_ELSE_NESTED(96)
+   PPC_TLBILX_VA_EARLY(0,r3)
+  ALT_MMU_FTR_SECTION_END_NESTED_IFCLR(MMU_FTR_TLBILX_EARLY_OPCODE, 96)
 ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_TLBILX)
msync
isync
-- 
1.6.0.6


Re: [PATCH 1/3] PowerPC: MPC85xx: TQM85xx: correct address of LM75 I2C device nodes

2009-04-07 Thread Kumar Gala


On Mar 16, 2009, at 3:56 AM, Wolfgang Grandegger wrote:


Commit 0f73a449a649acfca91404a98a35353a618b9555 added I2C device nodes
for the LM75 thermal sensor on the TQM85xx modules, unfortunately with
the wrong I2C address. The LM75s are located at address 0x48.

Signed-off-by: Wolfgang Grandegger w...@grandegger.com
---
arch/powerpc/boot/dts/tqm8540.dts  |4 ++--
arch/powerpc/boot/dts/tqm8541.dts  |4 ++--
arch/powerpc/boot/dts/tqm8548-bigflash.dts |4 ++--
arch/powerpc/boot/dts/tqm8548.dts  |4 ++--
arch/powerpc/boot/dts/tqm8555.dts  |4 ++--
arch/powerpc/boot/dts/tqm8560.dts  |4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)


applied

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/3] PowerPC: MPC85xx: TQM8548: use proper phy-handles for enet2 and enet3

2009-04-07 Thread Kumar Gala


On Mar 16, 2009, at 3:57 AM, Wolfgang Grandegger wrote:


For enet2 and enet3 the wrong phy-handles have been used in DTS files
of the TQM8548 modules.

Signed-off-by: Wolfgang Grandegger w...@grandegger.com
---
arch/powerpc/boot/dts/tqm8548-bigflash.dts |4 ++--
arch/powerpc/boot/dts/tqm8548.dts  |4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)


fixup  applied

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] PowerPC: MPC85xx: TQM8548: update defconfig

2009-04-07 Thread Kumar Gala


On Mar 16, 2009, at 3:57 AM, Wolfgang Grandegger wrote:


Enable highmem support for the TQM8548-AG modules and NAND support for
the TQM8548-BE modules. Furthermore disable USB, Wireless and IDE  
support

because it's not available on the STK85xx starter kit.

Signed-off-by: Wolfgang Grandegger w...@grandegger.com
---
arch/powerpc/configs/85xx/tqm8548_defconfig |  164 +++ 
+---

1 files changed, 48 insertions(+), 116 deletions(-)



applied

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Please pull from 'next' branch (for 2.6.30)(updated) (fwd)

2009-04-07 Thread Kumar Gala
Forgot to CC linuxppc-dev

- k

-- Forwarded message --
Date: Tue, 7 Apr 2009 01:21:21 -0500 (CDT)
From: Kumar Gala ga...@kernel.crashing.org
To: Paul Mackerras pau...@samba.org,
Benjamin Herrenschmidt b...@kernel.crashing.org
Subject: Please pull from 'next' branch (for 2.6.30)(updated)

* Added some patches for tqm85xx that I missed
* Added tlbilx opcode patches (support was added in .30 so this is fixing
issues with that code)

- k

Please pull from 'next' branch of

master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git next

to receive the following updates:

 arch/powerpc/Kconfig|1
 arch/powerpc/boot/dts/ksi8560.dts   |4
 arch/powerpc/boot/dts/pq2fads.dts   |   20 ++-
 arch/powerpc/boot/dts/sbc8548.dts   |4
 arch/powerpc/boot/dts/sbc8560.dts   |4
 arch/powerpc/boot/dts/socrates.dts  |1
 arch/powerpc/boot/dts/stx_gp3_8560.dts  |4
 arch/powerpc/boot/dts/tqm8540.dts   |8 -
 arch/powerpc/boot/dts/tqm8541.dts   |8 -
 arch/powerpc/boot/dts/tqm8548-bigflash.dts  |8 -
 arch/powerpc/boot/dts/tqm8548.dts   |8 -
 arch/powerpc/boot/dts/tqm8555.dts   |8 -
 arch/powerpc/boot/dts/tqm8560.dts   |8 -
 arch/powerpc/configs/85xx/tqm8548_defconfig |  164 
 arch/powerpc/include/asm/mmu.h  |6 +
 arch/powerpc/include/asm/mpic.h |   12 ++
 arch/powerpc/include/asm/ppc-opcode.h   |   13 +-
 arch/powerpc/include/asm/reg.h  |   30 +
 arch/powerpc/include/asm/reg_booke.h|   30 -
 arch/powerpc/include/asm/sfp-machine.h  |6 -
 arch/powerpc/kernel/cputable.c  |2
 arch/powerpc/mm/tlb_nohash_low.S|   14 ++
 arch/powerpc/sysdev/mpic.c  |   34 +
 drivers/serial/cpm_uart/cpm_uart_core.c |   14 +-
 drivers/video/fsl-diu-fb.c  |   34 +++--
 include/linux/fsl_devices.h |   22 ---
 26 files changed, 234 insertions(+), 233 deletions(-)

Anton Vorontsov (1):
  fsl-diu-fb: Pass the proper device for dma mapping routines

Grant Likely (1):
  powerpc: Remove unused symbols from fsl_devices.h

Josh Boyer (1):
  powerpc: Make LOWMEM_CAM_NUM depend on FSL_BOOKE

Kumar Gala (6):
  powerpc/85xx: Use fsl,mpc85.. as prefix for memory ctrl  l2-cache nodes
  powerpc: Move SPEFSCR defines to common header
  powerpc/math-emu: Change types to work on ppc64
  powerpc: Add support for CoreInt delivery of interrupts on MPIC
  powerpc: Fix tlbilx opcode
  powerpc: Add support for early tlbilx opcode

Scott Wood (3):
  cpm_uart: Initialize port.dev before it's used.
  cpm_uart: Disable CPM udbg when re-initing CPM uart, even if not the 
console.
  powerpc/pq2fads: Update device tree for use with device-tree-aware u-boot.

Wolfgang Grandegger (4):
  powerpc/85xx: Re-add the device_type soc to socrates.dts
  powerpc/85xx: TQM85xx: correct address of LM75 I2C device nodes
  powerpc/85xx: TQM8548: use proper phy-handles for enet2 and enet3
  powerpc/85xx: TQM8548: update defconfig

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Bug:scheduling while atomic

2009-04-07 Thread Vijay Nikam
Hello All,

I have mpc8313erb with linux kernel 2.6.20.

When I ported the kernel with CONFIG_PREEMPT=y (Enabled) I am getting
the 'scheduling while atomic'. Please check the following call trace,
thanks.

Could anyone please let me to the way to fix it ? ? ?

Kindly please acknowledge ... thank you ...

Kind Regards,
Vijay Nikam

## LOG #
mpc8313_rdb_setup_arch()
arch: exit

[0.00] Using MPC8313 RDB machine description
[0.00] Linux version 2.6.20 (mess...@localhost.localdomain)
(gcc version 4.0.2 20060628 (Wasabi)) #23 PREEMPT Tue Apr 7 10:36:18
IST 209
[0.00] Found MPC83xx PCI host bridge at 0xe0008500.
Firmware bus number: 0-0
[0.00] Zone PFN ranges:
[0.00]   DMA 0 -32768
[0.00]   Normal  32768 -32768
[0.00] early_node_map[1] active PFN ranges
[0.00] 0:0 -32768
[0.00] Built 1 zonelists.  Total pages: 32512
[0.00] Kernel command line: root=/dev/mtdblock4
rootfstype=jffs2 rw console=ttyS0,115200 mtdparts=nand0:-(rootfs)
[0.00] IPIC (128 IRQ sources) at fdefa700
[0.00] PID hash table entries: 512 (order: 9, 2048 bytes)
[   10.730683] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[   10.731455] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[   10.744855] Memory: 125836k/131072k available (3296k kernel code,
5088k reserved, 472k data, 110k bss, 144k init)
[   10.766153] Mount-cache hash table entries: 512
[   10.776457] NET: Registered protocol family 16
[   10.795354] PCI: Probing PCI hardware
[   10.835814] Generic PHY: Registered new driver
[   10.845802] SCSI subsystem initialized
[   10.848001] usbcore: registered new interface driver usbfs
[   10.849225] usbcore: registered new interface driver hub
[   10.850730] usbcore: registered new device driver usb
[   10.864131] NET: Registered protocol family 2
[   10.873891] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[   10.875624] TCP established hash table entries: 4096 (order: 4, 65536 bytes)
[   10.876118] TCP bind hash table entries: 2048 (order: 3, 40960 bytes)
[   10.876483] TCP: Hash tables configured (established 4096 bind 2048)
[   10.876508] TCP reno registered
[   10.926572] Initializing RT-Tester: OK
[   10.931275] JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
[   10.932114] io scheduler noop registered
[   10.932142] io scheduler anticipatory registered (default)
[   10.932164] io scheduler deadline registered
[   10.932336] io scheduler cfq registered
[   11.669977] Generic RTC Driver v1.07
[   11.673740] WDT driver for MPC83xx initialized. mode:reset
timeout=65535 (25 seconds)
[   11.673826] Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports,
IRQ sharing disabled
[   11.680975] serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
[   11.902695] serial8250.0: ttyS1 at MMIO 0xe0004600 (irq = 17) is a 16550A
[   11.934522] RAMDISK driver initialized: 16 RAM disks of 32768K size
1024 blocksize
[   11.953408] loop: loaded (max 8 devices)
[   11.957368] Intel(R) PRO/1000 Network Driver - version 7.3.15-k2-NAPI
[   11.963862] Copyright (c) 1999-2006 Intel Corporation.
[   11.979780] Gianfar MII Bus: probed
[   11.986456] eth0: Gianfar Ethernet Controller Version 1.4, 00:04:9f:ef:23:33
[   11.993766] eth0: MTU = 1500 (frame size=1540,truesize=2296)
[   11.999442] eth0: Running with NAPI enabled
[   12.003644] eth0: 64/64 RX/TX BD ring size
[   12.007756] eth0: Socket buffer recycling mode enabled
[   12.014840] eth1: Gianfar Ethernet Controller Version 1.4, 00:e0:0c:00:7e:21
[   12.022155] eth1: MTU = 1500 (frame size=1540,truesize=2296)
[   12.027855] eth1: Running with NAPI enabled
[   12.032060] eth1: 64/64 RX/TX BD ring size
[   12.036169] eth1: Socket buffer recycling mode enabled
[   12.041374] SKB Handler initialized(max=64)
[   12.047711] Marvell 88E1101: Registered new driver
[   12.053683] Marvell 88E: Registered new driver
[   12.059610] Marvell 88E1145: Registered new driver
[   12.065650] MPC8313ERDB Ethernet Switch: Registered new driver
[   12.080151] MPC8313RDB flash device: 80 at fe00 Partition number 4
[   12.087755] MPC8313RDB Flash Map Info: Found 1 x16 devices at 0x0
in 16-bit bank
[   12.095290]  Amd/Fujitsu Extended Query Table at 0x0040
[   12.100558] MPC8313RDB Flash Map Info: Swapping erase regions for
broken CFI table.
[   12.108294] number of CFI chips: 1
[   12.111729] cfi_cmdset_0002: Disabling erase-suspend-program due to
code brokenness.
[   12.119556] Creating 4 MTD partitions on MPC8313RDB Flash Map Info:
[   12.126040] 0x-0x0010 : U-Boot
[   12.134115] 0x0010-0x0030 : Kernel
[   12.142296] 0x0030-0x0070 : JFFS2
[   12.150546] 0x0070-0x0080 : dtb
[   12.158445] MPC8313RDB flash device (MPC8313RDB Flash Map Info) initialized
[   12.165481] Freescale eLBC NAND Driver (C) 2006 Freescale
[   12.173380] 

Re: [PATCH] powerpc: Add support for early tlbilx opcode

2009-04-07 Thread Michael Ellerman
On Tue, 2009-04-07 at 01:13 -0500, Kumar Gala wrote:
 During the ISA 2.06 development the opcode for tlbilx changed and some
 early implementations used to old opcode.  Add support for a MMU_FTR
 fixup to deal with this.
 
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
  arch/powerpc/include/asm/mmu.h|6 ++
  arch/powerpc/include/asm/ppc-opcode.h |   11 ++-
  arch/powerpc/kernel/cputable.c|2 +-
  arch/powerpc/mm/tlb_nohash_low.S  |   14 +-
  4 files changed, 30 insertions(+), 3 deletions(-)
 
 diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
 index cbf1543..86d2366 100644
 --- a/arch/powerpc/include/asm/mmu.h
 +++ b/arch/powerpc/include/asm/mmu.h
 @@ -52,6 +52,12 @@
   */
  #define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x0020)
  
 +/* This indicates that the processor uses the wrong opcode for tlbilx
 + * instructions.  During the ISA 2.06 development the opcode for tlbilx
 + * changed and some early implementations used to old opcode
 + */
 +#define MMU_FTR_TLBILX_EARLY_OPCODE  ASM_CONST(0x0040)

You're actually going to ship those parts? :)

It seems a pity to use up a feature bit.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Bug:scheduling while atomic

2009-04-07 Thread Kumar Gala


On Apr 7, 2009, at 1:29 AM, Vijay Nikam wrote:


Hello All,

I have mpc8313erb with linux kernel 2.6.20.

When I ported the kernel with CONFIG_PREEMPT=y (Enabled) I am getting
the 'scheduling while atomic'. Please check the following call trace,
thanks.

Could anyone please let me to the way to fix it ? ? ?

Kindly please acknowledge ... thank you ...

Kind Regards,
Vijay Nikam


Have you tried a newer kernel (like 2.6.29) and see if the issue still  
exists.


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Add support for early tlbilx opcode

2009-04-07 Thread Kumar Gala


On Apr 7, 2009, at 1:43 AM, Michael Ellerman wrote:



You're actually going to ship those parts? :)


I hope not, but until someone tells me otherwise I want the fix in  
(less headache for me).  We can easily revert this one commit if it  
becomes clear that such parts never really existed. ;)



It seems a pity to use up a feature bit.


MMU feature bits are new so we have a slew of them :)

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: wire up preadv and pwritev

2009-04-07 Thread Subrata Modak
Hi Stephen,

On Tue, Apr 7, 2009 at 8:49 AM, Stephen Rothwell s...@canb.auug.org.auwrote:


 Signed-off-by: Stephen Rothwell s...@canb.auug.org.au
 ---
  arch/powerpc/include/asm/systbl.h |2 ++
  arch/powerpc/include/asm/unistd.h |4 +++-
  2 files changed, 5 insertions(+), 1 deletions(-)

 Tested on pseries_defconfig (verified using strace{,64} and inspecting
 the files).  Test program (modified from the original because the API and
 ABI changed and I added a test with larger offsets):

 #if 0
 set -x
 gcc -Wall -O2 -m32 -o preadv $0
 gcc -Wall -O2 -m32 -D_FILE_OFFSET_BITS=64 -DLARGE_TEST -o preadv32 $0
 gcc -Wall -O2 -m64 -DLARGE_TEST -o preadv64 $0
 ./preadv
 ./preadv32
 ./preadv64
 exit 0
 #endif
 /*
  * preadv demo / test
  *
  * (c) 2008 Gerd Hoffmann kra...@redhat.com
  * Modified for new ABI and large offset test by Stephen Rothwell
  *
  * build with sh $thisfile
  */

 #include stdio.h
 #include stdlib.h
 #include unistd.h
 #include errno.h
 #include inttypes.h
 #include sys/uio.h

 /* - */
 /* syscall windup*/

 #include sys/syscall.h
 #if 1
 /* WARNING: Be sure you know what you are doing if you enable this.
  * linux syscall code isn't upstream yet, syscall numbers are subject
  * to change */
 # ifndef __NR_preadv
 #  ifdef __i386__
 #   define __NR_preadv  333
 #   define __NR_pwritev 334
 #  endif
 #  ifdef __x86_64__
 #   define __NR_preadv  295
 #   define __NR_pwritev 296
 #  endif
 #  ifdef __powerpc__
 #   define __NR_preadv  319
 #   define __NR_pwritev 320
 #  endif
 # endif
 #endif
 #ifndef __NR_preadv
 # error preadv/pwritev syscall numbers are unknown
 #endif

 #define HALF_BITS (sizeof(unsigned long)*4)

 static ssize_t preadv(int fd, const struct iovec *iov, int iovcnt,
  off_t offset)
 {
return syscall(__NR_preadv, fd, iov, iovcnt,
   (unsigned long)offset,
   (unsigned long)((offset  HALF_BITS)  HALF_BITS));
 }

 static ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt,
   off_t offset)
 {
return syscall(__NR_pwritev, fd, iov, iovcnt,
   (unsigned long)offset,
   (unsigned long)((offset  HALF_BITS)  HALF_BITS));
 }

 /* - */
 /* demo/test app */

 static char filename[] = /tmp/preadv-XX;
 static char outbuf[11] = 0123456789;
 static char inbuf[11]  = --;

 static struct iovec ovec[2] = {{
.iov_base = outbuf + 5,
.iov_len  = 5,
},{
.iov_base = outbuf + 0,
.iov_len  = 5,
}};

 static struct iovec ivec[3] = {{
.iov_base = inbuf + 6,
.iov_len  = 2,
},{
.iov_base = inbuf + 4,
.iov_len  = 2,
},{
.iov_base = inbuf + 2,
.iov_len  = 2,
}};

 void cleanup(void)
 {
unlink(filename);
 }

 int main(int argc, char **argv)
 {
int fd, rc;

fd = mkstemp(filename);
if (-1 == fd) {
perror(mkstemp);
exit(1);
}
atexit(cleanup);

/* write to file: 56789-01234 */
rc = pwritev(fd, ovec, 2, 0);
if (rc  0) {
perror(pwritev);
exit(1);
}

/* read from file: 78-90-12 */
rc = preadv(fd, ivec, 3, 2);
if (rc  0) {
perror(preadv);
exit(1);
}

printf(result  : %s\n, inbuf);
printf(expected: %s\n, --129078--);

 #ifdef LARGE_TEST

/* write to file: 56789-01234 */
rc = pwritev(fd, ovec, 2, 0x3ULL);
if (rc  0) {
perror(pwritev);
exit(1);
}

/* read from file: 78-90-12 */
rc = preadv(fd, ivec, 3, 0x3ULL + 2);
if (rc  0) {
perror(preadv);
exit(1);
}

printf(result  : %s\n, inbuf);
printf(expected: %s\n, --129078--);

 #endif

exit(0);
 }


How about contributing the above test to LTP(http://ltp.sourceforge.net/)
under GPL ? If you agree, i would soon send you a Patch integrating the same
to LTP.

Regards--
Subrata



 diff --git a/arch/powerpc/include/asm/systbl.h
 b/arch/powerpc/include/asm/systbl.h
 index fe16649..3fb6d9e 100644
 --- a/arch/powerpc/include/asm/systbl.h
 +++ b/arch/powerpc/include/asm/systbl.h
 @@ -322,3 +322,5 @@ SYSCALL_SPU(epoll_create1)
  SYSCALL_SPU(dup3)
  SYSCALL_SPU(pipe2)
  SYSCALL(inotify_init1)
 +COMPAT_SYS_SPU(preadv)
 +COMPAT_SYS_SPU(pwritev)
 diff --git a/arch/powerpc/include/asm/unistd.h
 b/arch/powerpc/include/asm/unistd.h
 index e07d0c7..7e03ebe 100644
 --- a/arch/powerpc/include/asm/unistd.h
 +++ 

Re: [PATCH] powerpc: Keep track of emulated instructions

2009-04-07 Thread Geert Uytterhoeven
On Tue, 7 Apr 2009, Michael Neuling wrote:
 In message alpine.lrh.2.00.0904061430090.11...@vixen.sonytel.be you wrote:
  On Fri, 3 Apr 2009, Kumar Gala wrote:
   On Apr 3, 2009, at 7:08 AM, Geert Uytterhoeven wrote:
   Finally (after ca. 1.5 years), he're an updated version of my patch to k=
  eep
   track of emulated instructions.  In the light of Kumar's `Emulate enough=
   of
   SPE
   instructions to make gcc happy' patch, he probably also wants to keep tr=
  ack
   of
   the actual runtime overhead.
   
   Changes since last version:
- arch/powerpc/kernel/sysfs.c is now compiled on ppc32, so we can provi=
  de
  counters in sysfs on ppc32, too,
- WARN_EMULATED() is a no-op if CONFIG_SYSCTL is disabled,
- Add warnings for altivec,
- Add warnings for recently introduced emulation of vsx and isel
  instructions.
   =
  
   pretty cool.  Do we think counters should be sysfs or debugfs?
  
  What do you prefer?
  
  On MIPS, unaligned exception handling control is in debugfs.
 
 Would per process counters be too hard?  Stick them in the thread_struct
 and export them via /proc/pid/emulated. 

But they go away as soon as the process exits, right?

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   geert.uytterhoe...@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: wire up preadv and pwritev

2009-04-07 Thread Stephen Rothwell
Hi Subrata,

On Tue, 7 Apr 2009 12:21:18 +0530 Subrata Modak tosubr...@gmail.com wrote:

 How about contributing the above test to LTP(http://ltp.sourceforge.net/)
 under GPL ? If you agree, i would soon send you a Patch integrating the same
 to LTP.

I have no problem with that.  However, the test was originally written by
Gerd Hoffmann and is essentially unchanged (i just updated some details),
so I think that is where you should direct your request.

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


pgp958GTTAREP.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] powerpc: Add configurable -Werror for arch/powerpc

2009-04-07 Thread Geert Uytterhoeven
On Mon, 6 Apr 2009, Olof Johansson wrote:
 On Tue, Apr 07, 2009 at 12:00:41PM +1000, Michael Ellerman wrote:
  Add an option, on by default, to build all code under arch/powerpc with
  -Werror, which causes gcc to treat warnings as errors.
  
  The intention is to make it harder for people to inadvertantly introduce
  errors in the arch/powerpc code. It needs to be configurable so that
  if a warning is introduced, people can easily work around it while it's
  being fixed.
 
 This looks useful at least for the automated builds to catch new warnings,
 but do similar options exist on other architectures, x86 in particular? I
 think a Cc to LKML of this could be useful.
 
 This is really only beneficial if various people build for powerpc often
 enough. If major subsystem maintainers aren't going to hit the errors
 it's more of a hinderance for PPC than a global benefit, right?

Will be built nightly: http://kisskb.ellerman.id.au/kisskb/matrix/

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   geert.uytterhoe...@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Add configurable -Werror for arch/powerpc

2009-04-07 Thread Stephen Rothwell
On Tue, 7 Apr 2009 09:41:38 +0200 (CEST) Geert Uytterhoeven 
geert.uytterhoe...@sonycom.com wrote:

 On Mon, 6 Apr 2009, Olof Johansson wrote:
  
  This is really only beneficial if various people build for powerpc often
  enough. If major subsystem maintainers aren't going to hit the errors
  it's more of a hinderance for PPC than a global benefit, right?
 
 Will be built nightly: http://kisskb.ellerman.id.au/kisskb/matrix/

And I build it several (i.e. between 20 and 80) times a day :-( (after
merging it with all sorts of stuff this is upcoming).

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


pgps4nFD6cDio.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] powerpc: Keep track of emulated instructions

2009-04-07 Thread Michael Neuling


In message alpine.lrh.2.00.0904070926001.17...@vixen.sonytel.be you wrote:
 On Tue, 7 Apr 2009, Michael Neuling wrote:
  In message alpine.lrh.2.00.0904061430090.11...@vixen.sonytel.be you wrote
:
   On Fri, 3 Apr 2009, Kumar Gala wrote:
On Apr 3, 2009, at 7:08 AM, Geert Uytterhoeven wrote:
Finally (after ca. 1.5 years), he're an updated version of my patch to
 k=
   eep
track of emulated instructions.  In the light of Kumar's `Emulate enou
gh=
of
SPE
instructions to make gcc happy' patch, he probably also wants to keep 
tr=
   ack
of
the actual runtime overhead.

Changes since last version:
 - arch/powerpc/kernel/sysfs.c is now compiled on ppc32, so we can pro
vi=
   de
   counters in sysfs on ppc32, too,
 - WARN_EMULATED() is a no-op if CONFIG_SYSCTL is disabled,
 - Add warnings for altivec,
 - Add warnings for recently introduced emulation of vsx and isel
   instructions.
=
   
pretty cool.  Do we think counters should be sysfs or debugfs?
   
   What do you prefer?
   
   On MIPS, unaligned exception handling control is in debugfs.
  
  Would per process counters be too hard?  Stick them in the thread_struct
  and export them via /proc/pid/emulated. 
 
 But they go away as soon as the process exits, right?

True.  

taskstats would be better then but you'd have to start touching generic
code for that.

Mikey
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v3 0/5] i2c: i2c-mpc: make I2C bus speed configurable

2009-04-07 Thread Wolfgang Grandegger
This patch series makes the I2C bus speed configurable by using the
I2C node property clock-frequency. If the property is not defined,
the old fixed clock settings will be used for backward compatibility.
The property fsl,preserve-clocking allows to inherit the settings
from the bootloader. Furthermore, it does some cleanup and uses the
new bindings for the Socrates board:

  i2c: i2c-mpc: various coding style fixes
  i2c: i2c-mpc: use dev based printout function
  i2c: i2c-mpc: make I2C bus speed configurable
  powerpc: i2c-mpc: document new FSL I2C bindings and cleanup
  powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board

Ben, could you please consider this patch series for inclusion into
2.6.30.

TIA,

Wolfgang.
 

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v3 4/5] powerpc: i2c-mpc: document new FSL I2C bindings and cleanup

2009-04-07 Thread Wolfgang Grandegger
This patch documents the new bindings for the MPC I2C bus driver.
Furthermore, it removes obsolete FSL device related definitions
for I2C.
It should go through the appropriate PowerPC maintainer(s) hands.

Signed-off-by: Wolfgang Grandegger w...@grandegger.com
---
 Documentation/powerpc/dts-bindings/fsl/i2c.txt |   46 -
 include/linux/fsl_devices.h|4 --
 2 files changed, 31 insertions(+), 19 deletions(-)

Index: linux-2.6-galak/Documentation/powerpc/dts-bindings/fsl/i2c.txt
===
--- linux-2.6-galak.orig/Documentation/powerpc/dts-bindings/fsl/i2c.txt 
2009-04-07 10:09:08.185721241 +0200
+++ linux-2.6-galak/Documentation/powerpc/dts-bindings/fsl/i2c.txt  
2009-04-07 10:09:15.413719535 +0200
@@ -7,8 +7,10 @@
 
 Recommended properties :
 
- - compatible : Should be fsl-i2c for parts compatible with
-   Freescale I2C specifications.
+ - compatible : compatibility list with 2 entries, the first should
+   be fsl,CHIP-i2c where CHIP is the name of a compatible processor,
+   e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one
+   should be fsl-i2c.
  - interrupts : a b where a is the interrupt number and b is a
field that represents an encoding of the sense and level
information for the interrupt.  This should be encoded based on
@@ -16,17 +18,31 @@
controller you have.
  - interrupt-parent : the phandle for the interrupt controller that
services interrupts for this device.
- - dfsrr : boolean; if defined, indicates that this I2C device has
-   a digital filter sampling rate register
- - fsl5200-clocking : boolean; if defined, indicated that this device
-   uses the FSL 5200 clocking mechanism.
-
-Example :
-   i...@3000 {
-   interrupt-parent = 4;
-   interrupts = 1b 3;
-   reg = 3000 18;
-   device_type = i2c;
-   compatible  = fsl-i2c;
-   dfsrr;
+ - fsl,preserve-clocking : boolean; if defined, the clock settings
+   from the bootloader are preserved (not touched).
+ - clock-frequency : desired I2C bus clock frequency in Hz.
+
+Examples :
+
+   i...@3d00 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,mpc5200b-i2c,fsl,mpc5200-i2c,fsl-i2c;
+   cell-index = 0;
+   reg = 0x3d00 0x40;
+   interrupts = 2 15 0;
+   interrupt-parent = mpc5200_pic;
+   fsl,preserve-clocking;
};
+
+   i...@3100 {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 1;
+   compatible = fsl,mpc8544-i2c, fsl-i2c;
+   reg = 0x3100 0x100;
+   interrupts = 43 2;
+   interrupt-parent = mpic;
+   clock-frequency = 40;
+   };
+
Index: linux-2.6-galak/include/linux/fsl_devices.h
===
--- linux-2.6-galak.orig/include/linux/fsl_devices.h2009-04-07 
10:09:08.185721241 +0200
+++ linux-2.6-galak/include/linux/fsl_devices.h 2009-04-07 10:09:15.414719119 
+0200
@@ -43,10 +43,6 @@
  *
  */
 
-/* Flags related to I2C device features */
-#define FSL_I2C_DEV_SEPARATE_DFSRR 0x0001
-#define FSL_I2C_DEV_CLOCK_5200 0x0002
-
 enum fsl_usb2_operating_modes {
FSL_USB2_MPH_HOST,
FSL_USB2_DR_HOST,

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v3 1/5] i2c: i2c-mpc: various coding style fixes

2009-04-07 Thread Wolfgang Grandegger
Fix errors reported by checkpatch (indention, long lines, trailing
white space, etc.).

Signed-off-by: Wolfgang Grandegger w...@grandegger.com
---
 drivers/i2c/busses/i2c-mpc.c |   35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
===
--- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c   2009-04-07 
10:09:09.400719216 +0200
+++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c2009-04-07 
10:09:13.271719088 +0200
@@ -20,7 +20,7 @@
 #include linux/of_platform.h
 #include linux/of_i2c.h
 
-#include asm/io.h
+#include linux/io.h
 #include linux/fsl_devices.h
 #include linux/i2c.h
 #include linux/interrupt.h
@@ -28,10 +28,10 @@
 
 #define DRV_NAME mpc-i2c
 
-#define MPC_I2C_FDR0x04
-#define MPC_I2C_CR 0x08
-#define MPC_I2C_SR 0x0c
-#define MPC_I2C_DR 0x10
+#define MPC_I2C_FDR   0x04
+#define MPC_I2C_CR0x08
+#define MPC_I2C_SR0x0c
+#define MPC_I2C_DR0x10
 #define MPC_I2C_DFSRR 0x14
 
 #define CCR_MEN  0x80
@@ -58,7 +58,7 @@
u32 flags;
 };
 
-static __inline__ void writeccr(struct mpc_i2c *i2c, u32 x)
+static inline void writeccr(struct mpc_i2c *i2c, u32 x)
 {
writeb(x, i2c-base + MPC_I2C_CR);
 }
@@ -100,8 +100,7 @@
u32 x;
int result = 0;
 
-   if (i2c-irq == NO_IRQ)
-   {
+   if (i2c-irq == NO_IRQ) {
while (!(readb(i2c-base + MPC_I2C_SR)  CSR_MIF)) {
schedule();
if (time_after(jiffies, orig_jiffies + timeout)) {
@@ -176,7 +175,7 @@
 }
 
 static int mpc_write(struct mpc_i2c *i2c, int target,
-const u8 * data, int length, int restart)
+const u8 *data, int length, int restart)
 {
int i, result;
unsigned timeout = i2c-adap.timeout;
@@ -207,7 +206,7 @@
 }
 
 static int mpc_read(struct mpc_i2c *i2c, int target,
-   u8 * data, int length, int restart)
+   u8 *data, int length, int restart)
 {
unsigned timeout = i2c-adap.timeout;
int i, result;
@@ -311,7 +310,8 @@
.timeout = HZ,
 };
 
-static int __devinit fsl_i2c_probe(struct of_device *op, const struct 
of_device_id *match)
+static int __devinit fsl_i2c_probe(struct of_device *op,
+  const struct of_device_id *match)
 {
int result = 0;
struct mpc_i2c *i2c;
@@ -341,11 +341,12 @@
result = request_irq(i2c-irq, mpc_i2c_isr,
 IRQF_SHARED, i2c-mpc, i2c);
if (result  0) {
-   printk(KERN_ERR i2c-mpc - failed to attach 
interrupt\n);
+   printk(KERN_ERR
+  i2c-mpc - failed to attach interrupt\n);
goto fail_request;
}
}
-   
+
mpc_i2c_setclock(i2c);
 
dev_set_drvdata(op-dev, i2c);
@@ -368,7 +369,7 @@
free_irq(i2c-irq, i2c);
  fail_request:
irq_dispose_mapping(i2c-irq);
-   iounmap(i2c-base);
+   iounmap(i2c-base);
  fail_map:
kfree(i2c);
return result;
@@ -414,7 +415,7 @@
 
rv = of_register_platform_driver(mpc_i2c_driver);
if (rv)
-   printk(KERN_ERR DRV_NAME 
+   printk(KERN_ERR DRV_NAME
of_register_platform_driver failed (%i)\n, rv);
return rv;
 }
@@ -428,6 +429,6 @@
 module_exit(fsl_i2c_exit);
 
 MODULE_AUTHOR(Adrian Cox adr...@humboldt.co.uk);
-MODULE_DESCRIPTION
-(I2C-Bus adapter for MPC107 bridge and MPC824x/85xx/52xx processors);
+MODULE_DESCRIPTION(I2C-Bus adapter for MPC107 bridge and 
+  MPC824x/85xx/52xx processors);
 MODULE_LICENSE(GPL);

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v3 2/5] i2c: i2c-mpc: use dev based printout function

2009-04-07 Thread Wolfgang Grandegger
This patch used the dev_dbg, dev_err, etc. functions for debug
and error output instead of printk and pr_debug.

Signed-off-by: Wolfgang Grandegger w...@grandegger.com
---
 drivers/i2c/busses/i2c-mpc.c |   31 +--
 1 file changed, 17 insertions(+), 14 deletions(-)

Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
===
--- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c   2009-04-07 
10:09:13.271719088 +0200
+++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c2009-04-07 
10:09:14.012720756 +0200
@@ -50,6 +50,7 @@
 #define CSR_RXAK 0x01
 
 struct mpc_i2c {
+   struct device *dev;
void __iomem *base;
u32 interrupt;
wait_queue_head_t queue;
@@ -104,7 +105,7 @@
while (!(readb(i2c-base + MPC_I2C_SR)  CSR_MIF)) {
schedule();
if (time_after(jiffies, orig_jiffies + timeout)) {
-   pr_debug(I2C: timeout\n);
+   dev_dbg(i2c-dev, timeout\n);
writeccr(i2c, 0);
result = -EIO;
break;
@@ -118,7 +119,7 @@
(i2c-interrupt  CSR_MIF), timeout);
 
if (unlikely(!(i2c-interrupt  CSR_MIF))) {
-   pr_debug(I2C: wait timeout\n);
+   dev_dbg(i2c-dev, wait timeout\n);
writeccr(i2c, 0);
result = -ETIMEDOUT;
}
@@ -131,17 +132,17 @@
return result;
 
if (!(x  CSR_MCF)) {
-   pr_debug(I2C: unfinished\n);
+   dev_dbg(i2c-dev, unfinished\n);
return -EIO;
}
 
if (x  CSR_MAL) {
-   pr_debug(I2C: MAL\n);
+   dev_dbg(i2c-dev, MAL\n);
return -EIO;
}
 
if (writing  (x  CSR_RXAK)) {
-   pr_debug(I2C: No RXAK\n);
+   dev_dbg(i2c-dev, No RXAK\n);
/* generate stop */
writeccr(i2c, CCR_MEN);
return -EIO;
@@ -263,12 +264,12 @@
/* Allow bus up to 1s to become not busy */
while (readb(i2c-base + MPC_I2C_SR)  CSR_MBB) {
if (signal_pending(current)) {
-   pr_debug(I2C: Interrupted\n);
+   dev_dbg(i2c-dev, Interrupted\n);
writeccr(i2c, 0);
return -EINTR;
}
if (time_after(jiffies, orig_jiffies + HZ)) {
-   pr_debug(I2C: timeout\n);
+   dev_dbg(i2c-dev, timeout\n);
if (readb(i2c-base + MPC_I2C_SR) ==
(CSR_MCF | CSR_MBB | CSR_RXAK))
mpc_i2c_fixup(i2c);
@@ -279,9 +280,10 @@
 
for (i = 0; ret = 0  i  num; i++) {
pmsg = msgs[i];
-   pr_debug(Doing %s %d bytes to 0x%02x - %d of %d messages\n,
-pmsg-flags  I2C_M_RD ? read : write,
-pmsg-len, pmsg-addr, i + 1, num);
+   dev_dbg(i2c-dev,
+   Doing %s %d bytes to 0x%02x - %d of %d messages\n,
+   pmsg-flags  I2C_M_RD ? read : write,
+   pmsg-len, pmsg-addr, i + 1, num);
if (pmsg-flags  I2C_M_RD)
ret =
mpc_read(i2c, pmsg-addr, pmsg-buf, pmsg-len, i);
@@ -320,6 +322,8 @@
if (!i2c)
return -ENOMEM;
 
+   i2c-dev = op-dev; /* for debug and error output */
+
if (of_get_property(op-node, dfsrr, NULL))
i2c-flags |= FSL_I2C_DEV_SEPARATE_DFSRR;
 
@@ -331,7 +335,7 @@
 
i2c-base = of_iomap(op-node, 0);
if (!i2c-base) {
-   printk(KERN_ERR i2c-mpc - failed to map controller\n);
+   dev_err(i2c-dev, failed to map controller\n);
result = -ENOMEM;
goto fail_map;
}
@@ -341,8 +345,7 @@
result = request_irq(i2c-irq, mpc_i2c_isr,
 IRQF_SHARED, i2c-mpc, i2c);
if (result  0) {
-   printk(KERN_ERR
-  i2c-mpc - failed to attach interrupt\n);
+   dev_err(i2c-dev, failed to attach interrupt\n);
goto fail_request;
}
}
@@ -357,7 +360,7 @@
 
result = i2c_add_adapter(i2c-adap);
if (result  0) {
-   printk(KERN_ERR i2c-mpc - failed to add adapter\n);
+   dev_err(i2c-dev, failed to add adapter\n);
goto fail_add;
}
of_register_i2c_devices(i2c-adap, op-node);

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org

[PATCH v3 3/5] i2c: i2c-mpc: make I2C bus speed configurable

2009-04-07 Thread Wolfgang Grandegger
This patch makes the I2C bus speed configurable by using the I2C node
property clock-frequency. If the property is not defined, the old
fixed clock settings will be used for backward comptibility.

The generic I2C clock properties, especially the CPU-specific source
clock pre-scaler are defined via the OF match table:

  static const struct of_device_id mpc_i2c_of_match[] = {
...
{.compatible = fsl,mpc8543-i2c,
 .data = (struct fsl_i2c_match_data) {
.setclock = mpc_i2c_setclock_8xxx,
.prescaler = 2,
},
},

The data field defines the relevant I2C setclock function and the
relevant pre-scaler for the I2C source clock frequency.

It uses arch-specific tables and functions to determine resonable
Freqency Divider Register (fdr) values for MPC83xx, MPC85xx, MPC86xx,
MPC5200 and MPC5200B.

The i2c-flags field and the corresponding FSL_I2C_DEV_* definitions
have been removed as they are obsolete.

Signed-off-by: Wolfgang Grandegger w...@grandegger.com
---
 drivers/i2c/busses/i2c-mpc.c |  262 +++
 1 file changed, 242 insertions(+), 20 deletions(-)

Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
===
--- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c   2009-04-07 
10:09:14.012720756 +0200
+++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c2009-04-07 
10:09:14.581719146 +0200
@@ -26,6 +26,9 @@
 #include linux/interrupt.h
 #include linux/delay.h
 
+#include asm/mpc52xx.h
+#include sysdev/fsl_soc.h
+
 #define DRV_NAME mpc-i2c
 
 #define MPC_I2C_FDR   0x04
@@ -56,7 +59,18 @@
wait_queue_head_t queue;
struct i2c_adapter adap;
int irq;
-   u32 flags;
+};
+
+struct mpc_i2c_divider {
+   u16 divider;
+   u16 fdr;/* including dfsrr */
+};
+
+struct mpc_i2c_match_data {
+   void (*setclock)(struct device_node *node,
+struct mpc_i2c *i2c,
+u32 clock, u32 prescaler);
+   u32 prescaler;
 };
 
 static inline void writeccr(struct mpc_i2c *i2c, u32 x)
@@ -150,17 +164,180 @@
return 0;
 }
 
-static void mpc_i2c_setclock(struct mpc_i2c *i2c)
+#ifdef CONFIG_PPC_52xx
+static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
+   {20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23},
+   {28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02},
+   {36, 0x26}, {40, 0x27}, {44, 0x04}, {48, 0x28},
+   {52, 0x63}, {56, 0x29}, {60, 0x41}, {64, 0x2a},
+   {68, 0x07}, {72, 0x2b}, {80, 0x2c}, {88, 0x09},
+   {96, 0x2d}, {104, 0x0a}, {112, 0x2e}, {120, 0x81},
+   {128, 0x2f}, {136, 0x47}, {144, 0x0c}, {160, 0x30},
+   {176, 0x49}, {192, 0x31}, {208, 0x4a}, {224, 0x32},
+   {240, 0x0f}, {256, 0x33}, {272, 0x87}, {288, 0x10},
+   {320, 0x34}, {352, 0x89}, {384, 0x35}, {416, 0x8a},
+   {448, 0x36}, {480, 0x13}, {512, 0x37}, {576, 0x14},
+   {640, 0x38}, {768, 0x39}, {896, 0x3a}, {960, 0x17},
+   {1024, 0x3b}, {1152, 0x18}, {1280, 0x3c}, {1536, 0x3d},
+   {1792, 0x3e}, {1920, 0x1b}, {2048, 0x3f}, {2304, 0x1c},
+   {2560, 0x1d}, {3072, 0x1e}, {3584, 0x7e}, {3840, 0x1f},
+   {4096, 0x7f}, {4608, 0x5c}, {5120, 0x5d}, {6144, 0x5e},
+   {7168, 0xbe}, {7680, 0x5f}, {8192, 0xbf}, {9216, 0x9c},
+   {10240, 0x9d}, {12288, 0x9e}, {15360, 0x9f}
+};
+
+int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
+{
+   const struct mpc52xx_i2c_divider *div = NULL;
+   unsigned int pvr = mfspr(SPRN_PVR);
+   u32 divider;
+   int i;
+
+   if (!clock)
+   return -EINVAL;
+
+   /* Determine divider value */
+   divider = mpc52xx_find_ipb_freq(node) / clock;
+
+   /*
+* We want to choose an FDR/DFSR that generates an I2C bus speed that
+* is equal to or lower than the requested speed.
+*/
+   for (i = 0; i  ARRAY_SIZE(mpc52xx_i2c_dividers); i++) {
+   div = mpc_i2c_dividers_52xx[i];
+   /* Old MPC5200 rev A CPUs do not support the high bits */
+   if (div-fdr  0xc0  pvr == 0x80822011)
+   continue;
+   if (div-divider = divider)
+   break;
+   }
+
+   return div ? (int)div-fdr : -EINVAL;
+}
+
+static void mpc_i2c_setclock_52xx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
+{
+   int fdr = mpc52xx_i2c_get_fdr(node, clock, prescaler);
+
+   if (fdr  0)
+   fdr = 0x3f; /* backward compatibility */
+   writeb(fdr  0xff, i2c-base + MPC_I2C_FDR);
+   dev_info(i2c-dev, clock %d Hz (fdr=%d)\n, clock, fdr);
+}
+#else /* !CONFIG_PPC_52xx */
+static void mpc_i2c_setclock_52xx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, 

[PATCH v3 5/5] powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board

2009-04-07 Thread Wolfgang Grandegger
Preserve I2C clock settings for the Socrates MPC8544 board.

Signed-off-by: Wolfgang Grandegger w...@grandegger.com
---
 arch/powerpc/boot/dts/socrates.dts |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-2.6-galak/arch/powerpc/boot/dts/socrates.dts
===
--- linux-2.6-galak.orig/arch/powerpc/boot/dts/socrates.dts 2009-04-07 
10:09:07.161718915 +0200
+++ linux-2.6-galak/arch/powerpc/boot/dts/socrates.dts  2009-04-07 
10:09:16.207719258 +0200
@@ -79,11 +79,11 @@
#address-cells = 1;
#size-cells = 0;
cell-index = 0;
-   compatible = fsl-i2c;
+   compatible = fsl,mpc8544-i2c, fsl-i2c;
reg = 0x3000 0x100;
interrupts = 43 2;
interrupt-parent = mpic;
-   dfsrr;
+   fsl,preserve-clocking;
 
d...@28 {
compatible = winbond,w83782d;
@@ -111,11 +111,11 @@
#address-cells = 1;
#size-cells = 0;
cell-index = 1;
-   compatible = fsl-i2c;
+   compatible = fsl,mpc8544-i2c, fsl-i2c;
reg = 0x3100 0x100;
interrupts = 43 2;
interrupt-parent = mpic;
-   dfsrr;
+   fsl,preserve-clocking;
};
 
enet0: ether...@24000 {

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: wire up preadv and pwritev

2009-04-07 Thread Gerd Hoffmann

  Hi,


How about contributing the above test to LTP(http://ltp.sourceforge.net/)
under GPL ? If you agree, i would soon send you a Patch integrating the same
to LTP.


Fine with me.  You probably want to remove the hard-coded syscall 
numbers and pickup them from unistd.h instead though.


cheers,
  Gerd

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 0/4 v2] mtd: physmap_of: Add multiple regions and concatenation support

2009-04-07 Thread Stefan Roese
This patchset adds support to handle multiple non-identical chips in one
flash device tree node. It also adds concat support to physmap_of. This
makes it possible to support e.g. the Intel P30 48F4400 chip which
internally consists of 2 non-identical NOR chips on one die. Additionally
partitions now can span over multiple chips:

mtd: physmap_of: Add multiple regions and concatenation support
mtd/powerpc: Factor out MTD physmap bindings into mtd-physmap.txt
mtd/powerpc: Remove unused device-width property
mtd/powerpc: Describe multiple reg tuples usage

v2 addresses all comments from Grant Likely, including factoring out the
MTD dts bindings documentation into a separate file.

Thanks,
Stefan
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/4 v2] mtd: physmap_of: Add multiple regions and concatenation support

2009-04-07 Thread Stefan Roese
This patch adds support to handle multiple non-identical chips in one
flash device tree node. It also adds concat support to physmap_of. This
makes it possible to support e.g. the Intel P30 48F4400 chips which
internally consists of 2 non-identical NOR chips on one die. Additionally
partitions now can span over multiple chips.

To describe such a chip's, multiple reg tuples are now supported in one
flash device tree node. Here an dts example:

fl...@f000,0 {
#address-cells = 1;
#size-cells = 1;
compatible = cfi-flash;
reg = 0 0x 0x0200
   0 0x0200 0x0200;
bank-width = 2;
partit...@0 {
label = test-part1;
reg = 0 0x0400;
};
};

Signed-off-by: Stefan Roese s...@denx.de
CC: Grant Likely grant.lik...@secretlab.ca
---
Changes in ver2 (as suggested by Grant Likely):
- Removed MAX_RESOURCES introduced in ver1. Now we don't have a hard limit
  for reg tuples anymore.
- Used of_n_addr_cells() and of_n_size_cells() to determine size of each tuple.

 drivers/mtd/maps/physmap_of.c |  199 +
 1 files changed, 143 insertions(+), 56 deletions(-)

diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index c83a60f..6991aac 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -20,16 +20,23 @@
 #include linux/mtd/mtd.h
 #include linux/mtd/map.h
 #include linux/mtd/partitions.h
+#include linux/mtd/concat.h
 #include linux/of.h
 #include linux/of_platform.h
 
+struct of_flash_list {
+   struct mtd_info *mtd;
+   struct map_info map;
+   struct resource *res;
+};
+
 struct of_flash {
-   struct mtd_info *mtd;
-   struct map_info map;
-   struct resource *res;
+   struct mtd_info *cmtd;
 #ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition*parts;
 #endif
+   int list_size; /* number of elements in of_flash_list */
+   struct of_flash_listlist[0];
 };
 
 #ifdef CONFIG_MTD_PARTITIONS
@@ -88,30 +95,44 @@ static int parse_obsolete_partitions(struct of_device *dev,
 static int of_flash_remove(struct of_device *dev)
 {
struct of_flash *info;
+   int i;
 
info = dev_get_drvdata(dev-dev);
if (!info)
return 0;
dev_set_drvdata(dev-dev, NULL);
 
-   if (info-mtd) {
+#ifdef CONFIG_MTD_CONCAT
+   if (info-cmtd != info-list[0].mtd) {
+   del_mtd_device(info-cmtd);
+   mtd_concat_destroy(info-cmtd);
+   }
+#endif
+
+   if (info-cmtd) {
if (OF_FLASH_PARTS(info)) {
-   del_mtd_partitions(info-mtd);
+   del_mtd_partitions(info-cmtd);
kfree(OF_FLASH_PARTS(info));
} else {
-   del_mtd_device(info-mtd);
+   del_mtd_device(info-cmtd);
}
-   map_destroy(info-mtd);
}
 
-   if (info-map.virt)
-   iounmap(info-map.virt);
+   for (i = 0; i  info-list_size; i++) {
+   if (info-list[i].mtd)
+   map_destroy(info-list[i].mtd);
 
-   if (info-res) {
-   release_resource(info-res);
-   kfree(info-res);
+   if (info-list[i].map.virt)
+   iounmap(info-list[i].map.virt);
+
+   if (info-list[i].res) {
+   release_resource(info-list[i].res);
+   kfree(info-list[i].res);
+   }
}
 
+   kfree(info);
+
return 0;
 }
 
@@ -164,68 +185,130 @@ static int __devinit of_flash_probe(struct of_device 
*dev,
const char *probe_type = match-data;
const u32 *width;
int err;
-
-   err = -ENXIO;
-   if (of_address_to_resource(dp, 0, res)) {
-   dev_err(dev-dev, Can't get IO address from device tree\n);
+   int i;
+   int count;
+   const u32 *p;
+   int reg_tuple_size;
+   struct mtd_info **mtd_list = NULL;
+
+   reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * 4;
+
+   /*
+* Get number of reg tuples. Scan for MTD devices on area's
+* described by each reg region. This makes it possible (including
+* the concat support) to support the Intel P30 48F4400 chips which
+* consists internally of 2 non-identical NOR chips on one die.
+*/
+   p = of_get_property(dp, reg, count);
+   if (count % reg_tuple_size != 0) {
+   dev_err(dev-dev, Malformed reg property on %s\n,
+   dev-node-full_name);
+   err = -EINVAL;
goto err_out;
}
-
-   dev_dbg(dev-dev, of_flash device: %.8llx-%.8llx\n,
-   (unsigned long long)res.start, 

[PATCH 2/4 v2] mtd/powerpc: Factor out MTD physmap bindings into mtd-physmap.txt

2009-04-07 Thread Stefan Roese
Signed-off-by: Stefan Roese s...@denx.de
CC: Grant Likely grant.lik...@secretlab.ca
---
 Documentation/powerpc/booting-without-of.txt   |   89 +++-
 Documentation/powerpc/dts-bindings/mtd-physmap.txt |   63 ++
 2 files changed, 75 insertions(+), 77 deletions(-)
 create mode 100644 Documentation/powerpc/dts-bindings/mtd-physmap.txt

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index 0ab0230..d16b7a1 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -43,12 +43,11 @@ Table of Contents
 2) Representing devices without a current OF specification
   a) PHY nodes
   b) Interrupt controllers
-  c) CFI or JEDEC memory-mapped NOR flash
-  d) 4xx/Axon EMAC ethernet nodes
-  e) Xilinx IP cores
-  f) USB EHCI controllers
-  g) MDIO on GPIOs
-  h) SPI busses
+  c) 4xx/Axon EMAC ethernet nodes
+  d) Xilinx IP cores
+  e) USB EHCI controllers
+  f) MDIO on GPIOs
+  g) SPI busses
 
   VII - Marvell Discovery mv64[345]6x System Controller chips
 1) The /system-controller node
@@ -999,7 +998,7 @@ compatibility.
   translation of SOC addresses for memory mapped SOC registers.
 - bus-frequency: Contains the bus frequency for the SOC node.
   Typically, the value of this field is filled in by the boot
-  loader. 
+  loader.
 
 
   Recommended properties:
@@ -1287,71 +1286,7 @@ platforms are moved over to use the 
flattened-device-tree model.
device_type = open-pic;
};
 
-   c) CFI or JEDEC memory-mapped NOR flash
-
-Flash chips (Memory Technology Devices) are often used for solid state
-file systems on embedded devices.
-
- - compatible : should contain the specific model of flash chip(s)
-   used, if known, followed by either cfi-flash or jedec-flash
- - reg : Address range of the flash chip
- - bank-width : Width (in bytes) of the flash bank.  Equal to the
-   device width times the number of interleaved chips.
- - device-width : (optional) Width of a single flash chip.  If
-   omitted, assumed to be equal to 'bank-width'.
- - #address-cells, #size-cells : Must be present if the flash has
-   sub-nodes representing partitions (see below).  In this case
-   both #address-cells and #size-cells must be equal to 1.
-
-For JEDEC compatible devices, the following additional properties
-are defined:
-
- - vendor-id : Contains the flash chip's vendor id (1 byte).
- - device-id : Contains the flash chip's device id (1 byte).
-
-In addition to the information on the flash bank itself, the
-device tree may optionally contain additional information
-describing partitions of the flash address space.  This can be
-used on platforms which have strong conventions about which
-portions of the flash are used for what purposes, but which don't
-use an on-flash partition table such as RedBoot.
-
-Each partition is represented as a sub-node of the flash device.
-Each node's name represents the name of the corresponding
-partition of the flash device.
-
-Flash partitions
- - reg : The partition's offset and size within the flash bank.
- - label : (optional) The label / name for this flash partition.
-   If omitted, the label is taken from the node name (excluding
-   the unit address).
- - read-only : (optional) This parameter, if present, is a hint to
-   Linux that this flash partition should only be mounted
-   read-only.  This is usually used for flash partitions
-   containing early-boot firmware images or data which should not
-   be clobbered.
-
-Example:
-
-   fl...@ff00 {
-   compatible = amd,am29lv128ml, cfi-flash;
-   reg = ff00 0100;
-   bank-width = 4;
-   device-width = 1;
-   #address-cells = 1;
-   #size-cells = 1;
-   f...@0 {
-   label = fs;
-   reg = 0 f8;
-   };
-   firmw...@f8 {
-   label =firmware;
-   reg = f8 8;
-   read-only;
-   };
-   };
-
-d) 4xx/Axon EMAC ethernet nodes
+c) 4xx/Axon EMAC ethernet nodes
 
 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
 the Axon bridge.  To operate this needs to interact with a ths
@@ -1499,7 +1434,7 @@ platforms are moved over to use the flattened-device-tree 
model.
   available.
   For Axon: 0x012a
 
-   e) Xilinx IP cores
+   d) Xilinx IP cores
 
The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
in Xilinx Spartan and Virtex FPGAs.  The devices cover the whole range
@@ -1761,7 +1696,7 @@ platforms are moved over to use the 

[PATCH 3/4 v2] mtd/powerpc: Remove unused device-width property

2009-04-07 Thread Stefan Roese
This property is unused. It's not handled as all by the physmap_of
driver. So let's remove it from the documentation.

Signed-off-by: Stefan Roese s...@denx.de
CC: Grant Likely grant.lik...@secretlab.ca
---
 Documentation/powerpc/dts-bindings/mtd-physmap.txt |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/Documentation/powerpc/dts-bindings/mtd-physmap.txt 
b/Documentation/powerpc/dts-bindings/mtd-physmap.txt
index cd474f9..ab1115e 100644
--- a/Documentation/powerpc/dts-bindings/mtd-physmap.txt
+++ b/Documentation/powerpc/dts-bindings/mtd-physmap.txt
@@ -8,8 +8,6 @@ file systems on embedded devices.
  - reg : Address range of the flash chip
  - bank-width : Width (in bytes) of the flash bank.  Equal to the
device width times the number of interleaved chips.
- - device-width : (optional) Width of a single flash chip.  If
-   omitted, assumed to be equal to 'bank-width'.
  - #address-cells, #size-cells : Must be present if the flash has
sub-nodes representing partitions (see below).  In this case
both #address-cells and #size-cells must be equal to 1.
@@ -48,7 +46,6 @@ Example:
compatible = amd,am29lv128ml, cfi-flash;
reg = ff00 0100;
bank-width = 4;
-   device-width = 1;
#address-cells = 1;
#size-cells = 1;
f...@0 {
-- 
1.6.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 4/4 v2] mtd/powerpc: Describe multiple reg tuples usage

2009-04-07 Thread Stefan Roese
Signed-off-by: Stefan Roese s...@denx.de
CC: Grant Likely grant.lik...@secretlab.ca
---
 Documentation/powerpc/dts-bindings/mtd-physmap.txt |   20 +++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/Documentation/powerpc/dts-bindings/mtd-physmap.txt 
b/Documentation/powerpc/dts-bindings/mtd-physmap.txt
index ab1115e..a3fa9e0 100644
--- a/Documentation/powerpc/dts-bindings/mtd-physmap.txt
+++ b/Documentation/powerpc/dts-bindings/mtd-physmap.txt
@@ -5,7 +5,10 @@ file systems on embedded devices.
 
  - compatible : should contain the specific model of flash chip(s)
used, if known, followed by either cfi-flash or jedec-flash
- - reg : Address range of the flash chip
+ - reg : Address range(s) of the flash chip(s)
+   It's possible to (optionally) define multiple reg tuples so that the
+   Intel P30 48F4400 chip which consists internally of 2 non-identical
+   NOR chips on one die can also be supported.
  - bank-width : Width (in bytes) of the flash bank.  Equal to the
device width times the number of interleaved chips.
  - #address-cells, #size-cells : Must be present if the flash has
@@ -58,3 +61,18 @@ Example:
read-only;
};
};
+
+Here an example with multiple reg tuples (e.g. Intel P30):
+
+   fl...@f000,0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = cfi-flash;
+   reg = 0 0x 0x0200
+  0 0x0200 0x0200;
+   bank-width = 2;
+   partit...@0 {
+   label = test-part1;
+   reg = 0 0x0400;
+   };
+   };
-- 
1.6.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [LTP] [PATCH] powerpc: wire up preadv and pwritev

2009-04-07 Thread Subrata Modak
Thanks Gerd/Stephen,

On Tue, 2009-04-07 at 09:52 +0200, Gerd Hoffmann wrote:
 Hi,
 
  How about contributing the above test to LTP(http://ltp.sourceforge.net/)
  under GPL ? If you agree, i would soon send you a Patch integrating the same
  to LTP.
 
 Fine with me.  You probably want to remove the hard-coded syscall 
 numbers and pickup them from unistd.h instead though.

Sure. We will do some necessary changes, and you will shortly hear from
us the Patch to integrate, and, retaining your Copyright on the test
program.

Regards--
Subrata

 
 cheers,
Gerd
 
 
 --
 This SF.net email is sponsored by:
 High Quality Requirements in a Collaborative Environment.
 Download a free trial of Rational Requirements Composer Now!
 http://p.sf.net/sfu/www-ibm-com
 ___
 Ltp-list mailing list
 ltp-l...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ltp-list

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: Recap: Kernel oops while duming user core.

2009-04-07 Thread Fredrik Arnerup
 -Original Message-
 From: Scott Wood [mailto:scottw...@freescale.com] 
 Sent: Monday, April 06, 2009 8:27 PM
 To: Fredrik Arnerup
 Cc: linuxppc-dev@ozlabs.org
 Subject: Re: Recap: Kernel oops while duming user core.

 On Mon, Apr 06, 2009 at 05:23:12PM +0200, Fredrik Arnerup wrote:
  Was the kernel oops when dumping core ever resolved?
  (http://ozlabs.org/pipermail/linuxppc-dev/2008-February/051080.html,
quoted
  below)
 
 What was the cause? Is there a patch? A bug tracker ticket?

 It was fixed here:
 http://ozlabs.org/pipermail/linuxppc-dev/2008-February/051350.html

  Using ELDK here, so still running 2.6.24 ...

 Please consider upgrading.

 -Scott

Thanks! Works with the ppc arch too.

/Fredrik


--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -483,7 +483,12 @@ void update_mmu_cache(struct vm_area_struct *vma,
unsigned long address,
 */
_tlbie(address, 0 /* 8xx doesn't care about PID */);
 #endif
-   if (!PageReserved(page)
+   /* The _PAGE_USER test should really be _PAGE_EXEC, but
+* older glibc versions execute some code from no-exec
+* pages, which for now we are supporting.  If exec-only
+* pages are ever implemented, this will have to change.
+*/
+   if (!PageReserved(page)  (pte_val(pte)  _PAGE_USER)
 !test_bit(PG_arch_1, page-flags)) {
if (vma-vm_mm == current-active_mm) {
__flush_dcache_icache((void *) address);


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Fix oops when loading modules

2009-04-07 Thread Geert Uytterhoeven
On Tue, 7 Apr 2009, Paul Mackerras wrote:
 This fixes a problem reported by Sean MacLennan where loading any
 module would cause an oops.  We weren't marking the pages containing
 the module text as having hardware execute permission, due to a bug
 introduced in commit 8d1cf34e (powerpc/mm: Tweak PTE bit combination
 definitions), hence trying to execute the module text caused an
 exception on processors that support hardware execute permission.
 
 This adds _PAGE_HWEXEC to the definitions of PAGE_KERNEL_X and
 PAGE_KERNEL_ROX to fix this problem.
 
 Reported-by: Sean MacLennan smaclen...@pikatech.com
 Signed-off-by: Paul Mackerras pau...@samba.org

Tested-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
(on Sequoia)

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   geert.uytterhoe...@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


How CPC925 HyperTransport Host Interface mapps NMI request?

2009-04-07 Thread Cao Qingtao
Hi Michael,
 
Thanks for commenting on my CPC925 EDAC driver. I am on vacation this week and 
will integrate your suggestions next week.
 
I am also thinking of adding EDAC NMI support for the AMD8131 chip, which is a 
HyperTransport Tunnel device that hosts two PCI-X bridges. If enabled, each 
PCI-X bridge could generate NMI interrupt request package upstream, with vector 
identifier = 0. 
 
The CPC925 user mannual, p111, says that This interrupt vector is used to set 
a corresponding interrupt latch, does this mean MPIC interrupt pin#0 would be 
latched on receiving NMI request package?
 
However, the pin#0 has been specified for Internal I2C master interrupt, so it 
would have to share hwirq #0 with NMI interrupt?
 
Thanks a lot!
 
Best regards,
 
Harry


  ___ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] powerpc: Add configurable -Werror for arch/powerpc

2009-04-07 Thread Olof Johansson
On Tue, Apr 07, 2009 at 03:01:33AM +, Michael Ellerman wrote:
 On Mon, 2009-04-06 at 21:27 -0500, Olof Johansson wrote:
  On Tue, Apr 07, 2009 at 12:00:41PM +1000, Michael Ellerman wrote:
   Add an option, on by default, to build all code under arch/powerpc with
   -Werror, which causes gcc to treat warnings as errors.
   
   The intention is to make it harder for people to inadvertantly introduce
   errors in the arch/powerpc code. It needs to be configurable so that
   if a warning is introduced, people can easily work around it while it's
   being fixed.
  
  This looks useful at least for the automated builds to catch new warnings,
  but do similar options exist on other architectures, x86 in particular? I
  think a Cc to LKML of this could be useful.
  
  This is really only beneficial if various people build for powerpc often
  enough. If major subsystem maintainers aren't going to hit the errors
  it's more of a hinderance for PPC than a global benefit, right?
 
 I don't think so. We're only enabling it for code under arch/powerpc -
 and most modifications to that code should come through linuxppc.

Good point.

 It's still possible that random stuff will get merged, or that someone
 will change code in a header that only causes warnings on powerpc, but
 it's less likely.
 
 And that's why it's an option, if someone breaks the build we can work
 around it until they're appropriately LARTed.

Yeah, sounds good to me.


-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc: 85xx: Add PHY fixup to socrates board code

2009-04-07 Thread Anatolij Gustschin
If the firmware missed to initialize the PHY correctly,
Linux may hang up on socrates while eth0/eth1 interface
startup (caused by continuous unacknowledged PHY interrupt).

This patch adds PHY fixup to socrates platform code to
ensure the PHY is pre-initialized correctly. It is needed
to be compatible with older firmware.

Signed-off-by: Anatolij Gustschin ag...@denx.de
---
 arch/powerpc/platforms/85xx/socrates.c |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/socrates.c 
b/arch/powerpc/platforms/85xx/socrates.c
index d0e8443..2275a39 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -28,6 +28,7 @@
 #include linux/delay.h
 #include linux/seq_file.h
 #include linux/of_platform.h
+#include linux/phy.h
 
 #include asm/system.h
 #include asm/time.h
@@ -78,6 +79,21 @@ static void __init socrates_pic_init(void)
of_node_put(np);
 }
 
+static int socrates_m88e1121_fixup(struct phy_device *phydev)
+{
+   int err;
+
+   err = phy_write(phydev, 0x12, 0);
+   if (err  0)
+   return err;
+
+   err = phy_read(phydev, 0x13);
+   if (err  0)
+   return err;
+
+   return 0;
+}
+
 /*
  * Setup the architecture
  */
@@ -105,6 +121,8 @@ static struct of_device_id __initdata socrates_of_bus_ids[] 
= {
 static void __init socrates_init(void)
 {
of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL);
+   phy_register_fixup_for_uid(0x1410cb0, 0xff0,
+  socrates_m88e1121_fixup);
 }
 
 /*
-- 
1.5.6.3

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code

2009-04-07 Thread Anton Vorontsov
On Tue, Apr 07, 2009 at 04:19:48PM +0200, Anatolij Gustschin wrote:
 If the firmware missed to initialize the PHY correctly,
 Linux may hang up on socrates while eth0/eth1 interface
 startup (caused by continuous unacknowledged PHY interrupt).
 
 This patch adds PHY fixup to socrates platform code to
 ensure the PHY is pre-initialized correctly. It is needed
 to be compatible with older firmware.

Is that really board-specific fixup, or can it be placed
somewhere inside drivers/net/phy/marvell.c?

Has this fixup any effect after phy power down/up sequence?
Otherwise you may encounter same problem after suspend/resume.

 Signed-off-by: Anatolij Gustschin ag...@denx.de
 ---
  arch/powerpc/platforms/85xx/socrates.c |   18 ++
  1 files changed, 18 insertions(+), 0 deletions(-)
 
 diff --git a/arch/powerpc/platforms/85xx/socrates.c 
 b/arch/powerpc/platforms/85xx/socrates.c
 index d0e8443..2275a39 100644
 --- a/arch/powerpc/platforms/85xx/socrates.c
 +++ b/arch/powerpc/platforms/85xx/socrates.c
 @@ -28,6 +28,7 @@
  #include linux/delay.h
  #include linux/seq_file.h
  #include linux/of_platform.h
 +#include linux/phy.h
  
  #include asm/system.h
  #include asm/time.h
 @@ -78,6 +79,21 @@ static void __init socrates_pic_init(void)
   of_node_put(np);
  }
  
 +static int socrates_m88e1121_fixup(struct phy_device *phydev)
 +{
 + int err;
 +
 + err = phy_write(phydev, 0x12, 0);

Do you know the proper names for 0x12 and 0x13 registers
on that chip?

 + if (err  0)
 + return err;
 +
 + err = phy_read(phydev, 0x13);
 + if (err  0)
 + return err;
 +
 + return 0;
 +}
 +
  /*
   * Setup the architecture
   */
 @@ -105,6 +121,8 @@ static struct of_device_id __initdata 
 socrates_of_bus_ids[] = {
  static void __init socrates_init(void)
  {
   of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL);
 + phy_register_fixup_for_uid(0x1410cb0, 0xff0,
 +socrates_m88e1121_fixup);
  }
  
  /*
 -- 
 1.5.6.3

Thanks,

-- 
Anton Vorontsov
email: cbouatmai...@gmail.com
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: issue at the beginning of kernel booting

2009-04-07 Thread Sauce.Cheng

thanks Scott 's following

 I don't quite follow the above, but what I meant is that you need to
 put a mapping in place that covers your LED I/O once you have the MMU on.
 Any mappings that U-boot made will be gone at that point.

i am sorry for my poor expression. i think i have got your meaning about
that.
the suggestion from others that the situation that external access will be
disabled at early booting time. i guess that means like yours, sometimes I/O
disabled due to cache operating or something.

certainly, if i have to turn LEDs at booting time, the way your said is the
best. but i supposed i could operate LEDs after early booting time. 

 i tried 
 CONFIG_PPC_EARLY_DEBUG_CPM=y 
 CONFIG_PPC_EARLY_DEBUG_CPM_ADDR=0xf0008  
 how can i make sure CPM_ADDR, 0xf008 is default value 

 Look at the u-boot source, or dump the memory and see if it looks like a
 ring buffer.

sorry, i mean that CPM_ADDR is address of what? address of CPM registers or
something?

 This is a dts-v0 tree, which implies it's fairly old.
dose later dts be used in corresponding kernel version ?

i guess i must read booting-without-of.txt. many of contents in dts i have
no idea.

in addition, there is one more question. 
my RAM size is 32MBytes, my vmlinux size is 30MBytes, vmlinux.o size is
58MBytes. so , will there be something wrong at uncompressing time ?

Sauce
-- 
View this message in context: 
http://www.nabble.com/issue-at-the-beginning-of-kernel-booting-tp22741532p22930588.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: issue at the beginning of kernel booting

2009-04-07 Thread Sauce.Cheng

evolution! kernel 2.6.11 has run on the board with u-boot 1.1.4, also, at
early booting time LEDs are disabled due to MMU on and off. so i tried to
turn LEDs on after start_kernel function, wow, blinking! that is before
start_kernel will be done successfully. then i modified registers mapping in
immap_cpm2.h and configure smc1 as serial. console worked normally.
booting info as following
U-Boot 1.1.4 (Apr  2 2009 - 20:05:19)

MPC8272 Reset Status: External Soft, External Hard

MPC8272 Clock Configuration
 - Bus-to-Core Mult 4x, VCO Div 2, 60x Bus Freq  25-75 , Core Freq 100-300
 - dfbrg 1, corecnf 0x1a, busdf 3, cpmdf 1, plldf 0, pllmf 3
 - vco_out  4, scc_clk  1, brg_clk   2500
 - cpu_clk  4, cpm_clk  2, bus_clk  1

Board: Motorola MPC8272ADS
DRAM:  32 MB
FLASH: 512 kB
In:serial
Out:   serial
Err:   serial
Net:   FCC1 ETHERNET
Hit any key to stop autoboot:  0 
Using FCC1 ETHERNET device
TFTP from server 192.168.0.99; our IP address is 192.168.0.100
Filename 'uImage'.
Load address: 0x40
Loading: #
 #
 ###
done
Bytes transferred = 781091 (beb23 hex)
= bootm

## Booting image at 0040 ...
   Image Name:   Linux-2.6.11
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:781027 Bytes = 762.7 kB
   Load Address: 
   Entry Point:  
   Verifying Checksum ... OK
OK
Linux version 2.6.11 (r...@localhost.localdomain) (gcc version 4.0.0 (DENX
ELDK 4.0 4.0.0)) #49 Tue Apr 7 04:11:56 EDT 2009

Motorola PQ2 ADS PowerPC port

Built 1 zonelists

Kernel command line: mem=32M console=ttyCPM0,9600 root=/dev/mtdblock0 rw
rootfstype=jffs2

PID hash table entries: 256 (order: 8, 4096 bytes)

Warning: real time clock seems stuck!

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 30728k available (1304k kernel code, 276k data, 104k init, 0k
highmem)

Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

Chengmo : Here will enter rest_init()!

NET: Registered protocol family 16

PCI: Probing PCI hardware

Generic RTC Driver v1.07

Serial: CPM driver $Revision: 0.01 $

ttyCPM0 at MMIO 0xf0011a80 (irq = 4) is a CPM UART

io scheduler noop registered

io scheduler anticipatory registered

io scheduler deadline registered

io scheduler cfq registered

RAMDISK driver initialized: 16 RAM disks of 32768K size 1024 blocksize

loop: loaded (max 8 devices)

halt here~
i have tried to build newer kernel and bootloader. but LEDs were not
blinking at start_kernel, i guessed something wrong with dts, i should check
OF doc and dts. 
-- 
View this message in context: 
http://www.nabble.com/issue-at-the-beginning-of-kernel-booting-tp22741532p22931181.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Add configurable -Werror for arch/powerpc

2009-04-07 Thread Kumar Gala


On Apr 6, 2009, at 9:00 PM, Michael Ellerman wrote:

Add an option, on by default, to build all code under arch/powerpc  
with

-Werror, which causes gcc to treat warnings as errors.

The intention is to make it harder for people to inadvertantly  
introduce

errors in the arch/powerpc code. It needs to be configurable so that
if a warning is introduced, people can easily work around it while  
it's

being fixed.

Signed-off-by: Michael Ellerman mich...@ellerman.id.au
---
arch/powerpc/Kconfig.debug  |8 
arch/powerpc/kernel/Makefile|4 
arch/powerpc/kvm/Makefile   |4 
arch/powerpc/lib/Makefile   |4 
arch/powerpc/mm/Makefile|4 
arch/powerpc/oprofile/Makefile  |4 
arch/powerpc/platforms/Makefile |4 
arch/powerpc/sysdev/Makefile|4 
arch/powerpc/xmon/Makefile  |4 
9 files changed, 40 insertions(+), 0 deletions(-)

v2: Leave math-emu alone, it's a steaming pile of warnings.


Acked-by: Kumar Gala ga...@kernel.crashing.org

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc/4xx: Sequoia: Enable NAND support

2009-04-07 Thread Stefan Roese
Now that the 4xx NAND driver is available again in arch/powerpc, let's
enable it on Sequoia. This patch also disables the early debug messages
(CONFIG_PPC_EARLY_DEBUG) in the Sequoia defconfig.

Signed-off-by: Stefan Roese s...@denx.de
---
 arch/powerpc/boot/dts/sequoia.dts  |   22 ++
 arch/powerpc/configs/44x/sequoia_defconfig |  109 ++--
 2 files changed, 94 insertions(+), 37 deletions(-)

diff --git a/arch/powerpc/boot/dts/sequoia.dts 
b/arch/powerpc/boot/dts/sequoia.dts
index 43cc68b..739dd0d 100644
--- a/arch/powerpc/boot/dts/sequoia.dts
+++ b/arch/powerpc/boot/dts/sequoia.dts
@@ -199,6 +199,28 @@
};
};
 
+   n...@3,0 {
+   compatible = ibm,ndfc;
+   reg = 0x0003 0x 
0x2000;
+   ccr = 0x1000;
+   bank-settings = 0x8000;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   nand {
+   #address-cells = 1;
+   #size-cells = 1;
+
+   partit...@0 {
+   label = u-boot;
+   reg = 0x 
0x00084000;
+   };
+   partit...@84000 {
+   label = user;
+   reg = 0x 
0x01f7c000;
+   };
+   };
+   };
};
 
UART0: ser...@ef600300 {
diff --git a/arch/powerpc/configs/44x/sequoia_defconfig 
b/arch/powerpc/configs/44x/sequoia_defconfig
index a921fe3..0dd7d3b 100644
--- a/arch/powerpc/configs/44x/sequoia_defconfig
+++ b/arch/powerpc/configs/44x/sequoia_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.29-rc2
-# Tue Jan 20 08:22:45 2009
+# Linux kernel version: 2.6.29
+# Tue Apr  7 17:04:52 2009
 #
 # CONFIG_PPC64 is not set
 
@@ -57,6 +57,7 @@ CONFIG_GENERIC_BUG=y
 CONFIG_PPC_DCR_NATIVE=y
 # CONFIG_PPC_DCR_MMIO is not set
 CONFIG_PPC_DCR=y
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
 CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
 
 #
@@ -74,6 +75,15 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_GROUP_SCHED=y
@@ -88,8 +98,12 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
 CONFIG_EMBEDDED=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
@@ -99,10 +113,8 @@ 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
@@ -112,10 +124,12 @@ CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_PCI_QUIRKS=y
 CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=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_EFFICIENT_UNALIGNED_ACCESS=y
@@ -123,6 +137,7 @@ CONFIG_HAVE_IOREMAP_PROT=y
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_SLOW_WORK is not set
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -135,7 +150,6 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_BLOCK=y
 CONFIG_LBD=y
-# CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set
 
@@ -151,11 +165,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED=anticipatory
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
-# CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_FREEZER is not set
 # CONFIG_PPC4xx_PCI_EXPRESS is not set
 
@@ -176,6 +185,7 @@ CONFIG_SEQUOIA=y
 # CONFIG_ARCHES is not set
 # CONFIG_CANYONLANDS is not set
 # CONFIG_GLACIER 

Re: [PATCH v3 3/5] i2c: i2c-mpc: make I2C bus speed configurable

2009-04-07 Thread Grant Likely
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger w...@grandegger.com wrote:
 This patch makes the I2C bus speed configurable by using the I2C node
 property clock-frequency. If the property is not defined, the old
 fixed clock settings will be used for backward comptibility.

 The generic I2C clock properties, especially the CPU-specific source
 clock pre-scaler are defined via the OF match table:

  static const struct of_device_id mpc_i2c_of_match[] = {
        ...
        {.compatible = fsl,mpc8543-i2c,
         .data = (struct fsl_i2c_match_data) {
                        .setclock = mpc_i2c_setclock_8xxx,
                        .prescaler = 2,
                },
        },

 The data field defines the relevant I2C setclock function and the
 relevant pre-scaler for the I2C source clock frequency.

 It uses arch-specific tables and functions to determine resonable
 Freqency Divider Register (fdr) values for MPC83xx, MPC85xx, MPC86xx,
 MPC5200 and MPC5200B.

 The i2c-flags field and the corresponding FSL_I2C_DEV_* definitions
 have been removed as they are obsolete.

 Signed-off-by: Wolfgang Grandegger w...@grandegger.com

I haven't tested it, but it looks good and I trust Wolfgang.

Acked-by: Grant Likely grant.lik...@secretlab.ca

 ---
  drivers/i2c/busses/i2c-mpc.c |  262 
 +++
  1 file changed, 242 insertions(+), 20 deletions(-)

 Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
 ===
 --- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c   2009-04-07 
 10:09:14.012720756 +0200
 +++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c        2009-04-07 
 10:09:14.581719146 +0200
 @@ -26,6 +26,9 @@
  #include linux/interrupt.h
  #include linux/delay.h

 +#include asm/mpc52xx.h
 +#include sysdev/fsl_soc.h
 +
  #define DRV_NAME mpc-i2c

  #define MPC_I2C_FDR   0x04
 @@ -56,7 +59,18 @@
        wait_queue_head_t queue;
        struct i2c_adapter adap;
        int irq;
 -       u32 flags;
 +};
 +
 +struct mpc_i2c_divider {
 +       u16 divider;
 +       u16 fdr;        /* including dfsrr */
 +};
 +
 +struct mpc_i2c_match_data {
 +       void (*setclock)(struct device_node *node,
 +                        struct mpc_i2c *i2c,
 +                        u32 clock, u32 prescaler);
 +       u32 prescaler;
  };

  static inline void writeccr(struct mpc_i2c *i2c, u32 x)
 @@ -150,17 +164,180 @@
        return 0;
  }

 -static void mpc_i2c_setclock(struct mpc_i2c *i2c)
 +#ifdef CONFIG_PPC_52xx
 +static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
 +       {20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23},
 +       {28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02},
 +       {36, 0x26}, {40, 0x27}, {44, 0x04}, {48, 0x28},
 +       {52, 0x63}, {56, 0x29}, {60, 0x41}, {64, 0x2a},
 +       {68, 0x07}, {72, 0x2b}, {80, 0x2c}, {88, 0x09},
 +       {96, 0x2d}, {104, 0x0a}, {112, 0x2e}, {120, 0x81},
 +       {128, 0x2f}, {136, 0x47}, {144, 0x0c}, {160, 0x30},
 +       {176, 0x49}, {192, 0x31}, {208, 0x4a}, {224, 0x32},
 +       {240, 0x0f}, {256, 0x33}, {272, 0x87}, {288, 0x10},
 +       {320, 0x34}, {352, 0x89}, {384, 0x35}, {416, 0x8a},
 +       {448, 0x36}, {480, 0x13}, {512, 0x37}, {576, 0x14},
 +       {640, 0x38}, {768, 0x39}, {896, 0x3a}, {960, 0x17},
 +       {1024, 0x3b}, {1152, 0x18}, {1280, 0x3c}, {1536, 0x3d},
 +       {1792, 0x3e}, {1920, 0x1b}, {2048, 0x3f}, {2304, 0x1c},
 +       {2560, 0x1d}, {3072, 0x1e}, {3584, 0x7e}, {3840, 0x1f},
 +       {4096, 0x7f}, {4608, 0x5c}, {5120, 0x5d}, {6144, 0x5e},
 +       {7168, 0xbe}, {7680, 0x5f}, {8192, 0xbf}, {9216, 0x9c},
 +       {10240, 0x9d}, {12288, 0x9e}, {15360, 0x9f}
 +};
 +
 +int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
 +{
 +       const struct mpc52xx_i2c_divider *div = NULL;
 +       unsigned int pvr = mfspr(SPRN_PVR);
 +       u32 divider;
 +       int i;
 +
 +       if (!clock)
 +               return -EINVAL;
 +
 +       /* Determine divider value */
 +       divider = mpc52xx_find_ipb_freq(node) / clock;
 +
 +       /*
 +        * We want to choose an FDR/DFSR that generates an I2C bus speed that
 +        * is equal to or lower than the requested speed.
 +        */
 +       for (i = 0; i  ARRAY_SIZE(mpc52xx_i2c_dividers); i++) {
 +               div = mpc_i2c_dividers_52xx[i];
 +               /* Old MPC5200 rev A CPUs do not support the high bits */
 +               if (div-fdr  0xc0  pvr == 0x80822011)
 +                       continue;
 +               if (div-divider = divider)
 +                       break;
 +       }
 +
 +       return div ? (int)div-fdr : -EINVAL;
 +}
 +
 +static void mpc_i2c_setclock_52xx(struct device_node *node,
 +                                 struct mpc_i2c *i2c,
 +                                 u32 clock, u32 prescaler)
 +{
 +       int fdr = mpc52xx_i2c_get_fdr(node, clock, prescaler);
 +
 +       if (fdr  0)
 +               fdr = 0x3f; /* backward compatibility */
 +       

Re: [PATCH v3 1/5] i2c: i2c-mpc: various coding style fixes

2009-04-07 Thread Grant Likely
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger w...@grandegger.com wrote:
 Fix errors reported by checkpatch (indention, long lines, trailing
 white space, etc.).

 Signed-off-by: Wolfgang Grandegger w...@grandegger.com

Acked-by: Grant Likely grant.lik...@secretlab.ca

 ---
  drivers/i2c/busses/i2c-mpc.c |   35 ++-
  1 file changed, 18 insertions(+), 17 deletions(-)

 Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
 ===
 --- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c   2009-04-07 
 10:09:09.400719216 +0200
 +++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c        2009-04-07 
 10:09:13.271719088 +0200
 @@ -20,7 +20,7 @@
  #include linux/of_platform.h
  #include linux/of_i2c.h

 -#include asm/io.h
 +#include linux/io.h
  #include linux/fsl_devices.h
  #include linux/i2c.h
  #include linux/interrupt.h
 @@ -28,10 +28,10 @@

  #define DRV_NAME mpc-i2c

 -#define MPC_I2C_FDR    0x04
 -#define MPC_I2C_CR     0x08
 -#define MPC_I2C_SR     0x0c
 -#define MPC_I2C_DR     0x10
 +#define MPC_I2C_FDR   0x04
 +#define MPC_I2C_CR    0x08
 +#define MPC_I2C_SR    0x0c
 +#define MPC_I2C_DR    0x10
  #define MPC_I2C_DFSRR 0x14

  #define CCR_MEN  0x80
 @@ -58,7 +58,7 @@
        u32 flags;
  };

 -static __inline__ void writeccr(struct mpc_i2c *i2c, u32 x)
 +static inline void writeccr(struct mpc_i2c *i2c, u32 x)
  {
        writeb(x, i2c-base + MPC_I2C_CR);
  }
 @@ -100,8 +100,7 @@
        u32 x;
        int result = 0;

 -       if (i2c-irq == NO_IRQ)
 -       {
 +       if (i2c-irq == NO_IRQ) {
                while (!(readb(i2c-base + MPC_I2C_SR)  CSR_MIF)) {
                        schedule();
                        if (time_after(jiffies, orig_jiffies + timeout)) {
 @@ -176,7 +175,7 @@
  }

  static int mpc_write(struct mpc_i2c *i2c, int target,
 -                    const u8 * data, int length, int restart)
 +                    const u8 *data, int length, int restart)
  {
        int i, result;
        unsigned timeout = i2c-adap.timeout;
 @@ -207,7 +206,7 @@
  }

  static int mpc_read(struct mpc_i2c *i2c, int target,
 -                   u8 * data, int length, int restart)
 +                   u8 *data, int length, int restart)
  {
        unsigned timeout = i2c-adap.timeout;
        int i, result;
 @@ -311,7 +310,8 @@
        .timeout = HZ,
  };

 -static int __devinit fsl_i2c_probe(struct of_device *op, const struct 
 of_device_id *match)
 +static int __devinit fsl_i2c_probe(struct of_device *op,
 +                                  const struct of_device_id *match)
  {
        int result = 0;
        struct mpc_i2c *i2c;
 @@ -341,11 +341,12 @@
                result = request_irq(i2c-irq, mpc_i2c_isr,
                                     IRQF_SHARED, i2c-mpc, i2c);
                if (result  0) {
 -                       printk(KERN_ERR i2c-mpc - failed to attach 
 interrupt\n);
 +                       printk(KERN_ERR
 +                              i2c-mpc - failed to attach interrupt\n);
                        goto fail_request;
                }
        }
 -
 +
        mpc_i2c_setclock(i2c);

        dev_set_drvdata(op-dev, i2c);
 @@ -368,7 +369,7 @@
        free_irq(i2c-irq, i2c);
  fail_request:
        irq_dispose_mapping(i2c-irq);
 -       iounmap(i2c-base);
 +       iounmap(i2c-base);
  fail_map:
        kfree(i2c);
        return result;
 @@ -414,7 +415,7 @@

        rv = of_register_platform_driver(mpc_i2c_driver);
        if (rv)
 -               printk(KERN_ERR DRV_NAME
 +               printk(KERN_ERR DRV_NAME
                        of_register_platform_driver failed (%i)\n, rv);
        return rv;
  }
 @@ -428,6 +429,6 @@
  module_exit(fsl_i2c_exit);

  MODULE_AUTHOR(Adrian Cox adr...@humboldt.co.uk);
 -MODULE_DESCRIPTION
 -    (I2C-Bus adapter for MPC107 bridge and MPC824x/85xx/52xx processors);
 +MODULE_DESCRIPTION(I2C-Bus adapter for MPC107 bridge and 
 +                  MPC824x/85xx/52xx processors);
  MODULE_LICENSE(GPL);





-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v3 2/5] i2c: i2c-mpc: use dev based printout function

2009-04-07 Thread Grant Likely
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger w...@grandegger.com wrote:
 This patch used the dev_dbg, dev_err, etc. functions for debug
 and error output instead of printk and pr_debug.

 Signed-off-by: Wolfgang Grandegger w...@grandegger.com

Acked-by: Grant Likely grant.lik...@secretlab.ca

 ---
  drivers/i2c/busses/i2c-mpc.c |   31 +--
  1 file changed, 17 insertions(+), 14 deletions(-)

 Index: linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c
 ===
 --- linux-2.6-galak.orig/drivers/i2c/busses/i2c-mpc.c   2009-04-07 
 10:09:13.271719088 +0200
 +++ linux-2.6-galak/drivers/i2c/busses/i2c-mpc.c        2009-04-07 
 10:09:14.012720756 +0200
 @@ -50,6 +50,7 @@
  #define CSR_RXAK 0x01

  struct mpc_i2c {
 +       struct device *dev;
        void __iomem *base;
        u32 interrupt;
        wait_queue_head_t queue;
 @@ -104,7 +105,7 @@
                while (!(readb(i2c-base + MPC_I2C_SR)  CSR_MIF)) {
                        schedule();
                        if (time_after(jiffies, orig_jiffies + timeout)) {
 -                               pr_debug(I2C: timeout\n);
 +                               dev_dbg(i2c-dev, timeout\n);
                                writeccr(i2c, 0);
                                result = -EIO;
                                break;
 @@ -118,7 +119,7 @@
                        (i2c-interrupt  CSR_MIF), timeout);

                if (unlikely(!(i2c-interrupt  CSR_MIF))) {
 -                       pr_debug(I2C: wait timeout\n);
 +                       dev_dbg(i2c-dev, wait timeout\n);
                        writeccr(i2c, 0);
                        result = -ETIMEDOUT;
                }
 @@ -131,17 +132,17 @@
                return result;

        if (!(x  CSR_MCF)) {
 -               pr_debug(I2C: unfinished\n);
 +               dev_dbg(i2c-dev, unfinished\n);
                return -EIO;
        }

        if (x  CSR_MAL) {
 -               pr_debug(I2C: MAL\n);
 +               dev_dbg(i2c-dev, MAL\n);
                return -EIO;
        }

        if (writing  (x  CSR_RXAK)) {
 -               pr_debug(I2C: No RXAK\n);
 +               dev_dbg(i2c-dev, No RXAK\n);
                /* generate stop */
                writeccr(i2c, CCR_MEN);
                return -EIO;
 @@ -263,12 +264,12 @@
        /* Allow bus up to 1s to become not busy */
        while (readb(i2c-base + MPC_I2C_SR)  CSR_MBB) {
                if (signal_pending(current)) {
 -                       pr_debug(I2C: Interrupted\n);
 +                       dev_dbg(i2c-dev, Interrupted\n);
                        writeccr(i2c, 0);
                        return -EINTR;
                }
                if (time_after(jiffies, orig_jiffies + HZ)) {
 -                       pr_debug(I2C: timeout\n);
 +                       dev_dbg(i2c-dev, timeout\n);
                        if (readb(i2c-base + MPC_I2C_SR) ==
                            (CSR_MCF | CSR_MBB | CSR_RXAK))
                                mpc_i2c_fixup(i2c);
 @@ -279,9 +280,10 @@

        for (i = 0; ret = 0  i  num; i++) {
                pmsg = msgs[i];
 -               pr_debug(Doing %s %d bytes to 0x%02x - %d of %d messages\n,
 -                        pmsg-flags  I2C_M_RD ? read : write,
 -                        pmsg-len, pmsg-addr, i + 1, num);
 +               dev_dbg(i2c-dev,
 +                       Doing %s %d bytes to 0x%02x - %d of %d messages\n,
 +                       pmsg-flags  I2C_M_RD ? read : write,
 +                       pmsg-len, pmsg-addr, i + 1, num);
                if (pmsg-flags  I2C_M_RD)
                        ret =
                            mpc_read(i2c, pmsg-addr, pmsg-buf, pmsg-len, i);
 @@ -320,6 +322,8 @@
        if (!i2c)
                return -ENOMEM;

 +       i2c-dev = op-dev; /* for debug and error output */
 +
        if (of_get_property(op-node, dfsrr, NULL))
                i2c-flags |= FSL_I2C_DEV_SEPARATE_DFSRR;

 @@ -331,7 +335,7 @@

        i2c-base = of_iomap(op-node, 0);
        if (!i2c-base) {
 -               printk(KERN_ERR i2c-mpc - failed to map controller\n);
 +               dev_err(i2c-dev, failed to map controller\n);
                result = -ENOMEM;
                goto fail_map;
        }
 @@ -341,8 +345,7 @@
                result = request_irq(i2c-irq, mpc_i2c_isr,
                                     IRQF_SHARED, i2c-mpc, i2c);
                if (result  0) {
 -                       printk(KERN_ERR
 -                              i2c-mpc - failed to attach interrupt\n);
 +                       dev_err(i2c-dev, failed to attach interrupt\n);
                        goto fail_request;
                }
        }
 @@ -357,7 +360,7 @@

        result = i2c_add_adapter(i2c-adap);
        if (result  0) {
 -               printk(KERN_ERR i2c-mpc - failed to add adapter\n);
 +               dev_err(i2c-dev, failed to add adapter\n);
                goto fail_add;
        }
        

Re: [PATCH v3 4/5] powerpc: i2c-mpc: document new FSL I2C bindings and cleanup

2009-04-07 Thread Grant Likely
On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger w...@grandegger.com wrote:
 This patch documents the new bindings for the MPC I2C bus driver.
 Furthermore, it removes obsolete FSL device related definitions
 for I2C.
 It should go through the appropriate PowerPC maintainer(s) hands.

 Signed-off-by: Wolfgang Grandegger w...@grandegger.com

Acked-by: Grant Likely grant.lik...@secretlab.ca

 ---
  Documentation/powerpc/dts-bindings/fsl/i2c.txt |   46 
 -
  include/linux/fsl_devices.h                    |    4 --
  2 files changed, 31 insertions(+), 19 deletions(-)

 Index: linux-2.6-galak/Documentation/powerpc/dts-bindings/fsl/i2c.txt
 ===
 --- linux-2.6-galak.orig/Documentation/powerpc/dts-bindings/fsl/i2c.txt 
 2009-04-07 10:09:08.185721241 +0200
 +++ linux-2.6-galak/Documentation/powerpc/dts-bindings/fsl/i2c.txt      
 2009-04-07 10:09:15.413719535 +0200
 @@ -7,8 +7,10 @@

  Recommended properties :

 - - compatible : Should be fsl-i2c for parts compatible with
 -   Freescale I2C specifications.
 + - compatible : compatibility list with 2 entries, the first should
 +   be fsl,CHIP-i2c where CHIP is the name of a compatible processor,
 +   e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one
 +   should be fsl-i2c.
  - interrupts : a b where a is the interrupt number and b is a
    field that represents an encoding of the sense and level
    information for the interrupt.  This should be encoded based on
 @@ -16,17 +18,31 @@
    controller you have.
  - interrupt-parent : the phandle for the interrupt controller that
    services interrupts for this device.
 - - dfsrr : boolean; if defined, indicates that this I2C device has
 -   a digital filter sampling rate register
 - - fsl5200-clocking : boolean; if defined, indicated that this device
 -   uses the FSL 5200 clocking mechanism.
 -
 -Example :
 -       i...@3000 {
 -               interrupt-parent = 4;
 -               interrupts = 1b 3;
 -               reg = 3000 18;
 -               device_type = i2c;
 -               compatible  = fsl-i2c;
 -               dfsrr;
 + - fsl,preserve-clocking : boolean; if defined, the clock settings
 +   from the bootloader are preserved (not touched).
 + - clock-frequency : desired I2C bus clock frequency in Hz.
 +
 +Examples :
 +
 +       i...@3d00 {
 +               #address-cells = 1;
 +               #size-cells = 0;
 +               compatible = fsl,mpc5200b-i2c,fsl,mpc5200-i2c,fsl-i2c;
 +               cell-index = 0;
 +               reg = 0x3d00 0x40;
 +               interrupts = 2 15 0;
 +               interrupt-parent = mpc5200_pic;
 +               fsl,preserve-clocking;
        };
 +
 +       i...@3100 {
 +               #address-cells = 1;
 +               #size-cells = 0;
 +               cell-index = 1;
 +               compatible = fsl,mpc8544-i2c, fsl-i2c;
 +               reg = 0x3100 0x100;
 +               interrupts = 43 2;
 +               interrupt-parent = mpic;
 +               clock-frequency = 40;
 +       };
 +
 Index: linux-2.6-galak/include/linux/fsl_devices.h
 ===
 --- linux-2.6-galak.orig/include/linux/fsl_devices.h    2009-04-07 
 10:09:08.185721241 +0200
 +++ linux-2.6-galak/include/linux/fsl_devices.h 2009-04-07 10:09:15.414719119 
 +0200
 @@ -43,10 +43,6 @@
  *
  */

 -/* Flags related to I2C device features */
 -#define FSL_I2C_DEV_SEPARATE_DFSRR     0x0001
 -#define FSL_I2C_DEV_CLOCK_5200         0x0002
 -
  enum fsl_usb2_operating_modes {
        FSL_USB2_MPH_HOST,
        FSL_USB2_DR_HOST,





-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


AMCC 440EP phy detection

2009-04-07 Thread Eddie Dawydiuk

Hello,

I'm working on a board based on the Yosemite AMCC 440EP eval board. I'm having 
some difficulty getting both network interfaces working. The first problem I 
found is the ibm_newemac driver was detecting the two phys at address 0 and 1 
where we have them wired for addresses 1 and 3. As a result I hardcoded the 
phy-address in the dts file. I then found I was able to receive and send data on 
eth1(phy-address 3) without incident. Although I found eth0 can receive data but 
I see no packets being transmitted(using a packet sniffer) and I see no 
indication from a software standpoint of any transmit failures. We are using 
Micrel KSZ8041FTL phys(RMII mode) where the Yosemite board used Micrel KS8721BL 
phys.  I've reviewed the schematic and it appears both phys are connected 
identically and I've seen this same failure on multiple boards. I thought the 
fact that the driver detected a phy at address 0 might be a clue, but I can't 
make much of the clue. So I thought I'd post this info in the hopes someone else 
might have run into a similar problem or have a suggestion.


--
Best Regards,

 Eddie Dawydiuk, Technologic Systems | voice:  (480) 837-5200
 16525 East Laser Drive  | fax:(480) 837-5300
 Fountain Hills, AZ 85268| web: www.embeddedARM.com
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/4 v2] mtd/powerpc: Remove unused device-width property

2009-04-07 Thread Scott Wood

Stefan Roese wrote:

This property is unused. It's not handled as all by the physmap_of
driver. So let's remove it from the documentation.

Signed-off-by: Stefan Roese s...@denx.de
CC: Grant Likely grant.lik...@secretlab.ca


The device tree describes the hardware, not what Linux happens to do 
with it at the moment.


I'd rather keep it.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: AMCC 440EP phy detection

2009-04-07 Thread Feng Kan

Hi Eddie:

Are you able to ping in u-boot? Sounded like you were only pinging in linux.
I would try the mii command in uboot. It seems like it detected the 
phys. Try enable the
loopbacks at the different stages to see if the traffic is returning. 
This excerise is

much easier in uboot than linux.


Feng Kan
AMCC Software

Eddie Dawydiuk wrote:

Hello,

I'm working on a board based on the Yosemite AMCC 440EP eval board. I'm having 
some difficulty getting both network interfaces working. The first problem I 
found is the ibm_newemac driver was detecting the two phys at address 0 and 1 
where we have them wired for addresses 1 and 3. As a result I hardcoded the 
phy-address in the dts file. I then found I was able to receive and send data on 
eth1(phy-address 3) without incident. Although I found eth0 can receive data but 
I see no packets being transmitted(using a packet sniffer) and I see no 
indication from a software standpoint of any transmit failures. We are using 
Micrel KSZ8041FTL phys(RMII mode) where the Yosemite board used Micrel KS8721BL 
phys.  I've reviewed the schematic and it appears both phys are connected 
identically and I've seen this same failure on multiple boards. I thought the 
fact that the driver detected a phy at address 0 might be a clue, but I can't 
make much of the clue. So I thought I'd post this info in the hopes someone else 
might have run into a similar problem or have a suggestion.


  


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/4 v2] mtd/powerpc: Remove unused device-width property

2009-04-07 Thread Stefan Roese
On Tuesday 07 April 2009, Scott Wood wrote:
 Stefan Roese wrote:
  This property is unused. It's not handled as all by the physmap_of
  driver. So let's remove it from the documentation.
 
  Signed-off-by: Stefan Roese s...@denx.de
  CC: Grant Likely grant.lik...@secretlab.ca

 The device tree describes the hardware, not what Linux happens to do
 with it at the moment.

 I'd rather keep it.

I find it rather confusing to see such bindings that are not supported. One 
could expect something to happen/change after defining this property. So in 
general I think adding unsupported properties to the Documentation is a bad 
idea. But that's just my 2 cents. If the general opinion is to keep this 
property, I'll keep it in of course.

Best regards,
Stefan
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: AMCC 440EP phy detection

2009-04-07 Thread Grant Likely
On Tue, Apr 7, 2009 at 9:32 AM, Eddie Dawydiuk ed...@embeddedarm.com wrote:
 Hello,

 I'm working on a board based on the Yosemite AMCC 440EP eval board. I'm
 having some difficulty getting both network interfaces working. The first
 problem I found is the ibm_newemac driver was detecting the two phys at
 address 0 and 1 where we have them wired for addresses 1 and 3. As a result
 I hardcoded the phy-address in the dts file. I then found I was able to
 receive and send data on eth1(phy-address 3) without incident. Although I
 found eth0 can receive data but I see no packets being transmitted(using a
 packet sniffer) and I see no indication from a software standpoint of any
 transmit failures. We are using Micrel KSZ8041FTL phys(RMII mode) where the
 Yosemite board used Micrel KS8721BL phys.  I've reviewed the schematic and
 it appears both phys are connected identically and I've seen this same
 failure on multiple boards. I thought the fact that the driver detected a
 phy at address 0 might be a clue, but I can't make much of the clue. So I
 thought I'd post this info in the hopes someone else might have run into a
 similar problem or have a suggestion.

Phy address 0 is the broadcast address.  All phys will usually respond
to address 0 accesses.  Off the top of my head, It sounds like one PHY
is responding to addresses 0  1, and the other phy isn't responding
at all.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: AMCC 440EP phy detection

2009-04-07 Thread Stefan Roese
On Tuesday 07 April 2009, Grant Likely wrote:
 Phy address 0 is the broadcast address.  All phys will usually respond
 to address 0 accesses.

Not all. Some (e.g. LXT971) can be used at this address. But you're correct,  
it's definitely a bad idea to use 0 as an PHY address.

Not sure how the Micrel reacts here. The datasheet could help...

Best regards,
Stefan
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code

2009-04-07 Thread Anatolij Gustschin
Anton Vorontsov wrote:
 On Tue, Apr 07, 2009 at 04:19:48PM +0200, Anatolij Gustschin wrote:
 If the firmware missed to initialize the PHY correctly,
 Linux may hang up on socrates while eth0/eth1 interface
 startup (caused by continuous unacknowledged PHY interrupt).

 This patch adds PHY fixup to socrates platform code to
 ensure the PHY is pre-initialized correctly. It is needed
 to be compatible with older firmware.
 
 Is that really board-specific fixup, or can it be placed
 somewhere inside drivers/net/phy/marvell.c?

On this board the multi-PHY is configured to use shared IRQ pin
for both PHY ports. Placing this fixup in drivers/net/phy/marvell.c
as e.g. '.config_init' callback could be done, but this will add
more overhead as the fixup routine have to do more work:

acquire 'struct mii_bus' pointer and walk through all registered PHYs
searching for the PHY which use the same interrupt, then getting
the address of this PHY on the bus and disable and clear PHY irqs
by writing/reading to/from this PHY, (but only in the case it was
not already brought up and has interrupts enabled!) e.g.:

struct mii_bus *bus = phydev-bus;
int addr;

for (addr = 0; addr  PHY_MAX_ADDR; addr++) {
struct phy_device *phy = bus-phy_map[addr];

if (addr != phydev-addr  bus-irq[addr] == phydev-irq 
(phy-phy_id  0x0ff0) == 0x01410cb0 
!(phy-interrupts  PHY_INTERRUPT_ENABLED)) {

int imask = phy_read(phy, MII_M1011_IMASK);

if (imask) {
phy_write(phy, 0x12, 0); /* disable */
phy_read(phy, 0x13); /* clear */
}
}
}

All this to allow support for multiple m88e1121 devices.
Otherwise, after registering first phy interrupt handler
and enabling interrupt pending irq on other PHY port or
other PHY device will lock up the board.

The fixup in this patch will only be done while mdio bus scan
before registering a PHY device.

 Has this fixup any effect after phy power down/up sequence?
 Otherwise you may encounter same problem after suspend/resume.

No, do we need it after phy power down/up sequence?
If each phy interrupt handler remains registered and the phy is
only stopped  (phydev-state == PHY_HALTED) we don't have
this problem, i think. And we do not use PM on this board.
 
 Signed-off-by: Anatolij Gustschin ag...@denx.de
 ---
  arch/powerpc/platforms/85xx/socrates.c |   18 ++
  1 files changed, 18 insertions(+), 0 deletions(-)

 diff --git a/arch/powerpc/platforms/85xx/socrates.c 
 b/arch/powerpc/platforms/85xx/socrates.c
 index d0e8443..2275a39 100644
 --- a/arch/powerpc/platforms/85xx/socrates.c
 +++ b/arch/powerpc/platforms/85xx/socrates.c
 @@ -28,6 +28,7 @@
  #include linux/delay.h
  #include linux/seq_file.h
  #include linux/of_platform.h
 +#include linux/phy.h
  
  #include asm/system.h
  #include asm/time.h
 @@ -78,6 +79,21 @@ static void __init socrates_pic_init(void)
  of_node_put(np);
  }
  
 +static int socrates_m88e1121_fixup(struct phy_device *phydev)
 +{
 +int err;
 +
 +err = phy_write(phydev, 0x12, 0);
 
 Do you know the proper names for 0x12 and 0x13 registers
 on that chip?

Marvell PHY driver defines them as MII_M1011_IMASK and
MII_M1011_IEVENT respectively. I can use these defines
here too. The data sheet is under NDA.

Thanks,
Anatolij
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Fix tlbilx opcode

2009-04-07 Thread Peter Bergner
On Mon, 2009-04-06 at 15:36 -0500, Kumar Gala wrote:
 The tlbilx opcode was not matching the Power ISA 2.06 arch spec.
 The old opcode was an early suggested opcode that changed during the
 2.06 architecture process.
[snip]
  #define PPC_INST_STSWI   0x7c0005aa
  #define PPC_INST_STSWX   0x7c00052a
 -#define PPC_INST_TLBILX  0x7c000626
 +#define PPC_INST_TLBILX  0x7c24
  #define PPC_INST_WAIT0x7c7c

How do you want to handle the current binutils code that implements tlbilx
and its extended mnemonics?  Should they be changed to use secondary opcode
18 instead of 787 as per the ISA 2.06 doc?

  {tlbilx,  X(31,787),  X_MASK,  E500MC,PPCNONE,{T, 
RA0, RB}},
  {tlbilxlpid,  XTO(31,787,0),  XTO_MASK,E500MC,PPCNONE,{0}},
  {tlbilxpid,   XTO(31,787,1),  XTO_MASK,E500MC,PPCNONE,{0}},
  {tlbilxva,XTO(31,787,3),  XTO_MASK,E500MC,PPCNONE,{RA0, 
RB}},

If you want to change the tlbilx entry to use 18 rather than 787, let me
know whether you want me to make the change or whether you (Edmar?) will
handle it.

I'll note the extended mnemonics should be moved before tlbilx so that the
disassembler will use them (if appropriate) instead of the base instruction.


Peter



___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Fix tlbilx opcode

2009-04-07 Thread Kumar Gala


On Apr 7, 2009, at 12:36 PM, Peter Bergner wrote:


On Mon, 2009-04-06 at 15:36 -0500, Kumar Gala wrote:

The tlbilx opcode was not matching the Power ISA 2.06 arch spec.
The old opcode was an early suggested opcode that changed during the
2.06 architecture process.

[snip]

#define PPC_INST_STSWI  0x7c0005aa
#define PPC_INST_STSWX  0x7c00052a
-#define PPC_INST_TLBILX0x7c000626
+#define PPC_INST_TLBILX0x7c24
#define PPC_INST_WAIT   0x7c7c


How do you want to handle the current binutils code that implements  
tlbilx
and its extended mnemonics?  Should they be changed to use secondary  
opcode

18 instead of 787 as per the ISA 2.06 doc?


YES ! :)

 {tlbilx,  X(31,787),  X_MASK,  E500MC, 
PPCNONE,{T, RA0, RB}},
 {tlbilxlpid,  XTO(31,787,0),  XTO_MASK,E500MC, 
PPCNONE,{0}},
 {tlbilxpid,   XTO(31,787,1),  XTO_MASK,E500MC, 
PPCNONE,{0}},
 {tlbilxva,XTO(31,787,3),  XTO_MASK,E500MC, 
PPCNONE,{RA0, RB}},


If you want to change the tlbilx entry to use 18 rather than 787,  
let me
know whether you want me to make the change or whether you (Edmar?)  
will

handle it.

I'll note the extended mnemonics should be moved before tlbilx so  
that the
disassembler will use them (if appropriate) instead of the base  
instruction.


I'll check w/Edmar.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: issue at the beginning of kernel booting

2009-04-07 Thread Scott Wood

Sauce.Cheng wrote:
i tried 
CONFIG_PPC_EARLY_DEBUG_CPM=y 
CONFIG_PPC_EARLY_DEBUG_CPM_ADDR=0xf0008	
how can i make sure CPM_ADDR, 0xf008 is default value 



Look at the u-boot source, or dump the memory and see if it looks like a
ring buffer.


sorry, i mean that CPM_ADDR is address of what? address of CPM registers or
something?


It's the address of a transmit descriptor for the serial port.  It's 
typically in DPRAM, but the exact position depends on where u-boot put 
it.  Try 0xf088.



This is a dts-v0 tree, which implies it's fairly old.

dose later dts be used in corresponding kernel version ?


Yes, current kernels use dts-v1.

in addition, there is one more question. 
my RAM size is 32MBytes, my vmlinux size is 30MBytes, vmlinux.o size is

58MBytes. so , will there be something wrong at uncompressing time ?


That's just debugging information; it won't end up in the uImage.  Use 
the size utility in your toolchain to see how big the actual code and 
data are.


-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc/oprofile: dump_pmcs() is not used

2009-04-07 Thread Kumar Gala


On Apr 6, 2009, at 9:03 AM, Kumar Gala wrote:



On Apr 6, 2009, at 8:45 AM, Michael Ellerman wrote:


Signed-off-by: Michael Ellerman mich...@ellerman.id.au
---
arch/powerpc/oprofile/op_model_fsl_emb.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

Or should we just remove it?


I'm for removing it if Andy doesn't have any issues.  Someone can  
always add it back as debugfs code in the future if they want it.


I chatted w/Andy and we both agreed to just remove the code rather  
than #if 0 it.  If you send me a patch with that I'll apply it.


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Printk time stamp seems to be stuck.

2009-04-07 Thread Subodh Nijsure
I  am running PPC kernel (2.6.26) with .config that contains
CONFIG_PRINTK_TIME=y also I am booting kernel with parameter printk.time=1. 
I am also booting the kernel with option initcall_debug and I see following
output after setup_vmstat() the printk timestamp feature stops working. 
i.e. after call to setup_vmstat all printk messages have same timestamp...
 
 
[4.294855] calling  pdflush_init+0x0/0x28()
[4.294926] initcall pdflush_init+0x0/0x28() returned 0 after 0 msecs
[4.294931] calling  kswapd_init+0x0/0x2c()
[4.294962] initcall kswapd_init+0x0/0x2c() returned 0 after 0 msecs
[4.294966] calling  setup_vmstat+0x0/0x74()
[4.294966] initcall setup_vmstat+0x0/0x74() returned 0 after 0 msecs
[4.294966] calling  init_emergency_pool+0x0/0x84()
[4.294966] highmem bounce pool size: 64 pages
 
Has anybody else seen this or there is something odd with my kernel/board
setup.


/Subodh Nijsure
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code

2009-04-07 Thread Anton Vorontsov
On Tue, Apr 07, 2009 at 07:24:12PM +0200, Anatolij Gustschin wrote:
 Anton Vorontsov wrote:
  On Tue, Apr 07, 2009 at 04:19:48PM +0200, Anatolij Gustschin wrote:
  If the firmware missed to initialize the PHY correctly,
  Linux may hang up on socrates while eth0/eth1 interface
  startup (caused by continuous unacknowledged PHY interrupt).
 
  This patch adds PHY fixup to socrates platform code to
  ensure the PHY is pre-initialized correctly. It is needed
  to be compatible with older firmware.
  
  Is that really board-specific fixup, or can it be placed
  somewhere inside drivers/net/phy/marvell.c?
 
 On this board the multi-PHY is configured to use shared IRQ pin
 for both PHY ports. Placing this fixup in drivers/net/phy/marvell.c
 as e.g. '.config_init' callback could be done, but this will add
 more overhead as the fixup routine have to do more work:
 
 acquire 'struct mii_bus' pointer and walk through all registered PHYs
 searching for the PHY which use the same interrupt, then getting
 the address of this PHY on the bus and disable and clear PHY irqs
 by writing/reading to/from this PHY, (but only in the case it was
 not already brought up and has interrupts enabled!) e.g.:
 
 struct mii_bus *bus = phydev-bus;
 int addr;
 
 for (addr = 0; addr  PHY_MAX_ADDR; addr++) {
   struct phy_device *phy = bus-phy_map[addr];
 
   if (addr != phydev-addr  bus-irq[addr] == phydev-irq 
   (phy-phy_id  0x0ff0) == 0x01410cb0 
   !(phy-interrupts  PHY_INTERRUPT_ENABLED)) {
 
   int imask = phy_read(phy, MII_M1011_IMASK);
 
   if (imask) {
   phy_write(phy, 0x12, 0); /* disable */
   phy_read(phy, 0x13); /* clear */
   }
   }
 }
 
 All this to allow support for multiple m88e1121 devices.
 Otherwise, after registering first phy interrupt handler
 and enabling interrupt pending irq on other PHY port or
 other PHY device will lock up the board.
 
 The fixup in this patch will only be done while mdio bus scan
 before registering a PHY device.

Still, I think you shouldn't do this in a board-specific fixup.
Maybe I'm a bit naive, but shouldn't this work too?

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index b754020..9052937 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -205,6 +205,16 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int 
addr)
 
phydev-bus = bus;
 
+   /*
+* Some PHYs may have unmasked/pending interrupts, this might
+* cause troubles w/ shared IRQs. So try to put the PHYs into
+* some sane state.
+*
+* NOTE: This won't work if you have two PHYs w/ shared IRQs
+*   on different MDIO buses.
+*/
+   phy_disable_interrupts(phydev);
+
/* Run all of the fixups for this PHY */
phy_scan_fixups(phydev);
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: 85xx: Add PHY fixup to socrates board code

2009-04-07 Thread Anton Vorontsov
On Tue, Apr 07, 2009 at 10:09:57PM +0400, Anton Vorontsov wrote:
[...]
 Still, I think you shouldn't do this in a board-specific fixup.
 Maybe I'm a bit naive, but shouldn't this work too?

Yes, I'm naive. The phydev isn't yet bound to any driver, so we
can't call phy_disable_interrupts().

And I don't see any proper solution. :-( After all, it appears
we'll have to live with the board fixup.

 diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
 index b754020..9052937 100644
 --- a/drivers/net/phy/mdio_bus.c
 +++ b/drivers/net/phy/mdio_bus.c
 @@ -205,6 +205,16 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int 
 addr)
  
   phydev-bus = bus;
  
 + /*
 +  * Some PHYs may have unmasked/pending interrupts, this might
 +  * cause troubles w/ shared IRQs. So try to put the PHYs into
 +  * some sane state.
 +  *
 +  * NOTE: This won't work if you have two PHYs w/ shared IRQs
 +  *   on different MDIO buses.
 +  */
 + phy_disable_interrupts(phydev);
 +
   /* Run all of the fixups for this PHY */
   phy_scan_fixups(phydev);
  

-- 
Anton Vorontsov
email: cbouatmai...@gmail.com
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: AMCC 440EP phy detection

2009-04-07 Thread Eddie Dawydiuk

Feng,


Are you able to ping in u-boot? Sounded like you were only pinging in 
linux.


We are not using u-boot, we've written a custom bootloader. I see there are a 
few debugging flags in the emac driver I can enable, I'll do that next to look 
into the problem further. Thanks for the response.


I would try the mii command in uboot. It seems like it detected the 
phys. Try enable the
loopbacks at the different stages to see if the traffic is returning. 
This excerise is

much easier in uboot than linux.


Feng Kan
AMCC Software

Eddie Dawydiuk wrote:

Hello,

I'm working on a board based on the Yosemite AMCC 440EP eval board. 
I'm having some difficulty getting both network interfaces working. 
The first problem I found is the ibm_newemac driver was detecting the 
two phys at address 0 and 1 where we have them wired for addresses 1 
and 3. As a result I hardcoded the phy-address in the dts file. I then 
found I was able to receive and send data on eth1(phy-address 3) 
without incident. Although I found eth0 can receive data but I see no 
packets being transmitted(using a packet sniffer) and I see no 
indication from a software standpoint of any transmit failures. We are 
using Micrel KSZ8041FTL phys(RMII mode) where the Yosemite board used 
Micrel KS8721BL phys.  I've reviewed the schematic and it appears both 
phys are connected identically and I've seen this same failure on 
multiple boards. I thought the fact that the driver detected a phy at 
address 0 might be a clue, but I can't make much of the clue. So I 
thought I'd post this info in the hopes someone else might have run 
into a similar problem or have a suggestion.


  





--
Best Regards,

 Eddie Dawydiuk, Technologic Systems | voice:  (480) 837-5200
 16525 East Laser Drive  | fax:(480) 837-5300
 Fountain Hills, AZ 85268| web: www.embeddedARM.com
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Fix tlbilx opcode

2009-04-07 Thread Peter Bergner
On Tue, 2009-04-07 at 12:54 -0500, Kumar Gala wrote:
 On Apr 7, 2009, at 12:36 PM, Peter Bergner wrote:
  How do you want to handle the current binutils code that implements tlbilx
  and its extended mnemonics?  Should they be changed to use secondary opcode
  18 instead of 787 as per the ISA 2.06 doc?
 
 YES ! :)

The ISA 2.06 documentation states the secondary opcode used by tlbilx and
its extended mnemonics is 18 and not 787 which the current code uses.
This patch fixes the typo, as well as reordering the extended mnemonics
so they are listed in the opcodes table before the base tlbilx insn, so
that objdump will attempt to use them before the base insn.

This built and make checks fine, so I committed this as obvious.

Peter


opcodes/
* ppc-opc.c (powerpc_opcodes) tlbilxlpid, tlbilxpid, tlbilxva,
tlbilx: Use secondary opcode 18 as per the ISA 2.06 documentation.
Reorder entries so the extended mnemonics are listed before tlbilx.

gas/testsuite/
* gas/ppc/e500mc.d: Update to match extended mnemonics.

Index: gas/testsuite/gas/ppc/e500mc.d
===
RCS file: /cvs/src/src/gas/testsuite/gas/ppc/e500mc.d,v
retrieving revision 1.3
diff -u -p -r1.3 e500mc.d
--- gas/testsuite/gas/ppc/e500mc.d  26 Feb 2009 22:07:33 -  1.3
+++ gas/testsuite/gas/ppc/e500mc.d  7 Apr 2009 18:15:23 -
@@ -50,7 +50,8 @@ Disassembly of section \.text:
   a0:  7c 64 29 fe dcbtstep r3,r4,r5
   a4:  7c c7 42 7e dcbtep  r6,r7,r8
   a8:  7c 0b 67 fe dcbzep  r11,r12
-  ac:  7c 00 06 26 tlbilx  0,0,r0
-  b0:  7c 20 06 26 tlbilx  1,0,r0
-  b4:  7c 62 1e 26 tlbilx  3,r2,r3
-  b8:  7c 64 2e 26 tlbilx  3,r4,r5
+  ac:  7c 00 00 24 tlbilxlpid
+  b0:  7c 20 00 24 tlbilxpid
+  b4:  7c 62 18 24 tlbilxva r2,r3
+  b8:  7c 64 28 24 tlbilxva r4,r5
+
Index: opcodes/ppc-opc.c
===
RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
retrieving revision 1.120
diff -u -p -r1.120 ppc-opc.c
--- opcodes/ppc-opc.c   2 Apr 2009 13:30:56 -   1.120
+++ opcodes/ppc-opc.c   7 Apr 2009 18:15:24 -
@@ -3464,6 +3464,11 @@ const struct powerpc_opcode powerpc_opco
 
 {isellt, X(31,15),   X_MASK,  PPCISEL,   PPCNONE,{RT, 
RA, RB}},
 
+{tlbilxlpid, XTO(31,18,0),   XTO_MASK,E500MC,PPCNONE,{0}},
+{tlbilxpid,  XTO(31,18,1),   XTO_MASK,E500MC,PPCNONE,{0}},
+{tlbilxva,   XTO(31,18,3),   XTO_MASK,E500MC,PPCNONE,{RA0, 
RB}},
+{tlbilx, X(31,18),   X_MASK,  E500MC,PPCNONE,{T, 
RA0, RB}},
+
 {mfcr,   XFXM(31,19,0,0), XFXFXM_MASK, POWER4,   PPCNONE,{RT, 
FXM4}},
 {mfcr,   XFXM(31,19,0,0), XRARB_MASK, COM,   POWER4, {RT}},
 {mfocrf, XFXM(31,19,0,1), XFXFXM_MASK, COM,  PPCNONE,{RT, 
FXM}},
@@ -4551,10 +4556,6 @@ const struct powerpc_opcode powerpc_opco
 {lxvw4x, X(31,780),  XX1_MASK,PPCVSX,PPCNONE,{XT6, 
RA, RB}},
 
 {tlbivax,X(31,786),  XRT_MASK,BOOKE, PPCNONE,{RA, 
RB}},
-{tlbilx, X(31,787),  X_MASK,  E500MC,PPCNONE,{T, 
RA0, RB}},
-{tlbilxlpid, XTO(31,787,0),  XTO_MASK,E500MC,PPCNONE,{0}},
-{tlbilxpid,  XTO(31,787,1),  XTO_MASK,E500MC,PPCNONE,{0}},
-{tlbilxva,   XTO(31,787,3),  XTO_MASK,E500MC,PPCNONE,{RA0, 
RB}},
 
 {lwzcix, X(31,789),  X_MASK,  POWER6,PPCNONE,{RT, 
RA0, RB}},
 


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Hotplug on PPC4xx

2009-04-07 Thread Sean MacLennan
On Mon, 6 Apr 2009 18:20:23 -0400
Sean MacLennan sean.maclen...@ottawa.kanatek.ca wrote:

 I am trying to run the /sbin/hotplug from the kernel and it doesn't
 work. Has anybody got it running?

I looked into it some more. It turns out that the env pointers are
freed before they are copied.

In kobject_uevent_env() if I change the line that calls the helper from
UMH_NO_WAIT to UMH_WAIT_EXEC, then it works... but probably at a loss
of performance.

retval = call_usermodehelper(argv[0], argv,
 env-envp, UMH_WAIT_EXEC);

Any other ideas?

Cheers,
   Sean
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc/oprofile: Remove unused dump_pmcs() in FSL oprofile

2009-04-07 Thread Michael Ellerman
It's still in the git history if anyone wants it.

Signed-off-by: Michael Ellerman mich...@ellerman.id.au
---
 arch/powerpc/oprofile/op_model_fsl_emb.c |   14 --
 1 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/oprofile/op_model_fsl_emb.c 
b/arch/powerpc/oprofile/op_model_fsl_emb.c
index 91596f6..62312ab 100644
--- a/arch/powerpc/oprofile/op_model_fsl_emb.c
+++ b/arch/powerpc/oprofile/op_model_fsl_emb.c
@@ -228,20 +228,6 @@ static void pmc_stop_ctrs(void)
mtpmr(PMRN_PMGC0, pmgc0);
 }
 
-static void dump_pmcs(void)
-{
-   printk(pmgc0: %x\n, mfpmr(PMRN_PMGC0));
-   printk(pmc\t\tpmlca\t\tpmlcb\n);
-   printk(%8x\t%8x\t%8x\n, mfpmr(PMRN_PMC0),
-   mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
-   printk(%8x\t%8x\t%8x\n, mfpmr(PMRN_PMC1),
-   mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
-   printk(%8x\t%8x\t%8x\n, mfpmr(PMRN_PMC2),
-   mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
-   printk(%8x\t%8x\t%8x\n, mfpmr(PMRN_PMC3),
-   mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
-}
-
 static int fsl_emb_cpu_setup(struct op_counter_config *ctr)
 {
int i;
-- 
1.6.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc/oprofile: dump_pmcs() is not used

2009-04-07 Thread Michael Ellerman
On Tue, 2009-04-07 at 14:42 -0500, Kumar Gala wrote:
 On Apr 6, 2009, at 9:03 AM, Kumar Gala wrote:
 
 
  On Apr 6, 2009, at 8:45 AM, Michael Ellerman wrote:
 
  Signed-off-by: Michael Ellerman mich...@ellerman.id.au
  ---
  arch/powerpc/oprofile/op_model_fsl_emb.c |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
 
  Or should we just remove it?
 
  I'm for removing it if Andy doesn't have any issues.  Someone can  
  always add it back as debugfs code in the future if they want it.
 
 I chatted w/Andy and we both agreed to just remove the code rather  
 than #if 0 it.  If you send me a patch with that I'll apply it.

Cool, done.

Delegated to you in patchwork too. I was going to mark the old one as
superseded but I won't mess with it while it's delegated to you.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: AMCC 440EP phy detection

2009-04-07 Thread Eddie Dawydiuk

Hello,

Thanks for the suggestions :)

I found the ibm_newemac driver(2.6.29) makes the assumption that the bootloader 
has already configured the tx enable pin as it is a multiplexed pin. 
Unfortuantley I am not using U-Boot and our minimal bootloader does not do this. 
 After finding tx enable was never asserting for Eth0 a quick user space 
program verified tx enable was configured as a GPIO pin.



On Tue, Apr 7, 2009 at 9:32 AM, Eddie Dawydiuk ed...@embeddedarm.com wrote:

Hello,

I'm working on a board based on the Yosemite AMCC 440EP eval board. I'm
having some difficulty getting both network interfaces working. The first
problem I found is the ibm_newemac driver was detecting the two phys at
address 0 and 1 where we have them wired for addresses 1 and 3. As a result
I hardcoded the phy-address in the dts file. I then found I was able to
receive and send data on eth1(phy-address 3) without incident. Although I
found eth0 can receive data but I see no packets being transmitted(using a
packet sniffer) and I see no indication from a software standpoint of any
transmit failures. We are using Micrel KSZ8041FTL phys(RMII mode) where the
Yosemite board used Micrel KS8721BL phys.  I've reviewed the schematic and
it appears both phys are connected identically and I've seen this same
failure on multiple boards. I thought the fact that the driver detected a
phy at address 0 might be a clue, but I can't make much of the clue. So I
thought I'd post this info in the hopes someone else might have run into a
similar problem or have a suggestion.


Phy address 0 is the broadcast address.  All phys will usually respond
to address 0 accesses.  Off the top of my head, It sounds like one PHY
is responding to addresses 0  1, and the other phy isn't responding
at all.

g.




--
Best Regards,

 Eddie Dawydiuk, Technologic Systems | voice:  (480) 837-5200
 16525 East Laser Drive  | fax:(480) 837-5300
 Fountain Hills, AZ 85268| web: www.embeddedARM.com
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Hotplug on PPC4xx

2009-04-07 Thread Michael Ellerman
On Tue, 2009-04-07 at 19:27 -0400, Sean MacLennan wrote:
 On Mon, 6 Apr 2009 18:20:23 -0400
 Sean MacLennan sean.maclen...@ottawa.kanatek.ca wrote:
 
  I am trying to run the /sbin/hotplug from the kernel and it doesn't
  work. Has anybody got it running?
 
 I looked into it some more. It turns out that the env pointers are
 freed before they are copied.

That sounds like a bug?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: ahci: drop intx manipulation on msi enable breaks ULI M1575

2009-04-07 Thread Michael Ellerman
On Tue, 2009-04-07 at 19:36 -0500, Timur Tabi wrote:
 On Tue, Apr 7, 2009 at 6:57 PM, Tejun Heo t...@kernel.org wrote:
 
  Hmmm... that means intx isn't set by default.  I'm not sure what is
  the right thing to do here.  I think it's something which should be
  handled by the PCI layer.  Oh well, maybe we should just revert the
  change and keep setting intx?
 
 cc'ing linuxppc-dev
 
 I really don't know what should be done.  It seems to make sense to
 have the PCI layer enable interrupts.
 
 This seems to be a powerpc-specific bug, but I don't know enough of
 the PCI subsystem.

Can you post some more details, or point us at a thread?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: ahci: drop intx manipulation on msi enable breaks ULI M1575

2009-04-07 Thread Timur Tabi
On Tue, Apr 7, 2009 at 7:52 PM, Michael Ellerman mich...@ellerman.id.au wrote:

 Can you post some more details, or point us at a thread?

http://marc.info/?t=12391165216r=1w=2

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ahci: drop intx manipulation on msi enable breaks ULI M1575

2009-04-07 Thread Michael Ellerman
On Tue, 2009-04-07 at 19:36 -0500, Timur Tabi wrote:
 On Tue, Apr 7, 2009 at 6:57 PM, Tejun Heo t...@kernel.org wrote:
 
  Hmmm... that means intx isn't set by default.  I'm not sure what is
  the right thing to do here.  I think it's something which should be
  handled by the PCI layer.  Oh well, maybe we should just revert the
  change and keep setting intx?
 
 cc'ing linuxppc-dev
 
 I really don't know what should be done.  It seems to make sense to
 have the PCI layer enable interrupts.
 
 This seems to be a powerpc-specific bug, but I don't know enough of
 the PCI subsystem.

Have you confirmed that INTX is disabled before that call?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH] powerpc/mm: Fix compile warning

2009-04-07 Thread Kumar Gala
arch/powerpc/mm/tlb_nohash.c: In function 'flush_tlb_mm':
arch/powerpc/mm/tlb_nohash.c:128: warning: unused variable 'cpu_mask'

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 arch/powerpc/mm/tlb_nohash.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index 7af7297..ad2eb4d 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -125,7 +125,6 @@ static void do_flush_tlb_page_ipi(void *param)
 
 void flush_tlb_mm(struct mm_struct *mm)
 {
-   cpumask_t cpu_mask;
unsigned int pid;
 
preempt_disable();
-- 
1.6.0.6

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] Fix build failure drivers/parport/parport_pc.c for powerpc

2009-04-07 Thread Tony Breeds
In commit 51dcdfec6a274afc1c6fce180d582add9ff512c0 (parport: Use the PCI
IRQ if offered) parport_pc_probe_port() gained an irqflags arg.  This
isn't being supplied on powerpc.  This patch make powerpc fallback to
the old behaviour, that is using 0 for irqflags.

Fixes build failure:
In file included from drivers/parport/parport_pc.c:68:
arch/powerpc/include/asm/parport.h: In function 'parport_pc_find_nonpci_ports':
arch/powerpc/include/asm/parport.h:32: error: too few arguments to function 
'parport_pc_probe_port'
arch/powerpc/include/asm/parport.h:32: error: too few arguments to function 
'parport_pc_probe_port'
arch/powerpc/include/asm/parport.h:32: error: too few arguments to function 
'parport_pc_probe_port'
make[3]: *** [drivers/parport/parport_pc.o] Error 1

Signed-off-by: Tony Breeds t...@bakeyournoodle.com
---
 arch/powerpc/include/asm/parport.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/parport.h 
b/arch/powerpc/include/asm/parport.h
index 414c50e..94942d6 100644
--- a/arch/powerpc/include/asm/parport.h
+++ b/arch/powerpc/include/asm/parport.h
@@ -29,7 +29,7 @@ static int __devinit parport_pc_find_nonpci_ports (int 
autoirq, int autodma)
prop = of_get_property(np, interrupts, NULL);
if (!prop)
continue;
-   if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != 
NULL)
+   if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL, 0) 
!= NULL)
count++;
}
return count;
-- 
1.6.0.6

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


linux-next: build failure

2009-04-07 Thread Stephen Rothwell
Hi all,

Today's linux-next build (powerpc allyesconfig) failed like this:

  LD  vmlinux.o
powerpc-linux-ld: TOC section size exceeds 64k

I will think about (and appreciate suggestions on) how to fix this ...
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/


pgpwGoLLtOckt.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH] mpic_find() was overloaded to do two things introduce mpic_is_ipi() and simplify mpic_find()

2009-04-07 Thread Tony Breeds
Also silences the warning:
arch/powerpc/sysdev/mpic.c: In function 'mpic_irq_set_priority':
arch/powerpc/sysdev/mpic.c:1382: warning: 'is_ipi' may be used uninitialized in 
this function

Signed-off-by: Tony Breeds t...@bakeyournoodle.com
---
Only compile tested.

 arch/powerpc/sysdev/mpic.c |   23 +++
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 21b9567..a09eaf9 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -613,23 +613,23 @@ static int irq_choose_cpu(unsigned int virt_irq)
 #define mpic_irq_to_hw(virq)   ((unsigned int)irq_map[virq].hwirq)
 
 /* Find an mpic associated with a given linux interrupt */
-static struct mpic *mpic_find(unsigned int irq, unsigned int *is_ipi)
+static struct mpic *mpic_find(unsigned int irq)
 {
-   unsigned int src = mpic_irq_to_hw(irq);
-   struct mpic *mpic;
-
if (irq  NUM_ISA_INTERRUPTS)
return NULL;
 
-   mpic = irq_desc[irq].chip_data;
+   return irq_desc[irq].chip_data;
+}
 
-   if (is_ipi)
-   *is_ipi = (src = mpic-ipi_vecs[0] 
-  src = mpic-ipi_vecs[3]);
+/* Determine if the linux irq is an IPI */
+static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq)
+{
+   unsigned int src = mpic_irq_to_hw(irq);
 
-   return mpic;
+   return (src = mpic-ipi_vecs[0]  src = mpic-ipi_vecs[3]);
 }
 
+
 /* Convert a cpu mask from logical to physical cpu numbers. */
 static inline u32 mpic_physmask(u32 cpumask)
 {
@@ -1379,8 +1379,7 @@ void __init mpic_set_serial_int(struct mpic *mpic, int 
enable)
 
 void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
 {
-   unsigned int is_ipi;
-   struct mpic *mpic = mpic_find(irq, is_ipi);
+   struct mpic *mpic = mpic_find(irq);
unsigned int src = mpic_irq_to_hw(irq);
unsigned long flags;
u32 reg;
@@ -1389,7 +1388,7 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int 
pri)
return;
 
spin_lock_irqsave(mpic_lock, flags);
-   if (is_ipi) {
+   if (mpic_is_ipi(mpic, irq)) {
reg = mpic_ipi_read(src - mpic-ipi_vecs[0]) 
~MPIC_VECPRI_PRIORITY_MASK;
mpic_ipi_write(src - mpic-ipi_vecs[0],
-- 
1.6.0.6

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] Quieten arch/powerpc in a allmodconfig build.

2009-04-07 Thread Tony Breeds
This patch silences all the warnings generated in arch/powerpc for
allmodconfig build.

It does:
 * Where appropriate use the uninitialized_var() macro to help GCC
   understand we know what's going on.
 * Explicitly casts PHYSICAL_START in one printk()
 * Initialise a few variables, as it's neater than using uninitialized_var()

Signed-off-by: Tony Breeds t...@bakeyournoodle.com
---
Only compile tested.

 arch/powerpc/kernel/cacheinfo.c   |4 ++--
 arch/powerpc/kernel/pci_dn.c  |2 +-
 arch/powerpc/kernel/setup_64.c|4 ++--
 arch/powerpc/platforms/cell/axon_msi.c|2 +-
 arch/powerpc/platforms/cell/beat_iommu.c  |2 +-
 arch/powerpc/platforms/iseries/pci.c  |   24 
 arch/powerpc/platforms/powermac/low_i2c.c |5 ++---
 arch/powerpc/platforms/pseries/msi.c  |2 +-
 8 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index bb37b1d..fd6aef9 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -510,7 +510,7 @@ static struct cache *index_kobj_to_cache(struct kobject *k)
 
 static ssize_t size_show(struct kobject *k, struct kobj_attribute *attr, char 
*buf)
 {
-   unsigned int size_kb;
+   unsigned int uninitialized_var(size_kb);
struct cache *cache;
 
cache = index_kobj_to_cache(k);
@@ -559,7 +559,7 @@ static struct kobj_attribute cache_nr_sets_attr =
 
 static ssize_t associativity_show(struct kobject *k, struct kobj_attribute 
*attr, char *buf)
 {
-   unsigned int associativity;
+   unsigned int uninitialized_var(associativity);
struct cache *cache;
 
cache = index_kobj_to_cache(k);
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 1c67de5..b9d66ed 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -83,7 +83,7 @@ void *traverse_pci_devices(struct device_node *start, 
traverse_func pre,
void *data)
 {
struct device_node *dn, *nextdn;
-   void *ret;
+   void *uninitialized_var(ret);
 
/* We started with a phb, iterate all childs */
for (dn = start-child; dn; dn = nextdn) {
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index c410c60..38968f1 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -421,8 +421,8 @@ void __init setup_system(void)
printk(htab_address  = 0x%p\n, htab_address);
printk(htab_hash_mask= 0x%lx\n, htab_hash_mask);
if (PHYSICAL_START  0)
-   printk(physical_start= 0x%lx\n,
-  PHYSICAL_START);
+   printk(physical_start= 0x%llx\n,
+  (unsigned long long)PHYSICAL_START);
printk(-\n);
 
DBG( - setup_system()\n);
diff --git a/arch/powerpc/platforms/cell/axon_msi.c 
b/arch/powerpc/platforms/cell/axon_msi.c
index 0ce45c2..dae4c7c 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -151,7 +151,7 @@ static struct axon_msic *find_msi_translator(struct pci_dev 
*dev)
 {
struct irq_host *irq_host;
struct device_node *dn, *tmp;
-   const phandle *ph;
+   const phandle *uninitialized_var(ph);
struct axon_msic *msic = NULL;
 
dn = of_node_get(pci_device_to_OF_node(dev));
diff --git a/arch/powerpc/platforms/cell/beat_iommu.c 
b/arch/powerpc/platforms/cell/beat_iommu.c
index 93b0efd..8230cd8 100644
--- a/arch/powerpc/platforms/cell/beat_iommu.c
+++ b/arch/powerpc/platforms/cell/beat_iommu.c
@@ -57,7 +57,7 @@ static unsigned long celleb_dma_direct_offset;
 static void __init celleb_init_direct_mapping(void)
 {
u64 lpar_addr, io_addr;
-   u64 io_space_id, ioid, dma_base, dma_size, io_page_size;
+   u64 io_space_id=0, ioid=0, dma_base=0, dma_size=0, io_page_size=0;
 
if (!find_dma_window(io_space_id, ioid, dma_base, dma_size,
 io_page_size)) {
diff --git a/arch/powerpc/platforms/iseries/pci.c 
b/arch/powerpc/platforms/iseries/pci.c
index 02a634f..05f047d 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -616,8 +616,8 @@ static inline struct device_node *xlate_iomm_address(
  */
 static u8 iseries_readb(const volatile void __iomem *addr)
 {
-   u64 bar_offset;
-   u64 dsa;
+   u64 uninitialized_var(bar_offset);
+   u64 uninitialized_var(dsa);
int retry = 0;
struct HvCallPci_LoadReturn ret;
struct device_node *dn =
@@ -634,8 +634,8 @@ static u8 iseries_readb(const volatile void __iomem *addr)
 
 static u16 iseries_readw_be(const volatile void __iomem *addr)
 {
-   u64 bar_offset;
-   u64 dsa;
+   u64 uninitialized_var(bar_offset);
+   u64 

Re: [PATCH] powerpc/oprofile: Remove unused dump_pmcs() in FSL oprofile

2009-04-07 Thread Kumar Gala


On Apr 7, 2009, at 7:02 PM, Michael Ellerman wrote:


It's still in the git history if anyone wants it.

Signed-off-by: Michael Ellerman mich...@ellerman.id.au
---
arch/powerpc/oprofile/op_model_fsl_emb.c |   14 --
1 files changed, 0 insertions(+), 14 deletions(-)


applied to next

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Quieten arch/powerpc in a allmodconfig build.

2009-04-07 Thread Michael Ellerman
On Wed, 2009-04-08 at 14:36 +1000, Tony Breeds wrote:
 This patch silences all the warnings generated in arch/powerpc for
 allmodconfig build.
 
 It does:
  * Where appropriate use the uninitialized_var() macro to help GCC
understand we know what's going on.
  * Explicitly casts PHYSICAL_START in one printk()
  * Initialise a few variables, as it's neater than using uninitialized_var()
 
 Signed-off-by: Tony Breeds t...@bakeyournoodle.com
 ---
 Only compile tested.
 
  arch/powerpc/kernel/cacheinfo.c   |4 ++--
  arch/powerpc/kernel/pci_dn.c  |2 +-
  arch/powerpc/kernel/setup_64.c|4 ++--
  arch/powerpc/platforms/cell/axon_msi.c|2 +-
  arch/powerpc/platforms/cell/beat_iommu.c  |2 +-
  arch/powerpc/platforms/iseries/pci.c  |   24 
  arch/powerpc/platforms/powermac/low_i2c.c |5 ++---
  arch/powerpc/platforms/pseries/msi.c  |2 +-
  8 files changed, 22 insertions(+), 23 deletions(-)
 
 diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
 index bb37b1d..fd6aef9 100644
 --- a/arch/powerpc/kernel/cacheinfo.c
 +++ b/arch/powerpc/kernel/cacheinfo.c
 @@ -510,7 +510,7 @@ static struct cache *index_kobj_to_cache(struct kobject 
 *k)
  
  static ssize_t size_show(struct kobject *k, struct kobj_attribute *attr, 
 char *buf)
  {
 - unsigned int size_kb;
 + unsigned int uninitialized_var(size_kb);
   struct cache *cache;
  
   cache = index_kobj_to_cache(k);
 @@ -559,7 +559,7 @@ static struct kobj_attribute cache_nr_sets_attr =
  
  static ssize_t associativity_show(struct kobject *k, struct kobj_attribute 
 *attr, char *buf)
  {
 - unsigned int associativity;
 + unsigned int uninitialized_var(associativity);
   struct cache *cache;

The getter routines in here could really multiplex their return values
with a negative error code, which I generally prefer, but this works I
guess.


 diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
 index 1c67de5..b9d66ed 100644
 --- a/arch/powerpc/kernel/pci_dn.c
 +++ b/arch/powerpc/kernel/pci_dn.c
 @@ -83,7 +83,7 @@ void *traverse_pci_devices(struct device_node *start, 
 traverse_func pre,
   void *data)
  {
   struct device_node *dn, *nextdn;
 - void *ret;
 + void *uninitialized_var(ret);

The code causing this one is a little ugly anyway, I think we should
change it to be:

-   if (pre  ((ret = pre(dn, data)) != NULL))
-   return ret;
+   if (pre) {
+   ret = pre(dn, data);
+   if (ret != NULL)
+   return ret;
+   }


 diff --git a/arch/powerpc/platforms/cell/axon_msi.c 
 b/arch/powerpc/platforms/cell/axon_msi.c
 index 0ce45c2..dae4c7c 100644
 --- a/arch/powerpc/platforms/cell/axon_msi.c
 +++ b/arch/powerpc/platforms/cell/axon_msi.c
 @@ -151,7 +151,7 @@ static struct axon_msic *find_msi_translator(struct 
 pci_dev *dev)
  {
   struct irq_host *irq_host;
   struct device_node *dn, *tmp;
 - const phandle *ph;
 + const phandle *uninitialized_var(ph);
   struct axon_msic *msic = NULL;

Freakin gcc. This is just:

if (!dn)
return;

for (; dn; ..)
ph = ..

if (!ph)

And it can't work out that it's never used uninitialised?

 diff --git a/arch/powerpc/platforms/cell/beat_iommu.c 
 b/arch/powerpc/platforms/cell/beat_iommu.c
 index 93b0efd..8230cd8 100644
 --- a/arch/powerpc/platforms/cell/beat_iommu.c
 +++ b/arch/powerpc/platforms/cell/beat_iommu.c
 @@ -57,7 +57,7 @@ static unsigned long celleb_dma_direct_offset;
  static void __init celleb_init_direct_mapping(void)
  {
   u64 lpar_addr, io_addr;
 - u64 io_space_id, ioid, dma_base, dma_size, io_page_size;
 + u64 io_space_id=0, ioid=0, dma_base=0, dma_size=0, io_page_size=0;

Do you need a new spacebar? :D

 diff --git a/arch/powerpc/platforms/iseries/pci.c 
 b/arch/powerpc/platforms/iseries/pci.c
 index 02a634f..05f047d 100644
 --- a/arch/powerpc/platforms/iseries/pci.c
 +++ b/arch/powerpc/platforms/iseries/pci.c
 @@ -616,8 +616,8 @@ static inline struct device_node *xlate_iomm_address(
   */
  static u8 iseries_readb(const volatile void __iomem *addr)
  {
 - u64 bar_offset;
 - u64 dsa;
 + u64 uninitialized_var(bar_offset);
 + u64 uninitialized_var(dsa);
   int retry = 0;
   struct HvCallPci_LoadReturn ret;
   struct device_node *dn =
 @@ -634,8 +634,8 @@ static u8 iseries_readb(const volatile void __iomem *addr)
  
  static u16 iseries_readw_be(const volatile void __iomem *addr)
  {
 - u64 bar_offset;
 - u64 dsa;
 + u64 uninitialized_var(bar_offset);
 + u64 uninitialized_var(dsa);
   int retry = 0;
   struct HvCallPci_LoadReturn ret;
   struct device_node *dn =
 @@ -653,8 +653,8 @@ static u16 iseries_readw_be(const volatile void __iomem 
 *addr)
  
  static u32 iseries_readl_be(const volatile void __iomem *addr)
  {
 -   

Re: [PATCH v3 0/5] i2c: i2c-mpc: make I2C bus speed configurable

2009-04-07 Thread Kumar Gala


On Apr 7, 2009, at 3:20 AM, Wolfgang Grandegger wrote:


This patch series makes the I2C bus speed configurable by using the
I2C node property clock-frequency. If the property is not defined,
the old fixed clock settings will be used for backward compatibility.
The property fsl,preserve-clocking allows to inherit the settings
from the bootloader. Furthermore, it does some cleanup and uses the
new bindings for the Socrates board:

 i2c: i2c-mpc: various coding style fixes
 i2c: i2c-mpc: use dev based printout function
 i2c: i2c-mpc: make I2C bus speed configurable


It looks like Ben picked up these patches.


 powerpc: i2c-mpc: document new FSL I2C bindings and cleanup
 powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board


I would have preferred these two go via me, but it looks like the  
board one got picked up by Ben.  I'll deal with the doc/binding update.


Ben, could you please consider this patch series for inclusion into
2.6.30.


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: linux-next: build failure

2009-04-07 Thread Alan Modra
On Wed, Apr 08, 2009 at 02:04:07PM +1000, Stephen Rothwell wrote:
   LD  vmlinux.o
 powerpc-linux-ld: TOC section size exceeds 64k

I'm starting to sound like a cracked record, but I'll say it again:
ld -r does not merely package together object files, it transforms
them.   Try using thin archives instead.

-- 
Alan Modra
Australia Development Lab, IBM
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v3 0/5] i2c: i2c-mpc: make I2C bus speed configurable

2009-04-07 Thread Grant Likely
On Tue, Apr 7, 2009 at 10:11 PM, Kumar Gala ga...@kernel.crashing.org wrote:

 On Apr 7, 2009, at 3:20 AM, Wolfgang Grandegger wrote:

 This patch series makes the I2C bus speed configurable by using the
 I2C node property clock-frequency. If the property is not defined,
 the old fixed clock settings will be used for backward compatibility.
 The property fsl,preserve-clocking allows to inherit the settings
 from the bootloader. Furthermore, it does some cleanup and uses the
 new bindings for the Socrates board:

  i2c: i2c-mpc: various coding style fixes
  i2c: i2c-mpc: use dev based printout function
  i2c: i2c-mpc: make I2C bus speed configurable

 It looks like Ben picked up these patches.

  powerpc: i2c-mpc: document new FSL I2C bindings and cleanup
  powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board

 I would have preferred these two go via me, but it looks like the board one
 got picked up by Ben.  I'll deal with the doc/binding update.

hrummm.  As I mentioned in my reply, I'm not convinced that the board
one is the right thing in this case.  I would have preferred it to be
deferred.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v3 0/5] i2c: i2c-mpc: make I2C bus speed configurable

2009-04-07 Thread Kumar Gala


On Apr 8, 2009, at 12:16 AM, Grant Likely wrote:

On Tue, Apr 7, 2009 at 10:11 PM, Kumar Gala  
ga...@kernel.crashing.org wrote:


On Apr 7, 2009, at 3:20 AM, Wolfgang Grandegger wrote:


This patch series makes the I2C bus speed configurable by using the
I2C node property clock-frequency. If the property is not defined,
the old fixed clock settings will be used for backward  
compatibility.

The property fsl,preserve-clocking allows to inherit the settings
from the bootloader. Furthermore, it does some cleanup and uses the
new bindings for the Socrates board:

 i2c: i2c-mpc: various coding style fixes
 i2c: i2c-mpc: use dev based printout function
 i2c: i2c-mpc: make I2C bus speed configurable


It looks like Ben picked up these patches.


 powerpc: i2c-mpc: document new FSL I2C bindings and cleanup
 powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board


I would have preferred these two go via me, but it looks like the  
board one

got picked up by Ben.  I'll deal with the doc/binding update.


hrummm.  As I mentioned in my reply, I'm not convinced that the board
one is the right thing in this case.  I would have preferred it to be
deferred.


which part?  I missed this whole thread as I had it forwarding to my  
devicetree-discuss folder which I don't normally look at.


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v3 0/5] i2c: i2c-mpc: make I2C bus speed configurable

2009-04-07 Thread Kumar Gala


On Apr 8, 2009, at 12:11 AM, Kumar Gala wrote:



On Apr 7, 2009, at 3:20 AM, Wolfgang Grandegger wrote:


This patch series makes the I2C bus speed configurable by using the
I2C node property clock-frequency. If the property is not defined,
the old fixed clock settings will be used for backward compatibility.
The property fsl,preserve-clocking allows to inherit the settings
from the bootloader. Furthermore, it does some cleanup and uses the
new bindings for the Socrates board:

i2c: i2c-mpc: various coding style fixes
i2c: i2c-mpc: use dev based printout function
i2c: i2c-mpc: make I2C bus speed configurable


It looks like Ben picked up these patches.


powerpc: i2c-mpc: document new FSL I2C bindings and cleanup
powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board


I would have preferred these two go via me, but it looks like the  
board one got picked up by Ben.  I'll deal with the doc/binding  
update.


Ben, could you please consider this patch series for inclusion into
2.6.30


So I'm a bit concerned with the output we now get:

mpc-i2c fffe03000.i2c: clock 0 Hz (dfsrr=16 fdr=49)

why 0? is that right?

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v3 0/5] i2c: i2c-mpc: make I2C bus speed configurable

2009-04-07 Thread Grant Likely
On Tue, Apr 7, 2009 at 10:22 PM, Kumar Gala ga...@kernel.crashing.org wrote:

 On Apr 8, 2009, at 12:16 AM, Grant Likely wrote:

 On Tue, Apr 7, 2009 at 10:11 PM, Kumar Gala ga...@kernel.crashing.org
 wrote:

 On Apr 7, 2009, at 3:20 AM, Wolfgang Grandegger wrote:

 This patch series makes the I2C bus speed configurable by using the
 I2C node property clock-frequency. If the property is not defined,
 the old fixed clock settings will be used for backward compatibility.
 The property fsl,preserve-clocking allows to inherit the settings
 from the bootloader. Furthermore, it does some cleanup and uses the
 new bindings for the Socrates board:

  i2c: i2c-mpc: various coding style fixes
  i2c: i2c-mpc: use dev based printout function
  i2c: i2c-mpc: make I2C bus speed configurable

 It looks like Ben picked up these patches.

  powerpc: i2c-mpc: document new FSL I2C bindings and cleanup
  powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board

 I would have preferred these two go via me, but it looks like the board
 one
 got picked up by Ben.  I'll deal with the doc/binding update.

 hrummm.  As I mentioned in my reply, I'm not convinced that the board
 one is the right thing in this case.  I would have preferred it to be
 deferred.

 which part?  I missed this whole thread as I had it forwarding to my
 devicetree-discuss folder which I don't normally look at.

Here you go:

On Tue, Apr 7, 2009 at 8:43 AM, Grant Likely grant.lik...@secretlab.ca wrote:
 On Tue, Apr 7, 2009 at 1:20 AM, Wolfgang Grandegger w...@grandegger.com 
 wrote:
 Preserve I2C clock settings for the Socrates MPC8544 board.

 I had thought that the preserve-clocking property was intended for
 older boards that don't currently have any method of getting the clock
 setting out of u-boot.  Since Socrates is a new board, U-Boot should
 probably be made to fill in the real clock rate setting.

 g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Quieten arch/powerpc in a allmodconfig build.

2009-04-07 Thread Tony Breeds
On Wed, Apr 08, 2009 at 03:08:55PM +1000, Michael Ellerman wrote:

 The getter routines in here could really multiplex their return values
 with a negative error code, which I generally prefer, but this works I
 guess.

I was hoping someone would notice and suggest it.  tag you're it!

 Do you need a new spacebar? :D

nowhydoyouask?
 
 This one is a bug surely?

Hmm actually I think you're right.  I dont want to push my luck with the gcc
hackers though

 Gah, gcc sucks. It should just not warn in these cases where it doesn't
 know wth is going on.

I don't think you'll get any arguments.  it only there was a -Wnowarnunused!

Yours Tony
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev