cascardo/linux.git
11 years agoMerge branch 'mti-next' of git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill into...
Ralf Baechle [Thu, 9 May 2013 15:57:30 +0000 (17:57 +0200)]
Merge branch 'mti-next' of git://git.linux-mips.org/sjhill/linux-sjhill into mips-for-linux-next

11 years agoMerge branch 'next/kvm' into mips-for-linux-next
Ralf Baechle [Thu, 9 May 2013 15:56:40 +0000 (17:56 +0200)]
Merge branch 'next/kvm' into mips-for-linux-next

11 years agoMIPS: Add new GIC clockevent driver.
Raghu Gandham [Wed, 10 Apr 2013 21:30:12 +0000 (16:30 -0500)]
MIPS: Add new GIC clockevent driver.

Add new clockevent driver that uses the counter present on the MIPS
Global Interrupt Controller.

Signed-off-by: Raghu Gandham <Raghu.Gandham@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Formatting clean-ups for clocksources.
Steven J. Hill [Wed, 10 Apr 2013 21:29:13 +0000 (16:29 -0500)]
MIPS: Formatting clean-ups for clocksources.

Various whitespace and #ifdef removals for GIC and R4K clocksources.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Refactor GIC clocksource code.
Steven J. Hill [Wed, 10 Apr 2013 21:28:36 +0000 (16:28 -0500)]
MIPS: Refactor GIC clocksource code.

Reorganize some of the GIC clocksource driver code. Below is a list of
the various changes.

  * No longer select CSRC_GIC by default for Malta platform.
  * Limit choice for either the GIC or R4K clocksource, not both.
  * Change location in Makefile.
  * Created new 'gic_read_count' function in common 'irq-gic.c' file.
  * Change 'git_hpt_read' function in 'csrc-gic.c' to use new function.
  * Surround GIC specific code in Malta platform code with #ifdef's.
  * Only initialize the GIC clocksource if it was selected. Original
    code called it unconditionally if a GIC was found.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Move 'gic_frequency' to common location.
Steven J. Hill [Wed, 10 Apr 2013 21:27:50 +0000 (16:27 -0500)]
MIPS: Move 'gic_frequency' to common location.

Move the global variable 'gic_frequency' to be defined in the file
'arch/mips/kernel/irq-gic.c' instead of defining it individually
for each platform making use of the GIC. Also change the type to
be an unsigned integer instead of signed.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Move 'gic_present' to common location.
Steven J. Hill [Wed, 10 Apr 2013 21:27:04 +0000 (16:27 -0500)]
MIPS: Move 'gic_present' to common location.

Move the global variable 'gic_present' to be defined in the file
'arch/mips/kernel/irq-gic.c' instead of defining it individually
for each platform making use of the GIC. Also change the type to
be an unsigned integer instead of signed.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: MIPS16e: Add unaligned access support.
Steven J. Hill [Mon, 25 Mar 2013 18:46:15 +0000 (13:46 -0500)]
MIPS: MIPS16e: Add unaligned access support.

Add logic needed to handle unaligned accesses in MIPS16e mode.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
11 years agoMIPS: MIPS16e: Support handling of delay slots.
Steven J. Hill [Mon, 25 Mar 2013 18:45:19 +0000 (13:45 -0500)]
MIPS: MIPS16e: Support handling of delay slots.

Add logic needed to properly calculate exceptions for delay slots
when in MIPS16e mode.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: MIPS16e: Add instruction formats.
Steven J. Hill [Mon, 25 Mar 2013 18:44:04 +0000 (13:44 -0500)]
MIPS: MIPS16e: Add instruction formats.

Add structures for all the MIPS16e instructions. Also add the
enumerations for all the bit fields for opcodes, functions, etc.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Optimise 'strnlen' core library function.
Steven J. Hill [Mon, 25 Mar 2013 18:42:18 +0000 (13:42 -0500)]
MIPS: microMIPS: Optimise 'strnlen' core library function.

Optimise 'strnlen' to use microMIPS instructions and/or optimisations
for binary size reduction. When the microMIPS ISA is not being used,
the library function compiles to the original binary code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Optimise 'strlen' core library function.
Steven J. Hill [Mon, 25 Mar 2013 18:41:47 +0000 (13:41 -0500)]
MIPS: microMIPS: Optimise 'strlen' core library function.

Optimise 'strlen' to use microMIPS instructions and/or optimisations
for binary size reduction. When the microMIPS ISA is not being used,
the library function compiles to the original binary code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Optimise 'strncpy' core library function.
Steven J. Hill [Mon, 25 Mar 2013 18:41:18 +0000 (13:41 -0500)]
MIPS: microMIPS: Optimise 'strncpy' core library function.

Optimise 'strncpy' to use microMIPS instructions and/or optimisations
for binary size reduction. When the microMIPS ISA is not being used,
the library function compiles to the original binary code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Optimise 'memset' core library function.
Steven J. Hill [Mon, 25 Mar 2013 18:40:49 +0000 (13:40 -0500)]
MIPS: microMIPS: Optimise 'memset' core library function.

