21 Jul, 2008

1 commit


15 Jul, 2008

2 commits

  • This is a driver for the MMC controller on the AP7000 chips from
    Atmel. It should in theory work on AT91 systems too with some
    tweaking, but since the DMA interface is quite different, it's not
    entirely clear if it's worth merging this with the at91_mci driver.

    This driver has been around for a while in BSPs and kernel sources
    provided by Atmel, but this particular version uses the generic DMA
    Engine framework (with the slave extensions) instead of an
    avr32-only DMA controller framework.

    This driver can also use PIO transfers when no DMA channels are
    available, and for transfers where using DMA may be difficult or
    impractical for some reason (e.g. the DMA setup overhead is usually
    not worth it for very short transfers, and badly aligned buffers or
    lengths are difficult to handle.)

    Currently, the driver only support PIO transfers. DMA support has been
    split out to a separate patch to hopefully make it easier to review.

    The driver has been tested using mmc-block and ext3fs on several SD,
    SDHC and MMC+ cards. Reads and writes work fine, with read transfer
    rates up to 3.5 MiB/s on fast cards with debugging disabled.

    The driver has also been tested using the mmc_test module on the same
    cards. All tests except 7, 9, 15 and 17 succeed. The first two are
    unsupported by all the cards I have, so I don't know if the driver
    handles this correctly. The last two fail because the hardware flags a
    Data CRC Error instead of a Data Timeout error. I'm not sure how to deal
    with that.

    Documentation for this controller can be found in many data sheets from
    Atmel, including the AT32AP7000 data sheet which can be found here:

    http://www.atmel.com/dyn/products/datasheets.asp?family_id=682

    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Pierre Ossman

    Haavard Skinnemoen
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6: (31 commits)
    avr32: Fix typo of IFSR in a comment in the PIO header file
    avr32: Power Management support ("standby" and "mem" modes)
    avr32: Add system device for the internal interrupt controller (intc)
    avr32: Add simple SRAM allocator
    avr32: Enable SDRAMC clock at startup
    rtc-at32ap700x: Enable wakeup
    macb: Basic suspend/resume support
    atmel_serial: Drain console TX shifter before suspending
    atmel_serial: Fix build on avr32 with CONFIG_PM enabled
    avr32: Use a quicklist for PTE allocation as well
    avr32: Use a quicklist for PGD allocation
    avr32: Cover the kernel page tables in the user PGDs
    avr32: Store virtual addresses in the PGD
    avr32: Remove useless zeroing of swapper_pg_dir at startup
    avr32: Clean up and optimize the TLB operations
    avr32: Rename at32ap.c -> pdc.c
    avr32: Move setup_platform() into chip-specific file
    avr32: Kill special exception handler sections
    avr32: Kill unneeded #include from asm/mmu_context.h
    avr32: Clean up time.c #includes
    ...

    Linus Torvalds
     

11 Jul, 2008

1 commit


02 Jul, 2008

7 commits

  • Implement Standby support. In this mode, we'll suspend all drivers,
    put the SDRAM in self-refresh mode and switch off the HSB bus
    ("frozen" mode.)

    Implement Suspend-to-mem support. In this mode, we suspend all
    drivers, put the SDRAM into self-refresh mode and switch off all
    internal clocks except the 32 kHz oscillator ("stop" mode.)

    The lowest-level suspend code runs from a small portion of SRAM
    allocated at startup time. This gets rid of a small potential race
    with the SDRAM where we might try to enter self-refresh mode in the
    middle of an icache burst. We also relocate all interrupt and
    exception handlers to SRAM during the small window when we enter and
    exit the low-power modes.

    We don't need to do any special tricks to start and stop the PLL. The
    main clock is automatically gated by hardware until the PLL is stable.

    Signed-off-by: Haavard Skinnemoen

    Haavard Skinnemoen
     
  • Add SRAM allocator for avr32, which is just a thin wrapper around
    genalloc.

    Signed-off-by: Haavard Skinnemoen

    Haavard Skinnemoen
     
  • Using a quicklist to allocate PTEs might be slightly faster than using
    the page allocator directly since we might avoid zeroing the page
    after each allocation.

    Signed-off-by: Haavard Skinnemoen

    Haavard Skinnemoen
     
  • Use a quicklist to allocate process PGDs. This is expected to be
    slightly faster since we need to copy entries from swapper_pg_dir,
    which can stay around for pages on the PGD quick list.

    Signed-off-by: Haavard Skinnemoen

    Haavard Skinnemoen
     
  • Expand the per-process PGDs so that they cover the kernel virtual
    memory area as well. This simplifies the TLB miss handler fastpath
    since it doesn't have to check for kernel addresses anymore.

    If a TLB miss happens on a kernel address and a second-level page
    table can't be found, we check swapper_pg_dir and copy the PGD entry
    into the user PGD if it can be found there.

    Signed-off-by: Haavard Skinnemoen

    Haavard Skinnemoen
     
  • Instead of storing physical addresses along with page flags in the
    PGD, store virtual addresses and use NULL to indicate a not present
    second-level page table. A non-page-aligned page table indicates a bad
    PMD.

    This simplifies the TLB miss handler since it no longer has to check
    the Present bit and no longer has to convert the PGD entry from
    physical to virtual address. Instead, it has to check for a NULL
    entry, which is slightly cheaper than either.

    Signed-off-by: Haavard Skinnemoen

    Haavard Skinnemoen
     
  • 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
     

28 Jun, 2008

1 commit


27 Jun, 2008

5 commits


03 May, 2008

1 commit


29 Apr, 2008

1 commit

  • Unaligned access is ok for the following arches:
    cris, m68k, mn10300, powerpc, s390, x86

    Arches that use the memmove implementation for native endian, and
    the byteshifting for the opposite endianness.
    h8300, m32r, xtensa

    Packed struct for native endian, byteshifting for other endian:
    alpha, blackfin, ia64, parisc, sparc, sparc64, mips, sh

    m86knommu is generic_be for Coldfire, otherwise unaligned access is ok.

    frv, arm chooses endianness based on compiler settings, uses the byteshifting
    versions. Remove the unaligned trap handler from frv as it is now unused.

    v850 is le, uses the byteshifting versions for both be and le.

    Remove the now unused asm-generic implementation.

    Signed-off-by: Harvey Harrison
    Acked-by: David S. Miller
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     

28 Apr, 2008

1 commit

  • s390 for one, cannot implement VM_MIXEDMAP with pfn_valid, due to their memory
    model (which is more dynamic than most). Instead, they had proposed to
    implement it with an additional path through vm_normal_page(), using a bit in
    the pte to determine whether or not the page should be refcounted:

    vm_normal_page()
    {
    ...
    if (unlikely(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))) {
    if (vma->vm_flags & VM_MIXEDMAP) {
    #ifdef s390
    if (!mixedmap_refcount_pte(pte))
    return NULL;
    #else
    if (!pfn_valid(pfn))
    return NULL;
    #endif
    goto out;
    }
    ...
    }

    This is fine, however if we are allowed to use a bit in the pte to determine
    refcountedness, we can use that to _completely_ replace all the vma based
    schemes. So instead of adding more cases to the already complex vma-based
    scheme, we can have a clearly seperate and simple pte-based scheme (and get
    slightly better code generation in the process):

    vm_normal_page()
    {
    #ifdef s390
    if (!mixedmap_refcount_pte(pte))
    return NULL;
    return pte_page(pte);
    #else
    ...
    #endif
    }

    And finally, we may rather make this concept usable by any architecture rather
    than making it s390 only, so implement a new type of pte state for this.
    Unfortunately the old vma based code must stay, because some architectures may
    not be able to spare pte bits. This makes vm_normal_page a little bit more
    ugly than we would like, but the 2 cases are clearly seperate.

    So introduce a pte_special pte state, and use it in mm/memory.c. It is
    currently a noop for all architectures, so this doesn't actually result in any
    compiled code changes to mm/memory.o.

    BTW:
    I haven't put vm_normal_page() into arch code as-per an earlier suggestion.
    The reason is that, regardless of where vm_normal_page is actually
    implemented, the *abstraction* is still exactly the same. Also, while it
    depends on whether the architecture has pte_special or not, that is the
    only two possible cases, and it really isn't an arch specific function --
    the role of the arch code should be to provide primitive functions and
    accessors with which to build the core code; pte_special does that. We do
    not want architectures to know or care about vm_normal_page itself, and
    we definitely don't want them being able to invent something new there
    out of sight of mm/ code. If we made vm_normal_page an arch function, then
    we have to make vm_insert_mixed (next patch) an arch function too. So I
    don't think moving it to arch code fundamentally improves any abstractions,
    while it does practically make the code more difficult to follow, for both
    mm and arch developers, and easier to misuse.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Nick Piggin
    Acked-by: Carsten Otte
    Cc: Jared Hulbert
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

20 Apr, 2008

9 commits

  • On Mon, Apr 14, 2008 at 03:36:24PM +0100, Alan Cox wrote:
    > On Mon, 14 Apr 2008 17:17:21 +0300
    > Adrian Bunk wrote:
    >
    > > This patch fixes the following build error:
    > >
    > >
    > >
    > > ...
    > > CC [M] drivers/serial/8250.o
    > > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/serial/8250.c:95:24: error: asm/serial.h: No such file or directory
    > > make[3]: *** [drivers/serial/8250.o] Error 1
    > >
    > >
    > >
    > > Signed-off-by: Adrian Bunk
    > >
    > > ---
    > > 3cb4ef80d75e118ccfd44f7006aea3db54afb31c diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
    > > index b1bbaa0..b0e216d 100644
    > > --- a/drivers/serial/Kconfig
    > > +++ b/drivers/serial/Kconfig
    > > @@ -11,7 +11,7 @@ menu "Serial drivers"
    > > # The new 8250/16550 serial drivers
    > > config SERIAL_8250
    > > tristate "8250/16550 and compatible serial support"
    > > - depends on (BROKEN || !SPARC)
    > > + depends on (BROKEN || !SPARC) && !AVR32
    > > select SERIAL_CORE
    > > ---help---
    >
    > NAK.
    >
    > Add an asm/serial.h to the platform as it has PCI so will have 8250 PCI
    > devices available to it. A copy of the MIPS one should be right.

    Patch below.

    > Alan

    cu
    Adrian

    This patch fixes the following build error with CONFIG_SERIAL_8250:

    ...
    CC [M] drivers/serial/8250.o
    /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/serial/8250.c:95:24: error: asm/serial.h: No such file or directory
    make[3]: *** [drivers/serial/8250.o] Error 1

    Signed-off-by: Adrian Bunk
    Acked-by: Alan Cox
    Signed-off-by: Haavard Skinnemoen

    Adrian Bunk
     
  • This patch fixes the following compile error with CONFIG_MD_RAID456
    on avr32:

    ...
    CC [M] crypto/xor.o
    /home/bunk/linux/kernel-2.6/git/linux-2.6/crypto/xor.c:23:21: error: asm/xor.h: No such file or directory
    /home/bunk/linux/kernel-2.6/git/linux-2.6/crypto/xor.c: In function 'calibrate_xor_blocks':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/crypto/xor.c:131: error: 'XOR_TRY_TEMPLATES' undeclared (first use in this function)
    /home/bunk/linux/kernel-2.6/git/linux-2.6/crypto/xor.c:131: error: (Each undeclared identifier is reported only once
    /home/bunk/linux/kernel-2.6/git/linux-2.6/crypto/xor.c:131: error: for each function it appears in.)
    make[2]: *** [crypto/xor.o] Error 1

    Signed-off-by: Adrian Bunk
    Signed-off-by: Haavard Skinnemoen

    Adrian Bunk
     
  • 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
    Signed-off-by: Haavard Skinnemoen

    David Brownell
     
  • 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

    Haavard Skinnemoen
     
  • Signed-off-by: Haavard Skinnemoen

    Haavard Skinnemoen
     
  • 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

    Haavard Skinnemoen
     
  • 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
    Signed-off-by: Haavard Skinnemoen

    Ben Nizette
     
  • PAGE_SIZE is used both from assembly and C code. We want to have type
    specifiers when using it from C, but this will make the assembler
    confused, so we need to make it conditional.

    This is exactly what the _AC macro is for, so using it allows us to
    get rid of a few lines of cpp noise.

    Signed-off-by: Cyrill Gorcunov
    Signed-off-by: Haavard Skinnemoen

    Cyrill Gorcunov
     
  • …en/usba-2.6.26 into base

    Haavard Skinnemoen
     

17 Apr, 2008

1 commit

  • 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
    Acked-by: Ingo Molnar

    Matthew Wilcox
     

07 Apr, 2008

1 commit

  • 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 ).

    Signed-off-by: Stelian Pop
    Acked-by: David Brownell
    Signed-off-by: Haavard Skinnemoen

    Stelian Pop
     

03 Apr, 2008

1 commit

  • Currently include/linux/kvm.h is not considered by make headers_install,
    because Kbuild cannot handle " unifdef-$(CONFIG_FOO) += foo.h. This problem
    was introduced by

    commit fb56dbb31c4738a3918db81fd24da732ce3b4ae6
    Author: Avi Kivity
    Date: Sun Dec 2 10:50:06 2007 +0200

    KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM

    Currently, make headers_check barfs due to , which
    includes, not existing. Rather than add a zillion s, export kvm.
    only if the arch actually supports it.

    Signed-off-by: Avi Kivity

    which makes this an 2.6.25 regression.

    One way of solving the issue is to enhance Kbuild, but Avi and David conviced
    me, that changing headers_install is not the way to go. This patch changes
    the definition for linux/kvm.h to unifdef-y.

    If  unifdef-y is used for linux/kvm.h "make headers_check" will fail on all
    architectures without asm/kvm.h. Therefore, this patch also provides
    asm/kvm.h on all architectures.

    Signed-off-by: Christian Borntraeger
    Acked-by: Avi Kivity
    Cc: Sam Ravnborg
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christian Borntraeger
     

10 Mar, 2008

1 commit


13 Feb, 2008

1 commit


09 Feb, 2008

4 commits

  • Background: I've implemented 1K/2K page tables for s390. These sub-page
    page tables are required to properly support the s390 virtualization
    instruction with KVM. The SIE instruction requires that the page tables
    have 256 page table entries (pte) followed by 256 page status table entries
    (pgste). The pgstes are only required if the process is using the SIE
    instruction. The pgstes are updated by the hardware and by the hypervisor
    for a number of reasons, one of them is dirty and reference bit tracking.
    To avoid wasting memory the standard pte table allocation should return
    1K/2K (31/64 bit) and 2K/4K if the process is using SIE.

    Problem: Page size on s390 is 4K, page table size is 1K or 2K. That means
    the s390 version for pte_alloc_one cannot return a pointer to a struct
    page. Trouble is that with the CONFIG_HIGHPTE feature on x86 pte_alloc_one
    cannot return a pointer to a pte either, since that would require more than
    32 bit for the return value of pte_alloc_one (and the pte * would not be
    accessible since its not kmapped).

    Solution: The only solution I found to this dilemma is a new typedef: a
    pgtable_t. For s390 pgtable_t will be a (pte *) - to be introduced with a
    later patch. For everybody else it will be a (struct page *). The
    additional problem with the initialization of the ptl lock and the
    NR_PAGETABLE accounting is solved with a constructor pgtable_page_ctor and
    a destructor pgtable_page_dtor. The page table allocation and free
    functions need to call these two whenever a page table page is allocated or
    freed. pmd_populate will get a pgtable_t instead of a struct page pointer.
    To get the pgtable_t back from a pmd entry that has been installed with
    pmd_populate a new function pmd_pgtable is added. It replaces the pmd_page
    call in free_pte_range and apply_to_pte_range.

    Signed-off-by: Martin Schwidefsky
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Schwidefsky
     
  • 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
    Signed-off-by: Haavard Skinnemoen
    Cc: Andrew Victor
    Cc: Nicolas Ferre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Some arches (like alpha and ia64) already have a clean posix_types.h header.
    This brings all the others in line by removing all references to __GLIBC__
    (and some undocumented __USE_ALL).

    Signed-off-by: Mike Frysinger
    Acked-by: Ingo Molnar
    Cc: Ulrich Drepper
    Cc: Roland McGrath
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Move STACK_TOP[_MAX] out of asm/a.out.h and into asm/processor.h as they're
    required whether or not A.OUT format is available.

    Signed-off-by: David Howells
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

08 Feb, 2008

2 commits

  • Use the new generic cmpxchg_local (disables interrupt) for 8, 16 and 64 bits
    cmpxchg_local. Use the __cmpxchg_u32 primitive for 32 bits cmpxchg_local.

    Note that cmpxchg only uses the __cmpxchg_u32 or __cmpxchg_u64 and will cause
    a linker error if called with 8 or 16 bits argument.

    Signed-off-by: Mathieu Desnoyers
    Acked-by: Haavard Skinnemoen
    Cc: Haavard Skinnemoen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • struct user.u_ar0 is defined to contain a pointer offset on all
    architectures in which it is defined (all architectures which define an
    a.out format except SPARC.) However, it has a pointer type in the headers,
    which is pointless -- is not exported to userspace, and it
    just makes the code messy.

    Redefine the field as "unsigned long" (which is the same size as a pointer
    on all Linux architectures) and change the setting code to user offsetof()
    instead of hand-coded arithmetic.

    Cc: Linux Arch Mailing List
    Cc: Bryan Wu
    Cc: Roman Zippel
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Russell King
    Cc: Lennert Buytenhek
    Cc: Håvard Skinnemoen
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Tony Luck
    Cc: Hirokazu Takata
    Cc: Ralf Baechle
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Signed-off-by: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H. Peter Anvin