diff --git a/[refs] b/[refs] index 8f30c0e09080..e3e18208df3e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 214c6a7ed13e01cab2addeef56124067e4d20147 +refs/heads/master: afd2fc02ab7bae6062671c5ca80dd34c34a63fb7 diff --git a/trunk/Documentation/00-INDEX b/trunk/Documentation/00-INDEX index 6de71308a906..5b5aba404aac 100644 --- a/trunk/Documentation/00-INDEX +++ b/trunk/Documentation/00-INDEX @@ -89,8 +89,6 @@ cciss.txt - info, major/minor #'s for Compaq's SMART Array Controllers. cdrom/ - directory with information on the CD-ROM drivers that Linux has. -cli-sti-removal.txt - - cli()/sti() removal guide. computone.txt - info on Computone Intelliport II/Plus Multiport Serial Driver. connector/ diff --git a/trunk/Documentation/DocBook/Makefile b/trunk/Documentation/DocBook/Makefile index 0eb0d027eb32..1d1b34500b69 100644 --- a/trunk/Documentation/DocBook/Makefile +++ b/trunk/Documentation/DocBook/Makefile @@ -12,7 +12,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ - mac80211.xml debugobjects.xml + mac80211.xml debugobjects.xml sh.xml ### # The build process is as follows (targets): diff --git a/trunk/Documentation/DocBook/s390-drivers.tmpl b/trunk/Documentation/DocBook/s390-drivers.tmpl index 4acc73240a6d..95bfc12e5439 100644 --- a/trunk/Documentation/DocBook/s390-drivers.tmpl +++ b/trunk/Documentation/DocBook/s390-drivers.tmpl @@ -100,7 +100,7 @@ the hardware structures represented here, please consult the Principles of Operation. -!Iinclude/asm-s390/cio.h +!Iarch/s390/include/asm/cio.h ccw devices @@ -114,7 +114,7 @@ ccw device structure. Device drivers must not bypass those functions or strange side effects may happen. -!Iinclude/asm-s390/ccwdev.h +!Iarch/s390/include/asm/ccwdev.h !Edrivers/s390/cio/device.c !Edrivers/s390/cio/device_ops.c @@ -125,7 +125,7 @@ measurement data which is made available by the channel subsystem for each channel attached device. -!Iinclude/asm-s390/cmb.h +!Iarch/s390/include/asm/cmb.h !Edrivers/s390/cio/cmf.c @@ -142,7 +142,7 @@ ccw group devices -!Iinclude/asm-s390/ccwgroup.h +!Iarch/s390/include/asm/ccwgroup.h !Edrivers/s390/cio/ccwgroup.c diff --git a/trunk/Documentation/DocBook/sh.tmpl b/trunk/Documentation/DocBook/sh.tmpl new file mode 100644 index 000000000000..0c3dc4c69dd1 --- /dev/null +++ b/trunk/Documentation/DocBook/sh.tmpl @@ -0,0 +1,105 @@ + + + + + + SuperH Interfaces Guide + + + + Paul + Mundt + +
+ lethal@linux-sh.org +
+
+
+
+ + + 2008 + Paul Mundt + + + 2008 + Renesas Technology Corp. + + + + + This documentation is free software; you can redistribute + it and/or modify it under the terms of the GNU General Public + License version 2 as published by the Free Software Foundation. + + + + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, + MA 02111-1307 USA + + + + For more details see the file COPYING in the source + distribution of Linux. + + +
+ + + + + Memory Management + + SH-4 + + Store Queue API +!Earch/sh/kernel/cpu/sh4/sq.c + + + + SH-5 + + TLB Interfaces +!Iarch/sh/mm/tlb-sh5.c +!Iarch/sh/include/asm/tlb_64.h + + + + + Clock Framework Extensions +!Iarch/sh/include/asm/clock.h + + + Machine Specific Interfaces + + mach-dreamcast +!Iarch/sh/boards/mach-dreamcast/rtc.c + + + mach-x3proto +!Earch/sh/boards/mach-x3proto/ilsel.c + + + + Busses + + SuperHyway +!Edrivers/sh/superhyway/superhyway.c + + + + Maple +!Edrivers/sh/maple/maple.c + + +
diff --git a/trunk/Documentation/arm/IXP4xx b/trunk/Documentation/arm/IXP4xx index 43edb4ecf27d..72fbcc4fcab0 100644 --- a/trunk/Documentation/arm/IXP4xx +++ b/trunk/Documentation/arm/IXP4xx @@ -32,7 +32,7 @@ Linux currently supports the following features on the IXP4xx chips: - Flash access (MTD/JFFS) - I2C through GPIO on IXP42x - GPIO for input/output/interrupts - See include/asm-arm/arch-ixp4xx/platform.h for access functions. + See arch/arm/mach-ixp4xx/include/mach/platform.h for access functions. - Timers (watchdog, OS) The following components of the chips are not supported by Linux and diff --git a/trunk/Documentation/arm/Interrupts b/trunk/Documentation/arm/Interrupts index c202ed35d7d6..f09ab1b90ef1 100644 --- a/trunk/Documentation/arm/Interrupts +++ b/trunk/Documentation/arm/Interrupts @@ -158,7 +158,7 @@ So, what's changed? be re-checked for pending events. (see the Neponset IRQ handler for details). -7. fixup_irq() is gone, as is include/asm-arm/arch-*/irq.h +7. fixup_irq() is gone, as is arch/arm/mach-*/include/mach/irq.h Please note that this will not solve all problems - some of them are hardware based. Mixing level-based and edge-based IRQs on the same diff --git a/trunk/Documentation/arm/README b/trunk/Documentation/arm/README index 9b9c8226fdc4..d98783fbe0c7 100644 --- a/trunk/Documentation/arm/README +++ b/trunk/Documentation/arm/README @@ -79,7 +79,7 @@ Machine/Platform support To this end, we now have arch/arm/mach-$(MACHINE) directories which are designed to house the non-driver files for a particular machine (eg, PCI, memory management, architecture definitions etc). For all future - machines, there should be a corresponding include/asm-arm/arch-$(MACHINE) + machines, there should be a corresponding arch/arm/mach-$(MACHINE)/include/mach directory. @@ -176,7 +176,7 @@ Kernel entry (head.S) class typically based around one or more system on a chip devices, and acts as a natural container around the actual implementations. These classes are given directories - arch/arm/mach- and - include/asm-arm/arch- - which contain the source files to + arch/arm/mach- - which contain the source files to/include/mach support the machine class. This directories also contain any machine specific supporting code. diff --git a/trunk/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/trunk/Documentation/arm/Samsung-S3C24XX/GPIO.txt index 8caea8c237ee..b5d20c0b2ab4 100644 --- a/trunk/Documentation/arm/Samsung-S3C24XX/GPIO.txt +++ b/trunk/Documentation/arm/Samsung-S3C24XX/GPIO.txt @@ -16,13 +16,13 @@ Introduction Headers ------- - See include/asm-arm/arch-s3c2410/regs-gpio.h for the list + See arch/arm/mach-s3c2410/include/mach/regs-gpio.h for the list of GPIO pins, and the configuration values for them. This - is included by using #include + is included by using #include The GPIO management functions are defined in the hardware - header include/asm-arm/arch-s3c2410/hardware.h which can be - included by #include + header arch/arm/mach-s3c2410/include/mach/hardware.h which can be + included by #include A useful amount of documentation can be found in the hardware header on how the GPIO functions (and others) work. diff --git a/trunk/Documentation/arm/Samsung-S3C24XX/Overview.txt b/trunk/Documentation/arm/Samsung-S3C24XX/Overview.txt index d04e1e30c47f..014a8ec4877d 100644 --- a/trunk/Documentation/arm/Samsung-S3C24XX/Overview.txt +++ b/trunk/Documentation/arm/Samsung-S3C24XX/Overview.txt @@ -36,7 +36,7 @@ Layout in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440 Register, kernel and platform data definitions are held in the - include/asm-arm/arch-s3c2410 directory. + arch/arm/mach-s3c2410 directory./include/mach Machines diff --git a/trunk/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/trunk/Documentation/arm/Samsung-S3C24XX/USB-Host.txt index b93b68e2b143..67671eba4231 100644 --- a/trunk/Documentation/arm/Samsung-S3C24XX/USB-Host.txt +++ b/trunk/Documentation/arm/Samsung-S3C24XX/USB-Host.txt @@ -49,7 +49,7 @@ Board Support Platform Data ------------- - See linux/include/asm-arm/arch-s3c2410/usb-control.h for the + See arch/arm/mach-s3c2410/include/mach/usb-control.h for the descriptions of the platform device data. An implementation can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c . diff --git a/trunk/Documentation/cli-sti-removal.txt b/trunk/Documentation/cli-sti-removal.txt deleted file mode 100644 index 60932b02fcb3..000000000000 --- a/trunk/Documentation/cli-sti-removal.txt +++ /dev/null @@ -1,133 +0,0 @@ - -#### cli()/sti() removal guide, started by Ingo Molnar - - -as of 2.5.28, five popular macros have been removed on SMP, and -are being phased out on UP: - - cli(), sti(), save_flags(flags), save_flags_cli(flags), restore_flags(flags) - -until now it was possible to protect driver code against interrupt -handlers via a cli(), but from now on other, more lightweight methods -have to be used for synchronization, such as spinlocks or semaphores. - -for example, driver code that used to do something like: - - struct driver_data; - - irq_handler (...) - { - .... - driver_data.finish = 1; - driver_data.new_work = 0; - .... - } - - ... - - ioctl_func (...) - { - ... - cli(); - ... - driver_data.finish = 0; - driver_data.new_work = 2; - ... - sti(); - ... - } - -was SMP-correct because the cli() function ensured that no -interrupt handler (amongst them the above irq_handler()) function -would execute while the cli()-ed section is executing. - -but from now on a more direct method of locking has to be used: - - DEFINE_SPINLOCK(driver_lock); - struct driver_data; - - irq_handler (...) - { - unsigned long flags; - .... - spin_lock_irqsave(&driver_lock, flags); - .... - driver_data.finish = 1; - driver_data.new_work = 0; - .... - spin_unlock_irqrestore(&driver_lock, flags); - .... - } - - ... - - ioctl_func (...) - { - ... - spin_lock_irq(&driver_lock); - ... - driver_data.finish = 0; - driver_data.new_work = 2; - ... - spin_unlock_irq(&driver_lock); - ... - } - -the above code has a number of advantages: - -- the locking relation is easier to understand - actual lock usage - pinpoints the critical sections. cli() usage is too opaque. - Easier to understand means it's easier to debug. - -- it's faster, because spinlocks are faster to acquire than the - potentially heavily-used IRQ lock. Furthermore, your driver does - not have to wait eg. for a big heavy SCSI interrupt to finish, - because the driver_lock spinlock is only used by your driver. - cli() on the other hand was used by many drivers, and extended - the critical section to the whole IRQ handler function - creating - serious lock contention. - - -to make the transition easier, we've still kept the cli(), sti(), -save_flags(), save_flags_cli() and restore_flags() macros defined -on UP systems - but their usage will be phased out until 2.6 is -released. - -drivers that want to disable local interrupts (interrupts on the -current CPU), can use the following five macros: - - local_irq_disable(), local_irq_enable(), local_save_flags(flags), - local_irq_save(flags), local_irq_restore(flags) - -but beware, their meaning and semantics are much simpler, far from -that of the old cli(), sti(), save_flags(flags) and restore_flags(flags) -SMP meaning: - - local_irq_disable() => turn local IRQs off - - local_irq_enable() => turn local IRQs on - - local_save_flags(flags) => save the current IRQ state into flags. The - state can be on or off. (on some - architectures there's even more bits in it.) - - local_irq_save(flags) => save the current IRQ state into flags and - disable interrupts. - - local_irq_restore(flags) => restore the IRQ state from flags. - -(local_irq_save can save both irqs on and irqs off state, and -local_irq_restore can restore into both irqs on and irqs off state.) - -another related change is that synchronize_irq() now takes a parameter: -synchronize_irq(irq). This change too has the purpose of making SMP -synchronization more lightweight - this way you can wait for your own -interrupt handler to finish, no need to wait for other IRQ sources. - - -why were these changes done? The main reason was the architectural burden -of maintaining the cli()/sti() interface - it became a real problem. The -new interrupt system is much more streamlined, easier to understand, debug, -and it's also a bit faster - the same happened to it that will happen to -cli()/sti() using drivers once they convert to spinlocks :-) - diff --git a/trunk/Documentation/power/pm_qos_interface.txt b/trunk/Documentation/power/pm_qos_interface.txt index 49adb1a33514..c40866e8b957 100644 --- a/trunk/Documentation/power/pm_qos_interface.txt +++ b/trunk/Documentation/power/pm_qos_interface.txt @@ -1,4 +1,4 @@ -PM quality of Service interface. +PM Quality Of Service Interface. This interface provides a kernel and user mode interface for registering performance expectations by drivers, subsystems and user space applications on @@ -7,6 +7,11 @@ one of the parameters. Currently we have {cpu_dma_latency, network_latency, network_throughput} as the initial set of pm_qos parameters. +Each parameters have defined units: + * latency: usec + * timeout: usec + * throughput: kbs (kilo bit / sec) + The infrastructure exposes multiple misc device nodes one per implemented parameter. The set of parameters implement is defined by pm_qos_power_init() and pm_qos_params.h. This is done because having the available parameters diff --git a/trunk/Documentation/powerpc/booting-without-of.txt b/trunk/Documentation/powerpc/booting-without-of.txt index 928a79ceb7aa..de4063cb4fdc 100644 --- a/trunk/Documentation/powerpc/booting-without-of.txt +++ b/trunk/Documentation/powerpc/booting-without-of.txt @@ -278,7 +278,7 @@ it with special cases. a 64-bit platform. d) request and get assigned a platform number (see PLATFORM_* - constants in include/asm-powerpc/processor.h + constants in arch/powerpc/include/asm/processor.h 32-bit embedded kernels: @@ -340,7 +340,7 @@ the block to RAM before passing it to the kernel. --------- The kernel is entered with r3 pointing to an area of memory that is - roughly described in include/asm-powerpc/prom.h by the structure + roughly described in arch/powerpc/include/asm/prom.h by the structure boot_param_header: struct boot_param_header { diff --git a/trunk/Documentation/powerpc/eeh-pci-error-recovery.txt b/trunk/Documentation/powerpc/eeh-pci-error-recovery.txt index df7afe43d462..9d4e33df624c 100644 --- a/trunk/Documentation/powerpc/eeh-pci-error-recovery.txt +++ b/trunk/Documentation/powerpc/eeh-pci-error-recovery.txt @@ -133,7 +133,7 @@ error. Given an arbitrary address, the routine pci_get_device_by_addr() will find the pci device associated with that address (if any). -The default include/asm-powerpc/io.h macros readb(), inb(), insb(), +The default arch/powerpc/include/asm/io.h macros readb(), inb(), insb(), etc. include a check to see if the i/o read returned all-0xff's. If so, these make a call to eeh_dn_check_failure(), which in turn asks the firmware if the all-ff's value is the sign of a true EEH diff --git a/trunk/Documentation/spi/pxa2xx b/trunk/Documentation/spi/pxa2xx index f3853cc37bde..bbe8dee681a5 100644 --- a/trunk/Documentation/spi/pxa2xx +++ b/trunk/Documentation/spi/pxa2xx @@ -19,7 +19,7 @@ Declaring PXA2xx Master Controllers ----------------------------------- Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a "platform device". The master configuration is passed to the driver via a table -found in include/asm-arm/arch-pxa/pxa2xx_spi.h: +found in arch/arm/mach-pxa/include/mach/pxa2xx_spi.h: struct pxa2xx_spi_master { enum pxa_ssp_type ssp_type; @@ -94,7 +94,7 @@ using the "spi_board_info" structure found in "linux/spi/spi.h". See Each slave device attached to the PXA must provide slave specific configuration information via the structure "pxa2xx_spi_chip" found in -"include/asm-arm/arch-pxa/pxa2xx_spi.h". The pxa2xx_spi master controller driver +"arch/arm/mach-pxa/include/mach/pxa2xx_spi.h". The pxa2xx_spi master controller driver will uses the configuration whenever the driver communicates with the slave device. diff --git a/trunk/Documentation/spi/spi-summary b/trunk/Documentation/spi/spi-summary index 6d5f18143c50..8bae2f018d34 100644 --- a/trunk/Documentation/spi/spi-summary +++ b/trunk/Documentation/spi/spi-summary @@ -210,7 +210,7 @@ board should normally be set up and registered. So for example arch/.../mach-*/board-*.c files might have code like: - #include /* for mysoc_spi_data */ + #include /* for mysoc_spi_data */ /* if your mach-* infrastructure doesn't support kernels that can * run on multiple boards, pdata wouldn't benefit from "__init". @@ -227,7 +227,7 @@ So for example arch/.../mach-*/board-*.c files might have code like: And SOC-specific utility code might look something like: - #include + #include static struct platform_device spi2 = { ... }; diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 5e6d6ab82433..8223a521d7c3 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -502,6 +502,12 @@ L: openezx-devel@lists.openezx.org (subscribers-only) W: http://www.openezx.org/ S: Maintained +ARM/FREESCALE IMX / MXC ARM ARCHITECTURE +P: Sascha Hauer +M: kernel@pengutronix.de +L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) +S: Maintained + ARM/GLOMATION GESBC9312SX MACHINE SUPPORT P: Lennert Buytenhek M: kernel@wantstofly.org diff --git a/trunk/Makefile b/trunk/Makefile index f156f40d6334..f3e206509ee1 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 27 -EXTRAVERSION = -rc1 +EXTRAVERSION = -rc2 NAME = Rotary Wombat # *DOCUMENTATION* @@ -929,10 +929,10 @@ ifneq ($(KBUILD_SRC),) echo " in the '$(srctree)' directory.";\ /bin/false; \ fi; - $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi; - $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/errno.h ]; then \ + $(Q)if [ ! -d include2 ]; then \ + mkdir -p include2; \ ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \ - fi + fi endif # prepare2 creates a makefile if using a separate output directory @@ -1492,7 +1492,7 @@ quiet_cmd_cscope-file = FILELST cscope.files cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files quiet_cmd_cscope = MAKE cscope.out - cmd_cscope = cscope -b + cmd_cscope = cscope -b -f cscope.out cscope: FORCE $(call cmd,cscope-file) diff --git a/trunk/arch/arm/Makefile b/trunk/arch/arm/Makefile index 2f0747744236..703a44fa0f9b 100644 --- a/trunk/arch/arm/Makefile +++ b/trunk/arch/arm/Makefile @@ -97,9 +97,7 @@ textofs-y := 0x00008000 machine-$(CONFIG_ARCH_RPC) := rpc machine-$(CONFIG_ARCH_EBSA110) := ebsa110 machine-$(CONFIG_ARCH_CLPS7500) := clps7500 - incdir-$(CONFIG_ARCH_CLPS7500) := cl7500 machine-$(CONFIG_FOOTBRIDGE) := footbridge - incdir-$(CONFIG_FOOTBRIDGE) := ebsa285 machine-$(CONFIG_ARCH_SHARK) := shark machine-$(CONFIG_ARCH_SA1100) := sa1100 ifeq ($(CONFIG_ARCH_SA1100),y) @@ -114,13 +112,15 @@ endif machine-$(CONFIG_ARCH_IOP32X) := iop32x machine-$(CONFIG_ARCH_IOP33X) := iop33x machine-$(CONFIG_ARCH_IOP13XX) := iop13xx + plat-$(CONFIG_PLAT_IOP) := iop machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx machine-$(CONFIG_ARCH_IXP2000) := ixp2000 machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx machine-$(CONFIG_ARCH_OMAP1) := omap1 machine-$(CONFIG_ARCH_OMAP2) := omap2 - incdir-$(CONFIG_ARCH_OMAP) := omap - machine-$(CONFIG_ARCH_S3C2410) := s3c2410 + plat-$(CONFIG_ARCH_OMAP) := omap + machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443 + plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x machine-$(CONFIG_ARCH_VERSATILE) := versatile machine-$(CONFIG_ARCH_IMX) := imx @@ -135,10 +135,11 @@ endif machine-$(CONFIG_ARCH_DAVINCI) := davinci machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood machine-$(CONFIG_ARCH_KS8695) := ks8695 - incdir-$(CONFIG_ARCH_MXC) := mxc + plat-$(CONFIG_ARCH_MXC) := mxc machine-$(CONFIG_ARCH_MX2) := mx2 machine-$(CONFIG_ARCH_MX3) := mx3 machine-$(CONFIG_ARCH_ORION5X) := orion5x + plat-$(CONFIG_PLAT_ORION) := orion machine-$(CONFIG_ARCH_MSM7X00A) := msm machine-$(CONFIG_ARCH_LOKI) := loki machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0 @@ -153,17 +154,22 @@ endif # The byte offset of the kernel image in RAM from the start of RAM. TEXT_OFFSET := $(textofs-y) -ifeq ($(incdir-y),) -incdir-y := $(machine-y) -endif -INCDIR := arch-$(incdir-y) - +# The first directory contains additional information for the boot setup code ifneq ($(machine-y),) -MACHINE := arch/arm/mach-$(machine-y)/ +MACHINE := arch/arm/mach-$(word 1,$(machine-y))/ else MACHINE := endif +machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y)) +platdirs := $(patsubst %,arch/arm/plat-%/,$(plat-y)) + +ifeq ($(KBUILD_SRC),) +KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs)) +else +KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs)) +endif + export TEXT_OFFSET GZFLAGS MMUEXT # Do we have FASTFPE? @@ -174,23 +180,11 @@ endif # If we have a machine-specific directory, then include it in the build. core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ -core-y += $(MACHINE) -core-$(CONFIG_ARCH_S3C2410) += arch/arm/mach-s3c2400/ -core-$(CONFIG_ARCH_S3C2410) += arch/arm/mach-s3c2412/ -core-$(CONFIG_ARCH_S3C2410) += arch/arm/mach-s3c2440/ -core-$(CONFIG_ARCH_S3C2410) += arch/arm/mach-s3c2442/ -core-$(CONFIG_ARCH_S3C2410) += arch/arm/mach-s3c2443/ +core-y += $(machdirs) $(platdirs) core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) core-$(CONFIG_VFP) += arch/arm/vfp/ -# If we have a common platform directory, then include it in the build. -core-$(CONFIG_PLAT_IOP) += arch/arm/plat-iop/ -core-$(CONFIG_PLAT_ORION) += arch/arm/plat-orion/ -core-$(CONFIG_ARCH_OMAP) += arch/arm/plat-omap/ -core-$(CONFIG_PLAT_S3C24XX) += arch/arm/plat-s3c24xx/ -core-$(CONFIG_ARCH_MXC) += arch/arm/plat-mxc/ - drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ libs-y := arch/arm/lib/ $(libs-y) @@ -210,20 +204,10 @@ boot := arch/arm/boot # them changed. We use .arch to indicate when they were updated # last, otherwise make uses the target directory mtime. -include/asm-arm/.arch: $(wildcard include/config/arch/*.h) include/config/auto.conf - @echo ' SYMLINK include/asm-arm/arch -> include/asm-arm/$(INCDIR)' -ifneq ($(KBUILD_SRC),) - $(Q)mkdir -p include/asm-arm - $(Q)ln -fsn $(srctree)/include/asm-arm/$(INCDIR) include/asm-arm/arch -else - $(Q)ln -fsn $(INCDIR) include/asm-arm/arch -endif - @touch $@ - archprepare: maketools PHONY += maketools FORCE -maketools: include/linux/version.h include/asm-arm/.arch FORCE +maketools: include/linux/version.h FORCE $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h # Convert bzImage to zImage diff --git a/trunk/arch/arm/boot/compressed/Makefile b/trunk/arch/arm/boot/compressed/Makefile index 95baac4939e0..94462a097f86 100644 --- a/trunk/arch/arm/boot/compressed/Makefile +++ b/trunk/arch/arm/boot/compressed/Makefile @@ -112,6 +112,3 @@ $(obj)/font.c: $(FONTC) $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config @sed "$(SEDFLAGS)" < $< > $@ - -$(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c - diff --git a/trunk/arch/arm/boot/compressed/head-xscale.S b/trunk/arch/arm/boot/compressed/head-xscale.S index dd3fbd6766e1..aa5ee49c5c5a 100644 --- a/trunk/arch/arm/boot/compressed/head-xscale.S +++ b/trunk/arch/arm/boot/compressed/head-xscale.S @@ -6,7 +6,6 @@ */ #include -#include .section ".start", "ax" diff --git a/trunk/arch/arm/boot/compressed/head.S b/trunk/arch/arm/boot/compressed/head.S index de41daeab5e9..d42f89b7760b 100644 --- a/trunk/arch/arm/boot/compressed/head.S +++ b/trunk/arch/arm/boot/compressed/head.S @@ -37,7 +37,7 @@ #else -#include +#include .macro writeb, ch, rb senduart \ch, \rb diff --git a/trunk/arch/arm/boot/compressed/misc.c b/trunk/arch/arm/boot/compressed/misc.c index 7145cc7c04f0..65ce8fff29db 100644 --- a/trunk/arch/arm/boot/compressed/misc.c +++ b/trunk/arch/arm/boot/compressed/misc.c @@ -27,7 +27,7 @@ unsigned int __machine_arch_type; static void putstr(const char *ptr); #include -#include +#include #ifdef CONFIG_DEBUG_ICEDCC diff --git a/trunk/arch/arm/common/locomo.c b/trunk/arch/arm/common/locomo.c index 85579654d3b7..283051eaf931 100644 --- a/trunk/arch/arm/common/locomo.c +++ b/trunk/arch/arm/common/locomo.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/trunk/arch/arm/common/sa1111.c b/trunk/arch/arm/common/sa1111.c index f6d3fdda7067..ec8a5471bf06 100644 --- a/trunk/arch/arm/common/sa1111.c +++ b/trunk/arch/arm/common/sa1111.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include diff --git a/trunk/arch/arm/common/sharpsl_pm.c b/trunk/arch/arm/common/sharpsl_pm.c index 8822b684d474..db8309161408 100644 --- a/trunk/arch/arm/common/sharpsl_pm.c +++ b/trunk/arch/arm/common/sharpsl_pm.c @@ -26,13 +26,12 @@ #include #include -#include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include /* diff --git a/trunk/arch/arm/common/time-acorn.c b/trunk/arch/arm/common/time-acorn.c index d544da414731..df0983aafe69 100644 --- a/trunk/arch/arm/common/time-acorn.c +++ b/trunk/arch/arm/common/time-acorn.c @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/trunk/arch/arm/common/uengine.c b/trunk/arch/arm/common/uengine.c index 117cab30bd36..7ecd3c0ab011 100644 --- a/trunk/arch/arm/common/uengine.c +++ b/trunk/arch/arm/common/uengine.c @@ -16,8 +16,7 @@ #include #include #include -#include -#include +#include #include #include diff --git a/trunk/include/asm-arm/Kbuild b/trunk/arch/arm/include/asm/Kbuild similarity index 100% rename from trunk/include/asm-arm/Kbuild rename to trunk/arch/arm/include/asm/Kbuild diff --git a/trunk/include/asm-arm/a.out-core.h b/trunk/arch/arm/include/asm/a.out-core.h similarity index 100% rename from trunk/include/asm-arm/a.out-core.h rename to trunk/arch/arm/include/asm/a.out-core.h diff --git a/trunk/include/asm-arm/a.out.h b/trunk/arch/arm/include/asm/a.out.h similarity index 100% rename from trunk/include/asm-arm/a.out.h rename to trunk/arch/arm/include/asm/a.out.h diff --git a/trunk/include/asm-arm/assembler.h b/trunk/arch/arm/include/asm/assembler.h similarity index 98% rename from trunk/include/asm-arm/assembler.h rename to trunk/arch/arm/include/asm/assembler.h index 911393b2c6f0..6116e4893c0a 100644 --- a/trunk/include/asm-arm/assembler.h +++ b/trunk/arch/arm/include/asm/assembler.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/assembler.h + * arch/arm/include/asm/assembler.h * * Copyright (C) 1996-2000 Russell King * diff --git a/trunk/include/asm-arm/atomic.h b/trunk/arch/arm/include/asm/atomic.h similarity index 99% rename from trunk/include/asm-arm/atomic.h rename to trunk/arch/arm/include/asm/atomic.h index 3b59f94b5a3d..325f881ccb50 100644 --- a/trunk/include/asm-arm/atomic.h +++ b/trunk/arch/arm/include/asm/atomic.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/atomic.h + * arch/arm/include/asm/atomic.h * * Copyright (C) 1996 Russell King. * Copyright (C) 2002 Deep Blue Solutions Ltd. diff --git a/trunk/include/asm-arm/auxvec.h b/trunk/arch/arm/include/asm/auxvec.h similarity index 100% rename from trunk/include/asm-arm/auxvec.h rename to trunk/arch/arm/include/asm/auxvec.h diff --git a/trunk/include/asm-arm/bitops.h b/trunk/arch/arm/include/asm/bitops.h similarity index 100% rename from trunk/include/asm-arm/bitops.h rename to trunk/arch/arm/include/asm/bitops.h diff --git a/trunk/include/asm-arm/bug.h b/trunk/arch/arm/include/asm/bug.h similarity index 100% rename from trunk/include/asm-arm/bug.h rename to trunk/arch/arm/include/asm/bug.h diff --git a/trunk/include/asm-arm/bugs.h b/trunk/arch/arm/include/asm/bugs.h similarity index 93% rename from trunk/include/asm-arm/bugs.h rename to trunk/arch/arm/include/asm/bugs.h index ca54eb0f12d7..a97f1ea708d1 100644 --- a/trunk/include/asm-arm/bugs.h +++ b/trunk/arch/arm/include/asm/bugs.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/bugs.h + * arch/arm/include/asm/bugs.h * * Copyright (C) 1995-2003 Russell King * diff --git a/trunk/include/asm-arm/byteorder.h b/trunk/arch/arm/include/asm/byteorder.h similarity index 97% rename from trunk/include/asm-arm/byteorder.h rename to trunk/arch/arm/include/asm/byteorder.h index e6f7fcdc73b0..4fbfb22f65a0 100644 --- a/trunk/include/asm-arm/byteorder.h +++ b/trunk/arch/arm/include/asm/byteorder.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/byteorder.h + * arch/arm/include/asm/byteorder.h * * ARM Endian-ness. In little endian mode, the data bus is connected such * that byte accesses appear as: diff --git a/trunk/include/asm-arm/cache.h b/trunk/arch/arm/include/asm/cache.h similarity index 80% rename from trunk/include/asm-arm/cache.h rename to trunk/arch/arm/include/asm/cache.h index 31332c8ac04e..cb7a9e97fd7e 100644 --- a/trunk/include/asm-arm/cache.h +++ b/trunk/arch/arm/include/asm/cache.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/cache.h + * arch/arm/include/asm/cache.h */ #ifndef __ASMARM_CACHE_H #define __ASMARM_CACHE_H diff --git a/trunk/arch/arm/include/asm/cacheflush.h b/trunk/arch/arm/include/asm/cacheflush.h new file mode 100644 index 000000000000..9073d9c6567e --- /dev/null +++ b/trunk/arch/arm/include/asm/cacheflush.h @@ -0,0 +1,537 @@ +/* + * arch/arm/include/asm/cacheflush.h + * + * Copyright (C) 1999-2002 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef _ASMARM_CACHEFLUSH_H +#define _ASMARM_CACHEFLUSH_H + +#include +#include + +#include +#include + +#define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT) + +/* + * Cache Model + * =========== + */ +#undef _CACHE +#undef MULTI_CACHE + +#if defined(CONFIG_CPU_CACHE_V3) +# ifdef _CACHE +# define MULTI_CACHE 1 +# else +# define _CACHE v3 +# endif +#endif + +#if defined(CONFIG_CPU_CACHE_V4) +# ifdef _CACHE +# define MULTI_CACHE 1 +# else +# define _CACHE v4 +# endif +#endif + +#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \ + defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) +# define MULTI_CACHE 1 +#endif + +#if defined(CONFIG_CPU_ARM926T) +# ifdef _CACHE +# define MULTI_CACHE 1 +# else +# define _CACHE arm926 +# endif +#endif + +#if defined(CONFIG_CPU_ARM940T) +# ifdef _CACHE +# define MULTI_CACHE 1 +# else +# define _CACHE arm940 +# endif +#endif + +#if defined(CONFIG_CPU_ARM946E) +# ifdef _CACHE +# define MULTI_CACHE 1 +# else +# define _CACHE arm946 +# endif +#endif + +#if defined(CONFIG_CPU_CACHE_V4WB) +# ifdef _CACHE +# define MULTI_CACHE 1 +# else +# define _CACHE v4wb +# endif +#endif + +#if defined(CONFIG_CPU_XSCALE) +# ifdef _CACHE +# define MULTI_CACHE 1 +# else +# define _CACHE xscale +# endif +#endif + +#if defined(CONFIG_CPU_XSC3) +# ifdef _CACHE +# define MULTI_CACHE 1 +# else +# define _CACHE xsc3 +# endif +#endif + +#if defined(CONFIG_CPU_FEROCEON) +# define MULTI_CACHE 1 +#endif + +#if defined(CONFIG_CPU_V6) +//# ifdef _CACHE +# define MULTI_CACHE 1 +//# else +//# define _CACHE v6 +//# endif +#endif + +#if defined(CONFIG_CPU_V7) +//# ifdef _CACHE +# define MULTI_CACHE 1 +//# else +//# define _CACHE v7 +//# endif +#endif + +#if !defined(_CACHE) && !defined(MULTI_CACHE) +#error Unknown cache maintainence model +#endif + +/* + * This flag is used to indicate that the page pointed to by a pte + * is dirty and requires cleaning before returning it to the user. + */ +#define PG_dcache_dirty PG_arch_1 + +/* + * MM Cache Management + * =================== + * + * The arch/arm/mm/cache-*.S and arch/arm/mm/proc-*.S files + * implement these methods. + * + * Start addresses are inclusive and end addresses are exclusive; + * start addresses should be rounded down, end addresses up. + * + * See Documentation/cachetlb.txt for more information. + * Please note that the implementation of these, and the required + * effects are cache-type (VIVT/VIPT/PIPT) specific. + * + * flush_cache_kern_all() + * + * Unconditionally clean and invalidate the entire cache. + * + * flush_cache_user_mm(mm) + * + * Clean and invalidate all user space cache entries + * before a change of page tables. + * + * flush_cache_user_range(start, end, flags) + * + * Clean and invalidate a range of cache entries in the + * specified address space before a change of page tables. + * - start - user start address (inclusive, page aligned) + * - end - user end address (exclusive, page aligned) + * - flags - vma->vm_flags field + * + * coherent_kern_range(start, end) + * + * Ensure coherency between the Icache and the Dcache in the + * region described by start, end. If you have non-snooping + * Harvard caches, you need to implement this function. + * - start - virtual start address + * - end - virtual end address + * + * DMA Cache Coherency + * =================== + * + * dma_inv_range(start, end) + * + * Invalidate (discard) the specified virtual address range. + * May not write back any entries. If 'start' or 'end' + * are not cache line aligned, those lines must be written + * back. + * - start - virtual start address + * - end - virtual end address + * + * dma_clean_range(start, end) + * + * Clean (write back) the specified virtual address range. + * - start - virtual start address + * - end - virtual end address + * + * dma_flush_range(start, end) + * + * Clean and invalidate the specified virtual address range. + * - start - virtual start address + * - end - virtual end address + */ + +struct cpu_cache_fns { + void (*flush_kern_all)(void); + void (*flush_user_all)(void); + void (*flush_user_range)(unsigned long, unsigned long, unsigned int); + + void (*coherent_kern_range)(unsigned long, unsigned long); + void (*coherent_user_range)(unsigned long, unsigned long); + void (*flush_kern_dcache_page)(void *); + + void (*dma_inv_range)(const void *, const void *); + void (*dma_clean_range)(const void *, const void *); + void (*dma_flush_range)(const void *, const void *); +}; + +struct outer_cache_fns { + void (*inv_range)(unsigned long, unsigned long); + void (*clean_range)(unsigned long, unsigned long); + void (*flush_range)(unsigned long, unsigned long); +}; + +/* + * Select the calling method + */ +#ifdef MULTI_CACHE + +extern struct cpu_cache_fns cpu_cache; + +#define __cpuc_flush_kern_all cpu_cache.flush_kern_all +#define __cpuc_flush_user_all cpu_cache.flush_user_all +#define __cpuc_flush_user_range cpu_cache.flush_user_range +#define __cpuc_coherent_kern_range cpu_cache.coherent_kern_range +#define __cpuc_coherent_user_range cpu_cache.coherent_user_range +#define __cpuc_flush_dcache_page cpu_cache.flush_kern_dcache_page + +/* + * These are private to the dma-mapping API. Do not use directly. + * Their sole purpose is to ensure that data held in the cache + * is visible to DMA, or data written by DMA to system memory is + * visible to the CPU. + */ +#define dmac_inv_range cpu_cache.dma_inv_range +#define dmac_clean_range cpu_cache.dma_clean_range +#define dmac_flush_range cpu_cache.dma_flush_range + +#else + +#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all) +#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all) +#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range) +#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range) +#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range) +#define __cpuc_flush_dcache_page __glue(_CACHE,_flush_kern_dcache_page) + +extern void __cpuc_flush_kern_all(void); +extern void __cpuc_flush_user_all(void); +extern void __cpuc_flush_user_range(unsigned long, unsigned long, unsigned int); +extern void __cpuc_coherent_kern_range(unsigned long, unsigned long); +extern void __cpuc_coherent_user_range(unsigned long, unsigned long); +extern void __cpuc_flush_dcache_page(void *); + +/* + * These are private to the dma-mapping API. Do not use directly. + * Their sole purpose is to ensure that data held in the cache + * is visible to DMA, or data written by DMA to system memory is + * visible to the CPU. + */ +#define dmac_inv_range __glue(_CACHE,_dma_inv_range) +#define dmac_clean_range __glue(_CACHE,_dma_clean_range) +#define dmac_flush_range __glue(_CACHE,_dma_flush_range) + +extern void dmac_inv_range(const void *, const void *); +extern void dmac_clean_range(const void *, const void *); +extern void dmac_flush_range(const void *, const void *); + +#endif + +#ifdef CONFIG_OUTER_CACHE + +extern struct outer_cache_fns outer_cache; + +static inline void outer_inv_range(unsigned long start, unsigned long end) +{ + if (outer_cache.inv_range) + outer_cache.inv_range(start, end); +} +static inline void outer_clean_range(unsigned long start, unsigned long end) +{ + if (outer_cache.clean_range) + outer_cache.clean_range(start, end); +} +static inline void outer_flush_range(unsigned long start, unsigned long end) +{ + if (outer_cache.flush_range) + outer_cache.flush_range(start, end); +} + +#else + +static inline void outer_inv_range(unsigned long start, unsigned long end) +{ } +static inline void outer_clean_range(unsigned long start, unsigned long end) +{ } +static inline void outer_flush_range(unsigned long start, unsigned long end) +{ } + +#endif + +/* + * flush_cache_vmap() is used when creating mappings (eg, via vmap, + * vmalloc, ioremap etc) in kernel space for pages. Since the + * direct-mappings of these pages may contain cached data, we need + * to do a full cache flush to ensure that writebacks don't corrupt + * data placed into these pages via the new mappings. + */ +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() + +/* + * Copy user data from/to a page which is mapped into a different + * processes address space. Really, we want to allow our "user + * space" model to handle this. + */ +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + do { \ + memcpy(dst, src, len); \ + flush_ptrace_access(vma, page, vaddr, dst, len, 1);\ + } while (0) + +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + do { \ + memcpy(dst, src, len); \ + } while (0) + +/* + * Convert calls to our calling convention. + */ +#define flush_cache_all() __cpuc_flush_kern_all() +#ifndef CONFIG_CPU_CACHE_VIPT +static inline void flush_cache_mm(struct mm_struct *mm) +{ + if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) + __cpuc_flush_user_all(); +} + +static inline void +flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) +{ + if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) + __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end), + vma->vm_flags); +} + +static inline void +flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn) +{ + if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { + unsigned long addr = user_addr & PAGE_MASK; + __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags); + } +} + +static inline void +flush_ptrace_access(struct vm_area_struct *vma, struct page *page, + unsigned long uaddr, void *kaddr, + unsigned long len, int write) +{ + if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { + unsigned long addr = (unsigned long)kaddr; + __cpuc_coherent_kern_range(addr, addr + len); + } +} +#else +extern void flush_cache_mm(struct mm_struct *mm); +extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); +extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn); +extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, + unsigned long uaddr, void *kaddr, + unsigned long len, int write); +#endif + +#define flush_cache_dup_mm(mm) flush_cache_mm(mm) + +/* + * flush_cache_user_range is used when we want to ensure that the + * Harvard caches are synchronised for the user space address range. + * This is used for the ARM private sys_cacheflush system call. + */ +#define flush_cache_user_range(vma,start,end) \ + __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end)) + +/* + * Perform necessary cache operations to ensure that data previously + * stored within this range of addresses can be executed by the CPU. + */ +#define flush_icache_range(s,e) __cpuc_coherent_kern_range(s,e) + +/* + * Perform necessary cache operations to ensure that the TLB will + * see data written in the specified area. + */ +#define clean_dcache_area(start,size) cpu_dcache_clean_area(start, size) + +/* + * flush_dcache_page is used when the kernel has written to the page + * cache page at virtual address page->virtual. + * + * If this page isn't mapped (ie, page_mapping == NULL), or it might + * have userspace mappings, then we _must_ always clean + invalidate + * the dcache entries associated with the kernel mapping. + * + * Otherwise we can defer the operation, and clean the cache when we are + * about to change to user space. This is the same method as used on SPARC64. + * See update_mmu_cache for the user space part. + */ +extern void flush_dcache_page(struct page *); + +extern void __flush_dcache_page(struct address_space *mapping, struct page *page); + +static inline void __flush_icache_all(void) +{ + asm("mcr p15, 0, %0, c7, c5, 0 @ invalidate I-cache\n" + : + : "r" (0)); +} + +#define ARCH_HAS_FLUSH_ANON_PAGE +static inline void flush_anon_page(struct vm_area_struct *vma, + struct page *page, unsigned long vmaddr) +{ + extern void __flush_anon_page(struct vm_area_struct *vma, + struct page *, unsigned long); + if (PageAnon(page)) + __flush_anon_page(vma, page, vmaddr); +} + +#define flush_dcache_mmap_lock(mapping) \ + spin_lock_irq(&(mapping)->tree_lock) +#define flush_dcache_mmap_unlock(mapping) \ + spin_unlock_irq(&(mapping)->tree_lock) + +#define flush_icache_user_range(vma,page,addr,len) \ + flush_dcache_page(page) + +/* + * We don't appear to need to do anything here. In fact, if we did, we'd + * duplicate cache flushing elsewhere performed by flush_dcache_page(). + */ +#define flush_icache_page(vma,page) do { } while (0) + +static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt, + unsigned offset, size_t size) +{ + const void *start = (void __force *)virt + offset; + dmac_inv_range(start, start + size); +} + +#define __cacheid_present(val) (val != read_cpuid(CPUID_ID)) +#define __cacheid_type_v7(val) ((val & (7 << 29)) == (4 << 29)) + +#define __cacheid_vivt_prev7(val) ((val & (15 << 25)) != (14 << 25)) +#define __cacheid_vipt_prev7(val) ((val & (15 << 25)) == (14 << 25)) +#define __cacheid_vipt_nonaliasing_prev7(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25)) +#define __cacheid_vipt_aliasing_prev7(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25 | 1 << 23)) + +#define __cacheid_vivt(val) (__cacheid_type_v7(val) ? 0 : __cacheid_vivt_prev7(val)) +#define __cacheid_vipt(val) (__cacheid_type_v7(val) ? 1 : __cacheid_vipt_prev7(val)) +#define __cacheid_vipt_nonaliasing(val) (__cacheid_type_v7(val) ? 1 : __cacheid_vipt_nonaliasing_prev7(val)) +#define __cacheid_vipt_aliasing(val) (__cacheid_type_v7(val) ? 0 : __cacheid_vipt_aliasing_prev7(val)) +#define __cacheid_vivt_asid_tagged_instr(val) (__cacheid_type_v7(val) ? ((val & (3 << 14)) == (1 << 14)) : 0) + +#if defined(CONFIG_CPU_CACHE_VIVT) && !defined(CONFIG_CPU_CACHE_VIPT) +/* + * VIVT caches only + */ +#define cache_is_vivt() 1 +#define cache_is_vipt() 0 +#define cache_is_vipt_nonaliasing() 0 +#define cache_is_vipt_aliasing() 0 +#define icache_is_vivt_asid_tagged() 0 + +#elif !defined(CONFIG_CPU_CACHE_VIVT) && defined(CONFIG_CPU_CACHE_VIPT) +/* + * VIPT caches only + */ +#define cache_is_vivt() 0 +#define cache_is_vipt() 1 +#define cache_is_vipt_nonaliasing() \ + ({ \ + unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ + __cacheid_vipt_nonaliasing(__val); \ + }) + +#define cache_is_vipt_aliasing() \ + ({ \ + unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ + __cacheid_vipt_aliasing(__val); \ + }) + +#define icache_is_vivt_asid_tagged() \ + ({ \ + unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ + __cacheid_vivt_asid_tagged_instr(__val); \ + }) + +#else +/* + * VIVT or VIPT caches. Note that this is unreliable since ARM926 + * and V6 CPUs satisfy the "(val & (15 << 25)) == (14 << 25)" test. + * There's no way to tell from the CacheType register what type (!) + * the cache is. + */ +#define cache_is_vivt() \ + ({ \ + unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ + (!__cacheid_present(__val)) || __cacheid_vivt(__val); \ + }) + +#define cache_is_vipt() \ + ({ \ + unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ + __cacheid_present(__val) && __cacheid_vipt(__val); \ + }) + +#define cache_is_vipt_nonaliasing() \ + ({ \ + unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ + __cacheid_present(__val) && \ + __cacheid_vipt_nonaliasing(__val); \ + }) + +#define cache_is_vipt_aliasing() \ + ({ \ + unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ + __cacheid_present(__val) && \ + __cacheid_vipt_aliasing(__val); \ + }) + +#define icache_is_vivt_asid_tagged() \ + ({ \ + unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ + __cacheid_present(__val) && \ + __cacheid_vivt_asid_tagged_instr(__val); \ + }) + +#endif + +#endif diff --git a/trunk/include/asm-arm/checksum.h b/trunk/arch/arm/include/asm/checksum.h similarity index 98% rename from trunk/include/asm-arm/checksum.h rename to trunk/arch/arm/include/asm/checksum.h index eaa0efd8d0d4..6dcc16430868 100644 --- a/trunk/include/asm-arm/checksum.h +++ b/trunk/arch/arm/include/asm/checksum.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/checksum.h + * arch/arm/include/asm/checksum.h * * IP checksum routines * diff --git a/trunk/include/asm-arm/cnt32_to_63.h b/trunk/arch/arm/include/asm/cnt32_to_63.h similarity index 100% rename from trunk/include/asm-arm/cnt32_to_63.h rename to trunk/arch/arm/include/asm/cnt32_to_63.h diff --git a/trunk/include/asm-arm/cpu-multi32.h b/trunk/arch/arm/include/asm/cpu-multi32.h similarity index 97% rename from trunk/include/asm-arm/cpu-multi32.h rename to trunk/arch/arm/include/asm/cpu-multi32.h index 3479de9266e5..e2b5b0b2116a 100644 --- a/trunk/include/asm-arm/cpu-multi32.h +++ b/trunk/arch/arm/include/asm/cpu-multi32.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/cpu-multi32.h + * arch/arm/include/asm/cpu-multi32.h * * Copyright (C) 2000 Russell King * diff --git a/trunk/include/asm-arm/cpu-single.h b/trunk/arch/arm/include/asm/cpu-single.h similarity index 97% rename from trunk/include/asm-arm/cpu-single.h rename to trunk/arch/arm/include/asm/cpu-single.h index 0b120ee36091..f073a6d2a406 100644 --- a/trunk/include/asm-arm/cpu-single.h +++ b/trunk/arch/arm/include/asm/cpu-single.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/cpu-single.h + * arch/arm/include/asm/cpu-single.h * * Copyright (C) 2000 Russell King * diff --git a/trunk/arch/arm/include/asm/cpu.h b/trunk/arch/arm/include/asm/cpu.h new file mode 100644 index 000000000000..634b2d7c612a --- /dev/null +++ b/trunk/arch/arm/include/asm/cpu.h @@ -0,0 +1,25 @@ +/* + * arch/arm/include/asm/cpu.h + * + * Copyright (C) 2004-2005 ARM Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __ASM_ARM_CPU_H +#define __ASM_ARM_CPU_H + +#include + +struct cpuinfo_arm { + struct cpu cpu; +#ifdef CONFIG_SMP + struct task_struct *idle; + unsigned int loops_per_jiffy; +#endif +}; + +DECLARE_PER_CPU(struct cpuinfo_arm, cpu_data); + +#endif diff --git a/trunk/include/asm-arm/cputime.h b/trunk/arch/arm/include/asm/cputime.h similarity index 100% rename from trunk/include/asm-arm/cputime.h rename to trunk/arch/arm/include/asm/cputime.h diff --git a/trunk/include/asm-arm/current.h b/trunk/arch/arm/include/asm/current.h similarity index 100% rename from trunk/include/asm-arm/current.h rename to trunk/arch/arm/include/asm/current.h diff --git a/trunk/include/asm-arm/delay.h b/trunk/arch/arm/include/asm/delay.h similarity index 100% rename from trunk/include/asm-arm/delay.h rename to trunk/arch/arm/include/asm/delay.h diff --git a/trunk/include/asm-arm/device.h b/trunk/arch/arm/include/asm/device.h similarity index 100% rename from trunk/include/asm-arm/device.h rename to trunk/arch/arm/include/asm/device.h diff --git a/trunk/include/asm-arm/div64.h b/trunk/arch/arm/include/asm/div64.h similarity index 100% rename from trunk/include/asm-arm/div64.h rename to trunk/arch/arm/include/asm/div64.h diff --git a/trunk/include/asm-arm/dma-mapping.h b/trunk/arch/arm/include/asm/dma-mapping.h similarity index 100% rename from trunk/include/asm-arm/dma-mapping.h rename to trunk/arch/arm/include/asm/dma-mapping.h diff --git a/trunk/arch/arm/include/asm/dma.h b/trunk/arch/arm/include/asm/dma.h new file mode 100644 index 000000000000..75154b193117 --- /dev/null +++ b/trunk/arch/arm/include/asm/dma.h @@ -0,0 +1,143 @@ +#ifndef __ASM_ARM_DMA_H +#define __ASM_ARM_DMA_H + +typedef unsigned int dmach_t; + +#include +#include +#include +#include + +/* + * This is the maximum virtual address which can be DMA'd from. + */ +#ifndef MAX_DMA_ADDRESS +#define MAX_DMA_ADDRESS 0xffffffff +#endif + +/* + * DMA modes + */ +typedef unsigned int dmamode_t; + +#define DMA_MODE_MASK 3 + +#define DMA_MODE_READ 0 +#define DMA_MODE_WRITE 1 +#define DMA_MODE_CASCADE 2 +#define DMA_AUTOINIT 4 + +extern spinlock_t dma_spin_lock; + +static inline unsigned long claim_dma_lock(void) +{ + unsigned long flags; + spin_lock_irqsave(&dma_spin_lock, flags); + return flags; +} + +static inline void release_dma_lock(unsigned long flags) +{ + spin_unlock_irqrestore(&dma_spin_lock, flags); +} + +/* Clear the 'DMA Pointer Flip Flop'. + * Write 0 for LSB/MSB, 1 for MSB/LSB access. + */ +#define clear_dma_ff(channel) + +/* Set only the page register bits of the transfer address. + * + * NOTE: This is an architecture specific function, and should + * be hidden from the drivers + */ +extern void set_dma_page(dmach_t channel, char pagenr); + +/* Request a DMA channel + * + * Some architectures may need to do allocate an interrupt + */ +extern int request_dma(dmach_t channel, const char * device_id); + +/* Free a DMA channel + * + * Some architectures may need to do free an interrupt + */ +extern void free_dma(dmach_t channel); + +/* Enable DMA for this channel + * + * On some architectures, this may have other side effects like + * enabling an interrupt and setting the DMA registers. + */ +extern void enable_dma(dmach_t channel); + +/* Disable DMA for this channel + * + * On some architectures, this may have other side effects like + * disabling an interrupt or whatever. + */ +extern void disable_dma(dmach_t channel); + +/* Test whether the specified channel has an active DMA transfer + */ +extern int dma_channel_active(dmach_t channel); + +/* Set the DMA scatter gather list for this channel + * + * This should not be called if a DMA channel is enabled, + * especially since some DMA architectures don't update the + * DMA address immediately, but defer it to the enable_dma(). + */ +extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg); + +/* Set the DMA address for this channel + * + * This should not be called if a DMA channel is enabled, + * especially since some DMA architectures don't update the + * DMA address immediately, but defer it to the enable_dma(). + */ +extern void __set_dma_addr(dmach_t channel, void *addr); +#define set_dma_addr(channel, addr) \ + __set_dma_addr(channel, bus_to_virt(addr)) + +/* Set the DMA byte count for this channel + * + * This should not be called if a DMA channel is enabled, + * especially since some DMA architectures don't update the + * DMA count immediately, but defer it to the enable_dma(). + */ +extern void set_dma_count(dmach_t channel, unsigned long count); + +/* Set the transfer direction for this channel + * + * This should not be called if a DMA channel is enabled, + * especially since some DMA architectures don't update the + * DMA transfer direction immediately, but defer it to the + * enable_dma(). + */ +extern void set_dma_mode(dmach_t channel, dmamode_t mode); + +/* Set the transfer speed for this channel + */ +extern void set_dma_speed(dmach_t channel, int cycle_ns); + +/* Get DMA residue count. After a DMA transfer, this + * should return zero. Reading this while a DMA transfer is + * still in progress will return unpredictable results. + * If called before the channel has been used, it may return 1. + * Otherwise, it returns the number of _bytes_ left to transfer. + */ +extern int get_dma_residue(dmach_t channel); + +#ifndef NO_DMA +#define NO_DMA 255 +#endif + +#ifdef CONFIG_PCI +extern int isa_dma_bridge_buggy; +#else +#define isa_dma_bridge_buggy (0) +#endif + +#endif /* _ARM_DMA_H */ diff --git a/trunk/include/asm-arm/domain.h b/trunk/arch/arm/include/asm/domain.h similarity index 98% rename from trunk/include/asm-arm/domain.h rename to trunk/arch/arm/include/asm/domain.h index 3c12a7625304..cc7ef4080711 100644 --- a/trunk/include/asm-arm/domain.h +++ b/trunk/arch/arm/include/asm/domain.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/domain.h + * arch/arm/include/asm/domain.h * * Copyright (C) 1999 Russell King. * diff --git a/trunk/include/asm-arm/ecard.h b/trunk/arch/arm/include/asm/ecard.h similarity index 99% rename from trunk/include/asm-arm/ecard.h rename to trunk/arch/arm/include/asm/ecard.h index 5e22881a630d..29f2610efc70 100644 --- a/trunk/include/asm-arm/ecard.h +++ b/trunk/arch/arm/include/asm/ecard.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/ecard.h + * arch/arm/include/asm/ecard.h * * definitions for expansion cards * diff --git a/trunk/include/asm-arm/elf.h b/trunk/arch/arm/include/asm/elf.h similarity index 100% rename from trunk/include/asm-arm/elf.h rename to trunk/arch/arm/include/asm/elf.h diff --git a/trunk/include/asm-arm/emergency-restart.h b/trunk/arch/arm/include/asm/emergency-restart.h similarity index 100% rename from trunk/include/asm-arm/emergency-restart.h rename to trunk/arch/arm/include/asm/emergency-restart.h diff --git a/trunk/include/asm-arm/errno.h b/trunk/arch/arm/include/asm/errno.h similarity index 100% rename from trunk/include/asm-arm/errno.h rename to trunk/arch/arm/include/asm/errno.h diff --git a/trunk/include/asm-arm/fb.h b/trunk/arch/arm/include/asm/fb.h similarity index 100% rename from trunk/include/asm-arm/fb.h rename to trunk/arch/arm/include/asm/fb.h diff --git a/trunk/include/asm-arm/fcntl.h b/trunk/arch/arm/include/asm/fcntl.h similarity index 100% rename from trunk/include/asm-arm/fcntl.h rename to trunk/arch/arm/include/asm/fcntl.h diff --git a/trunk/include/asm-arm/fiq.h b/trunk/arch/arm/include/asm/fiq.h similarity index 96% rename from trunk/include/asm-arm/fiq.h rename to trunk/arch/arm/include/asm/fiq.h index a3bad09e825c..2242ce22ec6c 100644 --- a/trunk/include/asm-arm/fiq.h +++ b/trunk/arch/arm/include/asm/fiq.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/fiq.h + * arch/arm/include/asm/fiq.h * * Support for FIQ on ARM architectures. * Written by Philip Blundell , 1998 diff --git a/trunk/include/asm-arm/flat.h b/trunk/arch/arm/include/asm/flat.h similarity index 90% rename from trunk/include/asm-arm/flat.h rename to trunk/arch/arm/include/asm/flat.h index 9918aa46d9e5..1d77e51907f6 100644 --- a/trunk/include/asm-arm/flat.h +++ b/trunk/arch/arm/include/asm/flat.h @@ -1,5 +1,5 @@ /* - * include/asm-arm/flat.h -- uClinux flat-format executables + * arch/arm/include/asm/flat.h -- uClinux flat-format executables */ #ifndef __ARM_FLAT_H__ diff --git a/trunk/include/asm-arm/floppy.h b/trunk/arch/arm/include/asm/floppy.h similarity index 98% rename from trunk/include/asm-arm/floppy.h rename to trunk/arch/arm/include/asm/floppy.h index 41a5e9d6bb69..c9f03eccc9d8 100644 --- a/trunk/include/asm-arm/floppy.h +++ b/trunk/arch/arm/include/asm/floppy.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/floppy.h + * arch/arm/include/asm/floppy.h * * Copyright (C) 1996-2000 Russell King * @@ -12,7 +12,7 @@ #ifndef __ASM_ARM_FLOPPY_H #define __ASM_ARM_FLOPPY_H #if 0 -#include +#include #endif #define fd_outb(val,port) \ diff --git a/trunk/include/asm-arm/fpstate.h b/trunk/arch/arm/include/asm/fpstate.h similarity index 97% rename from trunk/include/asm-arm/fpstate.h rename to trunk/arch/arm/include/asm/fpstate.h index 392eb5332323..ee5e03efc1bb 100644 --- a/trunk/include/asm-arm/fpstate.h +++ b/trunk/arch/arm/include/asm/fpstate.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/fpstate.h + * arch/arm/include/asm/fpstate.h * * Copyright (C) 1995 Russell King * diff --git a/trunk/include/asm-arm/ftrace.h b/trunk/arch/arm/include/asm/ftrace.h similarity index 100% rename from trunk/include/asm-arm/ftrace.h rename to trunk/arch/arm/include/asm/ftrace.h diff --git a/trunk/include/asm-arm/futex.h b/trunk/arch/arm/include/asm/futex.h similarity index 100% rename from trunk/include/asm-arm/futex.h rename to trunk/arch/arm/include/asm/futex.h diff --git a/trunk/include/asm-arm/glue.h b/trunk/arch/arm/include/asm/glue.h similarity index 99% rename from trunk/include/asm-arm/glue.h rename to trunk/arch/arm/include/asm/glue.h index a97a182ba287..a0e39d5d00c9 100644 --- a/trunk/include/asm-arm/glue.h +++ b/trunk/arch/arm/include/asm/glue.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/glue.h + * arch/arm/include/asm/glue.h * * Copyright (C) 1997-1999 Russell King * Copyright (C) 2000-2002 Deep Blue Solutions Ltd. diff --git a/trunk/arch/arm/include/asm/gpio.h b/trunk/arch/arm/include/asm/gpio.h new file mode 100644 index 000000000000..166a7a3e2840 --- /dev/null +++ b/trunk/arch/arm/include/asm/gpio.h @@ -0,0 +1,7 @@ +#ifndef _ARCH_ARM_GPIO_H +#define _ARCH_ARM_GPIO_H + +/* not all ARM platforms necessarily support this API ... */ +#include + +#endif /* _ARCH_ARM_GPIO_H */ diff --git a/trunk/include/asm-arm/hardirq.h b/trunk/arch/arm/include/asm/hardirq.h similarity index 100% rename from trunk/include/asm-arm/hardirq.h rename to trunk/arch/arm/include/asm/hardirq.h diff --git a/trunk/include/asm-arm/hardware/arm_timer.h b/trunk/arch/arm/include/asm/hardware/arm_timer.h similarity index 100% rename from trunk/include/asm-arm/hardware/arm_timer.h rename to trunk/arch/arm/include/asm/hardware/arm_timer.h diff --git a/trunk/include/asm-arm/hardware/arm_twd.h b/trunk/arch/arm/include/asm/hardware/arm_twd.h similarity index 100% rename from trunk/include/asm-arm/hardware/arm_twd.h rename to trunk/arch/arm/include/asm/hardware/arm_twd.h diff --git a/trunk/include/asm-arm/hardware/cache-l2x0.h b/trunk/arch/arm/include/asm/hardware/cache-l2x0.h similarity index 97% rename from trunk/include/asm-arm/hardware/cache-l2x0.h rename to trunk/arch/arm/include/asm/hardware/cache-l2x0.h index 54029a740396..64f2252a25cd 100644 --- a/trunk/include/asm-arm/hardware/cache-l2x0.h +++ b/trunk/arch/arm/include/asm/hardware/cache-l2x0.h @@ -1,5 +1,5 @@ /* - * include/asm-arm/hardware/cache-l2x0.h + * arch/arm/include/asm/hardware/cache-l2x0.h * * Copyright (C) 2007 ARM Limited * diff --git a/trunk/include/asm-arm/hardware/clps7111.h b/trunk/arch/arm/include/asm/hardware/clps7111.h similarity index 99% rename from trunk/include/asm-arm/hardware/clps7111.h rename to trunk/arch/arm/include/asm/hardware/clps7111.h index 8d3228dc1778..44477225aed6 100644 --- a/trunk/include/asm-arm/hardware/clps7111.h +++ b/trunk/arch/arm/include/asm/hardware/clps7111.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/clps7111.h + * arch/arm/include/asm/hardware/clps7111.h * * This file contains the hardware definitions of the CLPS7111 internal * registers. diff --git a/trunk/include/asm-arm/hardware/cs89712.h b/trunk/arch/arm/include/asm/hardware/cs89712.h similarity index 97% rename from trunk/include/asm-arm/hardware/cs89712.h rename to trunk/arch/arm/include/asm/hardware/cs89712.h index ad99a3e1b802..f75626933e94 100644 --- a/trunk/include/asm-arm/hardware/cs89712.h +++ b/trunk/arch/arm/include/asm/hardware/cs89712.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/cs89712.h + * arch/arm/include/asm/hardware/cs89712.h * * This file contains the hardware definitions of the CS89712 * additional internal registers. diff --git a/trunk/include/asm-arm/hardware/debug-8250.S b/trunk/arch/arm/include/asm/hardware/debug-8250.S similarity index 93% rename from trunk/include/asm-arm/hardware/debug-8250.S rename to trunk/arch/arm/include/asm/hardware/debug-8250.S index 07c97fb233fc..22c689255e6e 100644 --- a/trunk/include/asm-arm/hardware/debug-8250.S +++ b/trunk/arch/arm/include/asm/hardware/debug-8250.S @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/debug-8250.S + * arch/arm/include/asm/hardware/debug-8250.S * * Copyright (C) 1994-1999 Russell King * diff --git a/trunk/include/asm-arm/hardware/debug-pl01x.S b/trunk/arch/arm/include/asm/hardware/debug-pl01x.S similarity index 93% rename from trunk/include/asm-arm/hardware/debug-pl01x.S rename to trunk/arch/arm/include/asm/hardware/debug-pl01x.S index 23c541a9e89a..f9fd083eff63 100644 --- a/trunk/include/asm-arm/hardware/debug-pl01x.S +++ b/trunk/arch/arm/include/asm/hardware/debug-pl01x.S @@ -1,4 +1,4 @@ -/* linux/include/asm-arm/hardware/debug-pl01x.S +/* arch/arm/include/asm/hardware/debug-pl01x.S * * Debugging macro include header * diff --git a/trunk/include/asm-arm/hardware/dec21285.h b/trunk/arch/arm/include/asm/hardware/dec21285.h similarity index 98% rename from trunk/include/asm-arm/hardware/dec21285.h rename to trunk/arch/arm/include/asm/hardware/dec21285.h index 546f7077be9c..0d7552751aaf 100644 --- a/trunk/include/asm-arm/hardware/dec21285.h +++ b/trunk/arch/arm/include/asm/hardware/dec21285.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/dec21285.h + * arch/arm/include/asm/hardware/dec21285.h * * Copyright (C) 1998 Russell King * @@ -19,7 +19,7 @@ #define DC21285_PCI_MEM 0x80000000 #ifndef __ASSEMBLY__ -#include +#include #define DC21285_IO(x) ((volatile unsigned long *)(ARMCSR_BASE+(x))) #else #define DC21285_IO(x) (x) diff --git a/trunk/include/asm-arm/hardware/entry-macro-iomd.S b/trunk/arch/arm/include/asm/hardware/entry-macro-iomd.S similarity index 99% rename from trunk/include/asm-arm/hardware/entry-macro-iomd.S rename to trunk/arch/arm/include/asm/hardware/entry-macro-iomd.S index 9bb580a5b15e..e0af4983723f 100644 --- a/trunk/include/asm-arm/hardware/entry-macro-iomd.S +++ b/trunk/arch/arm/include/asm/hardware/entry-macro-iomd.S @@ -1,5 +1,5 @@ /* - * include/asm-arm/hardware/entry-macro-iomd.S + * arch/arm/include/asm/hardware/entry-macro-iomd.S * * Low-level IRQ helper macros for IOC/IOMD based platforms * diff --git a/trunk/include/asm-arm/hardware/ep7211.h b/trunk/arch/arm/include/asm/hardware/ep7211.h similarity index 96% rename from trunk/include/asm-arm/hardware/ep7211.h rename to trunk/arch/arm/include/asm/hardware/ep7211.h index 017aa68f612d..654d5f625c49 100644 --- a/trunk/include/asm-arm/hardware/ep7211.h +++ b/trunk/arch/arm/include/asm/hardware/ep7211.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/ep7211.h + * arch/arm/include/asm/hardware/ep7211.h * * This file contains the hardware definitions of the EP7211 internal * registers. diff --git a/trunk/include/asm-arm/hardware/ep7212.h b/trunk/arch/arm/include/asm/hardware/ep7212.h similarity index 98% rename from trunk/include/asm-arm/hardware/ep7212.h rename to trunk/arch/arm/include/asm/hardware/ep7212.h index 0e952e747073..3b43bbeaf1db 100644 --- a/trunk/include/asm-arm/hardware/ep7212.h +++ b/trunk/arch/arm/include/asm/hardware/ep7212.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/ep7212.h + * arch/arm/include/asm/hardware/ep7212.h * * This file contains the hardware definitions of the EP7212 internal * registers. diff --git a/trunk/include/asm-arm/hardware/gic.h b/trunk/arch/arm/include/asm/hardware/gic.h similarity index 96% rename from trunk/include/asm-arm/hardware/gic.h rename to trunk/arch/arm/include/asm/hardware/gic.h index 966e428ad32c..4924914af188 100644 --- a/trunk/include/asm-arm/hardware/gic.h +++ b/trunk/arch/arm/include/asm/hardware/gic.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/gic.h + * arch/arm/include/asm/hardware/gic.h * * Copyright (C) 2002 ARM Limited, All Rights Reserved. * diff --git a/trunk/include/asm-arm/hardware/icst307.h b/trunk/arch/arm/include/asm/hardware/icst307.h similarity index 96% rename from trunk/include/asm-arm/hardware/icst307.h rename to trunk/arch/arm/include/asm/hardware/icst307.h index ff8618a441c0..554f128a1046 100644 --- a/trunk/include/asm-arm/hardware/icst307.h +++ b/trunk/arch/arm/include/asm/hardware/icst307.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/icst307.h + * arch/arm/include/asm/hardware/icst307.h * * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. * diff --git a/trunk/include/asm-arm/hardware/icst525.h b/trunk/arch/arm/include/asm/hardware/icst525.h similarity index 96% rename from trunk/include/asm-arm/hardware/icst525.h rename to trunk/arch/arm/include/asm/hardware/icst525.h index edd5a5704406..58f0dc43e2ed 100644 --- a/trunk/include/asm-arm/hardware/icst525.h +++ b/trunk/arch/arm/include/asm/hardware/icst525.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/icst525.h + * arch/arm/include/asm/hardware/icst525.h * * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. * diff --git a/trunk/include/asm-arm/hardware/ioc.h b/trunk/arch/arm/include/asm/hardware/ioc.h similarity index 97% rename from trunk/include/asm-arm/hardware/ioc.h rename to trunk/arch/arm/include/asm/hardware/ioc.h index b3b46ef65943..1f6b8013becb 100644 --- a/trunk/include/asm-arm/hardware/ioc.h +++ b/trunk/arch/arm/include/asm/hardware/ioc.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/ioc.h + * arch/arm/include/asm/hardware/ioc.h * * Copyright (C) Russell King * diff --git a/trunk/include/asm-arm/hardware/iomd.h b/trunk/arch/arm/include/asm/hardware/iomd.h similarity index 99% rename from trunk/include/asm-arm/hardware/iomd.h rename to trunk/arch/arm/include/asm/hardware/iomd.h index 396e55ad06c6..9c5afbd71a69 100644 --- a/trunk/include/asm-arm/hardware/iomd.h +++ b/trunk/arch/arm/include/asm/hardware/iomd.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/iomd.h + * arch/arm/include/asm/hardware/iomd.h * * Copyright (C) 1999 Russell King * diff --git a/trunk/include/asm-arm/hardware/iop3xx-adma.h b/trunk/arch/arm/include/asm/hardware/iop3xx-adma.h similarity index 99% rename from trunk/include/asm-arm/hardware/iop3xx-adma.h rename to trunk/arch/arm/include/asm/hardware/iop3xx-adma.h index af64676650a2..87bff09633aa 100644 --- a/trunk/include/asm-arm/hardware/iop3xx-adma.h +++ b/trunk/arch/arm/include/asm/hardware/iop3xx-adma.h @@ -19,7 +19,7 @@ #define _ADMA_H #include #include -#include +#include #include /* Memory copy units */ diff --git a/trunk/include/asm-arm/hardware/iop3xx-gpio.h b/trunk/arch/arm/include/asm/hardware/iop3xx-gpio.h similarity index 95% rename from trunk/include/asm-arm/hardware/iop3xx-gpio.h rename to trunk/arch/arm/include/asm/hardware/iop3xx-gpio.h index 0c9331f9ac24..b69d972b1f7d 100644 --- a/trunk/include/asm-arm/hardware/iop3xx-gpio.h +++ b/trunk/arch/arm/include/asm/hardware/iop3xx-gpio.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/iop3xx-gpio.h + * arch/arm/include/asm/hardware/iop3xx-gpio.h * * IOP3xx GPIO wrappers * @@ -25,7 +25,7 @@ #ifndef __ASM_ARM_HARDWARE_IOP3XX_GPIO_H #define __ASM_ARM_HARDWARE_IOP3XX_GPIO_H -#include +#include #include #define IOP3XX_N_GPIOS 8 diff --git a/trunk/include/asm-arm/hardware/iop3xx.h b/trunk/arch/arm/include/asm/hardware/iop3xx.h similarity index 99% rename from trunk/include/asm-arm/hardware/iop3xx.h rename to trunk/arch/arm/include/asm/hardware/iop3xx.h index 18f6937f5010..4b8e7f559929 100644 --- a/trunk/include/asm-arm/hardware/iop3xx.h +++ b/trunk/arch/arm/include/asm/hardware/iop3xx.h @@ -1,5 +1,5 @@ /* - * include/asm-arm/hardware/iop3xx.h + * arch/arm/include/asm/hardware/iop3xx.h * * Intel IOP32X and IOP33X register definitions * diff --git a/trunk/include/asm-arm/hardware/iop_adma.h b/trunk/arch/arm/include/asm/hardware/iop_adma.h similarity index 100% rename from trunk/include/asm-arm/hardware/iop_adma.h rename to trunk/arch/arm/include/asm/hardware/iop_adma.h diff --git a/trunk/include/asm-arm/hardware/it8152.h b/trunk/arch/arm/include/asm/hardware/it8152.h similarity index 100% rename from trunk/include/asm-arm/hardware/it8152.h rename to trunk/arch/arm/include/asm/hardware/it8152.h diff --git a/trunk/include/asm-arm/hardware/linkup-l1110.h b/trunk/arch/arm/include/asm/hardware/linkup-l1110.h similarity index 100% rename from trunk/include/asm-arm/hardware/linkup-l1110.h rename to trunk/arch/arm/include/asm/hardware/linkup-l1110.h diff --git a/trunk/include/asm-arm/hardware/locomo.h b/trunk/arch/arm/include/asm/hardware/locomo.h similarity index 99% rename from trunk/include/asm-arm/hardware/locomo.h rename to trunk/arch/arm/include/asm/hardware/locomo.h index fb0645de6f31..954b1be991b4 100644 --- a/trunk/include/asm-arm/hardware/locomo.h +++ b/trunk/arch/arm/include/asm/hardware/locomo.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/locomo.h + * arch/arm/include/asm/hardware/locomo.h * * This file contains the definitions for the LoCoMo G/A Chip * diff --git a/trunk/include/asm-arm/hardware/memc.h b/trunk/arch/arm/include/asm/hardware/memc.h similarity index 93% rename from trunk/include/asm-arm/hardware/memc.h rename to trunk/arch/arm/include/asm/hardware/memc.h index 8aef5aa0e01b..42ba7c167d1f 100644 --- a/trunk/include/asm-arm/hardware/memc.h +++ b/trunk/arch/arm/include/asm/hardware/memc.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/memc.h + * arch/arm/include/asm/hardware/memc.h * * Copyright (C) Russell King. * diff --git a/trunk/include/asm-arm/hardware/pci_v3.h b/trunk/arch/arm/include/asm/hardware/pci_v3.h similarity index 99% rename from trunk/include/asm-arm/hardware/pci_v3.h rename to trunk/arch/arm/include/asm/hardware/pci_v3.h index 4d497bdb9a97..2811c7e2cfdf 100644 --- a/trunk/include/asm-arm/hardware/pci_v3.h +++ b/trunk/arch/arm/include/asm/hardware/pci_v3.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/pci_v3.h + * arch/arm/include/asm/hardware/pci_v3.h * * Internal header file PCI V3 chip * diff --git a/trunk/include/asm-arm/hardware/sa1111.h b/trunk/arch/arm/include/asm/hardware/sa1111.h similarity index 99% rename from trunk/include/asm-arm/hardware/sa1111.h rename to trunk/arch/arm/include/asm/hardware/sa1111.h index 61b1d05c7df7..5da2595759e5 100644 --- a/trunk/include/asm-arm/hardware/sa1111.h +++ b/trunk/arch/arm/include/asm/hardware/sa1111.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/sa1111.h + * arch/arm/include/asm/hardware/sa1111.h * * Copyright (C) 2000 John G Dorsey * @@ -12,7 +12,7 @@ #ifndef _ASM_ARCH_SA1111 #define _ASM_ARCH_SA1111 -#include +#include /* * The SA1111 is always located at virtual 0xf4000000, and is always diff --git a/trunk/include/asm-arm/hardware/scoop.h b/trunk/arch/arm/include/asm/hardware/scoop.h similarity index 100% rename from trunk/include/asm-arm/hardware/scoop.h rename to trunk/arch/arm/include/asm/hardware/scoop.h diff --git a/trunk/include/asm-arm/hardware/sharpsl_pm.h b/trunk/arch/arm/include/asm/hardware/sharpsl_pm.h similarity index 100% rename from trunk/include/asm-arm/hardware/sharpsl_pm.h rename to trunk/arch/arm/include/asm/hardware/sharpsl_pm.h diff --git a/trunk/include/asm-arm/hardware/ssp.h b/trunk/arch/arm/include/asm/hardware/ssp.h similarity index 100% rename from trunk/include/asm-arm/hardware/ssp.h rename to trunk/arch/arm/include/asm/hardware/ssp.h diff --git a/trunk/include/asm-arm/hardware/uengine.h b/trunk/arch/arm/include/asm/hardware/uengine.h similarity index 100% rename from trunk/include/asm-arm/hardware/uengine.h rename to trunk/arch/arm/include/asm/hardware/uengine.h diff --git a/trunk/include/asm-arm/hardware/vic.h b/trunk/arch/arm/include/asm/hardware/vic.h similarity index 97% rename from trunk/include/asm-arm/hardware/vic.h rename to trunk/arch/arm/include/asm/hardware/vic.h index ed9ca3736a0b..263f2c362a30 100644 --- a/trunk/include/asm-arm/hardware/vic.h +++ b/trunk/arch/arm/include/asm/hardware/vic.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/hardware/vic.h + * arch/arm/include/asm/hardware/vic.h * * Copyright (c) ARM Limited 2003. All rights reserved. * diff --git a/trunk/arch/arm/include/asm/hw_irq.h b/trunk/arch/arm/include/asm/hw_irq.h new file mode 100644 index 000000000000..90831f6f5f5c --- /dev/null +++ b/trunk/arch/arm/include/asm/hw_irq.h @@ -0,0 +1,27 @@ +/* + * Nothing to see here yet + */ +#ifndef _ARCH_ARM_HW_IRQ_H +#define _ARCH_ARM_HW_IRQ_H + +static inline void ack_bad_irq(int irq) +{ + extern unsigned long irq_err_count; + irq_err_count++; +} + +/* + * Obsolete inline function for calling irq descriptor handlers. + */ +static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc) +{ + desc->handle_irq(irq, desc); +} + +void set_irq_flags(unsigned int irq, unsigned int flags); + +#define IRQF_VALID (1 << 0) +#define IRQF_PROBE (1 << 1) +#define IRQF_NOAUTOEN (1 << 2) + +#endif diff --git a/trunk/include/asm-arm/hwcap.h b/trunk/arch/arm/include/asm/hwcap.h similarity index 100% rename from trunk/include/asm-arm/hwcap.h rename to trunk/arch/arm/include/asm/hwcap.h diff --git a/trunk/arch/arm/include/asm/ide.h b/trunk/arch/arm/include/asm/ide.h new file mode 100644 index 000000000000..b507ce8e5019 --- /dev/null +++ b/trunk/arch/arm/include/asm/ide.h @@ -0,0 +1,23 @@ +/* + * arch/arm/include/asm/ide.h + * + * Copyright (C) 1994-1996 Linus Torvalds & authors + */ + +/* + * This file contains the ARM architecture specific IDE code. + */ + +#ifndef __ASMARM_IDE_H +#define __ASMARM_IDE_H + +#ifdef __KERNEL__ + +#define __ide_mm_insw(port,addr,len) readsw(port,addr,len) +#define __ide_mm_insl(port,addr,len) readsl(port,addr,len) +#define __ide_mm_outsw(port,addr,len) writesw(port,addr,len) +#define __ide_mm_outsl(port,addr,len) writesl(port,addr,len) + +#endif /* __KERNEL__ */ + +#endif /* __ASMARM_IDE_H */ diff --git a/trunk/arch/arm/include/asm/io.h b/trunk/arch/arm/include/asm/io.h new file mode 100644 index 000000000000..94a95d7fafd6 --- /dev/null +++ b/trunk/arch/arm/include/asm/io.h @@ -0,0 +1,287 @@ +/* + * arch/arm/include/asm/io.h + * + * Copyright (C) 1996-2000 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Modifications: + * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both + * constant addresses and variable addresses. + * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture + * specific IO header files. + * 27-Mar-1999 PJB Second parameter of memcpy_toio is const.. + * 04-Apr-1999 PJB Added check_signature. + * 12-Dec-1999 RMK More cleanups + * 18-Jun-2000 RMK Removed virt_to_* and friends definitions + * 05-Oct-2004 BJD Moved memory string functions to use void __iomem + */ +#ifndef __ASM_ARM_IO_H +#define __ASM_ARM_IO_H + +#ifdef __KERNEL__ + +#include +#include +#include + +/* + * ISA I/O bus memory addresses are 1:1 with the physical address. + */ +#define isa_virt_to_bus virt_to_phys +#define isa_page_to_bus page_to_phys +#define isa_bus_to_virt phys_to_virt + +/* + * Generic IO read/write. These perform native-endian accesses. Note + * that some architectures will want to re-define __raw_{read,write}w. + */ +extern void __raw_writesb(void __iomem *addr, const void *data, int bytelen); +extern void __raw_writesw(void __iomem *addr, const void *data, int wordlen); +extern void __raw_writesl(void __iomem *addr, const void *data, int longlen); + +extern void __raw_readsb(const void __iomem *addr, void *data, int bytelen); +extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen); +extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); + +#define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a) = (v)) +#define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v)) +#define __raw_writel(v,a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a) = (v)) + +#define __raw_readb(a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a)) +#define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a)) +#define __raw_readl(a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a)) + +/* + * Architecture ioremap implementation. + */ +#define MT_DEVICE 0 +#define MT_DEVICE_NONSHARED 1 +#define MT_DEVICE_CACHED 2 +#define MT_DEVICE_IXP2000 3 +/* + * types 4 onwards can be found in asm/mach/map.h and are undefined + * for ioremap + */ + +/* + * __arm_ioremap takes CPU physical address. + * __arm_ioremap_pfn takes a Page Frame Number and an offset into that page + */ +extern void __iomem * __arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int); +extern void __iomem * __arm_ioremap(unsigned long, size_t, unsigned int); +extern void __iounmap(volatile void __iomem *addr); + +/* + * Bad read/write accesses... + */ +extern void __readwrite_bug(const char *fn); + +/* + * Now, pick up the machine-defined IO definitions + */ +#include + +/* + * IO port access primitives + * ------------------------- + * + * The ARM doesn't have special IO access instructions; all IO is memory + * mapped. Note that these are defined to perform little endian accesses + * only. Their primary purpose is to access PCI and ISA peripherals. + * + * Note that for a big endian machine, this implies that the following + * big endian mode connectivity is in place, as described by numerous + * ARM documents: + * + * PCI: D0-D7 D8-D15 D16-D23 D24-D31 + * ARM: D24-D31 D16-D23 D8-D15 D0-D7 + * + * The machine specific io.h include defines __io to translate an "IO" + * address to a memory address. + * + * Note that we prevent GCC re-ordering or caching values in expressions + * by introducing sequence points into the in*() definitions. Note that + * __raw_* do not guarantee this behaviour. + * + * The {in,out}[bwl] macros are for emulating x86-style PCI/ISA IO space. + */ +#ifdef __io +#define outb(v,p) __raw_writeb(v,__io(p)) +#define outw(v,p) __raw_writew((__force __u16) \ + cpu_to_le16(v),__io(p)) +#define outl(v,p) __raw_writel((__force __u32) \ + cpu_to_le32(v),__io(p)) + +#define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __v; }) +#define inw(p) ({ __u16 __v = le16_to_cpu((__force __le16) \ + __raw_readw(__io(p))); __v; }) +#define inl(p) ({ __u32 __v = le32_to_cpu((__force __le32) \ + __raw_readl(__io(p))); __v; }) + +#define outsb(p,d,l) __raw_writesb(__io(p),d,l) +#define outsw(p,d,l) __raw_writesw(__io(p),d,l) +#define outsl(p,d,l) __raw_writesl(__io(p),d,l) + +#define insb(p,d,l) __raw_readsb(__io(p),d,l) +#define insw(p,d,l) __raw_readsw(__io(p),d,l) +#define insl(p,d,l) __raw_readsl(__io(p),d,l) +#endif + +#define outb_p(val,port) outb((val),(port)) +#define outw_p(val,port) outw((val),(port)) +#define outl_p(val,port) outl((val),(port)) +#define inb_p(port) inb((port)) +#define inw_p(port) inw((port)) +#define inl_p(port) inl((port)) + +#define outsb_p(port,from,len) outsb(port,from,len) +#define outsw_p(port,from,len) outsw(port,from,len) +#define outsl_p(port,from,len) outsl(port,from,len) +#define insb_p(port,to,len) insb(port,to,len) +#define insw_p(port,to,len) insw(port,to,len) +#define insl_p(port,to,len) insl(port,to,len) + +/* + * String version of IO memory access ops: + */ +extern void _memcpy_fromio(void *, const volatile void __iomem *, size_t); +extern void _memcpy_toio(volatile void __iomem *, const void *, size_t); +extern void _memset_io(volatile void __iomem *, int, size_t); + +#define mmiowb() + +/* + * Memory access primitives + * ------------------------ + * + * These perform PCI memory accesses via an ioremap region. They don't + * take an address as such, but a cookie. + * + * Again, this are defined to perform little endian accesses. See the + * IO port primitives for more information. + */ +#ifdef __mem_pci +#define readb(c) ({ __u8 __v = __raw_readb(__mem_pci(c)); __v; }) +#define readw(c) ({ __u16 __v = le16_to_cpu((__force __le16) \ + __raw_readw(__mem_pci(c))); __v; }) +#define readl(c) ({ __u32 __v = le32_to_cpu((__force __le32) \ + __raw_readl(__mem_pci(c))); __v; }) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + +#define readsb(p,d,l) __raw_readsb(__mem_pci(p),d,l) +#define readsw(p,d,l) __raw_readsw(__mem_pci(p),d,l) +#define readsl(p,d,l) __raw_readsl(__mem_pci(p),d,l) + +#define writeb(v,c) __raw_writeb(v,__mem_pci(c)) +#define writew(v,c) __raw_writew((__force __u16) \ + cpu_to_le16(v),__mem_pci(c)) +#define writel(v,c) __raw_writel((__force __u32) \ + cpu_to_le32(v),__mem_pci(c)) + +#define writesb(p,d,l) __raw_writesb(__mem_pci(p),d,l) +#define writesw(p,d,l) __raw_writesw(__mem_pci(p),d,l) +#define writesl(p,d,l) __raw_writesl(__mem_pci(p),d,l) + +#define memset_io(c,v,l) _memset_io(__mem_pci(c),(v),(l)) +#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l)) +#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l)) + +#elif !defined(readb) + +#define readb(c) (__readwrite_bug("readb"),0) +#define readw(c) (__readwrite_bug("readw"),0) +#define readl(c) (__readwrite_bug("readl"),0) +#define writeb(v,c) __readwrite_bug("writeb") +#define writew(v,c) __readwrite_bug("writew") +#define writel(v,c) __readwrite_bug("writel") + +#define check_signature(io,sig,len) (0) + +#endif /* __mem_pci */ + +/* + * ioremap and friends. + * + * ioremap takes a PCI memory address, as specified in + * Documentation/IO-mapping.txt. + * + */ +#ifndef __arch_ioremap +#define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) +#define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) +#define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED) +#define iounmap(cookie) __iounmap(cookie) +#else +#define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) +#define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) +#define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED) +#define iounmap(cookie) __arch_iounmap(cookie) +#endif + +/* + * io{read,write}{8,16,32} macros + */ +#ifndef ioread8 +#define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; }) +#define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __v; }) +#define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __v; }) + +#define iowrite8(v,p) __raw_writeb(v, p) +#define iowrite16(v,p) __raw_writew((__force __u16)cpu_to_le16(v), p) +#define iowrite32(v,p) __raw_writel((__force __u32)cpu_to_le32(v), p) + +#define ioread8_rep(p,d,c) __raw_readsb(p,d,c) +#define ioread16_rep(p,d,c) __raw_readsw(p,d,c) +#define ioread32_rep(p,d,c) __raw_readsl(p,d,c) + +#define iowrite8_rep(p,s,c) __raw_writesb(p,s,c) +#define iowrite16_rep(p,s,c) __raw_writesw(p,s,c) +#define iowrite32_rep(p,s,c) __raw_writesl(p,s,c) + +extern void __iomem *ioport_map(unsigned long port, unsigned int nr); +extern void ioport_unmap(void __iomem *addr); +#endif + +struct pci_dev; + +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); +extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); + +/* + * can the hardware map this into one segment or not, given no other + * constraints. + */ +#define BIOVEC_MERGEABLE(vec1, vec2) \ + ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) + +#ifdef CONFIG_MMU +#define ARCH_HAS_VALID_PHYS_ADDR_RANGE +extern int valid_phys_addr_range(unsigned long addr, size_t size); +extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); +#endif + +/* + * Convert a physical pointer to a virtual kernel pointer for /dev/mem + * access + */ +#define xlate_dev_mem_ptr(p) __va(p) + +/* + * Convert a virtual cached pointer to an uncached pointer + */ +#define xlate_dev_kmem_ptr(p) p + +/* + * Register ISA memory and port locations for glibc iopl/inb/outb + * emulation. + */ +extern void register_isa_ports(unsigned int mmio, unsigned int io, + unsigned int io_shift); + +#endif /* __KERNEL__ */ +#endif /* __ASM_ARM_IO_H */ diff --git a/trunk/include/asm-arm/ioctl.h b/trunk/arch/arm/include/asm/ioctl.h similarity index 100% rename from trunk/include/asm-arm/ioctl.h rename to trunk/arch/arm/include/asm/ioctl.h diff --git a/trunk/include/asm-arm/ioctls.h b/trunk/arch/arm/include/asm/ioctls.h similarity index 100% rename from trunk/include/asm-arm/ioctls.h rename to trunk/arch/arm/include/asm/ioctls.h diff --git a/trunk/include/asm-arm/ipcbuf.h b/trunk/arch/arm/include/asm/ipcbuf.h similarity index 100% rename from trunk/include/asm-arm/ipcbuf.h rename to trunk/arch/arm/include/asm/ipcbuf.h diff --git a/trunk/arch/arm/include/asm/irq.h b/trunk/arch/arm/include/asm/irq.h new file mode 100644 index 000000000000..d6786090d02c --- /dev/null +++ b/trunk/arch/arm/include/asm/irq.h @@ -0,0 +1,28 @@ +#ifndef __ASM_ARM_IRQ_H +#define __ASM_ARM_IRQ_H + +#include + +#ifndef irq_canonicalize +#define irq_canonicalize(i) (i) +#endif + +#ifndef NR_IRQS +#define NR_IRQS 128 +#endif + +/* + * Use this value to indicate lack of interrupt + * capability + */ +#ifndef NO_IRQ +#define NO_IRQ ((unsigned int)(-1)) +#endif + +#ifndef __ASSEMBLY__ +struct irqaction; +extern void migrate_irqs(void); +#endif + +#endif + diff --git a/trunk/include/asm-arm/irq_regs.h b/trunk/arch/arm/include/asm/irq_regs.h similarity index 100% rename from trunk/include/asm-arm/irq_regs.h rename to trunk/arch/arm/include/asm/irq_regs.h diff --git a/trunk/include/asm-arm/irqflags.h b/trunk/arch/arm/include/asm/irqflags.h similarity index 100% rename from trunk/include/asm-arm/irqflags.h rename to trunk/arch/arm/include/asm/irqflags.h diff --git a/trunk/include/asm-arm/kdebug.h b/trunk/arch/arm/include/asm/kdebug.h similarity index 100% rename from trunk/include/asm-arm/kdebug.h rename to trunk/arch/arm/include/asm/kdebug.h diff --git a/trunk/include/asm-arm/kexec.h b/trunk/arch/arm/include/asm/kexec.h similarity index 100% rename from trunk/include/asm-arm/kexec.h rename to trunk/arch/arm/include/asm/kexec.h diff --git a/trunk/include/asm-arm/kgdb.h b/trunk/arch/arm/include/asm/kgdb.h similarity index 100% rename from trunk/include/asm-arm/kgdb.h rename to trunk/arch/arm/include/asm/kgdb.h diff --git a/trunk/include/asm-arm/kmap_types.h b/trunk/arch/arm/include/asm/kmap_types.h similarity index 100% rename from trunk/include/asm-arm/kmap_types.h rename to trunk/arch/arm/include/asm/kmap_types.h diff --git a/trunk/include/asm-arm/kprobes.h b/trunk/arch/arm/include/asm/kprobes.h similarity index 98% rename from trunk/include/asm-arm/kprobes.h rename to trunk/arch/arm/include/asm/kprobes.h index b1a37876942d..a5d0d99ad387 100644 --- a/trunk/include/asm-arm/kprobes.h +++ b/trunk/arch/arm/include/asm/kprobes.h @@ -1,5 +1,5 @@ /* - * include/asm-arm/kprobes.h + * arch/arm/include/asm/kprobes.h * * Copyright (C) 2006, 2007 Motorola Inc. * diff --git a/trunk/include/asm-arm/leds.h b/trunk/arch/arm/include/asm/leds.h similarity index 96% rename from trunk/include/asm-arm/leds.h rename to trunk/arch/arm/include/asm/leds.h index 12290ea55801..c545739f39b7 100644 --- a/trunk/include/asm-arm/leds.h +++ b/trunk/arch/arm/include/asm/leds.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/leds.h + * arch/arm/include/asm/leds.h * * Copyright (C) 1998 Russell King * diff --git a/trunk/include/asm-arm/limits.h b/trunk/arch/arm/include/asm/limits.h similarity index 100% rename from trunk/include/asm-arm/limits.h rename to trunk/arch/arm/include/asm/limits.h diff --git a/trunk/include/asm-arm/linkage.h b/trunk/arch/arm/include/asm/linkage.h similarity index 100% rename from trunk/include/asm-arm/linkage.h rename to trunk/arch/arm/include/asm/linkage.h diff --git a/trunk/include/asm-arm/local.h b/trunk/arch/arm/include/asm/local.h similarity index 100% rename from trunk/include/asm-arm/local.h rename to trunk/arch/arm/include/asm/local.h diff --git a/trunk/include/asm-arm/locks.h b/trunk/arch/arm/include/asm/locks.h similarity index 99% rename from trunk/include/asm-arm/locks.h rename to trunk/arch/arm/include/asm/locks.h index 852220eecdbc..ef4c897772d1 100644 --- a/trunk/include/asm-arm/locks.h +++ b/trunk/arch/arm/include/asm/locks.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/locks.h + * arch/arm/include/asm/locks.h * * Copyright (C) 2000 Russell King * diff --git a/trunk/include/asm-arm/mach/arch.h b/trunk/arch/arm/include/asm/mach/arch.h similarity index 97% rename from trunk/include/asm-arm/mach/arch.h rename to trunk/arch/arm/include/asm/mach/arch.h index bcc8aed7c9a9..c59842dc7cb8 100644 --- a/trunk/include/asm-arm/mach/arch.h +++ b/trunk/arch/arm/include/asm/mach/arch.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/mach/arch.h + * arch/arm/include/asm/mach/arch.h * * Copyright (C) 2000 Russell King * diff --git a/trunk/arch/arm/include/asm/mach/dma.h b/trunk/arch/arm/include/asm/mach/dma.h new file mode 100644 index 000000000000..fc7278ea7146 --- /dev/null +++ b/trunk/arch/arm/include/asm/mach/dma.h @@ -0,0 +1,57 @@ +/* + * arch/arm/include/asm/mach/dma.h + * + * Copyright (C) 1998-2000 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This header file describes the interface between the generic DMA handler + * (dma.c) and the architecture-specific DMA backends (dma-*.c) + */ + +struct dma_struct; +typedef struct dma_struct dma_t; + +struct dma_ops { + int (*request)(dmach_t, dma_t *); /* optional */ + void (*free)(dmach_t, dma_t *); /* optional */ + void (*enable)(dmach_t, dma_t *); /* mandatory */ + void (*disable)(dmach_t, dma_t *); /* mandatory */ + int (*residue)(dmach_t, dma_t *); /* optional */ + int (*setspeed)(dmach_t, dma_t *, int); /* optional */ + char *type; +}; + +struct dma_struct { + void *addr; /* single DMA address */ + unsigned long count; /* single DMA size */ + struct scatterlist buf; /* single DMA */ + int sgcount; /* number of DMA SG */ + struct scatterlist *sg; /* DMA Scatter-Gather List */ + + unsigned int active:1; /* Transfer active */ + unsigned int invalid:1; /* Address/Count changed */ + + dmamode_t dma_mode; /* DMA mode */ + int speed; /* DMA speed */ + + unsigned int lock; /* Device is allocated */ + const char *device_id; /* Device name */ + + unsigned int dma_base; /* Controller base address */ + int dma_irq; /* Controller IRQ */ + struct scatterlist cur_sg; /* Current controller buffer */ + unsigned int state; + + struct dma_ops *d_ops; +}; + +/* Prototype: void arch_dma_init(dma) + * Purpose : Initialise architecture specific DMA + * Params : dma - pointer to array of DMA structures + */ +extern void arch_dma_init(dma_t *dma); + +extern void isa_init_dma(dma_t *dma); diff --git a/trunk/include/asm-arm/mach/flash.h b/trunk/arch/arm/include/asm/mach/flash.h similarity index 96% rename from trunk/include/asm-arm/mach/flash.h rename to trunk/arch/arm/include/asm/mach/flash.h index 05b029ef6371..4ca69fe2c850 100644 --- a/trunk/include/asm-arm/mach/flash.h +++ b/trunk/arch/arm/include/asm/mach/flash.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/mach/flash.h + * arch/arm/include/asm/mach/flash.h * * Copyright (C) 2003 Russell King, All Rights Reserved. * diff --git a/trunk/arch/arm/include/asm/mach/irda.h b/trunk/arch/arm/include/asm/mach/irda.h new file mode 100644 index 000000000000..38f77b5e56cf --- /dev/null +++ b/trunk/arch/arm/include/asm/mach/irda.h @@ -0,0 +1,20 @@ +/* + * arch/arm/include/asm/mach/irda.h + * + * Copyright (C) 2004 Russell King. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __ASM_ARM_MACH_IRDA_H +#define __ASM_ARM_MACH_IRDA_H + +struct irda_platform_data { + int (*startup)(struct device *); + void (*shutdown)(struct device *); + int (*set_power)(struct device *, unsigned int state); + void (*set_speed)(struct device *, unsigned int speed); +}; + +#endif diff --git a/trunk/arch/arm/include/asm/mach/irq.h b/trunk/arch/arm/include/asm/mach/irq.h new file mode 100644 index 000000000000..acac5302e4ea --- /dev/null +++ b/trunk/arch/arm/include/asm/mach/irq.h @@ -0,0 +1,34 @@ +/* + * arch/arm/include/asm/mach/irq.h + * + * Copyright (C) 1995-2000 Russell King. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __ASM_ARM_MACH_IRQ_H +#define __ASM_ARM_MACH_IRQ_H + +#include + +struct seq_file; + +/* + * This is internal. Do not use it. + */ +extern void (*init_arch_irq)(void); +extern void init_FIQ(void); +extern int show_fiq_list(struct seq_file *, void *); + +/* + * This is for easy migration, but should be changed in the source + */ +#define do_bad_IRQ(irq,desc) \ +do { \ + spin_lock(&desc->lock); \ + handle_bad_irq(irq, desc); \ + spin_unlock(&desc->lock); \ +} while(0) + +#endif diff --git a/trunk/arch/arm/include/asm/mach/map.h b/trunk/arch/arm/include/asm/mach/map.h new file mode 100644 index 000000000000..06f583b13999 --- /dev/null +++ b/trunk/arch/arm/include/asm/mach/map.h @@ -0,0 +1,36 @@ +/* + * arch/arm/include/asm/map.h + * + * Copyright (C) 1999-2000 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Page table mapping constructs and function prototypes + */ +#include + +struct map_desc { + unsigned long virtual; + unsigned long pfn; + unsigned long length; + unsigned int type; +}; + +/* types 0-3 are defined in asm/io.h */ +#define MT_CACHECLEAN 4 +#define MT_MINICLEAN 5 +#define MT_LOW_VECTORS 6 +#define MT_HIGH_VECTORS 7 +#define MT_MEMORY 8 +#define MT_ROM 9 + +#define MT_NONSHARED_DEVICE MT_DEVICE_NONSHARED +#define MT_IXP2000_DEVICE MT_DEVICE_IXP2000 + +#ifdef CONFIG_MMU +extern void iotable_init(struct map_desc *, int); +#else +#define iotable_init(map,num) do { } while (0) +#endif diff --git a/trunk/arch/arm/include/asm/mach/mmc.h b/trunk/arch/arm/include/asm/mach/mmc.h new file mode 100644 index 000000000000..4da332b03144 --- /dev/null +++ b/trunk/arch/arm/include/asm/mach/mmc.h @@ -0,0 +1,15 @@ +/* + * arch/arm/include/asm/mach/mmc.h + */ +#ifndef ASMARM_MACH_MMC_H +#define ASMARM_MACH_MMC_H + +#include + +struct mmc_platform_data { + unsigned int ocr_mask; /* available voltages */ + u32 (*translate_vdd)(struct device *, unsigned int); + unsigned int (*status)(struct device *); +}; + +#endif diff --git a/trunk/arch/arm/include/asm/mach/pci.h b/trunk/arch/arm/include/asm/mach/pci.h new file mode 100644 index 000000000000..32da1ae17e06 --- /dev/null +++ b/trunk/arch/arm/include/asm/mach/pci.h @@ -0,0 +1,72 @@ +/* + * arch/arm/include/asm/mach/pci.h + * + * Copyright (C) 2000 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +struct pci_sys_data; +struct pci_bus; + +struct hw_pci { + struct list_head buses; + int nr_controllers; + int (*setup)(int nr, struct pci_sys_data *); + struct pci_bus *(*scan)(int nr, struct pci_sys_data *); + void (*preinit)(void); + void (*postinit)(void); + u8 (*swizzle)(struct pci_dev *dev, u8 *pin); + int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin); +}; + +/* + * Per-controller structure + */ +struct pci_sys_data { + struct list_head node; + int busnr; /* primary bus number */ + u64 mem_offset; /* bus->cpu memory mapping offset */ + unsigned long io_offset; /* bus->cpu IO mapping offset */ + struct pci_bus *bus; /* PCI bus */ + struct resource *resource[3]; /* Primary PCI bus resources */ + /* Bridge swizzling */ + u8 (*swizzle)(struct pci_dev *, u8 *); + /* IRQ mapping */ + int (*map_irq)(struct pci_dev *, u8, u8); + struct hw_pci *hw; +}; + +/* + * This is the standard PCI-PCI bridge swizzling algorithm. + */ +u8 pci_std_swizzle(struct pci_dev *dev, u8 *pinp); + +/* + * Call this with your hw_pci struct to initialise the PCI system. + */ +void pci_common_init(struct hw_pci *); + +/* + * PCI controllers + */ +extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); +extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *); +extern void iop3xx_pci_preinit(void); +extern void iop3xx_pci_preinit_cond(void); + +extern int dc21285_setup(int nr, struct pci_sys_data *); +extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); +extern void dc21285_preinit(void); +extern void dc21285_postinit(void); + +extern int via82c505_setup(int nr, struct pci_sys_data *); +extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *); +extern void via82c505_init(void *sysdata); + +extern int pci_v3_setup(int nr, struct pci_sys_data *); +extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *); +extern void pci_v3_preinit(void); +extern void pci_v3_postinit(void); diff --git a/trunk/include/asm-avr32/mach/serial_at91.h b/trunk/arch/arm/include/asm/mach/serial_at91.h similarity index 94% rename from trunk/include/asm-avr32/mach/serial_at91.h rename to trunk/arch/arm/include/asm/mach/serial_at91.h index 55b317a89061..ea6d063923b8 100644 --- a/trunk/include/asm-avr32/mach/serial_at91.h +++ b/trunk/arch/arm/include/asm/mach/serial_at91.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/mach/serial_at91.h + * arch/arm/include/asm/mach/serial_at91.h * * Based on serial_sa1100.h by Nicolas Pitre * diff --git a/trunk/include/asm-arm/mach/serial_sa1100.h b/trunk/arch/arm/include/asm/mach/serial_sa1100.h similarity index 86% rename from trunk/include/asm-arm/mach/serial_sa1100.h rename to trunk/arch/arm/include/asm/mach/serial_sa1100.h index 20c22bb218d9..d09064bf95a0 100644 --- a/trunk/include/asm-arm/mach/serial_sa1100.h +++ b/trunk/arch/arm/include/asm/mach/serial_sa1100.h @@ -1,9 +1,9 @@ /* - * linux/include/asm-arm/mach/serial_sa1100.h + * arch/arm/include/asm/mach/serial_sa1100.h * * Author: Nicolas Pitre * - * Moved to include/asm-arm/mach and changed lots, Russell King + * Moved and changed lots, Russell King * * Low level machine dependent UART functions. */ diff --git a/trunk/include/asm-arm/mach/sharpsl_param.h b/trunk/arch/arm/include/asm/mach/sharpsl_param.h similarity index 100% rename from trunk/include/asm-arm/mach/sharpsl_param.h rename to trunk/arch/arm/include/asm/mach/sharpsl_param.h diff --git a/trunk/arch/arm/include/asm/mach/time.h b/trunk/arch/arm/include/asm/mach/time.h new file mode 100644 index 000000000000..b2cc1fcd0400 --- /dev/null +++ b/trunk/arch/arm/include/asm/mach/time.h @@ -0,0 +1,57 @@ +/* + * arch/arm/include/asm/mach/time.h + * + * Copyright (C) 2004 MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __ASM_ARM_MACH_TIME_H +#define __ASM_ARM_MACH_TIME_H + +#include + +/* + * This is our kernel timer structure. + * + * - init + * Initialise the kernels jiffy timer source, claim interrupt + * using setup_irq. This is called early on during initialisation + * while interrupts are still disabled on the local CPU. + * - suspend + * Suspend the kernel jiffy timer source, if necessary. This + * is called with interrupts disabled, after all normal devices + * have been suspended. If no action is required, set this to + * NULL. + * - resume + * Resume the kernel jiffy timer source, if necessary. This + * is called with interrupts disabled before any normal devices + * are resumed. If no action is required, set this to NULL. + * - offset + * Return the timer offset in microseconds since the last timer + * interrupt. Note: this must take account of any unprocessed + * timer interrupt which may be pending. + */ +struct sys_timer { + struct sys_device dev; + void (*init)(void); + void (*suspend)(void); + void (*resume)(void); +#ifndef CONFIG_GENERIC_TIME + unsigned long (*offset)(void); +#endif +}; + +extern struct sys_timer *system_timer; +extern void timer_tick(void); + +/* + * Kernel time keeping support. + */ +struct timespec; +extern int (*set_rtc)(void); +extern void save_time_delta(struct timespec *delta, struct timespec *rtc); +extern void restore_time_delta(struct timespec *delta, struct timespec *rtc); + +#endif diff --git a/trunk/include/asm-arm/mach/udc_pxa2xx.h b/trunk/arch/arm/include/asm/mach/udc_pxa2xx.h similarity index 95% rename from trunk/include/asm-arm/mach/udc_pxa2xx.h rename to trunk/arch/arm/include/asm/mach/udc_pxa2xx.h index 9e5ed7c0f27f..270902c353fd 100644 --- a/trunk/include/asm-arm/mach/udc_pxa2xx.h +++ b/trunk/arch/arm/include/asm/mach/udc_pxa2xx.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/mach/udc_pxa2xx.h + * arch/arm/include/asm/mach/udc_pxa2xx.h * * This supports machine-specific differences in how the PXA2xx * USB Device Controller (UDC) is wired. diff --git a/trunk/include/asm-arm/mc146818rtc.h b/trunk/arch/arm/include/asm/mc146818rtc.h similarity index 95% rename from trunk/include/asm-arm/mc146818rtc.h rename to trunk/arch/arm/include/asm/mc146818rtc.h index 7b81e0c42543..e1ca48a9e973 100644 --- a/trunk/include/asm-arm/mc146818rtc.h +++ b/trunk/arch/arm/include/asm/mc146818rtc.h @@ -4,7 +4,7 @@ #ifndef _ASM_MC146818RTC_H #define _ASM_MC146818RTC_H -#include +#include #include #ifndef RTC_PORT diff --git a/trunk/arch/arm/include/asm/memory.h b/trunk/arch/arm/include/asm/memory.h new file mode 100644 index 000000000000..1e070a2b561a --- /dev/null +++ b/trunk/arch/arm/include/asm/memory.h @@ -0,0 +1,334 @@ +/* + * arch/arm/include/asm/memory.h + * + * Copyright (C) 2000-2002 Russell King + * modification for nommu, Hyok S. Choi, 2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Note: this file should not be included by non-asm/.h files + */ +#ifndef __ASM_ARM_MEMORY_H +#define __ASM_ARM_MEMORY_H + +/* + * Allow for constants defined here to be used from assembly code + * by prepending the UL suffix only with actual C code compilation. + */ +#ifndef __ASSEMBLY__ +#define UL(x) (x##UL) +#else +#define UL(x) (x) +#endif + +#include +#include +#include + +#ifdef CONFIG_MMU + +#ifndef TASK_SIZE +/* + * TASK_SIZE - the maximum size of a user space task. + * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area + */ +#define TASK_SIZE UL(0xbf000000) +#define TASK_UNMAPPED_BASE UL(0x40000000) +#endif + +/* + * The maximum size of a 26-bit user space task. + */ +#define TASK_SIZE_26 UL(0x04000000) + +/* + * Page offset: 3GB + */ +#ifndef PAGE_OFFSET +#define PAGE_OFFSET UL(0xc0000000) +#endif + +/* + * The module space lives between the addresses given by TASK_SIZE + * and PAGE_OFFSET - it must be within 32MB of the kernel text. + */ +#define MODULE_END (PAGE_OFFSET) +#define MODULE_START (MODULE_END - 16*1048576) + +#if TASK_SIZE > MODULE_START +#error Top of user space clashes with start of module space +#endif + +/* + * The XIP kernel gets mapped at the bottom of the module vm area. + * Since we use sections to map it, this macro replaces the physical address + * with its virtual address while keeping offset from the base section. + */ +#define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) + +/* + * Allow 16MB-aligned ioremap pages + */ +#define IOREMAP_MAX_ORDER 24 + +#else /* CONFIG_MMU */ + +/* + * The limitation of user task size can grow up to the end of free ram region. + * It is difficult to define and perhaps will never meet the original meaning + * of this define that was meant to. + * Fortunately, there is no reference for this in noMMU mode, for now. + */ +#ifndef TASK_SIZE +#define TASK_SIZE (CONFIG_DRAM_SIZE) +#endif + +#ifndef TASK_UNMAPPED_BASE +#define TASK_UNMAPPED_BASE UL(0x00000000) +#endif + +#ifndef PHYS_OFFSET +#define PHYS_OFFSET (CONFIG_DRAM_BASE) +#endif + +#ifndef END_MEM +#define END_MEM (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE) +#endif + +#ifndef PAGE_OFFSET +#define PAGE_OFFSET (PHYS_OFFSET) +#endif + +/* + * The module can be at any place in ram in nommu mode. + */ +#define MODULE_END (END_MEM) +#define MODULE_START (PHYS_OFFSET) + +#endif /* !CONFIG_MMU */ + +/* + * Size of DMA-consistent memory region. Must be multiple of 2M, + * between 2MB and 14MB inclusive. + */ +#ifndef CONSISTENT_DMA_SIZE +#define CONSISTENT_DMA_SIZE SZ_2M +#endif + +/* + * Physical vs virtual RAM address space conversion. These are + * private definitions which should NOT be used outside memory.h + * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. + */ +#ifndef __virt_to_phys +#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) +#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) +#endif + +/* + * Convert a physical address to a Page Frame Number and back + */ +#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) +#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) + +#ifndef __ASSEMBLY__ + +/* + * The DMA mask corresponding to the maximum bus address allocatable + * using GFP_DMA. The default here places no restriction on DMA + * allocations. This must be the smallest DMA mask in the system, + * so a successful GFP_DMA allocation will always satisfy this. + */ +#ifndef ISA_DMA_THRESHOLD +#define ISA_DMA_THRESHOLD (0xffffffffULL) +#endif + +#ifndef arch_adjust_zones +#define arch_adjust_zones(node,size,holes) do { } while (0) +#endif + +/* + * PFNs are used to describe any physical page; this means + * PFN 0 == physical address 0. + * + * This is the PFN of the first RAM page in the kernel + * direct-mapped view. We assume this is the first page + * of RAM in the mem_map as well. + */ +#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT) + +/* + * These are *only* valid on the kernel direct mapped RAM memory. + * Note: Drivers should NOT use these. They are the wrong + * translation for translating DMA addresses. Use the driver + * DMA support - see dma-mapping.h. + */ +static inline unsigned long virt_to_phys(void *x) +{ + return __virt_to_phys((unsigned long)(x)); +} + +static inline void *phys_to_virt(unsigned long x) +{ + return (void *)(__phys_to_virt((unsigned long)(x))); +} + +/* + * Drivers should NOT use these either. + */ +#define __pa(x) __virt_to_phys((unsigned long)(x)) +#define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) +#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) + +/* + * Virtual <-> DMA view memory address translations + * Again, these are *only* valid on the kernel direct mapped RAM + * memory. Use of these is *deprecated* (and that doesn't mean + * use the __ prefixed forms instead.) See dma-mapping.h. + */ +static inline __deprecated unsigned long virt_to_bus(void *x) +{ + return __virt_to_bus((unsigned long)x); +} + +static inline __deprecated void *bus_to_virt(unsigned long x) +{ + return (void *)__bus_to_virt(x); +} + +/* + * Conversion between a struct page and a physical address. + * + * Note: when converting an unknown physical address to a + * struct page, the resulting pointer must be validated + * using VALID_PAGE(). It must return an invalid struct page + * for any physical address not corresponding to a system + * RAM address. + * + * page_to_pfn(page) convert a struct page * to a PFN number + * pfn_to_page(pfn) convert a _valid_ PFN number to struct page * + * pfn_valid(pfn) indicates whether a PFN number is valid + * + * virt_to_page(k) convert a _valid_ virtual address to struct page * + * virt_addr_valid(k) indicates whether a virtual address is valid + */ +#ifndef CONFIG_DISCONTIGMEM + +#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET + +#ifndef CONFIG_SPARSEMEM +#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) +#endif + +#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) +#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) + +#define PHYS_TO_NID(addr) (0) + +#else /* CONFIG_DISCONTIGMEM */ + +/* + * This is more complex. We have a set of mem_map arrays spread + * around in memory. + */ +#include + +#define arch_pfn_to_nid(pfn) PFN_TO_NID(pfn) +#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT) + +#define pfn_valid(pfn) \ + ({ \ + unsigned int nid = PFN_TO_NID(pfn); \ + int valid = nid < MAX_NUMNODES; \ + if (valid) { \ + pg_data_t *node = NODE_DATA(nid); \ + valid = (pfn - node->node_start_pfn) < \ + node->node_spanned_pages; \ + } \ + valid; \ + }) + +#define virt_to_page(kaddr) \ + (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr)) + +#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES) + +/* + * Common discontigmem stuff. + * PHYS_TO_NID is used by the ARM kernel/setup.c + */ +#define PHYS_TO_NID(addr) PFN_TO_NID((addr) >> PAGE_SHIFT) + +/* + * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory + * and returns the mem_map of that node. + */ +#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr)) + +/* + * Given a page frame number, find the owning node of the memory + * and returns the mem_map of that node. + */ +#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn)) + +#ifdef NODE_MEM_SIZE_BITS +#define NODE_MEM_SIZE_MASK ((1 << NODE_MEM_SIZE_BITS) - 1) + +/* + * Given a kernel address, find the home node of the underlying memory. + */ +#define KVADDR_TO_NID(addr) \ + (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MEM_SIZE_BITS) + +/* + * Given a page frame number, convert it to a node id. + */ +#define PFN_TO_NID(pfn) \ + (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MEM_SIZE_BITS - PAGE_SHIFT)) + +/* + * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory + * and returns the index corresponding to the appropriate page in the + * node's mem_map. + */ +#define LOCAL_MAP_NR(addr) \ + (((unsigned long)(addr) & NODE_MEM_SIZE_MASK) >> PAGE_SHIFT) + +#endif /* NODE_MEM_SIZE_BITS */ + +#endif /* !CONFIG_DISCONTIGMEM */ + +/* + * For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die. + */ +#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) + +/* + * Optional device DMA address remapping. Do _not_ use directly! + * We should really eliminate virt_to_bus() here - it's deprecated. + */ +#ifndef __arch_page_to_dma +#define page_to_dma(dev, page) ((dma_addr_t)__virt_to_bus((unsigned long)page_address(page))) +#define dma_to_virt(dev, addr) ((void *)__bus_to_virt(addr)) +#define virt_to_dma(dev, addr) ((dma_addr_t)__virt_to_bus((unsigned long)(addr))) +#else +#define page_to_dma(dev, page) (__arch_page_to_dma(dev, page)) +#define dma_to_virt(dev, addr) (__arch_dma_to_virt(dev, addr)) +#define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr)) +#endif + +/* + * Optional coherency support. Currently used only by selected + * Intel XSC3-based systems. + */ +#ifndef arch_is_coherent +#define arch_is_coherent() 0 +#endif + +#endif + +#include + +#endif diff --git a/trunk/include/asm-arm/mman.h b/trunk/arch/arm/include/asm/mman.h similarity index 100% rename from trunk/include/asm-arm/mman.h rename to trunk/arch/arm/include/asm/mman.h diff --git a/trunk/include/asm-arm/mmu.h b/trunk/arch/arm/include/asm/mmu.h similarity index 100% rename from trunk/include/asm-arm/mmu.h rename to trunk/arch/arm/include/asm/mmu.h diff --git a/trunk/include/asm-arm/mmu_context.h b/trunk/arch/arm/include/asm/mmu_context.h similarity index 98% rename from trunk/include/asm-arm/mmu_context.h rename to trunk/arch/arm/include/asm/mmu_context.h index 91b9dfdfed52..a301e446007f 100644 --- a/trunk/include/asm-arm/mmu_context.h +++ b/trunk/arch/arm/include/asm/mmu_context.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/mmu_context.h + * arch/arm/include/asm/mmu_context.h * * Copyright (C) 1996 Russell King. * diff --git a/trunk/include/asm-arm/mmzone.h b/trunk/arch/arm/include/asm/mmzone.h similarity index 90% rename from trunk/include/asm-arm/mmzone.h rename to trunk/arch/arm/include/asm/mmzone.h index b87de151f0a4..ae63a4fd28c8 100644 --- a/trunk/include/asm-arm/mmzone.h +++ b/trunk/arch/arm/include/asm/mmzone.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/mmzone.h + * arch/arm/include/asm/mmzone.h * * 1999-12-29 Nicolas Pitre Created * @@ -25,6 +25,6 @@ extern pg_data_t discontig_node_data[]; */ #define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map) -#include +#include #endif diff --git a/trunk/include/asm-arm/module.h b/trunk/arch/arm/include/asm/module.h similarity index 100% rename from trunk/include/asm-arm/module.h rename to trunk/arch/arm/include/asm/module.h diff --git a/trunk/include/asm-arm/msgbuf.h b/trunk/arch/arm/include/asm/msgbuf.h similarity index 100% rename from trunk/include/asm-arm/msgbuf.h rename to trunk/arch/arm/include/asm/msgbuf.h diff --git a/trunk/arch/arm/include/asm/mtd-xip.h b/trunk/arch/arm/include/asm/mtd-xip.h new file mode 100644 index 000000000000..4225372a26f3 --- /dev/null +++ b/trunk/arch/arm/include/asm/mtd-xip.h @@ -0,0 +1,26 @@ +/* + * MTD primitives for XIP support. Architecture specific functions + * + * Do not include this file directly. It's included from linux/mtd/xip.h + * + * Author: Nicolas Pitre + * Created: Nov 2, 2004 + * Copyright: (C) 2004 MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $ + */ + +#ifndef __ARM_MTD_XIP_H__ +#define __ARM_MTD_XIP_H__ + +#include +#include + +/* fill instruction prefetch */ +#define xip_iprefetch() do { asm volatile (".rep 8; nop; .endr"); } while (0) + +#endif /* __ARM_MTD_XIP_H__ */ diff --git a/trunk/include/asm-arm/mutex.h b/trunk/arch/arm/include/asm/mutex.h similarity index 98% rename from trunk/include/asm-arm/mutex.h rename to trunk/arch/arm/include/asm/mutex.h index 020bd98710a1..93226cf23ae0 100644 --- a/trunk/include/asm-arm/mutex.h +++ b/trunk/arch/arm/include/asm/mutex.h @@ -1,5 +1,5 @@ /* - * include/asm-arm/mutex.h + * arch/arm/include/asm/mutex.h * * ARM optimized mutex locking primitives * diff --git a/trunk/include/asm-arm/nwflash.h b/trunk/arch/arm/include/asm/nwflash.h similarity index 100% rename from trunk/include/asm-arm/nwflash.h rename to trunk/arch/arm/include/asm/nwflash.h diff --git a/trunk/include/asm-arm/page-nommu.h b/trunk/arch/arm/include/asm/page-nommu.h similarity index 96% rename from trunk/include/asm-arm/page-nommu.h rename to trunk/arch/arm/include/asm/page-nommu.h index ea1cde84f500..3574c0deb37f 100644 --- a/trunk/include/asm-arm/page-nommu.h +++ b/trunk/arch/arm/include/asm/page-nommu.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/page-nommu.h + * arch/arm/include/asm/page-nommu.h * * Copyright (C) 2004 Hyok S. Choi * diff --git a/trunk/include/asm-arm/page.h b/trunk/arch/arm/include/asm/page.h similarity index 99% rename from trunk/include/asm-arm/page.h rename to trunk/arch/arm/include/asm/page.h index 7c5fc5582e5d..cf2e2680daaa 100644 --- a/trunk/include/asm-arm/page.h +++ b/trunk/arch/arm/include/asm/page.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/page.h + * arch/arm/include/asm/page.h * * Copyright (C) 1995-2003 Russell King * diff --git a/trunk/arch/arm/include/asm/param.h b/trunk/arch/arm/include/asm/param.h new file mode 100644 index 000000000000..8b24bf94c06b --- /dev/null +++ b/trunk/arch/arm/include/asm/param.h @@ -0,0 +1,31 @@ +/* + * arch/arm/include/asm/param.h + * + * Copyright (C) 1995-1999 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __ASM_PARAM_H +#define __ASM_PARAM_H + +#ifdef __KERNEL__ +# define HZ CONFIG_HZ /* Internal kernel timer frequency */ +# define USER_HZ 100 /* User interfaces are in "ticks" */ +# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ +#else +# define HZ 100 +#endif + +#define EXEC_PAGESIZE 4096 + +#ifndef NOGROUP +#define NOGROUP (-1) +#endif + +/* max length of hostname */ +#define MAXHOSTNAMELEN 64 + +#endif + diff --git a/trunk/include/asm-arm/parport.h b/trunk/arch/arm/include/asm/parport.h similarity index 86% rename from trunk/include/asm-arm/parport.h rename to trunk/arch/arm/include/asm/parport.h index f2f90c76ddd1..26e94b09035a 100644 --- a/trunk/include/asm-arm/parport.h +++ b/trunk/arch/arm/include/asm/parport.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/parport.h: ARM-specific parport initialisation + * arch/arm/include/asm/parport.h: ARM-specific parport initialisation * * Copyright (C) 1999, 2000 Tim Waugh * diff --git a/trunk/arch/arm/include/asm/pci.h b/trunk/arch/arm/include/asm/pci.h new file mode 100644 index 000000000000..721c03d53f4b --- /dev/null +++ b/trunk/arch/arm/include/asm/pci.h @@ -0,0 +1,91 @@ +#ifndef ASMARM_PCI_H +#define ASMARM_PCI_H + +#ifdef __KERNEL__ +#include + +#include /* for PCIBIOS_MIN_* */ + +#define pcibios_scan_all_fns(a, b) 0 + +#ifdef CONFIG_PCI_HOST_ITE8152 +/* ITE bridge requires setting latency timer to avoid early bus access + termination by PIC bus mater devices +*/ +extern void pcibios_set_master(struct pci_dev *dev); +#else +static inline void pcibios_set_master(struct pci_dev *dev) +{ + /* No special bus mastering setup handling */ +} +#endif + +static inline void pcibios_penalize_isa_irq(int irq, int active) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + +/* + * The PCI address space does equal the physical memory address space. + * The networking and block device layers use this boolean for bounce + * buffer decisions. + */ +#define PCI_DMA_BUS_IS_PHYS (0) + +/* + * Whether pci_unmap_{single,page} is a nop depends upon the + * configuration. + */ +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME; +#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME; +#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME) +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL)) +#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME) +#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL)) + +#ifdef CONFIG_PCI +static inline void pci_dma_burst_advice(struct pci_dev *pdev, + enum pci_dma_burst_strategy *strat, + unsigned long *strategy_parameter) +{ + *strat = PCI_DMA_BURST_INFINITY; + *strategy_parameter = ~0UL; +} +#endif + +#define HAVE_PCI_MMAP +extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, + enum pci_mmap_state mmap_state, int write_combine); + +extern void +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res); + +extern void +pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, + struct pci_bus_region *region); + +static inline struct resource * +pcibios_select_root(struct pci_dev *pdev, struct resource *res) +{ + struct resource *root = NULL; + + if (res->flags & IORESOURCE_IO) + root = &ioport_resource; + if (res->flags & IORESOURCE_MEM) + root = &iomem_resource; + + return root; +} + +/* + * Dummy implementation; always return 0. + */ +static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) +{ + return 0; +} + +#endif /* __KERNEL__ */ + +#endif diff --git a/trunk/include/asm-arm/percpu.h b/trunk/arch/arm/include/asm/percpu.h similarity index 100% rename from trunk/include/asm-arm/percpu.h rename to trunk/arch/arm/include/asm/percpu.h diff --git a/trunk/include/asm-arm/pgalloc.h b/trunk/arch/arm/include/asm/pgalloc.h similarity index 98% rename from trunk/include/asm-arm/pgalloc.h rename to trunk/arch/arm/include/asm/pgalloc.h index 163b0305dd76..3dcd64bf1824 100644 --- a/trunk/include/asm-arm/pgalloc.h +++ b/trunk/arch/arm/include/asm/pgalloc.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/pgalloc.h + * arch/arm/include/asm/pgalloc.h * * Copyright (C) 2000-2001 Russell King * diff --git a/trunk/include/asm-arm/pgtable-hwdef.h b/trunk/arch/arm/include/asm/pgtable-hwdef.h similarity index 98% rename from trunk/include/asm-arm/pgtable-hwdef.h rename to trunk/arch/arm/include/asm/pgtable-hwdef.h index f3b5120c99fe..fd1521d5cb9d 100644 --- a/trunk/include/asm-arm/pgtable-hwdef.h +++ b/trunk/arch/arm/include/asm/pgtable-hwdef.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/pgtable-hwdef.h + * arch/arm/include/asm/pgtable-hwdef.h * * Copyright (C) 1995-2002 Russell King * diff --git a/trunk/include/asm-arm/pgtable-nommu.h b/trunk/arch/arm/include/asm/pgtable-nommu.h similarity index 98% rename from trunk/include/asm-arm/pgtable-nommu.h rename to trunk/arch/arm/include/asm/pgtable-nommu.h index 386fcc10a973..b011f2e939aa 100644 --- a/trunk/include/asm-arm/pgtable-nommu.h +++ b/trunk/arch/arm/include/asm/pgtable-nommu.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/pgtable-nommu.h + * arch/arm/include/asm/pgtable-nommu.h * * Copyright (C) 1995-2002 Russell King * Copyright (C) 2004 Hyok S. Choi diff --git a/trunk/include/asm-arm/pgtable.h b/trunk/arch/arm/include/asm/pgtable.h similarity index 99% rename from trunk/include/asm-arm/pgtable.h rename to trunk/arch/arm/include/asm/pgtable.h index 5571c13c3f3b..8e21ef15bd74 100644 --- a/trunk/include/asm-arm/pgtable.h +++ b/trunk/arch/arm/include/asm/pgtable.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/pgtable.h + * arch/arm/include/asm/pgtable.h * * Copyright (C) 1995-2002 Russell King * @@ -20,7 +20,7 @@ #else #include -#include +#include #include /* diff --git a/trunk/include/asm-arm/poll.h b/trunk/arch/arm/include/asm/poll.h similarity index 100% rename from trunk/include/asm-arm/poll.h rename to trunk/arch/arm/include/asm/poll.h diff --git a/trunk/include/asm-arm/posix_types.h b/trunk/arch/arm/include/asm/posix_types.h similarity index 98% rename from trunk/include/asm-arm/posix_types.h rename to trunk/arch/arm/include/asm/posix_types.h index c37379dadcb2..2446d23bfdbf 100644 --- a/trunk/include/asm-arm/posix_types.h +++ b/trunk/arch/arm/include/asm/posix_types.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/posix_types.h + * arch/arm/include/asm/posix_types.h * * Copyright (C) 1996-1998 Russell King. * diff --git a/trunk/include/asm-arm/proc-fns.h b/trunk/arch/arm/include/asm/proc-fns.h similarity index 99% rename from trunk/include/asm-arm/proc-fns.h rename to trunk/arch/arm/include/asm/proc-fns.h index 75ec760f4c74..db80203b68e0 100644 --- a/trunk/include/asm-arm/proc-fns.h +++ b/trunk/arch/arm/include/asm/proc-fns.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/proc-fns.h + * arch/arm/include/asm/proc-fns.h * * Copyright (C) 1997-1999 Russell King * Copyright (C) 2000 Deep Blue Solutions Ltd diff --git a/trunk/arch/arm/include/asm/processor.h b/trunk/arch/arm/include/asm/processor.h new file mode 100644 index 000000000000..b01d5e7e3d5a --- /dev/null +++ b/trunk/arch/arm/include/asm/processor.h @@ -0,0 +1,131 @@ +/* + * arch/arm/include/asm/processor.h + * + * Copyright (C) 1995-1999 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARM_PROCESSOR_H +#define __ASM_ARM_PROCESSOR_H + +/* + * Default implementation of macro that returns current + * instruction pointer ("program counter"). + */ +#define current_text_addr() ({ __label__ _l; _l: &&_l;}) + +#ifdef __KERNEL__ + +#include +#include + +#ifdef __KERNEL__ +#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \ + TASK_SIZE : TASK_SIZE_26) +#define STACK_TOP_MAX TASK_SIZE +#endif + +union debug_insn { + u32 arm; + u16 thumb; +}; + +struct debug_entry { + u32 address; + union debug_insn insn; +}; + +struct debug_info { + int nsaved; + struct debug_entry bp[2]; +}; + +struct thread_struct { + /* fault info */ + unsigned long address; + unsigned long trap_no; + unsigned long error_code; + /* debugging */ + struct debug_info debug; +}; + +#define INIT_THREAD { } + +#ifdef CONFIG_MMU +#define nommu_start_thread(regs) do { } while (0) +#else +#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data +#endif + +#define start_thread(regs,pc,sp) \ +({ \ + unsigned long *stack = (unsigned long *)sp; \ + set_fs(USER_DS); \ + memzero(regs->uregs, sizeof(regs->uregs)); \ + if (current->personality & ADDR_LIMIT_32BIT) \ + regs->ARM_cpsr = USR_MODE; \ + else \ + regs->ARM_cpsr = USR26_MODE; \ + if (elf_hwcap & HWCAP_THUMB && pc & 1) \ + regs->ARM_cpsr |= PSR_T_BIT; \ + regs->ARM_pc = pc & ~1; /* pc */ \ + regs->ARM_sp = sp; /* sp */ \ + regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ + regs->ARM_r1 = stack[1]; /* r1 (argv) */ \ + regs->ARM_r0 = stack[0]; /* r0 (argc) */ \ + nommu_start_thread(regs); \ +}) + +/* Forward declaration, a strange C thing */ +struct task_struct; + +/* Free all resources held by a thread. */ +extern void release_thread(struct task_struct *); + +/* Prepare to copy thread state - unlazy all lazy status */ +#define prepare_to_copy(tsk) do { } while (0) + +unsigned long get_wchan(struct task_struct *p); + +#define cpu_relax() barrier() + +/* + * Create a new kernel thread + */ +extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); + +#define task_pt_regs(p) \ + ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) + +#define KSTK_EIP(tsk) task_pt_regs(tsk)->ARM_pc +#define KSTK_ESP(tsk) task_pt_regs(tsk)->ARM_sp + +/* + * Prefetching support - only ARMv5. + */ +#if __LINUX_ARM_ARCH__ >= 5 + +#define ARCH_HAS_PREFETCH +static inline void prefetch(const void *ptr) +{ + __asm__ __volatile__( + "pld\t%0" + : + : "o" (*(char *)ptr) + : "cc"); +} + +#define ARCH_HAS_PREFETCHW +#define prefetchw(ptr) prefetch(ptr) + +#define ARCH_HAS_SPINLOCK_PREFETCH +#define spin_lock_prefetch(x) do { } while (0) + +#endif + +#endif + +#endif /* __ASM_ARM_PROCESSOR_H */ diff --git a/trunk/include/asm-arm/procinfo.h b/trunk/arch/arm/include/asm/procinfo.h similarity index 97% rename from trunk/include/asm-arm/procinfo.h rename to trunk/arch/arm/include/asm/procinfo.h index 4d3c685075e0..ca52e584ef74 100644 --- a/trunk/include/asm-arm/procinfo.h +++ b/trunk/arch/arm/include/asm/procinfo.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/procinfo.h + * arch/arm/include/asm/procinfo.h * * Copyright (C) 1996-1999 Russell King * diff --git a/trunk/include/asm-arm/ptrace.h b/trunk/arch/arm/include/asm/ptrace.h similarity index 99% rename from trunk/include/asm-arm/ptrace.h rename to trunk/arch/arm/include/asm/ptrace.h index 8382b7510f94..b415c0e85458 100644 --- a/trunk/include/asm-arm/ptrace.h +++ b/trunk/arch/arm/include/asm/ptrace.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/ptrace.h + * arch/arm/include/asm/ptrace.h * * Copyright (C) 1996-2003 Russell King * diff --git a/trunk/include/asm-arm/resource.h b/trunk/arch/arm/include/asm/resource.h similarity index 100% rename from trunk/include/asm-arm/resource.h rename to trunk/arch/arm/include/asm/resource.h diff --git a/trunk/include/asm-arm/scatterlist.h b/trunk/arch/arm/include/asm/scatterlist.h similarity index 100% rename from trunk/include/asm-arm/scatterlist.h rename to trunk/arch/arm/include/asm/scatterlist.h diff --git a/trunk/include/asm-arm/sections.h b/trunk/arch/arm/include/asm/sections.h similarity index 100% rename from trunk/include/asm-arm/sections.h rename to trunk/arch/arm/include/asm/sections.h diff --git a/trunk/include/asm-arm/segment.h b/trunk/arch/arm/include/asm/segment.h similarity index 100% rename from trunk/include/asm-arm/segment.h rename to trunk/arch/arm/include/asm/segment.h diff --git a/trunk/include/asm-arm/sembuf.h b/trunk/arch/arm/include/asm/sembuf.h similarity index 100% rename from trunk/include/asm-arm/sembuf.h rename to trunk/arch/arm/include/asm/sembuf.h diff --git a/trunk/arch/arm/include/asm/serial.h b/trunk/arch/arm/include/asm/serial.h new file mode 100644 index 000000000000..ebb049091e26 --- /dev/null +++ b/trunk/arch/arm/include/asm/serial.h @@ -0,0 +1,19 @@ +/* + * arch/arm/include/asm/serial.h + * + * Copyright (C) 1996 Russell King. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Changelog: + * 15-10-1996 RMK Created + */ + +#ifndef __ASM_SERIAL_H +#define __ASM_SERIAL_H + +#define BASE_BAUD (1843200 / 16) + +#endif diff --git a/trunk/include/asm-arm/setup.h b/trunk/arch/arm/include/asm/setup.h similarity index 100% rename from trunk/include/asm-arm/setup.h rename to trunk/arch/arm/include/asm/setup.h diff --git a/trunk/include/asm-arm/shmbuf.h b/trunk/arch/arm/include/asm/shmbuf.h similarity index 100% rename from trunk/include/asm-arm/shmbuf.h rename to trunk/arch/arm/include/asm/shmbuf.h diff --git a/trunk/include/asm-arm/shmparam.h b/trunk/arch/arm/include/asm/shmparam.h similarity index 100% rename from trunk/include/asm-arm/shmparam.h rename to trunk/arch/arm/include/asm/shmparam.h diff --git a/trunk/include/asm-arm/sigcontext.h b/trunk/arch/arm/include/asm/sigcontext.h similarity index 100% rename from trunk/include/asm-arm/sigcontext.h rename to trunk/arch/arm/include/asm/sigcontext.h diff --git a/trunk/include/asm-arm/siginfo.h b/trunk/arch/arm/include/asm/siginfo.h similarity index 100% rename from trunk/include/asm-arm/siginfo.h rename to trunk/arch/arm/include/asm/siginfo.h diff --git a/trunk/include/asm-arm/signal.h b/trunk/arch/arm/include/asm/signal.h similarity index 100% rename from trunk/include/asm-arm/signal.h rename to trunk/arch/arm/include/asm/signal.h diff --git a/trunk/include/asm-arm/sizes.h b/trunk/arch/arm/include/asm/sizes.h similarity index 100% rename from trunk/include/asm-arm/sizes.h rename to trunk/arch/arm/include/asm/sizes.h diff --git a/trunk/include/asm-arm/smp.h b/trunk/arch/arm/include/asm/smp.h similarity index 96% rename from trunk/include/asm-arm/smp.h rename to trunk/arch/arm/include/asm/smp.h index 7fffa2404b8e..727b5c042e52 100644 --- a/trunk/include/asm-arm/smp.h +++ b/trunk/arch/arm/include/asm/smp.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/smp.h + * arch/arm/include/asm/smp.h * * Copyright (C) 2004-2005 ARM Ltd. * @@ -14,10 +14,10 @@ #include #include -#include +#include #ifndef CONFIG_SMP -# error " included in non-SMP build" +# error " included in non-SMP build" #endif #define raw_smp_processor_id() (current_thread_info()->cpu) diff --git a/trunk/include/asm-arm/socket.h b/trunk/arch/arm/include/asm/socket.h similarity index 100% rename from trunk/include/asm-arm/socket.h rename to trunk/arch/arm/include/asm/socket.h diff --git a/trunk/include/asm-arm/sockios.h b/trunk/arch/arm/include/asm/sockios.h similarity index 100% rename from trunk/include/asm-arm/sockios.h rename to trunk/arch/arm/include/asm/sockios.h diff --git a/trunk/include/asm-arm/sparsemem.h b/trunk/arch/arm/include/asm/sparsemem.h similarity index 100% rename from trunk/include/asm-arm/sparsemem.h rename to trunk/arch/arm/include/asm/sparsemem.h diff --git a/trunk/include/asm-arm/spinlock.h b/trunk/arch/arm/include/asm/spinlock.h similarity index 100% rename from trunk/include/asm-arm/spinlock.h rename to trunk/arch/arm/include/asm/spinlock.h diff --git a/trunk/include/asm-arm/spinlock_types.h b/trunk/arch/arm/include/asm/spinlock_types.h similarity index 100% rename from trunk/include/asm-arm/spinlock_types.h rename to trunk/arch/arm/include/asm/spinlock_types.h diff --git a/trunk/include/asm-arm/stat.h b/trunk/arch/arm/include/asm/stat.h similarity index 100% rename from trunk/include/asm-arm/stat.h rename to trunk/arch/arm/include/asm/stat.h diff --git a/trunk/include/asm-arm/statfs.h b/trunk/arch/arm/include/asm/statfs.h similarity index 100% rename from trunk/include/asm-arm/statfs.h rename to trunk/arch/arm/include/asm/statfs.h diff --git a/trunk/include/asm-arm/string.h b/trunk/arch/arm/include/asm/string.h similarity index 100% rename from trunk/include/asm-arm/string.h rename to trunk/arch/arm/include/asm/string.h diff --git a/trunk/include/asm-arm/suspend.h b/trunk/arch/arm/include/asm/suspend.h similarity index 100% rename from trunk/include/asm-arm/suspend.h rename to trunk/arch/arm/include/asm/suspend.h diff --git a/trunk/include/asm-arm/system.h b/trunk/arch/arm/include/asm/system.h similarity index 100% rename from trunk/include/asm-arm/system.h rename to trunk/arch/arm/include/asm/system.h diff --git a/trunk/include/asm-arm/termbits.h b/trunk/arch/arm/include/asm/termbits.h similarity index 100% rename from trunk/include/asm-arm/termbits.h rename to trunk/arch/arm/include/asm/termbits.h diff --git a/trunk/include/asm-arm/termios.h b/trunk/arch/arm/include/asm/termios.h similarity index 100% rename from trunk/include/asm-arm/termios.h rename to trunk/arch/arm/include/asm/termios.h diff --git a/trunk/include/asm-arm/therm.h b/trunk/arch/arm/include/asm/therm.h similarity index 88% rename from trunk/include/asm-arm/therm.h rename to trunk/arch/arm/include/asm/therm.h index e51c923ecdf3..f002f0197d78 100644 --- a/trunk/include/asm-arm/therm.h +++ b/trunk/arch/arm/include/asm/therm.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/therm.h: Definitions for Dallas Semiconductor + * arch/arm/include/asm/therm.h: Definitions for Dallas Semiconductor * DS1620 thermometer driver (as used in the Rebel.com NetWinder) */ #ifndef __ASM_THERM_H diff --git a/trunk/include/asm-arm/thread_info.h b/trunk/arch/arm/include/asm/thread_info.h similarity index 97% rename from trunk/include/asm-arm/thread_info.h rename to trunk/arch/arm/include/asm/thread_info.h index d4be2d646160..e56fa48e4ae7 100644 --- a/trunk/include/asm-arm/thread_info.h +++ b/trunk/arch/arm/include/asm/thread_info.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/thread_info.h + * arch/arm/include/asm/thread_info.h * * Copyright (C) 2002 Russell King. * @@ -117,7 +117,7 @@ extern void iwmmxt_task_switch(struct thread_info *); /* * We use bit 30 of the preempt_count to indicate that kernel - * preemption is occurring. See include/asm-arm/hardirq.h. + * preemption is occurring. See . */ #define PREEMPT_ACTIVE 0x40000000 diff --git a/trunk/include/asm-arm/thread_notify.h b/trunk/arch/arm/include/asm/thread_notify.h similarity index 96% rename from trunk/include/asm-arm/thread_notify.h rename to trunk/arch/arm/include/asm/thread_notify.h index 8866e5216840..f27379d7f72a 100644 --- a/trunk/include/asm-arm/thread_notify.h +++ b/trunk/arch/arm/include/asm/thread_notify.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/thread_notify.h + * arch/arm/include/asm/thread_notify.h * * Copyright (C) 2006 Russell King. * diff --git a/trunk/arch/arm/include/asm/timex.h b/trunk/arch/arm/include/asm/timex.h new file mode 100644 index 000000000000..3be8de3adaba --- /dev/null +++ b/trunk/arch/arm/include/asm/timex.h @@ -0,0 +1,24 @@ +/* + * arch/arm/include/asm/timex.h + * + * Copyright (C) 1997,1998 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Architecture Specific TIME specifications + */ +#ifndef _ASMARM_TIMEX_H +#define _ASMARM_TIMEX_H + +#include + +typedef unsigned long cycles_t; + +static inline cycles_t get_cycles (void) +{ + return 0; +} + +#endif diff --git a/trunk/include/asm-arm/tlb.h b/trunk/arch/arm/include/asm/tlb.h similarity index 98% rename from trunk/include/asm-arm/tlb.h rename to trunk/arch/arm/include/asm/tlb.h index 36bd402a21cb..857f1dfac794 100644 --- a/trunk/include/asm-arm/tlb.h +++ b/trunk/arch/arm/include/asm/tlb.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/tlb.h + * arch/arm/include/asm/tlb.h * * Copyright (C) 2002 Russell King * diff --git a/trunk/include/asm-arm/tlbflush.h b/trunk/arch/arm/include/asm/tlbflush.h similarity index 99% rename from trunk/include/asm-arm/tlbflush.h rename to trunk/arch/arm/include/asm/tlbflush.h index 909656c747ef..0d0d40f1b599 100644 --- a/trunk/include/asm-arm/tlbflush.h +++ b/trunk/arch/arm/include/asm/tlbflush.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/tlbflush.h + * arch/arm/include/asm/tlbflush.h * * Copyright (C) 1999-2003 Russell King * diff --git a/trunk/include/asm-arm/topology.h b/trunk/arch/arm/include/asm/topology.h similarity index 100% rename from trunk/include/asm-arm/topology.h rename to trunk/arch/arm/include/asm/topology.h diff --git a/trunk/include/asm-arm/traps.h b/trunk/arch/arm/include/asm/traps.h similarity index 100% rename from trunk/include/asm-arm/traps.h rename to trunk/arch/arm/include/asm/traps.h diff --git a/trunk/include/asm-arm/types.h b/trunk/arch/arm/include/asm/types.h similarity index 100% rename from trunk/include/asm-arm/types.h rename to trunk/arch/arm/include/asm/types.h diff --git a/trunk/include/asm-arm/uaccess.h b/trunk/arch/arm/include/asm/uaccess.h similarity index 99% rename from trunk/include/asm-arm/uaccess.h rename to trunk/arch/arm/include/asm/uaccess.h index 4c1a3fa9f259..d0f51ff900b5 100644 --- a/trunk/include/asm-arm/uaccess.h +++ b/trunk/arch/arm/include/asm/uaccess.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/uaccess.h + * arch/arm/include/asm/uaccess.h * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/trunk/include/asm-arm/ucontext.h b/trunk/arch/arm/include/asm/ucontext.h similarity index 100% rename from trunk/include/asm-arm/ucontext.h rename to trunk/arch/arm/include/asm/ucontext.h diff --git a/trunk/include/asm-arm/unaligned.h b/trunk/arch/arm/include/asm/unaligned.h similarity index 100% rename from trunk/include/asm-arm/unaligned.h rename to trunk/arch/arm/include/asm/unaligned.h diff --git a/trunk/include/asm-arm/unistd.h b/trunk/arch/arm/include/asm/unistd.h similarity index 99% rename from trunk/include/asm-arm/unistd.h rename to trunk/arch/arm/include/asm/unistd.h index 7c570082b1e0..f95fbb2fcb5f 100644 --- a/trunk/include/asm-arm/unistd.h +++ b/trunk/arch/arm/include/asm/unistd.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/unistd.h + * arch/arm/include/asm/unistd.h * * Copyright (C) 2001-2005 Russell King * diff --git a/trunk/include/asm-arm/user.h b/trunk/arch/arm/include/asm/user.h similarity index 100% rename from trunk/include/asm-arm/user.h rename to trunk/arch/arm/include/asm/user.h diff --git a/trunk/include/asm-arm/vfp.h b/trunk/arch/arm/include/asm/vfp.h similarity index 98% rename from trunk/include/asm-arm/vfp.h rename to trunk/arch/arm/include/asm/vfp.h index 5f9a2cb3d452..f4ab34fd4f72 100644 --- a/trunk/include/asm-arm/vfp.h +++ b/trunk/arch/arm/include/asm/vfp.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/vfp.h + * arch/arm/include/asm/vfp.h * * VFP register definitions. * First, the standard VFP set. diff --git a/trunk/include/asm-arm/vfpmacros.h b/trunk/arch/arm/include/asm/vfpmacros.h similarity index 97% rename from trunk/include/asm-arm/vfpmacros.h rename to trunk/arch/arm/include/asm/vfpmacros.h index cccb3892e73c..422f3cc204a2 100644 --- a/trunk/include/asm-arm/vfpmacros.h +++ b/trunk/arch/arm/include/asm/vfpmacros.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/vfpmacros.h + * arch/arm/include/asm/vfpmacros.h * * Assembler-only file containing VFP macros and register definitions. */ diff --git a/trunk/include/asm-arm/vga.h b/trunk/arch/arm/include/asm/vga.h similarity index 89% rename from trunk/include/asm-arm/vga.h rename to trunk/arch/arm/include/asm/vga.h index 1e0b913c3d71..6a3cd2a2f670 100644 --- a/trunk/include/asm-arm/vga.h +++ b/trunk/arch/arm/include/asm/vga.h @@ -1,7 +1,7 @@ #ifndef ASMARM_VGA_H #define ASMARM_VGA_H -#include +#include #include #define VGA_MAP_MEM(x,s) (PCIMEM_BASE + (x)) diff --git a/trunk/include/asm-arm/xor.h b/trunk/arch/arm/include/asm/xor.h similarity index 99% rename from trunk/include/asm-arm/xor.h rename to trunk/arch/arm/include/asm/xor.h index e7c4cf58bed1..7604673dc427 100644 --- a/trunk/include/asm-arm/xor.h +++ b/trunk/arch/arm/include/asm/xor.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/xor.h + * arch/arm/include/asm/xor.h * * Copyright (C) 2001 Russell King * diff --git a/trunk/arch/arm/kernel/crunch-bits.S b/trunk/arch/arm/kernel/crunch-bits.S index a26886758c67..0ec9bb48fab9 100644 --- a/trunk/arch/arm/kernel/crunch-bits.S +++ b/trunk/arch/arm/kernel/crunch-bits.S @@ -16,7 +16,7 @@ #include #include #include -#include +#include /* * We can't use hex constants here due to a bug in gas. diff --git a/trunk/arch/arm/kernel/crunch.c b/trunk/arch/arm/kernel/crunch.c index 627d79414c9d..3b6a1c293ee4 100644 --- a/trunk/arch/arm/kernel/crunch.c +++ b/trunk/arch/arm/kernel/crunch.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/arch/arm/kernel/debug.S b/trunk/arch/arm/kernel/debug.S index 5617566477b4..9550ff0ddde4 100644 --- a/trunk/arch/arm/kernel/debug.S +++ b/trunk/arch/arm/kernel/debug.S @@ -80,7 +80,7 @@ #endif /* CONFIG_CPU_V6 */ #else -#include +#include #endif /* CONFIG_DEBUG_ICEDCC */ /* diff --git a/trunk/arch/arm/kernel/ecard.c b/trunk/arch/arm/kernel/ecard.c index f5cfdabcb87d..7a50575a8d4d 100644 --- a/trunk/arch/arm/kernel/ecard.c +++ b/trunk/arch/arm/kernel/ecard.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include #include diff --git a/trunk/arch/arm/kernel/entry-armv.S b/trunk/arch/arm/kernel/entry-armv.S index 7dca225752c1..617e509d60df 100644 --- a/trunk/arch/arm/kernel/entry-armv.S +++ b/trunk/arch/arm/kernel/entry-armv.S @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include "entry-header.S" diff --git a/trunk/arch/arm/kernel/entry-common.S b/trunk/arch/arm/kernel/entry-common.S index 84694e88b428..060d7e2e9f64 100644 --- a/trunk/arch/arm/kernel/entry-common.S +++ b/trunk/arch/arm/kernel/entry-common.S @@ -10,7 +10,7 @@ #include #include -#include +#include #include "entry-header.S" diff --git a/trunk/arch/arm/kernel/head-common.S b/trunk/arch/arm/kernel/head-common.S index 7e9c00a8a412..1c3c6ea5f9e7 100644 --- a/trunk/arch/arm/kernel/head-common.S +++ b/trunk/arch/arm/kernel/head-common.S @@ -181,7 +181,7 @@ ENTRY(lookup_processor_type) ldmfd sp!, {r4 - r7, r9, pc} /* - * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for + * Look in and arch/arm/kernel/arch.[ch] for * more information about the __proc_info and __arch_info structures. */ .long __proc_info_begin diff --git a/trunk/arch/arm/kernel/head-nommu.S b/trunk/arch/arm/kernel/head-nommu.S index 5d78ffb8a9a7..27329bd32037 100644 --- a/trunk/arch/arm/kernel/head-nommu.S +++ b/trunk/arch/arm/kernel/head-nommu.S @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/trunk/arch/arm/kernel/irq.c b/trunk/arch/arm/kernel/irq.c index 11dcd52e51be..f88efb135b70 100644 --- a/trunk/arch/arm/kernel/irq.c +++ b/trunk/arch/arm/kernel/irq.c @@ -38,6 +38,7 @@ #include #include +#include #include /* diff --git a/trunk/arch/arm/kernel/process.c b/trunk/arch/arm/kernel/process.c index 89bfded70a1f..3fd882337064 100644 --- a/trunk/arch/arm/kernel/process.c +++ b/trunk/arch/arm/kernel/process.c @@ -51,7 +51,7 @@ extern void setup_mm_for_reboot(char mode); static volatile int hlt_counter; -#include +#include void disable_hlt(void) { diff --git a/trunk/arch/arm/lib/ecard.S b/trunk/arch/arm/lib/ecard.S index c55aaa2a2088..8678eb2b7a60 100644 --- a/trunk/arch/arm/lib/ecard.S +++ b/trunk/arch/arm/lib/ecard.S @@ -12,7 +12,7 @@ */ #include #include -#include +#include #define CPSR2SPSR(rt) \ mrs rt, cpsr; \ diff --git a/trunk/arch/arm/lib/getuser.S b/trunk/arch/arm/lib/getuser.S index 1dd8ea4f9a9c..2034d4dbe6ad 100644 --- a/trunk/arch/arm/lib/getuser.S +++ b/trunk/arch/arm/lib/getuser.S @@ -20,7 +20,7 @@ * r2, r3 contains the zero-extended value * lr corrupted * - * No other registers must be altered. (see include/asm-arm/uaccess.h + * No other registers must be altered. (see * for specific ASM register usage). * * Note that ADDR_LIMIT is either 0 or 0xc0000000. diff --git a/trunk/arch/arm/lib/io-readsw-armv3.S b/trunk/arch/arm/lib/io-readsw-armv3.S index 4ef904185142..9aaf7c72065d 100644 --- a/trunk/arch/arm/lib/io-readsw-armv3.S +++ b/trunk/arch/arm/lib/io-readsw-armv3.S @@ -9,7 +9,7 @@ */ #include #include -#include +#include .Linsw_bad_alignment: adr r0, .Linsw_bad_align_msg diff --git a/trunk/arch/arm/lib/io-writesw-armv3.S b/trunk/arch/arm/lib/io-writesw-armv3.S index 1607a29f49b7..cd34503e424d 100644 --- a/trunk/arch/arm/lib/io-writesw-armv3.S +++ b/trunk/arch/arm/lib/io-writesw-armv3.S @@ -9,7 +9,7 @@ */ #include #include -#include +#include .Loutsw_bad_alignment: adr r0, .Loutsw_bad_align_msg diff --git a/trunk/arch/arm/lib/putuser.S b/trunk/arch/arm/lib/putuser.S index 8620afe54f72..08ec7dffa52e 100644 --- a/trunk/arch/arm/lib/putuser.S +++ b/trunk/arch/arm/lib/putuser.S @@ -20,7 +20,7 @@ * Outputs: r0 is the error code * lr corrupted * - * No other registers must be altered. (see include/asm-arm/uaccess.h + * No other registers must be altered. (see * for specific ASM register usage). * * Note that ADDR_LIMIT is either 0 or 0xc0000000 diff --git a/trunk/arch/arm/mach-aaec2000/aaed2000.c b/trunk/arch/arm/mach-aaec2000/aaed2000.c index 83f57da3184c..81a3ecc0d104 100644 --- a/trunk/arch/arm/mach-aaec2000/aaed2000.c +++ b/trunk/arch/arm/mach-aaec2000/aaed2000.c @@ -20,14 +20,14 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include "core.h" diff --git a/trunk/arch/arm/mach-aaec2000/core.c b/trunk/arch/arm/mach-aaec2000/core.c index b016be2b0e35..dfb26bc23d1a 100644 --- a/trunk/arch/arm/mach-aaec2000/core.c +++ b/trunk/arch/arm/mach-aaec2000/core.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/trunk/include/asm-arm/arch-aaec2000/aaec2000.h b/trunk/arch/arm/mach-aaec2000/include/mach/aaec2000.h similarity index 99% rename from trunk/include/asm-arm/arch-aaec2000/aaec2000.h rename to trunk/arch/arm/mach-aaec2000/include/mach/aaec2000.h index a6d1ee0980f2..bc729c42f843 100644 --- a/trunk/include/asm-arm/arch-aaec2000/aaec2000.h +++ b/trunk/arch/arm/mach-aaec2000/include/mach/aaec2000.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/arch-aaec2000/aaec2000.h + * arch/arm/mach-aaec2000/include/mach/aaec2000.h * * AAEC-2000 registers definition * diff --git a/trunk/include/asm-arm/arch-aaec2000/aaed2000.h b/trunk/arch/arm/mach-aaec2000/include/mach/aaed2000.h similarity index 96% rename from trunk/include/asm-arm/arch-aaec2000/aaed2000.h rename to trunk/arch/arm/mach-aaec2000/include/mach/aaed2000.h index bc76d2badb91..f821295ca71b 100644 --- a/trunk/include/asm-arm/arch-aaec2000/aaed2000.h +++ b/trunk/arch/arm/mach-aaec2000/include/mach/aaed2000.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/arch-aaec2000/aaed2000.h + * arch/arm/mach-aaec2000/include/mach/aaed2000.h * * AAED-2000 specific bits definition * diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/debug-macro.S b/trunk/arch/arm/mach-aaec2000/include/mach/debug-macro.S new file mode 100644 index 000000000000..0b6351d7c389 --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/debug-macro.S @@ -0,0 +1,37 @@ +/* arch/arm/mach-aaec2000/include/mach/debug-macro.S + * + * Debugging macro include header + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "hardware.h" + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x80000000 @ physical + movne \rx, #io_p2v(0x80000000) @ virtual + orr \rx, \rx, #0x00000800 + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0] + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #0x10] + tst \rd, #(1 << 7) + beq 1002b + .endm + + .macro waituart,rd,rx +#if 0 +1001: ldr \rd, [\rx, #0x10] + tst \rd, #(1 << 5) + beq 1001b +#endif + .endm diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/dma.h b/trunk/arch/arm/mach-aaec2000/include/mach/dma.h new file mode 100644 index 000000000000..2da846c72fe7 --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/dma.h @@ -0,0 +1,9 @@ +/* + * arch/arm/mach-aaec2000/include/mach/dma.h + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/entry-macro.S b/trunk/arch/arm/mach-aaec2000/include/mach/entry-macro.S new file mode 100644 index 000000000000..c8fb34469007 --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/entry-macro.S @@ -0,0 +1,40 @@ +/* + * arch/arm/mach-aaec2000/include/mach/entry-macro.S + * + * Low-level IRQ helper for aaec-2000 based platforms + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ +#include + + .macro disable_fiq + .endm + + .macro get_irqnr_preamble, base, tmp + .endm + + .macro arch_ret_to_user, tmp1, tmp2 + .endm + + .macro get_irqnr_and_base, irqnr, irqstat, base, tmp + mov r4, #0xf8000000 + add r4, r4, #0x00000500 + mov \base, r4 + ldr \irqstat, [\base, #0] + cmp \irqstat, #0 + bne 1001f + ldr \irqnr, =NR_IRQS+1 + b 1003f +1001: mov \irqnr, #0 +1002: ands \tmp, \irqstat, #1 + mov \irqstat, \irqstat, LSR #1 + add \irqnr, \irqnr, #1 + beq 1002b + sub \irqnr, \irqnr, #1 +1003: + .endm diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/hardware.h b/trunk/arch/arm/mach-aaec2000/include/mach/hardware.h new file mode 100644 index 000000000000..965a6f6672d6 --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/hardware.h @@ -0,0 +1,50 @@ +/* + * arch/arm/mach-aaec2000/include/mach/hardware.h + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARCH_HARDWARE_H +#define __ASM_ARCH_HARDWARE_H + +#include +#include + +/* The kernel is loaded at physical address 0xf8000000. + * We map the IO space a bit after + */ +#define PIO_APB_BASE 0x80000000 +#define VIO_APB_BASE 0xf8000000 +#define IO_APB_LENGTH 0x2000 +#define PIO_AHB_BASE 0x80002000 +#define VIO_AHB_BASE 0xf8002000 +#define IO_AHB_LENGTH 0x2000 + +#define VIO_BASE VIO_APB_BASE +#define PIO_BASE PIO_APB_BASE + +#define io_p2v(x) ( (x) - PIO_BASE + VIO_BASE ) +#define io_v2p(x) ( (x) + PIO_BASE - VIO_BASE ) + +#ifndef __ASSEMBLY__ + +#include + +/* FIXME: Is it needed to optimize this a la pxa ?? */ +#define __REG(x) (*((volatile u32 *)io_p2v(x))) +#define __PREG(x) (io_v2p((u32)&(x))) + +#else /* __ASSEMBLY__ */ + +#define __REG(x) io_p2v(x) +#define __PREG(x) io_v2p(x) + +#endif + +#include "aaec2000.h" + +#endif /* __ASM_ARCH_HARDWARE_H */ diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/io.h b/trunk/arch/arm/mach-aaec2000/include/mach/io.h new file mode 100644 index 000000000000..c87c24de1110 --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/io.h @@ -0,0 +1,20 @@ +/* + * arch/arm/mach-aaec2000/include/mach/io.h + * + * Copied from asm/arch/sa1100/io.h + */ +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#include + +#define IO_SPACE_LIMIT 0xffffffff + +/* + * We don't actually have real ISA nor PCI buses, but there is so many + * drivers out there that might just work if we fake them... + */ +#define __io(a) ((void __iomem *)(a)) +#define __mem_pci(a) (a) + +#endif diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/irqs.h b/trunk/arch/arm/mach-aaec2000/include/mach/irqs.h new file mode 100644 index 000000000000..bf45c6d2f294 --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/irqs.h @@ -0,0 +1,46 @@ +/* + * arch/arm/mach-aaec2000/include/mach/irqs.h + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARCH_IRQS_H +#define __ASM_ARCH_IRQS_H + + +#define INT_GPIOF0_FIQ 0 /* External GPIO Port F O Fast Interrupt Input */ +#define INT_BL_FIQ 1 /* Battery Low Fast Interrupt */ +#define INT_WE_FIQ 2 /* Watchdog Expired Fast Interrupt */ +#define INT_MV_FIQ 3 /* Media Changed Interrupt */ +#define INT_SC 4 /* Sound Codec Interrupt */ +#define INT_GPIO1 5 /* GPIO Port F Configurable Int 1 */ +#define INT_GPIO2 6 /* GPIO Port F Configurable Int 2 */ +#define INT_GPIO3 7 /* GPIO Port F Configurable Int 3 */ +#define INT_TMR1_OFL 8 /* Timer 1 Overflow Interrupt */ +#define INT_TMR2_OFL 9 /* Timer 2 Overflow Interrupt */ +#define INT_RTC_CM 10 /* RTC Compare Match Interrupt */ +#define INT_TICK 11 /* 64Hz Tick Interrupt */ +#define INT_UART1 12 /* UART1 Interrupt */ +#define INT_UART2 13 /* UART2 & Modem State Changed Interrupt */ +#define INT_LCD 14 /* LCD Interrupt */ +#define INT_SSI 15 /* SSI End of Transfer Interrupt */ +#define INT_UART3 16 /* UART3 Interrupt */ +#define INT_SCI 17 /* SCI Interrupt */ +#define INT_AAC 18 /* Advanced Audio Codec Interrupt */ +#define INT_MMC 19 /* MMC Interrupt */ +#define INT_USB 20 /* USB Interrupt */ +#define INT_DMA 21 /* DMA Interrupt */ +#define INT_TMR3_UOFL 22 /* Timer 3 Underflow Interrupt */ +#define INT_GPIO4 23 /* GPIO Port F Configurable Int 4 */ +#define INT_GPIO5 24 /* GPIO Port F Configurable Int 4 */ +#define INT_GPIO6 25 /* GPIO Port F Configurable Int 4 */ +#define INT_GPIO7 26 /* GPIO Port F Configurable Int 4 */ +#define INT_BMI 27 /* BMI Interrupt */ + +#define NR_IRQS (INT_BMI + 1) + +#endif /* __ASM_ARCH_IRQS_H */ diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/memory.h b/trunk/arch/arm/mach-aaec2000/include/mach/memory.h new file mode 100644 index 000000000000..56ae900a482e --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/memory.h @@ -0,0 +1,30 @@ +/* + * arch/arm/mach-aaec2000/include/mach/memory.h + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H + + +#define PHYS_OFFSET UL(0xf0000000) + +#define __virt_to_bus(x) __virt_to_phys(x) +#define __bus_to_virt(x) __phys_to_virt(x) + +/* + * The nodes are the followings: + * + * node 0: 0xf000.0000 - 0xf3ff.ffff + * node 1: 0xf400.0000 - 0xf7ff.ffff + * node 2: 0xf800.0000 - 0xfbff.ffff + * node 3: 0xfc00.0000 - 0xffff.ffff + */ +#define NODE_MEM_SIZE_BITS 26 + +#endif /* __ASM_ARCH_MEMORY_H */ diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/system.h b/trunk/arch/arm/mach-aaec2000/include/mach/system.h new file mode 100644 index 000000000000..8f4115d734ce --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/system.h @@ -0,0 +1,24 @@ +/* + * arch/arm/mach-aaed2000/include/mach/system.h + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARCH_SYSTEM_H +#define __ASM_ARCH_SYSTEM_H + +static inline void arch_idle(void) +{ + cpu_do_idle(); +} + +static inline void arch_reset(char mode) +{ + cpu_reset(0); +} + +#endif /* __ASM_ARCH_SYSTEM_H */ diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/timex.h b/trunk/arch/arm/mach-aaec2000/include/mach/timex.h new file mode 100644 index 000000000000..6c8edf4a8828 --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/timex.h @@ -0,0 +1,18 @@ +/* + * arch/arm/mach-aaec2000/include/mach/timex.h + * + * AAEC-2000 Architecture timex specification + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARCH_TIMEX_H +#define __ASM_ARCH_TIMEX_H + +#define CLOCK_TICK_RATE 508000 + +#endif /* __ASM_ARCH_TIMEX_H */ diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/uncompress.h b/trunk/arch/arm/mach-aaec2000/include/mach/uncompress.h new file mode 100644 index 000000000000..381ecad1a1bb --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/uncompress.h @@ -0,0 +1,46 @@ +/* + * arch/arm/mach-aaec2000/include/mach/uncompress.h + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARCH_UNCOMPRESS_H +#define __ASM_ARCH_UNCOMPRESS_H + +#include "hardware.h" + +#define UART(x) (*(volatile unsigned long *)(serial_port + (x))) + +static void putc(int c) +{ + unsigned long serial_port; + do { + serial_port = _UART3_BASE; + if (UART(UART_CR) & UART_CR_EN) break; + serial_port = _UART1_BASE; + if (UART(UART_CR) & UART_CR_EN) break; + serial_port = _UART2_BASE; + if (UART(UART_CR) & UART_CR_EN) break; + return; + } while (0); + + /* wait for space in the UART's transmitter */ + while ((UART(UART_SR) & UART_SR_TxFF)) + barrier(); + + /* send the character out. */ + UART(UART_DR) = c; +} + +static inline void flush(void) +{ +} + +#define arch_decomp_setup() +#define arch_decomp_wdog() + +#endif /* __ASM_ARCH_UNCOMPRESS_H */ diff --git a/trunk/arch/arm/mach-aaec2000/include/mach/vmalloc.h b/trunk/arch/arm/mach-aaec2000/include/mach/vmalloc.h new file mode 100644 index 000000000000..551f68f666bf --- /dev/null +++ b/trunk/arch/arm/mach-aaec2000/include/mach/vmalloc.h @@ -0,0 +1,16 @@ +/* + * arch/arm/mach-aaec2000/include/mach/vmalloc.h + * + * Copyright (c) 2005 Nicolas Bellido Y Ortega + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARCH_VMALLOC_H +#define __ASM_ARCH_VMALLOC_H + +#define VMALLOC_END (PAGE_OFFSET + 0x10000000) + +#endif /* __ASM_ARCH_VMALLOC_H */ diff --git a/trunk/arch/arm/mach-at91/at91cap9.c b/trunk/arch/arm/mach-at91/at91cap9.c index 933fa8f55cbc..638948c16770 100644 --- a/trunk/arch/arm/mach-at91/at91cap9.c +++ b/trunk/arch/arm/mach-at91/at91cap9.c @@ -17,10 +17,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "generic.h" #include "clock.h" diff --git a/trunk/arch/arm/mach-at91/at91cap9_devices.c b/trunk/arch/arm/mach-at91/at91cap9_devices.c index 25765f1afca9..abb4aac8fa98 100644 --- a/trunk/arch/arm/mach-at91/at91cap9_devices.c +++ b/trunk/arch/arm/mach-at91/at91cap9_devices.c @@ -20,11 +20,11 @@ #include