Re: [PATCH 24/28] mpc82xx: Remove a bunch of cruft that duplicates generic functionality.

2007-09-18 Thread David Gibson
On Mon, Sep 17, 2007 at 11:58:16AM -0500, Scott Wood wrote:
 m82xx_calibrate_decr(), mpc82xx_ads_show_cpuinfo(), and mpc82xx_halt() do
 anything useful beyond what the generic code does.
 
 Signed-off-by: Scott Wood [EMAIL PROTECTED]

Acked-by: David Gibson [EMAIL PROTECTED]

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 02/28] Introduce new CPM device bindings.

2007-09-18 Thread David Gibson
On Mon, Sep 17, 2007 at 11:57:30AM -0500, Scott Wood wrote:
 This introduces a new device binding for the CPM and other devices on
 these boards.  Some of the changes include:
 
 1. Proper namespace scoping for Freescale compatibles and properties.
 
 2. Use compatible rather than things like device_type and model
 to determine which particular variant of a device is present.
 
 3. Give the drivers the relevant CPM command word directly, rather than
 requiring it to have a lookup table based on device-id, SCC v. SMC, and
 CPM version.
 
 4. Specify the CPCR and the usable DPRAM region in the CPM's reg property.
 
 Boards that do not require the legacy bindings should select
 CONFIG_PPC_CPM_NEW_BINDING to enable the of_platform CPM devices. Once
 all existing boards are converted and tested, the config option can
 become default y to prevent new boards from using the old model.  Once
 arch/ppc is gone, the config option can be removed altogether.
 
 Signed-off-by: Scott Wood [EMAIL PROTECTED]

Acked-by: David Gibson [EMAIL PROTECTED]

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/2] [POWERPC] Size swapper_pg_dir correctly

2007-09-18 Thread Stephen Rothwell
David Gibson pointed out that swapper_pg_dir actually need to be
PGD_TABLE_SIZE bytes long not PAGE_SIZE.  This actually saves 64k in
the bss for a kernel ppc64_defconfig built with CONFIG_PPC_64K_PAGES.

Signed-off-by: Stephen Rothwell [EMAIL PROTECTED]
---
 arch/powerpc/kernel/asm-offsets.c |4 
 arch/powerpc/kernel/head_64.S |2 +-
 include/asm-powerpc/pgtable-4k.h  |2 ++
 include/asm-powerpc/pgtable-64k.h |2 ++
 4 files changed, 9 insertions(+), 1 deletions(-)

Boot tested on a POWER5+ with 4K and 64K pages.

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]

diff --git a/arch/powerpc/kernel/asm-offsets.c 
b/arch/powerpc/kernel/asm-offsets.c
index a408053..0ae5d57 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -320,5 +320,9 @@ int main(void)
DEFINE(VMALLOC_START_ESID, GET_ESID(VMALLOC_START));
DEFINE(VMALLOC_START_VSID, KERNEL_VSID(VMALLOC_START));
 #endif
+
+#ifdef CONFIG_PPC64
+   DEFINE(PGD_TABLE_SIZE, PGD_TABLE_SIZE);
+#endif
return 0;
 }
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index f4ae82e..384cc75 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1539,4 +1539,4 @@ empty_zero_page:
 
.globl  swapper_pg_dir
 swapper_pg_dir:
-   .space  PAGE_SIZE
+   .space  PGD_TABLE_SIZE
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h
index add5481..818e2ab 100644
--- a/include/asm-powerpc/pgtable-4k.h
+++ b/include/asm-powerpc/pgtable-4k.h
@@ -10,10 +10,12 @@
 #define PUD_INDEX_SIZE  7
 #define PGD_INDEX_SIZE  9
 
+#ifndef __ASSEMBLY__
 #define PTE_TABLE_SIZE (sizeof(pte_t)  PTE_INDEX_SIZE)
 #define PMD_TABLE_SIZE (sizeof(pmd_t)  PMD_INDEX_SIZE)
 #define PUD_TABLE_SIZE (sizeof(pud_t)  PUD_INDEX_SIZE)
 #define PGD_TABLE_SIZE (sizeof(pgd_t)  PGD_INDEX_SIZE)
+#endif /* __ASSEMBLY__ */
 
 #define PTRS_PER_PTE   (1  PTE_INDEX_SIZE)
 #define PTRS_PER_PMD   (1  PMD_INDEX_SIZE)
diff --git a/include/asm-powerpc/pgtable-64k.h 
b/include/asm-powerpc/pgtable-64k.h
index 33ae901..bd54b77 100644
--- a/include/asm-powerpc/pgtable-64k.h
+++ b/include/asm-powerpc/pgtable-64k.h
@@ -9,9 +9,11 @@
 #define PUD_INDEX_SIZE 0
 #define PGD_INDEX_SIZE  4
 
+#ifndef __ASSEMBLY__
 #define PTE_TABLE_SIZE (sizeof(real_pte_t)  PTE_INDEX_SIZE)
 #define PMD_TABLE_SIZE (sizeof(pmd_t)  PMD_INDEX_SIZE)
 #define PGD_TABLE_SIZE (sizeof(pgd_t)  PGD_INDEX_SIZE)
+#endif /* __ASSEMBLY__ */
 
 #define PTRS_PER_PTE   (1  PTE_INDEX_SIZE)
 #define PTRS_PER_PMD   (1  PMD_INDEX_SIZE)
-- 
1.5.3.1

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


[PATCH 2/2] [POWERPC] fwnmi is only used on pSeries

2007-09-18 Thread Stephen Rothwell
This saves 4k on non pSeries builds (except for iSeries where it saves
almost 4k).

Signed-off-by: Stephen Rothwell [EMAIL PROTECTED]
---
 arch/powerpc/kernel/crash_dump.c |2 ++
 arch/powerpc/kernel/head_64.S|7 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

Boot tested on iSeries and POWER5+.
-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]

diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index ffa91d6..29ff77c 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -54,8 +54,10 @@ void __init setup_kdump_trampoline(void)
create_trampoline(i);
}
 
+#ifdef CONFIG_PPC_PSERIES
create_trampoline(__pa(system_reset_fwnmi) - PHYSICAL_START);
create_trampoline(__pa(machine_check_fwnmi) - PHYSICAL_START);
+#endif /* CONFIG_PPC_PSERIES */
 
DBG( - setup_kdump_trampoline()\n);
 }
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 384cc75..22ac245 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -341,6 +341,7 @@ slb_miss_user_pseries:
b   .   /* prevent spec. execution */
 #endif /* __DISABLED__ */
 
+#ifdef CONFIG_PPC_PSERIES
 /*
  * Vectors for the FWNMI option.  Share common code.
  */
@@ -358,6 +359,8 @@ machine_check_fwnmi:
mtspr   SPRN_SPRG1,r13  /* save r13 */
EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXMC, machine_check_common)
 
+#endif /* CONFIG_PPC_PSERIES */
+
 /*** Common interrupt handlers ***/
 
STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception)
@@ -1012,6 +1015,7 @@ _GLOBAL(do_stab_bolted)
 initial_stab:
.space  4096
 
+#ifdef CONFIG_PPC_PSERIES
 /*
  * Data area reserved for FWNMI option.
  * This address (0x7000) is fixed by the RPA.
@@ -1019,6 +1023,7 @@ initial_stab:
.= 0x7000
.globl fwnmi_data_area
 fwnmi_data_area:
+#endif /* CONFIG_PPC_PSERIES */
 
/* iSeries does not use the FWNMI stuff, so it is safe to put
 * this here, even if we later allow kernels that will boot on
@@ -1043,7 +1048,9 @@ xLparMap:
 
 #endif /* CONFIG_PPC_ISERIES */
 
+#ifdef CONFIG_PPC_PSERIES
 . = 0x8000
+#endif /* CONFIG_PPC_PSERIES */
 
 /*
  * On pSeries and most other platforms, secondary processors spin
-- 
1.5.3.1

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


RE: [PATCH] ucc_geth: fix compilation

2007-09-18 Thread Li Yang-r58472
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 On Behalf Of Kumar Gala
 Sent: Friday, September 14, 2007 10:08 PM
 To: Jeff Garzik
 Cc: linuxppc-dev@ozlabs.org list; netdev
 Subject: Re: [PATCH] ucc_geth: fix compilation
 
 
 On Sep 13, 2007, at 10:23 AM, Anton Vorontsov wrote:
 
  Currently qe_bd_t is used in the macro call -- 
 dma_unmap_single, which 
  is a no-op on PPC32, thus error is hidden today. Starting 
 with 2.6.24, 
  macro will be replaced by the empty static function, and 
 erroneous use 
  of qe_bd_t will trigger compilation error.
 
  Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
  ---
 
 Jeff, I'm going to pick this up via the powerpc.git tree 
 since its currently only broken in our for-2.6.24 branch 
 (because of other changes in there).  Any issues?

Kumar,

Kim Phillips has posted the same patch to netdev list before Anton.
Therefore, I do prefer to use his.  Thanks

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


Re: 2.6.23-rc6-mm1

2007-09-18 Thread Andy Whitcroft
On Tue, Sep 18, 2007 at 02:43:48PM +0530, Kamalesh Babulal wrote:
 Andrew Morton wrote:
 ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc6/2.6.23-rc6-mm1/
 
 2.6.23-rc6-mm1 is a 29MB diff against 2.6.23-rc6.
 
   
 snip
 
 Hi Andrew,
 
 The 2.6.23-rc6-mm1build fails at
 
  CC  drivers/pci/hotplug/rpadlpar_core.o
  CC  drivers/pci/hotplug/rpadlpar_sysfs.o
 drivers/pci/hotplug/rpadlpar_sysfs.c:132: error: unknown field `name' 
 specified in initializer
 drivers/pci/hotplug/rpadlpar_sysfs.c: In function `dlpar_sysfs_init':
 drivers/pci/hotplug/rpadlpar_sysfs.c:142: error: structure has no member 
 named `name'
 make[3]: *** [drivers/pci/hotplug/rpadlpar_sysfs.o] Error 1
 make[2]: *** [drivers/pci/hotplug] Error 2
 make[1]: *** [drivers/pci] Error 2
 make: *** [drivers] Error 2

This seems to be occuring across a number of the powerpc systems we test
with.  That driver is a power dynamic lpar IO partitioning driver.

Relevant Cc: added.

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


Re: 2.6.23-rc6-mm1

2007-09-18 Thread Benjamin Herrenschmidt
On Tue, 2007-09-18 at 10:34 +0100, Andy Whitcroft wrote:
 On Tue, Sep 18, 2007 at 02:43:48PM +0530, Kamalesh Babulal wrote:
  Andrew Morton wrote:
  ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc6/2.6.23-rc6-mm1/
  
  2.6.23-rc6-mm1 is a 29MB diff against 2.6.23-rc6.
  

  snip
  
  Hi Andrew,
  
  The 2.6.23-rc6-mm1build fails at
  
   CC  drivers/pci/hotplug/rpadlpar_core.o
   CC  drivers/pci/hotplug/rpadlpar_sysfs.o
  drivers/pci/hotplug/rpadlpar_sysfs.c:132: error: unknown field `name' 
  specified in initializer
  drivers/pci/hotplug/rpadlpar_sysfs.c: In function `dlpar_sysfs_init':
  drivers/pci/hotplug/rpadlpar_sysfs.c:142: error: structure has no member 
  named `name'
  make[3]: *** [drivers/pci/hotplug/rpadlpar_sysfs.o] Error 1
  make[2]: *** [drivers/pci/hotplug] Error 2
  make[1]: *** [drivers/pci] Error 2
  make: *** [drivers] Error 2
 
 This seems to be occuring across a number of the powerpc systems we test
 with.  That driver is a power dynamic lpar IO partitioning driver.
 
 Relevant Cc: added.

That's because somebody is breaking sysfs/kobject interfaces without
fixing all users :-) (Fair enough... it's just that we need to make sure
whoever takes care of that driver nowadays is aware of the breakage).

Ben.


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


[PATCH] [POWERPC][RFC] mpc8xx: fix build with CONFIG_MODULES=y

2007-09-18 Thread Anton Vorontsov
Hi all,

It seems there is no __res in the arch/powerpc. How it was used in
the new tree, can we now safely remove it? At least kernel builds
with that patch.

Thanks,

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---
 arch/powerpc/kernel/ppc_ksyms.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 430c502..b4163c3 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -180,9 +180,6 @@ EXPORT_SYMBOL(cacheable_memcpy);
 EXPORT_SYMBOL(cpm_install_handler);
 EXPORT_SYMBOL(cpm_free_handler);
 #endif /* CONFIG_8xx */
-#if defined(CONFIG_8xx)
-EXPORT_SYMBOL(__res);
-#endif
 
 #ifdef CONFIG_PPC32
 EXPORT_SYMBOL(next_mmu_context);
-- 
1.5.0.6
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


multicasting in MPC8272ADS

2007-09-18 Thread Nethra

hi,

I have written a multicast test application in which there is a multicast
sender and receiver.
The multicast sender sends multicast packets on a specified interface and
the multicast 
receiver receives multicast packets. I have tested this application on my
network with
 x86 machines. But when I run a multicast receiver (which has been cross
compiled for 
MPC8272ADS) on my MPC board, it is unable to receive multicast packets (the
recvfrom 
call is waiting for ever for packets to arrive). The MPC board is able to
send multicast
packets to without any problems. The /proc/net/dev_mcast shows the
appropriate 
entries for the multicast address being enabled for the interface of
interest(esentially 
group joining appear to work).

