25 Jan, 2016

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for MIPS for 4.5 plus some 4.4 fixes.

    The executive summary:

    - ATH79 platform improvments, use DT bindings for the ATH79 USB PHY.
    - Avoid useless rebuilds for zboot.
    - jz4780: Add NEMC, BCH and NAND device tree nodes
    - Initial support for the MicroChip's DT platform. As all the device
    drivers are missing this is still of limited use.
    - Some Loongson3 cleanups.
    - The unavoidable whitespace polishing.
    - Reduce clock skew when synchronizing the CPU cycle counters on CPU
    startup.
    - Add MIPS R6 fixes.
    - Lots of cleanups across arch/mips as fallout from KVM.
    - Lots of minor fixes and changes for IEEE 754-2008 support to the
    FPU emulator / fp-assist software.
    - Minor Ralink, BCM47xx and bcm963xx platform support improvments.
    - Support SMP on BCM63168"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (84 commits)
    MIPS: zboot: Add support for serial debug using the PROM
    MIPS: zboot: Avoid useless rebuilds
    MIPS: BMIPS: Enable ARCH_WANT_OPTIONAL_GPIOLIB
    MIPS: bcm63xx: nvram: Remove unused bcm63xx_nvram_get_psi_size() function
    MIPS: bcm963xx: Update bcm_tag field image_sequence
    MIPS: bcm963xx: Move extended flash address to bcm_tag header file
    MIPS: bcm963xx: Move Broadcom BCM963xx image tag data structure
    MIPS: bcm63xx: nvram: Use nvram structure definition from header file
    MIPS: bcm963xx: Add Broadcom BCM963xx board nvram data structure
    MAINTAINERS: Add KVM for MIPS entry
    MIPS: KVM: Add missing newline to kvm_err()
    MIPS: Move KVM specific opcodes into asm/inst.h
    MIPS: KVM: Use cacheops.h definitions
    MIPS: Break down cacheops.h definitions
    MIPS: Use EXCCODE_ constants with set_except_vector()
    MIPS: Update trap codes
    MIPS: Move Cause.ExcCode trap codes to mipsregs.h
    MIPS: KVM: Make kvm_mips_{init,exit}() static
    MIPS: KVM: Refactor added offsetof()s
    MIPS: KVM: Convert EXPORT_SYMBOL to _GPL
    ...

    Linus Torvalds
     

24 Jan, 2016

