aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@strongmad.(none)>2007-01-17 19:40:39 -0600
committerEric Van Hensbergen <ericvh@strongmad.(none)>2007-01-17 19:40:39 -0600
commit4350048b23b3ba807fe674769b8ddafe18eda07f (patch)
tree338cb69304bf6ccebe209b89d540c2f6509952b1
parent7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (diff)
downloadsystemsim-2.6.16.tar.gz
Systemsim Full Systems Simulator patchsystemsim-2.6.16GPUL_AlphaWorks_2_0_0
Signed-off-by: Eric Van Hensbergen <bergevan@us.ibm.com>
-rw-r--r--Documentation/systemsim/maple.tcl95
-rw-r--r--Documentation/systemsim/systemsim.txt92
-rw-r--r--arch/powerpc/Kconfig28
-rw-r--r--arch/powerpc/configs/systemsim_defconfig1127
-rw-r--r--arch/powerpc/kernel/Makefile1
-rw-r--r--arch/powerpc/kernel/idle_systemsim.c35
-rw-r--r--arch/powerpc/kernel/setup_64.c19
-rw-r--r--arch/powerpc/kernel/udbg.c3
-rw-r--r--arch/powerpc/platforms/pseries/hvconsole.c5
-rw-r--r--arch/powerpc/platforms/pseries/setup.c8
-rw-r--r--drivers/block/Kconfig7
-rw-r--r--drivers/block/Makefile2
-rw-r--r--drivers/block/systemsim_bd.c308
-rw-r--r--drivers/char/Kconfig32
-rw-r--r--drivers/char/Makefile7
-rw-r--r--drivers/char/hvc_console.c78
-rw-r--r--drivers/char/hvc_console.h63
-rw-r--r--drivers/char/hvc_fss.c124
-rw-r--r--drivers/char/hvc_rtas.c138
-rw-r--r--drivers/char/hvc_vio.c11
-rw-r--r--drivers/net/Kconfig8
-rw-r--r--drivers/net/Makefile1
-rw-r--r--drivers/net/systemsim_net.c393
-rw-r--r--include/asm-powerpc/hvconsole.h17
-rw-r--r--include/asm-powerpc/machdep.h1
-rw-r--r--include/asm-powerpc/systemsim.h132
-rw-r--r--include/asm-powerpc/udbg.h1
27 files changed, 2677 insertions, 59 deletions
diff --git a/Documentation/systemsim/maple.tcl b/Documentation/systemsim/maple.tcl
new file mode 100644
index 00000000000000..5041d78fcb7aa8
--- /dev/null
+++ b/Documentation/systemsim/maple.tcl
@@ -0,0 +1,95 @@
+puts "To debug mambo with gdb: attach [pid]"
+#gets stdin
+#simdebug set UART 1
+
+# get the general procedures defined for mambo
+source $env(LIB_DIR)/ppc/util.tcl
+
+
+#
+# First create a simulator called mysim
+#
+define dup gpul myconf
+myconf config cpus 1
+myconf config memory_size 128M
+
+# we prefer a maple right now
+myconf config pic/start 0xf8040000
+myconf config pic/end 0xf807ffff
+myconf config pic/little_endian 0
+
+set isa_base 0xf4000000
+
+myconf config rtc/start [add64 $isa_base 0x900]
+myconf config rtc/end [add64 $isa_base 0x90f]
+myconf config uart0 on
+myconf config uart0/start [add64 $isa_base 0x3f8]
+myconf config uart0/end [add64 $isa_base 0x3ff]
+myconf config uart1/start [add64 $isa_base 0x2f8]
+myconf config uart1/end [add64 $isa_base 0x2ff]
+
+define machine myconf mysim
+
+set root [ mysim of find_device / ]
+
+set ht [ mysim of addchild $root ht 0 ]
+set range [list 0x0 0x0 ]
+mysim of addprop $ht array "bus-range" range
+set ranges [list 0x81000000 0x00000000 0x00000000 0x00000000 0xf4000000 0x00000000 0x00400000 0x82000000 0x00000000 0x80000000 0x00000000 0x80000000 0x00000000 0x70000000 ]
+mysim of addprop $ht array "ranges" ranges
+set reg [list 0x0 0xf2000000 0x03000000 ]
+mysim of addprop $ht array "reg" reg
+mysim of addprop $ht string "compatible" "u3-ht"
+mysim of addprop $ht int "#size-cells" 2
+mysim of addprop $ht int "#address-cells" 3
+mysim of addprop $ht string "device_type" "ht"
+mysim of addprop $ht string "name" "ht"
+
+set isa [ mysim of addchild $ht isa 4 ]
+mysim of addprop $isa string "name" "isa"
+mysim of addprop $isa string "device_type" "isa"
+set reg [list 0x2000 0x0 0x0 0x0 0x0]
+mysim of addprop $isa array "reg" reg
+set ranges [list 0x1 $isa_base 0x10000 ]
+mysim of addprop $isa array "ranges" ranges
+
+set rtc [ mysim of addchild $isa rtc 0x900 ]
+mysim of addprop $rtc string "compatible" "pnpPNP,B00"
+mysim of addprop $rtc string "name" "rtc"
+mysim of addprop $rtc string "device_type" "rtc"
+set reg [list 0x1 0x900 0x1 0x1 0x901 0x1]
+mysim of addprop $rtc array "reg" reg
+
+set uart1 [ mysim of addchild $isa serial 0x3f8 ]
+set reg [ list 0x1 0x3f8 0x8 ]
+mysim of addprop $uart1 array "reg" reg
+mysim of addprop $uart1 string "device_type" "serial"
+mysim of package_to_path $uart1
+
+if { [ info exists GUI_HOOK ] } then { eval $GUI_HOOK }
+
+#
+# Now load the boot image
+#
+
+mysim bogus disk init 0 rootdisk.img newcow simple.cow 1024
+mysim bogus net init 0 de:ad:ca:fe:ba:be /tmp/serversocketh0 0 0
+mysim load vmlinux vmlinux 0
+
+mysim modify loose on
+
+set usertcl /dev/null
+if { [ file exists ./user.tcl ] } {
+ set usertcl ./user.tcl
+}
+source $usertcl
+
+set of_root [mysim of find_device /]
+mysim of setprop $of_root compatible "Momentum,Maple"
+set of_chosen [mysim of find_device /chosen]
+mysim of setprop $of_chosen bootargs "rw root=/dev/mambobd0 console=bogus0"
+simdebug set PCI 1
+set dart [ mysim of addchild $root dart 0 ]
+mysim of addprop $dart string "device_type" "dart"
+mysim of addprop $dart string "compatible" "u3-dart"
+mysim go
diff --git a/Documentation/systemsim/systemsim.txt b/Documentation/systemsim/systemsim.txt
new file mode 100644
index 00000000000000..204c5150c5d96b
--- /dev/null
+++ b/Documentation/systemsim/systemsim.txt
@@ -0,0 +1,92 @@
+ SystemSim: PowerPC Full-System Simulator
+
+Introduction
+============
+
+What is the IBM Full-System Simulator for IBM PowerPC 970?
+----------------------------------------------------------
+
+The IBM Full-System Simulator has been developed and refined in conjunction
+with several large-system design projects built upon the IBM Power Architecture.
+As an execution-driven, full-system simulator, the IBM Full-System Simulator has
+facilitated the experimentation and evaluation of a wide variety of system
+components for core IBM initiatives, such as the STI Cell and the IBM PERCS
+projects. The IBM Full-System Simulator for PowerPC 970 enables development
+teams both within and outside IBM to simulate a PowerPC 970 system in order to
+develop and enhance application support for this platform.
+
+This technology runs on AIX®, Linux®, and Mac OS X (see the requirements
+section on the website for details).
+
+How does it work?
+-----------------
+
+Written in C, a significant part of the Full-System Simulator's simulation
+capability is directly attributed to its TSIM component. Developed as a
+robust, high-performance alternative to conventional process and thread
+programming, TSIM is a light-weight, multi-tasking scheduling framework that
+provides a complete set of facilities for creating and scheduling threads,
+manipulating time delays, and applying a variety of inter-thread communication
+policies and mechanisms to simulation events.
+
+In TSIM's multi-threaded approach, individually-schedulable threads are created
+to simulate a component or collection of components. If a thread must defer
+processing, it requests to be blocked and continues execution when awakened. Any
+local (stack) state is preserved in order to mitigate the necessity for
+allocating areas for saving and restoring this state. TSIM threads are
+non-preemptive; they block only on well-defined events. TSIM simplifies access
+to shared data that must otherwise be serialized in order to guarantee correct
+behavior. Each thread has an associated priority. Scheduling and resource
+allocations are all "first-come, first-served" (FCFS) within priority. TSIM also
+includes software components useful for modeling common hardware components
+such as gates, latches, and ports.
+
+This low-level simulation infrastructure is complemented with a host of
+additional features, such as integrated development and debugging tools,
+support for stand-alone and operating system boot, data collection and
+analysis frameworks, performance visualization, and tracing and logging
+capabilities that enable developers to realistically represent an entire
+system of equipment, devices, or subsystems and simulate not only the
+instructions executed by the processor core, but also its interactions with
+its surrounding system components. Additionally, the Full-System Simulator is
+capable of booting K42, IBM's research operating system, and rHype, the
+research hypervisor.
+
+About the technology author(s):
+-------------------------------
+
+The IBM Full-System Simulator has been developed by the Future Systems group at
+the IBM Austin Research Lab (ARL). Consisting of the Performance and Tools team,
+Novel Systems Architecture team, and Power-Aware Systems team, Future Systems
+focuses on software system issues, including system-level power analysis, system
+performance, and low-level system software issues. The researchers bring a wide
+variety of expertise and extensive experience in numerous software and hardware
+technologies to the team, including computer architecture, performance analysis,
+operating systems, power management, and algorithms.
+
+Where can I get it?
+-------------------
+
+The IBM PowerPC Full-System Simulator is available from the IBM Alphaworks
+website: http://www.alphaworks.ibm.com/tech/systemsim970
+
+Compiling & Booting Linux for SystemSim
+=======================================
+
+When compiling Linux to run on SystemSim you should use the configuration
+file in arch/ppc64/configs/systemsim_defconfig as a base.
+
+When booting the resulting image in SystemSim use the maple.tcl file in
+this directory (Documentation/systemsim/maple.tcl) as a base. You will
+likely need to change the name of the root disk image and perhaps the path
+to the vmlinux file. This standard profile will be included with the
+SystemSim tool in the near future (at which point we will hopefully update
+this document.
+
+For further information on using Linux with SystemSim, please reference the
+SystemSim documentation, and the FAQ and/or Forums on the Alphaworks site.
+
+
+
+
+
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index dfba81719dec06..2427611c5f9e18 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -364,6 +364,34 @@ config PPC_CELL
select MMIO_NVRAM
select PPC_UDBG_16550
+config PPC_SYSTEMSIM
+ bool " IBM Full System Simulator (systemsim) support"
+ depends on PPC_CELL || PPC_PSERIES || PPC_MAPLE
+ help
+ Support booting resulting image under IBMs Full System Simulator.
+ If you enable this option, you are able to select device
+ drivers (e.g. network and disk) for purely simulated devices
+ that are provided by systemsim.
+ The Full system simulator is available for download from
+ http://www.alphaworks.ibm.com/tech/.
+
+config SYSTEMSIM_IDLE
+ bool " Optimized idle loop for systemsim"
+ depends on PPC_SYSTEMSIM
+ help
+ Selecting this option will enable an more optimized idle loop
+ for running on the IBM Full System Simulator that
+ significantly reduces the load on the host system when
+ simulating an idle system.
+
+config SYSTEMSIM_BOOT
+ bool " Boot hacks for non-standard hardware under systemsim"
+ depends on PPC_SYSTEMSIM
+ help
+ Selecting this option will enable boot hacks during setup
+ to facilitate Linux boots on non-standard hardware under the
+ IBM Full System Simulator.
+
config XICS
depends on PPC_PSERIES
bool
diff --git a/arch/powerpc/configs/systemsim_defconfig b/arch/powerpc/configs/systemsim_defconfig
new file mode 100644
index 00000000000000..5c1aee0c1d1cd4
--- /dev/null
+++ b/arch/powerpc/configs/systemsim_defconfig
@@ -0,0 +1,1127 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.16
+# Mon Mar 20 18:41:01 2006
+#
+CONFIG_PPC64=y
+CONFIG_64BIT=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_COMPAT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+CONFIG_GENERIC_TBSYNC=y
+# CONFIG_DEFAULT_UIMAGE is not set
+
+#
+# Processor support
+#
+# CONFIG_POWER4_ONLY is not set
+CONFIG_POWER3=y
+CONFIG_POWER4=y
+CONFIG_PPC_FPU=y
+CONFIG_ALTIVEC=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=32
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION="-systemsim"
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+# CONFIG_CPUSETS is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODULE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# Platform support
+#
+CONFIG_PPC_MULTIPLATFORM=y
+# CONFIG_PPC_ISERIES is not set
+# CONFIG_EMBEDDED6xx is not set
+# CONFIG_APUS is not set
+CONFIG_PPC_PSERIES=y
+# CONFIG_PPC_PMAC is not set
+CONFIG_PPC_MAPLE=y
+# CONFIG_PPC_CELL is not set
+CONFIG_PPC_SYSTEMSIM=y
+CONFIG_SYSTEMSIM_IDLE=y
+# CONFIG_SYSTEMSIM_BOOT is not set
+CONFIG_XICS=y
+CONFIG_U3_DART=y
+CONFIG_MPIC=y
+CONFIG_PPC_RTAS=y
+CONFIG_RTAS_ERROR_LOGGING=y
+CONFIG_RTAS_PROC=y
+# CONFIG_RTAS_FLASH is not set
+# CONFIG_MMIO_NVRAM is not set
+CONFIG_MPIC_BROKEN_U3=y
+CONFIG_IBMVIO=y
+# CONFIG_IBMEBUS is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Kernel options
+#
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT_BKL=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_FORCE_MAX_ZONEORDER=13
+# CONFIG_IOMMU_VMERGE is not set
+# CONFIG_HOTPLUG_CPU is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_IRQ_ALL_CPUS is not set
+# CONFIG_PPC_SPLPAR is not set
+CONFIG_EEH=y
+# CONFIG_SCANLOG is not set
+# CONFIG_LPARCFG is not set
+CONFIG_NUMA=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_SELECT_MEMORY_MODEL=y
+# CONFIG_FLATMEM_MANUAL is not set
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_NEED_MULTIPLE_NODES=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_EXTREME=y
+# CONFIG_MEMORY_HOTPLUG is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_MIGRATION=y
+CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
+# CONFIG_PPC_64K_PAGES is not set
+# CONFIG_SCHED_SMT is not set
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PPC_I8259=y
+# CONFIG_PPC_INDIRECT_PCI is not set
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_LEGACY_PROC is not set
+# CONFIG_PCI_DEBUG is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+CONFIG_KERNEL_START=0xc000000000000000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+
+#
+# IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=16
+
+#
+# IPVS transport protocol load balancing support
+#
+# CONFIG_IP_VS_PROTO_TCP is not set
+# CONFIG_IP_VS_PROTO_UDP is not set
+# CONFIG_IP_VS_PROTO_ESP is not set
+# CONFIG_IP_VS_PROTO_AH is not set
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+# CONFIG_IP_VS_SED is not set
+# CONFIG_IP_VS_NQ is not set
+
+#
+# IPVS application helper
+#
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+# CONFIG_NETFILTER_NETLINK is not set
+# CONFIG_NETFILTER_XTABLES is not set
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+# CONFIG_IP_NF_CT_ACCT is not set
+# CONFIG_IP_NF_CONNTRACK_MARK is not set
+# CONFIG_IP_NF_CONNTRACK_EVENTS is not set
+# CONFIG_IP_NF_CT_PROTO_SCTP is not set
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+# CONFIG_IP_NF_NETBIOS_NS is not set
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+# CONFIG_IP_NF_PPTP is not set
+CONFIG_IP_NF_QUEUE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP6_NF_QUEUE is not set
+
+#
+# DECnet: Netfilter Configuration
+#
+# CONFIG_DECNET_NF_GRABULATOR is not set
+
+#
+# Bridge: Netfilter Configuration
+#
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+CONFIG_ATM=y
+CONFIG_ATM_CLIP=y
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+CONFIG_ATM_BR2684_IPFILTER=y
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+CONFIG_DECNET=m
+CONFIG_DECNET_ROUTER=y
+CONFIG_DECNET_ROUTE_FWMARK=y
+CONFIG_LLC=m
+# CONFIG_LLC2 is not set
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=y
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+CONFIG_NET_DIVERT=y
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CLK_JIFFIES=y
+# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
+# CONFIG_NET_SCH_CLK_CPU is not set
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+# CONFIG_NET_SCH_HFSC is not set
+# CONFIG_NET_SCH_ATM is not set
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+# CONFIG_NET_SCH_NETEM is not set
+CONFIG_NET_SCH_INGRESS=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+# CONFIG_NET_CLS_BASIC is not set
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+# CONFIG_CLS_U32_PERF is not set
+# CONFIG_CLS_U32_MARK is not set
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+# CONFIG_NET_EMATCH is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_POLICE=y
+# CONFIG_NET_CLS_IND is not set
+CONFIG_NET_ESTIMATOR=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_PARTITIONS is not set
+
+#
+# User Modules And Translation Layers
+#
+# CONFIG_MTD_CHAR is not set
+# CONFIG_MTD_BLOCK is not set
+# CONFIG_MTD_BLOCK_RO is not set
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+CONFIG_BLK_DEV_NBD=y
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_SYSTEMSIM=y
+# CONFIG_CDROM_PKTCDVD is not set
+CONFIG_ATA_OVER_ETH=m
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+# CONFIG_WINDFARM is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBMVETH is not set
+CONFIG_SYSTEMSIM_NET=y
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_MV643XX_ETH is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# ATM drivers
+#
+# CONFIG_ATM_DUMMY is not set
+# CONFIG_ATM_TCP is not set
+# CONFIG_ATM_LANAI is not set
+# CONFIG_ATM_ENI is not set
+# CONFIG_ATM_FIRESTREAM is not set
+# CONFIG_ATM_ZATM is not set
+# CONFIG_ATM_IDT77252 is not set
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_FORE200E_MAYBE is not set
+# CONFIG_ATM_HE is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PCIPS2 is not set
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+# CONFIG_SERIAL_8250_CONSOLE is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+# CONFIG_SERIAL_ICOM is not set
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+CONFIG_HVC_DRIVER=y
+# CONFIG_HVC_CONSOLE is not set
+CONFIG_HVC_FSS=y
+# CONFIG_PPC_EARLY_DEBUG_FSS is not set
+CONFIG_HVC_RTAS=y
+# CONFIG_HVCS is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_HANGCHECK_TIMER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=y
+CONFIG_AUTOFS4_FS=y
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=y
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=y
+# CONFIG_SMB_NLS_DEFAULT is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+CONFIG_9P_FS=y
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+CONFIG_OSF_PARTITION=y
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+
+#
+# Instrumentation Support
+#
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+# CONFIG_KPROBES is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=15
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+CONFIG_DEBUG_SLAB=y
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUGGER is not set
+# CONFIG_IRQSTACKS is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
+# CONFIG_PPC_EARLY_DEBUG_G5 is not set
+# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
+# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
+# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
+# CONFIG_SECURITY is not set
+CONFIG_KEYS_COMPAT=y
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_DEFLATE=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 80e9fe2632b84a..d27dfa8102cd9d 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
obj-$(CONFIG_PPC64) += vdso64/
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
obj-$(CONFIG_POWER4) += idle_power4.o
+obj-$(CONFIG_SYSTEMSIM_IDLE) += idle_systemsim.o
obj-$(CONFIG_PPC_OF) += of_device.o prom_parse.o
procfs-$(CONFIG_PPC64) := proc_ppc64.o
obj-$(CONFIG_PROC_FS) += $(procfs-y)
diff --git a/arch/powerpc/kernel/idle_systemsim.c b/arch/powerpc/kernel/idle_systemsim.c
new file mode 100644
index 00000000000000..5bf4db9033690a
--- /dev/null
+++ b/arch/powerpc/kernel/idle_systemsim.c
@@ -0,0 +1,35 @@
+/*
+ * Idle daemon for the IBM Full System Simulator.
+ *
+ * Originally Written by Cort Dougan (cort@cs.nmt.edu)
+ * Copyright (c) 2003-2006 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/sched.h>
+#include <linux/preempt.h>
+
+#include <asm/systemsim.h>
+
+#define SIM_HALT_CODE 126
+
+static inline void systemsim_halt(void)
+{
+ callthru0(SIM_HALT_CODE);
+}
+
+void systemsim_idle(void)
+{
+ while (1) {
+ while (!need_resched())
+ systemsim_halt();
+
+ preempt_enable_no_resched();
+ schedule();
+ preempt_disable();
+ }
+}
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index f96c49b03ba05f..0504d80870326d 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -557,6 +557,23 @@ static void __init emergency_stack_init(void)
}
/*
+ * Detect if we are running on top of the IBM Full System Simulator.
+ * If we are, use the optimized idle loop for that case.
+ */
+static void __init setup_systemsim_idle(void)
+{
+#ifdef CONFIG_SYSTEMSIM_IDLE
+ struct device_node *mambo_node;
+
+ mambo_node = of_find_node_by_path("/mambo");
+ if (mambo_node) {
+ ppc_md.idle_loop = systemsim_idle;
+ of_node_put(mambo_node);
+ }
+#endif
+}
+
+/*
* Called into from start_kernel, after lock_kernel has been called.
* Initializes bootmem, which is unsed to manage page allocation until
* mem_init is called.
@@ -603,6 +620,8 @@ void __init setup_arch(char **cmdline_p)
ppc_md.setup_arch();
+ setup_systemsim_idle();
+
/* Use the default idle loop if the platform hasn't provided one. */
if (NULL == ppc_md.idle_loop) {
ppc_md.idle_loop = default_idle;
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index 3774e80094f539..66b63ad917d162 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -39,6 +39,9 @@ void __init udbg_early_init(void)
#elif defined(CONFIG_PPC_EARLY_DEBUG_MAPLE)
/* Maple real mode debug */
udbg_init_maple_realmode();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_FSS)
+ /* Maple real mode debug */
+ udbg_init_fss();
#elif defined(CONFIG_PPC_EARLY_DEBUG_ISERIES)
/* For iSeries - hit Ctrl-x Ctrl-x to see the output */
udbg_init_iseries();
diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c
index 138e128a3886b8..ba6befd96636e2 100644
--- a/arch/powerpc/platforms/pseries/hvconsole.c
+++ b/arch/powerpc/platforms/pseries/hvconsole.c
@@ -62,6 +62,11 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
unsigned long *lbuf = (unsigned long *) buf;
long ret;
+
+ /* hcall will ret H_PARAMETER if 'count' exceeds firmware max.*/
+ if (count > MAX_VIO_PUT_CHARS)
+ count = MAX_VIO_PUT_CHARS;
+
ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
lbuf[1]);
if (ret == H_Success)
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 9edeca83f43463..ca5d20a31c9ab2 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -171,11 +171,19 @@ static void __init pSeries_setup_mpic(void)
/* Setup the openpic driver */
irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */
+#ifndef CONFIG_SYSTEMSIM_BOOT
pSeries_mpic = mpic_alloc(openpic_addr, MPIC_PRIMARY,
16, 16, irq_count, /* isu size, irq offset, irq count */
NR_IRQS - 4, /* ipi offset */
senses, irq_count, /* sense & sense size */
" MPIC ");
+#else /* CONFIG_SYSTEMSIM_BOOT */
+ pSeries_mpic = mpic_alloc(openpic_addr, MPIC_PRIMARY,
+ 0, 0, irq_count, /* isu size, irq offset, irq count */
+ NR_IRQS - 4, /* ipi offset */
+ senses, irq_count, /* sense & sense size */
+ " MPIC ");
+#endif /* CONFIG_SYSTEMSIM_BOOT */
}
static void pseries_lpar_enable_pmcs(void)
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 8b133167740768..90f6177fad5454 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -409,6 +409,13 @@ config BLK_DEV_INITRD
"real" root file system, etc. See <file:Documentation/initrd.txt>
for details.
+config BLK_DEV_SYSTEMSIM
+ depends on PPC_SYSTEMSIM
+ tristate "IBM Full System Simulator Bogus Disk Support"
+ default y
+ help
+ Provides quick access to disk images in the simulator without
+ simulating a full IDE or SCSI device.
config CDROM_PKTCDVD
tristate "Packet writing on CD/DVD media"
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 3ec1f8df87b16d..20a11d6058513a 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -28,6 +28,6 @@ obj-$(CONFIG_BLK_DEV_NBD) += nbd.o
obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o
obj-$(CONFIG_VIODASD) += viodasd.o
+obj-$(CONFIG_BLK_DEV_SYSTEMSIM) += systemsim_bd.o
obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
obj-$(CONFIG_BLK_DEV_UB) += ub.o
-
diff --git a/drivers/block/systemsim_bd.c b/drivers/block/systemsim_bd.c
new file mode 100644
index 00000000000000..bec453ee0bd222
--- /dev/null
+++ b/drivers/block/systemsim_bd.c
@@ -0,0 +1,308 @@
+/*
+ * Bogus Block Driver for PowerPC Full System Simulator
+ *
+ * (C) Copyright IBM Corporation 2003-2005
+ *
+ * Bogus Disk Driver
+ *
+ * Author: Eric Van Hensbegren <ericvh@gmail.com>
+ *
+ * inspired by drivers/block/nbd.c
+ * written by Pavel Machek and Steven Whitehouse
+ *
+ * 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:
+ * Free Software Foundation
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02111-1301 USA
+ *
+ */
+
+#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 <linux/blkdev.h>
+#include <net/sock.h>
+#include <asm/prom.h>
+#include <asm/systemsim.h>
+
+#include <linux/devfs_fs_kernel.h>
+
+#include <asm/uaccess.h>
+#include <asm/types.h>
+
+#define MAJOR_NR 42
+#define MAX_SYSTEMSIM_BD 128
+
+#define SYSTEMSIM_BD_SET_BLKSIZE _IO( 0xab, 1 )
+#define SYSTEMSIM_BD_SET_SIZE _IO( 0xab, 2 )
+#define SYSTEMSIM_BD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
+#define SYSTEMSIM_BD_DISCONNECT _IO( 0xab, 8 )
+
+struct systemsim_bd_device {
+ int initialized;
+ int refcnt;
+ int flags;
+ struct gendisk *disk;
+};
+
+static struct systemsim_bd_device systemsim_bd_dev[MAX_SYSTEMSIM_BD];
+
+#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
+
+#define BOGUS_DISK_READ 116
+#define BOGUS_DISK_WRITE 117
+#define BOGUS_DISK_INFO 118
+
+static inline int
+systemsim_disk_read(int devno, void *buf, ulong sect, ulong nrsect)
+{
+ return callthru3(BOGUS_DISK_READ, (unsigned long)buf,
+ (unsigned long)sect,
+ (unsigned long)((nrsect << 16) | devno));
+}
+
+static inline int
+systemsim_disk_write(int devno, void *buf, ulong sect, ulong nrsect)
+{
+ return callthru3(BOGUS_DISK_WRITE, (unsigned long)buf,
+ (unsigned long)sect,
+ (unsigned long)((nrsect << 16) | devno));
+}
+
+static inline int systemsim_disk_info(int op, int devno)
+{
+ return callthru2(BOGUS_DISK_INFO, (unsigned long)op,
+ (unsigned long)devno);
+}
+
+static int systemsim_bd_init_disk(int devno)
+{
+ struct gendisk *disk = systemsim_bd_dev[devno].disk;
+ unsigned int sz;
+
+ /* check disk configured */
+ if (!systemsim_disk_info(BD_INFO_STATUS, devno)) {
+ printk(KERN_ERR
+ "Attempting to open bogus disk before initializaiton\n");
+ return 0;
+ }
+
+ systemsim_bd_dev[devno].initialized++;
+
+ sz = systemsim_disk_info(BD_INFO_DEVSZ, devno);
+
+ printk("Initializing disk %d with devsz %u\n", devno, sz);
+
+ set_capacity(disk, sz << 1);
+
+ return 1;
+}
+
+static void do_systemsim_bd_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;
+
+ switch (rq_data_dir(req)) {
+ case READ:
+ result = systemsim_disk_read(minor,
+ req->buffer, req->sector,
+ req->current_nr_sectors);
+ break;
+ case WRITE:
+ result = systemsim_disk_write(minor,
+ req->buffer, req->sector,
+ req->current_nr_sectors);
+ };
+
+ if (result)
+ end_request(req, 0); /* failure */
+ else
+ end_request(req, 1); /* success */
+ }
+}
+
+static int systemsim_bd_release(struct inode *inode, struct file *file)
+{
+ struct systemsim_bd_device *lo;
+ int dev;
+
+ if (!inode)
+ return -ENODEV;
+ dev = inode->i_bdev->bd_disk->first_minor;
+ if (dev >= MAX_SYSTEMSIM_BD)
+ return -ENODEV;
+ if (systemsim_disk_info(BD_INFO_SYNC, dev) < 0) {
+ printk(KERN_ALERT "systemsim_bd_release: unable to sync\n");
+ }
+ lo = &systemsim_bd_dev[dev];
+ if (lo->refcnt <= 0)
+ printk(KERN_ALERT "systemsim_bd_release: refcount(%d) <= 0\n",
+ lo->refcnt);
+ lo->refcnt--;
+ return 0;
+}
+
+static int systemsim_bd_revalidate(struct gendisk *disk)
+{
+ int devno = disk->first_minor;
+
+ systemsim_bd_init_disk(devno);
+
+ return 0;
+}
+
+static int systemsim_bd_open(struct inode *inode, struct file *file)
+{
+ int dev;
+
+ if (!inode)
+ return -EINVAL;
+ dev = inode->i_bdev->bd_disk->first_minor;
+ if (dev >= MAX_SYSTEMSIM_BD)
+ return -ENODEV;
+
+ check_disk_change(inode->i_bdev);
+
+ if (!systemsim_bd_dev[dev].initialized)
+ if (!systemsim_bd_init_disk(dev))
+ return -ENODEV;
+
+ systemsim_bd_dev[dev].refcnt++;
+ return 0;
+}
+
+static struct block_device_operations systemsim_bd_fops = {
+ owner:THIS_MODULE,
+ open:systemsim_bd_open,
+ release:systemsim_bd_release,
+ /* media_changed: systemsim_bd_check_change, */
+ revalidate_disk:systemsim_bd_revalidate,
+};
+
+static spinlock_t systemsim_bd_lock = SPIN_LOCK_UNLOCKED;
+
+static int __init systemsim_bd_init(void)
+{
+ struct device_node *systemsim;
+ int err = -ENOMEM;
+ int i;
+
+ systemsim = find_path_device("/systemsim");
+
+ if (systemsim == NULL) {
+ printk("NO SYSTEMSIM BOGUS DISK DETECTED\n");
+ return -1;
+ }
+
+ /*
+ * We could detect which disks are configured in openfirmware
+ * but I think this unnecessarily limits us from being able to
+ * hot-plug bogus disks durning run-time.
+ *
+ */
+
+ for (i = 0; i < MAX_SYSTEMSIM_BD; i++) {
+ struct gendisk *disk = alloc_disk(1);
+ if (!disk)
+ goto out;
+ systemsim_bd_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_systemsim_bd_request, &systemsim_bd_lock);
+ if (!disk->queue) {
+ put_disk(disk);
+ goto out;
+ }
+ }
+
+ if (register_blkdev(MAJOR_NR, "systemsim_bd")) {
+ err = -EIO;
+ goto out;
+ }
+#ifdef MODULE
+ printk("systemsim bogus disk: registered device at major %d\n",
+ MAJOR_NR);
+#else
+ printk("systemsim bogus disk: compiled in with kernel\n");
+#endif
+
+ /*
+ * left device name alone for now as too much depends on it
+ * external to the kernel
+ *
+ */
+
+ devfs_mk_dir("mambobd");
+ for (i = 0; i < MAX_SYSTEMSIM_BD; i++) { /* load defaults */
+ struct gendisk *disk = systemsim_bd_dev[i].disk;
+ systemsim_bd_dev[i].initialized = 0;
+ systemsim_bd_dev[i].refcnt = 0;
+ systemsim_bd_dev[i].flags = 0;
+ disk->major = MAJOR_NR;
+ disk->first_minor = i;
+ disk->fops = &systemsim_bd_fops;
+ disk->private_data = &systemsim_bd_dev[i];
+ sprintf(disk->disk_name, "mambobd%d", i);
+ sprintf(disk->devfs_name, "mambobd%d", i);
+ set_capacity(disk, 0x7ffffc00ULL << 1); /* 2 TB */
+ add_disk(disk);
+ }
+
+ return 0;
+ out:
+ while (i--) {
+ if (systemsim_bd_dev[i].disk->queue)
+ blk_cleanup_queue(systemsim_bd_dev[i].disk->queue);
+ put_disk(systemsim_bd_dev[i].disk);
+ }
+ return -EIO;
+}
+
+static void __exit systemsim_bd_cleanup(void)
+{
+ devfs_remove("mambobd");
+
+ if (unregister_blkdev(MAJOR_NR, "systemsim_bd") != 0)
+ printk("systemsim_bd: cleanup_module failed\n");
+ else
+ printk("systemsim_bd: module cleaned up.\n");
+}
+
+module_init(systemsim_bd_init);
+module_exit(systemsim_bd_cleanup);
+
+MODULE_DESCRIPTION("Systemsim Block Device");
+MODULE_LICENSE("GPL");
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 05ba410682a34d..19738692ab22bd 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -560,14 +560,46 @@ config TIPAR
If unsure, say N.
+config HVC_DRIVER
+ bool
+ help
+ Users of pSeries machines that want to utilize the hvc console front-end
+ module for their backend console driver should select this option.
+ It will automatically be selected if one of the back-end console drivers
+ is selected.
+
+
config HVC_CONSOLE
bool "pSeries Hypervisor Virtual Console support"
depends on PPC_PSERIES
+ select HVC_DRIVER
help
pSeries machines when partitioned support a hypervisor virtual
console. This driver allows each pSeries partition to have a console
which is accessed via the HMC.
+config HVC_FSS
+ bool "IBM Full System Simulator Console support"
+ depends on PPC_SYSTEMSIM
+ select HVC_DRIVER
+ help
+ IBM Full System Simulator Console device driver which makes use of
+ the HVC_DRIVER front end.
+
+config PPC_EARLY_DEBUG_FSS
+ bool "IBM Full System Simulator Console early debug support"
+ depends on PPC_SYSTEMSIM
+ select HVC_FSS
+ help
+ Display early debug info over the Full System simulator console
+
+config HVC_RTAS
+ bool "IBM RTAS Console support"
+ depends on PPC_RTAS
+ select HVC_DRIVER
+ help
+ IBM Console device driver which makes use of RTAS
+
config HVCS
tristate "IBM Hypervisor Virtual Console Server support"
depends on PPC_PSERIES
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 503dd901d406ba..3df78d4f047066 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -41,11 +41,14 @@ obj-$(CONFIG_N_HDLC) += n_hdlc.o
obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
obj-$(CONFIG_SX) += sx.o generic_serial.o
obj-$(CONFIG_RIO) += rio/ generic_serial.o
-obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o hvc_vio.o hvsi.o
+obj-$(CONFIG_HVC_DRIVER) += hvc_console.o
+obj-$(CONFIG_HVC_CONSOLE) += hvc_vio.o hvsi.o
+obj-$(CONFIG_HVC_FSS) += hvc_fss.o
+obj-$(CONFIG_HVC_RTAS) += hvc_rtas.o
obj-$(CONFIG_RAW_DRIVER) += raw.o
obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o
obj-$(CONFIG_MMTIMER) += mmtimer.o
-obj-$(CONFIG_VIOCONS) += viocons.o
+obj-$(CONFIG_VIOCONS) += viocons.o
obj-$(CONFIG_VIOTAPE) += viotape.o
obj-$(CONFIG_HVCS) += hvcs.o
obj-$(CONFIG_SGI_MBCS) += mbcs.o
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index f65b2e14a48561..e76f4052cf88f1 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -39,8 +39,10 @@
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
+
#include <asm/uaccess.h>
-#include <asm/hvconsole.h>
+
+#include "hvc_console.h"
#define HVC_MAJOR 229
#define HVC_MINOR 0
@@ -54,17 +56,14 @@
#define HVC_CLOSE_WAIT (HZ/100) /* 1/10 of a second */
/*
- * The Linux TTY code does not support dynamic addition of tty derived devices
- * so we need to know how many tty devices we might need when space is allocated
- * for the tty device. Since this driver supports hotplug of vty adapters we
- * need to make sure we have enough allocated.
+ * These sizes are most efficient for vio, because they are the
+ * native transfer size. We could make them selectable in the
+ * future to better deal with backends that want other buffer sizes.
*/
-#define HVC_ALLOC_TTY_ADAPTERS 8
-
#define N_OUTBUF 16
#define N_INBUF 16
-#define __ALIGNED__ __attribute__((__aligned__(8)))
+#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
static struct tty_driver *hvc_driver;
static struct task_struct *hvc_task;
@@ -154,7 +153,7 @@ static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =
void hvc_console_print(struct console *co, const char *b, unsigned count)
{
- char c[16] __ALIGNED__;
+ char c[N_OUTBUF] __ALIGNED__;
unsigned i = 0, n = 0;
int r, donecr = 0, index = co->index;
@@ -335,8 +334,6 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
} /* else count == 0 */
tty->driver_data = hp;
- tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */
-
hp->tty = tty;
/* Save for request_irq outside of spin_lock. */
irq = hp->irq;
@@ -473,8 +470,10 @@ static void hvc_push(struct hvc_struct *hp)
n = hp->ops->put_chars(hp->vtermno, hp->outbuf, hp->n_outbuf);
if (n <= 0) {
- if (n == 0)
+ if (n == 0) {
+ hp->do_wakeup = 1;
return;
+ }
/* throw away output on error; this happens when
there is no session connected to the vterm. */
hp->n_outbuf = 0;
@@ -486,12 +485,19 @@ static void hvc_push(struct hvc_struct *hp)
hp->do_wakeup = 1;
}
-static inline int __hvc_write_kernel(struct hvc_struct *hp,
- const unsigned char *buf, int count)
+static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count)
{
+ struct hvc_struct *hp = tty->driver_data;
unsigned long flags;
int rsize, written = 0;
+ /* This write was probably executed during a tty close. */
+ if (!hp)
+ return -EPIPE;
+
+ if (hp->count <= 0)
+ return -EIO;
+
spin_lock_irqsave(&hp->lock, flags);
/* Push pending writes */
@@ -510,26 +516,8 @@ static inline int __hvc_write_kernel(struct hvc_struct *hp,
}
spin_unlock_irqrestore(&hp->lock, flags);
- return written;
-}
-static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count)
-{
- struct hvc_struct *hp = tty->driver_data;
- int written;
-
- /* This write was probably executed during a tty close. */
- if (!hp)
- return -EPIPE;
-
- if (hp->count <= 0)
- return -EIO;
-
- written = __hvc_write_kernel(hp, buf, count);
-
/*
* Racy, but harmless, kick thread if there is still pending data.
- * There really is nothing wrong with kicking the thread, even if there
- * is no buffered data.
*/
if (hp->n_outbuf)
hvc_kick();
@@ -571,7 +559,6 @@ static int hvc_poll(struct hvc_struct *hp)
int i, n, poll_mask = 0;
char buf[N_INBUF] __ALIGNED__;
unsigned long flags;
- int read_total = 0;
spin_lock_irqsave(&hp->lock, flags);
@@ -614,6 +601,13 @@ static int hvc_poll(struct hvc_struct *hp)
spin_unlock_irqrestore(&hp->lock, flags);
tty_hangup(tty);
spin_lock_irqsave(&hp->lock, flags);
+ } else if ( n == -EAGAIN ) {
+ /*
+ * Some back-ends can only ensure a certain min
+ * num of bytes read, which may be > 'count'.
+ * Let the tty clear the flip buff to make room.
+ */
+ poll_mask |= HVC_POLL_READ;
}
break;
}
@@ -635,16 +629,8 @@ static int hvc_poll(struct hvc_struct *hp)
tty_insert_flip_char(tty, buf[i], 0);
}
- /*
- * Account for the total amount read in one loop, and if above
- * 64 bytes, we do a quick schedule loop to let the tty grok
- * the data and eventually throttle us.
- */
- read_total += n;
- if (read_total >= 64) {
- poll_mask |= HVC_POLL_QUICK;
- break;
- }
+ if (count)
+ tty_schedule_flip(tty);
}
throttled:
/* Wakeup write queue if necessary */
@@ -655,9 +641,6 @@ static int hvc_poll(struct hvc_struct *hp)
bail:
spin_unlock_irqrestore(&hp->lock, flags);
- if (read_total)
- tty_flip_buffer_push(tty);
-
return poll_mask;
}
@@ -767,7 +750,8 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int irq,
* see if this vterm id matches one registered for console.
*/
for (i=0; i < MAX_NR_HVC_CONSOLES; i++)
- if (vtermnos[i] == hp->vtermno)
+ if (vtermnos[i] == hp->vtermno &&
+ cons_ops[i] == hp->ops)
break;
/* no matching slot, just use a counter */
diff --git a/drivers/char/hvc_console.h b/drivers/char/hvc_console.h
new file mode 100644
index 00000000000000..96b7401319c196
--- /dev/null
+++ b/drivers/char/hvc_console.h
@@ -0,0 +1,63 @@
+/*
+ * hvc_console.h
+ * Copyright (C) 2005 IBM Corporation
+ *
+ * Author(s):
+ * Ryan S. Arnold <rsa@us.ibm.com>
+ *
+ * hvc_console header information:
+ * moved here from include/asm-powerpc/hvconsole.h
+ * and drivers/char/hvc_console.c
+ *
+ * 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.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef HVC_CONSOLE_H
+#define HVC_CONSOLE_H
+
+/*
+ * This is the max number of console adapters that can/will be found as
+ * console devices on first stage console init. Any number beyond this range
+ * can't be used as a console device but is still a valid tty device.
+ */
+#define MAX_NR_HVC_CONSOLES 16
+
+/*
+ * The Linux TTY code does not support dynamic addition of tty derived devices
+ * so we need to know how many tty devices we might need when space is allocated
+ * for the tty device. Since this driver supports hotplug of vty adapters we
+ * need to make sure we have enough allocated.
+ */
+#define HVC_ALLOC_TTY_ADAPTERS 8
+
+
+/* implemented by a low level driver */
+struct hv_ops {
+ int (*get_chars)(uint32_t vtermno, char *buf, int count);
+ int (*put_chars)(uint32_t vtermno, const char *buf, int count);
+};
+
+struct hvc_struct;
+
+/* Register a vterm and a slot index for use as a console (console_init) */
+extern int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops);
+
+/* register a vterm for hvc tty operation (module_init or hotplug add) */
+extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq,
+ struct hv_ops *ops);
+/* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */
+extern int __devexit hvc_remove(struct hvc_struct *hp);
+
+#endif // HVC_CONSOLE_H
diff --git a/drivers/char/hvc_fss.c b/drivers/char/hvc_fss.c
new file mode 100644
index 00000000000000..84aa34fcf88b59
--- /dev/null
+++ b/drivers/char/hvc_fss.c
@@ -0,0 +1,124 @@
+/*
+ * IBM Full System Simulator driver interface to hvc_console.c
+ *
+ * (C) Copyright IBM Corporation 2001-2005
+ * Author(s): Maximino Augilar <IBM STI Design Center>
+ * : Ryan S. Arnold <rsa@us.ibm.com>
+ *
+ * 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>
+ *
+ * Much of this code was moved here from the IBM Full System Simulator
+ * Bogus console driver in order to reuse the framework provided by the hvc
+ * console driver. Ryan S. Arnold <rsa@us.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/console.h>
+
+#include <asm/prom.h>
+#include <asm/irq.h>
+#include <asm/systemsim.h>
+#include <asm/udbg.h>
+
+#include "hvc_console.h"
+
+#define SIM_WRITE_CONSOLE_CODE 0
+#define SIM_READ_CONSOLE_CODE 60
+
+#define hvc_fss_cookie 0x1aa70e29
+
+static int hvc_fss_write_console(uint32_t vtermno, const char *buf, int count)
+{
+ int ret;
+ ret = callthru3(SIM_WRITE_CONSOLE_CODE, (unsigned long)buf, count, 1);
+ if (ret != 0)
+ return (count - ret); /* is this right? */
+
+ /* the calling routine expects to receive the number of bytes sent */
+ return count;
+}
+
+static int hvc_fss_read_console(uint32_t vtermno, char *buf, int count)
+{
+ unsigned long got;
+ int c, i;
+
+ got = 0;
+ for (i = 0; i < count; i++) {
+ if ((c = callthru0(SIM_READ_CONSOLE_CODE)) != -1) {
+ buf[i] = c;
+ ++got;
+ }
+ else
+ break;
+ }
+ return got;
+}
+
+#ifdef CONFIG_PPC_EARLY_DEBUG_FSS
+void udbg_fss_real_putc(char c)
+{
+ callthru3(SIM_WRITE_CONSOLE_CODE, (unsigned long)&c, 1, 1);
+}
+
+void __init udbg_init_fss(void)
+{
+ udbg_putc = udbg_fss_real_putc;
+ udbg_getc = NULL;
+ udbg_getc_poll = NULL;
+}
+#endif /* CONFIG_PPC_EARLY_DEBUG_FSS */
+
+static struct hv_ops hvc_fss_get_put_ops = {
+ .get_chars = hvc_fss_read_console,
+ .put_chars = hvc_fss_write_console,
+};
+
+static int __init hvc_fss_init(void)
+{
+ struct hvc_struct *hp;
+
+ /* Allocate an hvc_struct for the console device we instantiated
+ * earlier. Save off hp so that we can return it on exit */
+ hp = hvc_alloc(hvc_fss_cookie, NO_IRQ, &hvc_fss_get_put_ops);
+ if (IS_ERR(hp))
+ return PTR_ERR(hp);
+
+ return 0;
+}
+module_init(hvc_fss_init);
+
+/* This will happen prior to module init. There is no tty at this time? */
+static int __init hvc_fss_console_init(void)
+{
+ /* Don't register if we aren't running on the simulator */
+ if (of_find_node_by_path("/mambo")) {
+ /* Tell the driver we know of one console device. We
+ * shouldn't get a collision on the index as long as no-one
+ * else instantiates on hardware they don't have. */
+ hvc_instantiate(hvc_fss_cookie, 0, &hvc_fss_get_put_ops );
+ add_preferred_console("hvc", 0, NULL);
+ }
+ return 0;
+}
+console_initcall(hvc_fss_console_init);
diff --git a/drivers/char/hvc_rtas.c b/drivers/char/hvc_rtas.c
new file mode 100644
index 00000000000000..4a388c9df884a7
--- /dev/null
+++ b/drivers/char/hvc_rtas.c
@@ -0,0 +1,138 @@
+/*
+ * IBM RTAS driver interface to hvc_console.c
+ *
+ * (C) Copyright IBM Corporation 2001-2005
+ * (C) Copyright Red Hat, Inc. 2005
+ *
+ * Author(s): Maximino Augilar <IBM STI Design Center>
+ * : Ryan S. Arnold <rsa@us.ibm.com>
+ * : Utz Bacher <utz.bacher@de.ibm.com>
+ * : David Woodhouse <dwmw2@infradead.org>
+ *
+ * inspired by drivers/char/hvc_console.c
+ * written by Anton Blanchard and Paul Mackerras
+ *
+ * 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.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+
+#include <asm/irq.h>
+#include <asm/rtas.h>
+#include "hvc_console.h"
+
+#define hvc_rtas_cookie 0x67781e15
+struct hvc_struct *hvc_rtas_dev;
+
+#define RTASCONS_PUT_ATTEMPTS 16
+
+static int rtascons_put_char_token = RTAS_UNKNOWN_SERVICE;
+static int rtascons_get_char_token = RTAS_UNKNOWN_SERVICE;
+static int rtascons_put_delay = 100;
+module_param_named(put_delay, rtascons_put_delay, int, 0644);
+
+static inline int hvc_rtas_write_console(uint32_t vtermno, const char *buf, int count)
+{
+ int done;
+
+ /* if there is more than one character to be displayed, wait a bit */
+ for (done = 0; done < count; done++) {
+ int result;
+ result = rtas_call(rtascons_put_char_token, 1, 1, NULL, buf[done]);
+ if (result)
+ break;
+ }
+ /* the calling routine expects to receive the number of bytes sent */
+ return done;
+}
+
+static int hvc_rtas_read_console(uint32_t vtermno, char *buf, int count)
+{
+ int i;
+
+ for (i = 0; i < count; i++) {
+ int c, err;
+
+ err = rtas_call(rtascons_get_char_token, 0, 2, &c);
+ if (err)
+ break;
+
+ buf[i] = c;
+ }
+
+ return i;
+}
+
+static struct hv_ops hvc_rtas_get_put_ops = {
+ .get_chars = hvc_rtas_read_console,
+ .put_chars = hvc_rtas_write_console,
+};
+
+static int hvc_rtas_init(void)
+{
+ struct hvc_struct *hp;
+
+ if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE)
+ rtascons_put_char_token = rtas_token("put-term-char");
+ if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE)
+ return -EIO;
+
+ if (rtascons_get_char_token == RTAS_UNKNOWN_SERVICE)
+ rtascons_get_char_token = rtas_token("get-term-char");
+ if (rtascons_get_char_token == RTAS_UNKNOWN_SERVICE)
+ return -EIO;
+
+ BUG_ON(hvc_rtas_dev);
+
+ /* Allocate an hvc_struct for the console device we instantiated
+ * earlier. Save off hp so that we can return it on exit */
+ hp = hvc_alloc(hvc_rtas_cookie, NO_IRQ, &hvc_rtas_get_put_ops);
+ if (IS_ERR(hp))
+ return PTR_ERR(hp);
+ hvc_rtas_dev = hp;
+ return 0;
+}
+module_init(hvc_rtas_init);
+
+/* This will tear down the tty portion of the driver */
+static void __exit hvc_rtas_exit(void)
+{
+ /* Really the fun isn't over until the worker thread breaks down and the
+ * tty cleans up */
+ if (hvc_rtas_dev)
+ hvc_remove(hvc_rtas_dev);
+}
+module_exit(hvc_rtas_exit); /* before drivers/char/hvc_console.c */
+
+/* This will happen prior to module init. There is no tty at this time? */
+static int hvc_rtas_console_init(void)
+{
+ rtascons_put_char_token = rtas_token("put-term-char");
+ if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE)
+ return -EIO;
+ rtascons_get_char_token = rtas_token("get-term-char");
+ if (rtascons_get_char_token == RTAS_UNKNOWN_SERVICE)
+ return -EIO;
+
+ hvc_instantiate(hvc_rtas_cookie, 0, &hvc_rtas_get_put_ops );
+ add_preferred_console("hvc", 0, NULL);
+ return 0;
+}
+console_initcall(hvc_rtas_console_init);
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index f5212eb2b41d0d..9add81ceb44050 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -31,10 +31,13 @@
#include <linux/types.h>
#include <linux/init.h>
+
#include <asm/hvconsole.h>
#include <asm/vio.h>
#include <asm/prom.h>
+#include "hvc_console.h"
+
char hvc_driver_name[] = "hvc_console";
static struct vio_device_id hvc_driver_table[] __devinitdata = {
@@ -48,6 +51,14 @@ static int filtered_get_chars(uint32_t vtermno, char *buf, int count)
unsigned long got;
int i;
+ /*
+ * Vio firmware will read up to SIZE_VIO_GET_CHARS at its own discretion
+ * so we play safe and avoid the situation where got > count which could
+ * overload the flip buffer.
+ */
+ if (count < SIZE_VIO_GET_CHARS)
+ return -EAGAIN;
+
got = hvc_get_chars(vtermno, buf, count);
/*
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index aa633fa95e648e..cd29f579551284 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1174,6 +1174,14 @@ config IBMVETH
<file:Documentation/networking/net-modules.txt>. The module will
be called ibmveth.
+config SYSTEMSIM_NET
+ depends on PPC_SYSTEMSIM
+ 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.
+
config IBM_EMAC
tristate "PowerPC 4xx on-chip Ethernet support"
depends on 4xx
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 00e72b12fb9225..511e176c4692dc 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -145,6 +145,7 @@ obj-$(CONFIG_EL3) += 3c509.o
obj-$(CONFIG_3C515) += 3c515.o
obj-$(CONFIG_EEXPRESS) += eexpress.o
obj-$(CONFIG_EEXPRESS_PRO) += eepro.o
+obj-$(CONFIG_SYSTEMSIM_NET) += systemsim_net.o
obj-$(CONFIG_8139CP) += 8139cp.o
obj-$(CONFIG_8139TOO) += 8139too.o
obj-$(CONFIG_ZNET) += znet.o
diff --git a/drivers/net/systemsim_net.c b/drivers/net/systemsim_net.c
new file mode 100644
index 00000000000000..0a4cea925f2079
--- /dev/null
+++ b/drivers/net/systemsim_net.c
@@ -0,0 +1,393 @@
+/*
+ * Bogus Network Driver for PowerPC Full System Simulator
+ *
+ * (C) Copyright IBM Corporation 2003-2005
+ *
+ * Bogus Network Driver
+ *
+ * Author: JimiX <jimix@watson.ibm.com>
+ * Maintained By: Eric Van Hensbergen <ericvh@gmail.com>
+ *
+ * inspired by drivers/net/ibmveth.c
+ * written by Dave Larson
+ *
+ * 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:
+ * Free Software Foundation
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02111-1301 USA
+ *
+ */
+
+#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/systemsim.h>
+
+#define SYSTEMSIM_NET_PROBE 119
+#define SYSTEMSIM_NET_SEND 120
+#define SYSTEMSIM_NET_RECV 121
+
+static inline int systemsim_bogusnet_probe(int devno, void *buf)
+{
+ return callthru2(SYSTEMSIM_NET_PROBE,
+ (unsigned long)devno, (unsigned long)buf);
+}
+
+static inline int systemsim_bogusnet_send(int devno, void *buf, ulong size)
+{
+ return callthru3(SYSTEMSIM_NET_SEND,
+ (unsigned long)devno,
+ (unsigned long)buf, (unsigned long)size);
+}
+
+static inline int systemsim_bogusnet_recv(int devno, void *buf, ulong size)
+{
+ return callthru3(SYSTEMSIM_NET_RECV,
+ (unsigned long)devno,
+ (unsigned long)buf, (unsigned long)size);
+}
+
+static irqreturn_t
+systemsim_net_intr(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 systemsim_net_probedev(int devno, void *buf)
+{
+ struct device_node *systemsim;
+ struct device_node *net;
+ unsigned int *reg;
+
+ systemsim = find_path_device("/systemsim");
+
+ if (systemsim == NULL) {
+ return -1;
+ }
+ net = find_path_device("/systemsim/bogus-net@0");
+ if (net == NULL) {
+ return -1;
+ }
+ reg = (unsigned int *)get_property(net, "reg", 0);
+
+ if (*reg != devno) {
+ return -1;
+ }
+
+ return systemsim_bogusnet_probe(devno, buf);
+}
+
+static int systemsim_net_send(int devno, void *buf, ulong size)
+{
+ return systemsim_bogusnet_send(devno, buf, size);
+}
+
+static int systemsim_net_recv(int devno, void *buf, ulong size)
+{
+ return systemsim_bogusnet_recv(devno, buf, size);
+}
+
+static int systemsim_net_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 */
+ systemsim_net_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 systemsim_net_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 = systemsim_net_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 */
+#ifdef 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 systemsim_net_timer(struct net_device *dev)
+{
+ int budget = 16;
+ struct netdev_private *priv = (struct netdev_private *)dev->priv;
+
+ systemsim_net_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
+systemsim_net_intr(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 systemsim_net_open(struct net_device *dev)
+{
+ struct netdev_private *priv;
+ int ret = 0;
+
+ priv = dev->priv;
+
+ /*
+ * we can't start polling in systemsim_net_init, because I don't think
+ * workqueues are usable that early. so start polling now.
+ */
+
+ if (dev->irq) {
+ ret = request_irq(dev->irq, &systemsim_net_intr, 0,
+ dev->name, dev);
+
+ if (ret == 0) {
+ netif_start_queue(dev);
+ } else {
+ printk(KERN_ERR "systemsim net: request irq failed\n");
+ }
+
+ /* probe with NULL to activate interrupts */
+ systemsim_bogusnet_probe(priv->devno, NULL);
+ } else {
+ systemsim_net_timer(dev);
+ }
+
+ return ret;
+}
+
+static int systemsim_net_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);
+ }
+
+ return 0;
+}
+
+static struct net_device_stats systemsim_net_stats;
+
+static struct net_device_stats *systemsim_net_get_stats(struct net_device *dev)
+{
+ return &systemsim_net_stats;
+}
+
+static int systemsim_net_set_mac_address(struct net_device *dev, void *p)
+{
+ return -EOPNOTSUPP;
+}
+static int systemsim_net_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_systemsim_net_probe(struct net_device *dev)
+{
+ struct netdev_private *priv;
+ int devno = nextdevno++;
+ int irq;
+
+ printk("eth%d: bogus network driver initialization\n", devno);
+
+ irq = systemsim_net_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 = systemsim_net_open;
+ dev->poll = systemsim_net_poll;
+ dev->weight = 16;
+ dev->stop = systemsim_net_close;
+ dev->hard_start_xmit = systemsim_net_start_xmit;
+ dev->get_stats = systemsim_net_get_stats;
+ dev->set_mac_address = systemsim_net_set_mac_address;
+ dev->do_ioctl = systemsim_net_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 *)systemsim_net_timer,
+ (void *)dev);
+ }
+
+ return (0);
+};
+
+struct net_device *__init systemsim_net_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_systemsim_net_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_systemsim_net(void)
+{
+ systemsim_net_probe(0);
+ return 0;
+}
+
+module_init(init_systemsim_net);
+MODULE_DESCRIPTION("Systemsim Network Driver");
+MODULE_LICENSE("GPL");
diff --git a/include/asm-powerpc/hvconsole.h b/include/asm-powerpc/hvconsole.h
index 34daf7b9b62fe5..d0407670bdca62 100644
--- a/include/asm-powerpc/hvconsole.h
+++ b/include/asm-powerpc/hvconsole.h
@@ -24,17 +24,16 @@
#ifdef __KERNEL__
/*
- * This is the max number of console adapters that can/will be found as
- * console devices on first stage console init. Any number beyond this range
- * can't be used as a console device but is still a valid tty device.
+ * PSeries firmware will only send/recv up to 16 bytes of character data per
+ * hcall.
*/
-#define MAX_NR_HVC_CONSOLES 16
+#define MAX_VIO_PUT_CHARS 16
+#define SIZE_VIO_GET_CHARS 16
-/* implemented by a low level driver */
-struct hv_ops {
- int (*get_chars)(uint32_t vtermno, char *buf, int count);
- int (*put_chars)(uint32_t vtermno, const char *buf, int count);
-};
+/*
+ * Vio firmware always attempts to fetch MAX_VIO_GET_CHARS chars. The 'count'
+ * parm is included to conform to put_chars() function pointer template
+ */
extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 5348b820788cbd..e1fac06c5c021e 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -244,6 +244,7 @@ struct machdep_calls {
extern void default_idle(void);
extern void native_idle(void);
+extern void systemsim_idle(void);
extern struct machdep_calls ppc_md;
extern char cmd_line[COMMAND_LINE_SIZE];
diff --git a/include/asm-powerpc/systemsim.h b/include/asm-powerpc/systemsim.h
new file mode 100644
index 00000000000000..351572f06c71eb
--- /dev/null
+++ b/include/asm-powerpc/systemsim.h
@@ -0,0 +1,132 @@
+/*
+ *
+ * Copyright (C) 2001, 2005 IBM
+ *
+ * Filename : systemsim.h
+ *
+ * Originator : Patrick Bohrer and Charles Lefurgy
+ * Modified By : Eric Van Hensbegren <ericvh@gmail.com>
+ *
+ * Purpose :
+ *
+ * This file is compiled with programs that are run under the
+ * PowerPC Full System simulator. For example, stand-alone programs
+ * or operating systems. The programs call the callthru wrapper
+ * functions which use an illegal PowerPC instruction to signal the
+ * simulator to emulate special support.
+ *
+ */
+
+#ifndef _SYSTEMSIM_CONFIG_H_
+#define _SYSTEMSIM_CONFIG_H_
+#ifdef __KERNEL__
+
+/* The functions callthru0 to callthru5 setup up the arguments for the
+ * simulator callthru and then use the callthru instruction. Note that
+ * 0-5 specify the number of arguments after the command */
+
+/* Note: Arguments are cast as void* to prevent casting by the
+ compiler. This way, you can pass pointers, integers, etc. in
+ machine register and have the 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 void*. 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) */
+
+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 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);
+}
+static 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);
+}
+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 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);
+}
+static 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);
+}
+static 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);
+}
+static 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);
+}
+
+#endif /* __KERNEL__ */
+#endif/* _SYSTEMSIM_CONFIG_H_ */
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h
index 5c4236c342bb16..46b100a314ec72 100644
--- a/include/asm-powerpc/udbg.h
+++ b/include/asm-powerpc/udbg.h
@@ -42,6 +42,7 @@ extern void __init udbg_init_pmac_realmode(void);
extern void __init udbg_init_maple_realmode(void);
extern void __init udbg_init_iseries(void);
extern void __init udbg_init_rtas(void);
+extern void __init udbg_init_fss(void);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_UDBG_H */