]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
sh: Shuffle the board directories in to mach groups.
authorPaul Mundt <lethal@linux-sh.org>
Tue, 29 Jul 2008 12:01:19 +0000 (21:01 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 29 Jul 2008 12:01:19 +0000 (21:01 +0900)
This flattens out the board directories in to individual mach groups,
we will use this for getting rid of unneeded directories, simplifying
the build system, and becoming more coherent with the refactored
arch/sh/include topology.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
214 files changed:
arch/sh/Kconfig
arch/sh/Makefile
arch/sh/boards/cayman/Makefile [deleted file]
arch/sh/boards/cayman/irq.c [deleted file]
arch/sh/boards/cayman/led.c [deleted file]
arch/sh/boards/cayman/setup.c [deleted file]
arch/sh/boards/dreamcast/Makefile [deleted file]
arch/sh/boards/dreamcast/irq.c [deleted file]
arch/sh/boards/dreamcast/rtc.c [deleted file]
arch/sh/boards/dreamcast/setup.c [deleted file]
arch/sh/boards/hp6xx/Makefile [deleted file]
arch/sh/boards/hp6xx/hp6xx_apm.c [deleted file]
arch/sh/boards/hp6xx/pm.c [deleted file]
arch/sh/boards/hp6xx/pm_wakeup.S [deleted file]
arch/sh/boards/hp6xx/setup.c [deleted file]
arch/sh/boards/landisk/Makefile [deleted file]
arch/sh/boards/landisk/gio.c [deleted file]
arch/sh/boards/landisk/irq.c [deleted file]
arch/sh/boards/landisk/psw.c [deleted file]
arch/sh/boards/landisk/setup.c [deleted file]
arch/sh/boards/lboxre2/Makefile [deleted file]
arch/sh/boards/lboxre2/irq.c [deleted file]
arch/sh/boards/lboxre2/setup.c [deleted file]
arch/sh/boards/mach-ap325rxa/Makefile [new file with mode: 0644]
arch/sh/boards/mach-ap325rxa/setup.c [new file with mode: 0644]
arch/sh/boards/mach-cayman/Makefile [new file with mode: 0644]
arch/sh/boards/mach-cayman/irq.c [new file with mode: 0644]
arch/sh/boards/mach-cayman/led.c [new file with mode: 0644]
arch/sh/boards/mach-cayman/setup.c [new file with mode: 0644]
arch/sh/boards/mach-dreamcast/Makefile [new file with mode: 0644]
arch/sh/boards/mach-dreamcast/irq.c [new file with mode: 0644]
arch/sh/boards/mach-dreamcast/rtc.c [new file with mode: 0644]
arch/sh/boards/mach-dreamcast/setup.c [new file with mode: 0644]
arch/sh/boards/mach-edosk7705/Makefile [new file with mode: 0644]
arch/sh/boards/mach-edosk7705/io.c [new file with mode: 0644]
arch/sh/boards/mach-edosk7705/setup.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-highlander/Makefile [new file with mode: 0644]
arch/sh/boards/mach-highlander/irq-r7780mp.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/irq-r7780rp.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/irq-r7785rp.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/psw.c [new file with mode: 0644]
arch/sh/boards/mach-highlander/setup.c [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/Makefile [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/hp6xx_apm.c [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/pm.c [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/pm_wakeup.S [new file with mode: 0644]
arch/sh/boards/mach-hp6xx/setup.c [new file with mode: 0644]
arch/sh/boards/mach-landisk/Makefile [new file with mode: 0644]
arch/sh/boards/mach-landisk/gio.c [new file with mode: 0644]
arch/sh/boards/mach-landisk/irq.c [new file with mode: 0644]
arch/sh/boards/mach-landisk/psw.c [new file with mode: 0644]
arch/sh/boards/mach-landisk/setup.c [new file with mode: 0644]
arch/sh/boards/mach-lboxre2/Makefile [new file with mode: 0644]
arch/sh/boards/mach-lboxre2/irq.c [new file with mode: 0644]
arch/sh/boards/mach-lboxre2/setup.c [new file with mode: 0644]
arch/sh/boards/mach-magicpanelr2/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-magicpanelr2/Makefile [new file with mode: 0644]
arch/sh/boards/mach-magicpanelr2/setup.c [new file with mode: 0644]
arch/sh/boards/mach-microdev/Makefile [new file with mode: 0644]
arch/sh/boards/mach-microdev/io.c [new file with mode: 0644]
arch/sh/boards/mach-microdev/irq.c [new file with mode: 0644]
arch/sh/boards/mach-microdev/led.c [new file with mode: 0644]
arch/sh/boards/mach-microdev/setup.c [new file with mode: 0644]
arch/sh/boards/mach-migor/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-migor/Makefile [new file with mode: 0644]
arch/sh/boards/mach-migor/lcd_qvga.c [new file with mode: 0644]
arch/sh/boards/mach-migor/setup.c [new file with mode: 0644]
arch/sh/boards/mach-r2d/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-r2d/Makefile [new file with mode: 0644]
arch/sh/boards/mach-r2d/irq.c [new file with mode: 0644]
arch/sh/boards/mach-r2d/setup.c [new file with mode: 0644]
arch/sh/boards/mach-rsk7203/Makefile [new file with mode: 0644]
arch/sh/boards/mach-rsk7203/setup.c [new file with mode: 0644]
arch/sh/boards/mach-sdk7780/Kconfig [new file with mode: 0644]
arch/sh/boards/mach-sdk7780/Makefile [new file with mode: 0644]
arch/sh/boards/mach-sdk7780/irq.c [new file with mode: 0644]
arch/sh/boards/mach-sdk7780/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7206/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7206/io.c [new file with mode: 0644]
arch/sh/boards/mach-se/7206/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7206/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7343/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7343/io.c [new file with mode: 0644]
arch/sh/boards/mach-se/7343/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7343/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7619/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7619/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/770x/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/770x/io.c [new file with mode: 0644]
arch/sh/boards/mach-se/770x/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/770x/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7721/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7721/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7721/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7722/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7722/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7722/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7751/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7751/io.c [new file with mode: 0644]
arch/sh/boards/mach-se/7751/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7751/pci.c [new file with mode: 0644]
arch/sh/boards/mach-se/7751/setup.c [new file with mode: 0644]
arch/sh/boards/mach-se/7780/Makefile [new file with mode: 0644]
arch/sh/boards/mach-se/7780/irq.c [new file with mode: 0644]
arch/sh/boards/mach-se/7780/setup.c [new file with mode: 0644]
arch/sh/boards/mach-sh03/Makefile [new file with mode: 0644]
arch/sh/boards/mach-sh03/rtc.c [new file with mode: 0644]
arch/sh/boards/mach-sh03/setup.c [new file with mode: 0644]
arch/sh/boards/mach-sh7763rdp/Makefile [new file with mode: 0644]
arch/sh/boards/mach-sh7763rdp/irq.c [new file with mode: 0644]
arch/sh/boards/mach-sh7763rdp/setup.c [new file with mode: 0644]
arch/sh/boards/mach-sh7785lcr/Makefile [new file with mode: 0644]
arch/sh/boards/mach-sh7785lcr/setup.c [new file with mode: 0644]
arch/sh/boards/mach-shmin/Makefile [new file with mode: 0644]
arch/sh/boards/mach-shmin/setup.c [new file with mode: 0644]
arch/sh/boards/mach-snapgear/Makefile [new file with mode: 0644]
arch/sh/boards/mach-snapgear/io.c [new file with mode: 0644]
arch/sh/boards/mach-snapgear/setup.c [new file with mode: 0644]
arch/sh/boards/mach-systemh/Makefile [new file with mode: 0644]
arch/sh/boards/mach-systemh/io.c [new file with mode: 0644]
arch/sh/boards/mach-systemh/irq.c [new file with mode: 0644]
arch/sh/boards/mach-systemh/setup.c [new file with mode: 0644]
arch/sh/boards/mach-titan/Makefile [new file with mode: 0644]
arch/sh/boards/mach-titan/io.c [new file with mode: 0644]
arch/sh/boards/mach-titan/setup.c [new file with mode: 0644]
arch/sh/boards/mach-x3proto/Makefile [new file with mode: 0644]
arch/sh/boards/mach-x3proto/ilsel.c [new file with mode: 0644]
arch/sh/boards/mach-x3proto/setup.c [new file with mode: 0644]
arch/sh/boards/magicpanelr2/Kconfig [deleted file]
arch/sh/boards/magicpanelr2/Makefile [deleted file]
arch/sh/boards/magicpanelr2/setup.c [deleted file]
arch/sh/boards/renesas/ap325rxa/Makefile [deleted file]
arch/sh/boards/renesas/ap325rxa/setup.c [deleted file]
arch/sh/boards/renesas/edosk7705/Makefile [deleted file]
arch/sh/boards/renesas/edosk7705/io.c [deleted file]
arch/sh/boards/renesas/edosk7705/setup.c [deleted file]
arch/sh/boards/renesas/migor/Kconfig [deleted file]
arch/sh/boards/renesas/migor/Makefile [deleted file]
arch/sh/boards/renesas/migor/lcd_qvga.c [deleted file]
arch/sh/boards/renesas/migor/setup.c [deleted file]
arch/sh/boards/renesas/r7780rp/Kconfig [deleted file]
arch/sh/boards/renesas/r7780rp/Makefile [deleted file]
arch/sh/boards/renesas/r7780rp/irq-r7780mp.c [deleted file]
arch/sh/boards/renesas/r7780rp/irq-r7780rp.c [deleted file]
arch/sh/boards/renesas/r7780rp/irq-r7785rp.c [deleted file]
arch/sh/boards/renesas/r7780rp/psw.c [deleted file]
arch/sh/boards/renesas/r7780rp/setup.c [deleted file]
arch/sh/boards/renesas/rsk7203/Makefile [deleted file]
arch/sh/boards/renesas/rsk7203/setup.c [deleted file]
arch/sh/boards/renesas/rts7751r2d/Kconfig [deleted file]
arch/sh/boards/renesas/rts7751r2d/Makefile [deleted file]
arch/sh/boards/renesas/rts7751r2d/irq.c [deleted file]
arch/sh/boards/renesas/rts7751r2d/setup.c [deleted file]
arch/sh/boards/renesas/sdk7780/Kconfig [deleted file]
arch/sh/boards/renesas/sdk7780/Makefile [deleted file]
arch/sh/boards/renesas/sdk7780/irq.c [deleted file]
arch/sh/boards/renesas/sdk7780/setup.c [deleted file]
arch/sh/boards/renesas/sh7763rdp/Makefile [deleted file]
arch/sh/boards/renesas/sh7763rdp/irq.c [deleted file]
arch/sh/boards/renesas/sh7763rdp/setup.c [deleted file]
arch/sh/boards/renesas/sh7785lcr/Makefile [deleted file]
arch/sh/boards/renesas/sh7785lcr/setup.c [deleted file]
arch/sh/boards/renesas/systemh/Makefile [deleted file]
arch/sh/boards/renesas/systemh/io.c [deleted file]
arch/sh/boards/renesas/systemh/irq.c [deleted file]
arch/sh/boards/renesas/systemh/setup.c [deleted file]
arch/sh/boards/renesas/x3proto/Makefile [deleted file]
arch/sh/boards/renesas/x3proto/ilsel.c [deleted file]
arch/sh/boards/renesas/x3proto/setup.c [deleted file]
arch/sh/boards/se/7206/Makefile [deleted file]
arch/sh/boards/se/7206/io.c [deleted file]
arch/sh/boards/se/7206/irq.c [deleted file]
arch/sh/boards/se/7206/setup.c [deleted file]
arch/sh/boards/se/7343/Makefile [deleted file]
arch/sh/boards/se/7343/io.c [deleted file]
arch/sh/boards/se/7343/irq.c [deleted file]
arch/sh/boards/se/7343/setup.c [deleted file]
arch/sh/boards/se/7619/Makefile [deleted file]
arch/sh/boards/se/7619/setup.c [deleted file]
arch/sh/boards/se/770x/Makefile [deleted file]
arch/sh/boards/se/770x/io.c [deleted file]
arch/sh/boards/se/770x/irq.c [deleted file]
arch/sh/boards/se/770x/setup.c [deleted file]
arch/sh/boards/se/7721/Makefile [deleted file]
arch/sh/boards/se/7721/irq.c [deleted file]
arch/sh/boards/se/7721/setup.c [deleted file]
arch/sh/boards/se/7722/Makefile [deleted file]
arch/sh/boards/se/7722/irq.c [deleted file]
arch/sh/boards/se/7722/setup.c [deleted file]
arch/sh/boards/se/7751/Makefile [deleted file]
arch/sh/boards/se/7751/io.c [deleted file]
arch/sh/boards/se/7751/irq.c [deleted file]
arch/sh/boards/se/7751/pci.c [deleted file]
arch/sh/boards/se/7751/setup.c [deleted file]
arch/sh/boards/se/7780/Makefile [deleted file]
arch/sh/boards/se/7780/irq.c [deleted file]
arch/sh/boards/se/7780/setup.c [deleted file]
arch/sh/boards/sh03/Makefile [deleted file]
arch/sh/boards/sh03/rtc.c [deleted file]
arch/sh/boards/sh03/setup.c [deleted file]
arch/sh/boards/shmin/Makefile [deleted file]
arch/sh/boards/shmin/setup.c [deleted file]
arch/sh/boards/snapgear/Makefile [deleted file]
arch/sh/boards/snapgear/io.c [deleted file]
arch/sh/boards/snapgear/setup.c [deleted file]
arch/sh/boards/superh/microdev/Makefile [deleted file]
arch/sh/boards/superh/microdev/io.c [deleted file]
arch/sh/boards/superh/microdev/irq.c [deleted file]
arch/sh/boards/superh/microdev/led.c [deleted file]
arch/sh/boards/superh/microdev/setup.c [deleted file]
arch/sh/boards/titan/Makefile [deleted file]
arch/sh/boards/titan/io.c [deleted file]
arch/sh/boards/titan/setup.c [deleted file]

index 81eaa4b72f4abb18487011a8fa1804bd9b952557..83d170ccb0f80394863bb7bd2eff9072f4aefe96 100644 (file)
@@ -594,11 +594,11 @@ config SH_CAYMAN
 
 endmenu
 
-source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
-source "arch/sh/boards/renesas/r7780rp/Kconfig"
-source "arch/sh/boards/renesas/sdk7780/Kconfig"
-source "arch/sh/boards/renesas/migor/Kconfig"
-source "arch/sh/boards/magicpanelr2/Kconfig"
+source "arch/sh/boards/mach-r2d/Kconfig"
+source "arch/sh/boards/mach-highlander/Kconfig"
+source "arch/sh/boards/mach-sdk7780/Kconfig"
+source "arch/sh/boards/mach-migor/Kconfig"
+source "arch/sh/boards/mach-magicpanelr2/Kconfig"
 
 menu "Timer and clock configuration"
 
index f2b07b54c912f024fb3a1f9304f2302efbc55067..47bbfd8ae664be2c3fc2a9499267da7ea41eda65 100644 (file)
@@ -102,36 +102,36 @@ core-y                            += arch/sh/kernel/ arch/sh/mm/
 core-$(CONFIG_SH_FPU_EMU)      += arch/sh/math-emu/
 
 # Boards
-machdir-$(CONFIG_SH_SOLUTION_ENGINE)           += se/770x
-machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE)      += se/7722
-machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)      += se/7751
-machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE)      += se/7780
-machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE)      += se/7343
-machdir-$(CONFIG_SH_7721_SOLUTION_ENGINE)      += se/7721
-machdir-$(CONFIG_SH_HP6XX)                     += hp6xx
-machdir-$(CONFIG_SH_DREAMCAST)                 += dreamcast
-machdir-$(CONFIG_SH_SH03)                      += sh03
-machdir-$(CONFIG_SH_SECUREEDGE5410)            += snapgear
-machdir-$(CONFIG_SH_RTS7751R2D)                        += renesas/rts7751r2d
-machdir-$(CONFIG_SH_7751_SYSTEMH)              += renesas/systemh
-machdir-$(CONFIG_SH_EDOSK7705)                 += renesas/edosk7705
-machdir-$(CONFIG_SH_HIGHLANDER)                        += renesas/r7780rp
-machdir-$(CONFIG_SH_MIGOR)                     += renesas/migor
-machdir-$(CONFIG_SH_SDK7780)                   += renesas/sdk7780
-machdir-$(CONFIG_SH_X3PROTO)                   += renesas/x3proto
-machdir-$(CONFIG_SH_RSK7203)                   += renesas/rsk7203
-machdir-$(CONFIG_SH_AP325RXA)                  += renesas/ap325rxa
-machdir-$(CONFIG_SH_SH7763RDP)                 += renesas/sh7763rdp
-machdir-$(CONFIG_SH_SH7785LCR)                 += renesas/sh7785lcr
-machdir-$(CONFIG_SH_SH4202_MICRODEV)           += superh/microdev
-machdir-$(CONFIG_SH_LANDISK)                   += landisk
-machdir-$(CONFIG_SH_TITAN)                     += titan
-machdir-$(CONFIG_SH_SHMIN)                     += shmin
-machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE)      += se/7206
-machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE)      += se/7619
-machdir-$(CONFIG_SH_LBOX_RE2)                  += lboxre2
-machdir-$(CONFIG_SH_MAGIC_PANEL_R2)            += magicpanelr2
-machdir-$(CONFIG_SH_CAYMAN)                    += cayman
+machdir-$(CONFIG_SH_SOLUTION_ENGINE)           += mach-se/770x
+machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE)      += mach-se/7206
+machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE)      += mach-se/7619
+machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE)      += mach-se/7722
+machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)      += mach-se/7751
+machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE)      += mach-se/7780
+machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE)      += mach-se/7343
+machdir-$(CONFIG_SH_7721_SOLUTION_ENGINE)      += mach-se/7721
+machdir-$(CONFIG_SH_HP6XX)                     += mach-hp6xx
+machdir-$(CONFIG_SH_DREAMCAST)                 += mach-dreamcast
+machdir-$(CONFIG_SH_SH03)                      += mach-sh03
+machdir-$(CONFIG_SH_SECUREEDGE5410)            += mach-snapgear
+machdir-$(CONFIG_SH_RTS7751R2D)                        += mach-r2d
+machdir-$(CONFIG_SH_7751_SYSTEMH)              += mach-systemh
+machdir-$(CONFIG_SH_EDOSK7705)                 += mach-edosk7705
+machdir-$(CONFIG_SH_HIGHLANDER)                        += mach-highlander
+machdir-$(CONFIG_SH_MIGOR)                     += mach-migor
+machdir-$(CONFIG_SH_SDK7780)                   += mach-sdk7780
+machdir-$(CONFIG_SH_X3PROTO)                   += mach-x3proto
+machdir-$(CONFIG_SH_RSK7203)                   += mach-rsk7203
+machdir-$(CONFIG_SH_AP325RXA)                  += mach-ap325rxa
+machdir-$(CONFIG_SH_SH7763RDP)                 += mach-sh7763rdp
+machdir-$(CONFIG_SH_SH7785LCR)                 += mach-sh7785lcr
+machdir-$(CONFIG_SH_SH4202_MICRODEV)           += mach-microdev
+machdir-$(CONFIG_SH_LANDISK)                   += mach-landisk
+machdir-$(CONFIG_SH_TITAN)                     += mach-titan
+machdir-$(CONFIG_SH_SHMIN)                     += mach-shmin
+machdir-$(CONFIG_SH_LBOX_RE2)                  += mach-lboxre2
+machdir-$(CONFIG_SH_MAGIC_PANEL_R2)            += mach-magicpanelr2
+machdir-$(CONFIG_SH_CAYMAN)                    += mach-cayman
 
 incdir-y       := $(notdir $(machdir-y))
 
diff --git a/arch/sh/boards/cayman/Makefile b/arch/sh/boards/cayman/Makefile
deleted file mode 100644 (file)
index 489a8f8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the Hitachi Cayman specific parts of the kernel
-#
-obj-y := setup.o irq.o
-obj-$(CONFIG_HEARTBEAT)        += led.o
diff --git a/arch/sh/boards/cayman/irq.c b/arch/sh/boards/cayman/irq.c
deleted file mode 100644 (file)
index ceb37ae..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * arch/sh/mach-cayman/irq.c - SH-5 Cayman Interrupt Support
- *
- * This file handles the board specific parts of the Cayman interrupt system
- *
- * Copyright (C) 2002 Stuart Menefy
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/signal.h>
-#include <cpu/irq.h>
-#include <asm/page.h>
-
-/* Setup for the SMSC FDC37C935 / LAN91C100FD */
-#define SMSC_IRQ         IRQ_IRL1
-
-/* Setup for PCI Bus 2, which transmits interrupts via the EPLD */
-#define PCI2_IRQ         IRQ_IRL3
-
-unsigned long epld_virt;
-
-#define EPLD_BASE        0x04002000
-#define EPLD_STATUS_BASE (epld_virt + 0x10)
-#define EPLD_MASK_BASE   (epld_virt + 0x20)
-
-/* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto
-   the same SH-5 interrupt */
-
-static irqreturn_t cayman_interrupt_smsc(int irq, void *dev_id)
-{
-        printk(KERN_INFO "CAYMAN: spurious SMSC interrupt\n");
-       return IRQ_NONE;
-}
-
-static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)
-{
-        printk(KERN_INFO "CAYMAN: spurious PCI interrupt, IRQ %d\n", irq);
-       return IRQ_NONE;
-}
-
-static struct irqaction cayman_action_smsc = {
-       .name           = "Cayman SMSC Mux",
-       .handler        = cayman_interrupt_smsc,
-       .flags          = IRQF_DISABLED,
-};
-
-static struct irqaction cayman_action_pci2 = {
-       .name           = "Cayman PCI2 Mux",
-       .handler        = cayman_interrupt_pci2,
-       .flags          = IRQF_DISABLED,
-};
-
-static void enable_cayman_irq(unsigned int irq)
-{
-       unsigned long flags;
-       unsigned long mask;
-       unsigned int reg;
-       unsigned char bit;
-
-       irq -= START_EXT_IRQS;
-       reg = EPLD_MASK_BASE + ((irq / 8) << 2);
-       bit = 1<<(irq % 8);
-       local_irq_save(flags);
-       mask = ctrl_inl(reg);
-       mask |= bit;
-       ctrl_outl(mask, reg);
-       local_irq_restore(flags);
-}
-
-void disable_cayman_irq(unsigned int irq)
-{
-       unsigned long flags;
-       unsigned long mask;
-       unsigned int reg;
-       unsigned char bit;
-
-       irq -= START_EXT_IRQS;
-       reg = EPLD_MASK_BASE + ((irq / 8) << 2);
-       bit = 1<<(irq % 8);
-       local_irq_save(flags);
-       mask = ctrl_inl(reg);
-       mask &= ~bit;
-       ctrl_outl(mask, reg);
-       local_irq_restore(flags);
-}
-
-static void ack_cayman_irq(unsigned int irq)
-{
-       disable_cayman_irq(irq);
-}
-
-static void end_cayman_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-               enable_cayman_irq(irq);
-}
-
-static unsigned int startup_cayman_irq(unsigned int irq)
-{
-       enable_cayman_irq(irq);
-       return 0; /* never anything pending */
-}
-
-static void shutdown_cayman_irq(unsigned int irq)
-{
-       disable_cayman_irq(irq);
-}
-
-struct hw_interrupt_type cayman_irq_type = {
-       .typename       = "Cayman-IRQ",
-       .startup        = startup_cayman_irq,
-       .shutdown       = shutdown_cayman_irq,
-       .enable         = enable_cayman_irq,
-       .disable        = disable_cayman_irq,
-       .ack            = ack_cayman_irq,
-       .end            = end_cayman_irq,
-};
-
-int cayman_irq_demux(int evt)
-{
-       int irq = intc_evt_to_irq[evt];
-
-       if (irq == SMSC_IRQ) {
-               unsigned long status;
-               int i;
-
-               status = ctrl_inl(EPLD_STATUS_BASE) &
-                        ctrl_inl(EPLD_MASK_BASE) & 0xff;
-               if (status == 0) {
-                       irq = -1;
-               } else {
-                       for (i=0; i<8; i++) {
-                               if (status & (1<<i))
-                                       break;
-                       }
-                       irq = START_EXT_IRQS + i;
-               }
-       }
-
-       if (irq == PCI2_IRQ) {
-               unsigned long status;
-               int i;
-
-               status = ctrl_inl(EPLD_STATUS_BASE + 3 * sizeof(u32)) &
-                        ctrl_inl(EPLD_MASK_BASE + 3 * sizeof(u32)) & 0xff;
-               if (status == 0) {
-                       irq = -1;
-               } else {
-                       for (i=0; i<8; i++) {
-                               if (status & (1<<i))
-                                       break;
-                       }
-                       irq = START_EXT_IRQS + (3 * 8) + i;
-               }
-       }
-
-       return irq;
-}
-
-#if defined(CONFIG_PROC_FS) && defined(CONFIG_SYSCTL)
-int cayman_irq_describe(char* p, int irq)
-{
-       if (irq < NR_INTC_IRQS) {
-               return intc_irq_describe(p, irq);
-       } else if (irq < NR_INTC_IRQS + 8) {
-               return sprintf(p, "(SMSC %d)", irq - NR_INTC_IRQS);
-       } else if ((irq >= NR_INTC_IRQS + 24) && (irq < NR_INTC_IRQS + 32)) {
-               return sprintf(p, "(PCI2 %d)", irq - (NR_INTC_IRQS + 24));
-       }
-
-       return 0;
-}
-#endif
-
-void init_cayman_irq(void)
-{
-       int i;
-
-       epld_virt = onchip_remap(EPLD_BASE, 1024, "EPLD");
-       if (!epld_virt) {
-               printk(KERN_ERR "Cayman IRQ: Unable to remap EPLD\n");
-               return;
-       }
-
-       for (i=0; i<NR_EXT_IRQS; i++) {
-               irq_desc[START_EXT_IRQS + i].chip = &cayman_irq_type;
-       }
-
-       /* Setup the SMSC interrupt */
-       setup_irq(SMSC_IRQ, &cayman_action_smsc);
-       setup_irq(PCI2_IRQ, &cayman_action_pci2);
-}
diff --git a/arch/sh/boards/cayman/led.c b/arch/sh/boards/cayman/led.c
deleted file mode 100644 (file)
index a808eac..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * arch/sh/boards/cayman/led.c
- *
- * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Flash the LEDs
- */
-#include <asm/io.h>
-
-/*
-** It is supposed these functions to be used for a low level
-** debugging (via Cayman LEDs), hence to be available as soon
-** as possible.
-** Unfortunately Cayman LEDs relies on Cayman EPLD to be mapped
-** (this happen when IRQ are initialized... quite late).
-** These triky dependencies should be removed. Temporary, it
-** may be enough to NOP until EPLD is mapped.
-*/
-
-extern unsigned long epld_virt;
-
-#define LED_ADDR      (epld_virt + 0x008)
-#define HDSP2534_ADDR (epld_virt + 0x100)
-
-void mach_led(int position, int value)
-{
-       if (!epld_virt)
-               return;
-
-       if (value)
-               ctrl_outl(0, LED_ADDR);
-       else
-               ctrl_outl(1, LED_ADDR);
-
-}
-
-void mach_alphanum(int position, unsigned char value)
-{
-       if (!epld_virt)
-               return;
-
-       ctrl_outb(value, HDSP2534_ADDR + 0xe0 + (position << 2));
-}
-
-void mach_alphanum_brightness(int setting)
-{
-       ctrl_outb(setting & 7, HDSP2534_ADDR + 0xc0);
-}
diff --git a/arch/sh/boards/cayman/setup.c b/arch/sh/boards/cayman/setup.c
deleted file mode 100644 (file)
index e7f9cc5..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * arch/sh/mach-cayman/setup.c
- *
- * SH5 Cayman support
- *
- * Copyright (C) 2002  David J. Mckay & Benedict Gaster
- * Copyright (C) 2003 - 2007  Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <cpu/irq.h>
-
-/*
- * Platform Dependent Interrupt Priorities.
- */
-
-/* Using defaults defined in irq.h */
-#define        RES NO_PRIORITY         /* Disabled */
-#define IR0 IRL0_PRIORITY      /* IRLs */
-#define IR1 IRL1_PRIORITY
-#define IR2 IRL2_PRIORITY
-#define IR3 IRL3_PRIORITY
-#define PCA INTA_PRIORITY      /* PCI Ints */
-#define PCB INTB_PRIORITY
-#define PCC INTC_PRIORITY
-#define PCD INTD_PRIORITY
-#define SER TOP_PRIORITY
-#define ERR TOP_PRIORITY
-#define PW0 TOP_PRIORITY
-#define PW1 TOP_PRIORITY
-#define PW2 TOP_PRIORITY
-#define PW3 TOP_PRIORITY
-#define DM0 NO_PRIORITY                /* DMA Ints */
-#define DM1 NO_PRIORITY
-#define DM2 NO_PRIORITY
-#define DM3 NO_PRIORITY
-#define DAE NO_PRIORITY
-#define TU0 TIMER_PRIORITY     /* TMU Ints */
-#define TU1 NO_PRIORITY
-#define TU2 NO_PRIORITY
-#define TI2 NO_PRIORITY
-#define ATI NO_PRIORITY                /* RTC Ints */
-#define PRI NO_PRIORITY
-#define CUI RTC_PRIORITY
-#define ERI SCIF_PRIORITY      /* SCIF Ints */
-#define RXI SCIF_PRIORITY
-#define BRI SCIF_PRIORITY
-#define TXI SCIF_PRIORITY
-#define ITI TOP_PRIORITY       /* WDT Ints */
-
-/* Setup for the SMSC FDC37C935 */
-#define SMSC_SUPERIO_BASE      0x04000000
-#define SMSC_CONFIG_PORT_ADDR  0x3f0
-#define SMSC_INDEX_PORT_ADDR   SMSC_CONFIG_PORT_ADDR
-#define SMSC_DATA_PORT_ADDR    0x3f1
-
-#define SMSC_ENTER_CONFIG_KEY  0x55
-#define SMSC_EXIT_CONFIG_KEY   0xaa
-
-#define SMCS_LOGICAL_DEV_INDEX 0x07
-#define SMSC_DEVICE_ID_INDEX   0x20
-#define SMSC_DEVICE_REV_INDEX  0x21
-#define SMSC_ACTIVATE_INDEX    0x30
-#define SMSC_PRIMARY_BASE_INDEX  0x60
-#define SMSC_SECONDARY_BASE_INDEX 0x62
-#define SMSC_PRIMARY_INT_INDEX 0x70
-#define SMSC_SECONDARY_INT_INDEX 0x72
-
-#define SMSC_IDE1_DEVICE       1
-#define SMSC_KEYBOARD_DEVICE   7
-#define SMSC_CONFIG_REGISTERS  8
-
-#define SMSC_SUPERIO_READ_INDEXED(index) ({ \
-       outb((index), SMSC_INDEX_PORT_ADDR); \
-       inb(SMSC_DATA_PORT_ADDR); })
-#define SMSC_SUPERIO_WRITE_INDEXED(val, index) ({ \
-       outb((index), SMSC_INDEX_PORT_ADDR); \
-       outb((val),   SMSC_DATA_PORT_ADDR); })
-
-#define IDE1_PRIMARY_BASE      0x01f0
-#define IDE1_SECONDARY_BASE    0x03f6
-
-unsigned long smsc_superio_virt;
-
-int platform_int_priority[NR_INTC_IRQS] = {
-       IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ  0- 7 */
-       RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ  8-15 */
-       PW1, PW0, DM0, DM1, DM2, DM3, DAE, RES, /* IRQ 16-23 */
-       RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 24-31 */
-       TU0, TU1, TU2, TI2, ATI, PRI, CUI, ERI, /* IRQ 32-39 */
-       RXI, BRI, TXI, RES, RES, RES, RES, RES, /* IRQ 40-47 */
-       RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 48-55 */
-       RES, RES, RES, RES, RES, RES, RES, ITI, /* IRQ 56-63 */
-};
-
-static int __init smsc_superio_setup(void)
-{
-       unsigned char devid, devrev;
-
-       smsc_superio_virt = onchip_remap(SMSC_SUPERIO_BASE, 1024, "SMSC SuperIO");
-       if (!smsc_superio_virt) {
-               panic("Unable to remap SMSC SuperIO\n");
-       }
-
-       /* Initially the chip is in run state */
-       /* Put it into configuration state */
-       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
-       /* Read device ID info */
-       devid = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
-       devrev = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
-       printk("SMSC SuperIO devid %02x rev %02x\n", devid, devrev);
-
-       /* Select the keyboard device */
-       SMSC_SUPERIO_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-
-       /* enable it */
-       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-
-       /* Select the interrupts */
-       /* On a PC keyboard is IRQ1, mouse is IRQ12 */
-       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_PRIMARY_INT_INDEX);
-       SMSC_SUPERIO_WRITE_INDEXED(12, SMSC_SECONDARY_INT_INDEX);
-
-#ifdef CONFIG_IDE
-       /*
-        * Only IDE1 exists on the Cayman
-        */
-
-       /* Power it on */
-       SMSC_SUPERIO_WRITE_INDEXED(1 << SMSC_IDE1_DEVICE, 0x22);
-
-       SMSC_SUPERIO_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-
-       SMSC_SUPERIO_WRITE_INDEXED(IDE1_PRIMARY_BASE >> 8,
-                                  SMSC_PRIMARY_BASE_INDEX + 0);
-       SMSC_SUPERIO_WRITE_INDEXED(IDE1_PRIMARY_BASE & 0xff,
-                                  SMSC_PRIMARY_BASE_INDEX + 1);
-
-       SMSC_SUPERIO_WRITE_INDEXED(IDE1_SECONDARY_BASE >> 8,
-                                  SMSC_SECONDARY_BASE_INDEX + 0);
-       SMSC_SUPERIO_WRITE_INDEXED(IDE1_SECONDARY_BASE & 0xff,
-                                  SMSC_SECONDARY_BASE_INDEX + 1);
-
-       SMSC_SUPERIO_WRITE_INDEXED(14, SMSC_PRIMARY_INT_INDEX);
-
-       SMSC_SUPERIO_WRITE_INDEXED(SMSC_CONFIG_REGISTERS,
-                                  SMCS_LOGICAL_DEV_INDEX);
-
-       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
-       SMSC_SUPERIO_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
-       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
-       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
-#endif
-
-       /* Exit the configuration state */
-       outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
-       return 0;
-}
-__initcall(smsc_superio_setup);
-
-static void __iomem *cayman_ioport_map(unsigned long port, unsigned int len)
-{
-       if (port < 0x400) {
-               extern unsigned long smsc_superio_virt;
-               return (void __iomem *)((port << 2) | smsc_superio_virt);
-       }
-
-       return (void __iomem *)port;
-}
-
-extern void init_cayman_irq(void);
-
-static struct sh_machine_vector mv_cayman __initmv = {
-       .mv_name                = "Hitachi Cayman",
-       .mv_nr_irqs             = 64,
-       .mv_ioport_map          = cayman_ioport_map,
-       .mv_init_irq            = init_cayman_irq,
-};
diff --git a/arch/sh/boards/dreamcast/Makefile b/arch/sh/boards/dreamcast/Makefile
deleted file mode 100644 (file)
index 7b97546..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# Makefile for the Sega Dreamcast specific parts of the kernel
-#
-
-obj-y   := setup.o irq.o rtc.o
-
diff --git a/arch/sh/boards/dreamcast/irq.c b/arch/sh/boards/dreamcast/irq.c
deleted file mode 100644 (file)
index 67bdc33..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * arch/sh/boards/dreamcast/irq.c
- *
- * Holly IRQ support for the Sega Dreamcast.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@0xd6.org>
- *
- * This file is part of the LinuxDC project (www.linuxdc.org)
- * Released under the terms of the GNU GPL v2.0
- */
-
-#include <linux/irq.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <mach/sysasic.h>
-
-/* Dreamcast System ASIC Hardware Events -
-
-   The Dreamcast's System ASIC (a.k.a. Holly) is responsible for receiving
-   hardware events from system peripherals and triggering an SH7750 IRQ.
-   Hardware events can trigger IRQs 13, 11, or 9 depending on which bits are
-   set in the Event Mask Registers (EMRs).  When a hardware event is
-   triggered, it's corresponding bit in the Event Status Registers (ESRs)
-   is set, and that bit should be rewritten to the ESR to acknowledge that
-   event.
-
-   There are three 32-bit ESRs located at 0xa05f8900 - 0xa05f6908.  Event
-   types can be found in include/asm-sh/dreamcast/sysasic.h. There are three
-   groups of EMRs that parallel the ESRs.  Each EMR group corresponds to an
-   IRQ, so 0xa05f6910 - 0xa05f6918 triggers IRQ 13, 0xa05f6920 - 0xa05f6928
-   triggers IRQ 11, and 0xa05f6930 - 0xa05f6938 triggers IRQ 9.
-
-   In the kernel, these events are mapped to virtual IRQs so that drivers can
-   respond to them as they would a normal interrupt.  In order to keep this
-   mapping simple, the events are mapped as:
-
-   6900/6910 - Events  0-31, IRQ 13
-   6904/6924 - Events 32-63, IRQ 11
-   6908/6938 - Events 64-95, IRQ  9
-
-*/
-
-#define ESR_BASE 0x005f6900    /* Base event status register */
-#define EMR_BASE 0x005f6910    /* Base event mask register */
-
-/* Helps us determine the EMR group that this event belongs to: 0 = 0x6910,
-   1 = 0x6920, 2 = 0x6930; also determine the event offset */
-#define LEVEL(event) (((event) - HW_EVENT_IRQ_BASE) / 32)
-
-/* Return the hardware event's bit positon within the EMR/ESR */
-#define EVENT_BIT(event) (((event) - HW_EVENT_IRQ_BASE) & 31)
-
-/* For each of these *_irq routines, the IRQ passed in is the virtual IRQ
-   (logically mapped to the corresponding bit for the hardware event). */
-
-/* Disable the hardware event by masking its bit in its EMR */
-static inline void disable_systemasic_irq(unsigned int irq)
-{
-        __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
-        __u32 mask;
-
-        mask = inl(emr);
-        mask &= ~(1 << EVENT_BIT(irq));
-        outl(mask, emr);
-}
-
-/* Enable the hardware event by setting its bit in its EMR */
-static inline void enable_systemasic_irq(unsigned int irq)
-{
-        __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
-        __u32 mask;
-
-        mask = inl(emr);
-        mask |= (1 << EVENT_BIT(irq));
-        outl(mask, emr);
-}
-
-/* Acknowledge a hardware event by writing its bit back to its ESR */
-static void ack_systemasic_irq(unsigned int irq)
-{
-        __u32 esr = ESR_BASE + (LEVEL(irq) << 2);
-        disable_systemasic_irq(irq);
-        outl((1 << EVENT_BIT(irq)), esr);
-}
-
-/* After a IRQ has been ack'd and responded to, it needs to be renabled */
-static void end_systemasic_irq(unsigned int irq)
-{
-        if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-                enable_systemasic_irq(irq);
-}
-
-static unsigned int startup_systemasic_irq(unsigned int irq)
-{
-        enable_systemasic_irq(irq);
-
-        return 0;
-}
-
-static void shutdown_systemasic_irq(unsigned int irq)
-{
-        disable_systemasic_irq(irq);
-}
-
-struct hw_interrupt_type systemasic_int = {
-        .typename       = "System ASIC",
-        .startup        = startup_systemasic_irq,
-        .shutdown       = shutdown_systemasic_irq,
-        .enable         = enable_systemasic_irq,
-        .disable        = disable_systemasic_irq,
-        .ack            = ack_systemasic_irq,
-        .end            = end_systemasic_irq,
-};
-
-/*
- * Map the hardware event indicated by the processor IRQ to a virtual IRQ.
- */
-int systemasic_irq_demux(int irq)
-{
-        __u32 emr, esr, status, level;
-        __u32 j, bit;
-
-        switch (irq) {
-                case 13:
-                        level = 0;
-                        break;
-                case 11:
-                        level = 1;
-                        break;
-                case  9:
-                        level = 2;
-                        break;
-                default:
-                        return irq;
-        }
-        emr = EMR_BASE + (level << 4) + (level << 2);
-        esr = ESR_BASE + (level << 2);
-
-        /* Mask the ESR to filter any spurious, unwanted interrupts */
-        status = inl(esr);
-        status &= inl(emr);
-
-        /* Now scan and find the first set bit as the event to map */
-        for (bit = 1, j = 0; j < 32; bit <<= 1, j++) {
-                if (status & bit) {
-                        irq = HW_EVENT_IRQ_BASE + j + (level << 5);
-                        return irq;
-                }
-        }
-
-        /* Not reached */
-        return irq;
-}
diff --git a/arch/sh/boards/dreamcast/rtc.c b/arch/sh/boards/dreamcast/rtc.c
deleted file mode 100644 (file)
index a743368..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * arch/sh/boards/dreamcast/rtc.c
- *
- * Dreamcast AICA RTC routines.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@0xd6.org>
- * Copyright (c) 2002 Paul Mundt <lethal@chaoticdreams.org>
- *
- * Released under the terms of the GNU GPL v2.0.
- *
- */
-
-#include <linux/time.h>
-#include <asm/rtc.h>
-#include <asm/io.h>
-
-/* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in
-   seconds) to get the standard Unix Epoch when getting the time, and add
-   20 years when setting the time. */
-#define TWENTY_YEARS ((20 * 365LU + 5) * 86400)
-
-/* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit
-   registers.*/
-#define AICA_RTC_SECS_H                0xa0710000
-#define AICA_RTC_SECS_L                0xa0710004
-
-/**
- * aica_rtc_gettimeofday - Get the time from the AICA RTC
- * @ts: pointer to resulting timespec
- *
- * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.
- */
-static void aica_rtc_gettimeofday(struct timespec *ts)
-{
-       unsigned long val1, val2;
-
-       do {
-               val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
-                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
-
-               val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
-                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
-       } while (val1 != val2);
-
-       ts->tv_sec = val1 - TWENTY_YEARS;
-
-       /* Can't get nanoseconds with just a seconds counter. */
-       ts->tv_nsec = 0;
-}
-
-/**
- * aica_rtc_settimeofday - Set the AICA RTC to the current time
- * @secs: contains the time_t to set
- *
- * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter.
- */
-static int aica_rtc_settimeofday(const time_t secs)
-{
-       unsigned long val1, val2;
-       unsigned long adj = secs + TWENTY_YEARS;
-
-       do {
-               ctrl_outl((adj & 0xffff0000) >> 16, AICA_RTC_SECS_H);
-               ctrl_outl((adj & 0xffff), AICA_RTC_SECS_L);
-
-               val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
-                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
-
-               val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
-                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
-       } while (val1 != val2);
-
-       return 0;
-}
-
-void aica_time_init(void)
-{
-       rtc_sh_get_time = aica_rtc_gettimeofday;
-       rtc_sh_set_time = aica_rtc_settimeofday;
-}
-
diff --git a/arch/sh/boards/dreamcast/setup.c b/arch/sh/boards/dreamcast/setup.c
deleted file mode 100644 (file)
index 7d944fc..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * arch/sh/boards/dreamcast/setup.c
- *
- * Hardware support for the Sega Dreamcast.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org>
- * Copyright (c) 2002, 2003, 2004 Paul Mundt <lethal@linux-sh.org>
- *
- * This file is part of the LinuxDC project (www.linuxdc.org)
- *
- * Released under the terms of the GNU GPL v2.0.
- *
- * This file originally bore the message (with enclosed-$):
- *     Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp
- *     SEGA Dreamcast support
- */
-
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/device.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/rtc.h>
-#include <asm/machvec.h>
-#include <mach/sysasic.h>
-
-extern struct hw_interrupt_type systemasic_int;
-extern void aica_time_init(void);
-extern int gapspci_init(void);
-extern int systemasic_irq_demux(int);
-
-static void __init dreamcast_setup(char **cmdline_p)
-{
-       int i;
-
-       /* Mask all hardware events */
-       /* XXX */
-
-       /* Acknowledge any previous events */
-       /* XXX */
-
-       __set_io_port_base(0xa0000000);
-
-       /* Assign all virtual IRQs to the System ASIC int. handler */
-       for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
-               irq_desc[i].chip = &systemasic_int;
-
-       board_time_init = aica_time_init;
-
-#ifdef CONFIG_PCI
-       if (gapspci_init() < 0)
-               printk(KERN_WARNING "GAPSPCI was not detected.\n");
-#endif
-}
-
-static struct sh_machine_vector mv_dreamcast __initmv = {
-       .mv_name                = "Sega Dreamcast",
-       .mv_setup               = dreamcast_setup,
-       .mv_irq_demux           = systemasic_irq_demux,
-};
diff --git a/arch/sh/boards/hp6xx/Makefile b/arch/sh/boards/hp6xx/Makefile
deleted file mode 100644 (file)
index b312427..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Makefile for the HP6xx specific parts of the kernel
-#
-
-obj-y                  := setup.o
-obj-$(CONFIG_PM)       += pm.o pm_wakeup.o
-obj-$(CONFIG_APM_EMULATION)    += hp6xx_apm.o
diff --git a/arch/sh/boards/hp6xx/hp6xx_apm.c b/arch/sh/boards/hp6xx/hp6xx_apm.c
deleted file mode 100644 (file)
index 177f4f0..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * bios-less APM driver for hp680
- *
- * Copyright 2005 (c) Andriy Skulysh <askulysh@gmail.com>
- * Copyright 2008 (c) Kristoffer Ericson <kristoffer.ericson@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License.
- */
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/apm-emulation.h>
-#include <linux/io.h>
-#include <asm/adc.h>
-#include <asm/hp6xx.h>
-
-/* percentage values */
-#define APM_CRITICAL                   10
-#define APM_LOW                                30
-
-/* resonably sane values */
-#define HP680_BATTERY_MAX              898
-#define HP680_BATTERY_MIN              486
-#define HP680_BATTERY_AC_ON            1023
-
-#define MODNAME "hp6x0_apm"
-
-#define PGDR   0xa400012c
-
-static void hp6x0_apm_get_power_status(struct apm_power_info *info)
-{
-       int battery, backup, charging, percentage;
-       u8 pgdr;
-
-       battery         = adc_single(ADC_CHANNEL_BATTERY);
-       backup          = adc_single(ADC_CHANNEL_BACKUP);
-       charging        = adc_single(ADC_CHANNEL_CHARGE);
-
-       percentage = 100 * (battery - HP680_BATTERY_MIN) /
-                          (HP680_BATTERY_MAX - HP680_BATTERY_MIN);
-
-       /* % of full battery */
-       info->battery_life = percentage;
-
-       /* We want our estimates in minutes */
-       info->units = 0;
-
-       /* Extremely(!!) rough estimate, we will replace this with a datalist later on */
-       info->time = (2 * battery);
-
-       info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ?
-                        APM_AC_ONLINE : APM_AC_OFFLINE;
-
-       pgdr = ctrl_inb(PGDR);
-       if (pgdr & PGDR_MAIN_BATTERY_OUT) {
-               info->battery_status    = APM_BATTERY_STATUS_NOT_PRESENT;
-               info->battery_flag      = 0x80;
-       } else if (charging < 8) {
-               info->battery_status    = APM_BATTERY_STATUS_CHARGING;
-               info->battery_flag      = 0x08;
-               info->ac_line_status    = 0x01;
-       } else if (percentage <= APM_CRITICAL) {
-               info->battery_status    = APM_BATTERY_STATUS_CRITICAL;
-               info->battery_flag      = 0x04;
-       } else if (percentage <= APM_LOW) {
-               info->battery_status    = APM_BATTERY_STATUS_LOW;
-               info->battery_flag      = 0x02;
-       } else {
-               info->battery_status    = APM_BATTERY_STATUS_HIGH;
-               info->battery_flag      = 0x01;
-       }
-}
-
-static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev)
-{
-       if (!APM_DISABLED)
-               apm_queue_event(APM_USER_SUSPEND);
-
-       return IRQ_HANDLED;
-}
-
-static int __init hp6x0_apm_init(void)
-{
-       int ret;
-
-       ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt,
-                         IRQF_DISABLED, MODNAME, NULL);
-       if (unlikely(ret < 0)) {
-               printk(KERN_ERR MODNAME ": IRQ %d request failed\n",
-                      HP680_BTN_IRQ);
-               return ret;
-       }
-
-       apm_get_power_status = hp6x0_apm_get_power_status;
-
-       return ret;
-}
-
-static void __exit hp6x0_apm_exit(void)
-{
-       free_irq(HP680_BTN_IRQ, 0);
-}
-
-module_init(hp6x0_apm_init);
-module_exit(hp6x0_apm_exit);
-
-MODULE_AUTHOR("Adriy Skulysh");
-MODULE_DESCRIPTION("hp6xx Advanced Power Management");
-MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/hp6xx/pm.c b/arch/sh/boards/hp6xx/pm.c
deleted file mode 100644 (file)
index e96684d..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * hp6x0 Power Management Routines
- *
- * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License.
- */
-#include <linux/init.h>
-#include <linux/suspend.h>
-#include <linux/errno.h>
-#include <linux/time.h>
-#include <asm/io.h>
-#include <asm/hd64461.h>
-#include <asm/hp6xx.h>
-#include <cpu/dac.h>
-#include <asm/pm.h>
-
-#define STBCR          0xffffff82
-#define STBCR2         0xffffff88
-
-static int hp6x0_pm_enter(suspend_state_t state)
-{
-       u8 stbcr, stbcr2;
-#ifdef CONFIG_HD64461_ENABLER
-       u8 scr;
-       u16 hd64461_stbcr;
-#endif
-
-#ifdef CONFIG_HD64461_ENABLER
-       outb(0, HD64461_PCC1CSCIER);
-
-       scr = inb(HD64461_PCC1SCR);
-       scr |= HD64461_PCCSCR_VCC1;
-       outb(scr, HD64461_PCC1SCR);
-
-       hd64461_stbcr = inw(HD64461_STBCR);
-       hd64461_stbcr |= HD64461_STBCR_SPC1ST;
-       outw(hd64461_stbcr, HD64461_STBCR);
-#endif
-
-       ctrl_outb(0x1f, DACR);
-
-       stbcr = ctrl_inb(STBCR);
-       ctrl_outb(0x01, STBCR);
-
-       stbcr2 = ctrl_inb(STBCR2);
-       ctrl_outb(0x7f , STBCR2);
-
-       outw(0xf07f, HD64461_SCPUCR);
-
-       pm_enter();
-
-       outw(0, HD64461_SCPUCR);
-       ctrl_outb(stbcr, STBCR);
-       ctrl_outb(stbcr2, STBCR2);
-
-#ifdef CONFIG_HD64461_ENABLER
-       hd64461_stbcr = inw(HD64461_STBCR);
-       hd64461_stbcr &= ~HD64461_STBCR_SPC1ST;
-       outw(hd64461_stbcr, HD64461_STBCR);
-
-       outb(0x4c, HD64461_PCC1CSCIER);
-       outb(0x00, HD64461_PCC1CSCR);
-#endif
-
-       return 0;
-}
-
-static struct platform_suspend_ops hp6x0_pm_ops = {
-       .enter          = hp6x0_pm_enter,
-       .valid          = suspend_valid_only_mem,
-};
-
-static int __init hp6x0_pm_init(void)
-{
-       suspend_set_ops(&hp6x0_pm_ops);
-       return 0;
-}
-
-late_initcall(hp6x0_pm_init);
diff --git a/arch/sh/boards/hp6xx/pm_wakeup.S b/arch/sh/boards/hp6xx/pm_wakeup.S
deleted file mode 100644 (file)
index 44b648c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-
-#include <linux/linkage.h>
-#include <cpu/mmu_context.h>
-
-#define k0     r0
-#define k1     r1
-#define k2     r2
-#define k3     r3
-#define k4     r4
-
-/*
- * Kernel mode register usage:
- *     k0      scratch
- *     k1      scratch
- *     k2      scratch (Exception code)
- *     k3      scratch (Return address)
- *     k4      scratch
- *     k5      reserved
- *     k6      Global Interrupt Mask (0--15 << 4)
- *     k7      CURRENT_THREAD_INFO (pointer to current thread info)
- */
-
-ENTRY(wakeup_start)
-! clear STBY bit
-       mov     #-126, k2
-       and     #127, k0
-       mov.b   k0, @k2
-! enable refresh
-       mov.l   5f, k1
-       mov.w   6f, k0
-       mov.w   k0, @k1
-! jump to handler
-       mov.l   2f, k2
-       mov.l   3f, k3
-       mov.l   @k2, k2
-
-       mov.l   4f, k1
-       jmp     @k1
-       nop
-
-       .align  2
-1:     .long   EXPEVT
-2:     .long   INTEVT
-3:     .long   ret_from_irq
-4:     .long   handle_exception
-5:     .long   0xffffff68
-6:     .word   0x0524
-
-ENTRY(wakeup_end)
-       nop
diff --git a/arch/sh/boards/hp6xx/setup.c b/arch/sh/boards/hp6xx/setup.c
deleted file mode 100644 (file)
index 475b46c..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * linux/arch/sh/boards/hp6xx/setup.c
- *
- * Copyright (C) 2002 Andriy Skulysh
- * Copyright (C) 2007 Kristoffer Ericson <Kristoffer_e1@hotmail.com>
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * Setup code for HP620/HP660/HP680/HP690 (internal peripherials only)
- */
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/hd64461.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/hp6xx.h>
-#include <cpu/dac.h>
-
-#define        SCPCR   0xa4000116
-#define        SCPDR   0xa4000136
-
-/* CF Slot */
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start = 0x15000000 + 0x1f0,
-               .end   = 0x15000000 + 0x1f0 + 0x08 - 0x01,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = 0x15000000 + 0x1fe,
-               .end   = 0x15000000 + 0x1fe + 0x01,
-               .flags = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start = 77,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device = {
-       .name           =  "pata_platform",
-       .id             =  -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static struct platform_device jornadakbd_device = {
-       .name           = "jornada680_kbd",
-       .id             = -1,
-};
-
-static struct platform_device *hp6xx_devices[] __initdata = {
-       &cf_ide_device,
-       &jornadakbd_device,
-};
-
-static void __init hp6xx_init_irq(void)
-{
-       /* Gets touchscreen and powerbutton IRQ working */
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static int __init hp6xx_devices_setup(void)
-{
-       return platform_add_devices(hp6xx_devices, ARRAY_SIZE(hp6xx_devices));
-}
-
-static void __init hp6xx_setup(char **cmdline_p)
-{
-       u8 v8;
-       u16 v;
-
-       v = inw(HD64461_STBCR);
-       v |=    HD64461_STBCR_SURTST | HD64461_STBCR_SIRST      |
-               HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST     |
-               HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST     |
-               HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST|
-               HD64461_STBCR_SAFECKE_IST;
-#ifndef CONFIG_HD64461_ENABLER
-       v |= HD64461_STBCR_SPC1ST;
-#endif
-       outw(v, HD64461_STBCR);
-       v = inw(HD64461_GPADR);
-       v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
-       outw(v, HD64461_GPADR);
-
-       outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR);
-
-#ifndef CONFIG_HD64461_ENABLER
-       outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR);
-#endif
-
-       sh_dac_output(0, DAC_SPEAKER_VOLUME);
-       sh_dac_disable(DAC_SPEAKER_VOLUME);
-       v8 = ctrl_inb(DACR);
-       v8 &= ~DACR_DAE;
-       ctrl_outb(v8,DACR);
-
-       v8 = ctrl_inb(SCPDR);
-       v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y;
-       v8 &= ~SCPDR_TS_SCAN_ENABLE;
-       ctrl_outb(v8, SCPDR);
-
-       v = ctrl_inw(SCPCR);
-       v &= ~SCPCR_TS_MASK;
-       v |= SCPCR_TS_ENABLE;
-       ctrl_outw(v, SCPCR);
-}
-device_initcall(hp6xx_devices_setup);
-
-static struct sh_machine_vector mv_hp6xx __initmv = {
-       .mv_name = "hp6xx",
-       .mv_setup = hp6xx_setup,
-       /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */
-       .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6,
-       .mv_irq_demux = hd64461_irq_demux,
-       /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
-       .mv_init_irq = hp6xx_init_irq,
-};
diff --git a/arch/sh/boards/landisk/Makefile b/arch/sh/boards/landisk/Makefile
deleted file mode 100644 (file)
index a696b42..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for I-O DATA DEVICE, INC. "LANDISK Series"
-#
-
-obj-y   := setup.o irq.o psw.o gio.o
diff --git a/arch/sh/boards/landisk/gio.c b/arch/sh/boards/landisk/gio.c
deleted file mode 100644 (file)
index edcde08..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * arch/sh/boards/landisk/gio.c - driver for landisk
- *
- * This driver will also support the I-O DATA Device, Inc. LANDISK Board.
- * LANDISK and USL-5P Button, LED and GIO driver drive function.
- *
- *   Copylight (C) 2006 kogiidena
- *   Copylight (C) 2002 Atom Create Engineering Co., Ltd. *
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/smp_lock.h>
-#include <linux/kdev_t.h>
-#include <linux/cdev.h>
-#include <linux/fs.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <mach/gio.h>
-#include <mach/iodata_landisk.h>
-
-#define DEVCOUNT                4
-#define GIO_MINOR              2       /* GIO minor no. */
-
-static dev_t dev;
-static struct cdev *cdev_p;
-static int openCnt;
-
-static int gio_open(struct inode *inode, struct file *filp)
-{
-       int minor;
-       int ret = -ENOENT;
-
-       lock_kernel();
-       minor = MINOR(inode->i_rdev);
-       if (minor < DEVCOUNT) {
-               if (openCnt > 0) {
-                       ret = -EALREADY;
-               } else {
-                       openCnt++;
-                       ret = 0;
-               }
-       }
-       unlock_kernel();
-       return ret;
-}
-
-static int gio_close(struct inode *inode, struct file *filp)
-{
-       int minor;
-
-       minor = MINOR(inode->i_rdev);
-       if (minor < DEVCOUNT) {
-               openCnt--;
-       }
-       return 0;
-}
-
-static int gio_ioctl(struct inode *inode, struct file *filp,
-                            unsigned int cmd, unsigned long arg)
-{
-       unsigned int data;
-       static unsigned int addr = 0;
-
-       if (cmd & 0x01) {       /* write */
-               if (copy_from_user(&data, (int *)arg, sizeof(int))) {
-                       return -EFAULT;
-               }
-       }
-
-       switch (cmd) {
-       case GIODRV_IOCSGIOSETADDR:     /* address set */
-               addr = data;
-               break;
-
-       case GIODRV_IOCSGIODATA1:       /* write byte */
-               ctrl_outb((unsigned char)(0x0ff & data), addr);
-               break;
-
-       case GIODRV_IOCSGIODATA2:       /* write word */
-               if (addr & 0x01) {
-                       return -EFAULT;
-               }
-               ctrl_outw((unsigned short int)(0x0ffff & data), addr);
-               break;
-
-       case GIODRV_IOCSGIODATA4:       /* write long */
-               if (addr & 0x03) {
-                       return -EFAULT;
-               }
-               ctrl_outl(data, addr);
-               break;
-
-       case GIODRV_IOCGGIODATA1:       /* read byte */
-               data = ctrl_inb(addr);
-               break;
-
-       case GIODRV_IOCGGIODATA2:       /* read word */
-               if (addr & 0x01) {
-                       return -EFAULT;
-               }
-               data = ctrl_inw(addr);
-               break;
-
-       case GIODRV_IOCGGIODATA4:       /* read long */
-               if (addr & 0x03) {
-                       return -EFAULT;
-               }
-               data = ctrl_inl(addr);
-               break;
-       default:
-               return -EFAULT;
-               break;
-       }
-
-       if ((cmd & 0x01) == 0) {        /* read */
-               if (copy_to_user((int *)arg, &data, sizeof(int))) {
-                       return -EFAULT;
-               }
-       }
-       return 0;
-}
-
-static const struct file_operations gio_fops = {
-       .owner = THIS_MODULE,
-       .open = gio_open,       /* open */
-       .release = gio_close,   /* release */
-       .ioctl = gio_ioctl,     /* ioctl */
-};
-
-static int __init gio_init(void)
-{
-       int error;
-
-       printk(KERN_INFO "gio: driver initialized\n");
-
-       openCnt = 0;
-
-       if ((error = alloc_chrdev_region(&dev, 0, DEVCOUNT, "gio")) < 0) {
-               printk(KERN_ERR
-                      "gio: Couldn't alloc_chrdev_region, error=%d\n",
-                      error);
-               return 1;
-       }
-
-       cdev_p = cdev_alloc();
-       cdev_p->ops = &gio_fops;
-       error = cdev_add(cdev_p, dev, DEVCOUNT);
-       if (error) {
-               printk(KERN_ERR
-                      "gio: Couldn't cdev_add, error=%d\n", error);
-               return 1;
-       }
-
-       return 0;
-}
-
-static void __exit gio_exit(void)
-{
-       cdev_del(cdev_p);
-       unregister_chrdev_region(dev, DEVCOUNT);
-}
-
-module_init(gio_init);
-module_exit(gio_exit);
-
-MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/landisk/irq.c b/arch/sh/boards/landisk/irq.c
deleted file mode 100644 (file)
index d0f9378..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * arch/sh/boards/landisk/irq.c
- *
- * I-O DATA Device, Inc. LANDISK Support
- *
- * Copyright (C) 2005-2007 kogiidena
- *
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <mach/iodata_landisk.h>
-
-static void disable_landisk_irq(unsigned int irq)
-{
-       unsigned char mask = 0xff ^ (0x01 << (irq - 5));
-
-       ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK);
-}
-
-static void enable_landisk_irq(unsigned int irq)
-{
-       unsigned char value = (0x01 << (irq - 5));
-
-       ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK);
-}
-
-static struct irq_chip landisk_irq_chip __read_mostly = {
-       .name           = "LANDISK",
-       .mask           = disable_landisk_irq,
-       .unmask         = enable_landisk_irq,
-       .mask_ack       = disable_landisk_irq,
-};
-
-/*
- * Initialize IRQ setting
- */
-void __init init_landisk_IRQ(void)
-{
-       int i;
-
-       for (i = 5; i < 14; i++) {
-               disable_irq_nosync(i);
-               set_irq_chip_and_handler_name(i, &landisk_irq_chip,
-                                             handle_level_irq, "level");
-               enable_landisk_irq(i);
-       }
-       ctrl_outb(0x00, PA_PWRINT_CLR);
-}
diff --git a/arch/sh/boards/landisk/psw.c b/arch/sh/boards/landisk/psw.c
deleted file mode 100644 (file)
index 4bd502c..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * arch/sh/boards/landisk/psw.c
- *
- * push switch support for LANDISK and USL-5P
- *
- * Copyright (C) 2006-2007  Paul Mundt
- * Copyright (C) 2007  kogiidena
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/io.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <mach/iodata_landisk.h>
-#include <asm/push-switch.h>
-
-static irqreturn_t psw_irq_handler(int irq, void *arg)
-{
-       struct platform_device *pdev = arg;
-       struct push_switch *psw = platform_get_drvdata(pdev);
-       struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
-       unsigned int sw_value;
-       int ret = 0;
-
-       sw_value = (0x0ff & (~ctrl_inb(PA_STATUS)));
-
-       /* Nothing to do if there's no state change */
-       if (psw->state) {
-               ret = 1;
-               goto out;
-       }
-
-       /* Figure out who raised it */
-       if (sw_value & (1 << psw_info->bit)) {
-               psw->state = 1;
-               mod_timer(&psw->debounce, jiffies + 50);
-               ret = 1;
-       }
-
-out:
-       /* Clear the switch IRQs */
-       ctrl_outb(0x00, PA_PWRINT_CLR);
-
-       return IRQ_RETVAL(ret);
-}
-
-static struct resource psw_power_resources[] = {
-       [0] = {
-               .start = IRQ_POWER,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource psw_usl5p_resources[] = {
-       [0] = {
-               .start = IRQ_BUTTON,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct push_switch_platform_info psw_power_platform_data = {
-       .name           = "psw_power",
-       .bit            = 4,
-       .irq_flags      = IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw1_platform_data = {
-       .name           = "psw1",
-       .bit            = 0,
-       .irq_flags      = IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw2_platform_data = {
-       .name           = "psw2",
-       .bit            = 2,
-       .irq_flags      = IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw3_platform_data = {
-       .name           = "psw3",
-       .bit            = 1,
-       .irq_flags      = IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct platform_device psw_power_switch_device = {
-       .name           = "push-switch",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(psw_power_resources),
-       .resource       = psw_power_resources,
-       .dev            = {
-               .platform_data = &psw_power_platform_data,
-       },
-};
-
-static struct platform_device psw1_switch_device = {
-       .name           = "push-switch",
-       .id             = 1,
-       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
-       .resource       = psw_usl5p_resources,
-       .dev            = {
-               .platform_data = &psw1_platform_data,
-       },
-};
-
-static struct platform_device psw2_switch_device = {
-       .name           = "push-switch",
-       .id             = 2,
-       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
-       .resource       = psw_usl5p_resources,
-       .dev            = {
-               .platform_data = &psw2_platform_data,
-       },
-};
-
-static struct platform_device psw3_switch_device = {
-       .name           = "push-switch",
-       .id             = 3,
-       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
-       .resource       = psw_usl5p_resources,
-       .dev = {
-               .platform_data = &psw3_platform_data,
-       },
-};
-
-static struct platform_device *psw_devices[] = {
-       &psw_power_switch_device,
-       &psw1_switch_device,
-       &psw2_switch_device,
-       &psw3_switch_device,
-};
-
-static int __init psw_init(void)
-{
-       return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
-}
-module_init(psw_init);
diff --git a/arch/sh/boards/landisk/setup.c b/arch/sh/boards/landisk/setup.c
deleted file mode 100644 (file)
index 470c781..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * arch/sh/boards/landisk/setup.c
- *
- * I-O DATA Device, Inc. LANDISK Support.
- *
- * Copyright (C) 2000 Kazumoto Kojima
- * Copyright (C) 2002 Paul Mundt
- * Copylight (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2005-2007 kogiidena
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/pm.h>
-#include <linux/mm.h>
-#include <asm/machvec.h>
-#include <mach/iodata_landisk.h>
-#include <asm/io.h>
-
-void init_landisk_IRQ(void);
-
-static void landisk_power_off(void)
-{
-        ctrl_outb(0x01, PA_SHUTDOWN);
-}
-
-static struct resource cf_ide_resources[3];
-
-static struct pata_platform_info pata_info = {
-       .ioport_shift   = 1,
-};
-
-static struct platform_device cf_ide_device = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-       .dev            = {
-               .platform_data = &pata_info,
-       },
-};
-
-static struct platform_device rtc_device = {
-       .name           = "rs5c313",
-       .id             = -1,
-};
-
-static struct platform_device *landisk_devices[] __initdata = {
-       &cf_ide_device,
-       &rtc_device,
-};
-
-static int __init landisk_devices_setup(void)
-{
-       pgprot_t prot;
-       unsigned long paddrbase;
-       void *cf_ide_base;
-
-       /* open I/O area window */
-       paddrbase = virt_to_phys((void *)PA_AREA5_IO);
-       prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
-       cf_ide_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
-       if (!cf_ide_base) {
-               printk("allocate_cf_area : can't open CF I/O window!\n");
-               return -ENOMEM;
-       }
-
-       /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
-       cf_ide_resources[0].start = (unsigned long)cf_ide_base + 0x40;
-       cf_ide_resources[0].end   = (unsigned long)cf_ide_base + 0x40 + 0x0f;
-       cf_ide_resources[0].flags = IORESOURCE_IO;
-       cf_ide_resources[1].start = (unsigned long)cf_ide_base + 0x2c;
-       cf_ide_resources[1].end   = (unsigned long)cf_ide_base + 0x2c + 0x03;
-       cf_ide_resources[1].flags = IORESOURCE_IO;
-       cf_ide_resources[2].start = IRQ_FATA;
-       cf_ide_resources[2].flags = IORESOURCE_IRQ;
-
-       return platform_add_devices(landisk_devices,
-                                   ARRAY_SIZE(landisk_devices));
-}
-
-__initcall(landisk_devices_setup);
-
-static void __init landisk_setup(char **cmdline_p)
-{
-        /* LED ON */
-       ctrl_outb(ctrl_inb(PA_LED) | 0x03, PA_LED);
-
-       printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
-       pm_power_off = landisk_power_off;
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_landisk __initmv = {
-       .mv_name = "LANDISK",
-       .mv_nr_irqs = 72,
-       .mv_setup = landisk_setup,
-       .mv_init_irq = init_landisk_IRQ,
-};
diff --git a/arch/sh/boards/lboxre2/Makefile b/arch/sh/boards/lboxre2/Makefile
deleted file mode 100644 (file)
index e9ed140..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the L-BOX RE2 specific parts of the kernel
-# Copyright (c) 2007 Nobuhiro Iwamatsu
-
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/lboxre2/irq.c b/arch/sh/boards/lboxre2/irq.c
deleted file mode 100644 (file)
index 5a1c3bb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * linux/arch/sh/boards/lboxre2/irq.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * NTT COMWARE L-BOX RE2 Support.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/lboxre2.h>
-
-/*
- * Initialize IRQ setting
- */
-void __init init_lboxre2_IRQ(void)
-{
-       make_imask_irq(IRQ_CF1);
-       make_imask_irq(IRQ_CF0);
-       make_imask_irq(IRQ_INTD);
-       make_imask_irq(IRQ_ETH1);
-       make_imask_irq(IRQ_ETH0);
-       make_imask_irq(IRQ_INTA);
-}
diff --git a/arch/sh/boards/lboxre2/setup.c b/arch/sh/boards/lboxre2/setup.c
deleted file mode 100644 (file)
index c74440d..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * linux/arch/sh/boards/lbox/setup.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * NTT COMWARE L-BOX RE2 Support
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <asm/machvec.h>
-#include <asm/addrspace.h>
-#include <asm/lboxre2.h>
-#include <asm/io.h>
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = 0x1f0,
-               .end    = 0x1f0 + 8 ,
-               .flags  = IORESOURCE_IO,
-       },
-       [1] = {
-               .start  = 0x1f0 + 0x206,
-               .end    = 0x1f0 +8 + 0x206 + 8,
-               .flags  = IORESOURCE_IO,
-       },
-       [2] = {
-               .start  = IRQ_CF0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static struct platform_device *lboxre2_devices[] __initdata = {
-       &cf_ide_device,
-};
-
-static int __init lboxre2_devices_setup(void)
-{
-       u32 cf0_io_base;        /* Boot CF base address */
-       pgprot_t prot;
-       unsigned long paddrbase, psize;
-
-       /* open I/O area window */
-       paddrbase = virt_to_phys((void*)PA_AREA5_IO);
-       psize = PAGE_SIZE;
-       prot = PAGE_KERNEL_PCC( 1 , _PAGE_PCC_IO16);
-       cf0_io_base = (u32)p3_ioremap(paddrbase, psize, prot.pgprot);
-       if (!cf0_io_base) {
-               printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );
-               return -ENOMEM;
-       }
-
-       cf_ide_resources[0].start += cf0_io_base ;
-       cf_ide_resources[0].end   += cf0_io_base ;
-       cf_ide_resources[1].start += cf0_io_base ;
-       cf_ide_resources[1].end   += cf0_io_base ;
-
-       return platform_add_devices(lboxre2_devices,
-                       ARRAY_SIZE(lboxre2_devices));
-
-}
-device_initcall(lboxre2_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_lboxre2 __initmv = {
-       .mv_name                = "L-BOX RE2",
-       .mv_nr_irqs             = 72,
-       .mv_init_irq            = init_lboxre2_IRQ,
-};
diff --git a/arch/sh/boards/mach-ap325rxa/Makefile b/arch/sh/boards/mach-ap325rxa/Makefile
new file mode 100644 (file)
index 0000000..f663768
--- /dev/null
@@ -0,0 +1 @@
+obj-y  := setup.o
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
new file mode 100644 (file)
index 0000000..7fa7446
--- /dev/null
@@ -0,0 +1,313 @@
+/*
+ * Renesas - AP-325RXA
+ * (Compatible with Algo System ., LTD. - AP-320A)
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ * Author : Yusuke Goda <goda.yuske@renesas.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
+#include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/delay.h>
+#include <linux/smc911x.h>
+#include <media/soc_camera_platform.h>
+#include <media/sh_mobile_ceu.h>
+#include <asm/sh_mobile_lcdc.h>
+#include <asm/io.h>
+#include <asm/clock.h>
+
+static struct smc911x_platdata smc911x_info = {
+       .flags = SMC911X_USE_32BIT,
+       .irq_flags = IRQF_TRIGGER_LOW,
+};
+
+static struct resource smc9118_resources[] = {
+       [0] = {
+               .start  = 0xb6080000,
+               .end    = 0xb60fffff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 35,
+               .end    = 35,
+               .flags  = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device smc9118_device = {
+       .name           = "smc911x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(smc9118_resources),
+       .resource       = smc9118_resources,
+       .dev            = {
+               .platform_data = &smc911x_info,
+       },
+};
+
+static struct mtd_partition ap325rxa_nor_flash_partitions[] = {
+       {
+                .name = "uboot",
+                .offset = 0,
+                .size = (1 * 1024 * 1024),
+                .mask_flags = MTD_WRITEABLE,   /* Read-only */
+       }, {
+                .name = "kernel",
+                .offset = MTDPART_OFS_APPEND,
+                .size = (2 * 1024 * 1024),
+       }, {
+                .name = "other",
+                .offset = MTDPART_OFS_APPEND,
+                .size = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data ap325rxa_nor_flash_data = {
+       .width          = 2,
+       .parts          = ap325rxa_nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(ap325rxa_nor_flash_partitions),
+};
+
+static struct resource ap325rxa_nor_flash_resources[] = {
+       [0] = {
+               .name   = "NOR Flash",
+               .start  = 0x00000000,
+               .end    = 0x00ffffff,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device ap325rxa_nor_flash_device = {
+       .name           = "physmap-flash",
+       .resource       = ap325rxa_nor_flash_resources,
+       .num_resources  = ARRAY_SIZE(ap325rxa_nor_flash_resources),
+       .dev            = {
+               .platform_data = &ap325rxa_nor_flash_data,
+       },
+};
+
+#define FPGA_LCDREG    0xB4100180
+#define FPGA_BKLREG    0xB4100212
+#define FPGA_LCDREG_VAL        0x0018
+#define PORT_PHCR      0xA405010E
+#define PORT_PLCR      0xA4050114
+#define PORT_PMCR      0xA4050116
+#define PORT_PRCR      0xA405011C
+#define PORT_PSCR      0xA405011E
+#define PORT_PZCR      0xA405014C
+#define PORT_HIZCRA    0xA4050158
+#define PORT_MSELCRB   0xA4050182
+#define PORT_PSDR      0xA405013E
+#define PORT_PZDR      0xA405016C
+#define PORT_PSELD     0xA4050154
+
+static void ap320_wvga_power_on(void *board_data)
+{
+       msleep(100);
+
+       /* ASD AP-320/325 LCD ON */
+       ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG);
+
+       /* backlight */
+       ctrl_outw((ctrl_inw(PORT_PSCR) & ~0x00C0) | 0x40, PORT_PSCR);
+       ctrl_outb(ctrl_inb(PORT_PSDR) & ~0x08, PORT_PSDR);
+       ctrl_outw(0x100, FPGA_BKLREG);
+}
+
+static struct sh_mobile_lcdc_info lcdc_info = {
+       .clock_source = LCDC_CLK_EXTERNAL,
+       .ch[0] = {
+               .chan = LCDC_CHAN_MAINLCD,
+               .bpp = 16,
+               .interface_type = RGB18,
+               .clock_divider = 1,
+               .lcd_cfg = {
+                       .name = "LB070WV1",
+                       .xres = 800,
+                       .yres = 480,
+                       .left_margin = 40,
+                       .right_margin = 160,
+                       .hsync_len = 8,
+                       .upper_margin = 63,
+                       .lower_margin = 80,
+                       .vsync_len = 1,
+                       .sync = 0, /* hsync and vsync are active low */
+               },
+               .board_cfg = {
+                       .display_on = ap320_wvga_power_on,
+               },
+       }
+};
+
+static struct resource lcdc_resources[] = {
+       [0] = {
+               .name   = "LCDC",
+               .start  = 0xfe940000, /* P4-only space */
+               .end    = 0xfe941fff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device lcdc_device = {
+       .name           = "sh_mobile_lcdc_fb",
+       .num_resources  = ARRAY_SIZE(lcdc_resources),
+       .resource       = lcdc_resources,
+       .dev            = {
+               .platform_data  = &lcdc_info,
+       },
+};
+
+static unsigned char camera_ncm03j_magic[] =
+{
+       0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8,
+       0x1D, 0x00, 0x1E, 0x8A, 0x21, 0x00, 0x33, 0x36,
+       0x36, 0x60, 0x37, 0x08, 0x3B, 0x31, 0x44, 0x0F,
+       0x46, 0xF0, 0x4B, 0x28, 0x4C, 0x21, 0x4D, 0x55,
+       0x4E, 0x1B, 0x4F, 0xC7, 0x50, 0xFC, 0x51, 0x12,
+       0x58, 0x02, 0x66, 0xC0, 0x67, 0x46, 0x6B, 0xA0,
+       0x6C, 0x34, 0x7E, 0x25, 0x7F, 0x25, 0x8D, 0x0F,
+       0x92, 0x40, 0x93, 0x04, 0x94, 0x26, 0x95, 0x0A,
+       0x99, 0x03, 0x9A, 0xF0, 0x9B, 0x14, 0x9D, 0x7A,
+       0xC5, 0x02, 0xD6, 0x07, 0x59, 0x00, 0x5A, 0x1A,
+       0x5B, 0x2A, 0x5C, 0x37, 0x5D, 0x42, 0x5E, 0x56,
+       0xC8, 0x00, 0xC9, 0x1A, 0xCA, 0x2A, 0xCB, 0x37,
+       0xCC, 0x42, 0xCD, 0x56, 0xCE, 0x00, 0xCF, 0x1A,
+       0xD0, 0x2A, 0xD1, 0x37, 0xD2, 0x42, 0xD3, 0x56,
+       0x5F, 0x68, 0x60, 0x87, 0x61, 0xA3, 0x62, 0xBC,
+       0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F,
+};
+
+static int camera_set_capture(struct soc_camera_platform_info *info,
+                             int enable)
+{
+       struct i2c_adapter *a = i2c_get_adapter(0);
+       struct i2c_msg msg;
+       int ret = 0;
+       int i;
+
+       if (!enable)
+               return 0; /* no disable for now */
+
+       for (i = 0; i < ARRAY_SIZE(camera_ncm03j_magic); i += 2) {
+               u_int8_t buf[8];
+
+               msg.addr = 0x6e;
+               msg.buf = buf;
+               msg.len = 2;
+               msg.flags = 0;
+
+               buf[0] = camera_ncm03j_magic[i];
+               buf[1] = camera_ncm03j_magic[i + 1];
+
+               ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
+       }
+
+       return ret;
+}
+
+static struct soc_camera_platform_info camera_info = {
+       .iface = 0,
+       .format_name = "UYVY",
+       .format_depth = 16,
+       .format = {
+               .pixelformat = V4L2_PIX_FMT_UYVY,
+               .colorspace = V4L2_COLORSPACE_SMPTE170M,
+               .width = 640,
+               .height = 480,
+       },
+       .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
+       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
+       .set_capture = camera_set_capture,
+};
+
+static struct platform_device camera_device = {
+       .name           = "soc_camera_platform",
+       .dev            = {
+               .platform_data  = &camera_info,
+       },
+};
+
+static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
+       .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
+       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
+};
+
+static struct resource ceu_resources[] = {
+       [0] = {
+               .name   = "CEU",
+               .start  = 0xfe910000,
+               .end    = 0xfe91009f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 52,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               /* place holder for contiguous memory */
+       },
+};
+
+static struct platform_device ceu_device = {
+       .name           = "sh_mobile_ceu",
+       .num_resources  = ARRAY_SIZE(ceu_resources),
+       .resource       = ceu_resources,
+       .dev            = {
+               .platform_data  = &sh_mobile_ceu_info,
+       },
+};
+
+static struct platform_device *ap325rxa_devices[] __initdata = {
+       &smc9118_device,
+       &ap325rxa_nor_flash_device,
+       &lcdc_device,
+       &ceu_device,
+       &camera_device,
+};
+
+static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
+};
+
+static int __init ap325rxa_devices_setup(void)
+{
+       clk_always_enable("mstp200"); /* LCDC */
+       clk_always_enable("mstp203"); /* CEU */
+
+       platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
+
+       i2c_register_board_info(0, ap325rxa_i2c_devices,
+                               ARRAY_SIZE(ap325rxa_i2c_devices));
+       return platform_add_devices(ap325rxa_devices,
+                               ARRAY_SIZE(ap325rxa_devices));
+}
+device_initcall(ap325rxa_devices_setup);
+
+static void __init ap325rxa_setup(char **cmdline_p)
+{
+       /* LCDC configuration */
+       ctrl_outw(ctrl_inw(PORT_PHCR) & ~0xffff, PORT_PHCR);
+       ctrl_outw(ctrl_inw(PORT_PLCR) & ~0xffff, PORT_PLCR);
+       ctrl_outw(ctrl_inw(PORT_PMCR) & ~0xffff, PORT_PMCR);
+       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x03ff, PORT_PRCR);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01C0, PORT_HIZCRA);
+
+       /* CEU */
+       ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
+       ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD);
+       ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR);
+       ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR);
+}
+
+static struct sh_machine_vector mv_ap325rxa __initmv = {
+       .mv_name = "AP-325RXA",
+       .mv_setup = ap325rxa_setup,
+};
diff --git a/arch/sh/boards/mach-cayman/Makefile b/arch/sh/boards/mach-cayman/Makefile
new file mode 100644 (file)
index 0000000..489a8f8
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the Hitachi Cayman specific parts of the kernel
+#
+obj-y := setup.o irq.o
+obj-$(CONFIG_HEARTBEAT)        += led.o
diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c
new file mode 100644 (file)
index 0000000..ceb37ae
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * arch/sh/mach-cayman/irq.c - SH-5 Cayman Interrupt Support
+ *
+ * This file handles the board specific parts of the Cayman interrupt system
+ *
+ * Copyright (C) 2002 Stuart Menefy
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/signal.h>
+#include <cpu/irq.h>
+#include <asm/page.h>
+
+/* Setup for the SMSC FDC37C935 / LAN91C100FD */
+#define SMSC_IRQ         IRQ_IRL1
+
+/* Setup for PCI Bus 2, which transmits interrupts via the EPLD */
+#define PCI2_IRQ         IRQ_IRL3
+
+unsigned long epld_virt;
+
+#define EPLD_BASE        0x04002000
+#define EPLD_STATUS_BASE (epld_virt + 0x10)
+#define EPLD_MASK_BASE   (epld_virt + 0x20)
+
+/* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto
+   the same SH-5 interrupt */
+
+static irqreturn_t cayman_interrupt_smsc(int irq, void *dev_id)
+{
+        printk(KERN_INFO "CAYMAN: spurious SMSC interrupt\n");
+       return IRQ_NONE;
+}
+
+static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)
+{
+        printk(KERN_INFO "CAYMAN: spurious PCI interrupt, IRQ %d\n", irq);
+       return IRQ_NONE;
+}
+
+static struct irqaction cayman_action_smsc = {
+       .name           = "Cayman SMSC Mux",
+       .handler        = cayman_interrupt_smsc,
+       .flags          = IRQF_DISABLED,
+};
+
+static struct irqaction cayman_action_pci2 = {
+       .name           = "Cayman PCI2 Mux",
+       .handler        = cayman_interrupt_pci2,
+       .flags          = IRQF_DISABLED,
+};
+
+static void enable_cayman_irq(unsigned int irq)
+{
+       unsigned long flags;
+       unsigned long mask;
+       unsigned int reg;
+       unsigned char bit;
+
+       irq -= START_EXT_IRQS;
+       reg = EPLD_MASK_BASE + ((irq / 8) << 2);
+       bit = 1<<(irq % 8);
+       local_irq_save(flags);
+       mask = ctrl_inl(reg);
+       mask |= bit;
+       ctrl_outl(mask, reg);
+       local_irq_restore(flags);
+}
+
+void disable_cayman_irq(unsigned int irq)
+{
+       unsigned long flags;
+       unsigned long mask;
+       unsigned int reg;
+       unsigned char bit;
+
+       irq -= START_EXT_IRQS;
+       reg = EPLD_MASK_BASE + ((irq / 8) << 2);
+       bit = 1<<(irq % 8);
+       local_irq_save(flags);
+       mask = ctrl_inl(reg);
+       mask &= ~bit;
+       ctrl_outl(mask, reg);
+       local_irq_restore(flags);
+}
+
+static void ack_cayman_irq(unsigned int irq)
+{
+       disable_cayman_irq(irq);
+}
+
+static void end_cayman_irq(unsigned int irq)
+{
+       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+               enable_cayman_irq(irq);
+}
+
+static unsigned int startup_cayman_irq(unsigned int irq)
+{
+       enable_cayman_irq(irq);
+       return 0; /* never anything pending */
+}
+
+static void shutdown_cayman_irq(unsigned int irq)
+{
+       disable_cayman_irq(irq);
+}
+
+struct hw_interrupt_type cayman_irq_type = {
+       .typename       = "Cayman-IRQ",
+       .startup        = startup_cayman_irq,
+       .shutdown       = shutdown_cayman_irq,
+       .enable         = enable_cayman_irq,
+       .disable        = disable_cayman_irq,
+       .ack            = ack_cayman_irq,
+       .end            = end_cayman_irq,
+};
+
+int cayman_irq_demux(int evt)
+{
+       int irq = intc_evt_to_irq[evt];
+
+       if (irq == SMSC_IRQ) {
+               unsigned long status;
+               int i;
+
+               status = ctrl_inl(EPLD_STATUS_BASE) &
+                        ctrl_inl(EPLD_MASK_BASE) & 0xff;
+               if (status == 0) {
+                       irq = -1;
+               } else {
+                       for (i=0; i<8; i++) {
+                               if (status & (1<<i))
+                                       break;
+                       }
+                       irq = START_EXT_IRQS + i;
+               }
+       }
+
+       if (irq == PCI2_IRQ) {
+               unsigned long status;
+               int i;
+
+               status = ctrl_inl(EPLD_STATUS_BASE + 3 * sizeof(u32)) &
+                        ctrl_inl(EPLD_MASK_BASE + 3 * sizeof(u32)) & 0xff;
+               if (status == 0) {
+                       irq = -1;
+               } else {
+                       for (i=0; i<8; i++) {
+                               if (status & (1<<i))
+                                       break;
+                       }
+                       irq = START_EXT_IRQS + (3 * 8) + i;
+               }
+       }
+
+       return irq;
+}
+
+#if defined(CONFIG_PROC_FS) && defined(CONFIG_SYSCTL)
+int cayman_irq_describe(char* p, int irq)
+{
+       if (irq < NR_INTC_IRQS) {
+               return intc_irq_describe(p, irq);
+       } else if (irq < NR_INTC_IRQS + 8) {
+               return sprintf(p, "(SMSC %d)", irq - NR_INTC_IRQS);
+       } else if ((irq >= NR_INTC_IRQS + 24) && (irq < NR_INTC_IRQS + 32)) {
+               return sprintf(p, "(PCI2 %d)", irq - (NR_INTC_IRQS + 24));
+       }
+
+       return 0;
+}
+#endif
+
+void init_cayman_irq(void)
+{
+       int i;
+
+       epld_virt = onchip_remap(EPLD_BASE, 1024, "EPLD");
+       if (!epld_virt) {
+               printk(KERN_ERR "Cayman IRQ: Unable to remap EPLD\n");
+               return;
+       }
+
+       for (i=0; i<NR_EXT_IRQS; i++) {
+               irq_desc[START_EXT_IRQS + i].chip = &cayman_irq_type;
+       }
+
+       /* Setup the SMSC interrupt */
+       setup_irq(SMSC_IRQ, &cayman_action_smsc);
+       setup_irq(PCI2_IRQ, &cayman_action_pci2);
+}
diff --git a/arch/sh/boards/mach-cayman/led.c b/arch/sh/boards/mach-cayman/led.c
new file mode 100644 (file)
index 0000000..a808eac
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * arch/sh/boards/cayman/led.c
+ *
+ * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * Flash the LEDs
+ */
+#include <asm/io.h>
+
+/*
+** It is supposed these functions to be used for a low level
+** debugging (via Cayman LEDs), hence to be available as soon
+** as possible.
+** Unfortunately Cayman LEDs relies on Cayman EPLD to be mapped
+** (this happen when IRQ are initialized... quite late).
+** These triky dependencies should be removed. Temporary, it
+** may be enough to NOP until EPLD is mapped.
+*/
+
+extern unsigned long epld_virt;
+
+#define LED_ADDR      (epld_virt + 0x008)
+#define HDSP2534_ADDR (epld_virt + 0x100)
+
+void mach_led(int position, int value)
+{
+       if (!epld_virt)
+               return;
+
+       if (value)
+               ctrl_outl(0, LED_ADDR);
+       else
+               ctrl_outl(1, LED_ADDR);
+
+}
+
+void mach_alphanum(int position, unsigned char value)
+{
+       if (!epld_virt)
+               return;
+
+       ctrl_outb(value, HDSP2534_ADDR + 0xe0 + (position << 2));
+}
+
+void mach_alphanum_brightness(int setting)
+{
+       ctrl_outb(setting & 7, HDSP2534_ADDR + 0xc0);
+}
diff --git a/arch/sh/boards/mach-cayman/setup.c b/arch/sh/boards/mach-cayman/setup.c
new file mode 100644 (file)
index 0000000..e7f9cc5
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * arch/sh/mach-cayman/setup.c
+ *
+ * SH5 Cayman support
+ *
+ * Copyright (C) 2002  David J. Mckay & Benedict Gaster
+ * Copyright (C) 2003 - 2007  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <cpu/irq.h>
+
+/*
+ * Platform Dependent Interrupt Priorities.
+ */
+
+/* Using defaults defined in irq.h */
+#define        RES NO_PRIORITY         /* Disabled */
+#define IR0 IRL0_PRIORITY      /* IRLs */
+#define IR1 IRL1_PRIORITY
+#define IR2 IRL2_PRIORITY
+#define IR3 IRL3_PRIORITY
+#define PCA INTA_PRIORITY      /* PCI Ints */
+#define PCB INTB_PRIORITY
+#define PCC INTC_PRIORITY
+#define PCD INTD_PRIORITY
+#define SER TOP_PRIORITY
+#define ERR TOP_PRIORITY
+#define PW0 TOP_PRIORITY
+#define PW1 TOP_PRIORITY
+#define PW2 TOP_PRIORITY
+#define PW3 TOP_PRIORITY
+#define DM0 NO_PRIORITY                /* DMA Ints */
+#define DM1 NO_PRIORITY
+#define DM2 NO_PRIORITY
+#define DM3 NO_PRIORITY
+#define DAE NO_PRIORITY
+#define TU0 TIMER_PRIORITY     /* TMU Ints */
+#define TU1 NO_PRIORITY
+#define TU2 NO_PRIORITY
+#define TI2 NO_PRIORITY
+#define ATI NO_PRIORITY                /* RTC Ints */
+#define PRI NO_PRIORITY
+#define CUI RTC_PRIORITY
+#define ERI SCIF_PRIORITY      /* SCIF Ints */
+#define RXI SCIF_PRIORITY
+#define BRI SCIF_PRIORITY
+#define TXI SCIF_PRIORITY
+#define ITI TOP_PRIORITY       /* WDT Ints */
+
+/* Setup for the SMSC FDC37C935 */
+#define SMSC_SUPERIO_BASE      0x04000000
+#define SMSC_CONFIG_PORT_ADDR  0x3f0
+#define SMSC_INDEX_PORT_ADDR   SMSC_CONFIG_PORT_ADDR
+#define SMSC_DATA_PORT_ADDR    0x3f1
+
+#define SMSC_ENTER_CONFIG_KEY  0x55
+#define SMSC_EXIT_CONFIG_KEY   0xaa
+
+#define SMCS_LOGICAL_DEV_INDEX 0x07
+#define SMSC_DEVICE_ID_INDEX   0x20
+#define SMSC_DEVICE_REV_INDEX  0x21
+#define SMSC_ACTIVATE_INDEX    0x30
+#define SMSC_PRIMARY_BASE_INDEX  0x60
+#define SMSC_SECONDARY_BASE_INDEX 0x62
+#define SMSC_PRIMARY_INT_INDEX 0x70
+#define SMSC_SECONDARY_INT_INDEX 0x72
+
+#define SMSC_IDE1_DEVICE       1
+#define SMSC_KEYBOARD_DEVICE   7
+#define SMSC_CONFIG_REGISTERS  8
+
+#define SMSC_SUPERIO_READ_INDEXED(index) ({ \
+       outb((index), SMSC_INDEX_PORT_ADDR); \
+       inb(SMSC_DATA_PORT_ADDR); })
+#define SMSC_SUPERIO_WRITE_INDEXED(val, index) ({ \
+       outb((index), SMSC_INDEX_PORT_ADDR); \
+       outb((val),   SMSC_DATA_PORT_ADDR); })
+
+#define IDE1_PRIMARY_BASE      0x01f0
+#define IDE1_SECONDARY_BASE    0x03f6
+
+unsigned long smsc_superio_virt;
+
+int platform_int_priority[NR_INTC_IRQS] = {
+       IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ  0- 7 */
+       RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ  8-15 */
+       PW1, PW0, DM0, DM1, DM2, DM3, DAE, RES, /* IRQ 16-23 */
+       RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 24-31 */
+       TU0, TU1, TU2, TI2, ATI, PRI, CUI, ERI, /* IRQ 32-39 */
+       RXI, BRI, TXI, RES, RES, RES, RES, RES, /* IRQ 40-47 */
+       RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 48-55 */
+       RES, RES, RES, RES, RES, RES, RES, ITI, /* IRQ 56-63 */
+};
+
+static int __init smsc_superio_setup(void)
+{
+       unsigned char devid, devrev;
+
+       smsc_superio_virt = onchip_remap(SMSC_SUPERIO_BASE, 1024, "SMSC SuperIO");
+       if (!smsc_superio_virt) {
+               panic("Unable to remap SMSC SuperIO\n");
+       }
+
+       /* Initially the chip is in run state */
+       /* Put it into configuration state */
+       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+
+       /* Read device ID info */
+       devid = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
+       devrev = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
+       printk("SMSC SuperIO devid %02x rev %02x\n", devid, devrev);
+
+       /* Select the keyboard device */
+       SMSC_SUPERIO_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+
+       /* enable it */
+       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+
+       /* Select the interrupts */
+       /* On a PC keyboard is IRQ1, mouse is IRQ12 */
+       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_PRIMARY_INT_INDEX);
+       SMSC_SUPERIO_WRITE_INDEXED(12, SMSC_SECONDARY_INT_INDEX);
+
+#ifdef CONFIG_IDE
+       /*
+        * Only IDE1 exists on the Cayman
+        */
+
+       /* Power it on */
+       SMSC_SUPERIO_WRITE_INDEXED(1 << SMSC_IDE1_DEVICE, 0x22);
+
+       SMSC_SUPERIO_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+       SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+
+       SMSC_SUPERIO_WRITE_INDEXED(IDE1_PRIMARY_BASE >> 8,
+                                  SMSC_PRIMARY_BASE_INDEX + 0);
+       SMSC_SUPERIO_WRITE_INDEXED(IDE1_PRIMARY_BASE & 0xff,
+                                  SMSC_PRIMARY_BASE_INDEX + 1);
+
+       SMSC_SUPERIO_WRITE_INDEXED(IDE1_SECONDARY_BASE >> 8,
+                                  SMSC_SECONDARY_BASE_INDEX + 0);
+       SMSC_SUPERIO_WRITE_INDEXED(IDE1_SECONDARY_BASE & 0xff,
+                                  SMSC_SECONDARY_BASE_INDEX + 1);
+
+       SMSC_SUPERIO_WRITE_INDEXED(14, SMSC_PRIMARY_INT_INDEX);
+
+       SMSC_SUPERIO_WRITE_INDEXED(SMSC_CONFIG_REGISTERS,
+                                  SMCS_LOGICAL_DEV_INDEX);
+
+       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
+       SMSC_SUPERIO_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
+       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
+       SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
+#endif
+
+       /* Exit the configuration state */
+       outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+
+       return 0;
+}
+__initcall(smsc_superio_setup);
+
+static void __iomem *cayman_ioport_map(unsigned long port, unsigned int len)
+{
+       if (port < 0x400) {
+               extern unsigned long smsc_superio_virt;
+               return (void __iomem *)((port << 2) | smsc_superio_virt);
+       }
+
+       return (void __iomem *)port;
+}
+
+extern void init_cayman_irq(void);
+
+static struct sh_machine_vector mv_cayman __initmv = {
+       .mv_name                = "Hitachi Cayman",
+       .mv_nr_irqs             = 64,
+       .mv_ioport_map          = cayman_ioport_map,
+       .mv_init_irq            = init_cayman_irq,
+};
diff --git a/arch/sh/boards/mach-dreamcast/Makefile b/arch/sh/boards/mach-dreamcast/Makefile
new file mode 100644 (file)
index 0000000..7b97546
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# Makefile for the Sega Dreamcast specific parts of the kernel
+#
+
+obj-y   := setup.o irq.o rtc.o
+
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
new file mode 100644 (file)
index 0000000..67bdc33
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * arch/sh/boards/dreamcast/irq.c
+ *
+ * Holly IRQ support for the Sega Dreamcast.
+ *
+ * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@0xd6.org>
+ *
+ * This file is part of the LinuxDC project (www.linuxdc.org)
+ * Released under the terms of the GNU GPL v2.0
+ */
+
+#include <linux/irq.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <mach/sysasic.h>
+
+/* Dreamcast System ASIC Hardware Events -
+
+   The Dreamcast's System ASIC (a.k.a. Holly) is responsible for receiving
+   hardware events from system peripherals and triggering an SH7750 IRQ.
+   Hardware events can trigger IRQs 13, 11, or 9 depending on which bits are
+   set in the Event Mask Registers (EMRs).  When a hardware event is
+   triggered, it's corresponding bit in the Event Status Registers (ESRs)
+   is set, and that bit should be rewritten to the ESR to acknowledge that
+   event.
+
+   There are three 32-bit ESRs located at 0xa05f8900 - 0xa05f6908.  Event
+   types can be found in include/asm-sh/dreamcast/sysasic.h. There are three
+   groups of EMRs that parallel the ESRs.  Each EMR group corresponds to an
+   IRQ, so 0xa05f6910 - 0xa05f6918 triggers IRQ 13, 0xa05f6920 - 0xa05f6928
+   triggers IRQ 11, and 0xa05f6930 - 0xa05f6938 triggers IRQ 9.
+
+   In the kernel, these events are mapped to virtual IRQs so that drivers can
+   respond to them as they would a normal interrupt.  In order to keep this
+   mapping simple, the events are mapped as:
+
+   6900/6910 - Events  0-31, IRQ 13
+   6904/6924 - Events 32-63, IRQ 11
+   6908/6938 - Events 64-95, IRQ  9
+
+*/
+
+#define ESR_BASE 0x005f6900    /* Base event status register */
+#define EMR_BASE 0x005f6910    /* Base event mask register */
+
+/* Helps us determine the EMR group that this event belongs to: 0 = 0x6910,
+   1 = 0x6920, 2 = 0x6930; also determine the event offset */
+#define LEVEL(event) (((event) - HW_EVENT_IRQ_BASE) / 32)
+
+/* Return the hardware event's bit positon within the EMR/ESR */
+#define EVENT_BIT(event) (((event) - HW_EVENT_IRQ_BASE) & 31)
+
+/* For each of these *_irq routines, the IRQ passed in is the virtual IRQ
+   (logically mapped to the corresponding bit for the hardware event). */
+
+/* Disable the hardware event by masking its bit in its EMR */
+static inline void disable_systemasic_irq(unsigned int irq)
+{
+        __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
+        __u32 mask;
+
+        mask = inl(emr);
+        mask &= ~(1 << EVENT_BIT(irq));
+        outl(mask, emr);
+}
+
+/* Enable the hardware event by setting its bit in its EMR */
+static inline void enable_systemasic_irq(unsigned int irq)
+{
+        __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
+        __u32 mask;
+
+        mask = inl(emr);
+        mask |= (1 << EVENT_BIT(irq));
+        outl(mask, emr);
+}
+
+/* Acknowledge a hardware event by writing its bit back to its ESR */
+static void ack_systemasic_irq(unsigned int irq)
+{
+        __u32 esr = ESR_BASE + (LEVEL(irq) << 2);
+        disable_systemasic_irq(irq);
+        outl((1 << EVENT_BIT(irq)), esr);
+}
+
+/* After a IRQ has been ack'd and responded to, it needs to be renabled */
+static void end_systemasic_irq(unsigned int irq)
+{
+        if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+                enable_systemasic_irq(irq);
+}
+
+static unsigned int startup_systemasic_irq(unsigned int irq)
+{
+        enable_systemasic_irq(irq);
+
+        return 0;
+}
+
+static void shutdown_systemasic_irq(unsigned int irq)
+{
+        disable_systemasic_irq(irq);
+}
+
+struct hw_interrupt_type systemasic_int = {
+        .typename       = "System ASIC",
+        .startup        = startup_systemasic_irq,
+        .shutdown       = shutdown_systemasic_irq,
+        .enable         = enable_systemasic_irq,
+        .disable        = disable_systemasic_irq,
+        .ack            = ack_systemasic_irq,
+        .end            = end_systemasic_irq,
+};
+
+/*
+ * Map the hardware event indicated by the processor IRQ to a virtual IRQ.
+ */
+int systemasic_irq_demux(int irq)
+{
+        __u32 emr, esr, status, level;
+        __u32 j, bit;
+
+        switch (irq) {
+                case 13:
+                        level = 0;
+                        break;
+                case 11:
+                        level = 1;
+                        break;
+                case  9:
+                        level = 2;
+                        break;
+                default:
+                        return irq;
+        }
+        emr = EMR_BASE + (level << 4) + (level << 2);
+        esr = ESR_BASE + (level << 2);
+
+        /* Mask the ESR to filter any spurious, unwanted interrupts */
+        status = inl(esr);
+        status &= inl(emr);
+
+        /* Now scan and find the first set bit as the event to map */
+        for (bit = 1, j = 0; j < 32; bit <<= 1, j++) {
+                if (status & bit) {
+                        irq = HW_EVENT_IRQ_BASE + j + (level << 5);
+                        return irq;
+                }
+        }
+
+        /* Not reached */
+        return irq;
+}
diff --git a/arch/sh/boards/mach-dreamcast/rtc.c b/arch/sh/boards/mach-dreamcast/rtc.c
new file mode 100644 (file)
index 0000000..a743368
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * arch/sh/boards/dreamcast/rtc.c
+ *
+ * Dreamcast AICA RTC routines.
+ *
+ * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@0xd6.org>
+ * Copyright (c) 2002 Paul Mundt <lethal@chaoticdreams.org>
+ *
+ * Released under the terms of the GNU GPL v2.0.
+ *
+ */
+
+#include <linux/time.h>
+#include <asm/rtc.h>
+#include <asm/io.h>
+
+/* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in
+   seconds) to get the standard Unix Epoch when getting the time, and add
+   20 years when setting the time. */
+#define TWENTY_YEARS ((20 * 365LU + 5) * 86400)
+
+/* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit
+   registers.*/
+#define AICA_RTC_SECS_H                0xa0710000
+#define AICA_RTC_SECS_L                0xa0710004
+
+/**
+ * aica_rtc_gettimeofday - Get the time from the AICA RTC
+ * @ts: pointer to resulting timespec
+ *
+ * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.
+ */
+static void aica_rtc_gettimeofday(struct timespec *ts)
+{
+       unsigned long val1, val2;
+
+       do {
+               val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
+                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
+
+               val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
+                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
+       } while (val1 != val2);
+
+       ts->tv_sec = val1 - TWENTY_YEARS;
+
+       /* Can't get nanoseconds with just a seconds counter. */
+       ts->tv_nsec = 0;
+}
+
+/**
+ * aica_rtc_settimeofday - Set the AICA RTC to the current time
+ * @secs: contains the time_t to set
+ *
+ * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter.
+ */
+static int aica_rtc_settimeofday(const time_t secs)
+{
+       unsigned long val1, val2;
+       unsigned long adj = secs + TWENTY_YEARS;
+
+       do {
+               ctrl_outl((adj & 0xffff0000) >> 16, AICA_RTC_SECS_H);
+               ctrl_outl((adj & 0xffff), AICA_RTC_SECS_L);
+
+               val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
+                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
+
+               val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
+                       (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
+       } while (val1 != val2);
+
+       return 0;
+}
+
+void aica_time_init(void)
+{
+       rtc_sh_get_time = aica_rtc_gettimeofday;
+       rtc_sh_set_time = aica_rtc_settimeofday;
+}
+
diff --git a/arch/sh/boards/mach-dreamcast/setup.c b/arch/sh/boards/mach-dreamcast/setup.c
new file mode 100644 (file)
index 0000000..7d944fc
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * arch/sh/boards/dreamcast/setup.c
+ *
+ * Hardware support for the Sega Dreamcast.
+ *
+ * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org>
+ * Copyright (c) 2002, 2003, 2004 Paul Mundt <lethal@linux-sh.org>
+ *
+ * This file is part of the LinuxDC project (www.linuxdc.org)
+ *
+ * Released under the terms of the GNU GPL v2.0.
+ *
+ * This file originally bore the message (with enclosed-$):
+ *     Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp
+ *     SEGA Dreamcast support
+ */
+
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/device.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/rtc.h>
+#include <asm/machvec.h>
+#include <mach/sysasic.h>
+
+extern struct hw_interrupt_type systemasic_int;
+extern void aica_time_init(void);
+extern int gapspci_init(void);
+extern int systemasic_irq_demux(int);
+
+static void __init dreamcast_setup(char **cmdline_p)
+{
+       int i;
+
+       /* Mask all hardware events */
+       /* XXX */
+
+       /* Acknowledge any previous events */
+       /* XXX */
+
+       __set_io_port_base(0xa0000000);
+
+       /* Assign all virtual IRQs to the System ASIC int. handler */
+       for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
+               irq_desc[i].chip = &systemasic_int;
+
+       board_time_init = aica_time_init;
+
+#ifdef CONFIG_PCI
+       if (gapspci_init() < 0)
+               printk(KERN_WARNING "GAPSPCI was not detected.\n");
+#endif
+}
+
+static struct sh_machine_vector mv_dreamcast __initmv = {
+       .mv_name                = "Sega Dreamcast",
+       .mv_setup               = dreamcast_setup,
+       .mv_irq_demux           = systemasic_irq_demux,
+};
diff --git a/arch/sh/boards/mach-edosk7705/Makefile b/arch/sh/boards/mach-edosk7705/Makefile
new file mode 100644 (file)
index 0000000..14bdd53
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# Makefile for the EDOSK7705 specific parts of the kernel
+#
+
+obj-y   := setup.o io.o
+
diff --git a/arch/sh/boards/mach-edosk7705/io.c b/arch/sh/boards/mach-edosk7705/io.c
new file mode 100644 (file)
index 0000000..541cea2
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * arch/sh/boards/renesas/edosk7705/io.c
+ *
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routines for Hitachi EDOSK7705 board.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <asm/io.h>
+#include <asm/edosk7705/io.h>
+#include <asm/addrspace.h>
+
+#define SMC_IOADDR     0xA2000000
+
+#define maybebadio(name,port) \
+  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
+        #name, (port), (__u32) __builtin_return_address(0))
+
+/* Map the Ethernet addresses as if it is at 0x300 - 0x320 */
+unsigned long sh_edosk7705_isa_port2addr(unsigned long port)
+{
+     if (port >= 0x300 && port < 0x320) {
+         /* SMC91C96 registers are 4 byte aligned rather than the
+          * usual 2 byte!
+          */
+         return SMC_IOADDR + ( (port - 0x300) * 2);
+     }
+
+     maybebadio(sh_edosk7705_isa_port2addr, port);
+     return port;
+}
+
+/* Trying to read / write bytes on odd-byte boundaries to the Ethernet
+ * registers causes problems. So we bit-shift the value and read / write
+ * in 2 byte chunks. Setting the low byte to 0 does not cause problems
+ * now as odd byte writes are only made on the bit mask / interrupt
+ * register. This may not be the case in future Mar-2003 SJD
+ */
+unsigned char sh_edosk7705_inb(unsigned long port)
+{
+       if (port >= 0x300 && port < 0x320 && port & 0x01) {
+               return (volatile unsigned char)(generic_inw(port -1) >> 8);
+       }
+       return *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port);
+}
+
+unsigned int sh_edosk7705_inl(unsigned long port)
+{
+       return *(volatile unsigned long *)port;
+}
+
+void sh_edosk7705_outb(unsigned char value, unsigned long port)
+{
+       if (port >= 0x300 && port < 0x320 && port & 0x01) {
+               generic_outw(((unsigned short)value << 8), port -1);
+               return;
+       }
+       *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port) = value;
+}
+
+void sh_edosk7705_outl(unsigned int value, unsigned long port)
+{
+       *(volatile unsigned long *)port = value;
+}
+
+void sh_edosk7705_insb(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned char *p = addr;
+       while (count--) *p++ = sh_edosk7705_inb(port);
+}
+
+void sh_edosk7705_insl(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned long *p = (unsigned long*)addr;
+       while (count--)
+               *p++ = *(volatile unsigned long *)port;
+}
+
+void sh_edosk7705_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned char *p = (unsigned char*)addr;
+       while (count--) sh_edosk7705_outb(*p++, port);
+}
+
+void sh_edosk7705_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned long *p = (unsigned long*)addr;
+       while (count--) sh_edosk7705_outl(*p++, port);
+}
+
diff --git a/arch/sh/boards/mach-edosk7705/setup.c b/arch/sh/boards/mach-edosk7705/setup.c
new file mode 100644 (file)
index 0000000..f076c45
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * arch/sh/boards/renesas/edosk7705/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ * Modified for edosk7705 development
+ * board by S. Dunn, 2003.
+ */
+#include <linux/init.h>
+#include <asm/machvec.h>
+#include <asm/edosk7705/io.h>
+
+static void __init sh_edosk7705_init_irq(void)
+{
+       /* This is the Ethernet interrupt */
+       make_imask_irq(0x09);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_edosk7705 __initmv = {
+       .mv_name                = "EDOSK7705",
+       .mv_nr_irqs             = 80,
+
+       .mv_inb                 = sh_edosk7705_inb,
+       .mv_inl                 = sh_edosk7705_inl,
+       .mv_outb                = sh_edosk7705_outb,
+       .mv_outl                = sh_edosk7705_outl,
+
+       .mv_inl_p               = sh_edosk7705_inl,
+       .mv_outl_p              = sh_edosk7705_outl,
+
+       .mv_insb                = sh_edosk7705_insb,
+       .mv_insl                = sh_edosk7705_insl,
+       .mv_outsb               = sh_edosk7705_outsb,
+       .mv_outsl               = sh_edosk7705_outsl,
+
+       .mv_isa_port2addr       = sh_edosk7705_isa_port2addr,
+       .mv_init_irq            = sh_edosk7705_init_irq,
+};
diff --git a/arch/sh/boards/mach-highlander/Kconfig b/arch/sh/boards/mach-highlander/Kconfig
new file mode 100644 (file)
index 0000000..fc8f28e
--- /dev/null
@@ -0,0 +1,24 @@
+if SH_HIGHLANDER
+
+choice
+       prompt "Highlander options"
+       default SH_R7780MP
+
+config SH_R7780RP
+       bool "R7780RP-1 board support"
+       depends on CPU_SUBTYPE_SH7780
+
+config SH_R7780MP
+       bool "R7780MP board support"
+       depends on CPU_SUBTYPE_SH7780
+       help
+         Selecting this option will enable support for the mass-production
+         version of the R7780RP. If in doubt, say Y.
+
+config SH_R7785RP
+       bool "R7785RP board support"
+       depends on CPU_SUBTYPE_SH7785
+
+endchoice
+
+endif
diff --git a/arch/sh/boards/mach-highlander/Makefile b/arch/sh/boards/mach-highlander/Makefile
new file mode 100644 (file)
index 0000000..20a1008
--- /dev/null
@@ -0,0 +1,11 @@
+#
+# Makefile for the R7780RP-1 specific parts of the kernel
+#
+irqinit-$(CONFIG_SH_R7780MP)   := irq-r7780mp.o
+irqinit-$(CONFIG_SH_R7785RP)   := irq-r7785rp.o
+irqinit-$(CONFIG_SH_R7780RP)   := irq-r7780rp.o
+obj-y                          := setup.o $(irqinit-y)
+
+ifneq ($(CONFIG_SH_R7785RP),y)
+obj-$(CONFIG_PUSH_SWITCH)      += psw.o
+endif
diff --git a/arch/sh/boards/mach-highlander/irq-r7780mp.c b/arch/sh/boards/mach-highlander/irq-r7780mp.c
new file mode 100644 (file)
index 0000000..ae1cfcb
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Renesas Solutions Highlander R7780MP Support.
+ *
+ * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2006  Paul Mundt
+ * Copyright (C) 2007  Magnus Damm
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/r7780rp.h>
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources */
+       CF,             /* Compact Flash */
+       TP,             /* Touch panel */
+       SCIF1,          /* FPGA SCIF1 */
+       SCIF0,          /* FPGA SCIF0 */
+       SMBUS,          /* SMBUS */
+       RTC,            /* RTC Alarm */
+       AX88796,        /* Ethernet controller */
+       PSW,            /* Push Switch */
+
+       /* external bus connector */
+       EXT1, EXT2, EXT4, EXT5, EXT6,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(CF, IRQ_CF),
+       INTC_IRQ(TP, IRQ_TP),
+       INTC_IRQ(SCIF1, IRQ_SCIF1),
+       INTC_IRQ(SCIF0, IRQ_SCIF0),
+       INTC_IRQ(SMBUS, IRQ_SMBUS),
+       INTC_IRQ(RTC, IRQ_RTC),
+       INTC_IRQ(AX88796, IRQ_AX88796),
+       INTC_IRQ(PSW, IRQ_PSW),
+
+       INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2),
+       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
+       INTC_IRQ(EXT6, IRQ_EXT6),
+};
+
+static struct intc_mask_reg mask_registers[] __initdata = {
+       { 0xa4000000, 0, 16, /* IRLMSK */
+         { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS,
+           0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } },
+};
+
+static unsigned char irl2irq[HL_NR_IRL] __initdata = {
+       0, IRQ_CF, IRQ_TP, IRQ_SCIF1,
+       IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6,
+       IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1,
+       0, IRQ_AX88796, IRQ_PSW,
+};
+
+static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
+                        NULL, mask_registers, NULL, NULL);
+
+unsigned char * __init highlander_plat_irq_setup(void)
+{
+       if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) {
+               printk(KERN_INFO "Using r7780mp interrupt controller.\n");
+               register_intc_controller(&intc_desc);
+               return irl2irq;
+       }
+
+       return NULL;
+}
diff --git a/arch/sh/boards/mach-highlander/irq-r7780rp.c b/arch/sh/boards/mach-highlander/irq-r7780rp.c
new file mode 100644 (file)
index 0000000..9d3921f
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Renesas Solutions Highlander R7780RP-1 Support.
+ *
+ * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2006  Paul Mundt
+ * Copyright (C) 2008  Magnus Damm
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/r7780rp.h>
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources */
+
+       AX88796,          /* Ethernet controller */
+       PSW,              /* Push Switch */
+       CF,               /* Compact Flash */
+
+       PCI_A,
+       PCI_B,
+       PCI_C,
+       PCI_D,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */
+       INTC_IRQ(PCI_B, 66),
+       INTC_IRQ(PCI_C, 67),
+       INTC_IRQ(PCI_D, 68),
+       INTC_IRQ(CF, IRQ_CF),
+       INTC_IRQ(PSW, IRQ_PSW),
+       INTC_IRQ(AX88796, IRQ_AX88796),
+};
+
+static struct intc_mask_reg mask_registers[] __initdata = {
+       { 0xa5000000, 0, 16, /* IRLMSK */
+         { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0,
+           0, 0, 0, 0, 0, 0, PSW, AX88796 } },
+};
+
+static unsigned char irl2irq[HL_NR_IRL] __initdata = {
+       65, 66, 67, 68,
+       IRQ_CF, 0, 0, 0,
+       0, 0, 0, 0,
+       IRQ_AX88796, IRQ_PSW
+};
+
+static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors,
+                        NULL, mask_registers, NULL, NULL);
+
+unsigned char * __init highlander_plat_irq_setup(void)
+{
+       if (ctrl_inw(0xa5000600)) {
+               printk(KERN_INFO "Using r7780rp interrupt controller.\n");
+               register_intc_controller(&intc_desc);
+               return irl2irq;
+       }
+
+       return NULL;
+}
diff --git a/arch/sh/boards/mach-highlander/irq-r7785rp.c b/arch/sh/boards/mach-highlander/irq-r7785rp.c
new file mode 100644 (file)
index 0000000..896c045
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Renesas Solutions Highlander R7785RP Support.
+ *
+ * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2006 - 2008  Paul Mundt
+ * Copyright (C) 2007  Magnus Damm
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/r7780rp.h>
+
+enum {
+       UNUSED = 0,
+
+       /* FPGA specific interrupt sources */
+       CF,             /* Compact Flash */
+       SMBUS,          /* SMBUS */
+       TP,             /* Touch panel */
+       RTC,            /* RTC Alarm */
+       TH_ALERT,       /* Temperature sensor */
+       AX88796,        /* Ethernet controller */
+
+       /* external bus connector */
+       EXT0, EXT1, EXT2, EXT3, EXT4, EXT5, EXT6, EXT7,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(CF, IRQ_CF),
+       INTC_IRQ(SMBUS, IRQ_SMBUS),
+       INTC_IRQ(TP, IRQ_TP),
+       INTC_IRQ(RTC, IRQ_RTC),
+       INTC_IRQ(TH_ALERT, IRQ_TH_ALERT),
+
+       INTC_IRQ(EXT0, IRQ_EXT0), INTC_IRQ(EXT1, IRQ_EXT1),
+       INTC_IRQ(EXT2, IRQ_EXT2), INTC_IRQ(EXT3, IRQ_EXT3),
+
+       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
+       INTC_IRQ(EXT6, IRQ_EXT6), INTC_IRQ(EXT7, IRQ_EXT7),
+
+       INTC_IRQ(AX88796, IRQ_AX88796),
+};
+
+static struct intc_mask_reg mask_registers[] __initdata = {
+       { 0xa4000010, 0, 16, /* IRLMCR1 */
+         { 0, 0, 0, 0, CF, AX88796, SMBUS, TP,
+           RTC, 0, TH_ALERT, 0, 0, 0, 0, 0 } },
+       { 0xa4000012, 0, 16, /* IRLMCR2 */
+         { 0, 0, 0, 0, 0, 0, 0, 0,
+           EXT7, EXT6, EXT5, EXT4, EXT3, EXT2, EXT1, EXT0 } },
+};
+
+static unsigned char irl2irq[HL_NR_IRL] __initdata = {
+       0, IRQ_CF, IRQ_EXT4, IRQ_EXT5,
+       IRQ_EXT6, IRQ_EXT7, IRQ_SMBUS, IRQ_TP,
+       IRQ_RTC, IRQ_TH_ALERT, IRQ_AX88796, IRQ_EXT0,
+       IRQ_EXT1, IRQ_EXT2, IRQ_EXT3,
+};
+
+static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors,
+                        NULL, mask_registers, NULL, NULL);
+
+unsigned char * __init highlander_plat_irq_setup(void)
+{
+       if ((ctrl_inw(0xa4000158) & 0xf000) != 0x1000)
+               return NULL;
+
+       printk(KERN_INFO "Using r7785rp interrupt controller.\n");
+
+       ctrl_outw(0x0000, PA_IRLSSR1);  /* FPGA IRLSSR1(CF_CD clear) */
+
+       /* Setup the FPGA IRL */
+       ctrl_outw(0x0000, PA_IRLPRA);   /* FPGA IRLA */
+       ctrl_outw(0xe598, PA_IRLPRB);   /* FPGA IRLB */
+       ctrl_outw(0x7060, PA_IRLPRC);   /* FPGA IRLC */
+       ctrl_outw(0x0000, PA_IRLPRD);   /* FPGA IRLD */
+       ctrl_outw(0x4321, PA_IRLPRE);   /* FPGA IRLE */
+       ctrl_outw(0xdcba, PA_IRLPRF);   /* FPGA IRLF */
+
+       register_intc_controller(&intc_desc);
+       return irl2irq;
+}
diff --git a/arch/sh/boards/mach-highlander/psw.c b/arch/sh/boards/mach-highlander/psw.c
new file mode 100644 (file)
index 0000000..0b3e062
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * arch/sh/boards/renesas/r7780rp/psw.c
+ *
+ * push switch support for RDBRP-1/RDBREVRP-1 debug boards.
+ *
+ * Copyright (C) 2006  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/io.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <mach/r7780rp.h>
+#include <asm/push-switch.h>
+
+static irqreturn_t psw_irq_handler(int irq, void *arg)
+{
+       struct platform_device *pdev = arg;
+       struct push_switch *psw = platform_get_drvdata(pdev);
+       struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
+       unsigned int l, mask;
+       int ret = 0;
+
+       l = ctrl_inw(PA_DBSW);
+
+       /* Nothing to do if there's no state change */
+       if (psw->state) {
+               ret = 1;
+               goto out;
+       }
+
+       mask = l & 0x70;
+       /* Figure out who raised it */
+       if (mask & (1 << psw_info->bit)) {
+               psw->state = !!(mask & (1 << psw_info->bit));
+               if (psw->state) /* debounce */
+                       mod_timer(&psw->debounce, jiffies + 50);
+
+               ret = 1;
+       }
+
+out:
+       /* Clear the switch IRQs */
+       l |= (0x7 << 12);
+       ctrl_outw(l, PA_DBSW);
+
+       return IRQ_RETVAL(ret);
+}
+
+static struct resource psw_resources[] = {
+       [0] = {
+               .start  = IRQ_PSW,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct push_switch_platform_info s2_platform_data = {
+       .name           = "s2",
+       .bit            = 6,
+       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
+                         IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct platform_device s2_switch_device = {
+       .name           = "push-switch",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(psw_resources),
+       .resource       = psw_resources,
+       .dev            = {
+               .platform_data = &s2_platform_data,
+       },
+};
+
+static struct push_switch_platform_info s3_platform_data = {
+       .name           = "s3",
+       .bit            = 5,
+       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
+                         IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct platform_device s3_switch_device = {
+       .name           = "push-switch",
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(psw_resources),
+       .resource       = psw_resources,
+       .dev            = {
+               .platform_data = &s3_platform_data,
+       },
+};
+
+static struct push_switch_platform_info s4_platform_data = {
+       .name           = "s4",
+       .bit            = 4,
+       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
+                         IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct platform_device s4_switch_device = {
+       .name           = "push-switch",
+       .id             = 2,
+       .num_resources  = ARRAY_SIZE(psw_resources),
+       .resource       = psw_resources,
+       .dev            = {
+               .platform_data = &s4_platform_data,
+       },
+};
+
+static struct platform_device *psw_devices[] = {
+       &s2_switch_device, &s3_switch_device, &s4_switch_device,
+};
+
+static int __init psw_init(void)
+{
+       return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
+}
+module_init(psw_init);
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
new file mode 100644 (file)
index 0000000..bc79afb
--- /dev/null
@@ -0,0 +1,345 @@
+/*
+ * arch/sh/boards/renesas/r7780rp/setup.c
+ *
+ * Renesas Solutions Highlander Support.
+ *
+ * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2005 - 2008 Paul Mundt
+ *
+ * This contains support for the R7780RP-1, R7780MP, and R7785RP
+ * Highlander modules.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
+#include <net/ax88796.h>
+#include <asm/machvec.h>
+#include <asm/r7780rp.h>
+#include <asm/clock.h>
+#include <asm/heartbeat.h>
+#include <asm/io.h>
+#include <asm/io_trapped.h>
+
+static struct resource r8a66597_usb_host_resources[] = {
+       [0] = {
+               .name   = "r8a66597_hcd",
+               .start  = 0xA4200000,
+               .end    = 0xA42000FF,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "r8a66597_hcd",
+               .start  = IRQ_EXT1,             /* irq number */
+               .end    = IRQ_EXT1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device r8a66597_usb_host_device = {
+       .name           = "r8a66597_hcd",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
+       .resource       = r8a66597_usb_host_resources,
+};
+
+static struct resource m66592_usb_peripheral_resources[] = {
+       [0] = {
+               .name   = "m66592_udc",
+               .start  = 0xb0000000,
+               .end    = 0xb00000FF,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "m66592_udc",
+               .start  = IRQ_EXT4,             /* irq number */
+               .end    = IRQ_EXT4,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device m66592_usb_peripheral_device = {
+       .name           = "m66592_udc",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(m66592_usb_peripheral_resources),
+       .resource       = m66592_usb_peripheral_resources,
+};
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_AREA5_IO + 0x1000,
+               .end    = PA_AREA5_IO + 0x1000 + 0x08 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = PA_AREA5_IO + 0x80c,
+               .end    = PA_AREA5_IO + 0x80c + 0x16 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start  = IRQ_CF,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct pata_platform_info pata_info = {
+       .ioport_shift   = 1,
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+       .dev    = {
+               .platform_data  = &pata_info,
+       },
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_OBLED,
+               .end    = PA_OBLED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+#ifndef CONFIG_SH_R7785RP
+static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+};
+#endif
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+
+       /* R7785RP has a slightly more sensible FPGA.. */
+#ifndef CONFIG_SH_R7785RP
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+#endif
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct ax_plat_data ax88796_platdata = {
+       .flags          = AXFLG_HAS_93CX6,
+       .wordlength     = 2,
+       .dcr_val        = 0x1,
+       .rcr_val        = 0x40,
+};
+
+static struct resource ax88796_resources[] = {
+       {
+#ifdef CONFIG_SH_R7780RP
+               .start  = 0xa5800400,
+               .end    = 0xa5800400 + (0x20 * 0x2) - 1,
+#else
+               .start  = 0xa4100400,
+               .end    = 0xa4100400 + (0x20 * 0x2) - 1,
+#endif
+               .flags  = IORESOURCE_MEM,
+       },
+       {
+               .start  = IRQ_AX88796,
+               .end    = IRQ_AX88796,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device ax88796_device = {
+       .name           = "ax88796",
+       .id             = 0,
+
+       .dev    = {
+               .platform_data = &ax88796_platdata,
+       },
+
+       .num_resources  = ARRAY_SIZE(ax88796_resources),
+       .resource       = ax88796_resources,
+};
+
+static struct resource smbus_resources[] = {
+       [0] = {
+               .start  = PA_SMCR,
+               .end    = PA_SMCR + 0x100 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_SMBUS,
+               .end    = IRQ_SMBUS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smbus_device = {
+       .name           = "i2c-highlander",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(smbus_resources),
+       .resource       = smbus_resources,
+};
+
+static struct i2c_board_info __initdata highlander_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("r2025sd", 0x32),
+       },
+};
+
+static struct platform_device *r7780rp_devices[] __initdata = {
+       &r8a66597_usb_host_device,
+       &m66592_usb_peripheral_device,
+       &heartbeat_device,
+       &smbus_device,
+#ifndef CONFIG_SH_R7780RP
+       &ax88796_device,
+#endif
+};
+
+/*
+ * The CF is connected using a 16-bit bus where 8-bit operations are
+ * unsupported. The linux ata driver is however using 8-bit operations, so
+ * insert a trapped io filter to convert 8-bit operations into 16-bit.
+ */
+static struct trapped_io cf_trapped_io = {
+       .resource               = cf_ide_resources,
+       .num_resources          = 2,
+       .minimum_bus_width      = 16,
+};
+
+static int __init r7780rp_devices_setup(void)
+{
+       int ret = 0;
+
+#ifndef CONFIG_SH_R7780RP
+       if (register_trapped_io(&cf_trapped_io) == 0)
+               ret |= platform_device_register(&cf_ide_device);
+#endif
+
+       ret |= platform_add_devices(r7780rp_devices,
+                                   ARRAY_SIZE(r7780rp_devices));
+
+       ret |= i2c_register_board_info(0, highlander_i2c_devices,
+                                      ARRAY_SIZE(highlander_i2c_devices));
+
+       return ret;
+}
+device_initcall(r7780rp_devices_setup);
+
+/*
+ * Platform specific clocks
+ */
+static void ivdr_clk_enable(struct clk *clk)
+{
+       ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL);
+}
+
+static void ivdr_clk_disable(struct clk *clk)
+{
+       ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
+}
+
+static struct clk_ops ivdr_clk_ops = {
+       .enable         = ivdr_clk_enable,
+       .disable        = ivdr_clk_disable,
+};
+
+static struct clk ivdr_clk = {
+       .name           = "ivdr_clk",
+       .ops            = &ivdr_clk_ops,
+};
+
+static struct clk *r7780rp_clocks[] = {
+       &ivdr_clk,
+};
+
+static void r7780rp_power_off(void)
+{
+       if (mach_is_r7780mp() || mach_is_r7785rp())
+               ctrl_outw(0x0001, PA_POFF);
+}
+
+/*
+ * Initialize the board
+ */
+static void __init highlander_setup(char **cmdline_p)
+{
+       u16 ver = ctrl_inw(PA_VERREG);
+       int i;
+
+       printk(KERN_INFO "Renesas Solutions Highlander %s support.\n",
+                        mach_is_r7780rp() ? "R7780RP-1" :
+                        mach_is_r7780mp() ? "R7780MP"   :
+                                            "R7785RP");
+
+       printk(KERN_INFO "Board version: %d (revision %d), "
+                        "FPGA version: %d (revision %d)\n",
+                        (ver >> 12) & 0xf, (ver >> 8) & 0xf,
+                        (ver >>  4) & 0xf, ver & 0xf);
+
+       /*
+        * Enable the important clocks right away..
+        */
+       for (i = 0; i < ARRAY_SIZE(r7780rp_clocks); i++) {
+               struct clk *clk = r7780rp_clocks[i];
+
+               clk_register(clk);
+               clk_enable(clk);
+       }
+
+       ctrl_outw(0x0000, PA_OBLED);    /* Clear LED. */
+
+       if (mach_is_r7780rp())
+               ctrl_outw(0x0001, PA_SDPOW);    /* SD Power ON */
+
+       ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL);     /* Si13112 */
+
+       pm_power_off = r7780rp_power_off;
+}
+
+static unsigned char irl2irq[HL_NR_IRL];
+
+static int highlander_irq_demux(int irq)
+{
+       if (irq >= HL_NR_IRL || !irl2irq[irq])
+               return irq;
+
+       return irl2irq[irq];
+}
+
+static void __init highlander_init_irq(void)
+{
+       unsigned char *ucp = highlander_plat_irq_setup();
+
+       if (ucp) {
+               plat_irq_setup_pins(IRQ_MODE_IRL3210);
+               memcpy(irl2irq, ucp, HL_NR_IRL);
+       }
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_highlander __initmv = {
+       .mv_name                = "Highlander",
+       .mv_setup               = highlander_setup,
+       .mv_init_irq            = highlander_init_irq,
+       .mv_irq_demux           = highlander_irq_demux,
+};
diff --git a/arch/sh/boards/mach-hp6xx/Makefile b/arch/sh/boards/mach-hp6xx/Makefile
new file mode 100644 (file)
index 0000000..b312427
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Makefile for the HP6xx specific parts of the kernel
+#
+
+obj-y                  := setup.o
+obj-$(CONFIG_PM)       += pm.o pm_wakeup.o
+obj-$(CONFIG_APM_EMULATION)    += hp6xx_apm.o
diff --git a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
new file mode 100644 (file)
index 0000000..177f4f0
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * bios-less APM driver for hp680
+ *
+ * Copyright 2005 (c) Andriy Skulysh <askulysh@gmail.com>
+ * Copyright 2008 (c) Kristoffer Ericson <kristoffer.ericson@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License.
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/apm-emulation.h>
+#include <linux/io.h>
+#include <asm/adc.h>
+#include <asm/hp6xx.h>
+
+/* percentage values */
+#define APM_CRITICAL                   10
+#define APM_LOW                                30
+
+/* resonably sane values */
+#define HP680_BATTERY_MAX              898
+#define HP680_BATTERY_MIN              486
+#define HP680_BATTERY_AC_ON            1023
+
+#define MODNAME "hp6x0_apm"
+
+#define PGDR   0xa400012c
+
+static void hp6x0_apm_get_power_status(struct apm_power_info *info)
+{
+       int battery, backup, charging, percentage;
+       u8 pgdr;
+
+       battery         = adc_single(ADC_CHANNEL_BATTERY);
+       backup          = adc_single(ADC_CHANNEL_BACKUP);
+       charging        = adc_single(ADC_CHANNEL_CHARGE);
+
+       percentage = 100 * (battery - HP680_BATTERY_MIN) /
+                          (HP680_BATTERY_MAX - HP680_BATTERY_MIN);
+
+       /* % of full battery */
+       info->battery_life = percentage;
+
+       /* We want our estimates in minutes */
+       info->units = 0;
+
+       /* Extremely(!!) rough estimate, we will replace this with a datalist later on */
+       info->time = (2 * battery);
+
+       info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ?
+                        APM_AC_ONLINE : APM_AC_OFFLINE;
+
+       pgdr = ctrl_inb(PGDR);
+       if (pgdr & PGDR_MAIN_BATTERY_OUT) {
+               info->battery_status    = APM_BATTERY_STATUS_NOT_PRESENT;
+               info->battery_flag      = 0x80;
+       } else if (charging < 8) {
+               info->battery_status    = APM_BATTERY_STATUS_CHARGING;
+               info->battery_flag      = 0x08;
+               info->ac_line_status    = 0x01;
+       } else if (percentage <= APM_CRITICAL) {
+               info->battery_status    = APM_BATTERY_STATUS_CRITICAL;
+               info->battery_flag      = 0x04;
+       } else if (percentage <= APM_LOW) {
+               info->battery_status    = APM_BATTERY_STATUS_LOW;
+               info->battery_flag      = 0x02;
+       } else {
+               info->battery_status    = APM_BATTERY_STATUS_HIGH;
+               info->battery_flag      = 0x01;
+       }
+}
+
+static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev)
+{
+       if (!APM_DISABLED)
+               apm_queue_event(APM_USER_SUSPEND);
+
+       return IRQ_HANDLED;
+}
+
+static int __init hp6x0_apm_init(void)
+{
+       int ret;
+
+       ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt,
+                         IRQF_DISABLED, MODNAME, NULL);
+       if (unlikely(ret < 0)) {
+               printk(KERN_ERR MODNAME ": IRQ %d request failed\n",
+                      HP680_BTN_IRQ);
+               return ret;
+       }
+
+       apm_get_power_status = hp6x0_apm_get_power_status;
+
+       return ret;
+}
+
+static void __exit hp6x0_apm_exit(void)
+{
+       free_irq(HP680_BTN_IRQ, 0);
+}
+
+module_init(hp6x0_apm_init);
+module_exit(hp6x0_apm_exit);
+
+MODULE_AUTHOR("Adriy Skulysh");
+MODULE_DESCRIPTION("hp6xx Advanced Power Management");
+MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c
new file mode 100644 (file)
index 0000000..e96684d
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * hp6x0 Power Management Routines
+ *
+ * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License.
+ */
+#include <linux/init.h>
+#include <linux/suspend.h>
+#include <linux/errno.h>
+#include <linux/time.h>
+#include <asm/io.h>
+#include <asm/hd64461.h>
+#include <asm/hp6xx.h>
+#include <cpu/dac.h>
+#include <asm/pm.h>
+
+#define STBCR          0xffffff82
+#define STBCR2         0xffffff88
+
+static int hp6x0_pm_enter(suspend_state_t state)
+{
+       u8 stbcr, stbcr2;
+#ifdef CONFIG_HD64461_ENABLER
+       u8 scr;
+       u16 hd64461_stbcr;
+#endif
+
+#ifdef CONFIG_HD64461_ENABLER
+       outb(0, HD64461_PCC1CSCIER);
+
+       scr = inb(HD64461_PCC1SCR);
+       scr |= HD64461_PCCSCR_VCC1;
+       outb(scr, HD64461_PCC1SCR);
+
+       hd64461_stbcr = inw(HD64461_STBCR);
+       hd64461_stbcr |= HD64461_STBCR_SPC1ST;
+       outw(hd64461_stbcr, HD64461_STBCR);
+#endif
+
+       ctrl_outb(0x1f, DACR);
+
+       stbcr = ctrl_inb(STBCR);
+       ctrl_outb(0x01, STBCR);
+
+       stbcr2 = ctrl_inb(STBCR2);
+       ctrl_outb(0x7f , STBCR2);
+
+       outw(0xf07f, HD64461_SCPUCR);
+
+       pm_enter();
+
+       outw(0, HD64461_SCPUCR);
+       ctrl_outb(stbcr, STBCR);
+       ctrl_outb(stbcr2, STBCR2);
+
+#ifdef CONFIG_HD64461_ENABLER
+       hd64461_stbcr = inw(HD64461_STBCR);
+       hd64461_stbcr &= ~HD64461_STBCR_SPC1ST;
+       outw(hd64461_stbcr, HD64461_STBCR);
+
+       outb(0x4c, HD64461_PCC1CSCIER);
+       outb(0x00, HD64461_PCC1CSCR);
+#endif
+
+       return 0;
+}
+
+static struct platform_suspend_ops hp6x0_pm_ops = {
+       .enter          = hp6x0_pm_enter,
+       .valid          = suspend_valid_only_mem,
+};
+
+static int __init hp6x0_pm_init(void)
+{
+       suspend_set_ops(&hp6x0_pm_ops);
+       return 0;
+}
+
+late_initcall(hp6x0_pm_init);
diff --git a/arch/sh/boards/mach-hp6xx/pm_wakeup.S b/arch/sh/boards/mach-hp6xx/pm_wakeup.S
new file mode 100644 (file)
index 0000000..44b648c
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <cpu/mmu_context.h>
+
+#define k0     r0
+#define k1     r1
+#define k2     r2
+#define k3     r3
+#define k4     r4
+
+/*
+ * Kernel mode register usage:
+ *     k0      scratch
+ *     k1      scratch
+ *     k2      scratch (Exception code)
+ *     k3      scratch (Return address)
+ *     k4      scratch
+ *     k5      reserved
+ *     k6      Global Interrupt Mask (0--15 << 4)
+ *     k7      CURRENT_THREAD_INFO (pointer to current thread info)
+ */
+
+ENTRY(wakeup_start)
+! clear STBY bit
+       mov     #-126, k2
+       and     #127, k0
+       mov.b   k0, @k2
+! enable refresh
+       mov.l   5f, k1
+       mov.w   6f, k0
+       mov.w   k0, @k1
+! jump to handler
+       mov.l   2f, k2
+       mov.l   3f, k3
+       mov.l   @k2, k2
+
+       mov.l   4f, k1
+       jmp     @k1
+       nop
+
+       .align  2
+1:     .long   EXPEVT
+2:     .long   INTEVT
+3:     .long   ret_from_irq
+4:     .long   handle_exception
+5:     .long   0xffffff68
+6:     .word   0x0524
+
+ENTRY(wakeup_end)
+       nop
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c
new file mode 100644 (file)
index 0000000..475b46c
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * linux/arch/sh/boards/hp6xx/setup.c
+ *
+ * Copyright (C) 2002 Andriy Skulysh
+ * Copyright (C) 2007 Kristoffer Ericson <Kristoffer_e1@hotmail.com>
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * Setup code for HP620/HP660/HP680/HP690 (internal peripherials only)
+ */
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/hd64461.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/hp6xx.h>
+#include <cpu/dac.h>
+
+#define        SCPCR   0xa4000116
+#define        SCPDR   0xa4000136
+
+/* CF Slot */
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start = 0x15000000 + 0x1f0,
+               .end   = 0x15000000 + 0x1f0 + 0x08 - 0x01,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = 0x15000000 + 0x1fe,
+               .end   = 0x15000000 + 0x1fe + 0x01,
+               .flags = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start = 77,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device = {
+       .name           =  "pata_platform",
+       .id             =  -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct platform_device jornadakbd_device = {
+       .name           = "jornada680_kbd",
+       .id             = -1,
+};
+
+static struct platform_device *hp6xx_devices[] __initdata = {
+       &cf_ide_device,
+       &jornadakbd_device,
+};
+
+static void __init hp6xx_init_irq(void)
+{
+       /* Gets touchscreen and powerbutton IRQ working */
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+static int __init hp6xx_devices_setup(void)
+{
+       return platform_add_devices(hp6xx_devices, ARRAY_SIZE(hp6xx_devices));
+}
+
+static void __init hp6xx_setup(char **cmdline_p)
+{
+       u8 v8;
+       u16 v;
+
+       v = inw(HD64461_STBCR);
+       v |=    HD64461_STBCR_SURTST | HD64461_STBCR_SIRST      |
+               HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST     |
+               HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST     |
+               HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST|
+               HD64461_STBCR_SAFECKE_IST;
+#ifndef CONFIG_HD64461_ENABLER
+       v |= HD64461_STBCR_SPC1ST;
+#endif
+       outw(v, HD64461_STBCR);
+       v = inw(HD64461_GPADR);
+       v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
+       outw(v, HD64461_GPADR);
+
+       outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR);
+
+#ifndef CONFIG_HD64461_ENABLER
+       outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR);
+#endif
+
+       sh_dac_output(0, DAC_SPEAKER_VOLUME);
+       sh_dac_disable(DAC_SPEAKER_VOLUME);
+       v8 = ctrl_inb(DACR);
+       v8 &= ~DACR_DAE;
+       ctrl_outb(v8,DACR);
+
+       v8 = ctrl_inb(SCPDR);
+       v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y;
+       v8 &= ~SCPDR_TS_SCAN_ENABLE;
+       ctrl_outb(v8, SCPDR);
+
+       v = ctrl_inw(SCPCR);
+       v &= ~SCPCR_TS_MASK;
+       v |= SCPCR_TS_ENABLE;
+       ctrl_outw(v, SCPCR);
+}
+device_initcall(hp6xx_devices_setup);
+
+static struct sh_machine_vector mv_hp6xx __initmv = {
+       .mv_name = "hp6xx",
+       .mv_setup = hp6xx_setup,
+       /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */
+       .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6,
+       .mv_irq_demux = hd64461_irq_demux,
+       /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
+       .mv_init_irq = hp6xx_init_irq,
+};
diff --git a/arch/sh/boards/mach-landisk/Makefile b/arch/sh/boards/mach-landisk/Makefile
new file mode 100644 (file)
index 0000000..a696b42
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for I-O DATA DEVICE, INC. "LANDISK Series"
+#
+
+obj-y   := setup.o irq.o psw.o gio.o
diff --git a/arch/sh/boards/mach-landisk/gio.c b/arch/sh/boards/mach-landisk/gio.c
new file mode 100644 (file)
index 0000000..edcde08
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * arch/sh/boards/landisk/gio.c - driver for landisk
+ *
+ * This driver will also support the I-O DATA Device, Inc. LANDISK Board.
+ * LANDISK and USL-5P Button, LED and GIO driver drive function.
+ *
+ *   Copylight (C) 2006 kogiidena
+ *   Copylight (C) 2002 Atom Create Engineering Co., Ltd. *
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/smp_lock.h>
+#include <linux/kdev_t.h>
+#include <linux/cdev.h>
+#include <linux/fs.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <mach/gio.h>
+#include <mach/iodata_landisk.h>
+
+#define DEVCOUNT                4
+#define GIO_MINOR              2       /* GIO minor no. */
+
+static dev_t dev;
+static struct cdev *cdev_p;
+static int openCnt;
+
+static int gio_open(struct inode *inode, struct file *filp)
+{
+       int minor;
+       int ret = -ENOENT;
+
+       lock_kernel();
+       minor = MINOR(inode->i_rdev);
+       if (minor < DEVCOUNT) {
+               if (openCnt > 0) {
+                       ret = -EALREADY;
+               } else {
+                       openCnt++;
+                       ret = 0;
+               }
+       }
+       unlock_kernel();
+       return ret;
+}
+
+static int gio_close(struct inode *inode, struct file *filp)
+{
+       int minor;
+
+       minor = MINOR(inode->i_rdev);
+       if (minor < DEVCOUNT) {
+               openCnt--;
+       }
+       return 0;
+}
+
+static int gio_ioctl(struct inode *inode, struct file *filp,
+                            unsigned int cmd, unsigned long arg)
+{
+       unsigned int data;
+       static unsigned int addr = 0;
+
+       if (cmd & 0x01) {       /* write */
+               if (copy_from_user(&data, (int *)arg, sizeof(int))) {
+                       return -EFAULT;
+               }
+       }
+
+       switch (cmd) {
+       case GIODRV_IOCSGIOSETADDR:     /* address set */
+               addr = data;
+               break;
+
+       case GIODRV_IOCSGIODATA1:       /* write byte */
+               ctrl_outb((unsigned char)(0x0ff & data), addr);
+               break;
+
+       case GIODRV_IOCSGIODATA2:       /* write word */
+               if (addr & 0x01) {
+                       return -EFAULT;
+               }
+               ctrl_outw((unsigned short int)(0x0ffff & data), addr);
+               break;
+
+       case GIODRV_IOCSGIODATA4:       /* write long */
+               if (addr & 0x03) {
+                       return -EFAULT;
+               }
+               ctrl_outl(data, addr);
+               break;
+
+       case GIODRV_IOCGGIODATA1:       /* read byte */
+               data = ctrl_inb(addr);
+               break;
+
+       case GIODRV_IOCGGIODATA2:       /* read word */
+               if (addr & 0x01) {
+                       return -EFAULT;
+               }
+               data = ctrl_inw(addr);
+               break;
+
+       case GIODRV_IOCGGIODATA4:       /* read long */
+               if (addr & 0x03) {
+                       return -EFAULT;
+               }
+               data = ctrl_inl(addr);
+               break;
+       default:
+               return -EFAULT;
+               break;
+       }
+
+       if ((cmd & 0x01) == 0) {        /* read */
+               if (copy_to_user((int *)arg, &data, sizeof(int))) {
+                       return -EFAULT;
+               }
+       }
+       return 0;
+}
+
+static const struct file_operations gio_fops = {
+       .owner = THIS_MODULE,
+       .open = gio_open,       /* open */
+       .release = gio_close,   /* release */
+       .ioctl = gio_ioctl,     /* ioctl */
+};
+
+static int __init gio_init(void)
+{
+       int error;
+
+       printk(KERN_INFO "gio: driver initialized\n");
+
+       openCnt = 0;
+
+       if ((error = alloc_chrdev_region(&dev, 0, DEVCOUNT, "gio")) < 0) {
+               printk(KERN_ERR
+                      "gio: Couldn't alloc_chrdev_region, error=%d\n",
+                      error);
+               return 1;
+       }
+
+       cdev_p = cdev_alloc();
+       cdev_p->ops = &gio_fops;
+       error = cdev_add(cdev_p, dev, DEVCOUNT);
+       if (error) {
+               printk(KERN_ERR
+                      "gio: Couldn't cdev_add, error=%d\n", error);
+               return 1;
+       }
+
+       return 0;
+}
+
+static void __exit gio_exit(void)
+{
+       cdev_del(cdev_p);
+       unregister_chrdev_region(dev, DEVCOUNT);
+}
+
+module_init(gio_init);
+module_exit(gio_exit);
+
+MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/mach-landisk/irq.c b/arch/sh/boards/mach-landisk/irq.c
new file mode 100644 (file)
index 0000000..d0f9378
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * arch/sh/boards/landisk/irq.c
+ *
+ * I-O DATA Device, Inc. LANDISK Support
+ *
+ * Copyright (C) 2005-2007 kogiidena
+ *
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <mach/iodata_landisk.h>
+
+static void disable_landisk_irq(unsigned int irq)
+{
+       unsigned char mask = 0xff ^ (0x01 << (irq - 5));
+
+       ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK);
+}
+
+static void enable_landisk_irq(unsigned int irq)
+{
+       unsigned char value = (0x01 << (irq - 5));
+
+       ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK);
+}
+
+static struct irq_chip landisk_irq_chip __read_mostly = {
+       .name           = "LANDISK",
+       .mask           = disable_landisk_irq,
+       .unmask         = enable_landisk_irq,
+       .mask_ack       = disable_landisk_irq,
+};
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_landisk_IRQ(void)
+{
+       int i;
+
+       for (i = 5; i < 14; i++) {
+               disable_irq_nosync(i);
+               set_irq_chip_and_handler_name(i, &landisk_irq_chip,
+                                             handle_level_irq, "level");
+               enable_landisk_irq(i);
+       }
+       ctrl_outb(0x00, PA_PWRINT_CLR);
+}
diff --git a/arch/sh/boards/mach-landisk/psw.c b/arch/sh/boards/mach-landisk/psw.c
new file mode 100644 (file)
index 0000000..4bd502c
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * arch/sh/boards/landisk/psw.c
+ *
+ * push switch support for LANDISK and USL-5P
+ *
+ * Copyright (C) 2006-2007  Paul Mundt
+ * Copyright (C) 2007  kogiidena
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/io.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <mach/iodata_landisk.h>
+#include <asm/push-switch.h>
+
+static irqreturn_t psw_irq_handler(int irq, void *arg)
+{
+       struct platform_device *pdev = arg;
+       struct push_switch *psw = platform_get_drvdata(pdev);
+       struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
+       unsigned int sw_value;
+       int ret = 0;
+
+       sw_value = (0x0ff & (~ctrl_inb(PA_STATUS)));
+
+       /* Nothing to do if there's no state change */
+       if (psw->state) {
+               ret = 1;
+               goto out;
+       }
+
+       /* Figure out who raised it */
+       if (sw_value & (1 << psw_info->bit)) {
+               psw->state = 1;
+               mod_timer(&psw->debounce, jiffies + 50);
+               ret = 1;
+       }
+
+out:
+       /* Clear the switch IRQs */
+       ctrl_outb(0x00, PA_PWRINT_CLR);
+
+       return IRQ_RETVAL(ret);
+}
+
+static struct resource psw_power_resources[] = {
+       [0] = {
+               .start = IRQ_POWER,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct resource psw_usl5p_resources[] = {
+       [0] = {
+               .start = IRQ_BUTTON,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct push_switch_platform_info psw_power_platform_data = {
+       .name           = "psw_power",
+       .bit            = 4,
+       .irq_flags      = IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct push_switch_platform_info psw1_platform_data = {
+       .name           = "psw1",
+       .bit            = 0,
+       .irq_flags      = IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct push_switch_platform_info psw2_platform_data = {
+       .name           = "psw2",
+       .bit            = 2,
+       .irq_flags      = IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct push_switch_platform_info psw3_platform_data = {
+       .name           = "psw3",
+       .bit            = 1,
+       .irq_flags      = IRQF_SHARED,
+       .irq_handler    = psw_irq_handler,
+};
+
+static struct platform_device psw_power_switch_device = {
+       .name           = "push-switch",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(psw_power_resources),
+       .resource       = psw_power_resources,
+       .dev            = {
+               .platform_data = &psw_power_platform_data,
+       },
+};
+
+static struct platform_device psw1_switch_device = {
+       .name           = "push-switch",
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
+       .resource       = psw_usl5p_resources,
+       .dev            = {
+               .platform_data = &psw1_platform_data,
+       },
+};
+
+static struct platform_device psw2_switch_device = {
+       .name           = "push-switch",
+       .id             = 2,
+       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
+       .resource       = psw_usl5p_resources,
+       .dev            = {
+               .platform_data = &psw2_platform_data,
+       },
+};
+
+static struct platform_device psw3_switch_device = {
+       .name           = "push-switch",
+       .id             = 3,
+       .num_resources  = ARRAY_SIZE(psw_usl5p_resources),
+       .resource       = psw_usl5p_resources,
+       .dev = {
+               .platform_data = &psw3_platform_data,
+       },
+};
+
+static struct platform_device *psw_devices[] = {
+       &psw_power_switch_device,
+       &psw1_switch_device,
+       &psw2_switch_device,
+       &psw3_switch_device,
+};
+
+static int __init psw_init(void)
+{
+       return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
+}
+module_init(psw_init);
diff --git a/arch/sh/boards/mach-landisk/setup.c b/arch/sh/boards/mach-landisk/setup.c
new file mode 100644 (file)
index 0000000..470c781
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * arch/sh/boards/landisk/setup.c
+ *
+ * I-O DATA Device, Inc. LANDISK Support.
+ *
+ * Copyright (C) 2000 Kazumoto Kojima
+ * Copyright (C) 2002 Paul Mundt
+ * Copylight (C) 2002 Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2005-2007 kogiidena
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/pm.h>
+#include <linux/mm.h>
+#include <asm/machvec.h>
+#include <mach/iodata_landisk.h>
+#include <asm/io.h>
+
+void init_landisk_IRQ(void);
+
+static void landisk_power_off(void)
+{
+        ctrl_outb(0x01, PA_SHUTDOWN);
+}
+
+static struct resource cf_ide_resources[3];
+
+static struct pata_platform_info pata_info = {
+       .ioport_shift   = 1,
+};
+
+static struct platform_device cf_ide_device = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+       .dev            = {
+               .platform_data = &pata_info,
+       },
+};
+
+static struct platform_device rtc_device = {
+       .name           = "rs5c313",
+       .id             = -1,
+};
+
+static struct platform_device *landisk_devices[] __initdata = {
+       &cf_ide_device,
+       &rtc_device,
+};
+
+static int __init landisk_devices_setup(void)
+{
+       pgprot_t prot;
+       unsigned long paddrbase;
+       void *cf_ide_base;
+
+       /* open I/O area window */
+       paddrbase = virt_to_phys((void *)PA_AREA5_IO);
+       prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
+       cf_ide_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
+       if (!cf_ide_base) {
+               printk("allocate_cf_area : can't open CF I/O window!\n");
+               return -ENOMEM;
+       }
+
+       /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
+       cf_ide_resources[0].start = (unsigned long)cf_ide_base + 0x40;
+       cf_ide_resources[0].end   = (unsigned long)cf_ide_base + 0x40 + 0x0f;
+       cf_ide_resources[0].flags = IORESOURCE_IO;
+       cf_ide_resources[1].start = (unsigned long)cf_ide_base + 0x2c;
+       cf_ide_resources[1].end   = (unsigned long)cf_ide_base + 0x2c + 0x03;
+       cf_ide_resources[1].flags = IORESOURCE_IO;
+       cf_ide_resources[2].start = IRQ_FATA;
+       cf_ide_resources[2].flags = IORESOURCE_IRQ;
+
+       return platform_add_devices(landisk_devices,
+                                   ARRAY_SIZE(landisk_devices));
+}
+
+__initcall(landisk_devices_setup);
+
+static void __init landisk_setup(char **cmdline_p)
+{
+        /* LED ON */
+       ctrl_outb(ctrl_inb(PA_LED) | 0x03, PA_LED);
+
+       printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
+       pm_power_off = landisk_power_off;
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_landisk __initmv = {
+       .mv_name = "LANDISK",
+       .mv_nr_irqs = 72,
+       .mv_setup = landisk_setup,
+       .mv_init_irq = init_landisk_IRQ,
+};
diff --git a/arch/sh/boards/mach-lboxre2/Makefile b/arch/sh/boards/mach-lboxre2/Makefile
new file mode 100644 (file)
index 0000000..e9ed140
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the L-BOX RE2 specific parts of the kernel
+# Copyright (c) 2007 Nobuhiro Iwamatsu
+
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-lboxre2/irq.c b/arch/sh/boards/mach-lboxre2/irq.c
new file mode 100644 (file)
index 0000000..5a1c3bb
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * linux/arch/sh/boards/lboxre2/irq.c
+ *
+ * Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * NTT COMWARE L-BOX RE2 Support.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/lboxre2.h>
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_lboxre2_IRQ(void)
+{
+       make_imask_irq(IRQ_CF1);
+       make_imask_irq(IRQ_CF0);
+       make_imask_irq(IRQ_INTD);
+       make_imask_irq(IRQ_ETH1);
+       make_imask_irq(IRQ_ETH0);
+       make_imask_irq(IRQ_INTA);
+}
diff --git a/arch/sh/boards/mach-lboxre2/setup.c b/arch/sh/boards/mach-lboxre2/setup.c
new file mode 100644 (file)
index 0000000..c74440d
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * linux/arch/sh/boards/lbox/setup.c
+ *
+ * Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * NTT COMWARE L-BOX RE2 Support
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <asm/machvec.h>
+#include <asm/addrspace.h>
+#include <asm/lboxre2.h>
+#include <asm/io.h>
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = 0x1f0,
+               .end    = 0x1f0 + 8 ,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .start  = 0x1f0 + 0x206,
+               .end    = 0x1f0 +8 + 0x206 + 8,
+               .flags  = IORESOURCE_IO,
+       },
+       [2] = {
+               .start  = IRQ_CF0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct platform_device *lboxre2_devices[] __initdata = {
+       &cf_ide_device,
+};
+
+static int __init lboxre2_devices_setup(void)
+{
+       u32 cf0_io_base;        /* Boot CF base address */
+       pgprot_t prot;
+       unsigned long paddrbase, psize;
+
+       /* open I/O area window */
+       paddrbase = virt_to_phys((void*)PA_AREA5_IO);
+       psize = PAGE_SIZE;
+       prot = PAGE_KERNEL_PCC( 1 , _PAGE_PCC_IO16);
+       cf0_io_base = (u32)p3_ioremap(paddrbase, psize, prot.pgprot);
+       if (!cf0_io_base) {
+               printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );
+               return -ENOMEM;
+       }
+
+       cf_ide_resources[0].start += cf0_io_base ;
+       cf_ide_resources[0].end   += cf0_io_base ;
+       cf_ide_resources[1].start += cf0_io_base ;
+       cf_ide_resources[1].end   += cf0_io_base ;
+
+       return platform_add_devices(lboxre2_devices,
+                       ARRAY_SIZE(lboxre2_devices));
+
+}
+device_initcall(lboxre2_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_lboxre2 __initmv = {
+       .mv_name                = "L-BOX RE2",
+       .mv_nr_irqs             = 72,
+       .mv_init_irq            = init_lboxre2_IRQ,
+};
diff --git a/arch/sh/boards/mach-magicpanelr2/Kconfig b/arch/sh/boards/mach-magicpanelr2/Kconfig
new file mode 100644 (file)
index 0000000..b0abddc
--- /dev/null
@@ -0,0 +1,13 @@
+if SH_MAGIC_PANEL_R2
+
+menu "Magic Panel R2 options"
+
+config SH_MAGIC_PANEL_R2_VERSION
+       int SH_MAGIC_PANEL_R2_VERSION
+       default "3"
+       help
+         Set the version of the Magic Panel R2
+
+endmenu
+
+endif
diff --git a/arch/sh/boards/mach-magicpanelr2/Makefile b/arch/sh/boards/mach-magicpanelr2/Makefile
new file mode 100644 (file)
index 0000000..7a6d586
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the Magic Panel specific parts
+#
+
+obj-y   := setup.o
\ No newline at end of file
diff --git a/arch/sh/boards/mach-magicpanelr2/setup.c b/arch/sh/boards/mach-magicpanelr2/setup.c
new file mode 100644 (file)
index 0000000..f3b8b07
--- /dev/null
@@ -0,0 +1,394 @@
+/*
+ * linux/arch/sh/boards/magicpanel/setup.c
+ *
+ *  Copyright (C) 2007  Markus Brunner, Mark Jonas
+ *
+ *  Magic Panel Release 2 board setup
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/mtd/map.h>
+#include <asm/magicpanelr2.h>
+#include <asm/heartbeat.h>
+
+#define LAN9115_READY  (ctrl_inl(0xA8000084UL) & 0x00000001UL)
+
+/* Prefer cmdline over RedBoot */
+static const char *probes[] = { "cmdlinepart", "RedBoot", NULL };
+
+/* Wait until reset finished. Timeout is 100ms. */
+static int __init ethernet_reset_finished(void)
+{
+       int i;
+
+       if (LAN9115_READY)
+               return 1;
+
+       for (i = 0; i < 10; ++i) {
+               mdelay(10);
+               if (LAN9115_READY)
+                       return 1;
+       }
+
+       return 0;
+}
+
+static void __init reset_ethernet(void)
+{
+       /* PMDR: LAN_RESET=on */
+       CLRBITS_OUTB(0x10, PORT_PMDR);
+
+       udelay(200);
+
+       /* PMDR: LAN_RESET=off */
+       SETBITS_OUTB(0x10, PORT_PMDR);
+}
+
+static void __init setup_chip_select(void)
+{
+       /* CS2: LAN (0x08000000 - 0x0bffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x36db0400, CS2BCR);
+       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+       ctrl_outl(0x000003c0, CS2WCR);
+
+       /* CS4: CAN1 (0xb0000000 - 0xb3ffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x00000200, CS4BCR);
+       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+       ctrl_outl(0x00100981, CS4WCR);
+
+       /* CS5a: CAN2 (0xb4000000 - 0xb5ffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x00000200, CS5ABCR);
+       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+       ctrl_outl(0x00100981, CS5AWCR);
+
+       /* CS5b: CAN3 (0xb6000000 - 0xb7ffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x00000200, CS5BBCR);
+       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+       ctrl_outl(0x00100981, CS5BWCR);
+
+       /* CS6a: Rotary (0xb8000000 - 0xb9ffffff) */
+       /* no idle cycles, normal space, 8 bit data bus */
+       ctrl_outl(0x00000200, CS6ABCR);
+       /* (SW:1.5 WR:3 HW:1.5), no ext. wait */
+       ctrl_outl(0x001009C1, CS6AWCR);
+}
+
+static void __init setup_port_multiplexing(void)
+{
+       /* A7 GPO(LED8);     A6 GPO(LED7);     A5 GPO(LED6);      A4 GPO(LED5);
+        * A3 GPO(LED4);     A2 GPO(LED3);     A1 GPO(LED2);      A0 GPO(LED1);
+        */
+       ctrl_outw(0x5555, PORT_PACR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* B7 GPO(RST4);   B6 GPO(RST3);  B5 GPO(RST2);    B4 GPO(RST1);
+        * B3 GPO(PB3);    B2 GPO(PB2);   B1 GPO(PB1);     B0 GPO(PB0);
+        */
+       ctrl_outw(0x5555, PORT_PBCR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* C7 GPO(PC7);   C6 GPO(PC6);    C5 GPO(PC5);     C4 GPO(PC4);
+        * C3 LCD_DATA3;  C2 LCD_DATA2;   C1 LCD_DATA1;    C0 LCD_DATA0;
+        */
+       ctrl_outw(0x5500, PORT_PCCR);   /* 01 01 01 01 00 00 00 00 */
+
+       /* D7 GPO(PD7); D6 GPO(PD6);    D5 GPO(PD5);       D4 GPO(PD4);
+        * D3 GPO(PD3); D2 GPO(PD2);    D1 GPO(PD1);       D0 GPO(PD0);
+        */
+       ctrl_outw(0x5555, PORT_PDCR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* E7 (x);        E6 GPI(nu);    E5 GPI(nu);      E4 LCD_M_DISP;
+        * E3 LCD_CL1;    E2 LCD_CL2;    E1 LCD_DON;      E0 LCD_FLM;
+        */
+       ctrl_outw(0x3C00, PORT_PECR);   /* 00 11 11 00 00 00 00 00 */
+
+       /* F7 (x);           F6 DA1(VLCD);     F5 DA0(nc);        F4 AN3;
+        * F3 AN2(MID_AD);   F2 AN1(EARTH_AD); F1 AN0(TEMP);      F0 GPI+(nc);
+        */
+       ctrl_outw(0x0002, PORT_PFCR);   /* 00 00 00 00 00 00 00 10 */
+
+       /* G7 (x);        G6 IRQ5(TOUCH_BUSY); G5 IRQ4(TOUCH_IRQ); G4 GPI(KEY2);
+        * G3 GPI(KEY1);  G2 GPO(LED11);        G1 GPO(LED10);     G0 GPO(LED9);
+        */
+       ctrl_outw(0x03D5, PORT_PGCR);   /* 00 00 00 11 11 01 01 01 */
+
+       /* H7 (x);            H6 /RAS(BRAS);      H5 /CAS(BCAS); H4 CKE(BCKE);
+        * H3 GPO(EARTH_OFF); H2 GPO(EARTH_TEST); H1 USB2_PWR;   H0 USB1_PWR;
+        */
+       ctrl_outw(0x0050, PORT_PHCR);   /* 00 00 00 00 01 01 00 00 */
+
+       /* J7 (x);        J6 AUDCK;        J5 ASEBRKAK;     J4 AUDATA3;
+        * J3 AUDATA2;    J2 AUDATA1;      J1 AUDATA0;      J0 AUDSYNC;
+        */
+       ctrl_outw(0x0000, PORT_PJCR);   /* 00 00 00 00 00 00 00 00 */
+
+       /* K7 (x);          K6 (x);          K5 (x);       K4 (x);
+        * K3 PINT7(/PWR2); K2 PINT6(/PWR1); K1 PINT5(nu); K0 PINT4(FLASH_READY)
+        */
+       ctrl_outw(0x00FF, PORT_PKCR);   /* 00 00 00 00 11 11 11 11 */
+
+       /* L7 TRST;        L6 TMS;           L5 TDO;              L4 TDI;
+        * L3 TCK;         L2 (x);           L1 (x);              L0 (x);
+        */
+       ctrl_outw(0x0000, PORT_PLCR);   /* 00 00 00 00 00 00 00 00 */
+
+       /* M7 GPO(CURRENT_SINK);    M6 GPO(PWR_SWITCH);     M5 GPO(LAN_SPEED);
+        * M4 GPO(LAN_RESET);       M3 GPO(BUZZER);         M2 GPO(LCD_BL);
+        * M1 CS5B(CAN3_CS);        M0 GPI+(nc);
+        */
+       ctrl_outw(0x5552, PORT_PMCR);      /* 01 01 01 01 01 01 00 10 */
+
+       /* CURRENT_SINK=off,    PWR_SWITCH=off, LAN_SPEED=100MBit,
+        * LAN_RESET=off,       BUZZER=off,     LCD_BL=off
+        */
+#if CONFIG_SH_MAGIC_PANEL_R2_VERSION == 2
+       ctrl_outb(0x30, PORT_PMDR);
+#elif CONFIG_SH_MAGIC_PANEL_R2_VERSION == 3
+       ctrl_outb(0xF0, PORT_PMDR);
+#else
+#error Unknown revision of PLATFORM_MP_R2
+#endif
+
+       /* P7 (x);             P6 (x);            P5 (x);
+        * P4 GPO(nu);         P3 IRQ3(LAN_IRQ);  P2 IRQ2(CAN3_IRQ);
+        * P1 IRQ1(CAN2_IRQ);  P0 IRQ0(CAN1_IRQ)
+        */
+       ctrl_outw(0x0100, PORT_PPCR);   /* 00 00 00 01 00 00 00 00 */
+       ctrl_outb(0x10, PORT_PPDR);
+
+       /* R7 A25;           R6 A24;         R5 A23;              R4 A22;
+        * R3 A21;           R2 A20;         R1 A19;              R0 A0;
+        */
+       ctrl_outw(0x0000, PORT_PRCR);   /* 00 00 00 00 00 00 00 00 */
+
+       /* S7 (x);              S6 (x);        S5 (x);       S4 GPO(EEPROM_CS2);
+        * S3 GPO(EEPROM_CS1);  S2 SIOF0_TXD;  S1 SIOF0_RXD; S0 SIOF0_SCK;
+        */
+       ctrl_outw(0x0140, PORT_PSCR);   /* 00 00 00 01 01 00 00 00 */
+
+       /* T7 (x);         T6 (x);        T5 (x);         T4 COM1_CTS;
+        * T3 COM1_RTS;    T2 COM1_TXD;   T1 COM1_RXD;    T0 GPO(WDOG)
+        */
+       ctrl_outw(0x0001, PORT_PTCR);   /* 00 00 00 00 00 00 00 01 */
+
+       /* U7 (x);           U6 (x);       U5 (x);        U4 GPI+(/AC_FAULT);
+        * U3 GPO(TOUCH_CS); U2 TOUCH_TXD; U1 TOUCH_RXD;  U0 TOUCH_SCK;
+        */
+       ctrl_outw(0x0240, PORT_PUCR);   /* 00 00 00 10 01 00 00 00 */
+
+       /* V7 (x);        V6 (x);       V5 (x);           V4 GPO(MID2);
+        * V3 GPO(MID1);  V2 CARD_TxD;  V1 CARD_RxD;      V0 GPI+(/BAT_FAULT);
+        */
+       ctrl_outw(0x0142, PORT_PVCR);   /* 00 00 00 01 01 00 00 10 */
+}
+
+static void __init mpr2_setup(char **cmdline_p)
+{
+       __set_io_port_base(0xa0000000);
+
+       /* set Pin Select Register A:
+        * /PCC_CD1, /PCC_CD2,  PCC_BVD1, PCC_BVD2,
+        * /IOIS16,  IRQ4,      IRQ5,     USB1d_SUSPEND
+        */
+       ctrl_outw(0xAABC, PORT_PSELA);
+       /* set Pin Select Register B:
+        * /SCIF0_RTS, /SCIF0_CTS, LCD_VCPWC,
+        * LCD_VEPWC,  IIC_SDA,    IIC_SCL, Reserved
+        */
+       ctrl_outw(0x3C00, PORT_PSELB);
+       /* set Pin Select Register C:
+        * SIOF1_SCK, SIOF1_RxD, SCIF1_RxD, SCIF1_TxD, Reserved
+        */
+       ctrl_outw(0x0000, PORT_PSELC);
+       /* set Pin Select Register D: Reserved, SIOF1_TxD, Reserved, SIOF1_MCLK,
+        * Reserved, SIOF1_SYNC, Reserved, SCIF1_SCK, Reserved
+        */
+       ctrl_outw(0x0000, PORT_PSELD);
+       /* set USB TxRx Control: Reserved, DRV, Reserved, USB_TRANS, USB_SEL */
+       ctrl_outw(0x0101, PORT_UTRCTL);
+       /* set USB Clock Control: USSCS, USSTB, Reserved (HighByte always A5) */
+       ctrl_outw(0xA5C0, PORT_UCLKCR_W);
+
+       setup_chip_select();
+
+       setup_port_multiplexing();
+
+       reset_ethernet();
+
+       printk(KERN_INFO "Magic Panel Release 2 A.%i\n",
+                               CONFIG_SH_MAGIC_PANEL_R2_VERSION);
+
+       if (ethernet_reset_finished() == 0)
+               printk(KERN_WARNING "Ethernet not ready\n");
+}
+
+static struct resource smc911x_resources[] = {
+       [0] = {
+               .start          = 0xa8000000,
+               .end            = 0xabffffff,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 35,
+               .end            = 35,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc911x_device = {
+       .name           = "smc911x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(smc911x_resources),
+       .resource       = smc911x_resources,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct heartbeat_data heartbeat_data = {
+       .flags          = HEARTBEAT_INVERTED,
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct mtd_partition *parsed_partitions;
+
+static struct mtd_partition mpr2_partitions[] = {
+       /* Reserved for bootloader, read-only */
+       {
+               .name = "Bootloader",
+               .offset = 0x00000000UL,
+               .size = MPR2_MTD_BOOTLOADER_SIZE,
+               .mask_flags = MTD_WRITEABLE,
+       },
+       /* Reserved for kernel image */
+       {
+               .name = "Kernel",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size = MPR2_MTD_KERNEL_SIZE,
+       },
+       /* Rest is used for Flash FS */
+       {
+               .name = "Flash_FS",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size = MTDPART_SIZ_FULL,
+       }
+};
+
+static struct physmap_flash_data flash_data = {
+       .width          = 2,
+};
+
+static struct resource flash_resource = {
+       .start          = 0x00000000,
+       .end            = 0x2000000UL,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device flash_device = {
+       .name           = "physmap-flash",
+       .id             = -1,
+       .resource       = &flash_resource,
+       .num_resources  = 1,
+       .dev            = {
+               .platform_data = &flash_data,
+       },
+};
+
+static struct mtd_info *flash_mtd;
+
+static struct map_info mpr2_flash_map = {
+       .name = "Magic Panel R2 Flash",
+       .size = 0x2000000UL,
+       .bankwidth = 2,
+};
+
+static void __init set_mtd_partitions(void)
+{
+       int nr_parts = 0;
+
+       simple_map_init(&mpr2_flash_map);
+       flash_mtd = do_map_probe("cfi_probe", &mpr2_flash_map);
+       nr_parts = parse_mtd_partitions(flash_mtd, probes,
+                                       &parsed_partitions, 0);
+       /* If there is no partition table, used the hard coded table */
+       if (nr_parts <= 0) {
+               flash_data.parts = mpr2_partitions;
+               flash_data.nr_parts = ARRAY_SIZE(mpr2_partitions);
+       } else {
+               flash_data.nr_parts = nr_parts;
+               flash_data.parts = parsed_partitions;
+       }
+}
+
+/*
+ * Add all resources to the platform_device
+ */
+
+static struct platform_device *mpr2_devices[] __initdata = {
+       &heartbeat_device,
+       &smc911x_device,
+       &flash_device,
+};
+
+
+static int __init mpr2_devices_setup(void)
+{
+       set_mtd_partitions();
+       return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices));
+}
+device_initcall(mpr2_devices_setup);
+
+/*
+ * Initialize IRQ setting
+ */
+static void __init init_mpr2_IRQ(void)
+{
+       plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */
+
+       set_irq_type(32, IRQ_TYPE_LEVEL_LOW);    /* IRQ0 CAN1 */
+       set_irq_type(33, IRQ_TYPE_LEVEL_LOW);    /* IRQ1 CAN2 */
+       set_irq_type(34, IRQ_TYPE_LEVEL_LOW);    /* IRQ2 CAN3 */
+       set_irq_type(35, IRQ_TYPE_LEVEL_LOW);    /* IRQ3 SMSC9115 */
+       set_irq_type(36, IRQ_TYPE_EDGE_RISING);  /* IRQ4 touchscreen */
+       set_irq_type(37, IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */
+
+       intc_set_priority(32, 13);              /* IRQ0 CAN1 */
+       intc_set_priority(33, 13);              /* IRQ0 CAN2 */
+       intc_set_priority(34, 13);              /* IRQ0 CAN3 */
+       intc_set_priority(35, 6);               /* IRQ3 SMSC9115 */
+}
+
+/*
+ * The Machine Vector
+ */
+
+static struct sh_machine_vector mv_mpr2 __initmv = {
+       .mv_name                = "mpr2",
+       .mv_setup               = mpr2_setup,
+       .mv_init_irq            = init_mpr2_IRQ,
+};
diff --git a/arch/sh/boards/mach-microdev/Makefile b/arch/sh/boards/mach-microdev/Makefile
new file mode 100644 (file)
index 0000000..1387dd6
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# Makefile for the SuperH MicroDev specific parts of the kernel
+#
+
+obj-y   := setup.o irq.o io.o
+
+obj-$(CONFIG_HEARTBEAT)        += led.o
+
diff --git a/arch/sh/boards/mach-microdev/io.c b/arch/sh/boards/mach-microdev/io.c
new file mode 100644 (file)
index 0000000..9f8a540
--- /dev/null
@@ -0,0 +1,367 @@
+/*
+ * linux/arch/sh/boards/superh/microdev/io.c
+ *
+ * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
+ * Copyright (C) 2003, 2004 SuperH, Inc.
+ * Copyright (C) 2004 Paul Mundt
+ *
+ * SuperH SH4-202 MicroDev board support.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ */
+
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/wait.h>
+#include <asm/io.h>
+#include <asm/microdev.h>
+
+       /*
+        *      we need to have a 'safe' address to re-direct all I/O requests
+        *      that we do not explicitly wish to handle. This safe address
+        *      must have the following properies:
+        *
+        *              * writes are ignored (no exception)
+        *              * reads are benign (no side-effects)
+        *              * accesses of width 1, 2 and 4-bytes are all valid.
+        *
+        *      The Processor Version Register (PVR) has these properties.
+        */
+#define        PVR     0xff000030      /* Processor Version Register */
+
+
+#define        IO_IDE2_BASE            0x170ul /* I/O base for SMSC FDC37C93xAPM IDE #2 */
+#define        IO_IDE1_BASE            0x1f0ul /* I/O base for SMSC FDC37C93xAPM IDE #1 */
+#define IO_ISP1161_BASE                0x290ul /* I/O port for Philips ISP1161x USB chip */
+#define IO_SERIAL2_BASE                0x2f8ul /* I/O base for SMSC FDC37C93xAPM Serial #2 */
+#define        IO_LAN91C111_BASE       0x300ul /* I/O base for SMSC LAN91C111 Ethernet chip */
+#define        IO_IDE2_MISC            0x376ul /* I/O misc for SMSC FDC37C93xAPM IDE #2 */
+#define IO_SUPERIO_BASE                0x3f0ul /* I/O base for SMSC FDC37C93xAPM SuperIO chip */
+#define        IO_IDE1_MISC            0x3f6ul /* I/O misc for SMSC FDC37C93xAPM IDE #1 */
+#define IO_SERIAL1_BASE                0x3f8ul /* I/O base for SMSC FDC37C93xAPM Serial #1 */
+
+#define        IO_ISP1161_EXTENT       0x04ul  /* I/O extent for Philips ISP1161x USB chip */
+#define        IO_LAN91C111_EXTENT     0x10ul  /* I/O extent for SMSC LAN91C111 Ethernet chip */
+#define        IO_SUPERIO_EXTENT       0x02ul  /* I/O extent for SMSC FDC37C93xAPM SuperIO chip */
+#define        IO_IDE_EXTENT           0x08ul  /* I/O extent for IDE Task Register set */
+#define IO_SERIAL_EXTENT       0x10ul
+
+#define        IO_LAN91C111_PHYS       0xa7500000ul    /* Physical address of SMSC LAN91C111 Ethernet chip */
+#define        IO_ISP1161_PHYS         0xa7700000ul    /* Physical address of Philips ISP1161x USB chip */
+#define        IO_SUPERIO_PHYS         0xa7800000ul    /* Physical address of SMSC FDC37C93xAPM SuperIO chip */
+
+/*
+ * map I/O ports to memory-mapped addresses
+ */
+static unsigned long microdev_isa_port2addr(unsigned long offset)
+{
+       unsigned long result;
+
+       if ((offset >= IO_LAN91C111_BASE) &&
+           (offset <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
+                       /*
+                        *      SMSC LAN91C111 Ethernet chip
+                        */
+               result = IO_LAN91C111_PHYS + offset - IO_LAN91C111_BASE;
+       } else if ((offset >= IO_SUPERIO_BASE) &&
+                  (offset <  IO_SUPERIO_BASE + IO_SUPERIO_EXTENT)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      Configuration Registers
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+#if 0
+       } else if (offset == KBD_DATA_REG || offset == KBD_CNTL_REG ||
+                  offset == KBD_STATUS_REG) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      PS/2 Keyboard + Mouse (ports 0x60 and 0x64).
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+#endif
+       } else if (((offset >= IO_IDE1_BASE) &&
+                   (offset <  IO_IDE1_BASE + IO_IDE_EXTENT)) ||
+                   (offset == IO_IDE1_MISC)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      IDE #1
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+       } else if (((offset >= IO_IDE2_BASE) &&
+                   (offset <  IO_IDE2_BASE + IO_IDE_EXTENT)) ||
+                   (offset == IO_IDE2_MISC)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      IDE #2
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+       } else if ((offset >= IO_SERIAL1_BASE) &&
+                  (offset <  IO_SERIAL1_BASE + IO_SERIAL_EXTENT)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      Serial #1
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+       } else if ((offset >= IO_SERIAL2_BASE) &&
+                  (offset <  IO_SERIAL2_BASE + IO_SERIAL_EXTENT)) {
+                       /*
+                        *      SMSC FDC37C93xAPM SuperIO chip
+                        *
+                        *      Serial #2
+                        */
+               result = IO_SUPERIO_PHYS + (offset << 1);
+       } else if ((offset >= IO_ISP1161_BASE) &&
+                  (offset < IO_ISP1161_BASE + IO_ISP1161_EXTENT)) {
+                       /*
+                        *      Philips USB ISP1161x chip
+                        */
+               result = IO_ISP1161_PHYS + offset - IO_ISP1161_BASE;
+       } else {
+                       /*
+                        *      safe default.
+                        */
+               printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
+                      __func__, offset);
+               result = PVR;
+       }
+
+       return result;
+}
+
+#define PORT2ADDR(x) (microdev_isa_port2addr(x))
+
+static inline void delay(void)
+{
+#if defined(CONFIG_PCI)
+       /* System board present, just make a dummy SRAM access.  (CS0 will be
+          mapped to PCI memory, probably good to avoid it.) */
+       ctrl_inw(0xa6800000);
+#else
+       /* CS0 will be mapped to flash, ROM etc so safe to access it. */
+       ctrl_inw(0xa0000000);
+#endif
+}
+
+unsigned char microdev_inb(unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO)
+               return microdev_pci_inb(port);
+#endif
+       return *(volatile unsigned char*)PORT2ADDR(port);
+}
+
+unsigned short microdev_inw(unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO)
+               return microdev_pci_inw(port);
+#endif
+       return *(volatile unsigned short*)PORT2ADDR(port);
+}
+
+unsigned int microdev_inl(unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO)
+               return microdev_pci_inl(port);
+#endif
+       return *(volatile unsigned int*)PORT2ADDR(port);
+}
+
+void microdev_outw(unsigned short b, unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO) {
+               microdev_pci_outw(b, port);
+               return;
+       }
+#endif
+       *(volatile unsigned short*)PORT2ADDR(port) = b;
+}
+
+void microdev_outb(unsigned char b, unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO) {
+               microdev_pci_outb(b, port);
+               return;
+       }
+#endif
+
+       /*
+        *      There is a board feature with the current SH4-202 MicroDev in
+        *      that the 2 byte enables (nBE0 and nBE1) are tied together (and
+        *      to the Chip Select Line (Ethernet_CS)). Due to this connectivity,
+        *      it is not possible to safely perform 8-bit writes to the
+        *      Ethernet registers, as 16-bits will be consumed from the Data
+        *      lines (corrupting the other byte).  Hence, this function is
+        *      written to implement 16-bit read/modify/write for all byte-wide
+        *      accesses.
+        *
+        *      Note: there is no problem with byte READS (even or odd).
+        *
+        *                      Sean McGoogan - 16th June 2003.
+        */
+       if ((port >= IO_LAN91C111_BASE) &&
+           (port <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
+                       /*
+                        * Then are trying to perform a byte-write to the
+                        * LAN91C111.  This needs special care.
+                        */
+               if (port % 2 == 1) {    /* is the port odd ? */
+                       /* unset bit-0, i.e. make even */
+                       const unsigned long evenPort = port-1;
+                       unsigned short word;
+
+                       /*
+                        * do a 16-bit read/write to write to 'port',
+                        * preserving even byte.
+                        *
+                        *      Even addresses are bits 0-7
+                        *      Odd  addresses are bits 8-15
+                        */
+                       word = microdev_inw(evenPort);
+                       word = (word & 0xffu) | (b << 8);
+                       microdev_outw(word, evenPort);
+               } else {
+                       /* else, we are trying to do an even byte write */
+                       unsigned short word;
+
+                       /*
+                        * do a 16-bit read/write to write to 'port',
+                        * preserving odd byte.
+                        *
+                        *      Even addresses are bits 0-7
+                        *      Odd  addresses are bits 8-15
+                        */
+                       word = microdev_inw(port);
+                       word = (word & 0xff00u) | (b);
+                       microdev_outw(word, port);
+               }
+       } else {
+               *(volatile unsigned char*)PORT2ADDR(port) = b;
+       }
+}
+
+void microdev_outl(unsigned int b, unsigned long port)
+{
+#ifdef CONFIG_PCI
+       if (port >= PCIBIOS_MIN_IO) {
+               microdev_pci_outl(b, port);
+               return;
+       }
+#endif
+       *(volatile unsigned int*)PORT2ADDR(port) = b;
+}
+
+unsigned char microdev_inb_p(unsigned long port)
+{
+       unsigned char v = microdev_inb(port);
+       delay();
+       return v;
+}
+
+unsigned short microdev_inw_p(unsigned long port)
+{
+       unsigned short v = microdev_inw(port);
+       delay();
+       return v;
+}
+
+unsigned int microdev_inl_p(unsigned long port)
+{
+       unsigned int v = microdev_inl(port);
+       delay();
+       return v;
+}
+
+void microdev_outb_p(unsigned char b, unsigned long port)
+{
+       microdev_outb(b, port);
+       delay();
+}
+
+void microdev_outw_p(unsigned short b, unsigned long port)
+{
+       microdev_outw(b, port);
+       delay();
+}
+
+void microdev_outl_p(unsigned int b, unsigned long port)
+{
+       microdev_outl(b, port);
+       delay();
+}
+
+void microdev_insb(unsigned long port, void *buffer, unsigned long count)
+{
+       volatile unsigned char *port_addr;
+       unsigned char *buf = buffer;
+
+       port_addr = (volatile unsigned char *)PORT2ADDR(port);
+
+       while (count--)
+               *buf++ = *port_addr;
+}
+
+void microdev_insw(unsigned long port, void *buffer, unsigned long count)
+{
+       volatile unsigned short *port_addr;
+       unsigned short *buf = buffer;
+
+       port_addr = (volatile unsigned short *)PORT2ADDR(port);
+
+       while (count--)
+               *buf++ = *port_addr;
+}
+
+void microdev_insl(unsigned long port, void *buffer, unsigned long count)
+{
+       volatile unsigned long *port_addr;
+       unsigned int *buf = buffer;
+
+       port_addr = (volatile unsigned long *)PORT2ADDR(port);
+
+       while (count--)
+               *buf++ = *port_addr;
+}
+
+void microdev_outsb(unsigned long port, const void *buffer, unsigned long count)
+{
+       volatile unsigned char *port_addr;
+       const unsigned char *buf = buffer;
+
+       port_addr = (volatile unsigned char *)PORT2ADDR(port);
+
+       while (count--)
+               *port_addr = *buf++;
+}
+
+void microdev_outsw(unsigned long port, const void *buffer, unsigned long count)
+{
+       volatile unsigned short *port_addr;
+       const unsigned short *buf = buffer;
+
+       port_addr = (volatile unsigned short *)PORT2ADDR(port);
+
+       while (count--)
+               *port_addr = *buf++;
+}
+
+void microdev_outsl(unsigned long port, const void *buffer, unsigned long count)
+{
+       volatile unsigned long *port_addr;
+       const unsigned int *buf = buffer;
+
+       port_addr = (volatile unsigned long *)PORT2ADDR(port);
+
+       while (count--)
+               *port_addr = *buf++;
+}
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c
new file mode 100644 (file)
index 0000000..4d33507
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * arch/sh/boards/superh/microdev/irq.c
+ *
+ * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
+ *
+ * SuperH SH4-202 MicroDev board support.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/microdev.h>
+
+#define NUM_EXTERNAL_IRQS 16   /* IRL0 .. IRL15 */
+
+static const struct {
+       unsigned char fpgaIrq;
+       unsigned char mapped;
+       const char *name;
+} fpgaIrqTable[NUM_EXTERNAL_IRQS] = {
+       { 0,                            0,      "unused"   },           /* IRQ #0       IRL=15  0x200  */
+       { MICRODEV_FPGA_IRQ_KEYBOARD,   1,      "keyboard" },           /* IRQ #1       IRL=14  0x220  */
+       { MICRODEV_FPGA_IRQ_SERIAL1,    1,      "Serial #1"},           /* IRQ #2       IRL=13  0x240  */
+       { MICRODEV_FPGA_IRQ_ETHERNET,   1,      "Ethernet" },           /* IRQ #3       IRL=12  0x260  */
+       { MICRODEV_FPGA_IRQ_SERIAL2,    0,      "Serial #2"},           /* IRQ #4       IRL=11  0x280  */
+       { 0,                            0,      "unused"   },           /* IRQ #5       IRL=10  0x2a0  */
+       { 0,                            0,      "unused"   },           /* IRQ #6       IRL=9   0x2c0  */
+       { MICRODEV_FPGA_IRQ_USB_HC,     1,      "USB"      },           /* IRQ #7       IRL=8   0x2e0  */
+       { MICRODEV_IRQ_PCI_INTA,        1,      "PCI INTA" },           /* IRQ #8       IRL=7   0x300  */
+       { MICRODEV_IRQ_PCI_INTB,        1,      "PCI INTB" },           /* IRQ #9       IRL=6   0x320  */
+       { MICRODEV_IRQ_PCI_INTC,        1,      "PCI INTC" },           /* IRQ #10      IRL=5   0x340  */
+       { MICRODEV_IRQ_PCI_INTD,        1,      "PCI INTD" },           /* IRQ #11      IRL=4   0x360  */
+       { MICRODEV_FPGA_IRQ_MOUSE,      1,      "mouse"    },           /* IRQ #12      IRL=3   0x380  */
+       { MICRODEV_FPGA_IRQ_IDE2,       1,      "IDE #2"   },           /* IRQ #13      IRL=2   0x3a0  */
+       { MICRODEV_FPGA_IRQ_IDE1,       1,      "IDE #1"   },           /* IRQ #14      IRL=1   0x3c0  */
+       { 0,                            0,      "unused"   },           /* IRQ #15      IRL=0   0x3e0  */
+};
+
+#if (MICRODEV_LINUX_IRQ_KEYBOARD != 1)
+#  error Inconsistancy in defining the IRQ# for Keyboard!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_ETHERNET != 3)
+#  error Inconsistancy in defining the IRQ# for Ethernet!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_USB_HC != 7)
+#  error Inconsistancy in defining the IRQ# for USB!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_MOUSE != 12)
+#  error Inconsistancy in defining the IRQ# for PS/2 Mouse!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_IDE2 != 13)
+#  error Inconsistancy in defining the IRQ# for secondary IDE!
+#endif
+
+#if (MICRODEV_LINUX_IRQ_IDE1 != 14)
+#  error Inconsistancy in defining the IRQ# for primary IDE!
+#endif
+
+static void enable_microdev_irq(unsigned int irq);
+static void disable_microdev_irq(unsigned int irq);
+
+       /* shutdown is same as "disable" */
+#define shutdown_microdev_irq disable_microdev_irq
+
+static void mask_and_ack_microdev(unsigned int);
+static void end_microdev_irq(unsigned int irq);
+
+static unsigned int startup_microdev_irq(unsigned int irq)
+{
+       enable_microdev_irq(irq);
+       return 0;               /* never anything pending */
+}
+
+static struct hw_interrupt_type microdev_irq_type = {
+       .typename = "MicroDev-IRQ",
+       .startup = startup_microdev_irq,
+       .shutdown = shutdown_microdev_irq,
+       .enable = enable_microdev_irq,
+       .disable = disable_microdev_irq,
+       .ack = mask_and_ack_microdev,
+       .end = end_microdev_irq
+};
+
+static void disable_microdev_irq(unsigned int irq)
+{
+       unsigned int fpgaIrq;
+
+       if (irq >= NUM_EXTERNAL_IRQS)
+               return;
+       if (!fpgaIrqTable[irq].mapped)
+               return;
+
+       fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
+
+       /* disable interrupts on the FPGA INTC register */
+       ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG);
+}
+
+static void enable_microdev_irq(unsigned int irq)
+{
+       unsigned long priorityReg, priorities, pri;
+       unsigned int fpgaIrq;
+
+       if (unlikely(irq >= NUM_EXTERNAL_IRQS))
+               return;
+       if (unlikely(!fpgaIrqTable[irq].mapped))
+               return;
+
+       pri = 15 - irq;
+
+       fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
+       priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq);
+
+       /* set priority for the interrupt */
+       priorities = ctrl_inl(priorityReg);
+       priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq);
+       priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri);
+       ctrl_outl(priorities, priorityReg);
+
+       /* enable interrupts on the FPGA INTC register */
+       ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG);
+}
+
+       /* This functions sets the desired irq handler to be a MicroDev type */
+static void __init make_microdev_irq(unsigned int irq)
+{
+       disable_irq_nosync(irq);
+       irq_desc[irq].chip = &microdev_irq_type;
+       disable_microdev_irq(irq);
+}
+
+static void mask_and_ack_microdev(unsigned int irq)
+{
+       disable_microdev_irq(irq);
+}
+
+static void end_microdev_irq(unsigned int irq)
+{
+       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+               enable_microdev_irq(irq);
+}
+
+extern void __init init_microdev_irq(void)
+{
+       int i;
+
+               /* disable interrupts on the FPGA INTC register */
+       ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG);
+
+       for (i = 0; i < NUM_EXTERNAL_IRQS; i++)
+               make_microdev_irq(i);
+}
+
+extern void microdev_print_fpga_intc_status(void)
+{
+       volatile unsigned int * const intenb = (unsigned int*)MICRODEV_FPGA_INTENB_REG;
+       volatile unsigned int * const intdsb = (unsigned int*)MICRODEV_FPGA_INTDSB_REG;
+       volatile unsigned int * const intpria = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(0);
+       volatile unsigned int * const intprib = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(8);
+       volatile unsigned int * const intpric = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(16);
+       volatile unsigned int * const intprid = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(24);
+       volatile unsigned int * const intsrc = (unsigned int*)MICRODEV_FPGA_INTSRC_REG;
+       volatile unsigned int * const intreq = (unsigned int*)MICRODEV_FPGA_INTREQ_REG;
+
+       printk("-------------------------- microdev_print_fpga_intc_status() ------------------\n");
+       printk("FPGA_INTENB = 0x%08x\n", *intenb);
+       printk("FPGA_INTDSB = 0x%08x\n", *intdsb);
+       printk("FPGA_INTSRC = 0x%08x\n", *intsrc);
+       printk("FPGA_INTREQ = 0x%08x\n", *intreq);
+       printk("FPGA_INTPRI[3..0] = %08x:%08x:%08x:%08x\n", *intprid, *intpric, *intprib, *intpria);
+       printk("-------------------------------------------------------------------------------\n");
+}
+
+
diff --git a/arch/sh/boards/mach-microdev/led.c b/arch/sh/boards/mach-microdev/led.c
new file mode 100644 (file)
index 0000000..36e54b4
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * linux/arch/sh/boards/superh/microdev/led.c
+ *
+ * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
+ * Copyright (C) 2003 Richard Curnow (Richard.Curnow@superh.com)
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ */
+
+#include <asm/io.h>
+
+#define LED_REGISTER 0xa6104d20
+
+static void mach_led_d9(int value)
+{
+       unsigned long reg;
+       reg = ctrl_inl(LED_REGISTER);
+       reg &= ~1;
+       reg |= (value & 1);
+       ctrl_outl(reg, LED_REGISTER);
+       return;
+}
+
+static void mach_led_d10(int value)
+{
+       unsigned long reg;
+       reg = ctrl_inl(LED_REGISTER);
+       reg &= ~2;
+       reg |= ((value & 1) << 1);
+       ctrl_outl(reg, LED_REGISTER);
+       return;
+}
+
+
+#ifdef CONFIG_HEARTBEAT
+#include <linux/sched.h>
+
+static unsigned char banner_table[] = {
+       0x11, 0x01, 0x11, 0x01, 0x11, 0x03,
+       0x11, 0x01, 0x11, 0x01, 0x13, 0x03,
+       0x11, 0x01, 0x13, 0x01, 0x13, 0x01, 0x11, 0x03,
+       0x11, 0x03,
+       0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
+       0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x07,
+       0x13, 0x01, 0x13, 0x03,
+       0x11, 0x01, 0x11, 0x03,
+       0x13, 0x01, 0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
+       0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
+       0x13, 0x01, 0x13, 0x01, 0x13, 0x03,
+       0x13, 0x01, 0x11, 0x01, 0x11, 0x03,
+       0x11, 0x03,
+       0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x13, 0x07,
+       0xff
+};
+
+static void banner(void)
+{
+       static int pos = 0;
+       static int count = 0;
+
+       if (count) {
+               count--;
+       } else {
+               int val = banner_table[pos];
+               if (val == 0xff) {
+                       pos = 0;
+                       val = banner_table[pos];
+               }
+               pos++;
+               mach_led_d10((val >> 4) & 1);
+               count = 10 * (val & 0xf);
+       }
+}
+
+/* From heartbeat_harp in the stboards directory */
+/* acts like an actual heart beat -- ie thump-thump-pause... */
+void microdev_heartbeat(void)
+{
+       static unsigned cnt = 0, period = 0, dist = 0;
+
+       if (cnt == 0 || cnt == dist)
+               mach_led_d9(1);
+       else if (cnt == 7 || cnt == dist+7)
+               mach_led_d9(0);
+
+       if (++cnt > period) {
+               cnt = 0;
+               /* The hyperbolic function below modifies the heartbeat period
+                * length in dependency of the current (5min) load. It goes
+                * through the points f(0)=126, f(1)=86, f(5)=51,
+                * f(inf)->30. */
+               period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
+               dist = period / 4;
+       }
+
+       banner();
+}
+
+#endif
diff --git a/arch/sh/boards/mach-microdev/setup.c b/arch/sh/boards/mach-microdev/setup.c
new file mode 100644 (file)
index 0000000..fc8cd06
--- /dev/null
@@ -0,0 +1,405 @@
+/*
+ * arch/sh/boards/superh/microdev/setup.c
+ *
+ * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
+ * Copyright (C) 2003, 2004 SuperH, Inc.
+ * Copyright (C) 2004, 2005 Paul Mundt
+ *
+ * SuperH SH4-202 MicroDev board support.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ioport.h>
+#include <video/s1d13xxxfb.h>
+#include <asm/microdev.h>
+#include <asm/io.h>
+#include <asm/machvec.h>
+
+extern void microdev_heartbeat(void);
+
+
+/****************************************************************************/
+
+
+       /*
+        * Setup for the SMSC FDC37C93xAPM
+        */
+#define SMSC_CONFIG_PORT_ADDR   (0x3F0)
+#define SMSC_INDEX_PORT_ADDR    SMSC_CONFIG_PORT_ADDR
+#define SMSC_DATA_PORT_ADDR     (SMSC_INDEX_PORT_ADDR + 1)
+
+#define SMSC_ENTER_CONFIG_KEY   0x55
+#define SMSC_EXIT_CONFIG_KEY    0xaa
+
+#define SMCS_LOGICAL_DEV_INDEX          0x07   /* Logical Device Number */
+#define SMSC_DEVICE_ID_INDEX    0x20   /* Device ID */
+#define SMSC_DEVICE_REV_INDEX   0x21   /* Device Revision */
+#define SMSC_ACTIVATE_INDEX     0x30   /* Activate */
+#define SMSC_PRIMARY_BASE_INDEX         0x60   /* Primary Base Address */
+#define SMSC_SECONDARY_BASE_INDEX 0x62 /* Secondary Base Address */
+#define SMSC_PRIMARY_INT_INDEX  0x70   /* Primary Interrupt Select */
+#define SMSC_SECONDARY_INT_INDEX 0x72  /* Secondary Interrupt Select */
+#define SMSC_HDCS0_INDEX        0xf0   /* HDCS0 Address Decoder */
+#define SMSC_HDCS1_INDEX        0xf1   /* HDCS1 Address Decoder */
+
+#define SMSC_IDE1_DEVICE       1       /* IDE #1 logical device */
+#define SMSC_IDE2_DEVICE       2       /* IDE #2 logical device */
+#define SMSC_PARALLEL_DEVICE   3       /* Parallel Port logical device */
+#define SMSC_SERIAL1_DEVICE    4       /* Serial #1 logical device */
+#define SMSC_SERIAL2_DEVICE    5       /* Serial #2 logical device */
+#define SMSC_KEYBOARD_DEVICE   7       /* Keyboard logical device */
+#define SMSC_CONFIG_REGISTERS  8       /* Configuration Registers (Aux I/O) */
+
+#define SMSC_READ_INDEXED(index) ({ \
+       outb((index), SMSC_INDEX_PORT_ADDR); \
+       inb(SMSC_DATA_PORT_ADDR); })
+#define SMSC_WRITE_INDEXED(val, index) ({ \
+       outb((index), SMSC_INDEX_PORT_ADDR); \
+       outb((val),   SMSC_DATA_PORT_ADDR); })
+
+#define        IDE1_PRIMARY_BASE       0x01f0  /* Task File Registe base for IDE #1 */
+#define        IDE1_SECONDARY_BASE     0x03f6  /* Miscellaneous AT registers for IDE #1 */
+#define        IDE2_PRIMARY_BASE       0x0170  /* Task File Registe base for IDE #2 */
+#define        IDE2_SECONDARY_BASE     0x0376  /* Miscellaneous AT registers for IDE #2 */
+
+#define SERIAL1_PRIMARY_BASE   0x03f8
+#define SERIAL2_PRIMARY_BASE   0x02f8
+
+#define        MSB(x)          ( (x) >> 8 )
+#define        LSB(x)          ( (x) & 0xff )
+
+       /* General-Purpose base address on CPU-board FPGA */
+#define        MICRODEV_FPGA_GP_BASE           0xa6100000ul
+
+       /* assume a Keyboard Controller is present */
+int microdev_kbd_controller_present = 1;
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .start          = 0x300,
+               .end            = 0x300 + 0x0001000 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = MICRODEV_LINUX_IRQ_ETHERNET,
+               .end            = MICRODEV_LINUX_IRQ_ETHERNET,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+       .resource       = smc91x_resources,
+};
+
+#ifdef CONFIG_FB_S1D13XXX
+static struct s1d13xxxfb_regval s1d13806_initregs[] = {
+       { S1DREG_MISC,                  0x00 },
+       { S1DREG_COM_DISP_MODE,         0x00 },
+       { S1DREG_GPIO_CNF0,             0x00 },
+       { S1DREG_GPIO_CNF1,             0x00 },
+       { S1DREG_GPIO_CTL0,             0x00 },
+       { S1DREG_GPIO_CTL1,             0x00 },
+       { S1DREG_CLK_CNF,               0x02 },
+       { S1DREG_LCD_CLK_CNF,           0x01 },
+       { S1DREG_CRT_CLK_CNF,           0x03 },
+       { S1DREG_MPLUG_CLK_CNF,         0x03 },
+       { S1DREG_CPU2MEM_WST_SEL,       0x02 },
+       { S1DREG_SDRAM_REF_RATE,        0x03 },
+       { S1DREG_SDRAM_TC0,             0x00 },
+       { S1DREG_SDRAM_TC1,             0x01 },
+       { S1DREG_MEM_CNF,               0x80 },
+       { S1DREG_PANEL_TYPE,            0x25 },
+       { S1DREG_MOD_RATE,              0x00 },
+       { S1DREG_LCD_DISP_HWIDTH,       0x63 },
+       { S1DREG_LCD_NDISP_HPER,        0x1e },
+       { S1DREG_TFT_FPLINE_START,      0x06 },
+       { S1DREG_TFT_FPLINE_PWIDTH,     0x03 },
+       { S1DREG_LCD_DISP_VHEIGHT0,     0x57 },
+       { S1DREG_LCD_DISP_VHEIGHT1,     0x02 },
+       { S1DREG_LCD_NDISP_VPER,        0x00 },
+       { S1DREG_TFT_FPFRAME_START,     0x0a },
+       { S1DREG_TFT_FPFRAME_PWIDTH,    0x81 },
+       { S1DREG_LCD_DISP_MODE,         0x03 },
+       { S1DREG_LCD_MISC,              0x00 },
+       { S1DREG_LCD_DISP_START0,       0x00 },
+       { S1DREG_LCD_DISP_START1,       0x00 },
+       { S1DREG_LCD_DISP_START2,       0x00 },
+       { S1DREG_LCD_MEM_OFF0,          0x90 },
+       { S1DREG_LCD_MEM_OFF1,          0x01 },
+       { S1DREG_LCD_PIX_PAN,           0x00 },
+       { S1DREG_LCD_DISP_FIFO_HTC,     0x00 },
+       { S1DREG_LCD_DISP_FIFO_LTC,     0x00 },
+       { S1DREG_CRT_DISP_HWIDTH,       0x63 },
+       { S1DREG_CRT_NDISP_HPER,        0x1f },
+       { S1DREG_CRT_HRTC_START,        0x04 },
+       { S1DREG_CRT_HRTC_PWIDTH,       0x8f },
+       { S1DREG_CRT_DISP_VHEIGHT0,     0x57 },
+       { S1DREG_CRT_DISP_VHEIGHT1,     0x02 },
+       { S1DREG_CRT_NDISP_VPER,        0x1b },
+       { S1DREG_CRT_VRTC_START,        0x00 },
+       { S1DREG_CRT_VRTC_PWIDTH,       0x83 },
+       { S1DREG_TV_OUT_CTL,            0x10 },
+       { S1DREG_CRT_DISP_MODE,         0x05 },
+       { S1DREG_CRT_DISP_START0,       0x00 },
+       { S1DREG_CRT_DISP_START1,       0x00 },
+       { S1DREG_CRT_DISP_START2,       0x00 },
+       { S1DREG_CRT_MEM_OFF0,          0x20 },
+       { S1DREG_CRT_MEM_OFF1,          0x03 },
+       { S1DREG_CRT_PIX_PAN,           0x00 },
+       { S1DREG_CRT_DISP_FIFO_HTC,     0x00 },
+       { S1DREG_CRT_DISP_FIFO_LTC,     0x00 },
+       { S1DREG_LCD_CUR_CTL,           0x00 },
+       { S1DREG_LCD_CUR_START,         0x01 },
+       { S1DREG_LCD_CUR_XPOS0,         0x00 },
+       { S1DREG_LCD_CUR_XPOS1,         0x00 },
+       { S1DREG_LCD_CUR_YPOS0,         0x00 },
+       { S1DREG_LCD_CUR_YPOS1,         0x00 },
+       { S1DREG_LCD_CUR_BCTL0,         0x00 },
+       { S1DREG_LCD_CUR_GCTL0,         0x00 },
+       { S1DREG_LCD_CUR_RCTL0,         0x00 },
+       { S1DREG_LCD_CUR_BCTL1,         0x1f },
+       { S1DREG_LCD_CUR_GCTL1,         0x3f },
+       { S1DREG_LCD_CUR_RCTL1,         0x1f },
+       { S1DREG_LCD_CUR_FIFO_HTC,      0x00 },
+       { S1DREG_CRT_CUR_CTL,           0x00 },
+       { S1DREG_CRT_CUR_START,         0x01 },
+       { S1DREG_CRT_CUR_XPOS0,         0x00 },
+       { S1DREG_CRT_CUR_XPOS1,         0x00 },
+       { S1DREG_CRT_CUR_YPOS0,         0x00 },
+       { S1DREG_CRT_CUR_YPOS1,         0x00 },
+       { S1DREG_CRT_CUR_BCTL0,         0x00 },
+       { S1DREG_CRT_CUR_GCTL0,         0x00 },
+       { S1DREG_CRT_CUR_RCTL0,         0x00 },
+       { S1DREG_CRT_CUR_BCTL1,         0x1f },
+       { S1DREG_CRT_CUR_GCTL1,         0x3f },
+       { S1DREG_CRT_CUR_RCTL1,         0x1f },
+       { S1DREG_CRT_CUR_FIFO_HTC,      0x00 },
+       { S1DREG_BBLT_CTL0,             0x00 },
+       { S1DREG_BBLT_CTL1,             0x00 },
+       { S1DREG_BBLT_CC_EXP,           0x00 },
+       { S1DREG_BBLT_OP,               0x00 },
+       { S1DREG_BBLT_SRC_START0,       0x00 },
+       { S1DREG_BBLT_SRC_START1,       0x00 },
+       { S1DREG_BBLT_SRC_START2,       0x00 },
+       { S1DREG_BBLT_DST_START0,       0x00 },
+       { S1DREG_BBLT_DST_START1,       0x00 },
+       { S1DREG_BBLT_DST_START2,       0x00 },
+       { S1DREG_BBLT_MEM_OFF0,         0x00 },
+       { S1DREG_BBLT_MEM_OFF1,         0x00 },
+       { S1DREG_BBLT_WIDTH0,           0x00 },
+       { S1DREG_BBLT_WIDTH1,           0x00 },
+       { S1DREG_BBLT_HEIGHT0,          0x00 },
+       { S1DREG_BBLT_HEIGHT1,          0x00 },
+       { S1DREG_BBLT_BGC0,             0x00 },
+       { S1DREG_BBLT_BGC1,             0x00 },
+       { S1DREG_BBLT_FGC0,             0x00 },
+       { S1DREG_BBLT_FGC1,             0x00 },
+       { S1DREG_LKUP_MODE,             0x00 },
+       { S1DREG_LKUP_ADDR,             0x00 },
+       { S1DREG_PS_CNF,                0x10 },
+       { S1DREG_PS_STATUS,             0x00 },
+       { S1DREG_CPU2MEM_WDOGT,         0x00 },
+       { S1DREG_COM_DISP_MODE,         0x02 },
+};
+
+static struct s1d13xxxfb_pdata s1d13806_platform_data = {
+       .initregs       = s1d13806_initregs,
+       .initregssize   = ARRAY_SIZE(s1d13806_initregs),
+};
+
+static struct resource s1d13806_resources[] = {
+       [0] = {
+               .start          = 0x07200000,
+               .end            = 0x07200000 + 0x00200000 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 0x07000000,
+               .end            = 0x07000000 + 0x00200000 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device s1d13806_device = {
+       .name           = "s1d13806fb",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(s1d13806_resources),
+       .resource       = s1d13806_resources,
+
+       .dev = {
+               .platform_data  = &s1d13806_platform_data,
+       },
+};
+#endif
+
+static struct platform_device *microdev_devices[] __initdata = {
+       &smc91x_device,
+#ifdef CONFIG_FB_S1D13XXX
+       &s1d13806_device,
+#endif
+};
+
+static int __init microdev_devices_setup(void)
+{
+       return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices));
+}
+
+/*
+ * Setup for the SMSC FDC37C93xAPM
+ */
+static int __init smsc_superio_setup(void)
+{
+
+       unsigned char devid, devrev;
+
+               /* Initially the chip is in run state */
+               /* Put it into configuration state */
+       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+
+               /* Read device ID info */
+       devid  = SMSC_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
+       devrev = SMSC_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
+       if ( (devid==0x30) && (devrev==0x01) )
+       {
+               printk("SMSC FDC37C93xAPM SuperIO device detected\n");
+       }
+       else
+       {               /* not the device identity we expected */
+               printk("Not detected a SMSC FDC37C93xAPM SuperIO device (devid=0x%02x, rev=0x%02x)\n",
+                       devid, devrev);
+                       /* inform the keyboard driver that we have no keyboard controller */
+               microdev_kbd_controller_present = 0;
+                       /* little point in doing anything else in this functon */
+               return 0;
+       }
+
+               /* Select the keyboard device */
+       SMSC_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* enable the interrupts */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_KEYBOARD, SMSC_PRIMARY_INT_INDEX);
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_MOUSE, SMSC_SECONDARY_INT_INDEX);
+
+               /* Select the Serial #1 device */
+       SMSC_WRITE_INDEXED(SMSC_SERIAL1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* program with port addresses */
+       SMSC_WRITE_INDEXED(MSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
+               /* enable the interrupts */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL1, SMSC_PRIMARY_INT_INDEX);
+
+               /* Select the Serial #2 device */
+       SMSC_WRITE_INDEXED(SMSC_SERIAL2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* program with port addresses */
+       SMSC_WRITE_INDEXED(MSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
+               /* enable the interrupts */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL2, SMSC_PRIMARY_INT_INDEX);
+
+               /* Select the IDE#1 device */
+       SMSC_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* program with port addresses */
+       SMSC_WRITE_INDEXED(MSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(MSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(0x0c, SMSC_HDCS0_INDEX);
+       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS1_INDEX);
+               /* select the interrupt */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE1, SMSC_PRIMARY_INT_INDEX);
+
+               /* Select the IDE#2 device */
+       SMSC_WRITE_INDEXED(SMSC_IDE2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
+               /* enable it */
+       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
+               /* program with port addresses */
+       SMSC_WRITE_INDEXED(MSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
+       SMSC_WRITE_INDEXED(MSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
+       SMSC_WRITE_INDEXED(LSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
+               /* select the interrupt */
+       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE2, SMSC_PRIMARY_INT_INDEX);
+
+               /* Select the configuration registers */
+       SMSC_WRITE_INDEXED(SMSC_CONFIG_REGISTERS, SMCS_LOGICAL_DEV_INDEX);
+               /* enable the appropriate GPIO pins for IDE functionality:
+                * bit[0]   In/Out              1==input;  0==output
+                * bit[1]   Polarity            1==invert; 0==no invert
+                * bit[2]   Int Enb #1          1==Enable Combined IRQ #1; 0==disable
+                * bit[3:4] Function Select     00==original; 01==Alternate Function #1
+                */
+       SMSC_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
+       SMSC_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
+       SMSC_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
+       SMSC_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
+       SMSC_WRITE_INDEXED(0x08, 0xe8); /* GP20 = nIDE2_OE */
+
+               /* Exit the configuration state */
+       outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
+
+       return 0;
+}
+
+static void __init microdev_setup(char **cmdline_p)
+{
+       int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul);
+       const int fpgaRevision = *fpgaRevisionRegister;
+       int * const CacheControlRegister = (int*)CCR;
+
+       device_initcall(microdev_devices_setup);
+       device_initcall(smsc_superio_setup);
+
+       printk("SuperH %s board (FPGA rev: 0x%0x, CCR: 0x%0x)\n",
+               get_system_type(), fpgaRevision, *CacheControlRegister);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_sh4202_microdev __initmv = {
+       .mv_name                = "SH4-202 MicroDev",
+       .mv_setup               = microdev_setup,
+       .mv_nr_irqs             = 72,           /* QQQ need to check this - use the MACRO */
+
+       .mv_inb                 = microdev_inb,
+       .mv_inw                 = microdev_inw,
+       .mv_inl                 = microdev_inl,
+       .mv_outb                = microdev_outb,
+       .mv_outw                = microdev_outw,
+       .mv_outl                = microdev_outl,
+
+       .mv_inb_p               = microdev_inb_p,
+       .mv_inw_p               = microdev_inw_p,
+       .mv_inl_p               = microdev_inl_p,
+       .mv_outb_p              = microdev_outb_p,
+       .mv_outw_p              = microdev_outw_p,
+       .mv_outl_p              = microdev_outl_p,
+
+       .mv_insb                = microdev_insb,
+       .mv_insw                = microdev_insw,
+       .mv_insl                = microdev_insl,
+       .mv_outsb               = microdev_outsb,
+       .mv_outsw               = microdev_outsw,
+       .mv_outsl               = microdev_outsl,
+
+       .mv_init_irq            = init_microdev_irq,
+
+#ifdef CONFIG_HEARTBEAT
+       .mv_heartbeat           = microdev_heartbeat,
+#endif
+};
diff --git a/arch/sh/boards/mach-migor/Kconfig b/arch/sh/boards/mach-migor/Kconfig
new file mode 100644 (file)
index 0000000..a7b3b72
--- /dev/null
@@ -0,0 +1,15 @@
+if SH_MIGOR
+
+choice
+       prompt "Migo-R LCD Panel Board Selection"
+       default SH_MIGOR_QVGA
+
+config SH_MIGOR_QVGA
+       bool "QVGA (320x240)"
+
+config SH_MIGOR_RTA_WVGA
+       bool "RTA WVGA (800x480)"
+
+endchoice
+
+endif
diff --git a/arch/sh/boards/mach-migor/Makefile b/arch/sh/boards/mach-migor/Makefile
new file mode 100644 (file)
index 0000000..5f231dd
--- /dev/null
@@ -0,0 +1,2 @@
+obj-y   := setup.o
+obj-$(CONFIG_SH_MIGOR_QVGA)    +=  lcd_qvga.o
diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c
new file mode 100644 (file)
index 0000000..6e96095
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Support for SuperH MigoR Quarter VGA LCD Panel
+ *
+ * Copyright (C) 2008 Magnus Damm
+ *
+ * Based on lcd_powertip.c from Kenati Technologies Pvt Ltd.
+ * Copyright (c) 2007 Ujjwal Pande <ujjwal@kenati.com>,
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <asm/sh_mobile_lcdc.h>
+#include <asm/migor.h>
+
+/* LCD Module is a PH240320T according to board schematics. This module
+ * is made up of a 240x320 LCD hooked up to a R61505U (or HX8347-A01?)
+ * Driver IC. This IC is connected to the SH7722 built-in LCDC using a
+ * SYS-80 interface configured in 16 bit mode.
+ *
+ * Index 0: "Device Code Read" returns 0x1505.
+ */
+
+static void reset_lcd_module(void)
+{
+       ctrl_outb(ctrl_inb(PORT_PHDR) & ~0x04, PORT_PHDR);
+       mdelay(2);
+       ctrl_outb(ctrl_inb(PORT_PHDR) | 0x04, PORT_PHDR);
+       mdelay(1);
+}
+
+/* DB0-DB7 are connected to D1-D8, and DB8-DB15 to D10-D17 */
+
+static unsigned long adjust_reg18(unsigned short data)
+{
+       unsigned long tmp1, tmp2;
+
+       tmp1 = (data<<1 | 0x00000001) & 0x000001FF;
+       tmp2 = (data<<2 | 0x00000200) & 0x0003FE00;
+       return tmp1 | tmp2;
+}
+
+static void write_reg(void *sys_ops_handle,
+                      struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
+                      unsigned short reg, unsigned short data)
+{
+       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg << 8 | data));
+}
+
+static void write_reg16(void *sys_ops_handle,
+                       struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
+                       unsigned short reg, unsigned short data)
+{
+       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
+       sys_ops->write_data(sys_ops_handle, adjust_reg18(data));
+}
+
+static unsigned long read_reg16(void *sys_ops_handle,
+                               struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
+                               unsigned short reg)
+{
+       unsigned long data;
+
+       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
+       data = sys_ops->read_data(sys_ops_handle);
+       return ((data >> 1) & 0xff) | ((data >> 2) & 0xff00);
+}
+
+static void migor_lcd_qvga_seq(void *sys_ops_handle,
+                              struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
+                              unsigned short const *data, int no_data)
+{
+       int i;
+
+       for (i = 0; i < no_data; i += 2)
+               write_reg16(sys_ops_handle, sys_ops, data[i], data[i + 1]);
+}
+
+static const unsigned short sync_data[] = {
+       0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+};
+
+static const unsigned short magic0_data[] = {
+       0x0060, 0x2700, 0x0008, 0x0808, 0x0090, 0x001A, 0x0007, 0x0001,
+       0x0017, 0x0001, 0x0019, 0x0000, 0x0010, 0x17B0, 0x0011, 0x0116,
+       0x0012, 0x0198, 0x0013, 0x1400, 0x0029, 0x000C, 0x0012, 0x01B8,
+};
+
+static const unsigned short magic1_data[] = {
+       0x0030, 0x0307, 0x0031, 0x0303, 0x0032, 0x0603, 0x0033, 0x0202,
+       0x0034, 0x0202, 0x0035, 0x0202, 0x0036, 0x1F1F, 0x0037, 0x0303,
+       0x0038, 0x0303, 0x0039, 0x0603, 0x003A, 0x0202, 0x003B, 0x0102,
+       0x003C, 0x0204, 0x003D, 0x0000, 0x0001, 0x0100, 0x0002, 0x0300,
+       0x0003, 0x5028, 0x0020, 0x00ef, 0x0021, 0x0000, 0x0004, 0x0000,
+       0x0009, 0x0000, 0x000A, 0x0008, 0x000C, 0x0000, 0x000D, 0x0000,
+       0x0015, 0x8000,
+};
+
+static const unsigned short magic2_data[] = {
+       0x0061, 0x0001, 0x0092, 0x0100, 0x0093, 0x0001, 0x0007, 0x0021,
+};
+
+static const unsigned short magic3_data[] = {
+       0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
+};
+
+int migor_lcd_qvga_setup(void *board_data, void *sohandle,
+                        struct sh_mobile_lcdc_sys_bus_ops *so)
+{
+       unsigned long xres = 320;
+       unsigned long yres = 240;
+       int k;
+
+       reset_lcd_module();
+       migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
+
+       if (read_reg16(sohandle, so, 0) != 0x1505)
+               return -ENODEV;
+
+       pr_info("Migo-R QVGA LCD Module detected.\n");
+
+       migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
+       write_reg16(sohandle, so, 0x00A4, 0x0001);
+       mdelay(10);
+
+       migor_lcd_qvga_seq(sohandle, so, magic0_data, ARRAY_SIZE(magic0_data));
+       mdelay(100);
+
+       migor_lcd_qvga_seq(sohandle, so, magic1_data, ARRAY_SIZE(magic1_data));
+       write_reg16(sohandle, so, 0x0050, 0xef - (yres - 1));
+       write_reg16(sohandle, so, 0x0051, 0x00ef);
+       write_reg16(sohandle, so, 0x0052, 0x0000);
+       write_reg16(sohandle, so, 0x0053, xres - 1);
+
+       migor_lcd_qvga_seq(sohandle, so, magic2_data, ARRAY_SIZE(magic2_data));
+       mdelay(10);
+
+       migor_lcd_qvga_seq(sohandle, so, magic3_data, ARRAY_SIZE(magic3_data));
+       mdelay(40);
+
+       /* clear GRAM to avoid displaying garbage */
+
+       write_reg16(sohandle, so, 0x0020, 0x0000); /* horiz addr */
+       write_reg16(sohandle, so, 0x0021, 0x0000); /* vert addr */
+
+       for (k = 0; k < (xres * 256); k++) /* yes, 256 words per line */
+               write_reg16(sohandle, so, 0x0022, 0x0000);
+
+       write_reg16(sohandle, so, 0x0020, 0x0000); /* reset horiz addr */
+       write_reg16(sohandle, so, 0x0021, 0x0000); /* reset vert addr */
+       write_reg16(sohandle, so, 0x0007, 0x0173);
+       mdelay(40);
+
+       /* enable display */
+       write_reg(sohandle, so, 0x00, 0x22);
+       mdelay(100);
+       return 0;
+}
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
new file mode 100644 (file)
index 0000000..7bd365a
--- /dev/null
@@ -0,0 +1,523 @@
+/*
+ * Renesas System Solutions Asia Pte. Ltd - Migo-R
+ *
+ * Copyright (C) 2008 Magnus Damm
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/mtd/physmap.h>
+#include <linux/mtd/nand.h>
+#include <linux/i2c.h>
+#include <linux/smc91x.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+#include <media/soc_camera_platform.h>
+#include <media/sh_mobile_ceu.h>
+#include <asm/clock.h>
+#include <asm/machvec.h>
+#include <asm/io.h>
+#include <asm/sh_keysc.h>
+#include <asm/sh_mobile_lcdc.h>
+#include <asm/migor.h>
+
+/* Address     IRQ  Size  Bus  Description
+ * 0x00000000       64MB  16   NOR Flash (SP29PL256N)
+ * 0x0c000000       64MB  64   SDRAM (2xK4M563233G)
+ * 0x10000000  IRQ0       16   Ethernet (SMC91C111)
+ * 0x14000000  IRQ4       16   USB 2.0 Host Controller (M66596)
+ * 0x18000000       8GB    8   NAND Flash (K9K8G08U0A)
+ */
+
+static struct smc91x_platdata smc91x_info = {
+       .flags = SMC91X_USE_16BIT,
+};
+
+static struct resource smc91x_eth_resources[] = {
+       [0] = {
+               .name   = "SMC91C111" ,
+               .start  = 0x10000300,
+               .end    = 0x1000030f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 32, /* IRQ0 */
+               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       },
+};
+
+static struct platform_device smc91x_eth_device = {
+       .name           = "smc91x",
+       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
+       .resource       = smc91x_eth_resources,
+       .dev    = {
+               .platform_data  = &smc91x_info,
+       },
+};
+
+static struct sh_keysc_info sh_keysc_info = {
+       .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
+       .scan_timing = 3,
+       .delay = 5,
+       .keycodes = {
+               0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
+               0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
+               0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
+               0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
+               0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
+       },
+};
+
+static struct resource sh_keysc_resources[] = {
+       [0] = {
+               .start  = 0x044b0000,
+               .end    = 0x044b000f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 79,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_keysc_device = {
+       .name           = "sh_keysc",
+       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
+       .resource       = sh_keysc_resources,
+       .dev    = {
+               .platform_data  = &sh_keysc_info,
+       },
+};
+
+static struct mtd_partition migor_nor_flash_partitions[] =
+{
+       {
+               .name = "uboot",
+               .offset = 0,
+               .size = (1 * 1024 * 1024),
+               .mask_flags = MTD_WRITEABLE,    /* Read-only */
+       },
+       {
+               .name = "rootfs",
+               .offset = MTDPART_OFS_APPEND,
+               .size = (15 * 1024 * 1024),
+       },
+       {
+               .name = "other",
+               .offset = MTDPART_OFS_APPEND,
+               .size = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data migor_nor_flash_data = {
+       .width          = 2,
+       .parts          = migor_nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(migor_nor_flash_partitions),
+};
+
+static struct resource migor_nor_flash_resources[] = {
+       [0] = {
+               .name           = "NOR Flash",
+               .start          = 0x00000000,
+               .end            = 0x03ffffff,
+               .flags          = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device migor_nor_flash_device = {
+       .name           = "physmap-flash",
+       .resource       = migor_nor_flash_resources,
+       .num_resources  = ARRAY_SIZE(migor_nor_flash_resources),
+       .dev            = {
+               .platform_data = &migor_nor_flash_data,
+       },
+};
+
+static struct mtd_partition migor_nand_flash_partitions[] = {
+       {
+               .name           = "nanddata1",
+               .offset         = 0x0,
+               .size           = 512 * 1024 * 1024,
+       },
+       {
+               .name           = "nanddata2",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 512 * 1024 * 1024,
+       },
+};
+
+static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd,
+                                    unsigned int ctrl)
+{
+       struct nand_chip *chip = mtd->priv;
+
+       if (cmd == NAND_CMD_NONE)
+               return;
+
+       if (ctrl & NAND_CLE)
+               writeb(cmd, chip->IO_ADDR_W + 0x00400000);
+       else if (ctrl & NAND_ALE)
+               writeb(cmd, chip->IO_ADDR_W + 0x00800000);
+       else
+               writeb(cmd, chip->IO_ADDR_W);
+}
+
+static int migor_nand_flash_ready(struct mtd_info *mtd)
+{
+       return ctrl_inb(PORT_PADR) & 0x02; /* PTA1 */
+}
+
+struct platform_nand_data migor_nand_flash_data = {
+       .chip = {
+               .nr_chips = 1,
+               .partitions = migor_nand_flash_partitions,
+               .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
+               .chip_delay = 20,
+               .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
+       },
+       .ctrl = {
+               .dev_ready = migor_nand_flash_ready,
+               .cmd_ctrl = migor_nand_flash_cmd_ctl,
+       },
+};
+
+static struct resource migor_nand_flash_resources[] = {
+       [0] = {
+               .name           = "NAND Flash",
+               .start          = 0x18000000,
+               .end            = 0x18ffffff,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device migor_nand_flash_device = {
+       .name           = "gen_nand",
+       .resource       = migor_nand_flash_resources,
+       .num_resources  = ARRAY_SIZE(migor_nand_flash_resources),
+       .dev            = {
+               .platform_data = &migor_nand_flash_data,
+       }
+};
+
+static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
+#ifdef CONFIG_SH_MIGOR_RTA_WVGA
+       .clock_source = LCDC_CLK_BUS,
+       .ch[0] = {
+               .chan = LCDC_CHAN_MAINLCD,
+               .bpp = 16,
+               .interface_type = RGB16,
+               .clock_divider = 2,
+               .lcd_cfg = {
+                       .name = "LB070WV1",
+                       .xres = 800,
+                       .yres = 480,
+                       .left_margin = 64,
+                       .right_margin = 16,
+                       .hsync_len = 120,
+                       .upper_margin = 1,
+                       .lower_margin = 17,
+                       .vsync_len = 2,
+                       .sync = 0,
+               },
+       }
+#endif
+#ifdef CONFIG_SH_MIGOR_QVGA
+       .clock_source = LCDC_CLK_PERIPHERAL,
+       .ch[0] = {
+               .chan = LCDC_CHAN_MAINLCD,
+               .bpp = 16,
+               .interface_type = SYS16A,
+               .clock_divider = 10,
+               .lcd_cfg = {
+                       .name = "PH240320T",
+                       .xres = 320,
+                       .yres = 240,
+                       .left_margin = 0,
+                       .right_margin = 16,
+                       .hsync_len = 8,
+                       .upper_margin = 1,
+                       .lower_margin = 17,
+                       .vsync_len = 2,
+                       .sync = FB_SYNC_HOR_HIGH_ACT,
+               },
+               .board_cfg = {
+                       .setup_sys = migor_lcd_qvga_setup,
+               },
+               .sys_bus_cfg = {
+                       .ldmt2r = 0x06000a09,
+                       .ldmt3r = 0x180e3418,
+               },
+       }
+#endif
+};
+
+static struct resource migor_lcdc_resources[] = {
+       [0] = {
+               .name   = "LCDC",
+               .start  = 0xfe940000, /* P4-only space */
+               .end    = 0xfe941fff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device migor_lcdc_device = {
+       .name           = "sh_mobile_lcdc_fb",
+       .num_resources  = ARRAY_SIZE(migor_lcdc_resources),
+       .resource       = migor_lcdc_resources,
+       .dev    = {
+               .platform_data  = &sh_mobile_lcdc_info,
+       },
+};
+
+static struct clk *camera_clk;
+
+static void camera_power_on(void)
+{
+       unsigned char value;
+
+       camera_clk = clk_get(NULL, "video_clk");
+       clk_set_rate(camera_clk, 24000000);
+       clk_enable(camera_clk); /* start VIO_CKO */
+
+       mdelay(10);
+       value = ctrl_inb(PORT_PTDR);
+       value &= ~0x09;
+#ifndef CONFIG_SH_MIGOR_RTA_WVGA
+       value |= 0x01;
+#endif
+       ctrl_outb(value, PORT_PTDR);
+       mdelay(10);
+
+       ctrl_outb(value | 8, PORT_PTDR);
+}
+
+static void camera_power_off(void)
+{
+       clk_disable(camera_clk); /* stop VIO_CKO */
+       clk_put(camera_clk);
+
+       ctrl_outb(ctrl_inb(PORT_PTDR) & ~0x08, PORT_PTDR);
+}
+
+static unsigned char camera_ov772x_magic[] =
+{
+       0x09, 0x01, 0x0c, 0x10, 0x0d, 0x41, 0x0e, 0x01,
+       0x12, 0x00, 0x13, 0x8F, 0x14, 0x4A, 0x15, 0x00,
+       0x16, 0x00, 0x17, 0x23, 0x18, 0xa0, 0x19, 0x07,
+       0x1a, 0xf0, 0x1b, 0x40, 0x1f, 0x00, 0x20, 0x10,
+       0x22, 0xff, 0x23, 0x01, 0x28, 0x00, 0x29, 0xa0,
+       0x2a, 0x00, 0x2b, 0x00, 0x2c, 0xf0, 0x2d, 0x00,
+       0x2e, 0x00, 0x30, 0x80, 0x31, 0x60, 0x32, 0x00,
+       0x33, 0x00, 0x34, 0x00, 0x3d, 0x80, 0x3e, 0xe2,
+       0x3f, 0x1f, 0x42, 0x80, 0x43, 0x80, 0x44, 0x80,
+       0x45, 0x80, 0x46, 0x00, 0x47, 0x00, 0x48, 0x00,
+       0x49, 0x50, 0x4a, 0x30, 0x4b, 0x50, 0x4c, 0x50,
+       0x4d, 0x00, 0x4e, 0xef, 0x4f, 0x10, 0x50, 0x60,
+       0x51, 0x00, 0x52, 0x00, 0x53, 0x24, 0x54, 0x7a,
+       0x55, 0xfc, 0x62, 0xff, 0x63, 0xf0, 0x64, 0x1f,
+       0x65, 0x00, 0x66, 0x10, 0x67, 0x00, 0x68, 0x00,
+       0x69, 0x5c, 0x6a, 0x11, 0x6b, 0xa2, 0x6c, 0x01,
+       0x6d, 0x50, 0x6e, 0x80, 0x6f, 0x80, 0x70, 0x0f,
+       0x71, 0x00, 0x72, 0x00, 0x73, 0x0f, 0x74, 0x0f,
+       0x75, 0xff, 0x78, 0x10, 0x79, 0x70, 0x7a, 0x70,
+       0x7b, 0xf0, 0x7c, 0xf0, 0x7d, 0xf0, 0x7e, 0x0e,
+       0x7f, 0x1a, 0x80, 0x31, 0x81, 0x5a, 0x82, 0x69,
+       0x83, 0x75, 0x84, 0x7e, 0x85, 0x88, 0x86, 0x8f,
+       0x87, 0x96, 0x88, 0xa3, 0x89, 0xaf, 0x8a, 0xc4,
+       0x8b, 0xd7, 0x8c, 0xe8, 0x8d, 0x20, 0x8e, 0x00,
+       0x8f, 0x00, 0x90, 0x08, 0x91, 0x10, 0x92, 0x1f,
+       0x93, 0x01, 0x94, 0x2c, 0x95, 0x24, 0x96, 0x08,
+       0x97, 0x14, 0x98, 0x24, 0x99, 0x38, 0x9a, 0x9e,
+       0x9b, 0x00, 0x9c, 0x40, 0x9e, 0x11, 0x9f, 0x02,
+       0xa0, 0x00, 0xa1, 0x40, 0xa2, 0x40, 0xa3, 0x06,
+       0xa4, 0x00, 0xa6, 0x00, 0xa7, 0x40, 0xa8, 0x40,
+       0xa9, 0x80, 0xaa, 0x80, 0xab, 0x06, 0xac, 0xff,
+       0x12, 0x06, 0x64, 0x3f, 0x12, 0x46, 0x17, 0x3f,
+       0x18, 0x50, 0x19, 0x03, 0x1a, 0x78, 0x29, 0x50,
+       0x2c, 0x78,
+};
+
+static int ov772x_set_capture(struct soc_camera_platform_info *info,
+                             int enable)
+{
+       struct i2c_adapter *a = i2c_get_adapter(0);
+       struct i2c_msg msg;
+       int ret = 0;
+       int i;
+
+       if (!enable)
+               return 0; /* camera_power_off() is enough */
+
+       for (i = 0; i < ARRAY_SIZE(camera_ov772x_magic); i += 2) {
+               u_int8_t buf[8];
+
+               msg.addr = 0x21;
+               msg.buf = buf;
+               msg.len = 2;
+               msg.flags = 0;
+
+               buf[0] = camera_ov772x_magic[i];
+               buf[1] = camera_ov772x_magic[i + 1];
+
+               ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
+       }
+
+       return ret;
+}
+
+static struct soc_camera_platform_info ov772x_info = {
+       .iface = 0,
+       .format_name = "RGB565",
+       .format_depth = 16,
+       .format = {
+               .pixelformat = V4L2_PIX_FMT_RGB565,
+               .colorspace = V4L2_COLORSPACE_SRGB,
+               .width = 320,
+               .height = 240,
+       },
+       .bus_param =  SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
+       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
+       .set_capture = ov772x_set_capture,
+};
+
+static struct platform_device migor_camera_device = {
+       .name           = "soc_camera_platform",
+       .dev    = {
+               .platform_data  = &ov772x_info,
+       },
+};
+
+static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
+       .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \
+       | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH,
+       .enable_camera = camera_power_on,
+       .disable_camera = camera_power_off,
+};
+
+static struct resource migor_ceu_resources[] = {
+       [0] = {
+               .name   = "CEU",
+               .start  = 0xfe910000,
+               .end    = 0xfe91009f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 52,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               /* place holder for contiguous memory */
+       },
+};
+
+static struct platform_device migor_ceu_device = {
+       .name           = "sh_mobile_ceu",
+       .num_resources  = ARRAY_SIZE(migor_ceu_resources),
+       .resource       = migor_ceu_resources,
+       .dev    = {
+               .platform_data  = &sh_mobile_ceu_info,
+       },
+};
+
+static struct platform_device *migor_devices[] __initdata = {
+       &smc91x_eth_device,
+       &sh_keysc_device,
+       &migor_lcdc_device,
+       &migor_ceu_device,
+       &migor_camera_device,
+       &migor_nor_flash_device,
+       &migor_nand_flash_device,
+};
+
+static struct i2c_board_info migor_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("rs5c372b", 0x32),
+       },
+       {
+               I2C_BOARD_INFO("migor_ts", 0x51),
+               .irq = 38, /* IRQ6 */
+       },
+};
+
+static int __init migor_devices_setup(void)
+{
+       clk_always_enable("mstp214"); /* KEYSC */
+       clk_always_enable("mstp200"); /* LCDC */
+       clk_always_enable("mstp203"); /* CEU */
+
+       platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20);
+
+       i2c_register_board_info(0, migor_i2c_devices,
+                               ARRAY_SIZE(migor_i2c_devices));
+       return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
+}
+__initcall(migor_devices_setup);
+
+static void __init migor_setup(char **cmdline_p)
+{
+       /* SMC91C111 - Enable IRQ0 */
+       ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR);
+
+       /* KEYSC */
+       ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR);
+       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR);
+       ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
+
+       /* NAND Flash */
+       ctrl_outw(ctrl_inw(PORT_PXCR) & 0x0fff, PORT_PXCR);
+       ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x00000600) | 0x00000200,
+                 BSC_CS6ABCR);
+
+       /* Touch Panel - Enable IRQ6 */
+       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0xc, PORT_PZCR);
+       ctrl_outw((ctrl_inw(PORT_PSELA) | 0x8000), PORT_PSELA);
+       ctrl_outw((ctrl_inw(PORT_HIZCRC) & ~0x4000), PORT_HIZCRC);
+
+#ifdef CONFIG_SH_MIGOR_RTA_WVGA
+       /* LCDC - WVGA - Enable RGB Interface signals */
+       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR);
+       ctrl_outw(0x0000, PORT_PHCR);
+       ctrl_outw(0x0000, PORT_PLCR);
+       ctrl_outw(0x0000, PORT_PMCR);
+       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x000f, PORT_PRCR);
+       ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x000d) | 0x0400, PORT_PSELD);
+       ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0100, PORT_MSELCRB);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA);
+#endif
+#ifdef CONFIG_SH_MIGOR_QVGA
+       /* LCDC - QVGA - Enable SYS Interface signals */
+       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR);
+       ctrl_outw((ctrl_inw(PORT_PHCR) & ~0xcfff) | 0x0010, PORT_PHCR);
+       ctrl_outw(0x0000, PORT_PLCR);
+       ctrl_outw(0x0000, PORT_PMCR);
+       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x030f, PORT_PRCR);
+       ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x0001) | 0x0420, PORT_PSELD);
+       ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x0100, PORT_MSELCRB);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA);
+#endif
+
+       /* CEU */
+       ctrl_outw((ctrl_inw(PORT_PTCR) & ~0x03c3) | 0x0051, PORT_PTCR);
+       ctrl_outw(ctrl_inw(PORT_PUCR) & ~0x03ff, PORT_PUCR);
+       ctrl_outw(ctrl_inw(PORT_PVCR) & ~0x03ff, PORT_PVCR);
+       ctrl_outw(ctrl_inw(PORT_PWCR) & ~0x3c00, PORT_PWCR);
+       ctrl_outw(ctrl_inw(PORT_PSELC) | 0x0001, PORT_PSELC);
+       ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x2000, PORT_PSELD);
+       ctrl_outw(ctrl_inw(PORT_PSELE) | 0x000f, PORT_PSELE);
+       ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2200, PORT_MSELCRB);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x0a00, PORT_HIZCRA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRB) & ~0x0003, PORT_HIZCRB);
+}
+
+static struct sh_machine_vector mv_migor __initmv = {
+       .mv_name                = "Migo-R",
+       .mv_setup               = migor_setup,
+};
diff --git a/arch/sh/boards/mach-r2d/Kconfig b/arch/sh/boards/mach-r2d/Kconfig
new file mode 100644 (file)
index 0000000..8122a96
--- /dev/null
@@ -0,0 +1,23 @@
+if SH_RTS7751R2D
+
+menu "RTS7751R2D Board Revision"
+
+config RTS7751R2D_PLUS
+       bool "R2D-PLUS"
+       help
+         Selecting this option will configure the kernel for R2D-PLUS.
+
+         R2D-PLUS is the smaller of the two R2D board versions, equipped
+         with a single PCI slot.
+
+config RTS7751R2D_1
+       bool "R2D-1"
+       help
+         Selecting this option will configure the kernel for R2D-1.
+
+         R2D-1 is the larger of the two R2D board versions, equipped
+         with two PCI slots.
+endmenu
+
+endif
+
diff --git a/arch/sh/boards/mach-r2d/Makefile b/arch/sh/boards/mach-r2d/Makefile
new file mode 100644 (file)
index 0000000..0d4c75a
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the RTS7751R2D specific parts of the kernel
+#
+
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-r2d/irq.c b/arch/sh/boards/mach-r2d/irq.c
new file mode 100644 (file)
index 0000000..8e49f6e
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * linux/arch/sh/boards/renesas/rts7751r2d/irq.c
+ *
+ * Copyright (C) 2007  Magnus Damm
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Renesas Technology Sales RTS7751R2D Support, R2D-PLUS and R2D-1.
+ *
+ * Modified for RTS7751R2D by
+ * Atom Create Engineering Co., Ltd. 2002.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <asm/rts7751r2d.h>
+
+#define R2D_NR_IRL 13
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources (R2D-1 and R2D-PLUS) */
+       EXT,              /* EXT_INT0-3 */
+       RTC_T, RTC_A,     /* Real Time Clock */
+       AX88796,          /* Ethernet controller (R2D-1 board) */
+       KEY,              /* Key input (R2D-PLUS board) */
+       SDCARD,           /* SD Card */
+       CF_CD, CF_IDE,    /* CF Card Detect + CF IDE */
+       SM501,            /* SM501 aka Voyager */
+       PCI_INTD_RTL8139, /* Ethernet controller */
+       PCI_INTC_PCI1520, /* Cardbus/PCMCIA bridge */
+       PCI_INTB_RTL8139, /* Ethernet controller with HUB (R2D-PLUS board) */
+       PCI_INTB_SLOT,    /* PCI Slot 3.3v (R2D-1 board) */
+       PCI_INTA_SLOT,    /* PCI Slot 3.3v */
+       TP,               /* Touch Panel */
+};
+
+#ifdef CONFIG_RTS7751R2D_1
+
+/* Vectors for R2D-1 */
+static struct intc_vect vectors_r2d_1[] __initdata = {
+       INTC_IRQ(EXT, IRQ_EXT),
+       INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
+       INTC_IRQ(AX88796, IRQ_AX88796), INTC_IRQ(SDCARD, IRQ_SDCARD),
+       INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE), /* ng */
+       INTC_IRQ(SM501, IRQ_VOYAGER),
+       INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
+       INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
+       INTC_IRQ(PCI_INTB_SLOT, IRQ_PCI_INTB),
+       INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
+       INTC_IRQ(TP, IRQ_TP),
+};
+
+/* IRLMSK mask register layout for R2D-1 */
+static struct intc_mask_reg mask_registers_r2d_1[] __initdata = {
+       { 0xa4000000, 0, 16, /* IRLMSK */
+         { TP, PCI_INTA_SLOT, PCI_INTB_SLOT,
+           PCI_INTC_PCI1520, PCI_INTD_RTL8139,
+           SM501, CF_IDE, CF_CD, SDCARD, AX88796,
+           RTC_A, RTC_T, 0, 0, 0, EXT } },
+};
+
+/* IRLn to IRQ table for R2D-1 */
+static unsigned char irl2irq_r2d_1[R2D_NR_IRL] __initdata = {
+       IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
+       IRQ_VOYAGER, IRQ_AX88796, IRQ_RTC_A, IRQ_RTC_T,
+       IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
+       IRQ_TP,
+};
+
+static DECLARE_INTC_DESC(intc_desc_r2d_1, "r2d-1", vectors_r2d_1,
+                        NULL, mask_registers_r2d_1, NULL, NULL);
+
+#endif /* CONFIG_RTS7751R2D_1 */
+
+#ifdef CONFIG_RTS7751R2D_PLUS
+
+/* Vectors for R2D-PLUS */
+static struct intc_vect vectors_r2d_plus[] __initdata = {
+       INTC_IRQ(EXT, IRQ_EXT),
+       INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
+       INTC_IRQ(KEY, IRQ_KEY), INTC_IRQ(SDCARD, IRQ_SDCARD),
+       INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE),
+       INTC_IRQ(SM501, IRQ_VOYAGER),
+       INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
+       INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
+       INTC_IRQ(PCI_INTB_RTL8139, IRQ_PCI_INTB),
+       INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
+       INTC_IRQ(TP, IRQ_TP),
+};
+
+/* IRLMSK mask register layout for R2D-PLUS */
+static struct intc_mask_reg mask_registers_r2d_plus[] __initdata = {
+       { 0xa4000000, 0, 16, /* IRLMSK */
+         { TP, PCI_INTA_SLOT, PCI_INTB_RTL8139,
+           PCI_INTC_PCI1520, PCI_INTD_RTL8139,
+           SM501, CF_IDE, CF_CD, SDCARD, KEY,
+           RTC_A, RTC_T, 0, 0, 0, EXT } },
+};
+
+/* IRLn to IRQ table for R2D-PLUS */
+static unsigned char irl2irq_r2d_plus[R2D_NR_IRL] __initdata = {
+       IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
+       IRQ_VOYAGER, IRQ_KEY, IRQ_RTC_A, IRQ_RTC_T,
+       IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
+       IRQ_TP,
+};
+
+static DECLARE_INTC_DESC(intc_desc_r2d_plus, "r2d-plus", vectors_r2d_plus,
+                        NULL, mask_registers_r2d_plus, NULL, NULL);
+
+#endif /* CONFIG_RTS7751R2D_PLUS */
+
+static unsigned char irl2irq[R2D_NR_IRL];
+
+int rts7751r2d_irq_demux(int irq)
+{
+       if (irq >= R2D_NR_IRL || !irl2irq[irq])
+               return irq;
+
+       return irl2irq[irq];
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_rts7751r2d_IRQ(void)
+{
+       struct intc_desc *d;
+
+       switch (ctrl_inw(PA_VERREG) & 0xf0) {
+#ifdef CONFIG_RTS7751R2D_PLUS
+       case 0x10:
+               printk(KERN_INFO "Using R2D-PLUS interrupt controller.\n");
+               d = &intc_desc_r2d_plus;
+               memcpy(irl2irq, irl2irq_r2d_plus, R2D_NR_IRL);
+               break;
+#endif
+#ifdef CONFIG_RTS7751R2D_1
+       case 0x00: /* according to manual */
+       case 0x30: /* in reality */
+               printk(KERN_INFO "Using R2D-1 interrupt controller.\n");
+               d = &intc_desc_r2d_1;
+               memcpy(irl2irq, irl2irq_r2d_1, R2D_NR_IRL);
+               break;
+#endif
+       default:
+               printk(KERN_INFO "Unknown R2D interrupt controller 0x%04x\n",
+                      ctrl_inw(PA_VERREG));
+               return;
+       }
+
+       register_intc_controller(d);
+}
diff --git a/arch/sh/boards/mach-r2d/setup.c b/arch/sh/boards/mach-r2d/setup.c
new file mode 100644 (file)
index 0000000..2308e87
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * Renesas Technology Sales RTS7751R2D Support.
+ *
+ * Copyright (C) 2002 - 2006 Atom Create Engineering Co., Ltd.
+ * Copyright (C) 2004 - 2007 Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/sm501.h>
+#include <linux/sm501-regs.h>
+#include <linux/pm.h>
+#include <linux/fb.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_bitbang.h>
+#include <asm/machvec.h>
+#include <asm/rts7751r2d.h>
+#include <asm/io.h>
+#include <asm/io_trapped.h>
+#include <asm/spi.h>
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_AREA5_IO + 0x1000,
+               .end    = PA_AREA5_IO + 0x1000 + 0x10 - 0x2,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = PA_AREA5_IO + 0x80c,
+               .end    = PA_AREA5_IO + 0x80c,
+               .flags  = IORESOURCE_MEM,
+       },
+#ifndef CONFIG_RTS7751R2D_1 /* For R2D-1 polling is preferred */
+       [2] = {
+               .start  = IRQ_CF_IDE,
+               .flags  = IORESOURCE_IRQ,
+       },
+#endif
+};
+
+static struct pata_platform_info pata_info = {
+       .ioport_shift   = 1,
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+       .dev    = {
+               .platform_data  = &pata_info,
+       },
+};
+
+static struct spi_board_info spi_bus[] = {
+       {
+               .modalias       = "rtc-r9701",
+               .max_speed_hz   = 1000000,
+               .mode           = SPI_MODE_3,
+       },
+};
+
+static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state)
+{
+       BUG_ON(cs != 0);  /* Single Epson RTC-9701JE attached on CS0 */
+       ctrl_outw(state == BITBANG_CS_ACTIVE, PA_RTCCE);
+}
+
+static struct sh_spi_info spi_info = {
+       .num_chipselect = 1,
+       .chip_select = r2d_chip_select,
+};
+
+static struct resource spi_sh_sci_resources[] = {
+       {
+               .start  = 0xffe00000,
+               .end    = 0xffe0001f,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device spi_sh_sci_device  = {
+       .name           = "spi_sh_sci",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(spi_sh_sci_resources),
+       .resource       = spi_sh_sci_resources,
+       .dev    = {
+               .platform_data  = &spi_info,
+       },
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_OUTPORT,
+               .end    = PA_OUTPORT,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct resource sm501_resources[] = {
+       [0]     = {
+               .start  = 0x10000000,
+               .end    = 0x13e00000 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1]     = {
+               .start  = 0x13e00000,
+               .end    = 0x13ffffff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2]     = {
+               .start  = IRQ_VOYAGER,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct fb_videomode sm501_default_mode = {
+       .pixclock       = 35714,
+       .xres           = 640,
+       .yres           = 480,
+       .left_margin    = 105,
+       .right_margin   = 50,
+       .upper_margin   = 35,
+       .lower_margin   = 0,
+       .hsync_len      = 96,
+       .vsync_len      = 2,
+       .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+};
+
+static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
+       .def_bpp        = 16,
+       .def_mode       = &sm501_default_mode,
+       .flags          = SM501FB_FLAG_USE_INIT_MODE |
+                         SM501FB_FLAG_USE_HWCURSOR |
+                         SM501FB_FLAG_USE_HWACCEL |
+                         SM501FB_FLAG_DISABLE_AT_EXIT,
+};
+
+static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
+       .flags          = (SM501FB_FLAG_USE_INIT_MODE |
+                          SM501FB_FLAG_USE_HWCURSOR |
+                          SM501FB_FLAG_USE_HWACCEL |
+                          SM501FB_FLAG_DISABLE_AT_EXIT),
+
+};
+
+static struct sm501_platdata_fb sm501_fb_pdata = {
+       .fb_route       = SM501_FB_OWN,
+       .fb_crt         = &sm501_pdata_fbsub_crt,
+       .fb_pnl         = &sm501_pdata_fbsub_pnl,
+       .flags          = SM501_FBPD_SWAP_FB_ENDIAN,
+};
+
+static struct sm501_initdata sm501_initdata = {
+       .devices        = SM501_USE_USB_HOST | SM501_USE_UART0,
+};
+
+static struct sm501_platdata sm501_platform_data = {
+       .init           = &sm501_initdata,
+       .fb             = &sm501_fb_pdata,
+};
+
+static struct platform_device sm501_device = {
+       .name           = "sm501",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &sm501_platform_data,
+       },
+       .num_resources  = ARRAY_SIZE(sm501_resources),
+       .resource       = sm501_resources,
+};
+
+static struct platform_device *rts7751r2d_devices[] __initdata = {
+       &sm501_device,
+       &heartbeat_device,
+       &spi_sh_sci_device,
+};
+
+/*
+ * The CF is connected with a 16-bit bus where 8-bit operations are
+ * unsupported. The linux ata driver is however using 8-bit operations, so
+ * insert a trapped io filter to convert 8-bit operations into 16-bit.
+ */
+static struct trapped_io cf_trapped_io = {
+       .resource               = cf_ide_resources,
+       .num_resources          = 2,
+       .minimum_bus_width      = 16,
+};
+
+static int __init rts7751r2d_devices_setup(void)
+{
+       if (register_trapped_io(&cf_trapped_io) == 0)
+               platform_device_register(&cf_ide_device);
+
+       spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
+
+       return platform_add_devices(rts7751r2d_devices,
+                                   ARRAY_SIZE(rts7751r2d_devices));
+}
+__initcall(rts7751r2d_devices_setup);
+
+static void rts7751r2d_power_off(void)
+{
+       ctrl_outw(0x0001, PA_POWOFF);
+}
+
+/*
+ * Initialize the board
+ */
+static void __init rts7751r2d_setup(char **cmdline_p)
+{
+       void __iomem *sm501_reg;
+       u16 ver = ctrl_inw(PA_VERREG);
+
+       printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
+
+       printk(KERN_INFO "FPGA version:%d (revision:%d)\n",
+                                       (ver >> 4) & 0xf, ver & 0xf);
+
+       ctrl_outw(0x0000, PA_OUTPORT);
+       pm_power_off = rts7751r2d_power_off;
+
+       /* sm501 dram configuration:
+        * ColSizeX = 11 - External Memory Column Size: 256 words.
+        * APX = 1 - External Memory Active to Pre-Charge Delay: 7 clocks.
+        * RstX = 1 - External Memory Reset: Normal.
+        * Rfsh = 1 - Local Memory Refresh to Command Delay: 12 clocks.
+        * BwC =  1 - Local Memory Block Write Cycle Time: 2 clocks.
+        * BwP =  1 - Local Memory Block Write to Pre-Charge Delay: 1 clock.
+        * AP = 1 - Internal Memory Active to Pre-Charge Delay: 7 clocks.
+        * Rst = 1 - Internal Memory Reset: Normal.
+        * RA = 1 - Internal Memory Remain in Active State: Do not remain.
+        */
+
+       sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
+       writel(readl(sm501_reg) | 0x00f107c0, sm501_reg);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_rts7751r2d __initmv = {
+       .mv_name                = "RTS7751R2D",
+       .mv_setup               = rts7751r2d_setup,
+       .mv_init_irq            = init_rts7751r2d_IRQ,
+       .mv_irq_demux           = rts7751r2d_irq_demux,
+};
diff --git a/arch/sh/boards/mach-rsk7203/Makefile b/arch/sh/boards/mach-rsk7203/Makefile
new file mode 100644 (file)
index 0000000..f663768
--- /dev/null
@@ -0,0 +1 @@
+obj-y  := setup.o
diff --git a/arch/sh/boards/mach-rsk7203/setup.c b/arch/sh/boards/mach-rsk7203/setup.c
new file mode 100644 (file)
index 0000000..ffbedc5
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Renesas Technology Europe RSK+ 7203 Support.
+ *
+ * Copyright (C) 2008 Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/mtd/map.h>
+#include <linux/smc911x.h>
+#include <asm/machvec.h>
+#include <asm/io.h>
+
+static struct smc911x_platdata smc911x_info = {
+       .flags          = SMC911X_USE_16BIT,
+       .irq_flags      = IRQF_TRIGGER_LOW,
+};
+
+static struct resource smc911x_resources[] = {
+       [0] = {
+               .start          = 0x24000000,
+               .end            = 0x24000000 + 0x100,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 64,
+               .end            = 64,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc911x_device = {
+       .name           = "smc911x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(smc911x_resources),
+       .resource       = smc911x_resources,
+       .dev            = {
+               .platform_data = &smc911x_info,
+       },
+};
+
+static const char *probes[] = { "cmdlinepart", NULL };
+
+static struct mtd_partition *parsed_partitions;
+
+static struct mtd_partition rsk7203_partitions[] = {
+       {
+               .name           = "Bootloader",
+               .offset         = 0x00000000,
+               .size           = 0x00040000,
+               .mask_flags     = MTD_WRITEABLE,
+       }, {
+               .name           = "Kernel",
+               .offset         = MTDPART_OFS_NXTBLK,
+               .size           = 0x001c0000,
+       }, {
+               .name           = "Flash_FS",
+               .offset         = MTDPART_OFS_NXTBLK,
+               .size           = MTDPART_SIZ_FULL,
+       }
+};
+
+static struct physmap_flash_data flash_data = {
+       .width          = 2,
+};
+
+static struct resource flash_resource = {
+       .start          = 0x20000000,
+       .end            = 0x20400000,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device flash_device = {
+       .name           = "physmap-flash",
+       .id             = -1,
+       .resource       = &flash_resource,
+       .num_resources  = 1,
+       .dev            = {
+               .platform_data = &flash_data,
+       },
+};
+
+static struct mtd_info *flash_mtd;
+
+static struct map_info rsk7203_flash_map = {
+       .name           = "RSK+ Flash",
+       .size           = 0x400000,
+       .bankwidth      = 2,
+};
+
+static void __init set_mtd_partitions(void)
+{
+       int nr_parts = 0;
+
+       simple_map_init(&rsk7203_flash_map);
+       flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map);
+       nr_parts = parse_mtd_partitions(flash_mtd, probes,
+                                       &parsed_partitions, 0);
+       /* If there is no partition table, used the hard coded table */
+       if (nr_parts <= 0) {
+               flash_data.parts = rsk7203_partitions;
+               flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions);
+       } else {
+               flash_data.nr_parts = nr_parts;
+               flash_data.parts = parsed_partitions;
+       }
+}
+
+
+static struct platform_device *rsk7203_devices[] __initdata = {
+       &smc911x_device,
+       &flash_device,
+};
+
+static int __init rsk7203_devices_setup(void)
+{
+       set_mtd_partitions();
+       return platform_add_devices(rsk7203_devices,
+                                   ARRAY_SIZE(rsk7203_devices));
+}
+device_initcall(rsk7203_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_rsk7203 __initmv = {
+       .mv_name        = "RSK+7203",
+};
diff --git a/arch/sh/boards/mach-sdk7780/Kconfig b/arch/sh/boards/mach-sdk7780/Kconfig
new file mode 100644 (file)
index 0000000..065f1df
--- /dev/null
@@ -0,0 +1,16 @@
+if SH_SDK7780
+
+choice
+       prompt "SDK7780 options"
+       default SH_SDK7780_BASE
+
+config SH_SDK7780_BASE
+       bool "SDK7780 with base-board support"
+       depends on CPU_SUBTYPE_SH7780
+       help
+         Selecting this option will enable support for the expansion
+         baseboard devices. If in doubt, say Y.
+
+endchoice
+
+endif
diff --git a/arch/sh/boards/mach-sdk7780/Makefile b/arch/sh/boards/mach-sdk7780/Makefile
new file mode 100644 (file)
index 0000000..3d8f0be
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the SDK7780 specific parts of the kernel
+#
+obj-y   := setup.o irq.o
+
diff --git a/arch/sh/boards/mach-sdk7780/irq.c b/arch/sh/boards/mach-sdk7780/irq.c
new file mode 100644 (file)
index 0000000..87cdc57
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * linux/arch/sh/boards/renesas/sdk7780/irq.c
+ *
+ * Renesas Technology Europe SDK7780 Support.
+ *
+ * Copyright (C) 2008  Nicholas Beck <nbeck@mpc-data.co.uk>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/sdk7780.h>
+
+enum {
+       UNUSED = 0,
+       /* board specific interrupt sources */
+       SMC91C111,      /* Ethernet controller */
+};
+
+static struct intc_vect fpga_vectors[] __initdata = {
+       INTC_IRQ(SMC91C111, IRQ_ETHERNET),
+};
+
+static struct intc_mask_reg fpga_mask_registers[] __initdata = {
+       { 0, FPGA_IRQ0MR, 16,
+         { 0, 0, 0, 0, 0, 0, 0, 0,
+           0, 0, 0, SMC91C111, 0, 0, 0, 0 } },
+};
+
+static DECLARE_INTC_DESC(fpga_intc_desc, "sdk7780-irq", fpga_vectors,
+                        NULL, fpga_mask_registers, NULL, NULL);
+
+void __init init_sdk7780_IRQ(void)
+{
+       printk(KERN_INFO "Using SDK7780 interrupt controller.\n");
+
+       ctrl_outw(0xFFFF, FPGA_IRQ0MR);
+       /* Setup IRL 0-3 */
+       ctrl_outw(0x0003, FPGA_IMSR);
+       plat_irq_setup_pins(IRQ_MODE_IRL3210);
+
+       register_intc_controller(&fpga_intc_desc);
+}
diff --git a/arch/sh/boards/mach-sdk7780/setup.c b/arch/sh/boards/mach-sdk7780/setup.c
new file mode 100644 (file)
index 0000000..acc5932
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * arch/sh/boards/renesas/sdk7780/setup.c
+ *
+ * Renesas Solutions SH7780 SDK Support
+ * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <asm/machvec.h>
+#include <asm/sdk7780.h>
+#include <asm/heartbeat.h>
+#include <asm/io.h>
+#include <asm/addrspace.h>
+
+#define GPIO_PECR        0xFFEA0008
+
+//* Heartbeat */
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+/* SMC91x */
+static struct resource smc91x_eth_resources[] = {
+       [0] = {
+               .name   = "smc91x-regs" ,
+               .start  = PA_LAN + 0x300,
+               .end    = PA_LAN + 0x300 + 0x10 ,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_ETHERNET,
+               .end    = IRQ_ETHERNET,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_eth_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
+       .resource       = smc91x_eth_resources,
+};
+
+static struct platform_device *sdk7780_devices[] __initdata = {
+       &heartbeat_device,
+       &smc91x_eth_device,
+};
+
+static int __init sdk7780_devices_setup(void)
+{
+       return platform_add_devices(sdk7780_devices,
+               ARRAY_SIZE(sdk7780_devices));
+}
+device_initcall(sdk7780_devices_setup);
+
+static void __init sdk7780_setup(char **cmdline_p)
+{
+       u16 ver = ctrl_inw(FPGA_FPVERR);
+       u16 dateStamp = ctrl_inw(FPGA_FPDATER);
+
+       printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n");
+       printk(KERN_INFO "Board version: %d (revision %d), "
+                        "FPGA version: %d (revision %d), datestamp : %d\n",
+                        (ver >> 12) & 0xf, (ver >> 8) & 0xf,
+                        (ver >>  4) & 0xf, ver & 0xf,
+                        dateStamp);
+
+       /* Setup pin mux'ing for PCIC */
+       ctrl_outw(0x0000, GPIO_PECR);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_se7780 __initmv = {
+       .mv_name        = "Renesas SDK7780-R3" ,
+       .mv_setup               = sdk7780_setup,
+       .mv_nr_irqs             = 111,
+       .mv_init_irq    = init_sdk7780_IRQ,
+};
+
diff --git a/arch/sh/boards/mach-se/7206/Makefile b/arch/sh/boards/mach-se/7206/Makefile
new file mode 100644 (file)
index 0000000..63e7ed6
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the 7206 SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/mach-se/7206/io.c b/arch/sh/boards/mach-se/7206/io.c
new file mode 100644 (file)
index 0000000..1308e61
--- /dev/null
@@ -0,0 +1,104 @@
+/* $Id: io.c,v 1.5 2004/02/22 23:08:43 kkojima Exp $
+ *
+ * linux/arch/sh/boards/se/7206/io.c
+ *
+ * Copyright (C) 2006 Yoshinori Sato
+ *
+ * I/O routine for Hitachi 7206 SolutionEngine.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <asm/io.h>
+#include <asm/se7206.h>
+
+
+static inline void delay(void)
+{
+       ctrl_inw(0x20000000);  /* P2 ROM Area */
+}
+
+/* MS7750 requires special versions of in*, out* routines, since
+   PC-like io ports are located at upper half byte of 16-bit word which
+   can be accessed only with 16-bit wide.  */
+
+static inline volatile __u16 *
+port2adr(unsigned int port)
+{
+       if (port >= 0x2000 && port < 0x2020)
+               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+       else if (port >= 0x300 && port < 0x310)
+               return (volatile __u16 *) (PA_SMSC + (port - 0x300));
+
+       return (volatile __u16 *)port;
+}
+
+unsigned char se7206_inb(unsigned long port)
+{
+       return (*port2adr(port)) & 0xff;
+}
+
+unsigned char se7206_inb_p(unsigned long port)
+{
+       unsigned long v;
+
+       v = (*port2adr(port)) & 0xff;
+       delay();
+       return v;
+}
+
+unsigned short se7206_inw(unsigned long port)
+{
+       return *port2adr(port);;
+}
+
+void se7206_outb(unsigned char value, unsigned long port)
+{
+       *(port2adr(port)) = value;
+}
+
+void se7206_outb_p(unsigned char value, unsigned long port)
+{
+       *(port2adr(port)) = value;
+       delay();
+}
+
+void se7206_outw(unsigned short value, unsigned long port)
+{
+       *port2adr(port) = value;
+}
+
+void se7206_insb(unsigned long port, void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       __u8 *ap = addr;
+
+       while (count--)
+               *ap++ = *p;
+}
+
+void se7206_insw(unsigned long port, void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       __u16 *ap = addr;
+       while (count--)
+               *ap++ = *p;
+}
+
+void se7206_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       const __u8 *ap = addr;
+
+       while (count--)
+               *p = *ap++;
+}
+
+void se7206_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       const __u16 *ap = addr;
+       while (count--)
+               *p = *ap++;
+}
diff --git a/arch/sh/boards/mach-se/7206/irq.c b/arch/sh/boards/mach-se/7206/irq.c
new file mode 100644 (file)
index 0000000..9d5bfc7
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * linux/arch/sh/boards/se/7206/irq.c
+ *
+ * Copyright (C) 2005,2006 Yoshinori Sato
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <linux/interrupt.h>
+#include <asm/se7206.h>
+
+#define INTSTS0 0x31800000
+#define INTSTS1 0x31800002
+#define INTMSK0 0x31800004
+#define INTMSK1 0x31800006
+#define INTSEL  0x31800008
+
+#define IRQ0_IRQ 64
+#define IRQ1_IRQ 65
+#define IRQ3_IRQ 67
+
+#define INTC_IPR01 0xfffe0818
+#define INTC_ICR1  0xfffe0802
+
+static void disable_se7206_irq(unsigned int irq)
+{
+       unsigned short val;
+       unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq)));
+       unsigned short msk0,msk1;
+
+       /* Set the priority in IPR to 0 */
+       val = ctrl_inw(INTC_IPR01);
+       val &= mask;
+       ctrl_outw(val, INTC_IPR01);
+       /* FPGA mask set */
+       msk0 = ctrl_inw(INTMSK0);
+       msk1 = ctrl_inw(INTMSK1);
+
+       switch (irq) {
+       case IRQ0_IRQ:
+               msk0 |= 0x0010;
+               break;
+       case IRQ1_IRQ:
+               msk0 |= 0x000f;
+               break;
+       case IRQ3_IRQ:
+               msk0 |= 0x0f00;
+               msk1 |= 0x00ff;
+               break;
+       }
+       ctrl_outw(msk0, INTMSK0);
+       ctrl_outw(msk1, INTMSK1);
+}
+
+static void enable_se7206_irq(unsigned int irq)
+{
+       unsigned short val;
+       unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq)));
+       unsigned short msk0,msk1;
+
+       /* Set priority in IPR back to original value */
+       val = ctrl_inw(INTC_IPR01);
+       val |= value;
+       ctrl_outw(val, INTC_IPR01);
+
+       /* FPGA mask reset */
+       msk0 = ctrl_inw(INTMSK0);
+       msk1 = ctrl_inw(INTMSK1);
+
+       switch (irq) {
+       case IRQ0_IRQ:
+               msk0 &= ~0x0010;
+               break;
+       case IRQ1_IRQ:
+               msk0 &= ~0x000f;
+               break;
+       case IRQ3_IRQ:
+               msk0 &= ~0x0f00;
+               msk1 &= ~0x00ff;
+               break;
+       }
+       ctrl_outw(msk0, INTMSK0);
+       ctrl_outw(msk1, INTMSK1);
+}
+
+static void eoi_se7206_irq(unsigned int irq)
+{
+       unsigned short sts0,sts1;
+
+       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+               enable_se7206_irq(irq);
+       /* FPGA isr clear */
+       sts0 = ctrl_inw(INTSTS0);
+       sts1 = ctrl_inw(INTSTS1);
+
+       switch (irq) {
+       case IRQ0_IRQ:
+               sts0 &= ~0x0010;
+               break;
+       case IRQ1_IRQ:
+               sts0 &= ~0x000f;
+               break;
+       case IRQ3_IRQ:
+               sts0 &= ~0x0f00;
+               sts1 &= ~0x00ff;
+               break;
+       }
+       ctrl_outw(sts0, INTSTS0);
+       ctrl_outw(sts1, INTSTS1);
+}
+
+static struct irq_chip se7206_irq_chip __read_mostly = {
+       .name           = "SE7206-FPGA",
+       .mask           = disable_se7206_irq,
+       .unmask         = enable_se7206_irq,
+       .mask_ack       = disable_se7206_irq,
+       .eoi            = eoi_se7206_irq,
+};
+
+static void make_se7206_irq(unsigned int irq)
+{
+       disable_irq_nosync(irq);
+       set_irq_chip_and_handler_name(irq, &se7206_irq_chip,
+                                     handle_level_irq, "level");
+       disable_se7206_irq(irq);
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7206_IRQ(void)
+{
+       make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */
+       make_se7206_irq(IRQ1_IRQ); /* ATA */
+       make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */
+       ctrl_outw(inw(INTC_ICR1) | 0x000b ,INTC_ICR1 ) ; /* ICR1 */
+
+       /* FPGA System register setup*/
+       ctrl_outw(0x0000,INTSTS0); /* Clear INTSTS0 */
+       ctrl_outw(0x0000,INTSTS1); /* Clear INTSTS1 */
+       /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */
+       ctrl_outw(0x0001,INTSEL);
+}
diff --git a/arch/sh/boards/mach-se/7206/setup.c b/arch/sh/boards/mach-se/7206/setup.c
new file mode 100644 (file)
index 0000000..4fe84cc
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ *
+ * linux/arch/sh/boards/se/7206/setup.c
+ *
+ * Copyright (C) 2006  Yoshinori Sato
+ * Copyright (C) 2007 - 2008  Paul Mundt
+ *
+ * Hitachi 7206 SolutionEngine Support.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/smc91x.h>
+#include <asm/se7206.h>
+#include <asm/io.h>
+#include <asm/machvec.h>
+#include <asm/heartbeat.h>
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .name           = "smc91x-regs",
+               .start          = PA_SMSC + 0x300,
+               .end            = PA_SMSC + 0x300 + 0x020 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 64,
+               .end            = 64,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct smc91x_platdata smc91x_info = {
+       .flags  = SMC91X_USE_16BIT,
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = -1,
+       .dev            = {
+               .dma_mask               = NULL,
+               .coherent_dma_mask      = 0xffffffff,
+               .platform_data          = &smc91x_info,
+       },
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+       .resource       = smc91x_resources,
+};
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+       .regsize        = 32,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct platform_device *se7206_devices[] __initdata = {
+       &smc91x_device,
+       &heartbeat_device,
+};
+
+static int __init se7206_devices_setup(void)
+{
+       return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
+}
+__initcall(se7206_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+
+static struct sh_machine_vector mv_se __initmv = {
+       .mv_name                = "SolutionEngine",
+       .mv_nr_irqs             = 256,
+       .mv_inb                 = se7206_inb,
+       .mv_inw                 = se7206_inw,
+       .mv_outb                = se7206_outb,
+       .mv_outw                = se7206_outw,
+
+       .mv_inb_p               = se7206_inb_p,
+       .mv_inw_p               = se7206_inw,
+       .mv_outb_p              = se7206_outb_p,
+       .mv_outw_p              = se7206_outw,
+
+       .mv_insb                = se7206_insb,
+       .mv_insw                = se7206_insw,
+       .mv_outsb               = se7206_outsb,
+       .mv_outsw               = se7206_outsw,
+
+       .mv_init_irq            = init_se7206_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7343/Makefile b/arch/sh/boards/mach-se/7343/Makefile
new file mode 100644 (file)
index 0000000..3024796
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the 7343 SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/mach-se/7343/io.c b/arch/sh/boards/mach-se/7343/io.c
new file mode 100644 (file)
index 0000000..e2fae32
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * arch/sh/boards/se/7343/io.c
+ *
+ * I/O routine for SH-Mobile3AS 7343 SolutionEngine.
+ *
+ */
+#include <linux/kernel.h>
+#include <asm/io.h>
+#include <mach/se7343.h>
+
+#define badio(fn, a) panic("bad i/o operation %s for %08lx.", #fn, a)
+
+struct iop {
+       unsigned long start, end;
+       unsigned long base;
+       struct iop *(*check) (struct iop * p, unsigned long port);
+       unsigned char (*inb) (struct iop * p, unsigned long port);
+       unsigned short (*inw) (struct iop * p, unsigned long port);
+       void (*outb) (struct iop * p, unsigned char value, unsigned long port);
+       void (*outw) (struct iop * p, unsigned short value, unsigned long port);
+};
+
+struct iop *
+simple_check(struct iop *p, unsigned long port)
+{
+       static int count;
+
+       if (count < 100)
+               count++;
+
+       port &= 0xFFFF;
+
+       if ((p->start <= port) && (port <= p->end))
+               return p;
+       else
+               badio(check, port);
+}
+
+struct iop *
+ide_check(struct iop *p, unsigned long port)
+{
+       if (((0x1f0 <= port) && (port <= 0x1f7)) || (port == 0x3f7))
+               return p;
+       return NULL;
+}
+
+unsigned char
+simple_inb(struct iop *p, unsigned long port)
+{
+       return *(unsigned char *) (p->base + port);
+}
+
+unsigned short
+simple_inw(struct iop *p, unsigned long port)
+{
+       return *(unsigned short *) (p->base + port);
+}
+
+void
+simple_outb(struct iop *p, unsigned char value, unsigned long port)
+{
+       *(unsigned char *) (p->base + port) = value;
+}
+
+void
+simple_outw(struct iop *p, unsigned short value, unsigned long port)
+{
+       *(unsigned short *) (p->base + port) = value;
+}
+
+unsigned char
+pcc_inb(struct iop *p, unsigned long port)
+{
+       unsigned long addr = p->base + port + 0x40000;
+       unsigned long v;
+
+       if (port & 1)
+               addr += 0x00400000;
+       v = *(volatile unsigned char *) addr;
+       return v;
+}
+
+void
+pcc_outb(struct iop *p, unsigned char value, unsigned long port)
+{
+       unsigned long addr = p->base + port + 0x40000;
+
+       if (port & 1)
+               addr += 0x00400000;
+       *(volatile unsigned char *) addr = value;
+}
+
+unsigned char
+bad_inb(struct iop *p, unsigned long port)
+{
+       badio(inb, port);
+}
+
+void
+bad_outb(struct iop *p, unsigned char value, unsigned long port)
+{
+       badio(inw, port);
+}
+
+#ifdef CONFIG_SMC91X
+/* MSTLANEX01 LAN at 0xb400:0000 */
+static struct iop laniop = {
+       .start = 0x00,
+       .end = 0x0F,
+       .base = 0x04000000,
+       .check = simple_check,
+       .inb = simple_inb,
+       .inw = simple_inw,
+       .outb = simple_outb,
+       .outw = simple_outw,
+};
+#endif
+
+#ifdef CONFIG_NE2000
+/* NE2000 pc card NIC */
+static struct iop neiop = {
+       .start = 0x280,
+       .end = 0x29f,
+       .base = 0xb0600000 + 0x80,      /* soft 0x280 -> hard 0x300 */
+       .check = simple_check,
+       .inb = pcc_inb,
+       .inw = simple_inw,
+       .outb = pcc_outb,
+       .outw = simple_outw,
+};
+#endif
+
+#ifdef CONFIG_IDE
+/* CF in CF slot */
+static struct iop cfiop = {
+       .base = 0xb0600000,
+       .check = ide_check,
+       .inb = pcc_inb,
+       .inw = simple_inw,
+       .outb = pcc_outb,
+       .outw = simple_outw,
+};
+#endif
+
+static __inline__ struct iop *
+port2iop(unsigned long port)
+{
+       if (0) ;
+#if defined(CONFIG_SMC91X)
+       else if (laniop.check(&laniop, port))
+               return &laniop;
+#endif
+#if defined(CONFIG_NE2000)
+       else if (neiop.check(&neiop, port))
+               return &neiop;
+#endif
+#if defined(CONFIG_IDE)
+       else if (cfiop.check(&cfiop, port))
+               return &cfiop;
+#endif
+       else
+               return NULL;
+}
+
+static inline void
+delay(void)
+{
+       ctrl_inw(0xac000000);
+       ctrl_inw(0xac000000);
+}
+
+unsigned char
+sh7343se_inb(unsigned long port)
+{
+       struct iop *p = port2iop(port);
+       return (p->inb) (p, port);
+}
+
+unsigned char
+sh7343se_inb_p(unsigned long port)
+{
+       unsigned char v = sh7343se_inb(port);
+       delay();
+       return v;
+}
+
+unsigned short
+sh7343se_inw(unsigned long port)
+{
+       struct iop *p = port2iop(port);
+       return (p->inw) (p, port);
+}
+
+unsigned int
+sh7343se_inl(unsigned long port)
+{
+       badio(inl, port);
+}
+
+void
+sh7343se_outb(unsigned char value, unsigned long port)
+{
+       struct iop *p = port2iop(port);
+       (p->outb) (p, value, port);
+}
+
+void
+sh7343se_outb_p(unsigned char value, unsigned long port)
+{
+       sh7343se_outb(value, port);
+       delay();
+}
+
+void
+sh7343se_outw(unsigned short value, unsigned long port)
+{
+       struct iop *p = port2iop(port);
+       (p->outw) (p, value, port);
+}
+
+void
+sh7343se_outl(unsigned int value, unsigned long port)
+{
+       badio(outl, port);
+}
+
+void
+sh7343se_insb(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned char *a = addr;
+       struct iop *p = port2iop(port);
+       while (count--)
+               *a++ = (p->inb) (p, port);
+}
+
+void
+sh7343se_insw(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned short *a = addr;
+       struct iop *p = port2iop(port);
+       while (count--)
+               *a++ = (p->inw) (p, port);
+}
+
+void
+sh7343se_insl(unsigned long port, void *addr, unsigned long count)
+{
+       badio(insl, port);
+}
+
+void
+sh7343se_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned char *a = (unsigned char *) addr;
+       struct iop *p = port2iop(port);
+       while (count--)
+               (p->outb) (p, *a++, port);
+}
+
+void
+sh7343se_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned short *a = (unsigned short *) addr;
+       struct iop *p = port2iop(port);
+       while (count--)
+               (p->outw) (p, *a++, port);
+}
+
+void
+sh7343se_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       badio(outsw, port);
+}
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c
new file mode 100644 (file)
index 0000000..1112e86
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * linux/arch/sh/boards/se/7343/irq.c
+ *
+ * Copyright (C) 2008  Yoshihiro Shimoda
+ *
+ * Based on linux/arch/sh/boards/se/7722/irq.c
+ * Copyright (C) 2007  Nobuhiro Iwamatsu
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/se7343.h>
+
+static void disable_se7343_irq(unsigned int irq)
+{
+       unsigned int bit = irq - SE7343_FPGA_IRQ_BASE;
+       ctrl_outw(ctrl_inw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK);
+}
+
+static void enable_se7343_irq(unsigned int irq)
+{
+       unsigned int bit = irq - SE7343_FPGA_IRQ_BASE;
+       ctrl_outw(ctrl_inw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK);
+}
+
+static struct irq_chip se7343_irq_chip __read_mostly = {
+       .name           = "SE7343-FPGA",
+       .mask           = disable_se7343_irq,
+       .unmask         = enable_se7343_irq,
+       .mask_ack       = disable_se7343_irq,
+};
+
+static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
+{
+       unsigned short intv = ctrl_inw(PA_CPLD_ST);
+       struct irq_desc *ext_desc;
+       unsigned int ext_irq = SE7343_FPGA_IRQ_BASE;
+
+       intv &= (1 << SE7343_FPGA_IRQ_NR) - 1;
+
+       while (intv) {
+               if (intv & 1) {
+                       ext_desc = irq_desc + ext_irq;
+                       handle_level_irq(ext_irq, ext_desc);
+               }
+               intv >>= 1;
+               ext_irq++;
+       }
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_7343se_IRQ(void)
+{
+       int i;
+
+       ctrl_outw(0, PA_CPLD_IMSK);     /* disable all irqs */
+       ctrl_outw(0x2000, 0xb03fffec);  /* mrshpc irq enable */
+
+       for (i = 0; i < SE7343_FPGA_IRQ_NR; i++)
+               set_irq_chip_and_handler_name(SE7343_FPGA_IRQ_BASE + i,
+                                             &se7343_irq_chip,
+                                             handle_level_irq, "level");
+
+       set_irq_chained_handler(IRQ0_IRQ, se7343_irq_demux);
+       set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
+       set_irq_chained_handler(IRQ1_IRQ, se7343_irq_demux);
+       set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
+       set_irq_chained_handler(IRQ4_IRQ, se7343_irq_demux);
+       set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW);
+       set_irq_chained_handler(IRQ5_IRQ, se7343_irq_demux);
+       set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW);
+}
diff --git a/arch/sh/boards/mach-se/7343/setup.c b/arch/sh/boards/mach-se/7343/setup.c
new file mode 100644 (file)
index 0000000..59dc92e
--- /dev/null
@@ -0,0 +1,152 @@
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
+#include <machvec.h>
+#include <mach/se7343.h>
+#include <asm/heartbeat.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .start  = 0x10000000,
+               .end    = 0x1000000F,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               /*
+                * shared with other devices via externel
+                * interrupt controller in FPGA...
+                */
+               .start  = SMC_IRQ,
+               .end    = SMC_IRQ,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+       .resource       = smc91x_resources,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct mtd_partition nor_flash_partitions[] = {
+       {
+               .name           = "loader",
+               .offset         = 0x00000000,
+               .size           = 128 * 1024,
+       },
+       {
+               .name           = "rootfs",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 31 * 1024 * 1024,
+       },
+       {
+               .name           = "data",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data nor_flash_data = {
+       .width          = 2,
+       .parts          = nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
+};
+
+static struct resource nor_flash_resources[] = {
+       [0]     = {
+               .start  = 0x00000000,
+               .end    = 0x01ffffff,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device nor_flash_device = {
+       .name           = "physmap-flash",
+       .dev            = {
+               .platform_data  = &nor_flash_data,
+       },
+       .num_resources  = ARRAY_SIZE(nor_flash_resources),
+       .resource       = nor_flash_resources,
+};
+
+static struct platform_device *sh7343se_platform_devices[] __initdata = {
+       &smc91x_device,
+       &heartbeat_device,
+       &nor_flash_device,
+};
+
+static int __init sh7343se_devices_setup(void)
+{
+       return platform_add_devices(sh7343se_platform_devices,
+                                   ARRAY_SIZE(sh7343se_platform_devices));
+}
+device_initcall(sh7343se_devices_setup);
+
+/*
+ * Initialize the board
+ */
+static void __init sh7343se_setup(char **cmdline_p)
+{
+       ctrl_outw(0xf900, FPGA_OUT);    /* FPGA */
+
+       ctrl_outw(0x0002, PORT_PECR);   /* PORT E 1 = IRQ5 */
+       ctrl_outw(0x0020, PORT_PSELD);
+
+       printk(KERN_INFO "MS7343CP01 Setup...done\n");
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_7343se __initmv = {
+       .mv_name = "SolutionEngine 7343",
+       .mv_setup = sh7343se_setup,
+       .mv_nr_irqs = 108,
+       .mv_inb = sh7343se_inb,
+       .mv_inw = sh7343se_inw,
+       .mv_inl = sh7343se_inl,
+       .mv_outb = sh7343se_outb,
+       .mv_outw = sh7343se_outw,
+       .mv_outl = sh7343se_outl,
+
+       .mv_inb_p = sh7343se_inb_p,
+       .mv_inw_p = sh7343se_inw,
+       .mv_inl_p = sh7343se_inl,
+       .mv_outb_p = sh7343se_outb_p,
+       .mv_outw_p = sh7343se_outw,
+       .mv_outl_p = sh7343se_outl,
+
+       .mv_insb = sh7343se_insb,
+       .mv_insw = sh7343se_insw,
+       .mv_insl = sh7343se_insl,
+       .mv_outsb = sh7343se_outsb,
+       .mv_outsw = sh7343se_outsw,
+       .mv_outsl = sh7343se_outsl,
+
+       .mv_init_irq = init_7343se_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7619/Makefile b/arch/sh/boards/mach-se/7619/Makefile
new file mode 100644 (file)
index 0000000..d21775c
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the 7619 SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o
diff --git a/arch/sh/boards/mach-se/7619/setup.c b/arch/sh/boards/mach-se/7619/setup.c
new file mode 100644 (file)
index 0000000..1d0ef7f
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * arch/sh/boards/se/7619/setup.c
+ *
+ * Copyright (C) 2006 Yoshinori Sato
+ *
+ * Hitachi SH7619 SolutionEngine Support.
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <asm/machvec.h>
+
+/*
+ * The Machine Vector
+ */
+
+static struct sh_machine_vector mv_se __initmv = {
+       .mv_name                = "SolutionEngine",
+       .mv_nr_irqs             = 108,
+};
diff --git a/arch/sh/boards/mach-se/770x/Makefile b/arch/sh/boards/mach-se/770x/Makefile
new file mode 100644 (file)
index 0000000..8e624b0
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the 770x SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/mach-se/770x/io.c b/arch/sh/boards/mach-se/770x/io.c
new file mode 100644 (file)
index 0000000..b1ec085
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * I/O routine for Hitachi SolutionEngine.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <asm/io.h>
+#include <asm/se.h>
+
+/* MS7750 requires special versions of in*, out* routines, since
+   PC-like io ports are located at upper half byte of 16-bit word which
+   can be accessed only with 16-bit wide.  */
+
+static inline volatile __u16 *
+port2adr(unsigned int port)
+{
+       if (port & 0xff000000)
+               return ( volatile __u16 *) port;
+       if (port >= 0x2000)
+               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+       else if (port >= 0x1000)
+               return (volatile __u16 *) (PA_83902 + (port << 1));
+       else
+               return (volatile __u16 *) (PA_SUPERIO + (port << 1));
+}
+
+static inline int
+shifted_port(unsigned long port)
+{
+       /* For IDE registers, value is not shifted */
+       if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
+               return 0;
+       else
+               return 1;
+}
+
+unsigned char se_inb(unsigned long port)
+{
+       if (shifted_port(port))
+               return (*port2adr(port) >> 8);
+       else
+               return (*port2adr(port))&0xff;
+}
+
+unsigned char se_inb_p(unsigned long port)
+{
+       unsigned long v;
+
+       if (shifted_port(port))
+               v = (*port2adr(port) >> 8);
+       else
+               v = (*port2adr(port))&0xff;
+       ctrl_delay();
+       return v;
+}
+
+unsigned short se_inw(unsigned long port)
+{
+       if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+unsigned int se_inl(unsigned long port)
+{
+       maybebadio(port);
+       return 0;
+}
+
+void se_outb(unsigned char value, unsigned long port)
+{
+       if (shifted_port(port))
+               *(port2adr(port)) = value << 8;
+       else
+               *(port2adr(port)) = value;
+}
+
+void se_outb_p(unsigned char value, unsigned long port)
+{
+       if (shifted_port(port))
+               *(port2adr(port)) = value << 8;
+       else
+               *(port2adr(port)) = value;
+       ctrl_delay();
+}
+
+void se_outw(unsigned short value, unsigned long port)
+{
+       if (port >= 0x2000)
+               *port2adr(port) = value;
+       else
+               maybebadio(port);
+}
+
+void se_outl(unsigned int value, unsigned long port)
+{
+       maybebadio(port);
+}
+
+void se_insb(unsigned long port, void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       __u8 *ap = addr;
+
+       if (shifted_port(port)) {
+               while (count--)
+                       *ap++ = *p >> 8;
+       } else {
+               while (count--)
+                       *ap++ = *p;
+       }
+}
+
+void se_insw(unsigned long port, void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       __u16 *ap = addr;
+       while (count--)
+               *ap++ = *p;
+}
+
+void se_insl(unsigned long port, void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
+
+void se_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       const __u8 *ap = addr;
+
+       if (shifted_port(port)) {
+               while (count--)
+                       *p = *ap++ << 8;
+       } else {
+               while (count--)
+                       *p = *ap++;
+       }
+}
+
+void se_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+       volatile __u16 *p = port2adr(port);
+       const __u16 *ap = addr;
+
+       while (count--)
+               *p = *ap++;
+}
+
+void se_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
diff --git a/arch/sh/boards/mach-se/770x/irq.c b/arch/sh/boards/mach-se/770x/irq.c
new file mode 100644 (file)
index 0000000..cdb0807
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * linux/arch/sh/boards/se/770x/irq.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ * Copyright (C) 2006  Nobuhiro Iwamatsu
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/se.h>
+
+static struct ipr_data ipr_irq_table[] = {
+       /*
+       * Super I/O (Just mimic PC):
+       *  1: keyboard
+       *  3: serial 0
+       *  4: serial 1
+       *  5: printer
+       *  6: floppy
+       *  8: rtc
+       * 12: mouse
+       * 14: ide0
+       */
+#if defined(CONFIG_CPU_SUBTYPE_SH7705)
+       /* This is default value */
+       { 13, 0, 8,  0x0f-13, },
+       { 5 , 0, 4,  0x0f- 5, },
+       { 10, 1, 0,  0x0f-10, },
+       { 7 , 2, 4,  0x0f- 7, },
+       { 3 , 2, 0,  0x0f- 3, },
+       { 1 , 3, 12, 0x0f- 1, },
+       { 12, 3, 4,  0x0f-12, }, /* LAN */
+       { 2 , 4, 8,  0x0f- 2, }, /* PCIRQ2 */
+       { 6 , 4, 4,  0x0f- 6, }, /* PCIRQ1 */
+       { 14, 4, 0,  0x0f-14, }, /* PCIRQ0 */
+       { 0 , 5, 12, 0x0f   , }, 
+       { 4 , 5, 4,  0x0f- 4, },
+       { 8 , 6, 12, 0x0f- 8, },
+       { 9 , 6, 8,  0x0f- 9, },
+       { 11, 6, 4,  0x0f-11, },
+#else
+       { 14, 0,  8, 0x0f-14, },
+       { 12, 0,  4, 0x0f-12, },
+       {  8, 1,  4, 0x0f- 8, },
+       {  6, 2, 12, 0x0f- 6, },
+       {  5, 2,  8, 0x0f- 5, },
+       {  4, 2,  4, 0x0f- 4, },
+       {  3, 2,  0, 0x0f- 3, },
+       {  1, 3, 12, 0x0f- 1, },
+#if defined(CONFIG_STNIC)
+       /* ST NIC */
+       { 10, 3,  4, 0x0f-10, },        /* LAN */
+#endif
+       /* MRSHPC IRQs setting */
+       {  0, 4, 12, 0x0f- 0, },        /* PCIRQ3 */
+       { 11, 4,  8, 0x0f-11, },        /* PCIRQ2 */
+       {  9, 4,  4, 0x0f- 9, },        /* PCIRQ1 */
+       {  7, 4,  0, 0x0f- 7, },        /* PCIRQ0 */
+       /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
+       /* NOTE: #2 and #13 are not used on PC */
+       { 13, 6,  4, 0x0f-13, },        /* SLOTIRQ2 */
+       {  2, 6,  0, 0x0f- 2, },        /* SLOTIRQ1 */
+#endif
+};
+
+static unsigned long ipr_offsets[] = {
+       BCR_ILCRA,
+       BCR_ILCRB,
+       BCR_ILCRC,
+       BCR_ILCRD,
+       BCR_ILCRE,
+       BCR_ILCRF,
+       BCR_ILCRG,
+};
+
+static struct ipr_desc ipr_irq_desc = {
+       .ipr_offsets    = ipr_offsets,
+       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
+
+       .ipr_data       = ipr_irq_table,
+       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
+       .chip = {
+               .name   = "IPR-se770x",
+       },
+};
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se_IRQ(void)
+{
+       /* Disable all interrupts */
+       ctrl_outw(0, BCR_ILCRA);
+       ctrl_outw(0, BCR_ILCRB);
+       ctrl_outw(0, BCR_ILCRC);
+       ctrl_outw(0, BCR_ILCRD);
+       ctrl_outw(0, BCR_ILCRE);
+       ctrl_outw(0, BCR_ILCRF);
+       ctrl_outw(0, BCR_ILCRG);
+
+       register_ipr_controller(&ipr_irq_desc);
+}
diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/770x/setup.c
new file mode 100644 (file)
index 0000000..6c64d77
--- /dev/null
@@ -0,0 +1,222 @@
+/*
+ * linux/arch/sh/boards/se/770x/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <asm/se.h>
+#include <asm/io.h>
+#include <asm/smc37c93x.h>
+#include <asm/heartbeat.h>
+
+/*
+ * Configure the Super I/O chip
+ */
+static void __init smsc_config(int index, int data)
+{
+       outb_p(index, INDEX_PORT);
+       outb_p(data, DATA_PORT);
+}
+
+/* XXX: Another candidate for a more generic cchip machine vector */
+static void __init smsc_setup(char **cmdline_p)
+{
+       outb_p(CONFIG_ENTER, CONFIG_PORT);
+       outb_p(CONFIG_ENTER, CONFIG_PORT);
+
+       /* FDC */
+       smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
+
+       /* AUXIO (GPIO): to use IDE1 */
+       smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
+       smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
+       smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
+
+       /* COM1 */
+       smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IO_BASE_HI_INDEX, 0x03);
+       smsc_config(IO_BASE_LO_INDEX, 0xf8);
+       smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
+
+       /* COM2 */
+       smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IO_BASE_HI_INDEX, 0x02);
+       smsc_config(IO_BASE_LO_INDEX, 0xf8);
+       smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
+
+       /* RTC */
+       smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
+
+       /* XXX: PARPORT, KBD, and MOUSE will come here... */
+       outb_p(CONFIG_EXIT, CONFIG_PORT);
+}
+
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_MRSHPC_IO + 0x1f0,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start  = IRQ_CFCARD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+       .regsize        = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
+       defined(CONFIG_CPU_SUBTYPE_SH7712)
+/* SH771X Ethernet driver */
+static struct resource sh_eth0_resources[] = {
+       [0] = {
+               .start = SH_ETH0_BASE,
+               .end = SH_ETH0_BASE + 0x1B8,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = SH_ETH0_IRQ,
+               .end = SH_ETH0_IRQ,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_eth0_device = {
+       .name = "sh-eth",
+       .id     = 0,
+       .dev = {
+               .platform_data = PHY_ID,
+       },
+       .num_resources = ARRAY_SIZE(sh_eth0_resources),
+       .resource = sh_eth0_resources,
+};
+
+static struct resource sh_eth1_resources[] = {
+       [0] = {
+               .start = SH_ETH1_BASE,
+               .end = SH_ETH1_BASE + 0x1B8,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = SH_ETH1_IRQ,
+               .end = SH_ETH1_IRQ,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_eth1_device = {
+       .name = "sh-eth",
+       .id     = 1,
+       .dev = {
+               .platform_data = PHY_ID,
+       },
+       .num_resources = ARRAY_SIZE(sh_eth1_resources),
+       .resource = sh_eth1_resources,
+};
+#endif
+
+static struct platform_device *se_devices[] __initdata = {
+       &heartbeat_device,
+       &cf_ide_device,
+#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
+       defined(CONFIG_CPU_SUBTYPE_SH7712)
+       &sh_eth0_device,
+       &sh_eth1_device,
+#endif
+};
+
+static int __init se_devices_setup(void)
+{
+       return platform_add_devices(se_devices, ARRAY_SIZE(se_devices));
+}
+device_initcall(se_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_se __initmv = {
+       .mv_name                = "SolutionEngine",
+       .mv_setup               = smsc_setup,
+#if defined(CONFIG_CPU_SH4)
+       .mv_nr_irqs             = 48,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
+       .mv_nr_irqs             = 32,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
+       .mv_nr_irqs             = 61,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
+       .mv_nr_irqs             = 86,
+#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
+       .mv_nr_irqs             = 104,
+#endif
+
+       .mv_inb                 = se_inb,
+       .mv_inw                 = se_inw,
+       .mv_inl                 = se_inl,
+       .mv_outb                = se_outb,
+       .mv_outw                = se_outw,
+       .mv_outl                = se_outl,
+
+       .mv_inb_p               = se_inb_p,
+       .mv_inw_p               = se_inw,
+       .mv_inl_p               = se_inl,
+       .mv_outb_p              = se_outb_p,
+       .mv_outw_p              = se_outw,
+       .mv_outl_p              = se_outl,
+
+       .mv_insb                = se_insb,
+       .mv_insw                = se_insw,
+       .mv_insl                = se_insl,
+       .mv_outsb               = se_outsb,
+       .mv_outsw               = se_outsw,
+       .mv_outsl               = se_outsl,
+
+       .mv_init_irq            = init_se_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7721/Makefile b/arch/sh/boards/mach-se/7721/Makefile
new file mode 100644 (file)
index 0000000..7f09030
--- /dev/null
@@ -0,0 +1 @@
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7721/irq.c b/arch/sh/boards/mach-se/7721/irq.c
new file mode 100644 (file)
index 0000000..c4fdd62
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * linux/arch/sh/boards/se/7721/irq.c
+ *
+ * Copyright (C) 2008  Renesas Solutions Corp.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <asm/se7721.h>
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources */
+       MRSHPC,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(MRSHPC, MRSHPC_IRQ0),
+};
+
+static struct intc_prio_reg prio_registers[] __initdata = {
+       { FPGA_ILSR6, 0, 8, 4, /* IRLMSK */
+         { 0, MRSHPC } },
+};
+
+static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
+                        NULL, NULL, prio_registers, NULL);
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7721_IRQ(void)
+{
+       /* PPCR */
+       ctrl_outw(ctrl_inw(0xa4050118) & ~0x00ff, 0xa4050118);
+
+       register_intc_controller(&intc_desc);
+       intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
+}
diff --git a/arch/sh/boards/mach-se/7721/setup.c b/arch/sh/boards/mach-se/7721/setup.c
new file mode 100644 (file)
index 0000000..1be3e92
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * linux/arch/sh/boards/se/7721/setup.c
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ *
+ * Hitachi UL SolutionEngine 7721 Support.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <asm/se7721.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+       .regsize        = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_MRSHPC_IO + 0x1f0,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
+               .flags  = IORESOURCE_IO,
+       },
+       [2] = {
+               .start  = MRSHPC_IRQ0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct platform_device *se7721_devices[] __initdata = {
+       &cf_ide_device,
+       &heartbeat_device
+};
+
+static int __init se7721_devices_setup(void)
+{
+       return platform_add_devices(se7721_devices,
+               ARRAY_SIZE(se7721_devices));
+}
+device_initcall(se7721_devices_setup);
+
+static void __init se7721_setup(char **cmdline_p)
+{
+       /* for USB */
+       ctrl_outw(0x0000, 0xA405010C);  /* PGCR */
+       ctrl_outw(0x0000, 0xA405010E);  /* PHCR */
+       ctrl_outw(0x00AA, 0xA4050118);  /* PPCR */
+       ctrl_outw(0x0000, 0xA4050124);  /* PSELA */
+}
+
+/*
+ * The Machine Vector
+ */
+struct sh_machine_vector mv_se7721 __initmv = {
+       .mv_name                = "Solution Engine 7721",
+       .mv_setup               = se7721_setup,
+       .mv_nr_irqs             = 109,
+       .mv_init_irq            = init_se7721_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7722/Makefile b/arch/sh/boards/mach-se/7722/Makefile
new file mode 100644 (file)
index 0000000..8694373
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# Makefile for the HITACHI UL SolutionEngine 7722 specific parts of the kernel
+#
+# This file is subject to the terms and conditions of the GNU General Public
+# License.  See the file "COPYING" in the main directory of this archive
+# for more details.
+#
+#
+
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c
new file mode 100644 (file)
index 0000000..0b03f3f
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * linux/arch/sh/boards/se/7722/irq.c
+ *
+ * Copyright (C) 2007  Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7722 Support.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/se7722.h>
+
+static void disable_se7722_irq(unsigned int irq)
+{
+       unsigned int bit = irq - SE7722_FPGA_IRQ_BASE;
+       ctrl_outw(ctrl_inw(IRQ01_MASK) | 1 << bit, IRQ01_MASK);
+}
+
+static void enable_se7722_irq(unsigned int irq)
+{
+       unsigned int bit = irq - SE7722_FPGA_IRQ_BASE;
+       ctrl_outw(ctrl_inw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK);
+}
+
+static struct irq_chip se7722_irq_chip __read_mostly = {
+       .name           = "SE7722-FPGA",
+       .mask           = disable_se7722_irq,
+       .unmask         = enable_se7722_irq,
+       .mask_ack       = disable_se7722_irq,
+};
+
+static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
+{
+       unsigned short intv = ctrl_inw(IRQ01_STS);
+       struct irq_desc *ext_desc;
+       unsigned int ext_irq = SE7722_FPGA_IRQ_BASE;
+
+       intv &= (1 << SE7722_FPGA_IRQ_NR) - 1;
+
+       while (intv) {
+               if (intv & 1) {
+                       ext_desc = irq_desc + ext_irq;
+                       handle_level_irq(ext_irq, ext_desc);
+               }
+               intv >>= 1;
+               ext_irq++;
+       }
+}
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7722_IRQ(void)
+{
+       int i;
+
+       ctrl_outw(0, IRQ01_MASK);       /* disable all irqs */
+       ctrl_outw(0x2000, 0xb03fffec);  /* mrshpc irq enable */
+
+       for (i = 0; i < SE7722_FPGA_IRQ_NR; i++)
+               set_irq_chip_and_handler_name(SE7722_FPGA_IRQ_BASE + i,
+                                             &se7722_irq_chip,
+                                             handle_level_irq, "level");
+
+       set_irq_chained_handler(IRQ0_IRQ, se7722_irq_demux);
+       set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
+
+       set_irq_chained_handler(IRQ1_IRQ, se7722_irq_demux);
+       set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
+}
diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c
new file mode 100644 (file)
index 0000000..6e228ea
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * linux/arch/sh/boards/se/7722/setup.c
+ *
+ * Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7722 Support.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/input.h>
+#include <linux/smc91x.h>
+#include <asm/machvec.h>
+#include <asm/clock.h>
+#include <asm/se7722.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+#include <asm/sh_keysc.h>
+
+/* Heartbeat */
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+/* SMC91x */
+static struct smc91x_platdata smc91x_info = {
+       .flags = SMC91X_USE_16BIT,
+};
+
+static struct resource smc91x_eth_resources[] = {
+       [0] = {
+               .name   = "smc91x-regs" ,
+               .start  = PA_LAN + 0x300,
+               .end    = PA_LAN + 0x300 + 0x10 ,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = SMC_IRQ,
+               .end    = SMC_IRQ,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_eth_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+               .platform_data  = &smc91x_info,
+       },
+       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
+       .resource       = smc91x_eth_resources,
+};
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_MRSHPC_IO + 0x1f0,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
+               .end    = PA_MRSHPC_IO + 0x1f0 +8 + 0x206 + 8,
+               .flags  = IORESOURCE_IO,
+       },
+       [2] = {
+               .start  = MRSHPC_IRQ0,
+               .end    = MRSHPC_IRQ0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device  = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct sh_keysc_info sh_keysc_info = {
+       .mode = SH_KEYSC_MODE_1, /* KEYOUT0->5, KEYIN0->4 */
+       .scan_timing = 3,
+       .delay = 5,
+       .keycodes = { /* SW1 -> SW30 */
+               KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
+               KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
+               KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
+               KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
+               KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y,
+               KEY_Z,
+               KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE, /* life */
+       },
+};
+
+static struct resource sh_keysc_resources[] = {
+       [0] = {
+               .start  = 0x044b0000,
+               .end    = 0x044b000f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 79,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_keysc_device = {
+       .name           = "sh_keysc",
+       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
+       .resource       = sh_keysc_resources,
+       .dev    = {
+               .platform_data  = &sh_keysc_info,
+       },
+};
+
+static struct platform_device *se7722_devices[] __initdata = {
+       &heartbeat_device,
+       &smc91x_eth_device,
+       &cf_ide_device,
+       &sh_keysc_device,
+};
+
+static int __init se7722_devices_setup(void)
+{
+       clk_always_enable("mstp214"); /* KEYSC */
+
+       return platform_add_devices(se7722_devices,
+               ARRAY_SIZE(se7722_devices));
+}
+device_initcall(se7722_devices_setup);
+
+static void __init se7722_setup(char **cmdline_p)
+{
+       ctrl_outw(0x010D, FPGA_OUT);    /* FPGA */
+
+       ctrl_outw(0x0000, PORT_PECR);   /* PORT E 1 = IRQ5 ,E 0 = BS */
+       ctrl_outw(0x1000, PORT_PJCR);   /* PORT J 1 = IRQ1,J 0 =IRQ0 */
+
+       /* LCDC I/O */
+       ctrl_outw(0x0020, PORT_PSELD);
+
+       /* SIOF1*/
+       ctrl_outw(0x0003, PORT_PSELB);
+       ctrl_outw(0xe000, PORT_PSELC);
+       ctrl_outw(0x0000, PORT_PKCR);
+
+       /* LCDC */
+       ctrl_outw(0x4020, PORT_PHCR);
+       ctrl_outw(0x0000, PORT_PLCR);
+       ctrl_outw(0x0000, PORT_PMCR);
+       ctrl_outw(0x0002, PORT_PRCR);
+       ctrl_outw(0x0000, PORT_PXCR);   /* LCDC,CS6A */
+
+       /* KEYSC */
+       ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */
+       ctrl_outw(0x0000, PORT_PYCR);
+       ctrl_outw(0x0000, PORT_PZCR);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_se7722 __initmv = {
+       .mv_name                = "Solution Engine 7722" ,
+       .mv_setup               = se7722_setup ,
+       .mv_nr_irqs             = SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_NR,
+       .mv_init_irq            = init_se7722_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7751/Makefile b/arch/sh/boards/mach-se/7751/Makefile
new file mode 100644 (file)
index 0000000..dbc29f3
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Makefile for the 7751 SolutionEngine specific parts of the kernel
+#
+
+obj-y   := setup.o io.o irq.o
+
+obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/sh/boards/mach-se/7751/io.c b/arch/sh/boards/mach-se/7751/io.c
new file mode 100644 (file)
index 0000000..e8d846c
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routine for Hitachi 7751 SolutionEngine.
+ *
+ * Initial version only to support LAN access; some
+ * placeholder code from io_se.c left in with the
+ * expectation of later SuperIO and PCMCIA access.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/se7751.h>
+#include <asm/addrspace.h>
+
+static inline volatile u16 *port2adr(unsigned int port)
+{
+       if (port >= 0x2000)
+               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+       maybebadio((unsigned long)port);
+       return (volatile __u16*)port;
+}
+
+/*
+ * General outline: remap really low stuff [eventually] to SuperIO,
+ * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
+ * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
+ * should be way beyond the window, and is used  w/o translation for
+ * compatibility.
+ */
+unsigned char sh7751se_inb(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned char *)pci_ioaddr(port);
+       else
+               return (*port2adr(port)) & 0xff;
+}
+
+unsigned char sh7751se_inb_p(unsigned long port)
+{
+       unsigned char v;
+
+        if (PXSEG(port))
+                v = *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+                v = *(volatile unsigned char *)pci_ioaddr(port);
+       else
+               v = (*port2adr(port)) & 0xff;
+       ctrl_delay();
+       return v;
+}
+
+unsigned short sh7751se_inw(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned short *)port;
+       else if (is_pci_ioaddr(port))
+                return *(volatile unsigned short *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+unsigned int sh7751se_inl(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned long *)port;
+       else if (is_pci_ioaddr(port))
+                return *(volatile unsigned int *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+void sh7751se_outb(unsigned char value, unsigned long port)
+{
+
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else
+               *(port2adr(port)) = value;
+}
+
+void sh7751se_outb_p(unsigned char value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else
+               *(port2adr(port)) = value;
+       ctrl_delay();
+}
+
+void sh7751se_outw(unsigned short value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned short *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned short *)pci_ioaddr(port)) = value;
+       else if (port >= 0x2000)
+               *port2adr(port) = value;
+       else
+               maybebadio(port);
+}
+
+void sh7751se_outl(unsigned int value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned long *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned long*)pci_ioaddr(port)) = value;
+       else
+               maybebadio(port);
+}
+
+void sh7751se_insl(unsigned long port, void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
+
+void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
diff --git a/arch/sh/boards/mach-se/7751/irq.c b/arch/sh/boards/mach-se/7751/irq.c
new file mode 100644 (file)
index 0000000..c3d1259
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * linux/arch/sh/boards/se/7751/irq.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ * Modified for 7751 Solution Engine by
+ * Ian da Silva and Jeremy Siegel, 2001.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/irq.h>
+#include <asm/se7751.h>
+
+static struct ipr_data ipr_irq_table[] = {
+       { 13, 3, 3, 2 },
+       /* Add additional entries here as drivers are added and tested. */
+};
+
+static unsigned long ipr_offsets[] = {
+       BCR_ILCRA,
+       BCR_ILCRB,
+       BCR_ILCRC,
+       BCR_ILCRD,
+       BCR_ILCRE,
+       BCR_ILCRF,
+       BCR_ILCRG,
+};
+
+static struct ipr_desc ipr_irq_desc = {
+       .ipr_offsets    = ipr_offsets,
+       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
+
+       .ipr_data       = ipr_irq_table,
+       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
+
+       .chip = {
+               .name   = "IPR-se7751",
+       },
+};
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_7751se_IRQ(void)
+{
+       register_ipr_controller(&ipr_irq_desc);
+}
diff --git a/arch/sh/boards/mach-se/7751/pci.c b/arch/sh/boards/mach-se/7751/pci.c
new file mode 100644 (file)
index 0000000..203b292
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * linux/arch/sh/boards/se/7751/pci.c
+ *
+ * Author:  Ian DaSilva (idasilva@mvista.com)
+ *
+ * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * PCI initialization for the Hitachi SH7751 Solution Engine board (MS7751SE01)
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include "../../../drivers/pci/pci-sh7751.h"
+
+#define PCIMCR_MRSET_OFF       0xBFFFFFFF
+#define PCIMCR_RFSH_OFF                0xFFFFFFFB
+
+/*
+ * Only long word accesses of the PCIC's internal local registers and the
+ * configuration registers from the CPU is supported.
+ */
+#define PCIC_WRITE(x,v) writel((v), PCI_REG(x))
+#define PCIC_READ(x) readl(PCI_REG(x))
+
+/*
+ * Description:  This function sets up and initializes the pcic, sets
+ * up the BARS, maps the DRAM into the address space etc, etc.
+ */
+int __init pcibios_init_platform(void)
+{
+   unsigned long bcr1, wcr1, wcr2, wcr3, mcr;
+   unsigned short bcr2;
+
+   /*
+    * Initialize the slave bus controller on the pcic.  The values used
+    * here should not be hardcoded, but they should be taken from the bsc
+    * on the processor, to make this function as generic as possible.
+    * (i.e. Another sbc may usr different SDRAM timing settings -- in order
+    * for the pcic to work, its settings need to be exactly the same.)
+    */
+   bcr1 = (*(volatile unsigned long*)(SH7751_BCR1));
+   bcr2 = (*(volatile unsigned short*)(SH7751_BCR2));
+   wcr1 = (*(volatile unsigned long*)(SH7751_WCR1));
+   wcr2 = (*(volatile unsigned long*)(SH7751_WCR2));
+   wcr3 = (*(volatile unsigned long*)(SH7751_WCR3));
+   mcr = (*(volatile unsigned long*)(SH7751_MCR));
+
+   bcr1 = bcr1 | 0x00080000;  /* Enable Bit 19, BREQEN */
+   (*(volatile unsigned long*)(SH7751_BCR1)) = bcr1;   
+
+   bcr1 = bcr1 | 0x40080000;  /* Enable Bit 19 BREQEN, set PCIC to slave */
+   PCIC_WRITE(SH7751_PCIBCR1, bcr1);    /* PCIC BCR1 */
+   PCIC_WRITE(SH7751_PCIBCR2, bcr2);     /* PCIC BCR2 */
+   PCIC_WRITE(SH7751_PCIWCR1, wcr1);     /* PCIC WCR1 */
+   PCIC_WRITE(SH7751_PCIWCR2, wcr2);     /* PCIC WCR2 */
+   PCIC_WRITE(SH7751_PCIWCR3, wcr3);     /* PCIC WCR3 */
+   mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF;
+   PCIC_WRITE(SH7751_PCIMCR, mcr);      /* PCIC MCR */
+
+
+   /* Enable all interrupts, so we know what to fix */
+   PCIC_WRITE(SH7751_PCIINTM, 0x0000c3ff);
+   PCIC_WRITE(SH7751_PCIAINTM, 0x0000380f);
+
+   /* Set up standard PCI config registers */
+   PCIC_WRITE(SH7751_PCICONF1,         0xF39000C7); /* Bus Master, Mem & I/O access */
+   PCIC_WRITE(SH7751_PCICONF2,         0x00000000); /* PCI Class code & Revision ID */
+   PCIC_WRITE(SH7751_PCICONF4,         0xab000001); /* PCI I/O address (local regs) */
+   PCIC_WRITE(SH7751_PCICONF5,         0x0c000000); /* PCI MEM address (local RAM)  */
+   PCIC_WRITE(SH7751_PCICONF6,         0xd0000000); /* PCI MEM address (unused)     */
+   PCIC_WRITE(SH7751_PCICONF11, 0x35051054); /* PCI Subsystem ID & Vendor ID */
+   PCIC_WRITE(SH7751_PCILSR0, 0x03f00000);   /* MEM (full 64M exposed)       */
+   PCIC_WRITE(SH7751_PCILSR1, 0x00000000);   /* MEM (unused)                 */
+   PCIC_WRITE(SH7751_PCILAR0, 0x0c000000);   /* MEM (direct map from PCI)    */
+   PCIC_WRITE(SH7751_PCILAR1, 0x00000000);   /* MEM (unused)                 */
+
+   /* Now turn it on... */
+   PCIC_WRITE(SH7751_PCICR, 0xa5000001);
+
+   /*
+    * Set PCIMBR and PCIIOBR here, assuming a single window
+    * (16M MEM, 256K IO) is enough.  If a larger space is
+    * needed, the readx/writex and inx/outx functions will
+    * have to do more (e.g. setting registers for each call).
+    */
+
+   /*
+    * Set the MBR so PCI address is one-to-one with window,
+    * meaning all calls go straight through... use BUG_ON to
+    * catch erroneous assumption.
+    */
+   BUG_ON(PCIBIOS_MIN_MEM != SH7751_PCI_MEMORY_BASE);
+
+   PCIC_WRITE(SH7751_PCIMBR, PCIBIOS_MIN_MEM);
+
+   /* Set IOBR for window containing area specified in pci.h */
+   PCIC_WRITE(SH7751_PCIIOBR, (PCIBIOS_MIN_IO & SH7751_PCIIOBR_MASK));
+
+   /* All done, may as well say so... */
+   printk("SH7751 PCI: Finished initialization of the PCI controller\n");
+
+   return 1;
+}
+
+int __init pcibios_map_platform_irq(u8 slot, u8 pin)
+{
+        switch (slot) {
+        case 0: return 13;
+        case 1: return 13;     /* AMD Ethernet controller */
+        case 2: return -1;
+        case 3: return -1;
+        case 4: return -1;
+        default:
+                printk("PCI: Bad IRQ mapping request for slot %d\n", slot);
+                return -1;
+        }
+}
+
+static struct resource sh7751_io_resource = {
+       .name   = "SH7751 IO",
+       .start  = SH7751_PCI_IO_BASE,
+       .end    = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
+       .flags  = IORESOURCE_IO
+};
+
+static struct resource sh7751_mem_resource = {
+       .name   = "SH7751 mem",
+       .start  = SH7751_PCI_MEMORY_BASE,
+       .end    = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
+       .flags  = IORESOURCE_MEM
+};
+
+extern struct pci_ops sh7751_pci_ops;
+
+struct pci_channel board_pci_channels[] = {
+       { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
+       { NULL, NULL, NULL, 0, 0 },
+};
+
diff --git a/arch/sh/boards/mach-se/7751/setup.c b/arch/sh/boards/mach-se/7751/setup.c
new file mode 100644 (file)
index 0000000..deefbfd
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * linux/arch/sh/boards/se/7751/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SolutionEngine Support.
+ *
+ * Modified for 7751 Solution Engine by
+ * Ian da Silva and Jeremy Siegel, 2001.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <asm/se7751.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct platform_device *se7751_devices[] __initdata = {
+       &heartbeat_device,
+};
+
+static int __init se7751_devices_setup(void)
+{
+       return platform_add_devices(se7751_devices, ARRAY_SIZE(se7751_devices));
+}
+__initcall(se7751_devices_setup);
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_7751se __initmv = {
+       .mv_name                = "7751 SolutionEngine",
+       .mv_nr_irqs             = 72,
+
+       .mv_inb                 = sh7751se_inb,
+       .mv_inw                 = sh7751se_inw,
+       .mv_inl                 = sh7751se_inl,
+       .mv_outb                = sh7751se_outb,
+       .mv_outw                = sh7751se_outw,
+       .mv_outl                = sh7751se_outl,
+
+       .mv_inb_p               = sh7751se_inb_p,
+       .mv_inw_p               = sh7751se_inw,
+       .mv_inl_p               = sh7751se_inl,
+       .mv_outb_p              = sh7751se_outb_p,
+       .mv_outw_p              = sh7751se_outw,
+       .mv_outl_p              = sh7751se_outl,
+
+       .mv_insl                = sh7751se_insl,
+       .mv_outsl               = sh7751se_outsl,
+
+       .mv_init_irq            = init_7751se_IRQ,
+};
diff --git a/arch/sh/boards/mach-se/7780/Makefile b/arch/sh/boards/mach-se/7780/Makefile
new file mode 100644 (file)
index 0000000..6b88ada
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# Makefile for the HITACHI UL SolutionEngine 7780 specific parts of the kernel
+#
+# This file is subject to the terms and conditions of the GNU General Public
+# License.  See the file "COPYING" in the main directory of this archive
+# for more details.
+#
+#
+
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7780/irq.c b/arch/sh/boards/mach-se/7780/irq.c
new file mode 100644 (file)
index 0000000..6bd70da
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * linux/arch/sh/boards/se/7780/irq.c
+ *
+ * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7780 Support.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/se7780.h>
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7780_IRQ(void)
+{
+       /* enable all interrupt at FPGA */
+       ctrl_outw(0, FPGA_INTMSK1);
+       /* mask SM501 interrupt */
+       ctrl_outw((ctrl_inw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
+       /* enable all interrupt at FPGA */
+       ctrl_outw(0, FPGA_INTMSK2);
+
+       /* set FPGA INTSEL register */
+       /* FPGA + 0x06 */
+       ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) |
+               (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
+
+       /* FPGA + 0x08 */
+       ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
+               (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
+               (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
+               (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
+
+       /* FPGA + 0x0A */
+       ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
+
+       plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */
+}
diff --git a/arch/sh/boards/mach-se/7780/setup.c b/arch/sh/boards/mach-se/7780/setup.c
new file mode 100644 (file)
index 0000000..0f08ab3
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * linux/arch/sh/boards/se/7780/setup.c
+ *
+ * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
+ *
+ * Hitachi UL SolutionEngine 7780 Support.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <asm/se7780.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+
+/* Heartbeat */
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev = {
+               .platform_data = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+/* SMC91x */
+static struct resource smc91x_eth_resources[] = {
+       [0] = {
+               .name   = "smc91x-regs" ,
+               .start  = PA_LAN + 0x300,
+               .end    = PA_LAN + 0x300 + 0x10 ,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = SMC_IRQ,
+               .end    = SMC_IRQ,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_eth_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
+       .resource       = smc91x_eth_resources,
+};
+
+static struct platform_device *se7780_devices[] __initdata = {
+       &heartbeat_device,
+       &smc91x_eth_device,
+};
+
+static int __init se7780_devices_setup(void)
+{
+       return platform_add_devices(se7780_devices,
+               ARRAY_SIZE(se7780_devices));
+}
+device_initcall(se7780_devices_setup);
+
+#define GPIO_PHCR        0xFFEA000E
+#define GPIO_PMSELR      0xFFEA0080
+#define GPIO_PECR        0xFFEA0008
+
+static void __init se7780_setup(char **cmdline_p)
+{
+       /* "SH-Linux" on LED Display */
+       ctrl_outw( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
+       ctrl_outw( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
+       ctrl_outw( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
+       ctrl_outw( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
+       ctrl_outw( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
+       ctrl_outw( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
+       ctrl_outw( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
+       ctrl_outw( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
+
+       printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
+
+       /*
+        * PCI REQ/GNT setting
+        *   REQ0/GNT0 -> USB
+        *   REQ1/GNT1 -> PC Card
+        *   REQ2/GNT2 -> Serial ATA
+        *   REQ3/GNT3 -> PCI slot
+        */
+       ctrl_outw(0x0213, FPGA_REQSEL);
+
+       /* GPIO setting */
+       ctrl_outw(0x0000, GPIO_PECR);
+       ctrl_outw(ctrl_inw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
+       ctrl_outw(0x0c00, GPIO_PMSELR);
+
+       /* iVDR Power ON */
+       ctrl_outw(0x0001, FPGA_IVDRPW);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_se7780 __initmv = {
+       .mv_name                = "Solution Engine 7780" ,
+       .mv_setup               = se7780_setup ,
+       .mv_nr_irqs             = 111 ,
+       .mv_init_irq            = init_se7780_IRQ,
+};
diff --git a/arch/sh/boards/mach-sh03/Makefile b/arch/sh/boards/mach-sh03/Makefile
new file mode 100644 (file)
index 0000000..400306a
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the Interface (CTP/PCI-SH03) specific parts of the kernel
+#
+
+obj-y   := setup.o rtc.o
diff --git a/arch/sh/boards/mach-sh03/rtc.c b/arch/sh/boards/mach-sh03/rtc.c
new file mode 100644 (file)
index 0000000..0a9266b
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * linux/arch/sh/boards/sh03/rtc.c -- CTP/PCI-SH03 on-chip RTC support
+ *
+ *  Copyright (C) 2004  Saito.K & Jeanne(ksaito@interface.co.jp)
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/time.h>
+#include <linux/bcd.h>
+#include <linux/rtc.h>
+#include <linux/spinlock.h>
+#include <asm/io.h>
+#include <asm/rtc.h>
+
+#define RTC_BASE       0xb0000000
+#define RTC_SEC1       (RTC_BASE + 0)
+#define RTC_SEC10      (RTC_BASE + 1)
+#define RTC_MIN1       (RTC_BASE + 2)
+#define RTC_MIN10      (RTC_BASE + 3)
+#define RTC_HOU1       (RTC_BASE + 4)
+#define RTC_HOU10      (RTC_BASE + 5)
+#define RTC_WEE1       (RTC_BASE + 6)
+#define RTC_DAY1       (RTC_BASE + 7)
+#define RTC_DAY10      (RTC_BASE + 8)
+#define RTC_MON1       (RTC_BASE + 9)
+#define RTC_MON10      (RTC_BASE + 10)
+#define RTC_YEA1       (RTC_BASE + 11)
+#define RTC_YEA10      (RTC_BASE + 12)
+#define RTC_YEA100     (RTC_BASE + 13)
+#define RTC_YEA1000    (RTC_BASE + 14)
+#define RTC_CTL                (RTC_BASE + 15)
+#define RTC_BUSY       1
+#define RTC_STOP       2
+
+extern spinlock_t rtc_lock;
+
+unsigned long get_cmos_time(void)
+{
+       unsigned int year, mon, day, hour, min, sec;
+
+       spin_lock(&rtc_lock);
+ again:
+       do {
+               sec  = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10;
+               min  = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
+               hour = (ctrl_inb(RTC_HOU1) & 0xf) + (ctrl_inb(RTC_HOU10) & 0xf) * 10;
+               day  = (ctrl_inb(RTC_DAY1) & 0xf) + (ctrl_inb(RTC_DAY10) & 0xf) * 10;
+               mon  = (ctrl_inb(RTC_MON1) & 0xf) + (ctrl_inb(RTC_MON10) & 0xf) * 10;
+               year = (ctrl_inb(RTC_YEA1) & 0xf) + (ctrl_inb(RTC_YEA10) & 0xf) * 10
+                    + (ctrl_inb(RTC_YEA100 ) & 0xf) * 100
+                    + (ctrl_inb(RTC_YEA1000) & 0xf) * 1000;
+       } while (sec != (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10);
+       if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
+           hour > 23 || min > 59 || sec > 59) {
+               printk(KERN_ERR
+                      "SH-03 RTC: invalid value, resetting to 1 Jan 2000\n");
+               printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n",
+                      year, mon, day, hour, min, sec);
+
+               ctrl_outb(0, RTC_SEC1); ctrl_outb(0, RTC_SEC10);
+               ctrl_outb(0, RTC_MIN1); ctrl_outb(0, RTC_MIN10);
+               ctrl_outb(0, RTC_HOU1); ctrl_outb(0, RTC_HOU10);
+               ctrl_outb(6, RTC_WEE1);
+               ctrl_outb(1, RTC_DAY1); ctrl_outb(0, RTC_DAY10);
+               ctrl_outb(1, RTC_MON1); ctrl_outb(0, RTC_MON10);
+               ctrl_outb(0, RTC_YEA1); ctrl_outb(0, RTC_YEA10);
+               ctrl_outb(0, RTC_YEA100);
+               ctrl_outb(2, RTC_YEA1000);
+               ctrl_outb(0, RTC_CTL);
+               goto again;
+       }
+
+       spin_unlock(&rtc_lock);
+       return mktime(year, mon, day, hour, min, sec);
+}
+
+void sh03_rtc_gettimeofday(struct timespec *tv)
+{
+
+       tv->tv_sec = get_cmos_time();
+       tv->tv_nsec = 0;
+}
+
+static int set_rtc_mmss(unsigned long nowtime)
+{
+       int retval = 0;
+       int real_seconds, real_minutes, cmos_minutes;
+       int i;
+
+       /* gets recalled with irq locally disabled */
+       spin_lock(&rtc_lock);
+       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
+               if (!(ctrl_inb(RTC_CTL) & RTC_BUSY))
+                       break;
+       cmos_minutes = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
+       real_seconds = nowtime % 60;
+       real_minutes = nowtime / 60;
+       if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
+               real_minutes += 30;             /* correct for half hour time zone */
+       real_minutes %= 60;
+
+       if (abs(real_minutes - cmos_minutes) < 30) {
+               ctrl_outb(real_seconds % 10, RTC_SEC1);
+               ctrl_outb(real_seconds / 10, RTC_SEC10);
+               ctrl_outb(real_minutes % 10, RTC_MIN1);
+               ctrl_outb(real_minutes / 10, RTC_MIN10);
+       } else {
+               printk(KERN_WARNING
+                      "set_rtc_mmss: can't update from %d to %d\n",
+                      cmos_minutes, real_minutes);
+               retval = -1;
+       }
+       spin_unlock(&rtc_lock);
+
+       return retval;
+}
+
+int sh03_rtc_settimeofday(const time_t secs)
+{
+       unsigned long nowtime = secs;
+
+       return set_rtc_mmss(nowtime);
+}
+
+void sh03_time_init(void)
+{
+       rtc_sh_get_time = sh03_rtc_gettimeofday;
+       rtc_sh_set_time = sh03_rtc_settimeofday;
+}
diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c
new file mode 100644 (file)
index 0000000..cd9cff1
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * linux/arch/sh/boards/sh03/setup.c
+ *
+ * Copyright (C) 2004  Interface Co.,Ltd. Saito.K
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/pci.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <asm/rtc.h>
+#include <mach/io.h>
+#include <mach/sh03.h>
+#include <asm/addrspace.h>
+
+static void __init init_sh03_IRQ(void)
+{
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+extern void *cf_io_base;
+
+static void __iomem *sh03_ioport_map(unsigned long port, unsigned int size)
+{
+       if (PXSEG(port))
+               return (void __iomem *)port;
+       /* CompactFlash (IDE) */
+       if (((port >= 0x1f0) && (port <= 0x1f7)) || (port == 0x3f6))
+               return (void __iomem *)((unsigned long)cf_io_base + port);
+
+        return (void __iomem *)(port + PCI_IO_BASE);
+}
+
+/* arch/sh/boards/sh03/rtc.c */
+void sh03_time_init(void);
+
+static void __init sh03_setup(char **cmdline_p)
+{
+       board_time_init = sh03_time_init;
+}
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = 0xa0800000,
+               .end    = 0xa0800000,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct platform_device *sh03_devices[] __initdata = {
+       &heartbeat_device,
+};
+
+static int __init sh03_devices_setup(void)
+{
+       return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
+}
+__initcall(sh03_devices_setup);
+
+static struct sh_machine_vector mv_sh03 __initmv = {
+       .mv_name                = "Interface (CTP/PCI-SH03)",
+       .mv_setup               = sh03_setup,
+       .mv_nr_irqs             = 48,
+       .mv_ioport_map          = sh03_ioport_map,
+       .mv_init_irq            = init_sh03_IRQ,
+};
diff --git a/arch/sh/boards/mach-sh7763rdp/Makefile b/arch/sh/boards/mach-sh7763rdp/Makefile
new file mode 100644 (file)
index 0000000..f6c0b55
--- /dev/null
@@ -0,0 +1 @@
+obj-y    := setup.o irq.o
diff --git a/arch/sh/boards/mach-sh7763rdp/irq.c b/arch/sh/boards/mach-sh7763rdp/irq.c
new file mode 100644 (file)
index 0000000..fd850ba
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * linux/arch/sh/boards/renesas/sh7763rdp/irq.c
+ *
+ * Renesas Solutions SH7763RDP Support.
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ * Copyright (C) 2008  Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/sh7763rdp.h>
+
+#define INTC_BASE              (0xFFD00000)
+#define INTC_INT2PRI7   (INTC_BASE+0x4001C)
+#define INTC_INT2MSKCR (INTC_BASE+0x4003C)
+#define INTC_INT2MSKCR1        (INTC_BASE+0x400D4)
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_sh7763rdp_IRQ(void)
+{
+       /* GPIO enabled */
+       ctrl_outl(1 << 25, INTC_INT2MSKCR);
+
+       /* enable GPIO interrupts */
+       ctrl_outl((ctrl_inl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000,
+                 INTC_INT2PRI7);
+
+       /* USBH enabled */
+       ctrl_outl(1 << 17, INTC_INT2MSKCR1);
+
+       /* GETHER enabled */
+       ctrl_outl(1 << 16, INTC_INT2MSKCR1);
+
+       /* DMAC enabled */
+       ctrl_outl(1 << 8, INTC_INT2MSKCR);
+}
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
new file mode 100644 (file)
index 0000000..925f16a
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * linux/arch/sh/boards/renesas/sh7763rdp/setup.c
+ *
+ * Renesas Solutions sh7763rdp board
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/mtd/physmap.h>
+#include <asm/io.h>
+#include <asm/sh7763rdp.h>
+
+/* NOR Flash */
+static struct mtd_partition sh7763rdp_nor_flash_partitions[] = {
+       {
+               .name = "U-Boot",
+               .offset = 0,
+               .size = (2 * 128 * 1024),
+               .mask_flags = MTD_WRITEABLE,    /* Read-only */
+       }, {
+               .name = "Linux-Kernel",
+               .offset = MTDPART_OFS_APPEND,
+               .size = (20 * 128 * 1024),
+       }, {
+               .name = "Root Filesystem",
+               .offset = MTDPART_OFS_APPEND,
+               .size = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data sh7763rdp_nor_flash_data = {
+       .width = 2,
+       .parts = sh7763rdp_nor_flash_partitions,
+       .nr_parts = ARRAY_SIZE(sh7763rdp_nor_flash_partitions),
+};
+
+static struct resource sh7763rdp_nor_flash_resources[] = {
+       [0] = {
+               .name = "NOR Flash",
+               .start = 0,
+               .end = (64 * 1024 * 1024),
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device sh7763rdp_nor_flash_device = {
+       .name = "physmap-flash",
+       .resource = sh7763rdp_nor_flash_resources,
+       .num_resources = ARRAY_SIZE(sh7763rdp_nor_flash_resources),
+       .dev = {
+               .platform_data = &sh7763rdp_nor_flash_data,
+       },
+};
+
+static struct platform_device *sh7763rdp_devices[] __initdata = {
+       &sh7763rdp_nor_flash_device,
+};
+
+static int __init sh7763rdp_devices_setup(void)
+{
+       return platform_add_devices(sh7763rdp_devices,
+                                   ARRAY_SIZE(sh7763rdp_devices));
+}
+__initcall(sh7763rdp_devices_setup);
+
+static void __init sh7763rdp_setup(char **cmdline_p)
+{
+       /* Board version check */
+       if (ctrl_inw(CPLD_BOARD_ID_ERV_REG) == 0xECB1)
+               printk(KERN_INFO "RTE Standard Configuration\n");
+       else
+               printk(KERN_INFO "RTA Standard Configuration\n");
+
+       /* USB pin select bits (clear bit 5-2 to 0) */
+       ctrl_outw((ctrl_inw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2);
+       /* USBH setup port I controls to other (clear bits 4-9 to 0) */
+       ctrl_outw(ctrl_inw(PORT_PICR) & 0xFC0F, PORT_PICR);
+
+       /* Select USB Host controller */
+       ctrl_outw(0x00, USB_USBHSC);
+
+       /* For LCD */
+       /* set PTJ7-1, bits 15-2 of PJCR to 0 */
+       ctrl_outw(ctrl_inw(PORT_PJCR) & 0x0003, PORT_PJCR);
+       /* set PTI5, bits 11-10 of PICR to 0 */
+       ctrl_outw(ctrl_inw(PORT_PICR) & 0xF3FF, PORT_PICR);
+       ctrl_outw(0, PORT_PKCR);
+       ctrl_outw(0, PORT_PLCR);
+       /* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */
+       ctrl_outw((ctrl_inw(PORT_PSEL2) & 0x00C0), PORT_PSEL2);
+       /* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */
+       ctrl_outw((ctrl_inw(PORT_PSEL3) & 0x0700), PORT_PSEL3);
+
+       /* For HAC */
+       /* bit3-0  0100:HAC & SSI1 enable */
+       ctrl_outw((ctrl_inw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1);
+       /* bit14      1:SSI_HAC_CLK enable */
+       ctrl_outw(ctrl_inw(PORT_PSEL4) | 0x4000, PORT_PSEL4);
+
+       /* SH-Ether */
+       ctrl_outw((ctrl_inw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1);
+       ctrl_outw(0x0, PORT_PFCR);
+       ctrl_outw(0x0, PORT_PFCR);
+       ctrl_outw(0x0, PORT_PFCR);
+
+       /* MMC */
+       /*selects SCIF and MMC other functions */
+       ctrl_outw(0x0001, PORT_PSEL0);
+       /* MMC clock operates */
+       ctrl_outl(ctrl_inl(MSTPCR1) & ~0x8, MSTPCR1);
+       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x3000, PORT_PACR);
+       ctrl_outw(ctrl_inw(PORT_PCCR) & ~0xCFC3, PORT_PCCR);
+}
+
+static struct sh_machine_vector mv_sh7763rdp __initmv = {
+       .mv_name = "sh7763drp",
+       .mv_setup = sh7763rdp_setup,
+       .mv_nr_irqs = 112,
+       .mv_init_irq = init_sh7763rdp_IRQ,
+};
diff --git a/arch/sh/boards/mach-sh7785lcr/Makefile b/arch/sh/boards/mach-sh7785lcr/Makefile
new file mode 100644 (file)
index 0000000..7703756
--- /dev/null
@@ -0,0 +1 @@
+obj-y   := setup.o
diff --git a/arch/sh/boards/mach-sh7785lcr/setup.c b/arch/sh/boards/mach-sh7785lcr/setup.c
new file mode 100644 (file)
index 0000000..b95d674
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+ * Renesas Technology Corp. R0P7785LC0011RL Support.
+ *
+ * Copyright (C) 2008  Yoshihiro Shimoda
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/sm501.h>
+#include <linux/sm501-regs.h>
+#include <linux/fb.h>
+#include <linux/mtd/physmap.h>
+#include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/i2c-pca-platform.h>
+#include <linux/i2c-algo-pca.h>
+#include <asm/heartbeat.h>
+#include <asm/sh7785lcr.h>
+
+/*
+ * NOTE: This board has 2 physical memory maps.
+ *      Please look at include/asm-sh/sh7785lcr.h or hardware manual.
+ */
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PLD_LEDCR,
+               .end    = PLD_LEDCR,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct heartbeat_data heartbeat_data = {
+       .regsize = 8,
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct mtd_partition nor_flash_partitions[] = {
+       {
+               .name           = "loader",
+               .offset         = 0x00000000,
+               .size           = 512 * 1024,
+       },
+       {
+               .name           = "bootenv",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 512 * 1024,
+       },
+       {
+               .name           = "kernel",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 4 * 1024 * 1024,
+       },
+       {
+               .name           = "data",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data nor_flash_data = {
+       .width          = 4,
+       .parts          = nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
+};
+
+static struct resource nor_flash_resources[] = {
+       [0]     = {
+               .start  = NOR_FLASH_ADDR,
+               .end    = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device nor_flash_device = {
+       .name           = "physmap-flash",
+       .dev            = {
+               .platform_data  = &nor_flash_data,
+       },
+       .num_resources  = ARRAY_SIZE(nor_flash_resources),
+       .resource       = nor_flash_resources,
+};
+
+static struct resource r8a66597_usb_host_resources[] = {
+       [0] = {
+               .name   = "r8a66597_hcd",
+               .start  = R8A66597_ADDR,
+               .end    = R8A66597_ADDR + R8A66597_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "r8a66597_hcd",
+               .start  = 2,
+               .end    = 2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device r8a66597_usb_host_device = {
+       .name           = "r8a66597_hcd",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
+       .resource       = r8a66597_usb_host_resources,
+};
+
+static struct resource sm501_resources[] = {
+       [0]     = {
+               .start  = SM107_MEM_ADDR,
+               .end    = SM107_MEM_ADDR + SM107_MEM_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1]     = {
+               .start  = SM107_REG_ADDR,
+               .end    = SM107_REG_ADDR + SM107_REG_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2]     = {
+               .start  = 10,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct fb_videomode sm501_default_mode_crt = {
+       .pixclock       = 35714,        /* 28MHz */
+       .xres           = 640,
+       .yres           = 480,
+       .left_margin    = 105,
+       .right_margin   = 16,
+       .upper_margin   = 33,
+       .lower_margin   = 10,
+       .hsync_len      = 39,
+       .vsync_len      = 2,
+       .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+};
+
+static struct fb_videomode sm501_default_mode_pnl = {
+       .pixclock       = 40000,        /* 25MHz */
+       .xres           = 640,
+       .yres           = 480,
+       .left_margin    = 2,
+       .right_margin   = 16,
+       .upper_margin   = 33,
+       .lower_margin   = 10,
+       .hsync_len      = 39,
+       .vsync_len      = 2,
+       .sync           = 0,
+};
+
+static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
+       .def_bpp        = 16,
+       .def_mode       = &sm501_default_mode_pnl,
+       .flags          = SM501FB_FLAG_USE_INIT_MODE |
+                         SM501FB_FLAG_USE_HWCURSOR |
+                         SM501FB_FLAG_USE_HWACCEL |
+                         SM501FB_FLAG_DISABLE_AT_EXIT |
+                         SM501FB_FLAG_PANEL_NO_VBIASEN,
+};
+
+static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
+       .def_bpp        = 16,
+       .def_mode       = &sm501_default_mode_crt,
+       .flags          = SM501FB_FLAG_USE_INIT_MODE |
+                         SM501FB_FLAG_USE_HWCURSOR |
+                         SM501FB_FLAG_USE_HWACCEL |
+                         SM501FB_FLAG_DISABLE_AT_EXIT,
+};
+
+static struct sm501_platdata_fb sm501_fb_pdata = {
+       .fb_route       = SM501_FB_OWN,
+       .fb_crt         = &sm501_pdata_fbsub_crt,
+       .fb_pnl         = &sm501_pdata_fbsub_pnl,
+};
+
+static struct sm501_initdata sm501_initdata = {
+       .gpio_high      = {
+               .set    = 0x00001fe0,
+               .mask   = 0x0,
+       },
+       .devices        = 0,
+       .mclk           = 84 * 1000000,
+       .m1xclk         = 112 * 1000000,
+};
+
+static struct sm501_platdata sm501_platform_data = {
+       .init           = &sm501_initdata,
+       .fb             = &sm501_fb_pdata,
+};
+
+static struct platform_device sm501_device = {
+       .name           = "sm501",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &sm501_platform_data,
+       },
+       .num_resources  = ARRAY_SIZE(sm501_resources),
+       .resource       = sm501_resources,
+};
+
+static struct resource i2c_resources[] = {
+       [0] = {
+               .start  = PCA9564_ADDR,
+               .end    = PCA9564_ADDR + PCA9564_SIZE - 1,
+               .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
+       },
+       [1] = {
+               .start  = 12,
+               .end    = 12,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
+       .gpio                   = 0,
+       .i2c_clock_speed        = I2C_PCA_CON_330kHz,
+       .timeout                = 100,
+};
+
+static struct platform_device i2c_device = {
+       .name           = "i2c-pca-platform",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &i2c_platform_data,
+       },
+       .num_resources  = ARRAY_SIZE(i2c_resources),
+       .resource       = i2c_resources,
+};
+
+static struct platform_device *sh7785lcr_devices[] __initdata = {
+       &heartbeat_device,
+       &nor_flash_device,
+       &r8a66597_usb_host_device,
+       &sm501_device,
+       &i2c_device,
+};
+
+static struct i2c_board_info __initdata sh7785lcr_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("r2025sd", 0x32),
+       },
+};
+
+static int __init sh7785lcr_devices_setup(void)
+{
+       i2c_register_board_info(0, sh7785lcr_i2c_devices,
+                               ARRAY_SIZE(sh7785lcr_i2c_devices));
+
+       return platform_add_devices(sh7785lcr_devices,
+                                   ARRAY_SIZE(sh7785lcr_devices));
+}
+__initcall(sh7785lcr_devices_setup);
+
+/* Initialize IRQ setting */
+void __init init_sh7785lcr_IRQ(void)
+{
+       plat_irq_setup_pins(IRQ_MODE_IRQ7654);
+       plat_irq_setup_pins(IRQ_MODE_IRQ3210);
+}
+
+static void sh7785lcr_power_off(void)
+{
+       ctrl_outb(0x01, P2SEGADDR(PLD_POFCR));
+}
+
+/* Initialize the board */
+static void __init sh7785lcr_setup(char **cmdline_p)
+{
+       void __iomem *sm501_reg;
+
+       printk(KERN_INFO "Renesas Technology Corp. R0P7785LC0011RL support.\n");
+
+       pm_power_off = sh7785lcr_power_off;
+
+       /* sm501 DRAM configuration */
+       sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
+       writel(0x000307c2, sm501_reg);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_sh7785lcr __initmv = {
+       .mv_name                = "SH7785LCR",
+       .mv_setup               = sh7785lcr_setup,
+       .mv_init_irq            = init_sh7785lcr_IRQ,
+};
+
diff --git a/arch/sh/boards/mach-shmin/Makefile b/arch/sh/boards/mach-shmin/Makefile
new file mode 100644 (file)
index 0000000..3190cc7
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the SHMIN board.
+#
+
+obj-y   := setup.o
diff --git a/arch/sh/boards/mach-shmin/setup.c b/arch/sh/boards/mach-shmin/setup.c
new file mode 100644 (file)
index 0000000..16e5dae
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * arch/sh/boards/shmin/setup.c
+ *
+ * Copyright (C) 2006 Takashi YOSHII
+ *
+ * SHMIN Support.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/machvec.h>
+#include <asm/shmin.h>
+#include <asm/clock.h>
+#include <asm/io.h>
+
+#define PFC_PHCR       0xa400010eUL
+#define INTC_ICR1      0xa4000010UL
+
+static void __init init_shmin_irq(void)
+{
+       ctrl_outw(0x2a00, PFC_PHCR);    // IRQ0-3=IRQ
+       ctrl_outw(0x0aaa, INTC_ICR1);   // IRQ0-3=IRQ-mode,Low-active.
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size)
+{
+       static int dummy;
+
+       if ((port & ~0x1f) == SHMIN_NE_BASE)
+               return (void __iomem *)(SHMIN_IO_BASE + port);
+
+       dummy = 0;
+
+       return &dummy;
+
+}
+
+static struct sh_machine_vector mv_shmin __initmv = {
+       .mv_name        = "SHMIN",
+       .mv_init_irq    = init_shmin_irq,
+       .mv_ioport_map  = shmin_ioport_map,
+};
diff --git a/arch/sh/boards/mach-snapgear/Makefile b/arch/sh/boards/mach-snapgear/Makefile
new file mode 100644 (file)
index 0000000..d2d2f4b
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the SnapGear specific parts of the kernel
+#
+
+obj-y   := setup.o io.o
diff --git a/arch/sh/boards/mach-snapgear/io.c b/arch/sh/boards/mach-snapgear/io.c
new file mode 100644 (file)
index 0000000..0f48242
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routine for Hitachi 7751 SolutionEngine.
+ *
+ * Initial version only to support LAN access; some
+ * placeholder code from io_se.c left in with the
+ * expectation of later SuperIO and PCMCIA access.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/addrspace.h>
+
+#ifdef CONFIG_SH_SECUREEDGE5410
+unsigned short secureedge5410_ioport;
+#endif
+
+static inline volatile __u16 *port2adr(unsigned int port)
+{
+       maybebadio((unsigned long)port);
+       return (volatile __u16*)port;
+}
+
+/*
+ * General outline: remap really low stuff [eventually] to SuperIO,
+ * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
+ * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
+ * should be way beyond the window, and is used  w/o translation for
+ * compatibility.
+ */
+unsigned char snapgear_inb(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned char *)pci_ioaddr(port);
+       else
+               return (*port2adr(port)) & 0xff;
+}
+
+unsigned char snapgear_inb_p(unsigned long port)
+{
+       unsigned char v;
+
+       if (PXSEG(port))
+               v = *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+               v = *(volatile unsigned char *)pci_ioaddr(port);
+       else
+               v = (*port2adr(port))&0xff;
+       ctrl_delay();
+       return v;
+}
+
+unsigned short snapgear_inw(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned short *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned short *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+unsigned int snapgear_inl(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned long *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned int *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+void snapgear_outb(unsigned char value, unsigned long port)
+{
+
+       if (PXSEG(port))
+               *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else
+               *(port2adr(port)) = value;
+}
+
+void snapgear_outb_p(unsigned char value, unsigned long port)
+{
+       if (PXSEG(port))
+               *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else
+               *(port2adr(port)) = value;
+       ctrl_delay();
+}
+
+void snapgear_outw(unsigned short value, unsigned long port)
+{
+       if (PXSEG(port))
+               *(volatile unsigned short *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned short *)pci_ioaddr(port)) = value;
+       else if (port >= 0x2000)
+               *port2adr(port) = value;
+       else
+               maybebadio(port);
+}
+
+void snapgear_outl(unsigned int value, unsigned long port)
+{
+       if (PXSEG(port))
+               *(volatile unsigned long *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned long*)pci_ioaddr(port)) = value;
+       else
+               maybebadio(port);
+}
+
+void snapgear_insl(unsigned long port, void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
+
+void snapgear_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
diff --git a/arch/sh/boards/mach-snapgear/setup.c b/arch/sh/boards/mach-snapgear/setup.c
new file mode 100644 (file)
index 0000000..a5e349d
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * linux/arch/sh/boards/snapgear/setup.c
+ *
+ * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
+ * Copyright (C) 2003  Paul Mundt <lethal@linux-sh.org>
+ *
+ * Based on files with the following comments:
+ *
+ *           Copyright (C) 2000  Kazumoto Kojima
+ *
+ *           Modified for 7751 Solution Engine by
+ *           Ian da Silva and Jeremy Siegel, 2001.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/timer.h>
+#include <linux/delay.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <asm/machvec.h>
+#include <asm/snapgear.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <cpu/timer.h>
+
+/*
+ * EraseConfig handling functions
+ */
+
+static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
+{
+       (void)ctrl_inb(0xb8000000);     /* dummy read */
+
+       printk("SnapGear: erase switch interrupt!\n");
+
+       return IRQ_HANDLED;
+}
+
+static int __init eraseconfig_init(void)
+{
+       printk("SnapGear: EraseConfig init\n");
+       /* Setup "EraseConfig" switch on external IRQ 0 */
+       if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED,
+                               "Erase Config", NULL))
+               printk("SnapGear: failed to register IRQ%d for Reset witch\n",
+                               IRL0_IRQ);
+       else
+               printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
+                               IRL0_IRQ);
+       return(0);
+}
+
+module_init(eraseconfig_init);
+
+/****************************************************************************/
+/*
+ * Initialize IRQ setting
+ *
+ * IRL0 = erase switch
+ * IRL1 = eth0
+ * IRL2 = eth1
+ * IRL3 = crypto
+ */
+
+static void __init init_snapgear_IRQ(void)
+{
+       printk("Setup SnapGear IRQ/IPR ...\n");
+       /* enable individual interrupt mode for externals */
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+/*
+ * The Machine Vector
+ */
+static struct sh_machine_vector mv_snapgear __initmv = {
+       .mv_name                = "SnapGear SecureEdge5410",
+       .mv_nr_irqs             = 72,
+
+       .mv_inb                 = snapgear_inb,
+       .mv_inw                 = snapgear_inw,
+       .mv_inl                 = snapgear_inl,
+       .mv_outb                = snapgear_outb,
+       .mv_outw                = snapgear_outw,
+       .mv_outl                = snapgear_outl,
+
+       .mv_inb_p               = snapgear_inb_p,
+       .mv_inw_p               = snapgear_inw,
+       .mv_inl_p               = snapgear_inl,
+       .mv_outb_p              = snapgear_outb_p,
+       .mv_outw_p              = snapgear_outw,
+       .mv_outl_p              = snapgear_outl,
+
+       .mv_init_irq            = init_snapgear_IRQ,
+};
diff --git a/arch/sh/boards/mach-systemh/Makefile b/arch/sh/boards/mach-systemh/Makefile
new file mode 100644 (file)
index 0000000..2cc6a23
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Makefile for the SystemH specific parts of the kernel
+#
+
+obj-y   := setup.o irq.o io.o
+
+# XXX: This wants to be consolidated in arch/sh/drivers/pci, and more
+# importantly, with the generic sh7751_pcic_init() code. For now, we'll
+# just abuse the hell out of kbuild, because we can..
+
+obj-$(CONFIG_PCI) += pci.o
+pci-y := ../../se/7751/pci.o
+
diff --git a/arch/sh/boards/mach-systemh/io.c b/arch/sh/boards/mach-systemh/io.c
new file mode 100644 (file)
index 0000000..1b767e1
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * linux/arch/sh/boards/renesas/systemh/io.c
+ *
+ * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
+ * Based largely on io_se.c.
+ *
+ * I/O routine for Hitachi 7751 Systemh.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/systemh7751.h>
+#include <asm/addrspace.h>
+#include <asm/io.h>
+
+#define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area
+                                                of smc lan chip*/
+static inline volatile __u16 *
+port2adr(unsigned int port)
+{
+       if (port >= 0x2000)
+               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
+       maybebadio((unsigned long)port);
+       return (volatile __u16*)port;
+}
+
+/*
+ * General outline: remap really low stuff [eventually] to SuperIO,
+ * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
+ * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
+ * should be way beyond the window, and is used  w/o translation for
+ * compatibility.
+ */
+unsigned char sh7751systemh_inb(unsigned long port)
+{
+       if (PXSEG(port))
+               return *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+               return *(volatile unsigned char *)pci_ioaddr(port);
+       else if (port <= 0x3F1)
+               return *(volatile unsigned char *)ETHER_IOMAP(port);
+       else
+               return (*port2adr(port))&0xff;
+}
+
+unsigned char sh7751systemh_inb_p(unsigned long port)
+{
+       unsigned char v;
+
+        if (PXSEG(port))
+                v = *(volatile unsigned char *)port;
+       else if (is_pci_ioaddr(port))
+                v = *(volatile unsigned char *)pci_ioaddr(port);
+       else if (port <= 0x3F1)
+               v = *(volatile unsigned char *)ETHER_IOMAP(port);
+       else
+               v = (*port2adr(port))&0xff;
+       ctrl_delay();
+       return v;
+}
+
+unsigned short sh7751systemh_inw(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned short *)port;
+       else if (is_pci_ioaddr(port))
+                return *(volatile unsigned short *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else if (port <= 0x3F1)
+               return *(volatile unsigned int *)ETHER_IOMAP(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+unsigned int sh7751systemh_inl(unsigned long port)
+{
+        if (PXSEG(port))
+                return *(volatile unsigned long *)port;
+       else if (is_pci_ioaddr(port))
+                return *(volatile unsigned int *)pci_ioaddr(port);
+       else if (port >= 0x2000)
+               return *port2adr(port);
+       else if (port <= 0x3F1)
+               return *(volatile unsigned int *)ETHER_IOMAP(port);
+       else
+               maybebadio(port);
+       return 0;
+}
+
+void sh7751systemh_outb(unsigned char value, unsigned long port)
+{
+
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else if (port <= 0x3F1)
+               *(volatile unsigned char *)ETHER_IOMAP(port) = value;
+       else
+               *(port2adr(port)) = value;
+}
+
+void sh7751systemh_outb_p(unsigned char value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned char *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned char*)pci_ioaddr(port)) = value;
+       else if (port <= 0x3F1)
+               *(volatile unsigned char *)ETHER_IOMAP(port) = value;
+       else
+               *(port2adr(port)) = value;
+       ctrl_delay();
+}
+
+void sh7751systemh_outw(unsigned short value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned short *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned short *)pci_ioaddr(port)) = value;
+       else if (port >= 0x2000)
+               *port2adr(port) = value;
+       else if (port <= 0x3F1)
+               *(volatile unsigned short *)ETHER_IOMAP(port) = value;
+       else
+               maybebadio(port);
+}
+
+void sh7751systemh_outl(unsigned int value, unsigned long port)
+{
+        if (PXSEG(port))
+                *(volatile unsigned long *)port = value;
+       else if (is_pci_ioaddr(port))
+               *((unsigned long*)pci_ioaddr(port)) = value;
+       else
+               maybebadio(port);
+}
+
+void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned char *p = addr;
+       while (count--) *p++ = sh7751systemh_inb(port);
+}
+
+void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count)
+{
+       unsigned short *p = addr;
+       while (count--) *p++ = sh7751systemh_inw(port);
+}
+
+void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
+
+void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned char *p = (unsigned char*)addr;
+       while (count--) sh7751systemh_outb(*p++, port);
+}
+
+void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count)
+{
+       unsigned short *p = (unsigned short*)addr;
+       while (count--) sh7751systemh_outw(*p++, port);
+}
+
+void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count)
+{
+       maybebadio(port);
+}
diff --git a/arch/sh/boards/mach-systemh/irq.c b/arch/sh/boards/mach-systemh/irq.c
new file mode 100644 (file)
index 0000000..0ba2fe6
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * linux/arch/sh/boards/renesas/systemh/irq.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ *
+ * Hitachi SystemH Support.
+ *
+ * Modified for 7751 SystemH by
+ * Jonathan Short.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <linux/hdreg.h>
+#include <linux/ide.h>
+#include <asm/io.h>
+#include <asm/systemh7751.h>
+#include <asm/smc37c93x.h>
+
+/* address of external interrupt mask register
+ * address must be set prior to use these (maybe in init_XXX_irq())
+ * XXX : is it better to use .config than specifying it in code? */
+static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004;
+static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000;
+
+/* forward declaration */
+static unsigned int startup_systemh_irq(unsigned int irq);
+static void shutdown_systemh_irq(unsigned int irq);
+static void enable_systemh_irq(unsigned int irq);
+static void disable_systemh_irq(unsigned int irq);
+static void mask_and_ack_systemh(unsigned int);
+static void end_systemh_irq(unsigned int irq);
+
+/* hw_interrupt_type */
+static struct hw_interrupt_type systemh_irq_type = {
+       .typename = " SystemH Register",
+       .startup = startup_systemh_irq,
+       .shutdown = shutdown_systemh_irq,
+       .enable = enable_systemh_irq,
+       .disable = disable_systemh_irq,
+       .ack = mask_and_ack_systemh,
+       .end = end_systemh_irq
+};
+
+static unsigned int startup_systemh_irq(unsigned int irq)
+{
+       enable_systemh_irq(irq);
+       return 0; /* never anything pending */
+}
+
+static void shutdown_systemh_irq(unsigned int irq)
+{
+       disable_systemh_irq(irq);
+}
+
+static void disable_systemh_irq(unsigned int irq)
+{
+       if (systemh_irq_mask_register) {
+               unsigned long val, mask = 0x01 << 1;
+
+               /* Clear the "irq"th bit in the mask and set it in the request */
+               val = ctrl_inl((unsigned long)systemh_irq_mask_register);
+               val &= ~mask;
+               ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
+
+               val = ctrl_inl((unsigned long)systemh_irq_request_register);
+               val |= mask;
+               ctrl_outl(val, (unsigned long)systemh_irq_request_register);
+       }
+}
+
+static void enable_systemh_irq(unsigned int irq)
+{
+       if (systemh_irq_mask_register) {
+               unsigned long val, mask = 0x01 << 1;
+
+               /* Set "irq"th bit in the mask register */
+               val = ctrl_inl((unsigned long)systemh_irq_mask_register);
+               val |= mask;
+               ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
+       }
+}
+
+static void mask_and_ack_systemh(unsigned int irq)
+{
+       disable_systemh_irq(irq);
+}
+
+static void end_systemh_irq(unsigned int irq)
+{
+       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+               enable_systemh_irq(irq);
+}
+
+void make_systemh_irq(unsigned int irq)
+{
+       disable_irq_nosync(irq);
+       irq_desc[irq].chip = &systemh_irq_type;
+       disable_systemh_irq(irq);
+}
+
diff --git a/arch/sh/boards/mach-systemh/setup.c b/arch/sh/boards/mach-systemh/setup.c
new file mode 100644 (file)
index 0000000..ee78af8
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * linux/arch/sh/boards/renesas/systemh/setup.c
+ *
+ * Copyright (C) 2000  Kazumoto Kojima
+ * Copyright (C) 2003  Paul Mundt
+ *
+ * Hitachi SystemH Support.
+ *
+ * Modified for 7751 SystemH by Jonathan Short.
+ *
+ * Rewritten for 2.6 by Paul Mundt.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <asm/machvec.h>
+#include <asm/systemh7751.h>
+
+extern void make_systemh_irq(unsigned int irq);
+
+/*
+ * Initialize IRQ setting
+ */
+static void __init sh7751systemh_init_irq(void)
+{
+       make_systemh_irq(0xb);  /* Ethernet interrupt */
+}
+
+static struct sh_machine_vector mv_7751systemh __initmv = {
+       .mv_name                = "7751 SystemH",
+       .mv_nr_irqs             = 72,
+
+       .mv_inb                 = sh7751systemh_inb,
+       .mv_inw                 = sh7751systemh_inw,
+       .mv_inl                 = sh7751systemh_inl,
+       .mv_outb                = sh7751systemh_outb,
+       .mv_outw                = sh7751systemh_outw,
+       .mv_outl                = sh7751systemh_outl,
+
+       .mv_inb_p               = sh7751systemh_inb_p,
+       .mv_inw_p               = sh7751systemh_inw,
+       .mv_inl_p               = sh7751systemh_inl,
+       .mv_outb_p              = sh7751systemh_outb_p,
+       .mv_outw_p              = sh7751systemh_outw,
+       .mv_outl_p              = sh7751systemh_outl,
+
+       .mv_insb                = sh7751systemh_insb,
+       .mv_insw                = sh7751systemh_insw,
+       .mv_insl                = sh7751systemh_insl,
+       .mv_outsb               = sh7751systemh_outsb,
+       .mv_outsw               = sh7751systemh_outsw,
+       .mv_outsl               = sh7751systemh_outsl,
+
+       .mv_init_irq            = sh7751systemh_init_irq,
+};
diff --git a/arch/sh/boards/mach-titan/Makefile b/arch/sh/boards/mach-titan/Makefile
new file mode 100644 (file)
index 0000000..08d7537
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the Nimble Microsystems TITAN specific parts of the kernel
+#
+
+obj-y   := setup.o io.o
diff --git a/arch/sh/boards/mach-titan/io.c b/arch/sh/boards/mach-titan/io.c
new file mode 100644 (file)
index 0000000..4730c1d
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ *     I/O routines for Titan
+ */
+#include <linux/pci.h>
+#include <asm/machvec.h>
+#include <asm/addrspace.h>
+#include <asm/titan.h>
+#include <asm/io.h>
+
+static inline unsigned int port2adr(unsigned int port)
+{
+        maybebadio((unsigned long)port);
+        return port;
+}
+
+u8 titan_inb(unsigned long port)
+{
+        if (PXSEG(port))
+                return ctrl_inb(port);
+        else if (is_pci_ioaddr(port))
+                return ctrl_inb(pci_ioaddr(port));
+        return ctrl_inw(port2adr(port)) & 0xff;
+}
+
+u8 titan_inb_p(unsigned long port)
+{
+        u8 v;
+
+        if (PXSEG(port))
+                v = ctrl_inb(port);
+        else if (is_pci_ioaddr(port))
+                v = ctrl_inb(pci_ioaddr(port));
+        else
+                v = ctrl_inw(port2adr(port)) & 0xff;
+        ctrl_delay();
+        return v;
+}
+
+u16 titan_inw(unsigned long port)
+{
+        if (PXSEG(port))
+                return ctrl_inw(port);
+        else if (is_pci_ioaddr(port))
+                return ctrl_inw(pci_ioaddr(port));
+        else if (port >= 0x2000)
+                return ctrl_inw(port2adr(port));
+        else
+                maybebadio(port);
+        return 0;
+}
+
+u32 titan_inl(unsigned long port)
+{
+        if (PXSEG(port))
+                return ctrl_inl(port);
+        else if (is_pci_ioaddr(port))
+                return ctrl_inl(pci_ioaddr(port));
+        else if (port >= 0x2000)
+                return ctrl_inw(port2adr(port));
+        else
+                maybebadio(port);
+        return 0;
+}
+
+void titan_outb(u8 value, unsigned long port)
+{
+        if (PXSEG(port))
+                ctrl_outb(value, port);
+        else if (is_pci_ioaddr(port))
+                ctrl_outb(value, pci_ioaddr(port));
+        else
+                ctrl_outw(value, port2adr(port));
+}
+
+void titan_outb_p(u8 value, unsigned long port)
+{
+        if (PXSEG(port))
+                ctrl_outb(value, port);
+        else if (is_pci_ioaddr(port))
+                ctrl_outb(value, pci_ioaddr(port));
+        else
+                ctrl_outw(value, port2adr(port));
+        ctrl_delay();
+}
+
+void titan_outw(u16 value, unsigned long port)
+{
+        if (PXSEG(port))
+                ctrl_outw(value, port);
+        else if (is_pci_ioaddr(port))
+                ctrl_outw(value, pci_ioaddr(port));
+        else if (port >= 0x2000)
+                ctrl_outw(value, port2adr(port));
+        else
+                maybebadio(port);
+}
+
+void titan_outl(u32 value, unsigned long port)
+{
+        if (PXSEG(port))
+                ctrl_outl(value, port);
+        else if (is_pci_ioaddr(port))
+                ctrl_outl(value, pci_ioaddr(port));
+        else
+                maybebadio(port);
+}
+
+void titan_insl(unsigned long port, void *dst, unsigned long count)
+{
+        maybebadio(port);
+}
+
+void titan_outsl(unsigned long port, const void *src, unsigned long count)
+{
+        maybebadio(port);
+}
+
+void __iomem *titan_ioport_map(unsigned long port, unsigned int size)
+{
+       if (PXSEG(port) || is_pci_memaddr(port))
+               return (void __iomem *)port;
+       else if (is_pci_ioaddr(port))
+               return (void __iomem *)pci_ioaddr(port);
+
+       return (void __iomem *)port2adr(port);
+}
diff --git a/arch/sh/boards/mach-titan/setup.c b/arch/sh/boards/mach-titan/setup.c
new file mode 100644 (file)
index 0000000..5de3b2a
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * arch/sh/boards/titan/setup.c - Setup for Titan
+ *
+ *  Copyright (C) 2006  Jamie Lenehan
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/titan.h>
+#include <asm/io.h>
+
+static void __init init_titan_irq(void)
+{
+       /* enable individual interrupt mode for externals */
+       plat_irq_setup_pins(IRQ_MODE_IRQ);
+}
+
+static struct sh_machine_vector mv_titan __initmv = {
+       .mv_name =      "Titan",
+
+       .mv_inb =       titan_inb,
+       .mv_inw =       titan_inw,
+       .mv_inl =       titan_inl,
+       .mv_outb =      titan_outb,
+       .mv_outw =      titan_outw,
+       .mv_outl =      titan_outl,
+
+       .mv_inb_p =     titan_inb_p,
+       .mv_inw_p =     titan_inw,
+       .mv_inl_p =     titan_inl,
+       .mv_outb_p =    titan_outb_p,
+       .mv_outw_p =    titan_outw,
+       .mv_outl_p =    titan_outl,
+
+       .mv_insl =      titan_insl,
+       .mv_outsl =     titan_outsl,
+
+       .mv_ioport_map = titan_ioport_map,
+
+       .mv_init_irq =  init_titan_irq,
+};
diff --git a/arch/sh/boards/mach-x3proto/Makefile b/arch/sh/boards/mach-x3proto/Makefile
new file mode 100644 (file)
index 0000000..983e455
--- /dev/null
@@ -0,0 +1 @@
+obj-y += setup.o ilsel.o
diff --git a/arch/sh/boards/mach-x3proto/ilsel.c b/arch/sh/boards/mach-x3proto/ilsel.c
new file mode 100644 (file)
index 0000000..b5c673c
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * arch/sh/boards/renesas/x3proto/ilsel.c
+ *
+ * Helper routines for SH-X3 proto board ILSEL.
+ *
+ * Copyright (C) 2007 Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/bitmap.h>
+#include <linux/io.h>
+#include <asm/ilsel.h>
+
+/*
+ * ILSEL is split across:
+ *
+ *     ILSEL0 - 0xb8100004 [ Levels  1 -  4 ]
+ *     ILSEL1 - 0xb8100006 [ Levels  5 -  8 ]
+ *     ILSEL2 - 0xb8100008 [ Levels  9 - 12 ]
+ *     ILSEL3 - 0xb810000a [ Levels 13 - 15 ]
+ *
+ * With each level being relative to an ilsel_source_t.
+ */
+#define ILSEL_BASE     0xb8100004
+#define ILSEL_LEVELS   15
+
+/*
+ * ILSEL level map, in descending order from the highest level down.
+ *
+ * Supported levels are 1 - 15 spread across ILSEL0 - ILSEL4, mapping
+ * directly to IRLs. As the IRQs are numbered in reverse order relative
+ * to the interrupt level, the level map is carefully managed to ensure a
+ * 1:1 mapping between the bit position and the IRQ number.
+ *
+ * This careful constructions allows ilsel_enable*() to be referenced
+ * directly for hooking up an ILSEL set and getting back an IRQ which can
+ * subsequently be used for internal accounting in the (optional) disable
+ * path.
+ */
+static unsigned long ilsel_level_map;
+
+static inline unsigned int ilsel_offset(unsigned int bit)
+{
+       return ILSEL_LEVELS - bit - 1;
+}
+
+static inline unsigned long mk_ilsel_addr(unsigned int bit)
+{
+       return ILSEL_BASE + ((ilsel_offset(bit) >> 1) & ~0x1);
+}
+
+static inline unsigned int mk_ilsel_shift(unsigned int bit)
+{
+       return (ilsel_offset(bit) & 0x3) << 2;
+}
+
+static void __ilsel_enable(ilsel_source_t set, unsigned int bit)
+{
+       unsigned int tmp, shift;
+       unsigned long addr;
+
+       addr = mk_ilsel_addr(bit);
+       shift = mk_ilsel_shift(bit);
+
+       pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n",
+                __func__, bit, addr, shift, set);
+
+       tmp = ctrl_inw(addr);
+       tmp &= ~(0xf << shift);
+       tmp |= set << shift;
+       ctrl_outw(tmp, addr);
+}
+
+/**
+ * ilsel_enable - Enable an ILSEL set.
+ * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
+ *
+ * Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest
+ * available interrupt level. Callers should take care to order callsites
+ * noting descending interrupt levels. Aliasing FPGA and external board
+ * IRQs need to use ilsel_enable_fixed().
+ *
+ * The return value is an IRQ number that can later be taken down with
+ * ilsel_disable().
+ */
+int ilsel_enable(ilsel_source_t set)
+{
+       unsigned int bit;
+
+       /* Aliased sources must use ilsel_enable_fixed() */
+       BUG_ON(set > ILSEL_KEY);
+
+       do {
+               bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS);
+       } while (test_and_set_bit(bit, &ilsel_level_map));
+
+       __ilsel_enable(set, bit);
+
+       return bit;
+}
+EXPORT_SYMBOL_GPL(ilsel_enable);
+
+/**
+ * ilsel_enable_fixed - Enable an ILSEL set at a fixed interrupt level
+ * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
+ * @level: Interrupt level (1 - 15)
+ *
+ * Enables a given ILSEL source at a fixed interrupt level. Necessary
+ * both for level reservation as well as for aliased sources that only
+ * exist on special ILSEL#s.
+ *
+ * Returns an IRQ number (as ilsel_enable()).
+ */
+int ilsel_enable_fixed(ilsel_source_t set, unsigned int level)
+{
+       unsigned int bit = ilsel_offset(level - 1);
+
+       if (test_and_set_bit(bit, &ilsel_level_map))
+               return -EBUSY;
+
+       __ilsel_enable(set, bit);
+
+       return bit;
+}
+EXPORT_SYMBOL_GPL(ilsel_enable_fixed);
+
+/**
+ * ilsel_disable - Disable an ILSEL set
+ * @irq: Bit position for ILSEL set value (retval from enable routines)
+ *
+ * Disable a previously enabled ILSEL set.
+ */
+void ilsel_disable(unsigned int irq)
+{
+       unsigned long addr;
+       unsigned int tmp;
+
+       addr = mk_ilsel_addr(irq);
+
+       tmp = ctrl_inw(addr);
+       tmp &= ~(0xf << mk_ilsel_shift(irq));
+       ctrl_outw(tmp, addr);
+
+       clear_bit(irq, &ilsel_level_map);
+}
+EXPORT_SYMBOL_GPL(ilsel_disable);
diff --git a/arch/sh/boards/mach-x3proto/setup.c b/arch/sh/boards/mach-x3proto/setup.c
new file mode 100644 (file)
index 0000000..abc5b6d
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * arch/sh/boards/renesas/x3proto/setup.c
+ *
+ * Renesas SH-X3 Prototype Board Support.
+ *
+ * Copyright (C) 2007 Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <asm/ilsel.h>
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = 0xb8140020,
+               .end    = 0xb8140020,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .start          = 0x18000300,
+               .end            = 0x18000300 + 0x10 - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               /* Filled in by ilsel */
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = -1,
+       .resource       = smc91x_resources,
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+};
+
+static struct resource r8a66597_usb_host_resources[] = {
+       [0] = {
+               .name   = "r8a66597_hcd",
+               .start  = 0x18040000,
+               .end    = 0x18080000 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "r8a66597_hcd",
+               /* Filled in by ilsel */
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device r8a66597_usb_host_device = {
+       .name           = "r8a66597_hcd",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
+       .resource       = r8a66597_usb_host_resources,
+};
+
+static struct resource m66592_usb_peripheral_resources[] = {
+       [0] = {
+               .name   = "m66592_udc",
+               .start  = 0x18080000,
+               .end    = 0x180c0000 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name   = "m66592_udc",
+               /* Filled in by ilsel */
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device m66592_usb_peripheral_device = {
+       .name           = "m66592_udc",
+       .id             = -1,
+       .dev = {
+               .dma_mask               = NULL,         /* don't use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(m66592_usb_peripheral_resources),
+       .resource       = m66592_usb_peripheral_resources,
+};
+
+static struct platform_device *x3proto_devices[] __initdata = {
+       &heartbeat_device,
+       &smc91x_device,
+       &r8a66597_usb_host_device,
+       &m66592_usb_peripheral_device,
+};
+
+static int __init x3proto_devices_setup(void)
+{
+       r8a66597_usb_host_resources[1].start =
+               r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I);
+
+       m66592_usb_peripheral_resources[1].start =
+               m66592_usb_peripheral_resources[1].end = ilsel_enable(ILSEL_USBP_I);
+
+       smc91x_resources[1].start =
+               smc91x_resources[1].end = ilsel_enable(ILSEL_LAN);
+
+       return platform_add_devices(x3proto_devices,
+                                   ARRAY_SIZE(x3proto_devices));
+}
+device_initcall(x3proto_devices_setup);
+
+static void __init x3proto_init_irq(void)
+{
+       plat_irq_setup_pins(IRQ_MODE_IRL3210);
+
+       /* Set ICR0.LVLMODE */
+       ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
+}
+
+static struct sh_machine_vector mv_x3proto __initmv = {
+       .mv_name                = "x3proto",
+       .mv_init_irq            = x3proto_init_irq,
+};
diff --git a/arch/sh/boards/magicpanelr2/Kconfig b/arch/sh/boards/magicpanelr2/Kconfig
deleted file mode 100644 (file)
index b0abddc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-if SH_MAGIC_PANEL_R2
-
-menu "Magic Panel R2 options"
-
-config SH_MAGIC_PANEL_R2_VERSION
-       int SH_MAGIC_PANEL_R2_VERSION
-       default "3"
-       help
-         Set the version of the Magic Panel R2
-
-endmenu
-
-endif
diff --git a/arch/sh/boards/magicpanelr2/Makefile b/arch/sh/boards/magicpanelr2/Makefile
deleted file mode 100644 (file)
index 7a6d586..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the Magic Panel specific parts
-#
-
-obj-y   := setup.o
\ No newline at end of file
diff --git a/arch/sh/boards/magicpanelr2/setup.c b/arch/sh/boards/magicpanelr2/setup.c
deleted file mode 100644 (file)
index f3b8b07..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * linux/arch/sh/boards/magicpanel/setup.c
- *
- *  Copyright (C) 2007  Markus Brunner, Mark Jonas
- *
- *  Magic Panel Release 2 board setup
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/map.h>
-#include <asm/magicpanelr2.h>
-#include <asm/heartbeat.h>
-
-#define LAN9115_READY  (ctrl_inl(0xA8000084UL) & 0x00000001UL)
-
-/* Prefer cmdline over RedBoot */
-static const char *probes[] = { "cmdlinepart", "RedBoot", NULL };
-
-/* Wait until reset finished. Timeout is 100ms. */
-static int __init ethernet_reset_finished(void)
-{
-       int i;
-
-       if (LAN9115_READY)
-               return 1;
-
-       for (i = 0; i < 10; ++i) {
-               mdelay(10);
-               if (LAN9115_READY)
-                       return 1;
-       }
-
-       return 0;
-}
-
-static void __init reset_ethernet(void)
-{
-       /* PMDR: LAN_RESET=on */
-       CLRBITS_OUTB(0x10, PORT_PMDR);
-
-       udelay(200);
-
-       /* PMDR: LAN_RESET=off */
-       SETBITS_OUTB(0x10, PORT_PMDR);
-}
-
-static void __init setup_chip_select(void)
-{
-       /* CS2: LAN (0x08000000 - 0x0bffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x36db0400, CS2BCR);
-       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
-       ctrl_outl(0x000003c0, CS2WCR);
-
-       /* CS4: CAN1 (0xb0000000 - 0xb3ffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x00000200, CS4BCR);
-       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
-       ctrl_outl(0x00100981, CS4WCR);
-
-       /* CS5a: CAN2 (0xb4000000 - 0xb5ffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x00000200, CS5ABCR);
-       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
-       ctrl_outl(0x00100981, CS5AWCR);
-
-       /* CS5b: CAN3 (0xb6000000 - 0xb7ffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x00000200, CS5BBCR);
-       /* (SW:1.5 WR:3 HW:1.5), ext. wait */
-       ctrl_outl(0x00100981, CS5BWCR);
-
-       /* CS6a: Rotary (0xb8000000 - 0xb9ffffff) */
-       /* no idle cycles, normal space, 8 bit data bus */
-       ctrl_outl(0x00000200, CS6ABCR);
-       /* (SW:1.5 WR:3 HW:1.5), no ext. wait */
-       ctrl_outl(0x001009C1, CS6AWCR);
-}
-
-static void __init setup_port_multiplexing(void)
-{
-       /* A7 GPO(LED8);     A6 GPO(LED7);     A5 GPO(LED6);      A4 GPO(LED5);
-        * A3 GPO(LED4);     A2 GPO(LED3);     A1 GPO(LED2);      A0 GPO(LED1);
-        */
-       ctrl_outw(0x5555, PORT_PACR);   /* 01 01 01 01 01 01 01 01 */
-
-       /* B7 GPO(RST4);   B6 GPO(RST3);  B5 GPO(RST2);    B4 GPO(RST1);
-        * B3 GPO(PB3);    B2 GPO(PB2);   B1 GPO(PB1);     B0 GPO(PB0);
-        */
-       ctrl_outw(0x5555, PORT_PBCR);   /* 01 01 01 01 01 01 01 01 */
-
-       /* C7 GPO(PC7);   C6 GPO(PC6);    C5 GPO(PC5);     C4 GPO(PC4);
-        * C3 LCD_DATA3;  C2 LCD_DATA2;   C1 LCD_DATA1;    C0 LCD_DATA0;
-        */
-       ctrl_outw(0x5500, PORT_PCCR);   /* 01 01 01 01 00 00 00 00 */
-
-       /* D7 GPO(PD7); D6 GPO(PD6);    D5 GPO(PD5);       D4 GPO(PD4);
-        * D3 GPO(PD3); D2 GPO(PD2);    D1 GPO(PD1);       D0 GPO(PD0);
-        */
-       ctrl_outw(0x5555, PORT_PDCR);   /* 01 01 01 01 01 01 01 01 */
-
-       /* E7 (x);        E6 GPI(nu);    E5 GPI(nu);      E4 LCD_M_DISP;
-        * E3 LCD_CL1;    E2 LCD_CL2;    E1 LCD_DON;      E0 LCD_FLM;
-        */
-       ctrl_outw(0x3C00, PORT_PECR);   /* 00 11 11 00 00 00 00 00 */
-
-       /* F7 (x);           F6 DA1(VLCD);     F5 DA0(nc);        F4 AN3;
-        * F3 AN2(MID_AD);   F2 AN1(EARTH_AD); F1 AN0(TEMP);      F0 GPI+(nc);
-        */
-       ctrl_outw(0x0002, PORT_PFCR);   /* 00 00 00 00 00 00 00 10 */
-
-       /* G7 (x);        G6 IRQ5(TOUCH_BUSY); G5 IRQ4(TOUCH_IRQ); G4 GPI(KEY2);
-        * G3 GPI(KEY1);  G2 GPO(LED11);        G1 GPO(LED10);     G0 GPO(LED9);
-        */
-       ctrl_outw(0x03D5, PORT_PGCR);   /* 00 00 00 11 11 01 01 01 */
-
-       /* H7 (x);            H6 /RAS(BRAS);      H5 /CAS(BCAS); H4 CKE(BCKE);
-        * H3 GPO(EARTH_OFF); H2 GPO(EARTH_TEST); H1 USB2_PWR;   H0 USB1_PWR;
-        */
-       ctrl_outw(0x0050, PORT_PHCR);   /* 00 00 00 00 01 01 00 00 */
-
-       /* J7 (x);        J6 AUDCK;        J5 ASEBRKAK;     J4 AUDATA3;
-        * J3 AUDATA2;    J2 AUDATA1;      J1 AUDATA0;      J0 AUDSYNC;
-        */
-       ctrl_outw(0x0000, PORT_PJCR);   /* 00 00 00 00 00 00 00 00 */
-
-       /* K7 (x);          K6 (x);          K5 (x);       K4 (x);
-        * K3 PINT7(/PWR2); K2 PINT6(/PWR1); K1 PINT5(nu); K0 PINT4(FLASH_READY)
-        */
-       ctrl_outw(0x00FF, PORT_PKCR);   /* 00 00 00 00 11 11 11 11 */
-
-       /* L7 TRST;        L6 TMS;           L5 TDO;              L4 TDI;
-        * L3 TCK;         L2 (x);           L1 (x);              L0 (x);
-        */
-       ctrl_outw(0x0000, PORT_PLCR);   /* 00 00 00 00 00 00 00 00 */
-
-       /* M7 GPO(CURRENT_SINK);    M6 GPO(PWR_SWITCH);     M5 GPO(LAN_SPEED);
-        * M4 GPO(LAN_RESET);       M3 GPO(BUZZER);         M2 GPO(LCD_BL);
-        * M1 CS5B(CAN3_CS);        M0 GPI+(nc);
-        */
-       ctrl_outw(0x5552, PORT_PMCR);      /* 01 01 01 01 01 01 00 10 */
-
-       /* CURRENT_SINK=off,    PWR_SWITCH=off, LAN_SPEED=100MBit,
-        * LAN_RESET=off,       BUZZER=off,     LCD_BL=off
-        */
-#if CONFIG_SH_MAGIC_PANEL_R2_VERSION == 2
-       ctrl_outb(0x30, PORT_PMDR);
-#elif CONFIG_SH_MAGIC_PANEL_R2_VERSION == 3
-       ctrl_outb(0xF0, PORT_PMDR);
-#else
-#error Unknown revision of PLATFORM_MP_R2
-#endif
-
-       /* P7 (x);             P6 (x);            P5 (x);
-        * P4 GPO(nu);         P3 IRQ3(LAN_IRQ);  P2 IRQ2(CAN3_IRQ);
-        * P1 IRQ1(CAN2_IRQ);  P0 IRQ0(CAN1_IRQ)
-        */
-       ctrl_outw(0x0100, PORT_PPCR);   /* 00 00 00 01 00 00 00 00 */
-       ctrl_outb(0x10, PORT_PPDR);
-
-       /* R7 A25;           R6 A24;         R5 A23;              R4 A22;
-        * R3 A21;           R2 A20;         R1 A19;              R0 A0;
-        */
-       ctrl_outw(0x0000, PORT_PRCR);   /* 00 00 00 00 00 00 00 00 */
-
-       /* S7 (x);              S6 (x);        S5 (x);       S4 GPO(EEPROM_CS2);
-        * S3 GPO(EEPROM_CS1);  S2 SIOF0_TXD;  S1 SIOF0_RXD; S0 SIOF0_SCK;
-        */
-       ctrl_outw(0x0140, PORT_PSCR);   /* 00 00 00 01 01 00 00 00 */
-
-       /* T7 (x);         T6 (x);        T5 (x);         T4 COM1_CTS;
-        * T3 COM1_RTS;    T2 COM1_TXD;   T1 COM1_RXD;    T0 GPO(WDOG)
-        */
-       ctrl_outw(0x0001, PORT_PTCR);   /* 00 00 00 00 00 00 00 01 */
-
-       /* U7 (x);           U6 (x);       U5 (x);        U4 GPI+(/AC_FAULT);
-        * U3 GPO(TOUCH_CS); U2 TOUCH_TXD; U1 TOUCH_RXD;  U0 TOUCH_SCK;
-        */
-       ctrl_outw(0x0240, PORT_PUCR);   /* 00 00 00 10 01 00 00 00 */
-
-       /* V7 (x);        V6 (x);       V5 (x);           V4 GPO(MID2);
-        * V3 GPO(MID1);  V2 CARD_TxD;  V1 CARD_RxD;      V0 GPI+(/BAT_FAULT);
-        */
-       ctrl_outw(0x0142, PORT_PVCR);   /* 00 00 00 01 01 00 00 10 */
-}
-
-static void __init mpr2_setup(char **cmdline_p)
-{
-       __set_io_port_base(0xa0000000);
-
-       /* set Pin Select Register A:
-        * /PCC_CD1, /PCC_CD2,  PCC_BVD1, PCC_BVD2,
-        * /IOIS16,  IRQ4,      IRQ5,     USB1d_SUSPEND
-        */
-       ctrl_outw(0xAABC, PORT_PSELA);
-       /* set Pin Select Register B:
-        * /SCIF0_RTS, /SCIF0_CTS, LCD_VCPWC,
-        * LCD_VEPWC,  IIC_SDA,    IIC_SCL, Reserved
-        */
-       ctrl_outw(0x3C00, PORT_PSELB);
-       /* set Pin Select Register C:
-        * SIOF1_SCK, SIOF1_RxD, SCIF1_RxD, SCIF1_TxD, Reserved
-        */
-       ctrl_outw(0x0000, PORT_PSELC);
-       /* set Pin Select Register D: Reserved, SIOF1_TxD, Reserved, SIOF1_MCLK,
-        * Reserved, SIOF1_SYNC, Reserved, SCIF1_SCK, Reserved
-        */
-       ctrl_outw(0x0000, PORT_PSELD);
-       /* set USB TxRx Control: Reserved, DRV, Reserved, USB_TRANS, USB_SEL */
-       ctrl_outw(0x0101, PORT_UTRCTL);
-       /* set USB Clock Control: USSCS, USSTB, Reserved (HighByte always A5) */
-       ctrl_outw(0xA5C0, PORT_UCLKCR_W);
-
-       setup_chip_select();
-
-       setup_port_multiplexing();
-
-       reset_ethernet();
-
-       printk(KERN_INFO "Magic Panel Release 2 A.%i\n",
-                               CONFIG_SH_MAGIC_PANEL_R2_VERSION);
-
-       if (ethernet_reset_finished() == 0)
-               printk(KERN_WARNING "Ethernet not ready\n");
-}
-
-static struct resource smc911x_resources[] = {
-       [0] = {
-               .start          = 0xa8000000,
-               .end            = 0xabffffff,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = 35,
-               .end            = 35,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc911x_device = {
-       .name           = "smc911x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc911x_resources),
-       .resource       = smc911x_resources,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .flags          = HEARTBEAT_INVERTED,
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct mtd_partition *parsed_partitions;
-
-static struct mtd_partition mpr2_partitions[] = {
-       /* Reserved for bootloader, read-only */
-       {
-               .name = "Bootloader",
-               .offset = 0x00000000UL,
-               .size = MPR2_MTD_BOOTLOADER_SIZE,
-               .mask_flags = MTD_WRITEABLE,
-       },
-       /* Reserved for kernel image */
-       {
-               .name = "Kernel",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = MPR2_MTD_KERNEL_SIZE,
-       },
-       /* Rest is used for Flash FS */
-       {
-               .name = "Flash_FS",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = MTDPART_SIZ_FULL,
-       }
-};
-
-static struct physmap_flash_data flash_data = {
-       .width          = 2,
-};
-
-static struct resource flash_resource = {
-       .start          = 0x00000000,
-       .end            = 0x2000000UL,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device flash_device = {
-       .name           = "physmap-flash",
-       .id             = -1,
-       .resource       = &flash_resource,
-       .num_resources  = 1,
-       .dev            = {
-               .platform_data = &flash_data,
-       },
-};
-
-static struct mtd_info *flash_mtd;
-
-static struct map_info mpr2_flash_map = {
-       .name = "Magic Panel R2 Flash",
-       .size = 0x2000000UL,
-       .bankwidth = 2,
-};
-
-static void __init set_mtd_partitions(void)
-{
-       int nr_parts = 0;
-
-       simple_map_init(&mpr2_flash_map);
-       flash_mtd = do_map_probe("cfi_probe", &mpr2_flash_map);
-       nr_parts = parse_mtd_partitions(flash_mtd, probes,
-                                       &parsed_partitions, 0);
-       /* If there is no partition table, used the hard coded table */
-       if (nr_parts <= 0) {
-               flash_data.parts = mpr2_partitions;
-               flash_data.nr_parts = ARRAY_SIZE(mpr2_partitions);
-       } else {
-               flash_data.nr_parts = nr_parts;
-               flash_data.parts = parsed_partitions;
-       }
-}
-
-/*
- * Add all resources to the platform_device
- */
-
-static struct platform_device *mpr2_devices[] __initdata = {
-       &heartbeat_device,
-       &smc911x_device,
-       &flash_device,
-};
-
-
-static int __init mpr2_devices_setup(void)
-{
-       set_mtd_partitions();
-       return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices));
-}
-device_initcall(mpr2_devices_setup);
-
-/*
- * Initialize IRQ setting
- */
-static void __init init_mpr2_IRQ(void)
-{
-       plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */
-
-       set_irq_type(32, IRQ_TYPE_LEVEL_LOW);    /* IRQ0 CAN1 */
-       set_irq_type(33, IRQ_TYPE_LEVEL_LOW);    /* IRQ1 CAN2 */
-       set_irq_type(34, IRQ_TYPE_LEVEL_LOW);    /* IRQ2 CAN3 */
-       set_irq_type(35, IRQ_TYPE_LEVEL_LOW);    /* IRQ3 SMSC9115 */
-       set_irq_type(36, IRQ_TYPE_EDGE_RISING);  /* IRQ4 touchscreen */
-       set_irq_type(37, IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */
-
-       intc_set_priority(32, 13);              /* IRQ0 CAN1 */
-       intc_set_priority(33, 13);              /* IRQ0 CAN2 */
-       intc_set_priority(34, 13);              /* IRQ0 CAN3 */
-       intc_set_priority(35, 6);               /* IRQ3 SMSC9115 */
-}
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_mpr2 __initmv = {
-       .mv_name                = "mpr2",
-       .mv_setup               = mpr2_setup,
-       .mv_init_irq            = init_mpr2_IRQ,
-};
diff --git a/arch/sh/boards/renesas/ap325rxa/Makefile b/arch/sh/boards/renesas/ap325rxa/Makefile
deleted file mode 100644 (file)
index f663768..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y  := setup.o
diff --git a/arch/sh/boards/renesas/ap325rxa/setup.c b/arch/sh/boards/renesas/ap325rxa/setup.c
deleted file mode 100644 (file)
index 7fa7446..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Renesas - AP-325RXA
- * (Compatible with Algo System ., LTD. - AP-320A)
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Author : Yusuke Goda <goda.yuske@renesas.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#include <linux/init.h>
-#include <linux/device.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
-#include <linux/delay.h>
-#include <linux/i2c.h>
-#include <linux/delay.h>
-#include <linux/smc911x.h>
-#include <media/soc_camera_platform.h>
-#include <media/sh_mobile_ceu.h>
-#include <asm/sh_mobile_lcdc.h>
-#include <asm/io.h>
-#include <asm/clock.h>
-
-static struct smc911x_platdata smc911x_info = {
-       .flags = SMC911X_USE_32BIT,
-       .irq_flags = IRQF_TRIGGER_LOW,
-};
-
-static struct resource smc9118_resources[] = {
-       [0] = {
-               .start  = 0xb6080000,
-               .end    = 0xb60fffff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 35,
-               .end    = 35,
-               .flags  = IORESOURCE_IRQ,
-       }
-};
-
-static struct platform_device smc9118_device = {
-       .name           = "smc911x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc9118_resources),
-       .resource       = smc9118_resources,
-       .dev            = {
-               .platform_data = &smc911x_info,
-       },
-};
-
-static struct mtd_partition ap325rxa_nor_flash_partitions[] = {
-       {
-                .name = "uboot",
-                .offset = 0,
-                .size = (1 * 1024 * 1024),
-                .mask_flags = MTD_WRITEABLE,   /* Read-only */
-       }, {
-                .name = "kernel",
-                .offset = MTDPART_OFS_APPEND,
-                .size = (2 * 1024 * 1024),
-       }, {
-                .name = "other",
-                .offset = MTDPART_OFS_APPEND,
-                .size = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data ap325rxa_nor_flash_data = {
-       .width          = 2,
-       .parts          = ap325rxa_nor_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(ap325rxa_nor_flash_partitions),
-};
-
-static struct resource ap325rxa_nor_flash_resources[] = {
-       [0] = {
-               .name   = "NOR Flash",
-               .start  = 0x00000000,
-               .end    = 0x00ffffff,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device ap325rxa_nor_flash_device = {
-       .name           = "physmap-flash",
-       .resource       = ap325rxa_nor_flash_resources,
-       .num_resources  = ARRAY_SIZE(ap325rxa_nor_flash_resources),
-       .dev            = {
-               .platform_data = &ap325rxa_nor_flash_data,
-       },
-};
-
-#define FPGA_LCDREG    0xB4100180
-#define FPGA_BKLREG    0xB4100212
-#define FPGA_LCDREG_VAL        0x0018
-#define PORT_PHCR      0xA405010E
-#define PORT_PLCR      0xA4050114
-#define PORT_PMCR      0xA4050116
-#define PORT_PRCR      0xA405011C
-#define PORT_PSCR      0xA405011E
-#define PORT_PZCR      0xA405014C
-#define PORT_HIZCRA    0xA4050158
-#define PORT_MSELCRB   0xA4050182
-#define PORT_PSDR      0xA405013E
-#define PORT_PZDR      0xA405016C
-#define PORT_PSELD     0xA4050154
-
-static void ap320_wvga_power_on(void *board_data)
-{
-       msleep(100);
-
-       /* ASD AP-320/325 LCD ON */
-       ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG);
-
-       /* backlight */
-       ctrl_outw((ctrl_inw(PORT_PSCR) & ~0x00C0) | 0x40, PORT_PSCR);
-       ctrl_outb(ctrl_inb(PORT_PSDR) & ~0x08, PORT_PSDR);
-       ctrl_outw(0x100, FPGA_BKLREG);
-}
-
-static struct sh_mobile_lcdc_info lcdc_info = {
-       .clock_source = LCDC_CLK_EXTERNAL,
-       .ch[0] = {
-               .chan = LCDC_CHAN_MAINLCD,
-               .bpp = 16,
-               .interface_type = RGB18,
-               .clock_divider = 1,
-               .lcd_cfg = {
-                       .name = "LB070WV1",
-                       .xres = 800,
-                       .yres = 480,
-                       .left_margin = 40,
-                       .right_margin = 160,
-                       .hsync_len = 8,
-                       .upper_margin = 63,
-                       .lower_margin = 80,
-                       .vsync_len = 1,
-                       .sync = 0, /* hsync and vsync are active low */
-               },
-               .board_cfg = {
-                       .display_on = ap320_wvga_power_on,
-               },
-       }
-};
-
-static struct resource lcdc_resources[] = {
-       [0] = {
-               .name   = "LCDC",
-               .start  = 0xfe940000, /* P4-only space */
-               .end    = 0xfe941fff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device lcdc_device = {
-       .name           = "sh_mobile_lcdc_fb",
-       .num_resources  = ARRAY_SIZE(lcdc_resources),
-       .resource       = lcdc_resources,
-       .dev            = {
-               .platform_data  = &lcdc_info,
-       },
-};
-
-static unsigned char camera_ncm03j_magic[] =
-{
-       0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8,
-       0x1D, 0x00, 0x1E, 0x8A, 0x21, 0x00, 0x33, 0x36,
-       0x36, 0x60, 0x37, 0x08, 0x3B, 0x31, 0x44, 0x0F,
-       0x46, 0xF0, 0x4B, 0x28, 0x4C, 0x21, 0x4D, 0x55,
-       0x4E, 0x1B, 0x4F, 0xC7, 0x50, 0xFC, 0x51, 0x12,
-       0x58, 0x02, 0x66, 0xC0, 0x67, 0x46, 0x6B, 0xA0,
-       0x6C, 0x34, 0x7E, 0x25, 0x7F, 0x25, 0x8D, 0x0F,
-       0x92, 0x40, 0x93, 0x04, 0x94, 0x26, 0x95, 0x0A,
-       0x99, 0x03, 0x9A, 0xF0, 0x9B, 0x14, 0x9D, 0x7A,
-       0xC5, 0x02, 0xD6, 0x07, 0x59, 0x00, 0x5A, 0x1A,
-       0x5B, 0x2A, 0x5C, 0x37, 0x5D, 0x42, 0x5E, 0x56,
-       0xC8, 0x00, 0xC9, 0x1A, 0xCA, 0x2A, 0xCB, 0x37,
-       0xCC, 0x42, 0xCD, 0x56, 0xCE, 0x00, 0xCF, 0x1A,
-       0xD0, 0x2A, 0xD1, 0x37, 0xD2, 0x42, 0xD3, 0x56,
-       0x5F, 0x68, 0x60, 0x87, 0x61, 0xA3, 0x62, 0xBC,
-       0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F,
-};
-
-static int camera_set_capture(struct soc_camera_platform_info *info,
-                             int enable)
-{
-       struct i2c_adapter *a = i2c_get_adapter(0);
-       struct i2c_msg msg;
-       int ret = 0;
-       int i;
-
-       if (!enable)
-               return 0; /* no disable for now */
-
-       for (i = 0; i < ARRAY_SIZE(camera_ncm03j_magic); i += 2) {
-               u_int8_t buf[8];
-
-               msg.addr = 0x6e;
-               msg.buf = buf;
-               msg.len = 2;
-               msg.flags = 0;
-
-               buf[0] = camera_ncm03j_magic[i];
-               buf[1] = camera_ncm03j_magic[i + 1];
-
-               ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
-       }
-
-       return ret;
-}
-
-static struct soc_camera_platform_info camera_info = {
-       .iface = 0,
-       .format_name = "UYVY",
-       .format_depth = 16,
-       .format = {
-               .pixelformat = V4L2_PIX_FMT_UYVY,
-               .colorspace = V4L2_COLORSPACE_SMPTE170M,
-               .width = 640,
-               .height = 480,
-       },
-       .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
-       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
-       .set_capture = camera_set_capture,
-};
-
-static struct platform_device camera_device = {
-       .name           = "soc_camera_platform",
-       .dev            = {
-               .platform_data  = &camera_info,
-       },
-};
-
-static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
-       .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
-       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
-};
-
-static struct resource ceu_resources[] = {
-       [0] = {
-               .name   = "CEU",
-               .start  = 0xfe910000,
-               .end    = 0xfe91009f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 52,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [2] = {
-               /* place holder for contiguous memory */
-       },
-};
-
-static struct platform_device ceu_device = {
-       .name           = "sh_mobile_ceu",
-       .num_resources  = ARRAY_SIZE(ceu_resources),
-       .resource       = ceu_resources,
-       .dev            = {
-               .platform_data  = &sh_mobile_ceu_info,
-       },
-};
-
-static struct platform_device *ap325rxa_devices[] __initdata = {
-       &smc9118_device,
-       &ap325rxa_nor_flash_device,
-       &lcdc_device,
-       &ceu_device,
-       &camera_device,
-};
-
-static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
-};
-
-static int __init ap325rxa_devices_setup(void)
-{
-       clk_always_enable("mstp200"); /* LCDC */
-       clk_always_enable("mstp203"); /* CEU */
-
-       platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
-
-       i2c_register_board_info(0, ap325rxa_i2c_devices,
-                               ARRAY_SIZE(ap325rxa_i2c_devices));
-       return platform_add_devices(ap325rxa_devices,
-                               ARRAY_SIZE(ap325rxa_devices));
-}
-device_initcall(ap325rxa_devices_setup);
-
-static void __init ap325rxa_setup(char **cmdline_p)
-{
-       /* LCDC configuration */
-       ctrl_outw(ctrl_inw(PORT_PHCR) & ~0xffff, PORT_PHCR);
-       ctrl_outw(ctrl_inw(PORT_PLCR) & ~0xffff, PORT_PLCR);
-       ctrl_outw(ctrl_inw(PORT_PMCR) & ~0xffff, PORT_PMCR);
-       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x03ff, PORT_PRCR);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01C0, PORT_HIZCRA);
-
-       /* CEU */
-       ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
-       ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD);
-       ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR);
-       ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR);
-}
-
-static struct sh_machine_vector mv_ap325rxa __initmv = {
-       .mv_name = "AP-325RXA",
-       .mv_setup = ap325rxa_setup,
-};
diff --git a/arch/sh/boards/renesas/edosk7705/Makefile b/arch/sh/boards/renesas/edosk7705/Makefile
deleted file mode 100644 (file)
index 14bdd53..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# Makefile for the EDOSK7705 specific parts of the kernel
-#
-
-obj-y   := setup.o io.o
-
diff --git a/arch/sh/boards/renesas/edosk7705/io.c b/arch/sh/boards/renesas/edosk7705/io.c
deleted file mode 100644 (file)
index 541cea2..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * arch/sh/boards/renesas/edosk7705/io.c
- *
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * I/O routines for Hitachi EDOSK7705 board.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <asm/io.h>
-#include <asm/edosk7705/io.h>
-#include <asm/addrspace.h>
-
-#define SMC_IOADDR     0xA2000000
-
-#define maybebadio(name,port) \
-  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
-        #name, (port), (__u32) __builtin_return_address(0))
-
-/* Map the Ethernet addresses as if it is at 0x300 - 0x320 */
-unsigned long sh_edosk7705_isa_port2addr(unsigned long port)
-{
-     if (port >= 0x300 && port < 0x320) {
-         /* SMC91C96 registers are 4 byte aligned rather than the
-          * usual 2 byte!
-          */
-         return SMC_IOADDR + ( (port - 0x300) * 2);
-     }
-
-     maybebadio(sh_edosk7705_isa_port2addr, port);
-     return port;
-}
-
-/* Trying to read / write bytes on odd-byte boundaries to the Ethernet
- * registers causes problems. So we bit-shift the value and read / write
- * in 2 byte chunks. Setting the low byte to 0 does not cause problems
- * now as odd byte writes are only made on the bit mask / interrupt
- * register. This may not be the case in future Mar-2003 SJD
- */
-unsigned char sh_edosk7705_inb(unsigned long port)
-{
-       if (port >= 0x300 && port < 0x320 && port & 0x01) {
-               return (volatile unsigned char)(generic_inw(port -1) >> 8);
-       }
-       return *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port);
-}
-
-unsigned int sh_edosk7705_inl(unsigned long port)
-{
-       return *(volatile unsigned long *)port;
-}
-
-void sh_edosk7705_outb(unsigned char value, unsigned long port)
-{
-       if (port >= 0x300 && port < 0x320 && port & 0x01) {
-               generic_outw(((unsigned short)value << 8), port -1);
-               return;
-       }
-       *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port) = value;
-}
-
-void sh_edosk7705_outl(unsigned int value, unsigned long port)
-{
-       *(volatile unsigned long *)port = value;
-}
-
-void sh_edosk7705_insb(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned char *p = addr;
-       while (count--) *p++ = sh_edosk7705_inb(port);
-}
-
-void sh_edosk7705_insl(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned long *p = (unsigned long*)addr;
-       while (count--)
-               *p++ = *(volatile unsigned long *)port;
-}
-
-void sh_edosk7705_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned char *p = (unsigned char*)addr;
-       while (count--) sh_edosk7705_outb(*p++, port);
-}
-
-void sh_edosk7705_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned long *p = (unsigned long*)addr;
-       while (count--) sh_edosk7705_outl(*p++, port);
-}
-
diff --git a/arch/sh/boards/renesas/edosk7705/setup.c b/arch/sh/boards/renesas/edosk7705/setup.c
deleted file mode 100644 (file)
index f076c45..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * arch/sh/boards/renesas/edosk7705/setup.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for edosk7705 development
- * board by S. Dunn, 2003.
- */
-#include <linux/init.h>
-#include <asm/machvec.h>
-#include <asm/edosk7705/io.h>
-
-static void __init sh_edosk7705_init_irq(void)
-{
-       /* This is the Ethernet interrupt */
-       make_imask_irq(0x09);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_edosk7705 __initmv = {
-       .mv_name                = "EDOSK7705",
-       .mv_nr_irqs             = 80,
-
-       .mv_inb                 = sh_edosk7705_inb,
-       .mv_inl                 = sh_edosk7705_inl,
-       .mv_outb                = sh_edosk7705_outb,
-       .mv_outl                = sh_edosk7705_outl,
-
-       .mv_inl_p               = sh_edosk7705_inl,
-       .mv_outl_p              = sh_edosk7705_outl,
-
-       .mv_insb                = sh_edosk7705_insb,
-       .mv_insl                = sh_edosk7705_insl,
-       .mv_outsb               = sh_edosk7705_outsb,
-       .mv_outsl               = sh_edosk7705_outsl,
-
-       .mv_isa_port2addr       = sh_edosk7705_isa_port2addr,
-       .mv_init_irq            = sh_edosk7705_init_irq,
-};
diff --git a/arch/sh/boards/renesas/migor/Kconfig b/arch/sh/boards/renesas/migor/Kconfig
deleted file mode 100644 (file)
index a7b3b72..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-if SH_MIGOR
-
-choice
-       prompt "Migo-R LCD Panel Board Selection"
-       default SH_MIGOR_QVGA
-
-config SH_MIGOR_QVGA
-       bool "QVGA (320x240)"
-
-config SH_MIGOR_RTA_WVGA
-       bool "RTA WVGA (800x480)"
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/renesas/migor/Makefile b/arch/sh/boards/renesas/migor/Makefile
deleted file mode 100644 (file)
index 5f231dd..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-obj-y   := setup.o
-obj-$(CONFIG_SH_MIGOR_QVGA)    +=  lcd_qvga.o
diff --git a/arch/sh/boards/renesas/migor/lcd_qvga.c b/arch/sh/boards/renesas/migor/lcd_qvga.c
deleted file mode 100644 (file)
index 6e96095..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Support for SuperH MigoR Quarter VGA LCD Panel
- *
- * Copyright (C) 2008 Magnus Damm
- *
- * Based on lcd_powertip.c from Kenati Technologies Pvt Ltd.
- * Copyright (c) 2007 Ujjwal Pande <ujjwal@kenati.com>,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/fb.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <asm/sh_mobile_lcdc.h>
-#include <asm/migor.h>
-
-/* LCD Module is a PH240320T according to board schematics. This module
- * is made up of a 240x320 LCD hooked up to a R61505U (or HX8347-A01?)
- * Driver IC. This IC is connected to the SH7722 built-in LCDC using a
- * SYS-80 interface configured in 16 bit mode.
- *
- * Index 0: "Device Code Read" returns 0x1505.
- */
-
-static void reset_lcd_module(void)
-{
-       ctrl_outb(ctrl_inb(PORT_PHDR) & ~0x04, PORT_PHDR);
-       mdelay(2);
-       ctrl_outb(ctrl_inb(PORT_PHDR) | 0x04, PORT_PHDR);
-       mdelay(1);
-}
-
-/* DB0-DB7 are connected to D1-D8, and DB8-DB15 to D10-D17 */
-
-static unsigned long adjust_reg18(unsigned short data)
-{
-       unsigned long tmp1, tmp2;
-
-       tmp1 = (data<<1 | 0x00000001) & 0x000001FF;
-       tmp2 = (data<<2 | 0x00000200) & 0x0003FE00;
-       return tmp1 | tmp2;
-}
-
-static void write_reg(void *sys_ops_handle,
-                      struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
-                      unsigned short reg, unsigned short data)
-{
-       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg << 8 | data));
-}
-
-static void write_reg16(void *sys_ops_handle,
-                       struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
-                       unsigned short reg, unsigned short data)
-{
-       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
-       sys_ops->write_data(sys_ops_handle, adjust_reg18(data));
-}
-
-static unsigned long read_reg16(void *sys_ops_handle,
-                               struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
-                               unsigned short reg)
-{
-       unsigned long data;
-
-       sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
-       data = sys_ops->read_data(sys_ops_handle);
-       return ((data >> 1) & 0xff) | ((data >> 2) & 0xff00);
-}
-
-static void migor_lcd_qvga_seq(void *sys_ops_handle,
-                              struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
-                              unsigned short const *data, int no_data)
-{
-       int i;
-
-       for (i = 0; i < no_data; i += 2)
-               write_reg16(sys_ops_handle, sys_ops, data[i], data[i + 1]);
-}
-
-static const unsigned short sync_data[] = {
-       0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-};
-
-static const unsigned short magic0_data[] = {
-       0x0060, 0x2700, 0x0008, 0x0808, 0x0090, 0x001A, 0x0007, 0x0001,
-       0x0017, 0x0001, 0x0019, 0x0000, 0x0010, 0x17B0, 0x0011, 0x0116,
-       0x0012, 0x0198, 0x0013, 0x1400, 0x0029, 0x000C, 0x0012, 0x01B8,
-};
-
-static const unsigned short magic1_data[] = {
-       0x0030, 0x0307, 0x0031, 0x0303, 0x0032, 0x0603, 0x0033, 0x0202,
-       0x0034, 0x0202, 0x0035, 0x0202, 0x0036, 0x1F1F, 0x0037, 0x0303,
-       0x0038, 0x0303, 0x0039, 0x0603, 0x003A, 0x0202, 0x003B, 0x0102,
-       0x003C, 0x0204, 0x003D, 0x0000, 0x0001, 0x0100, 0x0002, 0x0300,
-       0x0003, 0x5028, 0x0020, 0x00ef, 0x0021, 0x0000, 0x0004, 0x0000,
-       0x0009, 0x0000, 0x000A, 0x0008, 0x000C, 0x0000, 0x000D, 0x0000,
-       0x0015, 0x8000,
-};
-
-static const unsigned short magic2_data[] = {
-       0x0061, 0x0001, 0x0092, 0x0100, 0x0093, 0x0001, 0x0007, 0x0021,
-};
-
-static const unsigned short magic3_data[] = {
-       0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
-};
-
-int migor_lcd_qvga_setup(void *board_data, void *sohandle,
-                        struct sh_mobile_lcdc_sys_bus_ops *so)
-{
-       unsigned long xres = 320;
-       unsigned long yres = 240;
-       int k;
-
-       reset_lcd_module();
-       migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
-
-       if (read_reg16(sohandle, so, 0) != 0x1505)
-               return -ENODEV;
-
-       pr_info("Migo-R QVGA LCD Module detected.\n");
-
-       migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
-       write_reg16(sohandle, so, 0x00A4, 0x0001);
-       mdelay(10);
-
-       migor_lcd_qvga_seq(sohandle, so, magic0_data, ARRAY_SIZE(magic0_data));
-       mdelay(100);
-
-       migor_lcd_qvga_seq(sohandle, so, magic1_data, ARRAY_SIZE(magic1_data));
-       write_reg16(sohandle, so, 0x0050, 0xef - (yres - 1));
-       write_reg16(sohandle, so, 0x0051, 0x00ef);
-       write_reg16(sohandle, so, 0x0052, 0x0000);
-       write_reg16(sohandle, so, 0x0053, xres - 1);
-
-       migor_lcd_qvga_seq(sohandle, so, magic2_data, ARRAY_SIZE(magic2_data));
-       mdelay(10);
-
-       migor_lcd_qvga_seq(sohandle, so, magic3_data, ARRAY_SIZE(magic3_data));
-       mdelay(40);
-
-       /* clear GRAM to avoid displaying garbage */
-
-       write_reg16(sohandle, so, 0x0020, 0x0000); /* horiz addr */
-       write_reg16(sohandle, so, 0x0021, 0x0000); /* vert addr */
-
-       for (k = 0; k < (xres * 256); k++) /* yes, 256 words per line */
-               write_reg16(sohandle, so, 0x0022, 0x0000);
-
-       write_reg16(sohandle, so, 0x0020, 0x0000); /* reset horiz addr */
-       write_reg16(sohandle, so, 0x0021, 0x0000); /* reset vert addr */
-       write_reg16(sohandle, so, 0x0007, 0x0173);
-       mdelay(40);
-
-       /* enable display */
-       write_reg(sohandle, so, 0x00, 0x22);
-       mdelay(100);
-       return 0;
-}
diff --git a/arch/sh/boards/renesas/migor/setup.c b/arch/sh/boards/renesas/migor/setup.c
deleted file mode 100644 (file)
index 7bd365a..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * Renesas System Solutions Asia Pte. Ltd - Migo-R
- *
- * Copyright (C) 2008 Magnus Damm
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/nand.h>
-#include <linux/i2c.h>
-#include <linux/smc91x.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <media/soc_camera_platform.h>
-#include <media/sh_mobile_ceu.h>
-#include <asm/clock.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-#include <asm/sh_keysc.h>
-#include <asm/sh_mobile_lcdc.h>
-#include <asm/migor.h>
-
-/* Address     IRQ  Size  Bus  Description
- * 0x00000000       64MB  16   NOR Flash (SP29PL256N)
- * 0x0c000000       64MB  64   SDRAM (2xK4M563233G)
- * 0x10000000  IRQ0       16   Ethernet (SMC91C111)
- * 0x14000000  IRQ4       16   USB 2.0 Host Controller (M66596)
- * 0x18000000       8GB    8   NAND Flash (K9K8G08U0A)
- */
-
-static struct smc91x_platdata smc91x_info = {
-       .flags = SMC91X_USE_16BIT,
-};
-
-static struct resource smc91x_eth_resources[] = {
-       [0] = {
-               .name   = "SMC91C111" ,
-               .start  = 0x10000300,
-               .end    = 0x1000030f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 32, /* IRQ0 */
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
-       },
-};
-
-static struct platform_device smc91x_eth_device = {
-       .name           = "smc91x",
-       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
-       .resource       = smc91x_eth_resources,
-       .dev    = {
-               .platform_data  = &smc91x_info,
-       },
-};
-
-static struct sh_keysc_info sh_keysc_info = {
-       .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
-       .scan_timing = 3,
-       .delay = 5,
-       .keycodes = {
-               0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
-               0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
-               0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
-               0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
-               0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
-       },
-};
-
-static struct resource sh_keysc_resources[] = {
-       [0] = {
-               .start  = 0x044b0000,
-               .end    = 0x044b000f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 79,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sh_keysc_device = {
-       .name           = "sh_keysc",
-       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
-       .resource       = sh_keysc_resources,
-       .dev    = {
-               .platform_data  = &sh_keysc_info,
-       },
-};
-
-static struct mtd_partition migor_nor_flash_partitions[] =
-{
-       {
-               .name = "uboot",
-               .offset = 0,
-               .size = (1 * 1024 * 1024),
-               .mask_flags = MTD_WRITEABLE,    /* Read-only */
-       },
-       {
-               .name = "rootfs",
-               .offset = MTDPART_OFS_APPEND,
-               .size = (15 * 1024 * 1024),
-       },
-       {
-               .name = "other",
-               .offset = MTDPART_OFS_APPEND,
-               .size = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data migor_nor_flash_data = {
-       .width          = 2,
-       .parts          = migor_nor_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(migor_nor_flash_partitions),
-};
-
-static struct resource migor_nor_flash_resources[] = {
-       [0] = {
-               .name           = "NOR Flash",
-               .start          = 0x00000000,
-               .end            = 0x03ffffff,
-               .flags          = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device migor_nor_flash_device = {
-       .name           = "physmap-flash",
-       .resource       = migor_nor_flash_resources,
-       .num_resources  = ARRAY_SIZE(migor_nor_flash_resources),
-       .dev            = {
-               .platform_data = &migor_nor_flash_data,
-       },
-};
-
-static struct mtd_partition migor_nand_flash_partitions[] = {
-       {
-               .name           = "nanddata1",
-               .offset         = 0x0,
-               .size           = 512 * 1024 * 1024,
-       },
-       {
-               .name           = "nanddata2",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 512 * 1024 * 1024,
-       },
-};
-
-static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd,
-                                    unsigned int ctrl)
-{
-       struct nand_chip *chip = mtd->priv;
-
-       if (cmd == NAND_CMD_NONE)
-               return;
-
-       if (ctrl & NAND_CLE)
-               writeb(cmd, chip->IO_ADDR_W + 0x00400000);
-       else if (ctrl & NAND_ALE)
-               writeb(cmd, chip->IO_ADDR_W + 0x00800000);
-       else
-               writeb(cmd, chip->IO_ADDR_W);
-}
-
-static int migor_nand_flash_ready(struct mtd_info *mtd)
-{
-       return ctrl_inb(PORT_PADR) & 0x02; /* PTA1 */
-}
-
-struct platform_nand_data migor_nand_flash_data = {
-       .chip = {
-               .nr_chips = 1,
-               .partitions = migor_nand_flash_partitions,
-               .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
-               .chip_delay = 20,
-               .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
-       },
-       .ctrl = {
-               .dev_ready = migor_nand_flash_ready,
-               .cmd_ctrl = migor_nand_flash_cmd_ctl,
-       },
-};
-
-static struct resource migor_nand_flash_resources[] = {
-       [0] = {
-               .name           = "NAND Flash",
-               .start          = 0x18000000,
-               .end            = 0x18ffffff,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device migor_nand_flash_device = {
-       .name           = "gen_nand",
-       .resource       = migor_nand_flash_resources,
-       .num_resources  = ARRAY_SIZE(migor_nand_flash_resources),
-       .dev            = {
-               .platform_data = &migor_nand_flash_data,
-       }
-};
-
-static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
-#ifdef CONFIG_SH_MIGOR_RTA_WVGA
-       .clock_source = LCDC_CLK_BUS,
-       .ch[0] = {
-               .chan = LCDC_CHAN_MAINLCD,
-               .bpp = 16,
-               .interface_type = RGB16,
-               .clock_divider = 2,
-               .lcd_cfg = {
-                       .name = "LB070WV1",
-                       .xres = 800,
-                       .yres = 480,
-                       .left_margin = 64,
-                       .right_margin = 16,
-                       .hsync_len = 120,
-                       .upper_margin = 1,
-                       .lower_margin = 17,
-                       .vsync_len = 2,
-                       .sync = 0,
-               },
-       }
-#endif
-#ifdef CONFIG_SH_MIGOR_QVGA
-       .clock_source = LCDC_CLK_PERIPHERAL,
-       .ch[0] = {
-               .chan = LCDC_CHAN_MAINLCD,
-               .bpp = 16,
-               .interface_type = SYS16A,
-               .clock_divider = 10,
-               .lcd_cfg = {
-                       .name = "PH240320T",
-                       .xres = 320,
-                       .yres = 240,
-                       .left_margin = 0,
-                       .right_margin = 16,
-                       .hsync_len = 8,
-                       .upper_margin = 1,
-                       .lower_margin = 17,
-                       .vsync_len = 2,
-                       .sync = FB_SYNC_HOR_HIGH_ACT,
-               },
-               .board_cfg = {
-                       .setup_sys = migor_lcd_qvga_setup,
-               },
-               .sys_bus_cfg = {
-                       .ldmt2r = 0x06000a09,
-                       .ldmt3r = 0x180e3418,
-               },
-       }
-#endif
-};
-
-static struct resource migor_lcdc_resources[] = {
-       [0] = {
-               .name   = "LCDC",
-               .start  = 0xfe940000, /* P4-only space */
-               .end    = 0xfe941fff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device migor_lcdc_device = {
-       .name           = "sh_mobile_lcdc_fb",
-       .num_resources  = ARRAY_SIZE(migor_lcdc_resources),
-       .resource       = migor_lcdc_resources,
-       .dev    = {
-               .platform_data  = &sh_mobile_lcdc_info,
-       },
-};
-
-static struct clk *camera_clk;
-
-static void camera_power_on(void)
-{
-       unsigned char value;
-
-       camera_clk = clk_get(NULL, "video_clk");
-       clk_set_rate(camera_clk, 24000000);
-       clk_enable(camera_clk); /* start VIO_CKO */
-
-       mdelay(10);
-       value = ctrl_inb(PORT_PTDR);
-       value &= ~0x09;
-#ifndef CONFIG_SH_MIGOR_RTA_WVGA
-       value |= 0x01;
-#endif
-       ctrl_outb(value, PORT_PTDR);
-       mdelay(10);
-
-       ctrl_outb(value | 8, PORT_PTDR);
-}
-
-static void camera_power_off(void)
-{
-       clk_disable(camera_clk); /* stop VIO_CKO */
-       clk_put(camera_clk);
-
-       ctrl_outb(ctrl_inb(PORT_PTDR) & ~0x08, PORT_PTDR);
-}
-
-static unsigned char camera_ov772x_magic[] =
-{
-       0x09, 0x01, 0x0c, 0x10, 0x0d, 0x41, 0x0e, 0x01,
-       0x12, 0x00, 0x13, 0x8F, 0x14, 0x4A, 0x15, 0x00,
-       0x16, 0x00, 0x17, 0x23, 0x18, 0xa0, 0x19, 0x07,
-       0x1a, 0xf0, 0x1b, 0x40, 0x1f, 0x00, 0x20, 0x10,
-       0x22, 0xff, 0x23, 0x01, 0x28, 0x00, 0x29, 0xa0,
-       0x2a, 0x00, 0x2b, 0x00, 0x2c, 0xf0, 0x2d, 0x00,
-       0x2e, 0x00, 0x30, 0x80, 0x31, 0x60, 0x32, 0x00,
-       0x33, 0x00, 0x34, 0x00, 0x3d, 0x80, 0x3e, 0xe2,
-       0x3f, 0x1f, 0x42, 0x80, 0x43, 0x80, 0x44, 0x80,
-       0x45, 0x80, 0x46, 0x00, 0x47, 0x00, 0x48, 0x00,
-       0x49, 0x50, 0x4a, 0x30, 0x4b, 0x50, 0x4c, 0x50,
-       0x4d, 0x00, 0x4e, 0xef, 0x4f, 0x10, 0x50, 0x60,
-       0x51, 0x00, 0x52, 0x00, 0x53, 0x24, 0x54, 0x7a,
-       0x55, 0xfc, 0x62, 0xff, 0x63, 0xf0, 0x64, 0x1f,
-       0x65, 0x00, 0x66, 0x10, 0x67, 0x00, 0x68, 0x00,
-       0x69, 0x5c, 0x6a, 0x11, 0x6b, 0xa2, 0x6c, 0x01,
-       0x6d, 0x50, 0x6e, 0x80, 0x6f, 0x80, 0x70, 0x0f,
-       0x71, 0x00, 0x72, 0x00, 0x73, 0x0f, 0x74, 0x0f,
-       0x75, 0xff, 0x78, 0x10, 0x79, 0x70, 0x7a, 0x70,
-       0x7b, 0xf0, 0x7c, 0xf0, 0x7d, 0xf0, 0x7e, 0x0e,
-       0x7f, 0x1a, 0x80, 0x31, 0x81, 0x5a, 0x82, 0x69,
-       0x83, 0x75, 0x84, 0x7e, 0x85, 0x88, 0x86, 0x8f,
-       0x87, 0x96, 0x88, 0xa3, 0x89, 0xaf, 0x8a, 0xc4,
-       0x8b, 0xd7, 0x8c, 0xe8, 0x8d, 0x20, 0x8e, 0x00,
-       0x8f, 0x00, 0x90, 0x08, 0x91, 0x10, 0x92, 0x1f,
-       0x93, 0x01, 0x94, 0x2c, 0x95, 0x24, 0x96, 0x08,
-       0x97, 0x14, 0x98, 0x24, 0x99, 0x38, 0x9a, 0x9e,
-       0x9b, 0x00, 0x9c, 0x40, 0x9e, 0x11, 0x9f, 0x02,
-       0xa0, 0x00, 0xa1, 0x40, 0xa2, 0x40, 0xa3, 0x06,
-       0xa4, 0x00, 0xa6, 0x00, 0xa7, 0x40, 0xa8, 0x40,
-       0xa9, 0x80, 0xaa, 0x80, 0xab, 0x06, 0xac, 0xff,
-       0x12, 0x06, 0x64, 0x3f, 0x12, 0x46, 0x17, 0x3f,
-       0x18, 0x50, 0x19, 0x03, 0x1a, 0x78, 0x29, 0x50,
-       0x2c, 0x78,
-};
-
-static int ov772x_set_capture(struct soc_camera_platform_info *info,
-                             int enable)
-{
-       struct i2c_adapter *a = i2c_get_adapter(0);
-       struct i2c_msg msg;
-       int ret = 0;
-       int i;
-
-       if (!enable)
-               return 0; /* camera_power_off() is enough */
-
-       for (i = 0; i < ARRAY_SIZE(camera_ov772x_magic); i += 2) {
-               u_int8_t buf[8];
-
-               msg.addr = 0x21;
-               msg.buf = buf;
-               msg.len = 2;
-               msg.flags = 0;
-
-               buf[0] = camera_ov772x_magic[i];
-               buf[1] = camera_ov772x_magic[i + 1];
-
-               ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
-       }
-
-       return ret;
-}
-
-static struct soc_camera_platform_info ov772x_info = {
-       .iface = 0,
-       .format_name = "RGB565",
-       .format_depth = 16,
-       .format = {
-               .pixelformat = V4L2_PIX_FMT_RGB565,
-               .colorspace = V4L2_COLORSPACE_SRGB,
-               .width = 320,
-               .height = 240,
-       },
-       .bus_param =  SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
-       SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
-       .set_capture = ov772x_set_capture,
-};
-
-static struct platform_device migor_camera_device = {
-       .name           = "soc_camera_platform",
-       .dev    = {
-               .platform_data  = &ov772x_info,
-       },
-};
-
-static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
-       .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \
-       | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH,
-       .enable_camera = camera_power_on,
-       .disable_camera = camera_power_off,
-};
-
-static struct resource migor_ceu_resources[] = {
-       [0] = {
-               .name   = "CEU",
-               .start  = 0xfe910000,
-               .end    = 0xfe91009f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 52,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [2] = {
-               /* place holder for contiguous memory */
-       },
-};
-
-static struct platform_device migor_ceu_device = {
-       .name           = "sh_mobile_ceu",
-       .num_resources  = ARRAY_SIZE(migor_ceu_resources),
-       .resource       = migor_ceu_resources,
-       .dev    = {
-               .platform_data  = &sh_mobile_ceu_info,
-       },
-};
-
-static struct platform_device *migor_devices[] __initdata = {
-       &smc91x_eth_device,
-       &sh_keysc_device,
-       &migor_lcdc_device,
-       &migor_ceu_device,
-       &migor_camera_device,
-       &migor_nor_flash_device,
-       &migor_nand_flash_device,
-};
-
-static struct i2c_board_info migor_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("rs5c372b", 0x32),
-       },
-       {
-               I2C_BOARD_INFO("migor_ts", 0x51),
-               .irq = 38, /* IRQ6 */
-       },
-};
-
-static int __init migor_devices_setup(void)
-{
-       clk_always_enable("mstp214"); /* KEYSC */
-       clk_always_enable("mstp200"); /* LCDC */
-       clk_always_enable("mstp203"); /* CEU */
-
-       platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20);
-
-       i2c_register_board_info(0, migor_i2c_devices,
-                               ARRAY_SIZE(migor_i2c_devices));
-       return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
-}
-__initcall(migor_devices_setup);
-
-static void __init migor_setup(char **cmdline_p)
-{
-       /* SMC91C111 - Enable IRQ0 */
-       ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR);
-
-       /* KEYSC */
-       ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR);
-       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR);
-       ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
-       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
-
-       /* NAND Flash */
-       ctrl_outw(ctrl_inw(PORT_PXCR) & 0x0fff, PORT_PXCR);
-       ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x00000600) | 0x00000200,
-                 BSC_CS6ABCR);
-
-       /* Touch Panel - Enable IRQ6 */
-       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0xc, PORT_PZCR);
-       ctrl_outw((ctrl_inw(PORT_PSELA) | 0x8000), PORT_PSELA);
-       ctrl_outw((ctrl_inw(PORT_HIZCRC) & ~0x4000), PORT_HIZCRC);
-
-#ifdef CONFIG_SH_MIGOR_RTA_WVGA
-       /* LCDC - WVGA - Enable RGB Interface signals */
-       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR);
-       ctrl_outw(0x0000, PORT_PHCR);
-       ctrl_outw(0x0000, PORT_PLCR);
-       ctrl_outw(0x0000, PORT_PMCR);
-       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x000f, PORT_PRCR);
-       ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x000d) | 0x0400, PORT_PSELD);
-       ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0100, PORT_MSELCRB);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA);
-#endif
-#ifdef CONFIG_SH_MIGOR_QVGA
-       /* LCDC - QVGA - Enable SYS Interface signals */
-       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR);
-       ctrl_outw((ctrl_inw(PORT_PHCR) & ~0xcfff) | 0x0010, PORT_PHCR);
-       ctrl_outw(0x0000, PORT_PLCR);
-       ctrl_outw(0x0000, PORT_PMCR);
-       ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x030f, PORT_PRCR);
-       ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x0001) | 0x0420, PORT_PSELD);
-       ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x0100, PORT_MSELCRB);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA);
-#endif
-
-       /* CEU */
-       ctrl_outw((ctrl_inw(PORT_PTCR) & ~0x03c3) | 0x0051, PORT_PTCR);
-       ctrl_outw(ctrl_inw(PORT_PUCR) & ~0x03ff, PORT_PUCR);
-       ctrl_outw(ctrl_inw(PORT_PVCR) & ~0x03ff, PORT_PVCR);
-       ctrl_outw(ctrl_inw(PORT_PWCR) & ~0x3c00, PORT_PWCR);
-       ctrl_outw(ctrl_inw(PORT_PSELC) | 0x0001, PORT_PSELC);
-       ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x2000, PORT_PSELD);
-       ctrl_outw(ctrl_inw(PORT_PSELE) | 0x000f, PORT_PSELE);
-       ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2200, PORT_MSELCRB);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x0a00, PORT_HIZCRA);
-       ctrl_outw(ctrl_inw(PORT_HIZCRB) & ~0x0003, PORT_HIZCRB);
-}
-
-static struct sh_machine_vector mv_migor __initmv = {
-       .mv_name                = "Migo-R",
-       .mv_setup               = migor_setup,
-};
diff --git a/arch/sh/boards/renesas/r7780rp/Kconfig b/arch/sh/boards/renesas/r7780rp/Kconfig
deleted file mode 100644 (file)
index fc8f28e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-if SH_HIGHLANDER
-
-choice
-       prompt "Highlander options"
-       default SH_R7780MP
-
-config SH_R7780RP
-       bool "R7780RP-1 board support"
-       depends on CPU_SUBTYPE_SH7780
-
-config SH_R7780MP
-       bool "R7780MP board support"
-       depends on CPU_SUBTYPE_SH7780
-       help
-         Selecting this option will enable support for the mass-production
-         version of the R7780RP. If in doubt, say Y.
-
-config SH_R7785RP
-       bool "R7785RP board support"
-       depends on CPU_SUBTYPE_SH7785
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile
deleted file mode 100644 (file)
index 20a1008..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# Makefile for the R7780RP-1 specific parts of the kernel
-#
-irqinit-$(CONFIG_SH_R7780MP)   := irq-r7780mp.o
-irqinit-$(CONFIG_SH_R7785RP)   := irq-r7785rp.o
-irqinit-$(CONFIG_SH_R7780RP)   := irq-r7780rp.o
-obj-y                          := setup.o $(irqinit-y)
-
-ifneq ($(CONFIG_SH_R7785RP),y)
-obj-$(CONFIG_PUSH_SWITCH)      += psw.o
-endif
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c
deleted file mode 100644 (file)
index ae1cfcb..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Renesas Solutions Highlander R7780MP Support.
- *
- * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006  Paul Mundt
- * Copyright (C) 2007  Magnus Damm
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <asm/r7780rp.h>
-
-enum {
-       UNUSED = 0,
-
-       /* board specific interrupt sources */
-       CF,             /* Compact Flash */
-       TP,             /* Touch panel */
-       SCIF1,          /* FPGA SCIF1 */
-       SCIF0,          /* FPGA SCIF0 */
-       SMBUS,          /* SMBUS */
-       RTC,            /* RTC Alarm */
-       AX88796,        /* Ethernet controller */
-       PSW,            /* Push Switch */
-
-       /* external bus connector */
-       EXT1, EXT2, EXT4, EXT5, EXT6,
-};
-
-static struct intc_vect vectors[] __initdata = {
-       INTC_IRQ(CF, IRQ_CF),
-       INTC_IRQ(TP, IRQ_TP),
-       INTC_IRQ(SCIF1, IRQ_SCIF1),
-       INTC_IRQ(SCIF0, IRQ_SCIF0),
-       INTC_IRQ(SMBUS, IRQ_SMBUS),
-       INTC_IRQ(RTC, IRQ_RTC),
-       INTC_IRQ(AX88796, IRQ_AX88796),
-       INTC_IRQ(PSW, IRQ_PSW),
-
-       INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2),
-       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
-       INTC_IRQ(EXT6, IRQ_EXT6),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
-       { 0xa4000000, 0, 16, /* IRLMSK */
-         { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS,
-           0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
-       0, IRQ_CF, IRQ_TP, IRQ_SCIF1,
-       IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6,
-       IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1,
-       0, IRQ_AX88796, IRQ_PSW,
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
-                        NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
-       if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) {
-               printk(KERN_INFO "Using r7780mp interrupt controller.\n");
-               register_intc_controller(&intc_desc);
-               return irl2irq;
-       }
-
-       return NULL;
-}
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c
deleted file mode 100644 (file)
index 9d3921f..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Renesas Solutions Highlander R7780RP-1 Support.
- *
- * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006  Paul Mundt
- * Copyright (C) 2008  Magnus Damm
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <asm/r7780rp.h>
-
-enum {
-       UNUSED = 0,
-
-       /* board specific interrupt sources */
-
-       AX88796,          /* Ethernet controller */
-       PSW,              /* Push Switch */
-       CF,               /* Compact Flash */
-
-       PCI_A,
-       PCI_B,
-       PCI_C,
-       PCI_D,
-};
-
-static struct intc_vect vectors[] __initdata = {
-       INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */
-       INTC_IRQ(PCI_B, 66),
-       INTC_IRQ(PCI_C, 67),
-       INTC_IRQ(PCI_D, 68),
-       INTC_IRQ(CF, IRQ_CF),
-       INTC_IRQ(PSW, IRQ_PSW),
-       INTC_IRQ(AX88796, IRQ_AX88796),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
-       { 0xa5000000, 0, 16, /* IRLMSK */
-         { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0,
-           0, 0, 0, 0, 0, 0, PSW, AX88796 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
-       65, 66, 67, 68,
-       IRQ_CF, 0, 0, 0,
-       0, 0, 0, 0,
-       IRQ_AX88796, IRQ_PSW
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors,
-                        NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
-       if (ctrl_inw(0xa5000600)) {
-               printk(KERN_INFO "Using r7780rp interrupt controller.\n");
-               register_intc_controller(&intc_desc);
-               return irl2irq;
-       }
-
-       return NULL;
-}
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c
deleted file mode 100644 (file)
index 896c045..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Renesas Solutions Highlander R7785RP Support.
- *
- * Copyright (C) 2002  Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006 - 2008  Paul Mundt
- * Copyright (C) 2007  Magnus Damm
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <asm/r7780rp.h>
-
-enum {
-       UNUSED = 0,
-
-       /* FPGA specific interrupt sources */
-       CF,             /* Compact Flash */
-       SMBUS,          /* SMBUS */
-       TP,             /* Touch panel */
-       RTC,            /* RTC Alarm */
-       TH_ALERT,       /* Temperature sensor */
-       AX88796,        /* Ethernet controller */
-
-       /* external bus connector */
-       EXT0, EXT1, EXT2, EXT3, EXT4, EXT5, EXT6, EXT7,
-};
-
-static struct intc_vect vectors[] __initdata = {
-       INTC_IRQ(CF, IRQ_CF),
-       INTC_IRQ(SMBUS, IRQ_SMBUS),
-       INTC_IRQ(TP, IRQ_TP),
-       INTC_IRQ(RTC, IRQ_RTC),
-       INTC_IRQ(TH_ALERT, IRQ_TH_ALERT),
-
-       INTC_IRQ(EXT0, IRQ_EXT0), INTC_IRQ(EXT1, IRQ_EXT1),
-       INTC_IRQ(EXT2, IRQ_EXT2), INTC_IRQ(EXT3, IRQ_EXT3),
-
-       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
-       INTC_IRQ(EXT6, IRQ_EXT6), INTC_IRQ(EXT7, IRQ_EXT7),
-
-       INTC_IRQ(AX88796, IRQ_AX88796),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
-       { 0xa4000010, 0, 16, /* IRLMCR1 */
-         { 0, 0, 0, 0, CF, AX88796, SMBUS, TP,
-           RTC, 0, TH_ALERT, 0, 0, 0, 0, 0 } },
-       { 0xa4000012, 0, 16, /* IRLMCR2 */
-         { 0, 0, 0, 0, 0, 0, 0, 0,
-           EXT7, EXT6, EXT5, EXT4, EXT3, EXT2, EXT1, EXT0 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
-       0, IRQ_CF, IRQ_EXT4, IRQ_EXT5,
-       IRQ_EXT6, IRQ_EXT7, IRQ_SMBUS, IRQ_TP,
-       IRQ_RTC, IRQ_TH_ALERT, IRQ_AX88796, IRQ_EXT0,
-       IRQ_EXT1, IRQ_EXT2, IRQ_EXT3,
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors,
-                        NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
-       if ((ctrl_inw(0xa4000158) & 0xf000) != 0x1000)
-               return NULL;
-
-       printk(KERN_INFO "Using r7785rp interrupt controller.\n");
-
-       ctrl_outw(0x0000, PA_IRLSSR1);  /* FPGA IRLSSR1(CF_CD clear) */
-
-       /* Setup the FPGA IRL */
-       ctrl_outw(0x0000, PA_IRLPRA);   /* FPGA IRLA */
-       ctrl_outw(0xe598, PA_IRLPRB);   /* FPGA IRLB */
-       ctrl_outw(0x7060, PA_IRLPRC);   /* FPGA IRLC */
-       ctrl_outw(0x0000, PA_IRLPRD);   /* FPGA IRLD */
-       ctrl_outw(0x4321, PA_IRLPRE);   /* FPGA IRLE */
-       ctrl_outw(0xdcba, PA_IRLPRF);   /* FPGA IRLF */
-
-       register_intc_controller(&intc_desc);
-       return irl2irq;
-}
diff --git a/arch/sh/boards/renesas/r7780rp/psw.c b/arch/sh/boards/renesas/r7780rp/psw.c
deleted file mode 100644 (file)
index 0b3e062..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * arch/sh/boards/renesas/r7780rp/psw.c
- *
- * push switch support for RDBRP-1/RDBREVRP-1 debug boards.
- *
- * Copyright (C) 2006  Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/io.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <mach/r7780rp.h>
-#include <asm/push-switch.h>
-
-static irqreturn_t psw_irq_handler(int irq, void *arg)
-{
-       struct platform_device *pdev = arg;
-       struct push_switch *psw = platform_get_drvdata(pdev);
-       struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
-       unsigned int l, mask;
-       int ret = 0;
-
-       l = ctrl_inw(PA_DBSW);
-
-       /* Nothing to do if there's no state change */
-       if (psw->state) {
-               ret = 1;
-               goto out;
-       }
-
-       mask = l & 0x70;
-       /* Figure out who raised it */
-       if (mask & (1 << psw_info->bit)) {
-               psw->state = !!(mask & (1 << psw_info->bit));
-               if (psw->state) /* debounce */
-                       mod_timer(&psw->debounce, jiffies + 50);
-
-               ret = 1;
-       }
-
-out:
-       /* Clear the switch IRQs */
-       l |= (0x7 << 12);
-       ctrl_outw(l, PA_DBSW);
-
-       return IRQ_RETVAL(ret);
-}
-
-static struct resource psw_resources[] = {
-       [0] = {
-               .start  = IRQ_PSW,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct push_switch_platform_info s2_platform_data = {
-       .name           = "s2",
-       .bit            = 6,
-       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
-                         IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct platform_device s2_switch_device = {
-       .name           = "push-switch",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(psw_resources),
-       .resource       = psw_resources,
-       .dev            = {
-               .platform_data = &s2_platform_data,
-       },
-};
-
-static struct push_switch_platform_info s3_platform_data = {
-       .name           = "s3",
-       .bit            = 5,
-       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
-                         IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct platform_device s3_switch_device = {
-       .name           = "push-switch",
-       .id             = 1,
-       .num_resources  = ARRAY_SIZE(psw_resources),
-       .resource       = psw_resources,
-       .dev            = {
-               .platform_data = &s3_platform_data,
-       },
-};
-
-static struct push_switch_platform_info s4_platform_data = {
-       .name           = "s4",
-       .bit            = 4,
-       .irq_flags      = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
-                         IRQF_SHARED,
-       .irq_handler    = psw_irq_handler,
-};
-
-static struct platform_device s4_switch_device = {
-       .name           = "push-switch",
-       .id             = 2,
-       .num_resources  = ARRAY_SIZE(psw_resources),
-       .resource       = psw_resources,
-       .dev            = {
-               .platform_data = &s4_platform_data,
-       },
-};
-
-static struct platform_device *psw_devices[] = {
-       &s2_switch_device, &s3_switch_device, &s4_switch_device,
-};
-
-static int __init psw_init(void)
-{
-       return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
-}
-module_init(psw_init);
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
deleted file mode 100644 (file)
index bc79afb..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * arch/sh/boards/renesas/r7780rp/setup.c
- *
- * Renesas Solutions Highlander Support.
- *
- * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2005 - 2008 Paul Mundt
- *
- * This contains support for the R7780RP-1, R7780MP, and R7785RP
- * Highlander modules.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/types.h>
-#include <linux/i2c.h>
-#include <net/ax88796.h>
-#include <asm/machvec.h>
-#include <asm/r7780rp.h>
-#include <asm/clock.h>
-#include <asm/heartbeat.h>
-#include <asm/io.h>
-#include <asm/io_trapped.h>
-
-static struct resource r8a66597_usb_host_resources[] = {
-       [0] = {
-               .name   = "r8a66597_hcd",
-               .start  = 0xA4200000,
-               .end    = 0xA42000FF,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "r8a66597_hcd",
-               .start  = IRQ_EXT1,             /* irq number */
-               .end    = IRQ_EXT1,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
-       .name           = "r8a66597_hcd",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
-       .resource       = r8a66597_usb_host_resources,
-};
-
-static struct resource m66592_usb_peripheral_resources[] = {
-       [0] = {
-               .name   = "m66592_udc",
-               .start  = 0xb0000000,
-               .end    = 0xb00000FF,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "m66592_udc",
-               .start  = IRQ_EXT4,             /* irq number */
-               .end    = IRQ_EXT4,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device m66592_usb_peripheral_device = {
-       .name           = "m66592_udc",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(m66592_usb_peripheral_resources),
-       .resource       = m66592_usb_peripheral_resources,
-};
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_AREA5_IO + 0x1000,
-               .end    = PA_AREA5_IO + 0x1000 + 0x08 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = PA_AREA5_IO + 0x80c,
-               .end    = PA_AREA5_IO + 0x80c + 0x16 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = IRQ_CF,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct pata_platform_info pata_info = {
-       .ioport_shift   = 1,
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-       .dev    = {
-               .platform_data  = &pata_info,
-       },
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_OBLED,
-               .end    = PA_OBLED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-#ifndef CONFIG_SH_R7785RP
-static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-};
-#endif
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-
-       /* R7785RP has a slightly more sensible FPGA.. */
-#ifndef CONFIG_SH_R7785RP
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-#endif
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct ax_plat_data ax88796_platdata = {
-       .flags          = AXFLG_HAS_93CX6,
-       .wordlength     = 2,
-       .dcr_val        = 0x1,
-       .rcr_val        = 0x40,
-};
-
-static struct resource ax88796_resources[] = {
-       {
-#ifdef CONFIG_SH_R7780RP
-               .start  = 0xa5800400,
-               .end    = 0xa5800400 + (0x20 * 0x2) - 1,
-#else
-               .start  = 0xa4100400,
-               .end    = 0xa4100400 + (0x20 * 0x2) - 1,
-#endif
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = IRQ_AX88796,
-               .end    = IRQ_AX88796,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device ax88796_device = {
-       .name           = "ax88796",
-       .id             = 0,
-
-       .dev    = {
-               .platform_data = &ax88796_platdata,
-       },
-
-       .num_resources  = ARRAY_SIZE(ax88796_resources),
-       .resource       = ax88796_resources,
-};
-
-static struct resource smbus_resources[] = {
-       [0] = {
-               .start  = PA_SMCR,
-               .end    = PA_SMCR + 0x100 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_SMBUS,
-               .end    = IRQ_SMBUS,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smbus_device = {
-       .name           = "i2c-highlander",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(smbus_resources),
-       .resource       = smbus_resources,
-};
-
-static struct i2c_board_info __initdata highlander_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("r2025sd", 0x32),
-       },
-};
-
-static struct platform_device *r7780rp_devices[] __initdata = {
-       &r8a66597_usb_host_device,
-       &m66592_usb_peripheral_device,
-       &heartbeat_device,
-       &smbus_device,
-#ifndef CONFIG_SH_R7780RP
-       &ax88796_device,
-#endif
-};
-
-/*
- * The CF is connected using a 16-bit bus where 8-bit operations are
- * unsupported. The linux ata driver is however using 8-bit operations, so
- * insert a trapped io filter to convert 8-bit operations into 16-bit.
- */
-static struct trapped_io cf_trapped_io = {
-       .resource               = cf_ide_resources,
-       .num_resources          = 2,
-       .minimum_bus_width      = 16,
-};
-
-static int __init r7780rp_devices_setup(void)
-{
-       int ret = 0;
-
-#ifndef CONFIG_SH_R7780RP
-       if (register_trapped_io(&cf_trapped_io) == 0)
-               ret |= platform_device_register(&cf_ide_device);
-#endif
-
-       ret |= platform_add_devices(r7780rp_devices,
-                                   ARRAY_SIZE(r7780rp_devices));
-
-       ret |= i2c_register_board_info(0, highlander_i2c_devices,
-                                      ARRAY_SIZE(highlander_i2c_devices));
-
-       return ret;
-}
-device_initcall(r7780rp_devices_setup);
-
-/*
- * Platform specific clocks
- */
-static void ivdr_clk_enable(struct clk *clk)
-{
-       ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL);
-}
-
-static void ivdr_clk_disable(struct clk *clk)
-{
-       ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
-}
-
-static struct clk_ops ivdr_clk_ops = {
-       .enable         = ivdr_clk_enable,
-       .disable        = ivdr_clk_disable,
-};
-
-static struct clk ivdr_clk = {
-       .name           = "ivdr_clk",
-       .ops            = &ivdr_clk_ops,
-};
-
-static struct clk *r7780rp_clocks[] = {
-       &ivdr_clk,
-};
-
-static void r7780rp_power_off(void)
-{
-       if (mach_is_r7780mp() || mach_is_r7785rp())
-               ctrl_outw(0x0001, PA_POFF);
-}
-
-/*
- * Initialize the board
- */
-static void __init highlander_setup(char **cmdline_p)
-{
-       u16 ver = ctrl_inw(PA_VERREG);
-       int i;
-
-       printk(KERN_INFO "Renesas Solutions Highlander %s support.\n",
-                        mach_is_r7780rp() ? "R7780RP-1" :
-                        mach_is_r7780mp() ? "R7780MP"   :
-                                            "R7785RP");
-
-       printk(KERN_INFO "Board version: %d (revision %d), "
-                        "FPGA version: %d (revision %d)\n",
-                        (ver >> 12) & 0xf, (ver >> 8) & 0xf,
-                        (ver >>  4) & 0xf, ver & 0xf);
-
-       /*
-        * Enable the important clocks right away..
-        */
-       for (i = 0; i < ARRAY_SIZE(r7780rp_clocks); i++) {
-               struct clk *clk = r7780rp_clocks[i];
-
-               clk_register(clk);
-               clk_enable(clk);
-       }
-
-       ctrl_outw(0x0000, PA_OBLED);    /* Clear LED. */
-
-       if (mach_is_r7780rp())
-               ctrl_outw(0x0001, PA_SDPOW);    /* SD Power ON */
-
-       ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL);     /* Si13112 */
-
-       pm_power_off = r7780rp_power_off;
-}
-
-static unsigned char irl2irq[HL_NR_IRL];
-
-static int highlander_irq_demux(int irq)
-{
-       if (irq >= HL_NR_IRL || !irl2irq[irq])
-               return irq;
-
-       return irl2irq[irq];
-}
-
-static void __init highlander_init_irq(void)
-{
-       unsigned char *ucp = highlander_plat_irq_setup();
-
-       if (ucp) {
-               plat_irq_setup_pins(IRQ_MODE_IRL3210);
-               memcpy(irl2irq, ucp, HL_NR_IRL);
-       }
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_highlander __initmv = {
-       .mv_name                = "Highlander",
-       .mv_setup               = highlander_setup,
-       .mv_init_irq            = highlander_init_irq,
-       .mv_irq_demux           = highlander_irq_demux,
-};
diff --git a/arch/sh/boards/renesas/rsk7203/Makefile b/arch/sh/boards/renesas/rsk7203/Makefile
deleted file mode 100644 (file)
index f663768..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y  := setup.o
diff --git a/arch/sh/boards/renesas/rsk7203/setup.c b/arch/sh/boards/renesas/rsk7203/setup.c
deleted file mode 100644 (file)
index ffbedc5..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Renesas Technology Europe RSK+ 7203 Support.
- *
- * Copyright (C) 2008 Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/map.h>
-#include <linux/smc911x.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-
-static struct smc911x_platdata smc911x_info = {
-       .flags          = SMC911X_USE_16BIT,
-       .irq_flags      = IRQF_TRIGGER_LOW,
-};
-
-static struct resource smc911x_resources[] = {
-       [0] = {
-               .start          = 0x24000000,
-               .end            = 0x24000000 + 0x100,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = 64,
-               .end            = 64,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc911x_device = {
-       .name           = "smc911x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc911x_resources),
-       .resource       = smc911x_resources,
-       .dev            = {
-               .platform_data = &smc911x_info,
-       },
-};
-
-static const char *probes[] = { "cmdlinepart", NULL };
-
-static struct mtd_partition *parsed_partitions;
-
-static struct mtd_partition rsk7203_partitions[] = {
-       {
-               .name           = "Bootloader",
-               .offset         = 0x00000000,
-               .size           = 0x00040000,
-               .mask_flags     = MTD_WRITEABLE,
-       }, {
-               .name           = "Kernel",
-               .offset         = MTDPART_OFS_NXTBLK,
-               .size           = 0x001c0000,
-       }, {
-               .name           = "Flash_FS",
-               .offset         = MTDPART_OFS_NXTBLK,
-               .size           = MTDPART_SIZ_FULL,
-       }
-};
-
-static struct physmap_flash_data flash_data = {
-       .width          = 2,
-};
-
-static struct resource flash_resource = {
-       .start          = 0x20000000,
-       .end            = 0x20400000,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device flash_device = {
-       .name           = "physmap-flash",
-       .id             = -1,
-       .resource       = &flash_resource,
-       .num_resources  = 1,
-       .dev            = {
-               .platform_data = &flash_data,
-       },
-};
-
-static struct mtd_info *flash_mtd;
-
-static struct map_info rsk7203_flash_map = {
-       .name           = "RSK+ Flash",
-       .size           = 0x400000,
-       .bankwidth      = 2,
-};
-
-static void __init set_mtd_partitions(void)
-{
-       int nr_parts = 0;
-
-       simple_map_init(&rsk7203_flash_map);
-       flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map);
-       nr_parts = parse_mtd_partitions(flash_mtd, probes,
-                                       &parsed_partitions, 0);
-       /* If there is no partition table, used the hard coded table */
-       if (nr_parts <= 0) {
-               flash_data.parts = rsk7203_partitions;
-               flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions);
-       } else {
-               flash_data.nr_parts = nr_parts;
-               flash_data.parts = parsed_partitions;
-       }
-}
-
-
-static struct platform_device *rsk7203_devices[] __initdata = {
-       &smc911x_device,
-       &flash_device,
-};
-
-static int __init rsk7203_devices_setup(void)
-{
-       set_mtd_partitions();
-       return platform_add_devices(rsk7203_devices,
-                                   ARRAY_SIZE(rsk7203_devices));
-}
-device_initcall(rsk7203_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_rsk7203 __initmv = {
-       .mv_name        = "RSK+7203",
-};
diff --git a/arch/sh/boards/renesas/rts7751r2d/Kconfig b/arch/sh/boards/renesas/rts7751r2d/Kconfig
deleted file mode 100644 (file)
index 8122a96..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-if SH_RTS7751R2D
-
-menu "RTS7751R2D Board Revision"
-
-config RTS7751R2D_PLUS
-       bool "R2D-PLUS"
-       help
-         Selecting this option will configure the kernel for R2D-PLUS.
-
-         R2D-PLUS is the smaller of the two R2D board versions, equipped
-         with a single PCI slot.
-
-config RTS7751R2D_1
-       bool "R2D-1"
-       help
-         Selecting this option will configure the kernel for R2D-1.
-
-         R2D-1 is the larger of the two R2D board versions, equipped
-         with two PCI slots.
-endmenu
-
-endif
-
diff --git a/arch/sh/boards/renesas/rts7751r2d/Makefile b/arch/sh/boards/renesas/rts7751r2d/Makefile
deleted file mode 100644 (file)
index 0d4c75a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the RTS7751R2D specific parts of the kernel
-#
-
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/renesas/rts7751r2d/irq.c b/arch/sh/boards/renesas/rts7751r2d/irq.c
deleted file mode 100644 (file)
index 8e49f6e..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/rts7751r2d/irq.c
- *
- * Copyright (C) 2007  Magnus Damm
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Renesas Technology Sales RTS7751R2D Support, R2D-PLUS and R2D-1.
- *
- * Modified for RTS7751R2D by
- * Atom Create Engineering Co., Ltd. 2002.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <asm/rts7751r2d.h>
-
-#define R2D_NR_IRL 13
-
-enum {
-       UNUSED = 0,
-
-       /* board specific interrupt sources (R2D-1 and R2D-PLUS) */
-       EXT,              /* EXT_INT0-3 */
-       RTC_T, RTC_A,     /* Real Time Clock */
-       AX88796,          /* Ethernet controller (R2D-1 board) */
-       KEY,              /* Key input (R2D-PLUS board) */
-       SDCARD,           /* SD Card */
-       CF_CD, CF_IDE,    /* CF Card Detect + CF IDE */
-       SM501,            /* SM501 aka Voyager */
-       PCI_INTD_RTL8139, /* Ethernet controller */
-       PCI_INTC_PCI1520, /* Cardbus/PCMCIA bridge */
-       PCI_INTB_RTL8139, /* Ethernet controller with HUB (R2D-PLUS board) */
-       PCI_INTB_SLOT,    /* PCI Slot 3.3v (R2D-1 board) */
-       PCI_INTA_SLOT,    /* PCI Slot 3.3v */
-       TP,               /* Touch Panel */
-};
-
-#ifdef CONFIG_RTS7751R2D_1
-
-/* Vectors for R2D-1 */
-static struct intc_vect vectors_r2d_1[] __initdata = {
-       INTC_IRQ(EXT, IRQ_EXT),
-       INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
-       INTC_IRQ(AX88796, IRQ_AX88796), INTC_IRQ(SDCARD, IRQ_SDCARD),
-       INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE), /* ng */
-       INTC_IRQ(SM501, IRQ_VOYAGER),
-       INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
-       INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
-       INTC_IRQ(PCI_INTB_SLOT, IRQ_PCI_INTB),
-       INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
-       INTC_IRQ(TP, IRQ_TP),
-};
-
-/* IRLMSK mask register layout for R2D-1 */
-static struct intc_mask_reg mask_registers_r2d_1[] __initdata = {
-       { 0xa4000000, 0, 16, /* IRLMSK */
-         { TP, PCI_INTA_SLOT, PCI_INTB_SLOT,
-           PCI_INTC_PCI1520, PCI_INTD_RTL8139,
-           SM501, CF_IDE, CF_CD, SDCARD, AX88796,
-           RTC_A, RTC_T, 0, 0, 0, EXT } },
-};
-
-/* IRLn to IRQ table for R2D-1 */
-static unsigned char irl2irq_r2d_1[R2D_NR_IRL] __initdata = {
-       IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
-       IRQ_VOYAGER, IRQ_AX88796, IRQ_RTC_A, IRQ_RTC_T,
-       IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
-       IRQ_TP,
-};
-
-static DECLARE_INTC_DESC(intc_desc_r2d_1, "r2d-1", vectors_r2d_1,
-                        NULL, mask_registers_r2d_1, NULL, NULL);
-
-#endif /* CONFIG_RTS7751R2D_1 */
-
-#ifdef CONFIG_RTS7751R2D_PLUS
-
-/* Vectors for R2D-PLUS */
-static struct intc_vect vectors_r2d_plus[] __initdata = {
-       INTC_IRQ(EXT, IRQ_EXT),
-       INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
-       INTC_IRQ(KEY, IRQ_KEY), INTC_IRQ(SDCARD, IRQ_SDCARD),
-       INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE),
-       INTC_IRQ(SM501, IRQ_VOYAGER),
-       INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
-       INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
-       INTC_IRQ(PCI_INTB_RTL8139, IRQ_PCI_INTB),
-       INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
-       INTC_IRQ(TP, IRQ_TP),
-};
-
-/* IRLMSK mask register layout for R2D-PLUS */
-static struct intc_mask_reg mask_registers_r2d_plus[] __initdata = {
-       { 0xa4000000, 0, 16, /* IRLMSK */
-         { TP, PCI_INTA_SLOT, PCI_INTB_RTL8139,
-           PCI_INTC_PCI1520, PCI_INTD_RTL8139,
-           SM501, CF_IDE, CF_CD, SDCARD, KEY,
-           RTC_A, RTC_T, 0, 0, 0, EXT } },
-};
-
-/* IRLn to IRQ table for R2D-PLUS */
-static unsigned char irl2irq_r2d_plus[R2D_NR_IRL] __initdata = {
-       IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
-       IRQ_VOYAGER, IRQ_KEY, IRQ_RTC_A, IRQ_RTC_T,
-       IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
-       IRQ_TP,
-};
-
-static DECLARE_INTC_DESC(intc_desc_r2d_plus, "r2d-plus", vectors_r2d_plus,
-                        NULL, mask_registers_r2d_plus, NULL, NULL);
-
-#endif /* CONFIG_RTS7751R2D_PLUS */
-
-static unsigned char irl2irq[R2D_NR_IRL];
-
-int rts7751r2d_irq_demux(int irq)
-{
-       if (irq >= R2D_NR_IRL || !irl2irq[irq])
-               return irq;
-
-       return irl2irq[irq];
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_rts7751r2d_IRQ(void)
-{
-       struct intc_desc *d;
-
-       switch (ctrl_inw(PA_VERREG) & 0xf0) {
-#ifdef CONFIG_RTS7751R2D_PLUS
-       case 0x10:
-               printk(KERN_INFO "Using R2D-PLUS interrupt controller.\n");
-               d = &intc_desc_r2d_plus;
-               memcpy(irl2irq, irl2irq_r2d_plus, R2D_NR_IRL);
-               break;
-#endif
-#ifdef CONFIG_RTS7751R2D_1
-       case 0x00: /* according to manual */
-       case 0x30: /* in reality */
-               printk(KERN_INFO "Using R2D-1 interrupt controller.\n");
-               d = &intc_desc_r2d_1;
-               memcpy(irl2irq, irl2irq_r2d_1, R2D_NR_IRL);
-               break;
-#endif
-       default:
-               printk(KERN_INFO "Unknown R2D interrupt controller 0x%04x\n",
-                      ctrl_inw(PA_VERREG));
-               return;
-       }
-
-       register_intc_controller(d);
-}
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c
deleted file mode 100644 (file)
index 2308e87..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Renesas Technology Sales RTS7751R2D Support.
- *
- * Copyright (C) 2002 - 2006 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2004 - 2007 Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/sm501.h>
-#include <linux/sm501-regs.h>
-#include <linux/pm.h>
-#include <linux/fb.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/spi_bitbang.h>
-#include <asm/machvec.h>
-#include <asm/rts7751r2d.h>
-#include <asm/io.h>
-#include <asm/io_trapped.h>
-#include <asm/spi.h>
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_AREA5_IO + 0x1000,
-               .end    = PA_AREA5_IO + 0x1000 + 0x10 - 0x2,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = PA_AREA5_IO + 0x80c,
-               .end    = PA_AREA5_IO + 0x80c,
-               .flags  = IORESOURCE_MEM,
-       },
-#ifndef CONFIG_RTS7751R2D_1 /* For R2D-1 polling is preferred */
-       [2] = {
-               .start  = IRQ_CF_IDE,
-               .flags  = IORESOURCE_IRQ,
-       },
-#endif
-};
-
-static struct pata_platform_info pata_info = {
-       .ioport_shift   = 1,
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-       .dev    = {
-               .platform_data  = &pata_info,
-       },
-};
-
-static struct spi_board_info spi_bus[] = {
-       {
-               .modalias       = "rtc-r9701",
-               .max_speed_hz   = 1000000,
-               .mode           = SPI_MODE_3,
-       },
-};
-
-static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state)
-{
-       BUG_ON(cs != 0);  /* Single Epson RTC-9701JE attached on CS0 */
-       ctrl_outw(state == BITBANG_CS_ACTIVE, PA_RTCCE);
-}
-
-static struct sh_spi_info spi_info = {
-       .num_chipselect = 1,
-       .chip_select = r2d_chip_select,
-};
-
-static struct resource spi_sh_sci_resources[] = {
-       {
-               .start  = 0xffe00000,
-               .end    = 0xffe0001f,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device spi_sh_sci_device  = {
-       .name           = "spi_sh_sci",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(spi_sh_sci_resources),
-       .resource       = spi_sh_sci_resources,
-       .dev    = {
-               .platform_data  = &spi_info,
-       },
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_OUTPORT,
-               .end    = PA_OUTPORT,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct resource sm501_resources[] = {
-       [0]     = {
-               .start  = 0x10000000,
-               .end    = 0x13e00000 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1]     = {
-               .start  = 0x13e00000,
-               .end    = 0x13ffffff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2]     = {
-               .start  = IRQ_VOYAGER,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct fb_videomode sm501_default_mode = {
-       .pixclock       = 35714,
-       .xres           = 640,
-       .yres           = 480,
-       .left_margin    = 105,
-       .right_margin   = 50,
-       .upper_margin   = 35,
-       .lower_margin   = 0,
-       .hsync_len      = 96,
-       .vsync_len      = 2,
-       .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
-       .def_bpp        = 16,
-       .def_mode       = &sm501_default_mode,
-       .flags          = SM501FB_FLAG_USE_INIT_MODE |
-                         SM501FB_FLAG_USE_HWCURSOR |
-                         SM501FB_FLAG_USE_HWACCEL |
-                         SM501FB_FLAG_DISABLE_AT_EXIT,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
-       .flags          = (SM501FB_FLAG_USE_INIT_MODE |
-                          SM501FB_FLAG_USE_HWCURSOR |
-                          SM501FB_FLAG_USE_HWACCEL |
-                          SM501FB_FLAG_DISABLE_AT_EXIT),
-
-};
-
-static struct sm501_platdata_fb sm501_fb_pdata = {
-       .fb_route       = SM501_FB_OWN,
-       .fb_crt         = &sm501_pdata_fbsub_crt,
-       .fb_pnl         = &sm501_pdata_fbsub_pnl,
-       .flags          = SM501_FBPD_SWAP_FB_ENDIAN,
-};
-
-static struct sm501_initdata sm501_initdata = {
-       .devices        = SM501_USE_USB_HOST | SM501_USE_UART0,
-};
-
-static struct sm501_platdata sm501_platform_data = {
-       .init           = &sm501_initdata,
-       .fb             = &sm501_fb_pdata,
-};
-
-static struct platform_device sm501_device = {
-       .name           = "sm501",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &sm501_platform_data,
-       },
-       .num_resources  = ARRAY_SIZE(sm501_resources),
-       .resource       = sm501_resources,
-};
-
-static struct platform_device *rts7751r2d_devices[] __initdata = {
-       &sm501_device,
-       &heartbeat_device,
-       &spi_sh_sci_device,
-};
-
-/*
- * The CF is connected with a 16-bit bus where 8-bit operations are
- * unsupported. The linux ata driver is however using 8-bit operations, so
- * insert a trapped io filter to convert 8-bit operations into 16-bit.
- */
-static struct trapped_io cf_trapped_io = {
-       .resource               = cf_ide_resources,
-       .num_resources          = 2,
-       .minimum_bus_width      = 16,
-};
-
-static int __init rts7751r2d_devices_setup(void)
-{
-       if (register_trapped_io(&cf_trapped_io) == 0)
-               platform_device_register(&cf_ide_device);
-
-       spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
-
-       return platform_add_devices(rts7751r2d_devices,
-                                   ARRAY_SIZE(rts7751r2d_devices));
-}
-__initcall(rts7751r2d_devices_setup);
-
-static void rts7751r2d_power_off(void)
-{
-       ctrl_outw(0x0001, PA_POWOFF);
-}
-
-/*
- * Initialize the board
- */
-static void __init rts7751r2d_setup(char **cmdline_p)
-{
-       void __iomem *sm501_reg;
-       u16 ver = ctrl_inw(PA_VERREG);
-
-       printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
-
-       printk(KERN_INFO "FPGA version:%d (revision:%d)\n",
-                                       (ver >> 4) & 0xf, ver & 0xf);
-
-       ctrl_outw(0x0000, PA_OUTPORT);
-       pm_power_off = rts7751r2d_power_off;
-
-       /* sm501 dram configuration:
-        * ColSizeX = 11 - External Memory Column Size: 256 words.
-        * APX = 1 - External Memory Active to Pre-Charge Delay: 7 clocks.
-        * RstX = 1 - External Memory Reset: Normal.
-        * Rfsh = 1 - Local Memory Refresh to Command Delay: 12 clocks.
-        * BwC =  1 - Local Memory Block Write Cycle Time: 2 clocks.
-        * BwP =  1 - Local Memory Block Write to Pre-Charge Delay: 1 clock.
-        * AP = 1 - Internal Memory Active to Pre-Charge Delay: 7 clocks.
-        * Rst = 1 - Internal Memory Reset: Normal.
-        * RA = 1 - Internal Memory Remain in Active State: Do not remain.
-        */
-
-       sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
-       writel(readl(sm501_reg) | 0x00f107c0, sm501_reg);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_rts7751r2d __initmv = {
-       .mv_name                = "RTS7751R2D",
-       .mv_setup               = rts7751r2d_setup,
-       .mv_init_irq            = init_rts7751r2d_IRQ,
-       .mv_irq_demux           = rts7751r2d_irq_demux,
-};
diff --git a/arch/sh/boards/renesas/sdk7780/Kconfig b/arch/sh/boards/renesas/sdk7780/Kconfig
deleted file mode 100644 (file)
index 065f1df..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-if SH_SDK7780
-
-choice
-       prompt "SDK7780 options"
-       default SH_SDK7780_BASE
-
-config SH_SDK7780_BASE
-       bool "SDK7780 with base-board support"
-       depends on CPU_SUBTYPE_SH7780
-       help
-         Selecting this option will enable support for the expansion
-         baseboard devices. If in doubt, say Y.
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/renesas/sdk7780/Makefile b/arch/sh/boards/renesas/sdk7780/Makefile
deleted file mode 100644 (file)
index 3d8f0be..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the SDK7780 specific parts of the kernel
-#
-obj-y   := setup.o irq.o
-
diff --git a/arch/sh/boards/renesas/sdk7780/irq.c b/arch/sh/boards/renesas/sdk7780/irq.c
deleted file mode 100644 (file)
index 87cdc57..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/sdk7780/irq.c
- *
- * Renesas Technology Europe SDK7780 Support.
- *
- * Copyright (C) 2008  Nicholas Beck <nbeck@mpc-data.co.uk>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <asm/sdk7780.h>
-
-enum {
-       UNUSED = 0,
-       /* board specific interrupt sources */
-       SMC91C111,      /* Ethernet controller */
-};
-
-static struct intc_vect fpga_vectors[] __initdata = {
-       INTC_IRQ(SMC91C111, IRQ_ETHERNET),
-};
-
-static struct intc_mask_reg fpga_mask_registers[] __initdata = {
-       { 0, FPGA_IRQ0MR, 16,
-         { 0, 0, 0, 0, 0, 0, 0, 0,
-           0, 0, 0, SMC91C111, 0, 0, 0, 0 } },
-};
-
-static DECLARE_INTC_DESC(fpga_intc_desc, "sdk7780-irq", fpga_vectors,
-                        NULL, fpga_mask_registers, NULL, NULL);
-
-void __init init_sdk7780_IRQ(void)
-{
-       printk(KERN_INFO "Using SDK7780 interrupt controller.\n");
-
-       ctrl_outw(0xFFFF, FPGA_IRQ0MR);
-       /* Setup IRL 0-3 */
-       ctrl_outw(0x0003, FPGA_IMSR);
-       plat_irq_setup_pins(IRQ_MODE_IRL3210);
-
-       register_intc_controller(&fpga_intc_desc);
-}
diff --git a/arch/sh/boards/renesas/sdk7780/setup.c b/arch/sh/boards/renesas/sdk7780/setup.c
deleted file mode 100644 (file)
index acc5932..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * arch/sh/boards/renesas/sdk7780/setup.c
- *
- * Renesas Solutions SH7780 SDK Support
- * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <asm/machvec.h>
-#include <asm/sdk7780.h>
-#include <asm/heartbeat.h>
-#include <asm/io.h>
-#include <asm/addrspace.h>
-
-#define GPIO_PECR        0xFFEA0008
-
-//* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-/* SMC91x */
-static struct resource smc91x_eth_resources[] = {
-       [0] = {
-               .name   = "smc91x-regs" ,
-               .start  = PA_LAN + 0x300,
-               .end    = PA_LAN + 0x300 + 0x10 ,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_ETHERNET,
-               .end    = IRQ_ETHERNET,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_eth_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
-       .resource       = smc91x_eth_resources,
-};
-
-static struct platform_device *sdk7780_devices[] __initdata = {
-       &heartbeat_device,
-       &smc91x_eth_device,
-};
-
-static int __init sdk7780_devices_setup(void)
-{
-       return platform_add_devices(sdk7780_devices,
-               ARRAY_SIZE(sdk7780_devices));
-}
-device_initcall(sdk7780_devices_setup);
-
-static void __init sdk7780_setup(char **cmdline_p)
-{
-       u16 ver = ctrl_inw(FPGA_FPVERR);
-       u16 dateStamp = ctrl_inw(FPGA_FPDATER);
-
-       printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n");
-       printk(KERN_INFO "Board version: %d (revision %d), "
-                        "FPGA version: %d (revision %d), datestamp : %d\n",
-                        (ver >> 12) & 0xf, (ver >> 8) & 0xf,
-                        (ver >>  4) & 0xf, ver & 0xf,
-                        dateStamp);
-
-       /* Setup pin mux'ing for PCIC */
-       ctrl_outw(0x0000, GPIO_PECR);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7780 __initmv = {
-       .mv_name        = "Renesas SDK7780-R3" ,
-       .mv_setup               = sdk7780_setup,
-       .mv_nr_irqs             = 111,
-       .mv_init_irq    = init_sdk7780_IRQ,
-};
-
diff --git a/arch/sh/boards/renesas/sh7763rdp/Makefile b/arch/sh/boards/renesas/sh7763rdp/Makefile
deleted file mode 100644 (file)
index f6c0b55..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y    := setup.o irq.o
diff --git a/arch/sh/boards/renesas/sh7763rdp/irq.c b/arch/sh/boards/renesas/sh7763rdp/irq.c
deleted file mode 100644 (file)
index fd850ba..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/sh7763rdp/irq.c
- *
- * Renesas Solutions SH7763RDP Support.
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Copyright (C) 2008  Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/sh7763rdp.h>
-
-#define INTC_BASE              (0xFFD00000)
-#define INTC_INT2PRI7   (INTC_BASE+0x4001C)
-#define INTC_INT2MSKCR (INTC_BASE+0x4003C)
-#define INTC_INT2MSKCR1        (INTC_BASE+0x400D4)
-
-/*
- * Initialize IRQ setting
- */
-void __init init_sh7763rdp_IRQ(void)
-{
-       /* GPIO enabled */
-       ctrl_outl(1 << 25, INTC_INT2MSKCR);
-
-       /* enable GPIO interrupts */
-       ctrl_outl((ctrl_inl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000,
-                 INTC_INT2PRI7);
-
-       /* USBH enabled */
-       ctrl_outl(1 << 17, INTC_INT2MSKCR1);
-
-       /* GETHER enabled */
-       ctrl_outl(1 << 16, INTC_INT2MSKCR1);
-
-       /* DMAC enabled */
-       ctrl_outl(1 << 8, INTC_INT2MSKCR);
-}
diff --git a/arch/sh/boards/renesas/sh7763rdp/setup.c b/arch/sh/boards/renesas/sh7763rdp/setup.c
deleted file mode 100644 (file)
index 925f16a..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/sh7763rdp/setup.c
- *
- * Renesas Solutions sh7763rdp board
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/mtd/physmap.h>
-#include <asm/io.h>
-#include <asm/sh7763rdp.h>
-
-/* NOR Flash */
-static struct mtd_partition sh7763rdp_nor_flash_partitions[] = {
-       {
-               .name = "U-Boot",
-               .offset = 0,
-               .size = (2 * 128 * 1024),
-               .mask_flags = MTD_WRITEABLE,    /* Read-only */
-       }, {
-               .name = "Linux-Kernel",
-               .offset = MTDPART_OFS_APPEND,
-               .size = (20 * 128 * 1024),
-       }, {
-               .name = "Root Filesystem",
-               .offset = MTDPART_OFS_APPEND,
-               .size = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data sh7763rdp_nor_flash_data = {
-       .width = 2,
-       .parts = sh7763rdp_nor_flash_partitions,
-       .nr_parts = ARRAY_SIZE(sh7763rdp_nor_flash_partitions),
-};
-
-static struct resource sh7763rdp_nor_flash_resources[] = {
-       [0] = {
-               .name = "NOR Flash",
-               .start = 0,
-               .end = (64 * 1024 * 1024),
-               .flags = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device sh7763rdp_nor_flash_device = {
-       .name = "physmap-flash",
-       .resource = sh7763rdp_nor_flash_resources,
-       .num_resources = ARRAY_SIZE(sh7763rdp_nor_flash_resources),
-       .dev = {
-               .platform_data = &sh7763rdp_nor_flash_data,
-       },
-};
-
-static struct platform_device *sh7763rdp_devices[] __initdata = {
-       &sh7763rdp_nor_flash_device,
-};
-
-static int __init sh7763rdp_devices_setup(void)
-{
-       return platform_add_devices(sh7763rdp_devices,
-                                   ARRAY_SIZE(sh7763rdp_devices));
-}
-__initcall(sh7763rdp_devices_setup);
-
-static void __init sh7763rdp_setup(char **cmdline_p)
-{
-       /* Board version check */
-       if (ctrl_inw(CPLD_BOARD_ID_ERV_REG) == 0xECB1)
-               printk(KERN_INFO "RTE Standard Configuration\n");
-       else
-               printk(KERN_INFO "RTA Standard Configuration\n");
-
-       /* USB pin select bits (clear bit 5-2 to 0) */
-       ctrl_outw((ctrl_inw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2);
-       /* USBH setup port I controls to other (clear bits 4-9 to 0) */
-       ctrl_outw(ctrl_inw(PORT_PICR) & 0xFC0F, PORT_PICR);
-
-       /* Select USB Host controller */
-       ctrl_outw(0x00, USB_USBHSC);
-
-       /* For LCD */
-       /* set PTJ7-1, bits 15-2 of PJCR to 0 */
-       ctrl_outw(ctrl_inw(PORT_PJCR) & 0x0003, PORT_PJCR);
-       /* set PTI5, bits 11-10 of PICR to 0 */
-       ctrl_outw(ctrl_inw(PORT_PICR) & 0xF3FF, PORT_PICR);
-       ctrl_outw(0, PORT_PKCR);
-       ctrl_outw(0, PORT_PLCR);
-       /* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */
-       ctrl_outw((ctrl_inw(PORT_PSEL2) & 0x00C0), PORT_PSEL2);
-       /* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */
-       ctrl_outw((ctrl_inw(PORT_PSEL3) & 0x0700), PORT_PSEL3);
-
-       /* For HAC */
-       /* bit3-0  0100:HAC & SSI1 enable */
-       ctrl_outw((ctrl_inw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1);
-       /* bit14      1:SSI_HAC_CLK enable */
-       ctrl_outw(ctrl_inw(PORT_PSEL4) | 0x4000, PORT_PSEL4);
-
-       /* SH-Ether */
-       ctrl_outw((ctrl_inw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1);
-       ctrl_outw(0x0, PORT_PFCR);
-       ctrl_outw(0x0, PORT_PFCR);
-       ctrl_outw(0x0, PORT_PFCR);
-
-       /* MMC */
-       /*selects SCIF and MMC other functions */
-       ctrl_outw(0x0001, PORT_PSEL0);
-       /* MMC clock operates */
-       ctrl_outl(ctrl_inl(MSTPCR1) & ~0x8, MSTPCR1);
-       ctrl_outw(ctrl_inw(PORT_PACR) & ~0x3000, PORT_PACR);
-       ctrl_outw(ctrl_inw(PORT_PCCR) & ~0xCFC3, PORT_PCCR);
-}
-
-static struct sh_machine_vector mv_sh7763rdp __initmv = {
-       .mv_name = "sh7763drp",
-       .mv_setup = sh7763rdp_setup,
-       .mv_nr_irqs = 112,
-       .mv_init_irq = init_sh7763rdp_IRQ,
-};
diff --git a/arch/sh/boards/renesas/sh7785lcr/Makefile b/arch/sh/boards/renesas/sh7785lcr/Makefile
deleted file mode 100644 (file)
index 7703756..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y   := setup.o
diff --git a/arch/sh/boards/renesas/sh7785lcr/setup.c b/arch/sh/boards/renesas/sh7785lcr/setup.c
deleted file mode 100644 (file)
index b95d674..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Renesas Technology Corp. R0P7785LC0011RL Support.
- *
- * Copyright (C) 2008  Yoshihiro Shimoda
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/sm501.h>
-#include <linux/sm501-regs.h>
-#include <linux/fb.h>
-#include <linux/mtd/physmap.h>
-#include <linux/delay.h>
-#include <linux/i2c.h>
-#include <linux/i2c-pca-platform.h>
-#include <linux/i2c-algo-pca.h>
-#include <asm/heartbeat.h>
-#include <asm/sh7785lcr.h>
-
-/*
- * NOTE: This board has 2 physical memory maps.
- *      Please look at include/asm-sh/sh7785lcr.h or hardware manual.
- */
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PLD_LEDCR,
-               .end    = PLD_LEDCR,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 8,
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct mtd_partition nor_flash_partitions[] = {
-       {
-               .name           = "loader",
-               .offset         = 0x00000000,
-               .size           = 512 * 1024,
-       },
-       {
-               .name           = "bootenv",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 512 * 1024,
-       },
-       {
-               .name           = "kernel",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 4 * 1024 * 1024,
-       },
-       {
-               .name           = "data",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data nor_flash_data = {
-       .width          = 4,
-       .parts          = nor_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
-       [0]     = {
-               .start  = NOR_FLASH_ADDR,
-               .end    = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device nor_flash_device = {
-       .name           = "physmap-flash",
-       .dev            = {
-               .platform_data  = &nor_flash_data,
-       },
-       .num_resources  = ARRAY_SIZE(nor_flash_resources),
-       .resource       = nor_flash_resources,
-};
-
-static struct resource r8a66597_usb_host_resources[] = {
-       [0] = {
-               .name   = "r8a66597_hcd",
-               .start  = R8A66597_ADDR,
-               .end    = R8A66597_ADDR + R8A66597_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "r8a66597_hcd",
-               .start  = 2,
-               .end    = 2,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
-       .name           = "r8a66597_hcd",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
-       .resource       = r8a66597_usb_host_resources,
-};
-
-static struct resource sm501_resources[] = {
-       [0]     = {
-               .start  = SM107_MEM_ADDR,
-               .end    = SM107_MEM_ADDR + SM107_MEM_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1]     = {
-               .start  = SM107_REG_ADDR,
-               .end    = SM107_REG_ADDR + SM107_REG_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2]     = {
-               .start  = 10,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct fb_videomode sm501_default_mode_crt = {
-       .pixclock       = 35714,        /* 28MHz */
-       .xres           = 640,
-       .yres           = 480,
-       .left_margin    = 105,
-       .right_margin   = 16,
-       .upper_margin   = 33,
-       .lower_margin   = 10,
-       .hsync_len      = 39,
-       .vsync_len      = 2,
-       .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-};
-
-static struct fb_videomode sm501_default_mode_pnl = {
-       .pixclock       = 40000,        /* 25MHz */
-       .xres           = 640,
-       .yres           = 480,
-       .left_margin    = 2,
-       .right_margin   = 16,
-       .upper_margin   = 33,
-       .lower_margin   = 10,
-       .hsync_len      = 39,
-       .vsync_len      = 2,
-       .sync           = 0,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
-       .def_bpp        = 16,
-       .def_mode       = &sm501_default_mode_pnl,
-       .flags          = SM501FB_FLAG_USE_INIT_MODE |
-                         SM501FB_FLAG_USE_HWCURSOR |
-                         SM501FB_FLAG_USE_HWACCEL |
-                         SM501FB_FLAG_DISABLE_AT_EXIT |
-                         SM501FB_FLAG_PANEL_NO_VBIASEN,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
-       .def_bpp        = 16,
-       .def_mode       = &sm501_default_mode_crt,
-       .flags          = SM501FB_FLAG_USE_INIT_MODE |
-                         SM501FB_FLAG_USE_HWCURSOR |
-                         SM501FB_FLAG_USE_HWACCEL |
-                         SM501FB_FLAG_DISABLE_AT_EXIT,
-};
-
-static struct sm501_platdata_fb sm501_fb_pdata = {
-       .fb_route       = SM501_FB_OWN,
-       .fb_crt         = &sm501_pdata_fbsub_crt,
-       .fb_pnl         = &sm501_pdata_fbsub_pnl,
-};
-
-static struct sm501_initdata sm501_initdata = {
-       .gpio_high      = {
-               .set    = 0x00001fe0,
-               .mask   = 0x0,
-       },
-       .devices        = 0,
-       .mclk           = 84 * 1000000,
-       .m1xclk         = 112 * 1000000,
-};
-
-static struct sm501_platdata sm501_platform_data = {
-       .init           = &sm501_initdata,
-       .fb             = &sm501_fb_pdata,
-};
-
-static struct platform_device sm501_device = {
-       .name           = "sm501",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &sm501_platform_data,
-       },
-       .num_resources  = ARRAY_SIZE(sm501_resources),
-       .resource       = sm501_resources,
-};
-
-static struct resource i2c_resources[] = {
-       [0] = {
-               .start  = PCA9564_ADDR,
-               .end    = PCA9564_ADDR + PCA9564_SIZE - 1,
-               .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
-       },
-       [1] = {
-               .start  = 12,
-               .end    = 12,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
-       .gpio                   = 0,
-       .i2c_clock_speed        = I2C_PCA_CON_330kHz,
-       .timeout                = 100,
-};
-
-static struct platform_device i2c_device = {
-       .name           = "i2c-pca-platform",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &i2c_platform_data,
-       },
-       .num_resources  = ARRAY_SIZE(i2c_resources),
-       .resource       = i2c_resources,
-};
-
-static struct platform_device *sh7785lcr_devices[] __initdata = {
-       &heartbeat_device,
-       &nor_flash_device,
-       &r8a66597_usb_host_device,
-       &sm501_device,
-       &i2c_device,
-};
-
-static struct i2c_board_info __initdata sh7785lcr_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("r2025sd", 0x32),
-       },
-};
-
-static int __init sh7785lcr_devices_setup(void)
-{
-       i2c_register_board_info(0, sh7785lcr_i2c_devices,
-                               ARRAY_SIZE(sh7785lcr_i2c_devices));
-
-       return platform_add_devices(sh7785lcr_devices,
-                                   ARRAY_SIZE(sh7785lcr_devices));
-}
-__initcall(sh7785lcr_devices_setup);
-
-/* Initialize IRQ setting */
-void __init init_sh7785lcr_IRQ(void)
-{
-       plat_irq_setup_pins(IRQ_MODE_IRQ7654);
-       plat_irq_setup_pins(IRQ_MODE_IRQ3210);
-}
-
-static void sh7785lcr_power_off(void)
-{
-       ctrl_outb(0x01, P2SEGADDR(PLD_POFCR));
-}
-
-/* Initialize the board */
-static void __init sh7785lcr_setup(char **cmdline_p)
-{
-       void __iomem *sm501_reg;
-
-       printk(KERN_INFO "Renesas Technology Corp. R0P7785LC0011RL support.\n");
-
-       pm_power_off = sh7785lcr_power_off;
-
-       /* sm501 DRAM configuration */
-       sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
-       writel(0x000307c2, sm501_reg);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_sh7785lcr __initmv = {
-       .mv_name                = "SH7785LCR",
-       .mv_setup               = sh7785lcr_setup,
-       .mv_init_irq            = init_sh7785lcr_IRQ,
-};
-
diff --git a/arch/sh/boards/renesas/systemh/Makefile b/arch/sh/boards/renesas/systemh/Makefile
deleted file mode 100644 (file)
index 2cc6a23..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Makefile for the SystemH specific parts of the kernel
-#
-
-obj-y   := setup.o irq.o io.o
-
-# XXX: This wants to be consolidated in arch/sh/drivers/pci, and more
-# importantly, with the generic sh7751_pcic_init() code. For now, we'll
-# just abuse the hell out of kbuild, because we can..
-
-obj-$(CONFIG_PCI) += pci.o
-pci-y := ../../se/7751/pci.o
-
diff --git a/arch/sh/boards/renesas/systemh/io.c b/arch/sh/boards/renesas/systemh/io.c
deleted file mode 100644 (file)
index 1b767e1..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/systemh/io.c
- *
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * I/O routine for Hitachi 7751 Systemh.
- */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/systemh7751.h>
-#include <asm/addrspace.h>
-#include <asm/io.h>
-
-#define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area
-                                                of smc lan chip*/
-static inline volatile __u16 *
-port2adr(unsigned int port)
-{
-       if (port >= 0x2000)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-       maybebadio((unsigned long)port);
-       return (volatile __u16*)port;
-}
-
-/*
- * General outline: remap really low stuff [eventually] to SuperIO,
- * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
- * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
- * should be way beyond the window, and is used  w/o translation for
- * compatibility.
- */
-unsigned char sh7751systemh_inb(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned char *)pci_ioaddr(port);
-       else if (port <= 0x3F1)
-               return *(volatile unsigned char *)ETHER_IOMAP(port);
-       else
-               return (*port2adr(port))&0xff;
-}
-
-unsigned char sh7751systemh_inb_p(unsigned long port)
-{
-       unsigned char v;
-
-        if (PXSEG(port))
-                v = *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-                v = *(volatile unsigned char *)pci_ioaddr(port);
-       else if (port <= 0x3F1)
-               v = *(volatile unsigned char *)ETHER_IOMAP(port);
-       else
-               v = (*port2adr(port))&0xff;
-       ctrl_delay();
-       return v;
-}
-
-unsigned short sh7751systemh_inw(unsigned long port)
-{
-        if (PXSEG(port))
-                return *(volatile unsigned short *)port;
-       else if (is_pci_ioaddr(port))
-                return *(volatile unsigned short *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else if (port <= 0x3F1)
-               return *(volatile unsigned int *)ETHER_IOMAP(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-unsigned int sh7751systemh_inl(unsigned long port)
-{
-        if (PXSEG(port))
-                return *(volatile unsigned long *)port;
-       else if (is_pci_ioaddr(port))
-                return *(volatile unsigned int *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else if (port <= 0x3F1)
-               return *(volatile unsigned int *)ETHER_IOMAP(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-void sh7751systemh_outb(unsigned char value, unsigned long port)
-{
-
-        if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else if (port <= 0x3F1)
-               *(volatile unsigned char *)ETHER_IOMAP(port) = value;
-       else
-               *(port2adr(port)) = value;
-}
-
-void sh7751systemh_outb_p(unsigned char value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else if (port <= 0x3F1)
-               *(volatile unsigned char *)ETHER_IOMAP(port) = value;
-       else
-               *(port2adr(port)) = value;
-       ctrl_delay();
-}
-
-void sh7751systemh_outw(unsigned short value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned short *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned short *)pci_ioaddr(port)) = value;
-       else if (port >= 0x2000)
-               *port2adr(port) = value;
-       else if (port <= 0x3F1)
-               *(volatile unsigned short *)ETHER_IOMAP(port) = value;
-       else
-               maybebadio(port);
-}
-
-void sh7751systemh_outl(unsigned int value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned long *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned long*)pci_ioaddr(port)) = value;
-       else
-               maybebadio(port);
-}
-
-void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned char *p = addr;
-       while (count--) *p++ = sh7751systemh_inb(port);
-}
-
-void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned short *p = addr;
-       while (count--) *p++ = sh7751systemh_inw(port);
-}
-
-void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
-
-void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned char *p = (unsigned char*)addr;
-       while (count--) sh7751systemh_outb(*p++, port);
-}
-
-void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned short *p = (unsigned short*)addr;
-       while (count--) sh7751systemh_outw(*p++, port);
-}
-
-void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
diff --git a/arch/sh/boards/renesas/systemh/irq.c b/arch/sh/boards/renesas/systemh/irq.c
deleted file mode 100644 (file)
index 0ba2fe6..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/systemh/irq.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SystemH Support.
- *
- * Modified for 7751 SystemH by
- * Jonathan Short.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-
-#include <linux/hdreg.h>
-#include <linux/ide.h>
-#include <asm/io.h>
-#include <asm/systemh7751.h>
-#include <asm/smc37c93x.h>
-
-/* address of external interrupt mask register
- * address must be set prior to use these (maybe in init_XXX_irq())
- * XXX : is it better to use .config than specifying it in code? */
-static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004;
-static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000;
-
-/* forward declaration */
-static unsigned int startup_systemh_irq(unsigned int irq);
-static void shutdown_systemh_irq(unsigned int irq);
-static void enable_systemh_irq(unsigned int irq);
-static void disable_systemh_irq(unsigned int irq);
-static void mask_and_ack_systemh(unsigned int);
-static void end_systemh_irq(unsigned int irq);
-
-/* hw_interrupt_type */
-static struct hw_interrupt_type systemh_irq_type = {
-       .typename = " SystemH Register",
-       .startup = startup_systemh_irq,
-       .shutdown = shutdown_systemh_irq,
-       .enable = enable_systemh_irq,
-       .disable = disable_systemh_irq,
-       .ack = mask_and_ack_systemh,
-       .end = end_systemh_irq
-};
-
-static unsigned int startup_systemh_irq(unsigned int irq)
-{
-       enable_systemh_irq(irq);
-       return 0; /* never anything pending */
-}
-
-static void shutdown_systemh_irq(unsigned int irq)
-{
-       disable_systemh_irq(irq);
-}
-
-static void disable_systemh_irq(unsigned int irq)
-{
-       if (systemh_irq_mask_register) {
-               unsigned long val, mask = 0x01 << 1;
-
-               /* Clear the "irq"th bit in the mask and set it in the request */
-               val = ctrl_inl((unsigned long)systemh_irq_mask_register);
-               val &= ~mask;
-               ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
-
-               val = ctrl_inl((unsigned long)systemh_irq_request_register);
-               val |= mask;
-               ctrl_outl(val, (unsigned long)systemh_irq_request_register);
-       }
-}
-
-static void enable_systemh_irq(unsigned int irq)
-{
-       if (systemh_irq_mask_register) {
-               unsigned long val, mask = 0x01 << 1;
-
-               /* Set "irq"th bit in the mask register */
-               val = ctrl_inl((unsigned long)systemh_irq_mask_register);
-               val |= mask;
-               ctrl_outl(val, (unsigned long)systemh_irq_mask_register);
-       }
-}
-
-static void mask_and_ack_systemh(unsigned int irq)
-{
-       disable_systemh_irq(irq);
-}
-
-static void end_systemh_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-               enable_systemh_irq(irq);
-}
-
-void make_systemh_irq(unsigned int irq)
-{
-       disable_irq_nosync(irq);
-       irq_desc[irq].chip = &systemh_irq_type;
-       disable_systemh_irq(irq);
-}
-
diff --git a/arch/sh/boards/renesas/systemh/setup.c b/arch/sh/boards/renesas/systemh/setup.c
deleted file mode 100644 (file)
index ee78af8..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * linux/arch/sh/boards/renesas/systemh/setup.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- * Copyright (C) 2003  Paul Mundt
- *
- * Hitachi SystemH Support.
- *
- * Modified for 7751 SystemH by Jonathan Short.
- *
- * Rewritten for 2.6 by Paul Mundt.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <asm/machvec.h>
-#include <asm/systemh7751.h>
-
-extern void make_systemh_irq(unsigned int irq);
-
-/*
- * Initialize IRQ setting
- */
-static void __init sh7751systemh_init_irq(void)
-{
-       make_systemh_irq(0xb);  /* Ethernet interrupt */
-}
-
-static struct sh_machine_vector mv_7751systemh __initmv = {
-       .mv_name                = "7751 SystemH",
-       .mv_nr_irqs             = 72,
-
-       .mv_inb                 = sh7751systemh_inb,
-       .mv_inw                 = sh7751systemh_inw,
-       .mv_inl                 = sh7751systemh_inl,
-       .mv_outb                = sh7751systemh_outb,
-       .mv_outw                = sh7751systemh_outw,
-       .mv_outl                = sh7751systemh_outl,
-
-       .mv_inb_p               = sh7751systemh_inb_p,
-       .mv_inw_p               = sh7751systemh_inw,
-       .mv_inl_p               = sh7751systemh_inl,
-       .mv_outb_p              = sh7751systemh_outb_p,
-       .mv_outw_p              = sh7751systemh_outw,
-       .mv_outl_p              = sh7751systemh_outl,
-
-       .mv_insb                = sh7751systemh_insb,
-       .mv_insw                = sh7751systemh_insw,
-       .mv_insl                = sh7751systemh_insl,
-       .mv_outsb               = sh7751systemh_outsb,
-       .mv_outsw               = sh7751systemh_outsw,
-       .mv_outsl               = sh7751systemh_outsl,
-
-       .mv_init_irq            = sh7751systemh_init_irq,
-};
diff --git a/arch/sh/boards/renesas/x3proto/Makefile b/arch/sh/boards/renesas/x3proto/Makefile
deleted file mode 100644 (file)
index 983e455..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y += setup.o ilsel.o
diff --git a/arch/sh/boards/renesas/x3proto/ilsel.c b/arch/sh/boards/renesas/x3proto/ilsel.c
deleted file mode 100644 (file)
index b5c673c..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * arch/sh/boards/renesas/x3proto/ilsel.c
- *
- * Helper routines for SH-X3 proto board ILSEL.
- *
- * Copyright (C) 2007 Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/bitmap.h>
-#include <linux/io.h>
-#include <asm/ilsel.h>
-
-/*
- * ILSEL is split across:
- *
- *     ILSEL0 - 0xb8100004 [ Levels  1 -  4 ]
- *     ILSEL1 - 0xb8100006 [ Levels  5 -  8 ]
- *     ILSEL2 - 0xb8100008 [ Levels  9 - 12 ]
- *     ILSEL3 - 0xb810000a [ Levels 13 - 15 ]
- *
- * With each level being relative to an ilsel_source_t.
- */
-#define ILSEL_BASE     0xb8100004
-#define ILSEL_LEVELS   15
-
-/*
- * ILSEL level map, in descending order from the highest level down.
- *
- * Supported levels are 1 - 15 spread across ILSEL0 - ILSEL4, mapping
- * directly to IRLs. As the IRQs are numbered in reverse order relative
- * to the interrupt level, the level map is carefully managed to ensure a
- * 1:1 mapping between the bit position and the IRQ number.
- *
- * This careful constructions allows ilsel_enable*() to be referenced
- * directly for hooking up an ILSEL set and getting back an IRQ which can
- * subsequently be used for internal accounting in the (optional) disable
- * path.
- */
-static unsigned long ilsel_level_map;
-
-static inline unsigned int ilsel_offset(unsigned int bit)
-{
-       return ILSEL_LEVELS - bit - 1;
-}
-
-static inline unsigned long mk_ilsel_addr(unsigned int bit)
-{
-       return ILSEL_BASE + ((ilsel_offset(bit) >> 1) & ~0x1);
-}
-
-static inline unsigned int mk_ilsel_shift(unsigned int bit)
-{
-       return (ilsel_offset(bit) & 0x3) << 2;
-}
-
-static void __ilsel_enable(ilsel_source_t set, unsigned int bit)
-{
-       unsigned int tmp, shift;
-       unsigned long addr;
-
-       addr = mk_ilsel_addr(bit);
-       shift = mk_ilsel_shift(bit);
-
-       pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n",
-                __func__, bit, addr, shift, set);
-
-       tmp = ctrl_inw(addr);
-       tmp &= ~(0xf << shift);
-       tmp |= set << shift;
-       ctrl_outw(tmp, addr);
-}
-
-/**
- * ilsel_enable - Enable an ILSEL set.
- * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
- *
- * Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest
- * available interrupt level. Callers should take care to order callsites
- * noting descending interrupt levels. Aliasing FPGA and external board
- * IRQs need to use ilsel_enable_fixed().
- *
- * The return value is an IRQ number that can later be taken down with
- * ilsel_disable().
- */
-int ilsel_enable(ilsel_source_t set)
-{
-       unsigned int bit;
-
-       /* Aliased sources must use ilsel_enable_fixed() */
-       BUG_ON(set > ILSEL_KEY);
-
-       do {
-               bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS);
-       } while (test_and_set_bit(bit, &ilsel_level_map));
-
-       __ilsel_enable(set, bit);
-
-       return bit;
-}
-EXPORT_SYMBOL_GPL(ilsel_enable);
-
-/**
- * ilsel_enable_fixed - Enable an ILSEL set at a fixed interrupt level
- * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
- * @level: Interrupt level (1 - 15)
- *
- * Enables a given ILSEL source at a fixed interrupt level. Necessary
- * both for level reservation as well as for aliased sources that only
- * exist on special ILSEL#s.
- *
- * Returns an IRQ number (as ilsel_enable()).
- */
-int ilsel_enable_fixed(ilsel_source_t set, unsigned int level)
-{
-       unsigned int bit = ilsel_offset(level - 1);
-
-       if (test_and_set_bit(bit, &ilsel_level_map))
-               return -EBUSY;
-
-       __ilsel_enable(set, bit);
-
-       return bit;
-}
-EXPORT_SYMBOL_GPL(ilsel_enable_fixed);
-
-/**
- * ilsel_disable - Disable an ILSEL set
- * @irq: Bit position for ILSEL set value (retval from enable routines)
- *
- * Disable a previously enabled ILSEL set.
- */
-void ilsel_disable(unsigned int irq)
-{
-       unsigned long addr;
-       unsigned int tmp;
-
-       addr = mk_ilsel_addr(irq);
-
-       tmp = ctrl_inw(addr);
-       tmp &= ~(0xf << mk_ilsel_shift(irq));
-       ctrl_outw(tmp, addr);
-
-       clear_bit(irq, &ilsel_level_map);
-}
-EXPORT_SYMBOL_GPL(ilsel_disable);
diff --git a/arch/sh/boards/renesas/x3proto/setup.c b/arch/sh/boards/renesas/x3proto/setup.c
deleted file mode 100644 (file)
index abc5b6d..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * arch/sh/boards/renesas/x3proto/setup.c
- *
- * Renesas SH-X3 Prototype Board Support.
- *
- * Copyright (C) 2007 Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/kernel.h>
-#include <linux/io.h>
-#include <asm/ilsel.h>
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = 0xb8140020,
-               .end    = 0xb8140020,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .start          = 0x18000300,
-               .end            = 0x18000300 + 0x10 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               /* Filled in by ilsel */
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_device = {
-       .name           = "smc91x",
-       .id             = -1,
-       .resource       = smc91x_resources,
-       .num_resources  = ARRAY_SIZE(smc91x_resources),
-};
-
-static struct resource r8a66597_usb_host_resources[] = {
-       [0] = {
-               .name   = "r8a66597_hcd",
-               .start  = 0x18040000,
-               .end    = 0x18080000 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "r8a66597_hcd",
-               /* Filled in by ilsel */
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
-       .name           = "r8a66597_hcd",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(r8a66597_usb_host_resources),
-       .resource       = r8a66597_usb_host_resources,
-};
-
-static struct resource m66592_usb_peripheral_resources[] = {
-       [0] = {
-               .name   = "m66592_udc",
-               .start  = 0x18080000,
-               .end    = 0x180c0000 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "m66592_udc",
-               /* Filled in by ilsel */
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device m66592_usb_peripheral_device = {
-       .name           = "m66592_udc",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(m66592_usb_peripheral_resources),
-       .resource       = m66592_usb_peripheral_resources,
-};
-
-static struct platform_device *x3proto_devices[] __initdata = {
-       &heartbeat_device,
-       &smc91x_device,
-       &r8a66597_usb_host_device,
-       &m66592_usb_peripheral_device,
-};
-
-static int __init x3proto_devices_setup(void)
-{
-       r8a66597_usb_host_resources[1].start =
-               r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I);
-
-       m66592_usb_peripheral_resources[1].start =
-               m66592_usb_peripheral_resources[1].end = ilsel_enable(ILSEL_USBP_I);
-
-       smc91x_resources[1].start =
-               smc91x_resources[1].end = ilsel_enable(ILSEL_LAN);
-
-       return platform_add_devices(x3proto_devices,
-                                   ARRAY_SIZE(x3proto_devices));
-}
-device_initcall(x3proto_devices_setup);
-
-static void __init x3proto_init_irq(void)
-{
-       plat_irq_setup_pins(IRQ_MODE_IRL3210);
-
-       /* Set ICR0.LVLMODE */
-       ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
-}
-
-static struct sh_machine_vector mv_x3proto __initmv = {
-       .mv_name                = "x3proto",
-       .mv_init_irq            = x3proto_init_irq,
-};
diff --git a/arch/sh/boards/se/7206/Makefile b/arch/sh/boards/se/7206/Makefile
deleted file mode 100644 (file)
index 63e7ed6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the 7206 SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/se/7206/io.c b/arch/sh/boards/se/7206/io.c
deleted file mode 100644 (file)
index 1308e61..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $Id: io.c,v 1.5 2004/02/22 23:08:43 kkojima Exp $
- *
- * linux/arch/sh/boards/se/7206/io.c
- *
- * Copyright (C) 2006 Yoshinori Sato
- *
- * I/O routine for Hitachi 7206 SolutionEngine.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <asm/io.h>
-#include <asm/se7206.h>
-
-
-static inline void delay(void)
-{
-       ctrl_inw(0x20000000);  /* P2 ROM Area */
-}
-
-/* MS7750 requires special versions of in*, out* routines, since
-   PC-like io ports are located at upper half byte of 16-bit word which
-   can be accessed only with 16-bit wide.  */
-
-static inline volatile __u16 *
-port2adr(unsigned int port)
-{
-       if (port >= 0x2000 && port < 0x2020)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-       else if (port >= 0x300 && port < 0x310)
-               return (volatile __u16 *) (PA_SMSC + (port - 0x300));
-
-       return (volatile __u16 *)port;
-}
-
-unsigned char se7206_inb(unsigned long port)
-{
-       return (*port2adr(port)) & 0xff;
-}
-
-unsigned char se7206_inb_p(unsigned long port)
-{
-       unsigned long v;
-
-       v = (*port2adr(port)) & 0xff;
-       delay();
-       return v;
-}
-
-unsigned short se7206_inw(unsigned long port)
-{
-       return *port2adr(port);;
-}
-
-void se7206_outb(unsigned char value, unsigned long port)
-{
-       *(port2adr(port)) = value;
-}
-
-void se7206_outb_p(unsigned char value, unsigned long port)
-{
-       *(port2adr(port)) = value;
-       delay();
-}
-
-void se7206_outw(unsigned short value, unsigned long port)
-{
-       *port2adr(port) = value;
-}
-
-void se7206_insb(unsigned long port, void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       __u8 *ap = addr;
-
-       while (count--)
-               *ap++ = *p;
-}
-
-void se7206_insw(unsigned long port, void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       __u16 *ap = addr;
-       while (count--)
-               *ap++ = *p;
-}
-
-void se7206_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       const __u8 *ap = addr;
-
-       while (count--)
-               *p = *ap++;
-}
-
-void se7206_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       const __u16 *ap = addr;
-       while (count--)
-               *p = *ap++;
-}
diff --git a/arch/sh/boards/se/7206/irq.c b/arch/sh/boards/se/7206/irq.c
deleted file mode 100644 (file)
index 9d5bfc7..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7206/irq.c
- *
- * Copyright (C) 2005,2006 Yoshinori Sato
- *
- * Hitachi SolutionEngine Support.
- *
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <linux/interrupt.h>
-#include <asm/se7206.h>
-
-#define INTSTS0 0x31800000
-#define INTSTS1 0x31800002
-#define INTMSK0 0x31800004
-#define INTMSK1 0x31800006
-#define INTSEL  0x31800008
-
-#define IRQ0_IRQ 64
-#define IRQ1_IRQ 65
-#define IRQ3_IRQ 67
-
-#define INTC_IPR01 0xfffe0818
-#define INTC_ICR1  0xfffe0802
-
-static void disable_se7206_irq(unsigned int irq)
-{
-       unsigned short val;
-       unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq)));
-       unsigned short msk0,msk1;
-
-       /* Set the priority in IPR to 0 */
-       val = ctrl_inw(INTC_IPR01);
-       val &= mask;
-       ctrl_outw(val, INTC_IPR01);
-       /* FPGA mask set */
-       msk0 = ctrl_inw(INTMSK0);
-       msk1 = ctrl_inw(INTMSK1);
-
-       switch (irq) {
-       case IRQ0_IRQ:
-               msk0 |= 0x0010;
-               break;
-       case IRQ1_IRQ:
-               msk0 |= 0x000f;
-               break;
-       case IRQ3_IRQ:
-               msk0 |= 0x0f00;
-               msk1 |= 0x00ff;
-               break;
-       }
-       ctrl_outw(msk0, INTMSK0);
-       ctrl_outw(msk1, INTMSK1);
-}
-
-static void enable_se7206_irq(unsigned int irq)
-{
-       unsigned short val;
-       unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq)));
-       unsigned short msk0,msk1;
-
-       /* Set priority in IPR back to original value */
-       val = ctrl_inw(INTC_IPR01);
-       val |= value;
-       ctrl_outw(val, INTC_IPR01);
-
-       /* FPGA mask reset */
-       msk0 = ctrl_inw(INTMSK0);
-       msk1 = ctrl_inw(INTMSK1);
-
-       switch (irq) {
-       case IRQ0_IRQ:
-               msk0 &= ~0x0010;
-               break;
-       case IRQ1_IRQ:
-               msk0 &= ~0x000f;
-               break;
-       case IRQ3_IRQ:
-               msk0 &= ~0x0f00;
-               msk1 &= ~0x00ff;
-               break;
-       }
-       ctrl_outw(msk0, INTMSK0);
-       ctrl_outw(msk1, INTMSK1);
-}
-
-static void eoi_se7206_irq(unsigned int irq)
-{
-       unsigned short sts0,sts1;
-
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-               enable_se7206_irq(irq);
-       /* FPGA isr clear */
-       sts0 = ctrl_inw(INTSTS0);
-       sts1 = ctrl_inw(INTSTS1);
-
-       switch (irq) {
-       case IRQ0_IRQ:
-               sts0 &= ~0x0010;
-               break;
-       case IRQ1_IRQ:
-               sts0 &= ~0x000f;
-               break;
-       case IRQ3_IRQ:
-               sts0 &= ~0x0f00;
-               sts1 &= ~0x00ff;
-               break;
-       }
-       ctrl_outw(sts0, INTSTS0);
-       ctrl_outw(sts1, INTSTS1);
-}
-
-static struct irq_chip se7206_irq_chip __read_mostly = {
-       .name           = "SE7206-FPGA",
-       .mask           = disable_se7206_irq,
-       .unmask         = enable_se7206_irq,
-       .mask_ack       = disable_se7206_irq,
-       .eoi            = eoi_se7206_irq,
-};
-
-static void make_se7206_irq(unsigned int irq)
-{
-       disable_irq_nosync(irq);
-       set_irq_chip_and_handler_name(irq, &se7206_irq_chip,
-                                     handle_level_irq, "level");
-       disable_se7206_irq(irq);
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7206_IRQ(void)
-{
-       make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */
-       make_se7206_irq(IRQ1_IRQ); /* ATA */
-       make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */
-       ctrl_outw(inw(INTC_ICR1) | 0x000b ,INTC_ICR1 ) ; /* ICR1 */
-
-       /* FPGA System register setup*/
-       ctrl_outw(0x0000,INTSTS0); /* Clear INTSTS0 */
-       ctrl_outw(0x0000,INTSTS1); /* Clear INTSTS1 */
-       /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */
-       ctrl_outw(0x0001,INTSEL);
-}
diff --git a/arch/sh/boards/se/7206/setup.c b/arch/sh/boards/se/7206/setup.c
deleted file mode 100644 (file)
index 4fe84cc..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * linux/arch/sh/boards/se/7206/setup.c
- *
- * Copyright (C) 2006  Yoshinori Sato
- * Copyright (C) 2007 - 2008  Paul Mundt
- *
- * Hitachi 7206 SolutionEngine Support.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/smc91x.h>
-#include <asm/se7206.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-#include <asm/heartbeat.h>
-
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .name           = "smc91x-regs",
-               .start          = PA_SMSC + 0x300,
-               .end            = PA_SMSC + 0x300 + 0x020 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = 64,
-               .end            = 64,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct smc91x_platdata smc91x_info = {
-       .flags  = SMC91X_USE_16BIT,
-};
-
-static struct platform_device smc91x_device = {
-       .name           = "smc91x",
-       .id             = -1,
-       .dev            = {
-               .dma_mask               = NULL,
-               .coherent_dma_mask      = 0xffffffff,
-               .platform_data          = &smc91x_info,
-       },
-       .num_resources  = ARRAY_SIZE(smc91x_resources),
-       .resource       = smc91x_resources,
-};
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 32,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct platform_device *se7206_devices[] __initdata = {
-       &smc91x_device,
-       &heartbeat_device,
-};
-
-static int __init se7206_devices_setup(void)
-{
-       return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
-}
-__initcall(se7206_devices_setup);
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_se __initmv = {
-       .mv_name                = "SolutionEngine",
-       .mv_nr_irqs             = 256,
-       .mv_inb                 = se7206_inb,
-       .mv_inw                 = se7206_inw,
-       .mv_outb                = se7206_outb,
-       .mv_outw                = se7206_outw,
-
-       .mv_inb_p               = se7206_inb_p,
-       .mv_inw_p               = se7206_inw,
-       .mv_outb_p              = se7206_outb_p,
-       .mv_outw_p              = se7206_outw,
-
-       .mv_insb                = se7206_insb,
-       .mv_insw                = se7206_insw,
-       .mv_outsb               = se7206_outsb,
-       .mv_outsw               = se7206_outsw,
-
-       .mv_init_irq            = init_se7206_IRQ,
-};
diff --git a/arch/sh/boards/se/7343/Makefile b/arch/sh/boards/se/7343/Makefile
deleted file mode 100644 (file)
index 3024796..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the 7343 SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/se/7343/io.c b/arch/sh/boards/se/7343/io.c
deleted file mode 100644 (file)
index e2fae32..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * arch/sh/boards/se/7343/io.c
- *
- * I/O routine for SH-Mobile3AS 7343 SolutionEngine.
- *
- */
-#include <linux/kernel.h>
-#include <asm/io.h>
-#include <mach/se7343.h>
-
-#define badio(fn, a) panic("bad i/o operation %s for %08lx.", #fn, a)
-
-struct iop {
-       unsigned long start, end;
-       unsigned long base;
-       struct iop *(*check) (struct iop * p, unsigned long port);
-       unsigned char (*inb) (struct iop * p, unsigned long port);
-       unsigned short (*inw) (struct iop * p, unsigned long port);
-       void (*outb) (struct iop * p, unsigned char value, unsigned long port);
-       void (*outw) (struct iop * p, unsigned short value, unsigned long port);
-};
-
-struct iop *
-simple_check(struct iop *p, unsigned long port)
-{
-       static int count;
-
-       if (count < 100)
-               count++;
-
-       port &= 0xFFFF;
-
-       if ((p->start <= port) && (port <= p->end))
-               return p;
-       else
-               badio(check, port);
-}
-
-struct iop *
-ide_check(struct iop *p, unsigned long port)
-{
-       if (((0x1f0 <= port) && (port <= 0x1f7)) || (port == 0x3f7))
-               return p;
-       return NULL;
-}
-
-unsigned char
-simple_inb(struct iop *p, unsigned long port)
-{
-       return *(unsigned char *) (p->base + port);
-}
-
-unsigned short
-simple_inw(struct iop *p, unsigned long port)
-{
-       return *(unsigned short *) (p->base + port);
-}
-
-void
-simple_outb(struct iop *p, unsigned char value, unsigned long port)
-{
-       *(unsigned char *) (p->base + port) = value;
-}
-
-void
-simple_outw(struct iop *p, unsigned short value, unsigned long port)
-{
-       *(unsigned short *) (p->base + port) = value;
-}
-
-unsigned char
-pcc_inb(struct iop *p, unsigned long port)
-{
-       unsigned long addr = p->base + port + 0x40000;
-       unsigned long v;
-
-       if (port & 1)
-               addr += 0x00400000;
-       v = *(volatile unsigned char *) addr;
-       return v;
-}
-
-void
-pcc_outb(struct iop *p, unsigned char value, unsigned long port)
-{
-       unsigned long addr = p->base + port + 0x40000;
-
-       if (port & 1)
-               addr += 0x00400000;
-       *(volatile unsigned char *) addr = value;
-}
-
-unsigned char
-bad_inb(struct iop *p, unsigned long port)
-{
-       badio(inb, port);
-}
-
-void
-bad_outb(struct iop *p, unsigned char value, unsigned long port)
-{
-       badio(inw, port);
-}
-
-#ifdef CONFIG_SMC91X
-/* MSTLANEX01 LAN at 0xb400:0000 */
-static struct iop laniop = {
-       .start = 0x00,
-       .end = 0x0F,
-       .base = 0x04000000,
-       .check = simple_check,
-       .inb = simple_inb,
-       .inw = simple_inw,
-       .outb = simple_outb,
-       .outw = simple_outw,
-};
-#endif
-
-#ifdef CONFIG_NE2000
-/* NE2000 pc card NIC */
-static struct iop neiop = {
-       .start = 0x280,
-       .end = 0x29f,
-       .base = 0xb0600000 + 0x80,      /* soft 0x280 -> hard 0x300 */
-       .check = simple_check,
-       .inb = pcc_inb,
-       .inw = simple_inw,
-       .outb = pcc_outb,
-       .outw = simple_outw,
-};
-#endif
-
-#ifdef CONFIG_IDE
-/* CF in CF slot */
-static struct iop cfiop = {
-       .base = 0xb0600000,
-       .check = ide_check,
-       .inb = pcc_inb,
-       .inw = simple_inw,
-       .outb = pcc_outb,
-       .outw = simple_outw,
-};
-#endif
-
-static __inline__ struct iop *
-port2iop(unsigned long port)
-{
-       if (0) ;
-#if defined(CONFIG_SMC91X)
-       else if (laniop.check(&laniop, port))
-               return &laniop;
-#endif
-#if defined(CONFIG_NE2000)
-       else if (neiop.check(&neiop, port))
-               return &neiop;
-#endif
-#if defined(CONFIG_IDE)
-       else if (cfiop.check(&cfiop, port))
-               return &cfiop;
-#endif
-       else
-               return NULL;
-}
-
-static inline void
-delay(void)
-{
-       ctrl_inw(0xac000000);
-       ctrl_inw(0xac000000);
-}
-
-unsigned char
-sh7343se_inb(unsigned long port)
-{
-       struct iop *p = port2iop(port);
-       return (p->inb) (p, port);
-}
-
-unsigned char
-sh7343se_inb_p(unsigned long port)
-{
-       unsigned char v = sh7343se_inb(port);
-       delay();
-       return v;
-}
-
-unsigned short
-sh7343se_inw(unsigned long port)
-{
-       struct iop *p = port2iop(port);
-       return (p->inw) (p, port);
-}
-
-unsigned int
-sh7343se_inl(unsigned long port)
-{
-       badio(inl, port);
-}
-
-void
-sh7343se_outb(unsigned char value, unsigned long port)
-{
-       struct iop *p = port2iop(port);
-       (p->outb) (p, value, port);
-}
-
-void
-sh7343se_outb_p(unsigned char value, unsigned long port)
-{
-       sh7343se_outb(value, port);
-       delay();
-}
-
-void
-sh7343se_outw(unsigned short value, unsigned long port)
-{
-       struct iop *p = port2iop(port);
-       (p->outw) (p, value, port);
-}
-
-void
-sh7343se_outl(unsigned int value, unsigned long port)
-{
-       badio(outl, port);
-}
-
-void
-sh7343se_insb(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned char *a = addr;
-       struct iop *p = port2iop(port);
-       while (count--)
-               *a++ = (p->inb) (p, port);
-}
-
-void
-sh7343se_insw(unsigned long port, void *addr, unsigned long count)
-{
-       unsigned short *a = addr;
-       struct iop *p = port2iop(port);
-       while (count--)
-               *a++ = (p->inw) (p, port);
-}
-
-void
-sh7343se_insl(unsigned long port, void *addr, unsigned long count)
-{
-       badio(insl, port);
-}
-
-void
-sh7343se_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned char *a = (unsigned char *) addr;
-       struct iop *p = port2iop(port);
-       while (count--)
-               (p->outb) (p, *a++, port);
-}
-
-void
-sh7343se_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-       unsigned short *a = (unsigned short *) addr;
-       struct iop *p = port2iop(port);
-       while (count--)
-               (p->outw) (p, *a++, port);
-}
-
-void
-sh7343se_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       badio(outsw, port);
-}
diff --git a/arch/sh/boards/se/7343/irq.c b/arch/sh/boards/se/7343/irq.c
deleted file mode 100644 (file)
index 1112e86..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7343/irq.c
- *
- * Copyright (C) 2008  Yoshihiro Shimoda
- *
- * Based on linux/arch/sh/boards/se/7722/irq.c
- * Copyright (C) 2007  Nobuhiro Iwamatsu
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/se7343.h>
-
-static void disable_se7343_irq(unsigned int irq)
-{
-       unsigned int bit = irq - SE7343_FPGA_IRQ_BASE;
-       ctrl_outw(ctrl_inw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK);
-}
-
-static void enable_se7343_irq(unsigned int irq)
-{
-       unsigned int bit = irq - SE7343_FPGA_IRQ_BASE;
-       ctrl_outw(ctrl_inw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK);
-}
-
-static struct irq_chip se7343_irq_chip __read_mostly = {
-       .name           = "SE7343-FPGA",
-       .mask           = disable_se7343_irq,
-       .unmask         = enable_se7343_irq,
-       .mask_ack       = disable_se7343_irq,
-};
-
-static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
-{
-       unsigned short intv = ctrl_inw(PA_CPLD_ST);
-       struct irq_desc *ext_desc;
-       unsigned int ext_irq = SE7343_FPGA_IRQ_BASE;
-
-       intv &= (1 << SE7343_FPGA_IRQ_NR) - 1;
-
-       while (intv) {
-               if (intv & 1) {
-                       ext_desc = irq_desc + ext_irq;
-                       handle_level_irq(ext_irq, ext_desc);
-               }
-               intv >>= 1;
-               ext_irq++;
-       }
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_7343se_IRQ(void)
-{
-       int i;
-
-       ctrl_outw(0, PA_CPLD_IMSK);     /* disable all irqs */
-       ctrl_outw(0x2000, 0xb03fffec);  /* mrshpc irq enable */
-
-       for (i = 0; i < SE7343_FPGA_IRQ_NR; i++)
-               set_irq_chip_and_handler_name(SE7343_FPGA_IRQ_BASE + i,
-                                             &se7343_irq_chip,
-                                             handle_level_irq, "level");
-
-       set_irq_chained_handler(IRQ0_IRQ, se7343_irq_demux);
-       set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
-       set_irq_chained_handler(IRQ1_IRQ, se7343_irq_demux);
-       set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
-       set_irq_chained_handler(IRQ4_IRQ, se7343_irq_demux);
-       set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW);
-       set_irq_chained_handler(IRQ5_IRQ, se7343_irq_demux);
-       set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW);
-}
diff --git a/arch/sh/boards/se/7343/setup.c b/arch/sh/boards/se/7343/setup.c
deleted file mode 100644 (file)
index 59dc92e..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
-#include <machvec.h>
-#include <mach/se7343.h>
-#include <asm/heartbeat.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .start  = 0x10000000,
-               .end    = 0x1000000F,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               /*
-                * shared with other devices via externel
-                * interrupt controller in FPGA...
-                */
-               .start  = SMC_IRQ,
-               .end    = SMC_IRQ,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(smc91x_resources),
-       .resource       = smc91x_resources,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct mtd_partition nor_flash_partitions[] = {
-       {
-               .name           = "loader",
-               .offset         = 0x00000000,
-               .size           = 128 * 1024,
-       },
-       {
-               .name           = "rootfs",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 31 * 1024 * 1024,
-       },
-       {
-               .name           = "data",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct physmap_flash_data nor_flash_data = {
-       .width          = 2,
-       .parts          = nor_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
-       [0]     = {
-               .start  = 0x00000000,
-               .end    = 0x01ffffff,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device nor_flash_device = {
-       .name           = "physmap-flash",
-       .dev            = {
-               .platform_data  = &nor_flash_data,
-       },
-       .num_resources  = ARRAY_SIZE(nor_flash_resources),
-       .resource       = nor_flash_resources,
-};
-
-static struct platform_device *sh7343se_platform_devices[] __initdata = {
-       &smc91x_device,
-       &heartbeat_device,
-       &nor_flash_device,
-};
-
-static int __init sh7343se_devices_setup(void)
-{
-       return platform_add_devices(sh7343se_platform_devices,
-                                   ARRAY_SIZE(sh7343se_platform_devices));
-}
-device_initcall(sh7343se_devices_setup);
-
-/*
- * Initialize the board
- */
-static void __init sh7343se_setup(char **cmdline_p)
-{
-       ctrl_outw(0xf900, FPGA_OUT);    /* FPGA */
-
-       ctrl_outw(0x0002, PORT_PECR);   /* PORT E 1 = IRQ5 */
-       ctrl_outw(0x0020, PORT_PSELD);
-
-       printk(KERN_INFO "MS7343CP01 Setup...done\n");
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_7343se __initmv = {
-       .mv_name = "SolutionEngine 7343",
-       .mv_setup = sh7343se_setup,
-       .mv_nr_irqs = 108,
-       .mv_inb = sh7343se_inb,
-       .mv_inw = sh7343se_inw,
-       .mv_inl = sh7343se_inl,
-       .mv_outb = sh7343se_outb,
-       .mv_outw = sh7343se_outw,
-       .mv_outl = sh7343se_outl,
-
-       .mv_inb_p = sh7343se_inb_p,
-       .mv_inw_p = sh7343se_inw,
-       .mv_inl_p = sh7343se_inl,
-       .mv_outb_p = sh7343se_outb_p,
-       .mv_outw_p = sh7343se_outw,
-       .mv_outl_p = sh7343se_outl,
-
-       .mv_insb = sh7343se_insb,
-       .mv_insw = sh7343se_insw,
-       .mv_insl = sh7343se_insl,
-       .mv_outsb = sh7343se_outsb,
-       .mv_outsw = sh7343se_outsw,
-       .mv_outsl = sh7343se_outsl,
-
-       .mv_init_irq = init_7343se_IRQ,
-};
diff --git a/arch/sh/boards/se/7619/Makefile b/arch/sh/boards/se/7619/Makefile
deleted file mode 100644 (file)
index d21775c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the 7619 SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o
diff --git a/arch/sh/boards/se/7619/setup.c b/arch/sh/boards/se/7619/setup.c
deleted file mode 100644 (file)
index 1d0ef7f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * arch/sh/boards/se/7619/setup.c
- *
- * Copyright (C) 2006 Yoshinori Sato
- *
- * Hitachi SH7619 SolutionEngine Support.
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_se __initmv = {
-       .mv_name                = "SolutionEngine",
-       .mv_nr_irqs             = 108,
-};
diff --git a/arch/sh/boards/se/770x/Makefile b/arch/sh/boards/se/770x/Makefile
deleted file mode 100644 (file)
index 8e624b0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the 770x SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o io.o irq.o
diff --git a/arch/sh/boards/se/770x/io.c b/arch/sh/boards/se/770x/io.c
deleted file mode 100644 (file)
index b1ec085..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * I/O routine for Hitachi SolutionEngine.
- */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <asm/io.h>
-#include <asm/se.h>
-
-/* MS7750 requires special versions of in*, out* routines, since
-   PC-like io ports are located at upper half byte of 16-bit word which
-   can be accessed only with 16-bit wide.  */
-
-static inline volatile __u16 *
-port2adr(unsigned int port)
-{
-       if (port & 0xff000000)
-               return ( volatile __u16 *) port;
-       if (port >= 0x2000)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-       else if (port >= 0x1000)
-               return (volatile __u16 *) (PA_83902 + (port << 1));
-       else
-               return (volatile __u16 *) (PA_SUPERIO + (port << 1));
-}
-
-static inline int
-shifted_port(unsigned long port)
-{
-       /* For IDE registers, value is not shifted */
-       if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
-               return 0;
-       else
-               return 1;
-}
-
-unsigned char se_inb(unsigned long port)
-{
-       if (shifted_port(port))
-               return (*port2adr(port) >> 8);
-       else
-               return (*port2adr(port))&0xff;
-}
-
-unsigned char se_inb_p(unsigned long port)
-{
-       unsigned long v;
-
-       if (shifted_port(port))
-               v = (*port2adr(port) >> 8);
-       else
-               v = (*port2adr(port))&0xff;
-       ctrl_delay();
-       return v;
-}
-
-unsigned short se_inw(unsigned long port)
-{
-       if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-unsigned int se_inl(unsigned long port)
-{
-       maybebadio(port);
-       return 0;
-}
-
-void se_outb(unsigned char value, unsigned long port)
-{
-       if (shifted_port(port))
-               *(port2adr(port)) = value << 8;
-       else
-               *(port2adr(port)) = value;
-}
-
-void se_outb_p(unsigned char value, unsigned long port)
-{
-       if (shifted_port(port))
-               *(port2adr(port)) = value << 8;
-       else
-               *(port2adr(port)) = value;
-       ctrl_delay();
-}
-
-void se_outw(unsigned short value, unsigned long port)
-{
-       if (port >= 0x2000)
-               *port2adr(port) = value;
-       else
-               maybebadio(port);
-}
-
-void se_outl(unsigned int value, unsigned long port)
-{
-       maybebadio(port);
-}
-
-void se_insb(unsigned long port, void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       __u8 *ap = addr;
-
-       if (shifted_port(port)) {
-               while (count--)
-                       *ap++ = *p >> 8;
-       } else {
-               while (count--)
-                       *ap++ = *p;
-       }
-}
-
-void se_insw(unsigned long port, void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       __u16 *ap = addr;
-       while (count--)
-               *ap++ = *p;
-}
-
-void se_insl(unsigned long port, void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
-
-void se_outsb(unsigned long port, const void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       const __u8 *ap = addr;
-
-       if (shifted_port(port)) {
-               while (count--)
-                       *p = *ap++ << 8;
-       } else {
-               while (count--)
-                       *p = *ap++;
-       }
-}
-
-void se_outsw(unsigned long port, const void *addr, unsigned long count)
-{
-       volatile __u16 *p = port2adr(port);
-       const __u16 *ap = addr;
-
-       while (count--)
-               *p = *ap++;
-}
-
-void se_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
diff --git a/arch/sh/boards/se/770x/irq.c b/arch/sh/boards/se/770x/irq.c
deleted file mode 100644 (file)
index cdb0807..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * linux/arch/sh/boards/se/770x/irq.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- * Copyright (C) 2006  Nobuhiro Iwamatsu
- *
- * Hitachi SolutionEngine Support.
- *
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/se.h>
-
-static struct ipr_data ipr_irq_table[] = {
-       /*
-       * Super I/O (Just mimic PC):
-       *  1: keyboard
-       *  3: serial 0
-       *  4: serial 1
-       *  5: printer
-       *  6: floppy
-       *  8: rtc
-       * 12: mouse
-       * 14: ide0
-       */
-#if defined(CONFIG_CPU_SUBTYPE_SH7705)
-       /* This is default value */
-       { 13, 0, 8,  0x0f-13, },
-       { 5 , 0, 4,  0x0f- 5, },
-       { 10, 1, 0,  0x0f-10, },
-       { 7 , 2, 4,  0x0f- 7, },
-       { 3 , 2, 0,  0x0f- 3, },
-       { 1 , 3, 12, 0x0f- 1, },
-       { 12, 3, 4,  0x0f-12, }, /* LAN */
-       { 2 , 4, 8,  0x0f- 2, }, /* PCIRQ2 */
-       { 6 , 4, 4,  0x0f- 6, }, /* PCIRQ1 */
-       { 14, 4, 0,  0x0f-14, }, /* PCIRQ0 */
-       { 0 , 5, 12, 0x0f   , }, 
-       { 4 , 5, 4,  0x0f- 4, },
-       { 8 , 6, 12, 0x0f- 8, },
-       { 9 , 6, 8,  0x0f- 9, },
-       { 11, 6, 4,  0x0f-11, },
-#else
-       { 14, 0,  8, 0x0f-14, },
-       { 12, 0,  4, 0x0f-12, },
-       {  8, 1,  4, 0x0f- 8, },
-       {  6, 2, 12, 0x0f- 6, },
-       {  5, 2,  8, 0x0f- 5, },
-       {  4, 2,  4, 0x0f- 4, },
-       {  3, 2,  0, 0x0f- 3, },
-       {  1, 3, 12, 0x0f- 1, },
-#if defined(CONFIG_STNIC)
-       /* ST NIC */
-       { 10, 3,  4, 0x0f-10, },        /* LAN */
-#endif
-       /* MRSHPC IRQs setting */
-       {  0, 4, 12, 0x0f- 0, },        /* PCIRQ3 */
-       { 11, 4,  8, 0x0f-11, },        /* PCIRQ2 */
-       {  9, 4,  4, 0x0f- 9, },        /* PCIRQ1 */
-       {  7, 4,  0, 0x0f- 7, },        /* PCIRQ0 */
-       /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
-       /* NOTE: #2 and #13 are not used on PC */
-       { 13, 6,  4, 0x0f-13, },        /* SLOTIRQ2 */
-       {  2, 6,  0, 0x0f- 2, },        /* SLOTIRQ1 */
-#endif
-};
-
-static unsigned long ipr_offsets[] = {
-       BCR_ILCRA,
-       BCR_ILCRB,
-       BCR_ILCRC,
-       BCR_ILCRD,
-       BCR_ILCRE,
-       BCR_ILCRF,
-       BCR_ILCRG,
-};
-
-static struct ipr_desc ipr_irq_desc = {
-       .ipr_offsets    = ipr_offsets,
-       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
-
-       .ipr_data       = ipr_irq_table,
-       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
-       .chip = {
-               .name   = "IPR-se770x",
-       },
-};
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se_IRQ(void)
-{
-       /* Disable all interrupts */
-       ctrl_outw(0, BCR_ILCRA);
-       ctrl_outw(0, BCR_ILCRB);
-       ctrl_outw(0, BCR_ILCRC);
-       ctrl_outw(0, BCR_ILCRD);
-       ctrl_outw(0, BCR_ILCRE);
-       ctrl_outw(0, BCR_ILCRF);
-       ctrl_outw(0, BCR_ILCRG);
-
-       register_ipr_controller(&ipr_irq_desc);
-}
diff --git a/arch/sh/boards/se/770x/setup.c b/arch/sh/boards/se/770x/setup.c
deleted file mode 100644 (file)
index 6c64d77..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * linux/arch/sh/boards/se/770x/setup.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <asm/se.h>
-#include <asm/io.h>
-#include <asm/smc37c93x.h>
-#include <asm/heartbeat.h>
-
-/*
- * Configure the Super I/O chip
- */
-static void __init smsc_config(int index, int data)
-{
-       outb_p(index, INDEX_PORT);
-       outb_p(data, DATA_PORT);
-}
-
-/* XXX: Another candidate for a more generic cchip machine vector */
-static void __init smsc_setup(char **cmdline_p)
-{
-       outb_p(CONFIG_ENTER, CONFIG_PORT);
-       outb_p(CONFIG_ENTER, CONFIG_PORT);
-
-       /* FDC */
-       smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
-
-       /* AUXIO (GPIO): to use IDE1 */
-       smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
-       smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
-       smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
-
-       /* COM1 */
-       smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IO_BASE_HI_INDEX, 0x03);
-       smsc_config(IO_BASE_LO_INDEX, 0xf8);
-       smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
-
-       /* COM2 */
-       smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IO_BASE_HI_INDEX, 0x02);
-       smsc_config(IO_BASE_LO_INDEX, 0xf8);
-       smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
-
-       /* RTC */
-       smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
-
-       /* XXX: PARPORT, KBD, and MOUSE will come here... */
-       outb_p(CONFIG_EXIT, CONFIG_PORT);
-}
-
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_MRSHPC_IO + 0x1f0,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = IRQ_CFCARD,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
-       defined(CONFIG_CPU_SUBTYPE_SH7712)
-/* SH771X Ethernet driver */
-static struct resource sh_eth0_resources[] = {
-       [0] = {
-               .start = SH_ETH0_BASE,
-               .end = SH_ETH0_BASE + 0x1B8,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = SH_ETH0_IRQ,
-               .end = SH_ETH0_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sh_eth0_device = {
-       .name = "sh-eth",
-       .id     = 0,
-       .dev = {
-               .platform_data = PHY_ID,
-       },
-       .num_resources = ARRAY_SIZE(sh_eth0_resources),
-       .resource = sh_eth0_resources,
-};
-
-static struct resource sh_eth1_resources[] = {
-       [0] = {
-               .start = SH_ETH1_BASE,
-               .end = SH_ETH1_BASE + 0x1B8,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = SH_ETH1_IRQ,
-               .end = SH_ETH1_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sh_eth1_device = {
-       .name = "sh-eth",
-       .id     = 1,
-       .dev = {
-               .platform_data = PHY_ID,
-       },
-       .num_resources = ARRAY_SIZE(sh_eth1_resources),
-       .resource = sh_eth1_resources,
-};
-#endif
-
-static struct platform_device *se_devices[] __initdata = {
-       &heartbeat_device,
-       &cf_ide_device,
-#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
-       defined(CONFIG_CPU_SUBTYPE_SH7712)
-       &sh_eth0_device,
-       &sh_eth1_device,
-#endif
-};
-
-static int __init se_devices_setup(void)
-{
-       return platform_add_devices(se_devices, ARRAY_SIZE(se_devices));
-}
-device_initcall(se_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se __initmv = {
-       .mv_name                = "SolutionEngine",
-       .mv_setup               = smsc_setup,
-#if defined(CONFIG_CPU_SH4)
-       .mv_nr_irqs             = 48,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
-       .mv_nr_irqs             = 32,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
-       .mv_nr_irqs             = 61,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
-       .mv_nr_irqs             = 86,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
-       .mv_nr_irqs             = 104,
-#endif
-
-       .mv_inb                 = se_inb,
-       .mv_inw                 = se_inw,
-       .mv_inl                 = se_inl,
-       .mv_outb                = se_outb,
-       .mv_outw                = se_outw,
-       .mv_outl                = se_outl,
-
-       .mv_inb_p               = se_inb_p,
-       .mv_inw_p               = se_inw,
-       .mv_inl_p               = se_inl,
-       .mv_outb_p              = se_outb_p,
-       .mv_outw_p              = se_outw,
-       .mv_outl_p              = se_outl,
-
-       .mv_insb                = se_insb,
-       .mv_insw                = se_insw,
-       .mv_insl                = se_insl,
-       .mv_outsb               = se_outsb,
-       .mv_outsw               = se_outsw,
-       .mv_outsl               = se_outsl,
-
-       .mv_init_irq            = init_se_IRQ,
-};
diff --git a/arch/sh/boards/se/7721/Makefile b/arch/sh/boards/se/7721/Makefile
deleted file mode 100644 (file)
index 7f09030..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/se/7721/irq.c b/arch/sh/boards/se/7721/irq.c
deleted file mode 100644 (file)
index c4fdd62..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7721/irq.c
- *
- * Copyright (C) 2008  Renesas Solutions Corp.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <asm/se7721.h>
-
-enum {
-       UNUSED = 0,
-
-       /* board specific interrupt sources */
-       MRSHPC,
-};
-
-static struct intc_vect vectors[] __initdata = {
-       INTC_IRQ(MRSHPC, MRSHPC_IRQ0),
-};
-
-static struct intc_prio_reg prio_registers[] __initdata = {
-       { FPGA_ILSR6, 0, 8, 4, /* IRLMSK */
-         { 0, MRSHPC } },
-};
-
-static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
-                        NULL, NULL, prio_registers, NULL);
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7721_IRQ(void)
-{
-       /* PPCR */
-       ctrl_outw(ctrl_inw(0xa4050118) & ~0x00ff, 0xa4050118);
-
-       register_intc_controller(&intc_desc);
-       intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
-}
diff --git a/arch/sh/boards/se/7721/setup.c b/arch/sh/boards/se/7721/setup.c
deleted file mode 100644 (file)
index 1be3e92..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7721/setup.c
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- *
- * Hitachi UL SolutionEngine 7721 Support.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <asm/se7721.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_MRSHPC_IO + 0x1f0,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
-               .flags  = IORESOURCE_IO,
-       },
-       [1] = {
-               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
-               .flags  = IORESOURCE_IO,
-       },
-       [2] = {
-               .start  = MRSHPC_IRQ0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static struct platform_device *se7721_devices[] __initdata = {
-       &cf_ide_device,
-       &heartbeat_device
-};
-
-static int __init se7721_devices_setup(void)
-{
-       return platform_add_devices(se7721_devices,
-               ARRAY_SIZE(se7721_devices));
-}
-device_initcall(se7721_devices_setup);
-
-static void __init se7721_setup(char **cmdline_p)
-{
-       /* for USB */
-       ctrl_outw(0x0000, 0xA405010C);  /* PGCR */
-       ctrl_outw(0x0000, 0xA405010E);  /* PHCR */
-       ctrl_outw(0x00AA, 0xA4050118);  /* PPCR */
-       ctrl_outw(0x0000, 0xA4050124);  /* PSELA */
-}
-
-/*
- * The Machine Vector
- */
-struct sh_machine_vector mv_se7721 __initmv = {
-       .mv_name                = "Solution Engine 7721",
-       .mv_setup               = se7721_setup,
-       .mv_nr_irqs             = 109,
-       .mv_init_irq            = init_se7721_IRQ,
-};
diff --git a/arch/sh/boards/se/7722/Makefile b/arch/sh/boards/se/7722/Makefile
deleted file mode 100644 (file)
index 8694373..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Makefile for the HITACHI UL SolutionEngine 7722 specific parts of the kernel
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License.  See the file "COPYING" in the main directory of this archive
-# for more details.
-#
-#
-
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/se/7722/irq.c b/arch/sh/boards/se/7722/irq.c
deleted file mode 100644 (file)
index 0b03f3f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7722/irq.c
- *
- * Copyright (C) 2007  Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7722 Support.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/se7722.h>
-
-static void disable_se7722_irq(unsigned int irq)
-{
-       unsigned int bit = irq - SE7722_FPGA_IRQ_BASE;
-       ctrl_outw(ctrl_inw(IRQ01_MASK) | 1 << bit, IRQ01_MASK);
-}
-
-static void enable_se7722_irq(unsigned int irq)
-{
-       unsigned int bit = irq - SE7722_FPGA_IRQ_BASE;
-       ctrl_outw(ctrl_inw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK);
-}
-
-static struct irq_chip se7722_irq_chip __read_mostly = {
-       .name           = "SE7722-FPGA",
-       .mask           = disable_se7722_irq,
-       .unmask         = enable_se7722_irq,
-       .mask_ack       = disable_se7722_irq,
-};
-
-static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
-{
-       unsigned short intv = ctrl_inw(IRQ01_STS);
-       struct irq_desc *ext_desc;
-       unsigned int ext_irq = SE7722_FPGA_IRQ_BASE;
-
-       intv &= (1 << SE7722_FPGA_IRQ_NR) - 1;
-
-       while (intv) {
-               if (intv & 1) {
-                       ext_desc = irq_desc + ext_irq;
-                       handle_level_irq(ext_irq, ext_desc);
-               }
-               intv >>= 1;
-               ext_irq++;
-       }
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7722_IRQ(void)
-{
-       int i;
-
-       ctrl_outw(0, IRQ01_MASK);       /* disable all irqs */
-       ctrl_outw(0x2000, 0xb03fffec);  /* mrshpc irq enable */
-
-       for (i = 0; i < SE7722_FPGA_IRQ_NR; i++)
-               set_irq_chip_and_handler_name(SE7722_FPGA_IRQ_BASE + i,
-                                             &se7722_irq_chip,
-                                             handle_level_irq, "level");
-
-       set_irq_chained_handler(IRQ0_IRQ, se7722_irq_demux);
-       set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
-
-       set_irq_chained_handler(IRQ1_IRQ, se7722_irq_demux);
-       set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
-}
diff --git a/arch/sh/boards/se/7722/setup.c b/arch/sh/boards/se/7722/setup.c
deleted file mode 100644 (file)
index 6e228ea..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7722/setup.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7722 Support.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/input.h>
-#include <linux/smc91x.h>
-#include <asm/machvec.h>
-#include <asm/clock.h>
-#include <asm/se7722.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-#include <asm/sh_keysc.h>
-
-/* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-/* SMC91x */
-static struct smc91x_platdata smc91x_info = {
-       .flags = SMC91X_USE_16BIT,
-};
-
-static struct resource smc91x_eth_resources[] = {
-       [0] = {
-               .name   = "smc91x-regs" ,
-               .start  = PA_LAN + 0x300,
-               .end    = PA_LAN + 0x300 + 0x10 ,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = SMC_IRQ,
-               .end    = SMC_IRQ,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_eth_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-               .platform_data  = &smc91x_info,
-       },
-       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
-       .resource       = smc91x_eth_resources,
-};
-
-static struct resource cf_ide_resources[] = {
-       [0] = {
-               .start  = PA_MRSHPC_IO + 0x1f0,
-               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
-               .flags  = IORESOURCE_IO,
-       },
-       [1] = {
-               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
-               .end    = PA_MRSHPC_IO + 0x1f0 +8 + 0x206 + 8,
-               .flags  = IORESOURCE_IO,
-       },
-       [2] = {
-               .start  = MRSHPC_IRQ0,
-               .end    = MRSHPC_IRQ0,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cf_ide_device  = {
-       .name           = "pata_platform",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(cf_ide_resources),
-       .resource       = cf_ide_resources,
-};
-
-static struct sh_keysc_info sh_keysc_info = {
-       .mode = SH_KEYSC_MODE_1, /* KEYOUT0->5, KEYIN0->4 */
-       .scan_timing = 3,
-       .delay = 5,
-       .keycodes = { /* SW1 -> SW30 */
-               KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
-               KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
-               KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
-               KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
-               KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y,
-               KEY_Z,
-               KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE, /* life */
-       },
-};
-
-static struct resource sh_keysc_resources[] = {
-       [0] = {
-               .start  = 0x044b0000,
-               .end    = 0x044b000f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 79,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sh_keysc_device = {
-       .name           = "sh_keysc",
-       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
-       .resource       = sh_keysc_resources,
-       .dev    = {
-               .platform_data  = &sh_keysc_info,
-       },
-};
-
-static struct platform_device *se7722_devices[] __initdata = {
-       &heartbeat_device,
-       &smc91x_eth_device,
-       &cf_ide_device,
-       &sh_keysc_device,
-};
-
-static int __init se7722_devices_setup(void)
-{
-       clk_always_enable("mstp214"); /* KEYSC */
-
-       return platform_add_devices(se7722_devices,
-               ARRAY_SIZE(se7722_devices));
-}
-device_initcall(se7722_devices_setup);
-
-static void __init se7722_setup(char **cmdline_p)
-{
-       ctrl_outw(0x010D, FPGA_OUT);    /* FPGA */
-
-       ctrl_outw(0x0000, PORT_PECR);   /* PORT E 1 = IRQ5 ,E 0 = BS */
-       ctrl_outw(0x1000, PORT_PJCR);   /* PORT J 1 = IRQ1,J 0 =IRQ0 */
-
-       /* LCDC I/O */
-       ctrl_outw(0x0020, PORT_PSELD);
-
-       /* SIOF1*/
-       ctrl_outw(0x0003, PORT_PSELB);
-       ctrl_outw(0xe000, PORT_PSELC);
-       ctrl_outw(0x0000, PORT_PKCR);
-
-       /* LCDC */
-       ctrl_outw(0x4020, PORT_PHCR);
-       ctrl_outw(0x0000, PORT_PLCR);
-       ctrl_outw(0x0000, PORT_PMCR);
-       ctrl_outw(0x0002, PORT_PRCR);
-       ctrl_outw(0x0000, PORT_PXCR);   /* LCDC,CS6A */
-
-       /* KEYSC */
-       ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */
-       ctrl_outw(0x0000, PORT_PYCR);
-       ctrl_outw(0x0000, PORT_PZCR);
-       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
-       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7722 __initmv = {
-       .mv_name                = "Solution Engine 7722" ,
-       .mv_setup               = se7722_setup ,
-       .mv_nr_irqs             = SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_NR,
-       .mv_init_irq            = init_se7722_IRQ,
-};
diff --git a/arch/sh/boards/se/7751/Makefile b/arch/sh/boards/se/7751/Makefile
deleted file mode 100644 (file)
index dbc29f3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Makefile for the 7751 SolutionEngine specific parts of the kernel
-#
-
-obj-y   := setup.o io.o irq.o
-
-obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/sh/boards/se/7751/io.c b/arch/sh/boards/se/7751/io.c
deleted file mode 100644 (file)
index e8d846c..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * I/O routine for Hitachi 7751 SolutionEngine.
- *
- * Initial version only to support LAN access; some
- * placeholder code from io_se.c left in with the
- * expectation of later SuperIO and PCMCIA access.
- */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/io.h>
-#include <asm/se7751.h>
-#include <asm/addrspace.h>
-
-static inline volatile u16 *port2adr(unsigned int port)
-{
-       if (port >= 0x2000)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-       maybebadio((unsigned long)port);
-       return (volatile __u16*)port;
-}
-
-/*
- * General outline: remap really low stuff [eventually] to SuperIO,
- * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
- * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
- * should be way beyond the window, and is used  w/o translation for
- * compatibility.
- */
-unsigned char sh7751se_inb(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned char *)pci_ioaddr(port);
-       else
-               return (*port2adr(port)) & 0xff;
-}
-
-unsigned char sh7751se_inb_p(unsigned long port)
-{
-       unsigned char v;
-
-        if (PXSEG(port))
-                v = *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-                v = *(volatile unsigned char *)pci_ioaddr(port);
-       else
-               v = (*port2adr(port)) & 0xff;
-       ctrl_delay();
-       return v;
-}
-
-unsigned short sh7751se_inw(unsigned long port)
-{
-        if (PXSEG(port))
-                return *(volatile unsigned short *)port;
-       else if (is_pci_ioaddr(port))
-                return *(volatile unsigned short *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-unsigned int sh7751se_inl(unsigned long port)
-{
-        if (PXSEG(port))
-                return *(volatile unsigned long *)port;
-       else if (is_pci_ioaddr(port))
-                return *(volatile unsigned int *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-void sh7751se_outb(unsigned char value, unsigned long port)
-{
-
-        if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else
-               *(port2adr(port)) = value;
-}
-
-void sh7751se_outb_p(unsigned char value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else
-               *(port2adr(port)) = value;
-       ctrl_delay();
-}
-
-void sh7751se_outw(unsigned short value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned short *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned short *)pci_ioaddr(port)) = value;
-       else if (port >= 0x2000)
-               *port2adr(port) = value;
-       else
-               maybebadio(port);
-}
-
-void sh7751se_outl(unsigned int value, unsigned long port)
-{
-        if (PXSEG(port))
-                *(volatile unsigned long *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned long*)pci_ioaddr(port)) = value;
-       else
-               maybebadio(port);
-}
-
-void sh7751se_insl(unsigned long port, void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
-
-void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
diff --git a/arch/sh/boards/se/7751/irq.c b/arch/sh/boards/se/7751/irq.c
deleted file mode 100644 (file)
index c3d1259..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7751/irq.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <asm/se7751.h>
-
-static struct ipr_data ipr_irq_table[] = {
-       { 13, 3, 3, 2 },
-       /* Add additional entries here as drivers are added and tested. */
-};
-
-static unsigned long ipr_offsets[] = {
-       BCR_ILCRA,
-       BCR_ILCRB,
-       BCR_ILCRC,
-       BCR_ILCRD,
-       BCR_ILCRE,
-       BCR_ILCRF,
-       BCR_ILCRG,
-};
-
-static struct ipr_desc ipr_irq_desc = {
-       .ipr_offsets    = ipr_offsets,
-       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
-
-       .ipr_data       = ipr_irq_table,
-       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
-
-       .chip = {
-               .name   = "IPR-se7751",
-       },
-};
-
-/*
- * Initialize IRQ setting
- */
-void __init init_7751se_IRQ(void)
-{
-       register_ipr_controller(&ipr_irq_desc);
-}
diff --git a/arch/sh/boards/se/7751/pci.c b/arch/sh/boards/se/7751/pci.c
deleted file mode 100644 (file)
index 203b292..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7751/pci.c
- *
- * Author:  Ian DaSilva (idasilva@mvista.com)
- *
- * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * PCI initialization for the Hitachi SH7751 Solution Engine board (MS7751SE01)
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/pci.h>
-
-#include <asm/io.h>
-#include "../../../drivers/pci/pci-sh7751.h"
-
-#define PCIMCR_MRSET_OFF       0xBFFFFFFF
-#define PCIMCR_RFSH_OFF                0xFFFFFFFB
-
-/*
- * Only long word accesses of the PCIC's internal local registers and the
- * configuration registers from the CPU is supported.
- */
-#define PCIC_WRITE(x,v) writel((v), PCI_REG(x))
-#define PCIC_READ(x) readl(PCI_REG(x))
-
-/*
- * Description:  This function sets up and initializes the pcic, sets
- * up the BARS, maps the DRAM into the address space etc, etc.
- */
-int __init pcibios_init_platform(void)
-{
-   unsigned long bcr1, wcr1, wcr2, wcr3, mcr;
-   unsigned short bcr2;
-
-   /*
-    * Initialize the slave bus controller on the pcic.  The values used
-    * here should not be hardcoded, but they should be taken from the bsc
-    * on the processor, to make this function as generic as possible.
-    * (i.e. Another sbc may usr different SDRAM timing settings -- in order
-    * for the pcic to work, its settings need to be exactly the same.)
-    */
-   bcr1 = (*(volatile unsigned long*)(SH7751_BCR1));
-   bcr2 = (*(volatile unsigned short*)(SH7751_BCR2));
-   wcr1 = (*(volatile unsigned long*)(SH7751_WCR1));
-   wcr2 = (*(volatile unsigned long*)(SH7751_WCR2));
-   wcr3 = (*(volatile unsigned long*)(SH7751_WCR3));
-   mcr = (*(volatile unsigned long*)(SH7751_MCR));
-
-   bcr1 = bcr1 | 0x00080000;  /* Enable Bit 19, BREQEN */
-   (*(volatile unsigned long*)(SH7751_BCR1)) = bcr1;   
-
-   bcr1 = bcr1 | 0x40080000;  /* Enable Bit 19 BREQEN, set PCIC to slave */
-   PCIC_WRITE(SH7751_PCIBCR1, bcr1);    /* PCIC BCR1 */
-   PCIC_WRITE(SH7751_PCIBCR2, bcr2);     /* PCIC BCR2 */
-   PCIC_WRITE(SH7751_PCIWCR1, wcr1);     /* PCIC WCR1 */
-   PCIC_WRITE(SH7751_PCIWCR2, wcr2);     /* PCIC WCR2 */
-   PCIC_WRITE(SH7751_PCIWCR3, wcr3);     /* PCIC WCR3 */
-   mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF;
-   PCIC_WRITE(SH7751_PCIMCR, mcr);      /* PCIC MCR */
-
-
-   /* Enable all interrupts, so we know what to fix */
-   PCIC_WRITE(SH7751_PCIINTM, 0x0000c3ff);
-   PCIC_WRITE(SH7751_PCIAINTM, 0x0000380f);
-
-   /* Set up standard PCI config registers */
-   PCIC_WRITE(SH7751_PCICONF1,         0xF39000C7); /* Bus Master, Mem & I/O access */
-   PCIC_WRITE(SH7751_PCICONF2,         0x00000000); /* PCI Class code & Revision ID */
-   PCIC_WRITE(SH7751_PCICONF4,         0xab000001); /* PCI I/O address (local regs) */
-   PCIC_WRITE(SH7751_PCICONF5,         0x0c000000); /* PCI MEM address (local RAM)  */
-   PCIC_WRITE(SH7751_PCICONF6,         0xd0000000); /* PCI MEM address (unused)     */
-   PCIC_WRITE(SH7751_PCICONF11, 0x35051054); /* PCI Subsystem ID & Vendor ID */
-   PCIC_WRITE(SH7751_PCILSR0, 0x03f00000);   /* MEM (full 64M exposed)       */
-   PCIC_WRITE(SH7751_PCILSR1, 0x00000000);   /* MEM (unused)                 */
-   PCIC_WRITE(SH7751_PCILAR0, 0x0c000000);   /* MEM (direct map from PCI)    */
-   PCIC_WRITE(SH7751_PCILAR1, 0x00000000);   /* MEM (unused)                 */
-
-   /* Now turn it on... */
-   PCIC_WRITE(SH7751_PCICR, 0xa5000001);
-
-   /*
-    * Set PCIMBR and PCIIOBR here, assuming a single window
-    * (16M MEM, 256K IO) is enough.  If a larger space is
-    * needed, the readx/writex and inx/outx functions will
-    * have to do more (e.g. setting registers for each call).
-    */
-
-   /*
-    * Set the MBR so PCI address is one-to-one with window,
-    * meaning all calls go straight through... use BUG_ON to
-    * catch erroneous assumption.
-    */
-   BUG_ON(PCIBIOS_MIN_MEM != SH7751_PCI_MEMORY_BASE);
-
-   PCIC_WRITE(SH7751_PCIMBR, PCIBIOS_MIN_MEM);
-
-   /* Set IOBR for window containing area specified in pci.h */
-   PCIC_WRITE(SH7751_PCIIOBR, (PCIBIOS_MIN_IO & SH7751_PCIIOBR_MASK));
-
-   /* All done, may as well say so... */
-   printk("SH7751 PCI: Finished initialization of the PCI controller\n");
-
-   return 1;
-}
-
-int __init pcibios_map_platform_irq(u8 slot, u8 pin)
-{
-        switch (slot) {
-        case 0: return 13;
-        case 1: return 13;     /* AMD Ethernet controller */
-        case 2: return -1;
-        case 3: return -1;
-        case 4: return -1;
-        default:
-                printk("PCI: Bad IRQ mapping request for slot %d\n", slot);
-                return -1;
-        }
-}
-
-static struct resource sh7751_io_resource = {
-       .name   = "SH7751 IO",
-       .start  = SH7751_PCI_IO_BASE,
-       .end    = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
-       .flags  = IORESOURCE_IO
-};
-
-static struct resource sh7751_mem_resource = {
-       .name   = "SH7751 mem",
-       .start  = SH7751_PCI_MEMORY_BASE,
-       .end    = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
-       .flags  = IORESOURCE_MEM
-};
-
-extern struct pci_ops sh7751_pci_ops;
-
-struct pci_channel board_pci_channels[] = {
-       { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
-       { NULL, NULL, NULL, 0, 0 },
-};
-
diff --git a/arch/sh/boards/se/7751/setup.c b/arch/sh/boards/se/7751/setup.c
deleted file mode 100644 (file)
index deefbfd..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7751/setup.c
- *
- * Copyright (C) 2000  Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <asm/se7751.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
-       .bit_pos        = heartbeat_bit_pos,
-       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct platform_device *se7751_devices[] __initdata = {
-       &heartbeat_device,
-};
-
-static int __init se7751_devices_setup(void)
-{
-       return platform_add_devices(se7751_devices, ARRAY_SIZE(se7751_devices));
-}
-__initcall(se7751_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_7751se __initmv = {
-       .mv_name                = "7751 SolutionEngine",
-       .mv_nr_irqs             = 72,
-
-       .mv_inb                 = sh7751se_inb,
-       .mv_inw                 = sh7751se_inw,
-       .mv_inl                 = sh7751se_inl,
-       .mv_outb                = sh7751se_outb,
-       .mv_outw                = sh7751se_outw,
-       .mv_outl                = sh7751se_outl,
-
-       .mv_inb_p               = sh7751se_inb_p,
-       .mv_inw_p               = sh7751se_inw,
-       .mv_inl_p               = sh7751se_inl,
-       .mv_outb_p              = sh7751se_outb_p,
-       .mv_outw_p              = sh7751se_outw,
-       .mv_outl_p              = sh7751se_outl,
-
-       .mv_insl                = sh7751se_insl,
-       .mv_outsl               = sh7751se_outsl,
-
-       .mv_init_irq            = init_7751se_IRQ,
-};
diff --git a/arch/sh/boards/se/7780/Makefile b/arch/sh/boards/se/7780/Makefile
deleted file mode 100644 (file)
index 6b88ada..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Makefile for the HITACHI UL SolutionEngine 7780 specific parts of the kernel
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License.  See the file "COPYING" in the main directory of this archive
-# for more details.
-#
-#
-
-obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/se/7780/irq.c b/arch/sh/boards/se/7780/irq.c
deleted file mode 100644 (file)
index 6bd70da..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7780/irq.c
- *
- * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7780 Support.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/se7780.h>
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7780_IRQ(void)
-{
-       /* enable all interrupt at FPGA */
-       ctrl_outw(0, FPGA_INTMSK1);
-       /* mask SM501 interrupt */
-       ctrl_outw((ctrl_inw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
-       /* enable all interrupt at FPGA */
-       ctrl_outw(0, FPGA_INTMSK2);
-
-       /* set FPGA INTSEL register */
-       /* FPGA + 0x06 */
-       ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) |
-               (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
-
-       /* FPGA + 0x08 */
-       ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
-               (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
-               (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
-               (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
-
-       /* FPGA + 0x0A */
-       ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
-
-       plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */
-}
diff --git a/arch/sh/boards/se/7780/setup.c b/arch/sh/boards/se/7780/setup.c
deleted file mode 100644 (file)
index 0f08ab3..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * linux/arch/sh/boards/se/7780/setup.c
- *
- * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7780 Support.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <asm/se7780.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-/* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-/* SMC91x */
-static struct resource smc91x_eth_resources[] = {
-       [0] = {
-               .name   = "smc91x-regs" ,
-               .start  = PA_LAN + 0x300,
-               .end    = PA_LAN + 0x300 + 0x10 ,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = SMC_IRQ,
-               .end    = SMC_IRQ,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_eth_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .dev = {
-               .dma_mask               = NULL,         /* don't use dma */
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(smc91x_eth_resources),
-       .resource       = smc91x_eth_resources,
-};
-
-static struct platform_device *se7780_devices[] __initdata = {
-       &heartbeat_device,
-       &smc91x_eth_device,
-};
-
-static int __init se7780_devices_setup(void)
-{
-       return platform_add_devices(se7780_devices,
-               ARRAY_SIZE(se7780_devices));
-}
-device_initcall(se7780_devices_setup);
-
-#define GPIO_PHCR        0xFFEA000E
-#define GPIO_PMSELR      0xFFEA0080
-#define GPIO_PECR        0xFFEA0008
-
-static void __init se7780_setup(char **cmdline_p)
-{
-       /* "SH-Linux" on LED Display */
-       ctrl_outw( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
-       ctrl_outw( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
-       ctrl_outw( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
-       ctrl_outw( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
-       ctrl_outw( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
-       ctrl_outw( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
-       ctrl_outw( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
-       ctrl_outw( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
-
-       printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
-
-       /*
-        * PCI REQ/GNT setting
-        *   REQ0/GNT0 -> USB
-        *   REQ1/GNT1 -> PC Card
-        *   REQ2/GNT2 -> Serial ATA
-        *   REQ3/GNT3 -> PCI slot
-        */
-       ctrl_outw(0x0213, FPGA_REQSEL);
-
-       /* GPIO setting */
-       ctrl_outw(0x0000, GPIO_PECR);
-       ctrl_outw(ctrl_inw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
-       ctrl_outw(0x0c00, GPIO_PMSELR);
-
-       /* iVDR Power ON */
-       ctrl_outw(0x0001, FPGA_IVDRPW);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7780 __initmv = {
-       .mv_name                = "Solution Engine 7780" ,
-       .mv_setup               = se7780_setup ,
-       .mv_nr_irqs             = 111 ,
-       .mv_init_irq            = init_se7780_IRQ,
-};
diff --git a/arch/sh/boards/sh03/Makefile b/arch/sh/boards/sh03/Makefile
deleted file mode 100644 (file)
index 400306a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the Interface (CTP/PCI-SH03) specific parts of the kernel
-#
-
-obj-y   := setup.o rtc.o
diff --git a/arch/sh/boards/sh03/rtc.c b/arch/sh/boards/sh03/rtc.c
deleted file mode 100644 (file)
index 0a9266b..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * linux/arch/sh/boards/sh03/rtc.c -- CTP/PCI-SH03 on-chip RTC support
- *
- *  Copyright (C) 2004  Saito.K & Jeanne(ksaito@interface.co.jp)
- *
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/bcd.h>
-#include <linux/rtc.h>
-#include <linux/spinlock.h>
-#include <asm/io.h>
-#include <asm/rtc.h>
-
-#define RTC_BASE       0xb0000000
-#define RTC_SEC1       (RTC_BASE + 0)
-#define RTC_SEC10      (RTC_BASE + 1)
-#define RTC_MIN1       (RTC_BASE + 2)
-#define RTC_MIN10      (RTC_BASE + 3)
-#define RTC_HOU1       (RTC_BASE + 4)
-#define RTC_HOU10      (RTC_BASE + 5)
-#define RTC_WEE1       (RTC_BASE + 6)
-#define RTC_DAY1       (RTC_BASE + 7)
-#define RTC_DAY10      (RTC_BASE + 8)
-#define RTC_MON1       (RTC_BASE + 9)
-#define RTC_MON10      (RTC_BASE + 10)
-#define RTC_YEA1       (RTC_BASE + 11)
-#define RTC_YEA10      (RTC_BASE + 12)
-#define RTC_YEA100     (RTC_BASE + 13)
-#define RTC_YEA1000    (RTC_BASE + 14)
-#define RTC_CTL                (RTC_BASE + 15)
-#define RTC_BUSY       1
-#define RTC_STOP       2
-
-extern spinlock_t rtc_lock;
-
-unsigned long get_cmos_time(void)
-{
-       unsigned int year, mon, day, hour, min, sec;
-
-       spin_lock(&rtc_lock);
- again:
-       do {
-               sec  = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10;
-               min  = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
-               hour = (ctrl_inb(RTC_HOU1) & 0xf) + (ctrl_inb(RTC_HOU10) & 0xf) * 10;
-               day  = (ctrl_inb(RTC_DAY1) & 0xf) + (ctrl_inb(RTC_DAY10) & 0xf) * 10;
-               mon  = (ctrl_inb(RTC_MON1) & 0xf) + (ctrl_inb(RTC_MON10) & 0xf) * 10;
-               year = (ctrl_inb(RTC_YEA1) & 0xf) + (ctrl_inb(RTC_YEA10) & 0xf) * 10
-                    + (ctrl_inb(RTC_YEA100 ) & 0xf) * 100
-                    + (ctrl_inb(RTC_YEA1000) & 0xf) * 1000;
-       } while (sec != (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10);
-       if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
-           hour > 23 || min > 59 || sec > 59) {
-               printk(KERN_ERR
-                      "SH-03 RTC: invalid value, resetting to 1 Jan 2000\n");
-               printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n",
-                      year, mon, day, hour, min, sec);
-
-               ctrl_outb(0, RTC_SEC1); ctrl_outb(0, RTC_SEC10);
-               ctrl_outb(0, RTC_MIN1); ctrl_outb(0, RTC_MIN10);
-               ctrl_outb(0, RTC_HOU1); ctrl_outb(0, RTC_HOU10);
-               ctrl_outb(6, RTC_WEE1);
-               ctrl_outb(1, RTC_DAY1); ctrl_outb(0, RTC_DAY10);
-               ctrl_outb(1, RTC_MON1); ctrl_outb(0, RTC_MON10);
-               ctrl_outb(0, RTC_YEA1); ctrl_outb(0, RTC_YEA10);
-               ctrl_outb(0, RTC_YEA100);
-               ctrl_outb(2, RTC_YEA1000);
-               ctrl_outb(0, RTC_CTL);
-               goto again;
-       }
-
-       spin_unlock(&rtc_lock);
-       return mktime(year, mon, day, hour, min, sec);
-}
-
-void sh03_rtc_gettimeofday(struct timespec *tv)
-{
-
-       tv->tv_sec = get_cmos_time();
-       tv->tv_nsec = 0;
-}
-
-static int set_rtc_mmss(unsigned long nowtime)
-{
-       int retval = 0;
-       int real_seconds, real_minutes, cmos_minutes;
-       int i;
-
-       /* gets recalled with irq locally disabled */
-       spin_lock(&rtc_lock);
-       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
-               if (!(ctrl_inb(RTC_CTL) & RTC_BUSY))
-                       break;
-       cmos_minutes = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
-       real_seconds = nowtime % 60;
-       real_minutes = nowtime / 60;
-       if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
-               real_minutes += 30;             /* correct for half hour time zone */
-       real_minutes %= 60;
-
-       if (abs(real_minutes - cmos_minutes) < 30) {
-               ctrl_outb(real_seconds % 10, RTC_SEC1);
-               ctrl_outb(real_seconds / 10, RTC_SEC10);
-               ctrl_outb(real_minutes % 10, RTC_MIN1);
-               ctrl_outb(real_minutes / 10, RTC_MIN10);
-       } else {
-               printk(KERN_WARNING
-                      "set_rtc_mmss: can't update from %d to %d\n",
-                      cmos_minutes, real_minutes);
-               retval = -1;
-       }
-       spin_unlock(&rtc_lock);
-
-       return retval;
-}
-
-int sh03_rtc_settimeofday(const time_t secs)
-{
-       unsigned long nowtime = secs;
-
-       return set_rtc_mmss(nowtime);
-}
-
-void sh03_time_init(void)
-{
-       rtc_sh_get_time = sh03_rtc_gettimeofday;
-       rtc_sh_set_time = sh03_rtc_settimeofday;
-}
diff --git a/arch/sh/boards/sh03/setup.c b/arch/sh/boards/sh03/setup.c
deleted file mode 100644 (file)
index cd9cff1..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * linux/arch/sh/boards/sh03/setup.c
- *
- * Copyright (C) 2004  Interface Co.,Ltd. Saito.K
- *
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/pci.h>
-#include <linux/platform_device.h>
-#include <asm/io.h>
-#include <asm/rtc.h>
-#include <mach/io.h>
-#include <mach/sh03.h>
-#include <asm/addrspace.h>
-
-static void __init init_sh03_IRQ(void)
-{
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-extern void *cf_io_base;
-
-static void __iomem *sh03_ioport_map(unsigned long port, unsigned int size)
-{
-       if (PXSEG(port))
-               return (void __iomem *)port;
-       /* CompactFlash (IDE) */
-       if (((port >= 0x1f0) && (port <= 0x1f7)) || (port == 0x3f6))
-               return (void __iomem *)((unsigned long)cf_io_base + port);
-
-        return (void __iomem *)(port + PCI_IO_BASE);
-}
-
-/* arch/sh/boards/sh03/rtc.c */
-void sh03_time_init(void);
-
-static void __init sh03_setup(char **cmdline_p)
-{
-       board_time_init = sh03_time_init;
-}
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = 0xa0800000,
-               .end    = 0xa0800000,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device heartbeat_device = {
-       .name           = "heartbeat",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
-};
-
-static struct platform_device *sh03_devices[] __initdata = {
-       &heartbeat_device,
-};
-
-static int __init sh03_devices_setup(void)
-{
-       return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
-}
-__initcall(sh03_devices_setup);
-
-static struct sh_machine_vector mv_sh03 __initmv = {
-       .mv_name                = "Interface (CTP/PCI-SH03)",
-       .mv_setup               = sh03_setup,
-       .mv_nr_irqs             = 48,
-       .mv_ioport_map          = sh03_ioport_map,
-       .mv_init_irq            = init_sh03_IRQ,
-};
diff --git a/arch/sh/boards/shmin/Makefile b/arch/sh/boards/shmin/Makefile
deleted file mode 100644 (file)
index 3190cc7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the SHMIN board.
-#
-
-obj-y   := setup.o
diff --git a/arch/sh/boards/shmin/setup.c b/arch/sh/boards/shmin/setup.c
deleted file mode 100644 (file)
index 16e5dae..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * arch/sh/boards/shmin/setup.c
- *
- * Copyright (C) 2006 Takashi YOSHII
- *
- * SHMIN Support.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/machvec.h>
-#include <asm/shmin.h>
-#include <asm/clock.h>
-#include <asm/io.h>
-
-#define PFC_PHCR       0xa400010eUL
-#define INTC_ICR1      0xa4000010UL
-
-static void __init init_shmin_irq(void)
-{
-       ctrl_outw(0x2a00, PFC_PHCR);    // IRQ0-3=IRQ
-       ctrl_outw(0x0aaa, INTC_ICR1);   // IRQ0-3=IRQ-mode,Low-active.
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size)
-{
-       static int dummy;
-
-       if ((port & ~0x1f) == SHMIN_NE_BASE)
-               return (void __iomem *)(SHMIN_IO_BASE + port);
-
-       dummy = 0;
-
-       return &dummy;
-
-}
-
-static struct sh_machine_vector mv_shmin __initmv = {
-       .mv_name        = "SHMIN",
-       .mv_init_irq    = init_shmin_irq,
-       .mv_ioport_map  = shmin_ioport_map,
-};
diff --git a/arch/sh/boards/snapgear/Makefile b/arch/sh/boards/snapgear/Makefile
deleted file mode 100644 (file)
index d2d2f4b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the SnapGear specific parts of the kernel
-#
-
-obj-y   := setup.o io.o
diff --git a/arch/sh/boards/snapgear/io.c b/arch/sh/boards/snapgear/io.c
deleted file mode 100644 (file)
index 0f48242..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
- * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- *
- * I/O routine for Hitachi 7751 SolutionEngine.
- *
- * Initial version only to support LAN access; some
- * placeholder code from io_se.c left in with the
- * expectation of later SuperIO and PCMCIA access.
- */
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/io.h>
-#include <asm/addrspace.h>
-
-#ifdef CONFIG_SH_SECUREEDGE5410
-unsigned short secureedge5410_ioport;
-#endif
-
-static inline volatile __u16 *port2adr(unsigned int port)
-{
-       maybebadio((unsigned long)port);
-       return (volatile __u16*)port;
-}
-
-/*
- * General outline: remap really low stuff [eventually] to SuperIO,
- * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
- * is mapped through the PCI IO window.  Stuff with high bits (PXSEG)
- * should be way beyond the window, and is used  w/o translation for
- * compatibility.
- */
-unsigned char snapgear_inb(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned char *)pci_ioaddr(port);
-       else
-               return (*port2adr(port)) & 0xff;
-}
-
-unsigned char snapgear_inb_p(unsigned long port)
-{
-       unsigned char v;
-
-       if (PXSEG(port))
-               v = *(volatile unsigned char *)port;
-       else if (is_pci_ioaddr(port))
-               v = *(volatile unsigned char *)pci_ioaddr(port);
-       else
-               v = (*port2adr(port))&0xff;
-       ctrl_delay();
-       return v;
-}
-
-unsigned short snapgear_inw(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned short *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned short *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-unsigned int snapgear_inl(unsigned long port)
-{
-       if (PXSEG(port))
-               return *(volatile unsigned long *)port;
-       else if (is_pci_ioaddr(port))
-               return *(volatile unsigned int *)pci_ioaddr(port);
-       else if (port >= 0x2000)
-               return *port2adr(port);
-       else
-               maybebadio(port);
-       return 0;
-}
-
-void snapgear_outb(unsigned char value, unsigned long port)
-{
-
-       if (PXSEG(port))
-               *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else
-               *(port2adr(port)) = value;
-}
-
-void snapgear_outb_p(unsigned char value, unsigned long port)
-{
-       if (PXSEG(port))
-               *(volatile unsigned char *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned char*)pci_ioaddr(port)) = value;
-       else
-               *(port2adr(port)) = value;
-       ctrl_delay();
-}
-
-void snapgear_outw(unsigned short value, unsigned long port)
-{
-       if (PXSEG(port))
-               *(volatile unsigned short *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned short *)pci_ioaddr(port)) = value;
-       else if (port >= 0x2000)
-               *port2adr(port) = value;
-       else
-               maybebadio(port);
-}
-
-void snapgear_outl(unsigned int value, unsigned long port)
-{
-       if (PXSEG(port))
-               *(volatile unsigned long *)port = value;
-       else if (is_pci_ioaddr(port))
-               *((unsigned long*)pci_ioaddr(port)) = value;
-       else
-               maybebadio(port);
-}
-
-void snapgear_insl(unsigned long port, void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
-
-void snapgear_outsl(unsigned long port, const void *addr, unsigned long count)
-{
-       maybebadio(port);
-}
diff --git a/arch/sh/boards/snapgear/setup.c b/arch/sh/boards/snapgear/setup.c
deleted file mode 100644 (file)
index a5e349d..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * linux/arch/sh/boards/snapgear/setup.c
- *
- * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
- * Copyright (C) 2003  Paul Mundt <lethal@linux-sh.org>
- *
- * Based on files with the following comments:
- *
- *           Copyright (C) 2000  Kazumoto Kojima
- *
- *           Modified for 7751 Solution Engine by
- *           Ian da Silva and Jeremy Siegel, 2001.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/timer.h>
-#include <linux/delay.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <asm/machvec.h>
-#include <asm/snapgear.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <cpu/timer.h>
-
-/*
- * EraseConfig handling functions
- */
-
-static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
-{
-       (void)ctrl_inb(0xb8000000);     /* dummy read */
-
-       printk("SnapGear: erase switch interrupt!\n");
-
-       return IRQ_HANDLED;
-}
-
-static int __init eraseconfig_init(void)
-{
-       printk("SnapGear: EraseConfig init\n");
-       /* Setup "EraseConfig" switch on external IRQ 0 */
-       if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED,
-                               "Erase Config", NULL))
-               printk("SnapGear: failed to register IRQ%d for Reset witch\n",
-                               IRL0_IRQ);
-       else
-               printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
-                               IRL0_IRQ);
-       return(0);
-}
-
-module_init(eraseconfig_init);
-
-/****************************************************************************/
-/*
- * Initialize IRQ setting
- *
- * IRL0 = erase switch
- * IRL1 = eth0
- * IRL2 = eth1
- * IRL3 = crypto
- */
-
-static void __init init_snapgear_IRQ(void)
-{
-       printk("Setup SnapGear IRQ/IPR ...\n");
-       /* enable individual interrupt mode for externals */
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_snapgear __initmv = {
-       .mv_name                = "SnapGear SecureEdge5410",
-       .mv_nr_irqs             = 72,
-
-       .mv_inb                 = snapgear_inb,
-       .mv_inw                 = snapgear_inw,
-       .mv_inl                 = snapgear_inl,
-       .mv_outb                = snapgear_outb,
-       .mv_outw                = snapgear_outw,
-       .mv_outl                = snapgear_outl,
-
-       .mv_inb_p               = snapgear_inb_p,
-       .mv_inw_p               = snapgear_inw,
-       .mv_inl_p               = snapgear_inl,
-       .mv_outb_p              = snapgear_outb_p,
-       .mv_outw_p              = snapgear_outw,
-       .mv_outl_p              = snapgear_outl,
-
-       .mv_init_irq            = init_snapgear_IRQ,
-};
diff --git a/arch/sh/boards/superh/microdev/Makefile b/arch/sh/boards/superh/microdev/Makefile
deleted file mode 100644 (file)
index 1387dd6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Makefile for the SuperH MicroDev specific parts of the kernel
-#
-
-obj-y   := setup.o irq.o io.o
-
-obj-$(CONFIG_HEARTBEAT)        += led.o
-
diff --git a/arch/sh/boards/superh/microdev/io.c b/arch/sh/boards/superh/microdev/io.c
deleted file mode 100644 (file)
index 9f8a540..0000000
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * linux/arch/sh/boards/superh/microdev/io.c
- *
- * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
- * Copyright (C) 2003, 2004 SuperH, Inc.
- * Copyright (C) 2004 Paul Mundt
- *
- * SuperH SH4-202 MicroDev board support.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/wait.h>
-#include <asm/io.h>
-#include <asm/microdev.h>
-
-       /*
-        *      we need to have a 'safe' address to re-direct all I/O requests
-        *      that we do not explicitly wish to handle. This safe address
-        *      must have the following properies:
-        *
-        *              * writes are ignored (no exception)
-        *              * reads are benign (no side-effects)
-        *              * accesses of width 1, 2 and 4-bytes are all valid.
-        *
-        *      The Processor Version Register (PVR) has these properties.
-        */
-#define        PVR     0xff000030      /* Processor Version Register */
-
-
-#define        IO_IDE2_BASE            0x170ul /* I/O base for SMSC FDC37C93xAPM IDE #2 */
-#define        IO_IDE1_BASE            0x1f0ul /* I/O base for SMSC FDC37C93xAPM IDE #1 */
-#define IO_ISP1161_BASE                0x290ul /* I/O port for Philips ISP1161x USB chip */
-#define IO_SERIAL2_BASE                0x2f8ul /* I/O base for SMSC FDC37C93xAPM Serial #2 */
-#define        IO_LAN91C111_BASE       0x300ul /* I/O base for SMSC LAN91C111 Ethernet chip */
-#define        IO_IDE2_MISC            0x376ul /* I/O misc for SMSC FDC37C93xAPM IDE #2 */
-#define IO_SUPERIO_BASE                0x3f0ul /* I/O base for SMSC FDC37C93xAPM SuperIO chip */
-#define        IO_IDE1_MISC            0x3f6ul /* I/O misc for SMSC FDC37C93xAPM IDE #1 */
-#define IO_SERIAL1_BASE                0x3f8ul /* I/O base for SMSC FDC37C93xAPM Serial #1 */
-
-#define        IO_ISP1161_EXTENT       0x04ul  /* I/O extent for Philips ISP1161x USB chip */
-#define        IO_LAN91C111_EXTENT     0x10ul  /* I/O extent for SMSC LAN91C111 Ethernet chip */
-#define        IO_SUPERIO_EXTENT       0x02ul  /* I/O extent for SMSC FDC37C93xAPM SuperIO chip */
-#define        IO_IDE_EXTENT           0x08ul  /* I/O extent for IDE Task Register set */
-#define IO_SERIAL_EXTENT       0x10ul
-
-#define        IO_LAN91C111_PHYS       0xa7500000ul    /* Physical address of SMSC LAN91C111 Ethernet chip */
-#define        IO_ISP1161_PHYS         0xa7700000ul    /* Physical address of Philips ISP1161x USB chip */
-#define        IO_SUPERIO_PHYS         0xa7800000ul    /* Physical address of SMSC FDC37C93xAPM SuperIO chip */
-
-/*
- * map I/O ports to memory-mapped addresses
- */
-static unsigned long microdev_isa_port2addr(unsigned long offset)
-{
-       unsigned long result;
-
-       if ((offset >= IO_LAN91C111_BASE) &&
-           (offset <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
-                       /*
-                        *      SMSC LAN91C111 Ethernet chip
-                        */
-               result = IO_LAN91C111_PHYS + offset - IO_LAN91C111_BASE;
-       } else if ((offset >= IO_SUPERIO_BASE) &&
-                  (offset <  IO_SUPERIO_BASE + IO_SUPERIO_EXTENT)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      Configuration Registers
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-#if 0
-       } else if (offset == KBD_DATA_REG || offset == KBD_CNTL_REG ||
-                  offset == KBD_STATUS_REG) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      PS/2 Keyboard + Mouse (ports 0x60 and 0x64).
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-#endif
-       } else if (((offset >= IO_IDE1_BASE) &&
-                   (offset <  IO_IDE1_BASE + IO_IDE_EXTENT)) ||
-                   (offset == IO_IDE1_MISC)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      IDE #1
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-       } else if (((offset >= IO_IDE2_BASE) &&
-                   (offset <  IO_IDE2_BASE + IO_IDE_EXTENT)) ||
-                   (offset == IO_IDE2_MISC)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      IDE #2
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-       } else if ((offset >= IO_SERIAL1_BASE) &&
-                  (offset <  IO_SERIAL1_BASE + IO_SERIAL_EXTENT)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      Serial #1
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-       } else if ((offset >= IO_SERIAL2_BASE) &&
-                  (offset <  IO_SERIAL2_BASE + IO_SERIAL_EXTENT)) {
-                       /*
-                        *      SMSC FDC37C93xAPM SuperIO chip
-                        *
-                        *      Serial #2
-                        */
-               result = IO_SUPERIO_PHYS + (offset << 1);
-       } else if ((offset >= IO_ISP1161_BASE) &&
-                  (offset < IO_ISP1161_BASE + IO_ISP1161_EXTENT)) {
-                       /*
-                        *      Philips USB ISP1161x chip
-                        */
-               result = IO_ISP1161_PHYS + offset - IO_ISP1161_BASE;
-       } else {
-                       /*
-                        *      safe default.
-                        */
-               printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
-                      __func__, offset);
-               result = PVR;
-       }
-
-       return result;
-}
-
-#define PORT2ADDR(x) (microdev_isa_port2addr(x))
-
-static inline void delay(void)
-{
-#if defined(CONFIG_PCI)
-       /* System board present, just make a dummy SRAM access.  (CS0 will be
-          mapped to PCI memory, probably good to avoid it.) */
-       ctrl_inw(0xa6800000);
-#else
-       /* CS0 will be mapped to flash, ROM etc so safe to access it. */
-       ctrl_inw(0xa0000000);
-#endif
-}
-
-unsigned char microdev_inb(unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO)
-               return microdev_pci_inb(port);
-#endif
-       return *(volatile unsigned char*)PORT2ADDR(port);
-}
-
-unsigned short microdev_inw(unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO)
-               return microdev_pci_inw(port);
-#endif
-       return *(volatile unsigned short*)PORT2ADDR(port);
-}
-
-unsigned int microdev_inl(unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO)
-               return microdev_pci_inl(port);
-#endif
-       return *(volatile unsigned int*)PORT2ADDR(port);
-}
-
-void microdev_outw(unsigned short b, unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO) {
-               microdev_pci_outw(b, port);
-               return;
-       }
-#endif
-       *(volatile unsigned short*)PORT2ADDR(port) = b;
-}
-
-void microdev_outb(unsigned char b, unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO) {
-               microdev_pci_outb(b, port);
-               return;
-       }
-#endif
-
-       /*
-        *      There is a board feature with the current SH4-202 MicroDev in
-        *      that the 2 byte enables (nBE0 and nBE1) are tied together (and
-        *      to the Chip Select Line (Ethernet_CS)). Due to this connectivity,
-        *      it is not possible to safely perform 8-bit writes to the
-        *      Ethernet registers, as 16-bits will be consumed from the Data
-        *      lines (corrupting the other byte).  Hence, this function is
-        *      written to implement 16-bit read/modify/write for all byte-wide
-        *      accesses.
-        *
-        *      Note: there is no problem with byte READS (even or odd).
-        *
-        *                      Sean McGoogan - 16th June 2003.
-        */
-       if ((port >= IO_LAN91C111_BASE) &&
-           (port <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
-                       /*
-                        * Then are trying to perform a byte-write to the
-                        * LAN91C111.  This needs special care.
-                        */
-               if (port % 2 == 1) {    /* is the port odd ? */
-                       /* unset bit-0, i.e. make even */
-                       const unsigned long evenPort = port-1;
-                       unsigned short word;
-
-                       /*
-                        * do a 16-bit read/write to write to 'port',
-                        * preserving even byte.
-                        *
-                        *      Even addresses are bits 0-7
-                        *      Odd  addresses are bits 8-15
-                        */
-                       word = microdev_inw(evenPort);
-                       word = (word & 0xffu) | (b << 8);
-                       microdev_outw(word, evenPort);
-               } else {
-                       /* else, we are trying to do an even byte write */
-                       unsigned short word;
-
-                       /*
-                        * do a 16-bit read/write to write to 'port',
-                        * preserving odd byte.
-                        *
-                        *      Even addresses are bits 0-7
-                        *      Odd  addresses are bits 8-15
-                        */
-                       word = microdev_inw(port);
-                       word = (word & 0xff00u) | (b);
-                       microdev_outw(word, port);
-               }
-       } else {
-               *(volatile unsigned char*)PORT2ADDR(port) = b;
-       }
-}
-
-void microdev_outl(unsigned int b, unsigned long port)
-{
-#ifdef CONFIG_PCI
-       if (port >= PCIBIOS_MIN_IO) {
-               microdev_pci_outl(b, port);
-               return;
-       }
-#endif
-       *(volatile unsigned int*)PORT2ADDR(port) = b;
-}
-
-unsigned char microdev_inb_p(unsigned long port)
-{
-       unsigned char v = microdev_inb(port);
-       delay();
-       return v;
-}
-
-unsigned short microdev_inw_p(unsigned long port)
-{
-       unsigned short v = microdev_inw(port);
-       delay();
-       return v;
-}
-
-unsigned int microdev_inl_p(unsigned long port)
-{
-       unsigned int v = microdev_inl(port);
-       delay();
-       return v;
-}
-
-void microdev_outb_p(unsigned char b, unsigned long port)
-{
-       microdev_outb(b, port);
-       delay();
-}
-
-void microdev_outw_p(unsigned short b, unsigned long port)
-{
-       microdev_outw(b, port);
-       delay();
-}
-
-void microdev_outl_p(unsigned int b, unsigned long port)
-{
-       microdev_outl(b, port);
-       delay();
-}
-
-void microdev_insb(unsigned long port, void *buffer, unsigned long count)
-{
-       volatile unsigned char *port_addr;
-       unsigned char *buf = buffer;
-
-       port_addr = (volatile unsigned char *)PORT2ADDR(port);
-
-       while (count--)
-               *buf++ = *port_addr;
-}
-
-void microdev_insw(unsigned long port, void *buffer, unsigned long count)
-{
-       volatile unsigned short *port_addr;
-       unsigned short *buf = buffer;
-
-       port_addr = (volatile unsigned short *)PORT2ADDR(port);
-
-       while (count--)
-               *buf++ = *port_addr;
-}
-
-void microdev_insl(unsigned long port, void *buffer, unsigned long count)
-{
-       volatile unsigned long *port_addr;
-       unsigned int *buf = buffer;
-
-       port_addr = (volatile unsigned long *)PORT2ADDR(port);
-
-       while (count--)
-               *buf++ = *port_addr;
-}
-
-void microdev_outsb(unsigned long port, const void *buffer, unsigned long count)
-{
-       volatile unsigned char *port_addr;
-       const unsigned char *buf = buffer;
-
-       port_addr = (volatile unsigned char *)PORT2ADDR(port);
-
-       while (count--)
-               *port_addr = *buf++;
-}
-
-void microdev_outsw(unsigned long port, const void *buffer, unsigned long count)
-{
-       volatile unsigned short *port_addr;
-       const unsigned short *buf = buffer;
-
-       port_addr = (volatile unsigned short *)PORT2ADDR(port);
-
-       while (count--)
-               *port_addr = *buf++;
-}
-
-void microdev_outsl(unsigned long port, const void *buffer, unsigned long count)
-{
-       volatile unsigned long *port_addr;
-       const unsigned int *buf = buffer;
-
-       port_addr = (volatile unsigned long *)PORT2ADDR(port);
-
-       while (count--)
-               *port_addr = *buf++;
-}
diff --git a/arch/sh/boards/superh/microdev/irq.c b/arch/sh/boards/superh/microdev/irq.c
deleted file mode 100644 (file)
index 4d33507..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * arch/sh/boards/superh/microdev/irq.c
- *
- * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
- *
- * SuperH SH4-202 MicroDev board support.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/system.h>
-#include <asm/io.h>
-#include <asm/microdev.h>
-
-#define NUM_EXTERNAL_IRQS 16   /* IRL0 .. IRL15 */
-
-static const struct {
-       unsigned char fpgaIrq;
-       unsigned char mapped;
-       const char *name;
-} fpgaIrqTable[NUM_EXTERNAL_IRQS] = {
-       { 0,                            0,      "unused"   },           /* IRQ #0       IRL=15  0x200  */
-       { MICRODEV_FPGA_IRQ_KEYBOARD,   1,      "keyboard" },           /* IRQ #1       IRL=14  0x220  */
-       { MICRODEV_FPGA_IRQ_SERIAL1,    1,      "Serial #1"},           /* IRQ #2       IRL=13  0x240  */
-       { MICRODEV_FPGA_IRQ_ETHERNET,   1,      "Ethernet" },           /* IRQ #3       IRL=12  0x260  */
-       { MICRODEV_FPGA_IRQ_SERIAL2,    0,      "Serial #2"},           /* IRQ #4       IRL=11  0x280  */
-       { 0,                            0,      "unused"   },           /* IRQ #5       IRL=10  0x2a0  */
-       { 0,                            0,      "unused"   },           /* IRQ #6       IRL=9   0x2c0  */
-       { MICRODEV_FPGA_IRQ_USB_HC,     1,      "USB"      },           /* IRQ #7       IRL=8   0x2e0  */
-       { MICRODEV_IRQ_PCI_INTA,        1,      "PCI INTA" },           /* IRQ #8       IRL=7   0x300  */
-       { MICRODEV_IRQ_PCI_INTB,        1,      "PCI INTB" },           /* IRQ #9       IRL=6   0x320  */
-       { MICRODEV_IRQ_PCI_INTC,        1,      "PCI INTC" },           /* IRQ #10      IRL=5   0x340  */
-       { MICRODEV_IRQ_PCI_INTD,        1,      "PCI INTD" },           /* IRQ #11      IRL=4   0x360  */
-       { MICRODEV_FPGA_IRQ_MOUSE,      1,      "mouse"    },           /* IRQ #12      IRL=3   0x380  */
-       { MICRODEV_FPGA_IRQ_IDE2,       1,      "IDE #2"   },           /* IRQ #13      IRL=2   0x3a0  */
-       { MICRODEV_FPGA_IRQ_IDE1,       1,      "IDE #1"   },           /* IRQ #14      IRL=1   0x3c0  */
-       { 0,                            0,      "unused"   },           /* IRQ #15      IRL=0   0x3e0  */
-};
-
-#if (MICRODEV_LINUX_IRQ_KEYBOARD != 1)
-#  error Inconsistancy in defining the IRQ# for Keyboard!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_ETHERNET != 3)
-#  error Inconsistancy in defining the IRQ# for Ethernet!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_USB_HC != 7)
-#  error Inconsistancy in defining the IRQ# for USB!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_MOUSE != 12)
-#  error Inconsistancy in defining the IRQ# for PS/2 Mouse!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_IDE2 != 13)
-#  error Inconsistancy in defining the IRQ# for secondary IDE!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_IDE1 != 14)
-#  error Inconsistancy in defining the IRQ# for primary IDE!
-#endif
-
-static void enable_microdev_irq(unsigned int irq);
-static void disable_microdev_irq(unsigned int irq);
-
-       /* shutdown is same as "disable" */
-#define shutdown_microdev_irq disable_microdev_irq
-
-static void mask_and_ack_microdev(unsigned int);
-static void end_microdev_irq(unsigned int irq);
-
-static unsigned int startup_microdev_irq(unsigned int irq)
-{
-       enable_microdev_irq(irq);
-       return 0;               /* never anything pending */
-}
-
-static struct hw_interrupt_type microdev_irq_type = {
-       .typename = "MicroDev-IRQ",
-       .startup = startup_microdev_irq,
-       .shutdown = shutdown_microdev_irq,
-       .enable = enable_microdev_irq,
-       .disable = disable_microdev_irq,
-       .ack = mask_and_ack_microdev,
-       .end = end_microdev_irq
-};
-
-static void disable_microdev_irq(unsigned int irq)
-{
-       unsigned int fpgaIrq;
-
-       if (irq >= NUM_EXTERNAL_IRQS)
-               return;
-       if (!fpgaIrqTable[irq].mapped)
-               return;
-
-       fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
-
-       /* disable interrupts on the FPGA INTC register */
-       ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG);
-}
-
-static void enable_microdev_irq(unsigned int irq)
-{
-       unsigned long priorityReg, priorities, pri;
-       unsigned int fpgaIrq;
-
-       if (unlikely(irq >= NUM_EXTERNAL_IRQS))
-               return;
-       if (unlikely(!fpgaIrqTable[irq].mapped))
-               return;
-
-       pri = 15 - irq;
-
-       fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
-       priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq);
-
-       /* set priority for the interrupt */
-       priorities = ctrl_inl(priorityReg);
-       priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq);
-       priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri);
-       ctrl_outl(priorities, priorityReg);
-
-       /* enable interrupts on the FPGA INTC register */
-       ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG);
-}
-
-       /* This functions sets the desired irq handler to be a MicroDev type */
-static void __init make_microdev_irq(unsigned int irq)
-{
-       disable_irq_nosync(irq);
-       irq_desc[irq].chip = &microdev_irq_type;
-       disable_microdev_irq(irq);
-}
-
-static void mask_and_ack_microdev(unsigned int irq)
-{
-       disable_microdev_irq(irq);
-}
-
-static void end_microdev_irq(unsigned int irq)
-{
-       if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-               enable_microdev_irq(irq);
-}
-
-extern void __init init_microdev_irq(void)
-{
-       int i;
-
-               /* disable interrupts on the FPGA INTC register */
-       ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG);
-
-       for (i = 0; i < NUM_EXTERNAL_IRQS; i++)
-               make_microdev_irq(i);
-}
-
-extern void microdev_print_fpga_intc_status(void)
-{
-       volatile unsigned int * const intenb = (unsigned int*)MICRODEV_FPGA_INTENB_REG;
-       volatile unsigned int * const intdsb = (unsigned int*)MICRODEV_FPGA_INTDSB_REG;
-       volatile unsigned int * const intpria = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(0);
-       volatile unsigned int * const intprib = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(8);
-       volatile unsigned int * const intpric = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(16);
-       volatile unsigned int * const intprid = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(24);
-       volatile unsigned int * const intsrc = (unsigned int*)MICRODEV_FPGA_INTSRC_REG;
-       volatile unsigned int * const intreq = (unsigned int*)MICRODEV_FPGA_INTREQ_REG;
-
-       printk("-------------------------- microdev_print_fpga_intc_status() ------------------\n");
-       printk("FPGA_INTENB = 0x%08x\n", *intenb);
-       printk("FPGA_INTDSB = 0x%08x\n", *intdsb);
-       printk("FPGA_INTSRC = 0x%08x\n", *intsrc);
-       printk("FPGA_INTREQ = 0x%08x\n", *intreq);
-       printk("FPGA_INTPRI[3..0] = %08x:%08x:%08x:%08x\n", *intprid, *intpric, *intprib, *intpria);
-       printk("-------------------------------------------------------------------------------\n");
-}
-
-
diff --git a/arch/sh/boards/superh/microdev/led.c b/arch/sh/boards/superh/microdev/led.c
deleted file mode 100644 (file)
index 36e54b4..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * linux/arch/sh/boards/superh/microdev/led.c
- *
- * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
- * Copyright (C) 2003 Richard Curnow (Richard.Curnow@superh.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- */
-
-#include <asm/io.h>
-
-#define LED_REGISTER 0xa6104d20
-
-static void mach_led_d9(int value)
-{
-       unsigned long reg;
-       reg = ctrl_inl(LED_REGISTER);
-       reg &= ~1;
-       reg |= (value & 1);
-       ctrl_outl(reg, LED_REGISTER);
-       return;
-}
-
-static void mach_led_d10(int value)
-{
-       unsigned long reg;
-       reg = ctrl_inl(LED_REGISTER);
-       reg &= ~2;
-       reg |= ((value & 1) << 1);
-       ctrl_outl(reg, LED_REGISTER);
-       return;
-}
-
-
-#ifdef CONFIG_HEARTBEAT
-#include <linux/sched.h>
-
-static unsigned char banner_table[] = {
-       0x11, 0x01, 0x11, 0x01, 0x11, 0x03,
-       0x11, 0x01, 0x11, 0x01, 0x13, 0x03,
-       0x11, 0x01, 0x13, 0x01, 0x13, 0x01, 0x11, 0x03,
-       0x11, 0x03,
-       0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
-       0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x07,
-       0x13, 0x01, 0x13, 0x03,
-       0x11, 0x01, 0x11, 0x03,
-       0x13, 0x01, 0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
-       0x11, 0x01, 0x13, 0x01, 0x11, 0x03,
-       0x13, 0x01, 0x13, 0x01, 0x13, 0x03,
-       0x13, 0x01, 0x11, 0x01, 0x11, 0x03,
-       0x11, 0x03,
-       0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x13, 0x07,
-       0xff
-};
-
-static void banner(void)
-{
-       static int pos = 0;
-       static int count = 0;
-
-       if (count) {
-               count--;
-       } else {
-               int val = banner_table[pos];
-               if (val == 0xff) {
-                       pos = 0;
-                       val = banner_table[pos];
-               }
-               pos++;
-               mach_led_d10((val >> 4) & 1);
-               count = 10 * (val & 0xf);
-       }
-}
-
-/* From heartbeat_harp in the stboards directory */
-/* acts like an actual heart beat -- ie thump-thump-pause... */
-void microdev_heartbeat(void)
-{
-       static unsigned cnt = 0, period = 0, dist = 0;
-
-       if (cnt == 0 || cnt == dist)
-               mach_led_d9(1);
-       else if (cnt == 7 || cnt == dist+7)
-               mach_led_d9(0);
-
-       if (++cnt > period) {
-               cnt = 0;
-               /* The hyperbolic function below modifies the heartbeat period
-                * length in dependency of the current (5min) load. It goes
-                * through the points f(0)=126, f(1)=86, f(5)=51,
-                * f(inf)->30. */
-               period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
-               dist = period / 4;
-       }
-
-       banner();
-}
-
-#endif
diff --git a/arch/sh/boards/superh/microdev/setup.c b/arch/sh/boards/superh/microdev/setup.c
deleted file mode 100644 (file)
index fc8cd06..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * arch/sh/boards/superh/microdev/setup.c
- *
- * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
- * Copyright (C) 2003, 2004 SuperH, Inc.
- * Copyright (C) 2004, 2005 Paul Mundt
- *
- * SuperH SH4-202 MicroDev board support.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ioport.h>
-#include <video/s1d13xxxfb.h>
-#include <asm/microdev.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-
-extern void microdev_heartbeat(void);
-
-
-/****************************************************************************/
-
-
-       /*
-        * Setup for the SMSC FDC37C93xAPM
-        */
-#define SMSC_CONFIG_PORT_ADDR   (0x3F0)
-#define SMSC_INDEX_PORT_ADDR    SMSC_CONFIG_PORT_ADDR
-#define SMSC_DATA_PORT_ADDR     (SMSC_INDEX_PORT_ADDR + 1)
-
-#define SMSC_ENTER_CONFIG_KEY   0x55
-#define SMSC_EXIT_CONFIG_KEY    0xaa
-
-#define SMCS_LOGICAL_DEV_INDEX          0x07   /* Logical Device Number */
-#define SMSC_DEVICE_ID_INDEX    0x20   /* Device ID */
-#define SMSC_DEVICE_REV_INDEX   0x21   /* Device Revision */
-#define SMSC_ACTIVATE_INDEX     0x30   /* Activate */
-#define SMSC_PRIMARY_BASE_INDEX         0x60   /* Primary Base Address */
-#define SMSC_SECONDARY_BASE_INDEX 0x62 /* Secondary Base Address */
-#define SMSC_PRIMARY_INT_INDEX  0x70   /* Primary Interrupt Select */
-#define SMSC_SECONDARY_INT_INDEX 0x72  /* Secondary Interrupt Select */
-#define SMSC_HDCS0_INDEX        0xf0   /* HDCS0 Address Decoder */
-#define SMSC_HDCS1_INDEX        0xf1   /* HDCS1 Address Decoder */
-
-#define SMSC_IDE1_DEVICE       1       /* IDE #1 logical device */
-#define SMSC_IDE2_DEVICE       2       /* IDE #2 logical device */
-#define SMSC_PARALLEL_DEVICE   3       /* Parallel Port logical device */
-#define SMSC_SERIAL1_DEVICE    4       /* Serial #1 logical device */
-#define SMSC_SERIAL2_DEVICE    5       /* Serial #2 logical device */
-#define SMSC_KEYBOARD_DEVICE   7       /* Keyboard logical device */
-#define SMSC_CONFIG_REGISTERS  8       /* Configuration Registers (Aux I/O) */
-
-#define SMSC_READ_INDEXED(index) ({ \
-       outb((index), SMSC_INDEX_PORT_ADDR); \
-       inb(SMSC_DATA_PORT_ADDR); })
-#define SMSC_WRITE_INDEXED(val, index) ({ \
-       outb((index), SMSC_INDEX_PORT_ADDR); \
-       outb((val),   SMSC_DATA_PORT_ADDR); })
-
-#define        IDE1_PRIMARY_BASE       0x01f0  /* Task File Registe base for IDE #1 */
-#define        IDE1_SECONDARY_BASE     0x03f6  /* Miscellaneous AT registers for IDE #1 */
-#define        IDE2_PRIMARY_BASE       0x0170  /* Task File Registe base for IDE #2 */
-#define        IDE2_SECONDARY_BASE     0x0376  /* Miscellaneous AT registers for IDE #2 */
-
-#define SERIAL1_PRIMARY_BASE   0x03f8
-#define SERIAL2_PRIMARY_BASE   0x02f8
-
-#define        MSB(x)          ( (x) >> 8 )
-#define        LSB(x)          ( (x) & 0xff )
-
-       /* General-Purpose base address on CPU-board FPGA */
-#define        MICRODEV_FPGA_GP_BASE           0xa6100000ul
-
-       /* assume a Keyboard Controller is present */
-int microdev_kbd_controller_present = 1;
-
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .start          = 0x300,
-               .end            = 0x300 + 0x0001000 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = MICRODEV_LINUX_IRQ_ETHERNET,
-               .end            = MICRODEV_LINUX_IRQ_ETHERNET,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device smc91x_device = {
-       .name           = "smc91x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc91x_resources),
-       .resource       = smc91x_resources,
-};
-
-#ifdef CONFIG_FB_S1D13XXX
-static struct s1d13xxxfb_regval s1d13806_initregs[] = {
-       { S1DREG_MISC,                  0x00 },
-       { S1DREG_COM_DISP_MODE,         0x00 },
-       { S1DREG_GPIO_CNF0,             0x00 },
-       { S1DREG_GPIO_CNF1,             0x00 },
-       { S1DREG_GPIO_CTL0,             0x00 },
-       { S1DREG_GPIO_CTL1,             0x00 },
-       { S1DREG_CLK_CNF,               0x02 },
-       { S1DREG_LCD_CLK_CNF,           0x01 },
-       { S1DREG_CRT_CLK_CNF,           0x03 },
-       { S1DREG_MPLUG_CLK_CNF,         0x03 },
-       { S1DREG_CPU2MEM_WST_SEL,       0x02 },
-       { S1DREG_SDRAM_REF_RATE,        0x03 },
-       { S1DREG_SDRAM_TC0,             0x00 },
-       { S1DREG_SDRAM_TC1,             0x01 },
-       { S1DREG_MEM_CNF,               0x80 },
-       { S1DREG_PANEL_TYPE,            0x25 },
-       { S1DREG_MOD_RATE,              0x00 },
-       { S1DREG_LCD_DISP_HWIDTH,       0x63 },
-       { S1DREG_LCD_NDISP_HPER,        0x1e },
-       { S1DREG_TFT_FPLINE_START,      0x06 },
-       { S1DREG_TFT_FPLINE_PWIDTH,     0x03 },
-       { S1DREG_LCD_DISP_VHEIGHT0,     0x57 },
-       { S1DREG_LCD_DISP_VHEIGHT1,     0x02 },
-       { S1DREG_LCD_NDISP_VPER,        0x00 },
-       { S1DREG_TFT_FPFRAME_START,     0x0a },
-       { S1DREG_TFT_FPFRAME_PWIDTH,    0x81 },
-       { S1DREG_LCD_DISP_MODE,         0x03 },
-       { S1DREG_LCD_MISC,              0x00 },
-       { S1DREG_LCD_DISP_START0,       0x00 },
-       { S1DREG_LCD_DISP_START1,       0x00 },
-       { S1DREG_LCD_DISP_START2,       0x00 },
-       { S1DREG_LCD_MEM_OFF0,          0x90 },
-       { S1DREG_LCD_MEM_OFF1,          0x01 },
-       { S1DREG_LCD_PIX_PAN,           0x00 },
-       { S1DREG_LCD_DISP_FIFO_HTC,     0x00 },
-       { S1DREG_LCD_DISP_FIFO_LTC,     0x00 },
-       { S1DREG_CRT_DISP_HWIDTH,       0x63 },
-       { S1DREG_CRT_NDISP_HPER,        0x1f },
-       { S1DREG_CRT_HRTC_START,        0x04 },
-       { S1DREG_CRT_HRTC_PWIDTH,       0x8f },
-       { S1DREG_CRT_DISP_VHEIGHT0,     0x57 },
-       { S1DREG_CRT_DISP_VHEIGHT1,     0x02 },
-       { S1DREG_CRT_NDISP_VPER,        0x1b },
-       { S1DREG_CRT_VRTC_START,        0x00 },
-       { S1DREG_CRT_VRTC_PWIDTH,       0x83 },
-       { S1DREG_TV_OUT_CTL,            0x10 },
-       { S1DREG_CRT_DISP_MODE,         0x05 },
-       { S1DREG_CRT_DISP_START0,       0x00 },
-       { S1DREG_CRT_DISP_START1,       0x00 },
-       { S1DREG_CRT_DISP_START2,       0x00 },
-       { S1DREG_CRT_MEM_OFF0,          0x20 },
-       { S1DREG_CRT_MEM_OFF1,          0x03 },
-       { S1DREG_CRT_PIX_PAN,           0x00 },
-       { S1DREG_CRT_DISP_FIFO_HTC,     0x00 },
-       { S1DREG_CRT_DISP_FIFO_LTC,     0x00 },
-       { S1DREG_LCD_CUR_CTL,           0x00 },
-       { S1DREG_LCD_CUR_START,         0x01 },
-       { S1DREG_LCD_CUR_XPOS0,         0x00 },
-       { S1DREG_LCD_CUR_XPOS1,         0x00 },
-       { S1DREG_LCD_CUR_YPOS0,         0x00 },
-       { S1DREG_LCD_CUR_YPOS1,         0x00 },
-       { S1DREG_LCD_CUR_BCTL0,         0x00 },
-       { S1DREG_LCD_CUR_GCTL0,         0x00 },
-       { S1DREG_LCD_CUR_RCTL0,         0x00 },
-       { S1DREG_LCD_CUR_BCTL1,         0x1f },
-       { S1DREG_LCD_CUR_GCTL1,         0x3f },
-       { S1DREG_LCD_CUR_RCTL1,         0x1f },
-       { S1DREG_LCD_CUR_FIFO_HTC,      0x00 },
-       { S1DREG_CRT_CUR_CTL,           0x00 },
-       { S1DREG_CRT_CUR_START,         0x01 },
-       { S1DREG_CRT_CUR_XPOS0,         0x00 },
-       { S1DREG_CRT_CUR_XPOS1,         0x00 },
-       { S1DREG_CRT_CUR_YPOS0,         0x00 },
-       { S1DREG_CRT_CUR_YPOS1,         0x00 },
-       { S1DREG_CRT_CUR_BCTL0,         0x00 },
-       { S1DREG_CRT_CUR_GCTL0,         0x00 },
-       { S1DREG_CRT_CUR_RCTL0,         0x00 },
-       { S1DREG_CRT_CUR_BCTL1,         0x1f },
-       { S1DREG_CRT_CUR_GCTL1,         0x3f },
-       { S1DREG_CRT_CUR_RCTL1,         0x1f },
-       { S1DREG_CRT_CUR_FIFO_HTC,      0x00 },
-       { S1DREG_BBLT_CTL0,             0x00 },
-       { S1DREG_BBLT_CTL1,             0x00 },
-       { S1DREG_BBLT_CC_EXP,           0x00 },
-       { S1DREG_BBLT_OP,               0x00 },
-       { S1DREG_BBLT_SRC_START0,       0x00 },
-       { S1DREG_BBLT_SRC_START1,       0x00 },
-       { S1DREG_BBLT_SRC_START2,       0x00 },
-       { S1DREG_BBLT_DST_START0,       0x00 },
-       { S1DREG_BBLT_DST_START1,       0x00 },
-       { S1DREG_BBLT_DST_START2,       0x00 },
-       { S1DREG_BBLT_MEM_OFF0,         0x00 },
-       { S1DREG_BBLT_MEM_OFF1,         0x00 },
-       { S1DREG_BBLT_WIDTH0,           0x00 },
-       { S1DREG_BBLT_WIDTH1,           0x00 },
-       { S1DREG_BBLT_HEIGHT0,          0x00 },
-       { S1DREG_BBLT_HEIGHT1,          0x00 },
-       { S1DREG_BBLT_BGC0,             0x00 },
-       { S1DREG_BBLT_BGC1,             0x00 },
-       { S1DREG_BBLT_FGC0,             0x00 },
-       { S1DREG_BBLT_FGC1,             0x00 },
-       { S1DREG_LKUP_MODE,             0x00 },
-       { S1DREG_LKUP_ADDR,             0x00 },
-       { S1DREG_PS_CNF,                0x10 },
-       { S1DREG_PS_STATUS,             0x00 },
-       { S1DREG_CPU2MEM_WDOGT,         0x00 },
-       { S1DREG_COM_DISP_MODE,         0x02 },
-};
-
-static struct s1d13xxxfb_pdata s1d13806_platform_data = {
-       .initregs       = s1d13806_initregs,
-       .initregssize   = ARRAY_SIZE(s1d13806_initregs),
-};
-
-static struct resource s1d13806_resources[] = {
-       [0] = {
-               .start          = 0x07200000,
-               .end            = 0x07200000 + 0x00200000 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = 0x07000000,
-               .end            = 0x07000000 + 0x00200000 - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device s1d13806_device = {
-       .name           = "s1d13806fb",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(s1d13806_resources),
-       .resource       = s1d13806_resources,
-
-       .dev = {
-               .platform_data  = &s1d13806_platform_data,
-       },
-};
-#endif
-
-static struct platform_device *microdev_devices[] __initdata = {
-       &smc91x_device,
-#ifdef CONFIG_FB_S1D13XXX
-       &s1d13806_device,
-#endif
-};
-
-static int __init microdev_devices_setup(void)
-{
-       return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices));
-}
-
-/*
- * Setup for the SMSC FDC37C93xAPM
- */
-static int __init smsc_superio_setup(void)
-{
-
-       unsigned char devid, devrev;
-
-               /* Initially the chip is in run state */
-               /* Put it into configuration state */
-       outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
-               /* Read device ID info */
-       devid  = SMSC_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
-       devrev = SMSC_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
-       if ( (devid==0x30) && (devrev==0x01) )
-       {
-               printk("SMSC FDC37C93xAPM SuperIO device detected\n");
-       }
-       else
-       {               /* not the device identity we expected */
-               printk("Not detected a SMSC FDC37C93xAPM SuperIO device (devid=0x%02x, rev=0x%02x)\n",
-                       devid, devrev);
-                       /* inform the keyboard driver that we have no keyboard controller */
-               microdev_kbd_controller_present = 0;
-                       /* little point in doing anything else in this functon */
-               return 0;
-       }
-
-               /* Select the keyboard device */
-       SMSC_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* enable the interrupts */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_KEYBOARD, SMSC_PRIMARY_INT_INDEX);
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_MOUSE, SMSC_SECONDARY_INT_INDEX);
-
-               /* Select the Serial #1 device */
-       SMSC_WRITE_INDEXED(SMSC_SERIAL1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* program with port addresses */
-       SMSC_WRITE_INDEXED(MSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
-               /* enable the interrupts */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL1, SMSC_PRIMARY_INT_INDEX);
-
-               /* Select the Serial #2 device */
-       SMSC_WRITE_INDEXED(SMSC_SERIAL2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* program with port addresses */
-       SMSC_WRITE_INDEXED(MSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
-               /* enable the interrupts */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL2, SMSC_PRIMARY_INT_INDEX);
-
-               /* Select the IDE#1 device */
-       SMSC_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* program with port addresses */
-       SMSC_WRITE_INDEXED(MSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(MSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(0x0c, SMSC_HDCS0_INDEX);
-       SMSC_WRITE_INDEXED(0x00, SMSC_HDCS1_INDEX);
-               /* select the interrupt */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE1, SMSC_PRIMARY_INT_INDEX);
-
-               /* Select the IDE#2 device */
-       SMSC_WRITE_INDEXED(SMSC_IDE2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
-               /* enable it */
-       SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
-               /* program with port addresses */
-       SMSC_WRITE_INDEXED(MSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
-       SMSC_WRITE_INDEXED(MSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
-       SMSC_WRITE_INDEXED(LSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
-               /* select the interrupt */
-       SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE2, SMSC_PRIMARY_INT_INDEX);
-
-               /* Select the configuration registers */
-       SMSC_WRITE_INDEXED(SMSC_CONFIG_REGISTERS, SMCS_LOGICAL_DEV_INDEX);
-               /* enable the appropriate GPIO pins for IDE functionality:
-                * bit[0]   In/Out              1==input;  0==output
-                * bit[1]   Polarity            1==invert; 0==no invert
-                * bit[2]   Int Enb #1          1==Enable Combined IRQ #1; 0==disable
-                * bit[3:4] Function Select     00==original; 01==Alternate Function #1
-                */
-       SMSC_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
-       SMSC_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
-       SMSC_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
-       SMSC_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
-       SMSC_WRITE_INDEXED(0x08, 0xe8); /* GP20 = nIDE2_OE */
-
-               /* Exit the configuration state */
-       outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
-       return 0;
-}
-
-static void __init microdev_setup(char **cmdline_p)
-{
-       int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul);
-       const int fpgaRevision = *fpgaRevisionRegister;
-       int * const CacheControlRegister = (int*)CCR;
-
-       device_initcall(microdev_devices_setup);
-       device_initcall(smsc_superio_setup);
-
-       printk("SuperH %s board (FPGA rev: 0x%0x, CCR: 0x%0x)\n",
-               get_system_type(), fpgaRevision, *CacheControlRegister);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_sh4202_microdev __initmv = {
-       .mv_name                = "SH4-202 MicroDev",
-       .mv_setup               = microdev_setup,
-       .mv_nr_irqs             = 72,           /* QQQ need to check this - use the MACRO */
-
-       .mv_inb                 = microdev_inb,
-       .mv_inw                 = microdev_inw,
-       .mv_inl                 = microdev_inl,
-       .mv_outb                = microdev_outb,
-       .mv_outw                = microdev_outw,
-       .mv_outl                = microdev_outl,
-
-       .mv_inb_p               = microdev_inb_p,
-       .mv_inw_p               = microdev_inw_p,
-       .mv_inl_p               = microdev_inl_p,
-       .mv_outb_p              = microdev_outb_p,
-       .mv_outw_p              = microdev_outw_p,
-       .mv_outl_p              = microdev_outl_p,
-
-       .mv_insb                = microdev_insb,
-       .mv_insw                = microdev_insw,
-       .mv_insl                = microdev_insl,
-       .mv_outsb               = microdev_outsb,
-       .mv_outsw               = microdev_outsw,
-       .mv_outsl               = microdev_outsl,
-
-       .mv_init_irq            = init_microdev_irq,
-
-#ifdef CONFIG_HEARTBEAT
-       .mv_heartbeat           = microdev_heartbeat,
-#endif
-};
diff --git a/arch/sh/boards/titan/Makefile b/arch/sh/boards/titan/Makefile
deleted file mode 100644 (file)
index 08d7537..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the Nimble Microsystems TITAN specific parts of the kernel
-#
-
-obj-y   := setup.o io.o
diff --git a/arch/sh/boards/titan/io.c b/arch/sh/boards/titan/io.c
deleted file mode 100644 (file)
index 4730c1d..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *     I/O routines for Titan
- */
-#include <linux/pci.h>
-#include <asm/machvec.h>
-#include <asm/addrspace.h>
-#include <asm/titan.h>
-#include <asm/io.h>
-
-static inline unsigned int port2adr(unsigned int port)
-{
-        maybebadio((unsigned long)port);
-        return port;
-}
-
-u8 titan_inb(unsigned long port)
-{
-        if (PXSEG(port))
-                return ctrl_inb(port);
-        else if (is_pci_ioaddr(port))
-                return ctrl_inb(pci_ioaddr(port));
-        return ctrl_inw(port2adr(port)) & 0xff;
-}
-
-u8 titan_inb_p(unsigned long port)
-{
-        u8 v;
-
-        if (PXSEG(port))
-                v = ctrl_inb(port);
-        else if (is_pci_ioaddr(port))
-                v = ctrl_inb(pci_ioaddr(port));
-        else
-                v = ctrl_inw(port2adr(port)) & 0xff;
-        ctrl_delay();
-        return v;
-}
-
-u16 titan_inw(unsigned long port)
-{
-        if (PXSEG(port))
-                return ctrl_inw(port);
-        else if (is_pci_ioaddr(port))
-                return ctrl_inw(pci_ioaddr(port));
-        else if (port >= 0x2000)
-                return ctrl_inw(port2adr(port));
-        else
-                maybebadio(port);
-        return 0;
-}
-
-u32 titan_inl(unsigned long port)
-{
-        if (PXSEG(port))
-                return ctrl_inl(port);
-        else if (is_pci_ioaddr(port))
-                return ctrl_inl(pci_ioaddr(port));
-        else if (port >= 0x2000)
-                return ctrl_inw(port2adr(port));
-        else
-                maybebadio(port);
-        return 0;
-}
-
-void titan_outb(u8 value, unsigned long port)
-{
-        if (PXSEG(port))
-                ctrl_outb(value, port);
-        else if (is_pci_ioaddr(port))
-                ctrl_outb(value, pci_ioaddr(port));
-        else
-                ctrl_outw(value, port2adr(port));
-}
-
-void titan_outb_p(u8 value, unsigned long port)
-{
-        if (PXSEG(port))
-                ctrl_outb(value, port);
-        else if (is_pci_ioaddr(port))
-                ctrl_outb(value, pci_ioaddr(port));
-        else
-                ctrl_outw(value, port2adr(port));
-        ctrl_delay();
-}
-
-void titan_outw(u16 value, unsigned long port)
-{
-        if (PXSEG(port))
-                ctrl_outw(value, port);
-        else if (is_pci_ioaddr(port))
-                ctrl_outw(value, pci_ioaddr(port));
-        else if (port >= 0x2000)
-                ctrl_outw(value, port2adr(port));
-        else
-                maybebadio(port);
-}
-
-void titan_outl(u32 value, unsigned long port)
-{
-        if (PXSEG(port))
-                ctrl_outl(value, port);
-        else if (is_pci_ioaddr(port))
-                ctrl_outl(value, pci_ioaddr(port));
-        else
-                maybebadio(port);
-}
-
-void titan_insl(unsigned long port, void *dst, unsigned long count)
-{
-        maybebadio(port);
-}
-
-void titan_outsl(unsigned long port, const void *src, unsigned long count)
-{
-        maybebadio(port);
-}
-
-void __iomem *titan_ioport_map(unsigned long port, unsigned int size)
-{
-       if (PXSEG(port) || is_pci_memaddr(port))
-               return (void __iomem *)port;
-       else if (is_pci_ioaddr(port))
-               return (void __iomem *)pci_ioaddr(port);
-
-       return (void __iomem *)port2adr(port);
-}
diff --git a/arch/sh/boards/titan/setup.c b/arch/sh/boards/titan/setup.c
deleted file mode 100644 (file)
index 5de3b2a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * arch/sh/boards/titan/setup.c - Setup for Titan
- *
- *  Copyright (C) 2006  Jamie Lenehan
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/titan.h>
-#include <asm/io.h>
-
-static void __init init_titan_irq(void)
-{
-       /* enable individual interrupt mode for externals */
-       plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static struct sh_machine_vector mv_titan __initmv = {
-       .mv_name =      "Titan",
-
-       .mv_inb =       titan_inb,
-       .mv_inw =       titan_inw,
-       .mv_inl =       titan_inl,
-       .mv_outb =      titan_outb,
-       .mv_outw =      titan_outw,
-       .mv_outl =      titan_outl,
-
-       .mv_inb_p =     titan_inb_p,
-       .mv_inw_p =     titan_inw,
-       .mv_inl_p =     titan_inl,
-       .mv_outb_p =    titan_outb_p,
-       .mv_outw_p =    titan_outw,
-       .mv_outl_p =    titan_outl,
-
-       .mv_insl =      titan_insl,
-       .mv_outsl =     titan_outsl,
-
-       .mv_ioport_map = titan_ioport_map,
-
-       .mv_init_irq =  init_titan_irq,
-};