Commit Graph

240 Commits

Author SHA1 Message Date
Haavard Skinnemoen b13d618b44 avr32: Clean up and optimize the TLB operations
This and the following patches aim to optimize the code dealing with
page tables and TLB operations. Each patch reduces the time it takes
to gzip a 16 MB file slightly, but I expect things like fork() and
mmap() will improve somewhat more.

This patch deals with the low-level TLB operations:

  * Remove unused _TLBEHI_I define
  * Use gcc builtins instead of inline assembly
  * Remove a few unnecessary pipeline flushes and nops
  * Introduce NR_TLB_ENTRIES define and use it instead of hardcoding it
    to 32 a few places throughout the code.
  * Use sysreg bitops instead of hardcoded shifts and masks
  * Make a few needlessly global functions static

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-07-02 11:01:28 +02:00
Haavard Skinnemoen d7ff2a4a28 avr32: Rename at32ap.c -> pdc.c
The only thing left in at32ap.c is some PDC stuff. Rename the file to
reflect what it actually does.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-06-28 15:08:48 +02:00
Haavard Skinnemoen 65033ed740 avr32: Move setup_platform() into chip-specific file
Combine at32_clock_init() and at32_portmux_init() into
setup_platform() and remove setup_platform() from at32ap.c. No
functional change since all setup_platform() ever did was call those
two functions.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-06-28 15:08:39 +02:00
Haavard Skinnemoen d704fb0cc0 avr32: Kill special exception handler sections
Kill the special exception handler sections .tlbx.ex.text,
.tlbr.ex.text, tlbw.ex.text and .scall.text. Use .org instead to place
the handlers at the required offsets from EVBA.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 17:48:06 +02:00
Haavard Skinnemoen 9dbef285a3 avr32: Clean up time.c #includes
Remove lots of unneeded #includes, add #include <linux/kernel.h> and
sort alphabetically.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 17:48:04 +02:00
Sedji Gaouaou 8405996ff6 atmel_pwm: Rename the "mck" clock to "pwm_clk"
The name "mck" causes a conflict on AT91. Call it "pwm_clk" instead.

Signed-off-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:32:30 +02:00
David Brownell 9c2baf785e at32ap700x spi: enable pullups on MISO
This is a minor tweak to the at32ap700x pin configuration for the SPI
input pin (MISO), enabling the on-chip weak pullup (typical 190K) to

  (a) ensure a fixed data value for missing or input-only slaves;

  (b) prevent power waste associated with inputs floating near VDDIO/2.

Atmel's boards have no external pullup or pulldown on these pins, so
it's unlikely other boards would address these issues with external
pulldowns.  Were there trouble, board-specific code could turn off
the relevant pullup(s).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:32:29 +02:00
David Brownell 7ef31e9c4e avr32: improve NGW100 I2C/PMBus setup
Basic I2C initialization for the NGW100 board:

  - Provide empty i2c device table. Daughtercards may add devices,
    and the ATtiny24 could do stuff too.

  - Set up EXTINT(3) so the ATtiny24 can interrupt the AP7000.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:32:29 +02:00
Hans-Christian Egtvedt d86d314f67 avr32: Add PSIF platform devices
This patch adds the PS/2 interface (PSIF) to the device code, split into
two platform devices, one for each port.

The function for adding the PSIF platform device is also added to the
board header file.

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:32:28 +02:00
Hans-Christian Egtvedt 47882cf620 avr32: Add pin configuration choice to LCDC peripheral
This patch lets the board code choose which pin out to use for the LCD
interface.

On AT32AP7000 the LCDC is wired to two sets of pins, which lets the user
choose between dual ethernet and 32-bit EBI. For the ATNGW100 board it
is vital to have the choice to select the alternative pinout since this
pinout is routed to the external headers.

Update ATSTK1002 and ATSTK1004 to use the new interface.

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:32:27 +02:00
David Brownell aafafddb01 avr32: minor GPIO handling updates
On the odd chance some code uses a pin as a GPIO IRQ without calling
gpio_request() or gpio_direction_input(), the debug dump should still
show its pin status.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:32:27 +02:00
Haavard Skinnemoen c1f24ac99f avr32: Fix wrong I/O access size in __raw_readsb
__raw_readsb() should always use byte accesses, never halfword accesses,
to I/O memory.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:07:50 +02:00
Martin Koegler 7c1b90a1e9 avr32: Fix sigaltstack behaviour
A signal handler should be able to change the signal stack used for the
next signal by altering the ucontext_t passed as a parameter to the
handler. This does not currently work on avr32 since it doesn't update
the in-kernel signal context from the ucontext_t upon signal handler
return.

Fix it by adding a call to do_sigaltstack() from sys_rt_sigreturn(),
bringing it in line with most other architectures.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
[haavard.skinnemoen@atmel.com: changed patch description]
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:07:35 +02:00
Alex 60ed7951d0 avr32: Allow board to define oscillator rates
On our custom board we have other oscillator rates than on atngw100 and
atstk100x.

Currently these rates are hardcoded in arch/avr32/mach-at32ap/at32ap700x.c.

This patch moves them into board specific code.

Signed-off-by: Alex Raimondi <raimondi@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:07:16 +02:00
Haavard Skinnemoen 8bd8974fcd avr32: export empty_zero_page
Fixes one of two ext4 build problems:
ERROR: "empty_zero_page" [fs/ext4/ext4dev.ko] undefined!

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-27 15:07:07 +02:00
Haavard Skinnemoen f04d264afc avr32: Fix cpufreq oops when ondemand governor is default
Move the AP7 cpufreq init to late_initcall() so that we don't try to
bring up cpufreq until the governor is ready. x86 also uses
late_initcall() for this.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-27 09:37:42 +02:00
Haavard Skinnemoen d56acacdcd avr32: Update defconfigs
Just provide reasonable defaults for the new stuff. Tickless and
hrtimers are turned on for all boards except ATSTK1004.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-26 13:38:29 +02:00
Adrian Bunk 01575995de avr32: export strnlen_user
This patch fixes the following build error:

<--  snip  -->

...
  MODPOST 1327 modules
ERROR: "strnlen_user" [drivers/input/misc/uinput.ko] undefined!
...
make[2]: *** [__modpost] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-26 13:26:36 +02:00
Adrian Bunk a0ed3d8d94 avr32: export copy_page
This patch fixes the following build error:

<--  snip  -->

...
  MODPOST 61 modules
ERROR: "copy_page" [fs/fuse/fuse.ko] undefined!
...
make[2]: *** [__modpost] Error 1

<--  snip  -->

Also add an empty line since *_page aren't "String functions".

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-26 13:26:36 +02:00
Al Viro f52111b154 [PATCH] take init_files to fs/file.c
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-05-16 17:22:20 -04:00
Ulrich Drepper d35c7b0e54 unified (weak) sys_pipe implementation
This replaces the duplicated arch-specific versions of "sys_pipe()" with
one unified implementation.  This removes almost 250 lines of duplicated
code.

It's marked __weak, so that *if* an architecture wants to override the
default implementation it can do so by simply having its own replacement
version, since many architectures use alternate calling conventions for
the 'pipe()' system call for legacy reasons (ie traditional UNIX
implementations often return the two file descriptors in registers)

I still haven't changed the cris version even though Linus says the BKL
isn't needed.  The arch maintainer can easily do it if there are really
no obstacles.

Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-05-03 13:50:33 -07:00
Christoph Lameter 40765200b6 avr32: use kbuild.h macros instead of defining macros in asm-offsets.c
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:29 -07:00
Denis V. Lunev 0d9f10f4eb avr32: proc: use non-racy method for /proc/tlb creation
Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to
main tree.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:21 -07:00
Haavard Skinnemoen 01d3a5e7fa atmel_lcdfb: don't initialize a pre-allocated framebuffer
If the user specified a fixed framebuffer address on the command line, it may
have been initialized already with a splash image or something, so we
shouldn't clear it.

