]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sh: various fixes
authorAndrew Morton <akpm@osdl.org>
Mon, 22 Mar 2004 23:25:10 +0000 (15:25 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 22 Mar 2004 23:25:10 +0000 (15:25 -0800)
From: Paul Mundt <lethal@linux-sh.org>

This is the rest of the sh update, which includes everything else
sh-specific, general cleanups, bugfixes, etc.  Nothing really eventful.

38 files changed:
arch/sh/Kconfig
arch/sh/boards/hp6xx/hp680/mach.c
arch/sh/boards/hp6xx/hp680/setup.c
arch/sh/boards/se/770x/io.c
arch/sh/boards/se/770x/irq.c
arch/sh/cchips/Kconfig
arch/sh/cchips/hd6446x/hd64461/io.c
arch/sh/cchips/hd6446x/hd64461/setup.c
arch/sh/kernel/cf-enabler.c
arch/sh/kernel/cpu/irq_ipr.c
arch/sh/kernel/cpu/sh4/sq.c
arch/sh/kernel/entry.S
arch/sh/kernel/io.c
arch/sh/kernel/module.c
arch/sh/kernel/process.c
arch/sh/kernel/sh_ksyms.c
arch/sh/kernel/sys_sh.c
arch/sh/kernel/time.c
arch/sh/kernel/traps.c
arch/sh/mm/cache-sh4.c
arch/sh/mm/init.c
arch/sh/mm/ioremap.c
drivers/char/watchdog/shwdt.c
drivers/input/keyboard/maple_keyb.c
drivers/input/mouse/maplemouse.c
drivers/net/stnic.c
include/asm-sh/cpu-sh3/cacheflush.h
include/asm-sh/cpu-sh3/dac.h [new file with mode: 0644]
include/asm-sh/dreamcast/io.h [deleted file]
include/asm-sh/hd64461/hd64461.h
include/asm-sh/hd64461/io.h
include/asm-sh/hp6xx/hp6xx.h [new file with mode: 0644]
include/asm-sh/irq.h
include/asm-sh/pgtable.h
include/asm-sh/processor.h
include/asm-sh/sh2000/io.h [deleted file]
include/asm-sh/signal.h
include/linux/miscdevice.h

index 527dcd135799fa01fb527188221135b171e04168..8efb8e02aaf7214a963c7a82cd7b8eb211a4b413 100644 (file)
@@ -27,7 +27,6 @@ config RWSEM_XCHGADD_ALGORITHM
 
 source "init/Kconfig"
 
-
 menu "System type"
 
 choice
@@ -528,6 +527,8 @@ config SH_PCLK_FREQ
          with an auto-probed frequency which should be considered the proper
          value for your hardware.
 
+menu "CPU Frequency scaling"
+
 config CPU_FREQ
        bool "CPU Frequency scaling"
        help
@@ -538,6 +539,8 @@ config CPU_FREQ
 
          If unsure, say N.
 
+source "drivers/cpufreq/Kconfig"
+
 config CPU_FREQ_TABLE
        tristate "CPU frequency table helpers"
        depends on CPU_FREQ
@@ -559,12 +562,20 @@ config SH_CPU_FREQ
 
          If unsure, say N.
 
-source "drivers/cpufreq/Kconfig"
+endmenu
 
 source "arch/sh/drivers/dma/Kconfig"
 
 source "arch/sh/cchips/Kconfig"
 
+config HEARTBEAT
+       bool "Heartbeat LED"
+       depends on SH_MPC1211 || SH_CAT68701 || SH_STB1_HARP || SH_STB1_OVERDRIVE || SH_BIGSUR || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE
+       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.
+
 endmenu
 
 
@@ -614,8 +625,9 @@ config SBUS
        bool
 
 config MAPLE
-       bool
-       default y if SH_DREAMCAST
+       tristate "Maple Bus support"
+       depends on SH_DREAMCAST
+       default y
 
 source "arch/sh/drivers/pci/Kconfig"
 
@@ -634,351 +646,10 @@ source "fs/Kconfig.binfmt"
 
 endmenu
 
-source "drivers/base/Kconfig"
-
-source "drivers/mtd/Kconfig"
-
-source "drivers/parport/Kconfig"
-
-source "drivers/block/Kconfig"
-
-source "drivers/ide/Kconfig"
-
-source "drivers/scsi/Kconfig"
-
-source "drivers/cdrom/Kconfig"
-
-source "drivers/md/Kconfig"
-
-source "drivers/ieee1394/Kconfig"
-
-source "net/Kconfig"
-
-source "drivers/isdn/Kconfig"
-
-source "drivers/telephony/Kconfig"
-
-#
-# input - input/joystick depends on it. As does USB.
-#
-source "drivers/input/Kconfig"
-
-menu "Character devices"
-
-config VT
-       bool "Virtual terminal"
-       ---help---
-         If you say Y here, you will get support for terminal devices with
-         display and keyboard devices. These are called "virtual" because you
-         can run several virtual terminals (also called virtual consoles) on
-         one physical terminal. This is rather useful, for example one
-         virtual terminal can collect system messages and warnings, another
-         one can be used for a text-mode user session, and a third could run
-         an X session, all in parallel. Switching between virtual terminals
-         is done with certain key combinations, usually Alt-<function key>.
-
-         The setterm command ("man setterm") can be used to change the
-         properties (such as colors or beeping) of a virtual terminal. The
-         man page console_codes(4) ("man console_codes") contains the special
-         character sequences that can be used to change those properties
-         directly. The fonts used on virtual terminals can be changed with
-         the setfont ("man setfont") command and the key bindings are defined
-         with the loadkeys ("man loadkeys") command.
-
-         You need at least one virtual terminal device in order to make use
-         of your keyboard and monitor. Therefore, only people configuring an
-         embedded system would want to say N here in order to save some
-         memory; the only way to log into such a system is then via a serial
-         or network connection.
-
-         If unsure, say Y, or else you won't be able to do much with your new
-         shiny Linux system :-)
-
-config VT_CONSOLE
-       bool "Support for console on virtual terminal"
-       depends on VT
-       ---help---
-         The system console is the device which receives all kernel messages
-         and warnings and which allows logins in single user mode. If you
-         answer Y here, a virtual terminal (the device used to interact with
-         a physical terminal) can be used as system console. This is the most
-         common mode of operations, so you should say Y here unless you want
-         the kernel messages be output only to a serial port (in which case
-         you should say Y to "Console on serial port", below).
-
-         If you do say Y here, by default the currently visible virtual
-         terminal (/dev/tty0) will be used as system console. You can change
-         that with a kernel command line option such as "console=tty3" which
-         would use the third virtual terminal as system console. (Try "man
-         bootparam" or see the documentation of your boot loader (lilo or
-         loadlin) about how to pass options to the kernel at boot time.)
-
-         If unsure, say Y.
-
-config HW_CONSOLE
-       bool
-       depends on VT && !S390 && !UM
-       default y
-
-config SERIAL
-       tristate "Serial (8250, 16450, 16550 or compatible) support"
-       ---help---
-         This selects whether you want to include the driver for the standard
-         serial ports.  The standard answer is Y.  People who might say N
-         here are those that are setting up dedicated Ethernet WWW/FTP
-         servers, or users that have one of the various bus mice instead of a
-         serial mouse and don't intend to use their machine's standard serial
-         port for anything.  (Note that the Cyclades and Stallion multi
-         serial port drivers do not need this driver built in for them to
-         work.)
-
-         To compile this driver as a module, choose M here: the
-         module will be called serial.
-         [WARNING: Do not compile this driver as a module if you are using
-         non-standard serial ports, since the configuration information will
-         be lost when the driver is unloaded.  This limitation may be lifted
-         in the future.]
-
-         BTW1: If you have a mouseman serial mouse which is not recognized by
-         the X window system, try running gpm first.
-
-         BTW2: If you intend to use a software modem (also called Winmodem)
-         under Linux, forget it.  These modems are crippled and require
-         proprietary drivers which are only available under Windows.
-
-         Most people will say Y or M here, so that they can use serial mice,
-         modems and similar devices connecting to the standard serial ports.
-
-config SH_SCI
-       tristate "Serial (SCI, SCIF) support"
-       help
-         Selecting this option will allow the Linux kernel to transfer data
-         over SCI (Serial Communication Interface) and/or SCIF (Serial
-         Communication Interface with FIFO) which are built into the Hitachi
-         SuperH processor.  The option provides 1 to 3 (depending
-         on the CPU model) standard Linux tty devices, /dev/ttySC[012]; one
-         of these is normally used as the system console.
-
-         If in doubt, press "y".
-
-config SERIAL_CONSOLE
-       bool "Support for console on serial port"
-       depends on SERIAL=y || SH_SCI=y
-       ---help---
-         If you say Y here, it will be possible to use a serial port as the
-         system console (the system console is the device which receives all
-         kernel messages and warnings and which allows logins in single user
-         mode). This could be useful if some terminal or printer is connected
-         to that serial port.
-
-         Even if you say Y here, the currently visible virtual console
-         (/dev/tty0) will still be used as the system console by default, but
-         you can alter that using a kernel command line option such as
-         "console=ttyS1". (Try "man bootparam" or see the documentation of
-         your boot loader (lilo or loadlin) about how to pass options to the
-         kernel at boot time.)
-
-         If you don't have a VGA card installed and you say Y here, the
-         kernel will automatically use the first serial line, /dev/ttyS0, as
-         system console.
-
-         If unsure, say N.
-
-comment "Unix98 PTY support"
-
-config UNIX98_PTYS
-       bool "Unix98 PTY support"
-       ---help---
-         A pseudo terminal (PTY) is a software device consisting of two
-         halves: a master and a slave. The slave device behaves identical to
-         a physical terminal; the master device is used by a process to
-         read data from and write data to the slave, thereby emulating a
-         terminal. Typical programs for the master side are telnet servers
-         and xterms.
-
-         Linux has traditionally used the BSD-like names /dev/ptyxx for
-         masters and /dev/ttyxx for slaves of pseudo terminals. This scheme
-         has a number of problems. The GNU C library glibc 2.1 and later,
-         however, supports the Unix98 naming standard: in order to acquire a
-         pseudo terminal, a process opens /dev/ptmx; the number of the pseudo
-         terminal is then made available to the process and the pseudo
-         terminal slave can be accessed as /dev/pts/<number>. What was
-         traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
-
-         The entries in /dev/pts/ are created on the fly by a virtual
-         file system; therefore, if you say Y here you should say Y to
-         "/dev/pts file system for Unix98 PTYs" as well.
-
-         If you want to say Y here, you need to have the C library glibc 2.1
-         or later (equal to libc-6.1, check with "ls -l /lib/libc.so.*").
-         Read the instructions in <file:Documentation/Changes> pertaining to
-         pseudo terminals. It's safe to say N.
-
-config UNIX98_PTY_COUNT
-       int "Maximum number of Unix98 PTYs in use (0-2048)"
-       depends on UNIX98_PTYS
-       default "256"
-       help
-         The maximum number of Unix98 PTYs that can be used at any one time.
-         The default is 256, and should be enough for desktop systems. Server
-         machines which support incoming telnet/rlogin/ssh connections and/or
-         serve several X terminals may want to increase this: every incoming
-         connection and every xterm uses up one PTY.
-
-         When not in use, each additional set of 256 PTYs occupy
-         approximately 8 KB of kernel memory on 32-bit architectures.
-
-config HEARTBEAT
-       bool "Heartbeat LED"
-       depends on SH_MPC1211 || SH_CAT68701 || SH_STB1_HARP || SH_STB1_OVERDRIVE || SH_BIGSUR || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE
-       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.
-
-
-menu "Maple Bus input peripherals"
-       depends on SH_DREAMCAST && MAPLE
-
-config MAPLE_KEYBOARD
-       tristate "Maple Bus keyboard support"
-       depends on INPUT
-
-config MAPLE_MOUSE
-       tristate "Maple Bus mouse support"
-       depends on INPUT
-
-comment "Input core support is required for Maple input peripherals"
-       depends on INPUT=n
-
-endmenu
-
-config PRINTER
-       tristate "Parallel printer support"
-       depends on PARPORT
-       ---help---
-         If you intend to attach a printer to the parallel port of your Linux
-         box (as opposed to using a serial printer; if the connector at the
-         printer has 9 or 25 holes ["female"], then it's serial), say Y.
-         Also read the Printing-HOWTO, available from
-         <http://www.tldp.org/docs.html#howto>.
-
-         It is possible to share one parallel port among several devices
-         (e.g. printer and ZIP drive) and it is safe to compile the
-         corresponding drivers into the kernel.
-         To compile this driver as a module, choose M here and read
-         <file:Documentation/parport.txt>.  The module will be called lp.
-
-         If you have several parallel ports, you can specify which ports to
-         use with the "lp" kernel command line option.  (Try "man bootparam"
-         or see the documentation of your boot loader (lilo or loadlin) about
-         how to pass options to the kernel at boot time.)  The syntax of the
-         "lp" command line option can be found in <file:drivers/char/lp.c>.
-
-         If you have more than 8 printers, you need to increase the LP_NO
-         macro in lp.c and the PARPORT_MAX macro in parport.h.
-
-config LP_CONSOLE
-       bool "Support for console on line printer"
-       depends on PRINTER
-       ---help---
-         If you want kernel messages to be printed out as they occur, you
-         can have a console on the printer. This option adds support for
-         doing that; to actually get it to happen you need to pass the
-         option "console=lp0" to the kernel at boot time.
-
-         If the printer is out of paper (or off, or unplugged, or too
-         busy..) the kernel will stall until the printer is ready again.
-         By defining CONSOLE_LP_STRICT to 0 (at your own risk) you
-         can make the kernel continue when this happens,
-         but it'll lose the kernel messages.
-
-         If unsure, say N.
-
-config PPDEV
-       tristate "Support for user-space parallel port device drivers"
-       depends on PARPORT
-       ---help---
-         Saying Y to this adds support for /dev/parport device nodes.  This
-         is needed for programs that want portable access to the parallel
-         port, for instance deviceid (which displays Plug-and-Play device
-         IDs).
-
-         This is the parallel port equivalent of SCSI generic support (sg).
-         It is safe to say N to this -- it is not needed for normal printing
-         or parallel port CD-ROM/disk support.
-
-         To compile this support as a module, choose M here: the
-         module will be called ppdev.
-
-         If unsure, say N.
-
-config PSMOUSE
-       bool "PS/2 mouse (aka \"auxiliary device\") support"
-       ---help---
-         The PS/2 mouse connects to a special mouse port that looks much like
-         the keyboard port (small circular connector with 6 pins). This way,
-         the mouse does not use any serial ports. This port can also be used
-         for other input devices like light pens, tablets, keypads. Compaq,
-         AST and IBM all use this as their mouse port on currently shipping
-         machines. The trackballs of some laptops are PS/2 mice also. In
-         particular, the C&T 82C710 mouse on TI Travelmates is a PS/2 mouse.
-
-         Although PS/2 mice are not technically bus mice, they are explained
-         in detail in the Busmouse-HOWTO, available from
-         <http://www.tldp.org/docs.html#howto>.
-
-         When using a PS/2 mouse, you can get problems if you want to use the
-         mouse both on the Linux console and under X. Using the "-R" option
-         of the Linux mouse managing program gpm (available from
-         <ftp://gnu.systemy.it/pub/gpm/>) solves this problem, or you can get
-         the "mconv2" utility from <ftp://ibiblio.org/pub/Linux/system/mouse/>.
-
-source "drivers/char/watchdog/Kconfig"
-
-config RTC
-       tristate "Enhanced Real Time Clock Support"
-       ---help---
-         If you say Y here and create a character special file /dev/rtc with
-         major number 10 and minor number 135 using mknod ("man mknod"), you
-         will get access to the real time clock (or hardware clock) built
-         into your computer.
-
-         Every PC has such a clock built in. It can be used to generate
-         signals from as low as 1Hz up to 8192Hz, and can also be used
-         as a 24 hour alarm. It reports status information via the file
-         /proc/driver/rtc and its behaviour is set by various ioctls on
-         /dev/rtc.
-
-         If you run Linux on a multiprocessor machine and said Y to
-         "Symmetric Multi Processing" above, you should say Y here to read
-         and set the RTC in an SMP compatible fashion.
-
-         If you think you have a use for such a device (such as periodic data
-         sampling), then say Y here, and read <file:Documentation/rtc.txt>
-         for details.
-
-         To compile this driver as a module, choose M here: the
-         module will be called rtc.
-
-source "drivers/char/pcmcia/Kconfig"
-
-source "drivers/serial/Kconfig"
-
-source "drivers/i2c/Kconfig"
- 
-endmenu
+source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "drivers/media/Kconfig"
-
-source "drivers/video/Kconfig"
-
-source "sound/Kconfig"
-
-source "drivers/usb/Kconfig"
-
 source "arch/sh/oprofile/Kconfig"
 
 menu "Kernel hacking"
index bb8920f37ea7687b5461d19dc02134db89d3d60f..d73486136045610807626210aff47827288aff4f 100644 (file)
 #include <asm/irq.h>
 
 struct sh_machine_vector mv_hp680 __initmv = {
-        .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_irq_demux           = hd64461_irq_demux,
+       .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,
 };
+
 ALIAS_MV(hp680)
index 261f7b06382ebff39a0628be7f03b3a46ec78787..4170190f26448090bb348ecbe3bf6ced853ce291 100644 (file)
@@ -12,6 +12,9 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <asm/hd64461/hd64461.h>
+#include <asm/io.h>
+#include <asm/hp6xx/hp6xx.h>
+#include <asm/cpu/dac.h>
 
 const char *get_system_type(void)
 {
@@ -20,8 +23,19 @@ const char *get_system_type(void)
 
 int __init platform_setup(void)
 {
-       __set_io_port_base(CONFIG_HD64461_IOBASE - HD64461_STBCR);
+       u16 v;
+       v = inw(HD64461_STBCR);
+       v |= HD64461_STBCR_SURTST | HD64461_STBCR_SIRST |
+           HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST |
+           HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST |
+           HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST |
+           HD64461_STBCR_SAFECKE_IST;
+       outw(v, HD64461_STBCR);
+       v = inw(HD64461_GPADR);
+       v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
+       outw(v, HD64461_GPADR);
+
+       sh_dac_disable(DAC_SPEAKER_VOLUME);
 
        return 0;
 }
-
index c96d0b11edcdd48b39da1500d7f7403440d4d905..9a39ee963143fa4169bae4e9bb46abaabcf27a68 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.4 2003/08/03 03:05:10 lethal Exp $
+/* $Id: io.c,v 1.5 2004/02/22 23:08:43 kkojima Exp $
  *
  * linux/arch/sh/kernel/io_se.c
  *
@@ -134,25 +134,27 @@ void se_outl(unsigned int value, unsigned long port)
 void se_insb(unsigned long port, void *addr, unsigned long count)
 {
        volatile __u16 *p = port2adr(port);
+       __u8 *ap = addr;
 
        if (sh_pcic_io_start <= port && port <= sh_pcic_io_stop) {
                volatile __u8 *bp = (__u8 *) (sh_pcic_io_wbase + 0x40000 + port); 
                while (count--)
-                       *((__u8 *) addr)++ = *bp;
+                       *ap++ = *bp;
        } else if (shifted_port(port)) {
                while (count--)
-                       *((__u8 *) addr)++ = *p >> 8;
+                       *ap++ = *p >> 8;
        } else {
                while (count--)
-                       *((__u8 *) addr)++ = *p;
+                       *ap++ = *p;
        }
 }
 
 void se_insw(unsigned long port, void *addr, unsigned long count)
 {
        volatile __u16 *p = port2adr(port);
+       __u16 *ap = addr;
        while (count--)
-               *((__u16 *) addr)++ = *p;
+               *ap++ = *p;
 }
 
 void se_insl(unsigned long port, void *addr, unsigned long count)
@@ -163,25 +165,27 @@ void se_insl(unsigned long port, void *addr, unsigned long count)
 void se_outsb(unsigned long port, const void *addr, unsigned long count)
 {
        volatile __u16 *p = port2adr(port);
+       const __u8 *ap = addr;
 
        if (sh_pcic_io_start <= port && port <= sh_pcic_io_stop) {
                volatile __u8 *bp = (__u8 *) (sh_pcic_io_wbase + port); 
                while (count--)
-                       *bp = *((__u8 *) addr)++;
+                       *bp = *ap++;
        } else if (shifted_port(port)) {
                while (count--)
-                       *p = *((__u8 *) addr)++ << 8;
+                       *p = *ap++ << 8;
        } else {
                while (count--)
-                       *p = *((__u8 *) addr)++;
+                       *p = *ap++;
        }
 }
 
 void se_outsw(unsigned long port, const void *addr, unsigned long count)
 {
        volatile __u16 *p = port2adr(port);
+       const __u16 *ap = addr;
        while (count--)
-               *p = *((__u16 *) addr)++;
+               *p = *ap++;
 }
 
 void se_outsl(unsigned long port, const void *addr, unsigned long count)
index f8ce43f61020af791c59035a583312f1ab15e02a..dff4fbd8640f0eef81999631da06af7c137b25f6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.1.2.2 2002/10/29 00:56:09 lethal Exp $
+/* $Id: irq.c,v 1.4 2004/02/22 22:44:36 kkojima Exp $
  * 
  * linux/arch/sh/boards/se/770x/irq.c
  *
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/irq.h>
-#include <asm/hitachi_se.h>
+#include <asm/se/se.h>
 
 /*
  * Initialize IRQ setting
index c4fea875049288c3c1ad3f567db9ace4963fdee6..8a11af1ba3f83d714a47e3daff99499137c2cc99 100644 (file)
@@ -1,7 +1,13 @@
+menu "Companion Chips"
+
 # A board must have defined HD6446X_SERIES in order to see these
+config HD6446X_SERIES
+       bool "HD6446x support"
+       default n
+
 choice
        prompt "HD6446x options"
-       depends HD6446X_SERIES
+       depends on HD6446X_SERIES
        default HD64461
 
 config HD64461
@@ -73,4 +79,5 @@ config HD64465_IRQ
 
          Do not change this unless you know what you are doing.
 
+endmenu
 
index 49b3bfbb13f59e0b909688b94f299fd29d0c717b..4c062d6b7a9737ffa35be5740976a42a4e777690 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: io.c,v 1.5 2004/02/01 19:46:04 lethal Exp $
+ *     $Id: io.c,v 1.6 2004/03/16 00:07:50 lethal Exp $
  *     Copyright (C) 2000 YAEGASHI Takeshi
  *     Typical I/O routines for HD64461 system.
  */
@@ -8,6 +8,8 @@
 #include <asm/io.h>
 #include <asm/hd64461/hd64461.h>
 
+#define MEM_BASE (CONFIG_HD64461_IOBASE - HD64461_STBCR)
+
 static __inline__ unsigned long PORT2ADDR(unsigned long port)
 {
        /* 16550A: HD64461 internal */
@@ -36,7 +38,9 @@ static __inline__ unsigned long PORT2ADDR(unsigned long port)
 #endif
 
        /* ??? */
-       if (port < 0x10000) return 0xa0000000 + port;
+       if (port < 0xf000) return 0xa0000000 + port;
+       /* PCMCIA channel 0, I/O (0xba000000) */
+       if (port < 0x10000) return 0xba000000 + port - 0xf000;
 
        /* HD64461 internal devices (0xb0000000) */
        if (port < 0x20000) return CONFIG_HD64461_IOBASE + port - 0x10000;
@@ -140,3 +144,14 @@ void hd64461_outsl(unsigned long port, const void *buffer, unsigned long count)
        const unsigned long *buf=buffer;
        while(count--) *addr=*buf++;
 }
+
+unsigned short hd64461_readw(unsigned long addr)
+{
+       return *(volatile unsigned short*)(MEM_BASE+addr);
+}
+
+void hd64461_writew(unsigned short b, unsigned long addr)
+{
+       *(volatile unsigned short*)(MEM_BASE+addr) = b;
+}
+
index f523b5ba33949cd514fdae58380d75b1bc4eef21..5e03ea93838eb06bb89bd0353c805ced91250a25 100644 (file)
@@ -1,11 +1,12 @@
 /*
- *     $Id: setup.c,v 1.4 2003/08/03 03:05:10 lethal Exp $
+ *     $Id: setup.c,v 1.5 2004/03/16 00:07:50 lethal Exp $
  *     Copyright (C) 2000 YAEGASHI Takeshi
  *     Hitachi HD64461 companion chip support
  */
 
 #include <linux/config.h>
 #include <linux/sched.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/param.h>
 #include <linux/interrupt.h>
@@ -30,7 +31,6 @@ static void disable_hd64461_irq(unsigned int irq)
        local_irq_restore(flags);
 }
 
-
 static void enable_hd64461_irq(unsigned int irq)
 {
        unsigned long flags;
@@ -44,7 +44,6 @@ static void enable_hd64461_irq(unsigned int irq)
        local_irq_restore(flags);
 }
 
-
 static void mask_and_ack_hd64461(unsigned int irq)
 {
        disable_hd64461_irq(irq);
@@ -54,27 +53,23 @@ static void mask_and_ack_hd64461(unsigned int irq)
 #endif
 }
 
-
 static void end_hd64461_irq(unsigned int irq)
 {
        if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
                enable_hd64461_irq(irq);
 }
 
-
 static unsigned int startup_hd64461_irq(unsigned int irq)
-{ 
+{
        enable_hd64461_irq(irq);
        return 0;
 }
 
-
 static void shutdown_hd64461_irq(unsigned int irq)
 {
        disable_hd64461_irq(irq);
 }
 
-
 static struct hw_interrupt_type hd64461_irq_type = {
        .typename       = "HD64461-IRQ",
        .startup        = startup_hd64461_irq,
@@ -85,7 +80,6 @@ static struct hw_interrupt_type hd64461_irq_type = {
        .end            = end_hd64461_irq,
 };
 
-
 static irqreturn_t hd64461_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
        printk(KERN_INFO
@@ -95,23 +89,52 @@ static irqreturn_t hd64461_interrupt(int irq, void *dev_id, struct pt_regs *regs
        return IRQ_NONE;
 }
 
+static struct {
+       int (*func) (int, void *);
+       void *dev;
+} hd64461_demux[HD64461_IRQ_NUM];
+
+void hd64461_register_irq_demux(int irq,
+                               int (*demux) (int irq, void *dev), void *dev)
+{
+       hd64461_demux[irq - HD64461_IRQBASE].func = demux;
+       hd64461_demux[irq - HD64461_IRQBASE].dev = dev;
+}
+
+EXPORT_SYMBOL(hd64461_register_irq_demux);
+
+void hd64461_unregister_irq_demux(int irq)
+{
+       hd64461_demux[irq - HD64461_IRQBASE].func = 0;
+}
+
+EXPORT_SYMBOL(hd64461_unregister_irq_demux);
+
 int hd64461_irq_demux(int irq)
 {
        if (irq == CONFIG_HD64461_IRQ) {
                unsigned short bit;
                unsigned short nirr = inw(HD64461_NIRR);
                unsigned short nimr = inw(HD64461_NIMR);
+               int i;
+
                nirr &= ~nimr;
-               for (bit = 1, irq = 0; irq < 16; bit <<= 1, irq++)
-                       if (nirr & bit) break;
-               if (irq == 16) irq = CONFIG_HD64461_IRQ;
-               else irq += HD64461_IRQBASE;
+               for (bit = 1, i = 0; i < 16; bit <<= 1, i++)
+                       if (nirr & bit)
+                               break;
+               if (i == 16)
+                       irq = CONFIG_HD64461_IRQ;
+               else {
+                       irq = HD64461_IRQBASE + i;
+                       if (hd64461_demux[i].func != 0) {
+                               irq = hd64461_demux[i].func(irq, hd64461_demux[i].dev);
+                       }
+               }
        }
        return __irq_demux(irq);
 }
 
-static struct irqaction irq0  = { hd64461_interrupt, SA_INTERRUPT, 0, "HD64461", NULL, NULL};
-
+static struct irqaction irq0 = { hd64461_interrupt, SA_INTERRUPT, 0, "HD64461", NULL, NULL };
 
 int __init setup_hd64461(void)
 {
@@ -120,11 +143,12 @@ int __init setup_hd64461(void)
        if (!MACH_HD64461)
                return 0;
 
-       printk(KERN_INFO "HD64461 configured at 0x%x on irq %d(mapped into %d to %d)\n",
-              CONFIG_HD64461_IOBASE, CONFIG_HD64461_IRQ,
-              HD64461_IRQBASE, HD64461_IRQBASE+15);
+       printk(KERN_INFO
+              "HD64461 configured at 0x%x on irq %d(mapped into %d to %d)\n",
+              CONFIG_HD64461_IOBASE, CONFIG_HD64461_IRQ, HD64461_IRQBASE,
+              HD64461_IRQBASE + 15);
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7709) /* Should be at processor specific part.. */
+#if defined(CONFIG_CPU_SUBTYPE_SH7709) /* Should be at processor specific part.. */
        outw(0x2240, INTC_ICR1);
 #endif
        outw(0xffff, HD64461_NIMR);
index 3ee828a836405fcd473988c9e1a37aef08cd86fa..7a3b18faa277696ba5a4e3ae7bac22246317ccb0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cf-enabler.c,v 1.3 2003/05/04 19:29:52 lethal Exp $
+/* $Id: cf-enabler.c,v 1.4 2004/02/22 22:44:36 kkojima Exp $
  *
  *  linux/drivers/block/cf-enabler.c
  *
@@ -88,7 +88,7 @@ static int __init cf_init_default(void)
 }
 
 #if defined(CONFIG_SH_SOLUTION_ENGINE)
-#include <asm/hitachi_se.h>
+#include <asm/se/se.h>
 
 /*
  * SolutionEngine
index e641fcbeb962c42ca5f745e5565ab774b7f8368f..c66d6227965a9bfa7ed95f64e9850cb828beb1b9 100644 (file)
@@ -196,6 +196,7 @@ void __init init_IRQ(void)
 #endif
 
        make_ipr_irq(TIMER_IRQ, TIMER_IPR_ADDR, TIMER_IPR_POS, TIMER_PRIORITY);
+       make_ipr_irq(TIMER1_IRQ, TIMER1_IPR_ADDR, TIMER1_IPR_POS, TIMER1_PRIORITY);
        make_ipr_irq(RTC_IRQ, RTC_IPR_ADDR, RTC_IPR_POS, RTC_PRIORITY);
 
 #ifdef SCI_ERI_IRQ
index 98603d3cd0f5e190db4574b7ee10fa440b2539c9..7a0eb521ee7f55581c4ebedd432156625f3129a7 100644 (file)
@@ -3,13 +3,13 @@
  *
  * General management API for SH-4 integrated Store Queues
  *
- * Copyright (C) 2001, 2002, 2003  Paul Mundt
+ * Copyright (C) 2001, 2002, 2003, 2004  Paul Mundt
  * Copyright (C) 2001, 2002  M. R. Brown
  *
  * Some of this code has been adopted directly from the old arch/sh/mm/sq.c
- * hack that was part of the LinuxDC project. For all intensive purposes, this
- * is a completely new interface that really doesn't have much in common with
- * the old zone-based approach at all. Infact, I'm only listing it here for
+ * hack that was part of the LinuxDC project. For all intents and purposes,
+ * this is a completely new interface that really doesn't have much in common
+ * with the old zone-based approach at all. In fact, it's only listed here for
  * general completeness.
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -24,6 +24,7 @@
 #include <linux/list.h>
 #include <linux/proc_fs.h>
 #include <linux/miscdevice.h>
+#include <linux/vmalloc.h>
 
 #include <asm/io.h>
 #include <asm/page.h>
@@ -31,6 +32,9 @@
 #include <asm/cpu/sq.h>
 
 static LIST_HEAD(sq_mapping_list);
+static spinlock_t sq_mapping_lock = SPIN_LOCK_UNLOCKED;
+
+extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, unsigned long start, unsigned long end);
 
 /**
  * sq_flush - Flush (prefetch) the store queue cache
@@ -42,7 +46,7 @@ static LIST_HEAD(sq_mapping_list);
  */
 inline void sq_flush(void *addr)
 {
-       __asm__ __volatile__ ("pref @%0": "=r" (addr) : : "memory");
+       __asm__ __volatile__ ("pref @%0" : : "r" (addr) : "memory");
 }
 
 /**
@@ -57,13 +61,17 @@ inline void sq_flush(void *addr)
 void sq_flush_range(unsigned long start, unsigned int len)
 {
        volatile unsigned long *sq = (unsigned long *)start;
+       unsigned long dummy;
 
        /* Flush the queues */
        for (len >>= 5; len--; sq += 8)
                sq_flush((void *)sq);
-       
+
        /* Wait for completion */
-       sq = (volatile unsigned long *)start;
+       dummy = ctrl_inl(P4SEG_STORE_QUE);
+
+       ctrl_outl(0, P4SEG_STORE_QUE + 0);
+       ctrl_outl(0, P4SEG_STORE_QUE + 8);
 }
 
 static struct sq_mapping *__sq_alloc_mapping(unsigned long virt, unsigned long phys, unsigned long size, const char *name)
@@ -81,7 +89,7 @@ static struct sq_mapping *__sq_alloc_mapping(unsigned long virt, unsigned long p
 
        map->sq_addr    = virt;
        map->addr       = phys;
-       map->size       = size;
+       map->size       = size + 1;
        map->name       = name;
 
        list_add(&map->list, &sq_mapping_list);
@@ -128,24 +136,20 @@ static unsigned long __sq_get_next_addr(void)
  */
 static struct sq_mapping *__sq_remap(struct sq_mapping *map)
 {
-       /*
-        * First check the MMU status..
-        */
-#ifndef CONFIG_MMU
+       unsigned long flags, pteh, ptel;
+       struct vm_struct *vma;
+       pgprot_t pgprot;
+
        /*
         * Without an MMU (or with it turned off), this is much more
         * straightforward, as we can just load up each queue's QACR with
         * the physical address appropriately masked.
         */
+
        ctrl_outl(((map->addr >> 26) << 2) & 0x1c, SQ_QACR0);
        ctrl_outl(((map->addr >> 26) << 2) & 0x1c, SQ_QACR1);
-#else
-       unsigned long flags, pteh, ptel;
-       pgprot_t pgprot;
-       pgd_t *pgd;
-       pmd_t *pmd;
-       pte_t *pte;
 
+#ifdef CONFIG_MMU
        /*
         * With an MMU on the other hand, things are slightly more involved.
         * Namely, we have to have a direct mapping between the SQ addr and
@@ -161,7 +165,7 @@ static struct sq_mapping *__sq_remap(struct sq_mapping *map)
         * We could also probably get by without explicitly setting PTEA, but
         * we do it here just for good measure.
         */
-       local_irq_save(flags);
+       spin_lock_irqsave(&sq_mapping_lock, flags);
 
        pteh = map->sq_addr;
        ctrl_outl((pteh & MMU_VPN_MASK) | get_asid(), MMU_PTEH);
@@ -177,6 +181,8 @@ static struct sq_mapping *__sq_remap(struct sq_mapping *map)
 
        __asm__ __volatile__ ("ldtlb" : : : "memory");
 
+       spin_unlock_irqrestore(&sq_mapping_lock, flags);
+
        /*
         * Next, we need to map ourselves in the kernel page table, so that
         * future accesses after a TLB flush will be handled when we take a
@@ -188,31 +194,17 @@ static struct sq_mapping *__sq_remap(struct sq_mapping *map)
         * writeout before we hit the TLB flush, we do it anyways. This way
         * we at least save ourselves the initial page fault overhead.
         */
-       pgd = pgd_offset_k(map->sq_addr);
+       vma = __get_vm_area(map->size, VM_ALLOC, map->sq_addr, SQ_ADDRMAX);
+       if (!vma)
+               return ERR_PTR(-ENOMEM);
 
-       spin_lock(&init_mm.page_table_lock);
+       vma->phys_addr = map->addr;
 
-       pmd = pmd_alloc(&init_mm, pgd, map->sq_addr);
-       if (!pmd)
-               goto out;
-       
-       pte = pte_alloc_map(&init_mm, pmd, map->sq_addr);
-       if (!pte)
-               goto out;
-       if (!pte_none(*pte)) {
-               pte_unmap(pte);
-               goto out;
+       if (remap_area_pages((unsigned long)vma->addr, vma->phys_addr,
+                            map->size, pgprot_val(pgprot))) {
+               vunmap(vma->addr);
+               return NULL;
        }
-
-       set_pte(pte, mk_pte(phys_to_page(map->addr), pgprot));
-       pte_unmap(pte);
-
-out:
-       spin_unlock(&init_mm.page_table_lock);
-       sq_flush((void *)pteh);
-
-       local_irq_restore(flags);
-
 #endif /* CONFIG_MMU */
 
        return map;
@@ -236,11 +228,20 @@ out:
 struct sq_mapping *sq_remap(unsigned long phys, unsigned int size, const char *name)
 {
        struct sq_mapping *map;
-       unsigned long virt;
+       unsigned long virt, end;
        unsigned int psz;
 
+       /* Don't allow wraparound or zero size */
+       end = phys + size - 1;
+       if (!size || end < phys)
+               return NULL;
+       /* Don't allow anyone to remap normal memory.. */
+       if (phys < virt_to_phys(high_memory))
+               return NULL;
+
        phys &= PAGE_MASK;
 
+       size  = PAGE_ALIGN(end + 1) - phys;
        virt  = __sq_get_next_addr();
        psz   = (size + (PAGE_SIZE - 1)) / PAGE_SIZE;
        map   = __sq_alloc_mapping(virt, phys, size, name);
@@ -264,30 +265,8 @@ struct sq_mapping *sq_remap(unsigned long phys, unsigned int size, const char *n
  */
 void sq_unmap(struct sq_mapping *map)
 {
-#ifdef CONFIG_MMU
-       pgd_t *pgd;
-       pmd_t *pmd;
-       pte_t *pte;
-       
-       pgd = pgd_offset_k(map->sq_addr);
-       pmd = pmd_offset(pgd, map->sq_addr);
-
-       if (pmd_none(*pmd))
-               return;
-       if (pmd_bad(*pmd)) {
-               pmd_ERROR(*pmd);
-               pmd_clear(pmd);
-               return;
-       }
-
-       pte = pte_offset_kernel(pmd, map->sq_addr);
-       if (pte_none(*pte) || pte_not_present(*pte))
-               return;
-
-       ptep_get_and_clear(pte);
-
-       __flush_tlb_page(get_asid(), map->sq_addr & PAGE_MASK);
-#endif
+       if (map->sq_addr > (unsigned long)high_memory)
+               vfree((void *)(map->sq_addr & PAGE_MASK));
 
        list_del(&map->list);
        kfree(map);
@@ -475,6 +454,7 @@ module_exit(sq_api_exit);
 MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, M. R. Brown <mrbrown@0xd6.org>");
 MODULE_DESCRIPTION("Simple API for SH-4 integrated Store Queues");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(STORE_QUEUE_MINOR);
 
 EXPORT_SYMBOL(sq_remap);
 EXPORT_SYMBOL(sq_unmap);
index e64c5fbfe45ff42344a989d527af7727a412170a..dbc33d72656cb51eb6fdb7a4988534bc391ff4d4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.34 2004/01/13 05:52:11 kkojima Exp $
+/* $Id: entry.S,v 1.35 2004/02/21 14:45:47 lethal Exp $
  *
  *  linux/arch/sh/entry.S
  *
@@ -1129,9 +1129,6 @@ ENTRY(sys_call_table)
        .long sys_utimes
        .long sys_fadvise64_64_wrapper
        .long sys_ni_syscall    /* Reserved for vserver */
-
-       .rept NR_syscalls-(.-sys_call_table)/4
-               .long sys_ni_syscall
-       .endr
+       .long sys_ni_syscall
 
 /* End of entry.S */
index d163b42f1688df3129f2095812b290524169c8b1..d9932f25993b744a328e3451681080e040efed35 100644 (file)
  */
 void  memcpy_fromio(void * to, unsigned long from, unsigned long count)
 {
+       char *p = to;
         while (count) {
                 count--;
-                *(char *) to = readb(from);
-                ((char *) to)++;
+                *p = readb(from);
+                p++;
                 from++;
         }
 }
@@ -30,10 +31,11 @@ void  memcpy_fromio(void * to, unsigned long from, unsigned long count)
  */
 void  memcpy_toio(unsigned long to, const void * from, unsigned long count)
 {
+       const char *p = from;
         while (count) {
                 count--;
-                writeb(*(char *) from, to);
-                ((char *) from)++;
+                writeb(*p, to);
+                p++;
                 to++;
         }
 }
index 47852b7f1c1b9333b95e9f5ea07f3e321ec7da98..142a4e5b7ebc6da7c76c661056c64d9eb5eb9501 100644 (file)
@@ -55,20 +55,22 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
 #define COPY_UNALIGNED_WORD(sw, tw, align) \
 { \
        void *__s = &(sw), *__t = &(tw); \
+       unsigned short *__s2 = __s, *__t2 = __t; \
+       unsigned char *__s1 = __s, *__t1 = __t; \
        switch ((align)) \
        { \
        case 0: \
                *(unsigned long *) __t = *(unsigned long *) __s; \
                break; \
        case 2: \
-               *((unsigned short *) __t)++ = *((unsigned short *) __s)++; \
-               *((unsigned short *) __t) = *((unsigned short *) __s); \
+               *__t2++ = *__s2++; \
+               *__t2 = *__s2; \
                break; \
        default: \
-               *((unsigned char *) __t)++ = *((unsigned char *) __s)++; \
-               *((unsigned char *) __t)++ = *((unsigned char *) __s)++; \
-               *((unsigned char *) __t)++ = *((unsigned char *) __s)++; \
-               *((unsigned char *) __t) = *((unsigned char *) __s); \
+               *__t1++ = *__s1++; \
+               *__t1++ = *__s1++; \
+               *__t1++ = *__s1++; \
+               *__t1 = *__s1; \
                break; \
        } \
 }
index 1ccd3b25261e11536307c6e96cb48bca533d1d05..773006661b50c3f60285894329e078bd34945733 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.25 2004/01/13 05:52:11 kkojima Exp $
+/* $Id: process.c,v 1.26 2004/02/06 14:14:14 kkojima Exp $
  *
  *  linux/arch/sh/kernel/process.c
  *
@@ -254,6 +254,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
                struct task_struct *p, struct pt_regs *regs)
 {
        struct pt_regs *childregs;
+#if defined(CONFIG_CPU_SH4)
+       struct task_struct *tsk = current;
+
+       unlazy_fpu(tsk, regs);
+       p->thread.fpu = tsk->thread.fpu;
+       p->used_math = tsk->used_math;
+#endif
 
        childregs = ((struct pt_regs *)
                (THREAD_SIZE + (unsigned long) p->thread_info)
@@ -279,16 +286,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
 
        p->thread.ubc_pc = 0;
 
-#if defined(CONFIG_CPU_SH4)
-       {
-               struct task_struct *tsk = current;
-
-               unlazy_fpu(tsk, regs);
-               p->thread.fpu = tsk->thread.fpu;
-               p->used_math = tsk->used_math;
-               clear_ti_thread_flag(p->thread_info, TIF_USEDFPU);
-       }
-#endif
        return 0;
 }
 
index 2db9a04b565c3ea046ebd06b441155642c4ff617..abe649077f7b6798188eef2f07e40b7eeed9a36d 100644 (file)
@@ -113,3 +113,5 @@ EXPORT_SYMBOL(__down_trylock);
 #ifdef CONFIG_SMP
 EXPORT_SYMBOL(synchronize_irq);
 #endif
+
+EXPORT_SYMBOL(csum_partial);
index c3fc2b16a750f571557d65705fafe49e438ecfb7..df5ac294c37906cd575a9bd482b2478cdfbd4805 100644 (file)
@@ -44,7 +44,7 @@ asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
        return error;
 }
 
-#if defined(CONFIG_CPU_SH4)
+#if defined(HAVE_ARCH_UNMAPPED_AREA)
 /*
  * To avoid cache alias, we map the shard page with same color.
  */
@@ -53,7 +53,9 @@ asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
 unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
        unsigned long len, unsigned long pgoff, unsigned long flags)
 {
+       struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
+       unsigned long start_addr;
 
        if (flags & MAP_FIXED) {
                /* We do not accept a shared mapping if it would violate
@@ -66,20 +68,44 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
 
        if (len > TASK_SIZE)
                return -ENOMEM;
-       if (!addr)
-               addr = TASK_UNMAPPED_BASE;
 
+       if (addr) {
+               if (flags & MAP_PRIVATE)
+                       addr = PAGE_ALIGN(addr);
+               else
+                       addr = COLOUR_ALIGN(addr);
+               vma = find_vma(mm, addr);
+               if (TASK_SIZE - len >= addr &&
+                   (!vma || addr + len <= vma->vm_start))
+                       return addr;
+       }
        if (flags & MAP_PRIVATE)
-               addr = PAGE_ALIGN(addr);
+               addr = PAGE_ALIGN(mm->free_area_cache);
        else
-               addr = COLOUR_ALIGN(addr);
+               addr = COLOUR_ALIGN(mm->free_area_cache);
+       start_addr = addr;
 
-       for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
+full_search:
+       for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
                /* At this point:  (!vma || addr < vma->vm_end). */
-               if (TASK_SIZE - len < addr)
+               if (TASK_SIZE - len < addr) {
+                       /*
+                        * Start a new search - just in case we missed
+                        * some holes.
+                        */
+                       if (start_addr != TASK_UNMAPPED_BASE) {
+                               start_addr = addr = TASK_UNMAPPED_BASE;
+                               goto full_search;
+                       }
                        return -ENOMEM;
-               if (!vma || addr + len <= vma->vm_start)
+               }
+               if (!vma || addr + len <= vma->vm_start) {
+                       /*
+                        * Remember the place where we stopped the search:
+                        */
+                       mm->free_area_cache = addr + len;
                        return addr;
+               }
                addr = vma->vm_end;
                if (!(flags & MAP_PRIVATE))
                        addr = COLOUR_ALIGN(addr);
index 44fb114b781b57465b59d796e0b32c3aa24b129a..cd91a59a9fff109ad823292f8ef2ff7967739ca2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.18 2003/10/09 16:28:14 lethal Exp $
+/* $Id: time.c,v 1.19 2004/02/27 00:40:48 lethal Exp $
  *
  *  linux/arch/sh/kernel/time.c
  *
@@ -86,10 +86,14 @@ int (*rtc_set_time)(const time_t) = 0;
 #endif
 
 #if defined(CONFIG_CPU_SH3)
-#error "FIXME"
-static int ifc_table[] = { 1, 2, 4, 1, 3, 1, 1, 1 };
-static int pfc_table[] = { 1, 2, 4, 1, 3, 6, 1, 1 };
-static int stc_table[] = { 1, 2, 4, 8, 3, 6, 1, 1 };
+static int stc_multipliers[] = { 1, 2, 3, 4, 6, 1, 1, 1 };
+static int stc_values[]      = { 0, 1, 4, 2, 5, 0, 0, 0 };
+#define bfc_divisors stc_multipliers
+#define bfc_values stc_values
+static int ifc_divisors[]    = { 1, 2, 3, 4, 1, 1, 1, 1 };
+static int ifc_values[]      = { 0, 1, 4, 2, 0, 0, 0, 0 };
+static int pfc_divisors[]    = { 1, 2, 3, 4, 6, 1, 1, 1 };
+static int pfc_values[]      = { 0, 1, 4, 2, 5, 0, 0, 0 };
 #elif defined(CONFIG_CPU_SH4)
 static int ifc_divisors[] = { 1, 2, 3, 4, 6, 8, 1, 1 };
 static int ifc_values[]   = { 0, 1, 2, 3, 0, 4, 0, 5 };
@@ -398,13 +402,13 @@ void get_current_frequency_divisors(unsigned int *ifc, unsigned int *bfc, unsign
 
        tmp  = (frqcr & 0x8000) >> 13;
        tmp |= (frqcr & 0x0030) >>  4;
-       *bfc = stc_table[tmp];
+       *bfc = stc_multipliers[tmp];
        tmp  = (frqcr & 0x4000)  >> 12;
        tmp |= (frqcr & 0x000c) >> 2;
-       *ifc  = ifc_table[tmp];
+       *ifc = ifc_divisors[tmp];
        tmp  = (frqcr & 0x2000) >> 11;
        tmp |= frqcr & 0x0003;
-       *pfc = pfc_table[tmp];
+       *pfc = pfc_divisors[tmp];
 #elif defined(CONFIG_CPU_SH4)
        *ifc = ifc_divisors[(frqcr >> 6) & 0x0007];
        *bfc = bfc_divisors[(frqcr >> 3) & 0x0007];
index ae9888c47a188007010f4f44a3377d22f4ed6e55..5211a375afa83cdf5a6b5c484bb3669a1f516301 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.14 2003/11/14 18:40:10 lethal Exp $
+/* $Id: traps.c,v 1.16 2004/03/16 00:10:54 lethal Exp $
  *
  *  linux/arch/sh/traps.c
  *
@@ -656,6 +656,10 @@ void show_stack(struct task_struct *tsk, unsigned long *sp)
        unsigned long module_end = VMALLOC_END;
        int i = 1;
 
+       if (tsk && !sp) {
+               sp = (unsigned long *)tsk->thread.sp;
+       }
+
        if (!sp) {
                __asm__ __volatile__ (
                        "mov r15, %0\n\t"
index d3a994c68a6ec449dc8b314219240194f4464625..dde3de346fab7d9e83f2685e1c1f6f8ec71ac46b 100644 (file)
@@ -1,9 +1,10 @@
-/* $Id: cache-sh4.c,v 1.24 2003/10/12 19:40:12 lethal Exp $
+/* $Id: cache-sh4.c,v 1.26 2004/02/19 12:47:24 lethal Exp $
  *
  *  linux/arch/sh/mm/cache-sh4.c
  *
  * Copyright (C) 1999, 2000, 2002  Niibe Yutaka
- * Copyright (C) 2001, 2002, 2003  Paul Mundt
+ * Copyright (C) 2001, 2002, 2003, 2004  Paul Mundt
+ * Copyright (C) 2003  Richard Curnow
  */
 
 #include <linux/config.h>
@@ -29,10 +30,20 @@ static void __flush_dcache_all_ex(void);
 
 int __init detect_cpu_and_cache_system(void)
 {
-       unsigned long pvr, prr, ccr;
+       unsigned long pvr, prr, ccr, cvr;
+       unsigned long size;
+
+       static unsigned long sizes[16] = {
+               [1] = (1 << 12),
+               [2] = (1 << 13),
+               [4] = (1 << 14),
+               [8] = (1 << 15),
+               [9] = (1 << 16)
+       };
 
        pvr = (ctrl_inl(CCN_PVR) >> 8) & 0xffff;
        prr = (ctrl_inl(CCN_PRR) >> 4) & 0xff;
+       cvr = (ctrl_inl(CCN_CVR));
 
        /*
         * Setup some sane SH-4 defaults for the icache
@@ -54,6 +65,9 @@ int __init detect_cpu_and_cache_system(void)
        cpu_data->dcache.ways           = 1;
        cpu_data->dcache.linesz         = L1_CACHE_BYTES;
 
+       /* Set the FPU flag, virtually all SH-4's have one */
+       set_bit(CPU_HAS_FPU, &(cpu_data->flags));
+
        /*
         * Probe the underlying processor version/revision and
         * adjust cpu_data setup accordingly.
@@ -68,7 +82,7 @@ int __init detect_cpu_and_cache_system(void)
 
                /* 
                 * FIXME: This is needed for 7750, but do we need it for the
-                * 7750S and 7750R too? For now, assume we do.. -- PFM
+                * 7750S too? For now, assume we do.. -- PFM
                 */
                set_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags));
 
@@ -83,12 +97,18 @@ int __init detect_cpu_and_cache_system(void)
                cpu_data->type = CPU_ST40GX1;
                break;
        case 0x700:
-               /* XXX: Add proper CVR probing */
                cpu_data->type = CPU_SH4_501;
+               cpu_data->icache.ways = 2;
+               cpu_data->dcache.ways = 2;
+
+               /* No FPU on the SH4-500 series.. */
+               clear_bit(CPU_HAS_FPU, &(cpu_data->flags));
                break;
        case 0x600:
                cpu_data->type = CPU_SH4_202;
-               /* fall */
+               cpu_data->icache.ways = 2;
+               cpu_data->dcache.ways = 2;
+               break;
        case 0x500 ... 0x501:
                switch (prr) {
                    case 0x10: cpu_data->type = CPU_SH7750R; break;
@@ -96,9 +116,20 @@ int __init detect_cpu_and_cache_system(void)
                    case 0x50: cpu_data->type = CPU_SH7760;  break;
                }
 
-               if (cpu_data->type == CPU_SH7750R)
-                       set_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags));
+               cpu_data->icache.ways = 2;
+               cpu_data->dcache.ways = 2;
 
+               break;
+       default:
+               cpu_data->type = CPU_SH_NONE;
+               break;
+       }
+
+       /*
+        * On anything that's not a direct-mapped cache, look to the CVR
+        * for I/D-cache specifics.
+        */
+       if (cpu_data->dcache.ways > 1) {
                jump_to_P2();
                ccr = ctrl_inl(CCR);
 
@@ -110,19 +141,17 @@ int __init detect_cpu_and_cache_system(void)
 
                back_to_P1();
 
-               cpu_data->icache.ways = 2;
-               cpu_data->dcache.ways = 2;
+               size = sizes[(cvr >> 20) & 0xf];
+               cpu_data->icache.way_shift      =  (size >> 1);
+               cpu_data->icache.entry_mask     = ((size >> 2) - (1 << 5));
+               cpu_data->icache.sets           =  (size >> 6);
 
-               break;
-       default:
-               cpu_data->type = CPU_SH_NONE;
-               break;
+               size = sizes[(cvr >> 16) & 0xf];
+               cpu_data->dcache.way_shift      =  (size >> 1);
+               cpu_data->dcache.entry_mask     = ((size >> 2) - (1 << 5));
+               cpu_data->dcache.sets           =  (size >> 6);
        }
 
-       /* No FPU on the SH4-500 series.. */
-       if (cpu_data->type != CPU_SH4_501)
-               set_bit(CPU_HAS_FPU, &(cpu_data->flags));
-
        return 0;
 }
 
@@ -419,7 +448,7 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
                        }
                        pte++;
                        p += PAGE_SIZE;
-               } while (p < end && (unsigned long)pte & PAGE_MASK);
+               } while (p < end && ((unsigned long)pte & ~PAGE_MASK));
                pmd++;
        } while (p < end);
  loop_exit:
index a44e8a93cf43b6c483922add967212b87cbf2473..95b5368c06700615a85bfc93b252ef936a28b5f9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.18 2003/10/31 09:26:59 kkojima Exp $
+/* $Id: init.c,v 1.19 2004/02/21 04:42:16 kkojima Exp $
  *
  *  linux/arch/sh/mm/init.c
  *
@@ -174,6 +174,7 @@ void __init mem_init(void)
        extern unsigned long empty_zero_page[1024];
        int codesize, reservedpages, datasize, initsize;
        int tmp;
+       extern unsigned long memory_start;
 
 #ifdef CONFIG_MMU
        high_memory = (void *)__va(MAX_LOW_PFN * PAGE_SIZE);
@@ -183,7 +184,7 @@ void __init mem_init(void)
        high_memory = (void *)(memory_end & PAGE_MASK);
 #endif
 
-       max_mapnr = num_physpages = MAP_NR(high_memory);
+       max_mapnr = num_physpages = MAP_NR(high_memory) - MAP_NR(memory_start);
 
        /* clear the zero-page */
        memset(empty_zero_page, 0, PAGE_SIZE);
index d6fd7567caa67d2b578ffb7aaa21e119b18e4399..aaa8e871cce4e107ff59fb949ea97dd36e6c55fa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioremap.c,v 1.8 2003/10/09 15:25:42 lethal Exp $
+/* $Id: ioremap.c,v 1.9 2004/02/25 04:59:10 lethal Exp $
  *
  * arch/sh/mm/ioremap.c
  *
@@ -160,5 +160,5 @@ void * p3_ioremap(unsigned long phys_addr, unsigned long size, unsigned long fla
 void p3_iounmap(void *addr)
 {
        if (addr > high_memory)
-               return vfree((void *) (PAGE_MASK & (unsigned long) addr));
+               vfree((void *)(PAGE_MASK & (unsigned long)addr));
 }
index 896cc37d357501f16abe504a5355b2d076a0342e..ea14405b5e67eaf9d7c4cd3377f691d79f0c2ec5 100644 (file)
@@ -412,7 +412,7 @@ static int __init sh_wdt_init(void)
                return rc;
        }
 
-       rc = misc_register(&sh_wdt_miscdev)
+       rc = misc_register(&sh_wdt_miscdev);
        if (rc) {
                printk(KERN_ERR PFX "Can't register miscdev on minor=%d (err=%d)\n",
                        sh_wdt_miscdev.minor, rc);
index bbacd98a0c34d8d6fb373aadfbb4d8109cd3c2b0..eb5fe4d836473f4c586ca4efefb516a3d05ce819 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: maple_keyb.c,v 1.1 2001/11/02 17:27:32 jsimmons Exp $
+ *     $Id: maple_keyb.c,v 1.4 2004/03/22 01:18:15 lethal Exp $
  *     SEGA Dreamcast keyboard driver
  *     Based on drivers/usb/usbkbd.c
  */
@@ -125,8 +125,11 @@ static int dc_kbd_connect(struct maple_device *dev)
 
        kbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
 
+       init_input_dev(&kbd->dev);
+
        for (i=0; i<255; i++)
                set_bit(dc_kbd_keycode[i], kbd->dev.keybit);
+
        clear_bit(0, kbd->dev.keybit);
 
        kbd->dev.private = kbd;
@@ -141,10 +144,7 @@ static int dc_kbd_connect(struct maple_device *dev)
 
        maple_getcond_callback(dev, dc_kbd_callback, 1, MAPLE_FUNC_KEYBOARD);
 
-       printk(KERN_INFO "input%d: keyboard(0x%lx): %s\n",
-              kbd->dev.number, data, kbd->dev.name);
-
-       MOD_INC_USE_COUNT;
+       printk(KERN_INFO "input: keyboard(0x%lx): %s\n", data, kbd->dev.name);
 
        return 0;
 }
@@ -155,10 +155,7 @@ static void dc_kbd_disconnect(struct maple_device *dev)
        struct dc_kbd *kbd = dev->private_data;
 
        input_unregister_device(&kbd->dev);
-
        kfree(kbd);
-
-       MOD_DEC_USE_COUNT;
 }
 
 
index 6034a560da0afd5857c50e6bd54209a6a24ce88f..12dc0ef5020fa3a3f00a7bd6b6403ce2413cf0c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: maplemouse.c,v 1.1 2001/11/02 17:27:32 jsimmons Exp $
+ *     $Id: maplemouse.c,v 1.2 2004/03/22 01:18:15 lethal Exp $
  *     SEGA Dreamcast mouse driver
  *     Based on drivers/usb/usbmouse.c
  */
@@ -74,22 +74,21 @@ static int dc_mouse_connect(struct maple_device *dev)
        mouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
        mouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL);
 
+       init_input_dev(&mouse->dev);
+
        mouse->dev.private = mouse;
        mouse->dev.open = dc_mouse_open;
        mouse->dev.close = dc_mouse_close;
        mouse->dev.event = NULL;
 
        mouse->dev.name = dev->product_name;
-       mouse->dev.idbus = BUS_MAPLE;
+       mouse->dev.id.bustype = BUS_MAPLE;
        
        input_register_device(&mouse->dev);
 
        maple_getcond_callback(dev, dc_mouse_callback, 1, MAPLE_FUNC_MOUSE);
 
-       printk(KERN_INFO "input%d: mouse(0x%lx): %s\n",
-              mouse->dev.number, data, mouse->dev.name);
-
-       MOD_INC_USE_COUNT;
+       printk(KERN_INFO "input: mouse(0x%lx): %s\n", data, mouse->dev.name);
 
        return 0;
 }
@@ -100,10 +99,7 @@ static void dc_mouse_disconnect(struct maple_device *dev)
        struct dc_mouse *mouse = dev->private_data;
 
        input_unregister_device(&mouse->dev);
-
        kfree(mouse);
-
-       MOD_DEC_USE_COUNT;
 }
 
 
index f2c74a9bbdc7c186fac8b109705e78470d20212f..8346de427f05a51d3b1a62704d98da0f5b8f906f 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/hitachi_se.h>
+#include <asm/se/se.h>
 #include <asm/machvec.h>
 #ifdef CONFIG_SH_STANDARD_BIOS 
 #include <asm/sh_bios.h>
index c447c295c973c23001c921a010b0d7cf0ea4a17e..4f494d6558b91c57d5371e8860a1dce7d655c142 100644 (file)
@@ -37,5 +37,7 @@
 
 #define p3_cache_init()                                do { } while (0)
 
+#define HAVE_ARCH_UNMAPPED_AREA
+
 #endif /* __ASM_CPU_SH3_CACHEFLUSH_H */
 
diff --git a/include/asm-sh/cpu-sh3/dac.h b/include/asm-sh/cpu-sh3/dac.h
new file mode 100644 (file)
index 0000000..7f4129d
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef __ASM_SH_DAC_H
+#define __ASM_SH_DAC_H
+
+/*
+ * Copyright (C) 2003  Andriy Skulysh
+ */
+
+
+#define DADR0  0xa40000a0
+#define DADR1  0xa40000a2
+#define DACR   0xa40000a4
+#define DACR_DAOE1     0x80
+#define DACR_DAOE0     0x40
+#define DACR_DAE       0x20
+
+
+static __inline__ void sh_dac_enable(int channel)
+{
+       unsigned char v;
+       v = ctrl_inb(DACR);
+       if(channel) v |= DACR_DAOE1;
+       else v |= DACR_DAOE0;
+       ctrl_outb(v,DACR);
+}
+
+static __inline__ void sh_dac_disable(int channel)
+{
+       unsigned char v;
+       v = ctrl_inb(DACR);
+       if(channel) v &= ~DACR_DAOE1;
+       else v &= ~DACR_DAOE0;
+       ctrl_outb(v,DACR);
+}
+
+static __inline__ void sh_dac_output(u8 value, int channel)
+{
+       if(channel) ctrl_outb(value,DADR1);
+       else ctrl_outb(value,DADR0);
+}
+
+#endif /* __ASM_SH_DAC_H */
+
diff --git a/include/asm-sh/dreamcast/io.h b/include/asm-sh/dreamcast/io.h
deleted file mode 100644 (file)
index 9db9596..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *     $Id: io.h,v 1.3 2003/05/04 19:30:14 lethal Exp $
- *     IO functions for SEGA Dreamcast
- */
-
-#ifndef _ASM_SH_IO_DREAMCAST_H
-#define _ASM_SH_IO_DREAMCAST_H
-
-#include <asm/io_generic.h>
-
-unsigned long dreamcast_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb                 generic_inb
-# define __inw                 generic_inw
-# define __inl                 generic_inl
-# define __outb                        generic_outb
-# define __outw                        generic_outw
-# define __outl                        generic_outl
-
-# define __inb_p               generic_inb_p
-# define __inw_p               generic_inw
-# define __inl_p               generic_inl
-# define __outb_p              generic_outb_p
-# define __outw_p              generic_outw
-# define __outl_p              generic_outl
-
-# define __insb                        generic_insb
-# define __insw                        generic_insw
-# define __insl                        generic_insl
-# define __outsb               generic_outsb
-# define __outsw               generic_outsw
-# define __outsl               generic_outsl
-
-# define __readb               generic_readb
-# define __readw               generic_readw
-# define __readl               generic_readl
-# define __writeb              generic_writeb
-# define __writew              generic_writew
-# define __writel              generic_writel
-
-# define __isa_port2addr       dreamcast_isa_port2addr
-# define __ioremap             generic_ioremap
-# define __iounmap             generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_DREAMCAST_H */
index 306541673860299ccfc634151948a7e5bb5e098d..c457ca277a42c3d85ebbc3f0daa77ed564affaa1 100644 (file)
@@ -1,12 +1,24 @@
 #ifndef __ASM_SH_HD64461
 #define __ASM_SH_HD64461
 /*
- *     $Id: hd64461.h,v 1.4 2004/02/01 19:46:04 lethal Exp $
+ *     $Id: hd64461.h,v 1.5 2004/03/16 00:07:51 lethal Exp $
  *     Copyright (C) 2000 YAEGASHI Takeshi
  *     Hitachi HD64461 companion chip support
  */
 #include <linux/config.h>
 
+/* Constants for PCMCIA mappings */
+#define HD64461_PCC_WINDOW     0x01000000
+
+#define HD64461_PCC0_BASE      0xb8000000      /* area 6 */
+#define HD64461_PCC0_ATTR      (HD64461_PCC0_BASE)
+#define HD64461_PCC0_COMM      (HD64461_PCC0_BASE+HD64461_PCC_WINDOW)
+#define HD64461_PCC0_IO                (HD64461_PCC0_BASE+2*HD64461_PCC_WINDOW)
+
+#define HD64461_PCC1_BASE      0xb4000000      /* area 5 */
+#define HD64461_PCC1_ATTR      (HD64461_PCC1_BASE)
+#define HD64461_PCC1_COMM      (HD64461_PCC1_BASE+HD64461_PCC_WINDOW)
+
 #define HD64461_STBCR  0x10000
 #define HD64461_STBCR_CKIO_STBY                        0x2000
 #define HD64461_STBCR_SAFECKE_IST              0x1000
@@ -21,7 +33,7 @@
 #define HD64461_STBCR_STM0ST                   0x0008
 #define HD64461_STBCR_STM1ST                   0x0004
 #define HD64461_STBCR_SIRST                            0x0002
-#define HD64461_STBCR_SURTSD                   0x0001
+#define HD64461_STBCR_SURTST                   0x0001
 
 #define HD64461_SYSCR  0x10002
 #define HD64461_SCPUCR 0x10004
 #define HD64461_BBTROPR                0x11068
 #define HD64461_BBTMDR         0x1106a
 
-#define HD64461_PCC0ISR         0x12000
-#define HD64461_PCC0GCR         0x12002
-#define HD64461_PCC0CSCR        0x12004
-#define HD64461_PCC0CSCIER      0x12006
-#define HD64461_PCC0SCR         0x12008
-#define HD64461_PCC1ISR         0x12010
-#define HD64461_PCC1GCR         0x12012
-#define HD64461_PCC1CSCR        0x12014
-#define HD64461_PCC1CSCIER      0x12016
-#define HD64461_PCC1SCR         0x12018
+/* PC Card Controller Registers */
+#define HD64461_PCC0ISR         0x12000 /* socket 0 interface status */
+#define HD64461_PCC0GCR         0x12002 /* socket 0 general control */
+#define HD64461_PCC0CSCR        0x12004 /* socket 0 card status change */
+#define HD64461_PCC0CSCIER      0x12006 /* socket 0 card status change interrupt enable */
+#define HD64461_PCC0SCR         0x12008 /* socket 0 software control */
+#define HD64461_PCC1ISR         0x12010 /* socket 1 interface status */
+#define HD64461_PCC1GCR         0x12012 /* socket 1 general control */
+#define HD64461_PCC1CSCR        0x12014 /* socket 1 card status change */
+#define HD64461_PCC1CSCIER      0x12016 /* socket 1 card status change interrupt enable */
+#define HD64461_PCC1SCR         0x12018 /* socket 1 software control */
+
+/* PCC Interface Status Register */
+#define HD64461_PCCISR_READY           0x80    /* card ready */
+#define HD64461_PCCISR_MWP             0x40    /* card write-protected */
+#define HD64461_PCCISR_VS2             0x20    /* voltage select pin 2 */
+#define HD64461_PCCISR_VS1             0x10    /* voltage select pin 1 */
+#define HD64461_PCCISR_CD2             0x08    /* card detect 2 */
+#define HD64461_PCCISR_CD1             0x04    /* card detect 1 */
+#define HD64461_PCCISR_BVD2            0x02    /* battery 1 */
+#define HD64461_PCCISR_BVD1            0x01    /* battery 1 */
+
+#define HD64461_PCCISR_PCD_MASK                0x0c    /* card detect */
+#define HD64461_PCCISR_BVD_MASK        0x03    /* battery voltage */
+#define HD64461_PCCISR_BVD_BATGOOD     0x03    /* battery good */
+#define HD64461_PCCISR_BVD_BATWARN     0x01    /* battery low warning */
+#define HD64461_PCCISR_BVD_BATDEAD1    0x02    /* battery dead */
+#define HD64461_PCCISR_BVD_BATDEAD2    0x00    /* battery dead */
+
+/* PCC General Control Register */
+#define HD64461_PCCGCR_DRVE            0x80    /* output drive */
+#define HD64461_PCCGCR_PCCR            0x40    /* PC card reset */
+#define HD64461_PCCGCR_PCCT            0x20    /* PC card type, 1=IO&mem, 0=mem */
+#define HD64461_PCCGCR_VCC0            0x10    /* voltage control pin VCC0SEL0 */
+#define HD64461_PCCGCR_PMMOD           0x08    /* memory mode */
+#define HD64461_PCCGCR_PA25            0x04    /* pin A25 */
+#define HD64461_PCCGCR_PA24            0x02    /* pin A24 */
+#define HD64461_PCCGCR_REG             0x01    /* pin PCC0REG# */
+
+/* PCC Card Status Change Register */
+#define HD64461_PCCCSCR_SCDI           0x80    /* sw card detect intr */
+#define HD64461_PCCCSCR_SRV1           0x40    /* reserved */
+#define HD64461_PCCCSCR_IREQ           0x20    /* IREQ intr req */
+#define HD64461_PCCCSCR_SC             0x10    /* STSCHG (status change) pin */
+#define HD64461_PCCCSCR_CDC            0x08    /* CD (card detect) change */
+#define HD64461_PCCCSCR_RC             0x04    /* READY change */
+#define HD64461_PCCCSCR_BW             0x02    /* battery warning change */
+#define HD64461_PCCCSCR_BD             0x01    /* battery dead change */
+
+/* PCC Card Status Change Interrupt Enable Register */
+#define HD64461_PCCCSCIER_CRE          0x80    /* change reset enable */
+#define HD64461_PCCCSCIER_IREQE_MASK           0x60   /* IREQ enable */
+#define HD64461_PCCCSCIER_IREQE_DISABLED       0x00   /* IREQ disabled */
+#define HD64461_PCCCSCIER_IREQE_LEVEL          0x20   /* IREQ level-triggered */
+#define HD64461_PCCCSCIER_IREQE_FALLING        0x40   /* IREQ falling-edge-trig */
+#define HD64461_PCCCSCIER_IREQE_RISING         0x60   /* IREQ rising-edge-trig */
+
+#define HD64461_PCCCSCIER_SCE          0x10    /* status change enable */
+#define HD64461_PCCCSCIER_CDE          0x08    /* card detect change enable */
+#define HD64461_PCCCSCIER_RE           0x04    /* ready change enable */
+#define HD64461_PCCCSCIER_BWE          0x02    /* battery warn change enable */
+#define HD64461_PCCCSCIER_BDE          0x01    /* battery dead change enable*/
+
+/* PCC Software Control Register */
+#define HD64461_PCCSCR_VCC1            0x02    /* voltage control pin 1 */
+#define HD64461_PCCSCR_SWP             0x01    /* write protect */
+
+
 #define HD64461_P0OCR           0x1202a
 #define HD64461_P1OCR           0x1202c
 #define HD64461_PGCR            0x1202e
 #define HD64461_IRQBASE                OFFCHIP_IRQ_BASE
 #define HD64461_IRQ_NUM        16
 
