Re: [PATCH 00/10] Fix 8xx MMU/TLB

2009-11-17 Thread Joakim Tjernlund


Scott Wood scottw...@freescale.com wrote on 17/11/2009 01:40:11:

 From:

 Scott Wood scottw...@freescale.com

 To:

 Joakim Tjernlund joakim.tjernl...@transmode.se

 Cc:

 linuxppc-...@ozlabs.org linuxppc-...@ozlabs.org, Rex Feany 
 rfe...@mrv.com

 Date:

 17/11/2009 01:40

 Subject:

 Re: [PATCH 00/10] Fix 8xx MMU/TLB

 Joakim Tjernlund wrote:
  Scott Wood scottw...@freescale.com wrote on 16/11/2009 22:27:41:
  On Mon, Nov 16, 2009 at 03:00:09PM -0600, Scott Wood wrote:
  On Sun, Nov 15, 2009 at 06:09:27PM +0100, Joakim Tjernlund wrote:
  [I used the wrong branch, this will hopefully not conflict]
 
  This is hopfully the last iteration of the series.
  Rex  Scott, please test and signoff.
  Changes since last version:
   - Added mandatory pinning of iTLB
   - Added DTLB Miss cleanup
  I still get the EFAULTs.
 
  umm, this worked before this series with your own
  version, right?

 No...  I only meant that the ITLB pinning got rid of the boot hang.

 When I mentioned the EFAULTs before you said, No surprise as the it
 seems like the DAR decoding is broken.  I thought you meant you'd found
 a bug and fixed it in this respin.

Oh, there seems to be a misunderstanding here :)
Lets go back a bit, you said some time ago:
/Quote
  +3:   lwz   r11, 0(r11)  /* Get the level 1 entry */
DO_8xx_CPU6(0x3b80, r3)
mtspr SPRN_MD_TWC, r11 /* Load pte table base address 
  */
mfspr r11, SPRN_MD_TWC /* and get the pte address 
  */
lwz   r11, 0(r11)  /* Get the pte */
/* concat physical page address(r11) and page offset(r10) */
rlwimi  r11, r10, 0, 20, 31

 But r10 here contains SRR0 from above, and this is a data TLB error.

Never mind that last one, forgot that you'd be wanting to load the
instruction. :-P

But the rlwimi is what's causing the machine checks.  I replaced it with:
rlwinm   r11, r11, 0, 0x3000
rlwimi   r11, r10, 22, 0xffc

and things seem to work.  You could probably replace the rlwinm by
subtracting PAGE_OFFSET from swapper_pg_dir instead.
/End Quote

I read this as now everything is working, but I guess I misunderstood?
You still have EFAULT here?


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


[PATCH 10/13] mac68k: start CUDA early, take 2

2009-11-17 Thread Finn Thain
The valkyriefb driver needs the CUDA to work in order to set the video 
mode at boot. So initialise the device earlier, and bring the m68k code 
closer to the powermac code.

Take 2 was changed as per Benjamin Herrenschmidt's review.

Signed-off-by: Finn Thain fth...@telegraphics.com.au

---
 arch/m68k/mac/config.c   |6 +++
 drivers/macintosh/adb.c  |6 ++-
 drivers/macintosh/via-cuda.c |   74 +++
 3 files changed, 51 insertions(+), 35 deletions(-)

Index: linux-2.6.31/arch/m68k/mac/config.c
===
--- linux-2.6.31.orig/arch/m68k/mac/config.c2009-11-17 17:11:47.0 
+1100
+++ linux-2.6.31/arch/m68k/mac/config.c 2009-11-17 17:11:47.0 +1100
@@ -23,6 +23,8 @@
 #include linux/init.h
 #include linux/vt_kern.h
 #include linux/platform_device.h
+#include linux/adb.h
+#include linux/cuda.h
 
 #define BOOTINFO_COMPAT_1_0
 #include asm/setup.h
@@ -889,6 +891,10 @@ static void __init mac_identify(void)
oss_init();
psc_init();
baboon_init();
+
+#ifdef CONFIG_ADB_CUDA
+   find_via_cuda();
+#endif
 }
 
 static void __init mac_report_hardware(void)
Index: linux-2.6.31/drivers/macintosh/via-cuda.c
===
--- linux-2.6.31.orig/drivers/macintosh/via-cuda.c  2009-11-17 
17:07:58.0 +1100
+++ linux-2.6.31/drivers/macintosh/via-cuda.c   2009-11-17 17:11:47.0 
+1100
@@ -89,7 +89,6 @@ static int cuda_fully_inited;
 
 #ifdef CONFIG_ADB
 static int cuda_probe(void);
-static int cuda_init(void);
 static int cuda_send_request(struct adb_request *req, int sync);
 static int cuda_adb_autopoll(int devs);
 static int cuda_reset_adb_bus(void);