My configuration is a MPC8272ADS board rp_filter =0 for all interfaces (ie
no source 
filtering).I am wondering where the problem could be, configurations or the
ethernet 
driver itself? Are there some known issues ?

By the way with loopback enabled the reception of packets works
in case the sender and receiver are on the same machine 

waiting for ur comments..

thnks

-- 
View this message in context: 
http://www.nabble.com/multicasting-in-MPC8272ADS-tf4473829.html#a12755615
Sent from the linuxppc-dev mailing list archive at Nabble.com.

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


[PATCH] [POWERPC][RFC] sysdev/commproc.c: fix build caused by undefined symbols

2007-09-18 Thread Anton Vorontsov
cpm_install_handler and cpm_free_handler neither used nor defined
for arch/powerpc.

This causes MPC8xx build failure, patch used to fix that.

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---
 arch/powerpc/kernel/ppc_ksyms.c |5 -
 include/asm-powerpc/commproc.h  |3 ---
 2 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index b4163c3..4d28774 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -176,11 +176,6 @@ EXPORT_SYMBOL(console_drivers);
 EXPORT_SYMBOL(cacheable_memcpy);
 #endif
 
-#ifdef  CONFIG_8xx
-EXPORT_SYMBOL(cpm_install_handler);
-EXPORT_SYMBOL(cpm_free_handler);
-#endif /* CONFIG_8xx */
-
 #ifdef CONFIG_PPC32
 EXPORT_SYMBOL(next_mmu_context);
 EXPORT_SYMBOL(set_context);
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index 3972487..0d92012 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/commproc.h
@@ -686,7 +686,4 @@ typedef struct risc_timer_pram {
 #define CICR_IEN   ((uint)0x0080)  /* Int. enable */
 #define CICR_SPS   ((uint)0x0001)  /* SCC Spread */
 
-extern void cpm_install_handler(int vec, void (*handler)(void *), void 
*dev_id);
-extern void cpm_free_handler(int vec);
-
 #endif /* __CPM_8XX__ */
-- 
1.5.0.6

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


[PATCH] [POWERPC] sysdev/commproc.c: fix copy-n-paste problem

2007-09-18 Thread Anton Vorontsov
Second export should be for cpm_dpram_phys not cpm_dpram_addr.

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---
 arch/powerpc/sysdev/commproc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index b562afc..160a8b4 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -387,4 +387,4 @@ uint cpm_dpram_phys(u8* addr)
 {
return (dpram_pbase + (uint)(addr - dpram_vbase));
 }
-EXPORT_SYMBOL(cpm_dpram_addr);
+EXPORT_SYMBOL(cpm_dpram_phys);
-- 
1.5.0.6
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: 2.6.23-rc6-mm1

2007-09-18 Thread Kamalesh Babulal
Benjamin Herrenschmidt wrote:
 On Tue, 2007-09-18 at 10:34 +0100, Andy Whitcroft wrote:
   
 On Tue, Sep 18, 2007 at 02:43:48PM +0530, Kamalesh Babulal wrote:
 
 Andrew Morton wrote:
   
 ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc6/2.6.23-rc6-mm1/

 2.6.23-rc6-mm1 is a 29MB diff against 2.6.23-rc6.

  
 
 snip

 Hi Andrew,

 The 2.6.23-rc6-mm1build fails at

  CC  drivers/pci/hotplug/rpadlpar_core.o
  CC  drivers/pci/hotplug/rpadlpar_sysfs.o
 drivers/pci/hotplug/rpadlpar_sysfs.c:132: error: unknown field `name' 
 specified in initializer
 drivers/pci/hotplug/rpadlpar_sysfs.c: In function `dlpar_sysfs_init':
 drivers/pci/hotplug/rpadlpar_sysfs.c:142: error: structure has no member 
 named `name'
 make[3]: *** [drivers/pci/hotplug/rpadlpar_sysfs.o] Error 1
 make[2]: *** [drivers/pci/hotplug] Error 2
 make[1]: *** [drivers/pci] Error 2
 make: *** [drivers] Error 2
   
 This seems to be occuring across a number of the powerpc systems we test
 with.  That driver is a power dynamic lpar IO partitioning driver.

 Relevant Cc: added.
 

 That's because somebody is breaking sysfs/kobject interfaces without
 fixing all users :-) (Fair enough... it's just that we need to make sure
 whoever takes care of that driver nowadays is aware of the breakage).

 Ben.
   
Hi Andrew,

Using the kobject_set_name function to set the kobject k_name.

Signed-off-by: Kamalesh Babulal [EMAIL PROTECTED]
---
--- linux-2.6.23-rc6/drivers/pci/hotplug/rpadlpar_sysfs.c   
2007-09-18 14:56:05.0 +0530
+++ linux-2.6.23-rc6/drivers/pci/hotplug/~rpadlpar_sysfs.c  
2007-09-18 16:51:55.0 +0530
@@ -129,17 +129,17 @@ struct kobj_type ktype_dlpar_io = {
 };
 
 struct kset dlpar_io_kset = {
-   .kobj = {.name = DLPAR_KOBJ_NAME,
-.ktype = ktype_dlpar_io,
-.parent = pci_hotplug_slots_subsys.kobj},
+.kobj = {.ktype = ktype_dlpar_io,
+ .parent = pci_hotplug_slots_subsys.kobj},
.ktype = ktype_dlpar_io,
 };
 
 int dlpar_sysfs_init(void)
 {
+   kobject_set_name(dlpar_io_kset.kobj, DLPAR_KOBJ_NAME);
if (kset_register(dlpar_io_kset)) {
printk(KERN_ERR rpadlpar_io: cannot register kset for 
%s\n,
-   dlpar_io_kset.kobj.name);
+   dlpar_io_kset.kobj.k_name);
return -EINVAL;
}

-- 
Thanks  Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.

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


Re: [PATCH 18/28] 8xx: mpc885ads cleanup

2007-09-18 Thread Stephen Rothwell
On Mon, 17 Sep 2007 11:58:05 -0500 Scott Wood [EMAIL PROTECTED] wrote:

 +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
  #include asm/fs_pd.h
 -#include asm/prom.h
 +#include asm/of_platform.h

linux/of_platform.h

Sorry if I am getting boring.
-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


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

Re: [PATCH] ucc_geth: fix compilation

2007-09-18 Thread Kumar Gala

On Sep 18, 2007, at 3:56 AM, Li Yang-r58472 wrote:

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 On Behalf Of Kumar Gala
 Sent: Friday, September 14, 2007 10:08 PM
 To: Jeff Garzik
 Cc: linuxppc-dev@ozlabs.org list; netdev
 Subject: Re: [PATCH] ucc_geth: fix compilation


 On Sep 13, 2007, at 10:23 AM, Anton Vorontsov wrote:

 Currently qe_bd_t is used in the macro call --
 dma_unmap_single, which
 is a no-op on PPC32, thus error is hidden today. Starting
 with 2.6.24,
 macro will be replaced by the empty static function, and
 erroneous use
 of qe_bd_t will trigger compilation error.

 Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
 ---

 Jeff, I'm going to pick this up via the powerpc.git tree
 since its currently only broken in our for-2.6.24 branch
 (because of other changes in there).  Any issues?

 Kumar,

 Kim Phillips has posted the same patch to netdev list before Anton.
 Therefore, I do prefer to use his.  Thanks

No problem.  Jeff seems to have picked up some version of the fix.

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


Re: [PATCH] [POWERPC][RFC] sysdev/commproc.c: fix build caused by undefined symbols

2007-09-18 Thread Kumar Gala

On Sep 18, 2007, at 7:29 AM, Anton Vorontsov wrote:

 cpm_install_handler and cpm_free_handler neither used nor defined
 for arch/powerpc.

 This causes MPC8xx build failure, patch used to fix that.

can you add the __res fix, and EXPORT() and do these three as one  
patch and improve the commit message. I'm guessing this all shows up  
when we try to build with CONFIG_MODULES=y.  Put the actual compile  
failures in the commit message.

- k

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


[RFC] [PATCH] PowerPC: Add 64-bit phys addr support to 32-bit pci.

2007-09-18 Thread Valentine Barshak
Add 64-bit physical address support to PCI.

Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
---
 arch/powerpc/kernel/iomap.c  |4 +--
 arch/powerpc/kernel/pci_32.c |   56 +--
 2 files changed, 41 insertions(+), 19 deletions(-)

diff -ruN linux-2.6.orig/arch/powerpc/kernel/iomap.c 
linux-2.6/arch/powerpc/kernel/iomap.c
--- linux-2.6.orig/arch/powerpc/kernel/iomap.c  2007-09-18 15:32:19.0 
+0400
+++ linux-2.6/arch/powerpc/kernel/iomap.c   2007-09-18 17:26:35.0 
+0400
@@ -119,8 +119,8 @@
 
 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
 {
-   unsigned long start = pci_resource_start(dev, bar);
-   unsigned long len = pci_resource_len(dev, bar);
+   resource_size_t start = pci_resource_start(dev, bar);
+   resource_size_t len = pci_resource_len(dev, bar);
unsigned long flags = pci_resource_flags(dev, bar);
 
if (!len)
diff -ruN linux-2.6.orig/arch/powerpc/kernel/pci_32.c 
linux-2.6/arch/powerpc/kernel/pci_32.c
--- linux-2.6.orig/arch/powerpc/kernel/pci_32.c 2007-09-18 15:32:19.0 
+0400
+++ linux-2.6/arch/powerpc/kernel/pci_32.c  2007-09-18 18:17:00.0 
+0400
@@ -105,7 +105,7 @@
 {
struct pci_controller* hose = (struct pci_controller *)dev-sysdata;
int i;
-   unsigned long offset;
+   resource_size_t offset;
 
if (!hose) {
printk(KERN_ERR No hose for PCI dev %s!\n, pci_name(dev));
@@ -115,7 +115,7 @@
struct resource *res = dev-resource + i;
if (!res-flags)
continue;
-   if (res-end == 0x) {
+   if (res-end == (resource_size_t) -1) {
DBG(PCI:%s Resource %d [%016llx-%016llx] is 
unassigned\n,
pci_name(dev), i, (u64)res-start, (u64)res-end);
res-end -= res-start;
@@ -148,7 +148,7 @@
 void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region 
*region,
struct resource *res)
 {
-   unsigned long offset = 0;
+   resource_size_t offset = 0;
struct pci_controller *hose = dev-sysdata;
 
if (hose  res-flags  IORESOURCE_IO)
@@ -163,7 +163,7 @@
 void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
 struct pci_bus_region *region)
 {
-   unsigned long offset = 0;
+   resource_size_t offset = 0;
struct pci_controller *hose = dev-sysdata;
 
if (hose  res-flags  IORESOURCE_IO)
@@ -439,7 +439,7 @@
u8 io_base_lo, io_limit_lo;
u16 mem_base, mem_limit;
u16 cmd;
-   unsigned long start, end, off;
+   resource_size_t start, end, off;
struct pci_controller *hose = dev-sysdata;
 
if (!hose) {
@@ -843,16 +843,28 @@
 }
 EXPORT_SYMBOL(pci_device_from_OF_node);
 
+
+static inline u64 pci_get_range64(u32 *r)
+{
+   return (((u64)r[0]  32) | r[1]);
+}
+
+
 void __init
 pci_process_bridge_OF_ranges(struct pci_controller *hose,
   struct device_node *dev, int primary)
 {
static unsigned int static_lc_ranges[256] __initdata;
const unsigned int *dt_ranges;
-   unsigned int *lc_ranges, *ranges, *prev, size;
+   unsigned int *lc_ranges, *ranges, *prev;
int rlen = 0, orig_rlen;
int memno = 0;
struct resource *res;
+   u32 prev_pci_space, pci_space;
+   u64 prev_pci_addr, pci_addr;
+   u64 prev_size, size;
+   phys_addr_t cpu_phys_addr;
+   
int np, na = of_n_addr_cells(dev);
np = na + 5;
 
@@ -879,11 +891,18 @@
prev = NULL;
while ((rlen -= np * sizeof(unsigned int)) = 0) {
if (prev) {
-   if (prev[0] == ranges[0]  prev[1] == ranges[1] 
-   (prev[2] + prev[na+4]) == ranges[2] 
-   (prev[na+2] + prev[na+4]) == ranges[na+2]) {
-   prev[na+4] += ranges[na+4];
+   prev_pci_space = prev[0];
+   prev_pci_addr = pci_get_range64(prev[1]);
+   prev_size = pci_get_range64(prev[na+3]);
+   pci_space = ranges[0];
+   pci_addr = pci_get_range64(ranges[1]);
+   if ((prev_pci_space == pci_space)  
+   ((prev_pci_addr + prev_size) == pci_addr)) {
+   size = pci_get_range64(ranges[na+3]);
+   prev_size += size;
ranges[0] = 0;
+   prev[na+3] = (u32)((prev_size  32)  
0x);
+   prev[na+4] = (u32)(prev_size  0x);
ranges += np;
continue;
}
@@ -904,21 +923,22 @@
rlen = orig_rlen;
while (ranges  (rlen 

RE: [PATCH 23/28] mpc82xx: Define CPU_FTR_NEED_COHERENT

2007-09-18 Thread Rune Torgersen
 -Original Message-
 From: Scott Wood
 Sent: Monday, September 17, 2007 11:58 AM
 
 The 8272 (and presumably other PCI PQ2 chips) appear to have the
 same issue as the 83xx regarding PCI streaming DMA.
 

Can you explain what this isssue is? We're using a 8280 and have had
some PCI busmaster DMA problems, and wonder if it is related.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 03/28] Document local bus nodes in the device tree.

2007-09-18 Thread Kumar Gala

On Sep 17, 2007, at 11:57 AM, Scott Wood wrote:

 cuboot-pq2 is updated to match the binding, and get rid of phandle  
 linkage.

A slight more descriptive commit message is desired.

- k


 Signed-off-by: Scott Wood [EMAIL PROTECTED]
 ---
  Documentation/powerpc/booting-without-of.txt |   38 +++ 
 +++
  arch/powerpc/boot/cuboot-pq2.c   |   29  
 +--
  2 files changed, 46 insertions(+), 21 deletions(-)

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


Re: [PATCH] [RFC][POWERPC] Merge 32 and 64 bit pci_process_bridge_OF_ranges() instances

2007-09-18 Thread Valentine Barshak
Vitaly Bordug wrote:
 Hello Valentine,
 
 On Tue, 18 Sep 2007 16:03:50 +0400
 Valentine Barshak wrote:
 
 Vitaly Bordug wrote:
 +
 +   hose-io_base_phys = cpu_phys_addr - pci_addr;
 This is not gonna work on 32-bit platform (unless pci_addr == 0).
 Should be
 hose-io_base_phys = cpu_phys_addr;
 The other way we should adjust io size like we do on 64-bit and rewrite 
 resource fixup functions.

 I think the second sounds like a plan then. We should not assume where we 
 can make things to behave properly.
 
 +   /* handle from 0 to top of I/O window */
 +#ifdef CONFIG_PPC64
 +   hose-pci_io_size = pci_addr + size;
 +#endif
 +   hose-io_base_virt = ioremap(hose-io_base_phys, size);
 Do we need to ioremap on 64-bit? I think 64-bit uses different approach 
 in handling io space.

 Correct - 64 bit code does __get_vm_area() so the upper line is 
 ppc32-specific.
 +#ifdef CONFIG_PPC32
 +   if (prim)
 +   isa_io_base = (unsigned long)hose-io_base_virt;
 +#endif
 What's exactly the point of merging this single function?
 If this was intended to add 64-bit physical address support to 32-bit 
 platforms (like ppc440), then it does not seem sufficient to make pci 
 stuff work right.
 What about the 32-bit pcibios_fixup_resources(), 
 pcibios_resource_to_bus(), pcibios_bus_to_resource() stuff?
 There's still no 64-bit support. You'll get
 PCI Cannot allocate resource region attempting to initialize resources 
 at PCI start-up.
 Because this function is critical to get the stuff going. You can have some 
 devices working even without PCI resources initted
 (what in fact I had with mpc8272).  I am in process of moving the mentioned 
 to the common_... domain but I suspect there are other 32-bit-stick stuff 
 still. So if you want to assist in cleaning this up, feel free to join the 
 club...

Well, thanks for the invitation :)
I've been trying to work on the pci support here too. But I've used a 
bit different approach. I tried to add 64-bit phys addr support to 
pci_32.c. The patch seems to work on Sequoia. Actually, I thought 
merging was too risky at this point and might cause more problems 
breaking both 64 and 32-bit pci support.
Thanks,
Valentine.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [RFC] [PATCH] PowerPC: Add 64-bit phys addr support to 32-bit pci.

2007-09-18 Thread Kumar Gala

On Sep 18, 2007, at 9:44 AM, Valentine Barshak wrote:

 Add 64-bit physical address support to PCI.

Can you expand on your commit message.  for example why do this? is  
it address a bug fix, etc..


 Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
 ---
  arch/powerpc/kernel/iomap.c  |4 +--
  arch/powerpc/kernel/pci_32.c |   56  
 +--
  2 files changed, 41 insertions(+), 19 deletions(-)

- k

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


Re: [PATCH 16/28] 8xx: Don't call non-existent Soft_emulate_8xx from SoftwareEmulation.

2007-09-18 Thread Kumar Gala

On Sep 17, 2007, at 11:57 AM, Scott Wood wrote:

 On arch/ppc, Soft_emulate_8xx was used when full math emulation was
 turned off to emulate a minimal subset of floating point load/store
 instructions, to avoid needing a soft-float toolchain.  This function
 is called, but not present, on arch/powerpc, causing a build error
 if floating point emulation is turned off.

 As:
 1. soft-float toolchains are now common,
 2. partial emulation could mislead someone into thinking they have
 a soft-float userspace because things usually work, only to have it
 fail when actual FP gets executed under unusual circumstances, and
 3. full emulation is still available for those who need to run
 non-soft-float userspace,

 I'm deleting the call rather than moving Soft_emulate_8xx over to
 arch/powerpc.

 Signed-off-by: Scott Wood [EMAIL PROTECTED]

I'm still not in favor of this and think we should move the  
Soft_emulate_8xx code over.

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


Re: [RFC] [PATCH] PowerPC: Add 64-bit phys addr support to 32-bit pci.

2007-09-18 Thread Kumar Gala

On Sep 18, 2007, at 10:01 AM, Valentine Barshak wrote:

 Kumar Gala wrote:
 On Sep 18, 2007, at 9:44 AM, Valentine Barshak wrote:
 Add 64-bit physical address support to PCI.
 Can you expand on your commit message.  for example why do this?  
 is it address a bug fix, etc..

 Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
 ---
  arch/powerpc/kernel/iomap.c  |4 +--
  arch/powerpc/kernel/pci_32.c |   56  
 +--
  2 files changed, 41 insertions(+), 19 deletions(-)
 - k

 Currently 32-bit pci code doesn't support 64-bit physical addresses.
 We have to add 64-bit addr support in order to bring-up pci on  
 PowerPC 440. Actually, this refers to the conversation started here:

I can guess as to why, but its useful for the commit messages to be  
more descriptive so when some goes back a year from now they know why  
someone added this patch.

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


Re: [RFC] [PATCH] PowerPC: Add 64-bit phys addr support to 32-bit pci.

2007-09-18 Thread Valentine Barshak
Kumar Gala wrote:
 
 On Sep 18, 2007, at 9:44 AM, Valentine Barshak wrote:
 
 Add 64-bit physical address support to PCI.
 
 Can you expand on your commit message.  for example why do this? is it 
 address a bug fix, etc..
 

 Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
 ---
  arch/powerpc/kernel/iomap.c  |4 +--
  arch/powerpc/kernel/pci_32.c |   56 
 +--
  2 files changed, 41 insertions(+), 19 deletions(-)
 
 - k
 

Currently 32-bit pci code doesn't support 64-bit physical addresses.
We have to add 64-bit addr support in order to bring-up pci on PowerPC 
440. Actually, this refers to the conversation started here:

http://ozlabs.org/pipermail/linuxppc-dev/2007-September/042267.html
Thanks,
Valentine.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: dtc: Add basic testcases for dtc

2007-09-18 Thread Jon Loeliger
So, like, the other day David Gibson mumbled:
 This patch adds a handful of simple testcases for dtc.  It adds a dts
 file which should generate the same sample tree as is used for the
 libfdt testcases, and tests invoking dtc on this dts, plus the
 standard batch of libfdt cases on the resulting dtb, which effectively
 checks that the dtb is correct.
 
 Because the test framework assumes each testcase is an executable with
 the right output conventions, we use a little shell script, dtc.sh, as
 a wrapper around dtc itself.  It simply invokes dtc and returns a PASS
 or FAIL depending on whether dtc returned an error.
 
 It's not much, but it's a start.
 
 Signed-off-by: David Gibson [EMAIL PROTECTED]


Applied.

 NB: Jon, you won't be able to simply git-applymbox this and have it
 work.  You'll need to manually add execute permission to tests/dtc.sh
 before git commiting it, since I can't encode the permissions in a
 patch.  Sorry for the inconvenience, but it didn't really seem worth
 setting up my own git to pull from just for that.

No problem.  Too bad you can't just use git, though... :-)

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


Re: dtc: Whitespace cleanup

2007-09-18 Thread Jon Loeliger
So, like, the other day David Gibson mumbled:
 This large patch removes all trailing whitespace from dtc (including
 libfdt, the testsuite and documentation).  It also removes a handful
 of redundant blank lines (at the end of functions, or when there are
 two blank lines together for no particular reason).
 
 As well as anything else, this means that quilt won't whinge when I go
 to convert the whole of libfdt into a patch to apply to the kernel.
 
 Signed-off-by: David Gibson [EMAIL PROTECTED]

Applied.

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


Re: [PATCH 16/28] 8xx: Don't call non-existent Soft_emulate_8xx from SoftwareEmulation.

2007-09-18 Thread Scott Wood
On Tue, Sep 18, 2007 at 10:08:50AM -0500, Kumar Gala wrote:
 
 On Sep 17, 2007, at 11:57 AM, Scott Wood wrote:
 
 On arch/ppc, Soft_emulate_8xx was used when full math emulation was
 turned off to emulate a minimal subset of floating point load/store
 instructions, to avoid needing a soft-float toolchain.  This function
 is called, but not present, on arch/powerpc, causing a build error
 if floating point emulation is turned off.
 
 As:
 1. soft-float toolchains are now common,
 2. partial emulation could mislead someone into thinking they have
 a soft-float userspace because things usually work, only to have it
 fail when actual FP gets executed under unusual circumstances, and
 3. full emulation is still available for those who need to run
 non-soft-float userspace,
 
 I'm deleting the call rather than moving Soft_emulate_8xx over to
 arch/powerpc.
 
 Signed-off-by: Scott Wood [EMAIL PROTECTED]
 
 I'm still not in favor of this and think we should move the  
 Soft_emulate_8xx code over.

Any particular reasons that outweigh the reasons I gave, especially #2?

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


Re: [PATCH 16/28] 8xx: Don't call non-existent Soft_emulate_8xx from SoftwareEmulation.

2007-09-18 Thread Kumar Gala

On Sep 18, 2007, at 10:11 AM, Scott Wood wrote:

 On Tue, Sep 18, 2007 at 10:08:50AM -0500, Kumar Gala wrote:

 On Sep 17, 2007, at 11:57 AM, Scott Wood wrote:

 On arch/ppc, Soft_emulate_8xx was used when full math emulation was
 turned off to emulate a minimal subset of floating point load/store
 instructions, to avoid needing a soft-float toolchain.  This  
 function
 is called, but not present, on arch/powerpc, causing a build error
 if floating point emulation is turned off.

 As:
 1. soft-float toolchains are now common,
 2. partial emulation could mislead someone into thinking they have
 a soft-float userspace because things usually work, only to have it
 fail when actual FP gets executed under unusual circumstances, and
 3. full emulation is still available for those who need to run
 non-soft-float userspace,

 I'm deleting the call rather than moving Soft_emulate_8xx over to
 arch/powerpc.

 Signed-off-by: Scott Wood [EMAIL PROTECTED]

 I'm still not in favor of this and think we should move the
 Soft_emulate_8xx code over.

 Any particular reasons that outweigh the reasons I gave, especially  
 #2?

Mainly that 8xx has been doing this for a vast number of years and I  
see no reason to stop doing it at this point.

While I can see that it might be misleading, clearly 8xx linux users  
haven't had issues with it.

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


Re: [PATCH 16/28] 8xx: Don't call non-existent Soft_emulate_8xx from SoftwareEmulation.

2007-09-18 Thread Kumar Gala

On Sep 18, 2007, at 10:23 AM, Scott Wood wrote:

 On Tue, Sep 18, 2007 at 10:19:05AM -0500, Kumar Gala wrote:
 Mainly that 8xx has been doing this for a vast number of years and I
 see no reason to stop doing it at this point.

 While I can see that it might be misleading, clearly 8xx linux users
 haven't had issues with it.

 Or they haven't said anything. :-P

:)

 How about a three-way choice of full emulation, minimal emulation,  
 and no
 emulation?

I think I'd be ok with that.

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


[PATCH 2/2] [FS_ENET] Add polling support

2007-09-18 Thread Vitaly Bordug

Signed-off-by: Vitaly Bordug [EMAIL PROTECTED]

---

 drivers/net/fs_enet/fs_enet-main.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)


diff --git a/drivers/net/fs_enet/fs_enet-main.c 
b/drivers/net/fs_enet/fs_enet-main.c
index 927cd9e..0e2d2b2 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -61,6 +61,9 @@ module_param(fs_enet_debug, int, 0);
 MODULE_PARM_DESC(fs_enet_debug,
 Freescale bitmapped debugging message enable value);
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void fs_enet_netpoll(struct net_device *dev);
+#endif
 
 static void fs_set_multicast_list(struct net_device *dev)
 {
@@ -1049,6 +1052,10 @@ static struct net_device *fs_init_instance(struct device 
*dev,
ndev-stop = fs_enet_close;
ndev-get_stats = fs_enet_get_stats;
ndev-set_multicast_list = fs_set_multicast_list;
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+   ndev-poll_controller = fs_enet_netpoll;
+#endif
if (fpi-use_napi) {
ndev-poll = fs_enet_rx_napi;
ndev-weight = fpi-napi_weight;
@@ -1275,6 +1282,15 @@ static void __exit fs_cleanup(void)
cleanup_immap();
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void fs_enet_netpoll(struct net_device *dev)
+{
+   disable_irq(dev-irq);
+   fs_enet_interrupt(dev-irq, dev, NULL);
+   enable_irq(dev-irq);
+}
+#endif
+
 
/**/
 
 module_init(fs_init);

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


[PATCH 1/2] [FS_ENET] TX stuff should use fep-tx_lock, instead of fep-lock.

2007-09-18 Thread Vitaly Bordug

Signed-off-by: Vitaly Bordug [EMAIL PROTECTED]

---

 drivers/net/fs_enet/fs_enet-main.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/drivers/net/fs_enet/fs_enet-main.c 
b/drivers/net/fs_enet/fs_enet-main.c
index a4a2a0e..927cd9e 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -348,7 +348,7 @@ static void fs_enet_tx(struct net_device *dev)
int dirtyidx, do_wake, do_restart;
u16 sc;
 
-   spin_lock(fep-lock);
+   spin_lock(fep-tx_lock);
bdp = fep-dirty_tx;
 
do_wake = do_restart = 0;
@@ -428,7 +428,7 @@ static void fs_enet_tx(struct net_device *dev)
if (do_restart)
(*fep-ops-tx_restart)(dev);
 
-   spin_unlock(fep-lock);
+   spin_unlock(fep-tx_lock);
 
if (do_wake)
netif_wake_queue(dev);
@@ -826,7 +826,9 @@ static int fs_enet_close(struct net_device *dev)
phy_stop(fep-phydev);
 
spin_lock_irqsave(fep-lock, flags);
+   spin_lock(fep-tx_lock);
(*fep-ops-stop)(dev);
+   spin_unlock(fep-tx_lock);
spin_unlock_irqrestore(fep-lock, flags);
 
/* release any irqs */

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


[RFC] [PATCH] PowerPC: Add 64-bit phys addr support to 32-bit pci.

2007-09-18 Thread Valentine Barshak
Currently pci_32 doesn't support 64-bit physical addresses, while
PowerPC440 platform has PCI space typically mapped above 4GB range.
The patch adds 64-bit physical address support to 32-bit PCI code
in order to bring-up PCI on 44x platform.

Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
---
 arch/powerpc/kernel/iomap.c  |4 +--
 arch/powerpc/kernel/pci_32.c |   56 +--
 2 files changed, 41 insertions(+), 19 deletions(-)

diff -ruN linux-2.6.orig/arch/powerpc/kernel/iomap.c 
linux-2.6/arch/powerpc/kernel/iomap.c
--- linux-2.6.orig/arch/powerpc/kernel/iomap.c  2007-09-18 15:32:19.0 
+0400
+++ linux-2.6/arch/powerpc/kernel/iomap.c   2007-09-18 17:26:35.0 
+0400
@@ -119,8 +119,8 @@
 
 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
 {
-   unsigned long start = pci_resource_start(dev, bar);
-   unsigned long len = pci_resource_len(dev, bar);
+   resource_size_t start = pci_resource_start(dev, bar);
+   resource_size_t len = pci_resource_len(dev, bar);
unsigned long flags = pci_resource_flags(dev, bar);
 
if (!len)
diff -ruN linux-2.6.orig/arch/powerpc/kernel/pci_32.c 
linux-2.6/arch/powerpc/kernel/pci_32.c
--- linux-2.6.orig/arch/powerpc/kernel/pci_32.c 2007-09-18 15:32:19.0 
+0400
+++ linux-2.6/arch/powerpc/kernel/pci_32.c  2007-09-18 18:17:00.0 
+0400
@@ -105,7 +105,7 @@
 {
struct pci_controller* hose = (struct pci_controller *)dev-sysdata;
int i;
-   unsigned long offset;
+   resource_size_t offset;
 
if (!hose) {
printk(KERN_ERR No hose for PCI dev %s!\n, pci_name(dev));
@@ -115,7 +115,7 @@
struct resource *res = dev-resource + i;
if (!res-flags)
continue;
-   if (res-end == 0x) {
+   if (res-end == (resource_size_t) -1) {
DBG(PCI:%s Resource %d [%016llx-%016llx] is 
unassigned\n,
pci_name(dev), i, (u64)res-start, (u64)res-end);
res-end -= res-start;
@@ -148,7 +148,7 @@
 void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region 
*region,
struct resource *res)
 {
-   unsigned long offset = 0;
+   resource_size_t offset = 0;
struct pci_controller *hose = dev-sysdata;
 
if (hose  res-flags  IORESOURCE_IO)
@@ -163,7 +163,7 @@
 void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
 struct pci_bus_region *region)
 {
-   unsigned long offset = 0;
+   resource_size_t offset = 0;
struct pci_controller *hose = dev-sysdata;
 
if (hose  res-flags  IORESOURCE_IO)
@@ -439,7 +439,7 @@
u8 io_base_lo, io_limit_lo;
u16 mem_base, mem_limit;
u16 cmd;
-   unsigned long start, end, off;
+   resource_size_t start, end, off;
struct pci_controller *hose = dev-sysdata;
 
if (!hose) {
@@ -843,16 +843,28 @@
 }
 EXPORT_SYMBOL(pci_device_from_OF_node);
 
+
+static inline u64 pci_get_range64(u32 *r)
+{
+   return (((u64)r[0]  32) | r[1]);
+}
+
+
 void __init
 pci_process_bridge_OF_ranges(struct pci_controller *hose,
   struct device_node *dev, int primary)
 {
static unsigned int static_lc_ranges[256] __initdata;
const unsigned int *dt_ranges;
-   unsigned int *lc_ranges, *ranges, *prev, size;
+   unsigned int *lc_ranges, *ranges, *prev;
int rlen = 0, orig_rlen;
int memno = 0;
struct resource *res;
+   u32 prev_pci_space, pci_space;
+   u64 prev_pci_addr, pci_addr;
+   u64 prev_size, size;
+   phys_addr_t cpu_phys_addr;
+   
int np, na = of_n_addr_cells(dev);
np = na + 5;
 
@@ -879,11 +891,18 @@
prev = NULL;
while ((rlen -= np * sizeof(unsigned int)) = 0) {
if (prev) {
-   if (prev[0] == ranges[0]  prev[1] == ranges[1] 
-   (prev[2] + prev[na+4]) == ranges[2] 
-   (prev[na+2] + prev[na+4]) == ranges[na+2]) {
-   prev[na+4] += ranges[na+4];
+   prev_pci_space = prev[0];
+   prev_pci_addr = pci_get_range64(prev[1]);
+   prev_size = pci_get_range64(prev[na+3]);
+   pci_space = ranges[0];
+   pci_addr = pci_get_range64(ranges[1]);
+   if ((prev_pci_space == pci_space)  
+   ((prev_pci_addr + prev_size) == pci_addr)) {
+   size = pci_get_range64(ranges[na+3]);
+   prev_size += size;
ranges[0] = 0;
+   prev[na+3] = (u32)((prev_size  32)  
0x);
+   prev[na+4] = (u32)(prev_size  

Re: 2.6.23-rc6-mm1

2007-09-18 Thread Andrew Morton
On Tue, 18 Sep 2007 17:37:58 +0530 Kamalesh Babulal [EMAIL PROTECTED] wrote:

 Benjamin Herrenschmidt wrote:
  On Tue, 2007-09-18 at 10:34 +0100, Andy Whitcroft wrote:

  On Tue, Sep 18, 2007 at 02:43:48PM +0530, Kamalesh Babulal wrote:
  
  Andrew Morton wrote:

  ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc6/2.6.23-rc6-mm1/
 
  2.6.23-rc6-mm1 is a 29MB diff against 2.6.23-rc6.
 
   
  
  snip
 
  Hi Andrew,
 
  The 2.6.23-rc6-mm1build fails at
 
   CC  drivers/pci/hotplug/rpadlpar_core.o
   CC  drivers/pci/hotplug/rpadlpar_sysfs.o
  drivers/pci/hotplug/rpadlpar_sysfs.c:132: error: unknown field `name' 
  specified in initializer
  drivers/pci/hotplug/rpadlpar_sysfs.c: In function `dlpar_sysfs_init':
  drivers/pci/hotplug/rpadlpar_sysfs.c:142: error: structure has no member 
  named `name'
  make[3]: *** [drivers/pci/hotplug/rpadlpar_sysfs.o] Error 1
  make[2]: *** [drivers/pci/hotplug] Error 2
  make[1]: *** [drivers/pci] Error 2
  make: *** [drivers] Error 2

  This seems to be occuring across a number of the powerpc systems we test
  with.  That driver is a power dynamic lpar IO partitioning driver.
 
  Relevant Cc: added.
  
 
  That's because somebody is breaking sysfs/kobject interfaces without
  fixing all users :-) (Fair enough... it's just that we need to make sure
  whoever takes care of that driver nowadays is aware of the breakage).
 
  Ben.

 Hi Andrew,
 
 Using the kobject_set_name function to set the kobject k_name.
 
 Signed-off-by: Kamalesh Babulal [EMAIL PROTECTED]
 ---
 --- linux-2.6.23-rc6/drivers/pci/hotplug/rpadlpar_sysfs.c   
 2007-09-18 14:56:05.0 +0530
 +++ linux-2.6.23-rc6/drivers/pci/hotplug/~rpadlpar_sysfs.c  
 2007-09-18 16:51:55.0 +0530
 @@ -129,17 +129,17 @@ struct kobj_type ktype_dlpar_io = {
  };
  
  struct kset dlpar_io_kset = {
 -   .kobj = {.name = DLPAR_KOBJ_NAME,
 -.ktype = ktype_dlpar_io,
 -.parent = pci_hotplug_slots_subsys.kobj},
 +.kobj = {.ktype = ktype_dlpar_io,
 + .parent = pci_hotplug_slots_subsys.kobj},
 .ktype = ktype_dlpar_io,
  };
  
  int dlpar_sysfs_init(void)
  {
 +   kobject_set_name(dlpar_io_kset.kobj, DLPAR_KOBJ_NAME);
 if (kset_register(dlpar_io_kset)) {
 printk(KERN_ERR rpadlpar_io: cannot register kset for 
 %s\n,
 -   dlpar_io_kset.kobj.name);
 +   dlpar_io_kset.kobj.k_name);
 return -EINVAL;
 }
 

