GIT 128ded11b188ddb7b02f4f69bf17247ddf36a429 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git commit Author: Paul Mundt Date: Tue May 15 16:25:47 2007 +0900 sh: Fix SH-4 CPU selects. Now that select no longer works for selecting the "closest" CPU, we have to explicitly reference the precise sub-type in the few places where it actually matters (presently only setup code and some legacy sh-sci cruft). Signed-off-by: Paul Mundt commit 7cf44c5f21b6d4c115845e50a7a1540bcac59ca1 Author: Paul Mundt Date: Tue May 15 15:38:30 2007 +0900 sh: Rip out special unknown machvec. This kills off the BareCPU board as a "special" machvec, rather, we leave this as a default for when no other vector is available, or when we want to use it in combination with other vectors for testing with generic ops. As sh_mv is copied out anyways (or overloaded when an alternate vector is explicitly selected), this doesn't consume any additional memory. The generic machvec can be forcibly selected with sh_mv=generic, or by not having any other boards enabled. Signed-off-by: Paul Mundt commit 1247ab25501005abec3928fac916aea5e3c28e09 Author: Paul Mundt Date: Tue May 15 15:19:34 2007 +0900 sh: Kill off machvec aliases. We now throw all of the machvecs in to .machvec.init and either select one on the command line, or copy out the first (and usually only) one to sh_mv. The rest are freed as usual. This gets rid of all of the silly sh_mv aliasing and makes the selection explicit rather than link-order dependent. Signed-off-by: Paul Mundt commit c4942c66445497028927b06acad391ac74764917 Author: dmitry pervushin Date: Tue May 15 08:42:22 2007 +0900 sh: Fix clock multiplier on SH7722. This fixes up the master clock multiplier and initial rate propagation for the SH7722 clocks. Signed-off-by: dmitry pervushin Signed-off-by: Paul Mundt commit 708f24c86f3c5b0df4a775fb9b853857c190af3a Author: Paul Mundt Date: Tue May 15 08:36:36 2007 +0900 sh: Wire up kdump crash kernel exec in die(). Now that we have the basic kdump support in place, add it in to die() so we can enter the crash kernel automatically. Signed-off-by: Paul Mundt commit af24e40a3d4d911727b25252d43469b1e5050a2f Author: Paul Mundt Date: Mon May 14 19:39:48 2007 +0900 sh: sr.bl toggling around idle sleep. As pointed out by Saito-san, without the sr.bl manipulation we can occasionally hit delays in the idle loop due to interrupt handling, so ensure that interrupts are blocked before going to sleep. At the same time, we throw in TIF_POLLING_NRFLAG for the !hlt_counter case (primarily used by the ST-40 parts). Signed-off-by: Paul Mundt commit cbe40f89589a9c7063977426e9eb96227308bd12 Author: Paul Mundt Date: Mon May 14 19:12:37 2007 +0900 sh: Get multiple boards in one image working again. This tidies up the build rules and permits multiple boards to be linked in to the same kernel. The earlier Kconfig work ensures that the CPU configuration is consistent across the boards, as this is the only thing that we can't do dynamically. Signed-off-by: Paul Mundt commit a4a78388b7b85f0b410e9c28d209aa5dca3142f2 Author: Paul Mundt Date: Mon May 14 17:48:00 2007 +0900 sh: Fixup cmdline handling from machvec changes. The command line wasn't being saved off properly after the machvec changes went in, fix it up. Signed-off-by: Paul Mundt commit d6ad97a7d582208f5c17ebeb70992170927dd608 Author: Paul Mundt Date: Mon May 14 17:29:12 2007 +0900 sh: Rework CPU/board dependencies. This was a big mess, rework the logic a bit so that we constrain to a particular subtype and figure out the board support based on that. This makes building subtype specific kernels supporting multiple boards possible again. Signed-off-by: Paul Mundt commit c56d39283cbcec46e55ee1529520c8174bcaefef Author: Paul Mundt Date: Mon May 14 17:26:34 2007 +0900 sh: Shut up SH2-DSP compile warnings. Signed-off-by: Paul Mundt commit 42063c3e022a09f70b5ce1d7e2c19462b95ce9a8 Author: Paul Mundt Date: Mon May 14 17:00:31 2007 +0900 sh: disable genrtc support. sh never had support for this, so remove the option entirely. Signed-off-by: Paul Mundt commit 2810e8fc92fc7168e8ee62fda01f7239bcc4121f Author: Paul Mundt Date: Mon May 14 16:58:35 2007 +0900 fs: Kill sh dependency for binfmt_flat. Not really sure where this bogosity came from, but there's certainly nothing special about sh that lets us use flat files with the MMU on. Kill the dependency, and leave it as !MMU, like it is for all of the other nommu-wielding ports. Signed-off-by: Paul Mundt commit c54e2e89a8f883b9fb9930e51fc0e263bea0ecbe Author: Paul Mundt Date: Mon May 14 15:59:09 2007 +0900 sh: Fixup machvec support. This fixes up much of the machvec handling, allowing for it to be overloaded on boot. Making practical use of this still requires some Kconfig munging, however. Signed-off-by: Paul Mundt commit bbfd7764c81cd99a30a825a1a197b28c52078fa3 Author: Paul Mundt Date: Mon May 14 12:52:56 2007 +0900 sh: __user annotations for __get/__put_user(). This adds in some more __user annotations. These weren't being handled properly in some of the __get_user and __put_user paths, so tidy those up. Signed-off-by: Paul Mundt commit 5e5f00db82520ee91f4eb0e2b254a85ff3d7ebe8 Author: Paul Mundt Date: Mon May 14 12:50:43 2007 +0900 sh: Split out CPU topology initialization. Split out the CPU topology initialization to a separate file, and switch it to a percpu type, rather than an NR_CPUS array. At the same time, switch to only registering present CPUs, rather than using the possible CPU map. Signed-off-by: Paul Mundt commit 1d63fa8f92d3a2ef7d5ba5a7465baa0bd67f8a95 Author: Paul Mundt Date: Mon May 14 12:48:09 2007 +0900 sh: Disable psw support for R7785RP. While R7780RP and R7780MP support this, R7785RP does not. Signed-off-by: Paul Mundt commit 688e7636b1ece9fdb746d9bdc826b6b314ca9d66 Author: Paul Mundt Date: Mon May 14 10:49:40 2007 +0900 sh: Fix page size alignment in __copy_user_page(). SH-3 comes up with the PAGE_SIZE on a misaligned boundary: arch/sh/mm/copy_page.S: Assembler messages: arch/sh/mm/copy_page.S:132: Warning: misaligned data fix it up with explicit alignment. Signed-off-by: Paul Mundt commit 6402c39865c89bee965407e71bad00eb1cc60fa5 Author: Paul Mundt Date: Mon May 14 10:48:01 2007 +0900 sh: Fix up various compile warnings for SE boards. - setup-sh7750.c only defines the sh7751_ipr_map when building with SH7751 support. - 7722 Solution Engine was missing a mach-type entry, causing the macro in cf-enabler to be undefined. - arch/sh/mm/init.c needs linux/pagemap.h. Signed-off-by: Paul Mundt commit 2bdf4e5923c3770e5b259b6f0ce0ba5d0b1f1461 Author: Paul Mundt Date: Mon May 14 09:29:55 2007 +0900 sh: Wire up signalfd/timerfd/eventfd syscalls. Signed-off-by: Paul Mundt commit bfa90362c9e227af0bb2a1ef4a97042233f96cff Author: Christoph Hellwig Date: Mon May 14 08:18:14 2007 +0900 sh: revert addition of page fault notifiers Just at the time you added them on sh we're removing them from other architectures. As there's no user yet this patch just removes them completely. Once you actually have a kprobes patch it should follow the direct call to kprobes_fault_handler model that powerpc, s390 and sparc64 employ in 2.6.22-rc1 and that I'm updating other architectures to. Signed-off-by: Christoph Hellwig Signed-off-by: Paul Mundt commit e628cfffdb7266a6c7ad982c1c61694b46e04497 Author: Simon Arlott Date: Mon May 14 08:15:10 2007 +0900 spelling fixes: arch/sh/ Spelling fixes in arch/sh/. Signed-off-by: Simon Arlott Signed-off-by: Paul Mundt commit 9e959e00ab8e09f1f97124110a3111ddab1d22a2 Author: Paul Mundt Date: Mon May 14 08:10:56 2007 +0900 sh: Allow large block allocation via LARGE_ALLOCS. Wires up CONFIG_LARGE_ALLOCS, some of the SH-2 users are interested in this. Signed-off-by: Paul Mundt commit 049fa57ce3b22d9f5acb251070941b630ee71d6e Author: Kristoffer Ericson Date: Sat May 12 20:28:05 2007 +0900 input: hp680_ts compile fixes. Trivial fix to follow the DECLARE_WORK changes, this makes the HD64461 touchscreen driver work properly again. As pointed out by David Howells. Signed-off-by: Kristoffer Ericson Signed-off-by: Paul Mundt commit ad05acd6e95e99f56da304ec3566d81061ab67f9 Author: kogiidena Date: Sat May 12 20:25:11 2007 +0900 sh: landisk: Header cleanups. Signed-off-by: kogiidena Signed-off-by: Paul Mundt commit ad47c12b3596269b975c21fba8f3cf09befdc1f2 Author: kogiidena Date: Sat May 12 20:24:15 2007 +0900 sh: landisk: rtc-rs5c313 support. Add the rs5c313 platform device to the landisk setup code. Signed-off-by: kogiidena Signed-off-by: Paul Mundt commit 38c425f69c8d949620384f917e00652eaf390ec9 Author: Paul Mundt Date: Fri May 11 11:26:10 2007 +0900 sh: Kill off pmb slab cache destructor. This is the last remaining slab destructor in the kernel, which we kill off and move the resultant list tracking logic up to the pmb_alloc()/pmb_free() paths. As Christoph Lameter pointed out, it's potentially unsafe to be taking the list lock in the destructor anyways, so this is also more fundamentally correct. With this in place, we're all set for killing off slab destructors from the kernel entirely. Signed-off-by: Paul Mundt commit 0facbe3a34556bbc30333971e32c5430b087fcb1 Author: Paul Mundt Date: Fri May 11 11:23:05 2007 +0900 sh: Fix up psw build rules for r7780rp. When reordering the Makefile rules, the psw support was being clobbered. Fix it up so it's linked in again. Signed-off-by: Paul Mundt commit b8947444a738c6407466244c60e9e4a2999af555 Author: Paul Mundt Date: Thu May 10 14:25:01 2007 +0900 sh: Shut up compiler warnings in __do_page_fault(). GCC doesn't seem to be able to figure this one out for itself, so just shut it up.. CC arch/sh/mm/fault.o arch/sh/mm/fault.c: In function '__do_page_fault': arch/sh/mm/fault.c:288: warning: 'ptl' may be used uninitialized in this function Signed-off-by: Paul Mundt arch/sh/Kconfig | 316 +++++++++++++-------------- arch/sh/Makefile | 87 ++++--- arch/sh/boards/dreamcast/setup.c | 3 arch/sh/boards/hp6xx/mach.c | 4 arch/sh/boards/hp6xx/setup.c | 3 arch/sh/boards/landisk/gio.c | 2 arch/sh/boards/landisk/setup.c | 9 + arch/sh/boards/lboxre2/setup.c | 3 arch/sh/boards/mpc1211/setup.c | 3 arch/sh/boards/renesas/edosk7705/setup.c | 3 arch/sh/boards/renesas/hs7751rvoip/setup.c | 3 arch/sh/boards/renesas/r7780rp/Kconfig | 6 - arch/sh/boards/renesas/r7780rp/Makefile | 5 arch/sh/boards/renesas/r7780rp/setup.c | 3 arch/sh/boards/renesas/rts7751r2d/setup.c | 3 arch/sh/boards/renesas/sh7710voipgw/setup.c | 3 arch/sh/boards/renesas/systemh/setup.c | 3 arch/sh/boards/saturn/setup.c | 3 arch/sh/boards/se/7206/setup.c | 3 arch/sh/boards/se/7300/setup.c | 3 arch/sh/boards/se/73180/setup.c | 3 arch/sh/boards/se/7343/setup.c | 3 arch/sh/boards/se/7619/setup.c | 3 arch/sh/boards/se/770x/setup.c | 3 arch/sh/boards/se/7722/setup.c | 3 arch/sh/boards/se/7751/setup.c | 3 arch/sh/boards/se/7780/setup.c | 3 arch/sh/boards/sh03/setup.c | 3 arch/sh/boards/shmin/setup.c | 3 arch/sh/boards/snapgear/rtc.c | 2 arch/sh/boards/snapgear/setup.c | 3 arch/sh/boards/superh/microdev/io.c | 6 - arch/sh/boards/superh/microdev/irq.c | 6 - arch/sh/boards/superh/microdev/setup.c | 5 arch/sh/boards/titan/setup.c | 3 arch/sh/boards/unknown/Makefile | 6 - arch/sh/boards/unknown/setup.c | 21 -- arch/sh/drivers/dma/dma-api.c | 2 arch/sh/drivers/dma/dma-isa.c | 2 arch/sh/drivers/dma/dmabrg.c | 2 arch/sh/drivers/pci/ops-dreamcast.c | 2 arch/sh/drivers/pci/pci-st40.c | 6 - arch/sh/drivers/pci/pci-st40.h | 2 arch/sh/drivers/superhyway/ops-sh4-202.c | 2 arch/sh/kernel/Makefile | 9 - arch/sh/kernel/cf-enabler.c | 8 - arch/sh/kernel/cpu/clock.c | 7 + arch/sh/kernel/cpu/irq/maskreg.c | 2 arch/sh/kernel/cpu/sh4/Makefile | 4 arch/sh/kernel/cpu/sh4/fpu.c | 2 arch/sh/kernel/cpu/sh4/setup-sh7750.c | 2 arch/sh/kernel/cpu/sh4a/clock-sh7722.c | 34 ++- arch/sh/kernel/kgdb_stub.c | 4 arch/sh/kernel/machvec.c | 130 +++++++++++ arch/sh/kernel/process.c | 47 +++- arch/sh/kernel/ptrace.c | 8 - arch/sh/kernel/setup.c | 193 ++-------------- arch/sh/kernel/signal.c | 4 arch/sh/kernel/syscalls.S | 3 arch/sh/kernel/topology.c | 21 ++ arch/sh/kernel/traps.c | 17 + arch/sh/kernel/vmlinux.lds.S | 3 arch/sh/math-emu/math.c | 2 arch/sh/mm/Kconfig | 33 ++- arch/sh/mm/copy_page.S | 1 arch/sh/mm/fault.c | 39 --- arch/sh/mm/init.c | 3 arch/sh/mm/pmb.c | 79 +++---- arch/sh/tools/mach-types | 5 drivers/char/Kconfig | 2 drivers/input/touchscreen/hp680_ts_input.c | 7 - drivers/serial/sh-sci.h | 25 ++ fs/Kconfig.binfmt | 2 include/asm-sh/kdebug.h | 4 include/asm-sh/landisk/gio.h | 10 - include/asm-sh/landisk/iodata_landisk.h | 37 --- include/asm-sh/machvec.h | 4 include/asm-sh/machvec_init.h | 53 ----- include/asm-sh/page.h | 1 include/asm-sh/sections.h | 2 include/asm-sh/setup.h | 1 include/asm-sh/system.h | 14 + include/asm-sh/uaccess.h | 40 ++- include/asm-sh/unistd.h | 5 84 files changed, 679 insertions(+), 753 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 038179e..78f5f23 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -81,24 +81,146 @@ source "init/Kconfig" menu "System type" -config SOLUTION_ENGINE - bool +source "arch/sh/mm/Kconfig" + +menu "Processor features" choice - prompt "SuperH system type" - default SH_UNKNOWN + prompt "Endianess selection" + default CPU_LITTLE_ENDIAN + help + Some SuperH machines can be configured for either little or big + endian byte order. These modes require different kernels. + +config CPU_LITTLE_ENDIAN + bool "Little Endian" + +config CPU_BIG_ENDIAN + bool "Big Endian" + +endchoice + +config SH_FPU + bool "FPU support" + depends on !CPU_SH3 + default y + help + Selecting this option will enable support for SH processors that + have FPU units (ie, SH77xx). + + This option must be set in order to enable the FPU. + +config SH_FPU_EMU + bool "FPU emulation support" + depends on !SH_FPU && EXPERIMENTAL + default n + help + Selecting this option will enable support for software FPU emulation. + Most SH-3 users will want to say Y here, whereas most SH-4 users will + want to say N. + +config SH_DSP + bool "DSP support" + default y if SH4AL_DSP || !CPU_SH4 + default n + help + Selecting this option will enable support for SH processors that + have DSP units (ie, SH2-DSP, SH3-DSP, and SH4AL-DSP). + + This option must be set in order to enable the DSP. + +config SH_ADC + bool "ADC support" + depends on CPU_SH3 + default y + help + Selecting this option will allow the Linux kernel to use SH3 on-chip + ADC module. + + If unsure, say N. + +config SH_STORE_QUEUES + bool "Support for Store Queues" + depends on CPU_SH4 + help + Selecting this option will enable an in-kernel API for manipulating + 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 + bool + +config CPU_HAS_PINT_IRQ + bool + +config CPU_HAS_MASKREG_IRQ + bool + +config CPU_HAS_INTC2_IRQ + bool + +config CPU_HAS_IPR_IRQ + bool + +config CPU_HAS_SR_RB + bool "CPU has SR.RB" + depends on CPU_SH3 || CPU_SH4 + default y + help + This will enable the use of SR.RB register bank usage. Processors + that are lacking this bit must have another method in place for + accomplishing what is taken care of by the banked registers. + + See for further + information on SR.RB and register banking in the kernel in general. + +config CPU_HAS_PTEA + bool + +endmenu + +menu "Board support" + +config SOLUTION_ENGINE + bool config SH_SOLUTION_ENGINE bool "SolutionEngine" select SOLUTION_ENGINE + depends on CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7750 help Select SolutionEngine if configuring for a Hitachi SH7709 or SH7750 evaluation board. +config SH_7206_SOLUTION_ENGINE + bool "SolutionEngine7206" + select SOLUTION_ENGINE + depends on CPU_SUBTYPE_SH7206 + help + Select 7206 SolutionEngine if configuring for a Hitachi SH7206 + evaluation board. + +config SH_7619_SOLUTION_ENGINE + bool "SolutionEngine7619" + select SOLUTION_ENGINE + depends on CPU_SUBTYPE_SH7619 + help + Select 7619 SolutionEngine if configuring for a Hitachi SH7619 + evaluation board. + config SH_7722_SOLUTION_ENGINE bool "SolutionEngine7722" select SOLUTION_ENGINE - select CPU_SUBTYPE_SH7722 + depends on CPU_SUBTYPE_SH7722 help Select 7722 SolutionEngine if configuring for a Hitachi SH772 evaluation board. @@ -106,7 +228,7 @@ config SH_7722_SOLUTION_ENGINE config SH_7751_SOLUTION_ENGINE bool "SolutionEngine7751" select SOLUTION_ENGINE - select CPU_SUBTYPE_SH7751 + depends on CPU_SUBTYPE_SH7751 help Select 7751 SolutionEngine if configuring for a Hitachi SH7751 evaluation board. @@ -114,7 +236,7 @@ config SH_7751_SOLUTION_ENGINE config SH_7780_SOLUTION_ENGINE bool "SolutionEngine7780" select SOLUTION_ENGINE - select CPU_SUBTYPE_SH7780 + depends on CPU_SUBTYPE_SH7780 help Select 7780 SolutionEngine if configuring for a Renesas SH7780 evaluation board. @@ -122,7 +244,7 @@ config SH_7780_SOLUTION_ENGINE config SH_7300_SOLUTION_ENGINE bool "SolutionEngine7300" select SOLUTION_ENGINE - select CPU_SUBTYPE_SH7300 + depends on CPU_SUBTYPE_SH7300 help Select 7300 SolutionEngine if configuring for a Hitachi SH7300(SH-Mobile V) evaluation board. @@ -130,22 +252,22 @@ config SH_7300_SOLUTION_ENGINE config SH_7343_SOLUTION_ENGINE bool "SolutionEngine7343" select SOLUTION_ENGINE - select CPU_SUBTYPE_SH7343 + depends on CPU_SUBTYPE_SH7343 help Select 7343 SolutionEngine if configuring for a Hitachi SH7343 (SH-Mobile 3AS) evaluation board. config SH_73180_SOLUTION_ENGINE - bool "SolutionEngine73180" + bool "SolutionEngine73180" select SOLUTION_ENGINE - select CPU_SUBTYPE_SH73180 + depends on CPU_SUBTYPE_SH73180 help Select 73180 SolutionEngine if configuring for a Hitachi SH73180(SH-Mobile 3) evaluation board. config SH_7751_SYSTEMH bool "SystemH7751R" - select CPU_SUBTYPE_SH7751R + depends on CPU_SUBTYPE_SH7751R help Select SystemH if you are configuring for a Renesas SystemH 7751R evaluation board. @@ -153,6 +275,7 @@ config SH_7751_SYSTEMH config SH_HP6XX bool "HP6XX" select SYS_SUPPORTS_APM_EMULATION + depends on CPU_SUBTYPE_SH7709 help Select HP6XX if configuring for a HP jornada HP6xx. More information (hardware only) at @@ -160,13 +283,13 @@ config SH_HP6XX config SH_SATURN bool "Saturn" - select CPU_SUBTYPE_SH7604 + depends on CPU_SUBTYPE_SH7604 help Select Saturn if configuring for a SEGA Saturn. config SH_DREAMCAST bool "Dreamcast" - select CPU_SUBTYPE_SH7091 + depends on CPU_SUBTYPE_SH7091 help Select Dreamcast if configuring for a SEGA Dreamcast. More information at @@ -175,6 +298,7 @@ config SH_DREAMCAST config SH_MPC1211 bool "Interface MPC1211" + depends on CPU_SUBTYPE_SH7751 && BROKEN help CTP/PCI-SH02 is a CPU module computer that is produced by Interface Corporation. @@ -182,6 +306,7 @@ config SH_MPC1211 config SH_SH03 bool "Interface CTP/PCI-SH03" + depends on CPU_SUBTYPE_SH7751 && BROKEN help CTP/PCI-SH03 is a CPU module computer that is produced by Interface Corporation. @@ -189,7 +314,7 @@ config SH_SH03 config SH_SECUREEDGE5410 bool "SecureEdge5410" - select CPU_SUBTYPE_SH7751R + depends on CPU_SUBTYPE_SH7751R help Select SecureEdge5410 if configuring for a SnapGear SH board. This includes both the OEM SecureEdge products as well as the @@ -197,101 +322,74 @@ config SH_SECUREEDGE5410 config SH_HS7751RVOIP bool "HS7751RVOIP" - select CPU_SUBTYPE_SH7751R + depends on CPU_SUBTYPE_SH7751R help Select HS7751RVOIP if configuring for a Renesas Technology Sales VoIP board. config SH_7710VOIPGW bool "SH7710-VOIP-GW" - select CPU_SUBTYPE_SH7710 + depends on CPU_SUBTYPE_SH7710 help Select this option to build a kernel for the SH7710 based VOIP GW. config SH_RTS7751R2D bool "RTS7751R2D" - select CPU_SUBTYPE_SH7751R + depends on CPU_SUBTYPE_SH7751R help Select RTS7751R2D if configuring for a Renesas Technology Sales SH-Graphics board. config SH_HIGHLANDER bool "Highlander" + depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 config SH_EDOSK7705 bool "EDOSK7705" - select CPU_SUBTYPE_SH7705 + depends on CPU_SUBTYPE_SH7705 config SH_SH4202_MICRODEV bool "SH4-202 MicroDev" - select CPU_SUBTYPE_SH4_202 + depends on CPU_SUBTYPE_SH4_202 help Select SH4-202 MicroDev if configuring for a SuperH MicroDev board with an SH4-202 CPU. config SH_LANDISK bool "LANDISK" - select CPU_SUBTYPE_SH7751R + depends on CPU_SUBTYPE_SH7751R help I-O DATA DEVICE, INC. "LANDISK Series" support. config SH_TITAN bool "TITAN" - select CPU_SUBTYPE_SH7751R + depends on CPU_SUBTYPE_SH7751R help Select Titan if you are configuring for a Nimble Microsystems NetEngine NP51R. config SH_SHMIN bool "SHMIN" - select CPU_SUBTYPE_SH7706 + depends on CPU_SUBTYPE_SH7706 help Select SHMIN if configuring for the SHMIN board. -config SH_7206_SOLUTION_ENGINE - bool "SolutionEngine7206" - select CPU_SUBTYPE_SH7206 - help - Select 7206 SolutionEngine if configuring for a Hitachi SH7206 - evaluation board. - -config SH_7619_SOLUTION_ENGINE - bool "SolutionEngine7619" - select CPU_SUBTYPE_SH7619 - help - Select 7619 SolutionEngine if configuring for a Hitachi SH7619 - evaluation board. - config SH_LBOX_RE2 bool "L-BOX RE2" - select CPU_SUBTYPE_SH7751R + depends on CPU_SUBTYPE_SH7751R help Select L-BOX RE2 if configuring for the NTT COMWARE L-BOX RE2. -config SH_UNKNOWN - bool "BareCPU" - help - "Bare CPU" aka "unknown" means an SH-based system which is not one - of the specific ones mentioned above, which means you need to enter - all sorts of stuff like CONFIG_MEMORY_START because the config - system doesn't already know what it is. You get a machine vector - without any platform-specific code in it, so things like the RTC may - not work. - - This option is for the early stages of porting to a new machine. - -endchoice +endmenu 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" - config CF_ENABLER bool "Compact Flash Enabler support" - depends on SH_SOLUTION_ENGINE || SH_UNKNOWN || SH_SH03 + depends on SH_SOLUTION_ENGINE || SH_SH03 ---help--- Compact Flash is a small, removable mass storage device introduced in 1994 originally as a PCMCIA device. If you say `Y' here, you @@ -332,110 +430,6 @@ config CF_BASE_ADDR default "0xb8000000" if CF_AREA6 default "0xb4000000" if CF_AREA5 -menu "Processor features" - -choice - prompt "Endianess selection" - default CPU_LITTLE_ENDIAN - help - Some SuperH machines can be configured for either little or big - endian byte order. These modes require different kernels. - -config CPU_LITTLE_ENDIAN - bool "Little Endian" - -config CPU_BIG_ENDIAN - bool "Big Endian" - -endchoice - -config SH_FPU - bool "FPU support" - depends on !CPU_SH3 - default y - help - Selecting this option will enable support for SH processors that - have FPU units (ie, SH77xx). - - This option must be set in order to enable the FPU. - -config SH_FPU_EMU - bool "FPU emulation support" - depends on !SH_FPU && EXPERIMENTAL - default n - help - Selecting this option will enable support for software FPU emulation. - Most SH-3 users will want to say Y here, whereas most SH-4 users will - want to say N. - -config SH_DSP - bool "DSP support" - default y if SH4AL_DSP || !CPU_SH4 - default n - help - Selecting this option will enable support for SH processors that - have DSP units (ie, SH2-DSP, SH3-DSP, and SH4AL-DSP). - - This option must be set in order to enable the DSP. - -config SH_ADC - bool "ADC support" - depends on CPU_SH3 - default y - help - Selecting this option will allow the Linux kernel to use SH3 on-chip - ADC module. - - If unsure, say N. - -config SH_STORE_QUEUES - bool "Support for Store Queues" - depends on CPU_SH4 - help - Selecting this option will enable an in-kernel API for manipulating - 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 - bool - -config CPU_HAS_PINT_IRQ - bool - -config CPU_HAS_MASKREG_IRQ - bool - -config CPU_HAS_INTC2_IRQ - bool - -config CPU_HAS_IPR_IRQ - bool - -config CPU_HAS_SR_RB - bool "CPU has SR.RB" - depends on CPU_SH3 || CPU_SH4 - default y - help - This will enable the use of SR.RB register bank usage. Processors - that are lacking this bit must have another method in place for - accomplishing what is taken care of by the banked registers. - - See for further - information on SR.RB and register banking in the kernel in general. - -config CPU_HAS_PTEA - bool - -endmenu menu "Timer and clock configuration" @@ -473,13 +467,13 @@ config SH_PCLK_FREQ int "Peripheral clock frequency (in Hz)" default "27000000" if CPU_SUBTYPE_SH73180 || CPU_SUBTYPE_SH7343 default "31250000" if CPU_SUBTYPE_SH7619 + default "32000000" if CPU_SUBTYPE_SH7722 default "33333333" if CPU_SUBTYPE_SH7300 || CPU_SUBTYPE_SH7770 || \ CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \ CPU_SUBTYPE_SH7206 - default "50000000" if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7780 || \ - CPU_SUBTYPE_SH7785 - default "60000000" if CPU_SUBTYPE_SH7751 + default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R default "66000000" if CPU_SUBTYPE_SH4_202 + default "50000000" help This option is used to specify the peripheral clock frequency. This is necessary for determining the reference clock value on diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 7b11224..9abcaf6 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -87,39 +87,38 @@ core-y += arch/sh/kernel/ arch/sh/mm/ core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ # Boards -machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x -machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE) := se/7722 -machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751 -machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE) := se/7780 -machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) := se/7300 -machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) := se/7343 -machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se/73180 -machdir-$(CONFIG_SH_HP6XX) := hp6xx -machdir-$(CONFIG_SH_SATURN) := saturn -machdir-$(CONFIG_SH_DREAMCAST) := dreamcast -machdir-$(CONFIG_SH_MPC1211) := mpc1211 -machdir-$(CONFIG_SH_SH03) := sh03 -machdir-$(CONFIG_SH_SECUREEDGE5410) := snapgear -machdir-$(CONFIG_SH_HS7751RVOIP) := renesas/hs7751rvoip -machdir-$(CONFIG_SH_RTS7751R2D) := renesas/rts7751r2d -machdir-$(CONFIG_SH_7751_SYSTEMH) := renesas/systemh -machdir-$(CONFIG_SH_EDOSK7705) := renesas/edosk7705 -machdir-$(CONFIG_SH_HIGHLANDER) := renesas/r7780rp -machdir-$(CONFIG_SH_7710VOIPGW) := renesas/sh7710voipgw -machdir-$(CONFIG_SH_SH4202_MICRODEV) := superh/microdev -machdir-$(CONFIG_SH_LANDISK) := landisk -machdir-$(CONFIG_SH_TITAN) := titan -machdir-$(CONFIG_SH_SHMIN) := shmin -machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) := se/7206 -machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) := se/7619 -machdir-$(CONFIG_SH_LBOX_RE2) := lboxre2 -machdir-$(CONFIG_SH_UNKNOWN) := unknown - -incdir-y := $(notdir $(machdir-y)) -incdir-$(CONFIG_SH_HP6XX) := hp6xx +machdir-$(CONFIG_SH_SOLUTION_ENGINE) += se/770x +machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE) += se/7722 +machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) += se/7751 +machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE) += se/7780 +machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) += se/7300 +machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) += se/7343 +machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) += se/73180 +machdir-$(CONFIG_SH_HP6XX) += hp6xx +machdir-$(CONFIG_SH_SATURN) += saturn +machdir-$(CONFIG_SH_DREAMCAST) += dreamcast +machdir-$(CONFIG_SH_MPC1211) += mpc1211 +machdir-$(CONFIG_SH_SH03) += sh03 +machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear +machdir-$(CONFIG_SH_HS7751RVOIP) += renesas/hs7751rvoip +machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d +machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh +machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705 +machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp +machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw +machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev +machdir-$(CONFIG_SH_LANDISK) += landisk +machdir-$(CONFIG_SH_TITAN) += titan +machdir-$(CONFIG_SH_SHMIN) += shmin +machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) += se/7206 +machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619 +machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2 + +incdir-y := $(notdir $(machdir-y)) ifneq ($(machdir-y),) -core-y += arch/sh/boards/$(machdir-y)/ +core-y += $(addprefix arch/sh/boards/, \ + $(filter-out ., $(patsubst %,%/,$(machdir-y)))) endif # Companion chips @@ -157,19 +156,31 @@ include/asm-sh/.cpu: $(wildcard include/ # Most boards have their own mach directories. For the ones that # don't, just reference the parent directory so the semantics are # kept roughly the same. +# +# When multiple boards are compiled in at the same time, preference +# for the mach link is given to whichever has a directory for its +# headers. However, this is only a workaround until platforms that +# can live in the same kernel image back away from relying on the +# mach link. include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \ include/config/auto.conf FORCE - @echo -n ' SYMLINK include/asm-sh/mach -> ' $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi - $(Q)if [ -d $(incdir-prefix)$(incdir-y) ]; then \ - echo -e 'include/asm-sh/$(incdir-y)'; \ - ln -fsn $(incdir-prefix)$(incdir-y) \ + $(Q)rm -f include/asm-sh/mach + $(Q)for i in $(incdir-y); do \ + if [ -d $(incdir-prefix)$$i ]; then \ + echo -n ' SYMLINK include/asm-sh/mach -> '; \ + echo -e "include/asm-sh/$$i"; \ + ln -fsn $(incdir-prefix)$$i \ include/asm-sh/mach; \ else \ - echo -e 'include/asm-sh'; \ - ln -fsn $(incdir-prefix) include/asm-sh/mach; \ - fi + if [ ! -d include/asm-sh/mach ]; then \ + echo -n ' SYMLINK include/asm-sh/mach -> '; \ + echo -e 'include/asm-sh'; \ + ln -fsn $(incdir-prefix) include/asm-sh/mach; \ + fi; \ + fi; \ + done @touch $@ archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools diff --git a/arch/sh/boards/dreamcast/setup.c b/arch/sh/boards/dreamcast/setup.c index f13017e..8799df6 100644 --- a/arch/sh/boards/dreamcast/setup.c +++ b/arch/sh/boards/dreamcast/setup.c @@ -60,7 +60,7 @@ #ifdef CONFIG_PCI #endif } -struct sh_machine_vector mv_dreamcast __initmv = { +static struct sh_machine_vector mv_dreamcast __initmv = { .mv_name = "Sega Dreamcast", .mv_setup = dreamcast_setup, .mv_irq_demux = systemasic_irq_demux, @@ -70,4 +70,3 @@ #ifdef CONFIG_PCI .mv_consistent_free = dreamcast_consistent_free, #endif }; -ALIAS_MV(dreamcast) diff --git a/arch/sh/boards/hp6xx/mach.c b/arch/sh/boards/hp6xx/mach.c index 08dbba9..35b8959 100644 --- a/arch/sh/boards/hp6xx/mach.c +++ b/arch/sh/boards/hp6xx/mach.c @@ -13,7 +13,7 @@ #include #include #include -struct sh_machine_vector mv_hp6xx __initmv = { +static struct sh_machine_vector mv_hp6xx __initmv = { .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM, .mv_inb = hd64461_inb, @@ -42,5 +42,3 @@ struct sh_machine_vector mv_hp6xx __init .mv_irq_demux = hd64461_irq_demux, }; - -ALIAS_MV(hp6xx) diff --git a/arch/sh/boards/hp6xx/setup.c b/arch/sh/boards/hp6xx/setup.c index 6aeee85..7ae7089 100644 --- a/arch/sh/boards/hp6xx/setup.c +++ b/arch/sh/boards/hp6xx/setup.c @@ -98,10 +98,9 @@ #endif } device_initcall(hp6xx_devices_setup); -struct sh_machine_vector mv_hp6xx __initmv = { +static struct sh_machine_vector mv_hp6xx __initmv = { .mv_name = "hp6xx", .mv_setup = hp6xx_setup, .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM, .mv_irq_demux = hd64461_irq_demux, }; -ALIAS_MV(hp6xx) diff --git a/arch/sh/boards/landisk/gio.c b/arch/sh/boards/landisk/gio.c index 50d38be..a37643d 100644 --- a/arch/sh/boards/landisk/gio.c +++ b/arch/sh/boards/landisk/gio.c @@ -69,7 +69,7 @@ static int gio_ioctl(struct inode *inode } switch (cmd) { - case GIODRV_IOCSGIOSETADDR: /* addres set */ + case GIODRV_IOCSGIOSETADDR: /* address set */ addr = data; break; diff --git a/arch/sh/boards/landisk/setup.c b/arch/sh/boards/landisk/setup.c index 4058b4f..eda7176 100644 --- a/arch/sh/boards/landisk/setup.c +++ b/arch/sh/boards/landisk/setup.c @@ -44,8 +44,14 @@ static struct platform_device cf_ide_dev }, }; +static struct platform_device rtc_device = { + .name = "rs5c313", + .id = -1, +}; + static struct platform_device *landisk_devices[] __initdata = { &cf_ide_device, + &rtc_device, }; static int __init landisk_devices_setup(void) @@ -91,10 +97,9 @@ static void __init landisk_setup(char ** /* * The Machine Vector */ -struct sh_machine_vector mv_landisk __initmv = { +static struct sh_machine_vector mv_landisk __initmv = { .mv_name = "LANDISK", .mv_nr_irqs = 72, .mv_setup = landisk_setup, .mv_init_irq = init_landisk_IRQ, }; -ALIAS_MV(landisk) diff --git a/arch/sh/boards/lboxre2/setup.c b/arch/sh/boards/lboxre2/setup.c index 4e20f7c..9c830fd 100644 --- a/arch/sh/boards/lboxre2/setup.c +++ b/arch/sh/boards/lboxre2/setup.c @@ -77,9 +77,8 @@ device_initcall(lboxre2_devices_setup); /* * The Machine Vector */ -struct sh_machine_vector mv_lboxre2 __initmv = { +static 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) diff --git a/arch/sh/boards/mpc1211/setup.c b/arch/sh/boards/mpc1211/setup.c index 1a0604b..8ce03e0 100644 --- a/arch/sh/boards/mpc1211/setup.c +++ b/arch/sh/boards/mpc1211/setup.c @@ -338,11 +338,10 @@ static void __init mpc1211_setup(char ** /* * The Machine Vector */ -struct sh_machine_vector mv_mpc1211 __initmv = { +static struct sh_machine_vector mv_mpc1211 __initmv = { .mv_name = "Interface MPC-1211(CTP/PCI/MPC-SH02)", .mv_setup = mpc1211_setup, .mv_nr_irqs = 48, .mv_irq_demux = mpc1211_irq_demux, .mv_init_irq = init_mpc1211_IRQ, }; -ALIAS_MV(mpc1211) diff --git a/arch/sh/boards/renesas/edosk7705/setup.c b/arch/sh/boards/renesas/edosk7705/setup.c index ec5be01..f076c45 100644 --- a/arch/sh/boards/renesas/edosk7705/setup.c +++ b/arch/sh/boards/renesas/edosk7705/setup.c @@ -21,7 +21,7 @@ static void __init sh_edosk7705_init_irq /* * The Machine Vector */ -struct sh_machine_vector mv_edosk7705 __initmv = { +static struct sh_machine_vector mv_edosk7705 __initmv = { .mv_name = "EDOSK7705", .mv_nr_irqs = 80, @@ -41,4 +41,3 @@ struct sh_machine_vector mv_edosk7705 __ .mv_isa_port2addr = sh_edosk7705_isa_port2addr, .mv_init_irq = sh_edosk7705_init_irq, }; -ALIAS_MV(edosk7705) diff --git a/arch/sh/boards/renesas/hs7751rvoip/setup.c b/arch/sh/boards/renesas/hs7751rvoip/setup.c index f7d0e30..fa5fa39 100644 --- a/arch/sh/boards/renesas/hs7751rvoip/setup.c +++ b/arch/sh/boards/renesas/hs7751rvoip/setup.c @@ -89,7 +89,7 @@ static void __init hs7751rvoip_setup(cha printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n"); } -struct sh_machine_vector mv_hs7751rvoip __initmv = { +static struct sh_machine_vector mv_hs7751rvoip __initmv = { .mv_name = "HS7751RVoIP", .mv_setup = hs7751rvoip_setup, .mv_nr_irqs = 72, @@ -118,4 +118,3 @@ struct sh_machine_vector mv_hs7751rvoip .mv_init_irq = hs7751rvoip_init_irq, .mv_ioport_map = hs7751rvoip_ioport_map, }; -ALIAS_MV(hs7751rvoip) diff --git a/arch/sh/boards/renesas/r7780rp/Kconfig b/arch/sh/boards/renesas/r7780rp/Kconfig index 9fb1164..fc8f28e 100644 --- a/arch/sh/boards/renesas/r7780rp/Kconfig +++ b/arch/sh/boards/renesas/r7780rp/Kconfig @@ -6,18 +6,18 @@ choice config SH_R7780RP bool "R7780RP-1 board support" - select CPU_SUBTYPE_SH7780 + depends on CPU_SUBTYPE_SH7780 config SH_R7780MP bool "R7780MP board support" - select CPU_SUBTYPE_SH7780 + depends on CPU_SUBTYPE_SH7780 help Selecting this option will enable support for the mass-production version of the R7780RP. If in doubt, say Y. config SH_R7785RP bool "R7785RP board support" - select CPU_SUBTYPE_SH7785 + depends on CPU_SUBTYPE_SH7785 endchoice diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile index 609e5d5..b1d20af 100644 --- a/arch/sh/boards/renesas/r7780rp/Makefile +++ b/arch/sh/boards/renesas/r7780rp/Makefile @@ -3,5 +3,8 @@ # Makefile for the R7780RP-1 specific pa # irqinit-y := irq-r7780rp.o irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o +obj-y := setup.o irq.o $(irqinit-y) + +ifneq ($(CONFIG_SH_R7785RP),y) obj-$(CONFIG_PUSH_SWITCH) += psw.o -obj-y := setup.o irq.o $(irqinit-y) +endif diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c index 0727ef9..5afb864 100644 --- a/arch/sh/boards/renesas/r7780rp/setup.c +++ b/arch/sh/boards/renesas/r7780rp/setup.c @@ -166,10 +166,9 @@ static void __init highlander_setup(char /* * The Machine Vector */ -struct sh_machine_vector mv_highlander __initmv = { +static struct sh_machine_vector mv_highlander __initmv = { .mv_name = "Highlander", .mv_nr_irqs = 109, .mv_setup = highlander_setup, .mv_init_irq = highlander_init_irq, }; -ALIAS_MV(highlander) diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c index 593f26a..656fda3 100644 --- a/arch/sh/boards/renesas/rts7751r2d/setup.c +++ b/arch/sh/boards/renesas/rts7751r2d/setup.c @@ -176,7 +176,7 @@ static void __init rts7751r2d_setup(char /* * The Machine Vector */ -struct sh_machine_vector mv_rts7751r2d __initmv = { +static struct sh_machine_vector mv_rts7751r2d __initmv = { .mv_name = "RTS7751R2D", .mv_setup = rts7751r2d_setup, .mv_nr_irqs = 72, @@ -189,4 +189,3 @@ #ifdef CONFIG_USB_SM501 .mv_consistent_free = voyagergx_consistent_free, #endif }; -ALIAS_MV(rts7751r2d) diff --git a/arch/sh/boards/renesas/sh7710voipgw/setup.c b/arch/sh/boards/renesas/sh7710voipgw/setup.c index 180810b..2dce8bd 100644 --- a/arch/sh/boards/renesas/sh7710voipgw/setup.c +++ b/arch/sh/boards/renesas/sh7710voipgw/setup.c @@ -88,9 +88,8 @@ static void __init sh7710voipgw_init_irq /* * The Machine Vector */ -struct sh_machine_vector mv_sh7710voipgw __initmv = { +static struct sh_machine_vector mv_sh7710voipgw __initmv = { .mv_name = "SH7710 VoIP Gateway", .mv_nr_irqs = 104, .mv_init_irq = sh7710voipgw_init_irq, }; -ALIAS_MV(sh7710voipgw) diff --git a/arch/sh/boards/renesas/systemh/setup.c b/arch/sh/boards/renesas/systemh/setup.c index 9361176..ee78af8 100644 --- a/arch/sh/boards/renesas/systemh/setup.c +++ b/arch/sh/boards/renesas/systemh/setup.c @@ -28,7 +28,7 @@ static void __init sh7751systemh_init_ir make_systemh_irq(0xb); /* Ethernet interrupt */ } -struct sh_machine_vector mv_7751systemh __initmv = { +static struct sh_machine_vector mv_7751systemh __initmv = { .mv_name = "7751 SystemH", .mv_nr_irqs = 72, @@ -55,4 +55,3 @@ struct sh_machine_vector mv_7751systemh .mv_init_irq = sh7751systemh_init_irq, }; -ALIAS_MV(7751systemh) diff --git a/arch/sh/boards/saturn/setup.c b/arch/sh/boards/saturn/setup.c index a3a37c9..7df4312 100644 --- a/arch/sh/boards/saturn/setup.c +++ b/arch/sh/boards/saturn/setup.c @@ -18,7 +18,7 @@ extern int saturn_irq_demux(int irq_nr); /* * The Machine Vector */ -struct sh_machine_vector mv_saturn __initmv = { +static struct sh_machine_vector mv_saturn __initmv = { .mv_name = "Sega Saturn", .mv_nr_irqs = 80, /* Fix this later */ @@ -28,4 +28,3 @@ struct sh_machine_vector mv_saturn __ini .mv_ioremap = saturn_ioremap, .mv_iounmap = saturn_iounmap, }; -ALIAS_MV(saturn) diff --git a/arch/sh/boards/se/7206/setup.c b/arch/sh/boards/se/7206/setup.c index ca71487..a074b62 100644 --- a/arch/sh/boards/se/7206/setup.c +++ b/arch/sh/boards/se/7206/setup.c @@ -70,7 +70,7 @@ __initcall(se7206_devices_setup); * The Machine Vector */ -struct sh_machine_vector mv_se __initmv = { +static struct sh_machine_vector mv_se __initmv = { .mv_name = "SolutionEngine", .mv_nr_irqs = 256, .mv_inb = se7206_inb, @@ -96,4 +96,3 @@ struct sh_machine_vector mv_se __initmv .mv_init_irq = init_se7206_IRQ, }; -ALIAS_MV(se) diff --git a/arch/sh/boards/se/7300/setup.c b/arch/sh/boards/se/7300/setup.c index f196095..eb469f5 100644 --- a/arch/sh/boards/se/7300/setup.c +++ b/arch/sh/boards/se/7300/setup.c @@ -46,7 +46,7 @@ __initcall(se7300_devices_setup); /* * The Machine Vector */ -struct sh_machine_vector mv_7300se __initmv = { +static struct sh_machine_vector mv_7300se __initmv = { .mv_name = "SolutionEngine 7300", .mv_nr_irqs = 109, .mv_inb = sh7300se_inb, @@ -72,4 +72,3 @@ struct sh_machine_vector mv_7300se __ini .mv_init_irq = init_7300se_IRQ, }; -ALIAS_MV(7300se) diff --git a/arch/sh/boards/se/73180/setup.c b/arch/sh/boards/se/73180/setup.c index 911ce1c..563425c 100644 --- a/arch/sh/boards/se/73180/setup.c +++ b/arch/sh/boards/se/73180/setup.c @@ -46,7 +46,7 @@ __initcall(se73180_devices_setup); /* * The Machine Vector */ -struct sh_machine_vector mv_73180se __initmv = { +static struct sh_machine_vector mv_73180se __initmv = { .mv_name = "SolutionEngine 73180", .mv_nr_irqs = 108, .mv_inb = sh73180se_inb, @@ -73,4 +73,3 @@ struct sh_machine_vector mv_73180se __in .mv_init_irq = init_73180se_IRQ, .mv_irq_demux = shmse_irq_demux, }; -ALIAS_MV(73180se) diff --git a/arch/sh/boards/se/7343/setup.c b/arch/sh/boards/se/7343/setup.c index 3fdb16f..8fec155 100644 --- a/arch/sh/boards/se/7343/setup.c +++ b/arch/sh/boards/se/7343/setup.c @@ -64,7 +64,7 @@ static void __init sh7343se_setup(char * /* * The Machine Vector */ -struct sh_machine_vector mv_7343se __initmv = { +static struct sh_machine_vector mv_7343se __initmv = { .mv_name = "SolutionEngine 7343", .mv_setup = sh7343se_setup, .mv_nr_irqs = 108, @@ -92,4 +92,3 @@ struct sh_machine_vector mv_7343se __ini .mv_init_irq = init_7343se_IRQ, .mv_irq_demux = shmse_irq_demux, }; -ALIAS_MV(7343se) diff --git a/arch/sh/boards/se/7619/setup.c b/arch/sh/boards/se/7619/setup.c index 52d2c4d..1d0ef7f 100644 --- a/arch/sh/boards/se/7619/setup.c +++ b/arch/sh/boards/se/7619/setup.c @@ -15,8 +15,7 @@ #include * The Machine Vector */ -struct sh_machine_vector mv_se __initmv = { +static struct sh_machine_vector mv_se __initmv = { .mv_name = "SolutionEngine", .mv_nr_irqs = 108, }; -ALIAS_MV(se) diff --git a/arch/sh/boards/se/770x/setup.c b/arch/sh/boards/se/770x/setup.c index 17a2631..2962da1 100644 --- a/arch/sh/boards/se/770x/setup.c +++ b/arch/sh/boards/se/770x/setup.c @@ -122,7 +122,7 @@ device_initcall(se_devices_setup); /* * The Machine Vector */ -struct sh_machine_vector mv_se __initmv = { +static struct sh_machine_vector mv_se __initmv = { .mv_name = "SolutionEngine", .mv_setup = smsc_setup, #if defined(CONFIG_CPU_SH4) @@ -160,4 +160,3 @@ #endif .mv_init_irq = init_se_IRQ, }; -ALIAS_MV(se) diff --git a/arch/sh/boards/se/7722/setup.c b/arch/sh/boards/se/7722/setup.c index 636ca6c..6cca6cb 100644 --- a/arch/sh/boards/se/7722/setup.c +++ b/arch/sh/boards/se/7722/setup.c @@ -137,7 +137,7 @@ static void __init se7722_setup(char **c /* * The Machine Vector */ -struct sh_machine_vector mv_se7722 __initmv = { +static struct sh_machine_vector mv_se7722 __initmv = { .mv_name = "Solution Engine 7722" , .mv_setup = se7722_setup , .mv_nr_irqs = 109 , @@ -145,4 +145,3 @@ struct sh_machine_vector mv_se7722 __ini .mv_irq_demux = se7722_irq_demux, }; -ALIAS_MV(se7722) diff --git a/arch/sh/boards/se/7751/setup.c b/arch/sh/boards/se/7751/setup.c index 52c7bfa..7873d07 100644 --- a/arch/sh/boards/se/7751/setup.c +++ b/arch/sh/boards/se/7751/setup.c @@ -48,7 +48,7 @@ __initcall(se7751_devices_setup); /* * The Machine Vector */ -struct sh_machine_vector mv_7751se __initmv = { +static struct sh_machine_vector mv_7751se __initmv = { .mv_name = "7751 SolutionEngine", .mv_nr_irqs = 72, @@ -71,4 +71,3 @@ struct sh_machine_vector mv_7751se __ini .mv_init_irq = init_7751se_IRQ, }; -ALIAS_MV(7751se) diff --git a/arch/sh/boards/se/7780/setup.c b/arch/sh/boards/se/7780/setup.c index df7d08a..723f2fd 100644 --- a/arch/sh/boards/se/7780/setup.c +++ b/arch/sh/boards/se/7780/setup.c @@ -113,10 +113,9 @@ static void __init se7780_setup(char **c /* * The Machine Vector */ -struct sh_machine_vector mv_se7780 __initmv = { +static struct sh_machine_vector mv_se7780 __initmv = { .mv_name = "Solution Engine 7780" , .mv_setup = se7780_setup , .mv_nr_irqs = 111 , .mv_init_irq = init_se7780_IRQ, }; -ALIAS_MV(se7780) diff --git a/arch/sh/boards/sh03/setup.c b/arch/sh/boards/sh03/setup.c index c069c44..d7867c1 100644 --- a/arch/sh/boards/sh03/setup.c +++ b/arch/sh/boards/sh03/setup.c @@ -74,11 +74,10 @@ static int __init sh03_devices_setup(voi } __initcall(sh03_devices_setup); -struct sh_machine_vector mv_sh03 __initmv = { +static struct sh_machine_vector mv_sh03 __initmv = { .mv_name = "Interface (CTP/PCI-SH03)", .mv_setup = sh03_setup, .mv_nr_irqs = 48, .mv_ioport_map = sh03_ioport_map, .mv_init_irq = init_sh03_IRQ, }; -ALIAS_MV(sh03) diff --git a/arch/sh/boards/shmin/setup.c b/arch/sh/boards/shmin/setup.c index 4a9df4a..9c8bb51 100644 --- a/arch/sh/boards/shmin/setup.c +++ b/arch/sh/boards/shmin/setup.c @@ -43,9 +43,8 @@ static void __iomem *shmin_ioport_map(un } -struct sh_machine_vector mv_shmin __initmv = { +static struct sh_machine_vector mv_shmin __initmv = { .mv_name = "SHMIN", .mv_init_irq = init_shmin_irq, .mv_ioport_map = shmin_ioport_map, }; -ALIAS_MV(shmin) diff --git a/arch/sh/boards/snapgear/rtc.c b/arch/sh/boards/snapgear/rtc.c index 1659fdd..edb3dd9 100644 --- a/arch/sh/boards/snapgear/rtc.c +++ b/arch/sh/boards/snapgear/rtc.c @@ -108,7 +108,7 @@ static void ds1302_writebyte(unsigned in static void ds1302_reset(void) { unsigned long flags; - /* Hardware dependant reset/init */ + /* Hardware dependent reset/init */ local_irq_save(flags); set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK); set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK)); diff --git a/arch/sh/boards/snapgear/setup.c b/arch/sh/boards/snapgear/setup.c index 650fb36..b40124c 100644 --- a/arch/sh/boards/snapgear/setup.c +++ b/arch/sh/boards/snapgear/setup.c @@ -96,7 +96,7 @@ static void __init snapgear_setup(char * /* * The Machine Vector */ -struct sh_machine_vector mv_snapgear __initmv = { +static struct sh_machine_vector mv_snapgear __initmv = { .mv_name = "SnapGear SecureEdge5410", .mv_setup = snapgear_setup, .mv_nr_irqs = 72, @@ -117,4 +117,3 @@ struct sh_machine_vector mv_snapgear __i .mv_init_irq = init_snapgear_IRQ, }; -ALIAS_MV(snapgear) diff --git a/arch/sh/boards/superh/microdev/io.c b/arch/sh/boards/superh/microdev/io.c index 83419bf..b704e20 100644 --- a/arch/sh/boards/superh/microdev/io.c +++ b/arch/sh/boards/superh/microdev/io.c @@ -198,12 +198,12 @@ #endif /* * There is a board feature with the current SH4-202 MicroDev in * that the 2 byte enables (nBE0 and nBE1) are tied together (and - * to the Chip Select Line (Ethernet_CS)). Due to this conectivity, + * to the Chip Select Line (Ethernet_CS)). Due to this connectivity, * it is not possible to safely perform 8-bit writes to the * Ethernet registers, as 16-bits will be consumed from the Data * lines (corrupting the other byte). Hence, this function is - * written to impliment 16-bit read/modify/write for all byte-wide - * acceses. + * written to implement 16-bit read/modify/write for all byte-wide + * accesses. * * Note: there is no problem with byte READS (even or odd). * diff --git a/arch/sh/boards/superh/microdev/irq.c b/arch/sh/boards/superh/microdev/irq.c index 8c64baa..cc1cb04 100644 --- a/arch/sh/boards/superh/microdev/irq.c +++ b/arch/sh/boards/superh/microdev/irq.c @@ -100,7 +100,7 @@ static void disable_microdev_irq(unsigne fpgaIrq = fpgaIrqTable[irq].fpgaIrq; - /* disable interupts on the FPGA INTC register */ + /* disable interrupts on the FPGA INTC register */ ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG); } @@ -125,7 +125,7 @@ static void enable_microdev_irq(unsigned priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri); ctrl_outl(priorities, priorityReg); - /* enable interupts on the FPGA INTC register */ + /* enable interrupts on the FPGA INTC register */ ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); } @@ -152,7 +152,7 @@ extern void __init init_microdev_irq(voi { int i; - /* disable interupts on the FPGA INTC register */ + /* disable interrupts on the FPGA INTC register */ ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG); for (i = 0; i < NUM_EXTERNAL_IRQS; i++) diff --git a/arch/sh/boards/superh/microdev/setup.c b/arch/sh/boards/superh/microdev/setup.c index 031c814..fc8cd06 100644 --- a/arch/sh/boards/superh/microdev/setup.c +++ b/arch/sh/boards/superh/microdev/setup.c @@ -349,7 +349,7 @@ static int __init smsc_superio_setup(voi SMSC_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */ SMSC_WRITE_INDEXED(0x08, 0xe8); /* GP20 = nIDE2_OE */ - /* Exit the configuraton state */ + /* Exit the configuration state */ outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR); return 0; @@ -371,7 +371,7 @@ static void __init microdev_setup(char * /* * The Machine Vector */ -struct sh_machine_vector mv_sh4202_microdev __initmv = { +static struct sh_machine_vector mv_sh4202_microdev __initmv = { .mv_name = "SH4-202 MicroDev", .mv_setup = microdev_setup, .mv_nr_irqs = 72, /* QQQ need to check this - use the MACRO */ @@ -403,4 +403,3 @@ #ifdef CONFIG_HEARTBEAT .mv_heartbeat = microdev_heartbeat, #endif }; -ALIAS_MV(sh4202_microdev) diff --git a/arch/sh/boards/titan/setup.c b/arch/sh/boards/titan/setup.c index 6bcd939..630f62f 100644 --- a/arch/sh/boards/titan/setup.c +++ b/arch/sh/boards/titan/setup.c @@ -28,7 +28,7 @@ static void __init init_titan_irq(void) make_ipr_irq(titan_ipr_map, ARRAY_SIZE(titan_ipr_map)); } -struct sh_machine_vector mv_titan __initmv = { +static struct sh_machine_vector mv_titan __initmv = { .mv_name = "Titan", .mv_inb = titan_inb, @@ -52,4 +52,3 @@ struct sh_machine_vector mv_titan __init .mv_init_irq = init_titan_irq, }; -ALIAS_MV(titan) diff --git a/arch/sh/boards/unknown/Makefile b/arch/sh/boards/unknown/Makefile deleted file mode 100644 index 7d18f40..0000000 --- a/arch/sh/boards/unknown/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# -# Makefile for unknown SH boards -# - -obj-y := setup.o - diff --git a/arch/sh/boards/unknown/setup.c b/arch/sh/boards/unknown/setup.c deleted file mode 100644 index 1c94137..0000000 --- a/arch/sh/boards/unknown/setup.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * linux/arch/sh/boards/unknown/setup.c - * - * Copyright (C) 2002 Paul Mundt - * - * May be copied or modified under the terms of the GNU General Public - * License. See linux/COPYING for more information. - * - * Setup code for an unknown machine (internal peripherials only) - * - * This is the simplest of all boards, and serves only as a quick and dirty - * method to start debugging a new board during bring-up until proper board - * setup code is written. - */ -#include -#include - -struct sh_machine_vector mv_unknown __initmv = { - .mv_name = "Unknown", -}; -ALIAS_MV(unknown) diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c index e062067..8057a27 100644 --- a/arch/sh/drivers/dma/dma-api.c +++ b/arch/sh/drivers/dma/dma-api.c @@ -115,7 +115,7 @@ static int search_cap(const char **hayst /** * request_dma_bycap - Allocate a DMA channel based on its capabilities * @dmac: List of DMA controllers to search - * @caps: List of capabilites + * @caps: List of capabilities * * Search all channels of all DMA controllers to find a channel which * matches the requested capabilities. The result is the channel diff --git a/arch/sh/drivers/dma/dma-isa.c b/arch/sh/drivers/dma/dma-isa.c index 05a74ff..5fb044b 100644 --- a/arch/sh/drivers/dma/dma-isa.c +++ b/arch/sh/drivers/dma/dma-isa.c @@ -28,7 +28,7 @@ #include * NOTE: ops->xfer() is the preferred way of doing things. However, there * are some users of the ISA DMA API that exist in common code that we * don't necessarily want to go out of our way to break, so we still - * allow for some compatability at that level. Any new code is strongly + * allow for some compatibility at that level. Any new code is strongly * advised to run far away from the ISA DMA API and use the SH DMA API * directly. */ diff --git a/arch/sh/drivers/dma/dmabrg.c b/arch/sh/drivers/dma/dmabrg.c index 9d0a293..5e22689 100644 --- a/arch/sh/drivers/dma/dmabrg.c +++ b/arch/sh/drivers/dma/dmabrg.c @@ -33,7 +33,7 @@ #include * 9 | HAC1/SSI1 | rec | half done | DMABRGI2 * * all can be enabled/disabled in the DMABRGCR register, - * as well as checked if they occured. + * as well as checked if they occurred. * * DMABRGI0 services USB DMA Address errors, but it still must be * enabled/acked in the DMABRGCR register. USB-DMA complete indicator diff --git a/arch/sh/drivers/pci/ops-dreamcast.c b/arch/sh/drivers/pci/ops-dreamcast.c index 381306c..e1284fc 100644 --- a/arch/sh/drivers/pci/ops-dreamcast.c +++ b/arch/sh/drivers/pci/ops-dreamcast.c @@ -57,7 +57,7 @@ struct pci_channel board_pci_channels[] * * Also, we could very easily support both Type 0 and Type 1 configurations * here, but since it doesn't seem that there is any such implementation in - * existance, we don't bother. + * existence, we don't bother. * * I suppose if someone actually gets around to ripping the chip out of * the BBA and hanging some more devices off of it, then this might be diff --git a/arch/sh/drivers/pci/pci-st40.c b/arch/sh/drivers/pci/pci-st40.c index d67656a..543417f 100644 --- a/arch/sh/drivers/pci/pci-st40.c +++ b/arch/sh/drivers/pci/pci-st40.c @@ -292,7 +292,7 @@ int __init st40pci_init(unsigned memStar PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_IO); - /* Accesse to the 0xb0000000 -> 0xb6000000 area will go through to 0x10000000 -> 0x16000000 + /* Access to the 0xb0000000 -> 0xb6000000 area will go through to 0x10000000 -> 0x16000000 * on the PCI bus. This allows a nice 1-1 bus to phys mapping. */ @@ -315,7 +315,7 @@ int __init st40pci_init(unsigned memStar ST40PCI_WRITE(CSR_MBAR0, 0); ST40PCI_WRITE(LSR0, 0x0fff0001); - /* ... and set up the initial incomming window to expose all of RAM */ + /* ... and set up the initial incoming window to expose all of RAM */ pci_set_rbar_region(7, memStart, memStart, memSize); /* Maximise timeout values */ @@ -473,7 +473,7 @@ static void pci_set_rbar_region(unsigned mask = r2p2(regionSize) - 0x10000; - /* Diable the region (in case currently in use, should never happen) */ + /* Disable the region (in case currently in use, should never happen) */ ST40PCI_WRITE_INDEXED(RSR, region, 0); /* Start of local address space to publish */ diff --git a/arch/sh/drivers/pci/pci-st40.h b/arch/sh/drivers/pci/pci-st40.h index d729e0c..cf0d35b 100644 --- a/arch/sh/drivers/pci/pci-st40.h +++ b/arch/sh/drivers/pci/pci-st40.h @@ -4,7 +4,7 @@ * May be copied or modified under the terms of the GNU General Public * License. See linux/COPYING for more information. * - * Defintions for the ST40 PCI hardware. + * Definitions for the ST40 PCI hardware. */ #ifndef __PCI_ST40_H__ diff --git a/arch/sh/drivers/superhyway/ops-sh4-202.c b/arch/sh/drivers/superhyway/ops-sh4-202.c index a55c98a..3b14bf8 100644 --- a/arch/sh/drivers/superhyway/ops-sh4-202.c +++ b/arch/sh/drivers/superhyway/ops-sh4-202.c @@ -130,7 +130,7 @@ static int sh4202_read_vcr(unsigned long * Some modules (PBR and ePBR for instance) also appear to have * VCRL/VCRH flipped in the documentation, but on the SH4-202 * itself it appears that these are all consistently mapped with - * VCRH preceeding VCRL. + * VCRH preceding VCRL. * * Do not trust the documentation, for it is evil. */ diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index 9104b62..1f141a8 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile @@ -4,10 +4,9 @@ # extra-y := head.o init_task.o vmlinux.lds -obj-y := process.o signal.o traps.o irq.o \ - ptrace.o setup.o time.o sys_sh.o semaphore.o \ - io.o io_generic.o sh_ksyms.o syscalls.o \ - debugtraps.o +obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \ + semaphore.o setup.o signal.o sys_sh.o syscalls.o \ + time.o topology.o traps.o obj-y += cpu/ timers/ obj-$(CONFIG_VSYSCALL) += vsyscall/ @@ -17,7 +16,7 @@ obj-$(CONFIG_CF_ENABLER) += cf-enabler.o obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o obj-$(CONFIG_SH_KGDB) += kgdb_stub.o kgdb_jmp.o obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o -obj-$(CONFIG_MODULES) += module.o +obj-$(CONFIG_MODULES) += sh_ksyms.o module.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o obj-$(CONFIG_CRASH_DUMP) += crash_dump.o diff --git a/arch/sh/kernel/cf-enabler.c b/arch/sh/kernel/cf-enabler.c index 0758d48..d8a851a 100644 --- a/arch/sh/kernel/cf-enabler.c +++ b/arch/sh/kernel/cf-enabler.c @@ -31,7 +31,7 @@ #include */ #if defined(CONFIG_CPU_SH4) /* SH4 can't access PCMCIA interface through P2 area. - * we must remap it with appropreate attribute bit of the page set. + * we must remap it with appropriate attribute bit of the page set. * this part is based on Greg Banks' hd64465_ss.c implementation - Masahiro Abe */ #if defined(CONFIG_CF_AREA6) @@ -74,11 +74,7 @@ static int __init cf_init_default(void) #if defined(CONFIG_CPU_SH4) allocate_cf_area(); #endif -#if defined(CONFIG_SH_UNKNOWN) - /* This should be done in each board's init_xxx_irq. */ - make_imask_irq(14); - disable_irq(14); -#endif + return 0; } diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index 014f318..6325154 100644 --- a/arch/sh/kernel/cpu/clock.c +++ b/arch/sh/kernel/cpu/clock.c @@ -278,6 +278,11 @@ arch_init_clk_ops(struct clk_ops **ops, { } +void __init __attribute__ ((weak)) +arch_clk_init(void) +{ +} + static int show_clocks(char *buf, char **start, off_t off, int len, int *eof, void *data) { @@ -314,6 +319,8 @@ int __init clk_init(void) ret |= clk_register(clk); } + arch_clk_init(); + /* Kick the child clocks.. */ propagate_rate(&master_clk); propagate_rate(&bus_clk); diff --git a/arch/sh/kernel/cpu/irq/maskreg.c b/arch/sh/kernel/cpu/irq/maskreg.c index 492db31..978992e 100644 --- a/arch/sh/kernel/cpu/irq/maskreg.c +++ b/arch/sh/kernel/cpu/irq/maskreg.c @@ -38,7 +38,7 @@ static struct hw_interrupt_type maskreg_ .end = end_maskreg_irq }; -/* actual implementatin */ +/* actual implementation */ static unsigned int startup_maskreg_irq(unsigned int irq) { enable_maskreg_irq(irq); diff --git a/arch/sh/kernel/cpu/sh4/Makefile b/arch/sh/kernel/cpu/sh4/Makefile index 8add10b..dadd6bf 100644 --- a/arch/sh/kernel/cpu/sh4/Makefile +++ b/arch/sh/kernel/cpu/sh4/Makefile @@ -10,7 +10,11 @@ obj-$(CONFIG_SH_STORE_QUEUES) += sq.o # CPU subtype setup obj-$(CONFIG_CPU_SUBTYPE_SH7750) += setup-sh7750.o +obj-$(CONFIG_CPU_SUBTYPE_SH7750R) += setup-sh7750.o +obj-$(CONFIG_CPU_SUBTYPE_SH7750S) += setup-sh7750.o +obj-$(CONFIG_CPU_SUBTYPE_SH7091) += setup-sh7750.o obj-$(CONFIG_CPU_SUBTYPE_SH7751) += setup-sh7750.o +obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += setup-sh7750.o obj-$(CONFIG_CPU_SUBTYPE_SH7760) += setup-sh7760.o obj-$(CONFIG_CPU_SUBTYPE_SH4_202) += setup-sh4-202.o diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c index d61dd59..c5a4fc7 100644 --- a/arch/sh/kernel/cpu/sh4/fpu.c +++ b/arch/sh/kernel/cpu/sh4/fpu.c @@ -138,7 +138,7 @@ restore_fpu(struct task_struct *tsk) /* * Load the FPU with signalling NANS. This bit pattern we're using * has the property that no matter wether considered as single or as - * double precission represents signaling NANS. + * double precision represents signaling NANS. */ static void diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c index 6f8f458..03b14cf 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c @@ -106,6 +106,7 @@ static struct ipr_data sh7750_ipr_map[] { 38, 2, 8, 7 }, /* DMAC DMAE */ }; +#ifdef CONFIG_CPU_SUBTYPE_SH7751 static struct ipr_data sh7751_ipr_map[] = { { 44, 2, 8, 7 }, /* DMAC DMTE4 */ { 45, 2, 8, 7 }, /* DMAC DMTE5 */ @@ -117,6 +118,7 @@ static struct ipr_data sh7751_ipr_map[] /*{ 72, INTPRI00, 8, ? },*/ /* TMU3 TUNI */ /*{ 76, INTPRI00, 12, ? },*/ /* TMU4 TUNI */ }; +#endif static unsigned long ipr_offsets[] = { 0xffd00004UL, /* 0: IPRA */ diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c index 2909003..51b386d 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c @@ -17,7 +17,6 @@ #include #include #include -#define SH7722_PLL_FREQ (32000000/8) #define N (-1) #define NM (-2) #define ROUND_NEAREST 0 @@ -141,28 +140,36 @@ static void adjust_clocks(int originate, */ static int divisors2[] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40 }; +static void master_clk_recalc(struct clk *clk) +{ + unsigned frqcr = ctrl_inl(FRQCR); + + clk->rate = CONFIG_SH_PCLK_FREQ * (((frqcr >> 24) & 0x1f) + 1); +} + static void master_clk_init(struct clk *clk) { - clk_set_rate(clk, clk_get_rate(clk)); + clk->parent = NULL; + clk->flags |= CLK_RATE_PROPAGATES; + clk->rate = CONFIG_SH_PCLK_FREQ; + master_clk_recalc(clk); } -static void master_clk_recalc(struct clk *clk) + +static void module_clk_recalc(struct clk *clk) { unsigned long frqcr = ctrl_inl(FRQCR); - clk->rate = CONFIG_SH_PCLK_FREQ * (1 + (frqcr >> 24 & 0xF)); + clk->rate = clk->parent->rate / (((frqcr >> 24) & 0x1f) + 1); } static int master_clk_setrate(struct clk *clk, unsigned long rate, int id) { - int div = rate / SH7722_PLL_FREQ; + int div = rate / clk->rate; int master_divs[] = { 2, 3, 4, 6, 8, 16 }; int index; unsigned long frqcr; - if (rate < SH7722_PLL_FREQ * 2) - return -EINVAL; - for (index = 1; index < ARRAY_SIZE(master_divs); index++) if (div >= master_divs[index - 1] && div < master_divs[index]) break; @@ -185,6 +192,10 @@ static struct clk_ops sh7722_master_clk_ .set_rate = master_clk_setrate, }; +static struct clk_ops sh7722_module_clk_ops = { + .recalc = module_clk_recalc, +}; + struct frqcr_context { unsigned mask; unsigned shift; @@ -489,7 +500,7 @@ static void sh7722_siu_recalc(struct clk if (siu < 0) return /* siu */ ; - BUG_ON(siu > 1); + BUG_ON(siu > 2); r = ctrl_inl(sh7722_siu_regs[siu]); clk->rate = clk->parent->rate * 2 / divisors2[r & 0xF]; } @@ -571,7 +582,7 @@ static struct clk *sh7722_clocks[] = { */ struct clk_ops *onchip_ops[] = { &sh7722_master_clk_ops, - &sh7722_frqcr_clk_ops, + &sh7722_module_clk_ops, &sh7722_frqcr_clk_ops, &sh7722_frqcr_clk_ops, }; @@ -583,7 +594,7 @@ arch_init_clk_ops(struct clk_ops **ops, *ops = onchip_ops[type]; } -int __init sh7722_clock_init(void) +int __init arch_clk_init(void) { struct clk *master; int i; @@ -597,4 +608,3 @@ int __init sh7722_clock_init(void) clk_put(master); return 0; } -arch_initcall(sh7722_clock_init); diff --git a/arch/sh/kernel/kgdb_stub.c b/arch/sh/kernel/kgdb_stub.c index a532336..edd1ec2 100644 --- a/arch/sh/kernel/kgdb_stub.c +++ b/arch/sh/kernel/kgdb_stub.c @@ -2,7 +2,7 @@ * May be copied or modified under the terms of the GNU General Public * License. See linux/COPYING for more information. * - * Containes extracts from code by Glenn Engel, Jim Kingdon, + * Contains extracts from code by Glenn Engel, Jim Kingdon, * David Grothe , Tigran Aivazian , * Amit S. Kale , William Gatliff , * Ben Lee, Steve Chamberlain and Benoit Miller . @@ -85,7 +85,7 @@ * * Responses can be run-length encoded to save space. A '*' means that * the next character is an ASCII encoding giving a repeat count which - * stands for that many repititions of the character preceding the '*'. + * stands for that many repetitions of the character preceding the '*'. * The encoding is n+29, yielding a printable character where n >=3 * (which is where RLE starts to win). Don't use an n > 126. * diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c new file mode 100644 index 0000000..23c5948 --- /dev/null +++ b/arch/sh/kernel/machvec.c @@ -0,0 +1,130 @@ +/* + * arch/sh/kernel/machvec.c + * + * The SuperH machine vector setup handlers, yanked from setup.c + * + * Copyright (C) 1999 Niibe Yutaka + * Copyright (C) 2002 - 2007 Paul Mundt + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#include +#include +#include +#include +#include +#include + +#define MV_NAME_SIZE 32 + +#define for_each_mv(mv) \ + for ((mv) = (struct sh_machine_vector *)&__machvec_start; \ + (mv) && (unsigned long)(mv) < (unsigned long)&__machvec_end; \ + (mv)++) + +static struct sh_machine_vector * __init get_mv_byname(const char *name) +{ + struct sh_machine_vector *mv; + + for_each_mv(mv) + if (strcasecmp(name, mv->mv_name) == 0) + return mv; + + return NULL; +} + +static unsigned int __initdata machvec_selected; + +static int __init early_parse_mv(char *from) +{ + char mv_name[MV_NAME_SIZE] = ""; + char *mv_end; + char *mv_comma; + int mv_len; + struct sh_machine_vector *mvp; + + mv_end = strchr(from, ' '); + if (mv_end == NULL) + mv_end = from + strlen(from); + + mv_comma = strchr(from, ','); + mv_len = mv_end - from; + if (mv_len > (MV_NAME_SIZE-1)) + mv_len = MV_NAME_SIZE-1; + memcpy(mv_name, from, mv_len); + mv_name[mv_len] = '\0'; + from = mv_end; + + machvec_selected = 1; + + /* Boot with the generic vector */ + if (strcmp(mv_name, "generic") == 0) + return 0; + + mvp = get_mv_byname(mv_name); + if (unlikely(!mvp)) { + printk("Available vectors:\n\n\t'%s', ", sh_mv.mv_name); + for_each_mv(mvp) + printk("'%s', ", mvp->mv_name); + printk("\n\n"); + panic("Failed to select machvec '%s' -- halting.\n", + mv_name); + } else + sh_mv = *mvp; + + return 0; +} +early_param("sh_mv", early_parse_mv); + +void __init sh_mv_setup(void) +{ + /* + * Only overload the machvec if one hasn't been selected on + * the command line with sh_mv= + */ + if (!machvec_selected) { + unsigned long machvec_size; + + machvec_size = ((unsigned long)&__machvec_end - + (unsigned long)&__machvec_start); + + /* + * If the machvec hasn't been preselected, use the first + * vector (usually the only one) from .machvec.init. + */ + if (machvec_size >= sizeof(struct sh_machine_vector)) + sh_mv = *(struct sh_machine_vector *)&__machvec_start; + } + + printk(KERN_NOTICE "Booting machvec: %s\n", get_system_type()); + + /* + * Manually walk the vec, fill in anything that the board hasn't yet + * by hand, wrapping to the generic implementation. + */ +#define mv_set(elem) do { \ + if (!sh_mv.mv_##elem) \ + sh_mv.mv_##elem = generic_##elem; \ +} while (0) + + mv_set(inb); mv_set(inw); mv_set(inl); + mv_set(outb); mv_set(outw); mv_set(outl); + + mv_set(inb_p); mv_set(inw_p); mv_set(inl_p); + mv_set(outb_p); mv_set(outw_p); mv_set(outl_p); + + mv_set(insb); mv_set(insw); mv_set(insl); + mv_set(outsb); mv_set(outsw); mv_set(outsl); + + mv_set(readb); mv_set(readw); mv_set(readl); + mv_set(writeb); mv_set(writew); mv_set(writel); + + mv_set(ioport_map); + mv_set(ioport_unmap); + mv_set(irq_demux); + + if (!sh_mv.mv_nr_irqs) + sh_mv.mv_nr_irqs = NR_IRQS; +} diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 6b4f574..9ae3da0 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@ -17,6 +17,7 @@ #include #include #include #include +#include #include #include #include @@ -26,8 +27,6 @@ #include static int hlt_counter; int ubc_usercnt = 0; -#define HARD_IDLE_TIMEOUT (HZ / 3) - void (*pm_idle)(void); void (*pm_power_off)(void); EXPORT_SYMBOL(pm_power_off); @@ -44,16 +43,39 @@ void enable_hlt(void) } EXPORT_SYMBOL(enable_hlt); +static int __init nohlt_setup(char *__unused) +{ + hlt_counter = 1; + return 1; +} +__setup("nohlt", nohlt_setup); + +static int __init hlt_setup(char *__unused) +{ + hlt_counter = 0; + return 1; +} +__setup("hlt", hlt_setup); + void default_idle(void) { - if (!hlt_counter) - cpu_sleep(); - else - cpu_relax(); + if (!hlt_counter) { + clear_thread_flag(TIF_POLLING_NRFLAG); + smp_mb__after_clear_bit(); + set_bl_bit(); + while (!need_resched()) + cpu_sleep(); + clear_bl_bit(); + set_thread_flag(TIF_POLLING_NRFLAG); + } else + while (!need_resched()) + cpu_relax(); } void cpu_idle(void) { + set_thread_flag(TIF_POLLING_NRFLAG); + /* endless idle loop with no priority at all */ while (1) { void (*idle)(void) = pm_idle; @@ -384,8 +406,8 @@ asmlinkage int sys_fork(unsigned long r4 unsigned long r6, unsigned long r7, struct pt_regs __regs) { - struct pt_regs *regs = RELOC_HIDE(&__regs, 0); #ifdef CONFIG_MMU + struct pt_regs *regs = RELOC_HIDE(&__regs, 0); return do_fork(SIGCHLD, regs->regs[15], regs, 0, NULL, NULL); #else /* fork almost works, enough to trick you into looking elsewhere :-( */ @@ -428,23 +450,20 @@ asmlinkage int sys_vfork(unsigned long r /* * sys_execve() executes a new program. */ -asmlinkage int sys_execve(char *ufilename, char **uargv, - char **uenvp, unsigned long r7, +asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, + char __user * __user *uenvp, unsigned long r7, struct pt_regs __regs) { struct pt_regs *regs = RELOC_HIDE(&__regs, 0); int error; char *filename; - filename = getname((char __user *)ufilename); + filename = getname(ufilename); error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; - error = do_execve(filename, - (char __user * __user *)uargv, - (char __user * __user *)uenvp, - regs); + error = do_execve(filename, uargv, uenvp, regs); if (error == 0) { task_lock(current); current->ptrace &= ~PT_DTRACE; diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c index 3fb5fc0..f2eaa48 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace.c @@ -99,7 +99,7 @@ long arch_ptrace(struct task_struct *chi ret = -EIO; if (copied != sizeof(tmp)) break; - ret = put_user(tmp,(unsigned long *) data); + ret = put_user(tmp,(unsigned long __user *) data); break; } @@ -128,7 +128,7 @@ long arch_ptrace(struct task_struct *chi tmp = !!tsk_used_math(child); else tmp = 0; - ret = put_user(tmp, (unsigned long *)data); + ret = put_user(tmp, (unsigned long __user *)data); break; } @@ -196,7 +196,7 @@ long arch_ptrace(struct task_struct *chi case PTRACE_SINGLESTEP: { /* set the trap flag. */ long pc; - struct pt_regs *dummy = NULL; + struct pt_regs *regs = NULL; ret = -EIO; if (!valid_signal(data)) @@ -207,7 +207,7 @@ long arch_ptrace(struct task_struct *chi child->ptrace |= PT_DTRACE; } - pc = get_stack_long(child, (long)&dummy->pc); + pc = get_stack_long(child, (long)®s->pc); /* Next scheduling will set up UBC */ if (child->thread.ubc_pc == 0) diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index c277291..6f1ea9b 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -23,6 +23,7 @@ #include #include #include #include +#include #include #include #include @@ -41,20 +42,19 @@ extern void * __rd_start, * __rd_end; * The bigger value means no problem. */ struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, }; + +/* + * The machine vector. First entry in .machvec.init, or clobbered by + * sh_mv= on the command line, prior to .machvec.init teardown. + */ +struct sh_machine_vector sh_mv = { .mv_name = "generic", }; + #ifdef CONFIG_VT struct screen_info screen_info; #endif -#if defined(CONFIG_SH_UNKNOWN) -struct sh_machine_vector sh_mv; -#endif - extern int root_mountflags; -#define MV_NAME_SIZE 32 - -static struct sh_machine_vector* __init get_mv_byname(const char* name); - /* * This is set up by the setup-routine at boot-time */ @@ -80,131 +80,17 @@ static struct resource data_resource = { unsigned long memory_start, memory_end; -static inline void parse_cmdline (char ** cmdline_p, char mv_name[MV_NAME_SIZE], - struct sh_machine_vector** mvp, - unsigned long *mv_io_base) +static int __init early_parse_mem(char *p) { - char c = ' ', *to = command_line, *from = COMMAND_LINE; - int len = 0; - - /* Save unparsed command line copy for /proc/cmdline */ - memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; + unsigned long size; memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START; - memory_end = memory_start + __MEMORY_SIZE; - - for (;;) { - /* - * "mem=XXX[kKmM]" defines a size of memory. - */ - if (c == ' ' && !memcmp(from, "mem=", 4)) { - if (to != command_line) - to--; - { - unsigned long mem_size; - - mem_size = memparse(from+4, &from); - memory_end = memory_start + mem_size; - } - } - - if (c == ' ' && !memcmp(from, "sh_mv=", 6)) { - char* mv_end; - char* mv_comma; - int mv_len; - if (to != command_line) - to--; - from += 6; - mv_end = strchr(from, ' '); - if (mv_end == NULL) - mv_end = from + strlen(from); - - mv_comma = strchr(from, ','); - if ((mv_comma != NULL) && (mv_comma < mv_end)) { - int ints[3]; - get_options(mv_comma+1, ARRAY_SIZE(ints), ints); - *mv_io_base = ints[1]; - mv_len = mv_comma - from; - } else { - mv_len = mv_end - from; - } - if (mv_len > (MV_NAME_SIZE-1)) - mv_len = MV_NAME_SIZE-1; - memcpy(mv_name, from, mv_len); - mv_name[mv_len] = '\0'; - from = mv_end; - - *mvp = get_mv_byname(mv_name); - } - - c = *(from++); - if (!c) - break; - if (COMMAND_LINE_SIZE <= ++len) - break; - *(to++) = c; - } - *to = '\0'; - *cmdline_p = command_line; -} - -static int __init sh_mv_setup(char **cmdline_p) -{ -#ifdef CONFIG_SH_UNKNOWN - extern struct sh_machine_vector mv_unknown; -#endif - struct sh_machine_vector *mv = NULL; - char mv_name[MV_NAME_SIZE] = ""; - unsigned long mv_io_base = 0; - - parse_cmdline(cmdline_p, mv_name, &mv, &mv_io_base); - -#ifdef CONFIG_SH_UNKNOWN - if (mv == NULL) { - mv = &mv_unknown; - if (*mv_name != '\0') { - printk("Warning: Unsupported machine %s, using unknown\n", - mv_name); - } - } - sh_mv = *mv; -#endif - - /* - * Manually walk the vec, fill in anything that the board hasn't yet - * by hand, wrapping to the generic implementation. - */ -#define mv_set(elem) do { \ - if (!sh_mv.mv_##elem) \ - sh_mv.mv_##elem = generic_##elem; \ -} while (0) - - mv_set(inb); mv_set(inw); mv_set(inl); - mv_set(outb); mv_set(outw); mv_set(outl); - - mv_set(inb_p); mv_set(inw_p); mv_set(inl_p); - mv_set(outb_p); mv_set(outw_p); mv_set(outl_p); - - mv_set(insb); mv_set(insw); mv_set(insl); - mv_set(outsb); mv_set(outsw); mv_set(outsl); - - mv_set(readb); mv_set(readw); mv_set(readl); - mv_set(writeb); mv_set(writew); mv_set(writel); - - mv_set(ioport_map); - mv_set(ioport_unmap); - mv_set(irq_demux); - -#ifdef CONFIG_SH_UNKNOWN - __set_io_port_base(mv_io_base); -#endif - - if (!sh_mv.mv_nr_irqs) - sh_mv.mv_nr_irqs = NR_IRQS; + size = memparse(p, &p); + memory_end = memory_start + size; return 0; } +early_param("mem", early_parse_mem); /* * Register fully available low RAM pages with the bootmem allocator. @@ -315,10 +201,6 @@ void __init setup_arch(char **cmdline_p) { enable_mmu(); -#ifdef CONFIG_CMDLINE_BOOL - strcpy(COMMAND_LINE, CONFIG_CMDLINE); -#endif - ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); #ifdef CONFIG_BLK_DEV_RAM @@ -339,9 +221,22 @@ #endif data_resource.start = virt_to_phys(_etext); data_resource.end = virt_to_phys(_edata)-1; + memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START; + memory_end = memory_start + __MEMORY_SIZE; + +#ifdef CONFIG_CMDLINE_BOOL + strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line)); +#else + strlcpy(command_line, COMMAND_LINE, sizeof(command_line)); +#endif + + /* Save unparsed command line copy for /proc/cmdline */ + memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); + *cmdline_p = command_line; + parse_early_param(); - sh_mv_setup(cmdline_p); + sh_mv_setup(); /* * Find the highest page frame number we have available @@ -368,40 +263,6 @@ #endif sh_mv.mv_setup(cmdline_p); } -struct sh_machine_vector* __init get_mv_byname(const char* name) -{ - extern long __machvec_start, __machvec_end; - struct sh_machine_vector *all_vecs = - (struct sh_machine_vector *)&__machvec_start; - - int i, n = ((unsigned long)&__machvec_end - - (unsigned long)&__machvec_start)/ - sizeof(struct sh_machine_vector); - - for (i = 0; i < n; ++i) { - struct sh_machine_vector *mv = &all_vecs[i]; - if (mv == NULL) - continue; - if (strcasecmp(name, get_system_type()) == 0) { - return mv; - } - } - return NULL; -} - -static struct cpu cpu[NR_CPUS]; - -static int __init topology_init(void) -{ - int cpu_id; - - for_each_possible_cpu(cpu_id) - register_cpu(&cpu[cpu_id], cpu_id); - - return 0; -} - -subsys_initcall(topology_init); static const char *cpu_name[] = { [CPU_SH7206] = "SH7206", [CPU_SH7619] = "SH7619", diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index b32c35a..4fc5b40 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c @@ -261,14 +261,14 @@ asmlinkage int sys_rt_sigreturn(unsigned goto badframe; /* It is more difficult to avoid calling this function than to call it and ignore errors. */ - do_sigaltstack(&st, NULL, regs->regs[15]); + do_sigaltstack((const stack_t __user *)&st, NULL, (unsigned long)frame); return r0; badframe: force_sig(SIGSEGV, current); return 0; -} +} /* * Set up a signal frame. diff --git a/arch/sh/kernel/syscalls.S b/arch/sh/kernel/syscalls.S index 4357d1a..7db1c2d 100644 --- a/arch/sh/kernel/syscalls.S +++ b/arch/sh/kernel/syscalls.S @@ -355,3 +355,6 @@ ENTRY(sys_call_table) .long sys_getcpu .long sys_epoll_pwait .long sys_utimensat /* 320 */ + .long sys_signalfd + .long sys_timerfd + .long sys_eventfd diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c new file mode 100644 index 0000000..8a4664c --- /dev/null +++ b/arch/sh/kernel/topology.c @@ -0,0 +1,21 @@ +#include +#include +#include +#include + +static DEFINE_PER_CPU(struct cpu, cpu_devices); + +static int __init topology_init(void) +{ + int i, ret; + + for_each_present_cpu(i) { + ret = register_cpu(&per_cpu(cpu_devices, i), i); + if (unlikely(ret)) + printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n", + __FUNCTION__, i, ret); + } + + return 0; +} +subsys_initcall(topology_init); diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index 3a19764..9c7fb92 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c @@ -21,6 +21,7 @@ #include #include #include #include +#include #include #include #include @@ -101,6 +102,16 @@ void die(const char * str, struct pt_reg bust_spinlocks(0); spin_unlock_irq(&die_lock); + + if (kexec_should_crash(current)) + crash_kexec(regs); + + if (in_interrupt()) + panic("Fatal exception in interrupt"); + + if (panic_on_oops) + panic("Fatal exception"); + do_exit(SIGSEGV); } @@ -513,7 +524,7 @@ #endif * misaligned data access * access to >= 0x80000000 is user mode * Unfortuntaly we can't distinguish between instruction address error - * and data address errors caused by read acceses. + * and data address errors caused by read accesses. */ asmlinkage void do_address_error(struct pt_regs *regs, unsigned long writeaccess, @@ -570,7 +581,7 @@ uspace_segv: info.si_signo = SIGBUS; info.si_errno = 0; info.si_code = si_code; - info.si_addr = (void *) address; + info.si_addr = (void __user *)address; force_sig_info(SIGBUS, &info, current); } else { if (regs->pc & 1) @@ -603,7 +614,7 @@ #ifdef CONFIG_SH_DSP */ int is_dsp_inst(struct pt_regs *regs) { - unsigned short inst; + unsigned short inst = 0; /* * Safe guard if DSP mode is already enabled or we're lacking diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index d83143c..f7ceca8 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S @@ -98,8 +98,9 @@ #ifdef CONFIG_BLK_DEV_INITRD #endif __machvec_start = .; - .init.machvec : { *(.init.machvec) } + .machvec.init : { *(.machvec.init) } __machvec_end = .; + . = ALIGN(PAGE_SIZE); __init_end = .; diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c index 1efbac1..a38e1ee 100644 --- a/arch/sh/math-emu/math.c +++ b/arch/sh/math-emu/math.c @@ -148,7 +148,7 @@ fmac(struct sh_fpu_soft_struct *fregs, s return 0; } -// to process fmov's extention (odd n for DR access XD). +// to process fmov's extension (odd n for DR access XD). #define FMOV_EXT(x) if(x&1) x+=16-1 static int diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 253346d..c87ca2c 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig @@ -1,5 +1,3 @@ -menu "Processor selection" - # # Processor families # @@ -38,11 +36,14 @@ config CPU_SUBTYPE_ST40 config CPU_SHX2 bool +choice + prompt "Processor sub-type selection" + # # Processor subtypes # -comment "SH-2 Processor Support" +# SH-2 Processor Support config CPU_SUBTYPE_SH7604 bool "Support SH7604 processor" @@ -52,13 +53,13 @@ config CPU_SUBTYPE_SH7619 bool "Support SH7619 processor" select CPU_SH2 -comment "SH-2A Processor Support" +# SH-2A Processor Support config CPU_SUBTYPE_SH7206 bool "Support SH7206 processor" select CPU_SH2A -comment "SH-3 Processor Support" +# SH-3 Processor Support config CPU_SUBTYPE_SH7300 bool "Support SH7300 processor" @@ -113,7 +114,7 @@ config CPU_SUBTYPE_SH7712 help Select SH7712 if you have a SH3-DSP SH7712 CPU. -comment "SH-4 Processor Support" +# SH-4 Processor Support config CPU_SUBTYPE_SH7750 bool "Support SH7750 processor" @@ -125,7 +126,6 @@ config CPU_SUBTYPE_SH7750 config CPU_SUBTYPE_SH7091 bool "Support SH7091 processor" select CPU_SH4 - select CPU_SUBTYPE_SH7750 help Select SH7091 if you have an SH-4 based Sega device (such as the Dreamcast, Naomi, and Naomi 2). @@ -133,13 +133,11 @@ config CPU_SUBTYPE_SH7091 config CPU_SUBTYPE_SH7750R bool "Support SH7750R processor" select CPU_SH4 - select CPU_SUBTYPE_SH7750 select CPU_HAS_IPR_IRQ config CPU_SUBTYPE_SH7750S bool "Support SH7750S processor" select CPU_SH4 - select CPU_SUBTYPE_SH7750 select CPU_HAS_IPR_IRQ config CPU_SUBTYPE_SH7751 @@ -153,7 +151,6 @@ config CPU_SUBTYPE_SH7751 config CPU_SUBTYPE_SH7751R bool "Support SH7751R processor" select CPU_SH4 - select CPU_SUBTYPE_SH7751 select CPU_HAS_IPR_IRQ config CPU_SUBTYPE_SH7760 @@ -166,7 +163,7 @@ config CPU_SUBTYPE_SH4_202 bool "Support SH4-202 processor" select CPU_SH4 -comment "ST40 Processor Support" +# ST40 Processor Support config CPU_SUBTYPE_ST40STB1 bool "Support ST40STB1/ST40RA processors" @@ -181,7 +178,7 @@ config CPU_SUBTYPE_ST40GX1 help Select ST40GX1 if you have a ST40GX1 CPU. -comment "SH-4A Processor Support" +# SH-4A Processor Support config CPU_SUBTYPE_SH7770 bool "Support SH7770 processor" @@ -198,7 +195,7 @@ config CPU_SUBTYPE_SH7785 select CPU_SHX2 select CPU_HAS_INTC2_IRQ -comment "SH4AL-DSP Processor Support" +# SH4AL-DSP Processor Support config CPU_SUBTYPE_SH73180 bool "Support SH73180 processor" @@ -214,7 +211,7 @@ config CPU_SUBTYPE_SH7722 select CPU_SHX2 select CPU_HAS_IPR_IRQ -endmenu +endchoice menu "Memory management options" @@ -359,6 +356,14 @@ config HUGETLB_PAGE_SIZE_64MB endchoice +config LARGE_ALLOCS + bool "Allow allocating large blocks (> 1MB) of memory" + help + Allow the slab memory allocator to keep chains for very large memory + sizes - up to 32MB. You may need this if your system has a lot of + RAM, and you need to able to allocate very large contiguous chunks. + If unsure, say N. + source "mm/Kconfig" endmenu diff --git a/arch/sh/mm/copy_page.S b/arch/sh/mm/copy_page.S index 397c94c..ae039f2 100644 --- a/arch/sh/mm/copy_page.S +++ b/arch/sh/mm/copy_page.S @@ -129,6 +129,7 @@ ENTRY(__copy_user_page) rts nop #endif + .align 2 .Lpsz: .long PAGE_SIZE /* * __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 9207da6..c878faa 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -15,43 +15,11 @@ #include #include #include #include -#include #include #include #include #include -#ifdef CONFIG_KPROBES -ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); - -/* Hook to register for page fault notifications */ -int register_page_fault_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(¬ify_page_fault_chain, nb); -} - -int unregister_page_fault_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb); -} - -static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, - int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .trapnr = trap, - }; - return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args); -} -#else -static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, - int trap, int sig) -{ - return NOTIFY_DONE; -} -#endif - /* * This routine handles page faults. It determines the address, * and the problem, and then passes it off to one of the appropriate @@ -69,11 +37,6 @@ asmlinkage void __kprobes do_page_fault( siginfo_t info; trace_hardirqs_on(); - - if (notify_page_fault(DIE_PAGE_FAULT, regs, - writeaccess, SIGSEGV) == NOTIFY_STOP) - return; - local_irq_enable(); #ifdef CONFIG_SH_KGDB @@ -285,7 +248,7 @@ asmlinkage int __kprobes __do_page_fault pte_t *pte; pte_t entry; struct mm_struct *mm = current->mm; - spinlock_t *ptl; + spinlock_t *ptl = NULL; int ret = 1; #ifdef CONFIG_SH_KGDB diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 8fe223a..e0e644f 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -12,6 +12,7 @@ #include #include #include #include +#include #include #include #include @@ -112,7 +113,7 @@ static void set_pte_phys(unsigned long a * As a performance optimization, other platforms preserve the fixmap mapping * across a context switch, we don't presently do this, but this could be done * in a similar fashion as to the wired TLB interface that sh64 uses (by way - * of the memorry mapped UTLB configuration) -- this unfortunately forces us to + * of the memory mapped UTLB configuration) -- this unfortunately forces us to * give up a TLB entry for each mapping we want to preserve. While this may be * viable for a small number of fixmaps, it's not particularly useful for * everything and needs to be carefully evaluated. (ie, we may want this for diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index 02aae06..b6a5a33 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c @@ -3,7 +3,7 @@ * * Privileged Space Mapping Buffer (PMB) Support. * - * Copyright (C) 2005, 2006 Paul Mundt + * Copyright (C) 2005, 2006, 2007 Paul Mundt * * P1/P2 Section mapping definitions from map32.h, which was: * @@ -68,6 +68,32 @@ static inline unsigned long mk_pmb_data( return mk_pmb_entry(entry) | PMB_DATA; } +static DEFINE_SPINLOCK(pmb_list_lock); +static struct pmb_entry *pmb_list; + +static inline void pmb_list_add(struct pmb_entry *pmbe) +{ + struct pmb_entry **p, *tmp; + + p = &pmb_list; + while ((tmp = *p) != NULL) + p = &tmp->next; + + pmbe->next = tmp; + *p = pmbe; +} + +static inline void pmb_list_del(struct pmb_entry *pmbe) +{ + struct pmb_entry **p, *tmp; + + for (p = &pmb_list; (tmp = *p); p = &tmp->next) + if (tmp == pmbe) { + *p = tmp->next; + return; + } +} + struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, unsigned long flags) { @@ -81,11 +107,19 @@ struct pmb_entry *pmb_alloc(unsigned lon pmbe->ppn = ppn; pmbe->flags = flags; + spin_lock_irq(&pmb_list_lock); + pmb_list_add(pmbe); + spin_unlock_irq(&pmb_list_lock); + return pmbe; } void pmb_free(struct pmb_entry *pmbe) { + spin_lock_irq(&pmb_list_lock); + pmb_list_del(pmbe); + spin_unlock_irq(&pmb_list_lock); + kmem_cache_free(pmb_cache, pmbe); } @@ -167,31 +201,6 @@ void clear_pmb_entry(struct pmb_entry *p clear_bit(entry, &pmb_map); } -static DEFINE_SPINLOCK(pmb_list_lock); -static struct pmb_entry *pmb_list; - -static inline void pmb_list_add(struct pmb_entry *pmbe) -{ - struct pmb_entry **p, *tmp; - - p = &pmb_list; - while ((tmp = *p) != NULL) - p = &tmp->next; - - pmbe->next = tmp; - *p = pmbe; -} - -static inline void pmb_list_del(struct pmb_entry *pmbe) -{ - struct pmb_entry **p, *tmp; - - for (p = &pmb_list; (tmp = *p); p = &tmp->next) - if (tmp == pmbe) { - *p = tmp->next; - return; - } -} static struct { unsigned long size; @@ -283,25 +292,14 @@ void pmb_unmap(unsigned long addr) } while (pmbe); } -static void pmb_cache_ctor(void *pmb, struct kmem_cache *cachep, unsigned long flags) +static void pmb_cache_ctor(void *pmb, struct kmem_cache *cachep, + unsigned long flags) { struct pmb_entry *pmbe = pmb; memset(pmb, 0, sizeof(struct pmb_entry)); - spin_lock_irq(&pmb_list_lock); - pmbe->entry = PMB_NO_ENTRY; - pmb_list_add(pmbe); - - spin_unlock_irq(&pmb_list_lock); -} - -static void pmb_cache_dtor(void *pmb, struct kmem_cache *cachep, unsigned long flags) -{ - spin_lock_irq(&pmb_list_lock); - pmb_list_del(pmb); - spin_unlock_irq(&pmb_list_lock); } static int __init pmb_init(void) @@ -312,8 +310,7 @@ static int __init pmb_init(void) BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES)); pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0, - SLAB_PANIC, pmb_cache_ctor, - pmb_cache_dtor); + SLAB_PANIC, pmb_cache_ctor, NULL); jump_to_P2(); diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types index 554f801..fb40f18 100644 --- a/arch/sh/tools/mach-types +++ b/arch/sh/tools/mach-types @@ -7,8 +7,11 @@ # MACH_ CONFIG_ # SE SH_SOLUTION_ENGINE 7751SE SH_7751_SOLUTION_ENGINE +7722SE SH_7722_SOLUTION_ENGINE 7300SE SH_7300_SOLUTION_ENGINE 7343SE SH_7343_SOLUTION_ENGINE +7206SE SH_7206_SOLUTION_ENGINE +7619SE SH_7619_SOLUTION_ENGINE 7780SE SH_7780_SOLUTION_ENGINE 73180SE SH_73180_SOLUTION_ENGINE 7751SYSTEMH SH_7751_SYSTEMH @@ -31,5 +34,3 @@ R7785RP SH_R7785RP TITAN SH_TITAN SHMIN SH_SHMIN 7710VOIPGW SH_7710VOIPGW -7206SE SH_7206_SOLUTION_ENGINE -7619SE SH_7619_SOLUTION_ENGINE diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index abcafac..ef683eb 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -815,7 +815,7 @@ config SGI_IP27_RTC config GEN_RTC tristate "Generic /dev/rtc emulation" - depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC && !FRV && !S390 + depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC && !FRV && !S390 && !SUPERH ---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 diff --git a/drivers/input/touchscreen/hp680_ts_input.c b/drivers/input/touchscreen/hp680_ts_input.c index 61c1502..1a15475 100644 --- a/drivers/input/touchscreen/hp680_ts_input.c +++ b/drivers/input/touchscreen/hp680_ts_input.c @@ -1,7 +1,6 @@ #include #include #include - #include #include #include @@ -18,12 +17,12 @@ #define HP680_TS_ABS_Y_MAX 910 #define PHDR 0xa400012e #define SCPDR 0xa4000136 -static void do_softint(void *data); +static void do_softint(struct work_struct *work); static struct input_dev *hp680_ts_dev; -static DECLARE_WORK(work, do_softint); +static DECLARE_DELAYED_WORK(work, do_softint); -static void do_softint(void *data) +static void do_softint(struct work_struct *work) { int absx = 0, absy = 0; u8 scpdr; diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index fb04fb5..da643b3 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h @@ -53,7 +53,12 @@ # define SCSPTR2 0xFFE80020 /* 16 bit SC # define SCIF_ORER 0x0001 /* overrun error bit */ # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ # define SCIF_ONLY -#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) +#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ + defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ + defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ + defined(CONFIG_CPU_SUBTYPE_SH7091) || \ + defined(CONFIG_CPU_SUBTYPE_SH7751) || \ + defined(CONFIG_CPU_SUBTYPE_SH7751R) # define SCSPTR1 0xffe0001c /* 8 bit SCI */ # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */ # define SCIF_ORER 0x0001 /* overrun error bit */ @@ -177,9 +182,13 @@ #define SCI_CTRL_FLAGS_TIE 0x80 /* all #define SCI_CTRL_FLAGS_RIE 0x40 /* all */ #define SCI_CTRL_FLAGS_TE 0x20 /* all */ #define SCI_CTRL_FLAGS_RE 0x10 /* all */ -#if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ - defined(CONFIG_CPU_SUBTYPE_SH7751) || \ - defined(CONFIG_CPU_SUBTYPE_SH7780) || \ +#if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ + defined(CONFIG_CPU_SUBTYPE_SH7091) || \ + defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ + defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ + defined(CONFIG_CPU_SUBTYPE_SH7751) || \ + defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ + defined(CONFIG_CPU_SUBTYPE_SH7780) || \ defined(CONFIG_CPU_SUBTYPE_SH7785) #define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */ #else @@ -514,8 +523,12 @@ static inline void set_sh771x_scif_pfc(s } } -#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ - defined(CONFIG_CPU_SUBTYPE_SH7751) || \ +#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ + defined(CONFIG_CPU_SUBTYPE_SH7751) || \ + defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ + defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ + defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ + defined(CONFIG_CPU_SUBTYPE_SH7091) || \ defined(CONFIG_CPU_SUBTYPE_SH4_202) static inline int sci_rxd_in(struct uart_port *port) { diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt index 74c6440..d4fc609 100644 --- a/fs/Kconfig.binfmt +++ b/fs/Kconfig.binfmt @@ -38,7 +38,7 @@ config BINFMT_ELF_FDPIC config BINFMT_FLAT tristate "Kernel support for flat binaries" - depends on !MMU || SUPERH + depends on !MMU help Support uClinux FLAT format binaries. diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h index 16578b7..382cfc7 100644 --- a/include/asm-sh/kdebug.h +++ b/include/asm-sh/kdebug.h @@ -6,10 +6,6 @@ #include /* Grossly misnamed. */ enum die_val { DIE_TRAP, - DIE_PAGE_FAULT, }; -int register_page_fault_notifier(struct notifier_block *nb); -int unregister_page_fault_notifier(struct notifier_block *nb); - #endif /* __ASM_SH_KDEBUG_H */ diff --git a/include/asm-sh/landisk/gio.h b/include/asm-sh/landisk/gio.h index 3fce4c4..35d7368 100644 --- a/include/asm-sh/landisk/gio.h +++ b/include/asm-sh/landisk/gio.h @@ -29,16 +29,8 @@ #define GIODRV_IOCSGIODATA4 _IOW(GIODR #define GIODRV_IOCGGIODATA4 _IOR(GIODRV_IOC_MAGIC, 6, unsigned long *) #define GIODRV_IOCSGIOSETADDR _IOW(GIODRV_IOC_MAGIC, 7, unsigned long *) #define GIODRV_IOCHARDRESET _IO(GIODRV_IOC_MAGIC, 8) /* debugging tool */ - -#define GIODRV_IOCSGIO_LED _IOW(GIODRV_IOC_MAGIC, 9, unsigned long *) -#define GIODRV_IOCGGIO_LED _IOR(GIODRV_IOC_MAGIC, 10, unsigned long *) -#define GIODRV_IOCSGIO_BUZZER _IOW(GIODRV_IOC_MAGIC, 11, unsigned long *) -#define GIODRV_IOCGGIO_LANDISK _IOR(GIODRV_IOC_MAGIC, 14, unsigned long *) -#define GIODRV_IOCGGIO_BTN _IOR(GIODRV_IOC_MAGIC, 22, unsigned long *) -#define GIODRV_IOCSGIO_BTNPID _IOW(GIODRV_IOC_MAGIC, 23, unsigned long *) -#define GIODRV_IOCGGIO_BTNPID _IOR(GIODRV_IOC_MAGIC, 24, unsigned long *) - #define GIODRV_IOC_MAXNR 8 + #define GIO_READ 0x00000000 #define GIO_WRITE 0x00000001 diff --git a/include/asm-sh/landisk/iodata_landisk.h b/include/asm-sh/landisk/iodata_landisk.h index c74d3c7..6fb04ab 100644 --- a/include/asm-sh/landisk/iodata_landisk.h +++ b/include/asm-sh/landisk/iodata_landisk.h @@ -22,16 +22,6 @@ #define PA_IMASK 0xb0000005 /* Interrupt /* 2003.10.31 I-O DATA NSD NWG add. for shutdown port clear */ #define PA_PWRINT_CLR 0xb0000006 /* Shutdown Interrupt clear Register */ -#define PA_LCD_CLRDSP 0x00 /* LCD Clear Display Offset */ -#define PA_LCD_RTNHOME 0x00 /* LCD Return Home Offset */ -#define PA_LCD_ENTMODE 0x00 /* LCD Entry Mode Offset */ -#define PA_LCD_DSPCTL 0x00 /* LCD Display ON/OFF Control Offset */ -#define PA_LCD_FUNC 0x00 /* LCD Function Set Offset */ -#define PA_LCD_CGRAM 0x00 /* LCD Set CGRAM Address Offset */ -#define PA_LCD_DDRAM 0x00 /* LCD Set DDRAM Address Offset */ -#define PA_LCD_RDFLAG 0x01 /* LCD Read Busy Flag Offset */ -#define PA_LCD_WTDATA 0x02 /* LCD Write Datat to RAM Offset */ -#define PA_LCD_RDDATA 0x03 /* LCD Read Data from RAM Offset */ #define PA_PIDE_OFFSET 0x40 /* CF IDE Offset */ #define PA_SIDE_OFFSET 0x40 /* HDD IDE Offset */ @@ -45,33 +35,6 @@ #define IRQ_POWER 11 /* Power Switch IR #define IRQ_BUTTON 12 /* USL-5P Button IRQ */ #define IRQ_FAULT 13 /* USL-5P Fault IRQ */ -#define SHUTDOWN_BTN_MAJOR 99 /* Shutdown button device major no. */ - -#define SHUTDOWN_LOOP_CNT 5 /* Shutdown button Detection loop */ -#define SHUTDOWN_DELAY 200 /* Shutdown button delay value(ms) */ - - -/* added by kogiidena */ -/* - * landisk_ledparam - * - * led ------10 -6543210 -6543210 -6543210 - * |000000..|0.......|0.......|U.......| - * | HARD |fastblik| blink | on | - * - * led0: power U:update flag - * led1: error - * led2: usb1 - * led3: usb2 - * led4: usb3 - * led5: usb4 - * led6: usb5 - * - */ -extern int landisk_ledparam; /* from setup.c */ -extern int landisk_buzzerparam; /* from setup.c */ -extern int landisk_arch; /* from setup.c */ - #define __IO_PREFIX landisk #include diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h index 70389b7..088698b 100644 --- a/include/asm-sh/machvec.h +++ b/include/asm-sh/machvec.h @@ -13,7 +13,6 @@ #define _ASM_SH_MACHVEC_H #include #include #include -#include struct device; @@ -68,4 +67,7 @@ extern struct sh_machine_vector sh_mv; #define get_system_type() sh_mv.mv_name +#define __initmv \ + __attribute_used__ __attribute__((__section__ (".machvec.init"))) + #endif /* _ASM_SH_MACHVEC_H */ diff --git a/include/asm-sh/machvec_init.h b/include/asm-sh/machvec_init.h deleted file mode 100644 index e397798..0000000 --- a/include/asm-sh/machvec_init.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * include/asm-sh/machvec_init.h - * - * Copyright 2000 Stuart Menefy (stuart.menefy@st.com) - * - * May be copied or modified under the terms of the GNU General Public - * License. See linux/COPYING for more information. - * - * This file has goodies to help simplify instantiation of machine vectors. - */ - -#ifndef __SH_MACHVEC_INIT_H -#define __SH_MACHVEC_INIT_H - - -/* - * In a GENERIC kernel, we have lots of these vectors floating about, - * all but one of which we want to go away. In a non-GENERIC kernel, - * we want only one, ever. - * - * Accomplish this in the GENERIC kernel by puting all of the vectors - * in the .init.data section where they'll go away. We'll copy the - * one we want to the real alpha_mv vector in setup_arch. - * - * Accomplish this in a non-GENERIC kernel by ifdef'ing out all but - * one of the vectors, which will not reside in .init.data. We then - * alias this one vector to alpha_mv, so no copy is needed. - * - * Upshot: set __initdata to nothing for non-GENERIC kernels. - * - * Note we do the same thing for the UNKNOWN kernel, as we need to write - * to the machine vector while setting it up. - */ - -#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_UNKNOWN) -#define __initmv __attribute__((unused,__section__ (".machvec.init"))) -#define ALIAS_MV(x) -#else -#define __initmv - -/* GCC actually has a syntax for defining aliases, but is under some - delusion that you shouldn't be able to declare it extern somewhere - else beforehand. Fine. We'll do it ourselves. */ -#if 0 -#define ALIAS_MV(system) \ - struct sh_machine_vector sh_mv __attribute__((alias("mv_"#system))); -#else -#define ALIAS_MV(system) \ - asm(".global sh_mv\nsh_mv = mv_"#system ); -#endif -#endif /* GENERIC */ - -#endif /* __SH_MACHVEC_INIT_H */ diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 7464de4..011dfbe 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h @@ -60,6 +60,7 @@ extern void (*copy_page)(void *to, void extern unsigned long shm_align_mask; extern unsigned long max_low_pfn, min_low_pfn; +extern unsigned long memory_start, memory_end; #ifdef CONFIG_MMU extern void clear_page_slow(void *to); diff --git a/include/asm-sh/sections.h b/include/asm-sh/sections.h index 57abd70..2a696b8 100644 --- a/include/asm-sh/sections.h +++ b/include/asm-sh/sections.h @@ -3,7 +3,7 @@ #define __ASM_SH_SECTIONS_H #include -extern char _end[]; +extern long __machvec_start, __machvec_end; #endif /* __ASM_SH_SECTIONS_H */ diff --git a/include/asm-sh/setup.h b/include/asm-sh/setup.h index 1583c6b..586a971 100644 --- a/include/asm-sh/setup.h +++ b/include/asm-sh/setup.h @@ -6,6 +6,7 @@ #define COMMAND_LINE_SIZE 256 #ifdef __KERNEL__ int setup_early_printk(char *); +void sh_mv_setup(void); #endif /* __KERNEL__ */ diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 82f3e22..fb22fc3 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h @@ -8,9 +8,13 @@ #define __ASM_SH_SYSTEM_H #include #include +#include #include #include +struct task_struct *__switch_to(struct task_struct *prev, + struct task_struct *next); + /* * switch_to() should switch tasks to task nr n, first */ @@ -271,6 +275,16 @@ #define HAVE_DISABLE_HLT void disable_hlt(void); void enable_hlt(void); +void default_idle(void); + +asmlinkage void break_point_trap(void); +asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7, + struct pt_regs __regs); +asmlinkage void bug_trap_handler(unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7, + struct pt_regs __regs); + #define arch_align_stack(x) (x) #endif diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h index 5c49ed6..f18a1a5 100644 --- a/include/asm-sh/uaccess.h +++ b/include/asm-sh/uaccess.h @@ -61,8 +61,6 @@ static inline void set_fs(mm_segment_t s */ static inline int __access_ok(unsigned long addr, unsigned long size) { - extern unsigned long memory_start, memory_end; - return ((addr >= memory_start) && ((addr + size) < memory_end)); } #else /* CONFIG_MMU */ @@ -76,7 +74,7 @@ #define set_fs(x) (current_thread_info() * __access_ok: Check if address with size is OK or not. * * We do three checks: - * (1) is it user space? + * (1) is it user space? * (2) addr + size --> carry? * (3) addr + size >= 0x80000000 (PAGE_OFFSET) * @@ -142,11 +140,12 @@ #define __get_user(x,ptr) \ __get_user_nocheck((x),(ptr),sizeof(*(ptr))) struct __large_struct { unsigned long buf[100]; }; -#define __m(x) (*(struct __large_struct *)(x)) +#define __m(x) (*(struct __large_struct __user *)(x)) #define __get_user_size(x,ptr,size,retval) \ do { \ retval = 0; \ + __chk_user_ptr(ptr); \ switch (size) { \ case 1: \ __get_user_asm(x, ptr, retval, "b"); \ @@ -175,6 +174,7 @@ #ifdef CONFIG_MMU #define __get_user_check(x,ptr,size) \ ({ \ long __gu_err, __gu_val; \ + __chk_user_ptr(ptr); \ switch (size) { \ case 1: \ __get_user_1(__gu_val, (ptr), __gu_err); \ @@ -300,6 +300,7 @@ extern void __get_user_unknown(void); #define __put_user_size(x,ptr,size,retval) \ do { \ retval = 0; \ + __chk_user_ptr(ptr); \ switch (size) { \ case 1: \ __put_user_asm(x, ptr, retval, "b"); \ @@ -328,7 +329,7 @@ ({ \ #define __put_user_check(x,ptr,size) \ ({ \ long __pu_err = -EFAULT; \ - __typeof__(*(ptr)) *__pu_addr = (ptr); \ + __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ \ if (__access_ok((unsigned long)__pu_addr,size)) \ __put_user_size((x),__pu_addr,(size),__pu_err); \ @@ -406,10 +407,10 @@ __asm__ __volatile__( \ #endif extern void __put_user_unknown(void); - + /* Generic arbitrary sized copy. */ /* Return the number of bytes NOT copied */ -extern __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); +__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); #define copy_to_user(to,from,n) ({ \ void *__copy_to = (void *) (to); \ @@ -420,14 +421,6 @@ __copy_res = __copy_user(__copy_to, (voi } else __copy_res = __copy_size; \ __copy_res; }) -#define __copy_to_user(to,from,n) \ - __copy_user((void *)(to), \ - (void *)(from), n) - -#define __copy_to_user_inatomic __copy_to_user -#define __copy_from_user_inatomic __copy_from_user - - #define copy_from_user(to,from,n) ({ \ void *__copy_to = (void *) (to); \ void *__copy_from = (void *) (from); \ @@ -438,9 +431,20 @@ __copy_res = __copy_user(__copy_to, __co } else __copy_res = __copy_size; \ __copy_res; }) -#define __copy_from_user(to,from,n) \ - __copy_user((void *)(to), \ - (void *)(from), n) +static __always_inline unsigned long +__copy_from_user(void *to, const void __user *from, unsigned long n) +{ + return __copy_user(to, (__force void *)from, n); +} + +static __always_inline unsigned long __must_check +__copy_to_user(void __user *to, const void *from, unsigned long n) +{ + return __copy_user((__force void *)to, from, n); +} + +#define __copy_to_user_inatomic __copy_to_user +#define __copy_from_user_inatomic __copy_from_user /* * Clear the area and return remaining number of bytes diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index af71e37..77bcb09 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h @@ -329,8 +329,11 @@ #define __NR_move_pages 317 #define __NR_getcpu 318 #define __NR_epoll_pwait 319 #define __NR_utimensat 320 +#define __NR_signalfd 321 +#define __NR_timerfd 322 +#define __NR_eventfd 323 -#define NR_syscalls 321 +#define NR_syscalls 324 #ifdef __KERNEL__