Therefore, we should only initialize the framebuffer if we allocated it
ourselves.  This patch also updates the AVR32 setup code to clear the
framebuffer if it allocated it itself, i.e.  the user didn't provide a fixed
address or the reservation failed.

I've updated the at91 platform code as well so that it initializes the
framebuffer if it is located in SRAM, but I haven't tested that it actually
works.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Nicolas FERRE <nicolas.ferre@rfo.atmel.com>
Cc: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-28 08:58:38 -07:00
Peter Ma ed3fa7c951 avr32: Add hardware power-down function call
This patch adds in the indirect call to pm_power_off(), as is done in
other architectures (e.g. ARM).

Tested on NGW100, with custom board with GPIO control over main DC
power.

Signed-off-by: Peter Ma <pma@mediamatech.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-04-19 20:40:11 -04:00
Johannes Weiner e6bef83af7 avr32: Remove two unused #defines from mm/init.c
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-04-19 20:40:08 -04:00
Hans-Christian Egtvedt 35bf50ccc8 avr32: Implement set_rate(), set_parent() and mode() for pll1
This patch is a take two of adding full functionality to PLL1 on
AT32AP7000.  This allows board-specific code and drivers to configure
and enable PLL1. This is useful when precise control over the
frequency of e.g. a genclock is needed and requested by users for the
ABDAC device.

The patch is based upon previous patches from both Haavard Skinnemoen
and David Brownell.

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-19 20:40:08 -04:00
David Brownell e723ff666a avr32: Generic clockevents support
This combines three patches from David Brownell:
  * avr32: tclib support
  * avr32: simplify clocksources
  * avr32: Turn count/compare into a oneshot clockevent device

Register both TC blocks (instead of just the first one) so that
the AT32/AT91 tclib code will pick them up (instead of just the
avr32-only PIT-style clocksource).

Rename the first one and its resources appropriately.

More cleanups to the cycle counter clocksource code

 - Disable all the weak symbol magic; remove the AVR32-only TCB-based
   clocksource code (source and header).

 - Mark the __init code properly.

 - Don't forget to report IRQF_TIMER.

 - Make the system work properly with this clocksource, by preventing
   use of the CPU "idle" sleep state in the idle loop when it's used.

Package the avr32 count/compare timekeeping support as a oneshot
clockevent device, so it supports NO_HZ and high res timers.
This means it also supports plugging in other clockevent devices
and clocksources.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-19 20:40:08 -04:00
Haavard Skinnemoen 7e59128f31 avr32: Move sleep code into mach-at32ap
Create a new file, pm-at32ap700x.S, in mach-at32ap and move the CPU
idle sleep code there. Make it possible to disable the sleep code.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-19 20:40:07 -04:00
Haavard Skinnemoen 46acb55b4b avr32: Delete mostly unused header asm/intc.h
Move the only thing that was actually implemented and used in
asm/intc.h, intc_get_pending(), into asm/irq.h and delete asm/intc.h

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-19 20:40:07 -04:00
David Brownell 62c6df62f9 avr32: start clocksource cleanup
Start cleaning up the AVR32 clocksource mess, starting with the cycle
counter clocksource:  remove unneeded pseudo-RTC (just inline that
call to mktime) and associated build warning, and unused sysdev.

Add comment about the problem using the cycle counter register,
and adjust the clocksource rating accordingly.  Later patches can
make this usable again (by disabling use of the idle state and
providing a proper clocksource without the weak binding hacks)
and move towards TCB-based clockevent support (including high
resolution timers) that's shared between AT91 and AVR32.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-19 20:40:06 -04:00
Ben Nizette 040b28fc0a avr32: pass i2c board info through at32_add_device_twi
New-style I2C drivers require that motherboard-mounted I2C devices are
registered with the I2C core, typically at arch_initcall time.  This
can be done nice and neat by passing the struct i2c_board_info[]
through at32_add_device_twi just like we do for the SPI board info.

While we've got the hood up, remove a duplicate declaration of
at32_add_device_twi() in board.h.