+#define HD64461_IRQ_UART       (HD64461_IRQBASE+5)
+#define HD64461_IRQ_IRDA       (HD64461_IRQBASE+6)
+#define HD64461_IRQ_TMU1       (HD64461_IRQBASE+9)
+#define HD64461_IRQ_TMU0       (HD64461_IRQBASE+10)
+#define HD64461_IRQ_GPIO       (HD64461_IRQBASE+11)
+#define HD64461_IRQ_AFE        (HD64461_IRQBASE+12)
+#define HD64461_IRQ_PCC1       (HD64461_IRQBASE+13)
+#define HD64461_IRQ_PCC0       (HD64461_IRQBASE+14)
+
 #endif
index a4c22eb98689ad809f660fec4e1c3c025f5cbbe5..67f2489088d9ee0b9feadd36a70cd994c41609ef 100644 (file)
@@ -23,15 +23,21 @@ extern void hd64461_outl(unsigned int value, unsigned long port);
 extern unsigned char hd64461_inb_p(unsigned long port);
 extern void hd64461_outb_p(unsigned char value, unsigned long port);
 
-extern void hd64461_insb(unsigned long port, const void *buffer, unsigned long count);
-extern void hd64461_insw(unsigned long port, const void *buffer, unsigned long count);
-extern void hd64461_insl(unsigned long port, const void *buffer, unsigned long count);
+extern void hd64461_insb(unsigned long port, void *addr, unsigned long count);
+extern void hd64461_insw(unsigned long port, void *addr, unsigned long count);
+extern void hd64461_insl(unsigned long port, void *addr, unsigned long count);
 
 extern void hd64461_outsb(unsigned long port, const void *buffer, unsigned long count);
 extern void hd64461_outsw(unsigned long port, const void *buffer, unsigned long count);
 extern void hd64461_outsl(unsigned long port, const void *buffer, unsigned long count);
 
+extern unsigned short hd64461_readw(unsigned long addr);
+extern void hd64461_writew(unsigned short b, unsigned long addr);
+
 
 extern int hd64461_irq_demux(int irq);
+extern void hd64461_register_irq_demux(int irq,
+               int (*demux)(int irq, void *dev), void *dev);
+extern void hd64461_unregister_irq_demux(int irq);
 
 #endif /* _ASM_SH_IO_HD64461_H */
diff --git a/include/asm-sh/hp6xx/hp6xx.h b/include/asm-sh/hp6xx/hp6xx.h
new file mode 100644 (file)
index 0000000..53079d2
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __ASM_SH_HP6XX_H
+#define __ASM_SH_HP6XX_H
+
+/*
+ * Copyright (C) 2003  Andriy Skulysh
+ */
+
+
+#define DAC_LCD_BRIGHTNESS             0
+#define DAC_SPEAKER_VOLUME             1
+
+#define HD64461_GPADR_SPEAKER  0x01
+#define HD64461_GPADR_PCMCIA0  (0x02|0x08)
+#define HD64461_GPBDR_LCDOFF   0x01
+#define HD64461_GPBDR_LED_RED  0x80
+
+
+#endif /* __ASM_SH_HP6XX_H */
+
index c796590258e44c775a59fc82742745f8fd223ca1..f470f758057a876e5a35bde85c316938f3bfd0d9 100644 (file)
 #define TIMER_IPR_POS   3
 #define TIMER_PRIORITY  2
 
