* Re: [2.6 patch] remove unused tmp_buf_sem's
From: Greg KH @ 2006-01-14 3:49 UTC (permalink / raw)
To: Adrian Bunk
Cc: akpm, Jes Sorensen, tony.luck, linux-ia64, linux-usb-devel,
linux-kernel, linuxppc-dev, torvalds, R.E.Wolff
In-Reply-To: <20060114020816.GW29663@stusta.de>
On Sat, Jan 14, 2006 at 03:08:16AM +0100, Adrian Bunk wrote:
> <-- snip -->
>
>
> tmp_buf_sem sems to be a common name for something completely unused...
>
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
>
> ---
>
> arch/ia64/hp/sim/simserial.c | 1 -
> arch/ppc/4xx_io/serial_sicc.c | 1 -
> drivers/char/amiserial.c | 1 -
> drivers/char/esp.c | 1 -
> drivers/char/generic_serial.c | 1 -
> drivers/char/riscom8.c | 1 -
> drivers/char/serial167.c | 1 -
> drivers/char/specialix.c | 3 ---
> drivers/char/synclink.c | 1 -
> drivers/sbus/char/aurora.c | 1 -
> drivers/serial/68328serial.c | 1 -
> drivers/usb/serial/pl2303.c | 2 --
> 12 files changed, 15 deletions(-)
usb portion is:
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
^ permalink raw reply
* [PATCH] powerpc: Recognize /chaos bridge on old pmacs as PCI
From: Paul Mackerras @ 2006-01-14 3:34 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
The first generation of PCI powermacs had a host bridge called /chaos
which was for all intents and purposes a PCI host bridge, but has a
device_type of "vci" in the device tree (presumably it's not really
PCI at the hardware level or something).
The OF parsing stuff in arch/powerpc/kernel/prom_parse.c currently
doesn't recognize it as a PCI bridge, which means that controlfb.c
can't get its device addresses.
This makes prom_parse.c recognize a device_type of "vci" as indicating
a PCI host bridge. With this, controlfb works again.
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 309ae1d..a8099c8 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -113,7 +113,8 @@ static unsigned int of_bus_default_get_f
static int of_bus_pci_match(struct device_node *np)
{
- return !strcmp(np->type, "pci");
+ /* "vci" is for the /chaos bridge on 1st-gen PCI powermacs */
+ return !strcmp(np->type, "pci") || !strcmp(np->type, "vci");
}
static void of_bus_pci_count_cells(struct device_node *np,
^ permalink raw reply related
* Help: MCC driver for mpc8260
From: s.maiti @ 2006-01-14 3:29 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <20060112152232.73EDB68A88@ozlabs.org>
Hi all,
I got a Linux kernel device driver for the MCC from souceforge. One
problem I am facing is that I am unable to compile the code. There is some
problem with Rule.make.
Please Help me.
Thanks and regards,
Souvik Maiti
Tata Consultancy Services Limited
Mailto: s.maiti@tcs.com
Website: http://www.tcs.com
Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
^ permalink raw reply
* [2.6 patch] remove unused tmp_buf_sem's
From: Adrian Bunk @ 2006-01-14 2:08 UTC (permalink / raw)
To: Jes Sorensen
Cc: akpm, tony.luck, linux-ia64, linux-usb-devel, gregkh,
linux-kernel, linuxppc-dev, torvalds, R.E.Wolff
In-Reply-To: <17348.61824.49889.569928@jaguar.mkp.net>
On Wed, Jan 11, 2006 at 06:52:32AM -0500, Jes Sorensen wrote:
>
> Remove unsued semaphore declaration.
>
> Signed-off-by: Jes Sorensen <jes@sgi.com>
>
> ----
>
> arch/ia64/hp/sim/simserial.c | 1 -
> 1 files changed, 1 deletion(-)
>
> Index: linux-2.6.15-rc7-quilt/arch/ia64/hp/sim/simserial.c
> ===================================================================
> --- linux-2.6.15-rc7-quilt.orig/arch/ia64/hp/sim/simserial.c
> +++ linux-2.6.15-rc7-quilt/arch/ia64/hp/sim/simserial.c
> @@ -107,7 +107,6 @@
> static struct console *console;
>
> static unsigned char *tmp_buf;
> -static DECLARE_MUTEX(tmp_buf_sem);
>...
There are even more of them...
Patch below.
cu
Adrian
<-- snip -->
tmp_buf_sem sems to be a common name for something completely unused...
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
arch/ia64/hp/sim/simserial.c | 1 -
arch/ppc/4xx_io/serial_sicc.c | 1 -
drivers/char/amiserial.c | 1 -
drivers/char/esp.c | 1 -
drivers/char/generic_serial.c | 1 -
drivers/char/riscom8.c | 1 -
drivers/char/serial167.c | 1 -
drivers/char/specialix.c | 3 ---
drivers/char/synclink.c | 1 -
drivers/sbus/char/aurora.c | 1 -
drivers/serial/68328serial.c | 1 -
drivers/usb/serial/pl2303.c | 2 --
12 files changed, 15 deletions(-)
--- linux-2.6.15-mm3-full/arch/ia64/hp/sim/simserial.c.old 2006-01-13 15:22:27.000000000 +0100
+++ linux-2.6.15-mm3-full/arch/ia64/hp/sim/simserial.c 2006-01-13 15:22:47.000000000 +0100
@@ -103,7 +103,6 @@
static struct console *console;
static unsigned char *tmp_buf;
-static DECLARE_MUTEX(tmp_buf_sem);
extern struct console *console_drivers; /* from kernel/printk.c */
--- linux-2.6.15-mm3-full/arch/ppc/4xx_io/serial_sicc.c.old 2006-01-13 15:22:56.000000000 +0100
+++ linux-2.6.15-mm3-full/arch/ppc/4xx_io/serial_sicc.c 2006-01-13 15:23:02.000000000 +0100
@@ -215,7 +215,6 @@
* memory if large numbers of serial ports are open.
*/
static u_char *tmp_buf;
-static DECLARE_MUTEX(tmp_buf_sem);
#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
--- linux-2.6.15-mm3-full/drivers/char/amiserial.c.old 2006-01-13 15:23:14.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/char/amiserial.c 2006-01-13 15:23:16.000000000 +0100
@@ -123,7 +123,6 @@
* memory if large numbers of serial ports are open.
*/
static unsigned char *tmp_buf;
-static DECLARE_MUTEX(tmp_buf_sem);
#include <asm/uaccess.h>
--- linux-2.6.15-mm3-full/drivers/char/esp.c.old 2006-01-13 15:23:25.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/char/esp.c 2006-01-13 15:23:28.000000000 +0100
@@ -160,7 +160,6 @@
* memory if large numbers of serial ports are open.
*/
static unsigned char *tmp_buf;
-static DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct esp_struct *info,
char *name, const char *routine)
--- linux-2.6.15-mm3-full/drivers/char/generic_serial.c.old 2006-01-13 15:23:36.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/char/generic_serial.c 2006-01-13 15:23:39.000000000 +0100
@@ -34,7 +34,6 @@
#define DEBUG
static char * tmp_buf;
-static DECLARE_MUTEX(tmp_buf_sem);
static int gs_debug;
--- linux-2.6.15-mm3-full/drivers/char/riscom8.c.old 2006-01-13 15:23:47.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/char/riscom8.c 2006-01-13 15:24:04.000000000 +0100
@@ -82,7 +82,6 @@
static struct riscom_board * IRQ_to_board[16];
static struct tty_driver *riscom_driver;
static unsigned char * tmp_buf;
-static DECLARE_MUTEX(tmp_buf_sem);
static unsigned long baud_table[] = {
0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
--- linux-2.6.15-mm3-full/drivers/char/serial167.c.old 2006-01-13 15:24:42.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/char/serial167.c 2006-01-13 15:24:45.000000000 +0100
@@ -129,7 +129,6 @@
* memory if large numbers of serial ports are open.
*/
static unsigned char *tmp_buf = 0;
-DECLARE_MUTEX(tmp_buf_sem);
/*
* This is used to look up the divisor speeds and the timeouts
--- linux-2.6.15-mm3-full/drivers/char/specialix.c.old 2006-01-13 15:24:53.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/char/specialix.c 2006-01-13 15:24:58.000000000 +0100
@@ -184,7 +184,6 @@
static struct tty_driver *specialix_driver;
static unsigned char * tmp_buf;
-static DECLARE_MUTEX(tmp_buf_sem);
static unsigned long baud_table[] = {
0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
@@ -2556,8 +2555,6 @@
func_enter();
- init_MUTEX(&tmp_buf_sem); /* Init de the semaphore - pvdl */
-
if (iobase[0] || iobase[1] || iobase[2] || iobase[3]) {
for(i = 0; i < SX_NBOARD; i++) {
sx_board[i].base = iobase[i];
--- linux-2.6.15-mm3-full/drivers/char/synclink.c.old 2006-01-13 15:25:05.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/char/synclink.c 2006-01-13 15:25:18.000000000 +0100
@@ -951,7 +951,6 @@
* memory if large numbers of serial ports are open.
*/
static unsigned char *tmp_buf;
-static DECLARE_MUTEX(tmp_buf_sem);
static inline int mgsl_paranoia_check(struct mgsl_struct *info,
char *name, const char *routine)
--- linux-2.6.15-mm3-full/drivers/sbus/char/aurora.c.old 2006-01-13 15:25:33.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/sbus/char/aurora.c 2006-01-13 15:25:39.000000000 +0100
@@ -92,7 +92,6 @@
/* no longer used. static struct Aurora_board * IRQ_to_board[16] = { NULL, } ;*/
static unsigned char * tmp_buf = NULL;
-static DECLARE_MUTEX(tmp_buf_sem);
DECLARE_TASK_QUEUE(tq_aurora);
--- linux-2.6.15-mm3-full/drivers/serial/68328serial.c.old 2006-01-13 15:25:50.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/serial/68328serial.c 2006-01-13 15:25:59.000000000 +0100
@@ -141,7 +141,6 @@
* memory if large numbers of serial ports are open.
*/
static unsigned char tmp_buf[SERIAL_XMIT_SIZE]; /* This is cheating */
-DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct m68k_serial *info,
char *name, const char *routine)
--- linux-2.6.15-mm3-full/drivers/usb/serial/pl2303.c.old 2006-01-13 15:26:10.000000000 +0100
+++ linux-2.6.15-mm3-full/drivers/usb/serial/pl2303.c 2006-01-13 15:26:17.000000000 +0100
@@ -43,8 +43,6 @@
#define PL2303_BUF_SIZE 1024
#define PL2303_TMP_BUF_SIZE 1024
-static DECLARE_MUTEX(pl2303_tmp_buf_sem);
-
struct pl2303_buf {
unsigned int buf_size;
char *buf_buf;
^ permalink raw reply
* Re: [PATCH] Initial MPC8540 ADS port with OF Flat Dev
From: Kumar Gala @ 2006-01-14 0:53 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <1137194938.29751.3950.camel@cashmere.sps.mot.com>
On Fri, 13 Jan 2006, Jon Loeliger wrote:
> Initial support for MPC8540 ADS with Flat Device tree.
> Does not yet include PCI or I2C.
>
> Signed-off-by: Jon Loeliger <jdl@freescale.com>
> Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
>
> --
>
> arch/powerpc/Kconfig | 23 +
> arch/powerpc/configs/mpc8540_ads_defconfig | 723 ++++++++++++++++++++++++++++
> arch/powerpc/kernel/head_booke.h | 363 ++++++++++++++
> arch/powerpc/platforms/85xx/Kconfig | 74 ---
> arch/powerpc/platforms/85xx/Makefile | 5
> arch/powerpc/platforms/85xx/mpc8540_ads.h | 67 +++
> arch/powerpc/platforms/85xx/mpc85xx.c | 257 ++++++++++
> arch/powerpc/platforms/Makefile | 2
> 8 files changed, 1441 insertions(+), 73 deletions(-)
>
>
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index a8d2f2d..898047d 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -138,6 +138,12 @@ config PPC_83xx
> select 83xx
> select PPC_FPU
>
> +config PPC_85xx
> + bool "Freescale 85xx"
> + select E500
> + select FSL_SOC
> + select 85xx
> +
> config 40x
> bool "AMCC 40x"
>
> @@ -150,8 +156,6 @@ config 8xx
> config E200
> bool "Freescale e200"
>
> -config E500
> - bool "Freescale e500"
> endchoice
>
> config POWER4_ONLY
> @@ -179,6 +183,12 @@ config 6xx
> config 83xx
> bool
>
Add a comment that 85xx is a temp place thing to match with arch=ppc (see
83xx comment)
> +config 85xx
> + bool
> +
> +config E500
> + bool
> +
> config PPC_FPU
> bool
> default y if PPC64
> @@ -228,6 +238,7 @@ config ALTIVEC
> config SPE
> bool "SPE Support"
> depends on E200 || E500
> + default y
> ---help---
> This option enables kernel support for the Signal Processing
> Extensions (SPE) to the PowerPC processor. The kernel currently
> @@ -735,13 +746,13 @@ config GENERIC_ISA_DMA
>
I'm not sure why we did this in the first place, but I the we can drop the
default y if PPC_85xx
> config PPC_I8259
> bool
> - default y if 85xx
> + default y if PPC_85xx
> default n
>
Drop PPC_85xx default here. You already have a select in 85xx/Kconfig
> config PPC_INDIRECT_PCI
> bool
> depends on PCI
> - default y if 40x || 44x || 85xx
> + default y if 40x || 44x || PPC_85xx
> default n
>
> config EISA
> @@ -758,8 +769,8 @@ config MCA
> bool
>
> config PCI
> - bool "PCI support" if 40x || CPM2 || PPC_83xx || 85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES)
> - default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx && !85xx
> + bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES)
> + default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx && !PPC_85xx
> default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
> default PCI_QSPAN if !4xx && !CPM2 && 8xx
> help
> diff --git a/arch/powerpc/configs/mpc8540_ads_defconfig b/arch/powerpc/configs/mpc8540_ads_defconfig
> new file mode 100644
> index 0000000..b7489f8
> --- /dev/null
> +++ b/arch/powerpc/configs/mpc8540_ads_defconfig
> @@ -0,0 +1,723 @@
> +#
> +# Automatically generated make config: don't edit
> +# Linux kernel version: 2.6.15-g2554f1e1-dirty
> +# Thu Jan 12 16:29:46 2006
> +#
> +# CONFIG_PPC64 is not set
> +CONFIG_PPC32=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_GENERIC_NVRAM=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 is not set
> +CONFIG_DEFAULT_UIMAGE=y
> +
> +#
> +# Processor support
> +#
> +# CONFIG_CLASSIC32 is not set
> +# CONFIG_PPC_52xx is not set
> +# CONFIG_PPC_82xx is not set
> +# CONFIG_PPC_83xx is not set
> +CONFIG_PPC_85xx=y
> +# CONFIG_40x is not set
> +# CONFIG_44x is not set
> +# CONFIG_8xx is not set
> +# CONFIG_E200 is not set
> +CONFIG_85xx=y
> +CONFIG_E500=y
> +CONFIG_BOOKE=y
> +CONFIG_FSL_BOOKE=y
> +# CONFIG_PHYS_64BIT is not set
> +CONFIG_SPE=y
> +
> +#
> +# Code maturity level options
> +#
> +CONFIG_EXPERIMENTAL=y
> +CONFIG_CLEAN_COMPILE=y
> +CONFIG_BROKEN_ON_SMP=y
> +CONFIG_INIT_ENV_ARG_LIMIT=32
> +
> +#
> +# General setup
> +#
> +CONFIG_LOCALVERSION=""
> +CONFIG_LOCALVERSION_AUTO=y
> +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 is not set
> +CONFIG_INITRAMFS_SOURCE=""
> +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
> +CONFIG_EMBEDDED=y
> +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
> +#
> +# CONFIG_LBD is not set
> +
> +#
> +# 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"
> +CONFIG_MPIC=y
> +# CONFIG_WANT_EARLY_SERIAL is not set
> +
> +#
> +# Platform support
> +#
> +CONFIG_MPC8540_ADS=y
> +CONFIG_MPC8540=y
> +CONFIG_PPC_INDIRECT_PCI_BE=y
> +
> +#
> +# Kernel options
> +#
> +# CONFIG_HIGHMEM is not set
> +# 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_BINFMT_ELF=y
> +CONFIG_BINFMT_MISC=m
> +CONFIG_MATH_EMULATION=y
> +CONFIG_ARCH_FLATMEM_ENABLE=y
> +CONFIG_SELECT_MEMORY_MODEL=y
> +CONFIG_FLATMEM_MANUAL=y
> +# CONFIG_DISCONTIGMEM_MANUAL is not set
> +# CONFIG_SPARSEMEM_MANUAL is not set
> +CONFIG_FLATMEM=y
> +CONFIG_FLAT_NODE_MEM_MAP=y
> +# CONFIG_SPARSEMEM_STATIC is not set
> +CONFIG_SPLIT_PTLOCK_CPUS=4
> +CONFIG_PROC_DEVICETREE=y
> +# CONFIG_CMDLINE_BOOL is not set
> +# CONFIG_PM is not set
> +# CONFIG_SOFTWARE_SUSPEND is not set
> +# CONFIG_SECCOMP is not set
> +CONFIG_ISA_DMA_API=y
> +
> +#
> +# Bus options
> +#
> +CONFIG_PPC_I8259=y
> +CONFIG_PPC_INDIRECT_PCI=y
> +CONFIG_FSL_SOC=y
> +# CONFIG_PCI is not set
> +# CONFIG_PCI_DOMAINS is not set
> +
> +#
> +# PCCARD (PCMCIA/CardBus) support
> +#
> +# CONFIG_PCCARD is not set
> +
> +#
> +# PCI Hotplug Support
> +#
> +
> +#
> +# Advanced setup
> +#
> +# CONFIG_ADVANCED_OPTIONS is not set
> +
> +#
> +# Default settings for advanced configuration options are used
> +#
> +CONFIG_HIGHMEM_START=0xfe000000
> +CONFIG_LOWMEM_SIZE=0x30000000
> +CONFIG_KERNEL_START=0xc0000000
> +CONFIG_TASK_SIZE=0x80000000
> +CONFIG_BOOT_LOAD=0x00800000
> +
> +#
> +# Networking
> +#
> +CONFIG_NET=y
> +
> +#
> +# Networking options
> +#
> +CONFIG_PACKET=y
> +# CONFIG_PACKET_MMAP is not set
> +CONFIG_UNIX=y
> +# CONFIG_NET_KEY is not set
> +CONFIG_INET=y
> +CONFIG_IP_MULTICAST=y
> +# CONFIG_IP_ADVANCED_ROUTER is not set
> +CONFIG_IP_FIB_HASH=y
> +CONFIG_IP_PNP=y
> +CONFIG_IP_PNP_DHCP=y
> +CONFIG_IP_PNP_BOOTP=y
> +# CONFIG_IP_PNP_RARP is not set
> +# CONFIG_NET_IPIP is not set
> +# CONFIG_NET_IPGRE is not set
> +# CONFIG_IP_MROUTE is not set
> +# CONFIG_ARPD is not set
> +CONFIG_SYN_COOKIES=y
> +# CONFIG_INET_AH is not set
> +# CONFIG_INET_ESP is not set
> +# CONFIG_INET_IPCOMP is not set
> +# CONFIG_INET_TUNNEL is not set
> +CONFIG_INET_DIAG=y
> +CONFIG_INET_TCP_DIAG=y
> +# CONFIG_TCP_CONG_ADVANCED is not set
> +CONFIG_TCP_CONG_BIC=y
> +# CONFIG_IPV6 is not set
> +# CONFIG_NETFILTER is not set
> +
> +#
> +# DCCP Configuration (EXPERIMENTAL)
> +#
> +# CONFIG_IP_DCCP is not set
> +
> +#
> +# SCTP Configuration (EXPERIMENTAL)
> +#
> +# CONFIG_IP_SCTP is not set
> +# CONFIG_ATM is not set
> +# CONFIG_BRIDGE is not set
> +# CONFIG_VLAN_8021Q is not set
> +# CONFIG_DECNET is not set
> +# CONFIG_LLC2 is not set
> +# CONFIG_IPX is not set
> +# CONFIG_ATALK is not set
> +# CONFIG_X25 is not set
> +# CONFIG_LAPB is not set
> +# CONFIG_NET_DIVERT is not set
> +# CONFIG_ECONET is not set
> +# CONFIG_WAN_ROUTER is not set
> +
> +#
> +# QoS and/or fair queueing
> +#
> +# CONFIG_NET_SCHED is not set
> +
> +#
> +# 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 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_DEV_COW_COMMON is not set
> +CONFIG_BLK_DEV_LOOP=y
> +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
> +# CONFIG_BLK_DEV_NBD is not set
> +CONFIG_BLK_DEV_RAM=y
> +CONFIG_BLK_DEV_RAM_COUNT=16
> +CONFIG_BLK_DEV_RAM_SIZE=32768
> +CONFIG_BLK_DEV_INITRD=y
> +# CONFIG_CDROM_PKTCDVD is not set
> +# CONFIG_ATA_OVER_ETH is not set
> +
> +#
> +# 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
> +#
> +
> +#
> +# I2O device support
> +#
> +
> +#
> +# Macintosh device drivers
> +#
> +# CONFIG_WINDFARM is not set
> +
> +#
> +# Network device support
> +#
> +CONFIG_NETDEVICES=y
> +# CONFIG_DUMMY is not set
> +# CONFIG_BONDING is not set
> +# CONFIG_EQUALIZER is not set
> +# CONFIG_TUN is not set
> +
> +#
> +# PHY device support
> +#
> +CONFIG_PHYLIB=y
> +
> +#
> +# MII PHY device drivers
> +#
> +# CONFIG_MARVELL_PHY is not set
> +# CONFIG_DAVICOM_PHY is not set
> +# CONFIG_QSEMI_PHY is not set
> +# CONFIG_LXT_PHY is not set
> +# CONFIG_CICADA_PHY is not set
> +
> +#
> +# Ethernet (10 or 100Mbit)
> +#
> +CONFIG_NET_ETHERNET=y
> +CONFIG_MII=y
> +
> +#
> +# Ethernet (1000 Mbit)
> +#
> +CONFIG_GIANFAR=y
> +CONFIG_GFAR_NAPI=y
> +
> +#
> +# Ethernet (10000 Mbit)
> +#
> +
> +#
> +# Token Ring devices
> +#
> +
> +#
> +# Wireless LAN (non-hamradio)
> +#
> +# CONFIG_NET_RADIO is not set
> +
> +#
> +# Wan interfaces
> +#
> +# CONFIG_WAN 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 is not set
> +# 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 is not set
> +# CONFIG_GAMEPORT is not set
> +
> +#
> +# Character devices
> +#
> +# CONFIG_VT is not set
> +# CONFIG_SERIAL_NONSTANDARD is not set
> +
> +#
> +# Serial drivers
> +#
> +CONFIG_SERIAL_8250=y
> +CONFIG_SERIAL_8250_CONSOLE=y
> +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_CORE_CONSOLE=y
> +CONFIG_UNIX98_PTYS=y
> +CONFIG_LEGACY_PTYS=y
> +CONFIG_LEGACY_PTY_COUNT=256
> +
> +#
> +# IPMI
> +#
> +# CONFIG_IPMI_HANDLER is not set
> +
> +#
> +# Watchdog Cards
> +#
> +# CONFIG_WATCHDOG is not set
> +# CONFIG_NVRAM is not set
> +CONFIG_GEN_RTC=y
> +# CONFIG_GEN_RTC_X is not set
> +# CONFIG_DTLK is not set
> +# CONFIG_R3964 is not set
> +
> +#
> +# Ftape, the floppy tape device driver
> +#
> +# CONFIG_AGP is not set
> +# CONFIG_RAW_DRIVER is not set
> +
> +#
> +# TPM devices
> +#
> +# CONFIG_TCG_TPM is not set
> +# CONFIG_TELCLOCK is not set
> +
> +#
> +# I2C support
> +#
> +# CONFIG_I2C 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_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
> +
> +#
> +# Sound
> +#
> +# CONFIG_SOUND is not set
> +
> +#
> +# USB support
> +#
> +# CONFIG_USB_ARCH_HAS_HCD is not set
> +# CONFIG_USB_ARCH_HAS_OHCI 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
> +#
> +
> +#
> +# SN Devices
> +#
> +
> +#
> +# 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 is not set
> +# CONFIG_AUTOFS4_FS is not set
> +# 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_HUGETLB_PAGE is not set
> +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_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 is not set
> +# CONFIG_NFS_V4 is not set
> +# CONFIG_NFS_DIRECTIO is not set
> +# CONFIG_NFSD is not set
> +CONFIG_ROOT_NFS=y
> +CONFIG_LOCKD=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 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 is not set
> +
> +#
> +# Partition Types
> +#
> +CONFIG_PARTITION_ADVANCED=y
> +# CONFIG_ACORN_PARTITION is not set
> +# CONFIG_OSF_PARTITION is not set
> +# CONFIG_AMIGA_PARTITION is not set
> +# CONFIG_ATARI_PARTITION is not set
> +# CONFIG_MAC_PARTITION is not set
> +# CONFIG_MSDOS_PARTITION is not set
> +# CONFIG_LDM_PARTITION is not set
> +# CONFIG_SGI_PARTITION is not set
> +# CONFIG_ULTRIX_PARTITION is not set
> +# CONFIG_SUN_PARTITION is not set
> +# CONFIG_EFI_PARTITION is not set
> +
> +#
> +# Native Language Support
> +#
> +# CONFIG_NLS is not set
> +
> +#
> +# Library routines
> +#
> +# CONFIG_CRC_CCITT is not set
> +# CONFIG_CRC16 is not set
> +CONFIG_CRC32=y
> +# CONFIG_LIBCRC32C is not set
> +
> +#
> +# Instrumentation Support
> +#
> +# CONFIG_PROFILING 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=14
> +CONFIG_DETECT_SOFTLOCKUP=y
> +# CONFIG_SCHEDSTATS is not set
> +# CONFIG_DEBUG_SLAB is not set
> +CONFIG_DEBUG_MUTEXES=y
> +# CONFIG_DEBUG_SPINLOCK is not set
> +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
> +# CONFIG_DEBUG_KOBJECT is not set
> +CONFIG_DEBUG_INFO=y
> +# CONFIG_DEBUG_FS is not set
> +# CONFIG_DEBUG_VM is not set
> +# CONFIG_RCU_TORTURE_TEST is not set
> +# CONFIG_DEBUGGER is not set
> +# CONFIG_BDI_SWITCH 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 is not set
> +# CONFIG_SECURITY is not set
> +
> +#
> +# Cryptographic options
> +#
> +# CONFIG_CRYPTO is not set
> +
> +#
> +# Hardware crypto devices
> +#
> diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
> new file mode 100644
> index 0000000..5827c27
> --- /dev/null
> +++ b/arch/powerpc/kernel/head_booke.h
> @@ -0,0 +1,363 @@
> +#ifndef __HEAD_BOOKE_H__
> +#define __HEAD_BOOKE_H__
> +
> +/*
> + * Macros used for common Book-e exception handling
> + */
> +
> +#define SET_IVOR(vector_number, vector_label) \
> + li r26,vector_label@l; \
> + mtspr SPRN_IVOR##vector_number,r26; \
> + sync
> +
> +#define NORMAL_EXCEPTION_PROLOG \
> + mtspr SPRN_SPRG0,r10; /* save two registers to work with */\
> + mtspr SPRN_SPRG1,r11; \
> + mtspr SPRN_SPRG4W,r1; \
> + mfcr r10; /* save CR in r10 for now */\
> + mfspr r11,SPRN_SRR1; /* check whether user or kernel */\
> + andi. r11,r11,MSR_PR; \
> + beq 1f; \
> + mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\
> + lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
> + addi r1,r1,THREAD_SIZE; \
> +1: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
> + mr r11,r1; \
> + stw r10,_CCR(r11); /* save various registers */\
> + stw r12,GPR12(r11); \
> + stw r9,GPR9(r11); \
> + mfspr r10,SPRN_SPRG0; \
> + stw r10,GPR10(r11); \
> + mfspr r12,SPRN_SPRG1; \
> + stw r12,GPR11(r11); \
> + mflr r10; \
> + stw r10,_LINK(r11); \
> + mfspr r10,SPRN_SPRG4R; \
> + mfspr r12,SPRN_SRR0; \
> + stw r10,GPR1(r11); \
> + mfspr r9,SPRN_SRR1; \
> + stw r10,0(r11); \
> + rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
> + stw r0,GPR0(r11); \
> + SAVE_4GPRS(3, r11); \
> + SAVE_2GPRS(7, r11)
> +
> +/* To handle the additional exception priority levels on 40x and Book-E
> + * processors we allocate a 4k stack per additional priority level. The various
> + * head_xxx.S files allocate space (exception_stack_top) for each priority's
> + * stack times the number of CPUs
> + *
> + * On 40x critical is the only additional level
> + * On 44x/e500 we have critical and machine check
> + * On e200 we have critical and debug (machine check occurs via critical)
> + *
> + * Additionally we reserve a SPRG for each priority level so we can free up a
> + * GPR to use as the base for indirect access to the exception stacks. This
> + * is necessary since the MMU is always on, for Book-E parts, and the stacks
> + * are offset from KERNELBASE.
> + *
> + */
> +#define BOOKE_EXCEPTION_STACK_SIZE (8192)
> +
> +/* CRIT_SPRG only used in critical exception handling */
> +#define CRIT_SPRG SPRN_SPRG2
> +/* MCHECK_SPRG only used in machine check exception handling */
> +#define MCHECK_SPRG SPRN_SPRG6W
> +
> +#define MCHECK_STACK_TOP (exception_stack_top - 4096)
> +#define CRIT_STACK_TOP (exception_stack_top)
> +
> +/* only on e200 for now */
> +#define DEBUG_STACK_TOP (exception_stack_top - 4096)
> +#define DEBUG_SPRG SPRN_SPRG6W
> +
> +#ifdef CONFIG_SMP
> +#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
> + mfspr r8,SPRN_PIR; \
> + mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \
> + neg r8,r8; \
> + addis r8,r8,level##_STACK_TOP@ha; \
> + addi r8,r8,level##_STACK_TOP@l
> +#else
> +#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
> + lis r8,level##_STACK_TOP@h; \
> + ori r8,r8,level##_STACK_TOP@l
> +#endif
> +
> +/*
> + * Exception prolog for critical/machine check exceptions. This is a
> + * little different from the normal exception prolog above since a
> + * critical/machine check exception can potentially occur at any point
> + * during normal exception processing. Thus we cannot use the same SPRG
> + * registers as the normal prolog above. Instead we use a portion of the
> + * critical/machine check exception stack at low physical addresses.
> + */
> +#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \
> + mtspr exc_level##_SPRG,r8; \
> + BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \
> + stw r10,GPR10-INT_FRAME_SIZE(r8); \
> + stw r11,GPR11-INT_FRAME_SIZE(r8); \
> + mfcr r10; /* save CR in r10 for now */\
> + mfspr r11,exc_level_srr1; /* check whether user or kernel */\
> + andi. r11,r11,MSR_PR; \
> + mr r11,r8; \
> + mfspr r8,exc_level##_SPRG; \
> + beq 1f; \
> + /* COMING FROM USER MODE */ \
> + mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
> + lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
> + addi r11,r11,THREAD_SIZE; \
> +1: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\
> + stw r10,_CCR(r11); /* save various registers */\
> + stw r12,GPR12(r11); \
> + stw r9,GPR9(r11); \
> + mflr r10; \
> + stw r10,_LINK(r11); \
> + mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\
> + stw r12,_DEAR(r11); /* since they may have had stuff */\
> + mfspr r9,SPRN_ESR; /* in them at the point where the */\
> + stw r9,_ESR(r11); /* exception was taken */\
> + mfspr r12,exc_level_srr0; \
> + stw r1,GPR1(r11); \
> + mfspr r9,exc_level_srr1; \
> + stw r1,0(r11); \
> + mr r1,r11; \
> + rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
> + stw r0,GPR0(r11); \
> + SAVE_4GPRS(3, r11); \
> + SAVE_2GPRS(7, r11)
> +
> +#define CRITICAL_EXCEPTION_PROLOG \
> + EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1)
> +#define DEBUG_EXCEPTION_PROLOG \
> + EXC_LEVEL_EXCEPTION_PROLOG(DEBUG, SPRN_DSRR0, SPRN_DSRR1)
> +#define MCHECK_EXCEPTION_PROLOG \
> + EXC_LEVEL_EXCEPTION_PROLOG(MCHECK, SPRN_MCSRR0, SPRN_MCSRR1)
> +
> +/*
> + * Exception vectors.
> + */
> +#define START_EXCEPTION(label) \
> + .align 5; \
> +label:
> +
> +#define FINISH_EXCEPTION(func) \
> + bl transfer_to_handler_full; \
> + .long func; \
> + .long ret_from_except_full
> +
> +#define EXCEPTION(n, label, hdlr, xfer) \
> + START_EXCEPTION(label); \
> + NORMAL_EXCEPTION_PROLOG; \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + xfer(n, hdlr)
> +
> +#define CRITICAL_EXCEPTION(n, label, hdlr) \
> + START_EXCEPTION(label); \
> + CRITICAL_EXCEPTION_PROLOG; \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
> + NOCOPY, crit_transfer_to_handler, \
> + ret_from_crit_exc)
> +
> +#define MCHECK_EXCEPTION(n, label, hdlr) \
> + START_EXCEPTION(label); \
> + MCHECK_EXCEPTION_PROLOG; \
> + mfspr r5,SPRN_ESR; \
> + stw r5,_ESR(r11); \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
> + NOCOPY, mcheck_transfer_to_handler, \
> + ret_from_mcheck_exc)
> +
> +#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \
> + li r10,trap; \
> + stw r10,_TRAP(r11); \
> + lis r10,msr@h; \
> + ori r10,r10,msr@l; \
> + copyee(r10, r9); \
> + bl tfer; \
> + .long hdlr; \
> + .long ret
> +
> +#define COPY_EE(d, s) rlwimi d,s,0,16,16
> +#define NOCOPY(d, s)
> +
> +#define EXC_XFER_STD(n, hdlr) \
> + EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \
> + ret_from_except_full)
> +
> +#define EXC_XFER_LITE(n, hdlr) \
> + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
> + ret_from_except)
> +
> +#define EXC_XFER_EE(n, hdlr) \
> + EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \
> + ret_from_except_full)
> +
> +#define EXC_XFER_EE_LITE(n, hdlr) \
> + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
> + ret_from_except)
> +
> +/* Check for a single step debug exception while in an exception
> + * handler before state has been saved. This is to catch the case
> + * where an instruction that we are trying to single step causes
> + * an exception (eg ITLB/DTLB miss) and thus the first instruction of
> + * the exception handler generates a single step debug exception.
> + *
> + * If we get a debug trap on the first instruction of an exception handler,
> + * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is
> + * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR).
> + * The exception handler was handling a non-critical interrupt, so it will
> + * save (and later restore) the MSR via SPRN_CSRR1, which will still have
> + * the MSR_DE bit set.
> + */
> +#ifdef CONFIG_E200
> +#define DEBUG_EXCEPTION \
> + START_EXCEPTION(Debug); \
> + DEBUG_EXCEPTION_PROLOG; \
> + \
> + /* \
> + * If there is a single step or branch-taken exception in an \
> + * exception entry sequence, it was probably meant to apply to \
> + * the code where the exception occurred (since exception entry \
> + * doesn't turn off DE automatically). We simulate the effect \
> + * of turning off DE on entry to an exception handler by turning \
> + * off DE in the CSRR1 value and clearing the debug status. \
> + */ \
> + mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
> + andis. r10,r10,DBSR_IC@h; \
> + beq+ 2f; \
> + \
> + lis r10,KERNELBASE@h; /* check if exception in vectors */ \
> + ori r10,r10,KERNELBASE@l; \
> + cmplw r12,r10; \
> + blt+ 2f; /* addr below exception vectors */ \
> + \
> + lis r10,Debug@h; \
> + ori r10,r10,Debug@l; \
> + cmplw r12,r10; \
> + bgt+ 2f; /* addr above exception vectors */ \
> + \
> + /* here it looks like we got an inappropriate debug exception. */ \
> +1: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CDRR1 value */ \
> + lis r10,DBSR_IC@h; /* clear the IC event */ \
> + mtspr SPRN_DBSR,r10; \
> + /* restore state and get out */ \
> + lwz r10,_CCR(r11); \
> + lwz r0,GPR0(r11); \
> + lwz r1,GPR1(r11); \
> + mtcrf 0x80,r10; \
> + mtspr SPRN_DSRR0,r12; \
> + mtspr SPRN_DSRR1,r9; \
> + lwz r9,GPR9(r11); \
> + lwz r12,GPR12(r11); \
> + mtspr DEBUG_SPRG,r8; \
> + BOOKE_LOAD_EXC_LEVEL_STACK(DEBUG); /* r8 points to the debug stack */ \
> + lwz r10,GPR10-INT_FRAME_SIZE(r8); \
> + lwz r11,GPR11-INT_FRAME_SIZE(r8); \
> + mfspr r8,DEBUG_SPRG; \
> + \
> + RFDI; \
> + b .; \
> + \
> + /* continue normal handling for a critical exception... */ \
> +2: mfspr r4,SPRN_DBSR; \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, debug_transfer_to_handler, ret_from_debug_exc)
> +#else
> +#define DEBUG_EXCEPTION \
> + START_EXCEPTION(Debug); \
> + CRITICAL_EXCEPTION_PROLOG; \
> + \
> + /* \
> + * If there is a single step or branch-taken exception in an \
> + * exception entry sequence, it was probably meant to apply to \
> + * the code where the exception occurred (since exception entry \
> + * doesn't turn off DE automatically). We simulate the effect \
> + * of turning off DE on entry to an exception handler by turning \
> + * off DE in the CSRR1 value and clearing the debug status. \
> + */ \
> + mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
> + andis. r10,r10,DBSR_IC@h; \
> + beq+ 2f; \
> + \
> + lis r10,KERNELBASE@h; /* check if exception in vectors */ \
> + ori r10,r10,KERNELBASE@l; \
> + cmplw r12,r10; \
> + blt+ 2f; /* addr below exception vectors */ \
> + \
> + lis r10,Debug@h; \
> + ori r10,r10,Debug@l; \
> + cmplw r12,r10; \
> + bgt+ 2f; /* addr above exception vectors */ \
> + \
> + /* here it looks like we got an inappropriate debug exception. */ \
> +1: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CSRR1 value */ \
> + lis r10,DBSR_IC@h; /* clear the IC event */ \
> + mtspr SPRN_DBSR,r10; \
> + /* restore state and get out */ \
> + lwz r10,_CCR(r11); \
> + lwz r0,GPR0(r11); \
> + lwz r1,GPR1(r11); \
> + mtcrf 0x80,r10; \
> + mtspr SPRN_CSRR0,r12; \
> + mtspr SPRN_CSRR1,r9; \
> + lwz r9,GPR9(r11); \
> + lwz r12,GPR12(r11); \
> + mtspr CRIT_SPRG,r8; \
> + BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \
> + lwz r10,GPR10-INT_FRAME_SIZE(r8); \
> + lwz r11,GPR11-INT_FRAME_SIZE(r8); \
> + mfspr r8,CRIT_SPRG; \
> + \
> + rfci; \
> + b .; \
> + \
> + /* continue normal handling for a critical exception... */ \
> +2: mfspr r4,SPRN_DBSR; \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
> +#endif
> +
> +#define INSTRUCTION_STORAGE_EXCEPTION \
> + START_EXCEPTION(InstructionStorage) \
> + NORMAL_EXCEPTION_PROLOG; \
> + mfspr r5,SPRN_ESR; /* Grab the ESR and save it */ \
> + stw r5,_ESR(r11); \
> + mr r4,r12; /* Pass SRR0 as arg2 */ \
> + li r5,0; /* Pass zero as arg3 */ \
> + EXC_XFER_EE_LITE(0x0400, handle_page_fault)
> +
> +#define ALIGNMENT_EXCEPTION \
> + START_EXCEPTION(Alignment) \
> + NORMAL_EXCEPTION_PROLOG; \
> + mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \
> + stw r4,_DEAR(r11); \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + EXC_XFER_EE(0x0600, alignment_exception)
> +
> +#define PROGRAM_EXCEPTION \
> + START_EXCEPTION(Program) \
> + NORMAL_EXCEPTION_PROLOG; \
> + mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \
> + stw r4,_ESR(r11); \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + EXC_XFER_STD(0x0700, program_check_exception)
> +
> +#define DECREMENTER_EXCEPTION \
> + START_EXCEPTION(Decrementer) \
> + NORMAL_EXCEPTION_PROLOG; \
> + lis r0,TSR_DIS@h; /* Setup the DEC interrupt mask */ \
> + mtspr SPRN_TSR,r0; /* Clear the DEC interrupt */ \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + EXC_XFER_LITE(0x0900, timer_interrupt)
> +
> +#define FP_UNAVAILABLE_EXCEPTION \
> + START_EXCEPTION(FloatingPointUnavailable) \
> + NORMAL_EXCEPTION_PROLOG; \
> + bne load_up_fpu; /* if from user, just load it up */ \
> + addi r3,r1,STACK_FRAME_OVERHEAD; \
> + EXC_XFER_EE_LITE(0x800, KernelFP)
> +
> +#endif /* __HEAD_BOOKE_H__ */
> diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
> index c5bc282..d3d0ff7 100644
> --- a/arch/powerpc/platforms/85xx/Kconfig
> +++ b/arch/powerpc/platforms/85xx/Kconfig
> @@ -1,86 +1,30 @@
> -config 85xx
> - bool
> - depends on E500
> - default y
> -
> -config PPC_INDIRECT_PCI_BE
> - bool
> - depends on 85xx
> - default y
> -
> -menu "Freescale 85xx options"
> - depends on E500
> +menu "Platform support"
> + depends on PPC_85xx
>
> choice
> prompt "Machine Type"
> - depends on 85xx
> default MPC8540_ADS
>
> config MPC8540_ADS
> bool "Freescale MPC8540 ADS"
> help
> - This option enables support for the MPC 8540 ADS evaluation board.
> -
> -config MPC8548_CDS
> - bool "Freescale MPC8548 CDS"
> - help
> - This option enablese support for the MPC8548 CDS evaluation board.
> -
> -config MPC8555_CDS
> - bool "Freescale MPC8555 CDS"
> - help
> - This option enablese support for the MPC8555 CDS evaluation board.
> -
> -config MPC8560_ADS
> - bool "Freescale MPC8560 ADS"
> - help
> - This option enables support for the MPC 8560 ADS evaluation board.
> -
> -config SBC8560
> - bool "WindRiver PowerQUICC III SBC8560"
> - help
> - This option enables support for the WindRiver PowerQUICC III
> - SBC8560 board.
> -
> -config STX_GP3
> - bool "Silicon Turnkey Express GP3"
> - help
> - This option enables support for the Silicon Turnkey Express GP3
> - board.
> + This option enables support for the MPC 8540 ADS board
>
> endchoice
>
> -# It's often necessary to know the specific 85xx processor type.
> -# Fortunately, it is implied (so far) from the board type, so we
> -# don't need to ask more redundant questions.
> config MPC8540
> bool
> - depends on MPC8540_ADS
> - default y
> -
> -config MPC8548
> - bool
> - depends on MPC8548_CDS
> - default y
> + select PPC_UDBG_16550
> + select PPC_INDIRECT_PCI
> + default y if MPC8540_ADS
>
> -config MPC8555
> - bool
> - depends on MPC8555_CDS
> - default y
> -
> -config MPC8560
> +config PPC_INDIRECT_PCI_BE
> bool
> - depends on SBC8560 || MPC8560_ADS || STX_GP3
> - default y
> -
> -config 85xx_PCI2
> - bool "Supprt for 2nd PCI host controller"
> - depends on MPC8555_CDS
> + depends on PPC_85xx
> default y
>
> -config PPC_GEN550
> +config MPIC
> bool
> - depends on MPC8540 || SBC8560 || MPC8555
> default y
>
> endmenu
> diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
> index 6407197..a9f3b36 100644
> --- a/arch/powerpc/platforms/85xx/Makefile
> +++ b/arch/powerpc/platforms/85xx/Makefile
> @@ -1 +1,4 @@
> -# empty makefile so make clean works
> +#
> +# Makefile for the PowerPC 85xx linux kernel.
> +#
> +obj-$(CONFIG_PPC_85xx) += mpc85xx.o
> diff --git a/arch/powerpc/platforms/85xx/mpc8540_ads.h b/arch/powerpc/platforms/85xx/mpc8540_ads.h
> new file mode 100644
> index 0000000..c665efc
> --- /dev/null
> +++ b/arch/powerpc/platforms/85xx/mpc8540_ads.h
> @@ -0,0 +1,67 @@
> +/*
> + * arch/ppc/platforms/85xx/mpc8540_ads.h
> + *
> + * MPC8540ADS board definitions
> + *
> + * Maintainer: Kumar Gala <kumar.gala@freescale.com>
> + *
> + * Copyright 2004 Freescale Semiconductor Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.
> + *
> + */
> +
> +#ifndef __MACH_MPC8540ADS_H__
> +#define __MACH_MPC8540ADS_H__
> +
> +#include <linux/config.h>
> +#include <linux/initrd.h>
> +
> +#define BOARD_CCSRBAR ((uint)0xe0000000)
> +#define BCSR_ADDR ((uint)0xf8000000)
> +#define BCSR_SIZE ((uint)(32 * 1024))
> +
> +/* PCI interrupt controller */
> +#define PIRQA MPC85xx_IRQ_EXT1
> +#define PIRQB MPC85xx_IRQ_EXT2
> +#define PIRQC MPC85xx_IRQ_EXT3
> +#define PIRQD MPC85xx_IRQ_EXT4
> +
> +#define MPC85XX_PCI1_LOWER_IO 0x00000000
> +#define MPC85XX_PCI1_UPPER_IO 0x00ffffff
> +
> +#define MPC85XX_PCI1_LOWER_MEM 0x80000000
> +#define MPC85XX_PCI1_UPPER_MEM 0x9fffffff
> +
> +#define MPC85XX_PCI1_IO_BASE 0xe2000000
> +#define MPC85XX_PCI1_MEM_OFFSET 0x00000000
> +
> +#define MPC85XX_PCI1_IO_SIZE 0x01000000
> +
> +/* PCI config */
> +#define PCI1_CFG_ADDR_OFFSET (0x8000)
> +#define PCI1_CFG_DATA_OFFSET (0x8004)
> +
> +#define PCI2_CFG_ADDR_OFFSET (0x9000)
> +#define PCI2_CFG_DATA_OFFSET (0x9004)
> +
> +/* Additional register for PCI-X configuration */
> +#define PCIX_NEXT_CAP 0x60
> +#define PCIX_CAP_ID 0x61
> +#define PCIX_COMMAND 0x62
> +#define PCIX_STATUS 0x64
> +
Is this needed here anymore?
> +/* Serial Config */
> +#ifdef CONFIG_SERIAL_MANY_PORTS
> +#define RS_TABLE_SIZE 64
> +#else
> +#define RS_TABLE_SIZE 2
> +#endif
> +
> +/* Offset of CPM register space */
> +#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET)
> +
> +#endif /* __MACH_MPC8540ADS_H__ */
rename mpc85xx.c -> mpc8540_ads.c. Other boards will need to exist so we
should use mpc85xx.c for any generic 85xx.c code and not for a specific
board.
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx.c b/arch/powerpc/platforms/85xx/mpc85xx.c
> new file mode 100644
> index 0000000..417f496
> --- /dev/null
> +++ b/arch/powerpc/platforms/85xx/mpc85xx.c
> @@ -0,0 +1,257 @@
> +/*
> + * MPC85xx setup and early boot code plus other random bits.
> + *
> + * Maintained by Kumar Gala (see MAINTAINERS for contact information)
> + *
> + * Copyright 2005 Freescale Semiconductor Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.
> + */
> +
> +#include <linux/config.h>
> +#include <linux/stddef.h>
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/errno.h>
> +#include <linux/reboot.h>
> +#include <linux/pci.h>
> +#include <linux/kdev_t.h>
> +#include <linux/major.h>
> +#include <linux/console.h>
> +#include <linux/delay.h>
> +#include <linux/irq.h>
> +#include <linux/seq_file.h>
> +#include <linux/root_dev.h>
> +#include <linux/serial.h>
> +#include <linux/tty.h> /* for linux/serial_core.h */
> +#include <linux/serial_core.h>
> +#include <linux/initrd.h>
> +#include <linux/module.h>
> +#include <linux/fsl_devices.h>
> +#include <linux/serial_core.h>
> +#include <linux/serial_8250.h>
> +
> +#include <asm/system.h>
> +#include <asm/pgtable.h>
> +#include <asm/page.h>
> +#include <asm/atomic.h>
> +#include <asm/time.h>
> +#include <asm/io.h>
> +#include <asm/machdep.h>
> +#include <asm/bootinfo.h>
> +#include <asm/pci-bridge.h>
> +#include <asm/mpc85xx.h>
> +#include <asm/irq.h>
> +#include <asm/immap_85xx.h>
> +#include <asm/prom.h>
> +#include <asm/mpic.h>
> +#include <mm/mmu_decl.h>
> +#include <asm/udbg.h>
> +
Kill unused externs
> +extern unsigned long total_memory; /* in mm/init */
> +
> +extern void abort(void);
> +
> +extern void gen550_progress(char *, unsigned short);
> +extern void gen550_init(int, struct uart_port *);
> +extern phys_addr_t get_immrbase(void);
> +extern void find_legacy_serial_ports(void);
> +
> +void mpc85xx_ads_show_cpuinfo(struct seq_file *m);
> +void mpc85xx_restart(char *cmd);
> +void mpc85xx_halt(void);
> +void mpc85xx_power_off(void);
> +
> +#ifndef CONFIG_PCI
> +unsigned long isa_io_base = 0;
> +unsigned long isa_mem_base = 0;
> +#endif
> +
You dont appear to use immr_base
> +phys_addr_t immr_base;
> +
> +
> +/*
> + * Internal interrupts are all Level Sensitive, and Positive Polarity
> + *
> + * Note: Likely, this table and the following function should be
> + * obtained and derived from the OF Device Tree.
> + */
> +static u_char mpc85xx_ads_openpic_initsenses[] __initdata = {
> + MPC85XX_INTERNAL_IRQ_SENSES,
> + 0x0, /* External 0: */
> +#if defined(CONFIG_PCI)
> + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 1: PCI slot 0 */
> + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 2: PCI slot 1 */
> + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 3: PCI slot 2 */
> + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 4: PCI slot 3 */
> +#else
> + 0x0, /* External 1: */
> + 0x0, /* External 2: */
> + 0x0, /* External 3: */
> + 0x0, /* External 4: */
> +#endif
> + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 5: PHY */
> + 0x0, /* External 6: */
> + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 7: PHY */
> + 0x0, /* External 8: */
> + 0x0, /* External 9: */
> + 0x0, /* External 10: */
> + 0x0, /* External 11: */
> +};
> +
> +
> +void __init mpc85xx_pic_init(void)
> +{
> + struct mpic *mpic1;
> + /* Determine the Physical Address of the OpenPIC regs */
> + phys_addr_t OpenPIC_PAddr = immr_base + MPC85xx_OPENPIC_OFFSET;
> +
> + mpic1 = mpic_alloc(OpenPIC_PAddr,
> + MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
> + 4, MPC85xx_OPENPIC_IRQ_OFFSET, 0, 250,
> + mpc85xx_ads_openpic_initsenses,
> + sizeof(mpc85xx_ads_openpic_initsenses), " OpenPIC ");
> + BUG_ON(mpic1 == NULL);
> + mpic_assign_isu(mpic1, 0, OpenPIC_PAddr + 0x10200);
> + mpic_assign_isu(mpic1, 1, OpenPIC_PAddr + 0x10280);
> + mpic_assign_isu(mpic1, 2, OpenPIC_PAddr + 0x10300);
> + mpic_assign_isu(mpic1, 3, OpenPIC_PAddr + 0x10380);
> + mpic_assign_isu(mpic1, 4, OpenPIC_PAddr + 0x10400);
> + mpic_assign_isu(mpic1, 5, OpenPIC_PAddr + 0x10480);
> + mpic_assign_isu(mpic1, 6, OpenPIC_PAddr + 0x10500);
> + mpic_assign_isu(mpic1, 7, OpenPIC_PAddr + 0x10580);
> +
> + /* dummy mappings to get to 48 */
> + mpic_assign_isu(mpic1, 8, OpenPIC_PAddr + 0x10600);
> + mpic_assign_isu(mpic1, 9, OpenPIC_PAddr + 0x10680);
> + mpic_assign_isu(mpic1, 10, OpenPIC_PAddr + 0x10700);
> + mpic_assign_isu(mpic1, 11, OpenPIC_PAddr + 0x10780);
> +
> + /* External ints */
> + mpic_assign_isu(mpic1, 12, OpenPIC_PAddr + 0x10000);
> + mpic_assign_isu(mpic1, 13, OpenPIC_PAddr + 0x10080);
> + mpic_assign_isu(mpic1, 14, OpenPIC_PAddr + 0x10100);
> + mpic_init(mpic1);
> +}
> +
> +
> +/*
> + * Setup the architecture
> + */
> +
> +static void __init
> +mpc85xx_setup_arch(void)
> +{
> + struct device_node *cpu;
> +
> + if (ppc_md.progress)
> + ppc_md.progress("mpc85xx_setup_arch()", 0);
> +
> + cpu = of_find_node_by_type(NULL, "cpu");
> + if (cpu != 0) {
> + unsigned int *fp;
> +
> + fp = (int *)get_property(cpu, "clock-frequency", NULL);
> + if (fp != 0)
> + loops_per_jiffy = *fp / HZ;
> + else
> + loops_per_jiffy = 50000000 / HZ;
> + of_node_put(cpu);
> + }
> +
kill this immr_base not used.
> + immr_base = get_immrbase();
> +
kill this ifdef not used
> +#ifdef CONFIG_SERIAL_TEXT_DEBUG
> + /*
> + * Invalidate the entry we stole earlier.
> + * The serial ports should be properly mapped.
> + */
> + invalidate_tlbcam_entry(num_tlbcam_entries - 1);
> +#endif
> +
> +#ifdef CONFIG_ROOT_NFS
> + ROOT_DEV = Root_NFS;
> +#else
> + ROOT_DEV = Root_HDA1;
> +#endif
> +}
> +
> +
> +void __init
> +platform_init(void)
> +{
> + ppc_md.setup_arch = mpc85xx_setup_arch;
> + ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo;
> +
> + ppc_md.init_IRQ = mpc85xx_pic_init;
> + ppc_md.get_irq = mpic_get_irq;
> +
Move mpc85xx_restart into mpc85xx.c since it's generic
> + ppc_md.restart = mpc85xx_restart;
Don't bother setting power_off & halt. My updated patch lets these be
NULL and the default behavior matches what you have in this file (and kill
mpc85xx_power_off & mpc85xx_halt)
> + ppc_md.power_off = mpc85xx_power_off;
> + ppc_md.halt = mpc85xx_halt;
> +
> + ppc_md.time_init = NULL;
> + ppc_md.set_rtc_time = NULL;
> + ppc_md.get_rtc_time = NULL;
> + ppc_md.calibrate_decr = generic_calibrate_decr;
> +
> + ppc_md.progress = udbg_progress;
> +
> + if (ppc_md.progress)
> + ppc_md.progress("mpc85xx platform_init(): exit", 0);
> +}
> +
> +void
> +mpc85xx_restart(char *cmd)
> +{
> + local_irq_disable();
> + abort();
> +}
> +
> +void
> +mpc85xx_power_off(void)
> +{
> + local_irq_disable();
> + for(;;);
> +}
> +
> +void
> +mpc85xx_halt(void)
> +{
> + local_irq_disable();
> + for(;;);
> +}
> +
> +/* For now this is a pass through */
> +phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
> +{
> + return addr;
> +};
> +EXPORT_SYMBOL(fixup_bigphys_addr);
> +
> +
> +
> +void
> +mpc85xx_ads_show_cpuinfo(struct seq_file *m)
> +{
> + uint pvid, svid, phid1;
> + uint memsize = total_memory;
> +
> + pvid = mfspr(SPRN_PVR);
> + svid = mfspr(SPRN_SVR);
> +
> + seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
> + seq_printf(m, "Machine\t\t: mpc85xx\n");
> + seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
> + seq_printf(m, "SVR\t\t: 0x%x\n", svid);
> +
> + /* Display cpu Pll setting */
> + phid1 = mfspr(SPRN_HID1);
> + seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
> +
> + /* Display the amount of memory */
> + seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
> +}
> diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
> index 04073fd..c4f6b0d 100644
> --- a/arch/powerpc/platforms/Makefile
> +++ b/arch/powerpc/platforms/Makefile
> @@ -8,7 +8,7 @@ endif
> obj-$(CONFIG_PPC_CHRP) += chrp/
> obj-$(CONFIG_4xx) += 4xx/
> obj-$(CONFIG_PPC_83xx) += 83xx/
> -obj-$(CONFIG_85xx) += 85xx/
> +obj-$(CONFIG_PPC_85xx) += 85xx/
> obj-$(CONFIG_PPC_PSERIES) += pseries/
> obj-$(CONFIG_PPC_ISERIES) += iseries/
> obj-$(CONFIG_PPC_MAPLE) += maple/
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
^ permalink raw reply
* [PATCH] macio-adb build fix
From: David Woodhouse @ 2006-01-14 0:15 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
This makes macio-adb.c build again. Entirely untested.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
--- drivers/macintosh/macio-adb.c~ 2006-01-03 03:21:10.000000000 +0000
+++ drivers/macintosh/macio-adb.c 2006-01-14 00:13:43.000000000 +0000
@@ -17,6 +17,7 @@
#include <asm/irq.h>
#include <asm/system.h>
#include <linux/init.h>
+#include <linux/ioport.h>
struct preg {
unsigned char r;
@@ -88,24 +89,26 @@ int macio_probe(void)
int macio_init(void)
{
struct device_node *adbs;
+ struct resource r;
adbs = find_compatible_devices("adb", "chrp,adb0");
if (adbs == 0)
return -ENXIO;
#if 0
- { int i;
+ { int i = 0;
printk("macio_adb_init: node = %p, addrs =", adbs->node);
- for (i = 0; i < adbs->n_addrs; ++i)
- printk(" %x(%x)", adbs->addrs[i].address, adbs->addrs[i].size);
+ while(!of_address_to_resource(adbs, i, &r))
+ printk(" %x(%x)", r.start, r.end - r.start);
printk(", intrs =");
for (i = 0; i < adbs->n_intrs; ++i)
printk(" %x", adbs->intrs[i].line);
printk("\n"); }
#endif
-
- adb = ioremap(adbs->addrs->address, sizeof(struct adb_regs));
+ if (of_address_to_resource(adbs, 0, &r))
+ return -ENXIO;
+ adb = ioremap(r.start, sizeof(struct adb_regs));
out_8(&adb->ctrl.r, 0);
out_8(&adb->intr.r, 0);
--
dwmw2
^ permalink raw reply
* [PATCH] Make CHRP build again
From: David Woodhouse @ 2006-01-14 0:13 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
This makes CHRP build again, although it's untested because my Pegasos
is currently in pieces.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
--- arch/powerpc/platforms/chrp/setup.c~ 2006-01-13 15:26:41.000000000 +0000
+++ arch/powerpc/platforms/chrp/setup.c 2006-01-13 23:44:29.000000000 +0000
@@ -352,9 +352,10 @@ static void __init chrp_find_openpic(voi
opaddr = opprop[na-1]; /* assume 32-bit */
oplen /= na * sizeof(unsigned int);
} else {
- if (np->n_addrs == 0)
+ struct resource r;
+ if (of_address_to_resource(np, 0, &r))
return;
- opaddr = np->addrs[0].address;
+ opaddr = r.start;
oplen = 0;
}
@@ -377,7 +378,7 @@ static void __init chrp_find_openpic(voi
*/
if (oplen < len) {
printk(KERN_ERR "Insufficient addresses for distributed"
- " OpenPIC (%d < %d)\n", np->n_addrs, len);
+ " OpenPIC (%d < %d)\n", oplen, len);
len = oplen;
}
--- arch/powerpc/platforms/chrp/time.c~ 2006-01-03 03:21:10.000000000 +0000
+++ arch/powerpc/platforms/chrp/time.c 2006-01-13 23:54:44.000000000 +0000
@@ -21,6 +21,7 @@
#include <linux/mc146818rtc.h>
#include <linux/init.h>
#include <linux/bcd.h>
+#include <linux/ioport.h>
#include <asm/io.h>
#include <asm/nvram.h>
@@ -37,14 +38,16 @@ static int nvram_data = NVRAM_DATA;
long __init chrp_time_init(void)
{
struct device_node *rtcs;
+ struct resource r;
int base;
rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
if (rtcs == NULL)
rtcs = find_compatible_devices("rtc", "ds1385-rtc");
- if (rtcs == NULL || rtcs->addrs == NULL)
+ if (rtcs == NULL || of_address_to_resource(rtcs, 0, &r))
return 0;
- base = rtcs->addrs[0].address;
+
+ base = r.start;
nvram_as1 = 0;
nvram_as0 = base;
nvram_data = base + 1;
--- arch/powerpc/platforms/chrp/pci.c~ 2006-01-03 03:21:10.000000000 +0000
+++ arch/powerpc/platforms/chrp/pci.c 2006-01-14 00:03:36.000000000 +0000
@@ -135,12 +135,13 @@ int __init
hydra_init(void)
{
struct device_node *np;
+ struct resource r;
np = find_devices("mac-io");
- if (np == NULL || np->n_addrs == 0)
+ if (np == NULL || of_address_to_resource(np, 0, &r))
return 0;
- Hydra = ioremap(np->addrs[0].address, np->addrs[0].size);
- printk("Hydra Mac I/O at %lx\n", np->addrs[0].address);
+ Hydra = ioremap(r.start, r.end-r.start);
+ printk("Hydra Mac I/O at %lx\n", r.start);
printk("Hydra Feature_Control was %x",
in_le32(&Hydra->Feature_Control));
out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN |
@@ -177,18 +178,24 @@ setup_python(struct pci_controller *hose
{
u32 __iomem *reg;
u32 val;
- unsigned long addr = dev->addrs[0].address;
+ struct resource r;
- setup_indirect_pci(hose, addr + 0xf8000, addr + 0xf8010);
+ if (of_address_to_resource(dev, 0, &r)) {
+ printk(KERN_ERR "No address for Python PCI controller\n");
+ return;
+ }
/* Clear the magic go-slow bit */
- reg = ioremap(dev->addrs[0].address + 0xf6000, 0x40);
+ reg = ioremap(r.start + 0xf6000, 0x40);
+ BUG_ON(!reg);
val = in_be32(®[12]);
if (val & PRG_CL_RESET_VALID) {
out_be32(®[12], val & ~PRG_CL_RESET_VALID);
in_be32(®[12]);
}
iounmap(reg);
+
+ setup_indirect_pci(hose, r.start + 0xf8000, r.start + 0xf8010);
}
/* Marvell Discovery II based Pegasos 2 */
@@ -218,7 +225,7 @@ chrp_find_bridges(void)
char *model, *machine;
int is_longtrail = 0, is_mot = 0, is_pegasos = 0;
struct device_node *root = find_path_device("/");
-
+ struct resource r;
/*
* The PCI host bridge nodes on some machines don't have
* properties to adequately identify them, so we have to
@@ -238,7 +245,7 @@ chrp_find_bridges(void)
continue;
++index;
/* The GG2 bridge on the LongTrail doesn't have an address */
- if (dev->n_addrs < 1 && !is_longtrail) {
+ if (of_address_to_resource(dev, 0, &r) && !is_longtrail) {
printk(KERN_WARNING "Can't use %s: no address\n",
dev->full_name);
continue;
@@ -255,8 +262,8 @@ chrp_find_bridges(void)
printk(KERN_INFO "PCI buses %d..%d",
bus_range[0], bus_range[1]);
printk(" controlled by %s", dev->type);
- if (dev->n_addrs > 0)
- printk(" at %lx", dev->addrs[0].address);
+ if (!is_longtrail)
+ printk(" at %lx", r.start);
printk("\n");
hose = pcibios_alloc_controller();
--
dwmw2
^ permalink raw reply
* [PATCH] Initial MPC8540 ADS port with OF Flat Dev
From: Jon Loeliger @ 2006-01-13 23:28 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org
Initial support for MPC8540 ADS with Flat Device tree.
Does not yet include PCI or I2C.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
--
arch/powerpc/Kconfig | 23 +
arch/powerpc/configs/mpc8540_ads_defconfig | 723 ++++++++++++++++++++++++++++
arch/powerpc/kernel/head_booke.h | 363 ++++++++++++++
arch/powerpc/platforms/85xx/Kconfig | 74 ---
arch/powerpc/platforms/85xx/Makefile | 5
arch/powerpc/platforms/85xx/mpc8540_ads.h | 67 +++
arch/powerpc/platforms/85xx/mpc85xx.c | 257 ++++++++++
arch/powerpc/platforms/Makefile | 2
8 files changed, 1441 insertions(+), 73 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a8d2f2d..898047d 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -138,6 +138,12 @@ config PPC_83xx
select 83xx
select PPC_FPU
+config PPC_85xx
+ bool "Freescale 85xx"
+ select E500
+ select FSL_SOC
+ select 85xx
+
config 40x
bool "AMCC 40x"
@@ -150,8 +156,6 @@ config 8xx
config E200
bool "Freescale e200"
-config E500
- bool "Freescale e500"
endchoice
config POWER4_ONLY
@@ -179,6 +183,12 @@ config 6xx
config 83xx
bool
+config 85xx
+ bool
+
+config E500
+ bool
+
config PPC_FPU
bool
default y if PPC64
@@ -228,6 +238,7 @@ config ALTIVEC
config SPE
bool "SPE Support"
depends on E200 || E500
+ default y
---help---
This option enables kernel support for the Signal Processing
Extensions (SPE) to the PowerPC processor. The kernel currently
@@ -735,13 +746,13 @@ config GENERIC_ISA_DMA
config PPC_I8259
bool
- default y if 85xx
+ default y if PPC_85xx
default n
config PPC_INDIRECT_PCI
bool
depends on PCI
- default y if 40x || 44x || 85xx
+ default y if 40x || 44x || PPC_85xx
default n
config EISA
@@ -758,8 +769,8 @@ config MCA
bool
config PCI
- bool "PCI support" if 40x || CPM2 || PPC_83xx || 85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES)
- default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx && !85xx
+ bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES)
+ default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx && !PPC_85xx
default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
default PCI_QSPAN if !4xx && !CPM2 && 8xx
help
diff --git a/arch/powerpc/configs/mpc8540_ads_defconfig b/arch/powerpc/configs/mpc8540_ads_defconfig
new file mode 100644
index 0000000..b7489f8
--- /dev/null
+++ b/arch/powerpc/configs/mpc8540_ads_defconfig
@@ -0,0 +1,723 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.15-g2554f1e1-dirty
+# Thu Jan 12 16:29:46 2006
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=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_GENERIC_NVRAM=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 is not set
+CONFIG_DEFAULT_UIMAGE=y
+
+#
+# Processor support
+#
+# CONFIG_CLASSIC32 is not set
+# CONFIG_PPC_52xx is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+CONFIG_85xx=y
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+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 is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EMBEDDED=y
+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
+#
+# CONFIG_LBD is not set
+
+#
+# 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"
+CONFIG_MPIC=y
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Platform support
+#
+CONFIG_MPC8540_ADS=y
+CONFIG_MPC8540=y
+CONFIG_PPC_INDIRECT_PCI_BE=y
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# 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_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_MATH_EMULATION=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_SECCOMP is not set
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_PPC_I8259=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+# CONFIG_IPV6 is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# 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 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_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=32768
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# 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
+#
+
+#
+# I2O device support
+#
+
+#
+# Macintosh device drivers
+#
+# CONFIG_WINDFARM is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_GIANFAR=y
+CONFIG_GFAR_NAPI=y
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN 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 is not set
+# 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 is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+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_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C 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_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
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI 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
+#
+
+#
+# SN Devices
+#
+
+#
+# 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 is not set
+# CONFIG_AUTOFS4_FS is not set
+# 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_HUGETLB_PAGE is not set
+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_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 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=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 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 is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING 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=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUGGER is not set
+# CONFIG_BDI_SWITCH 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 is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
new file mode 100644
index 0000000..5827c27
--- /dev/null
+++ b/arch/powerpc/kernel/head_booke.h
@@ -0,0 +1,363 @@
+#ifndef __HEAD_BOOKE_H__
+#define __HEAD_BOOKE_H__
+
+/*
+ * Macros used for common Book-e exception handling
+ */
+
+#define SET_IVOR(vector_number, vector_label) \
+ li r26,vector_label@l; \
+ mtspr SPRN_IVOR##vector_number,r26; \
+ sync
+
+#define NORMAL_EXCEPTION_PROLOG \
+ mtspr SPRN_SPRG0,r10; /* save two registers to work with */\
+ mtspr SPRN_SPRG1,r11; \
+ mtspr SPRN_SPRG4W,r1; \
+ mfcr r10; /* save CR in r10 for now */\
+ mfspr r11,SPRN_SRR1; /* check whether user or kernel */\
+ andi. r11,r11,MSR_PR; \
+ beq 1f; \
+ mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\
+ lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
+ addi r1,r1,THREAD_SIZE; \
+1: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
+ mr r11,r1; \
+ stw r10,_CCR(r11); /* save various registers */\
+ stw r12,GPR12(r11); \
+ stw r9,GPR9(r11); \
+ mfspr r10,SPRN_SPRG0; \
+ stw r10,GPR10(r11); \
+ mfspr r12,SPRN_SPRG1; \
+ stw r12,GPR11(r11); \
+ mflr r10; \
+ stw r10,_LINK(r11); \
+ mfspr r10,SPRN_SPRG4R; \
+ mfspr r12,SPRN_SRR0; \
+ stw r10,GPR1(r11); \
+ mfspr r9,SPRN_SRR1; \
+ stw r10,0(r11); \
+ rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
+ stw r0,GPR0(r11); \
+ SAVE_4GPRS(3, r11); \
+ SAVE_2GPRS(7, r11)
+
+/* To handle the additional exception priority levels on 40x and Book-E
+ * processors we allocate a 4k stack per additional priority level. The various
+ * head_xxx.S files allocate space (exception_stack_top) for each priority's
+ * stack times the number of CPUs
+ *
+ * On 40x critical is the only additional level
+ * On 44x/e500 we have critical and machine check
+ * On e200 we have critical and debug (machine check occurs via critical)
+ *
+ * Additionally we reserve a SPRG for each priority level so we can free up a
+ * GPR to use as the base for indirect access to the exception stacks. This
+ * is necessary since the MMU is always on, for Book-E parts, and the stacks
+ * are offset from KERNELBASE.
+ *
+ */
+#define BOOKE_EXCEPTION_STACK_SIZE (8192)
+
+/* CRIT_SPRG only used in critical exception handling */
+#define CRIT_SPRG SPRN_SPRG2
+/* MCHECK_SPRG only used in machine check exception handling */
+#define MCHECK_SPRG SPRN_SPRG6W
+
+#define MCHECK_STACK_TOP (exception_stack_top - 4096)
+#define CRIT_STACK_TOP (exception_stack_top)
+
+/* only on e200 for now */
+#define DEBUG_STACK_TOP (exception_stack_top - 4096)
+#define DEBUG_SPRG SPRN_SPRG6W
+
+#ifdef CONFIG_SMP
+#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
+ mfspr r8,SPRN_PIR; \
+ mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \
+ neg r8,r8; \
+ addis r8,r8,level##_STACK_TOP@ha; \
+ addi r8,r8,level##_STACK_TOP@l
+#else
+#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
+ lis r8,level##_STACK_TOP@h; \
+ ori r8,r8,level##_STACK_TOP@l
+#endif
+
+/*
+ * Exception prolog for critical/machine check exceptions. This is a
+ * little different from the normal exception prolog above since a
+ * critical/machine check exception can potentially occur at any point
+ * during normal exception processing. Thus we cannot use the same SPRG
+ * registers as the normal prolog above. Instead we use a portion of the
+ * critical/machine check exception stack at low physical addresses.
+ */
+#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \
+ mtspr exc_level##_SPRG,r8; \
+ BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \
+ stw r10,GPR10-INT_FRAME_SIZE(r8); \
+ stw r11,GPR11-INT_FRAME_SIZE(r8); \
+ mfcr r10; /* save CR in r10 for now */\
+ mfspr r11,exc_level_srr1; /* check whether user or kernel */\
+ andi. r11,r11,MSR_PR; \
+ mr r11,r8; \
+ mfspr r8,exc_level##_SPRG; \
+ beq 1f; \
+ /* COMING FROM USER MODE */ \
+ mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
+ lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
+ addi r11,r11,THREAD_SIZE; \
+1: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\
+ stw r10,_CCR(r11); /* save various registers */\
+ stw r12,GPR12(r11); \
+ stw r9,GPR9(r11); \
+ mflr r10; \
+ stw r10,_LINK(r11); \
+ mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\
+ stw r12,_DEAR(r11); /* since they may have had stuff */\
+ mfspr r9,SPRN_ESR; /* in them at the point where the */\
+ stw r9,_ESR(r11); /* exception was taken */\
+ mfspr r12,exc_level_srr0; \
+ stw r1,GPR1(r11); \
+ mfspr r9,exc_level_srr1; \
+ stw r1,0(r11); \
+ mr r1,r11; \
+ rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
+ stw r0,GPR0(r11); \
+ SAVE_4GPRS(3, r11); \
+ SAVE_2GPRS(7, r11)
+
+#define CRITICAL_EXCEPTION_PROLOG \
+ EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1)
+#define DEBUG_EXCEPTION_PROLOG \
+ EXC_LEVEL_EXCEPTION_PROLOG(DEBUG, SPRN_DSRR0, SPRN_DSRR1)
+#define MCHECK_EXCEPTION_PROLOG \
+ EXC_LEVEL_EXCEPTION_PROLOG(MCHECK, SPRN_MCSRR0, SPRN_MCSRR1)
+
+/*
+ * Exception vectors.
+ */
+#define START_EXCEPTION(label) \
+ .align 5; \
+label:
+
+#define FINISH_EXCEPTION(func) \
+ bl transfer_to_handler_full; \
+ .long func; \
+ .long ret_from_except_full
+
+#define EXCEPTION(n, label, hdlr, xfer) \
+ START_EXCEPTION(label); \
+ NORMAL_EXCEPTION_PROLOG; \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ xfer(n, hdlr)
+
+#define CRITICAL_EXCEPTION(n, label, hdlr) \
+ START_EXCEPTION(label); \
+ CRITICAL_EXCEPTION_PROLOG; \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
+ NOCOPY, crit_transfer_to_handler, \
+ ret_from_crit_exc)
+
+#define MCHECK_EXCEPTION(n, label, hdlr) \
+ START_EXCEPTION(label); \
+ MCHECK_EXCEPTION_PROLOG; \
+ mfspr r5,SPRN_ESR; \
+ stw r5,_ESR(r11); \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
+ NOCOPY, mcheck_transfer_to_handler, \
+ ret_from_mcheck_exc)
+
+#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \
+ li r10,trap; \
+ stw r10,_TRAP(r11); \
+ lis r10,msr@h; \
+ ori r10,r10,msr@l; \
+ copyee(r10, r9); \
+ bl tfer; \
+ .long hdlr; \
+ .long ret
+
+#define COPY_EE(d, s) rlwimi d,s,0,16,16
+#define NOCOPY(d, s)
+
+#define EXC_XFER_STD(n, hdlr) \
+ EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \
+ ret_from_except_full)
+
+#define EXC_XFER_LITE(n, hdlr) \
+ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
+ ret_from_except)
+
+#define EXC_XFER_EE(n, hdlr) \
+ EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \
+ ret_from_except_full)
+
+#define EXC_XFER_EE_LITE(n, hdlr) \
+ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
+ ret_from_except)
+
+/* Check for a single step debug exception while in an exception
+ * handler before state has been saved. This is to catch the case
+ * where an instruction that we are trying to single step causes
+ * an exception (eg ITLB/DTLB miss) and thus the first instruction of
+ * the exception handler generates a single step debug exception.
+ *
+ * If we get a debug trap on the first instruction of an exception handler,
+ * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is
+ * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR).
+ * The exception handler was handling a non-critical interrupt, so it will
+ * save (and later restore) the MSR via SPRN_CSRR1, which will still have
+ * the MSR_DE bit set.
+ */
+#ifdef CONFIG_E200
+#define DEBUG_EXCEPTION \
+ START_EXCEPTION(Debug); \
+ DEBUG_EXCEPTION_PROLOG; \
+ \
+ /* \
+ * If there is a single step or branch-taken exception in an \
+ * exception entry sequence, it was probably meant to apply to \
+ * the code where the exception occurred (since exception entry \
+ * doesn't turn off DE automatically). We simulate the effect \
+ * of turning off DE on entry to an exception handler by turning \
+ * off DE in the CSRR1 value and clearing the debug status. \
+ */ \
+ mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
+ andis. r10,r10,DBSR_IC@h; \
+ beq+ 2f; \
+ \
+ lis r10,KERNELBASE@h; /* check if exception in vectors */ \
+ ori r10,r10,KERNELBASE@l; \
+ cmplw r12,r10; \
+ blt+ 2f; /* addr below exception vectors */ \
+ \
+ lis r10,Debug@h; \
+ ori r10,r10,Debug@l; \
+ cmplw r12,r10; \
+ bgt+ 2f; /* addr above exception vectors */ \
+ \
+ /* here it looks like we got an inappropriate debug exception. */ \
+1: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CDRR1 value */ \
+ lis r10,DBSR_IC@h; /* clear the IC event */ \
+ mtspr SPRN_DBSR,r10; \
+ /* restore state and get out */ \
+ lwz r10,_CCR(r11); \
+ lwz r0,GPR0(r11); \
+ lwz r1,GPR1(r11); \
+ mtcrf 0x80,r10; \
+ mtspr SPRN_DSRR0,r12; \
+ mtspr SPRN_DSRR1,r9; \
+ lwz r9,GPR9(r11); \
+ lwz r12,GPR12(r11); \
+ mtspr DEBUG_SPRG,r8; \
+ BOOKE_LOAD_EXC_LEVEL_STACK(DEBUG); /* r8 points to the debug stack */ \
+ lwz r10,GPR10-INT_FRAME_SIZE(r8); \
+ lwz r11,GPR11-INT_FRAME_SIZE(r8); \
+ mfspr r8,DEBUG_SPRG; \
+ \
+ RFDI; \
+ b .; \
+ \
+ /* continue normal handling for a critical exception... */ \
+2: mfspr r4,SPRN_DBSR; \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, debug_transfer_to_handler, ret_from_debug_exc)
+#else
+#define DEBUG_EXCEPTION \
+ START_EXCEPTION(Debug); \
+ CRITICAL_EXCEPTION_PROLOG; \
+ \
+ /* \
+ * If there is a single step or branch-taken exception in an \
+ * exception entry sequence, it was probably meant to apply to \
+ * the code where the exception occurred (since exception entry \
+ * doesn't turn off DE automatically). We simulate the effect \
+ * of turning off DE on entry to an exception handler by turning \
+ * off DE in the CSRR1 value and clearing the debug status. \
+ */ \
+ mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
+ andis. r10,r10,DBSR_IC@h; \
+ beq+ 2f; \
+ \
+ lis r10,KERNELBASE@h; /* check if exception in vectors */ \
+ ori r10,r10,KERNELBASE@l; \
+ cmplw r12,r10; \
+ blt+ 2f; /* addr below exception vectors */ \
+ \
+ lis r10,Debug@h; \
+ ori r10,r10,Debug@l; \
+ cmplw r12,r10; \
+ bgt+ 2f; /* addr above exception vectors */ \
+ \
+ /* here it looks like we got an inappropriate debug exception. */ \
+1: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CSRR1 value */ \
+ lis r10,DBSR_IC@h; /* clear the IC event */ \
+ mtspr SPRN_DBSR,r10; \
+ /* restore state and get out */ \
+ lwz r10,_CCR(r11); \
+ lwz r0,GPR0(r11); \
+ lwz r1,GPR1(r11); \
+ mtcrf 0x80,r10; \
+ mtspr SPRN_CSRR0,r12; \
+ mtspr SPRN_CSRR1,r9; \
+ lwz r9,GPR9(r11); \
+ lwz r12,GPR12(r11); \
+ mtspr CRIT_SPRG,r8; \
+ BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \
+ lwz r10,GPR10-INT_FRAME_SIZE(r8); \
+ lwz r11,GPR11-INT_FRAME_SIZE(r8); \
+ mfspr r8,CRIT_SPRG; \
+ \
+ rfci; \
+ b .; \
+ \
+ /* continue normal handling for a critical exception... */ \
+2: mfspr r4,SPRN_DBSR; \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
+#endif
+
+#define INSTRUCTION_STORAGE_EXCEPTION \
+ START_EXCEPTION(InstructionStorage) \
+ NORMAL_EXCEPTION_PROLOG; \
+ mfspr r5,SPRN_ESR; /* Grab the ESR and save it */ \
+ stw r5,_ESR(r11); \
+ mr r4,r12; /* Pass SRR0 as arg2 */ \
+ li r5,0; /* Pass zero as arg3 */ \
+ EXC_XFER_EE_LITE(0x0400, handle_page_fault)
+
+#define ALIGNMENT_EXCEPTION \
+ START_EXCEPTION(Alignment) \
+ NORMAL_EXCEPTION_PROLOG; \
+ mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \
+ stw r4,_DEAR(r11); \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ EXC_XFER_EE(0x0600, alignment_exception)
+
+#define PROGRAM_EXCEPTION \
+ START_EXCEPTION(Program) \
+ NORMAL_EXCEPTION_PROLOG; \
+ mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \
+ stw r4,_ESR(r11); \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ EXC_XFER_STD(0x0700, program_check_exception)
+
+#define DECREMENTER_EXCEPTION \
+ START_EXCEPTION(Decrementer) \
+ NORMAL_EXCEPTION_PROLOG; \
+ lis r0,TSR_DIS@h; /* Setup the DEC interrupt mask */ \
+ mtspr SPRN_TSR,r0; /* Clear the DEC interrupt */ \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ EXC_XFER_LITE(0x0900, timer_interrupt)
+
+#define FP_UNAVAILABLE_EXCEPTION \
+ START_EXCEPTION(FloatingPointUnavailable) \
+ NORMAL_EXCEPTION_PROLOG; \
+ bne load_up_fpu; /* if from user, just load it up */ \
+ addi r3,r1,STACK_FRAME_OVERHEAD; \
+ EXC_XFER_EE_LITE(0x800, KernelFP)
+
+#endif /* __HEAD_BOOKE_H__ */
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index c5bc282..d3d0ff7 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -1,86 +1,30 @@
-config 85xx
- bool
- depends on E500
- default y
-
-config PPC_INDIRECT_PCI_BE
- bool
- depends on 85xx
- default y
-
-menu "Freescale 85xx options"
- depends on E500
+menu "Platform support"
+ depends on PPC_85xx
choice
prompt "Machine Type"
- depends on 85xx
default MPC8540_ADS
config MPC8540_ADS
bool "Freescale MPC8540 ADS"
help
- This option enables support for the MPC 8540 ADS evaluation board.
-
-config MPC8548_CDS
- bool "Freescale MPC8548 CDS"
- help
- This option enablese support for the MPC8548 CDS evaluation board.
-
-config MPC8555_CDS
- bool "Freescale MPC8555 CDS"
- help
- This option enablese support for the MPC8555 CDS evaluation board.
-
-config MPC8560_ADS
- bool "Freescale MPC8560 ADS"
- help
- This option enables support for the MPC 8560 ADS evaluation board.
-
-config SBC8560
- bool "WindRiver PowerQUICC III SBC8560"
- help
- This option enables support for the WindRiver PowerQUICC III
- SBC8560 board.
-
-config STX_GP3
- bool "Silicon Turnkey Express GP3"
- help
- This option enables support for the Silicon Turnkey Express GP3
- board.
+ This option enables support for the MPC 8540 ADS board
endchoice
-# It's often necessary to know the specific 85xx processor type.
-# Fortunately, it is implied (so far) from the board type, so we
-# don't need to ask more redundant questions.
config MPC8540
bool
- depends on MPC8540_ADS
- default y
-
-config MPC8548
- bool
- depends on MPC8548_CDS
- default y
+ select PPC_UDBG_16550
+ select PPC_INDIRECT_PCI
+ default y if MPC8540_ADS
-config MPC8555
- bool
- depends on MPC8555_CDS
- default y
-
-config MPC8560
+config PPC_INDIRECT_PCI_BE
bool
- depends on SBC8560 || MPC8560_ADS || STX_GP3
- default y
-
-config 85xx_PCI2
- bool "Supprt for 2nd PCI host controller"
- depends on MPC8555_CDS
+ depends on PPC_85xx
default y
-config PPC_GEN550
+config MPIC
bool
- depends on MPC8540 || SBC8560 || MPC8555
default y
endmenu
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index 6407197..a9f3b36 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -1 +1,4 @@
-# empty makefile so make clean works
+#
+# Makefile for the PowerPC 85xx linux kernel.
+#
+obj-$(CONFIG_PPC_85xx) += mpc85xx.o
diff --git a/arch/powerpc/platforms/85xx/mpc8540_ads.h b/arch/powerpc/platforms/85xx/mpc8540_ads.h
new file mode 100644
index 0000000..c665efc
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc8540_ads.h
@@ -0,0 +1,67 @@
+/*
+ * arch/ppc/platforms/85xx/mpc8540_ads.h
+ *
+ * MPC8540ADS board definitions
+ *
+ * Maintainer: Kumar Gala <kumar.gala@freescale.com>
+ *
+ * Copyright 2004 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
+
+#ifndef __MACH_MPC8540ADS_H__
+#define __MACH_MPC8540ADS_H__
+
+#include <linux/config.h>
+#include <linux/initrd.h>
+
+#define BOARD_CCSRBAR ((uint)0xe0000000)
+#define BCSR_ADDR ((uint)0xf8000000)
+#define BCSR_SIZE ((uint)(32 * 1024))
+
+/* PCI interrupt controller */
+#define PIRQA MPC85xx_IRQ_EXT1
+#define PIRQB MPC85xx_IRQ_EXT2
+#define PIRQC MPC85xx_IRQ_EXT3
+#define PIRQD MPC85xx_IRQ_EXT4
+
+#define MPC85XX_PCI1_LOWER_IO 0x00000000
+#define MPC85XX_PCI1_UPPER_IO 0x00ffffff
+
+#define MPC85XX_PCI1_LOWER_MEM 0x80000000
+#define MPC85XX_PCI1_UPPER_MEM 0x9fffffff
+
+#define MPC85XX_PCI1_IO_BASE 0xe2000000
+#define MPC85XX_PCI1_MEM_OFFSET 0x00000000
+
+#define MPC85XX_PCI1_IO_SIZE 0x01000000
+
+/* PCI config */
+#define PCI1_CFG_ADDR_OFFSET (0x8000)
+#define PCI1_CFG_DATA_OFFSET (0x8004)
+
+#define PCI2_CFG_ADDR_OFFSET (0x9000)
+#define PCI2_CFG_DATA_OFFSET (0x9004)
+
+/* Additional register for PCI-X configuration */
+#define PCIX_NEXT_CAP 0x60
+#define PCIX_CAP_ID 0x61
+#define PCIX_COMMAND 0x62
+#define PCIX_STATUS 0x64
+
+/* Serial Config */
+#ifdef CONFIG_SERIAL_MANY_PORTS
+#define RS_TABLE_SIZE 64
+#else
+#define RS_TABLE_SIZE 2
+#endif
+
+/* Offset of CPM register space */
+#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET)
+
+#endif /* __MACH_MPC8540ADS_H__ */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.c b/arch/powerpc/platforms/85xx/mpc85xx.c
new file mode 100644
index 0000000..417f496
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx.c
@@ -0,0 +1,257 @@
+/*
+ * MPC85xx setup and early boot code plus other random bits.
+ *
+ * Maintained by Kumar Gala (see MAINTAINERS for contact information)
+ *
+ * Copyright 2005 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/config.h>
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/reboot.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/irq.h>
+#include <linux/seq_file.h>
+#include <linux/root_dev.h>
+#include <linux/serial.h>
+#include <linux/tty.h> /* for linux/serial_core.h */
+#include <linux/serial_core.h>
+#include <linux/initrd.h>
+#include <linux/module.h>
+#include <linux/fsl_devices.h>
+#include <linux/serial_core.h>
+#include <linux/serial_8250.h>
+
+#include <asm/system.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <asm/atomic.h>
+#include <asm/time.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/bootinfo.h>
+#include <asm/pci-bridge.h>
+#include <asm/mpc85xx.h>
+#include <asm/irq.h>
+#include <asm/immap_85xx.h>
+#include <asm/prom.h>
+#include <asm/mpic.h>
+#include <mm/mmu_decl.h>
+#include <asm/udbg.h>
+
+extern unsigned long total_memory; /* in mm/init */
+
+extern void abort(void);
+
+extern void gen550_progress(char *, unsigned short);
+extern void gen550_init(int, struct uart_port *);
+extern phys_addr_t get_immrbase(void);
+extern void find_legacy_serial_ports(void);
+
+void mpc85xx_ads_show_cpuinfo(struct seq_file *m);
+void mpc85xx_restart(char *cmd);
+void mpc85xx_halt(void);
+void mpc85xx_power_off(void);
+
+#ifndef CONFIG_PCI
+unsigned long isa_io_base = 0;
+unsigned long isa_mem_base = 0;
+#endif
+
+phys_addr_t immr_base;
+
+
+/*
+ * Internal interrupts are all Level Sensitive, and Positive Polarity
+ *
+ * Note: Likely, this table and the following function should be
+ * obtained and derived from the OF Device Tree.
+ */
+static u_char mpc85xx_ads_openpic_initsenses[] __initdata = {
+ MPC85XX_INTERNAL_IRQ_SENSES,
+ 0x0, /* External 0: */
+#if defined(CONFIG_PCI)
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 1: PCI slot 0 */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 2: PCI slot 1 */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 3: PCI slot 2 */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 4: PCI slot 3 */
+#else
+ 0x0, /* External 1: */
+ 0x0, /* External 2: */
+ 0x0, /* External 3: */
+ 0x0, /* External 4: */
+#endif
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 5: PHY */
+ 0x0, /* External 6: */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 7: PHY */
+ 0x0, /* External 8: */
+ 0x0, /* External 9: */
+ 0x0, /* External 10: */
+ 0x0, /* External 11: */
+};
+
+
+void __init mpc85xx_pic_init(void)
+{
+ struct mpic *mpic1;
+ /* Determine the Physical Address of the OpenPIC regs */
+ phys_addr_t OpenPIC_PAddr = immr_base + MPC85xx_OPENPIC_OFFSET;
+
+ mpic1 = mpic_alloc(OpenPIC_PAddr,
+ MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+ 4, MPC85xx_OPENPIC_IRQ_OFFSET, 0, 250,
+ mpc85xx_ads_openpic_initsenses,
+ sizeof(mpc85xx_ads_openpic_initsenses), " OpenPIC ");
+ BUG_ON(mpic1 == NULL);
+ mpic_assign_isu(mpic1, 0, OpenPIC_PAddr + 0x10200);
+ mpic_assign_isu(mpic1, 1, OpenPIC_PAddr + 0x10280);
+ mpic_assign_isu(mpic1, 2, OpenPIC_PAddr + 0x10300);
+ mpic_assign_isu(mpic1, 3, OpenPIC_PAddr + 0x10380);
+ mpic_assign_isu(mpic1, 4, OpenPIC_PAddr + 0x10400);
+ mpic_assign_isu(mpic1, 5, OpenPIC_PAddr + 0x10480);
+ mpic_assign_isu(mpic1, 6, OpenPIC_PAddr + 0x10500);
+ mpic_assign_isu(mpic1, 7, OpenPIC_PAddr + 0x10580);
+
+ /* dummy mappings to get to 48 */
+ mpic_assign_isu(mpic1, 8, OpenPIC_PAddr + 0x10600);
+ mpic_assign_isu(mpic1, 9, OpenPIC_PAddr + 0x10680);
+ mpic_assign_isu(mpic1, 10, OpenPIC_PAddr + 0x10700);
+ mpic_assign_isu(mpic1, 11, OpenPIC_PAddr + 0x10780);
+
+ /* External ints */
+ mpic_assign_isu(mpic1, 12, OpenPIC_PAddr + 0x10000);
+ mpic_assign_isu(mpic1, 13, OpenPIC_PAddr + 0x10080);
+ mpic_assign_isu(mpic1, 14, OpenPIC_PAddr + 0x10100);
+ mpic_init(mpic1);
+}
+
+
+/*
+ * Setup the architecture
+ */
+
+static void __init
+mpc85xx_setup_arch(void)
+{
+ struct device_node *cpu;
+
+ if (ppc_md.progress)
+ ppc_md.progress("mpc85xx_setup_arch()", 0);
+
+ cpu = of_find_node_by_type(NULL, "cpu");
+ if (cpu != 0) {
+ unsigned int *fp;
+
+ fp = (int *)get_property(cpu, "clock-frequency", NULL);
+ if (fp != 0)
+ loops_per_jiffy = *fp / HZ;
+ else
+ loops_per_jiffy = 50000000 / HZ;
+ of_node_put(cpu);
+ }
+
+ immr_base = get_immrbase();
+
+#ifdef CONFIG_SERIAL_TEXT_DEBUG
+ /*
+ * Invalidate the entry we stole earlier.
+ * The serial ports should be properly mapped.
+ */
+ invalidate_tlbcam_entry(num_tlbcam_entries - 1);
+#endif
+
+#ifdef CONFIG_ROOT_NFS
+ ROOT_DEV = Root_NFS;
+#else
+ ROOT_DEV = Root_HDA1;
+#endif
+}
+
+
+void __init
+platform_init(void)
+{
+ ppc_md.setup_arch = mpc85xx_setup_arch;
+ ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo;
+
+ ppc_md.init_IRQ = mpc85xx_pic_init;
+ ppc_md.get_irq = mpic_get_irq;
+
+ ppc_md.restart = mpc85xx_restart;
+ ppc_md.power_off = mpc85xx_power_off;
+ ppc_md.halt = mpc85xx_halt;
+
+ ppc_md.time_init = NULL;
+ ppc_md.set_rtc_time = NULL;
+ ppc_md.get_rtc_time = NULL;
+ ppc_md.calibrate_decr = generic_calibrate_decr;
+
+ ppc_md.progress = udbg_progress;
+
+ if (ppc_md.progress)
+ ppc_md.progress("mpc85xx platform_init(): exit", 0);
+}
+
+void
+mpc85xx_restart(char *cmd)
+{
+ local_irq_disable();
+ abort();
+}
+
+void
+mpc85xx_power_off(void)
+{
+ local_irq_disable();
+ for(;;);
+}
+
+void
+mpc85xx_halt(void)
+{
+ local_irq_disable();
+ for(;;);
+}
+
+/* For now this is a pass through */
+phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
+{
+ return addr;
+};
+EXPORT_SYMBOL(fixup_bigphys_addr);
+
+
+
+void
+mpc85xx_ads_show_cpuinfo(struct seq_file *m)
+{
+ uint pvid, svid, phid1;
+ uint memsize = total_memory;
+
+ pvid = mfspr(SPRN_PVR);
+ svid = mfspr(SPRN_SVR);
+
+ seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
+ seq_printf(m, "Machine\t\t: mpc85xx\n");
+ seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
+ seq_printf(m, "SVR\t\t: 0x%x\n", svid);
+
+ /* Display cpu Pll setting */
+ phid1 = mfspr(SPRN_HID1);
+ seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
+
+ /* Display the amount of memory */
+ seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
+}
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index 04073fd..c4f6b0d 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -8,7 +8,7 @@ endif
obj-$(CONFIG_PPC_CHRP) += chrp/
obj-$(CONFIG_4xx) += 4xx/
obj-$(CONFIG_PPC_83xx) += 83xx/
-obj-$(CONFIG_85xx) += 85xx/
+obj-$(CONFIG_PPC_85xx) += 85xx/
obj-$(CONFIG_PPC_PSERIES) += pseries/
obj-$(CONFIG_PPC_ISERIES) += iseries/
obj-$(CONFIG_PPC_MAPLE) += maple/
^ permalink raw reply related
* Re: [PATCH] powerpc: Add support for the MPC83xx watchdog
From: Andrew Morton @ 2006-01-13 22:58 UTC (permalink / raw)
To: Kumar Gala; +Cc: dave, linux-kernel, iinuxppc-embedded, linuxppc-dev, wim
In-Reply-To: <Pine.LNX.4.44.0601131618020.26648-100000@gate.crashing.org>
Kumar Gala <galak@gate.crashing.org> wrote:
>
> +static struct platform_driver mpc83xx_wdt_driver = {
> + .probe = mpc83xx_wdt_probe,
> + .remove = __devexit_p(mpc83xx_wdt_remove),
> + .driver = {
> + .owner = THIS_MODULE,
> + .name = "mpc83xx_wdt",
> + },
> +};
platform_driver.owner no longer needs to be initialised for some reason.
I'll take that line out.
^ permalink raw reply
* Re: [PATCH] powerpc: Add support for the MPC83xx watchdog
From: Kumar Gala @ 2006-01-13 22:50 UTC (permalink / raw)
To: Andrew Morton; +Cc: dave, linux-kernel, iinuxppc-embedded, linuxppc-dev, wim
In-Reply-To: <20060113145259.6d38e296.akpm@osdl.org>
On Fri, 13 Jan 2006, Andrew Morton wrote:
> Kumar Gala <galak@gate.crashing.org> wrote:
> >
> > Added support for the PowerPC MPC83xx watchdog. The MPC83xx has a simple
> > watchdog that once enabled it can not be stopped, has some simple timeout
> > range selection, and the ability to either reset the processor or take
> > a machine check.
> >
> >
> > +static ushort timeout = 0xffff;
>
> There's no such thing ;) I'll change this to u16, OK?
There is one in include/linux/types.h, but u16 is fine.
> > +static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
> > + unsigned int cmd,
> > + unsigned long arg)
>
> Whitespace went nutty in various places. I'll fix that up. Please see the
> followup patch.
Odd, no one else has had any issues with patches from me recently.
- kumar
^ permalink raw reply
* Re: [PATCH] powerpc: Add support for the MPC83xx watchdog
From: Andrew Morton @ 2006-01-13 22:52 UTC (permalink / raw)
To: Kumar Gala; +Cc: dave, linux-kernel, iinuxppc-embedded, linuxppc-dev, wim
In-Reply-To: <Pine.LNX.4.44.0601131618020.26648-100000@gate.crashing.org>
Kumar Gala <galak@gate.crashing.org> wrote:
>
> Added support for the PowerPC MPC83xx watchdog. The MPC83xx has a simple
> watchdog that once enabled it can not be stopped, has some simple timeout
> range selection, and the ability to either reset the processor or take
> a machine check.
>
>
> +static ushort timeout = 0xffff;
There's no such thing ;) I'll change this to u16, OK?
> +static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
> + unsigned int cmd,
> + unsigned long arg)
Whitespace went nutty in various places. I'll fix that up. Please see the
followup patch.
^ permalink raw reply
* [PATCH] powerpc: Add support for the MPC83xx watchdog
From: Kumar Gala @ 2006-01-13 22:18 UTC (permalink / raw)
To: wim, Andrew Morton; +Cc: iinuxppc-embedded, linuxppc-dev, linux-kernel, dave
Added support for the PowerPC MPC83xx watchdog. The MPC83xx has a simple
watchdog that once enabled it can not be stopped, has some simple timeout
range selection, and the ability to either reset the processor or take
a machine check.
Signed-off-by: Dave Updegraff <dave@cray.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
commit 829b5a27d84d8ea95f6ba7314702c11127b5102c
tree 1eb3a840aea5ff2de729e510458d24688e4da59e
parent ae97a598202f4076627acaba0fcc1884f0c703d7
author Kumar Gala <galak@kernel.crashing.org> Fri, 13 Jan 2006 16:22:58 -0600
committer Kumar Gala <galak@kernel.crashing.org> Fri, 13 Jan 2006 16:22:58 -0600
drivers/char/watchdog/Kconfig | 4 +
drivers/char/watchdog/Makefile | 1
drivers/char/watchdog/mpc83xx_wdt.c | 230 +++++++++++++++++++++++++++++++++++
3 files changed, 235 insertions(+), 0 deletions(-)
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index a654479..32c035b 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -401,6 +401,10 @@ config 8xx_WDT
tristate "MPC8xx Watchdog Timer"
depends on WATCHDOG && 8xx
+config 83xx_WDT
+ tristate "MPC83xx Watchdog Timer"
+ depends on WATCHDOG && PPC_83xx
+
config MV64X60_WDT
tristate "MV64X60 (Marvell Discovery) Watchdog Timer"
depends on WATCHDOG && MV64X60
diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
index cfd0a39..4342b0d 100644
--- a/drivers/char/watchdog/Makefile
+++ b/drivers/char/watchdog/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_MACHZ_WDT) += machzwd.o
# PowerPC Architecture
obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o
obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o
diff --git a/drivers/char/watchdog/mpc83xx_wdt.c b/drivers/char/watchdog/mpc83xx_wdt.c
new file mode 100644
index 0000000..5734839
--- /dev/null
+++ b/drivers/char/watchdog/mpc83xx_wdt.c
@@ -0,0 +1,230 @@
+/*
+ * mpc83xx_wdt.c - MPC83xx watchdog userspace interface
+ *
+ * Authors: Dave Updegraff <dave@cray.org>
+ * Kumar Gala <galak@kernel.crashing.org>
+ * Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org>
+ * ..and from sc520_wdt
+ *
+ * Note: it appears that you can only actually ENABLE or DISABLE the thing
+ * once after POR. Once enabled, you cannot disable, and vice versa.
+ *
+ * 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/config.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/watchdog.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+struct mpc83xx_wdt {
+ __be32 res0;
+ __be32 swcrr; /* System watchdog control register */
+#define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
+#define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
+#define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit.*/
+#define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
+ __be32 swcnr; /* System watchdog count register */
+ u8 res1[2];
+ __be16 swsrr; /* System watchdog service register */
+ u8 res2[0xF0];
+};
+
+static struct mpc83xx_wdt __iomem *wd_base;
+
+static ushort timeout = 0xffff;
+module_param(timeout, ushort, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in ticks. (0<timeout<65536, default=65535");
+
+static int reset = 1;
+module_param(reset, bool, 0);
+MODULE_PARM_DESC(reset, "Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset");
+
+/* We always prescale, but if someone really doesn't want to they can set this to 0 */
+static int prescale = 1;
+static unsigned int timeout_sec;
+
+static unsigned long wdt_is_open;
+static spinlock_t wdt_spinlock;
+
+static void mpc83xx_wdt_keepalive(void)
+{
+ /* Ping the WDT */
+ spin_lock(&wdt_spinlock);
+ out_be16(&wd_base->swsrr, 0x556c);
+ out_be16(&wd_base->swsrr, 0xaa39);
+ spin_unlock(&wdt_spinlock);
+}
+
+static ssize_t mpc83xx_wdt_write(struct file * file, const char __user * buf,
+ size_t count, loff_t * ppos)
+{
+ if(count)
+ mpc83xx_wdt_keepalive();
+ return count;
+}
+
+static int mpc83xx_wdt_open(struct inode * inode, struct file * file)
+{
+ u32 tmp = SWCRR_SWEN;
+ if (test_and_set_bit(0, &wdt_is_open))
+ return -EBUSY;
+
+ /* Once we start the watchdog we can't stop it */
+ __module_get(THIS_MODULE);
+
+ /* Good, fire up the show */
+ if (prescale)
+ tmp |= SWCRR_SWPR;
+ if (reset)
+ tmp |= SWCRR_SWRI;
+
+ tmp |= timeout << 16;
+
+ out_be32(&wd_base->swcrr, tmp);
+
+ return nonseekable_open(inode, file);
+}
+
+static int mpc83xx_wdt_release(struct inode * inode, struct file * file)
+{
+ printk(KERN_CRIT "Unexpected close, not stopping watchdog!\n");
+ mpc83xx_wdt_keepalive();
+ clear_bit(0, &wdt_is_open);
+ return 0;
+}
+
+static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd,
+ unsigned long arg)
+{
+ void __user *argp = (void __user *)arg;
+ int __user *p = argp;
+ static struct watchdog_info ident = {
+ .options = WDIOF_KEEPALIVEPING,
+ .firmware_version = 1,
+ .identity = "MPC83xx",
+ };
+
+ switch(cmd)
+ {
+ case WDIOC_GETSUPPORT:
+ return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
+ case WDIOC_KEEPALIVE:
+ mpc83xx_wdt_keepalive();
+ return 0;
+ case WDIOC_GETTIMEOUT:
+ return put_user(timeout_sec, p);
+
+ default:
+ return -ENOIOCTLCMD;
+ }
+}
+
+static struct file_operations mpc83xx_wdt_fops = {
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .write = mpc83xx_wdt_write,
+ .ioctl = mpc83xx_wdt_ioctl,
+ .open = mpc83xx_wdt_open,
+ .release = mpc83xx_wdt_release,
+};
+
+static struct miscdevice mpc83xx_wdt_miscdev = {
+ .minor = WATCHDOG_MINOR,
+ .name = "watchdog",
+ .fops = &mpc83xx_wdt_fops,
+};
+
+static int __devinit mpc83xx_wdt_probe(struct platform_device *dev)
+{
+ struct resource *r;
+ int ret;
+ unsigned int *freq = dev->dev.platform_data;
+
+ /* get a pointer to the register memory */
+ r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+
+ if (!r) {
+ ret = -ENODEV;
+ goto err_out;
+ }
+
+ wd_base = (struct mpc83xx_wdt *)
+ ioremap(r->start, sizeof (struct mpc83xx_wdt));
+
+ if (wd_base == NULL) {
+ ret = -ENOMEM;
+ goto err_out;
+ }
+
+ ret = misc_register(&mpc83xx_wdt_miscdev);
+ if (ret) {
+ printk(KERN_ERR "cannot register miscdev on minor=%d (err=%d)\n",
+ WATCHDOG_MINOR, ret);
+ goto err_unmap;
+ }
+
+ /* Calculate the timeout in seconds */
+ if (prescale)
+ timeout_sec = (timeout * 0x10000) / (*freq);
+ else
+ timeout_sec = timeout / (*freq);
+
+ printk(KERN_INFO "WDT driver for MPC83xx initialized. "
+ "mode:%s timeout=%d (%d seconds)\n",
+ reset ? "reset":"interrupt", timeout, timeout_sec);
+
+ spin_lock_init(&wdt_spinlock);
+
+ return 0;
+
+err_unmap:
+ iounmap(wd_base);
+err_out:
+ return ret;
+}
+
+static int __devexit mpc83xx_wdt_remove(struct platform_device *dev)
+{
+ misc_deregister(&mpc83xx_wdt_miscdev);
+ iounmap(wd_base);
+
+ return 0;
+}
+
+static struct platform_driver mpc83xx_wdt_driver = {
+ .probe = mpc83xx_wdt_probe,
+ .remove = __devexit_p(mpc83xx_wdt_remove),
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "mpc83xx_wdt",
+ },
+};
+
+static int __init mpc83xx_wdt_init(void)
+{
+ return platform_driver_register(&mpc83xx_wdt_driver);
+}
+
+static void __exit mpc83xx_wdt_exit(void)
+{
+ platform_driver_unregister(&mpc83xx_wdt_driver);
+}
+
+module_init(mpc83xx_wdt_init);
+module_exit(mpc83xx_wdt_exit);
+
+MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
+MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx uProcessor");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
^ permalink raw reply related
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Dmitry Torokhov @ 2006-01-13 22:25 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-kernel, linux-kernel, linuxppc-dev, Vojtech Pavlik,
linux-input
In-Reply-To: <1137190444.4854.21.camel@localhost.localdomain>
On 1/13/06, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> > Right, so do we need "no translation, fnkeyfirst and fnkeylast" option
> > or just "fnkeyfirst and fnkeyast"?
>
> I think "no translation" should still be around if people want to handle
> it entirely from userland no ?
>
> That is:
>
> - no translation : nothing special is done, Fx sends Fx keycode
> regardless of Fn key, Fn key itsef sends a keycode for itself, there is
> no emulation of numlock
>
> - fnkeyfirst / fnkeylast : Either Fx is translated and Fn-Fx is not or
> the opposite. Numlock emulation is enabled.
OK then, I will push the patch to Linus.
--
Dmitry
^ permalink raw reply
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Benjamin Herrenschmidt @ 2006-01-13 22:14 UTC (permalink / raw)
To: dtor_core
Cc: linux-kernel, linux-kernel, linuxppc-dev, Vojtech Pavlik,
linux-input
In-Reply-To: <d120d5000601131405w4e20e37fna17767624a4ebf6@mail.gmail.com>
> Right, so do we need "no translation, fnkeyfirst and fnkeylast" option
> or just "fnkeyfirst and fnkeyast"?
I think "no translation" should still be around if people want to handle
it entirely from userland no ?
That is:
- no translation : nothing special is done, Fx sends Fx keycode
regardless of Fn key, Fn key itsef sends a keycode for itself, there is
no emulation of numlock
- fnkeyfirst / fnkeylast : Either Fx is translated and Fn-Fx is not or
the opposite. Numlock emulation is enabled.
> Huh? You mean 1, right?
Yah, forget it, I was on crack.
^ permalink raw reply
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Dmitry Torokhov @ 2006-01-13 22:08 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-kernel, linux-kernel, linuxppc-dev, Vojtech Pavlik,
linux-input
In-Reply-To: <d120d5000601131405w4e20e37fna17767624a4ebf6@mail.gmail.com>
On 1/13/06, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On 1/13/06, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >
> > > That should be "MODULE_PARM_DESC(pb_fn_mode, ...)". Also, since this =
is
> > > for compatibility with ADB, why do we have 3 options? Doesn't ADB hav=
e
> > > only 2?
> >
> > No, the ADB keyboard can operate in 2 modes that can be set with a PMU
> > command, I forgot about that in my earlier comments. In one mode, you g=
et
> > the "special" behaviour by default on the Fx keys and you get Fx when
> > pressing Fn-Fx, and in the other mode, you get the Fx by default and th=
e
> > special behaviour when pressing Fn-Fx.
> >
>
> Right, so do we need "no translation, fnkeyfirst and fnkeylast" option
> or just "fnkeyfirst and fnkeyast"?
>
> > > > +static inline struct hidinput_key_translation *find_translation(
> > >
> > > I thought is was agreed that we'd avoid "inlines" in .c files?
> >
> > Ah ? I have certainly missed that discussion ...
>
> Newer GCCs, unit-at-a-time, etc. etc. - teher was pretty long
> discussion about letting GCC decide on inlining.
>
> >
> > > > + struct hidinput_key_translation *table, u16 from)
> > > > +{
> > > > + struct hidinput_key_translation *trans;
> > > > +
> > > > + /* Look for the translation */
> > > > + for(trans =3D table; trans->from && (trans->from !=3D from); tr=
ans++);
> > > > +
> > > > + return (trans->from?trans:NULL);
> > > > +}
> > >
> > > I'd prefer liberal amount of spaces applied here </extreme nitpick mo=
de>
> >
> > Me too :)
> >
> > > > + try_translate =3D test_bit(usage->code, usbhid_pb_numlo=
ck)?1:
> > > > + test_bit(LED_NUML, input->led);
> > > > + if (try_translate) {
> > >
> > > Isn't this the same as
> > >
> > > if (test_bit(usage->code, usbhid_pb_numlock) || test_bi=
t(LED_NUML, input->led))
> > >
> > > but harder to read?
> >
> > No. If the first one is 0, the second one will not matter in the first
> > version, while it will in yours.
> >
>
> Huh? You mean 1, right?
>
> try_translate =3D 0;
> if (test_bit(usage->code, usbhid_pb_numlock))
> try_translate =3D 1;
> else if (test_bit(LED_NUML, input->led))
> try_translate =3D 1;
> else
>
Uhg, accidentially hit send, sorry... Ok, nevermind, I see your other messa=
ge ;)
--
Dmitry
^ permalink raw reply
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Dmitry Torokhov @ 2006-01-13 22:05 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-kernel, linux-kernel, linuxppc-dev, Vojtech Pavlik,
linux-input
In-Reply-To: <1137189319.4854.12.camel@localhost.localdomain>
On 1/13/06, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > That should be "MODULE_PARM_DESC(pb_fn_mode, ...)". Also, since this is
> > for compatibility with ADB, why do we have 3 options? Doesn't ADB have
> > only 2?
>
> No, the ADB keyboard can operate in 2 modes that can be set with a PMU
> command, I forgot about that in my earlier comments. In one mode, you get
> the "special" behaviour by default on the Fx keys and you get Fx when
> pressing Fn-Fx, and in the other mode, you get the Fx by default and the
> special behaviour when pressing Fn-Fx.
>
Right, so do we need "no translation, fnkeyfirst and fnkeylast" option
or just "fnkeyfirst and fnkeyast"?
> > > +static inline struct hidinput_key_translation *find_translation(
> >
> > I thought is was agreed that we'd avoid "inlines" in .c files?
>
> Ah ? I have certainly missed that discussion ...
Newer GCCs, unit-at-a-time, etc. etc. - teher was pretty long
discussion about letting GCC decide on inlining.
>
> > > + struct hidinput_key_translation *table, u16 from)
> > > +{
> > > + struct hidinput_key_translation *trans;
> > > +
> > > + /* Look for the translation */
> > > + for(trans =3D table; trans->from && (trans->from !=3D from); tran=
s++);
> > > +
> > > + return (trans->from?trans:NULL);
> > > +}
> >
> > I'd prefer liberal amount of spaces applied here </extreme nitpick mode=
>
>
> Me too :)
>
> > > + try_translate =3D test_bit(usage->code, usbhid_pb_numlock=
)?1:
> > > + test_bit(LED_NUML, input->led);
> > > + if (try_translate) {
> >
> > Isn't this the same as
> >
> > if (test_bit(usage->code, usbhid_pb_numlock) || test_bit(=
LED_NUML, input->led))
> >
> > but harder to read?
>
> No. If the first one is 0, the second one will not matter in the first
> version, while it will in yours.
>
Huh? You mean 1, right?
try_translate =3D 0;
if (test_bit(usage->code, usbhid_pb_numlock))
try_translate =3D 1;
else if (test_bit(LED_NUML, input->led))
try_translate =3D 1;
else
> Ben.
>
>
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Michael Hanselmann @ 2006-01-13 22:02 UTC (permalink / raw)
To: Vojtech Pavlik
Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
linux-input
In-Reply-To: <20060113074749.GA7103@midnight.suse.cz>
On Fri, Jan 13, 2006 at 08:47:49AM +0100, Vojtech Pavlik wrote:
> > + map_key_clear(KEY_FN);
> > + set_bit(KEY_FN, input->keybit);
> The set_bit(KEY_FN, input->keybit) is superfluous here, right?
> map_key_clear(KEY_FN); will take care of that further down.
Okay, fixed in the patch below.
This patch implements support for the fn key on Apple PowerBooks using
USB based keyboards.
Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Acked-by: Rene Nussbaumer <linux-kernel@killerfox.forkbomb.ch>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
diff -upr linux-2.6.15.orig/drivers/usb/input/hid-core.c linux-2.6.15/drivers/usb/input/hid-core.c
--- linux-2.6.15.orig/drivers/usb/input/hid-core.c 2006-01-11 23:59:40.000000000 +0100
+++ linux-2.6.15/drivers/usb/input/hid-core.c 2006-01-08 11:53:36.000000000 +0100
@@ -1580,6 +1580,14 @@ static struct hid_blacklist {
{ USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
{ USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
+ { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN },
+
{ 0, 0 }
};
diff -upr linux-2.6.15.orig/drivers/usb/input/hid.h linux-2.6.15/drivers/usb/input/hid.h
--- linux-2.6.15.orig/drivers/usb/input/hid.h 2006-01-11 23:59:40.000000000 +0100
+++ linux-2.6.15/drivers/usb/input/hid.h 2006-01-13 00:15:10.000000000 +0100
@@ -246,6 +246,8 @@ struct hid_item {
#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x100
#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200
#define HID_QUIRK_2WHEEL_POWERMOUSE 0x400
+#define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800
+#define HID_QUIRK_POWERBOOK_FN_ON 0x00001000
/*
* This is the global environment of the parser. This information is
@@ -431,6 +433,11 @@ struct hid_device { /* device repo
void (*ff_exit)(struct hid_device*); /* Called by hid_exit_ff(hid) */
int (*ff_event)(struct hid_device *hid, struct input_dev *input,
unsigned int type, unsigned int code, int value);
+
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
+ unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
+#endif
};
#define HID_GLOBAL_STACK_SIZE 4
diff -upr linux-2.6.15.orig/drivers/usb/input/hid-input.c linux-2.6.15/drivers/usb/input/hid-input.c
--- linux-2.6.15.orig/drivers/usb/input/hid-input.c 2006-01-11 23:59:40.000000000 +0100
+++ linux-2.6.15/drivers/usb/input/hid-input.c 2006-01-13 22:45:21.000000000 +0100
@@ -63,6 +63,65 @@ static struct {
__s32 y;
} hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
+struct hidinput_key_translation {
+ u16 from;
+ u16 to;
+ u8 flags;
+};
+
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+
+#define POWERBOOK_FLAG_FKEY 0x01
+
+static struct hidinput_key_translation powerbook_fn_keys[] = {
+ { KEY_BACKSPACE, KEY_DELETE },
+ { KEY_F1, KEY_BRIGHTNESSDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F2, KEY_BRIGHTNESSUP, POWERBOOK_FLAG_FKEY },
+ { KEY_F3, KEY_MUTE, POWERBOOK_FLAG_FKEY },
+ { KEY_F4, KEY_VOLUMEDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F5, KEY_VOLUMEUP, POWERBOOK_FLAG_FKEY },
+ { KEY_F6, KEY_NUMLOCK, POWERBOOK_FLAG_FKEY },
+ { KEY_F7, KEY_SWITCHVIDEOMODE, POWERBOOK_FLAG_FKEY },
+ { KEY_F8, KEY_KBDILLUMTOGGLE, POWERBOOK_FLAG_FKEY },
+ { KEY_F9, KEY_KBDILLUMDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F10, KEY_KBDILLUMUP, POWERBOOK_FLAG_FKEY },
+ { KEY_UP, KEY_PAGEUP },
+ { KEY_DOWN, KEY_PAGEDOWN },
+ { KEY_LEFT, KEY_HOME },
+ { KEY_RIGHT, KEY_END },
+ { }
+};
+
+static struct hidinput_key_translation powerbook_numlock_keys[] = {
+ { KEY_J, KEY_KP1 },
+ { KEY_K, KEY_KP2 },
+ { KEY_L, KEY_KP3 },
+ { KEY_U, KEY_KP4 },
+ { KEY_I, KEY_KP5 },
+ { KEY_O, KEY_KP6 },
+ { KEY_7, KEY_KP7 },
+ { KEY_8, KEY_KP8 },
+ { KEY_9, KEY_KP9 },
+ { KEY_M, KEY_KP0 },
+ { KEY_DOT, KEY_KPDOT },
+ { KEY_SLASH, KEY_KPPLUS },
+ { KEY_SEMICOLON, KEY_KPMINUS },
+ { KEY_P, KEY_KPASTERISK },
+ { KEY_MINUS, KEY_KPEQUAL },
+ { KEY_0, KEY_KPSLASH },
+ { KEY_F6, KEY_NUMLOCK },
+ { KEY_KPENTER, KEY_KPENTER },
+ { KEY_BACKSPACE, KEY_BACKSPACE },
+ { }
+};
+
+static int usbhid_pb_fnmode = 1;
+module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
+MODULE_PARM_DESC(pb_fnmode,
+ "Mode of fn key on PowerBooks (0 = disabled, "
+ "1 = fkeyslast, 2 = fkeysfirst)");
+#endif
+
#define map_abs(c) do { usage->code = c; usage->type = EV_ABS; bit = input->absbit; max = ABS_MAX; } while (0)
#define map_rel(c) do { usage->code = c; usage->type = EV_REL; bit = input->relbit; max = REL_MAX; } while (0)
#define map_key(c) do { usage->code = c; usage->type = EV_KEY; bit = input->keybit; max = KEY_MAX; } while (0)
@@ -73,6 +132,81 @@ static struct {
#define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0)
#define map_ff_effect(c) do { set_bit(c, input->ffbit); } while (0)
+static struct hidinput_key_translation *find_translation(
+ struct hidinput_key_translation *table, u16 from)
+{
+ struct hidinput_key_translation *trans;
+
+ /* Look for the translation */
+ for(trans = table;
+ trans->from && (trans->from != from);
+ trans++);
+
+ return (trans->from? trans : NULL);
+}
+
+static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
+ struct hid_usage *usage, __s32 value)
+{
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ struct hidinput_key_translation *trans;
+
+ if (usage->code == KEY_FN) {
+ if (value) hid->quirks |= HID_QUIRK_POWERBOOK_FN_ON;
+ else hid->quirks &= ~HID_QUIRK_POWERBOOK_FN_ON;
+
+ input_event(input, usage->type, usage->code, value);
+
+ return 1;
+ }
+
+ if (usbhid_pb_fnmode) {
+ int do_translate;
+
+ trans = find_translation(powerbook_fn_keys, usage->code);
+ if (trans) {
+ if (test_bit(usage->code, hid->pb_pressed_fn))
+ do_translate = 1;
+ else if (trans->flags & POWERBOOK_FLAG_FKEY)
+ do_translate =
+ (usbhid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
+ (usbhid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
+ else
+ do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);
+
+ if (do_translate) {
+ if (value)
+ set_bit(usage->code, hid->pb_pressed_fn);
+ else
+ clear_bit(usage->code, hid->pb_pressed_fn);
+
+ input_event(input, usage->type, trans->to, value);
+
+ return 1;
+ }
+ }
+
+ if (test_bit(usage->code, hid->pb_pressed_numlock) ||
+ test_bit(LED_NUML, input->led)) {
+ trans = find_translation(powerbook_numlock_keys, usage->code);
+
+ if (trans) {
+ if (value)
+ set_bit(usage->code, hid->pb_pressed_numlock);
+ else
+ clear_bit(usage->code, hid->pb_pressed_numlock);
+
+ input_event(input, usage->type, trans->to, value);
+ }
+
+ return 1;
+ }
+ }
+#endif
+
+ return 0;
+}
+
static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
struct hid_usage *usage)
{
@@ -325,7 +459,24 @@ static void hidinput_configure_usage(str
set_bit(EV_REP, input->evbit);
switch(usage->hid & HID_USAGE) {
- case 0x003: map_key_clear(KEY_FN); break;
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ /* The fn key on Apple PowerBooks */
+ case 0x0003: {
+ struct hidinput_key_translation *trans;
+
+ map_key_clear(KEY_FN);
+ set_bit(KEY_NUMLOCK, input->keybit);
+
+ /* Enable all needed keys */
+ for(trans = powerbook_fn_keys; trans->from; trans++)
+ set_bit(trans->to, input->keybit);
+
+ for(trans = powerbook_numlock_keys; trans->from; trans++)
+ set_bit(trans->to, input->keybit);
+
+ break;
+ }
+#endif
default: goto ignore;
}
break;
@@ -482,6 +633,10 @@ void hidinput_hid_event(struct hid_devic
return;
}
+ if ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) &&
+ hidinput_pb_event(hid, input, usage, value))
+ return;
+
if (usage->hat_min < usage->hat_max || usage->hat_dir) {
int hat_dir = usage->hat_dir;
if (!hat_dir)
diff -upr linux-2.6.15.orig/drivers/usb/input/Kconfig linux-2.6.15/drivers/usb/input/Kconfig
--- linux-2.6.15.orig/drivers/usb/input/Kconfig 2006-01-11 23:59:40.000000000 +0100
+++ linux-2.6.15/drivers/usb/input/Kconfig 2006-01-08 11:53:35.000000000 +0100
@@ -37,6 +37,16 @@ config USB_HIDINPUT
If unsure, say Y.
+config USB_HIDINPUT_POWERBOOK
+ bool "Enable support for iBook/PowerBook special keys"
+ default n
+ depends on USB_HIDINPUT
+ help
+ Say Y here if you want support for the special keys (Fn, Numlock) on
+ Apple iBooks and PowerBooks.
+
+ If unsure, say N.
+
config HID_FF
bool "Force feedback support (EXPERIMENTAL)"
depends on USB_HIDINPUT && EXPERIMENTAL
^ permalink raw reply
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Benjamin Herrenschmidt @ 2006-01-13 21:57 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-kernel, linux-kernel, linuxppc-dev, Vojtech Pavlik,
linux-input
In-Reply-To: <1137189319.4854.12.camel@localhost.localdomain>
On Sat, 2006-01-14 at 08:55 +1100, Benjamin Herrenschmidt wrote:
>
> > > + try_translate = test_bit(usage->code, usbhid_pb_numlock)?1:
> > > + test_bit(LED_NUML, input->led);
> > > + if (try_translate) {
> >
> > Isn't this the same as
> >
> > if (test_bit(usage->code, usbhid_pb_numlock) || test_bit(LED_NUML, input->led))
> >
> > but harder to read?
>
> No. If the first one is 0, the second one will not matter in the first
> version, while it will in yours.
Forget me, I'm stupid or rather I should finish by breakfast before
writing stupid things ;) Of course you are right, they are equivalent.
Ben.
^ permalink raw reply
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Benjamin Herrenschmidt @ 2006-01-13 21:55 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-kernel, linux-kernel, linuxppc-dev, Vojtech Pavlik,
linux-input
In-Reply-To: <200601122312.05210.dtor_core@ameritech.net>
> That should be "MODULE_PARM_DESC(pb_fn_mode, ...)". Also, since this is
> for compatibility with ADB, why do we have 3 options? Doesn't ADB have
> only 2?
No, the ADB keyboard can operate in 2 modes that can be set with a PMU
command, I forgot about that in my earlier comments. In one mode, you get
the "special" behaviour by default on the Fx keys and you get Fx when
pressing Fn-Fx, and in the other mode, you get the Fx by default and the
special behaviour when pressing Fn-Fx.
> > +static inline struct hidinput_key_translation *find_translation(
>
> I thought is was agreed that we'd avoid "inlines" in .c files?
Ah ? I have certainly missed that discussion ...
> > + struct hidinput_key_translation *table, u16 from)
> > +{
> > + struct hidinput_key_translation *trans;
> > +
> > + /* Look for the translation */
> > + for(trans = table; trans->from && (trans->from != from); trans++);
> > +
> > + return (trans->from?trans:NULL);
> > +}
>
> I'd prefer liberal amount of spaces applied here </extreme nitpick mode>
Me too :)
> > + try_translate = test_bit(usage->code, usbhid_pb_numlock)?1:
> > + test_bit(LED_NUML, input->led);
> > + if (try_translate) {
>
> Isn't this the same as
>
> if (test_bit(usage->code, usbhid_pb_numlock) || test_bit(LED_NUML, input->led))
>
> but harder to read?
No. If the first one is 0, the second one will not matter in the first
version, while it will in yours.
Ben.
^ permalink raw reply
* Re: [PATCH 08/10] ML300 & ML403 need embed_config.o linked in
From: Peter Korsgaard @ 2006-01-13 18:18 UTC (permalink / raw)
To: grant.likely; +Cc: glikely, dhlii, gnathita, linuxppc-embedded
In-Reply-To: <11367955811900-git-send-email-grant.likely@secretlab.ca>
>>>>> "grant" == grant likely <grant.likely@secretlab.ca> writes:
grant> +boot-$(CONFIG_XILINX_ML300) += embed_config.o
grant> +boot-$(CONFIG_XILINX_ML403) += embed_config.o
Notice that the ML300 line already is in mainline and pending for
2.6.15.1.
--
Bye, Peter Korsgaard
^ permalink raw reply
* Re: [PATCH 00/10] Xilinx Virtex-* updates
From: Peter Korsgaard @ 2006-01-13 18:17 UTC (permalink / raw)
To: grant.likely; +Cc: glikely, dhlii, gnathita, linuxppc-embedded
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>
>>>>> "grant" == grant likely <grant.likely@secretlab.ca> writes:
grant> Here's a repost of my Xilinx ML300 and ML403 patches with a few
grant> cleanups, a bit of patch reordering, and rebased to 2.6.15.
Nice, ..
grant> I've tested on an ML403
grant> Can someone test on an ML300? (I no longer have one)
Works fine here on a ML300-alike board.
--
Bye, Peter Korsgaard
^ permalink raw reply
* Re: [PATCH 03/10] Migrate Xilinx Vertex support from the OCP bus to the platfom bus.
From: Peter Korsgaard @ 2006-01-13 18:20 UTC (permalink / raw)
To: grant.likely; +Cc: glikely, dhlii, gnathita, linuxppc-embedded
In-Reply-To: <11367955801988-git-send-email-grant.likely@secretlab.ca>
>>>>> "grant" == grant likely <grant.likely@secretlab.ca> writes:
grant> +#else
grant> + /* Add other board xparameter includes here before the #else */
grant> + #error No *_xparameters.h file included
grant> +#endif
Nitpit, but this should be #error No xparameters_*.h file included.
--
Bye, Peter Korsgaard
^ permalink raw reply
* Re: [PATCH 08/10] ML300 & ML403 need embed_config.o linked in
From: Grant Likely @ 2006-01-13 18:34 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: dhlii, gnathita, linuxppc-embedded
In-Reply-To: <87psmwq9da.fsf@48ers.dk>
Peter Korsgaard wrote:
>>>>>>"grant" == grant likely <grant.likely@secretlab.ca> writes:
>>>>>>
>>>>>>
>
> grant> +boot-$(CONFIG_XILINX_ML300) += embed_config.o
> grant> +boot-$(CONFIG_XILINX_ML403) += embed_config.o
>
>Notice that the ML300 line already is in mainline and pending for
>2.6.15.1.
>
>
>
Good to know; we were just discussing if this was the case on #mklinux
Thanks
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
(403) 663-0761
^ permalink raw reply
* Re: [PATCH 08/10] ML300 & ML403 need embed_config.o linked in
From: Matt Porter @ 2006-01-13 18:31 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: dhlii, glikely, linuxppc-embedded, gnathita
In-Reply-To: <87psmwq9da.fsf@48ers.dk>
On Fri, Jan 13, 2006 at 07:18:57PM +0100, Peter Korsgaard wrote:
> >>>>> "grant" == grant likely <grant.likely@secretlab.ca> writes:
>
> grant> +boot-$(CONFIG_XILINX_ML300) += embed_config.o
> grant> +boot-$(CONFIG_XILINX_ML403) += embed_config.o
>
> Notice that the ML300 line already is in mainline and pending for
> 2.6.15.1.
I asked Grant to rebase against current git for the patches to
be submitted upstream so that will go away.
-Matt
^ permalink raw reply
* Re: [PATCH 02/10] Make Virtex-II Pro support generic for all Virtex devices
From: Grant Likely @ 2006-01-13 17:52 UTC (permalink / raw)
To: Andrei Konovalov; +Cc: glikely, dhlii, gnathita, linuxppc-embedded
In-Reply-To: <43C691C2.9090607@ru.mvista.com>
Andrei Konovalov wrote:
> grant.likely@secretlab.ca wrote:
>
>> The PPC405 hard core is used in both the Virtex-II Pro and Virtex 4 FX
>> FPGAs. This patch cleans up the Virtex naming convention to reflect more
>> than just the Virtex-II Pro.
>>
>> Rename files virtex-ii_pro.[ch] to virtex.[ch]
>> Rename config value VIRTEX_II_PRO to XILINX_VIRTEX
>>
>> Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>
>>
>> ---
>
>
> Here is a misprint:
>
>>
> ...
>
>> diff --git a/arch/ppc/platforms/4xx/virtex.c
>> b/arch/ppc/platforms/4xx/virtex.c
>> new file mode 100644
>> index 0000000..1de7a27
>> --- /dev/null
>> +++ b/arch/ppc/platforms/4xx/virtex.c
>> @@ -0,0 +1,60 @@
>> +/*
>> + * arch/ppc/platforms/4xx/virtex.c
>> + *
>> + * Author: MontaVista Software, Inc.
>> + * source@mvista.com
>> + *
>> + * 2002-2004 (c) MontaVista Software, Inc. This file is licensed
>> under the
>> + * terms of the GNU General Public License version 2. This program
>> is licensed
>> + * "as is" without any warranty of any kind, whether express or implied.
>> + */
>> +
>> +#include <linux/config.h>
>> +#include <linux/init.h>
>> +#include <asm/ocp.h>
>> +#include <platform/4xx/virtex.h>
>
>
> Should be
> #include <platforms/4xx/virtex.h>
oops, the 's' got added in one of the later patches. Don't know how I
managed that.
Thanks
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
(403) 663-0761
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox