[PATCH][1/3] ppc32: add 440ep support

2005-07-28 Thread Domen Puncer
On 27/07/05 18:56 -0400, Paul Mackerras wrote:
 Andrew Morton writes:
 
  Matt Porter mporter at kernel.crashing.org wrote:
  
   +static u64 dma_mask = 0xULL;

How about just DMA_32BIT_MASK from dma-mapping.h, that one has to be
correct. ;-)

  
  I'm sure you're totally uninterested in this, but the above will probably
  generate warnings on (say) ppc64, where u64 is implemented as unsigned
  long.
  
  I usually chuck a simple `-1' in there and the compiler always gets it
  right, regardless of signedness and size and architecture.
 
 Umm, I think we actually want 2^32-1 not -1, don't we?  In which case
 I think Matt's code is what we have to have.
 
 I tried a little test compile with gcc 4.0 with -m64 -Wall and it
 didn't generate a warning with the 0xULL constant.



[PATCH][1/3] ppc32: add 440ep support

2005-07-27 Thread Matt Porter

Add PPC440EP core support.  PPC440EP is a PPC440-based SoC with
a classic PPC FPU and another set of peripherals.

Signed-off-by: Wade Farnsworth wfarnsworth at mvista.com
Signed-off-by: Matt Porter mporter at kernel.crashing.org

diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -61,6 +61,12 @@ zimageinitrd-$(CONFIG_IBM_OPENBIOS)  := z
  end-$(CONFIG_EMBEDDEDBOOT):= embedded
 misc-$(CONFIG_EMBEDDEDBOOT):= misc-embedded.o
 
+  zimage-$(CONFIG_BAMBOO)  := zImage-TREE
+zimageinitrd-$(CONFIG_BAMBOO)  := zImage.initrd-TREE
+ end-$(CONFIG_BAMBOO)  := bamboo
+  entrypoint-$(CONFIG_BAMBOO)  := 0x0100
+ extra.o-$(CONFIG_BAMBOO)  := pibs.o
+
   zimage-$(CONFIG_EBONY)   := zImage-TREE
 zimageinitrd-$(CONFIG_EBONY)   := zImage.initrd-TREE
  end-$(CONFIG_EBONY)   := ebony
diff --git a/arch/ppc/boot/simple/pibs.c b/arch/ppc/boot/simple/pibs.c
--- a/arch/ppc/boot/simple/pibs.c
+++ b/arch/ppc/boot/simple/pibs.c
@@ -91,9 +91,11 @@ load_kernel(unsigned long load_addr, int
 
mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16);
memcpy(hold_residual-bi_enetaddr, (char *)mac64+2, 6);
-#ifdef CONFIG_440GX
+#if defined(CONFIG_440GX) || defined(CONFIG_440EP)
mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16);
memcpy(hold_residual-bi_enet1addr, (char *)mac64+2, 6);
+#endif
+#ifdef CONFIG_440GX
mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 
16);
memcpy(hold_residual-bi_enet2addr, (char *)mac64+2, 6);
mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 
16);
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -852,6 +852,26 @@ struct cpu_speccpu_specs[] = {
 
 #endif /* CONFIG_40x */
 #ifdef CONFIG_44x
+   {
+   .pvr_mask   = 0xffff,
+   .pvr_value  = 0x4850,
+   .cpu_name   = 440EP Rev. A,
+   .cpu_features   = CPU_FTR_SPLIT_ID_CACHE |
+   CPU_FTR_USE_TB,
+   .cpu_user_features  = COMMON_PPC, /* 440EP has an FPU */
+   .icache_bsize   = 32,
+   .dcache_bsize   = 32,
+   },
+   {
+   .pvr_mask   = 0xffff,
+   .pvr_value  = 0x48d3,
+   .cpu_name   = 440EP Rev. B,
+   .cpu_features   = CPU_FTR_SPLIT_ID_CACHE |
+   CPU_FTR_USE_TB,
+   .cpu_user_features  = COMMON_PPC, /* 440EP has an FPU */
+   .icache_bsize   = 32,
+   .dcache_bsize   = 32,
+   },
{   /* 440GP Rev. B */
.pvr_mask   = 0xffff,
.pvr_value  = 0x4440,
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -215,6 +215,7 @@ syscall_dotrace_cont:
lwzxr10,r10,r0  /* Fetch system call handler [ptr] */
mtlrr10
addir9,r1,STACK_FRAME_OVERHEAD
+   PPC440EP_ERR42
blrl/* Call handler */
.globl  ret_from_syscall
 ret_from_syscall:
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -190,7 +190,9 @@ skpinv: addir4,r4,1 /* 
Increment */
 
/* xlat fields */
lis r4,UART0_PHYS_IO_BASE at h  /* RPN depends on SoC */
+#ifndef CONFIG_440EP
ori r4,r4,0x0001/* ERPN is 1 for second 4GB page */
+#endif
 
/* attrib fields */
li  r5,0
@@ -228,6 +230,16 @@ skpinv:addir4,r4,1 /* 
Increment */
lis r4,interrupt_base at h  /* IVPR only uses the high 16-bits */
mtspr   SPRN_IVPR,r4
 
+#ifdef CONFIG_440EP
+   /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */
+   mfspr   r2,SPRN_CCR0
+   lis r3,0xffef
+   ori r3,r3,0x
+   and r2,r2,r3
+   mtspr   SPRN_CCR0,r2
+   isync
+#endif
+
/*
 * This is where the main kernel code starts.
 */
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -1145,6 +1145,7 @@ _GLOBAL(kernel_thread)
stwur0,-16(r1)
mtlrr30 /* fn addr in lr */
mr  r3,r31  /* load arg and call fn */
+   PPC440EP_ERR42
blrl
li  r0,__NR_exit/* exit if function returns */
li  r3,0
diff --git 

[PATCH][1/3] ppc32: add 440ep support

2005-07-27 Thread Andrew Morton
Matt Porter mporter at kernel.crashing.org wrote:

 +static u64 dma_mask = 0xULL;

I'm sure you're totally uninterested in this, but the above will probably
generate warnings on (say) ppc64, where u64 is implemented as unsigned
long.

I usually chuck a simple `-1' in there and the compiler always gets it
right, regardless of signedness and size and architecture.



[PATCH][1/3] ppc32: add 440ep support

2005-07-27 Thread Paul Mackerras
Andrew Morton writes:

 Matt Porter mporter at kernel.crashing.org wrote:
 
  +static u64 dma_mask = 0xULL;
 
 I'm sure you're totally uninterested in this, but the above will probably
 generate warnings on (say) ppc64, where u64 is implemented as unsigned
 long.
 
 I usually chuck a simple `-1' in there and the compiler always gets it
 right, regardless of signedness and size and architecture.

Umm, I think we actually want 2^32-1 not -1, don't we?  In which case
I think Matt's code is what we have to have.

I tried a little test compile with gcc 4.0 with -m64 -Wall and it
didn't generate a warning with the 0xULL constant.

Paul.



[PATCH][1/3] ppc32: add 440ep support

2005-07-27 Thread Andrew Morton
Paul Mackerras paulus at samba.org wrote:

 Andrew Morton writes:
 
  Matt Porter mporter at kernel.crashing.org wrote:
  
   +static u64 dma_mask = 0xULL;
  
  I'm sure you're totally uninterested in this, but the above will probably
  generate warnings on (say) ppc64, where u64 is implemented as unsigned
  long.
  
  I usually chuck a simple `-1' in there and the compiler always gets it
  right, regardless of signedness and size and architecture.
 
 Umm, I think we actually want 2^32-1 not -1, don't we?

Doh.  Cant coun't.