Commit 5b6b5498 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: (38 commits)
  sh: R7785RP board updates.
  sh: Update r7780rp defconfig.
  sh: Add die chain notifiers.
  sh: Fix APM emulation on hp6xx.
  sh: Wire up more IRQs for SH7709.
  sh: Solution Engine 7722 board support.
  sh: Fix r7780rp build.
  sh: kdump support.
  sh: Move clock reporting to its own proc entry.
  sh: Solution Engine SH7705 board and CPU updates.
  serial: sh-sci: Fix module clock refcount for serial console.
  serial: sh-sci: Fix module clock refcounting.
  sh: SH7722 clock framework support.
  sh: hp6xx pata_platform support.
  sh: Obey CONFIG_HZ for HZ definition.
  sh: Fix fstatat64() syscall.
  sh: se7780 PCI support.
  sh: SH7780 Solution Engine board support.
  sh: Add a dummy SH-4 PCIC fixup.
  sh: Tidy up L-BOX area5 addresses.
  ...
parents 35c74823 39374aad
Clock framework on SuperH architecture
The framework on SH extends existing API by the function clk_set_rate_ex,
which prototype is as follows:
clk_set_rate_ex (struct clk *clk, unsigned long rate, int algo_id)
The algo_id parameter is used to specify algorithm used to recalculate clocks,
adjanced to clock, specified as first argument. It is assumed that algo_id==0
means no changes to adjanced clock
Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method,
if it is present in ops structure. The method should set the clock rate and adjust
all needed clocks according to the passed algo_id.
Exact values for algo_id are machine-dependend. For the sh7722, the following
values are defined:
NO_CHANGE = 0,
IUS_N1_N1, /* I:U = N:1, U:Sh = N:1 */
IUS_322, /* I:U:Sh = 3:2:2 */
IUS_522, /* I:U:Sh = 5:2:2 */
IUS_N11, /* I:U:Sh = N:1:1 */
SB_N1, /* Sh:B = N:1 */
SB3_N1, /* Sh:B3 = N:1 */
SB3_32, /* Sh:B3 = 3:2 */
SB3_43, /* Sh:B3 = 4:3 */
SB3_54, /* Sh:B3 = 5:4 */
BP_N1, /* B:P = N:1 */
IP_N1 /* I:P = N:1 */
Each of these constants means relation between clocks that can be set via the FRQCR
register
Linux Magic System Request Key Hacks Linux Magic System Request Key Hacks
Documentation for sysrq.c Documentation for sysrq.c
Last update: 2007-JAN-06 Last update: 2007-MAR-14
* What is the magic SysRq key? * What is the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -75,7 +75,7 @@ On all - write a character to /proc/sysrq-trigger. e.g.: ...@@ -75,7 +75,7 @@ On all - write a character to /proc/sysrq-trigger. e.g.:
'f' - Will call oom_kill to kill a memory hog process. 'f' - Will call oom_kill to kill a memory hog process.
'g' - Used by kgdb on ppc platforms. 'g' - Used by kgdb on ppc and sh platforms.
'h' - Will display help (actually any other key than those listed 'h' - Will display help (actually any other key than those listed
above will display help. but 'h' is easy to remember :-) above will display help. but 'h' is easy to remember :-)
......
...@@ -22,6 +22,10 @@ config RWSEM_GENERIC_SPINLOCK ...@@ -22,6 +22,10 @@ config RWSEM_GENERIC_SPINLOCK
config RWSEM_XCHGADD_ALGORITHM config RWSEM_XCHGADD_ALGORITHM
bool bool
config GENERIC_BUG
def_bool y
depends on BUG
config GENERIC_FIND_NEXT_BIT config GENERIC_FIND_NEXT_BIT
bool bool
default y default y
...@@ -88,6 +92,14 @@ config SH_SOLUTION_ENGINE ...@@ -88,6 +92,14 @@ config SH_SOLUTION_ENGINE
Select SolutionEngine if configuring for a Hitachi SH7709 Select SolutionEngine if configuring for a Hitachi SH7709
or SH7750 evaluation board. or SH7750 evaluation board.
config SH_7722_SOLUTION_ENGINE
bool "SolutionEngine7722"
select SOLUTION_ENGINE
select CPU_SUBTYPE_SH7722
help
Select 7722 SolutionEngine if configuring for a Hitachi SH772
evaluation board.
config SH_7751_SOLUTION_ENGINE config SH_7751_SOLUTION_ENGINE
bool "SolutionEngine7751" bool "SolutionEngine7751"
select SOLUTION_ENGINE select SOLUTION_ENGINE
...@@ -95,6 +107,14 @@ config SH_7751_SOLUTION_ENGINE ...@@ -95,6 +107,14 @@ config SH_7751_SOLUTION_ENGINE
help help
Select 7751 SolutionEngine if configuring for a Hitachi SH7751 Select 7751 SolutionEngine if configuring for a Hitachi SH7751
evaluation board. evaluation board.
config SH_7780_SOLUTION_ENGINE
bool "SolutionEngine7780"
select SOLUTION_ENGINE
select CPU_SUBTYPE_SH7780
help
Select 7780 SolutionEngine if configuring for a Renesas SH7780
evaluation board.
config SH_7300_SOLUTION_ENGINE config SH_7300_SOLUTION_ENGINE
bool "SolutionEngine7300" bool "SolutionEngine7300"
...@@ -193,12 +213,8 @@ config SH_RTS7751R2D ...@@ -193,12 +213,8 @@ config SH_RTS7751R2D
Select RTS7751R2D if configuring for a Renesas Technology Select RTS7751R2D if configuring for a Renesas Technology
Sales SH-Graphics board. Sales SH-Graphics board.
config SH_R7780RP config SH_HIGHLANDER
bool "R7780RP-1" bool "Highlander"
select CPU_SUBTYPE_SH7780
help
Select R7780RP-1 if configuring for a Renesas Solutions
HIGHLANDER board.
config SH_EDOSK7705 config SH_EDOSK7705
bool "EDOSK7705" bool "EDOSK7705"
...@@ -243,6 +259,12 @@ config SH_7619_SOLUTION_ENGINE ...@@ -243,6 +259,12 @@ config SH_7619_SOLUTION_ENGINE
help help
Select 7619 SolutionEngine if configuring for a Hitachi SH7619 Select 7619 SolutionEngine if configuring for a Hitachi SH7619
evaluation board. evaluation board.
config SH_LBOX_RE2
bool "L-BOX RE2"
select CPU_SUBTYPE_SH7751R
help
Select L-BOX RE2 if configuring for the NTT COMWARE L-BOX RE2.
config SH_UNKNOWN config SH_UNKNOWN
bool "BareCPU" bool "BareCPU"
...@@ -258,6 +280,10 @@ config SH_UNKNOWN ...@@ -258,6 +280,10 @@ config SH_UNKNOWN
endchoice endchoice
source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
source "arch/sh/boards/renesas/r7780rp/Kconfig"
source "arch/sh/mm/Kconfig" source "arch/sh/mm/Kconfig"
config CF_ENABLER config CF_ENABLER
...@@ -366,6 +392,16 @@ config SH_STORE_QUEUES ...@@ -366,6 +392,16 @@ config SH_STORE_QUEUES
Selecting this option will enable an in-kernel API for manipulating Selecting this option will enable an in-kernel API for manipulating
the store queues integrated in the SH-4 processors. the store queues integrated in the SH-4 processors.
config SPECULATIVE_EXECUTION
bool "Speculative subroutine return"
depends on CPU_SUBTYPE_SH7780 && EXPERIMENTAL
help
This enables support for a speculative instruction fetch for
subroutine return. There are various pitfalls associated with
this, as outlined in the SH7780 hardware manual.
If unsure, say N.
config CPU_HAS_INTEVT config CPU_HAS_INTEVT
bool bool
...@@ -398,8 +434,9 @@ config CPU_HAS_PTEA ...@@ -398,8 +434,9 @@ config CPU_HAS_PTEA
endmenu endmenu
menu "Timer support" menu "Timer and clock configuration"
depends on !GENERIC_TIME
if !GENERIC_TIME
config SH_TMU config SH_TMU
bool "TMU timer support" bool "TMU timer support"
...@@ -422,17 +459,11 @@ config SH_MTU2 ...@@ -422,17 +459,11 @@ config SH_MTU2
help help
This enables the use of the MTU2 as the system timer. This enables the use of the MTU2 as the system timer.
endmenu endif
source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
source "arch/sh/boards/renesas/r7780rp/Kconfig"
config SH_TIMER_IRQ config SH_TIMER_IRQ
int int
default "28" if CPU_SUBTYPE_SH7780 default "28" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785
default "86" if CPU_SUBTYPE_SH7619 default "86" if CPU_SUBTYPE_SH7619
default "140" if CPU_SUBTYPE_SH7206 default "140" if CPU_SUBTYPE_SH7206
default "16" default "16"
...@@ -462,7 +493,8 @@ config SH_PCLK_FREQ ...@@ -462,7 +493,8 @@ config SH_PCLK_FREQ
default "33333333" if CPU_SUBTYPE_SH7300 || CPU_SUBTYPE_SH7770 || \ default "33333333" if CPU_SUBTYPE_SH7300 || CPU_SUBTYPE_SH7770 || \
CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \ CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \
CPU_SUBTYPE_SH7206 CPU_SUBTYPE_SH7206
default "50000000" if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7780 default "50000000" if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7780 || \
CPU_SUBTYPE_SH7785
default "60000000" if CPU_SUBTYPE_SH7751 default "60000000" if CPU_SUBTYPE_SH7751
default "66000000" if CPU_SUBTYPE_SH4_202 default "66000000" if CPU_SUBTYPE_SH4_202
help help
...@@ -477,6 +509,8 @@ config SH_CLK_MD ...@@ -477,6 +509,8 @@ config SH_CLK_MD
help help
MD2 - MD0 pin setting. MD2 - MD0 pin setting.
endmenu
menu "CPU Frequency scaling" menu "CPU Frequency scaling"
source "drivers/cpufreq/Kconfig" source "drivers/cpufreq/Kconfig"
...@@ -495,21 +529,6 @@ config SH_CPU_FREQ ...@@ -495,21 +529,6 @@ config SH_CPU_FREQ
endmenu endmenu
source "arch/sh/drivers/dma/Kconfig"
source "arch/sh/cchips/Kconfig"
config HEARTBEAT
bool "Heartbeat LED"
depends on SH_MPC1211 || SH_SH03 || \
SOLUTION_ENGINE || \
SH_RTS7751R2D || SH_SH4202_MICRODEV || SH_LANDISK || \
SH_R7780RP
help
Use the power-on LED on your machine as a load meter. The exact
behavior is platform-dependent, but normally the flash frequency is
a hyperbolic function of the 5-minute load average.
source "arch/sh/drivers/Kconfig" source "arch/sh/drivers/Kconfig"
endmenu endmenu
...@@ -540,6 +559,20 @@ config KEXEC ...@@ -540,6 +559,20 @@ config KEXEC
support. As of this writing the exact hardware interface is support. As of this writing the exact hardware interface is
strongly in flux, so no good recommendation can be made. strongly in flux, so no good recommendation can be made.
config CRASH_DUMP
bool "kernel crash dumps (EXPERIMENTAL)"
depends on EXPERIMENTAL
help
Generate crash dump after being started by kexec.
This should be normally only set in special crash dump kernels
which are loaded in the main kernel with kexec-tools into
a specially reserved region and then later executed after
a crash by kdump/kexec. The crash dump kernel must be compiled
to a memory address not used by the main kernel using
MEMORY_START.
For more details see Documentation/kdump/kdump.txt
config SMP config SMP
bool "Symmetric multi-processing support" bool "Symmetric multi-processing support"
---help--- ---help---
......
...@@ -33,6 +33,7 @@ config EARLY_SCIF_CONSOLE_PORT ...@@ -33,6 +33,7 @@ config EARLY_SCIF_CONSOLE_PORT
default "0xffe00000" if CPU_SUBTYPE_SH7780 default "0xffe00000" if CPU_SUBTYPE_SH7780
default "0xfffe9800" if CPU_SUBTYPE_SH7206 default "0xfffe9800" if CPU_SUBTYPE_SH7206
default "0xf8420000" if CPU_SUBTYPE_SH7619 default "0xf8420000" if CPU_SUBTYPE_SH7619
default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705
default "0xffe80000" if CPU_SH4 default "0xffe80000" if CPU_SH4
config EARLY_PRINTK config EARLY_PRINTK
...@@ -77,16 +78,17 @@ config 4KSTACKS ...@@ -77,16 +78,17 @@ config 4KSTACKS
on the VM subsystem for higher order allocations. This option on the VM subsystem for higher order allocations. This option
will also use IRQ stacks to compensate for the reduced stackspace. will also use IRQ stacks to compensate for the reduced stackspace.
config KGDB config SH_KGDB
bool "Include KGDB kernel debugger" bool "Include KGDB kernel debugger"
select FRAME_POINTER select FRAME_POINTER
select DEBUG_INFO
help help
Include in-kernel hooks for kgdb, the Linux kernel source level Include in-kernel hooks for kgdb, the Linux kernel source level
debugger. See <http://kgdb.sourceforge.net/> for more information. debugger. See <http://kgdb.sourceforge.net/> for more information.
Unless you are intending to debug the kernel, say N here. Unless you are intending to debug the kernel, say N here.
menu "KGDB configuration options" menu "KGDB configuration options"
depends on KGDB depends on SH_KGDB
config MORE_COMPILE_OPTIONS config MORE_COMPILE_OPTIONS
bool "Add any additional compile options" bool "Add any additional compile options"
...@@ -103,22 +105,16 @@ config KGDB_NMI ...@@ -103,22 +105,16 @@ config KGDB_NMI
bool "Enter KGDB on NMI" bool "Enter KGDB on NMI"
default n default n
config KGDB_THREAD
bool "Include KGDB thread support"
default y
config SH_KGDB_CONSOLE config SH_KGDB_CONSOLE
bool "Console messages through GDB" bool "Console messages through GDB"
depends on !SERIAL_SH_SCI_CONSOLE
select SERIAL_CORE_CONSOLE
default n default n
config KGDB_SYSRQ config KGDB_SYSRQ
bool "Allow SysRq 'G' to enter KGDB" bool "Allow SysRq 'G' to enter KGDB"
default y default y
config KGDB_KERNEL_ASSERTS
bool "Include KGDB kernel assertions"
default n
comment "Serial port setup" comment "Serial port setup"
config KGDB_DEFPORT config KGDB_DEFPORT
...@@ -131,7 +127,7 @@ config KGDB_DEFBAUD ...@@ -131,7 +127,7 @@ config KGDB_DEFBAUD
choice choice
prompt "Parity" prompt "Parity"
depends on KGDB depends on SH_KGDB
default KGDB_DEFPARITY_N default KGDB_DEFPARITY_N
config KGDB_DEFPARITY_N config KGDB_DEFPARITY_N
...@@ -147,7 +143,7 @@ endchoice ...@@ -147,7 +143,7 @@ endchoice
choice choice
prompt "Data bits" prompt "Data bits"
depends on KGDB depends on SH_KGDB
default KGDB_DEFBITS_8 default KGDB_DEFBITS_8
config KGDB_DEFBITS_8 config KGDB_DEFBITS_8
......
...@@ -47,7 +47,6 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml ...@@ -47,7 +47,6 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),) -ffreestanding cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),) -ffreestanding
cflags-$(CONFIG_SH_DSP) += -Wa,-dsp cflags-$(CONFIG_SH_DSP) += -Wa,-dsp
cflags-$(CONFIG_SH_KGDB) += -g
cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \
$(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
...@@ -89,7 +88,9 @@ core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ ...@@ -89,7 +88,9 @@ core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
# Boards # Boards
machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x 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_7751_SOLUTION_ENGINE) := se/7751
machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE) := se/7780
machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) := se/7300 machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) := se/7300
machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) := se/7343 machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) := se/7343
machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se/73180 machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se/73180
...@@ -103,7 +104,7 @@ machdir-$(CONFIG_SH_HS7751RVOIP) := renesas/hs7751rvoip ...@@ -103,7 +104,7 @@ machdir-$(CONFIG_SH_HS7751RVOIP) := renesas/hs7751rvoip
machdir-$(CONFIG_SH_RTS7751R2D) := renesas/rts7751r2d machdir-$(CONFIG_SH_RTS7751R2D) := renesas/rts7751r2d
machdir-$(CONFIG_SH_7751_SYSTEMH) := renesas/systemh machdir-$(CONFIG_SH_7751_SYSTEMH) := renesas/systemh
machdir-$(CONFIG_SH_EDOSK7705) := renesas/edosk7705 machdir-$(CONFIG_SH_EDOSK7705) := renesas/edosk7705
machdir-$(CONFIG_SH_R7780RP) := renesas/r7780rp machdir-$(CONFIG_SH_HIGHLANDER) := renesas/r7780rp
machdir-$(CONFIG_SH_7710VOIPGW) := renesas/sh7710voipgw machdir-$(CONFIG_SH_7710VOIPGW) := renesas/sh7710voipgw
machdir-$(CONFIG_SH_SH4202_MICRODEV) := superh/microdev machdir-$(CONFIG_SH_SH4202_MICRODEV) := superh/microdev
machdir-$(CONFIG_SH_LANDISK) := landisk machdir-$(CONFIG_SH_LANDISK) := landisk
...@@ -111,6 +112,7 @@ machdir-$(CONFIG_SH_TITAN) := titan ...@@ -111,6 +112,7 @@ machdir-$(CONFIG_SH_TITAN) := titan
machdir-$(CONFIG_SH_SHMIN) := shmin machdir-$(CONFIG_SH_SHMIN) := shmin
machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) := se/7206 machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) := se/7206
machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) := se/7619 machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) := se/7619
machdir-$(CONFIG_SH_LBOX_RE2) := lboxre2
machdir-$(CONFIG_SH_UNKNOWN) := unknown machdir-$(CONFIG_SH_UNKNOWN) := unknown
incdir-y := $(notdir $(machdir-y)) incdir-y := $(notdir $(machdir-y))
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
# Makefile for the HP6xx specific parts of the kernel # Makefile for the HP6xx specific parts of the kernel
# #
obj-y := setup.o obj-y := setup.o
obj-$(CONFIG_PM) += pm.o pm_wakeup.o obj-$(CONFIG_PM) += pm.o pm_wakeup.o
obj-$(CONFIG_APM) += hp6xx_apm.o obj-$(CONFIG_APM_EMULATION) += hp6xx_apm.o
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* linux/arch/sh/boards/hp6xx/setup.c * linux/arch/sh/boards/hp6xx/setup.c
* *
* Copyright (C) 2002 Andriy Skulysh * 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 * May be copied or modified under the terms of the GNU General Public
* License. See linux/COPYING for more information. * License. See linux/COPYING for more information.
...@@ -10,6 +11,7 @@ ...@@ -10,6 +11,7 @@
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/platform_device.h>
#include <asm/hd64461.h> #include <asm/hd64461.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -19,6 +21,40 @@ ...@@ -19,6 +21,40 @@
#define SCPCR 0xa4000116 #define SCPCR 0xa4000116
#define SCPDR 0xa4000136 #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 = 93,
.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 *hp6xx_devices[] __initdata = {
&cf_ide_device,
};
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) static void __init hp6xx_setup(char **cmdline_p)
{ {
u8 v8; u8 v8;
...@@ -60,41 +96,12 @@ static void __init hp6xx_setup(char **cmdline_p) ...@@ -60,41 +96,12 @@ static void __init hp6xx_setup(char **cmdline_p)
v |= SCPCR_TS_ENABLE; v |= SCPCR_TS_ENABLE;
ctrl_outw(v, SCPCR); ctrl_outw(v, SCPCR);
} }
device_initcall(hp6xx_devices_setup);
/*
* XXX: This is stupid, we should have a generic machine vector for the cchips
* and just wrap the platform setup code in to this, as it's the only thing
* that ends up being different.
*/
struct sh_machine_vector mv_hp6xx __initmv = { struct sh_machine_vector mv_hp6xx __initmv = {
.mv_name = "hp6xx", .mv_name = "hp6xx",
.mv_setup = hp6xx_setup, .mv_setup = hp6xx_setup,
.mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM, .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM,
.mv_inb = hd64461_inb,
.mv_inw = hd64461_inw,
.mv_inl = hd64461_inl,
.mv_outb = hd64461_outb,
.mv_outw = hd64461_outw,
.mv_outl = hd64461_outl,
.mv_inb_p = hd64461_inb_p,
.mv_inw_p = hd64461_inw,
.mv_inl_p = hd64461_inl,
.mv_outb_p = hd64461_outb_p,
.mv_outw_p = hd64461_outw,
.mv_outl_p = hd64461_outl,
.mv_insb = hd64461_insb,
.mv_insw = hd64461_insw,
.mv_insl = hd64461_insl,
.mv_outsb = hd64461_outsb,
.mv_outsw = hd64461_outsw,
.mv_outsl = hd64461_outsl,
.mv_readw = hd64461_readw,
.mv_writew = hd64461_writew,
.mv_irq_demux = hd64461_irq_demux, .mv_irq_demux = hd64461_irq_demux,
}; };
ALIAS_MV(hp6xx) ALIAS_MV(hp6xx)
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
# Makefile for I-O DATA DEVICE, INC. "LANDISK Series" # Makefile for I-O DATA DEVICE, INC. "LANDISK Series"
# #
obj-y := setup.o io.o irq.o rtc.o landisk_pwb.o obj-y := setup.o irq.o psw.o gio.o
/*
* 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/kdev_t.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/landisk/gio.h>
#include <asm/landisk/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;
minor = MINOR(inode->i_rdev);
if (minor < DEVCOUNT) {
if (openCnt > 0) {
return -EALREADY;
} else {
openCnt++;
return 0;
}
}
return -ENOENT;
}
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: /* addres 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 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");
/*
* arch/sh/boards/landisk/io.c
*
* Copyright (C) 2001 Ian da Silva, Jeremy Siegel
* Based largely on io_se.c.
*
* I/O routine for I-O Data Device, Inc. LANDISK.
*
* Initial version only to support LAN access; some
* placeholder code from io_landisk.c left in with the
* expectation of later SuperIO and PCMCIA access.
*/
/*
* modifed by kogiidena
* 2005.03.03
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <asm/landisk/iodata_landisk.h>
#include <asm/addrspace.h>
#include <asm/io.h>
extern void *area5_io_base; /* Area 5 I/O Base address */
extern void *area6_io_base; /* Area 6 I/O Base address */
static inline unsigned long port2adr(unsigned int port)
{
if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
if (port == 0x3f6)
return ((unsigned long)area5_io_base + 0x2c);
else
return ((unsigned long)area5_io_base + PA_PIDE_OFFSET +
((port - 0x1f0) << 1));
else if ((0x170 <= port && port < 0x178) || port == 0x376)
if (port == 0x376)
return ((unsigned long)area6_io_base + 0x2c);
else
return ((unsigned long)area6_io_base + PA_SIDE_OFFSET +
((port - 0x170) << 1));
else
maybebadio((unsigned long)port);
return 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.
*/
u8 landisk_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 landisk_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 landisk_inw(unsigned long port)
{
if (PXSEG(port))
return ctrl_inw(port);
else if (is_pci_ioaddr(port))
return ctrl_inw(pci_ioaddr(port));
else
maybebadio(port);
return 0;
}
u32 landisk_inl(unsigned long port)
{
if (PXSEG(port))
return ctrl_inl(port);
else if (is_pci_ioaddr(port))
return ctrl_inl(pci_ioaddr(port));
else
maybebadio(port);
return 0;
}
void landisk_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 landisk_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 landisk_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
maybebadio(port);
}
void landisk_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 landisk_insb(unsigned long port, void *dst, unsigned long count)
{
volatile u16 *p;
u8 *buf = dst;
if (PXSEG(port)) {
while (count--)
*buf++ = *(volatile u8 *)port;
} else if (is_pci_ioaddr(port)) {
volatile u8 *bp = (volatile u8 *)pci_ioaddr(port);
while (count--)
*buf++ = *bp;
} else {
p = (volatile u16 *)port2adr(port);
while (count--)
*buf++ = *p & 0xff;
}
}
void landisk_insw(unsigned long port, void *dst, unsigned long count)
{
volatile u16 *p;
u16 *buf = dst;
if (PXSEG(port))
p = (volatile u16 *)port;
else if (is_pci_ioaddr(port))
p = (volatile u16 *)pci_ioaddr(port);
else
p = (volatile u16 *)port2adr(port);
while (count--)
*buf++ = *p;
}
void landisk_insl(unsigned long port, void *dst, unsigned long count)
{
u32 *buf = dst;
if (is_pci_ioaddr(port)) {
volatile u32 *p = (volatile u32 *)pci_ioaddr(port);
while (count--)
*buf++ = *p;
} else
maybebadio(port);
}
void landisk_outsb(unsigned long port, const void *src, unsigned long count)
{
volatile u16 *p;
const u8 *buf = src;
if (PXSEG(port))
while (count--)
ctrl_outb(*buf++, port);
else if (is_pci_ioaddr(port)) {
volatile u8 *bp = (volatile u8 *)pci_ioaddr(port);
while (count--)
*bp = *buf++;
} else {
p = (volatile u16 *)port2adr(port);
while (count--)
*p = *buf++;
}
}
void landisk_outsw(unsigned long port, const void *src, unsigned long count)
{
volatile u16 *p;
const u16 *buf = src;
if (PXSEG(port))
p = (volatile u16 *)port;
else if (is_pci_ioaddr(port))
p = (volatile u16 *)pci_ioaddr(port);
else
p = (volatile u16 *)port2adr(port);
while (count--)
*p = *buf++;
}
void landisk_outsl(unsigned long port, const void *src, unsigned long count)
{
const u32 *buf = src;
if (is_pci_ioaddr(port)) {
volatile u32 *p = (volatile u32 *)pci_ioaddr(port);
while (count--)
*p = *buf++;
} else
maybebadio(port);
}
void __iomem *landisk_ioport_map(unsigned long port, unsigned int size)
{
if (PXSEG(port))
return (void __iomem *)port;
else if (is_pci_ioaddr(port))
return (void __iomem *)pci_ioaddr(port);
return (void __iomem *)port2adr(port);
}
/* /*
* arch/sh/boards/landisk/irq.c * 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 * Copyright (C) 2001 Ian da Silva, Jeremy Siegel
* Based largely on io_se.c. * Based largely on io_se.c.
* *
* I/O routine for I-O Data Device, Inc. LANDISK. * 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
* Initial version only to support LAN access; some * for more details.
* placeholder code from io_landisk.c left in with the
* expectation of later SuperIO and PCMCIA access.
*/
/*
* modified by kogiidena
* 2005.03.03
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/irq.h> #include <linux/irq.h>
...@@ -20,71 +18,27 @@ ...@@ -20,71 +18,27 @@
#include <linux/io.h> #include <linux/io.h>
#include <asm/landisk/iodata_landisk.h> #include <asm/landisk/iodata_landisk.h>
static void enable_landisk_irq(unsigned int irq);
static void disable_landisk_irq(unsigned int irq);
/* shutdown is same as "disable" */
#define shutdown_landisk_irq disable_landisk_irq
static void ack_landisk_irq(unsigned int irq);
static void end_landisk_irq(unsigned int irq);
static unsigned int startup_landisk_irq(unsigned int irq)
{
enable_landisk_irq(irq);
return 0; /* never anything pending */
}
static void disable_landisk_irq(unsigned int irq) static void disable_landisk_irq(unsigned int irq)
{ {
unsigned char val;
unsigned char mask = 0xff ^ (0x01 << (irq - 5)); unsigned char mask = 0xff ^ (0x01 << (irq - 5));
/* Set the priority in IPR to 0 */ ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK);
val = ctrl_inb(PA_IMASK);
val &= mask;
ctrl_outb(val, PA_IMASK);
} }
static void enable_landisk_irq(unsigned int irq) static void enable_landisk_irq(unsigned int irq)
{ {
unsigned char val;
unsigned char value = (0x01 << (irq - 5)); unsigned char value = (0x01 << (irq - 5));
/* Set priority in IPR back to original value */ ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK);
val = ctrl_inb(PA_IMASK);
val |= value;
ctrl_outb(val, PA_IMASK);
}
static void ack_landisk_irq(unsigned int irq)
{
disable_landisk_irq(irq);
}
static void end_landisk_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
enable_landisk_irq(irq);
} }
static struct hw_interrupt_type landisk_irq_type = { static struct irq_chip landisk_irq_chip __read_mostly = {
.typename = "LANDISK IRQ", .name = "LANDISK",
.startup = startup_landisk_irq, .mask = disable_landisk_irq,
.shutdown = shutdown_landisk_irq, .unmask = enable_landisk_irq,
.enable = enable_landisk_irq, .mask_ack = disable_landisk_irq,
.disable = disable_landisk_irq,
.ack = ack_landisk_irq,
.end = end_landisk_irq
}; };
static void make_landisk_irq(unsigned int irq)
{
disable_irq_nosync(irq);
irq_desc[irq].chip = &landisk_irq_type;
disable_landisk_irq(irq);
}
/* /*
* Initialize IRQ setting * Initialize IRQ setting
*/ */
...@@ -92,6 +46,11 @@ void __init init_landisk_IRQ(void) ...@@ -92,6 +46,11 @@ void __init init_landisk_IRQ(void)
{ {
int i; int i;
for (i = 5; i < 14; i++) for (i = 5; i < 14; i++) {
make_landisk_irq(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);
} }
/*
* arch/sh/boards/landisk/landisk_pwb.c -- driver for the Power control switch.
*
* This driver will also support the I-O DATA Device, Inc. LANDISK Board.
*
* 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.
*
* Copylight (C) 2002 Atom Create Engineering Co., Ltd.
*
* LED control drive function added by kogiidena
*/
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/major.h>
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/landisk/iodata_landisk.h>
#define SHUTDOWN_BTN_MINOR 1 /* Shutdown button device minor no. */
#define LED_MINOR 21 /* LED minor no. */
#define BTN_MINOR 22 /* BUTTON minor no. */
#define GIO_MINOR 40 /* GIO minor no. */
static int openCnt;
static int openCntLED;
static int openCntGio;
static int openCntBtn;
static int landisk_btn;
static int landisk_btnctrlpid;
/*
* Functions prototypes
*/
static int gio_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg);
static int swdrv_open(struct inode *inode, struct file *filp)
{
int minor;
minor = MINOR(inode->i_rdev);
filp->private_data = (void *)minor;
if (minor == SHUTDOWN_BTN_MINOR) {
if (openCnt > 0) {
return -EALREADY;
} else {
openCnt++;
return 0;
}
} else if (minor == LED_MINOR) {
if (openCntLED > 0) {
return -EALREADY;
} else {
openCntLED++;
return 0;
}
} else if (minor == BTN_MINOR) {
if (openCntBtn > 0) {
return -EALREADY;
} else {
openCntBtn++;
return 0;
}
} else if (minor == GIO_MINOR) {
if (openCntGio > 0) {
return -EALREADY;
} else {
openCntGio++;
return 0;
}
}
return -ENOENT;
}
static int swdrv_close(struct inode *inode, struct file *filp)
{
int minor;
minor = MINOR(inode->i_rdev);
if (minor == SHUTDOWN_BTN_MINOR) {
openCnt--;
} else if (minor == LED_MINOR) {
openCntLED--;
} else if (minor == BTN_MINOR) {
openCntBtn--;
} else if (minor == GIO_MINOR) {
openCntGio--;
}
return 0;
}
static int swdrv_read(struct file *filp, char *buff, size_t count,
loff_t * ppos)
{
int minor;
minor = (int)(filp->private_data);
if (!access_ok(VERIFY_WRITE, (void *)buff, count))
return -EFAULT;
if (minor == SHUTDOWN_BTN_MINOR) {
if (landisk_btn & 0x10) {
put_user(1, buff);
return 1;
} else {
return 0;
}
}
return 0;
}
static int swdrv_write(struct file *filp, const char *buff, size_t count,
loff_t * ppos)
{
int minor;
minor = (int)(filp->private_data);
if (minor == SHUTDOWN_BTN_MINOR) {
return count;
}
return count;
}
static irqreturn_t sw_interrupt(int irq, void *dev_id)
{
landisk_btn = (0x0ff & (~ctrl_inb(PA_STATUS)));
disable_irq(IRQ_BUTTON);
disable_irq(IRQ_POWER);
ctrl_outb(0x00, PA_PWRINT_CLR);
if (landisk_btnctrlpid != 0) {
kill_proc(landisk_btnctrlpid, SIGUSR1, 1);
landisk_btnctrlpid = 0;
}
return IRQ_HANDLED;
}
static const struct file_operations swdrv_fops = {
.read = swdrv_read, /* read */
.write = swdrv_write, /* write */
.open = swdrv_open, /* open */
.release = swdrv_close, /* release */
.ioctl = gio_ioctl, /* ioctl */
};
static char banner[] __initdata =
KERN_INFO "LANDISK and USL-5P Button, LED and GIO driver initialized\n";
int __init swdrv_init(void)
{
int error;
printk("%s", banner);
openCnt = 0;
openCntLED = 0;
openCntBtn = 0;
openCntGio = 0;
landisk_btn = 0;
landisk_btnctrlpid = 0;
if ((error = register_chrdev(SHUTDOWN_BTN_MAJOR, "swdrv", &swdrv_fops))) {
printk(KERN_ERR
"Button, LED and GIO driver:Couldn't register driver, error=%d\n",
error);
return 1;
}
if (request_irq(IRQ_POWER, sw_interrupt, 0, "SHUTDOWNSWITCH", NULL)) {
printk(KERN_ERR "Unable to get IRQ 11.\n");
return 1;
}
if (request_irq(IRQ_BUTTON, sw_interrupt, 0, "USL-5P BUTTON", NULL)) {
printk(KERN_ERR "Unable to get IRQ 12.\n");
return 1;
}
ctrl_outb(0x00, PA_PWRINT_CLR);
return 0;
}
module_init(swdrv_init);
/*
* gio driver
*
*/
#include <asm/landisk/gio.h>
static int gio_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
int minor;
unsigned int data, mask;
static unsigned int addr = 0;
minor = (int)(filp->private_data);
/* access control */
if (minor == GIO_MINOR) {
;
} else if (minor == LED_MINOR) {
if (((cmd & 0x0ff) >= 9) && ((cmd & 0x0ff) < 20)) {
;
} else {
return -EINVAL;
}
} else if (minor == BTN_MINOR) {
if (((cmd & 0x0ff) >= 20) && ((cmd & 0x0ff) < 30)) {
;
} else {
return -EINVAL;
}
} else {
return -EINVAL;
}
if (cmd & 0x01) { /* write */
if (copy_from_user(&data, (int *)arg, sizeof(int))) {
return -EFAULT;
}
}
switch (cmd) {
case GIODRV_IOCSGIOSETADDR: /* addres 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;
case GIODRV_IOCSGIO_LED: /* write */
mask = ((data & 0x00ffffff) << 8)
| ((data & 0x0000ffff) << 16)
| ((data & 0x000000ff) << 24);
landisk_ledparam = data & (~mask);
if (landisk_arch == 0) { /* arch == landisk */
landisk_ledparam &= 0x03030303;
mask = (~(landisk_ledparam >> 22)) & 0x000c;
landisk_ledparam |= mask;
} else { /* arch == usl-5p */
mask = (landisk_ledparam >> 24) & 0x0001;
landisk_ledparam |= mask;
landisk_ledparam &= 0x007f7f7f;
}
landisk_ledparam |= 0x80;
break;
case GIODRV_IOCGGIO_LED: /* read */
data = landisk_ledparam;
if (landisk_arch == 0) { /* arch == landisk */
data &= 0x03030303;
} else { /* arch == usl-5p */
;
}
data &= (~0x080);
break;
case GIODRV_IOCSGIO_BUZZER: /* write */
landisk_buzzerparam = data;
landisk_ledparam |= 0x80;
break;
case GIODRV_IOCGGIO_LANDISK: /* read */
data = landisk_arch & 0x01;
break;
case GIODRV_IOCGGIO_BTN: /* read */
data = (0x0ff & ctrl_inb(PA_PWRINT_CLR));
data <<= 8;
data |= (0x0ff & ctrl_inb(PA_IMASK));
data <<= 8;
data |= (0x0ff & landisk_btn);
data <<= 8;
data |= (0x0ff & (~ctrl_inb(PA_STATUS)));
break;
case GIODRV_IOCSGIO_BTNPID: /* write */
landisk_btnctrlpid = data;
landisk_btn = 0;
if (irq_desc[IRQ_BUTTON].depth) {
enable_irq(IRQ_BUTTON);
}
if (irq_desc[IRQ_POWER].depth) {
enable_irq(IRQ_POWER);
}
break;
case GIODRV_IOCGGIO_BTNPID: /* read */
data = landisk_btnctrlpid;
break;
default:
return -EFAULT;
break;
}
if ((cmd & 0x01) == 0) { /* read */
if (copy_to_user((int *)arg, &data, sizeof(int))) {
return -EFAULT;
}
}
return 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 <asm/landisk/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);
/*
* arch/sh/boards/landisk/rtc.c -- RTC support
*
* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
* Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka
*/
/*
* modifed by kogiidena
* 2005.09.16
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/time.h>
#include <linux/delay.h>
#include <linux/spinlock.h>
#include <linux/bcd.h>
#include <asm/rtc.h>
extern spinlock_t rtc_lock;
extern void
rs5c313_set_cmos_time(unsigned int BCD_yr, unsigned int BCD_mon,
unsigned int BCD_day, unsigned int BCD_hr,
unsigned int BCD_min, unsigned int BCD_sec);
extern unsigned long
rs5c313_get_cmos_time(unsigned int *BCD_yr, unsigned int *BCD_mon,
unsigned int *BCD_day, unsigned int *BCD_hr,
unsigned int *BCD_min, unsigned int *BCD_sec);
void landisk_rtc_gettimeofday(struct timespec *tv)
{
unsigned int BCD_yr, BCD_mon, BCD_day, BCD_hr, BCD_min, BCD_sec;
unsigned long flags;
spin_lock_irqsave(&rtc_lock, flags);
tv->tv_sec = rs5c313_get_cmos_time
(&BCD_yr, &BCD_mon, &BCD_day, &BCD_hr, &BCD_min, &BCD_sec);
tv->tv_nsec = 0;
spin_unlock_irqrestore(&rtc_lock, flags);
}
int landisk_rtc_settimeofday(const time_t secs)
{
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
unsigned long flags;
unsigned long nowtime = secs;
unsigned int BCD_yr, BCD_mon, BCD_day, BCD_hr, BCD_min, BCD_sec;
spin_lock_irqsave(&rtc_lock, flags);
rs5c313_get_cmos_time
(&BCD_yr, &BCD_mon, &BCD_day, &BCD_hr, &BCD_min, &BCD_sec);
cmos_minutes = BCD_min;
BCD_TO_BIN(cmos_minutes);
/*
* since we're only adjusting minutes and seconds,
* don't interfere with hour overflow. This avoids
* messing with unknown time zones but requires your
* RTC not to be off by more than 15 minutes
*/
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) {
BIN_TO_BCD(real_seconds);
BIN_TO_BCD(real_minutes);
rs5c313_set_cmos_time(BCD_yr, BCD_mon, BCD_day, BCD_hr,
real_minutes, real_seconds);
} else {
printk(KERN_WARNING
"set_rtc_time: can't update from %d to %d\n",
cmos_minutes, real_minutes);
retval = -1;
}
spin_unlock_irqrestore(&rtc_lock, flags);
return retval;
}
void landisk_time_init(void)
{
rtc_sh_get_time = landisk_rtc_gettimeofday;
rtc_sh_set_time = landisk_rtc_settimeofday;
}
/* /*
* arch/sh/boards/landisk/setup.c * arch/sh/boards/landisk/setup.c
* *
* Copyright (C) 2000 Kazumoto Kojima
* Copyright (C) 2002 Paul Mundt
*
* I-O DATA Device, Inc. LANDISK Support. * I-O DATA Device, Inc. LANDISK Support.
* *
* Modified for LANDISK by * Copyright (C) 2000 Kazumoto Kojima
* Atom Create Engineering Co., Ltd. 2002. * Copyright (C) 2002 Paul Mundt
* * Copylight (C) 2002 Atom Create Engineering Co., Ltd.
* modifed by kogiidena * Copyright (C) 2005-2007 kogiidena
* 2005.09.16
* *
* This file is subject to the terms and conditions of the GNU General Public * 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 * License. See the file "COPYING" in the main directory of this archive
* for more details. * for more details.
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/pata_platform.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/rtc.h>
#include <asm/landisk/iodata_landisk.h> #include <asm/landisk/iodata_landisk.h>
#include <asm/io.h> #include <asm/io.h>
void landisk_time_init(void);
void init_landisk_IRQ(void); void init_landisk_IRQ(void);
int landisk_ledparam;
int landisk_buzzerparam;
int landisk_arch;
/* cycle the led's in the clasic knightrider/sun pattern */
static void heartbeat_landisk(void)
{
static unsigned int cnt = 0, blink = 0x00, period = 25;
volatile u8 *p = (volatile u8 *)PA_LED;
char data;
if ((landisk_ledparam & 0x080) == 0)
return;
cnt += 1;
if (cnt < period)
return;
cnt = 0;
blink++;
data = (blink & 0x01) ? (landisk_ledparam >> 16) : 0;
data |= (blink & 0x02) ? (landisk_ledparam >> 8) : 0;
data |= landisk_ledparam;
/* buzzer */
if (landisk_buzzerparam & 0x1) {
data |= 0x80;
} else {
data &= 0x7f;
}
*p = data;
if (((landisk_ledparam & 0x007f7f00) == 0) &&
(landisk_buzzerparam == 0))
landisk_ledparam &= (~0x0080);
landisk_buzzerparam >>= 1;
}
static void landisk_power_off(void) static void landisk_power_off(void)
{ {
ctrl_outb(0x01, PA_SHUTDOWN); ctrl_outb(0x01, PA_SHUTDOWN);
} }
static void check_usl5p(void) static struct resource cf_ide_resources[3];
{
volatile u8 *p = (volatile u8 *)PA_LED;
u8 tmp1, tmp2;
tmp1 = *p; static struct pata_platform_info pata_info = {
*p = 0x40; .ioport_shift = 1,
tmp2 = *p; };
*p = tmp1;
landisk_arch = (tmp2 == 0x40); static struct platform_device cf_ide_device = {
if (landisk_arch == 1) { .name = "pata_platform",
/* arch == usl-5p */ .id = -1,
landisk_ledparam = 0x00000380; .num_resources = ARRAY_SIZE(cf_ide_resources),
landisk_ledparam |= (tmp1 & 0x07c); .resource = cf_ide_resources,
} else { .dev = {
/* arch == landisk */ .platform_data = &pata_info,
landisk_ledparam = 0x02000180; },
landisk_ledparam |= 0x04; };
}
}
void *area5_io_base; static struct platform_device *landisk_devices[] __initdata = {
void *area6_io_base; &cf_ide_device,
};
static int __init landisk_cf_init(void) static int __init landisk_devices_setup(void)
{ {
pgprot_t prot; pgprot_t prot;
unsigned long paddrbase, psize; unsigned long paddrbase;
void *cf_ide_base;
/* open I/O area window */ /* open I/O area window */
paddrbase = virt_to_phys((void *)PA_AREA5_IO); paddrbase = virt_to_phys((void *)PA_AREA5_IO);
psize = PAGE_SIZE;
prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16); prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
area5_io_base = p3_ioremap(paddrbase, psize, prot.pgprot); cf_ide_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
if (!area5_io_base) { if (!cf_ide_base) {
printk("allocate_cf_area : can't open CF I/O window!\n"); printk("allocate_cf_area : can't open CF I/O window!\n");
return -ENOMEM; return -ENOMEM;
} }
paddrbase = virt_to_phys((void *)PA_AREA6_IO); /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
psize = PAGE_SIZE; cf_ide_resources[0].start = (unsigned long)cf_ide_base + 0x40;
prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16); cf_ide_resources[0].end = (unsigned long)cf_ide_base + 0x40 + 0x0f;
area6_io_base = p3_ioremap(paddrbase, psize, prot.pgprot); cf_ide_resources[0].flags = IORESOURCE_IO;
if (!area6_io_base) { cf_ide_resources[1].start = (unsigned long)cf_ide_base + 0x2c;
printk("allocate_cf_area : can't open HDD I/O window!\n"); cf_ide_resources[1].end = (unsigned long)cf_ide_base + 0x2c + 0x03;
return -ENOMEM; cf_ide_resources[1].flags = IORESOURCE_IO;
} cf_ide_resources[2].start = IRQ_FATA;
cf_ide_resources[2].flags = IORESOURCE_IRQ;
printk(KERN_INFO "Allocate Area5/6 success.\n");
return platform_add_devices(landisk_devices,
/* XXX : do we need attribute and common-memory area also? */ ARRAY_SIZE(landisk_devices));
return 0;
} }
__initcall(landisk_devices_setup);
static void __init landisk_setup(char **cmdline_p) static void __init landisk_setup(char **cmdline_p)
{ {
device_initcall(landisk_cf_init); /* LED ON */
ctrl_outb(ctrl_inb(PA_LED) | 0x03, PA_LED);
landisk_buzzerparam = 0;
check_usl5p();
printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n"); printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
board_time_init = landisk_time_init;
pm_power_off = landisk_power_off; pm_power_off = landisk_power_off;
} }
...@@ -148,29 +94,6 @@ static void __init landisk_setup(char **cmdline_p) ...@@ -148,29 +94,6 @@ static void __init landisk_setup(char **cmdline_p)
struct sh_machine_vector mv_landisk __initmv = { struct sh_machine_vector mv_landisk __initmv = {
.mv_name = "LANDISK", .mv_name = "LANDISK",
.mv_setup = landisk_setup, .mv_setup = landisk_setup,
.mv_nr_irqs = 72,
.mv_inb = landisk_inb,
.mv_inw = landisk_inw,
.mv_inl = landisk_inl,
.mv_outb = landisk_outb,
.mv_outw = landisk_outw,
.mv_outl = landisk_outl,
.mv_inb_p = landisk_inb_p,
.mv_inw_p = landisk_inw,
.mv_inl_p = landisk_inl,
.mv_outb_p = landisk_outb_p,
.mv_outw_p = landisk_outw,
.mv_outl_p = landisk_outl,
.mv_insb = landisk_insb,
.mv_insw = landisk_insw,
.mv_insl = landisk_insl,
.mv_outsb = landisk_outsb,
.mv_outsw = landisk_outsw,
.mv_outsl = landisk_outsl,
.mv_ioport_map = landisk_ioport_map,
.mv_init_irq = init_landisk_IRQ, .mv_init_irq = init_landisk_IRQ,
#ifdef CONFIG_HEARTBEAT
.mv_heartbeat = heartbeat_landisk,
#endif
}; };
ALIAS_MV(landisk) ALIAS_MV(landisk)
#
# Makefile for the L-BOX RE2 specific parts of the kernel
# Copyright (c) 2007 Nobuhiro Iwamatsu
obj-y := setup.o irq.o
/*
* 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);
}
/*
* 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/pata_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
*/
struct sh_machine_vector mv_lboxre2 __initmv = {
.mv_name = "L-BOX RE2",
.mv_nr_irqs = 72,
.mv_init_irq = init_lboxre2_IRQ,
};
ALIAS_MV(lboxre2)
if SH_R7780RP if SH_HIGHLANDER
menu "R7780RP options" choice
prompt "Highlander options"
default SH_R7780MP
config SH_R7780RP
bool "R7780RP-1 board support"
select CPU_SUBTYPE_SH7780
config SH_R7780MP config SH_R7780MP
bool "R7780MP board support" bool "R7780MP board support"
default y select CPU_SUBTYPE_SH7780
help help
Selecting this option will enable support for the mass-production Selecting this option will enable support for the mass-production
version of the R7780RP. If in doubt, say Y. version of the R7780RP. If in doubt, say Y.
endmenu config SH_R7785RP
bool "R7785RP board support"
select CPU_SUBTYPE_SH7785
endchoice
endif endif
# #
# Makefile for the R7780RP-1 specific parts of the kernel # Makefile for the R7780RP-1 specific parts of the kernel
# #
irqinit-y := irq-r7780rp.o
obj-y := setup.o irq.o irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o
obj-$(CONFIG_PUSH_SWITCH) += psw.o obj-$(CONFIG_PUSH_SWITCH) += psw.o
obj-y := setup.o irq.o $(irqinit-y)
/*
* Renesas Solutions Highlander R7780RP-1 Support.
*
* Copyright (C) 2002 Atom Create Engineering Co., Ltd.
* 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/init.h>
#include <asm/io.h>
#include <asm/r7780rp.h>
void __init highlander_init_irq(void)
{
int i;
for (i = 0; i < 15; i++)
make_r7780rp_irq(i);
}
/*
* Renesas Solutions Highlander R7780RP-1 Support.
*
* Copyright (C) 2002 Atom Create Engineering Co., Ltd.
* 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/init.h>
#include <asm/io.h>
#include <asm/r7780rp.h>
void __init highlander_init_irq(void)
{
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(0x0000, PA_IRLPRF); /* FPGA IRLF */
make_r7780rp_irq(1); /* CF card */
make_r7780rp_irq(10); /* On-board ethernet */
}
...@@ -14,10 +14,12 @@ ...@@ -14,10 +14,12 @@
#include <linux/io.h> #include <linux/io.h>
#include <asm/r7780rp.h> #include <asm/r7780rp.h>
#ifdef CONFIG_SH_R7780MP #ifdef CONFIG_SH_R7780RP
static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0};
#else
static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0}; static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0};
#elif defined(CONFIG_SH_R7780MP)
static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0};
#elif defined(CONFIG_SH_R7785RP)
static int mask_pos[] = {2, 11, 2, 2, 2, 2, 9, 8, 7, 5, 10, 2, 2, 2, 2, 2};
#endif #endif
static void enable_r7780rp_irq(unsigned int irq) static void enable_r7780rp_irq(unsigned int irq)
...@@ -40,17 +42,10 @@ static struct irq_chip r7780rp_irq_chip __read_mostly = { ...@@ -40,17 +42,10 @@ static struct irq_chip r7780rp_irq_chip __read_mostly = {
.mask_ack = disable_r7780rp_irq, .mask_ack = disable_r7780rp_irq,
}; };
/* void make_r7780rp_irq(unsigned int irq)
* Initialize IRQ setting
*/
void __init init_r7780rp_IRQ(void)
{ {
int i; disable_irq_nosync(irq);
set_irq_chip_and_handler_name(irq, &r7780rp_irq_chip,
for (i = 0; i < 15; i++) { handle_level_irq, "level");
disable_irq_nosync(i); enable_r7780rp_irq(irq);
set_irq_chip_and_handler_name(i, &r7780rp_irq_chip,
handle_level_irq, "level");
enable_r7780rp_irq(i);
}
} }
/* /*
* arch/sh/boards/renesas/r7780rp/setup.c * arch/sh/boards/renesas/r7780rp/setup.c
* *
* Renesas Solutions Highlander Support.
*
* Copyright (C) 2002 Atom Create Engineering Co., Ltd. * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
* Copyright (C) 2005 - 2007 Paul Mundt * Copyright (C) 2005 - 2007 Paul Mundt
* *
* Renesas Solutions Highlander R7780RP-1 Support. * 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 * 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 * License. See the file "COPYING" in the main directory of this archive
...@@ -18,32 +21,6 @@ ...@@ -18,32 +21,6 @@
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/io.h> #include <asm/io.h>
extern void init_r7780rp_IRQ(void);
static struct resource m66596_usb_host_resources[] = {
[0] = {
.start = 0xa4800000,
.end = 0xa4ffffff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 6, /* irq number */
.end = 6,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device m66596_usb_host_device = {
.name = "m66596-hcd",
.id = 0,
.dev = {
.dma_mask = NULL, /* don't use dma */
.coherent_dma_mask = 0xffffffff,
},
.num_resources = ARRAY_SIZE(m66596_usb_host_resources),
.resource = m66596_usb_host_resources,
};
static struct resource cf_ide_resources[] = { static struct resource cf_ide_resources[] = {
[0] = { [0] = {
.start = PA_AREA5_IO + 0x1000, .start = PA_AREA5_IO + 0x1000,
...@@ -56,10 +33,10 @@ static struct resource cf_ide_resources[] = { ...@@ -56,10 +33,10 @@ static struct resource cf_ide_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[2] = { [2] = {
#ifdef CONFIG_SH_R7780MP #ifdef CONFIG_SH_R7780RP
.start = 1,
#else
.start = 4, .start = 4,
#else
.start = 1,
#endif #endif
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
...@@ -92,15 +69,18 @@ static struct resource heartbeat_resources[] = { ...@@ -92,15 +69,18 @@ static struct resource heartbeat_resources[] = {
static struct platform_device heartbeat_device = { static struct platform_device heartbeat_device = {
.name = "heartbeat", .name = "heartbeat",
.id = -1, .id = -1,
/* R7785RP has a slightly more sensible FPGA.. */
#ifndef CONFIG_SH_R7785RP
.dev = { .dev = {
.platform_data = heartbeat_bit_pos, .platform_data = heartbeat_bit_pos,
}, },
#endif
.num_resources = ARRAY_SIZE(heartbeat_resources), .num_resources = ARRAY_SIZE(heartbeat_resources),
.resource = heartbeat_resources, .resource = heartbeat_resources,
}; };
static struct platform_device *r7780rp_devices[] __initdata = { static struct platform_device *r7780rp_devices[] __initdata = {
&m66596_usb_host_device,
&cf_ide_device, &cf_ide_device,
&heartbeat_device, &heartbeat_device,
}; };
...@@ -110,18 +90,19 @@ static int __init r7780rp_devices_setup(void) ...@@ -110,18 +90,19 @@ static int __init r7780rp_devices_setup(void)
return platform_add_devices(r7780rp_devices, return platform_add_devices(r7780rp_devices,
ARRAY_SIZE(r7780rp_devices)); ARRAY_SIZE(r7780rp_devices));
} }
device_initcall(r7780rp_devices_setup);
/* /*
* Platform specific clocks * Platform specific clocks
*/ */
static void ivdr_clk_enable(struct clk *clk) static void ivdr_clk_enable(struct clk *clk)
{ {
ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << 8), PA_IVDRCTL); ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL);
} }
static void ivdr_clk_disable(struct clk *clk) static void ivdr_clk_disable(struct clk *clk)
{ {
ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << 8), PA_IVDRCTL); ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
} }
static struct clk_ops ivdr_clk_ops = { static struct clk_ops ivdr_clk_ops = {
...@@ -140,22 +121,22 @@ static struct clk *r7780rp_clocks[] = { ...@@ -140,22 +121,22 @@ static struct clk *r7780rp_clocks[] = {
static void r7780rp_power_off(void) static void r7780rp_power_off(void)
{ {
#ifdef CONFIG_SH_R7780MP if (mach_is_r7780mp() || mach_is_r7785rp())
ctrl_outw(0x0001, PA_POFF); ctrl_outw(0x0001, PA_POFF);
#endif
} }
/* /*
* Initialize the board * Initialize the board
*/ */
static void __init r7780rp_setup(char **cmdline_p) static void __init highlander_setup(char **cmdline_p)
{ {
u16 ver = ctrl_inw(PA_VERREG); u16 ver = ctrl_inw(PA_VERREG);
int i; int i;
device_initcall(r7780rp_devices_setup); printk(KERN_INFO "Renesas Solutions Highlander %s support.\n",
mach_is_r7780rp() ? "R7780RP-1" :
printk(KERN_INFO "Renesas Solutions Highlander R7780RP-1 support.\n"); mach_is_r7780mp() ? "R7780MP" :
"R7785RP");
printk(KERN_INFO "Board version: %d (revision %d), " printk(KERN_INFO "Board version: %d (revision %d), "
"FPGA version: %d (revision %d)\n", "FPGA version: %d (revision %d)\n",
...@@ -173,9 +154,10 @@ static void __init r7780rp_setup(char **cmdline_p) ...@@ -173,9 +154,10 @@ static void __init r7780rp_setup(char **cmdline_p)
} }
ctrl_outw(0x0000, PA_OBLED); /* Clear LED. */ ctrl_outw(0x0000, PA_OBLED); /* Clear LED. */
#ifndef CONFIG_SH_R7780MP
ctrl_outw(0x0001, PA_SDPOW); /* SD Power ON */ if (mach_is_r7780rp())
#endif ctrl_outw(0x0001, PA_SDPOW); /* SD Power ON */
ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL); /* Si13112 */ ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL); /* Si13112 */
pm_power_off = r7780rp_power_off; pm_power_off = r7780rp_power_off;
...@@ -184,10 +166,10 @@ static void __init r7780rp_setup(char **cmdline_p) ...@@ -184,10 +166,10 @@ static void __init r7780rp_setup(char **cmdline_p)
/* /*
* The Machine Vector * The Machine Vector
*/ */
struct sh_machine_vector mv_r7780rp __initmv = { struct sh_machine_vector mv_highlander __initmv = {
.mv_name = "Highlander R7780RP-1", .mv_name = "Highlander",
.mv_setup = r7780rp_setup,
.mv_nr_irqs = 109, .mv_nr_irqs = 109,
.mv_init_irq = init_r7780rp_IRQ, .mv_setup = highlander_setup,
.mv_init_irq = highlander_init_irq,
}; };
ALIAS_MV(r7780rp) ALIAS_MV(highlander)
...@@ -27,6 +27,8 @@ int sh_pcic_io_dummy; ...@@ -27,6 +27,8 @@ int sh_pcic_io_dummy;
static inline volatile __u16 * static inline volatile __u16 *
port2adr(unsigned int port) port2adr(unsigned int port)
{ {
if (port & 0xff000000)
return ( volatile __u16 *) port;
if (port >= 0x2000) if (port >= 0x2000)
return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
else if (port >= 0x1000) else if (port >= 0x1000)
......
...@@ -55,23 +55,34 @@ void make_se770x_irq(struct ipr_data *table, unsigned int nr_irqs) ...@@ -55,23 +55,34 @@ void make_se770x_irq(struct ipr_data *table, unsigned int nr_irqs)
} }
static struct ipr_data se770x_ipr_map[] = { static struct ipr_data se770x_ipr_map[] = {
/*
* 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) #if defined(CONFIG_CPU_SUBTYPE_SH7705)
/* This is default value */ /* This is default value */
{ 0xf-0x2, 0, 8, 0x2 , BCR_ILCRA}, { 13, 0, 8, 0x0f-13 ,BCR_ILCRA},
{ 0xf-0xa, 0, 4, 0xa , BCR_ILCRA}, { 5 , 0, 4, 0x0f- 5 ,BCR_ILCRA},
{ 0xf-0x5, 0, 0, 0x5 , BCR_ILCRB}, { 10, 0, 0, 0x0f-10, BCR_ILCRB},
{ 0xf-0x8, 0, 4, 0x8 , BCR_ILCRC}, { 7 , 0, 4, 0x0f- 7, BCR_ILCRC},
{ 0xf-0xc, 0, 0, 0xc , BCR_ILCRC}, { 3 , 0, 0, 0x0f- 3, BCR_ILCRC},
{ 0xf-0xe, 0, 12, 0xe , BCR_ILCRD}, { 1 , 0, 12, 0x0f- 1, BCR_ILCRD},
{ 0xf-0x3, 0, 4, 0x3 , BCR_ILCRD}, /* LAN */ { 12, 0, 4, 0x0f-12, BCR_ILCRD}, /* LAN */
{ 0xf-0xd, 0, 8, 0xd , BCR_ILCRE}, { 2 , 0, 8, 0x0f- 2, BCR_ILCRE}, /* PCIRQ2 */
{ 0xf-0x9, 0, 4, 0x9 , BCR_ILCRE}, { 6 , 0, 4, 0x0f- 6, BCR_ILCRE}, /* PCIRQ1 */
{ 0xf-0x1, 0, 0, 0x1 , BCR_ILCRE}, { 14, 0, 0, 0x0f-14, BCR_ILCRE}, /* PCIRQ0 */
{ 0xf-0xf, 0, 12, 0xf , BCR_ILCRF}, { 0 , 0, 12, 0x0f , BCR_ILCRF},
{ 0xf-0xb, 0, 4, 0xb , BCR_ILCRF}, { 4 , 0, 4, 0x0f- 4, BCR_ILCRF},
{ 0xf-0x7, 0, 12, 0x7 , BCR_ILCRG}, { 8 , 0, 12, 0x0f- 8, BCR_ILCRG},
{ 0xf-0x6, 0, 8, 0x6 , BCR_ILCRG}, { 9 , 0, 8, 0x0f- 9, BCR_ILCRG},
{ 0xf-0x4, 0, 4, 0x4 , BCR_ILCRG}, { 11, 0, 4, 0x0f-11, BCR_ILCRG},
#else #else
{ 14, 0, 8, 0x0f-14 ,BCR_ILCRA}, { 14, 0, 8, 0x0f-14 ,BCR_ILCRA},
{ 12, 0, 4, 0x0f-12 ,BCR_ILCRA}, { 12, 0, 4, 0x0f-12 ,BCR_ILCRA},
...@@ -81,8 +92,10 @@ static struct ipr_data se770x_ipr_map[] = { ...@@ -81,8 +92,10 @@ static struct ipr_data se770x_ipr_map[] = {
{ 4, 0, 4, 0x0f- 4 ,BCR_ILCRC}, { 4, 0, 4, 0x0f- 4 ,BCR_ILCRC},
{ 3, 0, 0, 0x0f- 3 ,BCR_ILCRC}, { 3, 0, 0, 0x0f- 3 ,BCR_ILCRC},
{ 1, 0, 12, 0x0f- 1 ,BCR_ILCRD}, { 1, 0, 12, 0x0f- 1 ,BCR_ILCRD},
#if defined(CONFIG_STNIC)
/* ST NIC */ /* ST NIC */
{ 10, 0, 4, 0x0f-10 ,BCR_ILCRD}, /* LAN */ { 10, 0, 4, 0x0f-10 ,BCR_ILCRD}, /* LAN */
#endif
/* MRSHPC IRQs setting */ /* MRSHPC IRQs setting */
{ 0, 0, 12, 0x0f- 0 ,BCR_ILCRE}, /* PCIRQ3 */ { 0, 0, 12, 0x0f- 0 ,BCR_ILCRE}, /* PCIRQ3 */
{ 11, 0, 8, 0x0f-11 ,BCR_ILCRE}, /* PCIRQ2 */ { 11, 0, 8, 0x0f-11 ,BCR_ILCRE}, /* PCIRQ2 */
...@@ -100,18 +113,6 @@ static struct ipr_data se770x_ipr_map[] = { ...@@ -100,18 +113,6 @@ static struct ipr_data se770x_ipr_map[] = {
*/ */
void __init init_se_IRQ(void) void __init init_se_IRQ(void)
{ {
/*
* 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)
/* Disable all interrupts */ /* Disable all interrupts */
ctrl_outw(0, BCR_ILCRA); ctrl_outw(0, BCR_ILCRA);
ctrl_outw(0, BCR_ILCRB); ctrl_outw(0, BCR_ILCRB);
...@@ -120,6 +121,6 @@ void __init init_se_IRQ(void) ...@@ -120,6 +121,6 @@ void __init init_se_IRQ(void)
ctrl_outw(0, BCR_ILCRE); ctrl_outw(0, BCR_ILCRE);
ctrl_outw(0, BCR_ILCRF); ctrl_outw(0, BCR_ILCRF);
ctrl_outw(0, BCR_ILCRG); ctrl_outw(0, BCR_ILCRG);
#endif
make_se770x_irq(se770x_ipr_map, ARRAY_SIZE(se770x_ipr_map)); make_se770x_irq(se770x_ipr_map, ARRAY_SIZE(se770x_ipr_map));
} }
...@@ -63,6 +63,31 @@ static void __init smsc_setup(char **cmdline_p) ...@@ -63,6 +63,31 @@ static void __init smsc_setup(char **cmdline_p)
outb_p(CONFIG_EXIT, CONFIG_PORT); 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 unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
static struct resource heartbeat_resources[] = { static struct resource heartbeat_resources[] = {
...@@ -85,13 +110,14 @@ static struct platform_device heartbeat_device = { ...@@ -85,13 +110,14 @@ static struct platform_device heartbeat_device = {
static struct platform_device *se_devices[] __initdata = { static struct platform_device *se_devices[] __initdata = {
&heartbeat_device, &heartbeat_device,
&cf_ide_device,
}; };
static int __init se_devices_setup(void) static int __init se_devices_setup(void)
{ {
return platform_add_devices(se_devices, ARRAY_SIZE(se_devices)); return platform_add_devices(se_devices, ARRAY_SIZE(se_devices));
} }
__initcall(se_devices_setup); device_initcall(se_devices_setup);
/* /*
* The Machine Vector * The Machine Vector
...@@ -107,6 +133,8 @@ struct sh_machine_vector mv_se __initmv = { ...@@ -107,6 +133,8 @@ struct sh_machine_vector mv_se __initmv = {
.mv_nr_irqs = 61, .mv_nr_irqs = 61,
#elif defined(CONFIG_CPU_SUBTYPE_SH7705) #elif defined(CONFIG_CPU_SUBTYPE_SH7705)
.mv_nr_irqs = 86, .mv_nr_irqs = 86,
#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
.mv_nr_irqs = 104,
#endif #endif
.mv_inb = se_inb, .mv_inb = se_inb,
......
#
# 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
/*
* 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>
#define INTC_INTMSK0 0xFFD00044
#define INTC_INTMSKCLR0 0xFFD00064
static void disable_se7722_irq(unsigned int irq)
{
struct ipr_data *p = get_irq_chip_data(irq);
ctrl_outw( ctrl_inw( p->addr ) | p->priority , p->addr );
}
static void enable_se7722_irq(unsigned int irq)
{
struct ipr_data *p = get_irq_chip_data(irq);
ctrl_outw( ctrl_inw( p->addr ) & ~p->priority , p->addr );
}
static struct irq_chip se7722_irq_chip __read_mostly = {
.name = "SE7722",
.mask = disable_se7722_irq,
.unmask = enable_se7722_irq,
.mask_ack = disable_se7722_irq,
};
static struct ipr_data ipr_irq_table[] = {
/* irq ,idx,sft, priority , addr */
{ MRSHPC_IRQ0 , 0 , 0 , MRSHPC_BIT0 , IRQ01_MASK } ,
{ MRSHPC_IRQ1 , 0 , 0 , MRSHPC_BIT1 , IRQ01_MASK } ,
{ MRSHPC_IRQ2 , 0 , 0 , MRSHPC_BIT2 , IRQ01_MASK } ,
{ MRSHPC_IRQ3 , 0 , 0 , MRSHPC_BIT3 , IRQ01_MASK } ,
{ SMC_IRQ , 0 , 0 , SMC_BIT , IRQ01_MASK } ,
{ EXT_IRQ , 0 , 0 , EXT_BIT , IRQ01_MASK } ,
};
int se7722_irq_demux(int irq)
{
if ((irq == IRQ0_IRQ)||(irq == IRQ1_IRQ)) {
volatile unsigned short intv =
*(volatile unsigned short *)IRQ01_STS;
if (irq == IRQ0_IRQ){
if(intv & SMC_BIT ) {
return SMC_IRQ;
} else if(intv & USB_BIT) {
return USB_IRQ;
} else {
printk("intv =%04x\n", intv);
return SMC_IRQ;
}
} else if(irq == IRQ1_IRQ){
if(intv & MRSHPC_BIT0) {
return MRSHPC_IRQ0;
} else if(intv & MRSHPC_BIT1) {
return MRSHPC_IRQ1;
} else if(intv & MRSHPC_BIT2) {
return MRSHPC_IRQ2;
} else if(intv & MRSHPC_BIT3) {
return MRSHPC_IRQ3;
} else {
printk("BIT_EXTENTION =%04x\n", intv);
return EXT_IRQ;
}
}
}
return irq;
}
/*
* Initialize IRQ setting
*/
void __init init_se7722_IRQ(void)
{
int i = 0;
ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */
ctrl_outl((3 << ((7 - 0) * 4))|(3 << ((7 - 1) * 4)), INTC_INTPRI0); /* irq0 pri=3,irq1,pri=3 */
ctrl_outw((2 << ((7 - 0) * 2))|(2 << ((7 - 1) * 2)), INTC_ICR1); /* irq0,1 low-level irq */
for (i = 0; i < ARRAY_SIZE(ipr_irq_table); i++) {
disable_irq_nosync(ipr_irq_table[i].irq);
set_irq_chip_and_handler_name( ipr_irq_table[i].irq, &se7722_irq_chip,
handle_level_irq, "level");
set_irq_chip_data( ipr_irq_table[i].irq, &ipr_irq_table[i] );
disable_se7722_irq(ipr_irq_table[i].irq);
}
}
/*
* 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/pata_platform.h>
#include <asm/machvec.h>
#include <asm/se7722.h>
#include <asm/io.h>
/* Heartbeat */
static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
static struct resource heartbeat_resources[] = {
[0] = {
.start = PA_LED,
.end = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device heartbeat_device = {
.name = "heartbeat",
.id = -1,
.dev = {
.platform_data = heartbeat_bit_pos,
},
.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 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 *se7722_devices[] __initdata = {
&heartbeat_device,
&smc91x_eth_device,
&cf_ide_device,
};
static int __init se7722_devices_setup(void)
{
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_outl(0x00051001, MSTPCR0);
ctrl_outl(0x00000000, MSTPCR1);
/* KEYSC, VOU, BEU, CEU, VEU, VPU, LCDC */
ctrl_outl(0xffffbfC0, MSTPCR2);
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);
}
/*
* The Machine Vector
*/
struct sh_machine_vector mv_se7722 __initmv = {
.mv_name = "Solution Engine 7722" ,
.mv_setup = se7722_setup ,
.mv_nr_irqs = 109 ,
.mv_init_irq = init_se7722_IRQ,
.mv_irq_demux = se7722_irq_demux,
};
ALIAS_MV(se7722)
...@@ -14,153 +14,6 @@ ...@@ -14,153 +14,6 @@
#include <asm/se7751.h> #include <asm/se7751.h>
#include <asm/io.h> #include <asm/io.h>
void init_7751se_IRQ(void);
#ifdef CONFIG_SH_KGDB
#include <asm/kgdb.h>
static int kgdb_uart_setup(void);
static struct kgdb_sermap kgdb_uart_sermap =
{ "ttyS", 0, kgdb_uart_setup, NULL };
#endif
/*
* Initialize the board
*/
static void __init sh7751se_setup(char **cmdline_p)
{
/* Call init_smsc() replacement to set up SuperIO. */
/* XXX: RTC setting comes here */
#ifdef CONFIG_SH_KGDB
kgdb_register_sermap(&kgdb_uart_sermap);
#endif
}
/*********************************************************************
* Currently a hack (e.g. does not interact well w/serial.c, lots of *
* hardcoded stuff) but may be useful if SCI/F needs debugging. *
* Mostly copied from x86 code (see files asm-i386/kgdb_local.h and *
* arch/i386/lib/kgdb_serial.c). *
*********************************************************************/
#ifdef CONFIG_SH_KGDB
#include <linux/types.h>
#include <linux/serial.h>
#include <linux/serialP.h>
#include <linux/serial_reg.h>
#define COM1_PORT 0x3f8 /* Base I/O address */
#define COM1_IRQ 4 /* IRQ not used yet */
#define COM2_PORT 0x2f8 /* Base I/O address */
#define COM2_IRQ 3 /* IRQ not used yet */
#define SB_CLOCK 1843200 /* Serial baud clock */
#define SB_BASE (SB_CLOCK/16)
#define SB_MCR UART_MCR_OUT2 | UART_MCR_DTR | UART_MCR_RTS
struct uart_port {
int base;
};
#define UART_NPORTS 2
struct uart_port uart_ports[] = {
{ COM1_PORT },
{ COM2_PORT },
};
struct uart_port *kgdb_uart_port;
#define UART_IN(reg) inb_p(kgdb_uart_port->base + reg)
#define UART_OUT(reg,v) outb_p((v), kgdb_uart_port->base + reg)
/* Basic read/write functions for the UART */
#define UART_LSR_RXCERR (UART_LSR_BI | UART_LSR_FE | UART_LSR_PE)
static int kgdb_uart_getchar(void)
{
int lsr;
int c = -1;
while (c == -1) {
lsr = UART_IN(UART_LSR);
if (lsr & UART_LSR_DR)
c = UART_IN(UART_RX);
if ((lsr & UART_LSR_RXCERR))
c = -1;
}
return c;
}
static void kgdb_uart_putchar(int c)
{
while ((UART_IN(UART_LSR) & UART_LSR_THRE) == 0)
;
UART_OUT(UART_TX, c);
}
/*
* Initialize UART to configured/requested values.
* (But we don't interrupts yet, or interact w/serial.c)
*/
static int kgdb_uart_setup(void)
{
int port;
int lcr = 0;
int bdiv = 0;
if (kgdb_portnum >= UART_NPORTS) {
KGDB_PRINTK("uart port %d invalid.\n", kgdb_portnum);
return -1;
}
kgdb_uart_port = &uart_ports[kgdb_portnum];
/* Init sequence from gdb_hook_interrupt */
UART_IN(UART_RX);
UART_OUT(UART_IER, 0);
UART_IN(UART_RX); /* Serial driver comments say */
UART_IN(UART_IIR); /* this clears interrupt regs */
UART_IN(UART_MSR);
/* Figure basic LCR values */
switch (kgdb_bits) {
case '7':
lcr |= UART_LCR_WLEN7;
break;
default: case '8':
lcr |= UART_LCR_WLEN8;
break;
}
switch (kgdb_parity) {
case 'O':
lcr |= UART_LCR_PARITY;
break;
case 'E':
lcr |= (UART_LCR_PARITY | UART_LCR_EPAR);
break;
default: break;
}
/* Figure the baud rate divisor */
bdiv = (SB_BASE/kgdb_baud);
/* Set the baud rate and LCR values */
UART_OUT(UART_LCR, (lcr | UART_LCR_DLAB));
UART_OUT(UART_DLL, (bdiv & 0xff));
UART_OUT(UART_DLM, ((bdiv >> 8) & 0xff));
UART_OUT(UART_LCR, lcr);
/* Set the MCR */
UART_OUT(UART_MCR, SB_MCR);
/* Turn off FIFOs for now */
UART_OUT(UART_FCR, 0);
/* Setup complete: initialize function pointers */
kgdb_getchar = kgdb_uart_getchar;
kgdb_putchar = kgdb_uart_putchar;
return 0;
}
#endif /* CONFIG_SH_KGDB */
static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
static struct resource heartbeat_resources[] = { static struct resource heartbeat_resources[] = {
...@@ -197,7 +50,6 @@ __initcall(se7751_devices_setup); ...@@ -197,7 +50,6 @@ __initcall(se7751_devices_setup);
*/ */
struct sh_machine_vector mv_7751se __initmv = { struct sh_machine_vector mv_7751se __initmv = {
.mv_name = "7751 SolutionEngine", .mv_name = "7751 SolutionEngine",
.mv_setup = sh7751se_setup,
.mv_nr_irqs = 72, .mv_nr_irqs = 72,
.mv_inb = sh7751se_inb, .mv_inb = sh7751se_inb,
......
#
# 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
/*
* 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>
#define INTC_INTMSK0 0xFFD00044
#define INTC_INTMSKCLR0 0xFFD00064
static void disable_se7780_irq(unsigned int irq)
{
struct intc2_data *p = get_irq_chip_data(irq);
ctrl_outl(1 << p->msk_shift, INTC_INTMSK0 + p->msk_offset);
}
static void enable_se7780_irq(unsigned int irq)
{
struct intc2_data *p = get_irq_chip_data(irq);
ctrl_outl(1 << p->msk_shift, INTC_INTMSKCLR0 + p->msk_offset);
}
static struct irq_chip se7780_irq_chip __read_mostly = {
.name = "SE7780",
.mask = disable_se7780_irq,
.unmask = enable_se7780_irq,
.mask_ack = disable_se7780_irq,
};
static struct intc2_data intc2_irq_table[] = {
{ 2, 0, 31, 0, 31, 3 }, /* daughter board EXTINT1 */
{ 4, 0, 30, 0, 30, 3 }, /* daughter board EXTINT2 */
{ 6, 0, 29, 0, 29, 3 }, /* daughter board EXTINT3 */
{ 8, 0, 28, 0, 28, 3 }, /* SMC 91C111 (LAN) */
{ 10, 0, 27, 0, 27, 3 }, /* daughter board EXTINT4 */
{ 4, 0, 30, 0, 30, 3 }, /* daughter board EXTINT5 */
{ 2, 0, 31, 0, 31, 3 }, /* daughter board EXTINT6 */
{ 2, 0, 31, 0, 31, 3 }, /* daughter board EXTINT7 */
{ 2, 0, 31, 0, 31, 3 }, /* daughter board EXTINT8 */
{ 0 , 0, 24, 0, 24, 3 }, /* SM501 */
};
/*
* Initialize IRQ setting
*/
void __init init_se7780_IRQ(void)
{
int i ;
/* 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);
for (i = 0; i < ARRAY_SIZE(intc2_irq_table); i++) {
disable_irq_nosync(intc2_irq_table[i].irq);
set_irq_chip_and_handler_name( intc2_irq_table[i].irq, &se7780_irq_chip,
handle_level_irq, "level");
set_irq_chip_data( intc2_irq_table[i].irq, &intc2_irq_table[i] );
disable_se7780_irq(intc2_irq_table[i].irq);
}
}
/*
* 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>
/* Heartbeat */
static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
static struct resource heartbeat_resources[] = {
[0] = {
.start = PA_LED,
.end = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device heartbeat_device = {
.name = "heartbeat",
.id = -1,
.dev = {
.platform_data = heartbeat_bit_pos,
},
.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
*/
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,
};
ALIAS_MV(se7780)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.18 # Linux kernel version: 2.6.21-rc5
# Tue Oct 3 12:03:04 2006 # Thu Apr 26 09:16:31 2007
# #
CONFIG_SUPERH=y CONFIG_SUPERH=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_GENERIC_CALIBRATE_DELAY=y
# CONFIG_GENERIC_TIME is not set
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
# #
...@@ -33,7 +39,9 @@ CONFIG_LOCALVERSION_AUTO=y ...@@ -33,7 +39,9 @@ CONFIG_LOCALVERSION_AUTO=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_AUDIT is not set # CONFIG_AUDIT is not set
# CONFIG_IKCONFIG is not set # CONFIG_IKCONFIG is not set
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_RELAY is not set # CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="" CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y CONFIG_SYSCTL=y
...@@ -91,27 +99,30 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" ...@@ -91,27 +99,30 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
CONFIG_SOLUTION_ENGINE=y CONFIG_SOLUTION_ENGINE=y
CONFIG_SH_SOLUTION_ENGINE=y CONFIG_SH_SOLUTION_ENGINE=y
# CONFIG_SH_7751_SOLUTION_ENGINE is not set # CONFIG_SH_7751_SOLUTION_ENGINE is not set
# CONFIG_SH_7780_SOLUTION_ENGINE is not set
# CONFIG_SH_7300_SOLUTION_ENGINE is not set # CONFIG_SH_7300_SOLUTION_ENGINE is not set
# CONFIG_SH_7343_SOLUTION_ENGINE is not set # CONFIG_SH_7343_SOLUTION_ENGINE is not set
# CONFIG_SH_73180_SOLUTION_ENGINE is not set # CONFIG_SH_73180_SOLUTION_ENGINE is not set
# CONFIG_SH_7722_SOLUTION_ENGINE is not set
# CONFIG_SH_7751_SYSTEMH is not set # CONFIG_SH_7751_SYSTEMH is not set
# CONFIG_SH_HP6XX is not set # CONFIG_SH_HP6XX is not set
# CONFIG_SH_EC3104 is not set
# CONFIG_SH_SATURN is not set # CONFIG_SH_SATURN is not set
# CONFIG_SH_DREAMCAST is not set # CONFIG_SH_DREAMCAST is not set
# CONFIG_SH_BIGSUR is not set
# CONFIG_SH_MPC1211 is not set # CONFIG_SH_MPC1211 is not set
# CONFIG_SH_SH03 is not set # CONFIG_SH_SH03 is not set
# CONFIG_SH_SECUREEDGE5410 is not set # CONFIG_SH_SECUREEDGE5410 is not set
# CONFIG_SH_HS7751RVOIP is not set # CONFIG_SH_HS7751RVOIP is not set
# CONFIG_SH_7710VOIPGW is not set # CONFIG_SH_7710VOIPGW is not set
# CONFIG_SH_RTS7751R2D is not set # CONFIG_SH_RTS7751R2D is not set
# CONFIG_SH_R7780RP is not set # CONFIG_SH_HIGHLANDER is not set
# CONFIG_SH_EDOSK7705 is not set # CONFIG_SH_EDOSK7705 is not set
# CONFIG_SH_SH4202_MICRODEV is not set # CONFIG_SH_SH4202_MICRODEV is not set
# CONFIG_SH_LANDISK is not set # CONFIG_SH_LANDISK is not set
# CONFIG_SH_TITAN is not set # CONFIG_SH_TITAN is not set
# CONFIG_SH_SHMIN is not set # CONFIG_SH_SHMIN is not set
# CONFIG_SH_7206_SOLUTION_ENGINE is not set
# CONFIG_SH_7619_SOLUTION_ENGINE is not set
# CONFIG_SH_LBOX_RE2 is not set
# CONFIG_SH_UNKNOWN is not set # CONFIG_SH_UNKNOWN is not set
# #
...@@ -123,6 +134,12 @@ CONFIG_CPU_SH3=y ...@@ -123,6 +134,12 @@ CONFIG_CPU_SH3=y
# SH-2 Processor Support # SH-2 Processor Support
# #
# CONFIG_CPU_SUBTYPE_SH7604 is not set # CONFIG_CPU_SUBTYPE_SH7604 is not set
# CONFIG_CPU_SUBTYPE_SH7619 is not set
#
# SH-2A Processor Support
#
# CONFIG_CPU_SUBTYPE_SH7206 is not set
# #
# SH-3 Processor Support # SH-3 Processor Support
...@@ -134,6 +151,7 @@ CONFIG_CPU_SUBTYPE_SH7705=y ...@@ -134,6 +151,7 @@ CONFIG_CPU_SUBTYPE_SH7705=y
# CONFIG_CPU_SUBTYPE_SH7708 is not set # CONFIG_CPU_SUBTYPE_SH7708 is not set
# CONFIG_CPU_SUBTYPE_SH7709 is not set # CONFIG_CPU_SUBTYPE_SH7709 is not set
# CONFIG_CPU_SUBTYPE_SH7710 is not set # CONFIG_CPU_SUBTYPE_SH7710 is not set
# CONFIG_CPU_SUBTYPE_SH7712 is not set
# #
# SH-4 Processor Support # SH-4 Processor Support
...@@ -158,12 +176,14 @@ CONFIG_CPU_SUBTYPE_SH7705=y ...@@ -158,12 +176,14 @@ CONFIG_CPU_SUBTYPE_SH7705=y
# #
# CONFIG_CPU_SUBTYPE_SH7770 is not set # CONFIG_CPU_SUBTYPE_SH7770 is not set
# CONFIG_CPU_SUBTYPE_SH7780 is not set # CONFIG_CPU_SUBTYPE_SH7780 is not set
# CONFIG_CPU_SUBTYPE_SH7785 is not set
# #
# SH4AL-DSP Processor Support # SH4AL-DSP Processor Support
# #
# CONFIG_CPU_SUBTYPE_SH73180 is not set # CONFIG_CPU_SUBTYPE_SH73180 is not set
# CONFIG_CPU_SUBTYPE_SH7343 is not set # CONFIG_CPU_SUBTYPE_SH7343 is not set
# CONFIG_CPU_SUBTYPE_SH7722 is not set
# #
# Memory management options # Memory management options
...@@ -173,6 +193,11 @@ CONFIG_PAGE_OFFSET=0x80000000 ...@@ -173,6 +193,11 @@ CONFIG_PAGE_OFFSET=0x80000000
CONFIG_MEMORY_START=0x0c000000 CONFIG_MEMORY_START=0x0c000000
CONFIG_MEMORY_SIZE=0x02000000 CONFIG_MEMORY_SIZE=0x02000000
CONFIG_VSYSCALL=y CONFIG_VSYSCALL=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_PAGE_SIZE_4KB=y
# CONFIG_PAGE_SIZE_8KB is not set
# CONFIG_PAGE_SIZE_64KB is not set
CONFIG_SELECT_MEMORY_MODEL=y CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set # CONFIG_DISCONTIGMEM_MANUAL is not set
...@@ -182,6 +207,7 @@ CONFIG_FLAT_NODE_MEM_MAP=y ...@@ -182,6 +207,7 @@ CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set # CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_RESOURCES_64BIT is not set # CONFIG_RESOURCES_64BIT is not set
CONFIG_ZONE_DMA_FLAG=0
# #
# Cache configuration # Cache configuration
...@@ -190,23 +216,31 @@ CONFIG_SH7705_CACHE_32KB=y ...@@ -190,23 +216,31 @@ CONFIG_SH7705_CACHE_32KB=y
# CONFIG_SH_DIRECT_MAPPED is not set # CONFIG_SH_DIRECT_MAPPED is not set
# CONFIG_SH_WRITETHROUGH is not set # CONFIG_SH_WRITETHROUGH is not set
# CONFIG_SH_OCRAM is not set # CONFIG_SH_OCRAM is not set
# CONFIG_CF_ENABLER is not set CONFIG_CF_ENABLER=y
# CONFIG_CF_AREA5 is not set
CONFIG_CF_AREA6=y
# CONFIG_CF_AREA4 is not set
CONFIG_CF_BASE_ADDR=0xb8000000
# #
# Processor features # Processor features
# #
CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_LITTLE_ENDIAN=y
# CONFIG_CPU_BIG_ENDIAN is not set
# CONFIG_SH_FPU_EMU is not set # CONFIG_SH_FPU_EMU is not set
# CONFIG_SH_DSP is not set # CONFIG_SH_DSP is not set
# CONFIG_SH_ADC is not set # CONFIG_SH_ADC is not set
CONFIG_CPU_HAS_INTEVT=y CONFIG_CPU_HAS_INTEVT=y
CONFIG_CPU_HAS_PINT_IRQ=y CONFIG_CPU_HAS_PINT_IRQ=y
CONFIG_CPU_HAS_IPR_IRQ=y
CONFIG_CPU_HAS_SR_RB=y CONFIG_CPU_HAS_SR_RB=y
# #
# Timer support # Timer and clock configuration
# #
CONFIG_SH_TMU=y CONFIG_SH_TMU=y
CONFIG_SH_TIMER_IRQ=16
# CONFIG_NO_IDLE_HZ is not set
CONFIG_SH_PCLK_FREQ=33333333 CONFIG_SH_PCLK_FREQ=33333333
# #
...@@ -223,13 +257,19 @@ CONFIG_SH_PCLK_FREQ=33333333 ...@@ -223,13 +257,19 @@ CONFIG_SH_PCLK_FREQ=33333333
# Companion Chips # Companion Chips
# #
# CONFIG_HD6446X_SERIES is not set # CONFIG_HD6446X_SERIES is not set
#
# Additional SuperH Device Drivers
#
CONFIG_HEARTBEAT=y CONFIG_HEARTBEAT=y
# CONFIG_PUSH_SWITCH is not set
# #
# Kernel features # Kernel features
# #
# CONFIG_HZ_100 is not set # CONFIG_HZ_100 is not set
CONFIG_HZ_250=y CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set # CONFIG_HZ_1000 is not set
CONFIG_HZ=250 CONFIG_HZ=250
# CONFIG_KEXEC is not set # CONFIG_KEXEC is not set
...@@ -287,6 +327,7 @@ CONFIG_UNIX=y ...@@ -287,6 +327,7 @@ CONFIG_UNIX=y
CONFIG_XFRM=y CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set # CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set # CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_NET_KEY is not set # CONFIG_NET_KEY is not set
CONFIG_INET=y CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set # CONFIG_IP_MULTICAST is not set
...@@ -307,11 +348,13 @@ CONFIG_IP_PNP_RARP=y ...@@ -307,11 +348,13 @@ CONFIG_IP_PNP_RARP=y
# CONFIG_INET_TUNNEL is not set # CONFIG_INET_TUNNEL is not set
CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TRANSPORT=y
CONFIG_INET_XFRM_MODE_TUNNEL=y CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_XFRM_MODE_BEET=y
CONFIG_INET_DIAG=y CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y CONFIG_INET_TCP_DIAG=y
# CONFIG_TCP_CONG_ADVANCED is not set # CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic" CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set # CONFIG_IPV6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set # CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set # CONFIG_INET6_TUNNEL is not set
...@@ -388,6 +431,7 @@ CONFIG_MTD_PARTITIONS=y ...@@ -388,6 +431,7 @@ CONFIG_MTD_PARTITIONS=y
# User Modules And Translation Layers # User Modules And Translation Layers
# #
CONFIG_MTD_CHAR=y CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set # CONFIG_FTL is not set
# CONFIG_NFTL is not set # CONFIG_NFTL is not set
...@@ -461,6 +505,7 @@ CONFIG_MTD_CFI_UTIL=y ...@@ -461,6 +505,7 @@ CONFIG_MTD_CFI_UTIL=y
# #
# Plug and Play support # Plug and Play support
# #
# CONFIG_PNPACPI is not set
# #
# Block devices # Block devices
...@@ -472,10 +517,13 @@ CONFIG_BLK_DEV_RAM=y ...@@ -472,10 +517,13 @@ CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
CONFIG_BLK_DEV_INITRD=y
# CONFIG_CDROM_PKTCDVD is not set # CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set # CONFIG_ATA_OVER_ETH is not set
#
# Misc devices
#
# #
# ATA/ATAPI/MFM/RLL support # ATA/ATAPI/MFM/RLL support
# #
...@@ -649,17 +697,12 @@ CONFIG_HW_RANDOM=y ...@@ -649,17 +697,12 @@ CONFIG_HW_RANDOM=y
# CONFIG_GEN_RTC is not set # CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
# CONFIG_R3964 is not set # CONFIG_R3964 is not set
#
# Ftape, the floppy tape device driver
#
# CONFIG_RAW_DRIVER is not set # CONFIG_RAW_DRIVER is not set
# #
# TPM devices # TPM devices
# #
# CONFIG_TCG_TPM is not set # CONFIG_TCG_TPM is not set
# CONFIG_TELCLOCK is not set
# #
# I2C support # I2C support
...@@ -675,6 +718,7 @@ CONFIG_HW_RANDOM=y ...@@ -675,6 +718,7 @@ CONFIG_HW_RANDOM=y
# #
# Dallas's 1-wire bus # Dallas's 1-wire bus
# #
# CONFIG_W1 is not set
# #
# Hardware Monitoring support # Hardware Monitoring support
...@@ -683,18 +727,19 @@ CONFIG_HWMON=y ...@@ -683,18 +727,19 @@ CONFIG_HWMON=y
# CONFIG_HWMON_VID is not set # CONFIG_HWMON_VID is not set
# CONFIG_SENSORS_ABITUGURU is not set # CONFIG_SENSORS_ABITUGURU is not set
# CONFIG_SENSORS_F71805F is not set # CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_VT1211 is not set # CONFIG_SENSORS_VT1211 is not set
# CONFIG_HWMON_DEBUG_CHIP is not set # CONFIG_HWMON_DEBUG_CHIP is not set
# #
# Misc devices # Multifunction device drivers
# #
# CONFIG_MFD_SM501 is not set
# #
# Multimedia devices # Multimedia devices
# #
# CONFIG_VIDEO_DEV is not set # CONFIG_VIDEO_DEV is not set
CONFIG_VIDEO_V4L2=y
# #
# Digital Video Broadcasting Devices # Digital Video Broadcasting Devices
...@@ -704,7 +749,7 @@ CONFIG_VIDEO_V4L2=y ...@@ -704,7 +749,7 @@ CONFIG_VIDEO_V4L2=y
# #
# Graphics support # Graphics support
# #
CONFIG_FIRMWARE_EDID=y # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
# CONFIG_FB is not set # CONFIG_FB is not set
# #
...@@ -712,6 +757,12 @@ CONFIG_FIRMWARE_EDID=y ...@@ -712,6 +757,12 @@ CONFIG_FIRMWARE_EDID=y
# #
# CONFIG_SOUND is not set # CONFIG_SOUND is not set
#
# HID Devices
#
CONFIG_HID=y
# CONFIG_HID_DEBUG is not set
# #
# USB support # USB support
# #
...@@ -772,6 +823,14 @@ CONFIG_FIRMWARE_EDID=y ...@@ -772,6 +823,14 @@ CONFIG_FIRMWARE_EDID=y
# DMA Devices # DMA Devices
# #
#
# Auxiliary Display support
#
#
# Virtualization
#
# #
# File systems # File systems
# #
...@@ -779,10 +838,12 @@ CONFIG_EXT2_FS=y ...@@ -779,10 +838,12 @@ CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set # CONFIG_EXT2_FS_XIP is not set
# CONFIG_EXT3_FS is not set # CONFIG_EXT3_FS is not set
# CONFIG_EXT4DEV_FS is not set
# CONFIG_REISERFS_FS is not set # CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set # CONFIG_JFS_FS is not set
# CONFIG_FS_POSIX_ACL is not set # CONFIG_FS_POSIX_ACL is not set
# CONFIG_XFS_FS is not set # CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_MINIX_FS is not set # CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set # CONFIG_ROMFS_FS is not set
CONFIG_INOTIFY=y CONFIG_INOTIFY=y
...@@ -828,7 +889,6 @@ CONFIG_RAMFS=y ...@@ -828,7 +889,6 @@ CONFIG_RAMFS=y
# CONFIG_BEFS_FS is not set # CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set # CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set # CONFIG_EFS_FS is not set
# CONFIG_JFFS_FS is not set
CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y CONFIG_JFFS2_FS_WRITEBUFFER=y
...@@ -877,6 +937,10 @@ CONFIG_MSDOS_PARTITION=y ...@@ -877,6 +937,10 @@ CONFIG_MSDOS_PARTITION=y
# #
# CONFIG_NLS is not set # CONFIG_NLS is not set
#
# Distributed Lock Manager
#
# #
# Profiling support # Profiling support
# #
...@@ -885,15 +949,18 @@ CONFIG_MSDOS_PARTITION=y ...@@ -885,15 +949,18 @@ CONFIG_MSDOS_PARTITION=y
# #
# Kernel hacking # Kernel hacking
# #
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_PRINTK_TIME is not set # CONFIG_PRINTK_TIME is not set
CONFIG_ENABLE_MUST_CHECK=y CONFIG_ENABLE_MUST_CHECK=y
# CONFIG_MAGIC_SYSRQ is not set # CONFIG_MAGIC_SYSRQ is not set
# CONFIG_UNUSED_SYMBOLS is not set # CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_KERNEL is not set # CONFIG_DEBUG_KERNEL is not set
CONFIG_LOG_BUF_SHIFT=14 CONFIG_LOG_BUF_SHIFT=14
# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_SH_STANDARD_BIOS is not set # CONFIG_SH_STANDARD_BIOS is not set
# CONFIG_KGDB is not set # CONFIG_EARLY_SCIF_CONSOLE is not set
# CONFIG_SH_KGDB is not set
# #
# Security options # Security options
...@@ -908,6 +975,7 @@ CONFIG_LOG_BUF_SHIFT=14 ...@@ -908,6 +975,7 @@ CONFIG_LOG_BUF_SHIFT=14
# #
# Library routines # Library routines
# #
CONFIG_BITREVERSE=y
CONFIG_CRC_CCITT=y CONFIG_CRC_CCITT=y
# CONFIG_CRC16 is not set # CONFIG_CRC16 is not set
CONFIG_CRC32=y CONFIG_CRC32=y
...@@ -915,3 +983,5 @@ CONFIG_CRC32=y ...@@ -915,3 +983,5 @@ CONFIG_CRC32=y
CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_DEFLATE=y
CONFIG_PLIST=y CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
source "arch/sh/drivers/dma/Kconfig"
source "arch/sh/cchips/Kconfig"
menu "Additional SuperH Device Drivers" menu "Additional SuperH Device Drivers"
config HEARTBEAT
bool "Heartbeat LED"
help
Use the power-on LED on your machine as a load meter. The exact
behavior is platform-dependent, but normally the flash frequency is
a hyperbolic function of the 5-minute load average.
config PUSH_SWITCH config PUSH_SWITCH
tristate "Push switch support" tristate "Push switch support"
help help
......
This diff is collapsed.
...@@ -8,12 +8,15 @@ obj-$(CONFIG_PCI_AUTO) += pci-auto.o ...@@ -8,12 +8,15 @@ obj-$(CONFIG_PCI_AUTO) += pci-auto.o
obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += pci-st40.o obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += pci-st40.o
obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o
obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o
obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o
obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \ obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \
dma-dreamcast.o dma-dreamcast.o
obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o
obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o
obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o
obj-$(CONFIG_SH_R7780RP) += ops-r7780rp.o fixups-r7780rp.o obj-$(CONFIG_SH_HIGHLANDER) += ops-r7780rp.o fixups-r7780rp.o
obj-$(CONFIG_SH_TITAN) += ops-titan.o obj-$(CONFIG_SH_TITAN) += ops-titan.o
obj-$(CONFIG_SH_LANDISK) += ops-landisk.o obj-$(CONFIG_SH_LANDISK) += ops-landisk.o
obj-$(CONFIG_SH_LBOX_RE2) += ops-lboxre2.o fixups-lboxre2.o
obj-$(CONFIG_SH_7780_SOLUTION_ENGINE) += ops-se7780.o fixups-se7780.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment