[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/kernel/devel linux-2.6.15-ppc-cell-basics.patch, NONE, 1.1 kernel-2.6.spec, 1.1682, 1.1683



Author: dwmw2

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv17731

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6.15-ppc-cell-basics.patch 
Log Message:
Add Cell simulator support

linux-2.6.15-ppc-cell-basics.patch:
 arch/powerpc/Kconfig                                         |   14 
 arch/powerpc/kernel/entry_64.S                               |    4 
 arch/powerpc/kernel/head_64.S                                |   41 +
 arch/powerpc/kernel/prom_init.c                              |    2 
 arch/powerpc/platforms/cell/iommu.c                          |    6 
 arch/powerpc/platforms/cell/spider-pic.c                     |    4 
 drivers/block/Makefile                                       |    1 
 drivers/char/Kconfig                                         |    6 
 drivers/char/Makefile                                        |    1 
 include/asm-powerpc/processor.h                              |   17 
 linux-2.6.14-rc/drivers/char/bogus_console.c                 |  315 +++++++++
 linux-2.6.14/drivers/net/Makefile                            |    2 
 linux-2.6.14/drivers/net/mambonet.c                          |  362 +++++++++++
 linux-2.6.15-rc/drivers/block/mambo_bd.c                     |  252 +++++++
 linux-2.6.15-rc/include/asm-powerpc/mambo/callthru_config.h  |  241 +++++++
 linux-2.6.15-rc/include/asm-powerpc/mambo/sim_support_code.h |  171 +++++
 linux-2.6.15-rc/include/linux/mambobd.h                      |   38 +
 17 files changed, 1475 insertions(+), 2 deletions(-)

--- NEW FILE linux-2.6.15-ppc-cell-basics.patch ---
unchanged:
--- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/iommu.c
+++ linux-2.6.15-rc/arch/powerpc/platforms/cell/iommu.c
@@ -374,7 +374,11 @@ static int cell_dma_supported(struct dev
 
 void cell_init_iommu(void)
 {
-	cell_map_iommu();
+	if (__onsim()) {
+		printk(KERN_INFO "Not using iommu on mambo\n");
+	} else {
+		cell_map_iommu();
+	}
 
 	/* Direct I/O, IOMMU off */
 	ppc_md.iommu_dev_setup = iommu_dev_setup_null;
unchanged:
--- linux-2.6.15-rc.orig/arch/powerpc/kernel/entry_64.S
+++ linux-2.6.15-rc/arch/powerpc/kernel/entry_64.S
@@ -35,6 +35,10 @@
 #define DO_SOFT_DISABLE
 #endif
 
+_GLOBAL(callthru)
+        .long 0x7c0007cc
+        blr
+
 /*
  * System calls.
  */
unchanged:
--- linux-2.6.15-rc.orig/include/asm-powerpc/processor.h
+++ linux-2.6.15-rc/include/asm-powerpc/processor.h
@@ -284,6 +284,23 @@ static inline void pause_zero(void)
 }
 #endif
 
+#ifdef CONFIG_PPC_CELL /* MAMBO SIMULATION code */
+#define MSR_SIM_LG      29
+#define MSR_SIM         __MASK(MSR_SIM_LG)
+
+static __inline__ int __onsim(void)
+{
+        unsigned long msr;
+        __asm__ __volatile__ ("mfmsr    %0" : "=&r" (msr));
+        return ((msr & MSR_SIM) ? 1 : 0);
+}
+#endif /* CONFIG_PPC_CELL */
+
 #endif /* __KERNEL__ */
+#else
+/* must be given a register to perform the compare, set cr0 = 1
+ * Usage: __onsim(r0); bne _if_onsim
+ */
+#define __onsim(r) mfmsr        r; rldicl. r,r,35,63
 #endif /* __ASSEMBLY__ */
 #endif /* _ASM_POWERPC_PROCESSOR_H */
unchanged:
--- /dev/null
+++ linux-2.6.15-rc/include/asm-powerpc/mambo/callthru_config.h
@@ -0,0 +1,241 @@
+/*********************************************************
+ *
+ * (C) Copyright IBM Corporation 2001, 2003
+ *
+ * Filename : callthru_config.h
+ *
+ * Originator   : Patrick Bohrer
+ *
+ * Purpose  :
+ *
+ *   This file is compiled with programs that are run under the Mambo
+ *   simulator.  For example, stand-alone programs or operating
+ *   systems.  (This file is not compiled info Mambo!)  The programs
+ *   call the callthru wrapper functions which use an illegal PowerPC
+ *   instruction to signal the Mambo simulator to emulate special
+ *   support.
+ *
+ *********************************************************/
+
+#ifndef _CALLTHRU_CONFIG_H_
+#define _CALLTHRU_CONFIG_H_
+
+#include "sim_support_code.h"
+
+#define CAST(t,e) ((t)(e))
+
+/* The AIX xlc compiler does not seem to like the gcc
+   "static inline" declaration. */
+#ifdef __GNUC__
+#define INLINE static inline
+#else /* #ifdef __GNUC__ */
+#define INLINE static
+#endif /* #ifdef __GNUC__ */
+
+
+/* The functions callthru0 to callthru5 setup up the arguments for the
+ * Mambo callthru and then use the callthru instruction.  Note that
+ * 0-5 specify the number of arguments after the command */
+
+/* Note: Arguments are cast as unsigned long to prevent casting by the
+   compiler.  This way, you can pass pointers, integers, etc. in
+   machine register and have the Mambo simulator interpret what the
+   register is supposed to be.  To help with typing errors when using
+   callthrus, we provide wrapper functions for each callthru.  The
+   wrappers cast all arguments to unsigned long.  Unfortunately, this results
+   in a lot of compiler warnings that I do not know how to remove.  If
+   you modify this code, be aware that we are trying to pick a type
+   that is the size of the registers (32-bit or 64-bit) and that is
+   why are choosing to cast to a void* (it should be the size of a
+   machine register) */
+
+INLINE int callthru0(int command)
+{
+    register int c asm ("r3") = command;
+    asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c));
+    return((c));
+}
+INLINE int callthru1(int command, unsigned long arg1)
+{
+    register int c asm ("r3") = command;
+    register unsigned long a1 asm ("r4") = arg1;
+    asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c), "r" (a1));
+    return((c));
+}
+INLINE int callthru2(int command, unsigned long arg1, unsigned long arg2)
+{
+    register int c asm ("r3") = command;
+    register unsigned long a1 asm ("r4") = arg1;
+    register unsigned long a2 asm ("r5") = arg2;
+    asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c), "r" (a1), "r" (a2));
+    return((c));
+}
+INLINE int callthru3(int command, unsigned long arg1, unsigned long arg2, unsigned long arg3)
+{
+    register int c asm ("r3") = command;
+    register unsigned long a1 asm ("r4") = arg1;
+    register unsigned long a2 asm ("r5") = arg2;
+    register unsigned long a3 asm ("r6") = arg3;
+    asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c), "r" (a1), "r" (a2), "r" (a3));
+    return((c));
+}
+INLINE int callthru4(int command, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4)
+{
+    register int c asm ("r3") = command;
+    register unsigned long a1 asm ("r4") = arg1;
+    register unsigned long a2 asm ("r5") = arg2;
+    register unsigned long a3 asm ("r6") = arg3;
+    register unsigned long a4 asm ("r7") = arg4;
+    asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c), "r" (a1), "r" (a2), "r" (a3), "r" (a4));
+    return((c));
+}
+INLINE int callthru5(int command, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5)
+{
+    register int c asm ("r3") = command;
+    register unsigned long a1 asm ("r4") = arg1;
+    register unsigned long a2 asm ("r5") = arg2;
+    register unsigned long a3 asm ("r6") = arg3;
+    register unsigned long a4 asm ("r7") = arg4;
+    register unsigned long a5 asm ("r8") = arg5;
+    asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c), "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5));
+    return((c));
+}
+INLINE int callthru6(int command, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5, unsigned long arg6)
+{
+    register int c asm ("r3") = command;
+    register unsigned long a1 asm ("r4") = arg1;
+    register unsigned long a2 asm ("r5") = arg2;
+    register unsigned long a3 asm ("r6") = arg3;
+    register unsigned long a4 asm ("r7") = arg4;
+    register unsigned long a5 asm ("r8") = arg5;
+    register unsigned long a6 asm ("r9") = arg6;
+    asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c), "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6));
+    return((c));
+}
+INLINE int callthru7(int command, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5, unsigned long arg6, unsigned long arg7)
+{
+    register int c asm ("r3") = command;
+    register unsigned long a1 asm ("r4") = arg1;
+    register unsigned long a2 asm ("r5") = arg2;
+    register unsigned long a3 asm ("r6") = arg3;
+    register unsigned long a4 asm ("r7") = arg4;
+    register unsigned long a5 asm ("r8") = arg5;
+    register unsigned long a6 asm ("r9") = arg6;
+    register unsigned long a7 asm ("r10") = arg7;
+    asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c), "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), "r" (a7));
+    return((c));
+}
+
+
+
+/* Wrappers for simulator callthrus */
+
+INLINE int MamboWriteConsole( char *string )
+{
+    return(callthru3( SimWriteConsoleCode, CAST(unsigned long,string), CAST(unsigned long,strlen(string)), CAST(unsigned long,1) ));
+}
+
+INLINE int MamboStopSimulation(void)
+{
+    return(callthru0( SimExitCode));
+}
+
+INLINE int MamboReadConsole(void)
+{
+    return(callthru0( SimReadConsoleCode));
+}
+
+INLINE int MamboThinIPRead( char *string, int length )
+{
+    return(callthru2( SimThinIPReadCode, CAST(unsigned long,string), CAST(unsigned long,length)));
+}
+
+INLINE int MamboThinIPWrite( char *string, int length )
+{
+    return(callthru2( SimThinIPWriteCode, CAST(unsigned long,string), CAST(unsigned long,length)));
+}
+
+INLINE int MamboGetConfig( CallthruConfig *config )
+{
+    return(callthru1( SimGetConfigCode, CAST(unsigned long,config)));
+}
+
+INLINE int MamboLogStats( char *comment, int id )
+{
+    return(callthru2( SimLogStatsCode, CAST(unsigned long,comment), CAST(unsigned long,id)));
+}
+
+INLINE int MamboPPCOnly( int newstate )
+{
+    return(callthru1( SimPPCOnlyCode, CAST(unsigned long,newstate)));
+}
+
+INLINE int MamboPIDCreate(int parent, int pid, int flags)
+{
+    return(callthru3(SimPIDCreateCode,CAST(unsigned long,parent),CAST(unsigned long,pid),CAST(unsigned long,flags)));
+}
+
+INLINE int MamboPIDExecExit(int pid)
+{
+    return(callthru1(SimPIDExecExitCode, CAST(unsigned long,pid)));
+}
+
+INLINE int MamboPIDExec(int pid, char *filename, int len)
+{
+    return(callthru3(SimPIDExecCode, CAST(unsigned long,pid), CAST(unsigned long,filename), CAST(unsigned long,len)));
+}
+
+INLINE int MamboPIDResume(int processor, int pid)
+{
+    return(callthru3(SimPIDResumeCode, CAST(unsigned long,processor), CAST(unsigned long,pid), CAST(unsigned long,0)));
+}
+
+INLINE int MamboPIDKill(int pid)
+{
+    return(callthru1(SimPIDKillCode,CAST(unsigned long,pid)));
+}
+INLINE int MamboKernelThreadCreate(int parent, int pid, int flags)
+{
+    return(callthru3(SimKernelThreadCreateCode,CAST(unsigned long,parent),CAST(unsigned long,pid),CAST(unsigned long,flags)));
+}
+
+INLINE int MamboBogusDiskRead( int devno, void *buf, ulong sect, ulong nrsect)
+{
+    return callthru3( SimBogusDiskReadCode, CAST(unsigned long,buf), CAST(unsigned long,sect),
+                      CAST(unsigned long,(nrsect<<16)|devno));
+}
+
+INLINE int MamboBogusDiskWrite( int devno, void *buf, ulong sect, ulong nrsect)
+{
+    return callthru3( SimBogusDiskWriteCode, CAST(unsigned long,buf), CAST(unsigned long,sect),
+                      CAST(unsigned long,(nrsect<<16)|devno));
+}
+INLINE int MamboBogusDiskInfo( int op, int devno)
+{
+    return(callthru2( SimBogusDiskInfoCode, CAST(unsigned long,op), CAST(unsigned long,devno)));
+}
+
+INLINE int MamboBogusNetProbe( int devno, void *buf)
+{
+    return(callthru2( SimBogusNetProbeCode, CAST(unsigned long,devno), CAST(unsigned long,buf) ));
+}
+
+INLINE int MamboBogusNetSend( int devno, void *buf, ulong size)
+{
+    return(callthru3( SimBogusNetSendCode, CAST(unsigned long,devno), CAST(unsigned long,buf), CAST(unsigned long,size)));
+}
+
+INLINE int MamboBogusNetRecv( int devno, void *buf, ulong size)
+{
+    return(callthru3( SimBogusNetRecvCode, CAST(unsigned long,devno), CAST(unsigned long,buf), CAST(unsigned long,size)));
+}
+
+INLINE void BogusHalt( void ) { callthru0( SimBogusHaltCode ); }
+
+INLINE int MamboKernelMmapFile(char *buffer, int pathlen, unsigned long addr, unsigned long len, unsigned long prot, unsigned long flag, unsigned long offset)
+{
+    return(callthru7( SimKernelMmapFileCode, CAST(unsigned long,buffer), CAST(unsigned long,pathlen), CAST(unsigned long,addr), CAST(unsigned long,len), CAST(unsigned long,prot), CAST(unsigned long,flag), CAST(unsigned long,offset)));
+}
+
+#endif /* #ifndef _CALLTHRU_CONFIG_H_ */
+
unchanged:
--- /dev/null
+++ linux-2.6.15-rc/include/asm-powerpc/mambo/sim_support_code.h
@@ -0,0 +1,171 @@
+/*********************************************************
+ *
+ * (C) Copyright IBM Corporation 2001, 2003
+ *
+ * Filename : sim_support_code.h
+ *
+ * Originator : Charles Lefurgy
+ *
+ * Purpose : This file is shared between Mambo and OSes (Linux, K42).
+ *
+ *********************************************************/
+
+#ifndef _SIM_SUPPORT_CODE_H_
+#define _SIM_SUPPORT_CODE_H_
+
+
+typedef struct CallthruCacheConfig
+{
+    int dcache_size;                /* bytes */
+    int dcache_assoc;
+    int dcache_line_size;           /* bytes */
+    int dcache_block_size;          /* bytes */
+
+    int icache_size;                /* bytes */
+    int icache_assoc;
+    int icache_line_size;           /* bytes */
+    int icache_block_size;          /* bytes */
+
+    int l2cache_size;               /* bytes */
+    int l2cache_assoc;
+    int l2cache_line_size;          /* bytes */
+} CallthruCacheConfig;
+
+typedef struct CallthruConfig
+{
+    int         num_cpus;
+    int         cpu_clock_freq;     /* Mhz */
+    unsigned long long      mem_size;       /* bytes */
+    CallthruCacheConfig cache;
+} CallthruConfig;
+
+
+
+/*
+ * Support functions that can be invoked by the simulated program
+ *
+ * Simulated reg 3 contains code indicating which function to perform: */
+typedef enum
+{
+    SimWriteConsoleCode = 0,         /*  0 */
+    SimDiskReadCode,                 /*  1 */
+    SimDiskWriteCode,                /*  2 */
+    SimDeviceIntRegisterCode,        /*  3 */
+    SimDeviceIntDeregisterCode,      /*  4 */
+    SimDeviceEnableIntCode,          /*  5 */
+    SimDeviceDisableIntCode,         /*  6 */
+    SimGetIntStreamForDeviceCode,    /*  7 */
+    SimResetIntForStreamCode,        /*  8 */
+    SimCharReadCode,                 /*  9 */
+    SimCharWriteCode,                /* 10 */
+    SimGetInterruptingLevelCode,     /* 11 */
+    SimSetExternalLevelMaskCode,     /* 12 */
+    SimSetInterruptCode,             /* 13 */
+    SimMapLevelCode,                 /* 14 */
+    SimResetInterruptCode,           /* 15 */
+    SimFileOpenCode,                 /* 16 */
+    SimFileCloseCode,                /* 17 */
+    SimFileReadCode,                 /* 18 */
+    SimFileWriteCode,                /* 19 */
+    SimTakeCheckpointCode,           /* 20 */
+    SimInterruptEOICode,             /* 21 */
+    SimShellCode,                    /* 22 */
+    SimBlockIOCode,                  /* 23 */
+    SimGetCookieCode,                /* 24 */
+    SimDumpStatsCode,                /* 25 */
+    SimReturnStatsCode = 30,         /* 30 */
+    SimExitCode,                     /* 31 */
+    SimDumpPPCStatsCode = 32,        /* 32 */ /* used in cyclesim + ??? */
+    SimClearPPCStatsCode = 33,       /* 33 */ /* used in cyclesim + ??? */
+    SimCopyQuickCode = 34,           /* 34 */ /* shortcut a long memory copy */
+    /* 35 */ /* bmark under test for power validation in cyclesim */
+    SimSetTestNameCode = 35,
+
+    SimDumpSystemStatsCode = 36,           /* 36 */
+    SimClearSystemStatsCode = 37,          /* 37 */
+    SimSystemMemTraceEnableCode = 38,      /* 38 */
+    SimSystemMemTraceDisableCode = 39,     /* 39 */
+
+    SimTCLReadCode = 40,              /* 40 */
+    SimTCLWriteCode,                  /* 41 */
+    SimFileLoadedByAIXCode = 50,        /* 50 */
+    SimUnloadedFileCode,              /* 51 */
+    SimDumpStateCode,                 /* 52 */ /* get a machine attribute */
+
+    SimReadConsoleCode = 60,          /* 60 */ /* k42 codes starting at 60 */
+    SimThinIPReadCode,                /* 61 */ /* thinIP read */
+    SimThinIPWriteCode,               /* 62 */ /* thinIP write */
+    SimFastRevMemCopyCode,            /* 63 */ /* fast rev mem cpy */
+    SimStartCPUCode,                  /* 64 */ /* start a cpu */
+    SimSendIPICode,                   /* 65 */ /* make an IPI */
+    SimGetInstrCountCode,             /* 66 */ /* get instr count */
+    SimGetNumbPhysProcsCode,          /* 67 */ /* get numb procs */
+    SimGetMachAttrCode,               /* 68 */ /* get a machine attribute */
+    SimPhysMemCopyCode,               /* 69 */ /* a fast phys to phys mem copy */
+    SimGetTimeCode,                   /* 70 */ /* get a time */
+    SimPhysMemSetCode,                /* 71 */ /* a fast memory set routine */
+    SimTraceFileCtlCode,              /* 72 */ /* allows open, write, close */
+
+    /* 80 */ /* read up to 4096 bytes from a simulator disk */
+    SimDiskReadK42Code = 80,
+
+    /* 81 */ /* write up to 4096 bytes to a simulator disk */
+    SimDiskWriteK42Code,
+
+    /* 82 */ /* open simulator disk; return disk size */
+    SimDiskOpenK42Code,
+
+    /* 83 */ /* close simulator disk; NOT YET IMPLEMENTED */
+    SimDiskCloseK42Code,
+
+
+    SimGetConfigCode,          /* 84 */ /* read the system configuration */
+    /* 85 */ /* print out the stats with a comment and id */
+    SimLogStatsCode,
+
+
+    /* 86 */ /* execute the passed string as a tcl procedure */
+    SimCallTCLCode,
+
+    SimPROMCode = 99,              /* 99 */ /* Handle open firmware calls */
+
+#if 1 // def STI
+    SimPPCOnlyCode = 100,             /* 100 */ /* Turn PPC-ONLY mode on or off */
+#endif /* #ifdef STI */
+/* mco hooks to linux kernel process creation destruction routines */
+    SimPIDCreateCode = 101,         /* 101 */ /* fork a proc */
+    SimPIDExecExitCode,             /* 102 */ /* exit() */
+    SimPIDExecCode,                 /* 103 */ /* execve() */
+    SimPIDResumeCode,               /* 104 */ /* */
+    SimPIDKillCode,                 /* 105 */ /* */
+    SimKernelThreadCreateCode,      /* 106 */ /* kernel_thread() */
+    SimKernelStartedCode,           /* 107 */ /* kernel finished booting */
+    SimLinuxLoadShlibCode,          /* 108 */ /* linux load_elf_library() */
+    SimOpenConnectionCode = 110,    /* 110 */ /* open connection code */
+    SimCloseConnectionCode,         /* 111 */ /* close connection code */
+    SimReadConnectionCode,          /* 112 */ /* read connection code */
+    SimWriteConnectionCode,         /* 113 */ /* write connection code */
+    SimSelectConnectionCode,        /* 114 */ /* select connection code */
+    SimPthreadCreateCode,           /* 115 traps into simulator to create/start a pthread */
+
+    SimBogusDiskReadCode,           /* 116 mambo bogus disk block read */
+    SimBogusDiskWriteCode,          /* 117 mambo bogus disk block write */
+    SimBogusDiskInfoCode,           /* 118 mambo bogus disk info op */
+    SimBogusNetProbeCode,           /* 119 mambo bogus net probe op */
+    SimBogusNetSendCode,            /* 120 mambo bogus net send op */
+    SimBogusNetRecvCode,            /* 121 mambo bogus net recv op */
+
+    SimFileLoadedByOSCode,          /* 122 */
+
+    SimKernelThreadCallCode,        /* 123 */ /* kernel_thread() */
+
+    SimKernelMmapFileCode,          /* 124 */ /* do_mmap from linux */
+
+    SimDumpMemoryCode,              /* 125 */ /* print memory region to file */
+    SimBogusHaltCode,               /* 126 */ /* bogus halt for idle */
+
+
+    SimLastCode /* This must be last in this list */
+} SimSupportCode;
+
+#endif /* #ifndef _SIM_SUPPORT_CODE_H_ */
unchanged:
--- linux-2.6.15-rc/arch/powerpc/Kconfig
+++ linux-2.6.14/arch/powerpc/Kconfig	2005-11-16 01:31:12.000000000 +0000
@@ -421,6 +421,20 @@
 	  some command-line options at build time by entering them here.  In
 	  most cases you will need to specify the root device here.
 