Thanks.

Your email client replaces tabs with spaces, and is performing wordwrapping.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 0/2] PowerPC: Fix MAL0 DTS entries for Bamboo and Sequoia.

2007-09-18 Thread Valentine Barshak
A couple of minor fixes to correct MAL0 DTS entries for bamboo.dts and 
sequoia.dts.
Also correct MAL channel assignment for EMACs on Sequoia board.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/2] PowerPC: Fix Sequoia MAL0 and EMAC dts entries.

2007-09-18 Thread Valentine Barshak
According to PowerPC 440EPx documentation,
MAL0 is comprised of four channels (two transmit and two receive).
Each channel is dedicated to one of two EMAC cores.
This patch fixes Sequoia DTS MAL0 entry and EMAC entries,
assigning correct channel numbers to EMACs.

Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/sequoia.dts |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -ruN linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts 
linux-2.6/arch/powerpc/boot/dts/sequoia.dts
--- linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts2007-09-18 
15:32:18.0 +0400
+++ linux-2.6/arch/powerpc/boot/dts/sequoia.dts 2007-09-18 21:11:00.0 
+0400
@@ -107,8 +107,8 @@
MAL0: mcmal {
compatible = ibm,mcmal-440epx, ibm,mcmal2;
dcr-reg = 180 62;
-   num-tx-chans = 4;
-   num-rx-chans = 4;
+   num-tx-chans = 2;
+   num-rx-chans = 2;
interrupt-parent = MAL0;
interrupts = 0 1 2 3 4;
#interrupt-cells = 1;
@@ -239,7 +239,7 @@
reg = ef600e00 70;
local-mac-address = [];
mal-device = MAL0;
-   mal-tx-channel = 0 1;
+   mal-tx-channel = 0;
mal-rx-channel = 0;
cell-index = 0;
max-frame-size = 5dc;
@@ -265,7 +265,7 @@
reg = ef600f00 70;
local-mac-address = [];
mal-device = MAL0;
-   mal-tx-channel = 2 3;
+   mal-tx-channel = 1;
mal-rx-channel = 1;
cell-index = 1;
max-frame-size = 5dc;
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/2] PowerPC: Fix Bamboo MAL0 dts entry.

