1. 01 6月, 2018 1 次提交
  2. 23 3月, 2018 1 次提交
    • M
      MIPS: Use the entry point from the ELF file header · 27c524d1
      Maciej W. Rozycki 提交于
      In order to fetch the correct entry point with the ISA bit included, for
      use by non-ELF boot loaders, parse the output of `objdump -f' for the
      start address recorded in the kernel executable itself, rather than
      using `nm' to get the value of the `kernel_entry' symbol.
      
      Sign-extend the address retrieved if 32-bit, so that execution is
      correctly started on 64-bit processors as well.  The tool always prints
      the entry point using either 8 or 16 hexadecimal digits, matching the
      address width (aka class) of the ELF file, even in the presence of
      leading zeros.
      Signed-off-by: NMaciej W. Rozycki <macro@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/18912/Signed-off-by: NJames Hogan <jhogan@kernel.org>
      27c524d1
  3. 22 3月, 2018 1 次提交
  4. 05 3月, 2018 1 次提交
    • J
      MIPS: Expand help text to list generic defconfigs · cccd0b9a
      James Hogan 提交于
      Expand the MIPS Makefile help text to list generic board names, generic
      defconfigs, and legacy defconfigs which have been converted to generic
      and are still usable.
      
      Here's a snippet of the new "make ARCH=mips help" output:
        ...
        If you are targeting a system supported by generic kernels you may
        configure the kernel for a given architecture target like so:
      
        {micro32,32,64}{r1,r2,r6}{el,}_defconfig <BOARDS="list of boards">
      
        Where BOARDS is some subset of the following:
          boston
          ni169445
          ranchu
          sead-3
          xilfpga
      
        Specifically the following generic default configurations are
        supported:
      
        32r1_defconfig           - Build generic kernel for MIPS32 r1
        32r1el_defconfig         - Build generic kernel for MIPS32 r1 little endian
        32r2_defconfig           - Build generic kernel for MIPS32 r2
        32r2el_defconfig         - Build generic kernel for MIPS32 r2 little endian
        32r6_defconfig           - Build generic kernel for MIPS32 r6
        32r6el_defconfig         - Build generic kernel for MIPS32 r6 little endian
        64r1_defconfig           - Build generic kernel for MIPS64 r1
        64r1el_defconfig         - Build generic kernel for MIPS64 r1 little endian
        64r2_defconfig           - Build generic kernel for MIPS64 r2
        64r2el_defconfig         - Build generic kernel for MIPS64 r2 little endian
        64r6_defconfig           - Build generic kernel for MIPS64 r6
        64r6el_defconfig         - Build generic kernel for MIPS64 r6 little endian
        micro32r2_defconfig      - Build generic kernel for microMIPS32 r2
        micro32r2el_defconfig    - Build generic kernel for microMIPS32 r2 little endian
      
        The following legacy default configurations have been converted to
        generic and can still be used:
      
        sead3_defconfig          - Build 32r2el_defconfig BOARDS=sead-3
        sead3micro_defconfig     - Build micro32r2el_defconfig BOARDS=sead-3
        xilfpga_defconfig        - Build 32r2el_defconfig BOARDS=xilfpga
        ...
      Signed-off-by: NJames Hogan <jhogan@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Matt Redfearn <matt.redfearn@mips.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kbuild@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/18598/
      cccd0b9a
  5. 20 2月, 2018 2 次提交
  6. 23 1月, 2018 1 次提交
    • J
      MIPS: XPA: Use XPA instructions in assembly · 8e4789d2
      James Hogan 提交于
      Utilise XPA instructions MFHC0 & MTHC0 in inline assembly instead of
      directly encoding them with the _ASM_INSN* macros, and transparently
      implement these instructions as assembler macros if the toolchain
      doesn't support them natively, using the recently introduced assembler
      macro helpers.
      
      The old direct encodings were restricted to using the register $at, so
      this allows the extra register moves to go away (saving a grand total of
      24 bytes).
      Signed-off-by: NJames Hogan <jhogan@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17775/
      8e4789d2
  7. 19 1月, 2018 1 次提交
  8. 09 11月, 2017 2 次提交
  9. 06 9月, 2017 1 次提交
  10. 30 8月, 2017 2 次提交
    • P
      MIPS: Prevent direct use of generic_defconfig · a4c2f797
      Paul Burton 提交于
      Using generic_defconfig directly is unlikely to be what a user actually
      wants to do - it doesn't specify any particular ISA revision & it
      doesn't enable any board or driver support, resulting in a largely
      useless kernel.
      
      Prevent users from using it directly, printing a helpful message to
      point them in the right direction if they attempt to.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16946/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a4c2f797
    • P
      MIPS: generic: Allow filtering enabled boards by requirements · 27e0d4b0
      Paul Burton 提交于
      Up until now when configuring a generic kernel all board config
      fragments have been merged by default unless boards are explicitly
      selected by the user specifying BOARDS=.
      
      In many cases this is sub-optimal, since some boards don't make sense to
      include in some kernels. For example the MIPS SEAD-3 development board
      has only ever been used with 32 bit CPUs, so including support for the
      SEAD-3 in a 64 bit kernel is wasteful.
      
      This patch introduces support for specifying requirements in board
      config fragments, using comments formatted like so:
      
        # require CONFIG_BLA=y
      
      For example the SEAD-3 board could specify that it should only be merged
      for 32 bit kernels using a requirement line like the following:
      
        # require CONFIG_32BIT=y
      
      A new generic-board-config.sh script is introduced to handle selecting
      the board config fragments to merge & calling merge_config.sh to merge
      them. In order to allow requirements to check Kconfig symbols that are
      implicitly selected, rather than explicitly specified by
      generic_defconfig or one of the ISA config fragments, an intermediate
      .config file is saved & used as a reference when checking requirements.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16943/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      27e0d4b0
  11. 29 8月, 2017 2 次提交
  12. 08 8月, 2017 1 次提交
    • P
      MIPS: Set ISA bit in entry-y for microMIPS kernels · 5fc9484f
      Paul Burton 提交于
      When building a kernel for the microMIPS ISA, ensure that the ISA bit
      (ie. bit 0) in the entry address is set. Otherwise we may include an
      entry address in images which bootloaders will jump to as MIPS32 code.
      
      I originally tried using "objdump -f" to obtain the entry address, which
      works for microMIPS but it always outputs a 32 bit address for a 32 bit
      ELF whilst nm will sign extend to 64 bit. That matters for systems where
      we might want to run a MIPS32 kernel on a MIPS64 CPU & load it with a
      MIPS64 bootloader, which would then jump to a non-canonical
      (non-sign-extended) address.
      
      This works in all cases as it only changes the behaviour for microMIPS
      kernels, but isn't the prettiest solution. A possible alternative would
      be to write a custom tool to just extract, sign extend & print the entry
      point of an ELF executable. I'm open to feedback if that would be
      preferred.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16950/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5fc9484f
  13. 29 6月, 2017 1 次提交
    • M
      MIPS: build: Fix "-modd-spreg" switch usage when compiling for mips32r6 · 21855a6e
      Miodrag Dinic 提交于
      Add "-modd-spreg" when compiling the kernel for mips32r6 target.
      
      This makes sure the kernel builds properly even with toolchains that
      use "-mno-odd-spreg" by default. This is the case with Android gcc.
      Prior to this patch, kernel builds using gcc for Android failed with
      following error messages, if target architecture is set to mips32r6:
      
      arch/mips/kernel/r4k_switch.S: Assembler messages:
      .../r4k_switch.S:210: Error: float register should be even, was 1
      .../r4k_switch.S:212: Error: float register should be even, was 3
      .../r4k_switch.S:214: Error: float register should be even, was 5
      .../r4k_switch.S:216: Error: float register should be even, was 7
      .../r4k_switch.S:218: Error: float register should be even, was 9
      .../r4k_switch.S:220: Error: float register should be even, was 11
      .../r4k_switch.S:222: Error: float register should be even, was 13
      .../r4k_switch.S:224: Error: float register should be even, was 15
      .../r4k_switch.S:226: Error: float register should be even, was 17
      .../r4k_switch.S:228: Error: float register should be even, was 19
      .../r4k_switch.S:230: Error: float register should be even, was 21
      .../r4k_switch.S:232: Error: float register should be even, was 23
      .../r4k_switch.S:234: Error: float register should be even, was 25
      .../r4k_switch.S:236: Error: float register should be even, was 27
      .../r4k_switch.S:238: Error: float register should be even, was 29
      .../r4k_switch.S:240: Error: float register should be even, was 31
      make[2]: *** [arch/mips/kernel/r4k_switch.o] Error 1
      Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com>
      Signed-off-by: NGoran Ferenc <goran.ferenc@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Cc: James.Hogan@imgtec.com
      Cc: Paul.Burton@imgtec.com
      Cc: Raghu.Gandham@imgtec.com
      Cc: Leonid.Yegoshin@imgtec.com
      Cc: Douglas.Leung@imgtec.com
      Cc: Petar.Jovanovic@imgtec.com
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16509/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      21855a6e
  14. 11 4月, 2017 1 次提交
    • M
      MIPS: generic: fix out-of-tree defconfig target builds · 337b775b
      Marcin Nowakowski 提交于
      When specifying a generic defconfig target with O=... option set, make
      is invoked in the output location before a target makefile wrapper is
      created. Ensure that the correct makefile is used by specifying the
      kernel source makefile during make invocation.
      
      This fixes the either of the following errors:
      
      $ make sead3_defoncifg ARCH=mips O=test
      make[1]: Entering directory '/mnt/ssd/MIPS/linux-next/test'
      make[2]: *** No rule to make target '32r2el_defconfig'.  Stop.
      arch/mips/Makefile:506: recipe for target 'sead3_defconfig' failed
      make[1]: *** [sead3_defconfig] Error 2
      make[1]: Leaving directory '/mnt/ssd/MIPS/linux-next/test'
      Makefile:152: recipe for target 'sub-make' failed
      make: *** [sub-make] Error 2
      
      $ make 32r2el_defconfig ARCH=mips O=test
      make[1]: Entering directory '/mnt/ssd/MIPS/linux-next/test'
      Using ../arch/mips/configs/generic_defconfig as base
      Merging ../arch/mips/configs/generic/32r2.config
      Merging ../arch/mips/configs/generic/el.config
      Merging ../arch/mips/configs/generic/board-sead-3.config
      !
      ! merged configuration written to .config (needs make)
      !
      make[2]: *** No rule to make target 'olddefconfig'.  Stop.
      arch/mips/Makefile:489: recipe for target '32r2el_defconfig' failed
      make[1]: *** [32r2el_defconfig] Error 2
      make[1]: Leaving directory '/mnt/ssd/MIPS/linux-next/test'
      Makefile:152: recipe for target 'sub-make' failed
      make: *** [sub-make] Error 2
      
      Fixes: eed0eabd ('MIPS: generic: Introduce generic DT-based board support')
      Fixes: 3f5f0a44 ('MIPS: generic: Convert SEAD-3 to a generic board')
      Signed-off-by: NMarcin Nowakowski <marcin.nowakowski@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15464/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      337b775b
  15. 14 2月, 2017 1 次提交
    • J
      MIPS: Disable stack checks on MIPS kernels · 573deec0
      Joshua Kinard 提交于
      Disable stack checking on MIPS kernels.  Some distribution toolchains
      might pass the -fstack-check option to gcc.  This results in a
      store-doubleword instruction being emitted at the top of all
      functions that checks the available stack space.  E.g.,
      
        a80000000001d740 <per_cpu_init>:
        a80000000001d740:       ffa0bfc0        sd      zero,-16448(sp)
        a80000000001d744:       2405ffc9        li      a1,-55
        a80000000001d748:       67bdffc0        daddiu  sp,sp,-64
      
      Generally, this is undesirable, and especially on the SGI IP27
      platform, it will trigger a NULL pointer dereference in
      '_raw_spin_lock_irq' during early init.
      Signed-off-by: NJoshua Kinard <kumba@gentoo.org>
      Suggested-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15132/Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      573deec0
  16. 25 1月, 2017 1 次提交
    • A
      MIPS: 'make -s' should be silent · 8c9b23ff
      Arnd Bergmann 提交于
      A clean mips64 build produces no output except for two lines:
      
        Checking missing-syscalls for N32
        Checking missing-syscalls for O32
      
      On other architectures, there is no output at all, so let's do the
      same here for the sake of build testing. The 'kecho' macro is used
      to print the message on a normal build but skip it with 'make -s'.
      
      Fixes: e48ce6b8 ("[MIPS] Simplify missing-syscalls for N32 and O32")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Matt Redfearn <matt.redfearn@imgtec.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Maarten ter Huurne <maarten@treewalker.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15040/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8c9b23ff
  17. 03 1月, 2017 2 次提交
  18. 04 11月, 2016 1 次提交
  19. 07 10月, 2016 3 次提交
    • P
      MIPS: generic: Convert SEAD-3 to a generic board · 3f5f0a44
      Paul Burton 提交于
      Convert the MIPS SEAD-3 board support to be a generic board, supported
      by generic kernels.
      
      Because the SEAD-3 boot protocol was defined long ago and we don't want
      to force a switch to the UHI protocol, SEAD-3 is added as a legacy board
      which is detected by reading the REVISION register. This may technically
      not be a valid memory read & future work will include attempting to
      handle that gracefully. In practice since SEAD-3 is the only legacy
      board supported by the generic kernel so far the read will only happen
      on SEAD-3 boards, and even once Malta is converted the same REVISION
      register exists there too. Other boards such as Boston, Ci20 & Ci40 will
      use the UHI boot protocol & thus not run any of the legacy board detect
      functions.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14354/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3f5f0a44
    • P
      MIPS: generic: Introduce generic DT-based board support · eed0eabd
      Paul Burton 提交于
      Introduce a "generic" platform, which aims to be board-agnostic by
      making use of device trees passed by the boot protocol defined in the
      MIPS UHI (Universal Hosting Interface) specification. Provision is made
      for supporting boards which use a legacy boot protocol that can't be
      changed, but adding support for such boards or any others is left to
      followon patches.
      
      Right now the built kernels expect to be loaded to 0x80100000, ie. in
      kseg0. This is fine for the vast majority of MIPS platforms, but
      nevertheless it would be good to remove this limitation in the future by
      mapping the kernel via the TLB such that it can be loaded anywhere & map
      itself appropriately.
      
      Configuration is handled by dynamically generating configs using
      scripts/kconfig/merge_config.sh, somewhat similar to the way powerpc
      makes use of it. This allows for variations upon the configuration, eg.
      differing architecture revisions or subsets of driver support for
      differing boards, to be handled without having a large number of
      defconfig files.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14353/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      eed0eabd
    • P
      MIPS: Support generating Flattened Image Trees (.itb) · cf2a5e0b
      Paul Burton 提交于
      Add support for generating kernel images in the Flattened Image Tree
      (.itb) format as supported by U-Boot. This format is essentially a
      Flattened Device Tree binary containing images (kernels, DTBs, ramdisks)
      and configurations which link those images together. The big advantages
      of FIT images over the uImage format are:
      
        - We can include FDTs in the kernel image in a way that the bootloader
          can extract it & manipulate it before providing it to the kernel.
          Thus we can ship FDTs as part of the kernel giving us the advantages
          of being able to develop & maintain the DT within the kernel tree,
          but also have the benefits of the bootloader being able to
          manipulate the FDT. Example uses for this would be to inject the
          kernel command line into the chosen node, or to fill in the correct
          memory size.
      
        - We can include multiple configurations in a single kernel image.
          This means that a single FIT image can, given appropriate
          bootloaders, be booted on different boards with the bootloader
          selecting an appropriate configuration & providing the correct FDT
          to the kernel.
      
        - We can support a multitude of hashes over the data.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14352/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      cf2a5e0b
  20. 13 9月, 2016 1 次提交
    • P
      MIPS: Remove compact branch policy Kconfig entries · b03c1e3b
      Paul Burton 提交于
      Commit c1a0e9bc ("MIPS: Allow compact branch policy to be changed")
      added Kconfig entries allowing for the compact branch policy used by the
      compiler for MIPSr6 kernels to be specified. This can be useful for
      debugging, particularly in systems where compact branches have recently
      been introduced.
      
      Unfortunately mainline gcc 5.x supports MIPSr6 but not the
      -mcompact-branches compiler flag, leading to MIPSr6 kernels failing to
      build with gcc 5.x with errors such as:
      
        mipsel-linux-gnu-gcc: error: unrecognized command line option '-mcompact-branches=optimal'
        make[2]: *** [kernel/bounds.s] Error 1
      
      Fixing this by hiding the Kconfig entry behind another seems to be more
      hassle than it's worth, as MIPSr6 & compact branches have been around
      for a while now and if policy does need to be set for debug it can be
      done easily enough with KCFLAGS. Therefore remove the compact branch
      policy Kconfig entries & their handling in the Makefile.
      
      This reverts commit c1a0e9bc ("MIPS: Allow compact branch policy to
      be changed").
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Fixes: c1a0e9bc ("MIPS: Allow compact branch policy to be changed")
      Cc: stable <stable@vger.kernel.org> # v4.4+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14241/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b03c1e3b
  21. 17 5月, 2016 1 次提交
    • J
      MIPS: Fix VZ probe gas errors with binutils <2.24 · bad50d79
      James Hogan 提交于
      The VZ guest register & TLB access macros introduced in commit "MIPS:
      Add guest CP0 accessors" use VZ ASE specific instructions that aren't
      understood by versions of binutils prior to 2.24.
      
      Add a check for whether the toolchain supports the -mvirt option,
      similar to the MSA toolchain check, and implement the accessors using
      .word if not.
      
      Due to difficulty in converting compiler specified registers (e.g. "$3")
      to usable numbers (e.g. "3") in inline asm, we need to copy to/from a
      temporary register, namely the assembler temporary (at/$1), and specify
      guest CP0 registers numerically in the gc0 macros.
      
      Fixes: 7eb91118 ("MIPS: Add guest CP0 accessors")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-next@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13255/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      bad50d79
  22. 13 5月, 2016 2 次提交
  23. 22 1月, 2016 1 次提交
  24. 26 10月, 2015 1 次提交
  25. 15 7月, 2015 1 次提交
    • R
      MIPS: SB1: Remove support for Pass 1 parts. · dd0bc75e
      Ralf Baechle 提交于
      Pass 1 parts had a number of significant erratas and were only available
      in small numbers and under NDA.  Full support also required the use of a
      special toolchain that kept branches properly aligned.  These workarounds
      were never upstreamed and the only toolchain known to have them is
      Montavista's GCC 3.0-based toolchain which completly obsoleted if not
      useless these days.
      
      So now that automated testing has tripped over the user of the
      -msb1-pass1-workarounds option, rather than fixing it remove support for
      pass 1 parts.
      
      Probably nobody will notice.  I seem to own the last know pass 1 board
      and I haven't noticed another one in the wild in the past decade, at
      least.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      dd0bc75e
  26. 13 5月, 2015 1 次提交
  27. 10 4月, 2015 1 次提交
    • M
      MIPS: Makefile: Fix MIPS ASE detection code · 5306a545
      Markos Chandras 提交于
      Commit 32098ec7 ("MIPS: Makefile: Move the ASEs checks after
      setting the core's CFLAGS") re-arranged the MIPS ASE detection code
      and also added the current cflags to the detection logic. However,
      this introduced a few bugs. First of all, the mips-cflags should not
      be quoted since that ends up being passed as a string to subsequent
      commands leading to broken detection from the cc-option-* tools.
      Moreover, in order to avoid duplicating the cflags-y because of how
      cc-option works, we rework the logic so we pass only those cflags which
      are needed by the selected ASE. Finally, fix some typos resulting in MSA
      not being detected correctly.
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Fixes: Commit 32098ec7 ("MIPS: Makefile: Move the ASEs checks after setting the core's CFLAGS")
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9661/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5306a545
  28. 02 4月, 2015 1 次提交
  29. 01 4月, 2015 2 次提交
  30. 20 2月, 2015 1 次提交
  31. 19 2月, 2015 1 次提交