+config MAMBO_BD
+	bool "Mambo Block driver stuff"
+	depends on PPC_PSERIES || PPC_CELL
+	---help---
+	mambo block device driver
+
+config MAMBO_NET
+        depends on PPC_PSERIES || PPC_CELL
+        tristate "    IBM Full System Simulator Bogus Network Support"
+        default y
+        ---help---
+           Provides quick access to a raw ethernet device in the simulator
+           without simulating any specific network device hardware.
+
 endmenu
 
 config ISA_DMA_API
unchanged:
--- linux-2.6.15-rc.orig/arch/powerpc/kernel/head_64.S
+++ linux-2.6.15-rc/arch/powerpc/kernel/head_64.S
@@ -36,6 +36,7 @@
 #include <asm/hvcall.h>
 #include <asm/iseries/lpar_map.h>
 #include <asm/thread_info.h>
+#include <asm/processor.h>
 
 #ifdef CONFIG_PPC_ISERIES
 #define DO_SOFT_DISABLE
@@ -1606,6 +1606,10 @@ _STATIC(__after_prom_start)
  * Note: this routine *only* clobbers r0, r6 and lr
  */
 _GLOBAL(copy_and_flush)
+#ifdef CONFIG_PPC_CELL
+	__onsim(r0)
+	bne     _sim_copy_and_flush
+#endif
 	addi	r5,r5,-8
 	addi	r6,r6,-8
 4:	li	r0,16			/* Use the least common		*/
@@ -1632,6 +1636,42 @@ _GLOBAL(copy_and_flush)
 	addi	r6,r6,8
 	blr
 
+#ifdef CONFIG_PPC_CELL
+_sim_copy_and_flush:
+/*
+ * Use Simulators copy cut-thru
+ * which is SimOSSupport(SimPhysMemCopyK, dst, src, size);
+ */
+	mr      r0,r6
+	mr      r6,r5
+	subf    r6,r0,r6
+
+	mr      r5,r4
+	add     r5,r5,r0
+
+	mr      r4,r3
+	add     r4,r4,r0
+
+	li      r3,69           # SimPhysMemCopyK
+	.long 0x000EAEB0        # SimOS trap
+
+	## restore
+	mr      r3,r4
+	subf    r3,r0,r3
+
+	mr      r4,r5
+	subf    r4,r0,r4
+
+	mr      r5,r6
+	add     r5,r5,r0
+
+	## r6 needs to be r5 rounded up to nearest 8
+	mr      r6,r5
+	addi    r6,r6,7
+	rldicr  r6,r6,0,60
+	blr
+#endif
+
 .align 8
 copy_to_here:
 
unchanged:
--- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/spider-pic.c
+++ linux-2.6.15-rc/arch/powerpc/platforms/cell/spider-pic.c
@@ -159,6 +159,10 @@ void spider_init_IRQ(void)
 	long pics[] = { 0x24000008000, 0x34000008000 };
 	int n;
 
+	if (__onsim()) {
+		return;
+	}
+
 /* FIXME: detect multiple PICs as soon as the device tree has them */
 	for (node = 0; node < num_present_cpus()/2; node++) {
 #if 0
unchanged:
--- linux-2.6.15-rc.orig/drivers/block/Makefile
+++ linux-2.6.15-rc/drivers/block/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_CDROM_PKTCDVD)	+= pktcdvd.o
 
 obj-$(CONFIG_BLK_DEV_UMEM)	+= umem.o
 obj-$(CONFIG_BLK_DEV_NBD)	+= nbd.o
+obj-$(CONFIG_MAMBO_BD)		+= mambo_bd.o
 obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o
 
 obj-$(CONFIG_VIODASD)		+= viodasd.o
unchanged:
--- /dev/null
+++ linux-2.6.15-rc/drivers/block/mambo_bd.c
@@ -0,0 +1,252 @@
+/*
+ * Mambo Block Driver - expose block devices through mambo callthru
+ *
+ * copyright 2003 IBM
+ *
+ */
+
+#include <linux/major.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/fs.h>
+#include <linux/stat.h>
+#include <linux/errno.h>
+#include <linux/file.h>
+#include <linux/ioctl.h>
+#include <net/sock.h>
+
+#include <asm/mambo/callthru_config.h>
+
+#include <linux/devfs_fs_kernel.h>
+
+#include <asm/uaccess.h>
+#include <asm/types.h>
+
+#define MAJOR_NR 42
+#include <linux/mambobd.h>
+
+static struct mbd_device mbd_dev[MAX_MBD];
+
+#define BD_INFO_SYNC   0
+#define BD_INFO_STATUS 1
+#define BD_INFO_BLKSZ  2
+#define BD_INFO_DEVSZ  3
+#define BD_INFO_CHANGE 4
+
+static int
+mbd_init_disk (int devno)
+{
+  /* check disk configured */
+  if (!MamboBogusDiskInfo (BD_INFO_STATUS, devno))
+    {
+      printk (KERN_ERR
+	      "Attempting to open bogus disk before initializaiton\n");
+      return 0;
+    }
+
+  mbd_dev[devno].initialized++;
+#ifdef DEBUG
+  printk ("<1>Bogus Device %d Init\n", devno);
+#endif
+
+  return 1;
+}
+
+static void
+do_mbd_request (request_queue_t * q)
+{
+  int result = 0;
+  struct request *req;
+
+  while ((req = elv_next_request(q)) != NULL)
+    {
+      int minor = req->rq_disk->first_minor;
+
+#ifdef DEBUG
+      dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%lx)\n",
+      		req->rq_disk->disk_name, req, req->flags);
+#endif
+
+      switch (rq_data_dir (req))
+	{
+	case READ:
+	  result = MamboBogusDiskRead (minor,
+				       req->buffer, req->sector,
+				       req->current_nr_sectors);
+	  break;
+	case WRITE:
+	  result = MamboBogusDiskWrite (minor,
+					req->buffer, req->sector,
+					req->current_nr_sectors);
+	};
+
+      if (result)
+	end_request (req, 0);	/* failure */
+      else
+	end_request (req, 1);	/* success */
+    }
+}
+
+static int
+mbd_release (struct inode *inode, struct file *file)
+{
+  struct mbd_device *lo;
+  int dev;
+
+  if (!inode)
+    return -ENODEV;
+  dev = inode->i_bdev->bd_disk->first_minor;
+  if (dev >= MAX_MBD)
+    return -ENODEV;
+  if (MamboBogusDiskInfo (BD_INFO_SYNC, dev) < 0)
+    {
+      printk (KERN_ALERT "mbd_release: unable to sync\n");
+    }
+  lo = &mbd_dev[dev];
+  if (lo->refcnt <= 0)
+    printk (KERN_ALERT "mbd_release: refcount(%d) <= 0\n", lo->refcnt);
+  lo->refcnt--;
+  return 0;
+}
+
+#if 0
+static int
+mbd_check_change (struct gendisk *disk)
+{
+  int devno = disk->first_minor;
+
+  if (MamboBogusDiskInfo (BD_INFO_CHANGE, devno))
+    return 1;
+
+  return 0;
+}
+#endif
+
+static int
+mbd_revalidate (struct gendisk *disk)
+{
+  int devno = disk->first_minor;
+
+  mbd_init_disk (devno);
+
+  return 0;
+}
+
+static int
+mbd_open (struct inode *inode, struct file *file)
+{
+  int dev;
+
+  if (!inode)
+    return -EINVAL;
+  dev = inode->i_bdev->bd_disk->first_minor;
+  if (dev >= MAX_MBD)
+    return -ENODEV;
+
+  check_disk_change (inode->i_bdev);
+
+  if (!mbd_dev[dev].initialized)
+    if (!mbd_init_disk (dev))
+      return -ENODEV;
+
+  mbd_dev[dev].refcnt++;
+  return 0;
+}
+
+static struct block_device_operations mbd_fops = {
+owner:THIS_MODULE,
+open:mbd_open,
+release:mbd_release,
+  /* media_changed:      mbd_check_change, */
+revalidate_disk:mbd_revalidate,
+};
+
+static spinlock_t mbd_lock = SPIN_LOCK_UNLOCKED;
+
+static int __init
+mbd_init (void)
+{
+  int err;
+  int i;
+
+  if (!__onsim())
+	return 0;
+
+  err = -ENOMEM;
+  for (i = 0; i < MAX_MBD; i++)
+    {
+      struct gendisk *disk = alloc_disk (1);
+      if (!disk)
+	goto out;
+      mbd_dev[i].disk = disk;
+      /*
+       * The new linux 2.5 block layer implementation requires
+       * every gendisk to have its very own request_queue struct.
+       * These structs are big so we dynamically allocate them.
+       */
+      disk->queue = blk_init_queue (do_mbd_request, &mbd_lock);
+      if (!disk->queue)
+	{
+	  put_disk (disk);
+	  goto out;
+	}
+    }
+
+  if (register_blkdev (MAJOR_NR, "mbd"))
+    {
+      err = -EIO;
+      goto out;
+    }
+
+#ifdef MODULE
+  printk ("mambo bogus disk: registered device at major %d\n", MAJOR_NR);
+#else
+  printk ("mambo bogus disk: compiled in with kernel\n");
+#endif
+
+  devfs_mk_dir ("mambobd");
+  for (i = 0; i < MAX_MBD; i++)
+    {				/* load defaults */
+      struct gendisk *disk = mbd_dev[i].disk;
+      mbd_dev[i].initialized = 0;
+      mbd_dev[i].refcnt = 0;
+      mbd_dev[i].flags = 0;
+      disk->major = MAJOR_NR;
+      disk->first_minor = i;
+      disk->fops = &mbd_fops;
+      disk->private_data = &mbd_dev[i];
+      sprintf (disk->disk_name, "mambobd%d", i);
+      sprintf (disk->devfs_name, "mambobd%d", i);
+      set_capacity (disk, 0x3ffffe);
+      add_disk (disk);
+    }
+
+  return 0;
+out:
+  while (i--)
+    {
+      if (mbd_dev[i].disk->queue)
+	blk_cleanup_queue (mbd_dev[i].disk->queue);
+      put_disk (mbd_dev[i].disk);
+    }
+  return -EIO;
+}
+
+static void __exit
+mbd_cleanup (void)
+{
+  devfs_remove("mambobd");
+
+  if (unregister_blkdev (MAJOR_NR, "mbd") != 0)
+    printk ("mbd: cleanup_module failed\n");
+  else
+    printk ("mbd: module cleaned up.\n");
+}
+
+module_init (mbd_init);
+module_exit (mbd_cleanup);
+
+MODULE_DESCRIPTION ("Mambo Block Device");
+MODULE_LICENSE ("GPL");
unchanged:
--- /dev/null
+++ linux-2.6.15-rc/include/linux/mambobd.h
@@ -0,0 +1,38 @@
+/*
+ * 2001 Copyright (C) IBM
+ */
+
+#ifndef LINUX_MAMBOBD_H
+#define LINUX_MAMBOBD_H
+
+#ifdef MAJOR_NR
+
+#include <asm/semaphore.h>
+
+#ifdef _STIDC_LINUX_25
+#include <linux/blk.h>
+#else
+#include <linux/blkdev.h>
+#endif
+
+#ifdef PARANOIA
+extern int requests_in;
+extern int requests_out;
+#endif
+
+#define MAX_MBD 128
+
+#define MBD_SET_BLKSIZE _IO( 0xab, 1 )
+#define MBD_SET_SIZE    _IO( 0xab, 2 )
+#define MBD_SET_SIZE_BLOCKS     _IO( 0xab, 7 )
+#define MBD_DISCONNECT  _IO( 0xab, 8 )
+
+struct mbd_device {
+  int initialized;
+  int refcnt;
+  int flags;
+  struct gendisk * disk;
+};
+#endif
+
+#endif
unchanged:
--- linux-2.6.14/drivers/net/mambonet.c.orig	2005-11-16 01:29:06.000000000 +0000
+++ linux-2.6.14/drivers/net/mambonet.c	2005-11-16 00:53:28.000000000 +0000
@@ -0,0 +1,362 @@
+/*
+ * Mambonet Driver
+ *
+ * copyright 2003 IBM
+ * JimiX (jimix watson ibm com)
+ */
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/fs.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/socket.h>
+#include <linux/errno.h>
+#include <linux/fcntl.h>
+#include <linux/in.h>
+#include <linux/init.h>
+
+#include <asm/system.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#include <linux/inet.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <net/sock.h>
+#include <linux/if_ether.h>	/* For the statistics structure. */
+#include <linux/if_arp.h>	/* For ARPHRD_ETHER */
+#include <linux/workqueue.h>
+#include <asm/prom.h>
+#include <linux/version.h>
+#include <asm/mambo/callthru_config.h>
+
+static irqreturn_t 
+mambonet_interrupt(int irq, void *dev_instance,
+		   struct pt_regs * regs);
+
+#define INIT_BOTTOM_HALF(x,y,z) INIT_WORK(x, y, (void*)z)
+#define SCHEDULE_BOTTOM_HALF(x) schedule_delayed_work(x, 1)
+#define KILL_BOTTOM_HALF(x) cancel_delayed_work(x); flush_scheduled_work()
+
+#define MAMBO_MTU 1500
+
+struct netdev_private {
+	int             devno;
+	int             closing;
+	struct work_struct poll_task;
+	struct net_device_stats stats;
+};
+
+static int
+mambonet_probedev(int devno, void *buf)
+{
+	struct device_node *mambo;
+	struct device_node *net;
+	unsigned int   *reg;
+
+	mambo = find_path_device("/mambo");
+
+	if (mambo == NULL) {
+		return -1;
+	}
+	net = find_path_device("/mambo/bogus-net 0");
+	if (net == NULL) {
+		return -1;
+	}
+	reg = (unsigned int *) get_property(net, "reg", 0);
+
+	if (*reg != devno) {
+		return -1;
+	}
+
+	return MamboBogusNetProbe( devno, buf );
+}
+
+static int
+mambonet_send(int devno, void *buf, ulong size)
+{
+	return MamboBogusNetSend(devno, buf, size);
+}
+
+static int
+mambonet_recv(int devno, void *buf, ulong size)
+{
+	return MamboBogusNetRecv(devno, buf, size);
+}
+
+static int
+mambonet_start_xmit(struct sk_buff * skb, struct net_device * dev)
+{
+	struct netdev_private *priv = (struct netdev_private
+				       *) dev->priv;
+	int             devno = priv->devno;
+
+	skb->dev = dev;
+
+	/* we might need to checksum or something */
+	mambonet_send(devno, skb->data, skb->len);
+
+	dev->last_rx = jiffies;
+	priv->stats.rx_bytes += skb->len;
+	priv->stats.tx_bytes += skb->len;
+	priv->stats.rx_packets++;
+	priv->stats.tx_packets++;
+
+	dev_kfree_skb(skb);
+
+	return (0);
+}
+
+static int
+mambonet_poll(struct net_device * dev, int *budget)
+{
+	struct netdev_private *np = dev->priv;
+	int             devno = np->devno;
+	char            buffer[1600];
+	int             ns;
+	struct sk_buff *skb;
+	int             frames = 0;
+	int             max_frames = min(*budget, dev->quota);
+	int             ret = 0;
+
+	while ((ns = mambonet_recv(devno, buffer, 1600)) > 0) {
+		if ((skb = dev_alloc_skb(ns + 2)) != NULL) {
+			skb->dev = dev;
+			skb_reserve(skb, 2);	/* 16 byte align the IP
+						 * header */
+#if HAS_IP_COPYSUM
+			eth_copy_and_sum(skb,
+					 buffer, ns, 0);
+			skb_put(skb, ns);
+#else
+			memcpy(skb_put(skb, ns),
+			       buffer, ns);
+#endif
+			skb->protocol =
+				eth_type_trans(skb, dev);
+
+			if(dev->irq) 
+				netif_receive_skb(skb);
+			else
+				netif_rx(skb);
+
+			dev->last_rx = jiffies;
+			np->stats.rx_packets++;
+			np->stats.rx_bytes += ns;
+		} else {
+			printk("Failed to allocated skbuff, "
+			       "dropping packet\n");
+			np->stats.rx_dropped++;
+			/* wait for another cycle */
+			return 1;
+		}
+		++frames;
+		if (frames > max_frames) {
+			ret = 1;
+			break;
+		}
+	}
+	*budget -= frames;
+	dev->quota -= frames;
+
+	if((!ret)&&(dev->irq))
+	  netif_rx_complete(dev);
+
+	return ret;
+}
+
+static void
+mambonet_timer(struct net_device * dev)
+{
+	int             budget = 16;
+	struct netdev_private *priv = 
+				(struct netdev_private*) dev->priv;
+				       
+	mambonet_poll(dev, &budget);
+
+	if (!priv->closing) {
+		SCHEDULE_BOTTOM_HALF(&priv->poll_task);
+	}
+}
+
+static struct net_device_stats *
+get_stats(struct net_device * dev)
+{
+	struct netdev_private *priv = 
+				(struct netdev_private *) dev->priv;
+	return (struct net_device_stats *) & (priv->stats);
+}
+
+static irqreturn_t
+mambonet_interrupt(int irq, void *dev_instance, struct pt_regs * regs)
+{
+	struct net_device *dev = dev_instance;
+	if (netif_rx_schedule_prep(dev)) {
+		__netif_rx_schedule(dev);
+	}
+	return IRQ_HANDLED;
+}
+
+static int
+mambonet_open(struct net_device * dev)
+{
+	struct netdev_private *priv;
+	int             ret = 0;
+
+	priv = dev->priv;
+
+	/*
+	 * we can't start polling in mambonet_init, because I don't think
+	 * workqueues are usable that early. so start polling now.
+	 */
+
+	if(dev->irq) {
+		ret = request_irq(dev->irq, &mambonet_interrupt, 0,
+				  dev->name, dev);
+
+		if (ret == 0) {
+			netif_start_queue(dev);
+		} else {
+			printk(KERN_ERR "mambonet: request irq failed\n");
+		}
+
+		MamboBogusNetProbe( priv->devno, NULL ); /* probe with NULL to activate interrupts */
+	} else {
+		mambonet_timer(dev);
+	}
+
+	return ret;
+}
+
+static int
+mambonet_close(struct net_device * dev)
+{
+	struct netdev_private *priv;
+
+	netif_stop_queue(dev);
+	
+	if(dev->irq)
+		free_irq(dev->irq, dev);
+
+	priv = dev->priv;
+	priv->closing = 1;
+	if(dev->irq==0) {
+		KILL_BOTTOM_HALF(&priv->poll_task);
+	}
+
+	kfree(priv);
+
+	return 0;
+}
+
+static struct net_device_stats mambonet_stats;
+
+static struct net_device_stats *
+mambonet_get_stats(struct net_device * dev)
+{
+	return &mambonet_stats;
+}
+
+static int
+mambonet_set_mac_address(struct net_device * dev, void *p)
+{
+	return -EOPNOTSUPP;
+}
+static int
+mambonet_ioctl(struct net_device * dev, struct ifreq * ifr, int cmd)
+{
+	return -EOPNOTSUPP;
+}
+static int      nextdevno = 0;	/* running count of device numbers */
+
+/* Initialize the rest of the device. */
+int             __init
+do_mambonet_probe(struct net_device * dev)
+{
+	struct netdev_private *priv;
+	int             devno = nextdevno++;
+	int             irq;
+
+	printk("eth%d: bogus network driver initialization\n", devno);
+
+	irq = mambonet_probedev(devno, dev->dev_addr);
+
+	if (irq < 0) {
+		printk("No IRQ retreived\n");
+		return (-ENODEV);
+	}
+
+	printk("%s: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", dev->name,
+	       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
+	       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+
+	SET_MODULE_OWNER(dev);
+
+	dev->irq = irq;
+	dev->mtu = MAMBO_MTU;
+	dev->open = mambonet_open;
+	dev->poll = mambonet_poll;
+	dev->weight = 16;
+	dev->stop = mambonet_close;
+	dev->hard_start_xmit = mambonet_start_xmit;
+	dev->get_stats = mambonet_get_stats;
+	dev->set_mac_address = mambonet_set_mac_address;
+	dev->do_ioctl = mambonet_ioctl;
+
+	dev->priv = kmalloc(sizeof(struct netdev_private), GFP_KERNEL);
+	if (dev->priv == NULL)
+		return -ENOMEM;
+	memset(dev->priv, 0, sizeof(struct netdev_private));
+
+	priv = dev->priv;
+	priv->devno = devno;
+	priv->closing = 0;
+	dev->get_stats = get_stats;
+
+	if(dev->irq==0) {
+		INIT_BOTTOM_HALF(&priv->poll_task, (void *) mambonet_timer, 
+						(void*) dev);
+	}		     
+
+	return (0);
+};
+
+struct net_device * __init
+mambonet_probe(int unit)
+{
+	struct net_device *dev = alloc_etherdev(0);
+	int err;
+
+	if (!dev)
+		return ERR_PTR(-ENODEV);
+
+	sprintf(dev->name, "eth%d", unit);
+	netdev_boot_setup_check(dev);
+
+	err = do_mambonet_probe(dev);
+
+	if (err)
+		goto out;
+	
+	err = register_netdev(dev);
+	if (err)
+		goto out;
+
+	return dev;
+
+out:
+	free_netdev(dev);
+	return ERR_PTR(err);
+}
+
+int __init init_mambonet(void)
+{
+        mambonet_probe(0);
+        return 0;
+}
+
+module_init(init_mambonet);
+MODULE_LICENSE("GPL");
unchanged:
--- linux-2.6.14/drivers/net/Makefile.orig	2005-11-16 01:29:02.000000000 +0000
+++ linux-2.6.14/drivers/net/Makefile	2005-11-16 01:31:33.000000000 +0000
@@ -207,4 +207,4 @@ obj-$(CONFIG_NETCONSOLE) += netconsole.o
 obj-$(CONFIG_NETDUMP) += netdump.o
 
 obj-$(CONFIG_FS_ENET) += fs_enet/
-
+obj-$(CONFIG_MAMBO_NET) += mambonet.o
unchanged:
--- linux-2.6.14-rc.orig/drivers/char/Makefile	2005-10-22 01:17:30.000000000 +0200
+++ linux-2.6.14-rc/drivers/char/Makefile	2005-10-22 01:18:12.000000000 +0200
@@ -41,5 +41,6 @@
 obj-$(CONFIG_SX)		+= sx.o generic_serial.o
 obj-$(CONFIG_RIO)		+= rio/ generic_serial.o
+obj-$(CONFIG_BOGUS_CONSOLE)	+=bogus_console.o
 obj-$(CONFIG_HVC_CONSOLE)	+= hvc_console.o hvc_vio.o hvsi.o
 obj-$(CONFIG_RAW_DRIVER)	+= raw.o
 obj-$(CONFIG_SGI_SNSC)		+= snsc.o snsc_event.o
unchanged:
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.14-rc/drivers/char/bogus_console.c	2005-10-22 01:18:12.000000000 +0200
@@ -0,0 +1,315 @@
+/*
+ * Bogus console driver using IBM Full System Simulator
+ *
+ * (C) Copyright IBM Corporation 2001-2005
+ *
+ * Bogus Console Driver
+ *
+ * Author: Maximino Aguilar <IBM STI Design Center>
+ *
+ *    inspired by drivers/char/hvc_console.c
+ *    written by Anton Blanchard and Paul Mackerras
+ *
+ * Some code is from the IBM Full System Simulator Group in ARL.
+ * Author: Patrick Bohrer <IBM Austin Research Lab>
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/errno.h>
+#include <linux/kdev_t.h>
+#include <linux/string.h>
+#include <linux/console.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/tty.h>
+#include <linux/types.h>
+#include <linux/vt_kern.h>
+#include <linux/tty_flip.h>
+
+#define bog_console_major			240
+#define bog_console_minor			0
+#define BOG_TTY_BUF_SIZE			512
+
+static inline int callthru0(int command)
+{
+	register int c asm ("r3") = command;
+
+	asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c));
+	return((c));
+}
+
+static inline int callthru3(int command, unsigned long arg1, unsigned long arg2, unsigned long arg3)
+{
+	register int c asm ("r3") = command;
+	register unsigned long a1 asm ("r4") = arg1;
+	register unsigned long a2 asm ("r5") = arg2;
+	register unsigned long a3 asm ("r6") = arg3;
+
+	asm volatile (".long 0x000EAEB0" : "=r" (c): "r" (c), "r" (a1), "r" (a2), "r" (a3));
+	return((c));
+}
+
+static inline int WriteConsole(char *string)
+{
+	return(callthru3(0, (unsigned long)string,
+		(unsigned long)strlen(string), (unsigned long)1));
+}
+
+static inline int ReadConsole(void)
+{
+	return(callthru0(60));
+}
+
+typedef struct {
+	struct tty_struct *tty;
+	unsigned char buf[BOG_TTY_BUF_SIZE];
+	unsigned short int buf_count;
+	spinlock_t lock;
+} bog_tty_data_struct;
+
+static bog_tty_data_struct bog_tty_data = {  };
+
+static struct tty_driver bog_tty_driver;
+static struct termios *bog_tty_termios[1];
+static struct termios *bog_tty_termios_locked[1];
+static int bog_tty_refcount = 0;
+
+static int
+bog_tty_open (struct tty_struct *tty, struct file *filp)
+{
+	if (tty->index != 0)
+		return -ENODEV;
+
+	tty->driver_data = &bog_tty_data;
+	bog_tty_data.buf_count = 0;
+	bog_tty_data.tty = tty;
+	tty->low_latency = 0;
+	bog_tty_data.buf[0]=0;
+	return 0;
+}
+
+static void
+bog_tty_close (struct tty_struct *tty, struct file *filp)
+{
+	if (tty->count > 1)
+		return;
+	bog_tty_data.tty = NULL;
+}
+
+static int
+bog_tty_write (struct tty_struct *tty, const unsigned char *buf, int count)
+{
+	return 0;
+}
+
+static int
+bog_tty_write_room (struct tty_struct *tty)
+{
+	return BOG_TTY_BUF_SIZE;
+}
+
+static void
+bog_tty_put_char (struct tty_struct *tty, unsigned char ch)
+{
+	char buff[BOG_TTY_BUF_SIZE];
+	int i;
+
+	if (bog_tty_data.buf_count >= BOG_TTY_BUF_SIZE) {
+		for (i=0;i<bog_tty_data.buf_count+1;i++)
+			buff[i]=0;
+		strncpy(buff,bog_tty_data.buf,bog_tty_data.buf_count);
+		WriteConsole(buff);
+		bog_tty_data.buf_count = 0;
+	}
+	bog_tty_data.buf[bog_tty_data.buf_count] = ch;
+	bog_tty_data.buf_count++;
+	bog_tty_data.buf[bog_tty_data.buf_count] = 0;
+}
+
+static void
+bog_tty_flush_chars (struct tty_struct *tty)
+{
+	int i;
+	char buff[BOG_TTY_BUF_SIZE];
+
+	for (i=0;i<bog_tty_data.buf_count+1;i++)
+		buff[i]=0;
+	strncpy(buff,bog_tty_data.buf,bog_tty_data.buf_count);
+	WriteConsole(buff);
+	bog_tty_data.buf_count = 0;
+}
+
+static int
+bog_tty_chars_in_buffer (struct tty_struct *tty)
+{
+	return 0;
+}
+
+static void
+bog_tty_flush_buffer (struct tty_struct *tty)
+{
+}
+
+int
+bog_tty_input (unsigned char *buf)
+{
+	struct tty_struct *tty = bog_tty_data.tty;
+	int c;
+	int bp=0;
+	int count=0;
+
+	if (tty != NULL)
+	{
+		for (;;) {
+			if (( c = ReadConsole() ) != -1) {
+				buf[bp++]=c;
+				buf[bp]='\0';
+				count++;
+			}
+			else
+				break;
+			if (count == BOG_TTY_BUF_SIZE)
+				break;
+		}
+	}
+	return count;
+}
+
+static void bog_poll(void) {
+	struct tty_struct *tty;
+	char buff[BOG_TTY_BUF_SIZE];
+	int count=0;
+	int i,rc;
+	unsigned char *charptr, *flagptr;
+
+	tty=bog_tty_data.tty;
+	if (!tty)
+		return ;
+	charptr=tty->flip.char_buf_ptr;
+	flagptr=tty->flip.flag_buf_ptr;
+	rc=tty->flip.count;
+
+	count=bog_tty_input(buff);
+	if (count!=0)
+	{
+		for (i=0;i<count;i++)
+			tty_insert_flip_char(tty,buff[i],0);
+		tty_schedule_flip(tty);
+	}
+	count=0;
+}
+
+int kbogconsd (void) {
+	daemonize("kbogconsd");
+	strcpy(current->comm,"kbogconsd");
+	sigfillset(&current->blocked);
+
+	for (;;) {
+		bog_poll();
+		set_current_state(TASK_INTERRUPTIBLE);
+		/* We schedule often to allow for a better typing experience */
+		schedule_timeout(1);
+	}
+}
+
+static struct tty_operations con_ops = {
+	.open = bog_tty_open,
+	.close = bog_tty_close,
+	.write = bog_tty_write,
+	.write_room = bog_tty_write_room,
+	.put_char = bog_tty_put_char,
+	.flush_chars = bog_tty_flush_chars,
+	.chars_in_buffer = bog_tty_chars_in_buffer,
+	.flush_buffer = bog_tty_flush_buffer,
+};
+
+int __init bog_tty_init (void)
+{
+	bog_tty_driver.magic = TTY_DRIVER_MAGIC;
+	bog_tty_driver.driver_name = "bogus";
+	bog_tty_driver.name = "bogus";
+	bog_tty_driver.name_base = 0;
+	bog_tty_driver.major = bog_console_major;
+	bog_tty_driver.minor_start = bog_console_minor;
+	bog_tty_driver.num = 1;
+	bog_tty_driver.type = TTY_DRIVER_TYPE_SYSTEM;
+	bog_tty_driver.subtype = SYSTEM_TYPE_TTY;
+	bog_tty_driver.init_termios = tty_std_termios;
+	bog_tty_driver.init_termios.c_iflag = IGNBRK | IGNPAR;
+	bog_tty_driver.init_termios.c_oflag = ONLCR;
+	bog_tty_driver.init_termios.c_lflag = ISIG | ECHO;
+	bog_tty_driver.flags = TTY_DRIVER_REAL_RAW;
+	bog_tty_driver.refcount = bog_tty_refcount;
+	bog_tty_driver.termios = bog_tty_termios;
+	bog_tty_driver.termios_locked = bog_tty_termios_locked;
+
+	tty_set_operations(&bog_tty_driver, &con_ops);
+
+	if (tty_register_driver(&bog_tty_driver))
+		printk(KERN_ERR "Couldn't register bog_tty driver\n");
+
+	kernel_thread((void *)kbogconsd, NULL, CLONE_KERNEL);
+	return 0;
+}
+
+static int __init bog_console_setup(struct console *co, char *options)
+{
+	return 0;
+}
+
+static void __exit bog_exit(void)
+{
+}
+
+void
+bog_console_write(struct console *console, const char *message, unsigned count)
+{
+	char buff[count+1];
+	int i;
+
+	for (i=0;i<count+1;i++)
+		buff[i]=0;
+	strncpy(buff,message,count);
+	WriteConsole(buff);
+}
+
+static struct tty_driver *bog_console_device (struct console * c, int *index)
+{
+	*index = c->index;
+	return &bog_tty_driver;
+}
+
+struct console bog_console = {
+	.name		= "bogus",
+	.write		= bog_console_write,
+	.device		= bog_console_device,
+	.setup		= bog_console_setup,
+	.flags		= CON_PRINTBUFFER,
+	.index		= -1,
+};
+
+static int __init bog_console_init (void)
+{
+	register_console(&bog_console);
+	return 0;
+}
+
+console_initcall(bog_console_init);
+module_init(bog_tty_init);
+module_exit(bog_exit);
unchanged:
--- linux-2.6.14-rc.orig/drivers/char/Kconfig	2005-10-22 01:17:30.000000000 +0200
+++ linux-2.6.14-rc/drivers/char/Kconfig	2005-10-22 01:18:12.000000000 +0200
@@ -566,6 +566,12 @@
         help
           RTAS console support.
 