Optimise 'memset' to use microMIPS instructions and/or optimisations
for binary size reduction. When the microMIPS ISA is not being used,
the library function compiles to the original binary code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Add configuration option for microMIPS kernel.
Steven J. Hill [Mon, 25 Mar 2013 18:27:11 +0000 (13:27 -0500)]
MIPS: microMIPS: Add configuration option for microMIPS kernel.

This adds the option to build the Linux kernel using only the
microMIPS ISA. The resulting kernel binary is, at a minimum,
20% smaller than using the MIPS32R2 ISA.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Disable LL/SC and fix linker bug.
Steven J. Hill [Mon, 25 Mar 2013 18:22:59 +0000 (13:22 -0500)]
MIPS: microMIPS: Disable LL/SC and fix linker bug.

Partially revert commit e0c14a260d66ba35935600d6435940a566fe806b
and turn off LL/SC when building a pure microMIPS kernel. This is
a temporary fix until the cmpxchg assembly macro functions are
re-written to not use the HI/LO registers in address calculations.

Also add .insn in selected user access functions which would
otherwise produce ISA mode jump incompatibilities. This is also a
temporary fix.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Add vdso support.
Douglas Leung [Mon, 25 Mar 2013 18:21:11 +0000 (13:21 -0500)]
MIPS: microMIPS: Add vdso support.

Support vdso in microMIPS mode.

Signed-off-by: Douglas Leung <Douglas.Leung@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Add unaligned access support.
Leonid Yegoshin [Mon, 25 Mar 2013 18:18:07 +0000 (13:18 -0500)]
MIPS: microMIPS: Add unaligned access support.

Add logic needed to handle unaligned accesses in microMIPS mode.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
11 years agoMIPS: microMIPS: Support handling of delay slots.
Leonid Yegoshin [Mon, 25 Mar 2013 18:08:40 +0000 (13:08 -0500)]
MIPS: microMIPS: Support handling of delay slots.

Add logic needed to properly calculate exceptions for delay slots
when in microMIPS mode.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Add support for exception handling.
Steven J. Hill [Mon, 25 Mar 2013 17:15:55 +0000 (12:15 -0500)]
MIPS: microMIPS: Add support for exception handling.

All exceptions must be taken in microMIPS mode, never in classic
MIPS mode or the kernel falls apart. A few NOP instructions are
used to maintain the correct alignment of microMIPS versions of
the exception vectors.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Floating point support.
Leonid Yegoshin [Mon, 25 Mar 2013 17:09:02 +0000 (12:09 -0500)]
MIPS: microMIPS: Floating point support.

Add logic needed to do floating point emulation in microMIPS mode.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Steven J. Hill <Steven. Hill@imgtec.com>
11 years agoMIPS: microMIPS: Fix macro naming in micro-assembler.
Steven J. Hill [Mon, 25 Mar 2013 17:03:41 +0000 (12:03 -0500)]
MIPS: microMIPS: Fix macro naming in micro-assembler.

The macros did not properly take into account the ISA that
the kernel was being compiled with. A classic MIPS kernel
will have the standard 'uasm_i_##op' macro functions with
'MM_uasm_i_##op' macro functions for the microMIPS version.
A pure microMIPS kernel will have the standard macros with
'CL_uasm_i_##op' macro functions for the classic version.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: microMIPS: Fix incorrect mask for jump immediate.
Steven J. Hill [Mon, 25 Mar 2013 17:07:40 +0000 (12:07 -0500)]
MIPS: microMIPS: Fix incorrect mask for jump immediate.

Jump or branch target addresses have the first bit set. The
original mask did not take this into account and will cause
a field overflow warning for the target address when a jump
immediate instruction is built.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoKVM/MIPS32: Binary patching of select privileged instructions.
Sanjay Lal [Thu, 22 Nov 2012 02:34:16 +0000 (18:34 -0800)]
KVM/MIPS32: Binary patching of select privileged instructions.

Currently, the following instructions are translated:
- CACHE (indexed)
- CACHE (va based): translated to a SYNCI, overkill on D-CACHE operations,
  but still much faster than a trap.
- mfc0/mtc0: the virtual COP0 registers for the guest are implemented as
  2-D array.
  [COP#][SEL] and this is mapped into the guest kernel address space @ VA 0x0.
  mfc0/mtc0 operations are transformed to load/stores.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Do not call vcpu_load when injecting interrupts.
Sanjay Lal [Thu, 22 Nov 2012 02:34:15 +0000 (18:34 -0800)]
KVM/MIPS32: Do not call vcpu_load when injecting interrupts.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: microMIPS: Support dynamic ASID sizing.
Steven J. Hill [Mon, 25 Mar 2013 17:01:00 +0000 (12:01 -0500)]
MIPS: microMIPS: Support dynamic ASID sizing.

Changes for pure microMIPS cores to dynamically determine the ASID
size at boot time.

Includes bug fix https://patchwork.linux-mips.org/patch/5230/

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
11 years agoMIPS: Allow ASID size to be determined at boot time.
Steven J. Hill [Mon, 25 Mar 2013 16:58:57 +0000 (11:58 -0500)]
MIPS: Allow ASID size to be determined at boot time.

Original patch by Ralf Baechle and removed by Harold Koerfgen
with commit f67e4ffc79905482c3b9b8c8dd65197bac7eb508. This
allows for more generic kernels since the size of the ASID
and corresponding masks can be determined at run-time. This
patch is also required for the new Aptiv cores and has been
tested on Malta and Malta Aptiv platforms.

[ralf@linux-mips.org: Added relevant part of fix
https://patchwork.linux-mips.org/patch/5213/]

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: FW: malta: Code formatting clean-ups.
Steven J. Hill [Mon, 25 Mar 2013 20:05:40 +0000 (15:05 -0500)]
MIPS: FW: malta: Code formatting clean-ups.

Clean-up code according to the 'checkpatch.pl' script.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: FW: Remove obsolete header file for MTI platforms.
Steven J. Hill [Mon, 25 Mar 2013 19:55:32 +0000 (14:55 -0500)]
MIPS: FW: Remove obsolete header file for MTI platforms.

Remove 'arch/mips/include/asm/mips-boards/prom.h' and get rid of
all inclusions of it by Malta and SEAD-3 platforms.

[ralf@linux-mips.org: Fold in John Crispin <blogic@openwrt.org>'s "MIPS:
ar7 powertv build"].

[ralf@linux-mips.org: Fold in John Crispin <blogic@openwrt.org>'s "MIPS:
unbreak powertv build"].

[ralf@linux-mips.org: Test. Build. Your. Fscking. Code. Or...]

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: FW: malta: Use new common FW library variable processing.
Steven J. Hill [Mon, 25 Mar 2013 19:47:05 +0000 (14:47 -0500)]
MIPS: FW: malta: Use new common FW library variable processing.

Remove old YAMON prom code and use common firmware library code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: FW: sead3: Use new common FW library variable processing.
Steven J. Hill [Mon, 25 Mar 2013 19:35:30 +0000 (14:35 -0500)]
MIPS: FW: sead3: Use new common FW library variable processing.

Remove old YAMON prom code and use common firmware library code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: FW: Add environment variable processing.
Steven J. Hill [Mon, 25 Mar 2013 19:32:15 +0000 (14:32 -0500)]
MIPS: FW: Add environment variable processing.

Add parsing of the environment and command line variables passed to
the kernel to the firmware library.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Add declarations to MIPS Technologies Inc. generic header.
Steven J. Hill [Mon, 25 Mar 2013 19:24:42 +0000 (14:24 -0500)]
MIPS: Add declarations to MIPS Technologies Inc. generic header.

Add declaration of 'mips_scroll_message' and 'mips_display_message'
to the common generic header file for the MIPS Technologies Inc.
development boards.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: sead3: Use generic suspend/resume for LEDs.
Lars-Peter Clausen [Mon, 25 Mar 2013 16:54:17 +0000 (11:54 -0500)]
MIPS: sead3: Use generic suspend/resume for LEDs.

Setting the LED_CORE_SUSPENDRESUME flag causes the LED driver core to call
led_classdev_suspend/led_classdev_resume during suspend/resume. Since this is
exactly what the driver's custom suspend/resume callbacks do we can replace them
by setting the LED_CORE_SUSPENDRESUME flag.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
11 years agoMIPS: Export symbols used by KVM/MIPS module
Sanjay Lal [Thu, 22 Nov 2012 02:34:14 +0000 (18:34 -0800)]
MIPS: Export symbols used by KVM/MIPS module

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: ASM offsets for VCPU arch specific fields.
Sanjay Lal [Thu, 22 Nov 2012 02:34:12 +0000 (18:34 -0800)]
MIPS: ASM offsets for VCPU arch specific fields.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: If KVM is enabled then use the KVM specific routine to flush the TLBs on a...
Sanjay Lal [Thu, 22 Nov 2012 02:34:11 +0000 (18:34 -0800)]
MIPS: If KVM is enabled then use the KVM specific routine to flush the TLBs on a ASID wrap.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: Export routines needed by the KVM module.
Sanjay Lal [Thu, 22 Nov 2012 02:34:10 +0000 (18:34 -0800)]
MIPS: Export routines needed by the KVM module.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest.
Sanjay Lal [Thu, 22 Nov 2012 02:34:09 +0000 (18:34 -0800)]
KVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Guest interrupt delivery.
Sanjay Lal [Thu, 22 Nov 2012 02:34:08 +0000 (18:34 -0800)]
KVM/MIPS32: Guest interrupt delivery.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: COP0 accesses profiling.
Sanjay Lal [Thu, 22 Nov 2012 02:34:07 +0000 (18:34 -0800)]
KVM/MIPS32: COP0 accesses profiling.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Release notes and KVM module Makefile
Sanjay Lal [Thu, 22 Nov 2012 02:34:06 +0000 (18:34 -0800)]
KVM/MIPS32: Release notes and KVM module Makefile

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: MMU/TLB operations for the Guest.
Sanjay Lal [Thu, 22 Nov 2012 02:34:05 +0000 (18:34 -0800)]
KVM/MIPS32: MMU/TLB operations for the Guest.

- Note that this file is statically linked with the rest of the host kernel (KSEG0). This is because kernel modules are
loaded into mapped space on MIPS and we want to make sure that we don't get any host kernel TLB faults while
manipulating TLBs.
- Virtual Guest TLBs are implemented as 64 entry array regardless of the number of host TLB entries.
- Shadow TLBs map Guest virtual addresses to Host physical addresses.

    - TLB miss handling details:
        Guest KSEG0 TLBMISS (0x40000000 â€“ 0x60000000): Transparent to the Guest.
        Guest KSEG2/3 (0x60000000 â€“ 0x80000000) & Guest UM TLBMISS (0x00000000 â€“ 0x40000000)
            Lookup in Guest/Virtual TLB
            If an entry doesn’t match
                deliver appropriate TLBMISS LD/ST exception to the guest
            If entry does exist in the Guest TLB and is NOT Valid
                Deliver TLB invalid exception to the guest
            If entry does exist in the Guest TLB and is VALID
                Inject the TLB entry into the Shadow TLB

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Privileged instruction/target branch emulation.
Sanjay Lal [Thu, 22 Nov 2012 02:34:04 +0000 (18:34 -0800)]
KVM/MIPS32: Privileged instruction/target branch emulation.

- The Guest kernel is run in UM and privileged instructions cause a trap.
- If the instruction causing the trap is in a branch delay slot, the branch
  needs to be emulated to figure out the PC @ which the guest will resume
  execution.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: KVM Guest kernel support.
Sanjay Lal [Thu, 22 Nov 2012 02:34:03 +0000 (18:34 -0800)]
KVM/MIPS32: KVM Guest kernel support.

Both Guest kernel and Guest Userspace execute in UM. The memory map is as follows:
Guest User address space:   0x00000000 -> 0x40000000
Guest Kernel Unmapped:      0x40000000 -> 0x60000000
Guest Kernel Mapped:        0x60000000 -> 0x80000000
- Guest Usermode virtual memory is limited to 1GB.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: MIPS arch specific APIs for KVM
Sanjay Lal [Thu, 22 Nov 2012 02:34:02 +0000 (18:34 -0800)]
KVM/MIPS32: MIPS arch specific APIs for KVM

- Implements the arch specific APIs for KVM, some are stubs for MIPS
- kvm_mips_handle_exit(): Main 'C' distpatch routine for handling exceptions while in "Guest" mode.
- Also implements in-kernel timer interrupt support for the guest.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Entry point for trampolining to the guest and trap handlers.
Sanjay Lal [Thu, 22 Nov 2012 02:34:01 +0000 (18:34 -0800)]
KVM/MIPS32: Entry point for trampolining to the guest and trap handlers.

- __kvm_mips_vcpu_run: main entry point to enter guest, we save kernel context, load
  up guest context from and ERET to guest context.
- mips32_exception: L1 exception handler(s), save k0/k1 and jump to main handlers.
- mips32_GuestException: Generic exception handlers for exceptions/interrupts while in
  guest context.  Save guest context, restore some kernel context and jump to
  main 'C' handler: kvm_mips_handle_exit()

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Arch specific KVM data structures.
Sanjay Lal [Thu, 22 Nov 2012 02:34:00 +0000 (18:34 -0800)]
KVM/MIPS32: Arch specific KVM data structures.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoKVM/MIPS32: Infrastructure/build files.
Sanjay Lal [Thu, 22 Nov 2012 02:33:59 +0000 (18:33 -0800)]
KVM/MIPS32: Infrastructure/build files.

- Add the KVM option to MIPS build files.
- Add default config files for KVM host/guest kernels.
- Change the link address for the Malta KVM Guest kernel to UM (0x40100000).
- Add KVM Kconfig file with KVM/MIPS specific options

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: IP27: Remove pfn_t.
Ralf Baechle [Wed, 8 May 2013 01:51:58 +0000 (03:51 +0200)]
MIPS: IP27: Remove pfn_t.

In the Linux kernel traditionally pfns are represented by an unsigned long.
However a few bits of the SGI IP27 platform code that were ported from
IRIX are using pfn_t for historic reasons.  This is conflicting with
KVM's use of pfn_t.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMerge branch 'mips-next-3.10' of git://git.linux-mips.org/pub/scm/john/linux-john...
Ralf Baechle [Tue, 7 May 2013 23:27:46 +0000 (01:27 +0200)]
Merge branch 'mips-next-3.10' of git://git.linux-mips.org/john/linux-john into mips-for-linux-next

11 years agoMIPS: BCM63XX: add missing clocks for BCM6328 and BCM6362
Jonas Gorski [Mon, 22 Apr 2013 10:57:06 +0000 (10:57 +0000)]
MIPS: BCM63XX: add missing clocks for BCM6328 and BCM6362

Add some mosty unused, but missing clocks for BCM6328 and BCM6362.
This also fixes PCIe init on BCM6362.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5200/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: ath79: make use of the new memory detection code
John Crispin [Mon, 15 Apr 2013 09:45:09 +0000 (09:45 +0000)]
MIPS: ath79: make use of the new memory detection code

There is now a generic function for detecting memory size. Use this instead of
the one found in the ath79 support.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5149/

11 years agoMIPS: ralink: make use of the new memory detection code
John Crispin [Sat, 13 Apr 2013 13:15:51 +0000 (15:15 +0200)]
MIPS: ralink: make use of the new memory detection code

Call detect_memory_region() from plat_mem_setup() unless the size was already
read from the system controller.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5184/

11 years agoMIPS: ralink: add memory definition for MT7620
John Crispin [Sun, 14 Apr 2013 07:55:29 +0000 (09:55 +0200)]
MIPS: ralink: add memory definition for MT7620

Populate struct soc_info with the data that describes our RAM window.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5183/

11 years agoMIPS: ralink: add memory definition for RT3883
John Crispin [Sat, 13 Apr 2013 18:23:19 +0000 (20:23 +0200)]
MIPS: ralink: add memory definition for RT3883

Populate struct soc_info with the data that describes our RAM window.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5182/

11 years agoMIPS: ralink: add memory definition for RT2880
John Crispin [Sat, 13 Apr 2013 13:37:37 +0000 (15:37 +0200)]
MIPS: ralink: add memory definition for RT2880

Populate struct soc_info with the data that describes our RAM window.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5181/

11 years agoMIPS: ralink: add memory definition for RT305x
John Crispin [Sat, 13 Apr 2013 13:13:40 +0000 (15:13 +0200)]
MIPS: ralink: add memory definition for RT305x

Populate struct soc_info with the data that describes our RAM window.

As memory detection fails on RT5350 we read the amount of available memory
from the system controller.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5180/

11 years agoMIPS: ralink: add memory definition to struct ralink_soc_info
John Crispin [Sat, 13 Apr 2013 13:10:14 +0000 (15:10 +0200)]
MIPS: ralink: add memory definition to struct ralink_soc_info

Depending on the actual SoC we have a different base address as well as minimum
and maximum size for RAM. Add these fields to the per SoC structure.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5179/

11 years agoMIPS: add detect_memory_region()
John Crispin [Sat, 13 Apr 2013 11:15:47 +0000 (13:15 +0200)]
MIPS: add detect_memory_region()

Add a generic way of detecting the available RAM. This function is based on the
implementation already used by ath79.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5178/

11 years agoDT: MIPS: ralink: add MT7620A dts files
John Crispin [Fri, 12 Apr 2013 06:27:41 +0000 (06:27 +0000)]
DT: MIPS: ralink: add MT7620A dts files

Add a dtsi file for MT7620A SoC and a sample dts file.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Patchwork: http://patchwork.linux-mips.org/patch/5190/

11 years agoDT: MIPS: ralink: add RT3883 dts files
John Crispin [Fri, 12 Apr 2013 06:27:39 +0000 (06:27 +0000)]
DT: MIPS: ralink: add RT3883 dts files

Add a dtsi file for RT3883 SoC and a sample dts file.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Patchwork: http://patchwork.linux-mips.org/patch/5189/

11 years agoDT: MIPS: ralink: add RT2880 dts files
John Crispin [Fri, 12 Apr 2013 06:27:37 +0000 (06:27 +0000)]
DT: MIPS: ralink: add RT2880 dts files

Add a dtsi file for RT2880 SoC and a sample dts file.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Patchwork: http://patchwork.linux-mips.org/patch/5188/

11 years agoDT: MIPS: ralink: clean up RT3050 dtsi and dts file
John Crispin [Thu, 21 Mar 2013 16:47:07 +0000 (17:47 +0100)]
DT: MIPS: ralink: clean up RT3050 dtsi and dts file

* remove nodes for cores whose drivers are not upstream yet
* add compat string for an additional soc
* fix a whitespace error

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Patchwork: http://patchwork.linux-mips.org/patch/5186/

11 years agoDT: add documentation for the Ralink MIPS SoCs
Gabor Juhos [Sat, 13 Apr 2013 07:02:40 +0000 (09:02 +0200)]
DT: add documentation for the Ralink MIPS SoCs

This patch adds binding documentation for the
compatible values of the Ralink MIPS SoCs.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Patchwork: http://patchwork.linux-mips.org/patch/5187/

11 years agoDT: add vendor prefixes for Ralink
John Crispin [Sat, 13 Apr 2013 08:11:51 +0000 (10:11 +0200)]
DT: add vendor prefixes for Ralink

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
11 years agoMIPS: ralink: add cpu-feature-overrides.h
Gabor Juhos [Wed, 10 Apr 2013 07:19:07 +0000 (09:19 +0200)]
MIPS: ralink: add cpu-feature-overrides.h

Add cpu-feature-overrides.h for RT288x, RT305x and RT3883.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5175/

11 years agoMIPS: ralink: adds support for MT7620 SoC family
John Crispin [Thu, 21 Mar 2013 16:49:02 +0000 (17:49 +0100)]
MIPS: ralink: adds support for MT7620 SoC family

Add support code for mt7620 SOC.

The code detects the SoC and registers the clk / pinmux settings.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5177/

11 years agoMIPS: ralink: adds support for RT3883 SoC family
John Crispin [Sun, 27 Jan 2013 08:39:02 +0000 (09:39 +0100)]
MIPS: ralink: adds support for RT3883 SoC family

Add support code for rt3883 SOC.

The code detects the SoC and registers the clk / pinmux settings.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5185/

11 years agoMIPS: ralink: adds support for RT2880 SoC family
John Crispin [Sun, 27 Jan 2013 08:17:20 +0000 (09:17 +0100)]
MIPS: ralink: adds support for RT2880 SoC family

Add support code for rt2880 SOC.

The code detects the SoC and registers the clk / pinmux settings.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5176/

11 years agoMIPS: ralink: add uart mask to struct ralink_pinmux
John Crispin [Fri, 12 Apr 2013 10:45:27 +0000 (12:45 +0200)]
MIPS: ralink: add uart mask to struct ralink_pinmux

Add a field for the uart muxing mask and set it inside the rt305x setup code.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5744/

11 years agoMIPS: ralink: add pci group to struct ralink_pinmux
Gabor Juhos [Fri, 12 Apr 2013 10:40:23 +0000 (12:40 +0200)]
MIPS: ralink: add pci group to struct ralink_pinmux

This will be used for RT3662/RT3883.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5173/

11 years agoMIPS: ralink: make the RT305x pinmuxing structure static
John Crispin [Fri, 12 Apr 2013 20:16:12 +0000 (22:16 +0200)]
MIPS: ralink: make the RT305x pinmuxing structure static

These structures are exported via struct ralink_pinmux rt_gpio_pinmux and can
hence be static.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5172/

11 years agoMIPS: ralink: rename gpio_pinmux to rt_gpio_pinmux
John Crispin [Fri, 12 Apr 2013 20:12:09 +0000 (22:12 +0200)]
MIPS: ralink: rename gpio_pinmux to rt_gpio_pinmux

Add proper namespacing to the variable.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5171/

11 years agoMIPS: ralink: make early_printk work on RT2880
John Crispin [Tue, 9 Apr 2013 16:31:15 +0000 (18:31 +0200)]
MIPS: ralink: make early_printk work on RT2880

RT2880 has a different location for the early serial port.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5170/

11 years agoMIPS: ralink: add RT5350 sdram register defines
John Crispin [Mon, 25 Mar 2013 10:19:58 +0000 (11:19 +0100)]
MIPS: ralink: add RT5350 sdram register defines

Add a few missing defines that are needed to make memory detection work on the
RT5350.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5169/

11 years agoMIPS: ralink: add missing comment in irq driver
John Crispin [Sat, 16 Mar 2013 15:28:54 +0000 (16:28 +0100)]
MIPS: ralink: add missing comment in irq driver

Trivial patch that adds a comment that makes the code more readable.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5168/

11 years agoMIPS: ralink: fix RT305x clock setup
John Crispin [Fri, 22 Mar 2013 18:25:59 +0000 (19:25 +0100)]
MIPS: ralink: fix RT305x clock setup

Add a few missing clocks.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5167/

11 years agoMIPS: ralink: add RT3352 register defines
John Crispin [Thu, 21 Mar 2013 18:01:49 +0000 (19:01 +0100)]
MIPS: ralink: add RT3352 register defines

Add a few missing defines that are needed to make USB and clock detection work
on the RT3352.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5166/

11 years agoMIPS: ralink: add PCI IRQ handling
Gabor Juhos [Wed, 10 Apr 2013 07:07:27 +0000 (09:07 +0200)]
MIPS: ralink: add PCI IRQ handling

The Ralink IRQ code was not handling the PCI IRQ yet. Add this functionaility
to make PCI work on rt3883.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5165/

11 years agoMIPS: move mips_{set,get}_machine_name() to a more generic place
John Crispin [Thu, 11 Apr 2013 05:34:59 +0000 (05:34 +0000)]
MIPS: move mips_{set,get}_machine_name() to a more generic place

Previously this functionality was only available to users of the mips_machine
api. Moving the code to prom.c allows us to also add a OF wrapper.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5164/

11 years agoMIPS: octeon: Fix GPIO number in IRQ chip private data
Alexander Sverdlin [Thu, 11 Apr 2013 15:29:39 +0000 (17:29 +0200)]
MIPS: octeon: Fix GPIO number in IRQ chip private data

Current GPIO chip implementation in octeon-irq is still broken, even after upstream
commit 87161ccdc61862c8b49e75c21209d7f79dc758e9 (MIPS: Octeon: Fix broken interrupt
controller code). It works for GPIO IRQs that have reset-default configuration, but
not for edge-triggered ones.

The problem is in octeon_irq_gpio_map_common(), which passes modified "hw" variable
(which has range of possible values 16..31) as "gpio_line" parameter to
octeon_irq_set_ciu_mapping(), which saves it in private data of the IRQ chip. Later,
neither octeon_irq_gpio_setup() is able to re-configure GPIOs (cvmx_write_csr() is
writing to non-existent CVMX_GPIO_BIT_CFGX), nor octeon_irq_ciu_gpio_ack() is able
to acknowledge such IRQ, because "mask" is incorrect.

Fix is trivial and has been tested on Cavium Octeon II -based board, including
both level-triggered and edge-triggered GPIO IRQs.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin.ext@nsn.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: http://patchwork.linux-mips.org/patch/4980/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: pci: convert to devm_ioremap_resource()
Silviu-Mihai Popescu [Tue, 12 Mar 2013 10:30:05 +0000 (10:30 +0000)]
MIPS: pci: convert to devm_ioremap_resource()

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Patchwork: http://patchwork.linux-mips.org/patch/4986/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Remove unneeded volatile from arch/mips/lib/bitops.c
David Daney [Tue, 26 Feb 2013 22:22:33 +0000 (22:22 +0000)]
MIPS: Remove unneeded volatile from arch/mips/lib/bitops.c

The operations on the bitmap pointers are protected by "memory"
clobbering raw_local_irq_{save,restore}(), so there is no need for
volatile here.  By removing the volatile we get better code generation
out of the compiler.

Signed-off-by: David Daney <david.daney@cavium.com>
Patchwork: http://patchwork.linux-mips.org/patch/4966/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Init new mmu_context for each possible CPU to avoid memory corruption
Huacai Chen [Sun, 17 Mar 2013 11:50:14 +0000 (11:50 +0000)]
MIPS: Init new mmu_context for each possible CPU to avoid memory corruption

Currently, init_new_context() only for each online CPU, this may cause
memory corruption when CPU hotplug and fork() happens at the same time.
To avoid this, we make init_new_context() cover each possible CPU.

Scenario:
1, CPU#1 is being offline;
2, On CPU#0, do_fork() call dup_mm() and copy a mm_struct to the child;
3, On CPU#0, dup_mm() call init_new_context(), since CPU#1 is offline
   and init_new_context() only covers the online CPUs, child has the
   same asid as its parent on CPU#1 (however, child's asid should be 0);
4, CPU#1 is being online;
5, Now, if both parent and child run on CPU#1, memory corruption (e.g.
   segfault, bus error, etc.) will occur.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: http://patchwork.linux-mips.org/patch/4995/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Build uasm-generated code only once to avoid CPU Hotplug problem
Huacai Chen [Sun, 17 Mar 2013 11:49:38 +0000 (11:49 +0000)]
MIPS: Build uasm-generated code only once to avoid CPU Hotplug problem

This and the next patch resolve memory corruption problems while CPU
hotplug. Without these patches, memory corruption can triggered easily
as below:

On a quad-core MIPS platform, use "spawn" of UnixBench-5.1.3 (http://
code.google.com/p/byte-unixbench/) and a CPU hotplug script like this
(hotplug.sh):
while true; do
echo 0 >/sys/devices/system/cpu/cpu1/online
echo 0 >/sys/devices/system/cpu/cpu2/online
echo 0 >/sys/devices/system/cpu/cpu3/online
sleep 1
echo 1 >/sys/devices/system/cpu/cpu1/online
echo 1 >/sys/devices/system/cpu/cpu2/online
echo 1 >/sys/devices/system/cpu/cpu3/online
sleep 1
done

Run "hotplug.sh" and then run "spawn 10000", spawn will get segfault
after a few minutes.

This patch:
Currently, clear_page()/copy_page() are generated by Micro-assembler
dynamically. But they are unavailable until uasm_resolve_relocs() has
finished because jump labels are illegal before that. Since these
functions are shared by every CPU, we only call build_clear_page()/
build_copy_page() only once at boot time. Without this patch, programs
will get random memory corruption (segmentation fault, bus error, etc.)
while CPU Hotplug (e.g. one CPU is using clear_page() while another is
generating it in cpu_cache_init()).

For similar reasons we modify build_tlb_refill_handler()'s invocation.

V2:
1, Rework the code to make CPU#0 can be online/offline.
2, Introduce cpu_has_local_ebase feature since some types of MIPS CPU
   need a per-CPU tlb_refill_handler().

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Hongbing Hu <huhb@lemote.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: http://patchwork.linux-mips.org/patch/4994/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Kconfig: remove "config MIPS_DISABLE_OBSOLETE_IDE"
Paul Bolle [Mon, 8 Apr 2013 17:51:13 +0000 (17:51 +0000)]
MIPS: Kconfig: remove "config MIPS_DISABLE_OBSOLETE_IDE"

The Kconfig symbol MIPS_DISABLE_OBSOLETE_IDE was added in v2.6.10. It
has never been used. Let's remove it.

The symbol was originally introduced by the following commit

commit 2bfa662b64a7ee593f3039c1d3fd81a7766a63cd
Author: Pete Popov <ppopov@embeddedalley.com>
Date:   Tue Oct 12 06:24:19 2004 +0000
    - Db1550 bug fixes
    - updated defconfig
    - updated Kconfig to use DMA_COHERENT since new silicon is coherent

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Patchwork: http://patchwork.linux-mips.org/patch/5064/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Kconfig: remove "config MIPS_BOARDS_GEN"
Paul Bolle [Mon, 8 Apr 2013 17:06:31 +0000 (17:06 +0000)]
MIPS: Kconfig: remove "config MIPS_BOARDS_GEN"

The Kconfig symbol MIPS_BOARDS_GEN is unused since v2.6.27. It should
now be removed.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Patchwork: http://patchwork.linux-mips.org/patch/5063/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: remove obsolete Kconfig macros
Paul Bolle [Mon, 25 Mar 2013 20:27:19 +0000 (20:27 +0000)]
MIPS: remove obsolete Kconfig macros

The support for PB1100, PB1500, and PB1550 got merged into the code for
DB1000 and DB1550 code in v3.7. When that was done the three related
Kconfig symbols were dropped. But not all related Kconfig macros were
removed. Do so now.

Note that the PB1100 code in the Au1100 LCD driver is removed entirely
and not converted to use its current Kconfig macro. That is done because
the macros it uses (PB1100_G_CONTROL, PB1100_G_CONTROL_BL, and
PB1100_G_CONTROL_VDD) are never defined. Actually only one of these was
ever defined (PB1100_G_CONTROL) but that define was removed in v2.6.34.
So, as far as I can tell, this code could have never compiled.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Patchwork: http://patchwork.linux-mips.org/patch/5040/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: Fix oprofile compile on XLR uniprocessor
Jayachandran C [Mon, 25 Mar 2013 06:51:52 +0000 (06:51 +0000)]
MIPS: Netlogic: Fix oprofile compile on XLR uniprocessor

The commit c783390a0ecef08df5c804f8c5f647431a04f502 [MIPS: oprofile:
Support for XLR/XLS processors] causes a compilation failure when
oprofile is enabled and SMP is not configured.

arch/mips/oprofile/op_model_mipsxx.c: In function 'mipsxx_cpu_setup':
arch/mips/oprofile/op_model_mipsxx.c:181:2: error: implicit declaration of function 'cpu_logical_map'

To fix this, update oprofile_skip_cpu to not call cpu_logical_map when
CONFIG_SMP is not defined.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5037/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: Merge platform usb.h to usb-init.c
Jayachandran C [Sat, 23 Mar 2013 17:28:00 +0000 (17:28 +0000)]
MIPS: Netlogic: Merge platform usb.h to usb-init.c

The definitions are not used anywhere else, and merging it will
make adding the new USB definitions for XLPII series easier.
While there, cleanup some whitespace in usb-init.c. There is no
change to logic due to this commit.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5027/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: Support for multiple built-in device trees
Jayachandran C [Sat, 23 Mar 2013 17:27:59 +0000 (17:27 +0000)]
MIPS: Netlogic: Support for multiple built-in device trees

This enables us to have a default device tree per SoC family to be built
into the kernel. The default device tree for XLP3xx has been added as part
of this change. Later this can be used to provide support default boards
for XLP2xx and XLP9xx SoCs.

Kconfig options are provided for each default device tree so that just the
needed ones can be selected to be built into the kernel.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5023/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: Remove unused code
Jayachandran C [Sat, 23 Mar 2013 17:27:58 +0000 (17:27 +0000)]
MIPS: Netlogic: Remove unused code

Remove unused functions and redundant comments from
arch/mips/include/asm/netlogic/haldefs.h

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5029/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: Add 32-bit support for XLP
Jayachandran C [Sat, 23 Mar 2013 17:27:57 +0000 (17:27 +0000)]
MIPS: Netlogic: Add 32-bit support for XLP

Update asm/netlogic/haldefs.h to extend register access functions
nlm_{read,write}_reg64() for 32-bit compilation. When compiled for 32-bit
the functions will read 64 IO registers with interrupts disabled.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5026/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: Avoid using fixed PIC IRT index
Jayachandran C [Sat, 23 Mar 2013 17:27:56 +0000 (17:27 +0000)]
MIPS: Netlogic: Avoid using fixed PIC IRT index

The index for a device interrupt in the PIC interrupt routing table
changes for different chips in the XLP family.  Avoid using the fixed
entries and derive the index value from the SoC device header.

Add workarounds for some devices which do not report the IRT index
correctly.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5025/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: print cpumask with cpumask_scnprintf
Jayachandran C [Sat, 23 Mar 2013 17:27:55 +0000 (17:27 +0000)]
MIPS: Netlogic: print cpumask with cpumask_scnprintf

Use standard function to print cpumask. Also fixup the name of the
variable used and make it static.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5024/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: Remove unused EIMR/EIRR functions
Jayachandran C [Sat, 23 Mar 2013 17:27:54 +0000 (17:27 +0000)]
MIPS: Netlogic: Remove unused EIMR/EIRR functions

Remove the definitions of {read,write}_c0_{eirr,eimr}. These functions
are now unused after the PIC and IRQ code has been updated to use
optimized EIMR/EIRR functions which work on both 32-bit and 64-bit.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5021/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: Netlogic: Optimize and fix write_c0_eimr()
Jayachandran C [Sat, 23 Mar 2013 17:27:53 +0000 (17:27 +0000)]
MIPS: Netlogic: Optimize and fix write_c0_eimr()

Remove the irq save/restore from write_c0_eimr(), as it is always called
with interrupts off.

This allows us to remove workaround in write_c0_eimr() to fix up the
flags used by local_irq_save. This fixup worked on XLR, but will break
when 32-bit support is added to r2 cpus like XLP.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5022/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: BCM63XX: merge bcm63xx_clk.h into bcm63xx/clk.c
Jonas Gorski [Sat, 6 Apr 2013 10:31:02 +0000 (10:31 +0000)]
MIPS: BCM63XX: merge bcm63xx_clk.h into bcm63xx/clk.c

All the header file does is provide the internal structure of clk,
which shouldn't be used by anyone except clk.c itself anyway.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Patchwork: http://patchwork.linux-mips.org/patch/5055/
Acked-by: John Crispin <blogic@openwrt.org>
11 years agoMIPS: BCM63XX: add flash detection for BCM6362
Jonas Gorski [Thu, 21 Mar 2013 14:03:20 +0000 (14:03 +0000)]
MIPS: BCM63XX: add flash detection for BCM6362

BCM6362 support booting from SPI flash and NAND.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5012/
Acked-by: John Crispin <blogic@openwrt.org>