+#define TIMER1_IRQ     17
+#define TIMER1_IPR_ADDR        INTC_IPRA
+#define TIMER1_IPR_POS  2
+#define TIMER1_PRIORITY         4
+
 #define RTC_IRQ                22
 #define RTC_IPR_ADDR   INTC_IPRA
 #define RTC_IPR_POS     0
 # define OFFCHIP_NR_IRQS 16
 #else
 # if defined(CONFIG_HD64461)
-#  define OFFCHIP_NR_IRQS 16
+#  define OFFCHIP_NR_IRQS 18
 # elif defined (CONFIG_SH_BIGSUR) /* must be before CONFIG_HD64465 */
 #  define OFFCHIP_NR_IRQS 48
 # elif defined(CONFIG_HD64465)
index b1fe4abade51d3e1080335dcbd9595454b6477de..e7fcaf0a3c3508d37973b9a85a226742076ec703 100644 (file)
@@ -204,6 +204,8 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
        return __pgprot(prot);
 }
 
+#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
+
 /*
  * Conversion functions: convert a page and protection to a page entry,
  * and a page entry and page directory to the page they refer to.
index 215b7e12e6ca335a0fd4d86974295e8981f9e0fa..786d41c3663c5da98621ad4fd245413b183137c0 100644 (file)
@@ -22,6 +22,7 @@
 
 /* Core Processor Version Register */
 #define CCN_PVR                0xff000030
+#define CCN_CVR                0xff000040
 #define CCN_PRR                0xff000044
 
 /*
diff --git a/include/asm-sh/sh2000/io.h b/include/asm-sh/sh2000/io.h
deleted file mode 100644 (file)
index 9152cef..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * include/asm-sh/io_sh2000.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *           2001 SUGIOKA Toshinobu (sugioka@itonet.co.jp)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for use when we don't know what machine we are on
- */
-
-#ifndef _ASM_SH_IO_SH2000_H
-#define _ASM_SH_IO_SH2000_H
-
-#include <asm/io_generic.h>
-
-unsigned long sh2000_isa_port2addr(unsigned long offset);
-
-#ifdef __WANT_IO_DEF
-
-# define __inb                 generic_inb
-# define __inw                 generic_inw
-# define __inl                 generic_inl
-# define __outb                        generic_outb
-# define __outw                        generic_outw
-# define __outl                        generic_outl
-
-# define __inb_p               generic_inb_p
-# define __inw_p               generic_inw
-# define __inl_p               generic_inl
-# define __outb_p              generic_outb_p
-# define __outw_p              generic_outw
-# define __outl_p              generic_outl
-
-# define __insb                        generic_insb
-# define __insw                        generic_insw
-# define __insl                        generic_insl
-# define __outsb               generic_outsb
-# define __outsw               generic_outsw
-# define __outsl               generic_outsl
-
-# define __readb               generic_readb
-# define __readw               generic_readw
-# define __readl               generic_readl
-# define __writeb              generic_writeb
-# define __writew              generic_writew
-# define __writel              generic_writel
-
-# define __isa_port2addr       sh2000_isa_port2addr
-# define __ioremap             generic_ioremap
-# define __iounmap             generic_iounmap
-
-#endif
-
-#endif /* _ASM_SH_IO_SH2000_H */
index 51a5f0691ee517c3f4ae70116a2010f83df2174f..0a7ff717c2451fb754913bc3d0df7e2762b83549 100644 (file)
@@ -7,6 +7,10 @@
 struct pt_regs;
 struct siginfo;
 
+#ifdef __KERNEL__
+/* Most things should be clean enough to redefine this at will, if care
+   is taken to make libc match.  */
+
 #define _NSIG          64
 #define _NSIG_BPW      32
 #define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
@@ -17,6 +21,14 @@ typedef struct {
        unsigned long sig[_NSIG_WORDS];
 } sigset_t;
 
+#else
+/* Here we must cater to libcs that poke about in kernel headers.  */
+
+#define NSIG           32
+typedef unsigned long sigset_t;
+
+#endif /* __KERNEL__ */
+
 #define SIGHUP          1
 #define SIGINT          2
 #define SIGQUIT                 3
index 89b87832c7695aee7ca1fbc3abc5ce5d75a76464..fe5dae18da82c667645b42054be4b3eb1edea4c5 100644 (file)
@@ -19,6 +19,7 @@
 #define SUN_OPENPROM_MINOR 139
 #define DMAPI_MINOR            140     /* DMAPI */
 #define NVRAM_MINOR 144
+#define STORE_QUEUE_MINOR      155
 #define I2O_MINOR 166
 #define MICROCODE_MINOR                184
 #define MWAVE_MINOR    219             /* ACP/Mwave Modem */