+config BOGUS_CONSOLE
+	bool "Simulator bogus console support"
+	depends on PPC_PSERIES || PPC_CELL
+	help
+	  IBM System Simulator bogus console device driver.
+
 config HVCS
 	tristate "IBM Hypervisor Virtual Console Server support"
 	depends on PPC_PSERIES
only in patch2:
unchanged:
--- linux-2.6.15-rc.orig/arch/powerpc/kernel/prom_init.c
+++ linux-2.6.15-rc/arch/powerpc/kernel/prom_init.c
@@ -1426,6 +1426,8 @@ static int __init prom_find_machine_type
 #ifdef CONFIG_PPC64
 			if (strstr(p, RELOC("Momentum,Maple")))
 				return PLATFORM_MAPLE;
+			if (strstr(p, RELOC("IBM,CPB")))
+				return PLATFORM_CELL;
 #endif
 			i += sl + 1;
 		}


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1682
retrieving revision 1.1683
diff -u -r1.1682 -r1.1683
--- kernel-2.6.spec	16 Nov 2005 05:13:37 -0000	1.1682
+++ kernel-2.6.spec	16 Nov 2005 10:39:01 -0000	1.1683
@@ -222,6 +222,7 @@
 Patch303: linux-2.6.15-rc1-ppc-vdso-2.patch
 Patch304: linux-2.6.15-rc1-ppc64-syscallpath.patch
 Patch305: linux-2.6.15-rc1-ppc64-pci.patch
+Patch306: linux-2.6.15-ppc-cell-basics.patch
 
 # 400 - 499   ia64
 # 500 - 599   s390(x)
@@ -602,6 +603,7 @@
 %patch303 -p1
 %patch304 -p1
 %patch305 -p1
+%patch306 -p1 
 
 #
 # Xen
@@ -1299,6 +1301,11 @@
 %endif
 
 %changelog
+* Wed Nov 16 2005 David Woodhouse <dwmw2 redhat com>
+- Support PPC64 kernel running in IBM Cell Broadband Engine simulator
+  (http://www.alphaworks.ibm.com/tech/cellsystemsim)
+- Update serial-of patch
+
 * Wed Nov 16 2005 Dave Jones <davej redhat com>
 - Unbreak config generation. HIGHMEM64G works again.
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]