[hskinnemoen@atmel.com: add missing i2c_board_info forward-declaration]
Signed-Off-By: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-19 20:40:06 -04:00
Haavard Skinnemoen e1c25dc638 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/usba-2.6.26 into base 2008-04-19 20:38:41 -04:00
Matthew Wilcox 64ac24e738 Generic semaphore implementation
Semaphores are no longer performance-critical, so a generic C
implementation is better for maintainability, debuggability and
extensibility.  Thanks to Peter Zijlstra for fixing the lockdep
warning.  Thanks to Harvey Harrison for pointing out that the
unlikely() was unnecessary.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 10:42:34 -04:00
Adrian Bunk 71fc4c0c44 avr32 mustn't select HAVE_IDE
There's a libata based PATA driver for avr32, but no support for 
drivers/ide/ on avr32.

This patch fixes the following compile error:

<--  snip  -->

...
  CC [M]  drivers/ide/ide-cd.o
In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/ide-cd.c:37:
/home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/ide.h:209:21: error: asm/ide.h: No such file or directory
make[3]: *** [drivers/ide/ide-cd.o] Error 1

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-17 01:14:32 +02:00
Stelian Pop 8d855317fc atmel_usba_udc: move endpoint declarations into platform data.
The atmel_usba_udc driver is being used by several platforms and arches
(avr32 and at91 ATM), and each platform may have different endpoint
settings.

The patch below moves the endpoint declarations into the platform
data and make the necessary adjustments for AVR32 (improved by
Haavard Skinnemoen <hskinnemoen@atmel.com>).

Signed-off-by: Stelian Pop <stelian@popies.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-06 17:15:08 -04:00
Haavard Skinnemoen a2a3952561 avr32: Fix bug in early resource allocation code
add_reserved_region() tries to keep the resource list sorted, so when
looking for a place to insert the new resource, it may break out
before the last entry.

When this happens, the list is broken in two because the sibling field
of the new entry doesn't point to the next resource. Fix it by
updating the new resource's sibling field appropriately.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-03-27 15:31:57 +01:00
Haavard Skinnemoen 957ecd7dc8 avr32: Build fix for CONFIG_BUG=n
Don't include the BUG trap handling code when CONFIG_BUG is not set.
This fixes allnoconfig.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-03-13 23:56:15 +01:00
Haavard Skinnemoen 325d6f5593 avr32: Fix OCD refcounting bug
Iff the parent has TIF_DEBUG set, _and_ clone_flags includes
CLONE_PTRACE we should set the TIF_DEBUG flag for the child and
increment the ocd refcount. Otherwise, the TIF_DEBUG flag must be
unset.

Currently, the child inherits TIF_DEBUG from the parent before
copy_thread is called, so TIF_DEBUG may be already be set before we
determine whether the child is supposed to inherit debugging
capabilities from the parent or not. This means that ocd_enable()
won't increment the refcount, because TIF_DEBUG is already set, and
that TIF_DEBUG will be set for processes that aren't being debugged.

This leads to a refcounting asymmetry, which may show up as

------------[ cut here ]------------
Badness at arch/avr32/kernel/ocd.c:73
PC is at ocd_disable+0x34/0x60
LR is at put_lock_stats+0xa/0x20

as reported by David Brownell. Happens when strace'ing a process that
forks a new child process, e.g. "strace mount -tjffs2 mtd1 /mnt", and
subsequently killing the child process (e.g. "umount /mnt".)

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-02-27 14:23:53 +01:00
Haavard Skinnemoen d45ad06273 avr32: Call tick_nohz_{stop,restart}_sched_tick() in idle loop
This fixes a hang on boot with nohz enabled. nohz is not actually
supported in mainline yet, but patches that add support for it are
currently under review.

When nohz is compiled out, the functions are no-ops, so this patch
results in no functional change, but it arguably makes the code more
correct.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-02-15 14:55:10 +01:00
Haavard Skinnemoen f059267e7f avr32: Use correct config symbol in atstk1004 board code
CONFIG_BOARD_ATSTK1002_SW2_CUSTOM should be
CONFIG_BOARD_ATSTK100X_SW2_CUSTOM.

Spotted by Robert P. J. Day.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-02-13 14:44:06 +01:00
Haavard Skinnemoen 32019828d9 avr32: Fix broken pte dump code in do_page_fault()
The per-task page tables only cover the first 2GiB of the address
space. For kernel addresses, we need to do the lookup in init's page
tables.

This is a temporary workaround until we modify the per-task page
tables to cover the whole 4GiB address space.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-02-13 14:44:04 +01:00
Sam Ravnborg ec7748b59e ide: introduce HAVE_IDE
To allow flexible configuration of IDE introduce HAVE_IDE.
All archs except arm, um and s390 unconditionally select it.
For arm the actual configuration determine if IDE is supported.

This is a step towards introducing drivers/Kconfig for arm.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Russell King - ARM Linux <linux@arm.linux.org.uk>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-09 10:46:40 +01:00
David Brownell 9a1e8eb1f0 Basic PWM driver for AVR32 and AT91
PWM device setup, and a simple PWM driver exposing a programming interface
giving access to each channel's full capabilities.  Note that this doesn't
support starting several channels in synch.

[hskinnemoen@atmel.com: allocate platform device dynamically]
[hskinnemoen@atmel.com: Kconfig fix]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:38 -08:00
Christoph Hellwig 8b88b0998e libfs: allow error return from simple attributes
Sometimes simple attributes might need to return an error, e.g. for
acquiring a mutex interruptibly.  In fact we have that situation in
spufs already which is the original user of the simple attributes.  This
patch merged the temporarily forked attributes in spufs back into the
main ones and allows to return errors.

[akpm@linux-foundation.org: build fix]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: <stefano.brivio@polimi.it>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:34 -08:00
Bernhard Walle 72a7fe3967 Introduce flags for reserve_bootmem()
This patchset adds a flags variable to reserve_bootmem() and uses the
BOOTMEM_EXCLUSIVE flag in crashkernel reservation code to detect collisions
between crashkernel area and already used memory.

This patch:

Change the reserve_bootmem() function to accept a new flag BOOTMEM_EXCLUSIVE.
If that flag is set, the function returns with -EBUSY if the memory already
has been reserved in the past.  This is to avoid conflicts.

Because that code runs before SMP initialisation, there's no race condition
inside reserve_bootmem_core().

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix powerpc build]
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: <linux-arch@vger.kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-07 08:42:25 -08:00
Andrew Morton 941e492bdb read_current_timer() cleanups
- All implementations can be __devinit

- The function prototypes were in asm/timex.h but they all must be the same,
  so create a single declaration in linux/timex.h.

- uninline the sparc64 version to match the other architectures

- Don't bother #defining ARCH_HAS_READ_CURRENT_TIMER to a particular value.

[ezk@cs.sunysb.edu: fix build]
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:02 -08:00
Haavard Skinnemoen 46a56c5a02 Fix timerfd breakage on avr32
Hmm. Someone removed the timerfd() syscall...

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-05 14:37:15 -08:00
David Brownell b98348bdd0 gpiolib: avr32 at32ap platform support
Teach AVR32 to use the "GPIO Library" when exposing its GPIOs, so that signals
on external chips (like GPIO expanders) can easily be used.

This mostly reorganizes some existing logic, with two minor changes in
behavior:

 - The PSR registers are used instead of the previous "gpio_mask" values,
   matching AT91 behavior and removing some duplication between that role
   and that of "pinmux_mask".

 - NR_IRQs grew to acommodate a bank of external GPIOs.  Eventually this
   number should probably become a board-specific config option.

There's a debugfs dump of status for the built-in GPIOs, showing which pins
have deglitching, pullups, or open drain drive enabled, as well as the ID
string used when requesting each IRQ.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Eric Miao <eric.miao@marvell.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ben Gardner <bgardner@wabtec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-05 09:44:13 -08:00
Haavard Skinnemoen b21761ff18 kbuild: Fix instrumentation removal breakage on avr32
AVR32 still includes Kconfig.instrumentation, so it won't build after
this...

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-04 07:57:38 -08:00