@@ -107,17 +106,42 @@ int cuda_request(struct adb_request *req
 
 #ifdef CONFIG_ADB
 struct adb_driver via_cuda_driver = {
-   CUDA,
-   cuda_probe,
-   cuda_init,
-   cuda_send_request,
-   cuda_adb_autopoll,
-   cuda_poll,
-   cuda_reset_adb_bus
+   .name = CUDA,
+   .probe= cuda_probe,
+   .send_request = cuda_send_request,
+   .autopoll = cuda_adb_autopoll,
+   .poll = cuda_poll,
+   .reset_bus= cuda_reset_adb_bus,
 };
 #endif /* CONFIG_ADB */
 
-#ifdef CONFIG_PPC
+#ifdef CONFIG_MAC
+int __init find_via_cuda(void)
+{
+struct adb_request req;
+int err;
+
+if (macintosh_config-adb_type != MAC_ADB_CUDA)
+   return 0;
+
+via = via1;
+cuda_state = idle;
+
+err = cuda_init_via();
+if (err) {
+   printk(KERN_ERR cuda_init_via() failed\n);
+   via = NULL;
+   return 0;
+}
+
+/* enable autopoll */
+cuda_request(req, NULL, 3, CUDA_PACKET, CUDA_AUTOPOLL, 1);
+while (!req.complete)
+   cuda_poll();
+
+return 1;
+}
+#else
 int __init find_via_cuda(void)
 {
 struct adb_request req;
@@ -175,7 +199,7 @@ int __init find_via_cuda(void)
 vias = NULL;
 return 0;
 }
-#endif /* CONFIG_PPC */
+#endif /* !defined CONFIG_MAC */
 
 static int __init via_cuda_start(void)
 {
@@ -184,14 +208,14 @@ static int __init via_cuda_start(void)
 
 #ifdef CONFIG_MAC
 cuda_irq = IRQ_MAC_ADB;
-#else /* CONFIG_MAC */
+#else
 cuda_irq = irq_of_parse_and_map(vias, 0);
 if (cuda_irq == NO_IRQ) {
printk(KERN_ERR via-cuda: can't map interrupts for %s\n,
   vias-full_name);
return -ENODEV;
 }
-#endif /* CONFIG_MAC */
+#endif
 
 if (request_irq(cuda_irq, cuda_interrupt, 0, ADB, cuda_interrupt)) {
printk(KERN_ERR via-cuda: can't request irq %d\n, cuda_irq);
@@ -216,28 +240,10 @@ cuda_probe(void)
 #else
 if (macintosh_config-adb_type != MAC_ADB_CUDA)
return -ENODEV;
-via = via1;
 #endif
-return 0;
-}
-
-static int __init
-cuda_init(void)
-{
-#ifdef CONFIG_PPC
 if (via == NULL)
return -ENODEV;
 return 0;
-#else 
-int err = cuda_init_via();
-if (err) {
-   printk(KERN_ERR cuda_init_via() failed\n);
-   return -ENODEV;
-}
-out_8(via[IER], IER_SET|SR_INT); /* enable interrupt from SR */
-
-return via_cuda_start();
-#endif
 }
 #endif /* CONFIG_ADB */
 
@@ -430,9 +436,11 @@ cuda_poll(void)
 /* cuda_interrupt only takes a normal lock, we disable
  * interrupts here to avoid re-entering and thus deadlocking.
  */
-disable_irq(cuda_irq);
+if (cuda_irq)
+   disable_irq(cuda_irq);
 cuda_interrupt(0, NULL);
-enable_irq(cuda_irq);
+if (cuda_irq)
+   enable_irq(cuda_irq);
 }
 
 static irqreturn_t
@@ -446,7 +454,7 @@ cuda_interrupt(int irq, void *arg)
 
 spin_lock(cuda_lock);
 
-/* On powermacs, this handler is registered for the VIA IRQ. But it uses
+/* On powermacs, this handler is registered for the VIA IRQ. But they use
  * just the shift register IRQ -- other VIA interrupt sources are disabled.
  * On m68k macs, the VIA IRQ sources are dispatched individually. Unless
  * 

[PATCH 1/2] pmac-zilog: add platform driver

2009-11-17 Thread Finn Thain
Add platform driver to the pmac-zilog driver for mac 68k, putting the 
powermac-specific bits inside #ifdef CONFIG_PPC_PMAC.

This patch should be applied after [PATCH 3/13] pmac-zilog: cleanup. It 
renders obsolete the version in [PATCH 4/13] pmac-zilog, mac68k: replace 
mac68k SCC code with platform.

Signed-off-by: Finn Thain fth...@telegraphics.com.au

---
 arch/m68k/configs/mac_defconfig   |5 +
 arch/m68k/configs/multi_defconfig |5 +
 drivers/serial/Kconfig|   12 +-
 drivers/serial/pmac_zilog.c   |  159 +-
 drivers/serial/pmac_zilog.h   |   14 +++
 5 files changed, 169 insertions(+), 26 deletions(-)

Index: linux-2.6.31/drivers/serial/Kconfig
===
--- linux-2.6.31.orig/drivers/serial/Kconfig2009-11-17 17:05:27.0 
+1100
+++ linux-2.6.31/drivers/serial/Kconfig 2009-11-17 17:07:38.0 +1100
@@ -1079,12 +1079,12 @@ config SERIAL_68360
default y
 
 config SERIAL_PMACZILOG
-   tristate PowerMac z85c30 ESCC support
-   depends on PPC_OF  PPC_PMAC
+   tristate Mac or PowerMac z85c30 ESCC support
+   depends on (M68K  MAC) || (PPC_OF  PPC_PMAC)
select SERIAL_CORE
help
  This driver supports the Zilog z85C30 serial ports found on
- PowerMac machines.
+ (Power)Mac machines.
  Say Y or M if you want to be able to these serial ports.
 
 config SERIAL_PMACZILOG_TTYS
@@ -1109,16 +1109,16 @@ config SERIAL_PMACZILOG_TTYS
  unable to use the 8250 module for PCMCIA or other 16C550-style
  UARTs.
 
- Say N unless you need the z85c30 ports on your powermac
+ Say N unless you need the z85c30 ports on your (Power)Mac
  to appear as /dev/ttySn.
 
 config SERIAL_PMACZILOG_CONSOLE
-   bool Console on PowerMac z85c30 serial port
+   bool Console on Mac or PowerMac z85c30 serial port
depends on SERIAL_PMACZILOG=y
select SERIAL_CORE_CONSOLE
help
  If you would like to be able to use the z85c30 serial port
- on your PowerMac as the console, you can do so by answering
+ on your (Power)Mac as the console, you can do so by answering
  Y to this option.
 
 config SERIAL_LH7A40X
Index: linux-2.6.31/arch/m68k/configs/mac_defconfig
===
--- linux-2.6.31.orig/arch/m68k/configs/mac_defconfig   2009-11-17 
17:07:29.0 +1100
+++ linux-2.6.31/arch/m68k/configs/mac_defconfig2009-11-17 
17:07:38.0 +1100
@@ -701,6 +701,11 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_PMACZILOG=y
+CONFIG_SERIAL_PMACZILOG_TTYS=y
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
Index: linux-2.6.31/arch/m68k/configs/multi_defconfig
===
--- linux-2.6.31.orig/arch/m68k/configs/multi_defconfig 2009-11-17 
17:07:29.0 +1100
+++ linux-2.6.31/arch/m68k/configs/multi_defconfig  2009-11-17 
17:07:38.0 +1100
@@ -822,6 +822,11 @@ CONFIG_A2232=y
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_PMACZILOG=y
+CONFIG_SERIAL_PMACZILOG_TTYS=y
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
Index: linux-2.6.31/drivers/serial/pmac_zilog.c
===
--- linux-2.6.31.orig/drivers/serial/pmac_zilog.c   2009-11-17 
17:07:28.0 +1100
+++ linux-2.6.31/drivers/serial/pmac_zilog.c2009-11-17 17:07:38.0 
+1100
@@ -63,11 +63,18 @@
 #include asm/sections.h
 #include asm/io.h
 #include asm/irq.h
+
+#ifdef CONFIG_PPC_PMAC
 #include asm/prom.h
 #include asm/machdep.h
 #include asm/pmac_feature.h
 #include asm/dbdma.h
 #include asm/macio.h
+#else
+#include linux/platform_device.h
+#include asm/macints.h
+#define machine_is_compatible(x) (0)
+#endif
 
 #if defined (CONFIG_SERIAL_PMACZILOG_CONSOLE)  defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -83,11 +90,9 @@
 
 static char version[] __initdata = pmac_zilog: 0.6 (Benjamin Herrenschmidt 
b...@kernel.crashing.org);
 MODULE_AUTHOR(Benjamin Herrenschmidt b...@kernel.crashing.org);
-MODULE_DESCRIPTION(Driver for the PowerMac serial ports.);
+MODULE_DESCRIPTION(Driver for the Mac and PowerMac serial ports.);
 MODULE_LICENSE(GPL);
 
-#define PWRDBG(fmt, arg...)printk(KERN_DEBUG fmt , ## arg)
-
 #ifdef CONFIG_SERIAL_PMACZILOG_TTYS
 #define PMACZILOG_MAJORTTY_MAJOR
 #define PMACZILOG_MINOR64
@@ -341,7 +346,7 @@ static struct tty_struct *pmz_receive_ch
uap-curregs[R1] = ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
write_zsreg(uap, R1, 

RE: [PATCH 1/1] ata/sata_sil24: MSI support, disabled by default

2009-11-17 Thread Mahajan Vivek-B08308
 From: Jeff Garzik [mailto:j...@garzik.org] 
 Sent: Tuesday, November 17, 2009 1:12 PM
  In this case msi is supposed to be passed via insmod and not via 
  kernel cmdline. If the driver is built-in the kernel, then force 
  sata_sil24_msi = 1 in the driver to enable it.
 
 First, the original patch was just fine, and it was applied.  
 You should have received email confirmation of this already.

Yes, I did.

 Second, all module options are available on the kernel 
 command line, when a module is built into the kernel.  You 
 supply a module name prefix to each module option, on the 
 kernel command line.

Correct, sata_sil24.msi enables it.

 
   Jeff

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


Re: updates to the mscan-driver in net-next

2009-11-17 Thread David Miller
From: Wolfram Sang w.s...@pengutronix.de
Date: Mon, 16 Nov 2009 23:57:43 +0100

 here are the patches which fix the issues for the mscan  mpc52xx_can drivers
 raised by Wolfgang Grandegger and Grant Likely. They are based on the initial
 version of the drivers I sent a few days ago. Devicetree-discuss has been 
 added
 for the property changes. I will also update my branch on pengutronix.de
 tomorrow, I seem to have issues when trying that from home :(^

All applied to net-next-2.6, thank you.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/4] powerpc: Add Kconfig dependency for PCI_MSI as needed by XICS

2009-11-17 Thread Mel Gorman
It's possible to set CONFIG_XICS without CONFIG_PCI_MSI. When that
happens, the kernel fails to build with

arch/powerpc/platforms/built-in.o: In function `.xics_startup':
xics.c:(.text+0x12f60): undefined reference to `.unmask_msi_irq'
make: *** [.tmp_vmlinux1] Error 1

This patch adds the dependency in KConfig.

Signed-off-by: Mel Gorman m...@csn.ul.ie
---
 arch/powerpc/platforms/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 04a8061..21a1fa1 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -52,7 +52,7 @@ config PPC_UDBG_BEAT
default n
 
 config XICS
-   depends on PPC_PSERIES
+   depends on PPC_PSERIES  PCI_MSI
bool
default y
 
-- 
1.6.5

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


[PATCH 4/4] powerpc: Avoid reference to XICS-related functions when CONFIG_XICS is not set

2009-11-17 Thread Mel Gorman
Calls to XICS-related functions is open-coded in a number of places even
when CONFIG_XICS is not set resulting in build failures such as

arch/powerpc/platforms/built-in.o: In function `.pseries_kexec_cpu_down_xics':
kexec.c:(.text+0x15558): undefined reference to `.xics_kexec_teardown_cpu'
arch/powerpc/platforms/built-in.o: In function `.pseries_cpu_disable': 
hotplug-cpu.c:(.text+0x16104): undefined reference to `.xics_migrate_irqs_away'
arch/powerpc/platforms/built-in.o: In function `.pseries_mach_cpu_die': 
hotplug-cpu.c:(.text+0x1615c): undefined reference to `.xics_teardown_cpu'
arch/powerpc/platforms/built-in.o: In function `.pseries_xics_init_IRQ': 
setup.c:(.init.text+0x4590): undefined reference to `.xics_init_IRQ'
make: *** [.tmp_vmlinux1] Error 1

This patch fixes up a number of references such as those described above.

Signed-off-by: Mel Gorman m...@csn.ul.ie
---
 arch/powerpc/platforms/pseries/hotplug-cpu.c |2 ++
 arch/powerpc/platforms/pseries/kexec.c   |7 +++
 arch/powerpc/platforms/pseries/setup.c   |7 +++
 arch/powerpc/platforms/pseries/xics.h|8 +++-
 4 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c 
b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index ebff6d9..a2957d6 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -58,7 +58,9 @@ static void pseries_mach_cpu_die(void)
 {
local_irq_disable();
idle_task_exit();
+#ifdef CONFIG_XICS
xics_teardown_cpu();
+#endif
unregister_slb_shadow(hard_smp_processor_id(), __pa(get_slb_shadow()));
rtas_stop_self();
/* Should never get here... */
diff --git a/arch/powerpc/platforms/pseries/kexec.c 
b/arch/powerpc/platforms/pseries/kexec.c
index 53cbd53..ab79947 100644
--- a/arch/powerpc/platforms/pseries/kexec.c
+++ b/arch/powerpc/platforms/pseries/kexec.c
@@ -51,6 +51,7 @@ void __init setup_kexec_cpu_down_mpic(void)
ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_mpic;
 }
 
+#ifdef CONFIG_XICS
 static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)
 {
pseries_kexec_cpu_down(crash_shutdown, secondary);
@@ -61,6 +62,12 @@ void __init setup_kexec_cpu_down_xics(void)
 {
ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics;
 }
+#else
+void __init setup_kexec_cpu_down_xics(void)
+{
+   BUG();
+}
+#endif
 
 static int __init pseries_kexec_setup(void)
 {
diff --git a/arch/powerpc/platforms/pseries/setup.c 
b/arch/powerpc/platforms/pseries/setup.c
index ca5f2e1..a925fbb 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -210,11 +210,18 @@ static void __init pseries_mpic_init_IRQ(void)
pseries_setup_i8259_cascade();
 }
 
+#ifdef CONFIG_XICS
 static void __init pseries_xics_init_IRQ(void)
 {
xics_init_IRQ();
pseries_setup_i8259_cascade();
 }
+#else
+static void __init pseries_xics_init_IRQ(void)
+{
+   BUG();
+}
+#endif
 
 static void pseries_lpar_enable_pmcs(void)
 {
diff --git a/arch/powerpc/platforms/pseries/xics.h 
b/arch/powerpc/platforms/pseries/xics.h
index d1d5a83..d0a618d 100644
--- a/arch/powerpc/platforms/pseries/xics.h
+++ b/arch/powerpc/platforms/pseries/xics.h
@@ -16,8 +16,14 @@ extern void xics_init_IRQ(void);
 extern void xics_setup_cpu(void);
 extern void xics_teardown_cpu(void);
 extern void xics_kexec_teardown_cpu(int secondary);
-extern void xics_migrate_irqs_away(void);
 extern int smp_xics_probe(void);
 extern void smp_xics_message_pass(int target, int msg);
+#ifdef CONFIG_XICS
+extern void xics_migrate_irqs_away(void);
+#else
+static inline void xics_migrate_irqs_away(void)
+{
+   BUG();
+}
 
 #endif /* _POWERPC_KERNEL_XICS_H */
-- 
1.6.5

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


[PATCH 2/4] powerpc: Panic on platform ppc-xicp when CONFIG_XICS not set instead of build failure

2009-11-17 Thread Mel Gorman
If CONFIG_XICS is not set but CONFIG_PPC_PSERIES is, then the kernel
fails to build with

arch/powerpc/platforms/pseries/smp.c: In function ‘smp_init_pseries_xics’:
arch/powerpc/platforms/pseries/smp.c:202: error: ‘pSeries_xics_smp_ops’ 
undeclared (first use in this function)
arch/powerpc/platforms/pseries/smp.c:202: error: (Each undeclared identifier is 
reported only once
arch/powerpc/platforms/pseries/smp.c:202: error: for each function it appears 
in.)
make[2]: *** [arch/powerpc/platforms/pseries/smp.o] Error 1

As CONFIG_XICS is not always necessary, this patch allows the kernel to
build but the system will panic at runtime if it is found that XICS is
required.

Signed-off-by: Mel Gorman m...@csn.ul.ie
---
 arch/powerpc/platforms/pseries/smp.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/smp.c 
b/arch/powerpc/platforms/pseries/smp.c
index 44c..da78ea5 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -199,7 +199,11 @@ void __init smp_init_pseries_mpic(void)
 
 void __init smp_init_pseries_xics(void)
 {
+#ifdef CONFIG_XICS
smp_ops = pSeries_xics_smp_ops;
+#else
+   panic(Support for platform ppc-xicp not configured);
+#endif
 
smp_init_pseries();
 }
-- 
1.6.5

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

[PATCH 3/4] powerpc: Only define smp_pSeries_cpu_bootable when CONFIG_XICS is set

2009-11-17 Thread Mel Gorman
If CONFIG_XICS is set, then smp_pSeries_cpu_bootable() is unnecessary.
As warnings are treated as errors, this fails to build.

This patch only defines smp_pSeries_cpu_bootable() when CONFIG_XICS is
set.

Signed-off-by: Mel Gorman m...@csn.ul.ie
---
 arch/powerpc/platforms/pseries/smp.c |   19 ++-
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/smp.c 
b/arch/powerpc/platforms/pseries/smp.c
index da78ea5..62b1141 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -130,6 +130,15 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
paca[nr].cpu_start = 1;
 }
 
+#ifdef CONFIG_MPIC
+static struct smp_ops_t pSeries_mpic_smp_ops = {
+   .message_pass   = smp_mpic_message_pass,
+   .probe  = smp_mpic_probe,
+   .kick_cpu   = smp_pSeries_kick_cpu,
+   .setup_cpu  = smp_mpic_setup_cpu,
+};
+#endif
+#ifdef CONFIG_XICS
 static int smp_pSeries_cpu_bootable(unsigned int nr)
 {
/* Special case - we inhibit secondary thread startup
@@ -142,15 +151,7 @@ static int smp_pSeries_cpu_bootable(unsigned int nr)
 
return 1;
 }
-#ifdef CONFIG_MPIC
-static struct smp_ops_t pSeries_mpic_smp_ops = {
-   .message_pass   = smp_mpic_message_pass,
-   .probe  = smp_mpic_probe,
-   .kick_cpu   = smp_pSeries_kick_cpu,
-   .setup_cpu  = smp_mpic_setup_cpu,
-};
-#endif
-#ifdef CONFIG_XICS
+
 static struct smp_ops_t pSeries_xics_smp_ops = {
.message_pass   = smp_xics_message_pass,
.probe  = smp_xics_probe,
-- 
1.6.5

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


[PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set

2009-11-17 Thread Mel Gorman
KConfig doesn't require CONFIG_XICS to be set with CONFIG_PSERIES but if
it's not set, there are numerous small build errors. This is a small series
of patches to allow CONFIG_XICS to be unset in the config.

XICS appears to be some sort of interrupt controller but I'm not sure how
common it is on systems that require CONFIG_PSERIES. If CONFIG_PSERIES
universally requires CONFIG_XICS, the better path might be to force it to
be set.

Testing was building with make oldconfig a configuration from 2.6.31 on
a PPC970.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set

2009-11-17 Thread Michael Ellerman
On Tue, 2009-11-17 at 12:07 +, Mel Gorman wrote:
 KConfig doesn't require CONFIG_XICS to be set with CONFIG_PSERIES but if
 it's not set, there are numerous small build errors. This is a small series
 of patches to allow CONFIG_XICS to be unset in the config.
 
 XICS appears to be some sort of interrupt controller but I'm not sure how
 common it is on systems that require CONFIG_PSERIES. If CONFIG_PSERIES
 universally requires CONFIG_XICS, the better path might be to force it to
 be set.

It is indeed 'some sort of interrupt controller' :)

All the virtualised PSERIES systems have, or appear to have, a XICS. So
it's pretty common.

I think the only time you see an MPIC is on older machines, and even
then maybe only if you're running bare metal.

So it is pretty much required for a PSERIES kernel, but perhaps there
are cases where the BML guys want to be able to turn it off.

cheers


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

Re: [PATCH 1/4] powerpc: Add Kconfig dependency for PCI_MSI as needed by XICS

2009-11-17 Thread Michael Ellerman
On Tue, 2009-11-17 at 12:07 +, Mel Gorman wrote:
 It's possible to set CONFIG_XICS without CONFIG_PCI_MSI. When that
 happens, the kernel fails to build with
 
 arch/powerpc/platforms/built-in.o: In function `.xics_startup':
 xics.c:(.text+0x12f60): undefined reference to `.unmask_msi_irq'
 make: *** [.tmp_vmlinux1] Error 1
 
 This patch adds the dependency in KConfig.

Actually we should ifdef the code instead, XICS doesn't require MSI -
that code chunk just needs to be conditional.

cheers


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

Re: [PATCH 2/4] powerpc: Panic on platform ppc-xicp when CONFIG_XICS not set instead of build failure

2009-11-17 Thread Michael Ellerman
On Tue, 2009-11-17 at 12:07 +, Mel Gorman wrote:
 If CONFIG_XICS is not set but CONFIG_PPC_PSERIES is, then the kernel
 fails to build with
 
 arch/powerpc/platforms/pseries/smp.c: In function ‘smp_init_pseries_xics’:
 arch/powerpc/platforms/pseries/smp.c:202: error: ‘pSeries_xics_smp_ops’ 
 undeclared (first use in this function)
 arch/powerpc/platforms/pseries/smp.c:202: error: (Each undeclared identifier 
 is reported only once
 arch/powerpc/platforms/pseries/smp.c:202: error: for each function it appears 
 in.)
 make[2]: *** [arch/powerpc/platforms/pseries/smp.o] Error 1
 
 As CONFIG_XICS is not always necessary, this patch allows the kernel to
 build but the system will panic at runtime if it is found that XICS is
 required.
 
 Signed-off-by: Mel Gorman m...@csn.ul.ie
 ---
  arch/powerpc/platforms/pseries/smp.c |4 
  1 files changed, 4 insertions(+), 0 deletions(-)
 
 diff --git a/arch/powerpc/platforms/pseries/smp.c 
 b/arch/powerpc/platforms/pseries/smp.c
 index 44c..da78ea5 100644
 --- a/arch/powerpc/platforms/pseries/smp.c
 +++ b/arch/powerpc/platforms/pseries/smp.c
 @@ -199,7 +199,11 @@ void __init smp_init_pseries_mpic(void)
  
  void __init smp_init_pseries_xics(void)
  {
 +#ifdef CONFIG_XICS
   smp_ops = pSeries_xics_smp_ops;
 +#else
 + panic(Support for platform ppc-xicp not configured);
 +#endif
  
   smp_init_pseries();
  }

I think it'd be neater to just ifdef the whole block in
pseries_discover_pic(), or move it out and ifdef that. That'd avoid
referencing pseries_xics_init_IRQ() and setup_kexec_cpu_down_xics()
also.

cheers


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

Re: [PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set

2009-11-17 Thread Michael Ellerman
On Tue, 2009-11-17 at 23:39 +1100, Michael Ellerman wrote:
 On Tue, 2009-11-17 at 12:07 +, Mel Gorman wrote:
  KConfig doesn't require CONFIG_XICS to be set with CONFIG_PSERIES but if
  it's not set, there are numerous small build errors. This is a small series
  of patches to allow CONFIG_XICS to be unset in the config.
  
  XICS appears to be some sort of interrupt controller but I'm not sure how
  common it is on systems that require CONFIG_PSERIES. If CONFIG_PSERIES
  universally requires CONFIG_XICS, the better path might be to force it to
  be set.
 
 It is indeed 'some sort of interrupt controller' :)
 
 All the virtualised PSERIES systems have, or appear to have, a XICS. So
 it's pretty common.
 
 I think the only time you see an MPIC is on older machines, and even
 then maybe only if you're running bare metal.
 
 So it is pretty much required for a PSERIES kernel, but perhaps there
 are cases where the BML guys want to be able to turn it off.

In fact this series makes me wonder whether we can drop support for a
single kernel image with pseries XICS  MPIC support.

If we could drop that requirement we could have a single set of names,
ie. API, for the irq routines and build either the XICS or MPIC
versions.

That would avoid all the code that needs a setup_foo_xics() and
setup_foo_mpic() - it'd just be setup_foo(), implemented by either the
XICS or MPIC code.

cheers




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

Re: updates to the mscan-driver in net-next

2009-11-17 Thread Wolfram Sang
 I will also update my branch on pengutronix.de tomorrow,

Done.

===

The following changes since commit a0a9020c1725cd5c9a13a7aab65831f3c85ea9ca:
  Wolfram Sang (1):
net/can/mscan: final checkpatch cleanups

are available in the git repository at:

  git://git.pengutronix.de/git/wsa/linux-2.6.git net-next-52xx-can

Wolfram Sang (11):
  net/can/mscan: move defines into .h file
  net/can/mscan: trivial fixes
  net/can/mscan: drop support for CAN_MODE_{SLEEP|STOP}
  net/can/mscan: use {clr|set}bits8 macros
  net/can/mscan: fix function annotations
  net/can/mscan: drop assignment in while-construct
  net/can/mpc52xx_can: refactor clock-get routine
  net/can/mpc52xx_can: improve properties and their description
  net/can/mscan: replace hardcoded values with defines
  net/can/mscan: add error path to mscan_open()
  net/can/mscan: improve build

 Documentation/powerpc/dts-bindings/fsl/mpc5200.txt |9 +-
 drivers/net/can/Kconfig|   19 +---
 drivers/net/can/mscan/Kconfig  |   23 
 drivers/net/can/mscan/Makefile |4 +-
 .../net/can/mscan/{mpc52xx_can.c = mpc5xxx_can.c} |   64 ---
 drivers/net/can/mscan/mscan.c  |  121 +++
 drivers/net/can/mscan/mscan.h  |   36 ++-
 7 files changed, 133 insertions(+), 143 deletions(-)
 create mode 100644 drivers/net/can/mscan/Kconfig
 rename drivers/net/can/mscan/{mpc52xx_can.c = mpc5xxx_can.c} (90%)

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set

2009-11-17 Thread Mel Gorman
On Tue, Nov 17, 2009 at 11:39:04PM +1100, Michael Ellerman wrote:
 On Tue, 2009-11-17 at 12:07 +, Mel Gorman wrote:
  KConfig doesn't require CONFIG_XICS to be set with CONFIG_PSERIES but if
  it's not set, there are numerous small build errors. This is a small series
  of patches to allow CONFIG_XICS to be unset in the config.
  
  XICS appears to be some sort of interrupt controller but I'm not sure how
  common it is on systems that require CONFIG_PSERIES. If CONFIG_PSERIES
  universally requires CONFIG_XICS, the better path might be to force it to
  be set.
 
 It is indeed 'some sort of interrupt controller' :)
 
 All the virtualised PSERIES systems have, or appear to have, a XICS. So
 it's pretty common.
 
 I think the only time you see an MPIC is on older machines, and even
 then maybe only if you're running bare metal.
 
 So it is pretty much required for a PSERIES kernel, but perhaps there
 are cases where the BML guys want to be able to turn it off.
 

Do you want to take ownership of the series as I'm a bit unclear on how
and when XICS should be used? If not, I don't mind fixing the series up
as you suggested but I wouldn't be in the best position to determine if
the final result is sensible or not.

-- 
Mel Gorman
Part-time Phd Student  Linux Technology Center
University of Limerick IBM Dublin Software Lab
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] spi/mpc52xx-spi: cleanups

2009-11-17 Thread Wolfram Sang
- drop own, obsolete include-file
- drop IRQF_SAMPLE_RANDOM (deprecated feature)
- drop 'if' above kfree()
- typos, braces  whitespaces

Signed-off-by: Wolfram Sang w.s...@pengutronix.de
Cc: Luotao Fu l...@pengutronix.de
Cc: Grant Likely grant.lik...@secretlab.ca
---

This goes ontop of Grant's test-branch.

 drivers/spi/mpc52xx_spi.c   |   24 ++--
 include/linux/spi/mpc52xx_spi.h |   10 --
 2 files changed, 10 insertions(+), 24 deletions(-)
 delete mode 100644 include/linux/spi/mpc52xx_spi.h

diff --git a/drivers/spi/mpc52xx_spi.c b/drivers/spi/mpc52xx_spi.c
index 97beba2..7f4089c 100644
--- a/drivers/spi/mpc52xx_spi.c
+++ b/drivers/spi/mpc52xx_spi.c
@@ -18,7 +18,6 @@
 #include linux/interrupt.h
 #include linux/delay.h
 #include linux/spi/spi.h
-#include linux/spi/mpc52xx_spi.h
 #include linux/of_spi.h
 #include linux/io.h
 #include linux/of_gpio.h
@@ -54,7 +53,7 @@ MODULE_LICENSE(GPL);
 /* FSM state return values */
 #define FSM_STOP   0   /* Nothing more for the state machine to */
/* do.  If something interesting happens */
-   /* then and IRQ will be received */
+   /* then an IRQ will be received */
 #define FSM_POLL   1   /* need to poll for completion, an IRQ is */
/* not expected */
 #define FSM_CONTINUE   2   /* Keep iterating the state machine */
@@ -62,13 +61,12 @@ MODULE_LICENSE(GPL);
 /* Driver internal data */
 struct mpc52xx_spi {
struct spi_master *master;
-   u32 sysclk;
void __iomem *regs;
int irq0;   /* MODF irq */
int irq1;   /* SPIF irq */
-   int ipb_freq;
+   unsigned int ipb_freq;
 
-   /* Statistics */
+   /* Statistics; not used now, but will be reintroduced for debugfs */
int msg_count;
int wcol_count;
int wcol_ticks;
@@ -229,7 +227,7 @@ static int mpc52xx_spi_fsmstate_transfer(int irq, struct 
mpc52xx_spi *ms,
ms-wcol_tx_timestamp = get_tbl();
data = 0;
if (ms-tx_buf)
-   data = *(ms-tx_buf-1);
+   data = *(ms-tx_buf - 1);
out_8(ms-regs + SPI_DATA, data); /* try again */
return FSM_CONTINUE;
} else if (status  SPI_STATUS_MODF) {
@@ -481,8 +479,9 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
gpio_direction_output(gpio_cs, 1);
ms-gpio_cs[i] = gpio_cs;
}
-   } else
+   } else {
master-num_chipselect = 1;
+   }
 
spin_lock_init(ms-lock);
INIT_LIST_HEAD(ms-queue);
@@ -490,9 +489,9 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
 
/* Decide if interrupts can be used */
if (ms-irq0  ms-irq1) {
-   rc = request_irq(ms-irq0, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM,
+   rc = request_irq(ms-irq0, mpc52xx_spi_irq, 0,
  mpc5200-spi-modf, ms);
-   rc |= request_irq(ms-irq1, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM,
+   rc |= request_irq(ms-irq1, mpc52xx_spi_irq, 0,
  mpc5200-spi-spiF, ms);
if (rc) {
free_irq(ms-irq0, ms);
@@ -524,8 +523,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
while (i--  0)
gpio_free(ms-gpio_cs[i]);
 
-   if (ms-gpio_cs != NULL)
-   kfree(ms-gpio_cs);
+   kfree(ms-gpio_cs);
  err_alloc:
  err_init:
iounmap(regs);
@@ -544,9 +542,7 @@ static int __devexit mpc52xx_spi_remove(struct of_device 
*op)
for (i = 0; i  ms-gpio_cs_count; i++)
gpio_free(ms-gpio_cs[i]);
 
-   if (ms-gpio_cs != NULL)
-   kfree(ms-gpio_cs);
-
+   kfree(ms-gpio_cs);
spi_unregister_master(master);
spi_master_put(master);
iounmap(ms-regs);
diff --git a/include/linux/spi/mpc52xx_spi.h b/include/linux/spi/mpc52xx_spi.h
deleted file mode 100644
index d1004cf..000
--- a/include/linux/spi/mpc52xx_spi.h
+++ /dev/null
@@ -1,10 +0,0 @@
-
-#ifndef INCLUDE_MPC5200_SPI_H
-#define INCLUDE_MPC5200_SPI_H
-
-extern void mpc52xx_spi_set_premessage_hook(struct spi_master *master,
-   void (*hook)(struct spi_message *m,
-void *context),
-   void *hook_context);
-
-#endif
-- 
1.6.3.3

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


Re: [PATCH] spi/mpc52xx-spi: cleanups

2009-11-17 Thread Luotao Fu
On Tue, Nov 17, 2009 at 03:31:08PM +0100, Wolfram Sang wrote:
 - drop own, obsolete include-file
 - drop IRQF_SAMPLE_RANDOM (deprecated feature)
 - drop 'if' above kfree()
 - typos, braces  whitespaces
 
 Signed-off-by: Wolfram Sang w.s...@pengutronix.de
 Cc: Luotao Fu l...@pengutronix.de
 Cc: Grant Likely grant.lik...@secretlab.ca

acked-by: Luotao Fu l...@pengutronix.de

minor comments see below,

 ---
 
 This goes ontop of Grant's test-branch.
 
  drivers/spi/mpc52xx_spi.c   |   24 ++--
  include/linux/spi/mpc52xx_spi.h |   10 --
  2 files changed, 10 insertions(+), 24 deletions(-)
  delete mode 100644 include/linux/spi/mpc52xx_spi.h
 
 diff --git a/drivers/spi/mpc52xx_spi.c b/drivers/spi/mpc52xx_spi.c
 index 97beba2..7f4089c 100644
 --- a/drivers/spi/mpc52xx_spi.c
 +++ b/drivers/spi/mpc52xx_spi.c
 @@ -18,7 +18,6 @@
  #include linux/interrupt.h
  #include linux/delay.h
  #include linux/spi/spi.h
 -#include linux/spi/mpc52xx_spi.h
  #include linux/of_spi.h
  #include linux/io.h
  #include linux/of_gpio.h
 @@ -54,7 +53,7 @@ MODULE_LICENSE(GPL);
  /* FSM state return values */
  #define FSM_STOP 0   /* Nothing more for the state machine to */
   /* do.  If something interesting happens */
 - /* then and IRQ will be received */
 + /* then an IRQ will be received */
  #define FSM_POLL 1   /* need to poll for completion, an IRQ is */
   /* not expected */
  #define FSM_CONTINUE 2   /* Keep iterating the state machine */
 @@ -62,13 +61,12 @@ MODULE_LICENSE(GPL);
  /* Driver internal data */
  struct mpc52xx_spi {
   struct spi_master *master;
 - u32 sysclk;
   void __iomem *regs;
   int irq0;   /* MODF irq */
   int irq1;   /* SPIF irq */
 - int ipb_freq;
 + unsigned int ipb_freq;
  
 - /* Statistics */
 + /* Statistics; not used now, but will be reintroduced for debugfs */
   int msg_count;
   int wcol_count;
   int wcol_ticks;
 @@ -229,7 +227,7 @@ static int mpc52xx_spi_fsmstate_transfer(int irq, struct 
 mpc52xx_spi *ms,
   ms-wcol_tx_timestamp = get_tbl();
   data = 0;
   if (ms-tx_buf)
 - data = *(ms-tx_buf-1);
 + data = *(ms-tx_buf - 1);
   out_8(ms-regs + SPI_DATA, data); /* try again */
   return FSM_CONTINUE;
   } else if (status  SPI_STATUS_MODF) {
 @@ -481,8 +479,9 @@ static int __devinit mpc52xx_spi_probe(struct of_device 
 *op,
   gpio_direction_output(gpio_cs, 1);
   ms-gpio_cs[i] = gpio_cs;
   }
 - } else
 + } else {
   master-num_chipselect = 1;
 + }
  
   spin_lock_init(ms-lock);
   INIT_LIST_HEAD(ms-queue);
 @@ -490,9 +489,9 @@ static int __devinit mpc52xx_spi_probe(struct of_device 
 *op,
  
   /* Decide if interrupts can be used */
   if (ms-irq0  ms-irq1) {
 - rc = request_irq(ms-irq0, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM,
 + rc = request_irq(ms-irq0, mpc52xx_spi_irq, 0,
 mpc5200-spi-modf, ms);
 - rc |= request_irq(ms-irq1, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM,
 + rc |= request_irq(ms-irq1, mpc52xx_spi_irq, 0,
 mpc5200-spi-spiF, ms);

The spiF here is probably also a typo.

   if (rc) {
   free_irq(ms-irq0, ms);
 @@ -524,8 +523,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device 
 *op,
   while (i--  0)
   gpio_free(ms-gpio_cs[i]);
  
 - if (ms-gpio_cs != NULL)
 - kfree(ms-gpio_cs);
 + kfree(ms-gpio_cs);
   err_alloc:
   err_init:
   iounmap(regs);
 @@ -544,9 +542,7 @@ static int __devexit mpc52xx_spi_remove(struct of_device 
 *op)
   for (i = 0; i  ms-gpio_cs_count; i++)
   gpio_free(ms-gpio_cs[i]);
  
 - if (ms-gpio_cs != NULL)
 - kfree(ms-gpio_cs);
 -
 + kfree(ms-gpio_cs);
   spi_unregister_master(master);
   spi_master_put(master);
   iounmap(ms-regs);
 diff --git a/include/linux/spi/mpc52xx_spi.h b/include/linux/spi/mpc52xx_spi.h
 deleted file mode 100644
 index d1004cf..000
 --- a/include/linux/spi/mpc52xx_spi.h
 +++ /dev/null
 @@ -1,10 +0,0 @@
 -
 -#ifndef INCLUDE_MPC5200_SPI_H
 -#define INCLUDE_MPC5200_SPI_H
 -
 -extern void mpc52xx_spi_set_premessage_hook(struct spi_master *master,
 - void (*hook)(struct spi_message *m,
 -  void *context),
 - void *hook_context);
 -
 -#endif
 -- 
 1.6.3.3
 

cheers
Luotao Fu
-- 
Pengutronix e.K.   | Dipl.-Ing. Luotao Fu|
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | 

[RFC 0/5] Rework OpenFirmware GPIO handling

2009-11-17 Thread Dmitry Eremin-Solenikov
This is an RFC serie of patches containing rework of OpenFirmware GPIO binding.

It permits very simple binding of most i2c/spi/etc. GPIO expanders (e.g.
to use pcf8574x driver I had only to patch in support for working w/o platform
data, no OF-specific code at all).

Dmitry Eremin-Solenikov (5):
  Rework OpenFirmware GPIO handling
  mcu_mpc8349emitx: port to new of gpio interface
  mpc8xxx_gpio: port to new of gpio interface
  simple_gpio: port to new of gpio interface
  qe_gpio: port to new of gpio interface

 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |   11 +++---
 arch/powerpc/sysdev/mpc8xxx_gpio.c |2 +-
 arch/powerpc/sysdev/qe_lib/gpio.c  |4 +-
 arch/powerpc/sysdev/simple_gpio.c  |2 +-
 drivers/gpio/gpiolib.c |6 +++
 drivers/of/gpio.c  |   42 ---
 include/asm-generic/gpio.h |   19 +++
 include/linux/of_gpio.h|   29 +---
 8 files changed, 86 insertions(+), 29 deletions(-)

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


[RFC PATCH 1/5] Rework OpenFirmware GPIO handling

2009-11-17 Thread Dmitry Eremin-Solenikov
This patch improves OF GPIO bindings so, that most non-OF-specific gpio
controllers don't need to call any of OF binding function:

0) Move of_gpio_chip into main gpio_chip structure.
1) Call of_gpio_init/destroy from gpiochip_add/remove.
2) By default supply reasonable defaults for gpio_cells/xlate

Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com
---
 drivers/gpio/gpiolib.c |6 ++
 drivers/of/gpio.c  |   42 --
 include/asm-generic/gpio.h |   19 +++
 include/linux/of_gpio.h|   29 -
 4 files changed, 77 insertions(+), 19 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 50de0f5..7c998b3 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -10,6 +10,8 @@
 #include linux/gpio.h
 #include linux/idr.h
 
+#include linux/of_gpio.h
+
 
 /* Optional implementation infrastructure for GPIO interfaces.
  *
@@ -963,6 +965,8 @@ unlock:
spin_unlock_irqrestore(gpio_lock, flags);
if (status == 0)
status = gpiochip_export(chip);
+   if (status == 0)
+   of_gpio_init(chip);
 fail:
/* failures here can mean systems won't boot... */
if (status)
@@ -994,6 +998,8 @@ int gpiochip_remove(struct gpio_chip *chip)
}
}
if (status == 0) {
+   of_gpio_destroy(chip);
+
for (id = chip-base; id  chip-base + chip-ngpio; id++)
gpio_desc[id].chip = NULL;
}
diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c
index 6eea601..903e79f 100644
--- a/drivers/of/gpio.c
+++ b/drivers/of/gpio.c
@@ -70,7 +70,7 @@ int of_get_gpio_flags(struct device_node *np, int index,
if (ret  0)
goto err1;
 
-   ret += of_gc-gc.base;
+   ret += to_gpio_chip_of(of_gc)-base;
 err1:
of_node_put(gc);
 err0:
@@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct of_gpio_chip *of_gc, struct 
device_node *np,
return -EINVAL;
}
 
-   if (*gpio  of_gc-gc.ngpio)
+   if (*gpio  to_gpio_chip_of(of_gc)-ngpio)
return -EINVAL;
 
if (flags)
@@ -176,7 +176,7 @@ int of_mm_gpiochip_add(struct device_node *np,
 {
int ret = -ENOMEM;
struct of_gpio_chip *of_gc = mm_gc-of_gc;
-   struct gpio_chip *gc = of_gc-gc;
+   struct gpio_chip *gc = mm_gc-gc;
 
gc-label = kstrdup(np-full_name, GFP_KERNEL);
if (!gc-label)
@@ -188,9 +188,6 @@ int of_mm_gpiochip_add(struct device_node *np,
 
gc-base = -1;
 
-   if (!of_gc-xlate)
-   of_gc-xlate = of_gpio_simple_xlate;
-
if (mm_gc-save_regs)
mm_gc-save_regs(mm_gc);
 
@@ -217,3 +214,36 @@ err0:
return ret;
 }
 EXPORT_SYMBOL(of_mm_gpiochip_add);
+
+void of_gpio_init(struct gpio_chip *gc)
+{
+   struct of_gpio_chip *of_gc = gc-of_gc;
+   struct device_node *np = gc-dev ?
+   dev_archdata_get_node(gc-dev-archdata) :
+   NULL;
+
+   if (!of_gc-xlate) {
+   if (!of_gc-gpio_cells)
+   of_gc-gpio_cells = 2;
+   of_gc-xlate = of_gpio_simple_xlate;
+   }
+
+   if (np) {
+   of_node_get(np);
+   np-data = of_gc;
+   }
+}
+EXPORT_SYMBOL(of_gpio_init);
+
+void of_gpio_destroy(struct gpio_chip *gc)
+{
+   struct device_node *np = gc-dev ?
+   dev_archdata_get_node(gc-dev-archdata) :
+   NULL;
+
+   if (np) {
+   np-data = NULL;
+   of_node_put(np);
+   }
+}
+EXPORT_SYMBOL(of_gpio_destroy);
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 66d6106..3a70958 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -31,6 +31,21 @@ static inline int gpio_is_valid(int number)
 struct seq_file;
 struct module;
 
+#ifdef CONFIG_OF_GPIO
+struct device_node;
+enum of_gpio_flags;
+
+/*
+ * Generic OF GPIO chip
+ */
+struct of_gpio_chip {
+   int gpio_cells;
+   int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np,
+const void *gpio_spec, enum of_gpio_flags *flags);
+};
+#endif
+
+
 /**
  * struct gpio_chip - abstract a GPIO controller
  * @label: for diagnostics
@@ -76,6 +91,10 @@ struct gpio_chip {
struct device   *dev;
struct module   *owner;
 
+#ifdef CONFIG_OF_GPIO
+   struct of_gpio_chip of_gc;
+#endif
+
int (*request)(struct gpio_chip *chip,
unsigned offset);
void(*free)(struct gpio_chip *chip,
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index fc2472c..99cf84f 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -32,25 +32,16 @@ enum of_gpio_flags {
 
 #ifdef CONFIG_OF_GPIO
 
-/*
- * Generic OF GPIO chip
- */
-struct of_gpio_chip {
-   

[RFC PATCH 2/5] mcu_mpc8349emitx: port to new of gpio interface

2009-11-17 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com
---
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |   11 +--
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c 
b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 82a9bcb..4ba8b16 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -36,7 +36,7 @@ struct mcu {
struct mutex lock;
struct device_node *np;
struct i2c_client *client;
-   struct of_gpio_chip of_gc;
+   struct gpio_chip gc;
u8 reg_ctrl;
 };
 
@@ -55,8 +55,7 @@ static void mcu_power_off(void)
 
 static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
 {
-   struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
-   struct mcu *mcu = container_of(of_gc, struct mcu, of_gc);
+   struct mcu *mcu = container_of(gc, struct mcu, gc);
u8 bit = 1  (4 + gpio);
 
mutex_lock(mcu-lock);
@@ -78,8 +77,8 @@ static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned 
int gpio, int val)
 static int mcu_gpiochip_add(struct mcu *mcu)
 {
struct device_node *np;
-   struct of_gpio_chip *of_gc = mcu-of_gc;
-   struct gpio_chip *gc = of_gc-gc;
+   struct gpio_chip *gc = mcu-gc;
+   struct of_gpio_chip *of_gc = gc-of_gc;
int ret;
 
np = of_find_compatible_node(NULL, NULL, fsl,mcu-mpc8349emitx);
@@ -113,7 +112,7 @@ static int mcu_gpiochip_remove(struct mcu *mcu)
 {
int ret;
 
-   ret = gpiochip_remove(mcu-of_gc.gc);
+   ret = gpiochip_remove(mcu-gc);
if (ret)
return ret;
of_node_put(mcu-np);
-- 
1.6.5

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


[RFC PATCH 4/5] simple_gpio: port to new of gpio interface

2009-11-17 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com
---
 arch/powerpc/sysdev/simple_gpio.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/simple_gpio.c 
b/arch/powerpc/sysdev/simple_gpio.c
index 43c4569..5ad1e23 100644
--- a/arch/powerpc/sysdev/simple_gpio.c
+++ b/arch/powerpc/sysdev/simple_gpio.c
@@ -101,7 +101,7 @@ static int __init u8_simple_gpiochip_add(struct device_node 
*np)
 
mm_gc = u8_gc-mm_gc;
of_gc = mm_gc-of_gc;
-   gc = of_gc-gc;
+   gc = mm_gc-gc;
 
mm_gc-save_regs = u8_gpio_save_regs;
of_gc-gpio_cells = 2;
-- 
1.6.5

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


[RFC PATCH 3/5] mpc8xxx_gpio: port to new of gpio interface

2009-11-17 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com
---
 arch/powerpc/sysdev/mpc8xxx_gpio.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/mpc8xxx_gpio.c 
b/arch/powerpc/sysdev/mpc8xxx_gpio.c
index 103eace..9e8f4b4 100644
--- a/arch/powerpc/sysdev/mpc8xxx_gpio.c
+++ b/arch/powerpc/sysdev/mpc8xxx_gpio.c
@@ -129,7 +129,7 @@ static void __init mpc8xxx_add_controller(struct 
device_node *np)
 
mm_gc = mpc8xxx_gc-mm_gc;
of_gc = mm_gc-of_gc;
-   gc = of_gc-gc;
+   gc = mm_gc-gc;
 
mm_gc-save_regs = mpc8xxx_gpio_save_regs;
of_gc-gpio_cells = 2;
-- 
1.6.5

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


[RFC PATCH 5/5] qe_gpio: port to new of gpio interface

2009-11-17 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com
---
 arch/powerpc/sysdev/qe_lib/gpio.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c 
b/arch/powerpc/sysdev/qe_lib/gpio.c
index 8e7a776..b85eab8 100644
--- a/arch/powerpc/sysdev/qe_lib/gpio.c
+++ b/arch/powerpc/sysdev/qe_lib/gpio.c
@@ -187,7 +187,7 @@ struct qe_pin *qe_pin_request(struct device_node *np, int 
index)
if (err  0)
goto err1;
 
-   mm_gc = to_of_mm_gpio_chip(of_gc-gc);
+   mm_gc = to_of_mm_of_chip(of_gc);
qe_gc = to_qe_gpio_chip(mm_gc);
 
spin_lock_irqsave(qe_gc-lock, flags);
@@ -319,7 +319,7 @@ static int __init qe_add_gpiochips(void)
 
mm_gc = qe_gc-mm_gc;
of_gc = mm_gc-of_gc;
-   gc = of_gc-gc;
+   gc = mm_gc-gc;
 
mm_gc-save_regs = qe_gpio_save_regs;
of_gc-gpio_cells = 2;
-- 
1.6.5

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


Re: updates to the mscan-driver in net-next

2009-11-17 Thread Wolfgang Grandegger
David Miller wrote:
 From: Wolfram Sang w.s...@pengutronix.de
 Date: Mon, 16 Nov 2009 23:57:43 +0100
 
 here are the patches which fix the issues for the mscan  mpc52xx_can drivers
 raised by Wolfgang Grandegger and Grant Likely. They are based on the initial
 version of the drivers I sent a few days ago. Devicetree-discuss has been 
 added
 for the property changes. I will also update my branch on pengutronix.de
 tomorrow, I seem to have issues when trying that from home :(^
 
 All applied to net-next-2.6, thank you.

Puh, I'm again too late for commenting, testing and adding my
signed-off-by line. Nevertheless, the driver looks good and works fine now.

Thanks,

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


Re: [RFC PATCH 1/5] Rework OpenFirmware GPIO handling

2009-11-17 Thread Anton Vorontsov
On Tue, Nov 17, 2009 at 06:42:22PM +0300, Dmitry Eremin-Solenikov wrote:
 This patch improves OF GPIO bindings so, that most non-OF-specific gpio
 controllers don't need to call any of OF binding function:
 
 0) Move of_gpio_chip into main gpio_chip structure.
 1) Call of_gpio_init/destroy from gpiochip_add/remove.
 2) By default supply reasonable defaults for gpio_cells/xlate

Heh.. you didn't google before writing the code, did you? ;-)

I don't really think that David will like this approach, just as
he didn't like the previous one (which was even less intrusive,
but still wrong):

http://lkml.org/lkml/2008/10/16/248 (a huge thread, but worth reading)

Both of the approaches do not solve the pdata issue.

There are some of David's [absolutely legitimate] comments:
http://lkml.org/lkml/2008/10/20/43

Some more thoughts:
http://lkml.org/lkml/2008/10/20/182

And it turned out that the only sane solution is to write
OF-pdata-hooks for the each driver (that we do for many drivers
already):

http://lkml.org/lkml/2008/10/22/471

And for this, you'll need the patches that I sent to you
yesterday.

Thanks,

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


8641D, gianfar driver and BAD Interruptions

2009-11-17 Thread Régis Odeyé

Hello,
On a board based on 8641D, we have BAD interruptions (cat 
/proc/interrupts) which means spurious interruptions seen by the MPIC. 
The number of this BAD ITs are increasing during the life time of the 
system and depending on the ethernet activity.

So this seems to come from the gianfar and we experimented that:
- when we are binding the three interruptions enet_tx, enet_rx and 
enet_err of each interfaces on the same processor, the BAD interruptions 
do not increase any more.
- when we are compiling the driver without the NAPI mode, there is no 
more BAD interruptions at all.

We are playing with a 2.6.25 + some patches Linux kernel.
I did not analyze the errata list of 8641D with this perspective but is 
there anybody who get some inputs about the phenomenon ?

Regards.

--
Régis ODEYE

Kontron Modular Computers SA
150, rue M. Berthelot / ZI Toulon Est / BP 244 / Fr 83078 TOULON Cedex 9
Phone: (33) 4 98 16 34 86   Fax: (33) 4 98 16 34 01
E-mail: regis.od...@kontron.com  Web : www.kontron.com


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


[patch 3/3] powerpc: make the CMM memory hotplug aware

2009-11-17 Thread akpm
From: Robert Jennings r...@linux.vnet.ibm.com

The Collaborative Memory Manager (CMM) module allocates individual pages
over time that are not migratable.  On a long running system this can
severely impact the ability to find enough pages to support a hotplug
memory remove operation.

This patch adds a memory isolation notifier and a memory hotplug notifier.
The memory isolation notifier will return the number of pages found in
the range specified.  This is used to determine if all of the used pages
in a pageblock are owned by the balloon (or other entities in the notifier
chain).  The hotplug notifier will free pages in the range which is to be
removed.  The priority of this hotplug notifier is low so that it will be
called near last, this helps avoids removing loaned pages in operations
that fail due to other handlers.

CMM activity will be halted when hotplug remove operations are active and
resume activity after a delay period to allow the hypervisor time to
adjust.

Signed-off-by: Robert Jennings r...@linux.vnet.ibm.com
Cc: Mel Gorman m...@csn.ul.ie
Cc: Ingo Molnar mi...@elte.hu
Cc: Brian King brk...@linux.vnet.ibm.com
Cc: Paul Mackerras pau...@samba.org
Cc: Martin Schwidefsky schwidef...@de.ibm.com
Cc: Gerald Schaefer gera...@linux.vnet.ibm.com
Cc: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Signed-off-by: Andrew Morton a...@linux-foundation.org
---

 arch/powerpc/platforms/pseries/cmm.c |  221 -
 1 file changed, 215 insertions(+), 6 deletions(-)

diff -puN 
arch/powerpc/platforms/pseries/cmm.c~powerpc-make-the-cmm-memory-hotplug-aware 
arch/powerpc/platforms/pseries/cmm.c
--- 
a/arch/powerpc/platforms/pseries/cmm.c~powerpc-make-the-cmm-memory-hotplug-aware
+++ a/arch/powerpc/platforms/pseries/cmm.c
@@ -38,19 +38,28 @@
 #include asm/mmu.h
 #include asm/pgalloc.h
 #include asm/uaccess.h
+#include linux/memory.h
 
 #include plpar_wrappers.h
 
 #define CMM_DRIVER_VERSION 1.0.0
 #define CMM_DEFAULT_DELAY  1
+#define CMM_HOTPLUG_DELAY  5
 #define CMM_DEBUG  0
 #define CMM_DISABLE0
 #define CMM_OOM_KB 1024
 #define CMM_MIN_MEM_MB 256
 #define KB2PAGES(_p)   ((_p)(PAGE_SHIFT-10))
 #define PAGES2KB(_p)   ((_p)(PAGE_SHIFT-10))
+/*
+ * The priority level tries to ensure that this notifier is called as
+ * late as possible to reduce thrashing in the shared memory pool.
+ */
+#define CMM_MEM_HOTPLUG_PRI1
+#define CMM_MEM_ISOLATE_PRI15
 
 static unsigned int delay = CMM_DEFAULT_DELAY;
+static unsigned int hotplug_delay = CMM_HOTPLUG_DELAY;
 static unsigned int oom_kb = CMM_OOM_KB;
 static unsigned int cmm_debug = CMM_DEBUG;
 static unsigned int cmm_disabled = CMM_DISABLE;
@@ -65,6 +74,10 @@ MODULE_VERSION(CMM_DRIVER_VERSION);
 module_param_named(delay, delay, uint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(delay, Delay (in seconds) between polls to query hypervisor 
paging requests. 
 [Default= __stringify(CMM_DEFAULT_DELAY) ]);
+module_param_named(hotplug_delay, hotplug_delay, uint, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(delay, Delay (in seconds) after memory hotplug remove 
+before loaning resumes. 
+[Default= __stringify(CMM_HOTPLUG_DELAY) ]);
 module_param_named(oom_kb, oom_kb, uint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(oom_kb, Amount of memory in kb to free on OOM. 
 [Default= __stringify(CMM_OOM_KB) ]);
@@ -92,6 +105,9 @@ static unsigned long oom_freed_pages;
 static struct cmm_page_array *cmm_page_list;
 static DEFINE_SPINLOCK(cmm_lock);
 
+static DEFINE_MUTEX(hotplug_mutex);
+static int hotplug_occurred; /* protected by the hotplug mutex */
+
 static struct task_struct *cmm_thread_ptr;
 
 /**
@@ -110,6 +126,17 @@ static long cmm_alloc_pages(long nr)
cmm_dbg(Begin request for %ld pages\n, nr);
 
while (nr) {
+   /* Exit if a hotplug operation is in progress or occurred */
+   if (mutex_trylock(hotplug_mutex)) {
+   if (hotplug_occurred) {
+   mutex_unlock(hotplug_mutex);
+   break;
+   }
+   mutex_unlock(hotplug_mutex);
+   } else {
+   break;
+   }
+
addr = __get_free_page(GFP_NOIO | __GFP_NOWARN |
   __GFP_NORETRY | __GFP_NOMEMALLOC);
if (!addr)
@@ -119,8 +146,10 @@ static long cmm_alloc_pages(long nr)
if (!pa || pa-index = CMM_NR_PAGES) {
/* Need a new page for the page list. */
spin_unlock(cmm_lock);
-   npa = (struct cmm_page_array *)__get_free_page(GFP_NOIO 
| __GFP_NOWARN |
-  
__GFP_NORETRY | __GFP_NOMEMALLOC);
+   npa = (struct 

[patch 1/3] powerpc: Sky CPU: redundant or incorrect tests on unsigned

2009-11-17 Thread akpm
From: Roel Kluin roel.kl...@gmail.com

count is unsigned and cannot be less than 0.

Signed-off-by: Roel Kluin roel.kl...@gmail.com
Acked-by: Cyrill Gorcunov gorcu...@gmail.com
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: Kumar Gala ga...@gate.crashing.org
Cc: Brian Waite wa...@skycomputers.com
Signed-off-by: Andrew Morton a...@linux-foundation.org
---

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

diff -puN 
drivers/misc/hdpuftrs/hdpu_cpustate.c~powerpc-sky-cpu-redundant-or-incorrect-tests-on-unsigned
 drivers/misc/hdpuftrs/hdpu_cpustate.c
--- 
a/drivers/misc/hdpuftrs/hdpu_cpustate.c~powerpc-sky-cpu-redundant-or-incorrect-tests-on-unsigned
+++ a/drivers/misc/hdpuftrs/hdpu_cpustate.c
@@ -121,8 +121,6 @@ static ssize_t cpustate_read(struct file
 {
unsigned char data;
 
-   if (count  0)
-   return -EFAULT;
if (count == 0)
return 0;
 
@@ -137,9 +135,6 @@ static ssize_t cpustate_write(struct fil
 {
unsigned char data;
 
-   if (count  0)
-   return -EFAULT;
-
if (count == 0)
return 0;
 
_
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[patch 2/3] mm: add notifier in pageblock isolation for balloon drivers

2009-11-17 Thread akpm
From: Robert Jennings r...@linux.vnet.ibm.com

Memory balloon drivers can allocate a large amount of memory which is not
movable but could be freed to accomodate memory hotplug remove.

Prior to calling the memory hotplug notifier chain the memory in the
pageblock is isolated.  Currently, if the migrate type is not
MIGRATE_MOVABLE the isolation will not proceed, causing the memory removal
for that page range to fail.

Rather than failing pageblock isolation if the migrateteype is not
MIGRATE_MOVABLE, this patch checks if all of the pages in the pageblock,
and not on the LRU, are owned by a registered balloon driver (or other
entity) using a notifier chain.  If all of the non-movable pages are owned
by a balloon, they can be freed later through the memory notifier chain
and the range can still be isolated in set_migratetype_isolate().

Signed-off-by: Robert Jennings r...@linux.vnet.ibm.com
Cc: Mel Gorman m...@csn.ul.ie
Cc: Ingo Molnar mi...@elte.hu
Cc: Brian King brk...@linux.vnet.ibm.com
Cc: Paul Mackerras pau...@samba.org
Cc: Martin Schwidefsky schwidef...@de.ibm.com
Cc: Gerald Schaefer gera...@linux.vnet.ibm.com
Cc: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Signed-off-by: Andrew Morton a...@linux-foundation.org
---

 drivers/base/memory.c  |   19 +
 include/linux/memory.h |   27 ++
 mm/page_alloc.c|   57 ++-
 3 files changed, 96 insertions(+), 7 deletions(-)

diff -puN 
drivers/base/memory.c~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers
 drivers/base/memory.c
--- 
a/drivers/base/memory.c~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers
+++ a/drivers/base/memory.c
@@ -63,6 +63,20 @@ void unregister_memory_notifier(struct n
 }
 EXPORT_SYMBOL(unregister_memory_notifier);
 
+static ATOMIC_NOTIFIER_HEAD(memory_isolate_chain);
+
+int register_memory_isolate_notifier(struct notifier_block *nb)
+{
+   return atomic_notifier_chain_register(memory_isolate_chain, nb);
+}
+EXPORT_SYMBOL(register_memory_isolate_notifier);
+
+void unregister_memory_isolate_notifier(struct notifier_block *nb)
+{
+   atomic_notifier_chain_unregister(memory_isolate_chain, nb);
+}
+EXPORT_SYMBOL(unregister_memory_isolate_notifier);
+
 /*
  * register_memory - Setup a sysfs device for a memory block
  */
@@ -157,6 +171,11 @@ int memory_notify(unsigned long val, voi
return blocking_notifier_call_chain(memory_chain, val, v);
 }
 
+int memory_isolate_notify(unsigned long val, void *v)
+{
+   return atomic_notifier_call_chain(memory_isolate_chain, val, v);
+}
+
 /*
  * MEMORY_HOTPLUG depends on SPARSEMEM in mm/Kconfig, so it is
  * OK to have direct references to sparsemem variables in here.
diff -puN 
include/linux/memory.h~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers
 include/linux/memory.h
--- 
a/include/linux/memory.h~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers
+++ a/include/linux/memory.h
@@ -50,6 +50,19 @@ struct memory_notify {
int status_change_nid;
 };
 
+/*
+ * During pageblock isolation, count the number of pages within the
+ * range [start_pfn, start_pfn + nr_pages) which are owned by code
+ * in the notifier chain.
+ */
+#define MEM_ISOLATE_COUNT  (10)
+
+struct memory_isolate_notify {
+   unsigned long start_pfn;/* Start of range to check */
+   unsigned int nr_pages;  /* # pages in range to check */
+   unsigned int pages_found;   /* # pages owned found by callbacks */
+};
+
 struct notifier_block;
 struct mem_section;
 
@@ -76,14 +89,28 @@ static inline int memory_notify(unsigned
 {
return 0;
 }
+static inline int register_memory_isolate_notifier(struct notifier_block *nb)
+{
+   return 0;
+}
+static inline void unregister_memory_isolate_notifier(struct notifier_block 
*nb)
+{
+}
+static inline int memory_isolate_notify(unsigned long val, void *v)
+{
+   return 0;
+}
 #else
 extern int register_memory_notifier(struct notifier_block *nb);
 extern void unregister_memory_notifier(struct notifier_block *nb);
+extern int register_memory_isolate_notifier(struct notifier_block *nb);
+extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
 extern int register_new_memory(int, struct mem_section *);
 extern int unregister_memory_section(struct mem_section *);
 extern int memory_dev_init(void);
 extern int remove_memory_block(unsigned long, struct mem_section *, int);
 extern int memory_notify(unsigned long val, void *v);
+extern int memory_isolate_notify(unsigned long val, void *v);
 extern struct memory_block *find_memory_block(struct mem_section *);
 #define CONFIG_MEM_BLOCK_SIZE  (PAGES_PER_SECTIONPAGE_SHIFT)
 enum mem_add_context { BOOT, HOTPLUG };
diff -puN 
mm/page_alloc.c~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers 
mm/page_alloc.c
--- a/mm/page_alloc.c~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers
+++ a/mm/page_alloc.c
@@ 

[PATCH 0/4] Merge OF dynamic patches

2009-11-17 Thread Nathan Fontenot

This set of patches merges the common dynamic device tree
updating routines of_attach_node() and of_detach_node() to
drivers/of/of_dynamic.c.

Built and tested on powerpc, I have no access to build/test
this on microblaze.

-Nathan Fontenot

1/4 - Merge of_attach_node
2/4 - Merge of_detach_node
3/4 - Makefile/Kconfig updates
4/4 - Move declarations to linux/of.h
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: spi_mpc8xxx.c: chip select polarity problem

2009-11-17 Thread Anton Vorontsov
On Tue, Nov 17, 2009 at 09:09:28PM +0100, Torsten Fleischer wrote:
 On Mon, Nov 16, 2009 at 19:00PM, Anton Vorontsov wrote:
 [...]
   So it might be better to fix up initial value in the platform code?
  
  Oh, we actually cannot, because the driver calls
  gpio_direction_output().
  
  And since we don't know the mode prior to SPI device's driver
  probe() finished, we'll have to set up an initial state in the
  first SPI transfer. I.e. something like this:
 
 In most cases the device drivers perform SPI transfers already in their 
 probe() function. How can it be ensured that the CS of all other devices are 
 inactive even if they are not initialized at that time?

Good question. Oh, well... then we have to use spi-cs-high,
no matter that it is a duplication of the 'compatible' property.
SPI bus drivers don't know all the devices and their CS level,
and so spi-cs-high is the only way to tell that information. :-(

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


Re: [RFC PATCH 1/5] Rework OpenFirmware GPIO handling

2009-11-17 Thread Wolfram Sang
 And it turned out that the only sane solution is to write
 OF-pdata-hooks for the each driver (that we do for many drivers
 already):

Or to support Grant in getting rid of of_platform :)

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: spi_mpc8xxx.c: chip select polarity problem

2009-11-17 Thread Torsten Fleischer
On Mon, Nov 16, 2009 at 19:00PM, Anton Vorontsov wrote:
[...]
  So it might be better to fix up initial value in the platform code?
 
 Oh, we actually cannot, because the driver calls
 gpio_direction_output().
 
 And since we don't know the mode prior to SPI device's driver
 probe() finished, we'll have to set up an initial state in the
 first SPI transfer. I.e. something like this:

In most cases the device drivers perform SPI transfers already in their 
probe() function. How can it be ensured that the CS of all other devices are 
inactive even if they are not initialized at that time?

Regards
Torsten Fleischer
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: spi_mpc8xxx.c: chip select polarity problem

2009-11-17 Thread Anton Vorontsov
On Tue, Nov 17, 2009 at 11:22:11PM +0300, Anton Vorontsov wrote:
 On Tue, Nov 17, 2009 at 09:09:28PM +0100, Torsten Fleischer wrote:
  On Mon, Nov 16, 2009 at 19:00PM, Anton Vorontsov wrote:
  [...]
So it might be better to fix up initial value in the platform code?
   
   Oh, we actually cannot, because the driver calls
   gpio_direction_output().
   
   And since we don't know the mode prior to SPI device's driver
   probe() finished, we'll have to set up an initial state in the
   first SPI transfer. I.e. something like this:
  
  In most cases the device drivers perform SPI transfers already in their 
  probe() function. How can it be ensured that the CS of all other devices 
  are 
  inactive even if they are not initialized at that time?
 
 Good question. Oh, well... then we have to use spi-cs-high,
 no matter that it is a duplication of the 'compatible' property.
 SPI bus drivers don't know all the devices and their CS level,
 and so spi-cs-high is the only way to tell that information. :-(

Oh. On the other hand, we can postpone the gpio_direction_output()
call, and still require that the platform code (or firmware)
should be responsible for setting a sane default values on the
chip selects.

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


[patch 06/13] powerpc: Fixup last users of irq_chip-typename

2009-11-17 Thread Thomas Gleixner
The typename member of struct irq_chip was kept for migration purposes
and is obsolete since more than 2 years. Fix up the leftovers.

Signed-off-by: Thomas Gleixner t...@linutronix.de
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: linuxppc-...@ozlabs.org
---
 arch/powerpc/kernel/irq.c   |6 +++---
 arch/powerpc/platforms/512x/mpc5121_ads_cpld.c  |2 +-
 arch/powerpc/platforms/52xx/media5200.c |2 +-
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c   |2 +-
 arch/powerpc/platforms/52xx/mpc52xx_pic.c   |8 
 arch/powerpc/platforms/82xx/pq2ads-pci-pic.c|2 +-
 arch/powerpc/platforms/85xx/socrates_fpga_pic.c |2 +-
 arch/powerpc/platforms/86xx/gef_pic.c   |2 +-
 arch/powerpc/platforms/cell/axon_msi.c  |2 +-
 arch/powerpc/platforms/cell/beat_interrupt.c|2 +-
 arch/powerpc/platforms/cell/interrupt.c |4 ++--
 arch/powerpc/platforms/cell/spider-pic.c|2 +-
 arch/powerpc/platforms/iseries/irq.c|2 +-
 arch/powerpc/platforms/powermac/pic.c   |2 +-
 arch/powerpc/platforms/ps3/interrupt.c  |2 +-
 arch/powerpc/platforms/pseries/xics.c   |4 ++--
 arch/powerpc/sysdev/cpm1.c  |2 +-
 arch/powerpc/sysdev/cpm2_pic.c  |2 +-
 arch/powerpc/sysdev/fsl_msi.c   |2 +-
 arch/powerpc/sysdev/i8259.c |2 +-
 arch/powerpc/sysdev/ipic.c  |4 ++--
 arch/powerpc/sysdev/mpc8xx_pic.c|2 +-
 arch/powerpc/sysdev/mpic.c  |6 +++---
 arch/powerpc/sysdev/mpic_pasemi_msi.c   |2 +-
 arch/powerpc/sysdev/mpic_u3msi.c|2 +-
 arch/powerpc/sysdev/qe_lib/qe_ic.c  |2 +-
 arch/powerpc/sysdev/tsi108_pci.c|2 +-
 arch/powerpc/sysdev/uic.c   |2 +-
 arch/powerpc/sysdev/xilinx_intc.c   |4 ++--
 29 files changed, 40 insertions(+), 40 deletions(-)

Index: linux-2.6/arch/powerpc/kernel/irq.c
===
--- linux-2.6.orig/arch/powerpc/kernel/irq.c
+++ linux-2.6/arch/powerpc/kernel/irq.c
@@ -203,7 +203,7 @@ int show_interrupts(struct seq_file *p, 
seq_printf(p, %10u , kstat_irqs(i));
 #endif /* CONFIG_SMP */
if (desc-chip)
-   seq_printf(p,  %s , desc-chip-typename);
+   seq_printf(p,  %s , desc-chip-name);
else
seq_puts(p,   None  );
seq_printf(p, %s, (desc-status  IRQ_LEVEL) ? Level  : 
Edge  );
@@ -1071,8 +1071,8 @@ static int virq_debug_show(struct seq_fi
seq_printf(m, %5d  , i);
seq_printf(m, 0x%05lx  , virq_to_hw(i));
 
-   if (desc-chip  desc-chip-typename)
-   p = desc-chip-typename;
+   if (desc-chip  desc-chip-name)
+   p = desc-chip-name;
else
p = none;
seq_printf(m, %-15s  , p);
Index: linux-2.6/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
===
--- linux-2.6.orig/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
+++ linux-2.6/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
@@ -79,7 +79,7 @@ cpld_unmask_irq(unsigned int irq)
 }
 
 static struct irq_chip cpld_pic = {
-   .typename =  CPLD PIC ,
+   .name =  CPLD PIC ,
.mask = cpld_mask_irq,
.ack = cpld_mask_irq,
.unmask = cpld_unmask_irq,
Index: linux-2.6/arch/powerpc/platforms/52xx/media5200.c
===
--- linux-2.6.orig/arch/powerpc/platforms/52xx/media5200.c
+++ linux-2.6/arch/powerpc/platforms/52xx/media5200.c
@@ -74,7 +74,7 @@ static void media5200_irq_mask(unsigned 
 }
 
 static struct irq_chip media5200_irq_chip = {
-   .typename = Media5200 FPGA,
+   .name = Media5200 FPGA,
.unmask = media5200_irq_unmask,
.mask = media5200_irq_mask,
.mask_ack = media5200_irq_mask,
Index: linux-2.6/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
===
--- linux-2.6.orig/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ linux-2.6/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -149,7 +149,7 @@ static int mpc52xx_gpt_irq_set_type(unsi
 }
 
 static struct irq_chip mpc52xx_gpt_irq_chip = {
-   .typename = MPC52xx GPT,
+   .name = MPC52xx GPT,
.unmask = mpc52xx_gpt_irq_unmask,
.mask = mpc52xx_gpt_irq_mask,
.ack = mpc52xx_gpt_irq_ack,
Index: linux-2.6/arch/powerpc/platforms/52xx/mpc52xx_pic.c
===
--- linux-2.6.orig/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ 

Re: [RFC PATCH 1/5] Rework OpenFirmware GPIO handling

2009-11-17 Thread Anton Vorontsov
On Tue, Nov 17, 2009 at 09:08:21PM +0100, Wolfram Sang wrote:
  And it turned out that the only sane solution is to write
  OF-pdata-hooks for the each driver (that we do for many drivers
  already):
 
 Or to support Grant in getting rid of of_platform :)

No, of_platform is completely other stuff. This won't help I2C/SPI
drivers.

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


Re: [PATCH] net/can: add driver for mscan family mpc52xx_mscan

2009-11-17 Thread Wolfgang Grandegger
Wolfgang Grandegger wrote:
 Wolfram Sang wrote:
 Hi Grant,

 Wolfgang commented on some points already, I will pick up the other remarks,
 just one question:

 +   clk_src = of_get_property(np, fsl,mscan-clk-src, NULL);
 +   if (clk_src  strcmp(clk_src, ip) == 0)
 Should protect against non-null.  strncmp() maybe?
 ip is null-terminated, or what do you mean?
 
 Imagine somebody defines:
 
   fsl,mscan-clk-src = 0xbaeee;

Forget my comment. I will not harm in the above case. I was just worried
about non-null-teminated strings.

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


[PATCH] [SCSI] mpt fusion: Fix 32 bit platforms with 64 bit resources.

2009-11-17 Thread pbathija
From: Pravin Bathija pbath...@amcc.com

  Powerpc 44x uses 36 bit real address while the real address defined
  in MPT Fusion driver is of type 32 bit. This causes ioremap to fail and driver
  fails to initialize. This fix changes the data types representing the real
  address from unsigned long 32-bit types to phys_addr_t which is 64-bit. The
  driver has been tested, the disks get discovered correctly and can do IO. 
Removed
  ioremap and used hose-io_base_virt for IO space to make it platform 
independent.
Content-Type: text/plain; charset=utf-8

Signed-off-by: Pravin Bathija pbath...@amcc.com
Acked-by: Feng Kan f...@amcc.com
Acked-by: Prodyut Hazarika phazar...@amcc.com
Acked-by: Loc Ho l...@amcc.com
Acked-by: Tirumala Reddy Marri tma...@amcc.com
Acked-by: Victor Gallardo vgalla...@amcc.com
---
 drivers/message/fusion/mptbase.c |   38 --
 drivers/message/fusion/mptbase.h |5 +++--
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 5d496a9..9bca4bd 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1510,11 +1510,12 @@ static int
 mpt_mapresources(MPT_ADAPTER *ioc)
 {
u8  __iomem *mem;
+   u8  __iomem *port;
int  ii;
-   unsigned longmem_phys;
-   unsigned longport;
-   u32  msize;
-   u32  psize;
+   resource_size_t  mem_phys;
+   resource_size_t  port_phys;
+   resource_size_t  msize;
+   resource_size_t  psize;
u8   revision;
int  r = -ENODEV;
struct pci_dev *pdev;
@@ -1552,14 +1553,24 @@ mpt_mapresources(MPT_ADAPTER *ioc)
}
 
mem_phys = msize = 0;
-   port = psize = 0;
+   port_phys = psize = 0;
for (ii = 0; ii  DEVICE_COUNT_RESOURCE; ii++) {
if (pci_resource_flags(pdev, ii)  PCI_BASE_ADDRESS_SPACE_IO) {
if (psize)
continue;
/* Get I/O space! */
-   port = pci_resource_start(pdev, ii);
+   port_phys = pci_resource_start(pdev, ii);
psize = pci_resource_len(pdev, ii);
+   struct pci_controller *hose =
+   pci_bus_to_host(pdev-bus);
+   port = hose-io_base_virt;
+   if (port == NULL) {
+   printk(MYIOC_s_ERR_FMT  : ERROR - Unable to
+   map adapter port !\n, ioc-name);
+   return -EINVAL;
+   }
+   ioc-pio_mem_phys = port_phys;
+   ioc-pio_chip = (SYSIF_REGS __iomem *)port;
} else {
if (msize)
continue;
@@ -1580,15 +1591,16 @@ mpt_mapresources(MPT_ADAPTER *ioc)
return -EINVAL;
}
ioc-memmap = mem;
-   dinitprintk(ioc, printk(MYIOC_s_INFO_FMT mem = %p, mem_phys = %lx\n,
-   ioc-name, mem, mem_phys));
+   dinitprintk(ioc, printk(MYIOC_s_INFO_FMT mem = %p, mem_phys = %llx\n,
+   ioc-name, mem, (u64)mem_phys));
 
ioc-mem_phys = mem_phys;
ioc-chip = (SYSIF_REGS __iomem *)mem;
 
/* Save Port IO values in case we need to do downloadboot */
-   ioc-pio_mem_phys = port;
-   ioc-pio_chip = (SYSIF_REGS __iomem *)port;
+   ioc-portmap = port;
+   dinitprintk(ioc, printk(MYIOC_s_INFO_FMT port=%p, port_phys=%llx\n,
+   ioc-name, port, (u64)port_phys));
 
return 0;
 }
@@ -1822,6 +1834,7 @@ mpt_attach(struct pci_dev *pdev, const struct 
pci_device_id *id)
if (ioc-alt_ioc)
ioc-alt_ioc-alt_ioc = NULL;
iounmap(ioc-memmap);
+   iounmap(ioc-portmap);
if (r != -5)
pci_release_selected_regions(pdev, ioc-bars);
 
@@ -2583,6 +2596,11 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
ioc-memmap = NULL;
}
 
+   if (ioc-portmap != NULL) {
+   iounmap(ioc-portmap);
+   ioc-portmap = NULL;
+   }
+
pci_disable_device(ioc-pcidev);
pci_release_selected_regions(ioc-pcidev, ioc-bars);
 
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index b3e981d..7091f13 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -584,8 +584,8 @@ typedef struct _MPT_ADAPTER
SYSIF_REGS __iomem  *chip;  /* == c8817000 (mmap) */
SYSIF_REGS __iomem  *pio_chip;  /* Programmed IO (downloadboot) 
*/
u8   bus_type;
-   u32  mem_phys;  /* == f402 (mmap) */
-   u32  

[PATCH] [PPC4xx] Fix device tree dts file for katmai board.

2009-11-17 Thread pbathija
From: Pravin Bathija pbath...@amcc.com

   Set size cell value to 2 for 4GB memory support in katmai. Also set PCI-E
   node inbound DMA ranges size to 4GB for correct boot up of katmai.
Content-Type: text/plain; charset=utf-8

Signed-off-by: Pravin Bathija pbath...@amcc.com
Acked-by: Feng Kan f...@amcc.com
Acked-by: Prodyut Hazarika phazar...@amcc.com
Acked-by: Loc Ho l...@amcc.com
Acked-by: Tirumala Reddy Marri tma...@amcc.com
Acked-by: Victor Gallardo vgalla...@amcc.com
---
 arch/powerpc/boot/dts/katmai.dts |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/boot/dts/katmai.dts b/arch/powerpc/boot/dts/katmai.dts
index 077819b..8b40fd8 100644
--- a/arch/powerpc/boot/dts/katmai.dts
+++ b/arch/powerpc/boot/dts/katmai.dts
@@ -16,7 +16,7 @@
 
 / {
#address-cells = 2;
-   #size-cells = 1;
+   #size-cells = 2;
model = amcc,katmai;
compatible = amcc,katmai;
dcr-parent = {/cpus/c...@0};
@@ -49,7 +49,7 @@
 
memory {
device_type = memory;
-   reg = 0x 0x 0x; /* Filled in by 
zImage */
+   reg =  0x0 0x 0x0 0x; /* Filled in by zImage 
*/
};
 
UIC0: interrupt-controller0 {
@@ -245,8 +245,8 @@
ranges = 0x0200 0x 0x8000 0x000d 
0x8000 0x 0x8000
  0x0100 0x 0x 0x000c 
0x0800 0x 0x0001;
 
-   /* Inbound 2GB range starting at 0 */
-   dma-ranges = 0x4200 0x0 0x0 0x0 0x0 0x0 
0x8000;
+   /* Inbound 4GB range starting at 0 */
+   dma-ranges = 0x4200 0x0 0x0 0x0 0x0 0x1 
0x;
 
/* This drives busses 0 to 0xf */
bus-range = 0x0 0xf;
@@ -289,8 +289,8 @@
ranges = 0x0200 0x 0x8000 0x000e 
0x 0x 0x8000
  0x0100 0x 0x 0x000f 
0x8000 0x 0x0001;
 
-   /* Inbound 2GB range starting at 0 */
-   dma-ranges = 0x4200 0x0 0x0 0x0 0x0 0x0 
0x8000;
+   /* Inbound 4GB range starting at 0 */
+   dma-ranges = 0x4200 0x0 0x0 0x0 0x0 0x1 
0x;
 
/* This drives busses 10 to 0x1f */
bus-range = 0x10 0x1f;
@@ -330,8 +330,8 @@
ranges = 0x0200 0x 0x8000 0x000e 
0x8000 0x 0x8000
  0x0100 0x 0x 0x000f 
0x8001 0x 0x0001;
 
-   /* Inbound 2GB range starting at 0 */
-   dma-ranges = 0x4200 0x0 0x0 0x0 0x0 0x0 
0x8000;
+   /* Inbound 4GB range starting at 0 */
+   dma-ranges = 0x4200 0x0 0x0 0x0 0x0 0x1 
0x;
 
/* This drives busses 10 to 0x1f */
bus-range = 0x20 0x2f;
@@ -371,8 +371,8 @@
ranges = 0x0200 0x 0x8000 0x000f 
0x 0x 0x8000
  0x0100 0x 0x 0x000f 
0x8002 0x 0x0001;
 
-   /* Inbound 2GB range starting at 0 */
-   dma-ranges = 0x4200 0x0 0x0 0x0 0x0 0x0 
0x8000;
+   /* Inbound 4GB range starting at 0 */
+   dma-ranges = 0x4200 0x0 0x0 0x0 0x0 0x1 
0x;
 
/* This drives busses 10 to 0x1f */
bus-range = 0x30 0x3f;
-- 
1.5.5

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


Re: [PATCH] [PPC4xx] Fix device tree dts file for katmai board.

2009-11-17 Thread Josh Boyer
On Tue, Nov 17, 2009 at 04:19:48PM -0800, pbath...@amcc.com wrote:
From: Pravin Bathija pbath...@amcc.com

   Set size cell value to 2 for 4GB memory support in katmai. Also set PCI-E
   node inbound DMA ranges size to 4GB for correct boot up of katmai.
Content-Type: text/plain; charset=utf-8

Signed-off-by: Pravin Bathija pbath...@amcc.com
Acked-by: Feng Kan f...@amcc.com
Acked-by: Prodyut Hazarika phazar...@amcc.com
Acked-by: Loc Ho l...@amcc.com
Acked-by: Tirumala Reddy Marri tma...@amcc.com
Acked-by: Victor Gallardo vgalla...@amcc.com

This conflicts with one I already have queued up in my next branch.  It also
seems to lack some of the changes that patch has.

Stefan, can you look this over and work out with Pravin what to do?

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


Re: [PATCH] net/can: add driver for mscan family mpc52xx_mscan

2009-11-17 Thread Wolfgang Grandegger
Wolfram Sang wrote:
 Hi Grant,
 
 Wolfgang commented on some points already, I will pick up the other remarks,
 just one question:
 
 +   clk_src = of_get_property(np, fsl,mscan-clk-src, NULL);
 +   if (clk_src  strcmp(clk_src, ip) == 0)
 Should protect against non-null.  strncmp() maybe?
 
 ip is null-terminated, or what do you mean?

Imagine somebody defines:

  fsl,mscan-clk-src = 0xbaeee;

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


[PATCH] ibm_newemac: Fix EMACx_TRTR[TRT] bit shifts

2009-11-17 Thread Dave Mitchell
The TRT bit shifts were reversed for EMAC4 and non-EMAC4 during the 
port from ibm_emac to ibm_newemac. This patch corrects that error.

Signed-off-by: Dave Mitchell dmitch...@appliedmicro.com
Acked-by: Feng Kan f...@appliedmicro.com
Acked-by: Prodyut Hazarika phazar...@appliedmicro.com
---
 For those curious, these bits control the TX threshold.
 
 drivers/net/ibm_newemac/emac.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ibm_newemac/emac.h b/drivers/net/ibm_newemac/emac.h
index d34adf9..f2751cb 100644
--- a/drivers/net/ibm_newemac/emac.h
+++ b/drivers/net/ibm_newemac/emac.h
@@ -263,8 +263,8 @@ struct emac_regs {
 
 
 /* EMACx_TRTR */
-#define EMAC_TRTR_SHIFT_EMAC4  27
-#define EMAC_TRTR_SHIFT24
+#define EMAC_TRTR_SHIFT_EMAC4  24
+#define EMAC_TRTR_SHIFT27
 
 /* EMAC specific TX descriptor control fields (write access) */
 #define EMAC_TX_CTRL_GFCS  0x0200
-- 
1.6.3.2

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


[PATCH 1/4] Merge of_attach_node

2009-11-17 Thread Nathan Fontenot

Merge the common of_attach_node() routine from powerpc and microblaze to
drivers/of/of_dynamic.c

Signed-off-by: Nathan Fontenot nf...@austin.ibm.com
---

Index: test-devicetree/arch/microblaze/kernel/prom.c
===
--- test-devicetree.orig/arch/microblaze/kernel/prom.c  2009-11-17 
13:52:45.0 -0600
+++ test-devicetree/arch/microblaze/kernel/prom.c   2009-11-17 
14:17:05.0 -0600
@@ -957,21 +957,6 @@
EXPORT_SYMBOL(of_node_put);

/*
- * Plug a device node into the tree and global list.
- */
-void of_attach_node(struct device_node *np)
-{
-   unsigned long flags;
-
-   write_lock_irqsave(devtree_lock, flags);
-   np-sibling = np-parent-child;
-   np-allnext = allnodes;
-   np-parent-child = np;
-   allnodes = np;
-   write_unlock_irqrestore(devtree_lock, flags);
-}
-
-/*
 * Unplug a node from the device tree.  The caller must hold
 * a reference to the node.  The memory associated with the node
 * is not freed until its refcount goes to zero.
Index: test-devicetree/arch/powerpc/kernel/prom.c
===
--- test-devicetree.orig/arch/powerpc/kernel/prom.c 2009-11-17 
13:52:45.0 -0600
+++ test-devicetree/arch/powerpc/kernel/prom.c  2009-11-17 14:17:05.0 
-0600
@@ -1413,21 +1413,6 @@
EXPORT_SYMBOL(of_node_put);

/*
- * Plug a device node into the tree and global list.
- */
-void of_attach_node(struct device_node *np)
-{
-   unsigned long flags;
-
-   write_lock_irqsave(devtree_lock, flags);
-   np-sibling = np-parent-child;
-   np-allnext = allnodes;
-   np-parent-child = np;
-   allnodes = np;
-   write_unlock_irqrestore(devtree_lock, flags);
-}
-
-/*
 * Unplug a node from the device tree.  The caller must hold
 * a reference to the node.  The memory associated with the node
 * is not freed until its refcount goes to zero.
Index: test-devicetree/drivers/of/of_dynamic.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ test-devicetree/drivers/of/of_dynamic.c 2009-11-17 14:18:11.0 
-0600
@@ -0,0 +1,36 @@
+/*
+ * Procedures for creating, accessing and interpreting the device tree.
+ *
+ * Paul Mackerras  August 1996.
+ * Copyright (C) 1996-2005 Paul Mackerras.
+ *
+ *  Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
+ *{engebret|bergn...@us.ibm.com
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#include linux/of.h
+
+/* temporary while merging */
+extern struct device_node *allnodes;
+extern rwlock_t devtree_lock;
+
+/*
+ * Plug a device node into the tree and global list.
+ */
+void of_attach_node(struct device_node *np)
+{
+   unsigned long flags;
+
+   write_lock_irqsave(devtree_lock, flags);
+   np-sibling = np-parent-child;
+   np-allnext = allnodes;
+   np-parent-child = np;
+   allnodes = np;
+   write_unlock_irqrestore(devtree_lock, flags);
+}
+
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 2/4] Merge of_detach_node

2009-11-17 Thread Nathan Fontenot

Merge the common of_detach_node() from powerpc and microblaze into the common
drivers/of/of_dynamic.c

Signed-off-by: Nathan Fontenot nf...@austin.ibm.com
---

Index: test-devicetree/arch/microblaze/kernel/prom.c
===
--- test-devicetree.orig/arch/microblaze/kernel/prom.c  2009-11-17 
14:17:05.0 -0600
+++ test-devicetree/arch/microblaze/kernel/prom.c   2009-11-17 
14:18:18.0 -0600
@@ -957,50 +957,6 @@
EXPORT_SYMBOL(of_node_put);

/*
- * Unplug a node from the device tree.  The caller must hold
- * a reference to the node.  The memory associated with the node
- * is not freed until its refcount goes to zero.
- */
-void of_detach_node(struct device_node *np)
-{
-   struct device_node *parent;
-   unsigned long flags;
-
-   write_lock_irqsave(devtree_lock, flags);
-
-   parent = np-parent;
-   if (!parent)
-   goto out_unlock;
-
-   if (allnodes == np)
-   allnodes = np-allnext;
-   else {
-   struct device_node *prev;
-   for (prev = allnodes;
-prev-allnext != np;
-prev = prev-allnext)
-   ;
-   prev-allnext = np-allnext;
-   }
-
-   if (parent-child == np)
-   parent-child = np-sibling;
-   else {
-   struct device_node *prevsib;
-   for (prevsib = np-parent-child;
-prevsib-sibling != np;
-prevsib = prevsib-sibling)
-   ;
-   prevsib-sibling = np-sibling;
-   }
-
-   of_node_set_flag(np, OF_DETACHED);
-
-out_unlock:
-   write_unlock_irqrestore(devtree_lock, flags);
-}
-
-/*
 * Add a property to a node
 */
int prom_add_property(struct device_node *np, struct property *prop)
Index: test-devicetree/arch/powerpc/kernel/prom.c
===
--- test-devicetree.orig/arch/powerpc/kernel/prom.c 2009-11-17 
14:17:05.0 -0600
+++ test-devicetree/arch/powerpc/kernel/prom.c  2009-11-17 14:18:18.0 
-0600
@@ -1412,50 +1412,6 @@
}
EXPORT_SYMBOL(of_node_put);

-/*
- * Unplug a node from the device tree.  The caller must hold
- * a reference to the node.  The memory associated with the node
- * is not freed until its refcount goes to zero.
- */
-void of_detach_node(struct device_node *np)
-{
-   struct device_node *parent;
-   unsigned long flags;
-
-   write_lock_irqsave(devtree_lock, flags);
-
-   parent = np-parent;
-   if (!parent)
-   goto out_unlock;
-
-   if (allnodes == np)
-   allnodes = np-allnext;
-   else {
-   struct device_node *prev;
-   for (prev = allnodes;
-prev-allnext != np;
-prev = prev-allnext)
-   ;
-   prev-allnext = np-allnext;
-   }
-
-   if (parent-child == np)
-   parent-child = np-sibling;
-   else {
-   struct device_node *prevsib;
-   for (prevsib = np-parent-child;
-prevsib-sibling != np;
-prevsib = prevsib-sibling)
-   ;
-   prevsib-sibling = np-sibling;
-   }
-
-   of_node_set_flag(np, OF_DETACHED);
-
-out_unlock:
-   write_unlock_irqrestore(devtree_lock, flags);
-}
-
#ifdef CONFIG_PPC_PSERIES
/*
 * Fix up the uninitialized fields in a new device node:
Index: test-devicetree/drivers/of/of_dynamic.c
===
--- test-devicetree.orig/drivers/of/of_dynamic.c2009-11-17 
14:18:11.0 -0600
+++ test-devicetree/drivers/of/of_dynamic.c 2009-11-17 14:18:18.0 
-0600
@@ -34,3 +34,46 @@
write_unlock_irqrestore(devtree_lock, flags);
}

+/*
+ * Unplug a node from the device tree.  The caller must hold
+ * a reference to the node.  The memory associated with the node
+ * is not freed until its refcount goes to zero.
+ */
+void of_detach_node(struct device_node *np)
+{
+   struct device_node *parent;
+   unsigned long flags;
+
+   write_lock_irqsave(devtree_lock, flags);
+
+   parent = np-parent;
+   if (!parent)
+   goto out_unlock;
+
+   if (allnodes == np)
+   allnodes = np-allnext;
+   else {
+   struct device_node *prev;
+   for (prev = allnodes;
+prev-allnext != np;
+prev = prev-allnext)
+   ;
+   prev-allnext = np-allnext;
+   }
+
+   if (parent-child == np)
+   parent-child = np-sibling;
+   else {
+   struct device_node *prevsib;
+   for (prevsib = np-parent-child;
+prevsib-sibling != np;
+prevsib = prevsib-sibling)
+   ;
+   

[PATCH 3/4] Makefile and Kconfig updates for of_dynamci

2009-11-17 Thread Nathan Fontenot

Update the Kconfig and Makefile files for drivers/of, powerpc and microblaze
to properly configure for CONFIG_OF_DYNAMIC to build the of_dynamic code.

Signed-off-by: Nathan Fontenot nf...@austin.ibm.com
---

Index: test-devicetree/arch/microblaze/Kconfig
===
--- test-devicetree.orig/arch/microblaze/Kconfig2009-11-17 
13:52:45.0 -0600
+++ test-devicetree/arch/microblaze/Kconfig 2009-11-17 14:01:06.0 
-0600
@@ -111,6 +111,7 @@

config OF
def_bool y
+   select OF_DYNAMIC

config PROC_DEVICETREE
bool Support for device tree in /proc
Index: test-devicetree/arch/powerpc/Kconfig
===
--- test-devicetree.orig/arch/powerpc/Kconfig   2009-11-17 13:52:45.0 
-0600
+++ test-devicetree/arch/powerpc/Kconfig2009-11-17 14:01:06.0 
-0600
@@ -163,6 +163,7 @@

config OF
def_bool y
+   select OF_DYNAMIC

config PPC_UDBG_16550
bool
Index: test-devicetree/drivers/of/Kconfig
===
--- test-devicetree.orig/drivers/of/Kconfig 2009-11-17 13:52:48.0 
-0600
+++ test-devicetree/drivers/of/Kconfig  2009-11-17 14:01:06.0 -0600
@@ -1,3 +1,7 @@
+config OF_DYNAMIC
+   bool
+   depends on OF
+
config OF_DEVICE
def_bool y
depends on OF  (SPARC || PPC_OF || MICROBLAZE)
Index: test-devicetree/drivers/of/Makefile
===
--- test-devicetree.orig/drivers/of/Makefile2009-11-17 13:52:48.0 
-0600
+++ test-devicetree/drivers/of/Makefile 2009-11-17 14:01:06.0 -0600
@@ -1,4 +1,5 @@
obj-y = base.o
+obj-$(CONFIG_OF_DYNAMIC) += of_dynamic.o
obj-$(CONFIG_OF_DEVICE) += device.o platform.o
obj-$(CONFIG_OF_GPIO)   += gpio.o
obj-$(CONFIG_OF_I2C)+= of_i2c.o
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 4/4] Move of_node[attach,detach] declarations to linux/of.h

2009-11-17 Thread Nathan Fontenot

Merge the declarations of of_attach_node and of_detach_node from the asm/prom.h
headers of powerpc and microblaze into linux/of.h.

This update also requires adding linux/of.h to the include list for
powerpc/platforms/pseries/reconfig.h.

Signed-off-by: Nathan Fontenot nf...@austin.ibm.com
---

Index: test-devicetree/arch/microblaze/include/asm/prom.h
===
--- test-devicetree.orig/arch/microblaze/include/asm/prom.h 2009-11-17 
14:17:03.0 -0600
+++ test-devicetree/arch/microblaze/include/asm/prom.h  2009-11-17 
14:18:25.0 -0600
@@ -139,10 +139,6 @@
of_flat_dt_is_compatible(unsigned long node, const char *name);
extern unsigned long __init of_get_flat_dt_root(void);

-/* For updating the device tree at runtime */
-extern void of_attach_node(struct device_node *);
-extern void of_detach_node(struct device_node *);
-
/* Other Prototypes */
extern void finish_device_tree(void);
extern void unflatten_device_tree(void);
Index: test-devicetree/arch/powerpc/include/asm/prom.h
===
--- test-devicetree.orig/arch/powerpc/include/asm/prom.h2009-11-17 
14:17:03.0 -0600
+++ test-devicetree/arch/powerpc/include/asm/prom.h 2009-11-17 
14:18:25.0 -0600
@@ -137,10 +137,6 @@
extern int __init of_flat_dt_is_compatible(unsigned long node, const char 
*name);
extern unsigned long __init of_get_flat_dt_root(void);

-/* For updating the device tree at runtime */
-extern void of_attach_node(struct device_node *);
-extern void of_detach_node(struct device_node *);
-
/* Other Prototypes */
extern void finish_device_tree(void);
extern void unflatten_device_tree(void);
Index: test-devicetree/arch/powerpc/platforms/pseries/reconfig.c
===
--- test-devicetree.orig/arch/powerpc/platforms/pseries/reconfig.c  
2009-11-17 14:17:03.0 -0600
+++ test-devicetree/arch/powerpc/platforms/pseries/reconfig.c   2009-11-17 
14:18:25.0 -0600
@@ -15,6 +15,7 @@
#include linux/kref.h
#include linux/notifier.h
#include linux/proc_fs.h
+#include linux/of.h

#include asm/prom.h
#include asm/machdep.h
Index: test-devicetree/include/linux/of.h
===
--- test-devicetree.orig/include/linux/of.h 2009-11-17 14:17:03.0 
-0600
+++ test-devicetree/include/linux/of.h  2009-11-17 14:18:25.0 -0600
@@ -84,4 +84,10 @@
const char *list_name, const char *cells_name, int index,
struct device_node **out_node, const void **out_args);

+#ifdef CONFIG_OF_DYNAMIC
+/* For updating the device tree at runtime */
+extern void of_attach_node(struct device_node *);
+extern void of_detach_node(struct device_node *);
+#endif
+
#endif /* _LINUX_OF_H */

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


Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

2009-11-17 Thread David Gibson
On Tue, Nov 17, 2009 at 01:07:03PM +0530, Sachin Sant wrote:
 David Gibson wrote:
 Hrm.  Ok.  I am truly baffled.  Well, below is a revised debug patch
 which I hope will shed some sort of light on things.  I do also notice
 Thanks for the debug patch. I have attached the collected information.
 
 from your full log that it looks like the bug is happening shortly
 after we start userspace.  So it may be differences in my userspace
 set up that meant I haven't been able to reproduce it.  I'll have
 another look at that when I get a chance.
 Let me know if you need access to the system on which i can recreate the
 bug. I can make that system available for you to debug this issue.

That's probably a good idea.  I'm still pretty baffled by this, so it
will probably take several more rounds of debug patches to start
getting a handle on it.


-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] [SCSI] mpt fusion: Fix 32 bit platforms with 64 bit resources.

2009-11-17 Thread Benjamin Herrenschmidt
On Tue, 2009-11-17 at 16:16 -0800, pbath...@amcc.com wrote:
 From: Pravin Bathija pbath...@amcc.com
 
   Powerpc 44x uses 36 bit real address while the real address defined
   in MPT Fusion driver is of type 32 bit. This causes ioremap to fail and 
 driver
   fails to initialize. This fix changes the data types representing the real
   address from unsigned long 32-bit types to phys_addr_t which is 64-bit. 
 The
   driver has been tested, the disks get discovered correctly and can do IO. 
 Removed
   ioremap and used hose-io_base_virt for IO space to make it platform 
 independent.
 Content-Type: text/plain; charset=utf-8

Except that this is all wrong :-) You basically made it powerpc specific
since none of that pci controller stuff is generic. I don't understand
what you are trying to do though. The -only- change you need to do is
to change the longs into resource_size_t.

IO Port numbers are special and handled as such already (and besides
are never bigger than 32-bit neither, at least on x86 and powerpc).

Just leave the PIO code alone, hopefully, if the driver isn't full of
crack, the code should be fine already. If the driver does something
wrong then you can attempt to fix it separately.

The only problem that you need to address afaik, is purely that
pci_resource_start() can return a resource_size_t which can be 64-bit,
and as such it is broken for the driver to manipulate and store that
value as an unsigned long or a u32.

Cheers,
Ben.


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


Re: [PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set

2009-11-17 Thread Benjamin Herrenschmidt
On Tue, 2009-11-17 at 23:52 +1100, Michael Ellerman wrote:
 
 In fact this series makes me wonder whether we can drop support for a
 single kernel image with pseries XICS  MPIC support.

Nope. Not happening. We should just hide CONFIG_XICS just like
CONFIG_MPIC, it should be select'ed by the platform (which today is only
pseries but that might change).

 If we could drop that requirement we could have a single set of names,
 ie. API, for the irq routines and build either the XICS or MPIC
 versions.

And so we would have the ability to build a kernel that supports in a
single binary every platform, as is the case today, ie, pseries,
powermac, pa6t, cell, etc... _BUT_ for pseries support, we would have to
choose at compile time whether to support old or new machines ? Sounds
backward to me :-)

 That would avoid all the code that needs a setup_foo_xics() and
 setup_foo_mpic() - it'd just be setup_foo(), implemented by either the
 XICS or MPIC code.

And that would save us what ? one page on a pSeries machine ? yeah !

Cheers,
Ben.

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


Re: [PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set

2009-11-17 Thread Benjamin Herrenschmidt
On Tue, 2009-11-17 at 12:07 +, Mel Gorman wrote:
 KConfig doesn't require CONFIG_XICS to be set with CONFIG_PSERIES but if
 it's not set, there are numerous small build errors. This is a small series
 of patches to allow CONFIG_XICS to be unset in the config.
 
 XICS appears to be some sort of interrupt controller but I'm not sure how
 common it is on systems that require CONFIG_PSERIES. If CONFIG_PSERIES
 universally requires CONFIG_XICS, the better path might be to force it to
 be set.
 
 Testing was building with make oldconfig a configuration from 2.6.31 on
 a PPC970.

CONFIG_XICS should be made invisible and selected by PSERIES.

Cheers,
Ben.


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


Value of .bootpg and TEXT_BASE for ppc440 in U-Boot

2009-11-17 Thread Mihir Punjabi
Hi,

I am currently trying to port U-Boot onto a board with PPC440x5. My board has 
16MB of flash whose base address is 0xFC00.

I have set .bootpg in u-boot.lds to 0xFCFFF000 (End of Flash - 4 KB) and 
TEXT_BASE in config.mk to 0xFCF8 (End of Flash - 512 KB). I obtained an 
error saying Not enough room for program headers (allocated 3, need 4)

I get the above error even if I set .bootpg to 0xFCF8 (End of Flash - 512 
KB)  TEXT_BASE to 0xFCF0 (End of Flash - 1 MB) - I know these are high 
values, but just wanted to ensure that enough space is available.
But, I still got the same error.

Can someone tell me what the problem here is? Is my understanding that 
.bootpg should be at a value (End of Flash - 4 KB) wrong?

Further, I harcoded the SIZEOF_HEADERS in u-boot.lds to 1024, reverted 
.bootpg to 0xFCFFF000  TEXT_BASE to 0xFCF8.

I obtained the following error:
cpu/ppc4xx/resetvec.o:(.resetvec+0x0): relocation truncated to fit: R_PPC_REL24 
against symbol `_start_440' defined in .bootpg section in cpu/ppc4xx/start.o

Please let me know what exactly should .bootpg  TEXT_BASE be set to?

I am suspecting these 2 values because my code compiles successfully if I:
1) Set TEXT_BASE to 0xFFFC
2) Remove the hardcoding of SIZEOF_HEADERS  
3) Set .bootpg to 0xF000 (set by all ppc440 boards)

Thanks and Regards,
Mihir Punjabi



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