2007-09-18 Thread Valentine Barshak
According to PowerPC 440EP documentation,
MAL0 consists of 6 channels (4 transmit channels and 2 receive channels)
This patch fixes Bamboo DTS MAL0 num-rx-chans entry.

Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/bamboo.dts |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -ruN linux-2.6.orig/arch/powerpc/boot/dts/bamboo.dts 
linux-2.6/arch/powerpc/boot/dts/bamboo.dts
--- linux-2.6.orig/arch/powerpc/boot/dts/bamboo.dts 2007-09-18 
15:32:18.0 +0400
+++ linux-2.6/arch/powerpc/boot/dts/bamboo.dts  2007-09-18 21:08:55.0 
+0400
@@ -94,7 +94,7 @@
compatible = ibm,mcmal-440ep, ibm,mcmal-440gp, 
ibm,mcmal;
dcr-reg = 180 62;
num-tx-chans = 4;
-   num-rx-chans = 4;
+   num-rx-chans = 2;
interrupt-parent = MAL0;
interrupts = 0 1 2 3 4;
#interrupt-cells = 1;
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [RFC] [PATCH] PowerPC: Add 64-bit phys addr support to 32-bit pci.

2007-09-18 Thread Vitaly Bordug
Hello Valentine,

On Tue, 18 Sep 2007 20:07:54 +0400
Valentine Barshak wrote:

 Currently pci_32 doesn't support 64-bit physical addresses, while
 PowerPC440 platform has PCI space typically mapped above 4GB range.
 The patch adds 64-bit physical address support to 32-bit PCI code
 in order to bring-up PCI on 44x platform.
 
The approach looks interesting, and resource_size_tulong apparently makes 
sense,
but I would strongly disagree we need to add more nuts and bolts into ranges 
parse func:
 Signed-off-by: Valentine Barshak [EMAIL PROTECTED]

[...]
  void __init
  pci_process_bridge_OF_ranges(struct pci_controller *hose,
  struct device_node *dev, int primary)
  {
   static unsigned int static_lc_ranges[256] __initdata;
   const unsigned int *dt_ranges;
 - unsigned int *lc_ranges, *ranges, *prev, size;
 + unsigned int *lc_ranges, *ranges, *prev;
   int rlen = 0, orig_rlen;
   int memno = 0;
   struct resource *res;
 + u32 prev_pci_space, pci_space;
 + u64 prev_pci_addr, pci_addr;
 + u64 prev_size, size;
 + phys_addr_t cpu_phys_addr;
 + 
   int np, na = of_n_addr_cells(dev);
   np = na + 5;
  
 @@ -879,11 +891,18 @@
   prev = NULL;
   while ((rlen -= np * sizeof(unsigned int)) = 0) {
   if (prev) {
 - if (prev[0] == ranges[0]  prev[1] == ranges[1] 
 - (prev[2] + prev[na+4]) == ranges[2] 
 - (prev[na+2] + prev[na+4]) == ranges[na+2]) {
 - prev[na+4] += ranges[na+4];
 + prev_pci_space = prev[0];
 + prev_pci_addr = pci_get_range64(prev[1]);
 + prev_size = pci_get_range64(prev[na+3]);
 + pci_space = ranges[0];
 + pci_addr = pci_get_range64(ranges[1]);
 + if ((prev_pci_space == pci_space)  
 + ((prev_pci_addr + prev_size) == pci_addr)) {
 + size = pci_get_range64(ranges[na+3]);
 + prev_size += size;
   ranges[0] = 0;
 + prev[na+3] = (u32)((prev_size  32)  
 0x);
 + prev[na+4] = (u32)(prev_size  0x);
   ranges += np;
   continue;

I do think that ranges hacking (even on a copy) to cope with contiguous ranges 
is not a good deed. And nobody would object the upper looks horrible from the 
maintenance POV.
   }
 @@ -904,21 +923,22 @@
   rlen = orig_rlen;
   while (ranges  (rlen -= np * sizeof(unsigned int)) = 0) {
   res = NULL;
 - size = ranges[na+4];
 - switch ((ranges[0]  24)  0x3) {
 + size = pci_get_range64(ranges[na+3]);

This is not correct - it should depend on #ac of the parent node.
But I'll stop right here - there is no deep mutual difference between 32  64 
bit so that to keep 2 similar implementations, none of which (esp 32bit) really 
comply the spec. It should work the same way, and, if there are differences, 
they should be handled
explicitly, and, of course, reconsidered if they make sense (like isa_io_base, 
absense of io_size in ppc32 and so on)

I am *not* telling here that my implementation is the only true way around. But 
we need to improve and make code cleaner rather then just extend existing 
error-prone approach.

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


Re: 2.6.23-rc6-mm1

2007-09-18 Thread Greg KH
On Tue, Sep 18, 2007 at 05:37:58PM +0530, Kamalesh Babulal wrote:
 Benjamin Herrenschmidt wrote:
 On Tue, 2007-09-18 at 10:34 +0100, Andy Whitcroft wrote:
   
 On Tue, Sep 18, 2007 at 02:43:48PM +0530, Kamalesh Babulal wrote:
 
 Andrew Morton wrote:
   
 ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc6/2.6.23-rc6-mm1/

 2.6.23-rc6-mm1 is a 29MB diff against 2.6.23-rc6.

  
 snip

 Hi Andrew,

 The 2.6.23-rc6-mm1build fails at

  CC  drivers/pci/hotplug/rpadlpar_core.o
  CC  drivers/pci/hotplug/rpadlpar_sysfs.o
 drivers/pci/hotplug/rpadlpar_sysfs.c:132: error: unknown field `name' 
 specified in initializer
 drivers/pci/hotplug/rpadlpar_sysfs.c: In function `dlpar_sysfs_init':
 drivers/pci/hotplug/rpadlpar_sysfs.c:142: error: structure has no member 
 named `name'
 make[3]: *** [drivers/pci/hotplug/rpadlpar_sysfs.o] Error 1
 make[2]: *** [drivers/pci/hotplug] Error 2
 make[1]: *** [drivers/pci] Error 2
 make: *** [drivers] Error 2
   
 This seems to be occuring across a number of the powerpc systems we test
 with.  That driver is a power dynamic lpar IO partitioning driver.

 Relevant Cc: added.
 

 That's because somebody is breaking sysfs/kobject interfaces without
 fixing all users :-) (Fair enough... it's just that we need to make sure
 whoever takes care of that driver nowadays is aware of the breakage).

 Ben.
   
 Hi Andrew,

 Using the kobject_set_name function to set the kobject k_name.

Close, you should also use the kobject_name() function when referencing
it.

I'll fix this up in the patch, thanks.

Oh, and sorry for breaking this, I could only test all of the modules
build on x86 due to traveling while creating this patch.  I need to set
up some cross-compilers on my laptop to fix this issue :(

thanks,

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


[PATCH 03/28] Document local bus nodes in the device tree, and update cuboot-pq2.

2007-09-18 Thread Scott Wood
The /localbus node is used to describe devices that are connected via a chip
select or similar mechanism.  The advantages over placing the devices under
the root node are that it can be probed without probing other random things
under the root, and that the description of which chip select a given device
uses can be used to set up mappings if the firmware failed to do so in a
useful manner.

cuboot-pq2 is updated to match the binding; previously, it called itself
chipselect rather than localbus, and used phandle linkage between the
actual bus node and the control node (the current agreement is to simply use
the fully-qualified address of the control registers, and ignore the overlap
with the IMMR node).

Signed-off-by: Scott Wood [EMAIL PROTECTED]
---
Resent with a better commit message.

 Documentation/powerpc/booting-without-of.txt |   38 ++
 arch/powerpc/boot/cuboot-pq2.c   |   29 +--
 2 files changed, 46 insertions(+), 21 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index a599f1a..42cbfb0 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -2017,6 +2017,44 @@ platforms are moved over to use the 
flattened-device-tree model.
fsl,cpm-command = 2e60;
};
 
+   m) Chipselect/Local Bus
+
+   Properties:
+   - name : Should be localbus
+   - #address-cells : Should be either two or three.  The first cell is the
+  chipselect number, and the remaining cells are the
+  offset into the chipselect.
+   - #size-cells : Either one or two, depending on how large each chipselect
+   can be.
+   - ranges : Each range should correspond to a single chipselect, and cover
+  the entire access window as configured.
+
+   Example:
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc8272ads-localbus,
+fsl,mpc8272-localbus,
+fsl,pq2-localbus;
+   #address-cells = 2;
+   #size-cells = 1;
+   reg = f0010100 40;
+
+   ranges = 0 0 fe00 0200
+ 1 0 f450 8000;
+
+   [EMAIL PROTECTED],0 {
+   compatible = jedec-flash;
+   reg = 0 0 200;
+   bank-width = 4;
+   device-width = 1;
+   };
+
+   [EMAIL PROTECTED],0 {
+   reg = 1 0 20;
+   compatible = fsl,mpc8272ads-bcsr;
+   };
+   };
+
+
More devices will be defined as this spec matures.
 
 VII - Specifying interrupt information for devices
diff --git a/arch/powerpc/boot/cuboot-pq2.c b/arch/powerpc/boot/cuboot-pq2.c
index b150bd4..e5d94ff 100644
--- a/arch/powerpc/boot/cuboot-pq2.c
+++ b/arch/powerpc/boot/cuboot-pq2.c
@@ -43,22 +43,21 @@ struct pci_range pci_ranges_buf[MAX_PROP_LEN / 
sizeof(struct pci_range)];
  * some don't set up the PCI PIC at all, so we assume the device tree is
  * sane and update the BRx registers appropriately.
  *
- * For any node defined as compatible with fsl,pq2-chipselect,
- * #address/#size must be 2/1 for chipselect bus, 1/1 for parent bus,
- * and ranges must be for whole chip selects.
+ * For any node defined as compatible with fsl,pq2-localbus,
+ * #address/#size must be 2/1 for the localbus, and 1/1 for the parent bus.
+ * Ranges must be for whole chip selects.
  */
 static void update_cs_ranges(void)
 {
-   u32 ctrl_ph;
-   void *ctrl_node, *bus_node, *parent_node;
+   void *bus_node, *parent_node;
u32 *ctrl_addr;
unsigned long ctrl_size;
u32 naddr, nsize;
int len;
int i;
 
-   bus_node = finddevice(/chipselect);
-   if (!bus_node || !dt_is_compatible(bus_node, fsl,pq2-chipselect))
+   bus_node = finddevice(/localbus);
+   if (!bus_node || !dt_is_compatible(bus_node, fsl,pq2-localbus))
return;
 
dt_get_reg_format(bus_node, naddr, nsize);
@@ -73,19 +72,7 @@ static void update_cs_ranges(void)
if (naddr != 1 || nsize != 1)
goto err;
 
-   len = getprop(bus_node, fsl,ctrl, ctrl_ph, 4);
-   if (len != 4)
-   goto err;
-
-   ctrl_node = find_node_by_prop_value(NULL, linux,phandle,
-   (char *)ctrl_ph, 4);
-   if (!ctrl_node)
-   goto err;
-
-   if (!dt_is_compatible(ctrl_node, fsl,pq2-chipselect-ctrl))
-   goto err;
-
-   if (!dt_xlate_reg(ctrl_node, 0, (unsigned long *)ctrl_addr,
+   if (!dt_xlate_reg(bus_node, 0, (unsigned long *)ctrl_addr,
  ctrl_size))
goto err;
 
@@ -122,7 +109,7 @@ static void update_cs_ranges(void)
return;
 
 err:
-   printf(Bad /chipselect or 

[PATCH 09/28] cpm_uart: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.

2007-09-18 Thread Scott Wood
The existing OF glue code was crufty and broken.  Rather than fix it,
it has been removed, and the serial driver now talks to the device tree
directly.

The non-CONFIG_PPC_CPM_NEW_BINDING code can go away once CPM platforms
are dropped from arch/ppc (which will hopefully be soon), and existing
arch/powerpc boards that I wasn't able to test on for this patchset get
converted (which should be even sooner).

Signed-off-by: Scott Wood [EMAIL PROTECTED]
---
Resent with asm/of_platform.h - linux/of_platform.h

 drivers/serial/cpm_uart/cpm_uart.h  |6 +-
 drivers/serial/cpm_uart/cpm_uart_core.c |  241 ---
 drivers/serial/cpm_uart/cpm_uart_cpm1.c |   16 ++-
 drivers/serial/cpm_uart/cpm_uart_cpm1.h |2 +
 drivers/serial/cpm_uart/cpm_uart_cpm2.c |   18 +++-
 drivers/serial/cpm_uart/cpm_uart_cpm2.h |2 +
 6 files changed, 260 insertions(+), 25 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart.h 
b/drivers/serial/cpm_uart/cpm_uart.h
index a8f894c..4e1987a 100644
--- a/drivers/serial/cpm_uart/cpm_uart.h
+++ b/drivers/serial/cpm_uart/cpm_uart.h
@@ -80,14 +80,18 @@ struct uart_cpm_port {
int is_portb;
/* wait on close if needed */
int wait_closing;
+   /* value to combine with opcode to form cpm command */
+   u32 command;
 };
 
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
 extern int cpm_uart_port_map[UART_NR];
+#endif
 extern int cpm_uart_nr;
 extern struct uart_cpm_port cpm_uart_ports[UART_NR];
 
 /* these are located in their respective files */
-void cpm_line_cr_cmd(int line, int cmd);
+void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd);
 int cpm_uart_init_portdesc(void);
 int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con);
 void cpm_uart_freebuf(struct uart_cpm_port *pinfo);
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c 
b/drivers/serial/cpm_uart/cpm_uart_core.c
index cefde58..8564ba2 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -10,7 +10,7 @@
  *  Maintainer: Kumar Gala ([EMAIL PROTECTED]) (CPM2)
  *  Pantelis Antoniou ([EMAIL PROTECTED]) (CPM1)
  *
- *  Copyright (C) 2004 Freescale Semiconductor, Inc.
+ *  Copyright (C) 2004, 2007 Freescale Semiconductor, Inc.
  *(C) 2004 Intracom, S.A.
  *(C) 2005-2006 MontaVista Software, Inc.
  * Vitaly Bordug [EMAIL PROTECTED]
@@ -47,6 +47,11 @@
 #include asm/irq.h
 #include asm/delay.h
 #include asm/fs_pd.h
+#include asm/udbg.h
+
+#ifdef CONFIG_PPC_CPM_NEW_BINDING
+#include linux/of_platform.h
+#endif
 
 #if defined(CONFIG_SERIAL_CPM_CONSOLE)  defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -57,12 +62,6 @@
 
 #include cpm_uart.h
 
-/***/
-
-/* Track which ports are configured as uarts */
-int cpm_uart_port_map[UART_NR];
-/* How many ports did we config as uarts */
-int cpm_uart_nr = 0;
 
 /**/
 
@@ -73,6 +72,11 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo);
 
 /**/
 
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
+/* Track which ports are configured as uarts */
+int cpm_uart_port_map[UART_NR];
+/* How many ports did we config as uarts */
+int cpm_uart_nr;
 
 /* Place-holder for board-specific stuff */
 struct platform_device* __attribute__ ((weak)) __init
@@ -119,6 +123,7 @@ static int cpm_uart_id2nr(int id)
/* not found or invalid argument */
return -1;
 }
+#endif
 
 /*
  * Check, if transmit buffers are processed
@@ -232,15 +237,14 @@ static void cpm_uart_enable_ms(struct uart_port *port)
 static void cpm_uart_break_ctl(struct uart_port *port, int break_state)
 {
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
-   int line = pinfo - cpm_uart_ports;
 
pr_debug(CPM uart[%d]:break ctrl, break_state: %d\n, port-line,
break_state);
 
if (break_state)
-   cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
+   cpm_line_cr_cmd(pinfo, CPM_CR_STOP_TX);
else
-   cpm_line_cr_cmd(line, CPM_CR_RESTART_TX);
+   cpm_line_cr_cmd(pinfo, CPM_CR_RESTART_TX);
 }
 
 /*
@@ -407,7 +411,6 @@ static int cpm_uart_startup(struct uart_port *port)
 {
int retval;
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
-   int line = pinfo - cpm_uart_ports;
 
pr_debug(CPM uart[%d]:startup\n, port-line);
 
@@ -426,7 +429,7 @@ static int cpm_uart_startup(struct uart_port *port)
}
 
if (!(pinfo-flags  FLAG_CONSOLE))
-   cpm_line_cr_cmd(line,CPM_CR_INIT_TRX);
+   cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
return 0;
 }
 
@@ -442,7 +445,6 @@ inline void cpm_uart_wait_until_send(struct uart_cpm_port 
*pinfo)
 static void cpm_uart_shutdown(struct uart_port 

[PATCH 16/28] 8xx: Move softemu8xx.c from arch/ppc

2007-09-18 Thread Scott Wood
Previously, Soft_emulate_8xx was called with no implementation, resulting in
build failures whenever building 8xx without math emulation.  The
implementation is copied from arch/ppc to resolve this issue.

However, this sort of minimal emulation is not a very good idea other than
for compatibility with existing userspaces, as it's less efficient than
soft-float and can mislead users into believing they have soft-float.  Thus,
it is made a configurable option, off by default.
---
This replaces the old 16/28 Don't call non-existent Soft_emulate_8xx from
SoftwareEmulation.

 arch/powerpc/Kconfig |   11 ++
 arch/powerpc/kernel/Makefile |2 +
 arch/powerpc/kernel/softemu8xx.c |  202 ++
 arch/powerpc/kernel/traps.c  |6 +-
 4 files changed, 220 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/kernel/softemu8xx.c

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 2622f04..0c0329e 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -180,6 +180,17 @@ config MATH_EMULATION
  unit, which will allow programs that use floating-point
  instructions to run.
 
+config 8XX_MINIMAL_FPEMU
+   bool Minimal math emulation for 8xx
+   depends on 8xx  !MATH_EMULATION
+   help
+ Older arch/ppc kernels still emulated a few floating point
+ instructions such as load and store, even when full math
+ emulation is disabled.  Say Y here if you want to preserve
+ this behavior.
+
+ It is recommended that you build a soft-float userspace instead.
+
 config IOMMU_VMERGE
bool Enable IOMMU virtual merging
depends on PPC64
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 967afc5..0d7b68b 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -76,6 +76,8 @@ obj-$(CONFIG_KEXEC)   += machine_kexec.o crash.o 
$(kexec-y)
 obj-$(CONFIG_AUDIT)+= audit.o
 obj64-$(CONFIG_AUDIT)  += compat_audit.o
 
+obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o
+
 ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
 obj-y  += iomap.o
 endif
diff --git a/arch/powerpc/kernel/softemu8xx.c b/arch/powerpc/kernel/softemu8xx.c
new file mode 100644
index 000..67d6f68
--- /dev/null
+++ b/arch/powerpc/kernel/softemu8xx.c
@@ -0,0 +1,202 @@
+/*
+ * Software emulation of some PPC instructions for the 8xx core.
+ *
+ * Copyright (C) 1998 Dan Malek ([EMAIL PROTECTED])
+ *
+ * Software floating emuation for the MPC8xx processor.  I did this mostly
+ * because it was easier than trying to get the libraries compiled for
+ * software floating point.  The goal is still to get the libraries done,
+ * but I lost patience and needed some hacks to at least get init and
+ * shells running.  The first problem is the setjmp/longjmp that save
+ * and restore the floating point registers.
+ *
+ * For this emulation, our working registers are found on the register
+ * save area.
+ */
+
+#include linux/errno.h
+#include linux/sched.h
+#include linux/kernel.h
+#include linux/mm.h
+#include linux/stddef.h
+#include linux/unistd.h
+#include linux/ptrace.h
+#include linux/slab.h
+#include linux/user.h
+#include linux/a.out.h
+#include linux/interrupt.h
+
+#include asm/pgtable.h
+#include asm/uaccess.h
+#include asm/system.h
+#include asm/io.h
+
+/* Eventually we may need a look-up table, but this works for now.
+*/
+#define LFS48
+#define LFD50
+#define LFDU   51
+#define STFD   54
+#define STFDU  55
+#define FMR63
+
+void print_8xx_pte(struct mm_struct *mm, unsigned long addr)
+{
+   pgd_t *pgd;
+   pmd_t *pmd;
+   pte_t *pte;
+
+   printk( pte @ 0x%8lx: , addr);
+   pgd = pgd_offset(mm, addr  PAGE_MASK);
+   if (pgd) {
+   pmd = pmd_offset(pud_offset(pgd, addr  PAGE_MASK),
+addr  PAGE_MASK);
+   if (pmd  pmd_present(*pmd)) {
+   pte = pte_offset_kernel(pmd, addr  PAGE_MASK);
+   if (pte) {
+   printk( (0x%08lx)-(0x%08lx)-0x%08lx\n,
+   (long)pgd, (long)pte, 
(long)pte_val(*pte));
+#define pp ((long)pte_val(*pte))
+   printk( RPN: %05lx PP: %lx SPS: %lx SH: %lx 
+  CI: %lx v: %lx\n,
+  pp12,/* rpn */
+  (pp10)3, /* pp */
+  (pp3)1, /* small */
+  (pp2)1, /* shared */
+  (pp1)1, /* cache inhibit */
+  pp1   /* valid */
+  );
+#undef pp
+   }
+   else {
+   printk(no pte\n);
+   }
+   }
+   else {
+   

[PATCH 18/28] 8xx: mpc885ads cleanup

2007-09-18 Thread Scott Wood
It now uses the new CPM binding and the generic pin/clock functions, and
has assorted fixes and cleanup.

Signed-off-by: Scott Wood [EMAIL PROTECTED]
---
Resent with asm/of_platform.h - linux/of_platform.h.

 arch/powerpc/boot/dts/mpc885ads.dts  |  195 +++-
 arch/powerpc/configs/mpc885_ads_defconfig|  297 +
 arch/powerpc/platforms/8xx/Kconfig   |1 +
 arch/powerpc/platforms/8xx/mpc885ads.h   |   38 ---
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |  450 +-
 5 files changed, 423 insertions(+), 558 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc885ads.dts 
b/arch/powerpc/boot/dts/mpc885ads.dts
index e9aa9d0..cbcd16f 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -2,6 +2,7 @@
  * MPC885 ADS Device Tree Source
  *
  * Copyright 2006 MontaVista Software, Inc.
+ * Copyright 2007 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -12,7 +13,7 @@
 
 / {
model = MPC885ADS;
-   compatible = mpc8xx;
+   compatible = fsl,mpc885ads;
#address-cells = 1;
#size-cells = 1;
 
@@ -23,156 +24,188 @@
PowerPC,[EMAIL PROTECTED] {
device_type = cpu;
reg = 0;
-   d-cache-line-size = 20;   // 32 bytes
-   i-cache-line-size = 20;   // 32 bytes
-   d-cache-size = 2000;  // L1, 8K
-   i-cache-size = 2000;  // L1, 8K
+   d-cache-line-size = d#16;
+   i-cache-line-size = d#16;
+   d-cache-size = d#8192;
+   i-cache-size = d#8192;
timebase-frequency = 0;
bus-frequency = 0;
clock-frequency = 0;
interrupts = f 2; // decrementer interrupt
-   interrupt-parent = Mpc8xx_pic;
+   interrupt-parent = PIC;
};
};
 
memory {
device_type = memory;
-   reg =  80;
+   reg = 0 0;
};
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc885-localbus, fsl,pq1-localbus;
+   #address-cells = 2;
+   #size-cells = 1;
+   reg = ff000100 40;
+
+   ranges = 
+   0 0 fe00 0080
+   1 0 ff08 8000
+   5 0 ff0a 8000
+   ;
+
+   [EMAIL PROTECTED],0 {
+   compatible = jedec-flash;
+   reg = 0 0 80;
+   bank-width = 4;
+   device-width = 1;
+   };
+
+   [EMAIL PROTECTED],0 {
+   reg = 1 0 20 5 300 4;
+   compatible = fsl,mpc885ads-bcsr;
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc885, fsl,pq1-soc;
#address-cells = 1;
#size-cells = 1;
device_type = soc;
-   ranges = 0 ff00 0010;
-   reg = ff00 0200;
+   ranges = 0 ff00 4000;
bus-frequency = 0;
-   [EMAIL PROTECTED] {
-   device_type = mdio;
-   compatible = fs_enet;
-   reg = e80 8;
+
+   // Temporary -- will go away once kernel uses ranges for 
get_immrbase().
+   reg = ff00 4000;
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc885-fec-mdio, fsl,pq1-fec-mdio;
+   reg = e00 188;
#address-cells = 1;
#size-cells = 0;
-   Phy0: [EMAIL PROTECTED] {
+
+   PHY0: [EMAIL PROTECTED] {
reg = 0;
device_type = ethernet-phy;
};
-   Phy1: [EMAIL PROTECTED] {
+
+   PHY1: [EMAIL PROTECTED] {
reg = 1;
device_type = ethernet-phy;
};
-   Phy2: [EMAIL PROTECTED] {
+
+   PHY2: [EMAIL PROTECTED] {
reg = 2;
device_type = ethernet-phy;
};
};
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
device_type = network;
-   compatible = fs_enet;
-   model = FEC;
-   device-id = 

[PATCH 28/28] mpc82xx: Add pq2fads board support.

2007-09-18 Thread Scott Wood
Signed-off-by: Scott Wood [EMAIL PROTECTED]
---
Resent with asm/of_platform.h - linux/of_platform.h

 arch/powerpc/boot/dts/pq2fads.dts  |  229 
 arch/powerpc/configs/pq2fads_defconfig | 1003 
 arch/powerpc/platforms/82xx/Kconfig|   11 +
 arch/powerpc/platforms/82xx/Makefile   |1 +
 arch/powerpc/platforms/82xx/pq2fads.c  |  198 +++
 5 files changed, 1442 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/pq2fads.dts
 create mode 100644 arch/powerpc/configs/pq2fads_defconfig
 create mode 100644 arch/powerpc/platforms/82xx/pq2fads.c

diff --git a/arch/powerpc/boot/dts/pq2fads.dts 
b/arch/powerpc/boot/dts/pq2fads.dts
new file mode 100644
index 000..54e8bd1
--- /dev/null
+++ b/arch/powerpc/boot/dts/pq2fads.dts
@@ -0,0 +1,229 @@
+/*
+ * Device Tree for the PQ2FADS-ZU board with an MPC8280 chip.
+ *
+ * Copyright 2007 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/ {
+   model = pq2fads;
+   compatible = fsl,pq2fads;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   [EMAIL PROTECTED] {
+   device_type = cpu;
+   reg = 0;
+   d-cache-line-size = d#32;
+   i-cache-line-size = d#32;
+   d-cache-size = d#16384;
+   i-cache-size = d#16384;
+   timebase-frequency = 0;
+   clock-frequency = 0;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0 0;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc8280-localbus,
+fsl,pq2-localbus;
+   #address-cells = 2;
+   #size-cells = 1;
+   reg = f0010100 60;
+
+   ranges = 0 0 fe00 0080
+ 1 0 f450 8000
+ 8 0 f820 8000;
+
+   [EMAIL PROTECTED],0 {
+   compatible = jedec-flash;
+   reg = 0 0 80;
+   bank-width = 4;
+   device-width = 1;
+   };
+
+   [EMAIL PROTECTED],0 {
+   reg = 1 0 20;
+   compatible = fsl,pq2fads-bcsr;
+   };
+
+   PCI_PIC: [EMAIL PROTECTED],0 {
+   #interrupt-cells = 1;
+   interrupt-controller;
+   reg = 8 0 8;
+   compatible = fsl,pq2ads-pci-pic;
+   interrupt-parent = PIC;
+   interrupts = 18 8;
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   device_type = pci;
+   reg = f0010800 10c f00101ac 8 f00101c4 8;
+   compatible = fsl,mpc8280-pci, fsl,pq2-pci;
+   #interrupt-cells = 1;
+   #size-cells = 2;
+   #address-cells = 3;
+   clock-frequency = d#6600;
+   interrupt-map-mask = f800 0 0 7;
+   interrupt-map = 
+   /* IDSEL 0x16 */
+b000 0 0 1 PCI_PIC 0
+b000 0 0 2 PCI_PIC 1
+b000 0 0 3 PCI_PIC 2
+b000 0 0 4 PCI_PIC 3
+
+   /* IDSEL 0x17 */
+b800 0 0 1 PCI_PIC 4
+b800 0 0 2 PCI_PIC 5
+b800 0 0 3 PCI_PIC 6
+b800 0 0 4 PCI_PIC 7
+
+   /* IDSEL 0x18 */
+c000 0 0 1 PCI_PIC 8
+c000 0 0 2 PCI_PIC 9
+c000 0 0 3 PCI_PIC a
+c000 0 0 4 PCI_PIC b;
+
+   interrupt-parent = PIC;
+   interrupts = 12 8;
+   ranges = 4200 0 8000 8000 0 2000
+ 0200 0 a000 a000 0 2000
+ 0100 0  f600 0 0200;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   compatible = fsl,mpc8280, fsl,pq2-soc;
+   ranges =  f000 00053000;
+
+   // Temporary -- will go away once kernel uses ranges for 
get_immrbase().
+   reg = f000 00053000;
+
+   [EMAIL PROTECTED] {
+   

Re: 2.6.23-rc6-mm1

2007-09-18 Thread Benjamin Herrenschmidt
On Tue, 2007-09-18 at 12:16 -0700, Greg KH wrote:
 Oh, and sorry for breaking this, I could only test all of the modules
 build on x86 due to traveling while creating this patch.  I need to
 set
 up some cross-compilers on my laptop to fix this issue :( 

Yuck :-) Oh well, I hope you have a _FAST_ laptop :-)

Cheers,
Ben.


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


Re: [RFC] [PATCH] PowerPC: Add 64-bit phys addr support to 32-bit pci.

2007-09-18 Thread Benjamin Herrenschmidt

  @@ -879,11 +891,18 @@
  prev = NULL;
  while ((rlen -= np * sizeof(unsigned int)) = 0) {
  if (prev) {
  -   if (prev[0] == ranges[0]  prev[1] == ranges[1] 
  -   (prev[2] + prev[na+4]) == ranges[2] 
  -   (prev[na+2] + prev[na+4]) == ranges[na+2]) {
  -   prev[na+4] += ranges[na+4];
  +   prev_pci_space = prev[0];
  +   prev_pci_addr = pci_get_range64(prev[1]);
  +   prev_size = pci_get_range64(prev[na+3]);
  +   pci_space = ranges[0];
  +   pci_addr = pci_get_range64(ranges[1]);
  +   if ((prev_pci_space == pci_space)  
  +   ((prev_pci_addr + prev_size) == pci_addr)) {
  +   size = pci_get_range64(ranges[na+3]);
  +   prev_size += size;
  ranges[0] = 0;
  +   prev[na+3] = (u32)((prev_size  32)  
  0x);
  +   prev[na+4] = (u32)(prev_size  0x);
  ranges += np;
  continue;
 
 I do think that ranges hacking (even on a copy) to cope with contiguous 
 ranges is not a good deed. And nobody would object the upper looks horrible 
 from the maintenance POV.
  

Yes, hacking of ranges shouldn't be done there. PowerMac does range
coalescing separately, we can move this to some generic place maybe and
use it where needed.

Just make everything use resource_size_t in the PCI bits and u64 in the
parsing bits.

 This is not correct - it should depend on #ac of the parent node.
 But I'll stop right here - there is no deep mutual difference between 32  64 
 bit so that to keep 2 similar implementations, none of which (esp 32bit) 
 really comply the spec. It should work the same way, and, if there are 
 differences, they should be handled
 explicitly, and, of course, reconsidered if they make sense (like 
 isa_io_base, absense of io_size in ppc32 and so on)
 
 I am *not* telling here that my implementation is the only true way around. 
 But we need to improve and make code cleaner rather then just extend existing 
 error-prone approach.

We need to merge 32 and 64 bits here for sure.

Ben.


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


Re: [PATCH] [RFC][POWERPC] Merge 32 and 64 bit pci_process_bridge_OF_ranges() instances

2007-09-18 Thread Benjamin Herrenschmidt
On Wed, 2007-09-12 at 02:49 +0400, Vitaly Bordug wrote:
 We are having 2 different instances of pci_process_bridge_OF_ranges(),
 which makes describing 64-bit physical addresses in non PPC64 case
 impossible.
 
 This approach inherits pci space parsing, but has a new way to behave
 equally good in both 32bit and 64bit environments. This approach uses
 of_translate_address(), so implies proper ranges  definition in
 devicetree, where PCI node has its reg on soc bus, and its ranges
 effectively belong to LAW addresses.

Sorry for the delay, I was travelling.

NAK the bits with struct ranges_pci. Don't map structures to those DT
entries. Use a cursor pointer and some getter function, like
prom_parse does (maybe export the ones in prom_parse).

Ben.


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


Re: [PATCH] [RFC][POWERPC] Merge 32 and 64 bit pci_process_bridge_OF_ranges() instances

2007-09-18 Thread Benjamin Herrenschmidt
Oh and...

PowerMac -needs- the coalescing of ranges. Apple tends to split their
ranges in bits in the device-tree and ends up with more than you have
struct resource in the pci_bus.

Ben.


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


Re: [PATCH] [RFC][POWERPC] Merge 32 and 64 bit pci_process_bridge_OF_ranges() instances

2007-09-18 Thread Benjamin Herrenschmidt
On Tue, 2007-09-18 at 16:03 +0400, Valentine Barshak wrote:
 Do we need to ioremap on 64-bit? I think 64-bit uses different
 approach 
 in handling io space.

Yup, we changed that recently and I haven't yet modified ppc32 to catch
up (and may never do so, they have different constraints).

Ben.


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


Re: [PATCH 23/28] mpc82xx: Define CPU_FTR_NEED_COHERENT

2007-09-18 Thread Scott Wood
On Tue, Sep 18, 2007 at 09:34:31AM -0500, Rune Torgersen wrote:
  -Original Message-
  From: Scott Wood
  Sent: Monday, September 17, 2007 11:58 AM
  
  The 8272 (and presumably other PCI PQ2 chips) appear to have the
  same issue as the 83xx regarding PCI streaming DMA.
  
 
 Can you explain what this isssue is? We're using a 8280 and have had
 some PCI busmaster DMA problems, and wonder if it is related.

I'm not sure of the details, just that I get corrupted PCI DMA if I don't
set it.

BTW, if the problems you're seeing include lockups when using PCI DMA,
check out the end of the PCI initialization in
arch/powerpc/boot/cuboot-pq2.c; it requires certain non-default arbiter
settings.

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


Re: [PATCH] [RFC][POWERPC] Merge 32 and 64 bit pci_process_bridge_OF_ranges() instances

2007-09-18 Thread Vitaly Bordug
Hello Valentine,

On Tue, 18 Sep 2007 18:38:56 +0400
Valentine Barshak wrote:

 Well, thanks for the invitation :)
 I've been trying to work on the pci support here too. But I've used a 
 bit different approach. I tried to add 64-bit phys addr support to 
 pci_32.c. The patch seems to work on Sequoia. Actually, I thought 
 merging was too risky at this point and might cause more problems 
 breaking both 64 and 32-bit pci support.

In order not to break, we just need same functionality and it is not that 
complex.
I began with the upper approach as well, but that seems more like a workaround, 
than a step forward.

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


Re: [PATCH 01/28] CPM: Change from fsl, brg-frequency to brg/clock-frequency

2007-09-18 Thread David Gibson
On Tue, Sep 18, 2007 at 09:21:50AM -0500, Scott Wood wrote:
 On Tue, Sep 18, 2007 at 04:11:41PM +1000, David Gibson wrote:
   + /* Legacy device binding -- will go away when no users are left. */
   + node = of_find_node_by_type(NULL, cpm);
   + if (node) {
   + prop = of_get_property(node, brg-frequency, size);
  
  Shouldn't you check for fsl,brg-frequency here, in case of old
  device trees?
 
 What old device trees?  fsl,brg-frequency has never hit mainline; it's
 only been in Kumar's tree for a week or so.

Ah, ok.  I didn't realise.

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/3] usb: ehci-ppc-of dts bindings.

2007-09-18 Thread Segher Boessenkool
 +  l) USB EHCI controllers
 +
 +  Required properties:
 +  - device_type : should be usb.

No device_type please.  The published USB binding doesn't define
one on purpose.

 +  - compatible : should be ehci.

Just ehci isn't enough -- compare to OHCI, which is the name for
a kind of USB host controller as well as for a kind of Firewire
host controller.

Maybe usb-ehci is best -- can anyone think of a better name?

 +  - reg : Offset and length of the register set for the device

Address and length.  You also should declare here how the optional
EHCI register blocks should be encoded (the USB debug port, etc.)

 +  - interrupts : a b where a is the interrupt number and b is a
 +field that represents an encoding of the sense and level
 +information for the interrupt.

This is incorrect; not all interrupt domains use two cells, and
not all that do have this meaning for those cells.

Instead, you should just say how many interrupts should be here,
and which is which in the EHCI standard.

 +  - interrupt-parent : the phandle for the interrupt controller that
 +services interrupts for this device.

Not every EHCI node needs this; just don't mention this at all,
interrupt mapping is fully defined for all devices elsewhere
already (in the interrupt mapping recommended practice).

 +  If device registers are implemented in big endian mode, the device
 +  node should have big-endian property.
 +  If controller implementation operates with big endian descriptors,
 +  compatible should also have ehci-be-desc

Ah, I understand what this is about, finally.

Don't put this in compatible; instead, do a big-endian-descriptors
property similar to the big-endian property.  That last one should
maybe be big-endian-registers here then, to avoid confusion.

Or make big-endian mean both big-endian registers *and* big-endian
descriptors.

I have no opinion which is best; it depends on what configurations
actually exist, and how popular those are.

 + [EMAIL PROTECTED] {
 + device_type = usb;
 + compatible = ibm,ehci-440epx, ehci-be-desc, ehci;
 + interrupts = 1a 4;
 + interrupt-parent = UIC0;
 + reg = 0 e300 ff;

Length should be 100 here.

 + big-endian;
 + };


Segher

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


Re: [PATCH 2/2] PowerPC: Fix Sequoia MAL0 and EMAC dts entries.

2007-09-18 Thread David Gibson
On Tue, Sep 18, 2007 at 09:29:13PM +0400, Valentine Barshak wrote:
 According to PowerPC 440EPx documentation,
 MAL0 is comprised of four channels (two transmit and two receive).
 Each channel is dedicated to one of two EMAC cores.
 This patch fixes Sequoia DTS MAL0 entry and EMAC entries,
 assigning correct channel numbers to EMACs.

Hrm.. did they change the EMAC in 440EPx to only use one MAL
tx-channel?  All the older ones could use two (for no readily apparent
reason, IMO).

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 04/28] Add early debug console for CPM serial ports.

2007-09-18 Thread David Gibson
On Mon, Sep 17, 2007 at 11:57:33AM -0500, Scott Wood wrote:
 This code assumes that the ports have been previously set up, with
 buffers in DPRAM.
 
 Signed-off-by: Scott Wood [EMAIL PROTECTED]

Looks sane as far as I can see.

Acked-by: David Gibson [EMAIL PROTECTED]

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 06/28] bootwrapper: Add PlanetCore firmware support.

2007-09-18 Thread David Gibson
On Mon, Sep 17, 2007 at 11:57:35AM -0500, Scott Wood wrote:
 This is a library that board code can use to extract information from the
 PlanetCore configuration keys.  PlanetCore is used on various boards from
 Embedded Planet.
 
 Signed-off-by: Scott Wood [EMAIL PROTECTED]

[snip]
 +void planetcore_set_mac_addrs(const char *table)
 +{
 + char addr[4][6];
 + u64 int_addr;
 + u32 i;
 + int j;
 + void *node;
 +
 + if (!planetcore_get_hex(table, PLANETCORE_KEY_MAC_ADDR, int_addr))
 + return;
 +
 + for (i = 0; i  4; i++) {
 + u64 this_dev_addr = int_addr | mac_table[i];
 +
 + for (j = 5; j = 0; j--) {
 + addr[i][j] = this_dev_addr  0xff;
 + this_dev_addr = 8;
 + }
 +
 + node = find_node_by_prop_value(NULL, linux,network-index,
 +(void *)i, 4);
 + if (node) {
 + printf(ENET%u: local-mac-address -
 + %02x:%02x:%02x:%02x:%02x:%02x\n\r, i,
 +addr[i][0], addr[i][1], addr[i][2],
 +addr[i][3], addr[i][4], addr[i][5]);
 +
 + setprop(node, local-mac-address, addr[i], 6);

Hrm.  When I said to extract the logic of fixup_mac_addrs(), I meant
to create a new one-address version of the function in devtree.c then
use it both here and in the fixup_mac_addrs() function.  Rather than
duplicating it inline here.

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 07/28] bootwrapper: Add fsl_get_immr() and 8xx/pq2 clock functions.

2007-09-18 Thread David Gibson
On Mon, Sep 17, 2007 at 11:57:36AM -0500, Scott Wood wrote:
 fsl_get_immr() uses /soc/ranges to determine the immr.
 
 mpc885_get_clock() transforms a crystal frequency into a system frequency
 according to the PLL register settings.
 
 pq2_get_clocks() does the same as the above for the PowerQUICC II,
 except that it produces several different clocks.
 
 The mpc8xx/pq2 set_clocks() functions modify common properties in
 the device tree based on the given clock data.
 
 The mpc885/pq2 fixup_clocks() functions call get_clocks(), and
 pass the results to set_clocks().
 
 Signed-off-by: Scott Wood [EMAIL PROTECTED]

Acked-by: David Gibson [EMAIL PROTECTED]

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 08/28] bootwrapper: Use fsl_get_immr() in cuboot-pq2.c.

2007-09-18 Thread David Gibson
On Mon, Sep 17, 2007 at 11:57:37AM -0500, Scott Wood wrote:

Needs a commit comment

 Signed-off-by: Scott Wood [EMAIL PROTECTED]


 ---
  arch/powerpc/boot/cuboot-pq2.c |   10 --
  1 files changed, 4 insertions(+), 6 deletions(-)
 

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] powerpc clk.h interface for platforms

2007-09-18 Thread Paul Mackerras
Domen Puncer writes:

 Paul, what do you say about this?
 Sylvain suggested it could also be integrated with define_machine
 interface.

As it stands, your patch adds the clk_* functions on all platforms.
What platforms would actually want to use them?

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


Cleanups for physmap_of.c

2007-09-18 Thread David Gibson
This patch includes a whole batch of smallish cleanups for
drivers/mtd/physmap_of.c.

- A bunch of uneeded #includes are removed
- We switch to the modern linux/of.h etc. in place of
asm/prom.h
- Use some helper macros to avoid some ugly inline #ifdefs
- A few lines of unreachable code are removed
- A number of indentation / line-wrapping fixes
- More consistent use of kernel idioms such as if (!p) instead
of if (p == NULL)
- Clarify some printk()s and other informative strings. 
- (the big one) Despite the name, this driver really has
nothing to do with drivers/mtd/physmap.c.  The fact that the flash
chips must be physically direct mapped is a constrant, but doesn't
really say anything about the actual purpose of this driver, which is
to instantiate MTD devices based on information from the device tree.
Therefore the physmap name is replaced everywhere within the file with
of_flash.  The file itself and the Kconfig option is not renamed for
now (so that the diff is actually a diff).  That can come later.

Signed-off-by: David Gibson [EMAIL PROTECTED]

Index: working-2.6/drivers/mtd/maps/physmap_of.c
===
--- working-2.6.orig/drivers/mtd/maps/physmap_of.c  2007-09-14 
14:24:06.0 +1000
+++ working-2.6/drivers/mtd/maps/physmap_of.c   2007-09-19 13:59:23.0 
+1000
@@ -1,5 +1,5 @@
 /*
- * Normal mappings of chips in physical memory for OF devices
+ * Flash mappings described by the OF (or flattened) device tree
  *
  * Copyright (C) 2006 MontaVista Software Inc.
  * Author: Vitaly Wool [EMAIL PROTECTED]
@@ -15,20 +15,15 @@
 
 #include linux/module.h
 #include linux/types.h
-#include linux/kernel.h
 #include linux/init.h
-#include linux/slab.h
 #include linux/device.h
 #include linux/mtd/mtd.h
 #include linux/mtd/map.h
 #include linux/mtd/partitions.h
-#include linux/mtd/physmap.h
-#include asm/io.h
-#include asm/prom.h
-#include asm/of_device.h
-#include asm/of_platform.h
+#include linux/of.h
+#include linux/of_platform.h
 
-struct physmap_flash_info {
+struct of_flash {
struct mtd_info *mtd;
struct map_info map;
struct resource *res;
@@ -38,8 +33,10 @@ struct physmap_flash_info {
 };
 
 #ifdef CONFIG_MTD_PARTITIONS
+#define OF_FLASH_PARTS(info)   ((info)-parts)
+
 static int parse_obsolete_partitions(struct of_device *dev,
-struct physmap_flash_info *info,
+struct of_flash *info,
 struct device_node *dp)
 {
int i, plen, nr_parts;
@@ -56,11 +53,9 @@ static int parse_obsolete_partitions(str
 
nr_parts = plen / sizeof(part[0]);
 
-   info-parts = kzalloc(nr_parts * sizeof(struct mtd_partition), 
GFP_KERNEL);
-   if (!info-parts) {
-   printk(KERN_ERR Can't allocate the flash partition data!\n);
+   info-parts = kzalloc(nr_parts * sizeof(*info-parts), GFP_KERNEL);
+   if (!info-parts)
return -ENOMEM;
-   }
 
names = of_get_property(dp, partition-names, plen);
 
@@ -86,8 +81,8 @@ static int parse_obsolete_partitions(str
return nr_parts;
 }
 
-static int __devinit process_partitions(struct physmap_flash_info *info,
-   struct of_device *dev)
+static int __devinit parse_partitions(struct of_flash *info,
+ struct of_device *dev)
 {
const char *partname;
static const char *part_probe_types[]
@@ -109,87 +104,68 @@ static int __devinit process_partitions(
for (pp = dp-child; pp; pp = pp-sibling)
nr_parts++;
 
-   if (nr_parts) {
-   info-parts = kzalloc(nr_parts * sizeof(struct mtd_partition),
- GFP_KERNEL);
-   if (!info-parts) {
-   printk(KERN_ERR Can't allocate the flash partition 
data!\n);
-   return -ENOMEM;
-   }
+   if (nr_parts == 0)
+   return parse_obsolete_partitions(dev, info, dp);
 
-   for (pp = dp-child, i = 0 ; pp; pp = pp-sibling, i++) {
-   const u32 *reg;
-   int len;
-
-   reg = of_get_property(pp, reg, len);
-   if (!reg || (len != 2*sizeof(u32))) {
-   dev_err(dev-dev, Invalid 'reg' on %s\n,
-   dp-full_name);
-   kfree(info-parts);
-   info-parts = NULL;
-   return -EINVAL;
-   }
-   info-parts[i].offset = reg[0];
-   info-parts[i].size = reg[1];
-
-   partname = of_get_property(pp, label, len);
-   if (!partname)
-   

[PATCH 1/2] powerpc: Don't expose clock vDSO functions when CPU has no timebase

2007-09-18 Thread Benjamin Herrenschmidt
We forgot to remove the clock_gettime, clock_getres and get_tbfreq vDSO
calls on CPUs that have no timebase such as 601 or 403 (old CPUs that have
different mechanisms and for which the vDSO code will not work properly).

Signed-off-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
---

 arch/powerpc/kernel/vdso.c |   12 
 1 file changed, 12 insertions(+)

Index: linux-work/arch/powerpc/kernel/vdso.c
===
--- linux-work.orig/arch/powerpc/kernel/vdso.c  2007-09-18 16:54:37.0 
+1000
+++ linux-work/arch/powerpc/kernel/vdso.c   2007-09-18 16:55:11.0 
+1000
@@ -98,6 +98,18 @@ static struct vdso_patch_def vdso_patche
CPU_FTR_USE_TB, 0,
__kernel_gettimeofday, NULL
},
+   {
+   CPU_FTR_USE_TB, 0,
+   __kernel_clock_gettime, NULL
+   },
+   {
+   CPU_FTR_USE_TB, 0,
+   __kernel_clock_getres, NULL
+   },
+   {
+   CPU_FTR_USE_TB, 0,
+   __kernel_get_tbfreq, NULL
+   },
 };
 
 /*
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/2] powerpc: Fix timekeeping on PowerPC 601

2007-09-18 Thread Benjamin Herrenschmidt
Recent changes to the timekeeping code broke support for the PowerPC 601
processor which doesn't have the usual timebase facility but a slightly
different thing called (yuck) the RTC.

This fixes it, boot tested on an old 601 based PowerMac 7200

Signed-off-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
---

 arch/powerpc/kernel/time.c |8 +---
 include/asm-powerpc/time.h |5 +
 2 files changed, 10 insertions(+), 3 deletions(-)

Index: linux-work/arch/powerpc/kernel/time.c
===
--- linux-work.orig/arch/powerpc/kernel/time.c  2007-09-19 10:53:28.0 
+1000
+++ linux-work/arch/powerpc/kernel/time.c   2007-09-19 11:28:14.0 
+1000
@@ -239,7 +239,7 @@ static void snapshot_tb_and_purr(void *d
struct cpu_purr_data *p = __get_cpu_var(cpu_purr_data);
 
local_irq_save(flags);
-   p-tb = mftb();
+   p-tb = get_tb_or_rtc();
p-purr = mfspr(SPRN_PURR);
wmb();
p-initialized = 1;
@@ -317,7 +317,7 @@ static void snapshot_purr(void)
  */
 void snapshot_timebase(void)
 {
-   __get_cpu_var(last_jiffy) = get_tb();
+   __get_cpu_var(last_jiffy) = get_tb_or_rtc();
snapshot_purr();
 }
 
@@ -684,6 +684,8 @@ void timer_interrupt(struct pt_regs * re
 
write_seqlock(xtime_lock);
tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy;
+   if (__USE_RTC()  tb_next_jiffy = 10)
+   tb_next_jiffy -= 10;
if (per_cpu(last_jiffy, cpu) = tb_next_jiffy) {
tb_last_jiffy = tb_next_jiffy;
do_timer(1);
@@ -977,7 +979,7 @@ void __init time_init(void)
tb_to_ns_scale = scale;
tb_to_ns_shift = shift;
/* Save the current timebase to pretty up CONFIG_PRINTK_TIME */
-   boot_tb = get_tb();
+   boot_tb = get_tb_or_rtc();
 
tm = get_boot_time();
 
Index: linux-work/include/asm-powerpc/time.h
===
--- linux-work.orig/include/asm-powerpc/time.h  2007-09-19 10:53:28.0 
+1000
+++ linux-work/include/asm-powerpc/time.h   2007-09-19 10:53:37.0 
+1000
@@ -149,6 +149,11 @@ static inline u64 get_tb(void)
 }
 #endif /* !CONFIG_PPC64 */
 
+static inline u64 get_tb_or_rtc(void)
+{
+   return __USE_RTC() ? get_rtc() : get_tb();
+}
+
 static inline void set_tb(unsigned int upper, unsigned int lower)
 {
mtspr(SPRN_TBWL, 0);
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 13/28] 8xx: Infrastructure code cleanup.

2007-09-18 Thread David Gibson
On Mon, Sep 17, 2007 at 11:57:42AM -0500, Scott Wood wrote:
 1. Keep a global mpc8xx_immr mapping, rather than constantly
 creating temporary mappings.

Nice, but again, it seems a bit pointless to leave in all the
immr_map() / immr_unmap() pairs now that they do basically nothing.

-- 
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@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc mm init_32 gdb regions

2007-09-18 Thread Ed Swarthout
Add memory regions to the kcore list for 32-bit machines.
Since the entries are only 32-bit, keep under 4G.

Signed-off-by: Ed Swarthout [EMAIL PROTECTED]
---

Adapted from init_64.c

 arch/powerpc/mm/init_32.c |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index d65995a..d804c65 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -255,3 +255,37 @@ void free_initrd_mem(unsigned long start, unsigned long 
end)
}
 }
 #endif
+
+static struct kcore_list kcore_vmem;
+
+static int __init setup_kcore(void)
+{
+   int i;
+
+   for (i=0; i  lmb.memory.cnt; i++) {
+   unsigned long base, size;
+   struct kcore_list *kcore_mem;
+
+   base = lmb.memory.region[i].base;
+   size = lmb.memory.region[i].size;
+
+   kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
+   if (!kcore_mem)
+   panic(%s: kmalloc failed\n, __FUNCTION__);
+
+   /* must stay under 32 bits */
+   if ( 0xul - (unsigned long)__va(base)  size) {
+   size = 0xul - (unsigned long)(__va(base));
+   printk(KERN_DEBUG setup_kcore: restrict size=%lx\n,
+   size);
+   }
+
+   kclist_add(kcore_mem, __va(base), size);
+   }
+
+   kclist_add(kcore_vmem, (void *)VMALLOC_START,
+   VMALLOC_END-VMALLOC_START);
+
+   return 0;
+}
+module_init(setup_kcore);
-- 
1.5.3.rc6.63.gf7c18

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


Re: [PATCH 13/28] 8xx: Infrastructure code cleanup.

2007-09-18 Thread Scott Wood
On Wed, Sep 19, 2007 at 02:25:33PM +1000, David Gibson wrote:
 On Mon, Sep 17, 2007 at 11:57:42AM -0500, Scott Wood wrote:
  1. Keep a global mpc8xx_immr mapping, rather than constantly
  creating temporary mappings.
 
 Nice, but again, it seems a bit pointless to leave in all the
 immr_map() / immr_unmap() pairs now that they do basically nothing.

One step at a time. :-)

Once arch/ppc is gone, I'd like to do some heavier cleanup of the CPM
stuff, including merging with QE.  For now, I want to touch code that's
shared between the architectures as little as possible.

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


Re: [PATCH] [POWERPC] Fix build errors when BLOCK=n

2007-09-18 Thread Paul Mackerras
Emil Medve writes:

 The fix tries to use the smallest scope CONFIG_* symbols that will fix the 
 build
 problem. In this case linux/ide.h needs to be included only if IDE=y or
 IDE=m were selected. Also, ppc_ide_md is needed only if BLK_DEV_IDE=y or
 BLK_DEV_IDE=m

It would be nicer to remove the ppc_ide_md stuff from ppc_ksyms.c
altogether and just put the EXPORT_SYMBOL in setup_32.c.

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