13 May, 2016

40 commits

  • Since commit 3b9d6da67e11 ("cpu/hotplug: Fix rollback during error-out
    in __cpu_disable()") it is ensured that callbacks of CPU_ONLINE and
    CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this
    work_on_cpu() calls are no longer required.

    Replace work_on_cpu() with a direct call of mips_cdmm_bus_up() or
    mips_cdmm_bus_down(). Description of those functions are adapted.

    Signed-off-by: Anna-Maria Gleixner
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: rt@linutronix.de
    Patchwork: https://patchwork.linux-mips.org/patch/13197/
    Signed-off-by: Ralf Baechle

    Anna-Maria Gleixner
     
  • No one of supported MIPS machines has an IOMMU unit, so we can safely define
    PCI_DMA_BUS_IS_PHYS = 1. Also remove iommu flag from the pci controller
    structure, since it is useless.

    Signed-off-by: Sergey Ryazanov
    Cc: Linux MIPS
    Patchwork: https://patchwork.linux-mips.org/patch/7604/
    Signed-off-by: Ralf Baechle

    Sergey Ryazanov
     
  • SEGBITS is 40 bits or more, depending on CPU type. Introduces optional
    support for 48 bits of application virtual address space. Only 16K and
    64K pages are supported.

    Enabling will result in a memory overhead of a small number of pages for
    small applications. For 64K pages a 3rd level of page tables is required
    which has some impact during software TLB refill.

    [ralf@linux-mips.org: Fixed things raised in the review of the version
    posted and changed kconfig to be a bit more userfriendly.]

    Signed-off-by: Leonid Yegoshin
    Cc: aleksey.makarov@auriga.com
    Cc: james.hogan@imgtec.com
    Cc: paul.burton@imgtec.com
    Cc: david.daney@cavium.com
    Cc: peterz@infradead.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: davidlohr@hp.com
    Cc: kirill@shutemov.name
    Cc: akpm@linux-foundation.org
    Cc: mingo@kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/10051/
    Signed-off-by: Ralf Baechle

    Leonid Yegoshin
     
  • MIPS32 o32 ABI sigaction() processing on MIPS64 n64 kernel was incorrectly
    set to processing aka rt_sigaction() variant only.

    Signed-off-by: Leonid Yegoshin
    Cc: paul.burton@imgtec.com
    Cc: richard@nod.at
    Cc: luto@amacapital.net
    Cc: alex.smith@imgtec.com
    Cc: Maciej W. Rozycki
    Cc: mpe@ellerman.id.au
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11321/
    Signed-off-by: Ralf Baechle

    Leonid Yegoshin
     
  • MIPS hardware may have an antialising support and it works even
    page size is small.

    Setup a shared memory aliasing mask to page size if hardware has
    an antialising support. Big shared memory mask forces a disruption
    in page address assignment and that corrupts Android library memory
    handling.

    Signed-off-by: Leonid Yegoshin
    Cc: cernekee@gmail.com
    Cc: paul.gortmaker@windriver.com
    Cc: kumba@gentoo.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11516/
    Signed-off-by: Ralf Baechle

    Leonid Yegoshin
     
  • flags is indeed unused.

    Signed-off-by: Tony Wu
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11699/
    Signed-off-by: Ralf Baechle

    Tony Wu
     
  • New Loongson 3 CPU (since Loongson-3A R2, as opposed to Loongson-3A R1,
    Loongson-3B R1 and Loongson-3B R2) has many enhancements, such as FTLB,
    L1-VCache, EI/DI/Wait/Prefetch instruction, DSP/DSPv2 ASE, User Local
    register, Read-Inhibit/Execute-Inhibit, SFB (Store Fill Buffer), Fast
    TLB refill support, etc.

    This patch introduce a config option, CONFIG_LOONGSON3_ENHANCEMENT, to
    enable those enhancements which are not probed at run time. If you want
    a generic kernel to run on all Loongson 3 machines, please say 'N'
    here. If you want a high-performance kernel to run on new Loongson 3
    machines only, please say 'Y' here.

    Some additional explanations:
    1) SFB locates between core and L1 cache, it causes memory access out
    of order, so writel/outl (and other similar functions) need a I/O
    reorder barrier.
    2) Loongson 3 has a bug that di instruction can not save the irqflag,
    so arch_local_irq_save() is modified. Since CPU_MIPSR2 is selected
    by CONFIG_LOONGSON3_ENHANCEMENT, generic kernel doesn't use ei/di
    at all.
    3) CPU_HAS_PREFETCH is selected by CONFIG_LOONGSON3_ENHANCEMENT, so
    MIPS_CPU_PREFETCH (used by uasm) probing is also put in this patch.

    Signed-off-by: Huacai Chen
    Cc: Aurelien Jarno
    Cc: Steven J . Hill
    Cc: Fuxin Zhang
    Cc: Zhangjin Wu
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12755/
    Signed-off-by: Ralf Baechle

    Huacai Chen
     
  • Loongson-3A R2 has pwbase/pwfield/pwsize/pwctl registers in CP0 (this
    is very similar to HTW) and lwdir/lwpte/lddir/ldpte instructions which
    can be used for fast TLB refill.

    [ralf@linux-mips.org: Resolve conflict.]

    Signed-off-by: Huacai Chen
    Cc: Aurelien Jarno
    Cc: Steven J . Hill
    Cc: Fuxin Zhang
    Cc: Zhangjin Wu
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12754/
    Signed-off-by: Ralf Baechle

    Huacai Chen
     
  • Loongson-2 has a 4 entry itlb which is a subset of jtlb, Loongson-3 has
    a 4 entry itlb and a 4 entry dtlb which are subsets of jtlb. We should
    write diag register to invalidate itlb/dtlb when flushing jtlb because
    itlb/dtlb are not totally transparent to software.

    For Loongson-3A R2 (and newer), we should invalidate ITLB, DTLB, VTLB
    and FTLB before we enable/disable FTLB.

    Signed-off-by: Huacai Chen
    Cc: Aurelien Jarno
    Cc: Steven J . Hill
    Cc: Fuxin Zhang
    Cc: Zhangjin Wu
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12753/
    Signed-off-by: Ralf Baechle

    Huacai Chen
     
  • Loongson-3 maintains cache coherency by hardware, this means:
    1) It's icache is coherent with dcache.
    2) It's dcaches don't alias (maybe depend on PAGE_SIZE).
    3) It maintains cache coherency across cores (and for DMA).

    So we can skip most cache flush operations by setting relevant handlers
    to `cache_noop' in `r4k_cache_init'.

    Signed-off-by: Huacai Chen
    Cc: Aurelien Jarno
    Cc: Steven J . Hill
    Cc: Fuxin Zhang
    Cc: Zhangjin Wu
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12752/
    Signed-off-by: Ralf Baechle

    Huacai Chen
     
  • Loongson-3 CPU family:

    Code-name Brand-name PRId
    Loongson-3A R1 Loongson-3A1000 0x6305
    Loongson-3A R2 Loongson-3A2000 0x6308
    Loongson-3B R1 Loongson-3B1000 0x6306
    Loongson-3B R2 Loongson-3B1500 0x6307

    Features of R2 revision of Loongson-3A:

    - Primary cache includes I-Cache, D-Cache and V-Cache (Victim Cache).
    - I-Cache, D-Cache and V-Cache are 16-way set-associative, linesize is
    64 bytes.
    - 64 entries of VTLB (classic TLB), 1024 entries of FTLB (8-way
    set-associative).
    - Supports DSP/DSPv2 instructions, UserLocal register and Read-Inhibit/
    Execute-Inhibit.

    [ralf@linux-mips.org: Resolved merge conflicts.]

    Signed-off-by: Huacai Chen
    Cc: Aurelien Jarno
    Cc: Steven J . Hill
    Cc: Fuxin Zhang
    Cc: Zhangjin Wu
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12751/
    Patchwork: https://patchwork.linux-mips.org/patch/13136/
    Signed-off-by: Ralf Baechle

    Huacai Chen
     
  • This patch adjust the logic in mach_irq_dispatch(), allow multiple IPs
    handled in the same dispatching. This can speedup interrupt processing.

    Signed-off-by: Huacai Chen
    Cc: Aurelien Jarno
    Cc: Steven J . Hill
    Cc: Fuxin Zhang
    Cc: Zhangjin Wu
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12891/
    Signed-off-by: Ralf Baechle

    Huacai Chen
     
  • SB700/SB710/SB800 chipset ACPI code is mostly Loongson-3 specific
    routines rather than a "platform driver".

    Signed-off-by: Huacai Chen
    Cc: John Crispin
    Cc: Steven J. Hill
    Cc: Fuxin Zhang
    Cc: Zhangjin Wu
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/11273/
    Signed-off-by: Ralf Baechle

    Huacai Chen
     
  • Strip some comments which probably meant to repeat the same value of the
    define; they also contained a confusing 0x0x prefix.

    Signed-off-by: Antonio Ospite
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12254/
    Signed-off-by: Ralf Baechle

    Antonio Ospite
     
  • The files watch.c and ptrace.c contain various magic masks for
    WatchLo/WatchHi register fields. Add some definitions to mipsregs.h for
    these registers and make use of them in both watch.c and ptrace.c,
    hopefully making them more readable.

    Signed-off-by: James Hogan
    Reviewed-by: David Daney
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12729/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • do_watch() clears bit 22 of cause without using a CAUSEF_* definition
    from mipsregs.h. Add a definition for this bit (CAUSEF_WP) and make use
    of it. Also use clear_c0_cause() instead of manual read/modify/write.

    Signed-off-by: James Hogan
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12728/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Adds support for the deadman timer peripheral found on PIC32 class devices.

    The primary function of the deadman timer (DMT) is to reset the processor
    in the event of a software malfunction. The DMT is a free-running
    instruction fetch timer, which is clocked whenever an instruction fetch
    occurs until a count match occurs. Instructions are not fetched when
    the processor is in sleep mode.

    Signed-off-by: Purna Chandra Mandal
    Signed-off-by: Joshua Henderson
    Reviewed-by: Guenter Roeck
    Cc: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Kumar Gala
    Cc: Wim Van Sebroeck
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-watchdog@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12703/
    Signed-off-by: Ralf Baechle

    Purna Chandra Mandal
     
  • Document the devicetree bindings for the deadman timer peripheral found on
    Microchip PIC32 SoC class devices.

    Signed-off-by: Purna Chandra Mandal
    Signed-off-by: Joshua Henderson
    Acked-by: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Kumar Gala
    Cc: Wim Van Sebroeck
    Cc: Guenter Roeck
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-watchdog@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12702/
    Signed-off-by: Ralf Baechle

    Purna Chandra Mandal
     
  • Add support for the watchdog peripheral found on PIC32 class
    devices.

    Signed-off-by: Joshua Henderson
    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Guenter Roeck
    Cc: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Kumar Gala
    Cc: Wim Van Sebroeck
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-watchdog@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12701/
    Signed-off-by: Ralf Baechle

    Joshua Henderson
     
  • Document the devicetree bindings for the watchdog peripheral found on
    Microchip PIC32 SoC class devices.

    Signed-off-by: Joshua Henderson
    Acked-by: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Kumar Gala
    Cc: Wim Van Sebroeck
    Cc: Guenter Roeck
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-watchdog@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12700/
    Signed-off-by: Ralf Baechle

    Joshua Henderson
     
  • IS_ERR_VALUE macro should be used only with unsigned long type.
    Specifically it works incorrectly with longer types.

    The patch follows conclusion from discussion on LKML [1][2].

    [1]: http://permalink.gmane.org/gmane.linux.kernel/2120927
    [2]: http://permalink.gmane.org/gmane.linux.kernel/2150581

    [ralf@linux-mips.org: While it may not immediately be obvious, the type
    of st_value in the end is an unsigned long equivalent so the invocation
    of IS_ERR_VALUE() was valid but I'm applying the patch anyway for
    clarity.]

    Signed-off-by: Andrzej Hajda
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Marek Szyprowski
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12553/
    Signed-off-by: Ralf Baechle

    Andrzej Hajda
     
  • Propagate sNaN payload in quieting in the legacy-NaN mode as well. If
    clearing the quiet bit would produce infinity, then set the next lower
    trailing significand field bit, matching the SB-1 and BMIPS5000 hardware
    implementations. Some other MIPS FPU hardware implementations do
    produce the default qNaN bit pattern instead.

    This reverts some changes made for semantics preservation with commit
    dc3ddf42 [MIPS: math-emu: Update sNaN quieting handlers], consequently
    bringing back most of the semantics from before commit fdffbafb [Lots of
    FPU bug fixes from Kjeld Borch Egevang.], except from the qNaN produced
    in the infinity case. Previously the default qNaN bit pattern was
    produced in that case.

    Signed-off-by: Maciej W. Rozycki
    Cc: Andrew Morton
    Cc: Matthew Fortune
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/11483/
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Update the ELF personality macros used for individual ABIs to make
    actions in the same order across all of them and match formatting too.

    Signed-off-by: Maciej W. Rozycki
    Cc: Andrew Morton
    Cc: Matthew Fortune
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Since commit 8cb48fe169dd ("MIPS: Provide correct siginfo_t.si_stime"),
    MIPS' uapi/asm/siginfo.h has included uapi/asm-generic/siginfo.h
    directly before defining MIPS' struct siginfo, in order to get the
    necessary definitions needed for the siginfo struct without the generic
    copy_siginfo() hitting compiler errors due to struct siginfo not yet
    being defined.

    Now that the generic copy_siginfo() is moved out to linux/signal.h we
    can safely include asm-generic/siginfo.h before defining the MIPS
    specific struct siginfo, which avoids the uapi/ include as well as
    breakage due to generic copy_siginfo() being defined before struct
    siginfo.

    Reported-by: Christopher Ferris
    Fixes: 8cb48fe169dd ("MIPS: Provide correct siginfo_t.si_stime")
    Signed-off-by: James Hogan
    Cc: Petr Malat
    Cc: linux-mips@linux-mips.org
    Cc: # 4.0-
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • The generic copy_siginfo() is currently defined in
    asm-generic/siginfo.h, after including uapi/asm-generic/siginfo.h which
    defines the generic struct siginfo. However this makes it awkward for an
    architecture to use it if it has to define its own struct siginfo (e.g.
    MIPS and potentially IA64), since it means that asm-generic/siginfo.h
    can only be included after defining the arch-specific siginfo, which may
    be problematic if the arch-specific definition needs definitions from
    uapi/asm-generic/siginfo.h.

    It is possible to work around this by first including
    uapi/asm-generic/siginfo.h to get the constants before defining the
    arch-specific siginfo, and include asm-generic/siginfo.h after. However
    uapi headers can't be included by other uapi headers, so that first
    include has to be in an ifdef __kernel__, with the non __kernel__ case
    including the non-UAPI header instead.

    Instead of that mess, move the generic copy_siginfo() definition into
    linux/signal.h, which allows an arch-specific uapi/asm/siginfo.h to
    include asm-generic/siginfo.h and define the arch-specific siginfo, and
    for the generic copy_siginfo() to see that arch-specific definition.

    Signed-off-by: James Hogan
    Cc: Arnd Bergmann
    Cc: Ralf Baechle
    Cc: Petr Malat
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Christopher Ferris
    Cc: linux-arch@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: # 4.0-
    Patchwork: https://patchwork.linux-mips.org/patch/12478/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • octeon_smp_setup and octeon_prepare_cpus are just used during initialization
    period, so mark them as __init. And, octeon_prepare_cpus is just used in smp.c,
    so make it static as well.

    Signed-off-by: Yang Shi
    Cc: david.daney@cavium.com
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12574/
    Signed-off-by: Ralf Baechle

    Yang Shi
     
  • - Remove unneeded leds0 alias.
    - Switch to bcm6345-l1-intc interrupt controller.
    - Use interrupt-controller instead of periph_intc and cpu_intc.
    - Add uart1 node.
    - Single ohci and ehci nodes.
    - Avoid using underscores in node names.
    - Rename uart aliases to serial.
    - Remove blank line in cpus node.

    [ralf@linux-mips.org: fix references in bcm96368mvwg.dts so the file keeps
    building.]

    Signed-off-by: Álvaro Fernández Rojas
    Cc: f.fainelli@gmail.com
    Cc: jogo@openwrt.org
    Cc: cernekee@gmail.com
    Cc: robh@kernel.org
    Cc: simon@fire.lp0.eu
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Signed-off-by: Ralf Baechle

    Álvaro Fernández Rojas
     
  • - Remove unneeded leds0 alias.
    - Switch to bcm6345-l1-intc interrupt controller.
    - Use interrupt-controller instead of periph_intc and cpu_intc.
    - Add uart1, ehci and ohci nodes.
    - Refactor syscon and syscon-reboot.
    - Avoid using underscores in node names.
    - Rename uart aliases to serial.

    Signed-off-by: Álvaro Fernández Rojas
    Cc: f.fainelli@gmail.com
    Cc: jogo@openwrt.org
    Cc: cernekee@gmail.com
    Cc: robh@kernel.org
    Cc: simon@fire.lp0.eu
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13043/
    Signed-off-by: Ralf Baechle

    Álvaro Fernández Rojas
     
  • This SoC is very similar to BCM63168 and Broadcom usually refers to them as
    BCM63268.
    Add BCM63268 and missing BCM63168 to device tree documentation.

    Signed-off-by: Álvaro Fernández Rojas
    Acked-by: Rob Herring
    Cc: f.fainelli@gmail.com
    Cc: jogo@openwrt.org
    Cc: cernekee@gmail.com
    Cc: robh@kernel.org
    Cc: simon@fire.lp0.eu
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13042/
    Signed-off-by: Ralf Baechle

    Álvaro Fernández Rojas
     
  • This adds a device tree example for SFR Neufbox4 (Sercomm version), which
    also serves as a real example for brcm,bcm6358-leds.

    Signed-off-by: Álvaro Fernández Rojas
    Acked-by: Rob Herring
    Cc: f.fainelli@gmail.com
    Cc: jogo@openwrt.org
    Cc: cernekee@gmail.com
    Cc: robh@kernel.org
    Cc: simon@fire.lp0.eu
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13041/
    Signed-off-by: Ralf Baechle

    Álvaro Fernández Rojas
     
  • BCM6358 has a shared TLB which conflicts with current SMP support, so it must
    be disabled for now.
    BCM6358 uses >= 0xfffe0000 addresses for internal registers, which need to be
    remapped (by using a simplified version of BRCM63xx ioremap.h).
    However, 0xfff80000 is a better address, since it also covers BCM3368, leaving
    the possibility to add it in the future.

    Signed-off-by: Álvaro Fernández Rojas
    Cc: f.fainelli@gmail.com
    Cc: jogo@openwrt.org
    Cc: cernekee@gmail.com
    Cc: robh@kernel.org
    Cc: simon@fire.lp0.eu
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13040/
    Signed-off-by: Ralf Baechle

    Álvaro Fernández Rojas
     
  • This patch replaces goto out with return in ls1x_cpufreq_probe().

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13056/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • This patch uses devm_kzalloc() instead of global structure.

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13055/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • This patch uses dev_get_platdata() to get the platform_data
    instead of referencing it directly.

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13054/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • This patch replaces kzalloc() with kcalloc() when allocating
    frequency table, and remove unnecessary 'out of memory' message.

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13053/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • This patch renames the file to loongson1-cpufreq.c,
    and also includes some minor updates.

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13052/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • Just to ease debugging of multiplatform kernel, make sure we print
    "Broadcom BMIPS5200" for the BMIPS5200 implementation instead of
    Broadcom BMIPS5000.

    Fixes: 68e6a78373a6d ("MIPS: BMIPS: Add PRId for BMIPS5200 (Whirlwind)")
    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13014/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • BMIPS_GENERIC being multiplatform and intended to support BMIPS3200,
    BMIPS3300, BMIPS4350, BMIPS4380 and BMIPS5000-class processors, there is
    not much more we can put in there since they do not share the same I and
    D cache line sizes at all (doubled for every new generation
    essentially), some processors have a S-cache, some don't, some have a
    FPU, some don't.

    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13013/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • local_r4k___flush_cache_all() is missing a special check for BMIPS5000
    processors, we need to blast the S-cache, just like other MTI processors
    since we have an inclusive cache. We also need an additional __sync() to
    make sure this is completed.

    Fixes: d74b0172e4e2c ("MIPS: BMIPS: Add special cache handling in c-r4k.c")
    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13012/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • BMIPS5000 and BMIPS5200 processor have no D cache aliases, and this is
    properly handled by the per-CPU override added at the end of
    r4k_cache_init(), the problem is that the output of probe_pcache()
    disagrees with that, since this is too late:

    Primary instruction cache 32kB, VIPT, 4-way, linesize 64 bytes.
    Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes

    With the change moved earlier, we now have a consistent output with the
    settings we are intending to have:

    Primary instruction cache 32kB, VIPT, 4-way, linesize 64 bytes.
    Primary data cache 32kB, 4-way, VIPT, no aliases, linesize 32 bytes

    Fixes: d74b0172e4e2c ("MIPS: BMIPS: Add special cache handling in c-r4k.c")
    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13011/
    Signed-off-by: Ralf Baechle

    Florian Fainelli