39 commits

  • Ralf Baechle
     
  • As most platforms implement the PROM serial interface prom_putchar()
    add a simple bridge to allow re-using this code for zboot.

    Signed-off-by: Alban Bedel
    Cc: Alex Smith
    Cc: Andrew Bresticker
    Cc: Wu Zhangjin
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11811/
    Signed-off-by: Ralf Baechle

    Alban Bedel
     
  • Add dummy.o to the targets list, and fill targets automatically from
    $(vmlinuzobjs) to avoid having to maintain two lists.

    When building with XZ compression copy ashldi3.c to the build
    directory to use a different object file for the kernel and zboot.
    Without this the same object file need to be build with different
    flags which cause a rebuild at every run.

    Signed-off-by: Alban Bedel
    Cc: linux-mips@linux-mips.org
    Cc: Alex Smith
    Cc: Wu Zhangjin
    Cc: Andrew Bresticker
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11810/
    Signed-off-by: Ralf Baechle

    Alban Bedel
     
  • Allow BMIPS_GENERIC supported platforms to build GPIO controller
    drivers.

    Signed-off-by: Florian Fainelli
    Reviewed-by: Dragan Stancevic
    Cc: cernekee@gmail.com
    Cc: jaedon.shin@gmail.com
    Cc: gregory.0xf0@gmail.com
    Cc: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12019/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • Remove bcm63xx_nvram_get_psi_size() as it now has no users.

    Signed-off-by: Simon Arlott
    Cc: David Woodhouse
    Cc: Brian Norris
    Cc: Kevin Cernekee
    Cc: Florian Fainelli
    Cc: Jonas Gorski
    Cc: Linux Kernel Mailing List
    Cc: MIPS Mailing List
    Cc: MTD Maling List
    Patchwork: https://patchwork.linux-mips.org/patch/11836/
    Signed-off-by: Ralf Baechle

    Simon Arlott
     
  • Move Broadcom BCM963xx image tag data structure to include/linux/
    so that drivers outside of mach-bcm63xx can use it.

    Signed-off-by: Simon Arlott
    Cc: David Woodhouse
    Cc: Brian Norris
    Cc: Kevin Cernekee
    Cc: Florian Fainelli
    Cc: Jonas Gorski
    Cc: Linux Kernel Mailing List
    Cc: MIPS Mailing List
    Cc: MTD Maling List
    Patchwork: https://patchwork.linux-mips.org/patch/11832/
    Signed-off-by: Ralf Baechle

    Simon Arlott
     
  • Use the common definition of the nvram structure from the header file
    include/linux/bcm963xx_nvram.h instead of maintaining a separate copy.

    Read the version 5 size of nvram data from memory and then call the
    new checksum verification function from the header file.

    Signed-off-by: Simon Arlott
    Cc: David Woodhouse
    Cc: Brian Norris
    Cc: Kevin Cernekee
    Cc: Florian Fainelli
    Cc: Jonas Gorski
    Cc: Linux Kernel Mailing List
    Cc: MIPS Mailing List
    Cc: MTD Maling List
    Patchwork: https://patchwork.linux-mips.org/patch/11831/
    Signed-off-by: Ralf Baechle

    Simon Arlott
     
  • Add missing newline to end of kvm_err string when guest PMAP couldn't be
    allocated.

    Signed-off-by: James Hogan
    Cc: Gleb Natapov
    Cc: Paolo Bonzini
    Cc: kvm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11896/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • The header arch/mips/kvm/opcode.h defines a few extra opcodes which
    aren't in arch/mips/include/uapi/asm/inst.h. There's nothing KVM
    specific about them, so lets move them into inst.h where they belong and
    delete the header.

    Note that mfmcz_op is renamed to mfmc0_op to match the instruction set
    manual, and wait_op was already added to inst.h in commit b0a3eae2b943
    ("MIPS: inst.h: define COP0 wait op"), merged in v3.16-rc1.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11895/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Drop the custom cache operation code definitions used by KVM for
    emulating guest CACHE instructions, and switch to use the existing
    definitions in .

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: kvm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11893/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Most of the cache op codes defined in cacheops.h are split into a 2-bit
    cache identifier, and a 3-bit cache op code which does largely the same
    thing semantically regardless of the cache identifier.

    To allow the use of these definitions by KVM for decoding cache ops,
    break the definitions down into parts where it makes sense to do so, and
    add masks for the Cache and Op field within the cache op.

    Signed-off-by: James Hogan
    Cc: linux-mips@linux-mips.org
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11892/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • The first argument to set_except_vector is the ExcCode, which we now
    have definitions for. Lets make use of them.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11894/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Add a few missing trap codes.

    [ralf@linux-mips.org: Drop removal of exception codes. I don't care what
    the incomplete architecture spec says; it can't change existing hardware
    and VCEI is supported indeed.]

    Signed-off-by: James Hogan
    Cc: linux-mips@linux-mips.org
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11890/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Move the Cause.ExcCode trap code definitions from kvm_host.h to
    mipsregs.h, since they describe architectural bits rather than KVM
    specific constants, and change the prefix from T_ to EXCCODE_.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11891/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • The module init and exit functions have no need to be global, so make
    them static.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: kvm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11889/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • When calculating the offsets into the commpage for dynamically
    translated mtc0/mfc0 guest instructions, multiple offsetof()s are added
    together to find the offset of the specific register in the mips_coproc,
    within the commpage.

    Simplify each of these cases to a single offsetof() to find the offset
    of the specific register within the commpage.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11888/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Export symbols only to GPL modules to match other KVM symbols in
    virt/kvm/ and arch/*/kvm/.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11887/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • The function kvm_mips_host_tlb_inv_index() is unused, so drop it
    completely.

    Signed-off-by: James Hogan
    Cc: Ralf Baechle
    Cc: Gleb Natapov
    Cc: Paolo Bonzini
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11886/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • The CAUSEB_DC and CAUSEF_DC definitions used by KVM are defined in
    asm/kvm_host.h, but all the other Cause register field definitions are
    found in asm/mipsregs.h.

    Lets reunite the DC bit definitions with its friends in mipsregs.h.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11885/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Some definitions in the MIPS asm/kvm_host.h are completely unused, so
    lets drop them.

    MS_TO_NS is no longer used since commit e30492bbe95a ("MIPS: KVM:
    Rewrite count/compare timer emulation"). The others don't appear ever to
    have been used.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Gleb Natapov
    Cc: kvm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11884/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • A bunch of misc whitespace and style fixes within arch/mips/kvm/.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: Ralf Baechle
    Cc: Gleb Natapov
    Cc: kvm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11883/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • This adds an initial default config that enables all available PIC32
    drivers and is enough for booting a PIC32MZDA Starter Kit.

    Signed-off-by: Joshua Henderson
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12105/
    Signed-off-by: Ralf Baechle

    Joshua Henderson
     
  • This adds basic DTS configuration for the PIC32MZDA chip and in turn the
    PIC32MZDA Starter Kit.

    Signed-off-by: Joshua Henderson
    Cc: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Kumar Gala
    Cc: Andrew Bresticker
    Cc: Paul Burton
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12104/
    Signed-off-by: Ralf Baechle

    Joshua Henderson
     
  • This adds support for the Microchip PIC32 MIPS microcontroller with the
    specific variant PIC32MZDA. PIC32MZDA is based on the MIPS m14KEc core
    and boots using device tree.

    This includes an early pin setup and early clock setup needed prior to
    device tree being initialized. In additon, an interface is provided to
    synchronize access to registers shared across several peripherals.

    Signed-off-by: Joshua Henderson
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12097/
    Signed-off-by: Ralf Baechle

    Joshua Henderson
     
  • Add brcm,bcm6358-leds node to bcm6368.dtsi
    Add reboot support (syscon-reboot as defined in BCM6328)

    Signed-off-by: Álvaro Fernández Rojas
    Reviewed-by: Florian Fainelli
    Cc: f.fainelli@gmail.com
    Cc: jogo@openwrt.org
    Cc: cernekee@gmail.com
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Cc: Álvaro Fernández Rojas
    Patchwork: https://patchwork.linux-mips.org/patch/12117/
    Signed-off-by: Ralf Baechle

    Álvaro Fernández Rojas
     
  • Adds bcm6328-leds node to bcm6328.dtsi

    Signed-off-by: Álvaro Fernández Rojas
    Reviewed-by: Florian Fainelli
    Cc: jogo@openwrt.org
    Cc: cernekee@gmail.com
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Cc: Álvaro Fernández Rojas
    Patchwork: https://patchwork.linux-mips.org/patch/12116/
    Signed-off-by: Ralf Baechle

    Álvaro Fernández Rojas
     
  • The cp0_tcstatus member of struct pt_regs was removed along with the
    rest of SMTC in v3.16, commit b633648c5ad3 ("MIPS: MT: Remove SMTC
    support"), however recent uprobes support in v4.3 added back a reference
    to it in the regoffset_table[] in ptrace.c. Remove it.

    Signed-off-by: James Hogan
    Fixes: 40e084a506eb ("MIPS: Add uprobes support.")
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11920/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • As we want gpio_chip .get() calls to be able to return negative
    error codes and propagate to drivers, we need to go over all
    drivers and make sure their return values are clamped to [0,1].
    We do this by using the ret = !!(val) design pattern.

    Signed-off-by: Linus Walleij
    Cc: linux-mips@linux-mips.org
    Cc: linux-gpio@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11925/
    Signed-off-by: Ralf Baechle

    Linus Walleij
     
  • As we want gpio_chip .get() calls to be able to return negative
    error codes and propagate to drivers, we need to go over all
    drivers and make sure their return values are clamped to [0,1].
    We do this by using the ret = !!(val) design pattern.

    Signed-off-by: Linus Walleij
    Cc: linux-mips@linux-mips.org
    Cc: linux-gpio@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11924/
    Signed-off-by: Ralf Baechle

    Linus Walleij
     
  • As we want gpio_chip .get() calls to be able to return negative
    error codes and propagate to drivers, we need to go over all
    drivers and make sure their return values are clamped to [0,1].
    We do this by using the ret = !!(val) design pattern.

    Signed-off-by: Linus Walleij
    Cc: linux-mips@linux-mips.org
    Cc: linux-gpio@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11923/
    Signed-off-by: Ralf Baechle

    Linus Walleij
     
  • As we want gpio_chip .get() calls to be able to return negative
    error codes and propagate to drivers, we need to go over all
    drivers and make sure their return values are clamped to [0,1].
    We do this by using the ret = !!(val) design pattern.

    Signed-off-by: Linus Walleij
    Acked-by: Florian Fainelli
    Cc: Alban Bedel
    Cc: linux-mips@linux-mips.org
    Cc: linux-gpio@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11922/
    Signed-off-by: Ralf Baechle

    Linus Walleij
     
  • As we want gpio_chip .get() calls to be able to return negative
    error codes and propagate to drivers, we need to go over all
    drivers and make sure their return values are clamped to [0,1].
    We do this by using the ret = !!(val) design pattern.

    Signed-off-by: Linus Walleij
    Cc: linux-mips@linux-mips.org
    Cc: linux-gpio@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11921/
    Signed-off-by: Ralf Baechle

    Linus Walleij
     
  • Change the CONFIG_MIPS_CMDLINE_EXTEND to CONFIG_MIPS_CMDLINE_DTB_EXTEND
    to resolve the EXTEND_WITH_PROM macro.

    Signed-off-by: Jaedon Shin
    Fixes: 2024972ef533 ("MIPS: Make the kernel arguments from dtb available")
    Reviewed-by: Alexander Sverdlin
    Cc: Jonas Gorski
    Cc: Masahiro Yamada
    Cc: Paul Burton
    Cc: Aaro Koskinen
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11909/
    Signed-off-by: Ralf Baechle

    Jaedon Shin
     
  • The kernel currently assumes that a core will start up in legacy mode
    using the exception base provided through the CM GCR registers. If a
    core has been configured in hardware to start in EVA mode, these
    assumptions will fail.

    This patch ensures that secondary cores are initialized to meet these
    assumptions.

    Signed-off-by: Matt Redfearn
    Reviewed-by: Paul Burton
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11907/
    Signed-off-by: Ralf Baechle

    Matt Redfearn
     
  • Signed-off-by: Maciej W. Rozycki
    Cc: Brian Norris
    Cc: Rafał Miłecki
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12040/
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Signed-off-by: Maciej W. Rozycki
    Cc: Aurelien Jarno
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12178/
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Fix the description of the microMIPS NOP16 encoding or MM_NOP16, which
    is not equivalent to the MIPS16 NOP instruction. This is 0x0c00 and
    represents the microMIPS `MOVE16 $0, $0' operation, whereas MIPS16 NOP
    is encoded as 0x6500, representing `MOVE $0, $16'.

    Also fix a typo in `mm_fp0_format' description.

    Signed-off-by: Maciej W. Rozycki
    Cc: Aurelien Jarno
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12177/
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Remove irrelevant content from the description of the emulation frame in
    `mips_dsemul', referring to bare-metal configurations. Update the text,
    reflecting the change made with commit ba3049ed4086 ("MIPS: Switch FPU
    emulator trap to BREAK instruction."), where we switched from using an
    address error exception on an unaligned access to the use of a BREAK 514
    instruction causing a breakpoint exception instead.

    Signed-off-by: Maciej W. Rozycki
    Cc: Aurelien Jarno
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12176/
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Emulate the microMIPS ADDIUPC instruction directly in `mips_dsemul'. If
    executed in the emulation frame, this instruction produces an incorrect
    result, because the value of the PC there is not the same as where the
    instruction originated.

    Reshape code so as to handle all microMIPS cases together.

    Signed-off-by: Maciej W. Rozycki
    Cc: Aurelien Jarno
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12175/
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki