Merge tag 'mips_4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 21 Feb 2017 22:21:11 +0000 (14:21 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 21 Feb 2017 22:21:11 +0000 (14:21 -0800)
Pull MIPS updates from James Hogan:
 "Here's the main MIPS pull request for 4.11.

  It contains a few new features such as IRQ stacks, cacheinfo support,
  and KASLR for Octeon CPUs, and a variety of smaller improvements and
  fixes including devicetree additions, kexec cleanups, microMIPS stack
  unwinding fixes, and a bunch of build fixes to clean up continuous
  integration builds.

  Its all been in linux-next for at least a couple of days, most of it
  far longer.

  Miscellaneous:
   - Add IRQ stacks
   - Add cacheinfo support
   - Add "uzImage.bin" zboot target
   - Unify performance counter definitions
   - Export various (mainly assembly) symbols alongside their
     definitions
   - Audit and remove unnecessary uses of module.h

  kexec & kdump:
   - Lots of improvements and fixes
   - Add correct copy_regs implementations
   - Add debug logging of new kernel information

  Security:
   - Use Makefile.postlink to insert relocations into vmlinux
   - Provide plat_post_relocation hook (used for Octeon KASLR)
   - Add support for tuning mmap randomisation
   - Relocate DTB

  microMIPS:
   - A load of unwind fixes
   - Add some missing .insn to fix link errors

  MIPSr6:
   - Fix MULTU/MADDU/MSUBU sign extension in r2 emulation
   - Remove r2_emul_return and use ERETNC unconditionally on MIPSr6
   - Allow pre-r6 emulation on SMP MIPSr6 kernels

  Cache management:
   - Treat physically indexed dcache as non-aliasing
   - Add return errors to protected cache ops for KVM
   - CM3: Ensure L1 & L2 cache ECC checking matches
   - CM3: Indicate inclusive caches
   - I6400: Treat dcache as physically indexed

  Memory management:
   - Ensure bootmem doesn't corrupt reserved memory
   - Export some TLB exception generation functions for KVM

  OF:
   - NULL check initial_boot_params before use in of_scan_flat_dt()
   - Fix unaligned access in of_alias_scan()

  SMP:
   - CPS: Don't BUG if a CPU fails to start

  Other fixes:
   - Fix longstanding 64-bit IP checksum carry bug
   - Fix KERN_CONT fallout in cpu-bugs64.c and sync-r4k.c
   - Update defconfigs for NF_CT_PROTO_DCCP, DPLITE,
     CPU_FREQ_STAT,SCSI_DH changes
   - Disable certain builtin compiler options, stack-check (whole
     kernel), asynchronous-unwind-tables (VDSO).
   - A bunch of build fixes from kernelci.org testing
   - Various other minor cleanups & corrections

  BMIPS:
   - Migrate interrupts during bmips_cpu_disable
   - BCM47xx: Add Luxul devices
   - BCM47xx: Fix Asus WL-500W button inversion
   - BCM7xxx: Add SPI device nodes

  Generic (multiplatform):
   - Add kexec DTB passing
   - Fix big endian
   - Add cpp_its_S in ksym_dep_filter to silence build warning

  IP22:
   - Reformat inline assembler code to modern standards
   - Fix binutils 2.25 build error

  IP27:
   - Fix duplicate CAC_BASE definition build error
   - Disable qlge driver to workaround broken compiler

  Lantiq:
   - Refresh defconfig and activate more drivers
   - Lock DMA register access
   - Fix cascading IRQ setup
   - Fix build of VPE loader
   - xway: Fix ethernet packet header corruption over reboot

  Loongson1
   - Add watchdog support
   - 1B: Reduce DEFAULT_MEMSIZE to 64MB
   - 1B: Change OSC clock name to match rest of kernel
   - 1C: Remove ARCH_WANT_OPTIONAL_GPIOLIB

  Octeon:
   - Add KASLR support
   - Support Octeon III USB controller
   - Fix large copy_from_user corner case
   - Enable devtmpfs in defconfig

  Netlogic:
   - Fix non-default XLR build error due to netlogic,xlp-pic code
   - Fix assembler warning from smpboot.S

  pic32mzda:
   - Fix linker error when early printk is disabled

  Pistachio:
   - Add base device tree
   - Add Ci40 "Marduk" device tree

  Ralink:
   - Support raw appended DTB
   - Add missing I2C & I2S clocks
   - Add missing pinmux and fix pinmux function name typo
   - Add missing clk_round_rate()
   - Clean up prom_init()
   - MT7621: Set SoC type
   - MT7621: Support highmem

  TXx9:
   - Modernize printing of kernel messages and resolve KERN_CONT fallout
   - 7segled: use permission-specific DEVICE_ATTR variants

  XilFPGA:
   - Add IRQ controller and UART IRQ
   - Add AXI I2C and emaclite to DT & defconfig"

* tag 'mips_4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips: (148 commits)
  MIPS: VDSO: Explicitly use -fno-asynchronous-unwind-tables
  MIPS: BCM47XX: Fix button inversion for Asus WL-500W
  MIPS: DTS: Add img directory to Makefile
  MIPS: ip27: Disable qlge driver in defconfig
  MIPS: pic32mzda: Fix linker error for pic32_get_pbclk()
  MIPS: Lantiq: Keep ethernet enabled during boot
  MIPS: OCTEON: Fix copy_from_user fault handling for large buffers
  MIPS: Fix special case in 64 bit IP checksumming.
  MIPS: OCTEON: Enable DEVTMPFS
  MIPS: lantiq: Set physical_memsize
  MIPS: sysmips: Remove duplicated include from syscall.c
  Kbuild: Add cpp_its_S in ksym_dep_filter
  MIPS: Audit and remove any unnecessary uses of module.h
  MIPS: Unify perf counter register definitions
  MIPS: Disable stack checks on MIPS kernels
  MIPS: OCTEON: Platform support for OCTEON III USB controller
  MIPS: Lantiq: Fix cascaded IRQ setup
  MIPS: sync-r4k: Fix KERN_CONT fallout
  MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch
  MIPS: Fix distclean with Makefile.postlink
  ...

253 files changed:
Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt [new file with mode: 0644]
MAINTAINERS
arch/mips/Kconfig
arch/mips/Makefile
arch/mips/Makefile.postlink [new file with mode: 0644]
arch/mips/alchemy/board-gpr.c
arch/mips/alchemy/common/dbdma.c
arch/mips/alchemy/common/dma.c
arch/mips/alchemy/common/gpiolib.c
arch/mips/alchemy/common/prom.c
arch/mips/alchemy/common/usb.c
arch/mips/alchemy/common/vss.c
arch/mips/alchemy/devboards/bcsr.c
arch/mips/ar7/clock.c
arch/mips/ar7/gpio.c
arch/mips/ar7/memory.c
arch/mips/ar7/platform.c
arch/mips/ar7/prom.c
arch/mips/ath79/clock.c
arch/mips/ath79/common.c
arch/mips/bcm47xx/board.c
arch/mips/bcm47xx/buttons.c
arch/mips/bcm47xx/leds.c
arch/mips/bcm63xx/clk.c
arch/mips/bcm63xx/cpu.c
arch/mips/bcm63xx/cs.c
arch/mips/bcm63xx/gpio.c
arch/mips/bcm63xx/irq.c
arch/mips/bcm63xx/reset.c
arch/mips/bcm63xx/timer.c
arch/mips/boot/compressed/Makefile
arch/mips/boot/dts/Makefile
arch/mips/boot/dts/brcm/bcm7125.dtsi
arch/mips/boot/dts/brcm/bcm7346.dtsi
arch/mips/boot/dts/brcm/bcm7358.dtsi
arch/mips/boot/dts/brcm/bcm7360.dtsi
arch/mips/boot/dts/brcm/bcm7362.dtsi
arch/mips/boot/dts/brcm/bcm7420.dtsi
arch/mips/boot/dts/brcm/bcm7425.dtsi
arch/mips/boot/dts/brcm/bcm7435.dtsi
arch/mips/boot/dts/brcm/bcm97125cbmb.dts
arch/mips/boot/dts/brcm/bcm97346dbsmb.dts
arch/mips/boot/dts/brcm/bcm97358svmb.dts
arch/mips/boot/dts/brcm/bcm97360svmb.dts
arch/mips/boot/dts/brcm/bcm97362svmb.dts
arch/mips/boot/dts/brcm/bcm97420c.dts
arch/mips/boot/dts/brcm/bcm97425svmb.dts
arch/mips/boot/dts/brcm/bcm97435svmb.dts
arch/mips/boot/dts/img/Makefile [new file with mode: 0644]
arch/mips/boot/dts/img/pistachio.dtsi [new file with mode: 0644]
arch/mips/boot/dts/img/pistachio_marduk.dts [new file with mode: 0644]
arch/mips/boot/dts/xilfpga/nexys4ddr.dts
arch/mips/cavium-octeon/Makefile
arch/mips/cavium-octeon/crypto/octeon-crypto.c
arch/mips/cavium-octeon/dma-octeon.c
arch/mips/cavium-octeon/executive/cvmx-bootmem.c
arch/mips/cavium-octeon/executive/cvmx-helper-errata.c
arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c
arch/mips/cavium-octeon/executive/cvmx-helper-sgmii.c
arch/mips/cavium-octeon/executive/cvmx-helper-spi.c
arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c
arch/mips/cavium-octeon/executive/cvmx-helper.c
arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
arch/mips/cavium-octeon/octeon-memcpy.S
arch/mips/cavium-octeon/octeon-platform.c
arch/mips/cavium-octeon/octeon-usb.c [new file with mode: 0644]
arch/mips/cavium-octeon/setup.c
arch/mips/cavium-octeon/smp.c
arch/mips/configs/cavium_octeon_defconfig
arch/mips/configs/ip22_defconfig
arch/mips/configs/ip27_defconfig
arch/mips/configs/lemote2f_defconfig
arch/mips/configs/loongson1b_defconfig
arch/mips/configs/loongson1c_defconfig
arch/mips/configs/malta_defconfig
arch/mips/configs/malta_kvm_defconfig
arch/mips/configs/malta_kvm_guest_defconfig
arch/mips/configs/maltaup_xpa_defconfig
arch/mips/configs/nlm_xlp_defconfig
arch/mips/configs/nlm_xlr_defconfig
arch/mips/configs/xilfpga_defconfig
arch/mips/configs/xway_defconfig
arch/mips/dec/prom/identify.c
arch/mips/dec/setup.c
arch/mips/dec/wbflush.c
arch/mips/emma/markeins/setup.c
arch/mips/generic/Makefile
arch/mips/generic/init.c
arch/mips/generic/kexec.c [new file with mode: 0644]
arch/mips/include/asm/Kbuild
arch/mips/include/asm/asm-prototypes.h [new file with mode: 0644]
arch/mips/include/asm/asm.h
arch/mips/include/asm/bootinfo.h
arch/mips/include/asm/checksum.h
arch/mips/include/asm/elf.h
arch/mips/include/asm/highmem.h
arch/mips/include/asm/i8259.h
arch/mips/include/asm/irq.h
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h
arch/mips/include/asm/mach-ip27/spaces.h
arch/mips/include/asm/mach-loongson32/loongson1.h
arch/mips/include/asm/mach-loongson32/platform.h
arch/mips/include/asm/mach-loongson32/regs-rtc.h [new file with mode: 0644]
arch/mips/include/asm/mach-ralink/mt7620.h
arch/mips/include/asm/mips-cm.h
arch/mips/include/asm/mipsregs.h
arch/mips/include/asm/octeon/cvmx-gpio-defs.h
arch/mips/include/asm/octeon/cvmx-helper-rgmii.h
arch/mips/include/asm/octeon/cvmx-helper-sgmii.h
arch/mips/include/asm/octeon/cvmx-helper-spi.h
arch/mips/include/asm/octeon/cvmx-helper-xaui.h
arch/mips/include/asm/octeon/cvmx-helper.h
arch/mips/include/asm/pgalloc.h
arch/mips/include/asm/r4kcache.h
arch/mips/include/asm/smp.h
arch/mips/include/asm/stackframe.h
arch/mips/include/asm/switch_to.h
arch/mips/include/asm/thread_info.h
arch/mips/include/asm/tlbex.h [new file with mode: 0644]
arch/mips/include/asm/uaccess.h
arch/mips/include/asm/uasm.h
arch/mips/include/asm/unaligned.h [deleted file]
arch/mips/jazz/jazzdma.c
arch/mips/jz4740/gpio.c
arch/mips/jz4740/prom.c
arch/mips/jz4740/timer.c
arch/mips/kernel/Makefile
arch/mips/kernel/asm-offsets.c
arch/mips/kernel/cacheinfo.c [new file with mode: 0644]
arch/mips/kernel/cpu-bugs64.c
arch/mips/kernel/crash.c
arch/mips/kernel/entry.S
arch/mips/kernel/genex.S
arch/mips/kernel/irq.c
arch/mips/kernel/linux32.c
arch/mips/kernel/machine_kexec.c
arch/mips/kernel/mcount.S
arch/mips/kernel/mips-mt-fpaff.c
arch/mips/kernel/mips-r2-to-r6-emul.c
arch/mips/kernel/mips_ksyms.c [deleted file]
arch/mips/kernel/perf_event_mipsxx.c
arch/mips/kernel/process.c
arch/mips/kernel/prom.c
arch/mips/kernel/ptrace.c
arch/mips/kernel/r2300_switch.S
arch/mips/kernel/r4k_switch.S
arch/mips/kernel/relocate.c
arch/mips/kernel/setup.c
arch/mips/kernel/smp-bmips.c
arch/mips/kernel/smp-cps.c
arch/mips/kernel/smp.c
arch/mips/kernel/sync-r4k.c
arch/mips/kernel/syscall.c
arch/mips/kernel/traps.c
arch/mips/kernel/uprobes.c
arch/mips/kernel/vmlinux.lds.S
arch/mips/lantiq/irq.c
arch/mips/lantiq/prom.c
arch/mips/lantiq/xway/dma.c
arch/mips/lantiq/xway/gptu.c
arch/mips/lantiq/xway/sysctrl.c
arch/mips/lasat/at93c.c
arch/mips/lasat/sysctl.c
arch/mips/lib/csum_partial.S
arch/mips/lib/memcpy.S
arch/mips/lib/memset.S
arch/mips/lib/strlen_user.S
arch/mips/lib/strncpy_user.S
arch/mips/lib/strnlen_user.S
arch/mips/loongson32/common/platform.c
arch/mips/loongson32/ls1b/board.c
arch/mips/loongson32/ls1c/board.c
arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c
arch/mips/loongson64/common/dma-swiotlb.c
arch/mips/loongson64/common/env.c
arch/mips/loongson64/common/setup.c
arch/mips/loongson64/common/uart_base.c
arch/mips/loongson64/lemote-2f/ec_kb3310b.c
arch/mips/loongson64/lemote-2f/irq.c
arch/mips/loongson64/lemote-2f/pm.c
arch/mips/loongson64/loongson-3/irq.c
arch/mips/loongson64/loongson-3/numa.c
arch/mips/loongson64/loongson-3/smp.c
arch/mips/mm/Makefile
arch/mips/mm/c-r4k.c
arch/mips/mm/init.c
arch/mips/mm/mmap.c
arch/mips/mm/page-funcs.S
arch/mips/mm/page.c
arch/mips/mm/pgtable-64.c
arch/mips/mm/pgtable.c [new file with mode: 0644]
arch/mips/mm/sc-ip22.c
arch/mips/mm/sc-mips.c
arch/mips/mm/tlbex.c
arch/mips/mti-malta/malta-platform.c
arch/mips/netlogic/common/irq.c
arch/mips/netlogic/common/smpboot.S
arch/mips/netlogic/xlp/wakeup.c
arch/mips/oprofile/op_model_mipsxx.c
arch/mips/pci/pci-tx4927.c
arch/mips/pci/pci-tx4938.c
arch/mips/pci/pci-tx4939.c
arch/mips/pic32/pic32mzda/Makefile
arch/mips/pmcs-msp71xx/msp_prom.c
arch/mips/pmcs-msp71xx/msp_time.c
arch/mips/ralink/Kconfig
arch/mips/ralink/clk.c
arch/mips/ralink/irq.c
arch/mips/ralink/mt7620.c
arch/mips/ralink/mt7621.c
arch/mips/ralink/of.c
arch/mips/ralink/prom.c
arch/mips/ralink/rt288x.c
arch/mips/ralink/rt305x.c
arch/mips/ralink/rt3883.c
arch/mips/ralink/timer.c
arch/mips/rb532/irq.c
arch/mips/rb532/prom.c
arch/mips/sgi-ip22/Platform
arch/mips/sgi-ip22/ip22-hpc.c
arch/mips/sgi-ip22/ip22-mc.c
arch/mips/sgi-ip22/ip22-nvram.c
arch/mips/sgi-ip22/ip22-reset.c
arch/mips/sgi-ip22/ip22-setup.c
arch/mips/sgi-ip27/ip27-berr.c
arch/mips/sgi-ip27/ip27-init.c
arch/mips/sgi-ip27/ip27-klnuma.c
arch/mips/sgi-ip27/ip27-memory.c
arch/mips/sgi-ip32/crime.c
arch/mips/sgi-ip32/ip32-irq.c
arch/mips/sibyte/bcm1480/setup.c
arch/mips/sibyte/sb1250/setup.c
arch/mips/txx9/generic/7segled.c
arch/mips/txx9/generic/pci.c
arch/mips/txx9/generic/setup.c
arch/mips/txx9/generic/setup_tx3927.c
arch/mips/txx9/generic/setup_tx4927.c
arch/mips/txx9/generic/setup_tx4938.c
arch/mips/txx9/generic/setup_tx4939.c
arch/mips/txx9/generic/smsc_fdc37m81x.c
arch/mips/txx9/jmr3927/prom.c
arch/mips/txx9/jmr3927/setup.c
arch/mips/txx9/rbtx4938/setup.c
arch/mips/vdso/Makefile
arch/mips/vr41xx/common/bcu.c
arch/mips/vr41xx/common/cmu.c
arch/mips/vr41xx/common/icu.c
arch/mips/vr41xx/common/irq.c
arch/mips/xilfpga/intc.c
drivers/of/base.c
drivers/of/fdt.c
scripts/Kbuild.include

diff --git a/Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt b/Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt
new file mode 100644 (file)
index 0000000..2d5126d
--- /dev/null
@@ -0,0 +1,10 @@
+Imagination Technologies' Pistachio SoC based Marduk Board
+==========================================================
+
+Compatible string must be "img,pistachio-marduk", "img,pistachio"
+
+Hardware and other related documentation is available at
+https://docs.creatordev.io/ci40/
+
+It is also known as Creator Ci40. Marduk is legacy name and will
+be there for decades.
index d5dee50..0e542ed 100644 (file)
@@ -7707,6 +7707,12 @@ W:       http://www.kernel.org/doc/man-pages
 L:     linux-man@vger.kernel.org
 S:     Maintained
 
+MARDUK (CREATOR CI40) DEVICE TREE SUPPORT
+M:     Rahul Bedarkar <rahul.bedarkar@imgtec.com>
+L:     linux-mips@linux-mips.org
+S:     Maintained
+F:     arch/mips/boot/dts/img/pistachio_marduk.dts
+
 MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER
 M:     Andrew Lunn <andrew@lunn.ch>
 M:     Vivien Didelot <vivien.didelot@savoirfairelinux.com>
@@ -9795,7 +9801,7 @@ L:      linux-mips@linux-mips.org
 S:      Maintained
 F:      arch/mips/pistachio/
 F:      arch/mips/include/asm/mach-pistachio/
-F:      arch/mips/boot/dts/pistachio/
+F:      arch/mips/boot/dts/img/pistachio*
 F:      arch/mips/configs/pistachio*_defconfig
 
 PKTCDVD DRIVER
index e137eed..a008a9f 100644 (file)
@@ -9,10 +9,13 @@ config MIPS
        select HAVE_CONTEXT_TRACKING
        select HAVE_GENERIC_DMA_COHERENT
        select HAVE_IDE
+       select HAVE_IRQ_EXIT_ON_IRQ_STACK
        select HAVE_OPROFILE
        select HAVE_PERF_EVENTS
        select PERF_USE_VMALLOC
        select HAVE_ARCH_KGDB
+       select HAVE_ARCH_MMAP_RND_BITS if MMU
+       select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
        select HAVE_CBPF_JIT if !CPU_MICROMIPS
@@ -94,6 +97,7 @@ config MIPS_GENERIC
        select PCI_DRIVERS_GENERIC
        select PINCTRL
        select SMP_UP if SMP
+       select SWAP_IO_SPACE
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_HAS_CPU_MIPS32_R2
        select SYS_HAS_CPU_MIPS32_R6
@@ -478,6 +482,7 @@ config MACH_XILFPGA
        select SYS_SUPPORTS_ZBOOT_UART16550
        select USE_OF
        select USE_GENERIC_EARLY_PRINTK_8250
+       select XILINX_INTC
        help
          This enables support for the IMG University Program MIPSfpga platform.
 
@@ -909,6 +914,7 @@ config CAVIUM_OCTEON_SOC
        select NR_CPUS_DEFAULT_16
        select BUILTIN_DTB
        select MTD_COMPLEX_MAPPINGS
+       select SYS_SUPPORTS_RELOCATABLE
        help
          This option supports all of the Octeon reference boards from Cavium
          Networks. It builds a kernel that dynamically determines the Octeon
@@ -1427,7 +1433,6 @@ config CPU_LOONGSON1C
        bool "Loongson 1C"
        depends on SYS_HAS_CPU_LOONGSON1C
        select CPU_LOONGSON1
-       select ARCH_WANT_OPTIONAL_GPIOLIB
        select LEDS_GPIO_REGISTER
        help
          The Loongson 1C is a 32-bit SoC, which implements the MIPS32
@@ -2288,7 +2293,7 @@ config MIPS_MT_FPAFF
 
 config MIPSR2_TO_R6_EMULATOR
        bool "MIPS R2-to-R6 emulator"
-       depends on CPU_MIPSR6 && !SMP
+       depends on CPU_MIPSR6
        default y
        help
          Choose this option if you want to run non-R6 MIPS userland code.
@@ -2296,8 +2301,6 @@ config MIPSR2_TO_R6_EMULATOR
          default. You can enable it using the 'mipsr2emu' kernel option.
          The only reason this is a build-time option is to save ~14K from the
          final kernel image.
-comment "MIPS R2-to-R6 emulator is only available for UP kernels"
-       depends on SMP && CPU_MIPSR6
 
 config MIPS_VPE_LOADER
        bool "VPE loader support."
@@ -2572,7 +2575,7 @@ config SYS_SUPPORTS_NUMA
 
 config RELOCATABLE
        bool "Relocatable kernel"
-       depends on SYS_SUPPORTS_RELOCATABLE && (CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_MIPS32_R6 || CPU_MIPS64_R6)
+       depends on SYS_SUPPORTS_RELOCATABLE && (CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_MIPS32_R6 || CPU_MIPS64_R6 || CAVIUM_OCTEON_SOC)
        help
          This builds a kernel image that retains relocation information
          so it can be loaded someplace besides the default 1MB.
@@ -2828,8 +2831,8 @@ config KEXEC
          made.
 
 config CRASH_DUMP
-         bool "Kernel crash dumps"
-         help
+       bool "Kernel crash dumps"
+       help
          Generate crash dump after being started by kexec.
          This should be normally only set in special crash dump kernels
          which are loaded in the main kernel with kexec-tools into
@@ -2839,11 +2842,11 @@ config CRASH_DUMP
          PHYSICAL_START.
 
 config PHYSICAL_START
-         hex "Physical address where the kernel is loaded"
-         default "0xffffffff84000000" if 64BIT
-         default "0x84000000" if 32BIT
-         depends on CRASH_DUMP
-         help
+       hex "Physical address where the kernel is loaded"
+       default "0xffffffff84000000" if 64BIT
+       default "0x84000000" if 32BIT
+       depends on CRASH_DUMP
+       help
          This gives the CKSEG0 or KSEG0 address where the kernel is loaded.
          If you plan to use kernel for capturing the crash dump change
          this value to start of the reserved region (the "X" value as
@@ -3075,6 +3078,20 @@ config MMU
        bool
        default y
 
+config ARCH_MMAP_RND_BITS_MIN
+       default 12 if 64BIT
+       default 8
+
+config ARCH_MMAP_RND_BITS_MAX
+       default 18 if 64BIT
+       default 15
+
+config ARCH_MMAP_RND_COMPAT_BITS_MIN
+       default 8
+
+config ARCH_MMAP_RND_COMPAT_BITS_MAX
+       default 15
+
 config I8253
        bool
        select CLKSRC_I8253
index 1a6bac7..8ef9c02 100644 (file)
@@ -131,6 +131,21 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.
 
 cflags-$(CONFIG_SB1XXX_CORELIS)        += $(call cc-option,-mno-sched-prolog) \
                                   -fno-omit-frame-pointer
+
+# Some distribution-specific toolchains might pass the -fstack-check
+# option during the build, which adds a simple stack-probe at the beginning
+# of every function.  This stack probe is to ensure that there is enough
+# stack space, else a SEGV is generated.  This is not desirable for MIPS
+# as kernel stacks are small, placed in unmapped virtual memory, and do not
+# grow when overflowed.  Especially on SGI IP27 platforms, this check will
+# lead to a NULL pointer dereference in _raw_spin_lock_irq.
+#
+# In disassembly, this stack probe appears at the top of a function as:
+#    sd                zero,<offset>(sp)
+# Where <offset> is a negative value.
+#
+cflags-y += -fno-stack-check
+
 #
 # CPU-dependent compiler/assembler options for optimization.
 #
@@ -320,6 +335,9 @@ bootz-y                     := vmlinuz
 bootz-y                        += vmlinuz.bin
 bootz-y                        += vmlinuz.ecoff
 bootz-y                        += vmlinuz.srec
+ifeq ($(shell expr $(zload-y) \< 0xffffffff80000000 2> /dev/null), 0)
+bootz-y                        += uzImage.bin
+endif
 
 ifdef CONFIG_LASAT
 rom.bin rom.sw: vmlinux
@@ -327,10 +345,6 @@ rom.bin rom.sw: vmlinux
                $(bootvars-y) $@
 endif
 
-CMD_RELOCS = arch/mips/boot/tools/relocs
-quiet_cmd_relocs = RELOCS  $<
-      cmd_relocs = $(CMD_RELOCS) $<
-
 #
 # Some machines like the Indy need 32-bit ELF binaries for booting purposes.
 # Other need ECOFF, so we build a 32-bit ELF binary for them which we then
@@ -339,11 +353,6 @@ quiet_cmd_relocs = RELOCS  $<
 quiet_cmd_32 = OBJCOPY $@
        cmd_32 = $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@
 vmlinux.32: vmlinux
-ifeq ($(CONFIG_RELOCATABLE)$(CONFIG_64BIT),yy)
-# Currently, objcopy fails to handle the relocations in the elf64
-# So the relocs tool must be run here to remove them first
-       $(call cmd,relocs)
-endif
        $(call cmd,32)
 
 #
@@ -359,9 +368,6 @@ all:        $(all-y)
 
 # boot
 $(boot-y): $(vmlinux-32) FORCE
-ifeq ($(CONFIG_RELOCATABLE)$(CONFIG_32BIT),yy)
-       $(call cmd,relocs)
-endif
        $(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) \
                $(bootvars-y) arch/mips/boot/$@
 
@@ -395,11 +401,11 @@ dtbs_install:
 
 archprepare:
 ifdef CONFIG_MIPS32_N32
-       @echo '  Checking missing-syscalls for N32'
+       @$(kecho) '  Checking missing-syscalls for N32'
        $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=n32"
 endif
 ifdef CONFIG_MIPS32_O32
-       @echo '  Checking missing-syscalls for O32'
+       @$(kecho) '  Checking missing-syscalls for O32'
        $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=32"
 endif
 
@@ -433,6 +439,7 @@ define archhelp
        echo '  uImage.gz            - U-Boot image (gzip)'
        echo '  uImage.lzma          - U-Boot image (lzma)'
        echo '  uImage.lzo           - U-Boot image (lzo)'
+       echo '  uzImage.bin          - U-Boot image (self-extracting)'
        echo '  dtbs                 - Device-tree blobs for enabled boards'
        echo '  dtbs_install         - Install dtbs to $(INSTALL_DTBS_PATH)'
        echo
diff --git a/arch/mips/Makefile.postlink b/arch/mips/Makefile.postlink
new file mode 100644 (file)
index 0000000..4b7f5a6
--- /dev/null
@@ -0,0 +1,35 @@
+# ===========================================================================
+# Post-link MIPS pass
+# ===========================================================================
+#
+# 1. Insert relocations into vmlinux
+
+PHONY := __archpost
+__archpost:
+
+-include include/config/auto.conf
+include scripts/Kbuild.include
+
+CMD_RELOCS = arch/mips/boot/tools/relocs
+quiet_cmd_relocs = RELOCS $@
+      cmd_relocs = $(CMD_RELOCS) $@
+
+# `@true` prevents complaint when there is nothing to be done
+
+vmlinux: FORCE
+       @true
+ifeq ($(CONFIG_RELOCATABLE),y)
+       $(call if_changed,relocs)
+endif
+
+%.ko: FORCE
+       @true
+
+clean:
+       @true
+
+PHONY += FORCE clean
+
+FORCE:
+
+.PHONY: $(PHONY)
index 79efe4c..6fb6b3f 100644 (file)
@@ -236,7 +236,6 @@ static struct platform_device gpr_i2c_device = {
 static struct i2c_board_info gpr_i2c_info[] __initdata = {
        {
                I2C_BOARD_INFO("lm83", 0x18),
-               .type = "lm83"
        }
 };
 
index f2f264b..fc482d9 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/syscore_ops.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
index 4fb6207..973049b 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 #include <linux/init.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/spinlock.h>
index e6b90e7..7d5da5e 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/gpio.h>
 #include <asm/mach-au1x00/gpio-au1000.h>
index 5340210..af312b5 100644 (file)
@@ -33,7 +33,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/string.h>
 
index 297805a..634edd3 100644 (file)
@@ -10,9 +10,9 @@
  */
 
 #include <linux/clk.h>
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/syscore_ops.h>
 #include <asm/cpu.h>
index d23b144..a7bd32e 100644 (file)
@@ -6,7 +6,7 @@
  * for various media blocks are enabled/disabled.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/spinlock.h>
 #include <asm/mach-au1x00/au1000.h>
 
index faeddf1..c1a2daa 100644 (file)
@@ -9,7 +9,8 @@
 
 #include <linux/interrupt.h>
 #include <linux/irqchip/chained_irq.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/spinlock.h>
 #include <linux/irq.h>
 #include <asm/addrspace.h>
index 2460f9d..dda422a 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/delay.h>
 #include <linux/gcd.h>
 #include <linux/io.h>
index ed5b3d2..4eee7e9 100644 (file)
@@ -18,7 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/gpio.h>
 
 #include <asm/mach-ar7/ar7.h>
index 92dfa48..0332f05 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/bootmem.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/module.h>
 #include <linux/pfn.h>
 #include <linux/proc_fs.h>
 #include <linux/string.h>
index 58fca9a..df7acea 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <linux/init.h>
 #include <linux/types.h>
-#include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
index a23adc4..4fd8333 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/serial_reg.h>
 #include <linux/spinlock.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/string.h>
 #include <linux/io.h>
 #include <asm/bootinfo.h>
index cc3a1e3..fa84595 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/err.h>
 #include <linux/clk.h>
@@ -45,7 +44,7 @@ static struct clk *__init ath79_add_sys_clkdev(
        int err;
 
        clk = clk_register_fixed_rate(NULL, id, NULL, 0, rate);
-       if (!clk)
+       if (IS_ERR(clk))
                panic("failed to allocate %s clock structure", id);
 
        err = clk_register_clkdev(clk, id, NULL);
@@ -508,16 +507,19 @@ static void __init ath79_clocks_init_dt_ng(struct device_node *np)
                ar9330_clk_init(ref_clk, pll_base);
        else {
                pr_err("%s: could not find any appropriate clk_init()\n", dnfn);
-               goto err_clk;
+               goto err_iounmap;
        }
 
        if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data)) {
                pr_err("%s: could not register clk provider\n", dnfn);
-               goto err_clk;
+               goto err_iounmap;
        }
 
        return;
 
+err_iounmap:
+       iounmap(pll_base);
+
 err_clk:
        clk_put(ref_clk);
 
index d071a3a..10a405d 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/types.h>
 #include <linux/spinlock.h>
 
index a88975a..8cbe60c 100644 (file)
@@ -149,6 +149,15 @@ struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] __initconst = {
 /* board_id */
 static const
 struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = {
+       {{BCM47XX_BOARD_LUXUL_ABR_4400_V1, "Luxul ABR-4400 V1"}, "luxul_abr4400_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_310_V1, "Luxul XAP-310 V1"}, "luxul_xap310_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_1210_V1, "Luxul XAP-1210 V1"}, "luxul_xap1210_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_1230_V1, "Luxul XAP-1230 V1"}, "luxul_xap1230_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_1240_V1, "Luxul XAP-1240 V1"}, "luxul_xap1240_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_1500_V1, "Luxul XAP-1500 V1"}, "luxul_xap1500_v1"},
+       {{BCM47XX_BOARD_LUXUL_XBR_4400_V1, "Luxul XBR-4400 V1"}, "luxul_xbr4400_v1"},
+       {{BCM47XX_BOARD_LUXUL_XVW_P30_V1, "Luxul XVW-P30 V1"}, "luxul_xvwp30_v1"},
+       {{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"},
        {{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"},
        {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
        {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
index 52caa75..8a760d8 100644 (file)
                .active_low     = 1,                                    \
        }
 
+#define BCM47XX_GPIO_KEY_H(_gpio, _code)                               \
+       {                                                               \
+               .code           = _code,                                \
+               .gpio           = _gpio,                                \
+       }
+
 /* Asus */
 
 static const struct gpio_keys_button
@@ -79,8 +85,8 @@ bcm47xx_buttons_asus_wl500gpv2[] __initconst = {
 
 static const struct gpio_keys_button
 bcm47xx_buttons_asus_wl500w[] __initconst = {
-       BCM47XX_GPIO_KEY(6, KEY_RESTART),
-       BCM47XX_GPIO_KEY(7, KEY_WPS_BUTTON),
+       BCM47XX_GPIO_KEY_H(6, KEY_RESTART),
+       BCM47XX_GPIO_KEY_H(7, KEY_WPS_BUTTON),
 };
 
 static const struct gpio_keys_button
@@ -302,6 +308,51 @@ bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = {
 /* Luxul */
 
 static const struct gpio_keys_button
+bcm47xx_buttons_luxul_abr_4400_v1[] = {
+       BCM47XX_GPIO_KEY(14, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_310_v1[] = {
+       BCM47XX_GPIO_KEY(20, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_1210_v1[] = {
+       BCM47XX_GPIO_KEY(8, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_1230_v1[] = {
+       BCM47XX_GPIO_KEY(8, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_1240_v1[] = {
+       BCM47XX_GPIO_KEY(8, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_1500_v1[] = {
+       BCM47XX_GPIO_KEY(14, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xbr_4400_v1[] = {
+       BCM47XX_GPIO_KEY(14, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xvw_p30_v1[] = {
+       BCM47XX_GPIO_KEY(20, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xwr_600_v1[] = {
+       BCM47XX_GPIO_KEY(8, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
 bcm47xx_buttons_luxul_xwr_1750_v1[] = {
        BCM47XX_GPIO_KEY(14, BTN_TASK),
 };
@@ -561,6 +612,33 @@ int __init bcm47xx_buttons_register(void)
                err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs);
                break;
 
+       case BCM47XX_BOARD_LUXUL_ABR_4400_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_abr_4400_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_310_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_310_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1210_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1210_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1230_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1230_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1240_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1240_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1500_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1500_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XBR_4400_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xbr_4400_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XVW_P30_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xvw_p30_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XWR_600_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_600_v1);
+               break;
        case BCM47XX_BOARD_LUXUL_XWR_1750_V1:
                err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_1750_v1);
                break;
index d20ae63..a35f1d5 100644 (file)
@@ -373,6 +373,60 @@ bcm47xx_leds_linksys_wrtsl54gs[] __initconst = {
 /* Luxul */
 
 static const struct gpio_led
+bcm47xx_leds_luxul_abr_4400_v1[] __initconst = {
+       BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(15, "green", "status", 0, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_310_v1[] __initconst = {
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_1210_v1[] __initconst = {
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_1230_v1[] __initconst = {
+       BCM47XX_GPIO_LED(3, "blue", "2ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED(4, "green", "bridge", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_1240_v1[] __initconst = {
+       BCM47XX_GPIO_LED(3, "blue", "2ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED(4, "green", "bridge", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_1500_v1[] __initconst = {
+       BCM47XX_GPIO_LED_TRIGGER(13, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xbr_4400_v1[] __initconst = {
+       BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(15, "green", "status", 0, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xvw_p30_v1[] __initconst = {
+       BCM47XX_GPIO_LED_TRIGGER(0, "blue", "status", 1, "timer"),
+       BCM47XX_GPIO_LED(1, "green", "link", 1, LEDS_GPIO_DEFSTATE_OFF),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xwr_600_v1[] __initconst = {
+       BCM47XX_GPIO_LED(3, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+       BCM47XX_GPIO_LED(9, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
+};
+
+static const struct gpio_led
 bcm47xx_leds_luxul_xwr_1750_v1[] __initconst = {
        BCM47XX_GPIO_LED(5, "green", "5ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
        BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
@@ -633,6 +687,33 @@ void __init bcm47xx_leds_register(void)
                bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs);
                break;
 
+       case BCM47XX_BOARD_LUXUL_ABR_4400_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_abr_4400_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_310_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_310_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1210_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1210_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1230_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1230_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1240_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1240_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1500_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1500_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XBR_4400_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xbr_4400_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XVW_P30_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xvw_p30_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XWR_600_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xwr_600_v1);
+               break;
        case BCM47XX_BOARD_LUXUL_XWR_1750_V1:
                bcm47xx_set_pdata(bcm47xx_leds_luxul_xwr_1750_v1);
                break;
index b49fc9c..7362604 100644 (file)
@@ -6,7 +6,8 @@
  * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/mutex.h>
 #include <linux/err.h>
 #include <linux/clk.h>
index 1c7c3fb..f61c16f 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/cpu.h>
 #include <asm/cpu.h>
 #include <asm/cpu-info.h>
index 50d8190..29205ba 100644 (file)
@@ -7,7 +7,8 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/export.h>
 #include <linux/spinlock.h>
 #include <linux/log2.h>
 #include <bcm63xx_cpu.h>
index 7c256da..16f353a 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/platform_device.h>
 #include <linux/gpio/driver.h>
index c961390..ec694b9 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
 #include <linux/irq.h>
 #include <linux/spinlock.h>
 #include <asm/irq_cpu.h>
index d1fe51e..a2af38c 100644 (file)
@@ -6,7 +6,8 @@
  * Copyright (C) 2012 Jonas Gorski <jonas.gorski@gmail.com>
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/mutex.h>
 #include <linux/err.h>
 #include <linux/clk.h>
index 2110359..a860658 100644 (file)
@@ -8,7 +8,8 @@
 
 #include <linux/kernel.h>
 #include <linux/err.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
 #include <linux/clk.h>
index 90aca95..c675eec 100644 (file)
@@ -18,14 +18,14 @@ include $(srctree)/arch/mips/Kbuild.platforms
 BOOT_HEAP_SIZE := 0x400000
 
 # Disable Function Tracer
-KBUILD_CFLAGS := $(shell echo $(KBUILD_CFLAGS) | sed -e "s/-pg//")
+KBUILD_CFLAGS := $(filter-out -pg, $(KBUILD_CFLAGS))
 
 KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS))
 
-KBUILD_CFLAGS := $(LINUXINCLUDE) $(KBUILD_CFLAGS) -D__KERNEL__ \
+KBUILD_CFLAGS := $(KBUILD_CFLAGS) -D__KERNEL__ \
        -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull"
 
-KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
+KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
        -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \
        -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS)
 
@@ -84,6 +84,7 @@ else
 VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \
                $(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS))
 endif
+UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS)
 
 vmlinuzobjs-y += $(obj)/piggy.o
 
@@ -129,4 +130,7 @@ OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec
 vmlinuz.srec: vmlinuz
        $(call cmd,objcopy)
 
+uzImage.bin: vmlinuz.bin FORCE
+       $(call if_changed,uimage,none)
+
 clean-files := $(objtree)/vmlinuz $(objtree)/vmlinuz.{32,ecoff,bin,srec}
index fc7a0a9..b9db492 100644 (file)
@@ -1,5 +1,6 @@
 dts-dirs       += brcm
 dts-dirs       += cavium-octeon
+dts-dirs       += img
 dts-dirs       += ingenic
 dts-dirs       += lantiq
 dts-dirs       += mti
index bbd00f6..79f838e 100644 (file)
                        compatible = "brcm,bcm7120-l2-intc";
                        reg = <0x406780 0x8>;
 
-                       brcm,int-map-mask = <0x44>, <0xf000000>;
+                       brcm,int-map-mask = <0x44>, <0xf000000>, <0x100000>;
                        brcm,int-fwd-mask = <0x70000>;
 
                        interrupt-controller;
                        #interrupt-cells = <1>;
 
                        interrupt-parent = <&periph_intc>;
-                       interrupts = <18>, <19>;
-                       interrupt-names = "upg_main", "upg_bsc";
+                       interrupts = <18>, <19>, <20>;
+                       interrupt-names = "upg_main", "upg_bsc", "upg_spi";
                };
 
                sun_top_ctrl: syscon@404000 {
                        interrupts = <61>;
                        status = "disabled";
                };
+
+               spi_l2_intc: interrupt-controller@411d00 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x411d00 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <79>;
+               };
+
+               qspi: spi@443000 {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-qspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x440920 0x4 0x443200 0x188 0x443000 0x50>;
+                       reg-names = "cs_reg", "hif_mspi", "bspi";
+                       interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
+                       interrupt-parent = <&spi_l2_intc>;
+                       interrupt-names = "spi_lr_fullness_reached",
+                                         "spi_lr_session_aborted",
+                                         "spi_lr_impatient",
+                                         "spi_lr_session_done",
+                                         "spi_lr_overread",
+                                         "mspi_done",
+                                         "mspi_halted";
+                       status = "disabled";
+               };
+
+               mspi: spi@406400 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-mspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x406400 0x180>;
+                       reg-names = "mspi";
+                       interrupts = <0x14>;
+                       interrupt-parent = <&upg_irq0_intc>;
+                       interrupt-names = "mspi_done";
+                       status = "disabled";
+               };
        };
 };
index 4bbcc95..da7bfa4 100644 (file)
                        interrupts = <85>;
                        status = "disabled";
                };
+
+               spi_l2_intc: interrupt-controller@411d00 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x411d00 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <31>;
+               };
+
+               qspi: spi@413000 {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-qspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x410920 0x4 0x413200 0x188 0x413000 0x50>;
+                       reg-names = "cs_reg", "hif_mspi", "bspi";
+                       interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
+                       interrupt-parent = <&spi_l2_intc>;
+                       interrupt-names = "spi_lr_fullness_reached",
+                                         "spi_lr_session_aborted",
+                                         "spi_lr_impatient",
+                                         "spi_lr_session_done",
+                                         "spi_lr_overread",
+                                         "mspi_done",
+                                         "mspi_halted";
+                       status = "disabled";
+               };
+
+               mspi: spi@408a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-mspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x408a00 0x180>;
+                       reg-names = "mspi";
+                       interrupts = <0x14>;
+                       interrupt-parent = <&upg_aon_irq0_intc>;
+                       interrupt-names = "mspi_done";
+                       status = "disabled";
+               };
        };
 };
index 3e42535..9b05760 100644 (file)
                        interrupts = <24>;
                        status = "disabled";
                };
+
+               spi_l2_intc: interrupt-controller@411d00 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x411d00 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <31>;
+               };
+
+               qspi: spi@413000 {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-qspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x410920 0x4 0x413200 0x188 0x413000 0x50>;
+                       reg-names = "cs_reg", "hif_mspi", "bspi";
+                       interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
+                       interrupt-parent = <&spi_l2_intc>;
+                       interrupt-names = "spi_lr_fullness_reached",
+                                         "spi_lr_session_aborted",
+                                         "spi_lr_impatient",
+                                         "spi_lr_session_done",
+                                         "spi_lr_overread",
+                                         "mspi_done",
+                                         "mspi_halted";
+                       status = "disabled";
+               };
+
+               mspi: spi@408a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-mspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x408a00 0x180>;
+                       reg-names = "mspi";
+                       interrupts = <0x14>;
+                       interrupt-parent = <&upg_aon_irq0_intc>;
+                       interrupt-names = "mspi_done";
+                       status = "disabled";
+               };
        };
 };
index 112a557..57b613c 100644 (file)
                        interrupts = <82>;
                        status = "disabled";
                };
+
+               spi_l2_intc: interrupt-controller@411d00 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x411d00 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <31>;
+               };
+
+               qspi: spi@413000 {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-qspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x410920 0x4 0x413200 0x188 0x413000 0x50>;
+                       reg-names = "cs_reg", "hif_mspi", "bspi";
+                       interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
+                       interrupt-parent = <&spi_l2_intc>;
+                       interrupt-names = "spi_lr_fullness_reached",
+                                         "spi_lr_session_aborted",
+                                         "spi_lr_impatient",
+                                         "spi_lr_session_done",
+                                         "spi_lr_overread",
+                                         "mspi_done",
+                                         "mspi_halted";
+                       status = "disabled";
+               };
+
+               mspi: spi@408a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-mspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x408a00 0x180>;
+                       reg-names = "mspi";
+                       interrupts = <0x14>;
+                       interrupt-parent = <&upg_aon_irq0_intc>;
+                       interrupt-names = "mspi_done";
+                       status = "disabled";
+               };
        };
 };
index 34abfb0..c2a2843 100644 (file)
                        interrupts = <82>;
                        status = "disabled";
                };
+
+               spi_l2_intc: interrupt-controller@411d00 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x411d00 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <31>;
+               };
+
+               qspi: spi@413000 {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-qspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x410920 0x4 0x413200 0x188 0x413000 0x50>;
+                       reg-names = "cs_reg", "hif_mspi", "bspi";
+                       interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
+                       interrupt-parent = <&spi_l2_intc>;
+                       interrupt-names = "spi_lr_fullness_reached",
+                                         "spi_lr_session_aborted",
+                                         "spi_lr_impatient",
+                                         "spi_lr_session_done",
+                                         "spi_lr_overread",
+                                         "mspi_done",
+                                         "mspi_halted";
+                       status = "disabled";
+               };
+
+               mspi: spi@408a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-mspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x408a00 0x180>;
+                       reg-names = "mspi";
+                       interrupts = <0x14>;
+                       interrupt-parent = <&upg_aon_irq0_intc>;
+                       interrupt-names = "mspi_done";
+                       status = "disabled";
+               };
        };
 };
index b143723..532fc8a 100644 (file)
                        compatible = "brcm,bcm7120-l2-intc";
                        reg = <0x406780 0x8>;
 
-                       brcm,int-map-mask = <0x44>, <0x1f000000>;
+                       brcm,int-map-mask = <0x44>, <0x1f000000>, <0x100000>;
                        brcm,int-fwd-mask = <0x70000>;
 
                        interrupt-controller;
                        #interrupt-cells = <1>;
 
                        interrupt-parent = <&periph_intc>;
-                       interrupts = <18>, <19>;
-                       interrupt-names = "upg_main", "upg_bsc";
+                       interrupts = <18>, <19>, <20>;
+                       interrupt-names = "upg_main", "upg_bsc", "upg_spi";
                };
 
                sun_top_ctrl: syscon@404000 {
                        interrupts = <62>;
                        status = "disabled";
                };
+
+               spi_l2_intc: interrupt-controller@411d00 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x411d00 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <78>;
+               };
+
+               qspi: spi@443000 {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-qspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x440920 0x4 0x443200 0x188 0x443000 0x50>;
+                       reg-names = "cs_reg", "hif_mspi", "bspi";
+                       interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
+                       interrupt-parent = <&spi_l2_intc>;
+                       interrupt-names = "spi_lr_fullness_reached",
+                                         "spi_lr_session_aborted",
+                                         "spi_lr_impatient",
+                                         "spi_lr_session_done",
+                                         "spi_lr_overread",
+                                         "mspi_done",
+                                         "mspi_halted";
+                       status = "disabled";
+               };
+
+               mspi: spi@406400 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-mspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x406400 0x180>;
+                       reg-names = "mspi";
+                       interrupts = <0x14>;
+                       interrupt-parent = <&upg_irq0_intc>;
+                       interrupt-names = "mspi_done";
+                       status = "disabled";
+               };
        };
 };
index 2488d2f..f56fb25 100644 (file)
                        mmc-hs200-1_8v;
                        status = "disabled";
                };
+
+               spi_l2_intc: interrupt-controller@41ad00 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x41ad00 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <25>;
+               };
+
+               qspi: spi@41c000 {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-qspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x419920 0x4 0x41c200 0x188 0x41c000 0x50>;
+                       reg-names = "cs_reg", "hif_mspi", "bspi";
+                       interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
+                       interrupt-parent = <&spi_l2_intc>;
+                       interrupt-names = "spi_lr_fullness_reached",
+                                         "spi_lr_session_aborted",
+                                         "spi_lr_impatient",
+                                         "spi_lr_session_done",
+                                         "spi_lr_overread",
+                                         "mspi_done",
+                                         "mspi_halted";
+                       status = "disabled";
+               };
+
+               mspi: spi@409200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-mspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x409200 0x180>;
+                       reg-names = "mspi";
+                       interrupts = <0x14>;
+                       interrupt-parent = <&upg_aon_irq0_intc>;
+                       interrupt-names = "mspi_done";
+                       status = "disabled";
+               };
        };
 };
index 19fa259..f2cead2 100644 (file)
                        mmc-hs200-1_8v;
                        status = "disabled";
                };
+
+               spi_l2_intc: interrupt-controller@41bd00 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x41bd00 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <25>;
+               };
+
+               qspi: spi@41d200 {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-qspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x41a920 0x4 0x41d400 0x188 0x41d200 0x50>;
+                       reg-names = "cs_reg", "hif_mspi", "bspi";
+                       interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>;
+                       interrupt-parent = <&spi_l2_intc>;
+                       interrupt-names = "spi_lr_fullness_reached",
+                                         "spi_lr_session_aborted",
+                                         "spi_lr_impatient",
+                                         "spi_lr_session_done",
+                                         "spi_lr_overread",
+                                         "mspi_done",
+                                         "mspi_halted";
+                       status = "disabled";
+               };
+
+               mspi: spi@409200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,spi-bcm-qspi",
+                                    "brcm,spi-brcmstb-mspi";
+                       clocks = <&upg_clk>;
+                       reg = <0x409200 0x180>;
+                       reg-names = "mspi";
+                       interrupts = <0x14>;
+                       interrupt-parent = <&upg_aon_irq0_intc>;
+                       interrupt-names = "mspi_done";
+                       status = "disabled";
+               };
        };
 };
index 5c24eac..d72bc42 100644 (file)
@@ -57,3 +57,7 @@
 &ohci0 {
        status = "disabled";
 };
+
+&mspi {
+       status = "okay";
+};
index e67eaf3..ea52d7b 100644 (file)
 &sdhci0 {
        status = "okay";
 };
+
+&mspi {
+       status = "okay";
+};
index ee4607f..71357fd 100644 (file)
 &nand {
        status = "okay";
 };
+
+&qspi {
+       status = "okay";
+
+       m25p80@0 {
+               compatible = "m25p80";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+               spi-cpol;
+               spi-cpha;
+               use-bspi;
+               m25p,fast-read;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       flash0.cfe@0 {
+                               reg = <0x0 0x200000>;
+                       };
+
+                       flash0.mac@200000 {
+                               reg = <0x200000 0x40000>;
+                       };
+
+                       flash0.nvram@240000 {
+                               reg = <0x240000 0x10000>;
+                       };
+               };
+       };
+};
+
+&mspi {
+       status = "okay";
+};
index bed821b..e2fed40 100644 (file)
 &sdhci0 {
        status = "okay";
 };
+
+&qspi {
+       status = "okay";
+
+       m25p80@0 {
+               compatible = "m25p80";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+               spi-cpol;
+               spi-cpha;
+               use-bspi;
+               m25p,fast-read;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       flash0.cfe@0 {
+                               reg = <0x0 0x200000>;
+                       };
+
+                       flash0.mac@200000 {
+                               reg = <0x200000 0x40000>;
+                       };
+
+                       flash0.nvram@240000 {
+                               reg = <0x240000 0x10000>;
+                       };
+               };
+       };
+};
+
+&mspi {
+       status = "okay";
+};
index 68fd823..78bffdf 100644 (file)
@@ -73,3 +73,7 @@
 &sdhci0 {
        status = "okay";
 };
+
+&mspi {
+       status = "okay";
+};
index e66271a..d62b448 100644 (file)
@@ -79,3 +79,7 @@
 &ohci1 {
        status = "okay";
 };
+
+&mspi {
+       status = "okay";
+};
index f95ba1b..73aa006 100644 (file)
 &sdhci1 {
        status = "okay";
 };
+
+&qspi {
+       status = "okay";
+
+       m25p80@0 {
+               compatible = "m25p80";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+               spi-cpol;
+               spi-cpha;
+               use-bspi;
+               m25p,fast-read;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       flash0.cfe@0 {
+                               reg = <0x0 0x200000>;
+                       };
+
+                       flash0.mac@200000 {
+                               reg = <0x200000 0x40000>;
+                       };
+
+                       flash0.nvram@240000 {
+                               reg = <0x240000 0x10000>;
+                       };
+               };
+       };
+};
+
+&mspi {
+       status = "okay";
+};
index fb37b71..0a915f3 100644 (file)
 &sdhci1 {
        status = "okay";
 };
+
+&mspi {
+       status = "okay";
+};
diff --git a/arch/mips/boot/dts/img/Makefile b/arch/mips/boot/dts/img/Makefile
new file mode 100644 (file)
index 0000000..69a65f0
--- /dev/null
@@ -0,0 +1,9 @@
+dtb-$(CONFIG_MACH_PISTACHIO)   += pistachio_marduk.dtb
+
+obj-y                          += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+
+# Force kbuild to make empty built-in.o if necessary
+obj-                           += dummy.o
+
+always                         := $(dtb-y)
+clean-files                    := *.dtb *.dtb.S
diff --git a/arch/mips/boot/dts/img/pistachio.dtsi b/arch/mips/boot/dts/img/pistachio.dtsi
new file mode 100644 (file)
index 0000000..57809f6
--- /dev/null
@@ -0,0 +1,924 @@
+/*
+ * Copyright (C) 2015, 2016 Imagination Technologies Ltd.
+ * Copyright (C) 2015 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <dt-bindings/clock/pistachio-clk.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/mips-gic.h>
+#include <dt-bindings/reset/pistachio-resets.h>
+
+/ {
+       compatible = "img,pistachio";
+
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "mti,interaptiv";
+                       reg = <0>;
+                       clocks = <&clk_core CLK_MIPS_PLL>;
+                       clock-names = "cpu";
+                       clock-latency = <1000>;
+                       operating-points = <
+                               /* kHz    uV(dummy) */
+                               546000 1150000
+                               520000 1100000
+                               494000 1000000
+                               468000 950000
+                               442000 900000
+                               416000 800000
+                       >;
+               };
+       };
+
+       i2c0: i2c@18100000 {
+               compatible = "img,scb-i2c";
+               reg = <0x18100000 0x200>;
+               interrupts = <GIC_SHARED 2 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_periph PERIPH_CLK_I2C0>,
+                        <&cr_periph SYS_CLK_I2C0>;
+               clock-names = "scb", "sys";
+               assigned-clocks = <&clk_periph PERIPH_CLK_I2C0_PRE_DIV>,
+                                 <&clk_periph PERIPH_CLK_I2C0_DIV>;
+               assigned-clock-rates = <100000000>, <33333334>;
+               status = "disabled";
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c0_pins>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+
+       i2c1: i2c@18100200 {
+               compatible = "img,scb-i2c";
+               reg = <0x18100200 0x200>;
+               interrupts = <GIC_SHARED 3 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_periph PERIPH_CLK_I2C1>,
+                        <&cr_periph SYS_CLK_I2C1>;
+               clock-names = "scb", "sys";
+               assigned-clocks = <&clk_periph PERIPH_CLK_I2C1_PRE_DIV>,
+                                 <&clk_periph PERIPH_CLK_I2C1_DIV>;
+               assigned-clock-rates = <100000000>, <33333334>;
+               status = "disabled";
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c1_pins>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+
+       i2c2: i2c@18100400 {
+               compatible = "img,scb-i2c";
+               reg = <0x18100400 0x200>;
+               interrupts = <GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_periph PERIPH_CLK_I2C2>,
+                        <&cr_periph SYS_CLK_I2C2>;
+               clock-names = "scb", "sys";
+               assigned-clocks = <&clk_periph PERIPH_CLK_I2C2_PRE_DIV>,
+                                 <&clk_periph PERIPH_CLK_I2C2_DIV>;
+               assigned-clock-rates = <100000000>, <33333334>;
+               status = "disabled";
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c2_pins>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+
+       i2c3: i2c@18100600 {
+               compatible = "img,scb-i2c";
+               reg = <0x18100600 0x200>;
+               interrupts = <GIC_SHARED 5 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_periph PERIPH_CLK_I2C3>,
+                        <&cr_periph SYS_CLK_I2C3>;
+               clock-names = "scb", "sys";
+               assigned-clocks = <&clk_periph PERIPH_CLK_I2C3_PRE_DIV>,
+                                 <&clk_periph PERIPH_CLK_I2C3_DIV>;
+               assigned-clock-rates = <100000000>, <33333334>;
+               status = "disabled";
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c3_pins>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+
+       i2s_in: i2s-in@18100800 {
+               compatible = "img,i2s-in";
+               reg = <0x18100800 0x200>;
+               interrupts = <GIC_SHARED 7 IRQ_TYPE_LEVEL_HIGH>;
+               dmas = <&mdc 30 0xffffffff 0>;
+               dma-names = "rx";
+               clocks = <&cr_periph SYS_CLK_I2S_IN>;
+               clock-names = "sys";
+               img,i2s-channels = <6>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2s_in_pins>;
+               status = "disabled";
+
+               #sound-dai-cells = <0>;
+       };
+
+       i2s_out: i2s-out@18100a00 {
+               compatible = "img,i2s-out";
+               reg = <0x18100a00 0x200>;
+               interrupts = <GIC_SHARED 13 IRQ_TYPE_LEVEL_HIGH>;
+               dmas = <&mdc 23 0xffffffff 0>;
+               dma-names = "tx";
+               clocks = <&cr_periph SYS_CLK_I2S_OUT>,
+                        <&clk_core CLK_I2S>;
+               clock-names = "sys", "ref";
+               assigned-clocks = <&clk_core CLK_I2S_DIV>;
+               assigned-clock-rates = <12288000>;
+               img,i2s-channels = <6>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2s_out_pins>;
+               status = "disabled";
+               resets = <&pistachio_reset PISTACHIO_RESET_I2S_OUT>;
+               reset-names = "rst";
+               #sound-dai-cells = <0>;
+       };
+
+       parallel_out: parallel-audio-out@18100c00 {
+               compatible = "img,parallel-out";
+               reg = <0x18100c00 0x100>;
+               interrupts = <GIC_SHARED 19 IRQ_TYPE_LEVEL_HIGH>;
+               dmas = <&mdc 16 0xffffffff 0>;
+               dma-names = "tx";
+               clocks = <&cr_periph SYS_CLK_PAUD_OUT>,
+                        <&clk_core CLK_AUDIO_DAC>;
+               clock-names = "sys", "ref";
+               assigned-clocks = <&clk_core CLK_AUDIO_DAC_DIV>;
+               assigned-clock-rates = <12288000>;
+               status = "disabled";
+               resets = <&pistachio_reset PISTACHIO_RESET_PRL_OUT>;
+               reset-names = "rst";
+               #sound-dai-cells = <0>;
+       };
+
+       spdif_out: spdif-out@18100d00 {
+               compatible = "img,spdif-out";
+               reg = <0x18100d00 0x100>;
+               interrupts = <GIC_SHARED 21 IRQ_TYPE_LEVEL_HIGH>;
+               dmas = <&mdc 14 0xffffffff 0>;
+               dma-names = "tx";
+               clocks = <&cr_periph SYS_CLK_SPDIF_OUT>,
+                        <&clk_core CLK_SPDIF>;
+               clock-names = "sys", "ref";
+               assigned-clocks = <&clk_core CLK_SPDIF_DIV>;
+               assigned-clock-rates = <12288000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&spdif_out_pin>;
+               status = "disabled";
+               resets = <&pistachio_reset PISTACHIO_RESET_SPDIF_OUT>;
+               reset-names = "rst";
+               #sound-dai-cells = <0>;
+       };
+
+       spdif_in: spdif-in@18100e00 {
+               compatible = "img,spdif-in";
+               reg = <0x18100e00 0x100>;
+               interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
+               dmas = <&mdc 15 0xffffffff 0>;
+               dma-names = "rx";
+               clocks = <&cr_periph SYS_CLK_SPDIF_IN>;
+               clock-names = "sys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&spdif_in_pin>;
+               status = "disabled";
+
+               #sound-dai-cells = <0>;
+       };
+
+       internal_dac: internal-dac {
+               compatible = "img,pistachio-internal-dac";
+               img,cr-top = <&cr_top>;
+               img,voltage-select = <1>;
+
+               #sound-dai-cells = <0>;
+       };
+
+       spfi0: spi@18100f00 {
+               compatible = "img,spfi";
+               reg = <0x18100f00 0x100>;
+               interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_core CLK_SPI0>, <&cr_periph SYS_CLK_SPI0_MASTER>;
+               clock-names = "sys", "spfi";
+               dmas = <&mdc 9 0xffffffff 0>, <&mdc 10 0xffffffff 0>;
+               dma-names = "rx", "tx";
+               spfi-max-frequency = <50000000>;
+               status = "disabled";
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+
+       spfi1: spi@18101000 {
+               compatible = "img,spfi";
+               reg = <0x18101000 0x100>;
+               interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_core CLK_SPI1>, <&cr_periph SYS_CLK_SPI1>;
+               clock-names = "sys", "spfi";
+               dmas = <&mdc 1 0xffffffff 0>, <&mdc 2 0xffffffff 0>;
+               dma-names = "rx", "tx";
+               img,supports-quad-mode;
+               spfi-max-frequency = <50000000>;
+               status = "disabled";
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+
+       pwm: pwm@18101300 {
+               compatible = "img,pistachio-pwm";
+               reg = <0x18101300 0x100>;
+               clocks = <&clk_periph PERIPH_CLK_PWM>,
+                        <&cr_periph SYS_CLK_PWM>;
+               clock-names = "pwm", "sys";
+               img,cr-periph = <&cr_periph>;
+               #pwm-cells = <2>;
+               status = "disabled";
+       };
+
+       uart0: uart@18101400 {
+               compatible = "snps,dw-apb-uart";
+               reg = <0x18101400 0x100>;
+               interrupts = <GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_core CLK_UART0>, <&cr_periph SYS_CLK_UART0>;
+               clock-names = "baudclk", "apb_pclk";
+               assigned-clocks = <&clk_core CLK_UART0_INTERNAL_DIV>,
+                                 <&clk_core CLK_UART0_DIV>;
+               reg-shift = <2>;
+               reg-io-width = <4>;
+               pinctrl-0 = <&uart0_pins>, <&uart0_rts_cts_pins>;
+               pinctrl-names = "default";
+               status = "disabled";
+       };
+
+       uart1: uart@18101500 {
+               compatible = "snps,dw-apb-uart";
+               reg = <0x18101500 0x100>;
+               interrupts = <GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_core CLK_UART1>, <&cr_periph SYS_CLK_UART1>;
+               clock-names = "baudclk", "apb_pclk";
+               assigned-clocks = <&clk_core CLK_UART1_INTERNAL_DIV>,
+                                 <&clk_core CLK_UART1_DIV>;
+               assigned-clock-rates = <114278400>, <1843200>;
+               reg-shift = <2>;
+               reg-io-width = <4>;
+               pinctrl-0 = <&uart1_pins>;
+               pinctrl-names = "default";
+               status = "disabled";
+       };
+
+       adc: adc@18101600 {
+               compatible = "cosmic,10001-adc";
+               reg = <0x18101600 0x24>;
+               adc-reserved-channels = <0x30>;
+               clocks = <&clk_core CLK_AUX_ADC>;
+               clock-names = "adc";
+               assigned-clocks = <&clk_core CLK_AUX_ADC_INTERNAL_DIV>,
+                                 <&clk_core CLK_AUX_ADC_DIV>;
+               assigned-clock-rates = <100000000>, <1000000>;
+               status = "disabled";
+
+               #io-channel-cells = <1>;
+       };
+
+       pinctrl: pinctrl@18101c00 {
+               compatible = "img,pistachio-system-pinctrl";
+               reg = <0x18101c00 0x400>;
+
+               gpio0: gpio0 {
+                       interrupts = <GIC_SHARED 71 IRQ_TYPE_LEVEL_HIGH>;
+
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pinctrl 0 0 16>;
+
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               gpio1: gpio1 {
+                       interrupts = <GIC_SHARED 72 IRQ_TYPE_LEVEL_HIGH>;
+
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pinctrl 0 16 16>;
+
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               gpio2: gpio2 {
+                       interrupts = <GIC_SHARED 73 IRQ_TYPE_LEVEL_HIGH>;
+
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pinctrl 0 32 16>;
+
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               gpio3: gpio3 {
+                       interrupts = <GIC_SHARED 74 IRQ_TYPE_LEVEL_HIGH>;
+
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pinctrl 0 48 16>;
+
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               gpio4: gpio4 {
+                       interrupts = <GIC_SHARED 75 IRQ_TYPE_LEVEL_HIGH>;
+
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pinctrl 0 64 16>;
+
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               gpio5: gpio5 {
+                       interrupts = <GIC_SHARED 76 IRQ_TYPE_LEVEL_HIGH>;
+
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pinctrl 0 80 10>;
+
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               i2c0_pins: i2c0-pins {
+                       pin_i2c0: i2c0 {
+                               pins = "mfio28", "mfio29";
+                               function = "i2c0";
+                               drive-strength = <4>;
+                       };
+               };
+
+               i2c1_pins: i2c1-pins {
+                       pin_i2c1: i2c1 {
+                               pins = "mfio30", "mfio31";
+                               function = "i2c1";
+                               drive-strength = <4>;
+                       };
+               };
+
+               i2c2_pins: i2c2-pins {
+                       pin_i2c2: i2c2 {
+                               pins = "mfio32", "mfio33";
+                               function = "i2c2";
+                               drive-strength = <4>;
+                       };
+               };
+
+               i2c3_pins: i2c3-pins {
+                       pin_i2c3: i2c3 {
+                               pins = "mfio34", "mfio35";
+                               function = "i2c3";
+                               drive-strength = <4>;
+                       };
+               };
+
+               spim0_pins: spim0-pins {
+                       pin_spim0: spim0 {
+                               pins = "mfio9", "mfio10";
+                               function = "spim0";
+                               drive-strength = <4>;
+                       };
+                       spim0_clk: spim0-clk {
+                               pins = "mfio8";
+                               function = "spim0";
+                               drive-strength = <4>;
+                       };
+               };
+
+               spim0_cs0_alt_pin: spim0-cs0-alt-pin {
+                       spim0-cs0 {
+                               pins = "mfio2";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim0_cs1_pin: spim0-cs1-pin {
+                       spim0-cs1 {
+                               pins = "mfio1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim0_cs2_pin: spim0-cs2-pin {
+                       spim0-cs2 {
+                               pins = "mfio55";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim0_cs2_alt_pin: spim0-cs2-alt-pin {
+                       spim0-cs2 {
+                               pins = "mfio28";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim0_cs3_pin: spim0-cs3-pin {
+                       spim0-cs3 {
+                               pins = "mfio56";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim0_cs3_alt_pin: spim0-cs3-alt-pin {
+                       spim0-cs3 {
+                               pins = "mfio29";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim0_cs4_pin: spim0-cs4-pin {
+                       spim0-cs4 {
+                               pins = "mfio57";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim0_cs4_alt_pin: spim0-cs4-alt-pin {
+                       spim0-cs4 {
+                               pins = "mfio30";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_pins: spim1-pins {
+                       spim1 {
+                               pins = "mfio3", "mfio4", "mfio5";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_quad_pins: spim1-quad-pins {
+                       spim1-quad {
+                               pins = "mfio6", "mfio7";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_cs0_pin: spim1-cs0-pins {
+                       spim1-cs0 {
+                               pins = "mfio0";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_cs1_pin: spim1-cs1-pin {
+                       spim1-cs1 {
+                               pins = "mfio1";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_cs1_alt_pin: spim1-cs1-alt-pin {
+                       spim1-cs1 {
+                               pins = "mfio58";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_cs2_pin: spim1-cs2-pin {
+                       spim1-cs2 {
+                               pins = "mfio2";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_cs2_alt0_pin: spim1-cs2-alt0-pin {
+                       spim1-cs2 {
+                               pins = "mfio31";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_cs2_alt1_pin: spim1-cs2-alt1-pin {
+                       spim1-cs2 {
+                               pins = "mfio55";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_cs3_pin: spim1-cs3-pin {
+                       spim1-cs3 {
+                               pins = "mfio56";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               spim1_cs4_pin: spim1-cs4-pin {
+                       spim1-cs4 {
+                               pins = "mfio57";
+                               function = "spim1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               uart0_pins: uart0-pins {
+                       uart0 {
+                               pins = "mfio55", "mfio56";
+                               function = "uart0";
+                               drive-strength = <2>;
+                       };
+               };
+
+               uart0_rts_cts_pins: uart0-rts-cts-pins {
+                       uart0-rts-cts {
+                               pins = "mfio57", "mfio58";
+                               function = "uart0";
+                               drive-strength = <2>;
+                       };
+               };
+
+               uart1_pins: uart1-pins {
+                       uart1 {
+                               pins = "mfio59", "mfio60";
+                               function = "uart1";
+                               drive-strength = <2>;
+                       };
+               };
+
+               uart1_rts_cts_pins: uart1-rts-cts-pins {
+                       uart1-rts-cts {
+                                 pins = "mfio1", "mfio2";
+                                 function = "uart1";
+                                 drive-strength = <2>;
+                       };
+               };
+
+               enet_pins: enet-pins {
+                       pin_enet: enet {
+                               pins = "mfio63", "mfio64", "mfio65", "mfio66",
+                                      "mfio67", "mfio68", "mfio69", "mfio70";
+                               function = "eth";
+                               slew-rate = <1>;
+                               drive-strength = <4>;
+                       };
+                       pin_enet_phy_clk: enet-phy-clk {
+                               pins = "mfio71";
+                               function = "eth";
+                               slew-rate = <1>;
+                               drive-strength = <8>;
+                       };
+               };
+
+               sdhost_pins: sdhost-pins {
+                       pin_sdhost_clk: sdhost-clk {
+                               pins = "mfio15";
+                               function = "sdhost";
+                               slew-rate = <1>;
+                               drive-strength = <4>;
+                       };
+                       pin_sdhost_cmd: sdhost-cmd {
+                               pins = "mfio16";
+                               function = "sdhost";
+                               slew-rate = <1>;
+                               drive-strength = <4>;
+                       };
+                       pin_sdhost_data: sdhost-data {
+                               pins = "mfio17", "mfio18", "mfio19", "mfio20",
+                                      "mfio21", "mfio22", "mfio23", "mfio24";
+                               function = "sdhost";
+                               slew-rate = <1>;
+                               drive-strength = <4>;
+                       };
+                       pin_sdhost_power_select: sdhost-power-select {
+                               pins = "mfio25";
+                               function = "sdhost";
+                               slew-rate = <1>;
+                               drive-strength = <2>;
+                       };
+                       pin_sdhost_card_detect: sdhost-card-detect {
+                               pins = "mfio26";
+                               function = "sdhost";
+                               drive-strength = <2>;
+                       };
+                       pin_sdhost_write_protect: sdhost-write-protect {
+                               pins = "mfio27";
+                               function = "sdhost";
+                               drive-strength = <2>;
+                       };
+               };
+
+               ir_pin: ir-pin {
+                       ir-data {
+                               pins = "mfio72";
+                               function = "ir";
+                               drive-strength = <2>;
+                       };
+               };
+
+               pwmpdm0_pin: pwmpdm0-pin {
+                       pwmpdm0 {
+                               pins = "mfio73";
+                               function = "pwmpdm";
+                               drive-strength = <2>;
+                       };
+               };
+
+               pwmpdm1_pin: pwmpdm1-pin {
+                       pwmpdm1 {
+                               pins = "mfio74";
+                               function = "pwmpdm";
+                               drive-strength = <2>;
+                       };
+               };
+
+               pwmpdm2_pin: pwmpdm2-pin {
+                       pwmpdm2 {
+                               pins = "mfio75";
+                               function = "pwmpdm";
+                               drive-strength = <2>;
+                       };
+               };
+
+               pwmpdm3_pin: pwmpdm3-pin {
+                       pwmpdm3 {
+                               pins = "mfio76";
+                               function = "pwmpdm";
+                               drive-strength = <2>;
+                       };
+               };
+
+               dac_clk_pin: dac-clk-pin {
+                       pin_dac_clk: dac-clk {
+                               pins = "mfio45";
+                               function = "i2s_dac_clk";
+                               drive-strength = <4>;
+                       };
+               };
+
+               i2s_mclk_pin: i2s-mclk-pin {
+                       pin_i2s_mclk: i2s-mclk {
+                               pins = "mfio36";
+                               function = "i2s_out";
+                               drive-strength = <4>;
+                       };
+               };
+
+               spdif_out_pin: spdif-out-pin {
+                       spdif-out {
+                               pins = "mfio61";
+                               function = "spdif_out";
+                               slew-rate = <1>;
+                               drive-strength = <2>;
+                       };
+               };
+
+               spdif_in_pin: spdif-in-pin {
+                       spdif-in {
+                               pins = "mfio62";
+                               function = "spdif_in";
+                               drive-strength = <2>;
+                       };
+               };
+
+               i2s_out_pins: i2s-out-pins {
+                       pins_i2s_out_clk: i2s-out-clk {
+                               pins = "mfio37", "mfio38";
+                               function = "i2s_out";
+                               drive-strength = <4>;
+                       };
+                       pins_i2s_out: i2s-out {
+                               pins = "mfio39", "mfio40",
+                                      "mfio41", "mfio42",
+                                      "mfio43", "mfio44";
+                               function = "i2s_out";
+                               drive-strength = <2>;
+                       };
+               };
+
+               i2s_in_pins: i2s-in-pins {
+                       i2s-in {
+                               pins = "mfio47", "mfio48", "mfio49",
+                                      "mfio50", "mfio51", "mfio52",
+                                      "mfio53", "mfio54";
+                               function = "i2s_in";
+                               drive-strength = <2>;
+                       };
+               };
+       };
+
+       timer: timer@18102000 {
+               compatible = "img,pistachio-gptimer";
+               reg = <0x18102000 0x100>;
+               interrupts = <GIC_SHARED 60 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_periph PERIPH_CLK_COUNTER_FAST>,
+                        <&cr_periph SYS_CLK_TIMER>;
+               clock-names = "fast", "sys";
+               img,cr-periph = <&cr_periph>;
+       };
+
+       wdt: watchdog@18102100 {
+               compatible = "img,pdc-wdt";
+               reg = <0x18102100 0x100>;
+               interrupts = <GIC_SHARED 52 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_periph PERIPH_CLK_WD>, <&cr_periph SYS_CLK_WD>;
+               clock-names = "wdt", "sys";
+               assigned-clocks = <&clk_periph PERIPH_CLK_WD_PRE_DIV>,
+                                 <&clk_periph PERIPH_CLK_WD_DIV>;
+               assigned-clock-rates = <4000000>, <32768>;
+       };
+
+       ir: ir@18102200 {
+               compatible = "img,ir-rev1";
+               reg = <0x18102200 0x100>;
+               interrupts = <GIC_SHARED 51 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_periph PERIPH_CLK_IR>, <&cr_periph SYS_CLK_IR>;
+               clock-names = "core", "sys";
+               assigned-clocks = <&clk_periph PERIPH_CLK_IR_PRE_DIV>,
+                                 <&clk_periph PERIPH_CLK_IR_DIV>;
+               assigned-clock-rates = <4000000>, <32768>;
+               pinctrl-0 = <&ir_pin>;
+               pinctrl-names = "default";
+               status = "disabled";
+       };
+
+       usb: usb@18120000 {
+               compatible = "snps,dwc2";
+               reg = <0x18120000 0x1c000>;
+               interrupts = <GIC_SHARED 49 IRQ_TYPE_LEVEL_HIGH>;
+               phys = <&usb_phy>;
+               phy-names = "usb2-phy";
+               g-tx-fifo-size = <256 256 256 256>;
+               status = "disabled";
+       };
+
+       enet: ethernet@18140000 {
+               compatible = "snps,dwmac";
+               reg = <0x18140000 0x2000>;
+               interrupts = <GIC_SHARED 50 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "macirq";
+               clocks = <&clk_core CLK_ENET>, <&cr_periph SYS_CLK_ENET>;
+               clock-names = "stmmaceth", "pclk";
+               assigned-clocks = <&clk_core CLK_ENET_MUX>,
+                                 <&clk_core CLK_ENET_DIV>;
+               assigned-clock-parents = <&clk_core CLK_SYS_INTERNAL_DIV>;
+               assigned-clock-rates = <0>, <50000000>;
+               pinctrl-0 = <&enet_pins>;
+               pinctrl-names = "default";
+               phy-mode = "rmii";
+               status = "disabled";
+       };
+
+       sdhost: mmc@18142000 {
+               compatible = "img,pistachio-dw-mshc";
+               reg = <0x18142000 0x400>;
+               interrupts = <GIC_SHARED 39 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&clk_core CLK_SD_HOST>, <&cr_periph SYS_CLK_SD_HOST>;
+               clock-names = "ciu", "biu";
+               pinctrl-0 = <&sdhost_pins>;
+               pinctrl-names = "default";
+               fifo-depth = <0x20>;
+               num-slots = <1>;
+               clock-frequency = <50000000>;
+               bus-width = <8>;
+               cap-mmc-highspeed;
+               cap-sd-highspeed;
+               status = "disabled";
+       };
+
+       sram: sram@1b000000 {
+               compatible = "mmio-sram";
+               reg = <0x1b000000 0x10000>;
+       };
+
+       mdc: dma-controller@18143000 {
+               compatible = "img,pistachio-mdc-dma";
+               reg = <0x18143000 0x1000>;
+               interrupts = <GIC_SHARED 27 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 28 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 29 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 30 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 31 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 32 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 33 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 34 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 35 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 36 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 37 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SHARED 38 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cr_periph SYS_CLK_MDC>;
+               clock-names = "sys";
+
+               img,max-burst-multiplier = <16>;
+               img,cr-periph = <&cr_periph>;
+
+               #dma-cells = <3>;
+       };
+
+       clk_core: clk@18144000 {
+               compatible = "img,pistachio-clk", "syscon";
+               clocks = <&xtal>, <&cr_top EXT_CLK_AUDIO_IN>,
+                        <&cr_top EXT_CLK_ENET_IN>;
+               clock-names = "xtal", "audio_refclk_ext_gate",
+                             "ext_enet_in_gate";
+               reg = <0x18144000 0x800>;
+               #clock-cells = <1>;
+       };
+
+       clk_periph: clk@18144800 {
+               compatible = "img,pistachio-clk-periph";
+               reg = <0x18144800 0x1000>;
+               clocks = <&clk_core CLK_PERIPH_SYS>;
+               clock-names = "periph_sys_core";
+               #clock-cells = <1>;
+       };
+
+       cr_periph: clk@18148000 {
+               compatible = "img,pistachio-cr-periph", "syscon", "simple-bus";
+               reg = <0x18148000 0x1000>;
+               clocks = <&clk_periph PERIPH_CLK_SYS>;
+               clock-names = "sys";
+               #clock-cells = <1>;
+
+               pistachio_reset: reset-controller {
+                       compatible = "img,pistachio-reset";
+                       #reset-cells = <1>;
+               };
+       };
+
+       cr_top: clk@18149000 {
+               compatible = "img,pistachio-cr-top", "syscon";
+               reg = <0x18149000 0x200>;
+               #clock-cells = <1>;
+       };
+
+       hash: hash@18149600 {
+               compatible = "img,hash-accelerator";
+               reg = <0x18149600 0x100>, <0x18101100 0x4>;
+               interrupts = <GIC_SHARED 59 IRQ_TYPE_LEVEL_HIGH>;
+               dmas = <&mdc 8 0xffffffff 0>;
+               dma-names = "tx";
+               clocks = <&cr_periph SYS_CLK_HASH>,
+                        <&clk_periph PERIPH_CLK_ROM>;
+               clock-names = "sys", "hash";
+       };
+
+       gic: interrupt-controller@1bdc0000 {
+               compatible = "mti,gic";
+               reg = <0x1bdc0000 0x20000>;
+
+               interrupt-controller;
+               #interrupt-cells = <3>;
+
+               timer {
+                       compatible = "mti,gic-timer";
+                       interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
+                       clocks = <&clk_core CLK_MIPS>;
+               };
+       };
+
+       usb_phy: usb-phy {
+               compatible = "img,pistachio-usb-phy";
+               clocks = <&clk_core CLK_USB_PHY>;
+               clock-names = "usb_phy";
+               assigned-clocks = <&clk_core CLK_USB_PHY_DIV>;
+               assigned-clock-rates = <50000000>;
+               img,refclk = <0x2>;
+               img,cr-top = <&cr_top>;
+               #phy-cells = <0>;
+       };
+
+       xtal: xtal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <52000000>;
+               clock-output-names = "xtal";
+       };
+};
diff --git a/arch/mips/boot/dts/img/pistachio_marduk.dts b/arch/mips/boot/dts/img/pistachio_marduk.dts
new file mode 100644 (file)
index 0000000..cf9cebd
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2015, 2016 Imagination Technologies Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * IMG Marduk board is also known as Creator Ci40.
+ */
+
+/dts-v1/;
+
+#include "pistachio.dtsi"
+
+/ {
+       model = "IMG Marduk (Creator Ci40)";
+       compatible = "img,pistachio-marduk", "img,pistachio";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+               ethernet0 = &enet;
+               spi0 = &spfi0;
+               spi1 = &spfi1;
+       };
+
+       chosen {
+               bootargs = "root=/dev/sda1 rootwait ro lpj=723968";
+               stdout-path = "serial1:115200";
+       };
+
+       memory {
+               device_type = "memory";
+               reg =  <0x00000000 0x10000000>;
+       };
+
+       reg_1v8: fixed-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "aux_adc_vref";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-boot-on;
+       };
+
+       internal_dac_supply: internal-dac-supply {
+               compatible = "regulator-fixed";
+               regulator-name = "internal_dac_supply";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
+       leds {
+               compatible = "pwm-leds";
+               heartbeat {
+                       label = "marduk:red:heartbeat";
+                       pwms = <&pwm 3 300000>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       keys {
+               compatible = "gpio-keys";
+               button@1 {
+                       label = "Button 1";
+                       linux,code = <0x101>; /* BTN_1 */
+                       gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
+               };
+               button@2 {
+                       label = "Button 2";
+                       linux,code = <0x102>; /* BTN_2 */
+                       gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&internal_dac {
+       VDD-supply = <&internal_dac_supply>;
+};
+
+&spfi1 {
+       status = "okay";
+
+       pinctrl-0 = <&spim1_pins>, <&spim1_quad_pins>, <&spim1_cs0_pin>,
+                   <&spim1_cs1_pin>;
+       pinctrl-names = "default";
+       cs-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>;
+
+       flash@0 {
+               compatible = "spansion,s25fl016k", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <50000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+       assigned-clock-rates = <114278400>, <1843200>;
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb {
+       status = "okay";
+};
+
+&enet {
+       status = "okay";
+};
+
+&pin_enet {
+       drive-strength = <2>;
+};
+
+&pin_enet_phy_clk {
+       drive-strength = <2>;
+};
+
+&sdhost {
+       status = "okay";
+       bus-width = <4>;
+       disable-wp;
+};
+
+&pin_sdhost_cmd {
+       drive-strength = <2>;
+};
+
+&pin_sdhost_data {
+       drive-strength = <2>;
+};
+
+&pwm {
+       status = "okay";
+
+       pinctrl-0 = <&pwmpdm0_pin>, <&pwmpdm1_pin>, <&pwmpdm2_pin>,
+                   <&pwmpdm3_pin>;
+       pinctrl-names = "default";
+};
+
+&adc {
+       status = "okay";
+       vref-supply = <&reg_1v8>;
+       adc-reserved-channels = <0x10>;
+};
+
+&i2c2 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       tpm@20 {
+               compatible = "infineon,slb9645tt";
+               reg = <0x20>;
+       };
+
+};
+
+&i2c3 {
+       status = "okay";
+       clock-frequency = <400000>;
+};
index 48d2112..09a62f2 100644 (file)
                compatible = "mti,cpu-interrupt-controller";
        };
 
+       axi_intc: interrupt-controller@10200000 {
+               #interrupt-cells = <1>;
+               compatible = "xlnx,xps-intc-1.00.a";
+               interrupt-controller;
+               reg = <0x10200000 0x10000>;
+               xlnx,kind-of-intr = <0x0>;
+               xlnx,num-intr-inputs = <0x6>;
+
+               interrupt-parent = <&cpuintc>;
+               interrupts = <6>;
+       };
+
        axi_gpio: gpio@10600000 {
                #gpio-cells = <1>;
                compatible = "xlnx,xps-gpio-1.00.a";
                xlnx,tri-default = <0xffffffff>;
        } ;
 
+       axi_ethernetlite: ethernet@10e00000 {
+               compatible = "xlnx,xps-ethernetlite-3.00.a";
+               device_type = "network";
+               interrupt-parent = <&axi_intc>;
+               interrupts = <1>;
+               phy-handle = <&phy0>;
+               reg = <0x10e00000 0x10000>;
+               xlnx,duplex = <0x1>;
+               xlnx,include-global-buffers = <0x1>;
+               xlnx,include-internal-loopback = <0x0>;
+               xlnx,include-mdio = <0x1>;
+               xlnx,instance = "axi_ethernetlite_inst";
+               xlnx,rx-ping-pong = <0x1>;
+               xlnx,s-axi-id-width = <0x1>;
+               xlnx,tx-ping-pong = <0x1>;
+               xlnx,use-internal = <0x0>;
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       phy0: phy@1 {
+                               device_type = "ethernet-phy";
+                               reg = <1>;
+                       };
+               };
+       };
+
        axi_uart16550: serial@10400000 {
                compatible = "ns16550a";
                reg = <0x10400000 0x10000>;
                reg-offset = <0x1000>;
 
                clocks  = <&ext>;
+
+               interrupt-parent = <&axi_intc>;
+               interrupts = <0>;
        };
+
+       axi_i2c: i2c@10A00000 {
+           compatible = "xlnx,xps-iic-2.00.a";
+           interrupt-parent = <&axi_intc>;
+           interrupts = <4>;
+           reg = < 0x10A00000 0x10000 >;
+           clocks = <&ext>;
+           xlnx,clk-freq = <0x5f5e100>;
+           xlnx,family = "Artix7";
+           xlnx,gpo-width = <0x1>;
+           xlnx,iic-freq = <0x186a0>;
+           xlnx,scl-inertial-delay = <0x0>;
+           xlnx,sda-inertial-delay = <0x0>;
+           xlnx,ten-bit-adr = <0x0>;
+           #address-cells = <1>;
+           #size-cells = <0>;
+
+           ad7420@4B {
+               compatible = "adi,adt7420";
+               reg = <0x4B>;
+           };
+       } ;
 };
 
 &ext {
index 2a59265..7c02e54 100644 (file)
@@ -18,3 +18,4 @@ obj-y += crypto/
 obj-$(CONFIG_MTD)                    += flash_setup.o
 obj-$(CONFIG_SMP)                    += smp.o
 obj-$(CONFIG_OCTEON_ILM)             += oct_ilm.o
+obj-$(CONFIG_USB)                    += octeon-usb.o
index f66bd1a..4d22365 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include <asm/cop2.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/interrupt.h>
 
 #include "octeon-crypto.h"
index fd69528..1226965 100644 (file)
@@ -164,19 +164,14 @@ static void *octeon_dma_alloc_coherent(struct device *dev, size_t size,
        /* ignore region specifiers */
        gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
 
-#ifdef CONFIG_ZONE_DMA
-       if (dev == NULL)
+       if (IS_ENABLED(CONFIG_ZONE_DMA) && dev == NULL)
                gfp |= __GFP_DMA;
-       else if (dev->coherent_dma_mask <= DMA_BIT_MASK(24))
+       else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
+                dev->coherent_dma_mask <= DMA_BIT_MASK(24))
                gfp |= __GFP_DMA;
-       else
-#endif
-#ifdef CONFIG_ZONE_DMA32
-            if (dev->coherent_dma_mask <= DMA_BIT_MASK(32))
+       else if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+                dev->coherent_dma_mask <= DMA_BIT_MASK(32))
                gfp |= __GFP_DMA32;
-       else
-#endif
-               ;
 
        /* Don't invoke OOM killer */
        gfp |= __GFP_NORETRY;
index b65a6c1..8d54d77 100644 (file)
@@ -30,8 +30,8 @@
  * application start time.
  */
 
+#include <linux/export.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 
 #include <asm/octeon/cvmx.h>
 #include <asm/octeon/cvmx-spinlock.h>
index 868659e..4b26fed 100644 (file)
@@ -33,7 +33,7 @@
  * these functions directly.
  *
  */
-#include <linux/module.h>
+#include <linux/export.h>
 
 #include <asm/octeon/octeon.h>
 
index 671ab1d..ba4753c 100644 (file)
@@ -287,8 +287,7 @@ cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port)
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index 5437534..5782833 100644 (file)
@@ -500,8 +500,7 @@ cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port)
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index 1f3030c..ef16aa0 100644 (file)
@@ -188,8 +188,7 @@ cvmx_helper_link_info_t __cvmx_helper_spi_link_get(int ipd_port)
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index d347fe1..19d54e0 100644 (file)
@@ -295,8 +295,7 @@ cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port)
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index 6456af6..f24be0b 100644 (file)
@@ -69,10 +69,6 @@ void (*cvmx_override_ipd_port_setup) (int ipd_port);
 /* Port count per interface */
 static int interface_port_count[5];
 
-/* Port last configured link info index by IPD/PKO port */
-static cvmx_helper_link_info_t
-    port_link_info[CVMX_PIP_NUM_INPUT_PORTS];
-
 /**
  * Return the number of interfaces the chip has. Each interface
  * may have multiple ports. Most chips support two interfaces,
@@ -1136,41 +1132,6 @@ int cvmx_helper_initialize_packet_io_local(void)
 }
 
 /**
- * Auto configure an IPD/PKO port link state and speed. This
- * function basically does the equivalent of:
- * cvmx_helper_link_set(ipd_port, cvmx_helper_link_get(ipd_port));
- *
- * @ipd_port: IPD/PKO port to auto configure
- *
- * Returns Link state after configure
- */
-cvmx_helper_link_info_t cvmx_helper_link_autoconf(int ipd_port)
-{
-       cvmx_helper_link_info_t link_info;
-       int interface = cvmx_helper_get_interface_num(ipd_port);
-       int index = cvmx_helper_get_interface_index_num(ipd_port);
-
-       if (index >= cvmx_helper_ports_on_interface(interface)) {
-               link_info.u64 = 0;
-               return link_info;
-       }
-
-       link_info = cvmx_helper_link_get(ipd_port);
-       if (link_info.u64 == port_link_info[ipd_port].u64)
-               return link_info;
-
-       /* If we fail to set the link speed, port_link_info will not change */
-       cvmx_helper_link_set(ipd_port, link_info);
-
-       /*
-        * port_link_info should be the current value, which will be
-        * different than expect if cvmx_helper_link_set() failed.
-        */
-       return port_link_info[ipd_port];
-}
-EXPORT_SYMBOL_GPL(cvmx_helper_link_autoconf);
-
-/**
  * Return the link state of an IPD/PKO port as returned by
  * auto negotiation. The result of this function may not match
  * Octeon's link config if auto negotiation has changed since
@@ -1233,8 +1194,7 @@ EXPORT_SYMBOL_GPL(cvmx_helper_link_get);
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
@@ -1276,11 +1236,6 @@ int cvmx_helper_link_set(int ipd_port, cvmx_helper_link_info_t link_info)
        case CVMX_HELPER_INTERFACE_MODE_LOOP:
                break;
        }
-       /* Set the port_link_info here so that the link status is updated
-          no matter how cvmx_helper_link_set is called. We don't change
-          the value if link_set failed */
-       if (result == 0)
-               port_link_info[ipd_port].u64 = link_info.u64;
        return result;
 }
 EXPORT_SYMBOL_GPL(cvmx_helper_link_set);
index cc1b1d2..30ecba1 100644 (file)
@@ -29,7 +29,7 @@
  * This module provides system/board/application information obtained
  * by the bootloader.
  */
-#include <linux/module.h>
+#include <linux/export.h>
 
 #include <asm/octeon/cvmx.h>
 #include <asm/octeon/cvmx-sysinfo.h>
index 64e08df..cfd97f6 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <asm/asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/export.h>
 #include <asm/regdef.h>
 
 #define dst a0
  * t7 is used as a flag to note inatomic mode.
  */
 LEAF(__copy_user_inatomic)
+EXPORT_SYMBOL(__copy_user_inatomic)
        b       __copy_user_common
         li     t7, 1
        END(__copy_user_inatomic)
@@ -154,9 +156,11 @@ LEAF(__copy_user_inatomic)
  */
        .align  5
 LEAF(memcpy)                                   /* a0=dst a1=src a2=len */
+EXPORT_SYMBOL(memcpy)
        move    v0, dst                         /* return value */
 __memcpy:
 FEXPORT(__copy_user)
+EXPORT_SYMBOL(__copy_user)
        li      t7, 0                           /* not inatomic */
 __copy_user_common:
        /*
@@ -208,18 +212,18 @@ EXC(      STORE   t2, UNIT(6)(dst),       s_exc_p10u)
        ADD     src, src, 16*NBYTES
 EXC(   STORE   t3, UNIT(7)(dst),       s_exc_p9u)
        ADD     dst, dst, 16*NBYTES
-EXC(   LOAD    t0, UNIT(-8)(src),      l_exc_copy)
-EXC(   LOAD    t1, UNIT(-7)(src),      l_exc_copy)
-EXC(   LOAD    t2, UNIT(-6)(src),      l_exc_copy)
-EXC(   LOAD    t3, UNIT(-5)(src),      l_exc_copy)
+EXC(   LOAD    t0, UNIT(-8)(src),      l_exc_copy_rewind16)
+EXC(   LOAD    t1, UNIT(-7)(src),      l_exc_copy_rewind16)
+EXC(   LOAD    t2, UNIT(-6)(src),      l_exc_copy_rewind16)
+EXC(   LOAD    t3, UNIT(-5)(src),      l_exc_copy_rewind16)
 EXC(   STORE   t0, UNIT(-8)(dst),      s_exc_p8u)
 EXC(   STORE   t1, UNIT(-7)(dst),      s_exc_p7u)
 EXC(   STORE   t2, UNIT(-6)(dst),      s_exc_p6u)
 EXC(   STORE   t3, UNIT(-5)(dst),      s_exc_p5u)
-EXC(   LOAD    t0, UNIT(-4)(src),      l_exc_copy)
-EXC(   LOAD    t1, UNIT(-3)(src),      l_exc_copy)
-EXC(   LOAD    t2, UNIT(-2)(src),      l_exc_copy)
-EXC(   LOAD    t3, UNIT(-1)(src),      l_exc_copy)
+EXC(   LOAD    t0, UNIT(-4)(src),      l_exc_copy_rewind16)
+EXC(   LOAD    t1, UNIT(-3)(src),      l_exc_copy_rewind16)
+EXC(   LOAD    t2, UNIT(-2)(src),      l_exc_copy_rewind16)
+EXC(   LOAD    t3, UNIT(-1)(src),      l_exc_copy_rewind16)
 EXC(   STORE   t0, UNIT(-4)(dst),      s_exc_p4u)
 EXC(   STORE   t1, UNIT(-3)(dst),      s_exc_p3u)
 EXC(   STORE   t2, UNIT(-2)(dst),      s_exc_p2u)
@@ -383,6 +387,10 @@ done:
         nop
        END(memcpy)
 
+l_exc_copy_rewind16:
+       /* Rewind src and dst by 16*NBYTES for l_exc_copy */
+       SUB     src, src, 16*NBYTES
+       SUB     dst, dst, 16*NBYTES
 l_exc_copy:
        /*
         * Copy bytes from src until faulting load address (or until a
@@ -459,6 +467,7 @@ s_exc:
 
        .align  5
 LEAF(memmove)
+EXPORT_SYMBOL(memmove)
        ADD     t0, a0, a2
        ADD     t1, a1, a2
        sltu    t0, a1, t0                      # dst + len <= src -> memcpy
index 37a932d..16083cf 100644 (file)
@@ -448,6 +448,7 @@ static struct of_device_id __initdata octeon_ids[] = {
        { .compatible = "cavium,octeon-3860-bootbus", },
        { .compatible = "cavium,mdio-mux", },
        { .compatible = "gpio-leds", },
+       { .compatible = "cavium,octeon-7130-usb-uctl", },
        {},
 };
 
diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
new file mode 100644 (file)
index 0000000..542be1c
--- /dev/null
@@ -0,0 +1,552 @@
+/*
+ * XHCI HCD glue for Cavium Octeon III SOCs.
+ *
+ * Copyright (C) 2010-2017 Cavium Networks
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/mutex.h>
+#include <linux/delay.h>
+#include <linux/of_platform.h>
+
+#include <asm/octeon/octeon.h>
+#include <asm/octeon/cvmx-gpio-defs.h>
+
+/* USB Control Register */
+union cvm_usbdrd_uctl_ctl {
+       uint64_t u64;
+       struct cvm_usbdrd_uctl_ctl_s {
+       /* 1 = BIST and set all USB RAMs to 0x0, 0 = BIST */
+       __BITFIELD_FIELD(uint64_t clear_bist:1,
+       /* 1 = Start BIST and cleared by hardware */
+       __BITFIELD_FIELD(uint64_t start_bist:1,
+       /* Reference clock select for SuperSpeed and HighSpeed PLLs:
+        *      0x0 = Both PLLs use DLMC_REF_CLK0 for reference clock
+        *      0x1 = Both PLLs use DLMC_REF_CLK1 for reference clock
+        *      0x2 = SuperSpeed PLL uses DLMC_REF_CLK0 for reference clock &
+        *            HighSpeed PLL uses PLL_REF_CLK for reference clck
+        *      0x3 = SuperSpeed PLL uses DLMC_REF_CLK1 for reference clock &
+        *            HighSpeed PLL uses PLL_REF_CLK for reference clck
+        */
+       __BITFIELD_FIELD(uint64_t ref_clk_sel:2,
+       /* 1 = Spread-spectrum clock enable, 0 = SS clock disable */
+       __BITFIELD_FIELD(uint64_t ssc_en:1,
+       /* Spread-spectrum clock modulation range:
+        *      0x0 = -4980 ppm downspread
+        *      0x1 = -4492 ppm downspread
+        *      0x2 = -4003 ppm downspread
+        *      0x3 - 0x7 = Reserved
+        */
+       __BITFIELD_FIELD(uint64_t ssc_range:3,
+       /* Enable non-standard oscillator frequencies:
+        *      [55:53] = modules -1
+        *      [52:47] = 2's complement push amount, 0 = Feature disabled
+        */
+       __BITFIELD_FIELD(uint64_t ssc_ref_clk_sel:9,
+       /* Reference clock multiplier for non-standard frequencies:
+        *      0x19 = 100MHz on DLMC_REF_CLK* if REF_CLK_SEL = 0x0 or 0x1
+        *      0x28 = 125MHz on DLMC_REF_CLK* if REF_CLK_SEL = 0x0 or 0x1
+        *      0x32 =  50MHz on DLMC_REF_CLK* if REF_CLK_SEL = 0x0 or 0x1
+        *      Other Values = Reserved
+        */
+       __BITFIELD_FIELD(uint64_t mpll_multiplier:7,
+       /* Enable reference clock to prescaler for SuperSpeed functionality.
+        * Should always be set to "1"
+        */
+       __BITFIELD_FIELD(uint64_t ref_ssp_en:1,
+       /* Divide the reference clock by 2 before entering the
+        * REF_CLK_FSEL divider:
+        *      If REF_CLK_SEL = 0x0 or 0x1, then only 0x0 is legal
+        *      If REF_CLK_SEL = 0x2 or 0x3, then:
+        *              0x1 = DLMC_REF_CLK* is 125MHz
+        *              0x0 = DLMC_REF_CLK* is another supported frequency
+        */
+       __BITFIELD_FIELD(uint64_t ref_clk_div2:1,
+       /* Select reference clock freqnuency for both PLL blocks:
+        *      0x27 = REF_CLK_SEL is 0x0 or 0x1
+        *      0x07 = REF_CLK_SEL is 0x2 or 0x3
+        */
+       __BITFIELD_FIELD(uint64_t ref_clk_fsel:6,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_31_31:1,
+       /* Controller clock enable. */
+       __BITFIELD_FIELD(uint64_t h_clk_en:1,
+       /* Select bypass input to controller clock divider:
+        *      0x0 = Use divided coprocessor clock from H_CLKDIV
+        *      0x1 = Use clock from GPIO pins
+        */
+       __BITFIELD_FIELD(uint64_t h_clk_byp_sel:1,
+       /* Reset controller clock divider. */
+       __BITFIELD_FIELD(uint64_t h_clkdiv_rst:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_27_27:1,
+       /* Clock divider select:
+        *      0x0 = divide by 1
+        *      0x1 = divide by 2
+        *      0x2 = divide by 4
+        *      0x3 = divide by 6
+        *      0x4 = divide by 8
+        *      0x5 = divide by 16
+        *      0x6 = divide by 24
+        *      0x7 = divide by 32
+        */
+       __BITFIELD_FIELD(uint64_t h_clkdiv_sel:3,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_22_23:2,
+       /* USB3 port permanently attached: 0x0 = No, 0x1 = Yes */
+       __BITFIELD_FIELD(uint64_t usb3_port_perm_attach:1,
+       /* USB2 port permanently attached: 0x0 = No, 0x1 = Yes */
+       __BITFIELD_FIELD(uint64_t usb2_port_perm_attach:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_19_19:1,
+       /* Disable SuperSpeed PHY: 0x0 = No, 0x1 = Yes */
+       __BITFIELD_FIELD(uint64_t usb3_port_disable:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_17_17:1,
+       /* Disable HighSpeed PHY: 0x0 = No, 0x1 = Yes */
+       __BITFIELD_FIELD(uint64_t usb2_port_disable:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_15_15:1,
+       /* Enable PHY SuperSpeed block power: 0x0 = No, 0x1 = Yes */
+       __BITFIELD_FIELD(uint64_t ss_power_en:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_13_13:1,
+       /* Enable PHY HighSpeed block power: 0x0 = No, 0x1 = Yes */
+       __BITFIELD_FIELD(uint64_t hs_power_en:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_5_11:7,
+       /* Enable USB UCTL interface clock: 0xx = No, 0x1 = Yes */
+       __BITFIELD_FIELD(uint64_t csclk_en:1,
+       /* Controller mode: 0x0 = Host, 0x1 = Device */
+       __BITFIELD_FIELD(uint64_t drd_mode:1,
+       /* PHY reset */
+       __BITFIELD_FIELD(uint64_t uphy_rst:1,
+       /* Software reset UAHC */
+       __BITFIELD_FIELD(uint64_t uahc_rst:1,
+       /* Software resets UCTL */
+       __BITFIELD_FIELD(uint64_t uctl_rst:1,
+       ;)))))))))))))))))))))))))))))))))
+       } s;
+};
+
+/* UAHC Configuration Register */
+union cvm_usbdrd_uctl_host_cfg {
+       uint64_t u64;
+       struct cvm_usbdrd_uctl_host_cfg_s {
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_60_63:4,
+       /* Indicates minimum value of all received BELT values */
+       __BITFIELD_FIELD(uint64_t host_current_belt:12,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_38_47:10,
+       /* HS jitter adjustment */
+       __BITFIELD_FIELD(uint64_t fla:6,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_29_31:3,
+       /* Bus-master enable: 0x0 = Disabled (stall DMAs), 0x1 = enabled */
+       __BITFIELD_FIELD(uint64_t bme:1,
+       /* Overcurrent protection enable: 0x0 = unavailable, 0x1 = available */
+       __BITFIELD_FIELD(uint64_t oci_en:1,
+       /* Overcurrent sene selection:
+        *      0x0 = Overcurrent indication from off-chip is active-low
+        *      0x1 = Overcurrent indication from off-chip is active-high
+        */
+       __BITFIELD_FIELD(uint64_t oci_active_high_en:1,
+       /* Port power control enable: 0x0 = unavailable, 0x1 = available */
+       __BITFIELD_FIELD(uint64_t ppc_en:1,
+       /* Port power control sense selection:
+        *      0x0 = Port power to off-chip is active-low
+        *      0x1 = Port power to off-chip is active-high
+        */
+       __BITFIELD_FIELD(uint64_t ppc_active_high_en:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_0_23:24,
+       ;)))))))))))
+       } s;
+};
+
+/* UCTL Shim Features Register */
+union cvm_usbdrd_uctl_shim_cfg {
+       uint64_t u64;
+       struct cvm_usbdrd_uctl_shim_cfg_s {
+       /* Out-of-bound UAHC register access: 0 = read, 1 = write */
+       __BITFIELD_FIELD(uint64_t xs_ncb_oob_wrn:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_60_62:3,
+       /* SRCID error log for out-of-bound UAHC register access:
+        *      [59:58] = chipID
+        *      [57] = Request source: 0 = core, 1 = NCB-device
+        *      [56:51] = Core/NCB-device number, [56] always 0 for NCB devices
+        *      [50:48] = SubID
+        */
+       __BITFIELD_FIELD(uint64_t xs_ncb_oob_osrc:12,
+       /* Error log for bad UAHC DMA access: 0 = Read log, 1 = Write log */
+       __BITFIELD_FIELD(uint64_t xm_bad_dma_wrn:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_44_46:3,
+       /* Encoded error type for bad UAHC DMA */
+       __BITFIELD_FIELD(uint64_t xm_bad_dma_type:4,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_13_39:27,
+       /* Select the IOI read command used by DMA accesses */
+       __BITFIELD_FIELD(uint64_t dma_read_cmd:1,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_10_11:2,
+       /* Select endian format for DMA accesses to the L2c:
+        *      0x0 = Little endian
+        *`     0x1 = Big endian
+        *      0x2 = Reserved
+        *      0x3 = Reserved
+        */
+       __BITFIELD_FIELD(uint64_t dma_endian_mode:2,
+       /* Reserved */
+       __BITFIELD_FIELD(uint64_t reserved_2_7:6,
+       /* Select endian format for IOI CSR access to UAHC:
+        *      0x0 = Little endian
+        *`     0x1 = Big endian
+        *      0x2 = Reserved
+        *      0x3 = Reserved
+        */
+       __BITFIELD_FIELD(uint64_t csr_endian_mode:2,
+       ;))))))))))))
+       } s;
+};
+
+#define OCTEON_H_CLKDIV_SEL            8
+#define OCTEON_MIN_H_CLK_RATE          150000000
+#define OCTEON_MAX_H_CLK_RATE          300000000
+
+static DEFINE_MUTEX(dwc3_octeon_clocks_mutex);
+static uint8_t clk_div[OCTEON_H_CLKDIV_SEL] = {1, 2, 4, 6, 8, 16, 24, 32};
+
+
+static int dwc3_octeon_config_power(struct device *dev, u64 base)
+{
+#define UCTL_HOST_CFG  0xe0
+       union cvm_usbdrd_uctl_host_cfg uctl_host_cfg;
+       union cvmx_gpio_bit_cfgx gpio_bit;
+       uint32_t gpio_pwr[3];
+       int gpio, len, power_active_low;
+       struct device_node *node = dev->of_node;
+       int index = (base >> 24) & 1;
+
+       if (of_find_property(node, "power", &len) != NULL) {
+               if (len == 12) {
+                       of_property_read_u32_array(node, "power", gpio_pwr, 3);
+                       power_active_low = gpio_pwr[2] & 0x01;
+                       gpio = gpio_pwr[1];
+               } else if (len == 8) {
+                       of_property_read_u32_array(node, "power", gpio_pwr, 2);
+                       power_active_low = 0;
+                       gpio = gpio_pwr[1];
+               } else {
+                       dev_err(dev, "dwc3 controller clock init failure.\n");
+                       return -EINVAL;
+               }
+               if ((OCTEON_IS_MODEL(OCTEON_CN73XX) ||
+                   OCTEON_IS_MODEL(OCTEON_CNF75XX))
+                   && gpio <= 31) {
+                       gpio_bit.u64 = cvmx_read_csr(CVMX_GPIO_BIT_CFGX(gpio));
+                       gpio_bit.s.tx_oe = 1;
+                       gpio_bit.cn73xx.output_sel = (index == 0 ? 0x14 : 0x15);
+                       cvmx_write_csr(CVMX_GPIO_BIT_CFGX(gpio), gpio_bit.u64);
+               } else if (gpio <= 15) {
+                       gpio_bit.u64 = cvmx_read_csr(CVMX_GPIO_BIT_CFGX(gpio));
+                       gpio_bit.s.tx_oe = 1;
+                       gpio_bit.cn70xx.output_sel = (index == 0 ? 0x14 : 0x19);
+                       cvmx_write_csr(CVMX_GPIO_BIT_CFGX(gpio), gpio_bit.u64);
+               } else {
+                       gpio_bit.u64 = cvmx_read_csr(CVMX_GPIO_XBIT_CFGX(gpio));
+                       gpio_bit.s.tx_oe = 1;
+                       gpio_bit.cn70xx.output_sel = (index == 0 ? 0x14 : 0x19);
+                       cvmx_write_csr(CVMX_GPIO_XBIT_CFGX(gpio), gpio_bit.u64);
+               }
+
+               /* Enable XHCI power control and set if active high or low. */
+               uctl_host_cfg.u64 = cvmx_read_csr(base + UCTL_HOST_CFG);
+               uctl_host_cfg.s.ppc_en = 1;
+               uctl_host_cfg.s.ppc_active_high_en = !power_active_low;
+               cvmx_write_csr(base + UCTL_HOST_CFG, uctl_host_cfg.u64);
+       } else {
+               /* Disable XHCI power control and set if active high. */
+               uctl_host_cfg.u64 = cvmx_read_csr(base + UCTL_HOST_CFG);
+               uctl_host_cfg.s.ppc_en = 0;
+               uctl_host_cfg.s.ppc_active_high_en = 0;
+               cvmx_write_csr(base + UCTL_HOST_CFG, uctl_host_cfg.u64);
+               dev_warn(dev, "dwc3 controller clock init failure.\n");
+       }
+       return 0;
+}
+
+static int dwc3_octeon_clocks_start(struct device *dev, u64 base)
+{
+       union cvm_usbdrd_uctl_ctl uctl_ctl;
+       int ref_clk_sel = 2;
+       u64 div;
+       u32 clock_rate;
+       int mpll_mul;
+       int i;
+       u64 h_clk_rate;
+       u64 uctl_ctl_reg = base;
+
+       if (dev->of_node) {
+               const char *ss_clock_type;
+               const char *hs_clock_type;
+
+               i = of_property_read_u32(dev->of_node,
+                                        "refclk-frequency", &clock_rate);
+               if (i) {
+                       pr_err("No UCTL \"refclk-frequency\"\n");
+                       return -EINVAL;
+               }
+               i = of_property_read_string(dev->of_node,
+                                           "refclk-type-ss", &ss_clock_type);
+               if (i) {
+                       pr_err("No UCTL \"refclk-type-ss\"\n");
+                       return -EINVAL;
+               }
+               i = of_property_read_string(dev->of_node,
+                                           "refclk-type-hs", &hs_clock_type);
+               if (i) {
+                       pr_err("No UCTL \"refclk-type-hs\"\n");
+                       return -EINVAL;
+               }
+               if (strcmp("dlmc_ref_clk0", ss_clock_type) == 0) {
+                       if (strcmp(hs_clock_type, "dlmc_ref_clk0") == 0)
+                               ref_clk_sel = 0;
+                       else if (strcmp(hs_clock_type, "pll_ref_clk") == 0)
+                               ref_clk_sel = 2;
+                       else
+                               pr_err("Invalid HS clock type %s, using  pll_ref_clk instead\n",
+                                      hs_clock_type);
+               } else if (strcmp(ss_clock_type, "dlmc_ref_clk1") == 0) {
+                       if (strcmp(hs_clock_type, "dlmc_ref_clk1") == 0)
+                               ref_clk_sel = 1;
+                       else if (strcmp(hs_clock_type, "pll_ref_clk") == 0)
+                               ref_clk_sel = 3;
+                       else {
+                               pr_err("Invalid HS clock type %s, using  pll_ref_clk instead\n",
+                                      hs_clock_type);
+                               ref_clk_sel = 3;
+                       }
+               } else
+                       pr_err("Invalid SS clock type %s, using  dlmc_ref_clk0 instead\n",
+                              ss_clock_type);
+
+               if ((ref_clk_sel == 0 || ref_clk_sel == 1) &&
+                                 (clock_rate != 100000000))
+                       pr_err("Invalid UCTL clock rate of %u, using 100000000 instead\n",
+                              clock_rate);
+
+       } else {
+               pr_err("No USB UCTL device node\n");
+               return -EINVAL;
+       }
+
+       /*
+        * Step 1: Wait for all voltages to be stable...that surely
+        *         happened before starting the kernel. SKIP
+        */
+
+       /* Step 2: Select GPIO for overcurrent indication, if desired. SKIP */
+
+       /* Step 3: Assert all resets. */
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.uphy_rst = 1;
+       uctl_ctl.s.uahc_rst = 1;
+       uctl_ctl.s.uctl_rst = 1;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+
+       /* Step 4a: Reset the clock dividers. */
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.h_clkdiv_rst = 1;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+
+       /* Step 4b: Select controller clock frequency. */
+       for (div = 0; div < OCTEON_H_CLKDIV_SEL; div++) {
+               h_clk_rate = octeon_get_io_clock_rate() / clk_div[div];
+               if (h_clk_rate <= OCTEON_MAX_H_CLK_RATE &&
+                                h_clk_rate >= OCTEON_MIN_H_CLK_RATE)
+                       break;
+       }
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.h_clkdiv_sel = div;
+       uctl_ctl.s.h_clk_en = 1;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       if ((div != uctl_ctl.s.h_clkdiv_sel) || (!uctl_ctl.s.h_clk_en)) {
+               dev_err(dev, "dwc3 controller clock init failure.\n");
+                       return -EINVAL;
+       }
+
+       /* Step 4c: Deassert the controller clock divider reset. */
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.h_clkdiv_rst = 0;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+
+       /* Step 5a: Reference clock configuration. */
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.ref_clk_sel = ref_clk_sel;
+       uctl_ctl.s.ref_clk_fsel = 0x07;
+       uctl_ctl.s.ref_clk_div2 = 0;
+       switch (clock_rate) {
+       default:
+               dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n",
+                       clock_rate);
+       case 100000000:
+               mpll_mul = 0x19;
+               if (ref_clk_sel < 2)
+                       uctl_ctl.s.ref_clk_fsel = 0x27;
+               break;
+       case 50000000:
+               mpll_mul = 0x32;
+               break;
+       case 125000000:
+               mpll_mul = 0x28;
+               break;
+       }
+       uctl_ctl.s.mpll_multiplier = mpll_mul;
+
+       /* Step 5b: Configure and enable spread-spectrum for SuperSpeed. */
+       uctl_ctl.s.ssc_en = 1;
+
+       /* Step 5c: Enable SuperSpeed. */
+       uctl_ctl.s.ref_ssp_en = 1;
+
+       /* Step 5d: Cofngiure PHYs. SKIP */
+
+       /* Step 6a & 6b: Power up PHYs. */
+       uctl_ctl.s.hs_power_en = 1;
+       uctl_ctl.s.ss_power_en = 1;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+
+       /* Step 7: Wait 10 controller-clock cycles to take effect. */
+       udelay(10);
+
+       /* Step 8a: Deassert UCTL reset signal. */
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.uctl_rst = 0;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+
+       /* Step 8b: Wait 10 controller-clock cycles. */
+       udelay(10);
+
+       /* Steo 8c: Setup power-power control. */
+       if (dwc3_octeon_config_power(dev, base)) {
+               dev_err(dev, "Error configuring power.\n");
+               return -EINVAL;
+       }
+
+       /* Step 8d: Deassert UAHC reset signal. */
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.uahc_rst = 0;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+
+       /* Step 8e: Wait 10 controller-clock cycles. */
+       udelay(10);
+
+       /* Step 9: Enable conditional coprocessor clock of UCTL. */
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.csclk_en = 1;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+
+       /*Step 10: Set for host mode only. */
+       uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg);
+       uctl_ctl.s.drd_mode = 0;
+       cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64);
+
+       return 0;
+}
+
+static void __init dwc3_octeon_set_endian_mode(u64 base)
+{
+#define UCTL_SHIM_CFG  0xe8
+       union cvm_usbdrd_uctl_shim_cfg shim_cfg;
+
+       shim_cfg.u64 = cvmx_read_csr(base + UCTL_SHIM_CFG);
+#ifdef __BIG_ENDIAN
+       shim_cfg.s.dma_endian_mode = 1;
+       shim_cfg.s.csr_endian_mode = 1;
+#else
+       shim_cfg.s.dma_endian_mode = 0;
+       shim_cfg.s.csr_endian_mode = 0;
+#endif
+       cvmx_write_csr(base + UCTL_SHIM_CFG, shim_cfg.u64);
+}
+
+#define CVMX_USBDRDX_UCTL_CTL(index)                           \
+               (CVMX_ADD_IO_SEG(0x0001180068000000ull) +       \
+               ((index & 1) * 0x1000000ull))
+static void __init dwc3_octeon_phy_reset(u64 base)
+{
+       union cvm_usbdrd_uctl_ctl uctl_ctl;
+       int index = (base >> 24) & 1;
+
+       uctl_ctl.u64 = cvmx_read_csr(CVMX_USBDRDX_UCTL_CTL(index));
+       uctl_ctl.s.uphy_rst = 0;
+       cvmx_write_csr(CVMX_USBDRDX_UCTL_CTL(index), uctl_ctl.u64);
+}
+
+static int __init dwc3_octeon_device_init(void)
+{
+       const char compat_node_name[] = "cavium,octeon-7130-usb-uctl";
+       struct platform_device *pdev;
+       struct device_node *node;
+       struct resource *res;
+       void __iomem *base;
+
+       /*
+        * There should only be three universal controllers, "uctl"
+        * in the device tree. Two USB and a SATA, which we ignore.
+        */
+       node = NULL;
+       do {
+               node = of_find_node_by_name(node, "uctl");
+               if (!node)
+                       return -ENODEV;
+
+               if (of_device_is_compatible(node, compat_node_name)) {
+                       pdev = of_find_device_by_node(node);
+                       if (!pdev)
+                               return -ENODEV;
+
+                       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+                       if (res == NULL) {
+                               dev_err(&pdev->dev, "No memory resources\n");
+                               return -ENXIO;
+                       }
+
+                       /*
+                        * The code below maps in the registers necessary for
+                        * setting up the clocks and reseting PHYs. We must
+                        * release the resources so the dwc3 subsystem doesn't
+                        * know the difference.
+                        */
+                       base = devm_ioremap_resource(&pdev->dev, res);
+                       if (IS_ERR(base))
+                               return PTR_ERR(base);
+
+                       mutex_lock(&dwc3_octeon_clocks_mutex);
+                       dwc3_octeon_clocks_start(&pdev->dev, (u64)base);
+                       dwc3_octeon_set_endian_mode((u64)base);
+                       dwc3_octeon_phy_reset((u64)base);
+                       dev_info(&pdev->dev, "clocks initialized.\n");
+                       mutex_unlock(&dwc3_octeon_clocks_mutex);
+                       devm_iounmap(&pdev->dev, base);
+                       devm_release_mem_region(&pdev->dev, res->start,
+                                               resource_size(res));
+               }
+       } while (node != NULL);
+
+       return 0;
+}
+device_initcall(dwc3_octeon_device_init);
+
+MODULE_AUTHOR("David Daney <david.daney@cavium.com>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("USB driver for OCTEON III SoC");
index 9a2db1c..d9dbeb0 100644 (file)
@@ -949,6 +949,29 @@ static __init void memory_exclude_page(u64 addr, u64 *mem, u64 *size)
 }
 #endif /* CONFIG_CRASH_DUMP */
 
+void __init fw_init_cmdline(void)
+{
+       int i;
+
+       octeon_boot_desc_ptr = (struct octeon_boot_descriptor *)fw_arg3;
+       for (i = 0; i < octeon_boot_desc_ptr->argc; i++) {
+               const char *arg =
+                       cvmx_phys_to_ptr(octeon_boot_desc_ptr->argv[i]);
+               if (strlen(arcs_cmdline) + strlen(arg) + 1 <
+                          sizeof(arcs_cmdline) - 1) {
+                       strcat(arcs_cmdline, " ");
+                       strcat(arcs_cmdline, arg);
+               }
+       }
+}
+
+void __init *plat_get_fdt(void)
+{
+       octeon_bootinfo =
+               cvmx_phys_to_ptr(octeon_boot_desc_ptr->cvmx_desc_vaddr);
+       return phys_to_virt(octeon_bootinfo->fdt_addr);
+}
+
 void __init plat_mem_setup(void)
 {
        uint64_t mem_alloc_size;
index 256fe6f..4355a4c 100644 (file)
@@ -11,7 +11,8 @@
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 
 #include <asm/mmu_context.h>
 #include <asm/time.h>
 volatile unsigned long octeon_processor_boot = 0xff;
 volatile unsigned long octeon_processor_sp;
 volatile unsigned long octeon_processor_gp;
+#ifdef CONFIG_RELOCATABLE
+volatile unsigned long octeon_processor_relocated_kernel_entry;
+#endif /* CONFIG_RELOCATABLE */
 
 #ifdef CONFIG_HOTPLUG_CPU
 uint64_t octeon_bootloader_entry_addr;
 EXPORT_SYMBOL(octeon_bootloader_entry_addr);
 #endif
 
+extern void kernel_entry(unsigned long arg1, ...);
+
 static void octeon_icache_flush(void)
 {
        asm volatile ("synci 0($0)\n");
@@ -180,6 +186,19 @@ static void __init octeon_smp_setup(void)
        octeon_smp_hotplug_setup();
 }
 
+
+#ifdef CONFIG_RELOCATABLE
+int plat_post_relocation(long offset)
+{
+       unsigned long entry = (unsigned long)kernel_entry;
+
+       /* Send secondaries into relocated kernel */
+       octeon_processor_relocated_kernel_entry = entry + offset;
+
+       return 0;
+}
+#endif /* CONFIG_RELOCATABLE */
+
 /**
  * Firmware CPU startup hook
  *
@@ -272,7 +291,6 @@ static int octeon_cpu_disable(void)
 
        set_cpu_online(cpu, false);
        calculate_cpu_foreign_map();
-       cpumask_clear_cpu(cpu, &cpu_callin_map);
        octeon_fixup_irqs();
 
        __flush_cache_all();
@@ -333,8 +351,6 @@ void play_dead(void)
                ;
 }
 
-extern void kernel_entry(unsigned long arg1, ...);
-
 static void start_after_reset(void)
 {
        kernel_entry(0, 0, 0);  /* set a2 = 0 for secondary core */
index d470d08..31e3c4d 100644 (file)
@@ -45,6 +45,7 @@ CONFIG_SYN_COOKIES=y
 # CONFIG_INET_LRO is not set
 CONFIG_IPV6=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
 # CONFIG_FW_LOADER is not set
 CONFIG_MTD=y
 # CONFIG_MTD_OF_PARTS is not set
index 5d83ff7..ec8e968 100644 (file)
@@ -67,8 +67,8 @@ CONFIG_NETFILTER_NETLINK_QUEUE=m
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
index 2b74aee..e582069 100644 (file)
@@ -133,7 +133,7 @@ CONFIG_LIBFC=m
 CONFIG_SCSI_QLOGIC_1280=y
 CONFIG_SCSI_PMCRAID=m
 CONFIG_SCSI_BFA_FC=m
-CONFIG_SCSI_DH=m
+CONFIG_SCSI_DH=y
 CONFIG_SCSI_DH_RDAC=m
 CONFIG_SCSI_DH_HP_SW=m
 CONFIG_SCSI_DH_EMC=m
@@ -205,7 +205,6 @@ CONFIG_MLX4_EN=m
 # CONFIG_MLX4_DEBUG is not set
 CONFIG_TEHUTI=m
 CONFIG_BNX2X=m
-CONFIG_QLGE=m
 CONFIG_SFC=m
 CONFIG_BE2NET=m
 CONFIG_LIBERTAS_THINFIRM=m
index bed7455..8df80c6 100644 (file)
@@ -39,7 +39,7 @@ CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION="/dev/hda3"
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_DEBUG=y
-CONFIG_CPU_FREQ_STAT=m
+CONFIG_CPU_FREQ_STAT=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_CPU_FREQ_GOV_POWERSAVE=m
 CONFIG_CPU_FREQ_GOV_USERSPACE=m
index c442f27..914c867 100644 (file)
@@ -74,6 +74,10 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_LOONGSON1=y
 # CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+CONFIG_WATCHDOG_SYSFS=y
+CONFIG_LOONGSON1_WDT=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_HID_GENERIC=m
 CONFIG_USB_HID=m
index 2304d41..68e42ef 100644 (file)
@@ -75,6 +75,10 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_LOONGSON1=y
 # CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+CONFIG_WATCHDOG_SYSFS=y
+CONFIG_LOONGSON1_WDT=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_HID_GENERIC=m
 CONFIG_USB_HID=m
index 58d43f3..078ecac 100644 (file)
@@ -59,8 +59,8 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
index c8f7e28..e233f87 100644 (file)
@@ -60,8 +60,8 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
index d2f54e5..fbe085c 100644 (file)
@@ -59,8 +59,8 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
index 3d0d9cb..2942610 100644 (file)
@@ -61,8 +61,8 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
index b496c25..07d0182 100644 (file)
@@ -110,7 +110,7 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
index 8e99ad8..f59969a 100644 (file)
@@ -90,7 +90,7 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
index ed1dce3..829c637 100644 (file)
@@ -7,6 +7,12 @@ CONFIG_EMBEDDED=y
 CONFIG_SLAB=y
 # CONFIG_BLOCK is not set
 # CONFIG_SUSPEND is not set
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IPV6 is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_UEVENT_HELPER is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
@@ -14,6 +20,30 @@ CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
 # CONFIG_FW_LOADER is not set
 # CONFIG_ALLOW_DEV_COREDUMP is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NET_CORE is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_RENESAS is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_XILINX_EMACLITE=y
+CONFIG_SMSC_PHY=y
+# CONFIG_WLAN is not set
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
@@ -25,13 +55,18 @@ CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
 # CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_HELPER_AUTO is not set
+CONFIG_I2C_XILINX=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_XILINX=y
-# CONFIG_HWMON is not set
+CONFIG_SENSORS_ADT7410=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MIPS_PLATFORM_DEVICES is not set
 # CONFIG_IOMMU_SUPPORT is not set
 # CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
 # CONFIG_MISC_FILESYSTEMS is not set
 CONFIG_PANIC_ON_OOPS=y
 # CONFIG_SCHED_DEBUG is not set
index 8987846..4365108 100644 (file)
@@ -1,12 +1,16 @@
 CONFIG_LANTIQ=y
+CONFIG_PCI_LANTIQ=y
 CONFIG_XRX200_PHY_FW=y
 CONFIG_CPU_MIPS32_R2=y
+CONFIG_MIPS_MT_SMP=y
+CONFIG_MIPS_VPE_LOADER=y
 # CONFIG_COMPACTION is not set
-# CONFIG_CROSS_MEMORY_ATTACH is not set
+CONFIG_NR_CPUS=2
 CONFIG_HZ_100=y
 # CONFIG_SECCOMP is not set
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
+# CONFIG_CROSS_MEMORY_ATTACH is not set
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
@@ -22,8 +26,8 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 # CONFIG_IOSCHED_CFQ is not set
+CONFIG_PCI=y
 # CONFIG_COREDUMP is not set
-# CONFIG_SUSPEND is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -35,12 +39,10 @@ CONFIG_IP_ROUTE_MULTIPATH=y
 CONFIG_IP_ROUTE_VERBOSE=y
 CONFIG_IP_MROUTE=y
 CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
-CONFIG_ARPD=y
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
 CONFIG_TCP_CONG_ADVANCED=y
 # CONFIG_TCP_CONG_BIC is not set
@@ -62,7 +64,6 @@ CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NF_CONNTRACK_IPV4=m
-# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
 CONFIG_IP_NF_IPTABLES=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
@@ -84,6 +85,8 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PHYSMAP_OF=y
 CONFIG_MTD_LANTIQ=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_XWAY=y
 CONFIG_EEPROM_93CX6=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
@@ -91,6 +94,7 @@ CONFIG_NETDEVICES=y
 CONFIG_LANTIQ_ETOP=y
 # CONFIG_NET_VENDOR_WIZNET is not set
 CONFIG_PHYLIB=y
+CONFIG_INTEL_XWAY_PHY=y
 CONFIG_PPP=m
 CONFIG_PPP_FILTER=y
 CONFIG_PPP_MULTILINK=y
@@ -111,17 +115,21 @@ CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
 CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_LANTIQ=y
 CONFIG_SPI=y
 CONFIG_GPIO_MM_LANTIQ=y
 CONFIG_GPIO_STP_XWAY=y
 # CONFIG_HWMON is not set
 CONFIG_WATCHDOG=y
+CONFIG_LANTIQ_WDT=y
 # CONFIG_HID is not set
 # CONFIG_USB_HID is not set
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_STORAGE_DEBUG=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC2_PCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_TRIGGERS=y
@@ -151,9 +159,6 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_FTRACE is not set
 CONFIG_CMDLINE_BOOL=y
-CONFIG_CRYPTO_MANAGER=m
 CONFIG_CRYPTO_ARC4=m
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRC_ITU_T=m
 CONFIG_CRC32_SARWATE=y
-CONFIG_AVERAGE=y
index 95e26f4..0c14a9d 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mc146818rtc.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/string.h>
 #include <linux/types.h>
 
index 1c3bf9f..61a0bf1 100644 (file)
@@ -9,12 +9,12 @@
  * Copyright (C) 2000, 2001, 2002, 2003, 2005  Maciej W. Rozycki
  */
 #include <linux/console.h>
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/irq.h>
 #include <linux/irqnr.h>
-#include <linux/module.h>
 #include <linux/param.h>
 #include <linux/percpu-defs.h>
 #include <linux/sched.h>
index 56bda4a..dad64d1 100644 (file)
@@ -14,6 +14,7 @@
  * Copyright (C) 2002 Maciej W. Rozycki
  */
 
+#include <linux/export.h>
 #include <linux/init.h>
 
 #include <asm/bootinfo.h>
@@ -88,7 +89,4 @@ static void wbflush_mips(void)
 {
        __fast_iob();
 }
-
-#include <linux/module.h>
-
 EXPORT_SYMBOL(__wbflush);
index 9100122..44ff64a 100644 (file)
@@ -90,7 +90,7 @@ void __init plat_time_init(void)
 static void markeins_board_init(void);
 extern void markeins_irq_setup(void);
 
-static void inline __init markeins_sio_setup(void)
+static inline void __init markeins_sio_setup(void)
 {
 }
 
index 7c66494..acb9b6d 100644 (file)
@@ -13,3 +13,4 @@ obj-y += irq.o
 obj-y += proc.o
 
 obj-$(CONFIG_LEGACY_BOARD_SEAD3)       += board-sead3.o
+obj-$(CONFIG_KEXEC)                    += kexec.o
index d493ccb..4af6192 100644 (file)
@@ -88,6 +88,19 @@ void __init *plat_get_fdt(void)
        return (void *)fdt;
 }
 
+void __init plat_fdt_relocated(void *new_location)
+{
+       /*
+        * reset fdt as the cached value would point to the location
+        * before relocations happened and update the location argument
+        * if it was passed using UHI
+        */
+       fdt = NULL;
+
+       if (fw_arg0 == -2)
+               fw_arg1 = (unsigned long)new_location;
+}
+
 void __init plat_mem_setup(void)
 {
        if (mach && mach->fixup_fdt)
diff --git a/arch/mips/generic/kexec.c b/arch/mips/generic/kexec.c
new file mode 100644 (file)
index 0000000..e9fb735
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2016 Imagination Technologies
+ * Author: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/kexec.h>
+#include <linux/libfdt.h>
+#include <linux/uaccess.h>
+
+static int generic_kexec_prepare(struct kimage *image)
+{
+       int i;
+
+       for (i = 0; i < image->nr_segments; i++) {
+               struct fdt_header fdt;
+
+               if (image->segment[i].memsz <= sizeof(fdt))
+                       continue;
+
+               if (copy_from_user(&fdt, image->segment[i].buf, sizeof(fdt)))
+                       continue;
+
+               if (fdt_check_header(&fdt))
+                       continue;
+
+               kexec_args[0] = -2;
+               kexec_args[1] = (unsigned long)
+                       phys_to_virt((unsigned long)image->segment[i].mem);
+               break;
+       }
+       return 0;
+}
+
+static int __init register_generic_kexec(void)
+{
+       _machine_kexec_prepare = generic_kexec_prepare;
+       return 0;
+}
+arch_initcall(register_generic_kexec);
index 994b1c4..2535c7b 100644 (file)
@@ -4,6 +4,7 @@ generic-y += clkdev.h
 generic-y += current.h
 generic-y += dma-contiguous.h
 generic-y += emergency-restart.h
+generic-y += export.h
 generic-y += irq_work.h
 generic-y += local64.h
 generic-y += mcs_spinlock.h
@@ -15,6 +16,7 @@ generic-y += sections.h
 generic-y += segment.h
 generic-y += serial.h
 generic-y += trace_clock.h
+generic-y += unaligned.h
 generic-y += user.h
 generic-y += word-at-a-time.h
 generic-y += xor.h
diff --git a/arch/mips/include/asm/asm-prototypes.h b/arch/mips/include/asm/asm-prototypes.h
new file mode 100644 (file)
index 0000000..a160cf6
--- /dev/null
@@ -0,0 +1,5 @@
+#include <asm/checksum.h>
+#include <asm/page.h>
+#include <asm/fpu.h>
+#include <asm-generic/asm-prototypes.h>
+#include <asm/uaccess.h>
index 7c26b28..859cf70 100644 (file)
@@ -54,7 +54,8 @@
                .align  2;                              \
                .type   symbol, @function;              \
                .ent    symbol, 0;                      \
-symbol:                .frame  sp, 0, ra
+symbol:                .frame  sp, 0, ra;                      \
+               .insn
 
 /*
  * NESTED - declare nested routine entry point
@@ -63,8 +64,9 @@ symbol:               .frame  sp, 0, ra
                .globl  symbol;                         \
                .align  2;                              \
                .type   symbol, @function;              \
-               .ent    symbol, 0;                       \
-symbol:                .frame  sp, framesize, rpc
+               .ent    symbol, 0;                      \
+symbol:                .frame  sp, framesize, rpc;             \
+               .insn
 
 /*
  * END - mark end of function
@@ -86,7 +88,7 @@ symbol:
 #define FEXPORT(symbol)                                        \
                .globl  symbol;                         \
                .type   symbol, @function;              \
-symbol:
+symbol:                .insn
 
 /*
  * ABS - export absolute symbol
index ee9f5f2..e26a093 100644 (file)
@@ -164,6 +164,19 @@ static inline void plat_swiotlb_setup(void) {}
  * Return: Pointer to the flattened device tree blob.
  */
 extern void *plat_get_fdt(void);
+
+#ifdef CONFIG_RELOCATABLE
+
+/**
+ * plat_fdt_relocated() - Update platform's information about relocated dtb
+ *
+ * This function provides a platform-independent API to set platform's
+ * information about relocated DTB if it needs to be moved due to kernel
+ * relocation occurring at boot.
+ */
+void plat_fdt_relocated(void *new_location);
+
+#endif /* CONFIG_RELOCATABLE */
 #endif /* CONFIG_USE_OF */
 
 #endif /* _ASM_BOOTINFO_H */
index 7749daf..c8b574f 100644 (file)
@@ -186,7 +186,9 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
        "       daddu   %0, %4          \n"
        "       dsll32  $1, %0, 0       \n"
        "       daddu   %0, $1          \n"
+       "       sltu    $1, %0, $1      \n"
        "       dsra32  %0, %0, 0       \n"
+       "       addu    %0, $1          \n"
 #endif
        "       .set    pop"
        : "=r" (sum)
index 2b3dc29..7a6c466 100644 (file)
@@ -210,6 +210,9 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 typedef double elf_fpreg_t;
 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 
+void mips_dump_regs32(u32 *uregs, const struct pt_regs *regs);
+void mips_dump_regs64(u64 *uregs, const struct pt_regs *regs);
+
 #ifdef CONFIG_32BIT
 /*
  * This is used to ensure we don't load something for the wrong architecture.
@@ -221,6 +224,9 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  */
 #define ELF_CLASS      ELFCLASS32
 
+#define ELF_CORE_COPY_REGS(dest, regs) \
+       mips_dump_regs32((u32 *)&(dest), (regs));
+
 #endif /* CONFIG_32BIT */
 
 #ifdef CONFIG_64BIT
@@ -234,6 +240,9 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  */
 #define ELF_CLASS      ELFCLASS64
 
+#define ELF_CORE_COPY_REGS(dest, regs) \
+       mips_dump_regs64((u64 *)&(dest), (regs));
+
 #endif /* CONFIG_64BIT */
 
 /*
index 64f2500..d34536e 100644 (file)
@@ -25,9 +25,6 @@
 #include <asm/cpu-features.h>
 #include <asm/kmap_types.h>
 
-/* undef for production */
-#define HIGHMEM_DEBUG 1
-
 /* declarations for highmem.c */
 extern unsigned long highstart_pfn, highend_pfn;
 
index 32229c7..47543d5 100644 (file)
@@ -40,7 +40,6 @@ extern raw_spinlock_t i8259A_lock;
 extern void make_8259A_irq(unsigned int irq);
 
 extern void init_i8259_irqs(void);
-extern int i8259_of_init(struct device_node *node, struct device_node *parent);
 
 /**
  * i8159_set_poll() - Override the i8259 polling function
index 6bf10e7..956db6e 100644 (file)
 
 #include <irq.h>
 
+#define IRQ_STACK_SIZE                 THREAD_SIZE
+
+extern void *irq_stack[NR_CPUS];
+
+static inline bool on_irq_stack(int cpu, unsigned long sp)
+{
+       unsigned long low = (unsigned long)irq_stack[cpu];
+       unsigned long high = low + IRQ_STACK_SIZE;
+
+       return (low <= sp && sp <= high);
+}
+
 #ifdef CONFIG_I8259
 static inline int irq_canonicalize(int irq)
 {
index 2afb840..ee3d4fe 100644 (file)
@@ -80,6 +80,15 @@ enum bcm47xx_board {
        BCM47XX_BOARD_LINKSYS_WRT610NV2,
        BCM47XX_BOARD_LINKSYS_WRTSL54GS,
 
+       BCM47XX_BOARD_LUXUL_ABR_4400_V1,
+       BCM47XX_BOARD_LUXUL_XAP_310_V1,
+       BCM47XX_BOARD_LUXUL_XAP_1210_V1,
+       BCM47XX_BOARD_LUXUL_XAP_1230_V1,
+       BCM47XX_BOARD_LUXUL_XAP_1240_V1,
+       BCM47XX_BOARD_LUXUL_XAP_1500_V1,
+       BCM47XX_BOARD_LUXUL_XBR_4400_V1,
+       BCM47XX_BOARD_LUXUL_XVW_P30_V1,
+       BCM47XX_BOARD_LUXUL_XWR_600_V1,
        BCM47XX_BOARD_LUXUL_XWR_1750_V1,
 
        BCM47XX_BOARD_MICROSOFT_MN700,
index c4873e8..c38b38c 100644 (file)
        # to begin
        #
 
-       # This is the variable where the next core to boot os stored
-       PTR_LA  t0, octeon_processor_boot
 octeon_spin_wait_boot:
+#ifdef CONFIG_RELOCATABLE
+       PTR_LA  t0, octeon_processor_relocated_kernel_entry
+       LONG_L  t0, (t0)
+       beq     zero, t0, 1f
+       nop
+
+       jr      t0
+       nop
+1:
+#endif /* CONFIG_RELOCATABLE */
+
+       # This is the variable where the next core to boot is stored
+       PTR_LA  t0, octeon_processor_boot
        # Get the core id of the next to be booted
        LONG_L  t1, (t0)
        # Keep looping if it isn't me
index 4775a11..24d5e31 100644 (file)
 
 /*
  * IP27 uses the R10000's uncached attribute feature.  Attribute 3 selects
- * uncached memory addressing.
+ * uncached memory addressing. Hide the definitions on 32-bit compilation
+ * of the compat-vdso code.
  */
-
+#ifdef CONFIG_64BIT
 #define HSPEC_BASE             0x9000000000000000
 #define IO_BASE                        0x9200000000000000
 #define MSPEC_BASE             0x9400000000000000
 #define UNCAC_BASE             0x9600000000000000
 #define CAC_BASE               0xa800000000000000
+#endif
 
 #define TO_MSPEC(x)            (MSPEC_BASE | ((x) & TO_PHYS_MASK))
 #define TO_HSPEC(x)            (HSPEC_BASE | ((x) & TO_PHYS_MASK))
index 3584c40..84c28a8 100644 (file)
@@ -3,9 +3,9 @@
  *
  * Register mappings for Loongson 1
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
 
@@ -13,7 +13,7 @@
 #define __ASM_MACH_LOONGSON32_LOONGSON1_H
 
 #if defined(CONFIG_LOONGSON1_LS1B)
-#define DEFAULT_MEMSIZE                        256     /* If no memsize provided */
+#define DEFAULT_MEMSIZE                        64      /* If no memsize provided */
 #elif defined(CONFIG_LOONGSON1_LS1C)
 #define DEFAULT_MEMSIZE                        32
 #endif
@@ -52,6 +52,7 @@
 #include <regs-clk.h>
 #include <regs-mux.h>
 #include <regs-pwm.h>
+#include <regs-rtc.h>
 #include <regs-wdt.h>
 
 #endif /* __ASM_MACH_LOONGSON32_LOONGSON1_H */
index 7adc313..8f8fa43 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
 
@@ -25,11 +25,12 @@ extern struct platform_device ls1x_gpio0_pdev;
 extern struct platform_device ls1x_gpio1_pdev;
 extern struct platform_device ls1x_nand_pdev;
 extern struct platform_device ls1x_rtc_pdev;
+extern struct platform_device ls1x_wdt_pdev;
 
 void __init ls1x_clk_init(void);
 void __init ls1x_dma_set_platdata(struct plat_ls1x_dma *pdata);
 void __init ls1x_nand_set_platdata(struct plat_ls1x_nand *pdata);
-void __init ls1x_serial_set_uartclk(struct platform_device *pdev);
 void __init ls1x_rtc_set_extclk(struct platform_device *pdev);
+void __init ls1x_serial_set_uartclk(struct platform_device *pdev);
 
 #endif /* __ASM_MACH_LOONGSON32_PLATFORM_H */
diff --git a/arch/mips/include/asm/mach-loongson32/regs-rtc.h b/arch/mips/include/asm/mach-loongson32/regs-rtc.h
new file mode 100644 (file)
index 0000000..e67fda2
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Yang Ling <gnaygnil@gmail.com>
+ *
+ * Loongson 1 RTC timer Register Definitions.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#ifndef __ASM_MACH_LOONGSON32_REGS_RTC_H
+#define __ASM_MACH_LOONGSON32_REGS_RTC_H
+
+#define LS1X_RTC_REG(x) \
+               ((void __iomem *)KSEG1ADDR(LS1X_RTC_BASE + (x)))
+
+#define LS1X_RTC_CTRL  LS1X_RTC_REG(0x40)
+
+#define RTC_EXTCLK_OK  (BIT(5) | BIT(8))
+#define RTC_EXTCLK_EN  BIT(8)
+
+#endif /* __ASM_MACH_LOONGSON32_REGS_RTC_H */
index a73350b..66af4cc 100644 (file)
 #define MT7620_GPIO_MODE_WDT_MASK      0x3
 #define MT7620_GPIO_MODE_WDT_SHIFT     21
 
+#define MT7620_GPIO_MODE_MDIO          0
+#define MT7620_GPIO_MODE_MDIO_REFCLK   1
+#define MT7620_GPIO_MODE_MDIO_GPIO     2
+#define MT7620_GPIO_MODE_MDIO_MASK     0x3
+#define MT7620_GPIO_MODE_MDIO_SHIFT    7
+
 #define MT7620_GPIO_MODE_I2C           0
 #define MT7620_GPIO_MODE_UART1         5
-#define MT7620_GPIO_MODE_MDIO          8
 #define MT7620_GPIO_MODE_RGMII1                9
 #define MT7620_GPIO_MODE_RGMII2                10
 #define MT7620_GPIO_MODE_SPI           11
index 2e41807..cfdbab0 100644 (file)
@@ -187,6 +187,7 @@ BUILD_CM_R_(config,         MIPS_CM_GCB_OFS + 0x00)
 BUILD_CM_RW(base,              MIPS_CM_GCB_OFS + 0x08)
 BUILD_CM_RW(access,            MIPS_CM_GCB_OFS + 0x20)
 BUILD_CM_R_(rev,               MIPS_CM_GCB_OFS + 0x30)
+BUILD_CM_RW(err_control,       MIPS_CM_GCB_OFS + 0x38)
 BUILD_CM_RW(error_mask,                MIPS_CM_GCB_OFS + 0x40)
 BUILD_CM_RW(error_cause,       MIPS_CM_GCB_OFS + 0x48)
 BUILD_CM_RW(error_addr,                MIPS_CM_GCB_OFS + 0x50)
@@ -266,6 +267,12 @@ BUILD_CM_Cx_R_(tcid_8_priority,    0x80)
 #define CM_REV_CM2_5                           CM_ENCODE_REV(7, 0)
 #define CM_REV_CM3                             CM_ENCODE_REV(8, 0)
 
+/* GCR_ERR_CONTROL register fields */
+#define CM_GCR_ERR_CONTROL_L2_ECC_EN_SHF       1
+#define CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK       (_ULCAST_(0x1) << 1)
+#define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_SHF  0
+#define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK  (_ULCAST_(0x1) << 0)
+
 /* GCR_ERROR_CAUSE register fields */
 #define CM_GCR_ERROR_CAUSE_ERRTYPE_SHF         27
 #define CM_GCR_ERROR_CAUSE_ERRTYPE_MSK         (_ULCAST_(0x1f) << 27)
index df78b2c..f8d1d2f 100644 (file)
 #define MIPS_WATCHHI_W         (_ULCAST_(1) << 0)
 #define MIPS_WATCHHI_IRW       (_ULCAST_(0x7) << 0)
 
+/* PerfCnt control register definitions */
+#define MIPS_PERFCTRL_EXL      (_ULCAST_(1) << 0)
+#define MIPS_PERFCTRL_K                (_ULCAST_(1) << 1)
+#define MIPS_PERFCTRL_S                (_ULCAST_(1) << 2)
+#define MIPS_PERFCTRL_U                (_ULCAST_(1) << 3)
+#define MIPS_PERFCTRL_IE       (_ULCAST_(1) << 4)
+#define MIPS_PERFCTRL_EVENT_S  5
+#define MIPS_PERFCTRL_EVENT    (_ULCAST_(0x3ff) << MIPS_PERFCTRL_EVENT_S)
+#define MIPS_PERFCTRL_PCTD     (_ULCAST_(1) << 15)
+#define MIPS_PERFCTRL_EC       (_ULCAST_(0x3) << 23)
+#define MIPS_PERFCTRL_EC_R     (_ULCAST_(0) << 23)
+#define MIPS_PERFCTRL_EC_RI    (_ULCAST_(1) << 23)
+#define MIPS_PERFCTRL_EC_G     (_ULCAST_(2) << 23)
+#define MIPS_PERFCTRL_EC_GRI   (_ULCAST_(3) << 23)
+#define MIPS_PERFCTRL_W                (_ULCAST_(1) << 30)
+#define MIPS_PERFCTRL_M                (_ULCAST_(1) << 31)
+
+/* PerfCnt control register MT extensions used by MIPS cores */
+#define MIPS_PERFCTRL_VPEID_S  16
+#define MIPS_PERFCTRL_VPEID    (_ULCAST_(0xf) << MIPS_PERFCTRL_VPEID_S)
+#define MIPS_PERFCTRL_TCID_S   22
+#define MIPS_PERFCTRL_TCID     (_ULCAST_(0xff) << MIPS_PERFCTRL_TCID_S)
+#define MIPS_PERFCTRL_MT_EN    (_ULCAST_(0x3) << 20)
+#define MIPS_PERFCTRL_MT_EN_ALL        (_ULCAST_(0) << 20)
+#define MIPS_PERFCTRL_MT_EN_VPE        (_ULCAST_(1) << 20)
+#define MIPS_PERFCTRL_MT_EN_TC (_ULCAST_(2) << 20)
+
+/* PerfCnt control register MT extensions used by BMIPS5000 */
+#define BRCM_PERFCTRL_TC       (_ULCAST_(1) << 30)
+
+/* PerfCnt control register MT extensions used by Netlogic XLR */
+#define XLR_PERFCTRL_ALLTHREADS        (_ULCAST_(1) << 13)
+
 /* MAAR bit definitions */
 #define MIPS_MAAR_ADDR         ((BIT_ULL(BITS_PER_LONG - 12) - 1) << 12)
 #define MIPS_MAAR_ADDR_SHIFT   12
index 4719fcf..8123b82 100644 (file)
@@ -46,7 +46,8 @@ union cvmx_gpio_bit_cfgx {
        uint64_t u64;
        struct cvmx_gpio_bit_cfgx_s {
 #ifdef __BIG_ENDIAN_BITFIELD
-               uint64_t reserved_17_63:47;
+               uint64_t reserved_21_63:42;
+               uint64_t output_sel:5;
                uint64_t synce_sel:2;
                uint64_t clk_gen:1;
                uint64_t clk_sel:2;
@@ -66,7 +67,8 @@ union cvmx_gpio_bit_cfgx {
                uint64_t clk_sel:2;
                uint64_t clk_gen:1;
                uint64_t synce_sel:2;
-               uint64_t reserved_17_63:47;
+               uint64_t output_sel:5;
+               uint64_t reserved_21_63:42;
 #endif
        } s;
        struct cvmx_gpio_bit_cfgx_cn30xx {
@@ -126,6 +128,8 @@ union cvmx_gpio_bit_cfgx {
        struct cvmx_gpio_bit_cfgx_s cn66xx;
        struct cvmx_gpio_bit_cfgx_s cn68xx;
        struct cvmx_gpio_bit_cfgx_s cn68xxp1;
+       struct cvmx_gpio_bit_cfgx_s cn70xx;
+       struct cvmx_gpio_bit_cfgx_s cn73xx;
        struct cvmx_gpio_bit_cfgx_s cnf71xx;
 };
 
index 4d7a3db..f89775b 100644 (file)
@@ -80,8 +80,7 @@ extern cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port);
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index 4debb1c..63fd213 100644 (file)
@@ -74,8 +74,7 @@ extern cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port);
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index 9f1c6b9..d5adf85 100644 (file)
@@ -71,8 +71,7 @@ extern cvmx_helper_link_info_t __cvmx_helper_spi_link_get(int ipd_port);
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index 5e89ed7..f8ce53f 100644 (file)
@@ -74,8 +74,7 @@ extern cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port);
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index 5a3090d..0ed87cb 100644 (file)
@@ -156,17 +156,6 @@ extern cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int
                                                                   interface);
 
 /**
- * Auto configure an IPD/PKO port link state and speed. This
- * function basically does the equivalent of:
- * cvmx_helper_link_set(ipd_port, cvmx_helper_link_get(ipd_port));
- *
- * @ipd_port: IPD/PKO port to auto configure
- *
- * Returns Link state after configure
- */
-extern cvmx_helper_link_info_t cvmx_helper_link_autoconf(int ipd_port);
-
-/**
  * Return the link state of an IPD/PKO port as returned by
  * auto negotiation. The result of this function may not match
  * Octeon's link config if auto negotiation has changed since
@@ -182,8 +171,7 @@ extern cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port);
  * Configure an IPD/PKO port for the specified link state. This
  * function does not influence auto negotiation at the PHY level.
  * The passed link state must always match the link state returned
- * by cvmx_helper_link_get(). It is normally best to use
- * cvmx_helper_link_autoconf() instead.
+ * by cvmx_helper_link_get().
  *
  * @ipd_port:  IPD/PKO port to configure
  * @link_info: The new link state
index a03e869..a8705f6 100644 (file)
@@ -43,21 +43,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
  * Initialize a new pgd / pmd table with invalid pointers.
  */
 extern void pgd_init(unsigned long page);
-
-static inline pgd_t *pgd_alloc(struct mm_struct *mm)
-{
-       pgd_t *ret, *init;
-
-       ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
-       if (ret) {
-               init = pgd_offset(&init_mm, 0UL);
-               pgd_init((unsigned long)ret);
-               memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
-                      (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
-       }
-
-       return ret;
-}
+extern pgd_t *pgd_alloc(struct mm_struct *mm);
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
index b42b513..55fd94e 100644 (file)
@@ -147,49 +147,66 @@ static inline void flush_scache_line(unsigned long addr)
 }
 
 #define protected_cache_op(op,addr)                            \
+({                                                             \
+       int __err = 0;                                          \
        __asm__ __volatile__(                                   \
        "       .set    push                    \n"             \
        "       .set    noreorder               \n"             \
        "       .set "MIPS_ISA_ARCH_LEVEL"      \n"             \
-       "1:     cache   %0, (%1)                \n"             \
-       "2:     .set    pop                     \n"             \
+       "1:     cache   %1, (%2)                \n"             \
+       "2:     .insn                           \n"             \
+       "       .set    pop                     \n"             \
+       "       .section .fixup,\"ax\"          \n"             \
+       "3:     li      %0, %3                  \n"             \
+       "       j       2b                      \n"             \
+       "       .previous                       \n"             \
        "       .section __ex_table,\"a\"       \n"             \
-       "       "STR(PTR)" 1b, 2b               \n"             \
+       "       "STR(PTR)" 1b, 3b               \n"             \
        "       .previous"                                      \
-       :                                                       \
-       : "i" (op), "r" (addr))
+       : "+r" (__err)                                          \
+       : "i" (op), "r" (addr), "i" (-EFAULT));                 \
+       __err;                                                  \
+})
+
 
 #define protected_cachee_op(op,addr)                           \
+({                                                             \
+       int __err = 0;                                          \
        __asm__ __volatile__(                                   \
        "       .set    push                    \n"             \
        "       .set    noreorder               \n"             \
        "       .set    mips0                   \n"             \
        "       .set    eva                     \n"             \
-       "1:     cachee  %0, (%1)                \n"             \
-       "2:     .set    pop                     \n"             \
+       "1:     cachee  %1, (%2)                \n"             \
+       "2:     .insn                           \n"             \
+       "       .set    pop                     \n"             \
+       "       .section .fixup,\"ax\"          \n"             \
+       "3:     li      %0, %3                  \n"             \
+       "       j       2b                      \n"             \
+       "       .previous                       \n"             \
        "       .section __ex_table,\"a\"       \n"             \
-       "       "STR(PTR)" 1b, 2b               \n"             \
+       "       "STR(PTR)" 1b, 3b               \n"             \
        "       .previous"                                      \
-       :                                                       \
-       : "i" (op), "r" (addr))
+       : "+r" (__err)                                          \
+       : "i" (op), "r" (addr), "i" (-EFAULT));                 \
+       __err;                                                  \
+})
 
 /*
  * The next two are for badland addresses like signal trampolines.
  */
-static inline void protected_flush_icache_line(unsigned long addr)
+static inline int protected_flush_icache_line(unsigned long addr)
 {
        switch (boot_cpu_type()) {
        case CPU_LOONGSON2:
-               protected_cache_op(Hit_Invalidate_I_Loongson2, addr);
-               break;
+               return protected_cache_op(Hit_Invalidate_I_Loongson2, addr);
 
        default:
 #ifdef CONFIG_EVA
-               protected_cachee_op(Hit_Invalidate_I, addr);
+               return protected_cachee_op(Hit_Invalidate_I, addr);
 #else
-               protected_cache_op(Hit_Invalidate_I, addr);
+               return protected_cache_op(Hit_Invalidate_I, addr);
 #endif
-               break;
        }
 }
 
@@ -199,21 +216,21 @@ static inline void protected_flush_icache_line(unsigned long addr)
  * caches.  We're talking about one cacheline unnecessarily getting invalidated
  * here so the penalty isn't overly hard.
  */
-static inline void protected_writeback_dcache_line(unsigned long addr)
+static inline int protected_writeback_dcache_line(unsigned long addr)
 {
 #ifdef CONFIG_EVA
-       protected_cachee_op(Hit_Writeback_Inv_D, addr);
+       return protected_cachee_op(Hit_Writeback_Inv_D, addr);
 #else
-       protected_cache_op(Hit_Writeback_Inv_D, addr);
+       return protected_cache_op(Hit_Writeback_Inv_D, addr);
 #endif
 }
 
-static inline void protected_writeback_scache_line(unsigned long addr)
+static inline int protected_writeback_scache_line(unsigned long addr)
 {
 #ifdef CONFIG_EVA
-       protected_cachee_op(Hit_Writeback_Inv_SD, addr);
+       return protected_cachee_op(Hit_Writeback_Inv_SD, addr);
 #else
-       protected_cache_op(Hit_Writeback_Inv_SD, addr);
+       return protected_cache_op(Hit_Writeback_Inv_SD, addr);
 #endif
 }
 
index 060f23f..98a117a 100644 (file)
@@ -42,11 +42,7 @@ extern int __cpu_logical_map[NR_CPUS];
 #define SMP_CALL_FUNCTION      0x2
 /* Octeon - Tell another core to flush its icache */
 #define SMP_ICACHE_FLUSH       0x4
-/* Used by kexec crashdump to save all cpu's state */
-#define SMP_DUMP               0x8
-#define SMP_ASK_C0COUNT                0x10
-
-extern cpumask_t cpu_callin_map;
+#define SMP_ASK_C0COUNT                0x8
 
 /* Mask of CPUs which are currently definitely operating coherently */
 extern cpumask_t cpu_coherent_mask;
@@ -113,8 +109,4 @@ static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)
        mp_ops->send_ipi_mask(mask, SMP_CALL_FUNCTION);
 }
 
-#if defined(CONFIG_KEXEC)
-extern void (*dump_ipi_function_ptr)(void *);
-void dump_send_ipi(void (*dump_ipi_callback)(void *));
-#endif
 #endif /* __ASM_SMP_H */
index eebf395..eaa5a4d 100644 (file)
                LONG_S  $25, PT_R25(sp)
                LONG_S  $28, PT_R28(sp)
                LONG_S  $31, PT_R31(sp)
+
+               /* Set thread_info if we're coming from user mode */
+               mfc0    k0, CP0_STATUS
+               sll     k0, 3           /* extract cu0 bit */
+               bltz    k0, 9f
+
                ori     $28, sp, _THREAD_MASK
                xori    $28, _THREAD_MASK
 #ifdef CONFIG_CPU_CAVIUM_OCTEON
                .set    mips64
                pref    0, 0($28)       /* Prefetch the current pointer */
 #endif
+9:
                .set    pop
                .endm
 
 
                .macro  RESTORE_SP_AND_RET
                LONG_L  sp, PT_R29(sp)
+#ifdef CONFIG_CPU_MIPSR6
+               eretnc
+#else
                .set    arch=r4000
                eret
                .set    mips0
+#endif
                .endm
 
 #endif
                RESTORE_SP
                .endm
 
-               .macro  RESTORE_ALL_AND_RET
-               RESTORE_TEMP
-               RESTORE_STATIC
-               RESTORE_AT
-               RESTORE_SOME
-               RESTORE_SP_AND_RET
-               .endm
-
 /*
  * Move to kernel mode and disable interrupts.
  * Set cp0 enable bit as sign that we're running on the kernel stack
index c0ae279..e610473 100644 (file)
@@ -66,13 +66,18 @@ do {                                                                        \
 #define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)
 #endif
 
-#define __clear_software_ll_bit()                                      \
-do {   if (cpu_has_rw_llb) {                                           \
+/*
+ * Clear LLBit during context switches on MIPSr6 such that eretnc can be used
+ * unconditionally when returning to userland in entry.S.
+ */
+#define __clear_r6_hw_ll_bit() do {                                    \
+       if (cpu_has_mips_r6)                                            \
                write_c0_lladdr(0);                                     \
-       } else {                                                        \
-               if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc)\
-                       ll_bit = 0;                                     \
-       }                                                               \
+} while (0)
+
+#define __clear_software_ll_bit() do {                                 \
+       if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc)       \
+               ll_bit = 0;                                             \
 } while (0)
 
 /*
@@ -120,6 +125,7 @@ do {                                                                        \
                }                                                       \
                clear_c0_status(ST0_CU2);                               \
        }                                                               \
+       __clear_r6_hw_ll_bit();                                         \
        __clear_software_ll_bit();                                      \
        if (cpu_has_userlocal)                                          \
                write_c0_userlocal(task_thread_info(next)->tp_value);   \
index e309d8f..b439e51 100644 (file)
@@ -27,7 +27,6 @@ struct thread_info {
        unsigned long           tp_value;       /* thread pointer */
        __u32                   cpu;            /* current CPU */
        int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
-       int                     r2_emul_return; /* 1 => Returning from R2 emulator */
        mm_segment_t            addr_limit;     /*
                                                 * thread address space limit:
                                                 * 0x7fffffff for user-thead
diff --git a/arch/mips/include/asm/tlbex.h b/arch/mips/include/asm/tlbex.h
new file mode 100644 (file)
index 0000000..53050e9
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __ASM_TLBEX_H
+#define __ASM_TLBEX_H
+
+#include <asm/uasm.h>
+
+/*
+ * Write random or indexed TLB entry, and care about the hazards from
+ * the preceding mtc0 and for the following eret.
+ */
+enum tlb_write_entry {
+       tlb_random,
+       tlb_indexed
+};
+
+extern int pgd_reg;
+
+void build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
+                     unsigned int tmp, unsigned int ptr);
+void build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr);
+void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr);
+void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep);
+void build_tlb_write_entry(u32 **p, struct uasm_label **l,
+                          struct uasm_reloc **r,
+                          enum tlb_write_entry wmode);
+
+#endif /* __ASM_TLBEX_H */
index 89fa5c0..5347cfe 100644 (file)
@@ -1241,6 +1241,9 @@ extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n);
        __cu_len;                                                       \
 })
 
+extern __kernel_size_t __bzero_kernel(void __user *addr, __kernel_size_t size);
+extern __kernel_size_t __bzero(void __user *addr, __kernel_size_t size);
+
 /*
  * __clear_user: - Zero a block of memory in user space, with less checking.
  * @to:          Destination address, in user space.
@@ -1293,6 +1296,9 @@ __clear_user(void __user *addr, __kernel_size_t size)
        __cl_size;                                                      \
 })
 
+extern long __strncpy_from_kernel_nocheck_asm(char *__to, const char __user *__from, long __len);
+extern long __strncpy_from_user_nocheck_asm(char *__to, const char __user *__from, long __len);
+
 /*
  * __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking.
  * @dst:   Destination address, in kernel space.  This buffer must be at
@@ -1344,6 +1350,9 @@ __strncpy_from_user(char *__to, const char __user *__from, long __len)
        return res;
 }
 
+extern long __strncpy_from_kernel_asm(char *__to, const char __user *__from, long __len);
+extern long __strncpy_from_user_asm(char *__to, const char __user *__from, long __len);
+
 /*
  * strncpy_from_user: - Copy a NUL terminated string from userspace.
  * @dst:   Destination address, in kernel space.  This buffer must be at
@@ -1393,6 +1402,9 @@ strncpy_from_user(char *__to, const char __user *__from, long __len)
        return res;
 }
 
+extern long __strlen_kernel_asm(const char __user *s);
+extern long __strlen_user_asm(const char __user *s);
+
 /*
  * strlen_user: - Get the size of a string in user space.
  * @str: The string to measure.
@@ -1434,6 +1446,9 @@ static inline long strlen_user(const char __user *s)
        return res;
 }
 
+extern long __strnlen_kernel_nocheck_asm(const char __user *s, long n);
+extern long __strnlen_user_nocheck_asm(const char __user *s, long n);
+
 /* Returns: 0 if bad, string length+1 (memory size) of string if ok */
 static inline long __strnlen_user(const char __user *s, long n)
 {
@@ -1463,6 +1478,9 @@ static inline long __strnlen_user(const char __user *s, long n)
        return res;
 }
 
+extern long __strnlen_kernel_asm(const char __user *s, long n);
+extern long __strnlen_user_asm(const char __user *s, long n);
+
 /*
  * strnlen_user: - Get the size of a string in user space.
  * @str: The string to measure.
index f7929f6..e9a9e2a 100644 (file)
@@ -9,6 +9,9 @@
  * Copyright (C) 2012, 2013  MIPS Technologies, Inc.  All rights reserved.
  */
 
+#ifndef __ASM_UASM_H
+#define __ASM_UASM_H
+
 #include <linux/types.h>
 
 #ifdef CONFIG_EXPORT_UASM
@@ -309,3 +312,5 @@ void uasm_il_bltz(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid);
 void uasm_il_bne(u32 **p, struct uasm_reloc **r, unsigned int reg1,
                 unsigned int reg2, int lid);
 void uasm_il_bnez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid);
+
+#endif /* __ASM_UASM_H */
diff --git a/arch/mips/include/asm/unaligned.h b/arch/mips/include/asm/unaligned.h
deleted file mode 100644 (file)
index 42f66c3..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
- */
-#ifndef _ASM_MIPS_UNALIGNED_H
-#define _ASM_MIPS_UNALIGNED_H
-
-#include <linux/compiler.h>
-#if defined(__MIPSEB__)
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# define get_unaligned __get_unaligned_be
-# define put_unaligned __put_unaligned_be
-#elif defined(__MIPSEL__)
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
-# define get_unaligned __get_unaligned_le
-# define put_unaligned __put_unaligned_le
-#else
-#  error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
-#endif
-
-# include <linux/unaligned/generic.h>
-
-#endif /* _ASM_MIPS_UNALIGNED_H */
index 1900f39..11172fd 100644 (file)
@@ -9,7 +9,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
index b765773..cac1ccd 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/init.h>
 
 #include <linux/io.h>
index 6984683..47e8571 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
index 4992461..777877f 100644 (file)
  *
  */
 
+#include <linux/export.h>
 #include <linux/io.h>
+#include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 
 #include <asm/mach-jz4740/base.h>
 #include <asm/mach-jz4740/timer.h>
index 4a603a3..9a0e37b 100644 (file)
@@ -7,7 +7,7 @@ extra-y         := head.o vmlinux.lds
 obj-y          += cpu-probe.o branch.o elf.o entry.o genex.o idle.o irq.o \
                   process.o prom.o ptrace.o reset.o setup.o signal.o \
                   syscall.o time.o topology.o traps.o unaligned.o watch.o \
-                  vdso.o
+                  vdso.o cacheinfo.o
 
 ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_ftrace.o = -pg
@@ -30,7 +30,7 @@ obj-$(CONFIG_SYNC_R4K)                += sync-r4k.o
 
 obj-$(CONFIG_DEBUG_FS)         += segment.o
 obj-$(CONFIG_STACKTRACE)       += stacktrace.o
-obj-$(CONFIG_MODULES)          += mips_ksyms.o module.o
+obj-$(CONFIG_MODULES)          += module.o
 obj-$(CONFIG_MODULES_USE_ELF_RELA) += module-rela.o
 
 obj-$(CONFIG_FTRACE_SYSCALLS)  += ftrace.o
index 6080582..bb5c5d3 100644 (file)
@@ -97,11 +97,11 @@ void output_thread_info_defines(void)
        OFFSET(TI_TP_VALUE, thread_info, tp_value);
        OFFSET(TI_CPU, thread_info, cpu);
        OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
-       OFFSET(TI_R2_EMUL_RET, thread_info, r2_emul_return);
        OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
        OFFSET(TI_REGS, thread_info, regs);
        DEFINE(_THREAD_SIZE, THREAD_SIZE);
        DEFINE(_THREAD_MASK, THREAD_MASK);
+       DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE);
        BLANK();
 }
 
diff --git a/arch/mips/kernel/cacheinfo.c b/arch/mips/kernel/cacheinfo.c
new file mode 100644 (file)
index 0000000..97d5239
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * MIPS cacheinfo support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#include <linux/cacheinfo.h>
+
+/* Populates leaf and increments to next leaf */
+#define populate_cache(cache, leaf, c_level, c_type)           \
+do {                                                           \
+       leaf->type = c_type;                                    \
+       leaf->level = c_level;                                  \
+       leaf->coherency_line_size = c->cache.linesz;            \
+       leaf->number_of_sets = c->cache.sets;                   \
+       leaf->ways_of_associativity = c->cache.ways;            \
+       leaf->size = c->cache.linesz * c->cache.sets *          \
+               c->cache.ways;                                  \
+       leaf++;                                                 \
+} while (0)
+
+static int __init_cache_level(unsigned int cpu)
+{
+       struct cpuinfo_mips *c = &current_cpu_data;
+       struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
+       int levels = 0, leaves = 0;
+
+       /*
+        * If Dcache is not set, we assume the cache structures
+        * are not properly initialized.
+        */
+       if (c->dcache.waysize)
+               levels += 1;
+       else
+               return -ENOENT;
+
+
+       leaves += (c->icache.waysize) ? 2 : 1;
+
+       if (c->scache.waysize) {
+               levels++;
+               leaves++;
+       }
+
+       if (c->tcache.waysize) {
+               levels++;
+               leaves++;
+       }
+
+       this_cpu_ci->num_levels = levels;
+       this_cpu_ci->num_leaves = leaves;
+       return 0;
+}
+
+static int __populate_cache_leaves(unsigned int cpu)
+{
+       struct cpuinfo_mips *c = &current_cpu_data;
+       struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
+       struct cacheinfo *this_leaf = this_cpu_ci->info_list;
+
+       if (c->icache.waysize) {
+               populate_cache(dcache, this_leaf, 1, CACHE_TYPE_DATA);
+               populate_cache(icache, this_leaf, 1, CACHE_TYPE_INST);
+       } else {
+               populate_cache(dcache, this_leaf, 1, CACHE_TYPE_UNIFIED);
+       }
+
+       if (c->scache.waysize)
+               populate_cache(scache, this_leaf, 2, CACHE_TYPE_UNIFIED);
+
+       if (c->tcache.waysize)
+               populate_cache(tcache, this_leaf, 3, CACHE_TYPE_UNIFIED);
+
+       return 0;
+}
+
+DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
+DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
index a378e44..c9e8622 100644 (file)
@@ -148,11 +148,11 @@ static inline void check_mult_sh(void)
                        bug = 1;
 
        if (bug == 0) {
-               printk("no.\n");
+               pr_cont("no.\n");
                return;
        }
 
-       printk("yes, workaround... ");
+       pr_cont("yes, workaround... ");
 
        fix = 1;
        for (i = 0; i < 8; i++)
@@ -160,11 +160,11 @@ static inline void check_mult_sh(void)
                        fix = 0;
 
        if (fix == 1) {
-               printk("yes.\n");
+               pr_cont("yes.\n");
                return;
        }
 
-       printk("no.\n");
+       pr_cont("no.\n");
        panic(bug64hit, !R4000_WAR ? r4kwar : nowar);
 }
 
@@ -218,11 +218,11 @@ static inline void check_daddi(void)
        local_irq_restore(flags);
 
        if (daddi_ov) {
-               printk("no.\n");
+               pr_cont("no.\n");
                return;
        }
 
-       printk("yes, workaround... ");
+       pr_cont("yes, workaround... ");
 
        local_irq_save(flags);
        handler = set_except_vector(EXCCODE_OV, handle_daddi_ov);
@@ -236,11 +236,11 @@ static inline void check_daddi(void)
        local_irq_restore(flags);
 
        if (daddi_ov) {
-               printk("yes.\n");
+               pr_cont("yes.\n");
                return;
        }
 
-       printk("no.\n");
+       pr_cont("no.\n");
        panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
 }
 
@@ -288,11 +288,11 @@ static inline void check_daddiu(void)
        daddiu_bug = v != w;
 
        if (!daddiu_bug) {
-               printk("no.\n");
+               pr_cont("no.\n");
                return;
        }
 
-       printk("yes, workaround... ");
+       pr_cont("yes, workaround... ");
 
        asm volatile(
                "addiu  %2, $0, %3\n\t"
@@ -304,11 +304,11 @@ static inline void check_daddiu(void)
                : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
 
        if (v == w) {
-               printk("yes.\n");
+               pr_cont("yes.\n");
                return;
        }
 
-       printk("no.\n");
+       pr_cont("no.\n");
        panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
 }
 
index 1723b17..5a71518 100644 (file)
@@ -56,7 +56,7 @@ static void crash_kexec_prepare_cpus(void)
 
        ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */
 
-       dump_send_ipi(crash_shutdown_secondary);
+       smp_call_function(crash_shutdown_secondary, NULL, 0);
        smp_wmb();
 
        /*
index 7791840..8d83fc2 100644 (file)
@@ -47,11 +47,6 @@ resume_userspace:
        local_irq_disable               # make sure we dont miss an
                                        # interrupt setting need_resched
                                        # between sampling and return
-#ifdef CONFIG_MIPSR2_TO_R6_EMULATOR
-       lw      k0, TI_R2_EMUL_RET($28)
-       bnez    k0, restore_all_from_r2_emul
-#endif
-
        LONG_L  a2, TI_FLAGS($28)       # current->work
        andi    t0, a2, _TIF_WORK_MASK  # (ignoring syscall_trace)
        bnez    t0, work_pending
@@ -120,19 +115,6 @@ restore_partial:           # restore partial frame
        RESTORE_SP_AND_RET
        .set    at
 
-#ifdef CONFIG_MIPSR2_TO_R6_EMULATOR
-restore_all_from_r2_emul:                      # restore full frame
-       .set    noat
-       sw      zero, TI_R2_EMUL_RET($28)       # reset it
-       RESTORE_TEMP
-       RESTORE_AT
-       RESTORE_STATIC
-       RESTORE_SOME
-       LONG_L  sp, PT_R29(sp)
-       eretnc
-       .set    at
-#endif
-
 work_pending:
        andi    t0, a2, _TIF_NEED_RESCHED # a2 is preloaded with TI_FLAGS
        beqz    t0, work_notifysig
index dc0b296..7ec9612 100644 (file)
@@ -187,9 +187,44 @@ NESTED(handle_int, PT_SIZE, sp)
 
        LONG_L  s0, TI_REGS($28)
        LONG_S  sp, TI_REGS($28)
-       PTR_LA  ra, ret_from_irq
-       PTR_LA  v0, plat_irq_dispatch
-       jr      v0
+
+       /*
+        * SAVE_ALL ensures we are using a valid kernel stack for the thread.
+        * Check if we are already using the IRQ stack.
+        */
+       move    s1, sp # Preserve the sp
+
+       /* Get IRQ stack for this CPU */
+       ASM_CPUID_MFC0  k0, ASM_SMP_CPUID_REG
+#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
+       lui     k1, %hi(irq_stack)
+#else
+       lui     k1, %highest(irq_stack)
+       daddiu  k1, %higher(irq_stack)
+       dsll    k1, 16
+       daddiu  k1, %hi(irq_stack)
+       dsll    k1, 16
+#endif
+       LONG_SRL        k0, SMP_CPUID_PTRSHIFT
+       LONG_ADDU       k1, k0
+       LONG_L  t0, %lo(irq_stack)(k1)
+
+       # Check if already on IRQ stack
+       PTR_LI  t1, ~(_THREAD_SIZE-1)
+       and     t1, t1, sp
+       beq     t0, t1, 2f
+
+       /* Switch to IRQ stack */
+       li      t1, _IRQ_STACK_SIZE
+       PTR_ADD sp, t0, t1
+
+2:
+       jal     plat_irq_dispatch
+
+       /* Restore sp */
+       move    sp, s1
+
+       j       ret_from_irq
 #ifdef CONFIG_CPU_MICROMIPS
        nop
 #endif
@@ -262,8 +297,44 @@ NESTED(except_vec_vi_handler, 0, sp)
 
        LONG_L  s0, TI_REGS($28)
        LONG_S  sp, TI_REGS($28)
-       PTR_LA  ra, ret_from_irq
-       jr      v0
+
+       /*
+        * SAVE_ALL ensures we are using a valid kernel stack for the thread.
+        * Check if we are already using the IRQ stack.
+        */
+       move    s1, sp # Preserve the sp
+
+       /* Get IRQ stack for this CPU */
+       ASM_CPUID_MFC0  k0, ASM_SMP_CPUID_REG
+#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
+       lui     k1, %hi(irq_stack)
+#else
+       lui     k1, %highest(irq_stack)
+       daddiu  k1, %higher(irq_stack)
+       dsll    k1, 16
+       daddiu  k1, %hi(irq_stack)
+       dsll    k1, 16
+#endif
+       LONG_SRL        k0, SMP_CPUID_PTRSHIFT
+       LONG_ADDU       k1, k0
+       LONG_L  t0, %lo(irq_stack)(k1)
+
+       # Check if already on IRQ stack
+       PTR_LI  t1, ~(_THREAD_SIZE-1)
+       and     t1, t1, sp
+       beq     t0, t1, 2f
+
+       /* Switch to IRQ stack */
+       li      t1, _IRQ_STACK_SIZE
+       PTR_ADD sp, t0, t1
+
+2:
+       jalr    v0
+
+       /* Restore sp */
+       move    sp, s1
+
+       j       ret_from_irq
        END(except_vec_vi_handler)
 
 /*
index f8f5836..ba150c7 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/atomic.h>
 #include <linux/uaccess.h>
 
+void *irq_stack[NR_CPUS];
+
 /*
  * 'what should we do if we get a hw irq event on an illegal vector'.
  * each architecture has to answer this themselves.
@@ -58,6 +60,15 @@ void __init init_IRQ(void)
                clear_c0_status(ST0_IM);
 
        arch_init_irq();
+
+       for_each_possible_cpu(i) {
+               int irq_pages = IRQ_STACK_SIZE / PAGE_SIZE;
+               void *s = (void *)__get_free_pages(GFP_KERNEL, irq_pages);
+
+               irq_stack[i] = s;
+               pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i,
+                       irq_stack[i], irq_stack[i] + IRQ_STACK_SIZE);
+       }
 }
 
 #ifdef CONFIG_DEBUG_STACKOVERFLOW
index 0352f74..b01bdef 100644 (file)
@@ -64,15 +64,10 @@ SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len,
        unsigned long, prot, unsigned long, flags, unsigned long, fd,
        unsigned long, pgoff)
 {
-       unsigned long error;
-
-       error = -EINVAL;
        if (pgoff & (~PAGE_MASK >> 12))
-               goto out;
-       error = sys_mmap_pgoff(addr, len, prot, flags, fd,
-                              pgoff >> (PAGE_SHIFT-12));
-out:
-       return error;
+               return -EINVAL;
+       return sys_mmap_pgoff(addr, len, prot, flags, fd,
+                             pgoff >> (PAGE_SHIFT-12));
 }
 
 #define RLIM_INFINITY32 0x7fffffff
index 5972520..8b574bc 100644 (file)
@@ -28,9 +28,31 @@ atomic_t kexec_ready_to_reboot = ATOMIC_INIT(0);
 void (*_crash_smp_send_stop)(void) = NULL;
 #endif
 
+static void kexec_image_info(const struct kimage *kimage)
+{
+       unsigned long i;
+
+       pr_debug("kexec kimage info:\n");
+       pr_debug("  type:        %d\n", kimage->type);
+       pr_debug("  start:       %lx\n", kimage->start);
+       pr_debug("  head:        %lx\n", kimage->head);
+       pr_debug("  nr_segments: %lu\n", kimage->nr_segments);
+
+       for (i = 0; i < kimage->nr_segments; i++) {
+               pr_debug("    segment[%lu]: %016lx - %016lx, 0x%lx bytes, %lu pages\n",
+                       i,
+                       kimage->segment[i].mem,
+                       kimage->segment[i].mem + kimage->segment[i].memsz,
+                       (unsigned long)kimage->segment[i].memsz,
+                       (unsigned long)kimage->segment[i].memsz /  PAGE_SIZE);
+       }
+}
+
 int
 machine_kexec_prepare(struct kimage *kimage)
 {
+       kexec_image_info(kimage);
+
        if (_machine_kexec_prepare)
                return _machine_kexec_prepare(kimage);
        return 0;
index 2f7c734..f2ee7e1 100644 (file)
@@ -10,6 +10,7 @@
  * Author: Wu Zhangjin <wuzhangjin@gmail.com>
  */
 
+#include <asm/export.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
 #include <asm/ftrace.h>
@@ -66,6 +67,7 @@
 NESTED(ftrace_caller, PT_SIZE, ra)
        .globl _mcount
 _mcount:
+EXPORT_SYMBOL(_mcount)
        b       ftrace_stub
 #ifdef CONFIG_32BIT
         addiu sp,sp,8
@@ -114,6 +116,7 @@ ftrace_stub:
 #else  /* ! CONFIG_DYNAMIC_FTRACE */
 
 NESTED(_mcount, PT_SIZE, ra)
+EXPORT_SYMBOL(_mcount)
        PTR_LA  t1, ftrace_stub
        PTR_L   t2, ftrace_trace_function /* Prepare t2 for (1) */
        bne     t1, t2, static_trace
index a12904e..1a0a3b4 100644 (file)
@@ -99,9 +99,10 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
                retval = -ENOMEM;
                goto out_free_new_mask;
        }
-       retval = -EPERM;
-       if (!check_same_owner(p) && !capable(CAP_SYS_NICE))
+       if (!check_same_owner(p) && !capable(CAP_SYS_NICE)) {
+               retval = -EPERM;
                goto out_unlock;
+       }
 
        retval = security_task_setscheduler(p);
        if (retval)
index ef2ca28..d8f1cf1 100644 (file)
@@ -433,8 +433,8 @@ static int multu_func(struct pt_regs *regs, u32 ir)
        rs = regs->regs[MIPSInst_RS(ir)];
        res = (u64)rt * (u64)rs;
        rt = res;
-       regs->lo = (s64)rt;
-       regs->hi = (s64)(res >> 32);
+       regs->lo = (s64)(s32)rt;
+       regs->hi = (s64)(s32)(res >> 32);
 
        MIPS_R2_STATS(muls);
 
@@ -670,9 +670,9 @@ static int maddu_func(struct pt_regs *regs, u32 ir)
        res += ((((s64)rt) << 32) | (u32)rs);
 
        rt = res;
-       regs->lo = (s64)rt;
+       regs->lo = (s64)(s32)rt;
        rs = res >> 32;
-       regs->hi = (s64)rs;
+       regs->hi = (s64)(s32)rs;
 
        MIPS_R2_STATS(dsps);
 
@@ -728,9 +728,9 @@ static int msubu_func(struct pt_regs *regs, u32 ir)
        res = ((((s64)rt) << 32) | (u32)rs) - res;
 
        rt = res;
-       regs->lo = (s64)rt;
+       regs->lo = (s64)(s32)rt;
        rs = res >> 32;
-       regs->hi = (s64)rs;
+       regs->hi = (s64)(s32)rs;
 
        MIPS_R2_STATS(dsps);
 
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
deleted file mode 100644 (file)
index 93aeec7..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Export MIPS-specific functions needed for loadable modules.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1996, 97, 98, 99, 2000, 01, 03, 04, 05, 12 by Ralf Baechle
- * Copyright (C) 1999, 2000, 01 Silicon Graphics, Inc.
- */
-#include <linux/interrupt.h>
-#include <linux/export.h>
-#include <asm/checksum.h>
-#include <linux/mm.h>
-#include <linux/uaccess.h>
-#include <asm/ftrace.h>
-#include <asm/fpu.h>
-#include <asm/msa.h>
-
-extern void *__bzero_kernel(void *__s, size_t __count);
-extern void *__bzero(void *__s, size_t __count);
-extern long __strncpy_from_kernel_nocheck_asm(char *__to,
-                                             const char *__from, long __len);
-extern long __strncpy_from_kernel_asm(char *__to, const char *__from,
-                                     long __len);
-extern long __strncpy_from_user_nocheck_asm(char *__to,
-                                           const char *__from, long __len);
-extern long __strncpy_from_user_asm(char *__to, const char *__from,
-                                   long __len);
-extern long __strlen_kernel_asm(const char *s);
-extern long __strlen_user_asm(const char *s);
-extern long __strnlen_kernel_nocheck_asm(const char *s);
-extern long __strnlen_kernel_asm(const char *s);
-extern long __strnlen_user_nocheck_asm(const char *s);
-extern long __strnlen_user_asm(const char *s);
-
-/*
- * Core architecture code
- */
-EXPORT_SYMBOL_GPL(_save_fp);
-#ifdef CONFIG_CPU_HAS_MSA
-EXPORT_SYMBOL_GPL(_save_msa);
-#endif
-
-/*
- * String functions
- */
-EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(memcpy);
-EXPORT_SYMBOL(memmove);
-
-/*
- * Functions that operate on entire pages.  Mostly used by memory management.
- */
-EXPORT_SYMBOL(clear_page);
-EXPORT_SYMBOL(copy_page);
-
-/*
- * Userspace access stuff.
- */
-EXPORT_SYMBOL(__copy_user);
-EXPORT_SYMBOL(__copy_user_inatomic);
-#ifdef CONFIG_EVA
-EXPORT_SYMBOL(__copy_from_user_eva);
-EXPORT_SYMBOL(__copy_in_user_eva);
-EXPORT_SYMBOL(__copy_to_user_eva);
-EXPORT_SYMBOL(__copy_user_inatomic_eva);
-EXPORT_SYMBOL(__bzero_kernel);
-#endif
-EXPORT_SYMBOL(__bzero);
-EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm);
-EXPORT_SYMBOL(__strncpy_from_kernel_asm);
-EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm);
-EXPORT_SYMBOL(__strncpy_from_user_asm);
-EXPORT_SYMBOL(__strlen_kernel_asm);
-EXPORT_SYMBOL(__strlen_user_asm);
-EXPORT_SYMBOL(__strnlen_kernel_nocheck_asm);
-EXPORT_SYMBOL(__strnlen_kernel_asm);
-EXPORT_SYMBOL(__strnlen_user_nocheck_asm);
-EXPORT_SYMBOL(__strnlen_user_asm);
-
-#ifndef CONFIG_CPU_MIPSR6
-EXPORT_SYMBOL(csum_partial);
-EXPORT_SYMBOL(csum_partial_copy_nocheck);
-EXPORT_SYMBOL(__csum_partial_copy_kernel);
-EXPORT_SYMBOL(__csum_partial_copy_to_user);
-EXPORT_SYMBOL(__csum_partial_copy_from_user);
-#endif
-
-EXPORT_SYMBOL(invalid_pte_table);
-#ifdef CONFIG_FUNCTION_TRACER
-/* _mcount is defined in arch/mips/kernel/mcount.S */
-EXPORT_SYMBOL(_mcount);
-#endif
index d3ba9f4..8c35b31 100644 (file)
@@ -101,40 +101,31 @@ struct mips_pmu {
 
 static struct mips_pmu mipspmu;
 
-#define M_PERFCTL_EXL                  (1      <<  0)
-#define M_PERFCTL_KERNEL               (1      <<  1)
-#define M_PERFCTL_SUPERVISOR           (1      <<  2)
-#define M_PERFCTL_USER                 (1      <<  3)
-#define M_PERFCTL_INTERRUPT_ENABLE     (1      <<  4)
-#define M_PERFCTL_EVENT(event)         (((event) & 0x3ff)  << 5)
-#define M_PERFCTL_VPEID(vpe)           ((vpe)    << 16)
+#define M_PERFCTL_EVENT(event)         (((event) << MIPS_PERFCTRL_EVENT_S) & \
+                                        MIPS_PERFCTRL_EVENT)
+#define M_PERFCTL_VPEID(vpe)           ((vpe)    << MIPS_PERFCTRL_VPEID_S)
 
 #ifdef CONFIG_CPU_BMIPS5000
 #define M_PERFCTL_MT_EN(filter)                0
 #else /* !CONFIG_CPU_BMIPS5000 */
-#define M_PERFCTL_MT_EN(filter)                ((filter) << 20)
+#define M_PERFCTL_MT_EN(filter)                (filter)
 #endif /* CONFIG_CPU_BMIPS5000 */
 
-#define           M_TC_EN_ALL                  M_PERFCTL_MT_EN(0)
-#define           M_TC_EN_VPE                  M_PERFCTL_MT_EN(1)
-#define           M_TC_EN_TC                   M_PERFCTL_MT_EN(2)
-#define M_PERFCTL_TCID(tcid)           ((tcid)   << 22)
-#define M_PERFCTL_WIDE                 (1      << 30)
-#define M_PERFCTL_MORE                 (1      << 31)
-#define M_PERFCTL_TC                   (1      << 30)
+#define           M_TC_EN_ALL                  M_PERFCTL_MT_EN(MIPS_PERFCTRL_MT_EN_ALL)
+#define           M_TC_EN_VPE                  M_PERFCTL_MT_EN(MIPS_PERFCTRL_MT_EN_VPE)
+#define           M_TC_EN_TC                   M_PERFCTL_MT_EN(MIPS_PERFCTRL_MT_EN_TC)
 
-#define M_PERFCTL_COUNT_EVENT_WHENEVER (M_PERFCTL_EXL |                \
-                                       M_PERFCTL_KERNEL |              \
-                                       M_PERFCTL_USER |                \
-                                       M_PERFCTL_SUPERVISOR |          \
-                                       M_PERFCTL_INTERRUPT_ENABLE)
+#define M_PERFCTL_COUNT_EVENT_WHENEVER (MIPS_PERFCTRL_EXL |            \
+                                        MIPS_PERFCTRL_K |              \
+                                        MIPS_PERFCTRL_U |              \
+                                        MIPS_PERFCTRL_S |              \
+                                        MIPS_PERFCTRL_IE)
 
 #ifdef CONFIG_MIPS_MT_SMP
 #define M_PERFCTL_CONFIG_MASK          0x3fff801f
 #else
 #define M_PERFCTL_CONFIG_MASK          0x1f
 #endif
-#define M_PERFCTL_EVENT_MASK           0xfe0
 
 
 #ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
@@ -345,11 +336,11 @@ static void mipsxx_pmu_enable_event(struct hw_perf_event *evt, int idx)
        cpuc->saved_ctrl[idx] = M_PERFCTL_EVENT(evt->event_base & 0xff) |
                (evt->config_base & M_PERFCTL_CONFIG_MASK) |
                /* Make sure interrupt enabled. */
-               M_PERFCTL_INTERRUPT_ENABLE;
+               MIPS_PERFCTRL_IE;
        if (IS_ENABLED(CONFIG_CPU_BMIPS5000))
                /* enable the counter for the calling thread */
                cpuc->saved_ctrl[idx] |=
-                       (1 << (12 + vpe_id())) | M_PERFCTL_TC;
+                       (1 << (12 + vpe_id())) | BRCM_PERFCTRL_TC;
 
        /*
         * We do not actually let the counter run. Leave it until start().
@@ -754,11 +745,11 @@ static int __n_counters(void)
 {
        if (!cpu_has_perf)
                return 0;
-       if (!(read_c0_perfctrl0() & M_PERFCTL_MORE))
+       if (!(read_c0_perfctrl0() & MIPS_PERFCTRL_M))
                return 1;
-       if (!(read_c0_perfctrl1() & M_PERFCTL_MORE))
+       if (!(read_c0_perfctrl1() & MIPS_PERFCTRL_M))
                return 2;
-       if (!(read_c0_perfctrl2() & M_PERFCTL_MORE))
+       if (!(read_c0_perfctrl2() & MIPS_PERFCTRL_M))
                return 3;
 
        return 4;
@@ -1339,7 +1330,7 @@ static int __hw_perf_event_init(struct perf_event *event)
         * We allow max flexibility on how each individual counter shared
         * by the single CPU operates (the mode exclusion and the range).
         */
-       hwc->config_base = M_PERFCTL_INTERRUPT_ENABLE;
+       hwc->config_base = MIPS_PERFCTRL_IE;
 
        /* Calculate range bits and validate it. */
        if (num_possible_cpus() > 1)
@@ -1350,14 +1341,14 @@ static int __hw_perf_event_init(struct perf_event *event)
                mutex_unlock(&raw_event_mutex);
 
        if (!attr->exclude_user)
-               hwc->config_base |= M_PERFCTL_USER;
+               hwc->config_base |= MIPS_PERFCTRL_U;
        if (!attr->exclude_kernel) {
-               hwc->config_base |= M_PERFCTL_KERNEL;
+               hwc->config_base |= MIPS_PERFCTRL_K;
                /* MIPS kernel mode: KSU == 00b || EXL == 1 || ERL == 1 */
-               hwc->config_base |= M_PERFCTL_EXL;
+               hwc->config_base |= MIPS_PERFCTRL_EXL;
        }
        if (!attr->exclude_hv)
-               hwc->config_base |= M_PERFCTL_SUPERVISOR;
+               hwc->config_base |= MIPS_PERFCTRL_S;
 
        hwc->config_base &= M_PERFCTL_CONFIG_MASK;
        /*
@@ -1830,7 +1821,7 @@ init_hw_perf_events(void)
        mipspmu.num_counters = counters;
        mipspmu.irq = irq;
 
-       if (read_c0_perfctrl0() & M_PERFCTL_WIDE) {
+       if (read_c0_perfctrl0() & MIPS_PERFCTRL_W) {
                mipspmu.max_period = (1ULL << 63) - 1;
                mipspmu.valid_count = (1ULL << 63) - 1;
                mipspmu.overflow = 1ULL << 63;
index 5142b1d..803e255 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/dsemul.h>
 #include <asm/dsp.h>
 #include <asm/fpu.h>
+#include <asm/irq.h>
 #include <asm/msa.h>
 #include <asm/pgtable.h>
 #include <asm/mipsregs.h>
@@ -49,9 +50,7 @@
 #ifdef CONFIG_HOTPLUG_CPU
 void arch_cpu_idle_dead(void)
 {
-       /* What the heck is this check doing ? */
-       if (!cpumask_test_cpu(smp_processor_id(), &cpu_callin_map))
-               play_dead();
+       play_dead();
 }
 #endif
 
@@ -195,11 +194,9 @@ struct mips_frame_info {
 #define J_TARGET(pc,target)    \
                (((unsigned long)(pc) & 0xf0000000) | ((target) << 2))
 
-static inline int is_ra_save_ins(union mips_instruction *ip)
+static inline int is_ra_save_ins(union mips_instruction *ip, int *poff)
 {
 #ifdef CONFIG_CPU_MICROMIPS
-       union mips_instruction mmi;
-
        /*
         * swsp ra,offset
         * swm16 reglist,offset(sp)
@@ -209,29 +206,71 @@ static inline int is_ra_save_ins(union mips_instruction *ip)
         *
         * microMIPS is way more fun...
         */
-       if (mm_insn_16bit(ip->halfword[0])) {
-               mmi.word = (ip->halfword[0] << 16);
-               return (mmi.mm16_r5_format.opcode == mm_swsp16_op &&
-                       mmi.mm16_r5_format.rt == 31) ||
-                      (mmi.mm16_m_format.opcode == mm_pool16c_op &&
-                       mmi.mm16_m_format.func == mm_swm16_op);
+       if (mm_insn_16bit(ip->halfword[1])) {
+               switch (ip->mm16_r5_format.opcode) {
+               case mm_swsp16_op:
+                       if (ip->mm16_r5_format.rt != 31)
+                               return 0;
+
+                       *poff = ip->mm16_r5_format.simmediate;
+                       *poff = (*poff << 2) / sizeof(ulong);
+                       return 1;
+
+               case mm_pool16c_op:
+                       switch (ip->mm16_m_format.func) {
+                       case mm_swm16_op:
+                               *poff = ip->mm16_m_format.imm;
+                               *poff += 1 + ip->mm16_m_format.rlist;
+                               *poff = (*poff << 2) / sizeof(ulong);
+                               return 1;
+
+                       default:
+                               return 0;
+                       }
+
+               default:
+                       return 0;
+               }
        }
-       else {
-               mmi.halfword[0] = ip->halfword[1];
-               mmi.halfword[1] = ip->halfword[0];
-               return (mmi.mm_m_format.opcode == mm_pool32b_op &&
-                       mmi.mm_m_format.rd > 9 &&
-                       mmi.mm_m_format.base == 29 &&
-                       mmi.mm_m_format.func == mm_swm32_func) ||
-                      (mmi.i_format.opcode == mm_sw32_op &&
-                       mmi.i_format.rs == 29 &&
-                       mmi.i_format.rt == 31);
+
+       switch (ip->i_format.opcode) {
+       case mm_sw32_op:
+               if (ip->i_format.rs != 29)
+                       return 0;
+               if (ip->i_format.rt != 31)
+                       return 0;
+
+               *poff = ip->i_format.simmediate / sizeof(ulong);
+               return 1;
+
+       case mm_pool32b_op:
+               switch (ip->mm_m_format.func) {
+               case mm_swm32_func:
+                       if (ip->mm_m_format.rd < 0x10)
+                               return 0;
+                       if (ip->mm_m_format.base != 29)
+                               return 0;
+
+                       *poff = ip->mm_m_format.simmediate;
+                       *poff += (ip->mm_m_format.rd & 0xf) * sizeof(u32);
+                       *poff /= sizeof(ulong);
+                       return 1;
+               default:
+                       return 0;
+               }
+
+       default:
+               return 0;
        }
 #else
        /* sw / sd $ra, offset($sp) */
-       return (ip->i_format.opcode == sw_op || ip->i_format.opcode == sd_op) &&
-               ip->i_format.rs == 29 &&
-               ip->i_format.rt == 31;
+       if ((ip->i_format.opcode == sw_op || ip->i_format.opcode == sd_op) &&
+               ip->i_format.rs == 29 && ip->i_format.rt == 31) {
+               *poff = ip->i_format.simmediate / sizeof(ulong);
+               return 1;
+       }
+
+       return 0;
 #endif
 }
 
@@ -246,13 +285,16 @@ static inline int is_jump_ins(union mips_instruction *ip)
         *
         * microMIPS is kind of more fun...
         */
-       union mips_instruction mmi;
-
-       mmi.word = (ip->halfword[0] << 16);
+       if (mm_insn_16bit(ip->halfword[1])) {
+               if ((ip->mm16_r5_format.opcode == mm_pool16c_op &&
+                   (ip->mm16_r5_format.rt & mm_jr16_op) == mm_jr16_op))
+                       return 1;
+               return 0;
+       }
 
-       if ((mmi.mm16_r5_format.opcode == mm_pool16c_op &&
-           (mmi.mm16_r5_format.rt & mm_jr16_op) == mm_jr16_op) ||
-           ip->j_format.opcode == mm_jal32_op)
+       if (ip->j_format.opcode == mm_j32_op)
+               return 1;
+       if (ip->j_format.opcode == mm_jal32_op)
                return 1;
        if (ip->r_format.opcode != mm_pool32a_op ||
                        ip->r_format.func != mm_pool32axf_op)
@@ -280,15 +322,13 @@ static inline int is_sp_move_ins(union mips_instruction *ip)
         *
         * microMIPS is not more fun...
         */
-       if (mm_insn_16bit(ip->halfword[0])) {
-               union mips_instruction mmi;
-
-               mmi.word = (ip->halfword[0] << 16);
-               return (mmi.mm16_r3_format.opcode == mm_pool16d_op &&
-                       mmi.mm16_r3_format.simmediate && mm_addiusp_func) ||
-                      (mmi.mm16_r5_format.opcode == mm_pool16d_op &&
-                       mmi.mm16_r5_format.rt == 29);
+       if (mm_insn_16bit(ip->halfword[1])) {
+               return (ip->mm16_r3_format.opcode == mm_pool16d_op &&
+                       ip->mm16_r3_format.simmediate && mm_addiusp_func) ||
+                      (ip->mm16_r5_format.opcode == mm_pool16d_op &&
+                       ip->mm16_r5_format.rt == 29);
        }
+
        return ip->mm_i_format.opcode == mm_addiu32_op &&
               ip->mm_i_format.rt == 29 && ip->mm_i_format.rs == 29;
 #else
@@ -303,30 +343,36 @@ static inline int is_sp_move_ins(union mips_instruction *ip)
 
 static int get_frame_info(struct mips_frame_info *info)
 {
-#ifdef CONFIG_CPU_MICROMIPS
-       union mips_instruction *ip = (void *) (((char *) info->func) - 1);
-#else
-       union mips_instruction *ip = info->func;
-#endif
-       unsigned max_insns = info->func_size / sizeof(union mips_instruction);
-       unsigned i;
+       bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS);
+       union mips_instruction insn, *ip, *ip_end;
+       const unsigned int max_insns = 128;
+       unsigned int i;
 
        info->pc_offset = -1;
        info->frame_size = 0;
 
+       ip = (void *)msk_isa16_mode((ulong)info->func);
        if (!ip)
                goto err;
 
-       if (max_insns == 0)
-               max_insns = 128U;       /* unknown function size */
-       max_insns = min(128U, max_insns);
+       ip_end = (void *)ip + info->func_size;
 
-       for (i = 0; i < max_insns; i++, ip++) {
+       for (i = 0; i < max_insns && ip < ip_end; i++, ip++) {
+               if (is_mmips && mm_insn_16bit(ip->halfword[0])) {
+                       insn.halfword[0] = 0;
+                       insn.halfword[1] = ip->halfword[0];
+               } else if (is_mmips) {
+                       insn.halfword[0] = ip->halfword[1];
+                       insn.halfword[1] = ip->halfword[0];
+               } else {
+                       insn.word = ip->word;
+               }
 
-               if (is_jump_ins(ip))
+               if (is_jump_ins(&insn))
                        break;
+
                if (!info->frame_size) {
-                       if (is_sp_move_ins(ip))
+                       if (is_sp_move_ins(&insn))
                        {
 #ifdef CONFIG_CPU_MICROMIPS
                                if (mm_insn_16bit(ip->halfword[0]))
@@ -349,11 +395,9 @@ static int get_frame_info(struct mips_frame_info *info)
                        }
                        continue;
                }
-               if (info->pc_offset == -1 && is_ra_save_ins(ip)) {
-                       info->pc_offset =
-                               ip->i_format.simmediate / sizeof(long);
+               if (info->pc_offset == -1 &&
+                   is_ra_save_ins(&insn, &info->pc_offset))
                        break;
-               }
        }
        if (info->frame_size && info->pc_offset >= 0) /* nested */
                return 0;
@@ -511,7 +555,19 @@ EXPORT_SYMBOL(unwind_stack_by_address);
 unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
                           unsigned long pc, unsigned long *ra)
 {
-       unsigned long stack_page = (unsigned long)task_stack_page(task);
+       unsigned long stack_page = 0;
+       int cpu;
+
+       for_each_possible_cpu(cpu) {
+               if (on_irq_stack(cpu, *sp)) {
+                       stack_page = (unsigned long)irq_stack[cpu];
+                       break;
+               }
+       }
+
+       if (!stack_page)
+               stack_page = (unsigned long)task_stack_page(task);
+
        return unwind_stack_by_address(stack_page, sp, pc, ra);
 }
 #endif
@@ -673,3 +729,47 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
 
        return 0;
 }
+
+#if defined(CONFIG_32BIT) || defined(CONFIG_MIPS32_O32)
+void mips_dump_regs32(u32 *uregs, const struct pt_regs *regs)
+{
+       unsigned int i;
+
+       for (i = MIPS32_EF_R1; i <= MIPS32_EF_R31; i++) {
+               /* k0/k1 are copied as zero. */
+               if (i == MIPS32_EF_R26 || i == MIPS32_EF_R27)
+                       uregs[i] = 0;
+               else
+                       uregs[i] = regs->regs[i - MIPS32_EF_R0];
+       }
+
+       uregs[MIPS32_EF_LO] = regs->lo;
+       uregs[MIPS32_EF_HI] = regs->hi;
+       uregs[MIPS32_EF_CP0_EPC] = regs->cp0_epc;
+       uregs[MIPS32_EF_CP0_BADVADDR] = regs->cp0_badvaddr;
+       uregs[MIPS32_EF_CP0_STATUS] = regs->cp0_status;
+       uregs[MIPS32_EF_CP0_CAUSE] = regs->cp0_cause;
+}
+#endif /* CONFIG_32BIT || CONFIG_MIPS32_O32 */
+
+#ifdef CONFIG_64BIT
+void mips_dump_regs64(u64 *uregs, const struct pt_regs *regs)
+{
+       unsigned int i;
+
+       for (i = MIPS64_EF_R1; i <= MIPS64_EF_R31; i++) {
+               /* k0/k1 are copied as zero. */
+               if (i == MIPS64_EF_R26 || i == MIPS64_EF_R27)
+                       uregs[i] = 0;
+               else
+                       uregs[i] = regs->regs[i - MIPS64_EF_R0];
+       }
+
+       uregs[MIPS64_EF_LO] = regs->lo;
+       uregs[MIPS64_EF_HI] = regs->hi;
+       uregs[MIPS64_EF_CP0_EPC] = regs->cp0_epc;
+       uregs[MIPS64_EF_CP0_BADVADDR] = regs->cp0_badvaddr;
+       uregs[MIPS64_EF_CP0_STATUS] = regs->cp0_status;
+       uregs[MIPS64_EF_CP0_CAUSE] = regs->cp0_cause;
+}
+#endif /* CONFIG_64BIT */
index 5fcec30..0dbcd15 100644 (file)
@@ -49,6 +49,13 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
        return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
 }
 
+int __init early_init_dt_reserve_memory_arch(phys_addr_t base,
+                                       phys_addr_t size, bool nomap)
+{
+       add_memory_region(base, size, BOOT_MEM_RESERVED);
+       return 0;
+}
+
 void __init __dt_setup_arch(void *bph)
 {
        if (!early_init_dt_scan(bph))
index c8ba260..fdef263 100644 (file)
@@ -294,23 +294,8 @@ static int gpr32_get(struct task_struct *target,
 {
        struct pt_regs *regs = task_pt_regs(target);
        u32 uregs[ELF_NGREG] = {};
-       unsigned i;
-
-       for (i = MIPS32_EF_R1; i <= MIPS32_EF_R31; i++) {
-               /* k0/k1 are copied as zero. */
-               if (i == MIPS32_EF_R26 || i == MIPS32_EF_R27)
-                       continue;
-
-               uregs[i] = regs->regs[i - MIPS32_EF_R0];
-       }
-
-       uregs[MIPS32_EF_LO] = regs->lo;
-       uregs[MIPS32_EF_HI] = regs->hi;
-       uregs[MIPS32_EF_CP0_EPC] = regs->cp0_epc;
-       uregs[MIPS32_EF_CP0_BADVADDR] = regs->cp0_badvaddr;
-       uregs[MIPS32_EF_CP0_STATUS] = regs->cp0_status;
-       uregs[MIPS32_EF_CP0_CAUSE] = regs->cp0_cause;
 
+       mips_dump_regs32(uregs, regs);
        return user_regset_copyout(&pos, &count, &kbuf, &ubuf, uregs, 0,
                                   sizeof(uregs));
 }
@@ -373,23 +358,8 @@ static int gpr64_get(struct task_struct *target,
 {
        struct pt_regs *regs = task_pt_regs(target);
        u64 uregs[ELF_NGREG] = {};
-       unsigned i;
-
-       for (i = MIPS64_EF_R1; i <= MIPS64_EF_R31; i++) {
-               /* k0/k1 are copied as zero. */
-               if (i == MIPS64_EF_R26 || i == MIPS64_EF_R27)
-                       continue;
-
-               uregs[i] = regs->regs[i - MIPS64_EF_R0];
-       }
-
-       uregs[MIPS64_EF_LO] = regs->lo;
-       uregs[MIPS64_EF_HI] = regs->hi;
-       uregs[MIPS64_EF_CP0_EPC] = regs->cp0_epc;
-       uregs[MIPS64_EF_CP0_BADVADDR] = regs->cp0_badvaddr;
-       uregs[MIPS64_EF_CP0_STATUS] = regs->cp0_status;
-       uregs[MIPS64_EF_CP0_CAUSE] = regs->cp0_cause;
 
+       mips_dump_regs64(uregs, regs);
        return user_regset_copyout(&pos, &count, &kbuf, &ubuf, uregs, 0,
                                   sizeof(uregs));
 }
index ac27ef7..1049eea 100644 (file)
@@ -12,6 +12,7 @@
  */
 #include <asm/asm.h>
 #include <asm/cachectl.h>
+#include <asm/export.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
 #include <asm/asm-offsets.h>
@@ -72,6 +73,7 @@ LEAF(resume)
  * Save a thread's fp context.
  */
 LEAF(_save_fp)
+EXPORT_SYMBOL(_save_fp)
        fpu_save_single a0, t1                  # clobbers t1
        jr      ra
        END(_save_fp)
index 2f0a3b2..7585778 100644 (file)
@@ -12,6 +12,7 @@
  */
 #include <asm/asm.h>
 #include <asm/cachectl.h>
+#include <asm/export.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
 #include <asm/asm-offsets.h>
@@ -75,6 +76,7 @@
  * Save a thread's fp context.
  */
 LEAF(_save_fp)
+EXPORT_SYMBOL(_save_fp)
 #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \
                defined(CONFIG_CPU_MIPS32_R6)
        mfc0    t0, CP0_STATUS
@@ -101,6 +103,7 @@ LEAF(_restore_fp)
  * Save a thread's MSA vector context.
  */
 LEAF(_save_msa)
+EXPORT_SYMBOL(_save_msa)
        msa_save_all    a0
        jr      ra
        END(_save_msa)
index 1958910..9103beb 100644 (file)
@@ -31,6 +31,18 @@ extern u32 _relocation_end[];        /* End relocation table */
 extern long __start___ex_table;        /* Start exception table */
 extern long __stop___ex_table; /* End exception table */
 
+extern void __weak plat_fdt_relocated(void *new_location);
+
+/*
+ * This function may be defined for a platform to perform any post-relocation
+ * fixup necessary.
+ * Return non-zero to abort relocation
+ */
+int __weak plat_post_relocation(long offset)
+{
+       return 0;
+}
+
 static inline u32 __init get_synci_step(void)
 {
        u32 res;
@@ -291,12 +303,14 @@ void *__init relocate_kernel(void)
        int res = 1;
        /* Default to original kernel entry point */
        void *kernel_entry = start_kernel;
+       void *fdt = NULL;
 
        /* Get the command line */
        fw_init_cmdline();
 #if defined(CONFIG_USE_OF)
        /* Deal with the device tree */
-       early_init_dt_scan(plat_get_fdt());
+       fdt = plat_get_fdt();
+       early_init_dt_scan(fdt);
        if (boot_command_line[0]) {
                /* Boot command line was passed in device tree */
                strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
@@ -316,6 +330,29 @@ void *__init relocate_kernel(void)
        arcs_cmdline[0] = '\0';
 
        if (offset) {
+               void (*fdt_relocated_)(void *) = NULL;
+#if defined(CONFIG_USE_OF)
+               unsigned long fdt_phys = virt_to_phys(fdt);
+
+               /*
+                * If built-in dtb is used then it will have been relocated
+                * during kernel _text relocation. If appended DTB is used
+                * then it will not be relocated, but it should remain
+                * intact in the original location. If dtb is loaded by
+                * the bootloader then it may need to be moved if it crosses
+                * the target memory area
+                */
+
+               if (fdt_phys >= virt_to_phys(RELOCATED(&_text)) &&
+                       fdt_phys <= virt_to_phys(RELOCATED(&_end))) {
+                       void *fdt_relocated =
+                               RELOCATED(ALIGN((long)&_end, PAGE_SIZE));
+                       memcpy(fdt_relocated, fdt, fdt_totalsize(fdt));
+                       fdt = fdt_relocated;
+                       fdt_relocated_ = RELOCATED(&plat_fdt_relocated);
+               }
+#endif /* CONFIG_USE_OF */
+
                /* Copy the kernel to it's new location */
                memcpy(loc_new, &_text, kernel_length);
 
@@ -338,6 +375,23 @@ void *__init relocate_kernel(void)
                 */
                memcpy(RELOCATED(&__bss_start), &__bss_start, bss_length);
 
+               /*
+                * If fdt was stored outside of the kernel image and
+                * had to be moved then update platform's state data
+                * with the new fdt location
+                */
+               if (fdt_relocated_)
+                       fdt_relocated_(fdt);
+
+               /*
+                * Last chance for the platform to abort relocation.
+                * This may also be used by the platform to perform any
+                * initialisation required now that the new kernel is
+                * resident in memory and ready to be executed.
+                */
+               if (plat_post_relocation(offset))
+                       goto out;
+
                /* The current thread is now within the relocated image */
                __current_thread_info = RELOCATED(&init_thread_union);
 
index f66e5ce..01d1dbd 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/device.h>
 #include <linux/dma-contiguous.h>
 #include <linux/decompress/generic.h>
+#include <linux/of_fdt.h>
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
@@ -153,6 +154,35 @@ void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_add
        add_memory_region(start, size, BOOT_MEM_RAM);
 }
 
+bool __init memory_region_available(phys_addr_t start, phys_addr_t size)
+{
+       int i;
+       bool in_ram = false, free = true;
+
+       for (i = 0; i < boot_mem_map.nr_map; i++) {
+               phys_addr_t start_, end_;
+
+               start_ = boot_mem_map.map[i].addr;
+               end_ = boot_mem_map.map[i].addr + boot_mem_map.map[i].size;
+
+               switch (boot_mem_map.map[i].type) {
+               case BOOT_MEM_RAM:
+                       if (start >= start_ && start + size <= end_)
+                               in_ram = true;
+                       break;
+               case BOOT_MEM_RESERVED:
+                       if ((start >= start_ && start < end_) ||
+                           (start < start_ && start + size >= start_))
+                               free = false;
+                       break;
+               default:
+                       continue;
+               }
+       }
+
+       return in_ram && free;
+}
+
 static void __init print_memory_map(void)
 {
        int i;
@@ -332,11 +362,19 @@ static void __init bootmem_init(void)
 
 #else  /* !CONFIG_SGI_IP27 */
 
+static unsigned long __init bootmap_bytes(unsigned long pages)
+{
+       unsigned long bytes = DIV_ROUND_UP(pages, 8);
+
+       return ALIGN(bytes, sizeof(long));
+}
+
 static void __init bootmem_init(void)
 {
        unsigned long reserved_end;
        unsigned long mapstart = ~0UL;
        unsigned long bootmap_size;
+       bool bootmap_valid = false;
        int i;
 
        /*
@@ -430,11 +468,42 @@ static void __init bootmem_init(void)
 #endif
 
        /*
-        * Initialize the boot-time allocator with low memory only.
+        * check that mapstart doesn't overlap with any of
+        * memory regions that have been reserved through eg. DTB
         */
-       bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart,
-                                        min_low_pfn, max_low_pfn);
+       bootmap_size = bootmap_bytes(max_low_pfn - min_low_pfn);
 
+       bootmap_valid = memory_region_available(PFN_PHYS(mapstart),
+                                               bootmap_size);
+       for (i = 0; i < boot_mem_map.nr_map && !bootmap_valid; i++) {
+               unsigned long mapstart_addr;
+
+               switch (boot_mem_map.map[i].type) {
+               case BOOT_MEM_RESERVED:
+                       mapstart_addr = PFN_ALIGN(boot_mem_map.map[i].addr +
+                                               boot_mem_map.map[i].size);
+                       if (PHYS_PFN(mapstart_addr) < mapstart)
+                               break;
+
+                       bootmap_valid = memory_region_available(mapstart_addr,
+                                                               bootmap_size);
+                       if (bootmap_valid)
+                               mapstart = PHYS_PFN(mapstart_addr);
+                       break;
+               default:
+                       break;
+               }
+       }
+
+       if (!bootmap_valid)
+               panic("No memory area to place a bootmap bitmap");
+
+       /*
+        * Initialize the boot-time allocator with low memory only.
+        */
+       if (bootmap_size != init_bootmem_node(NODE_DATA(0), mapstart,
+                                        min_low_pfn, max_low_pfn))
+               panic("Unexpected memory size required for bootmap");
 
        for (i = 0; i < boot_mem_map.nr_map; i++) {
                unsigned long start, end;
@@ -483,6 +552,10 @@ static void __init bootmem_init(void)
                        continue;
                default:
                        /* Not usable memory */
+                       if (start > min_low_pfn && end < max_low_pfn)
+                               reserve_bootmem(boot_mem_map.map[i].addr,
+                                               boot_mem_map.map[i].size,
+                                               BOOTMEM_DEFAULT);
                        continue;
                }
 
@@ -589,6 +662,10 @@ static int __init early_parse_mem(char *p)
                start = memparse(p + 1, &p);
 
        add_memory_region(start, size, BOOT_MEM_RAM);
+
+       if (start && start > PHYS_OFFSET)
+               add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
+                               BOOT_MEM_RESERVED);
        return 0;
 }
 early_param("mem", early_parse_mem);
@@ -664,6 +741,11 @@ static void __init mips_parse_crashkernel(void)
        if (ret != 0 || crash_size <= 0)
                return;
 
+       if (!memory_region_available(crash_base, crash_size)) {
+               pr_warn("Invalid memory region reserved for crash kernel\n");
+               return;
+       }
+
        crashk_res.start = crash_base;
        crashk_res.end   = crash_base + crash_size - 1;
 }
@@ -672,6 +754,9 @@ static void __init request_crashkernel(struct resource *res)
 {
        int ret;
 
+       if (crashk_res.start == crashk_res.end)
+               return;
+
        ret = request_resource(res, &crashk_res);
        if (!ret)
                pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n",
@@ -757,6 +842,9 @@ static void __init arch_mem_init(char **cmdline_p)
                print_memory_map();
        }
 
+       early_init_fdt_reserve_self();
+       early_init_fdt_scan_reserved_mem();
+
        bootmem_init();
 #ifdef CONFIG_PROC_VMCORE
        if (setup_elfcorehdr && setup_elfcorehdr_size) {
index 6d0f132..16e37a2 100644 (file)
@@ -364,7 +364,7 @@ static int bmips_cpu_disable(void)
 
        set_cpu_online(cpu, false);
        calculate_cpu_foreign_map();
-       cpumask_clear_cpu(cpu, &cpu_callin_map);
+       irq_cpu_offline();
        clear_c0_status(IE_IRQ5);
 
        local_flush_tlb_all();
index 6183ad8..a2544c2 100644 (file)
@@ -326,7 +326,11 @@ static void cps_boot_secondary(int cpu, struct task_struct *idle)
                        if (cpu_online(remote))
                                break;
                }
-               BUG_ON(remote >= NR_CPUS);
+               if (remote >= NR_CPUS) {
+                       pr_crit("No online CPU in core %u to start CPU%d\n",
+                               core, cpu);
+                       goto out;
+               }
 
                err = smp_call_function_single(remote, remote_vpe_boot,
                                               NULL, 1);
@@ -399,7 +403,6 @@ static int cps_cpu_disable(void)
        smp_mb__after_atomic();
        set_cpu_online(cpu, false);
        calculate_cpu_foreign_map();
-       cpumask_clear_cpu(cpu, &cpu_callin_map);
 
        return 0;
 }
index 7ebb191..8c60a29 100644 (file)
@@ -48,8 +48,6 @@
 #include <asm/setup.h>
 #include <asm/maar.h>
 
-cpumask_t cpu_callin_map;              /* Bitmask of started secondaries */
-
 int __cpu_number_map[NR_CPUS];         /* Map physical to logical */
 EXPORT_SYMBOL(__cpu_number_map);
 
@@ -68,6 +66,8 @@ EXPORT_SYMBOL(cpu_sibling_map);
 cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
 EXPORT_SYMBOL(cpu_core_map);
 
+static DECLARE_COMPLETION(cpu_running);
+
 /*
  * A logcal cpu mask containing only one VPE per core to
  * reduce the number of IPIs on large MT systems.
@@ -369,7 +369,7 @@ asmlinkage void start_secondary(void)
        cpumask_set_cpu(cpu, &cpu_coherent_mask);
        notify_cpu_starting(cpu);
 
-       cpumask_set_cpu(cpu, &cpu_callin_map);
+       complete(&cpu_running);
        synchronise_count_slave(cpu);
 
        set_cpu_online(cpu, true);
@@ -430,7 +430,6 @@ void smp_prepare_boot_cpu(void)
 {
        set_cpu_possible(0, true);
        set_cpu_online(0, true);
-       cpumask_set_cpu(0, &cpu_callin_map);
 }
 
 int __cpu_up(unsigned int cpu, struct task_struct *tidle)
@@ -438,11 +437,13 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
        mp_ops->boot_secondary(cpu, tidle);
 
        /*
-        * Trust is futile.  We should really have timeouts ...
+        * We must check for timeout here, as the CPU will not be marked
+        * online until the counters are synchronised.
         */
-       while (!cpumask_test_cpu(cpu, &cpu_callin_map)) {
-               udelay(100);
-               schedule();
+       if (!wait_for_completion_timeout(&cpu_running,
+                                        msecs_to_jiffies(1000))) {
+               pr_crit("CPU%u: failed to start\n", cpu);
+               return -EIO;
        }
 
        synchronise_count_master(cpu);
@@ -637,23 +638,6 @@ void flush_tlb_one(unsigned long vaddr)
 EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL(flush_tlb_one);
 
-#if defined(CONFIG_KEXEC)
-void (*dump_ipi_function_ptr)(void *) = NULL;
-void dump_send_ipi(void (*dump_ipi_callback)(void *))
-{
-       int i;
-       int cpu = smp_processor_id();
-
-       dump_ipi_function_ptr = dump_ipi_callback;
-       smp_mb();
-       for_each_online_cpu(i)
-               if (i != cpu)
-                       mp_ops->send_ipi_single(i, SMP_DUMP);
-
-}
-EXPORT_SYMBOL(dump_send_ipi);
-#endif
-
 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
 
 static DEFINE_PER_CPU(atomic_t, tick_broadcast_count);
index 4472a7f..1df1160 100644 (file)
@@ -29,7 +29,7 @@ void synchronise_count_master(int cpu)
        int i;
        unsigned long flags;
 
-       printk(KERN_INFO "Synchronize counters for CPU %u: ", cpu);
+       pr_info("Synchronize counters for CPU %u: ", cpu);
 
        local_irq_save(flags);
 
@@ -83,7 +83,7 @@ void synchronise_count_master(int cpu)
         * count registers were almost certainly out of sync
         * so no point in alarming people
         */
-       printk("done.\n");
+       pr_cont("done.\n");
 }
 
 void synchronise_count_slave(int cpu)
index 833f822..c86ddba 100644 (file)
@@ -36,7 +36,6 @@
 #include <asm/sim.h>
 #include <asm/shmparam.h>
 #include <asm/sysmips.h>
-#include <linux/uaccess.h>
 #include <asm/switch_to.h>
 
 /*
@@ -60,16 +59,9 @@ SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
        unsigned long, prot, unsigned long, flags, unsigned long,
        fd, off_t, offset)
 {
-       unsigned long result;
-
-       result = -EINVAL;
        if (offset & ~PAGE_MASK)
-               goto out;
-
-       result = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
-
-out:
-       return result;
+               return -EINVAL;
+       return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
 }
 
 SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
index 6c7f9d7..cb479be 100644 (file)
@@ -51,6 +51,7 @@
 #include <asm/idle.h>
 #include <asm/mips-cm.h>
 #include <asm/mips-r2-to-r6-emul.h>
+#include <asm/mips-cm.h>
 #include <asm/mipsregs.h>
 #include <asm/mipsmtregs.h>
 #include <asm/module.h>
@@ -1107,7 +1108,6 @@ asmlinkage void do_ri(struct pt_regs *regs)
                switch (status) {
                case 0:
                case SIGEMT:
-                       task_thread_info(current)->r2_emul_return = 1;
                        return;
                case SIGILL:
                        goto no_r2_instr;
@@ -1115,7 +1115,6 @@ asmlinkage void do_ri(struct pt_regs *regs)
                        process_fpemu_return(status,
                                             &current->thread.cp0_baduaddr,
                                             fcr31);
-                       task_thread_info(current)->r2_emul_return = 1;
                        return;
                }
        }
@@ -1644,6 +1643,65 @@ __setup("nol2par", nol2parity);
  */
 static inline void parity_protection_init(void)
 {
+#define ERRCTL_PE      0x80000000
+#define ERRCTL_L2P     0x00800000
+
+       if (mips_cm_revision() >= CM_REV_CM3) {
+               ulong gcr_ectl, cp0_ectl;
+
+               /*
+                * With CM3 systems we need to ensure that the L1 & L2
+                * parity enables are set to the same value, since this
+                * is presumed by the hardware engineers.
+                *
+                * If the user disabled either of L1 or L2 ECC checking,
+                * disable both.
+                */
+               l1parity &= l2parity;
+               l2parity &= l1parity;
+
+               /* Probe L1 ECC support */
+               cp0_ectl = read_c0_ecc();
+               write_c0_ecc(cp0_ectl | ERRCTL_PE);
+               back_to_back_c0_hazard();
+               cp0_ectl = read_c0_ecc();
+
+               /* Probe L2 ECC support */
+               gcr_ectl = read_gcr_err_control();
+
+               if (!(gcr_ectl & CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK) ||
+                   !(cp0_ectl & ERRCTL_PE)) {
+                       /*
+                        * One of L1 or L2 ECC checking isn't supported,
+                        * so we cannot enable either.
+                        */
+                       l1parity = l2parity = 0;
+               }
+
+               /* Configure L1 ECC checking */
+               if (l1parity)
+                       cp0_ectl |= ERRCTL_PE;
+               else
+                       cp0_ectl &= ~ERRCTL_PE;
+               write_c0_ecc(cp0_ectl);
+               back_to_back_c0_hazard();
+               WARN_ON(!!(read_c0_ecc() & ERRCTL_PE) != l1parity);
+
+               /* Configure L2 ECC checking */
+               if (l2parity)
+                       gcr_ectl |= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK;
+               else
+                       gcr_ectl &= ~CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK;
+               write_gcr_err_control(gcr_ectl);
+               gcr_ectl = read_gcr_err_control();
+               gcr_ectl &= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK;
+               WARN_ON(!!gcr_ectl != l2parity);
+
+               pr_info("Cache parity protection %sabled\n",
+                       l1parity ? "en" : "dis");
+               return;
+       }
+
        switch (current_cpu_type()) {
        case CPU_24K:
        case CPU_34K:
@@ -1654,11 +1712,8 @@ static inline void parity_protection_init(void)
        case CPU_PROAPTIV:
        case CPU_P5600:
        case CPU_QEMU_GENERIC:
-       case CPU_I6400:
        case CPU_P6600:
                {
-#define ERRCTL_PE      0x80000000
-#define ERRCTL_L2P     0x00800000
                        unsigned long errctl;
                        unsigned int l1parity_present, l2parity_present;
 
index dbb9174..e99e3fa 100644 (file)
@@ -226,7 +226,7 @@ int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm,
        return uprobe_write_opcode(mm, vaddr, UPROBE_SWBP_INSN);
 }
 
-void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
+void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
                                  void *src, unsigned long len)
 {
        unsigned long kaddr, kstart;
index d5de675..f0a0e6d 100644 (file)
@@ -182,7 +182,7 @@ SECTIONS
         * Force .bss to 64K alignment so that .bss..swapper_pg_dir
         * gets that alignment.  .sbss should be empty, so there will be
         * no holes after __init_end. */
-       BSS_SECTION(0, 0x10000, 0)
+       BSS_SECTION(0, 0x10000, 8)
 
        _end = . ;
 
index 8ac0e59..0ddf369 100644 (file)
@@ -269,6 +269,11 @@ static void ltq_hw5_irqdispatch(void)
 DEFINE_HWx_IRQDISPATCH(5)
 #endif
 
+static void ltq_hw_irq_handler(struct irq_desc *desc)
+{
+       ltq_hw_irqdispatch(irq_desc_get_irq(desc) - 2);
+}
+
 #ifdef CONFIG_MIPS_MT_SMP
 void __init arch_init_ipiirq(int irq, struct irqaction *action)
 {
@@ -313,23 +318,19 @@ static struct irqaction irq_call = {
 asmlinkage void plat_irq_dispatch(void)
 {
        unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
-       unsigned int i;
-
-       if ((MIPS_CPU_TIMER_IRQ == 7) && (pending & CAUSEF_IP7)) {
-               do_IRQ(MIPS_CPU_TIMER_IRQ);
-               goto out;
-       } else {
-               for (i = 0; i < MAX_IM; i++) {
-                       if (pending & (CAUSEF_IP2 << i)) {
-                               ltq_hw_irqdispatch(i);
-                               goto out;
-                       }
-               }
+       int irq;
+
+       if (!pending) {
+               spurious_interrupt();
+               return;
        }
-       pr_alert("Spurious IRQ: CAUSE=0x%08x\n", read_c0_status());
 
-out:
-       return;
+       pending >>= CAUSEB_IP;
+       while (pending) {
+               irq = fls(pending) - 1;
+               do_IRQ(MIPS_CPU_IRQ_BASE + irq);
+               pending &= ~BIT(irq);
+       }
 }
 
 static int icu_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
@@ -354,11 +355,6 @@ static const struct irq_domain_ops irq_domain_ops = {
        .map = icu_map,
 };
 
-static struct irqaction cascade = {
-       .handler = no_action,
-       .name = "cascade",
-};
-
 int __init icu_of_init(struct device_node *node, struct device_node *parent)
 {
        struct device_node *eiu_node;
@@ -390,7 +386,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
        mips_cpu_irq_init();
 
        for (i = 0; i < MAX_IM; i++)
-               setup_irq(i + 2, &cascade);
+               irq_set_chained_handler(i + 2, ltq_hw_irq_handler);
 
        if (cpu_has_vint) {
                pr_info("Setting up vectored interrupts\n");
index 4cbb000..96773be 100644 (file)
@@ -26,6 +26,12 @@ DEFINE_SPINLOCK(ebu_lock);
 EXPORT_SYMBOL_GPL(ebu_lock);
 
 /*
+ * This is needed by the VPE loader code, just set it to 0 and assume
+ * that the firmware hardcodes this value to something useful.
+ */
+unsigned long physical_memsize = 0L;
+
+/*
  * this struct is filled by the soc specific detection code and holds
  * information about the specific soc type, revision and name
  */
index cef8117..805b3a6 100644 (file)
@@ -19,7 +19,8 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/dma-mapping.h>
-#include <linux/module.h>
+#include <linux/export.h>
+#include <linux/spinlock.h>
 #include <linux/clk.h>
 #include <linux/err.h>
 
                                                ltq_dma_membase + (z))
 
 static void __iomem *ltq_dma_membase;
+static DEFINE_SPINLOCK(ltq_dma_lock);
 
 void
 ltq_dma_enable_irq(struct ltq_dma_channel *ch)
 {
        unsigned long flags;
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&ltq_dma_lock, flags);
        ltq_dma_w32(ch->nr, LTQ_DMA_CS);
        ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN);
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&ltq_dma_lock, flags);
 }
 EXPORT_SYMBOL_GPL(ltq_dma_enable_irq);
 
@@ -77,10 +79,10 @@ ltq_dma_disable_irq(struct ltq_dma_channel *ch)
 {
        unsigned long flags;
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&ltq_dma_lock, flags);
        ltq_dma_w32(ch->nr, LTQ_DMA_CS);
        ltq_dma_w32_mask(1 << ch->nr, 0, LTQ_DMA_IRNEN);
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&ltq_dma_lock, flags);
 }
 EXPORT_SYMBOL_GPL(ltq_dma_disable_irq);
 
@@ -89,10 +91,10 @@ ltq_dma_ack_irq(struct ltq_dma_channel *ch)
 {
        unsigned long flags;
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&ltq_dma_lock, flags);
        ltq_dma_w32(ch->nr, LTQ_DMA_CS);
        ltq_dma_w32(DMA_IRQ_ACK, LTQ_DMA_CIS);
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&ltq_dma_lock, flags);
 }
 EXPORT_SYMBOL_GPL(ltq_dma_ack_irq);
 
@@ -101,11 +103,11 @@ ltq_dma_open(struct ltq_dma_channel *ch)
 {
        unsigned long flag;
 
-       local_irq_save(flag);
+       spin_lock_irqsave(&ltq_dma_lock, flag);
        ltq_dma_w32(ch->nr, LTQ_DMA_CS);
        ltq_dma_w32_mask(0, DMA_CHAN_ON, LTQ_DMA_CCTRL);
-       ltq_dma_enable_irq(ch);
-       local_irq_restore(flag);
+       ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN);
+       spin_unlock_irqrestore(&ltq_dma_lock, flag);
 }
 EXPORT_SYMBOL_GPL(ltq_dma_open);
 
@@ -114,11 +116,11 @@ ltq_dma_close(struct ltq_dma_channel *ch)
 {
        unsigned long flag;
 
-       local_irq_save(flag);
+       spin_lock_irqsave(&ltq_dma_lock, flag);
        ltq_dma_w32(ch->nr, LTQ_DMA_CS);
        ltq_dma_w32_mask(DMA_CHAN_ON, 0, LTQ_DMA_CCTRL);
-       ltq_dma_disable_irq(ch);
-       local_irq_restore(flag);
+       ltq_dma_w32_mask(1 << ch->nr, 0, LTQ_DMA_IRNEN);
+       spin_unlock_irqrestore(&ltq_dma_lock, flag);
 }
 EXPORT_SYMBOL_GPL(ltq_dma_close);
 
@@ -133,7 +135,7 @@ ltq_dma_alloc(struct ltq_dma_channel *ch)
                                &ch->phys, GFP_ATOMIC);
        memset(ch->desc_base, 0, LTQ_DESC_NUM * LTQ_DESC_SIZE);
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&ltq_dma_lock, flags);
        ltq_dma_w32(ch->nr, LTQ_DMA_CS);
        ltq_dma_w32(ch->phys, LTQ_DMA_CDBA);
        ltq_dma_w32(LTQ_DESC_NUM, LTQ_DMA_CDLEN);
@@ -142,7 +144,7 @@ ltq_dma_alloc(struct ltq_dma_channel *ch)
        ltq_dma_w32_mask(0, DMA_CHAN_RST, LTQ_DMA_CCTRL);
        while (ltq_dma_r32(LTQ_DMA_CCTRL) & DMA_CHAN_RST)
                ;
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&ltq_dma_lock, flags);
 }
 
 void
@@ -152,11 +154,11 @@ ltq_dma_alloc_tx(struct ltq_dma_channel *ch)
 
        ltq_dma_alloc(ch);
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&ltq_dma_lock, flags);
        ltq_dma_w32(DMA_DESCPT, LTQ_DMA_CIE);
        ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN);
        ltq_dma_w32(DMA_WEIGHT | DMA_TX, LTQ_DMA_CCTRL);
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&ltq_dma_lock, flags);
 }
 EXPORT_SYMBOL_GPL(ltq_dma_alloc_tx);
 
@@ -167,11 +169,11 @@ ltq_dma_alloc_rx(struct ltq_dma_channel *ch)
 
        ltq_dma_alloc(ch);
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&ltq_dma_lock, flags);
        ltq_dma_w32(DMA_DESCPT, LTQ_DMA_CIE);
        ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN);
        ltq_dma_w32(DMA_WEIGHT, LTQ_DMA_CCTRL);
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&ltq_dma_lock, flags);
 }
 EXPORT_SYMBOL_GPL(ltq_dma_alloc_rx);
 
@@ -255,7 +257,6 @@ static const struct of_device_id dma_match[] = {
        { .compatible = "lantiq,dma-xway" },
        {},
 };
-MODULE_DEVICE_TABLE(of, dma_match);
 
 static struct platform_driver dma_driver = {
        .probe = ltq_dma_init,
index 0f1bbea..e304aab 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_platform.h>
 #include <linux/of_irq.h>
 
@@ -187,7 +187,6 @@ static const struct of_device_id gptu_match[] = {
        { .compatible = "lantiq,gptu-xway" },
        {},
 };
-MODULE_DEVICE_TABLE(of, dma_match);
 
 static struct platform_driver dma_driver = {
        .probe = gptu_probe,
index 236193b..3c3aa05 100644 (file)
@@ -469,8 +469,8 @@ void __init ltq_soc_init(void)
                        panic("Failed to load xbar nodes from devicetree");
                if (of_address_to_resource(np_pmu, 0, &res_xbar))
                        panic("Failed to get xbar resources");
-               if (request_mem_region(res_xbar.start, resource_size(&res_xbar),
-                       res_xbar.name) < 0)
+               if (!request_mem_region(res_xbar.start, resource_size(&res_xbar),
+                       res_xbar.name))
                        panic("Failed to get xbar resources");
 
                ltq_xbar_membase = ioremap_nocache(res_xbar.start,
@@ -545,7 +545,7 @@ void __init ltq_soc_init(void)
                clkdev_add_pmu("1a800000.pcie", "msi", 1, 1, PMU1_PCIE2_MSI);
                clkdev_add_pmu("1a800000.pcie", "pdi", 1, 1, PMU1_PCIE2_PDI);
                clkdev_add_pmu("1a800000.pcie", "ctl", 1, 1, PMU1_PCIE2_CTL);
-               clkdev_add_pmu("1e108000.eth", NULL, 1, 0, PMU_SWITCH | PMU_PPE_DP);
+               clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH | PMU_PPE_DP);
                clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
                clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
        } else if (of_machine_is_compatible("lantiq,ar10")) {
@@ -553,7 +553,7 @@ void __init ltq_soc_init(void)
                                  ltq_ar10_fpi_hz(), ltq_ar10_pp32_hz());
                clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0);
                clkdev_add_pmu("1e106000.usb", "ctl", 1, 0, PMU_USB1);
-               clkdev_add_pmu("1e108000.eth", NULL, 1, 0, PMU_SWITCH |
+               clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH |
                               PMU_PPE_DP | PMU_PPE_TC);
                clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
                clkdev_add_pmu("1f203000.rcu", "gphy", 1, 0, PMU_GPHY);
@@ -575,11 +575,11 @@ void __init ltq_soc_init(void)
                clkdev_add_pmu(NULL, "ahb", 1, 0, PMU_AHBM | PMU_AHBS);
 
                clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
-               clkdev_add_pmu("1e108000.eth", NULL, 1, 0,
+               clkdev_add_pmu("1e108000.eth", NULL, 0, 0,
                                PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM |
                                PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 |
                                PMU_PPE_QSB | PMU_PPE_TOP);
-               clkdev_add_pmu("1f203000.rcu", "gphy", 1, 0, PMU_GPHY);
+               clkdev_add_pmu("1f203000.rcu", "gphy", 0, 0, PMU_GPHY);
                clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO);
                clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
                clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);
index 942f32b..4e272a2 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <asm/lasat/lasat.h>
-#include <linux/module.h>
 
 #include "at93c.h"
 
index c710d96..6f74224 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/types.h>
 #include <asm/lasat/lasat.h>
 
-#include <linux/module.h>
 #include <linux/sysctl.h>
 #include <linux/stddef.h>
 #include <linux/init.h>
index ed88647..2ff84f4 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/errno.h>
 #include <asm/asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/export.h>
 #include <asm/regdef.h>
 
 #ifdef CONFIG_64BIT
        .set    noreorder
        .align  5
 LEAF(csum_partial)
+EXPORT_SYMBOL(csum_partial)
        move    sum, zero
        move    t7, zero
 
@@ -460,6 +462,7 @@ LEAF(csum_partial)
 #endif
        .if \__nocheck == 1
        FEXPORT(csum_partial_copy_nocheck)
+       EXPORT_SYMBOL(csum_partial_copy_nocheck)
        .endif
        move    sum, zero
        move    odd, zero
@@ -823,9 +826,12 @@ LEAF(csum_partial)
        .endm
 
 LEAF(__csum_partial_copy_kernel)
+EXPORT_SYMBOL(__csum_partial_copy_kernel)
 #ifndef CONFIG_EVA
 FEXPORT(__csum_partial_copy_to_user)
+EXPORT_SYMBOL(__csum_partial_copy_to_user)
 FEXPORT(__csum_partial_copy_from_user)
+EXPORT_SYMBOL(__csum_partial_copy_from_user)
 #endif
 __BUILD_CSUM_PARTIAL_COPY_USER LEGACY_MODE USEROP USEROP 1
 END(__csum_partial_copy_kernel)
index 6c303a9..c3031f1 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <asm/asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/export.h>
 #include <asm/regdef.h>
 
 #define dst a0
@@ -622,6 +623,7 @@ SEXC(1)
 
        .align  5
 LEAF(memmove)
+EXPORT_SYMBOL(memmove)
        ADD     t0, a0, a2
        ADD     t1, a1, a2
        sltu    t0, a1, t0                      # dst + len <= src -> memcpy
@@ -674,6 +676,7 @@ LEAF(__rmemcpy)                                     /* a0=dst a1=src a2=len */
  * t6 is used as a flag to note inatomic mode.
  */
 LEAF(__copy_user_inatomic)
+EXPORT_SYMBOL(__copy_user_inatomic)
        b       __copy_user_common
        li      t6, 1
        END(__copy_user_inatomic)
@@ -686,9 +689,11 @@ LEAF(__copy_user_inatomic)
  */
        .align  5
 LEAF(memcpy)                                   /* a0=dst a1=src a2=len */
+EXPORT_SYMBOL(memcpy)
        move    v0, dst                         /* return value */
 .L__memcpy:
 FEXPORT(__copy_user)
+EXPORT_SYMBOL(__copy_user)
        li      t6, 0   /* not inatomic */
 __copy_user_common:
        /* Legacy Mode, user <-> user */
@@ -704,6 +709,7 @@ __copy_user_common:
  */
 
 LEAF(__copy_user_inatomic_eva)
+EXPORT_SYMBOL(__copy_user_inatomic_eva)
        b       __copy_from_user_common
        li      t6, 1
        END(__copy_user_inatomic_eva)
@@ -713,6 +719,7 @@ LEAF(__copy_user_inatomic_eva)
  */
 
 LEAF(__copy_from_user_eva)
+EXPORT_SYMBOL(__copy_from_user_eva)
        li      t6, 0   /* not inatomic */
 __copy_from_user_common:
        __BUILD_COPY_USER EVA_MODE USEROP KERNELOP
@@ -725,6 +732,7 @@ END(__copy_from_user_eva)
  */
 
 LEAF(__copy_to_user_eva)
+EXPORT_SYMBOL(__copy_to_user_eva)
 __BUILD_COPY_USER EVA_MODE KERNELOP USEROP
 END(__copy_to_user_eva)
 
@@ -733,6 +741,7 @@ END(__copy_to_user_eva)
  */
 
 LEAF(__copy_in_user_eva)
+EXPORT_SYMBOL(__copy_in_user_eva)
 __BUILD_COPY_USER EVA_MODE USEROP USEROP
 END(__copy_in_user_eva)
 
index 18a1ccd..a145666 100644 (file)
@@ -10,6 +10,7 @@
  */
 #include <asm/asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/export.h>
 #include <asm/regdef.h>
 
 #if LONGSIZE == 4
  */
 
 LEAF(memset)
+EXPORT_SYMBOL(memset)
        beqz            a1, 1f
        move            v0, a0                  /* result */
 
@@ -285,13 +287,16 @@ LEAF(memset)
 1:
 #ifndef CONFIG_EVA
 FEXPORT(__bzero)
+EXPORT_SYMBOL(__bzero)
 #else
 FEXPORT(__bzero_kernel)
+EXPORT_SYMBOL(__bzero_kernel)
 #endif
        __BUILD_BZERO LEGACY_MODE
 
 #ifdef CONFIG_EVA
 LEAF(__bzero)
+EXPORT_SYMBOL(__bzero)
        __BUILD_BZERO EVA_MODE
 END(__bzero)
 #endif
index 929bbac..40be226 100644 (file)
@@ -9,6 +9,7 @@
  */
 #include <asm/asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/export.h>
 #include <asm/regdef.h>
 
 #define EX(insn,reg,addr,handler)                      \
@@ -48,9 +49,11 @@ LEAF(__strlen_\func\()_asm)
        /* Set aliases */
        .global __strlen_user_asm
        .set __strlen_user_asm, __strlen_kernel_asm
+EXPORT_SYMBOL(__strlen_user_asm)
 #endif
 
 __BUILD_STRLEN_ASM kernel
+EXPORT_SYMBOL(__strlen_kernel_asm)
 
 #ifdef CONFIG_EVA
 
@@ -58,4 +61,5 @@ __BUILD_STRLEN_ASM kernel
        .set eva
 __BUILD_STRLEN_ASM user
        .set pop
+EXPORT_SYMBOL(__strlen_user_asm)
 #endif
index 3c32baf..5267ca8 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/errno.h>
 #include <asm/asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/export.h>
 #include <asm/regdef.h>
 
 #define EX(insn,reg,addr,handler)                      \
@@ -72,13 +73,19 @@ FEXPORT(__strncpy_from_\func\()_nocheck_asm)
        .global __strncpy_from_user_nocheck_asm
        .set __strncpy_from_user_asm, __strncpy_from_kernel_asm
        .set __strncpy_from_user_nocheck_asm, __strncpy_from_kernel_nocheck_asm
+EXPORT_SYMBOL(__strncpy_from_user_asm)
+EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
 #endif
 
 __BUILD_STRNCPY_ASM kernel
+EXPORT_SYMBOL(__strncpy_from_kernel_asm)
+EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm)
 
 #ifdef CONFIG_EVA
        .set push
        .set eva
 __BUILD_STRNCPY_ASM user
        .set pop
+EXPORT_SYMBOL(__strncpy_from_user_asm)
+EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
 #endif
index 77e6494..860ea99 100644 (file)
@@ -8,6 +8,7 @@
  */
 #include <asm/asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/export.h>
 #include <asm/regdef.h>
 
 #define EX(insn,reg,addr,handler)                      \
@@ -70,9 +71,13 @@ FEXPORT(__strnlen_\func\()_nocheck_asm)
        .global __strnlen_user_nocheck_asm
        .set __strnlen_user_asm, __strnlen_kernel_asm
        .set __strnlen_user_nocheck_asm, __strnlen_kernel_nocheck_asm
+EXPORT_SYMBOL(__strnlen_user_asm)
+EXPORT_SYMBOL(__strnlen_user_nocheck_asm)
 #endif
 
 __BUILD_STRNLEN_ASM kernel
+EXPORT_SYMBOL(__strnlen_kernel_asm)
+EXPORT_SYMBOL(__strnlen_kernel_nocheck_asm)
 
 #ifdef CONFIG_EVA
 
@@ -80,4 +85,6 @@ __BUILD_STRNLEN_ASM kernel
        .set eva
 __BUILD_STRNLEN_ASM user
        .set pop
+EXPORT_SYMBOL(__strnlen_user_asm)
+EXPORT_SYMBOL(__strnlen_user_nocheck_asm)
 #endif
index beff085..100f23d 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
 
 #include <dma.h>
 #include <nand.h>
 
-#define LS1X_RTC_CTRL  ((void __iomem *)KSEG1ADDR(LS1X_RTC_BASE + 0x40))
-#define RTC_EXTCLK_OK  (BIT(5) | BIT(8))
-#define RTC_EXTCLK_EN  BIT(8)
-
 /* 8250/16550 compatible UART */
 #define LS1X_UART(_id)                                         \
        {                                                       \
@@ -70,19 +66,10 @@ void __init ls1x_serial_set_uartclk(struct platform_device *pdev)
                p->uartclk = clk_get_rate(clk);
 }
 
-void __init ls1x_rtc_set_extclk(struct platform_device *pdev)
-{
-       u32 val;
-
-       val = __raw_readl(LS1X_RTC_CTRL);
-       if (!(val & RTC_EXTCLK_OK))
-               __raw_writel(val | RTC_EXTCLK_EN, LS1X_RTC_CTRL);
-}
-
 /* CPUFreq */
 static struct plat_ls1x_cpufreq ls1x_cpufreq_pdata = {
        .clk_name       = "cpu_clk",
-       .osc_clk_name   = "osc_33m_clk",
+       .osc_clk_name   = "osc_clk",
        .max_freq       = 266 * 1000,
        .min_freq       = 33 * 1000,
 };
@@ -357,7 +344,31 @@ struct platform_device ls1x_ehci_pdev = {
 };
 
 /* Real Time Clock */
+void __init ls1x_rtc_set_extclk(struct platform_device *pdev)
+{
+       u32 val = __raw_readl(LS1X_RTC_CTRL);
+
+       if (!(val & RTC_EXTCLK_OK))
+               __raw_writel(val | RTC_EXTCLK_EN, LS1X_RTC_CTRL);
+}
+
 struct platform_device ls1x_rtc_pdev = {
        .name           = "ls1x-rtc",
        .id             = -1,
 };
+
+/* Watchdog */
+static struct resource ls1x_wdt_resources[] = {
+       {
+               .start  = LS1X_WDT_BASE,
+               .end    = LS1X_WDT_BASE + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+struct platform_device ls1x_wdt_pdev = {
+       .name           = "ls1x-wdt",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(ls1x_wdt_resources),
+       .resource       = ls1x_wdt_resources,
+};
index 38a1d40..01aceaa 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
 
@@ -72,6 +72,7 @@ static struct platform_device *ls1b_platform_devices[] __initdata = {
        &ls1x_gpio1_pdev,
        &ls1x_nand_pdev,
        &ls1x_rtc_pdev,
+       &ls1x_wdt_pdev,
 };
 
 static int __init ls1b_platform_init(void)
index a96bed5..eb2d913 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * Copyright (c) 2016 Yang Ling <gnaygnil@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
 
@@ -13,6 +13,7 @@ static struct platform_device *ls1c_platform_devices[] __initdata = {
        &ls1x_uart_pdev,
        &ls1x_eth0_pdev,
        &ls1x_rtc_pdev,
+       &ls1x_wdt_pdev,
 };
 
 static int __init ls1c_platform_init(void)
index 9edfa55..b817d6d 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <linux/io.h>
 #include <linux/init.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/jiffies.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
index aab4fd6..df7235e 100644 (file)
@@ -17,22 +17,14 @@ static void *loongson_dma_alloc_coherent(struct device *dev, size_t size,
        /* ignore region specifiers */
        gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
 
-#ifdef CONFIG_ISA
-       if (dev == NULL)
+       if ((IS_ENABLED(CONFIG_ISA) && dev == NULL) ||
+           (IS_ENABLED(CONFIG_ZONE_DMA) &&
+            dev->coherent_dma_mask < DMA_BIT_MASK(32)))
                gfp |= __GFP_DMA;
-       else
-#endif
-#ifdef CONFIG_ZONE_DMA
-       if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
-               gfp |= __GFP_DMA;
-       else
-#endif
-#ifdef CONFIG_ZONE_DMA32
-       if (dev->coherent_dma_mask < DMA_BIT_MASK(40))
+       else if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+                dev->coherent_dma_mask < DMA_BIT_MASK(40))
                gfp |= __GFP_DMA32;
-       else
-#endif
-       ;
+
        gfp |= __GFP_NORETRY;
 
        ret = swiotlb_alloc_coherent(dev, size, dma_handle, gfp);
index 57d590a..6afa218 100644 (file)
@@ -17,7 +17,7 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/module.h>
+#include <linux/export.h>
 #include <asm/bootinfo.h>
 #include <loongson.h>
 #include <boot_param.h>
index 2dc5122..3323876 100644 (file)
@@ -7,7 +7,8 @@
  *  Free Software Foundation;  either version 2 of the License, or (at your
  *  option) any later version.
  */
-#include <linux/module.h>
+#include <linux/export.h>
+#include <linux/init.h>
 
 #include <asm/wbflush.h>
 #include <asm/bootinfo.h>
index 9de559d..d27c41b 100644 (file)
@@ -8,7 +8,7 @@
  * option) any later version.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <asm/bootinfo.h>
 
 #include <loongson.h>
index 2b666d3..3218229 100644 (file)
@@ -10,7 +10,8 @@
  * (at your option) any later version.
  */
 
-#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/export.h>
 #include <linux/spinlock.h>
 #include <linux/delay.h>
 
index cab5f43..9e33e45 100644 (file)
@@ -8,8 +8,9 @@
  *  option) any later version.
  */
 
+#include <linux/export.h>
+#include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
 
 #include <asm/irq_cpu.h>
 #include <asm/i8259.h>
index cac4d38..6859e93 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/interrupt.h>
 #include <linux/pm.h>
 #include <linux/i8042.h>
-#include <linux/module.h>
+#include <linux/export.h>
 
 #include <asm/i8259.h>
 #include <asm/mipsregs.h>
index 8e76490..548f759 100644 (file)
@@ -1,7 +1,7 @@
 #include <loongson.h>
 #include <irq.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
+#include <linux/init.h>
 
 #include <asm/irq_cpu.h>
 #include <asm/i8259.h>
index 282c5a8..f17ef52 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/nodemask.h>
 #include <linux/swap.h>
 #include <linux/memblock.h>
index 99aab9f..cfcf240 100644 (file)
@@ -418,7 +418,6 @@ static int loongson3_cpu_disable(void)
 
        set_cpu_online(cpu, false);
        calculate_cpu_foreign_map();
-       cpumask_clear_cpu(cpu, &cpu_callin_map);
        local_irq_save(flags);
        fixup_irqs();
        local_irq_restore(flags);
index b4c64bd..b4cc881 100644 (file)
@@ -4,7 +4,7 @@
 
 obj-y                          += cache.o dma-default.o extable.o fault.o \
                                   gup.o init.o mmap.o page.o page-funcs.o \
-                                  tlbex.o tlbex-fault.o tlb-funcs.o
+                                  pgtable.o tlbex.o tlbex-fault.o tlb-funcs.o
 
 ifdef CONFIG_CPU_MICROMIPS
 obj-y                          += uasm-micromips.o
index 88cfaf8..e7f798d 100644 (file)
@@ -1452,6 +1452,7 @@ static void probe_pcache(void)
        switch (current_cpu_type()) {
        case CPU_20KC:
        case CPU_25KF:
+       case CPU_I6400:
        case CPU_SB1:
        case CPU_SB1A:
        case CPU_XLR:
@@ -1478,7 +1479,6 @@ static void probe_pcache(void)
        case CPU_PROAPTIV:
        case CPU_M5150:
        case CPU_QEMU_GENERIC:
-       case CPU_I6400:
        case CPU_P6600:
        case CPU_M6250:
                if (!(read_c0_config7() & MIPS_CONF7_IAR) &&
@@ -1497,6 +1497,10 @@ static void probe_pcache(void)
                        c->dcache.flags |= MIPS_CACHE_ALIASES;
        }
 
+       /* Physically indexed caches don't suffer from virtual aliasing */
+       if (c->dcache.flags & MIPS_CACHE_PINDEX)
+               c->dcache.flags &= ~MIPS_CACHE_ALIASES;
+
        switch (current_cpu_type()) {
        case CPU_20KC:
                /*
index e86ebcf..aa75849 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/hardirq.h>
 #include <linux/gfp.h>
 #include <linux/kcore.h>
+#include <linux/export.h>
 
 #include <asm/asm-offsets.h>
 #include <asm/bootinfo.h>
@@ -538,5 +539,7 @@ unsigned long pgd_current[NR_CPUS];
 pgd_t swapper_pg_dir[_PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
 #ifndef __PAGETABLE_PMD_FOLDED
 pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned_bss;
+EXPORT_SYMBOL_GPL(invalid_pmd_table);
 #endif
 pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss;
+EXPORT_SYMBOL(invalid_pte_table);
index d08ea3f..d6d92c0 100644 (file)
@@ -146,14 +146,14 @@ unsigned long arch_mmap_rnd(void)
 {
        unsigned long rnd;
 
-       rnd = get_random_long();
-       rnd <<= PAGE_SHIFT;
+#ifdef CONFIG_COMPAT
        if (TASK_IS_32BIT_ADDR)
-               rnd &= 0xfffffful;
+               rnd = get_random_long() & ((1UL << mmap_rnd_compat_bits) - 1);
        else
-               rnd &= 0xffffffful;
+#endif /* CONFIG_COMPAT */
+               rnd = get_random_long() & ((1UL << mmap_rnd_bits) - 1);
 
-       return rnd;
+       return rnd << PAGE_SHIFT;
 }
 
 void arch_pick_mmap_layout(struct mm_struct *mm)
index 48a6b38..43181ac 100644 (file)
@@ -9,6 +9,7 @@
  * Copyright (C) 2012  Ralf Baechle <ralf@linux-mips.org>
  */
 #include <asm/asm.h>
+#include <asm/export.h>
 #include <asm/regdef.h>
 
 #ifdef CONFIG_SIBYTE_DMA_PAGEOPS
@@ -29,6 +30,7 @@
  */
 EXPORT(__clear_page_start)
 LEAF(cpu_clear_page_function_name)
+EXPORT_SYMBOL(cpu_clear_page_function_name)
 1:     j       1b              /* Dummy, will be replaced. */
        .space 288
 END(cpu_clear_page_function_name)
@@ -44,6 +46,7 @@ EXPORT(__clear_page_end)
  */
 EXPORT(__copy_page_start)
 LEAF(cpu_copy_page_function_name)
+EXPORT_SYMBOL(cpu_copy_page_function_name)
 1:     j       1b              /* Dummy, will be replaced. */
        .space 1344
 END(cpu_copy_page_function_name)
index 6f804f5..d5d0299 100644 (file)
@@ -661,6 +661,7 @@ void clear_page(void *page)
                ;
        __raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE)));
 }
+EXPORT_SYMBOL(clear_page);
 
 void copy_page(void *to, void *from)
 {
@@ -687,5 +688,6 @@ void copy_page(void *to, void *from)
                ;
        __raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE)));
 }
+EXPORT_SYMBOL(copy_page);
 
 #endif /* CONFIG_SIBYTE_DMA_PAGEOPS */
index ce4473e..0ae7b28 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright (C) 1999, 2000 by Silicon Graphics
  * Copyright (C) 2003 by Ralf Baechle
  */
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <asm/fixmap.h>
@@ -60,6 +61,7 @@ void pmd_init(unsigned long addr, unsigned long pagetable)
                p[-1] = pagetable;
        } while (p != end);
 }
+EXPORT_SYMBOL_GPL(pmd_init);
 #endif
 
 pmd_t mk_pmd(struct page *page, pgprot_t prot)
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
new file mode 100644 (file)
index 0000000..05560b0
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/export.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+#include <asm/pgalloc.h>
+
+pgd_t *pgd_alloc(struct mm_struct *mm)
+{
+       pgd_t *ret, *init;
+
+       ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
+       if (ret) {
+               init = pgd_offset(&init_mm, 0UL);
+               pgd_init((unsigned long)ret);
+               memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
+                      (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(pgd_alloc);
index 026cb59..f293a97 100644 (file)
@@ -31,26 +31,40 @@ static inline void indy_sc_wipe(unsigned long first, unsigned long last)
        unsigned long tmp;
 
        __asm__ __volatile__(
-       ".set\tpush\t\t\t# indy_sc_wipe\n\t"
-       ".set\tnoreorder\n\t"
-       ".set\tmips3\n\t"
-       ".set\tnoat\n\t"
-       "mfc0\t%2, $12\n\t"
-       "li\t$1, 0x80\t\t\t# Go 64 bit\n\t"
-       "mtc0\t$1, $12\n\t"
-
-       "dli\t$1, 0x9000000080000000\n\t"
-       "or\t%0, $1\t\t\t# first line to flush\n\t"
-       "or\t%1, $1\t\t\t# last line to flush\n\t"
-       ".set\tat\n\t"
-
-       "1:\tsw\t$0, 0(%0)\n\t"
-       "bne\t%0, %1, 1b\n\t"
-       " daddu\t%0, 32\n\t"
-
-       "mtc0\t%2, $12\t\t\t# Back to 32 bit\n\t"
-       "nop; nop; nop; nop;\n\t"
-       ".set\tpop"
+       "       .set    push                    # indy_sc_wipe          \n"
+       "       .set    noreorder                                       \n"
+       "       .set    mips3                                           \n"
+       "       .set    noat                                            \n"
+       "       mfc0    %2, $12                                         \n"
+       "       li      $1, 0x80                # Go 64 bit             \n"
+       "       mtc0    $1, $12                                         \n"
+       "                                                               \n"
+       "       #                                                       \n"
+       "       # Open code a dli $1, 0x9000000080000000                \n"
+       "       #                                                       \n"
+       "       # Required because binutils 2.25 will happily accept    \n"
+       "       # 64 bit instructions in .set mips3 mode but puke on    \n"
+       "       # 64 bit constants when generating 32 bit ELF           \n"
+       "       #                                                       \n"
+       "       lui     $1,0x9000                                       \n"
+       "       dsll    $1,$1,0x10                                      \n"
+       "       ori     $1,$1,0x8000                                    \n"
+       "       dsll    $1,$1,0x10                                      \n"
+       "                                                               \n"
+       "       or      %0, $1                  # first line to flush   \n"
+       "       or      %1, $1                  # last line to flush    \n"
+       "       .set    at                                              \n"
+       "                                                               \n"
+       "1:     sw      $0, 0(%0)                                       \n"
+       "       bne     %0, %1, 1b                                      \n"
+       "        daddu  %0, 32                                          \n"
+       "                                                               \n"
+       "       mtc0    %2, $12                 # Back to 32 bit        \n"
+       "       nop                             # pipeline hazard       \n"
+       "       nop                                                     \n"
+       "       nop                                                     \n"
+       "       nop                                                     \n"
+       "       .set    pop                                             \n"
        : "=r" (first), "=r" (last), "=&r" (tmp)
        : "0" (first), "1" (last));
 }
index 286a4d5..c909c33 100644 (file)
@@ -181,6 +181,7 @@ static int __init mips_sc_probe_cm3(void)
 
        if (c->scache.linesz) {
                c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
+               c->options |= MIPS_CPU_INCLUSIVE_CACHES;
                return 1;
        }
 
index 55ce396..9bfee89 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <linux/bug.h>
+#include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/smp.h>
@@ -34,6 +35,7 @@
 #include <asm/war.h>
 #include <asm/uasm.h>
 #include <asm/setup.h>
+#include <asm/tlbex.h>
 
 static int mips_xpa_disabled;
 
@@ -344,7 +346,8 @@ static int allocate_kscratch(void)
 }
 
 static int scratch_reg;
-static int pgd_reg;
+int pgd_reg;
+EXPORT_SYMBOL_GPL(pgd_reg);
 enum vmalloc64_mode {not_refill, refill_scratch, refill_noscratch};
 
 static struct work_registers build_get_work_registers(u32 **p)
@@ -496,15 +499,9 @@ static void __maybe_unused build_tlb_probe_entry(u32 **p)
        }
 }
 
-/*
- * Write random or indexed TLB entry, and care about the hazards from
- * the preceding mtc0 and for the following eret.
- */
-enum tlb_write_entry { tlb_random, tlb_indexed };
-
-static void build_tlb_write_entry(u32 **p, struct uasm_label **l,
-                                 struct uasm_reloc **r,
-                                 enum tlb_write_entry wmode)
+void build_tlb_write_entry(u32 **p, struct uasm_label **l,
+                          struct uasm_reloc **r,
+                          enum tlb_write_entry wmode)
 {
        void(*tlbw)(u32 **) = NULL;
 
@@ -627,6 +624,7 @@ static void build_tlb_write_entry(u32 **p, struct uasm_label **l,
                break;
        }
 }
+EXPORT_SYMBOL_GPL(build_tlb_write_entry);
 
 static __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
                                                        unsigned int reg)
@@ -781,9 +779,8 @@ static void build_huge_handler_tail(u32 **p, struct uasm_reloc **r,
  * TMP and PTR are scratch.
  * TMP will be clobbered, PTR will hold the pmd entry.
  */
-static void
-build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
-                unsigned int tmp, unsigned int ptr)
+void build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
+                     unsigned int tmp, unsigned int ptr)
 {
 #ifndef CONFIG_MIPS_PGD_C0_CONTEXT
        long pgdc = (long)pgd_current;
@@ -859,6 +856,7 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
        uasm_i_daddu(p, ptr, ptr, tmp); /* add in pmd offset */
 #endif
 }
+EXPORT_SYMBOL_GPL(build_get_pmde64);
 
 /*
  * BVADDR is the faulting address, PTR is scratch.
@@ -934,8 +932,7 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
  * TMP and PTR are scratch.
  * TMP will be clobbered, PTR will hold the pgd entry.
  */
-static void __maybe_unused
-build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
+void build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
 {
        if (pgd_reg != -1) {
                /* pgd is in pgd_reg */
@@ -960,6 +957,7 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
        uasm_i_sll(p, tmp, tmp, PGD_T_LOG2);
        uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */
 }
+EXPORT_SYMBOL_GPL(build_get_pgde32);
 
 #endif /* !CONFIG_64BIT */
 
@@ -989,7 +987,7 @@ static void build_adjust_context(u32 **p, unsigned int ctx)
        uasm_i_andi(p, ctx, ctx, mask);
 }
 
-static void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)
+void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)
 {
        /*
         * Bug workaround for the Nevada. It seems as if under certain
@@ -1013,8 +1011,9 @@ static void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)
        build_adjust_context(p, tmp);
        UASM_i_ADDU(p, ptr, ptr, tmp); /* add in offset */
 }
+EXPORT_SYMBOL_GPL(build_get_ptep);
 
-static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep)
+void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep)
 {
        int pte_off_even = 0;
        int pte_off_odd = sizeof(pte_t);
@@ -1063,6 +1062,7 @@ static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep)
                UASM_i_MTC0(p, 0, C0_ENTRYLO1);
        UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
 }
+EXPORT_SYMBOL_GPL(build_update_entries);
 
 struct mips_huge_tlb_info {
        int huge_pte;
@@ -1536,7 +1536,9 @@ static void build_loongson3_tlb_refill_handler(void)
 extern u32 handle_tlbl[], handle_tlbl_end[];
 extern u32 handle_tlbs[], handle_tlbs_end[];
 extern u32 handle_tlbm[], handle_tlbm_end[];
-extern u32 tlbmiss_handler_setup_pgd_start[], tlbmiss_handler_setup_pgd[];
+extern u32 tlbmiss_handler_setup_pgd_start[];
+extern u32 tlbmiss_handler_setup_pgd[];
+EXPORT_SYMBOL_GPL(tlbmiss_handler_setup_pgd);
 extern u32 tlbmiss_handler_setup_pgd_end[];
 
 static void build_setup_pgd(void)
@@ -2041,7 +2043,7 @@ build_r4000_tlbchange_handler_tail(u32 **p, struct uasm_label **l,
 
 static void build_r4000_tlb_load_handler(void)
 {
-       u32 *p = handle_tlbl;
+       u32 *p = (u32 *)msk_isa16_mode((ulong)handle_tlbl);
        const int handle_tlbl_size = handle_tlbl_end - handle_tlbl;
        struct uasm_label *l = labels;
        struct uasm_reloc *r = relocs;
@@ -2224,7 +2226,7 @@ static void build_r4000_tlb_load_handler(void)
 
 static void build_r4000_tlb_store_handler(void)
 {
-       u32 *p = handle_tlbs;
+       u32 *p = (u32 *)msk_isa16_mode((ulong)handle_tlbs);
        const int handle_tlbs_size = handle_tlbs_end - handle_tlbs;
        struct uasm_label *l = labels;
        struct uasm_reloc *r = relocs;
@@ -2279,7 +2281,7 @@ static void build_r4000_tlb_store_handler(void)
 
 static void build_r4000_tlb_modify_handler(void)
 {
-       u32 *p = handle_tlbm;
+       u32 *p = (u32 *)msk_isa16_mode((ulong)handle_tlbm);
        const int handle_tlbm_size = handle_tlbm_end - handle_tlbm;
        struct uasm_label *l = labels;
        struct uasm_reloc *r = relocs;
index 516e123..11e9527 100644 (file)
@@ -23,7 +23,6 @@
  */
 #include <linux/init.h>
 #include <linux/serial_8250.h>
-#include <linux/module.h>
 #include <linux/irq.h>
 #include <linux/platform_device.h>
 #include <asm/mips-boards/maltaint.h>
index 3660dc6..f4961bc 100644 (file)
@@ -275,7 +275,7 @@ asmlinkage void plat_irq_dispatch(void)
        do_IRQ(nlm_irq_to_xirq(node, i));
 }
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_CPU_XLP
 static const struct irq_domain_ops xlp_pic_irq_domain_ops = {
        .xlate = irq_domain_xlate_onetwocell,
 };
@@ -348,7 +348,7 @@ void __init arch_init_irq(void)
 #if defined(CONFIG_CPU_XLR)
        nlm_setup_fmn_irq();
 #endif
-#if defined(CONFIG_OF)
+#ifdef CONFIG_CPU_XLP
        of_irq_init(xlp_pic_irq_ids);
 #endif
 }
index f0cc4c9..509c1a7 100644 (file)
@@ -59,8 +59,8 @@ NESTED(xlp_boot_core0_siblings, PT_SIZE, sp)
        sync
        /* find the location to which nlm_boot_siblings was relocated */
        li      t0, CKSEG1ADDR(RESET_VEC_PHYS)
-       dla     t1, nlm_reset_entry
-       dla     t2, nlm_boot_siblings
+       PTR_LA  t1, nlm_reset_entry
+       PTR_LA  t2, nlm_boot_siblings
        dsubu   t2, t1
        daddu   t2, t0
        /* call it */
index 87d7846..d61004d 100644 (file)
@@ -197,7 +197,7 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)
        }
 }
 
-void xlp_wakeup_secondary_cpus()
+void xlp_wakeup_secondary_cpus(void)
 {
        /*
         * In case of u-boot, the secondaries are in reset
index 45cb274..c57da6f 100644 (file)
 
 #include "op_impl.h"
 
-#define M_PERFCTL_EXL                  (1UL      <<  0)
-#define M_PERFCTL_KERNEL               (1UL      <<  1)
-#define M_PERFCTL_SUPERVISOR           (1UL      <<  2)
-#define M_PERFCTL_USER                 (1UL      <<  3)
-#define M_PERFCTL_INTERRUPT_ENABLE     (1UL      <<  4)
-#define M_PERFCTL_EVENT(event)         (((event) & 0x3ff)  << 5)
-#define M_PERFCTL_VPEID(vpe)           ((vpe)    << 16)
-#define M_PERFCTL_MT_EN(filter)                ((filter) << 20)
-#define           M_TC_EN_ALL                  M_PERFCTL_MT_EN(0)
-#define           M_TC_EN_VPE                  M_PERFCTL_MT_EN(1)
-#define           M_TC_EN_TC                   M_PERFCTL_MT_EN(2)
-#define M_PERFCTL_TCID(tcid)           ((tcid)   << 22)
-#define M_PERFCTL_WIDE                 (1UL      << 30)
-#define M_PERFCTL_MORE                 (1UL      << 31)
+#define M_PERFCTL_EVENT(event)         (((event) << MIPS_PERFCTRL_EVENT_S) & \
+                                        MIPS_PERFCTRL_EVENT)
+#define M_PERFCTL_VPEID(vpe)           ((vpe)    << MIPS_PERFCTRL_VPEID_S)
 
 #define M_COUNTER_OVERFLOW             (1UL      << 31)
 
-/* Netlogic XLR specific, count events in all threads in a core */
-#define M_PERFCTL_COUNT_ALL_THREADS    (1UL      << 13)
-
 static int (*save_perf_irq)(void);
 static int perfcount_irq;
 
@@ -51,7 +37,7 @@ static int perfcount_irq;
 
 #ifdef CONFIG_MIPS_MT_SMP
 static int cpu_has_mipsmt_pertccounters;
-#define WHAT           (M_TC_EN_VPE | \
+#define WHAT           (MIPS_PERFCTRL_MT_EN_VPE | \
                         M_PERFCTL_VPEID(cpu_data[smp_processor_id()].vpe_id))
 #define vpe_id()       (cpu_has_mipsmt_pertccounters ? \
                        0 : cpu_data[smp_processor_id()].vpe_id)
@@ -161,15 +147,15 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr)
                        continue;
 
                reg.control[i] = M_PERFCTL_EVENT(ctr[i].event) |
-                                M_PERFCTL_INTERRUPT_ENABLE;
+                                MIPS_PERFCTRL_IE;
                if (ctr[i].kernel)
-                       reg.control[i] |= M_PERFCTL_KERNEL;
+                       reg.control[i] |= MIPS_PERFCTRL_K;
                if (ctr[i].user)
-                       reg.control[i] |= M_PERFCTL_USER;
+                       reg.control[i] |= MIPS_PERFCTRL_U;
                if (ctr[i].exl)
-                       reg.control[i] |= M_PERFCTL_EXL;
+                       reg.control[i] |= MIPS_PERFCTRL_EXL;
                if (boot_cpu_type() == CPU_XLR)
-                       reg.control[i] |= M_PERFCTL_COUNT_ALL_THREADS;
+                       reg.control[i] |= XLR_PERFCTRL_ALLTHREADS;
                reg.counter[i] = 0x80000000 - ctr[i].count;
        }
 }
@@ -254,7 +240,7 @@ static int mipsxx_perfcount_handler(void)
        case n + 1:                                                     \
                control = r_c0_perfctrl ## n();                         \
                counter = r_c0_perfcntr ## n();                         \
-               if ((control & M_PERFCTL_INTERRUPT_ENABLE) &&           \
+               if ((control & MIPS_PERFCTRL_IE) &&                     \
                    (counter & M_COUNTER_OVERFLOW)) {                   \
                        oprofile_add_sample(get_irq_regs(), n);         \
                        w_c0_perfcntr ## n(reg.counter[n]);             \
@@ -273,11 +259,11 @@ static inline int __n_counters(void)
 {
        if (!cpu_has_perf)
                return 0;
-       if (!(read_c0_perfctrl0() & M_PERFCTL_MORE))
+       if (!(read_c0_perfctrl0() & MIPS_PERFCTRL_M))
                return 1;
-       if (!(read_c0_perfctrl1() & M_PERFCTL_MORE))
+       if (!(read_c0_perfctrl1() & MIPS_PERFCTRL_M))
                return 2;
-       if (!(read_c0_perfctrl2() & M_PERFCTL_MORE))
+       if (!(read_c0_perfctrl2() & MIPS_PERFCTRL_M))
                return 3;
 
        return 4;
index a032ae0..9b3301d 100644 (file)
@@ -21,9 +21,9 @@ int __init tx4927_report_pciclk(void)
 {
        int pciclk = 0;
 
-       printk(KERN_INFO "PCIC --%s PCICLK:",
-              (__raw_readq(&tx4927_ccfgptr->ccfg) & TX4927_CCFG_PCI66) ?
-              " PCI66" : "");
+       pr_info("PCIC --%s PCICLK:",
+               (__raw_readq(&tx4927_ccfgptr->ccfg) & TX4927_CCFG_PCI66) ?
+               " PCI66" : "");
        if (__raw_readq(&tx4927_ccfgptr->pcfg) & TX4927_PCFG_PCICLKEN_ALL) {
                u64 ccfg = __raw_readq(&tx4927_ccfgptr->ccfg);
                switch ((unsigned long)ccfg &
@@ -37,14 +37,14 @@ int __init tx4927_report_pciclk(void)
                case TX4927_CCFG_PCIDIVMODE_6:
                        pciclk = txx9_cpu_clock / 6; break;
                }
-               printk("Internal(%u.%uMHz)",
-                      (pciclk + 50000) / 1000000,
-                      ((pciclk + 50000) / 100000) % 10);
+               pr_cont("Internal(%u.%uMHz)",
+                       (pciclk + 50000) / 1000000,
+                       ((pciclk + 50000) / 100000) % 10);
        } else {
-               printk("External");
+               pr_cont("External");
                pciclk = -1;
        }
-       printk("\n");
+       pr_cont("\n");
        return pciclk;
 }
 
@@ -74,8 +74,8 @@ int __init tx4927_pciclk66_setup(void)
                }
                tx4927_ccfg_change(TX4927_CCFG_PCIDIVMODE_MASK,
                                   pcidivmode);
-               printk(KERN_DEBUG "PCICLK: ccfg:%08lx\n",
-                      (unsigned long)__raw_readq(&tx4927_ccfgptr->ccfg));
+               pr_debug("PCICLK: ccfg:%08lx\n",
+                        (unsigned long)__raw_readq(&tx4927_ccfgptr->ccfg));
        } else
                pciclk = -1;
        return pciclk;
@@ -87,5 +87,5 @@ void __init tx4927_setup_pcierr_irq(void)
                        tx4927_pcierr_interrupt,
                        0, "PCI error",
                        (void *)TX4927_PCIC_REG))
-               printk(KERN_WARNING "Failed to request irq for PCIERR\n");
+               pr_warn("Failed to request irq for PCIERR\n");
 }
index 141bba5..000c0e1 100644 (file)
@@ -21,9 +21,9 @@ int __init tx4938_report_pciclk(void)
 {
        int pciclk = 0;
 
-       printk(KERN_INFO "PCIC --%s PCICLK:",
-              (__raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCI66) ?
-              " PCI66" : "");
+       pr_info("PCIC --%s PCICLK:",
+               (__raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCI66) ?
+               " PCI66" : "");
        if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_PCICLKEN_ALL) {
                u64 ccfg = __raw_readq(&tx4938_ccfgptr->ccfg);
                switch ((unsigned long)ccfg &
@@ -45,14 +45,14 @@ int __init tx4938_report_pciclk(void)
                case TX4938_CCFG_PCIDIVMODE_11:
                        pciclk = txx9_cpu_clock / 11; break;
                }
-               printk("Internal(%u.%uMHz)",
-                      (pciclk + 50000) / 1000000,
-                      ((pciclk + 50000) / 100000) % 10);
+               pr_cont("Internal(%u.%uMHz)",
+                       (pciclk + 50000) / 1000000,
+                       ((pciclk + 50000) / 100000) % 10);
        } else {
-               printk("External");
+               pr_cont("External");
                pciclk = -1;
        }
-       printk("\n");
+       pr_cont("\n");
        return pciclk;
 }
 
@@ -62,10 +62,10 @@ void __init tx4938_report_pci1clk(void)
        unsigned int pciclk =
                txx9_gbus_clock / ((ccfg & TX4938_CCFG_PCI1DMD) ? 4 : 2);
 
-       printk(KERN_INFO "PCIC1 -- %sPCICLK:%u.%uMHz\n",
-              (ccfg & TX4938_CCFG_PCI1_66) ? "PCI66 " : "",
-              (pciclk + 50000) / 1000000,
-              ((pciclk + 50000) / 100000) % 10);
+       pr_info("PCIC1 -- %sPCICLK:%u.%uMHz\n",
+               (ccfg & TX4938_CCFG_PCI1_66) ? "PCI66 " : "",
+               (pciclk + 50000) / 1000000,
+               ((pciclk + 50000) / 100000) % 10);
 }
 
 int __init tx4938_pciclk66_setup(void)
@@ -105,8 +105,8 @@ int __init tx4938_pciclk66_setup(void)
                }
                tx4938_ccfg_change(TX4938_CCFG_PCIDIVMODE_MASK,
                                   pcidivmode);
-               printk(KERN_DEBUG "PCICLK: ccfg:%08lx\n",
-                      (unsigned long)__raw_readq(&tx4938_ccfgptr->ccfg));
+               pr_debug("PCICLK: ccfg:%08lx\n",
+                        (unsigned long)__raw_readq(&tx4938_ccfgptr->ccfg));
        } else
                pciclk = -1;
        return pciclk;
@@ -138,5 +138,5 @@ void __init tx4938_setup_pcierr_irq(void)
                        tx4927_pcierr_interrupt,
                        0, "PCI error",
                        (void *)TX4927_PCIC_REG))
-               printk(KERN_WARNING "Failed to request irq for PCIERR\n");
+               pr_warn("Failed to request irq for PCIERR\n");
 }
index cd8ed09..9d6acc0 100644 (file)
@@ -28,14 +28,14 @@ int __init tx4939_report_pciclk(void)
                pciclk = txx9_master_clock * 20 / 6;
                if (!(__raw_readq(&tx4939_ccfgptr->ccfg) & TX4939_CCFG_PCI66))
                        pciclk /= 2;
-               printk(KERN_CONT "Internal(%u.%uMHz)",
-                      (pciclk + 50000) / 1000000,
-                      ((pciclk + 50000) / 100000) % 10);
+               pr_cont("Internal(%u.%uMHz)",
+                       (pciclk + 50000) / 1000000,
+                       ((pciclk + 50000) / 100000) % 10);
        } else {
-               printk(KERN_CONT "External");
+               pr_cont("External");
                pciclk = -1;
        }
-       printk(KERN_CONT "\n");
+       pr_cont("\n");
        return pciclk;
 }
 
index 4a4c272..c286496 100644 (file)
@@ -2,8 +2,7 @@
 # Joshua Henderson, <joshua.henderson@microchip.com>
 # Copyright (C) 2015 Microchip Technology, Inc.  All rights reserved.
 #
-obj-y                  := init.o time.o config.o
+obj-y                  := config.o early_clk.o init.o time.o
 
 obj-$(CONFIG_EARLY_PRINTK)     += early_console.o      \
-                                  early_pin.o          \
-                                  early_clk.o
+                                  early_pin.o
index ef620a4..6fdcb3d 100644 (file)
@@ -34,7 +34,7 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
index fea917b..b4c020a 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/module.h>
 #include <linux/ptrace.h>
 
 #include <asm/cevt-r4k.h>
index 813826a..9825dee 100644 (file)
@@ -46,6 +46,7 @@ choice
                select SYS_SUPPORTS_MULTITHREADING
                select SYS_SUPPORTS_SMP
                select SYS_SUPPORTS_MIPS_CPS
+               select SYS_SUPPORTS_HIGHMEM
                select MIPS_GIC
                select COMMON_CLK
                select CLKSRC_MIPS_GIC
index ebaa7cc..df79588 100644 (file)
@@ -8,7 +8,8 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/clkdev.h>
 #include <linux/clk.h>
 
@@ -62,6 +63,12 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 }
 EXPORT_SYMBOL_GPL(clk_set_rate);
 
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+       return -1;
+}
+EXPORT_SYMBOL_GPL(clk_round_rate);
+
 void __init plat_time_init(void)
 {
        struct clk *clk;
index 4911c14..9b478c9 100644 (file)
@@ -163,8 +163,8 @@ static int __init intc_of_init(struct device_node *node,
        if (of_address_to_resource(node, 0, &res))
                panic("Failed to get intc memory range");
 
-       if (request_mem_region(res.start, resource_size(&res),
-                               res.name) < 0)
+       if (!request_mem_region(res.start, resource_size(&res),
+                               res.name))
                pr_err("Failed to request intc memory");
 
        rt_intc_membase = ioremap_nocache(res.start,
index 3c7c9bf..094a0ee 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/module.h>
 
 #include <asm/mipsregs.h>
 #include <asm/mach-ralink/ralink_regs.h>
@@ -55,7 +54,10 @@ static int dram_type;
 static struct rt2880_pmx_func i2c_grp[] =  { FUNC("i2c", 0, 1, 2) };
 static struct rt2880_pmx_func spi_grp[] = { FUNC("spi", 0, 3, 4) };
 static struct rt2880_pmx_func uartlite_grp[] = { FUNC("uartlite", 0, 15, 2) };
-static struct rt2880_pmx_func mdio_grp[] = { FUNC("mdio", 0, 22, 2) };
+static struct rt2880_pmx_func mdio_grp[] = {
+       FUNC("mdio", MT7620_GPIO_MODE_MDIO, 22, 2),
+       FUNC("refclk", MT7620_GPIO_MODE_MDIO_REFCLK, 22, 2),
+};
 static struct rt2880_pmx_func rgmii1_grp[] = { FUNC("rgmii1", 0, 24, 12) };
 static struct rt2880_pmx_func refclk_grp[] = { FUNC("spi refclk", 0, 37, 3) };
 static struct rt2880_pmx_func ephy_grp[] = { FUNC("ephy", 0, 40, 5) };
@@ -92,7 +94,8 @@ static struct rt2880_pmx_group mt7620a_pinmux_data[] = {
        GRP("uartlite", uartlite_grp, 1, MT7620_GPIO_MODE_UART1),
        GRP_G("wdt", wdt_grp, MT7620_GPIO_MODE_WDT_MASK,
                MT7620_GPIO_MODE_WDT_GPIO, MT7620_GPIO_MODE_WDT_SHIFT),
-       GRP("mdio", mdio_grp, 1, MT7620_GPIO_MODE_MDIO),
+       GRP_G("mdio", mdio_grp, MT7620_GPIO_MODE_MDIO_MASK,
+               MT7620_GPIO_MODE_MDIO_GPIO, MT7620_GPIO_MODE_MDIO_SHIFT),
        GRP("rgmii1", rgmii1_grp, 1, MT7620_GPIO_MODE_RGMII1),
        GRP("spi refclk", refclk_grp, 1, MT7620_GPIO_MODE_SPI_REF_CLK),
        GRP_G("pcie", pcie_rst_grp, MT7620_GPIO_MODE_PCIE_MASK,
@@ -176,7 +179,7 @@ static struct rt2880_pmx_func spi_cs1_grp_mt7628[] = {
 
 static struct rt2880_pmx_func spis_grp_mt7628[] = {
        FUNC("pwm_uart2", 3, 14, 4),
-       FUNC("util", 2, 14, 4),
+       FUNC("utif", 2, 14, 4),
        FUNC("gpio", 1, 14, 4),
        FUNC("spis", 0, 14, 4),
 };
@@ -190,28 +193,28 @@ static struct rt2880_pmx_func gpio_grp_mt7628[] = {
 
 static struct rt2880_pmx_func p4led_kn_grp_mt7628[] = {
        FUNC("jtag", 3, 30, 1),
-       FUNC("util", 2, 30, 1),
+       FUNC("utif", 2, 30, 1),
        FUNC("gpio", 1, 30, 1),
        FUNC("p4led_kn", 0, 30, 1),
 };
 
 static struct rt2880_pmx_func p3led_kn_grp_mt7628[] = {
        FUNC("jtag", 3, 31, 1),
-       FUNC("util", 2, 31, 1),
+       FUNC("utif", 2, 31, 1),
        FUNC("gpio", 1, 31, 1),
        FUNC("p3led_kn", 0, 31, 1),
 };
 
 static struct rt2880_pmx_func p2led_kn_grp_mt7628[] = {
        FUNC("jtag", 3, 32, 1),
-       FUNC("util", 2, 32, 1),
+       FUNC("utif", 2, 32, 1),
        FUNC("gpio", 1, 32, 1),
        FUNC("p2led_kn", 0, 32, 1),
 };
 
 static struct rt2880_pmx_func p1led_kn_grp_mt7628[] = {
        FUNC("jtag", 3, 33, 1),
-       FUNC("util", 2, 33, 1),
+       FUNC("utif", 2, 33, 1),
        FUNC("gpio", 1, 33, 1),
        FUNC("p1led_kn", 0, 33, 1),
 };
@@ -232,28 +235,28 @@ static struct rt2880_pmx_func wled_kn_grp_mt7628[] = {
 
 static struct rt2880_pmx_func p4led_an_grp_mt7628[] = {
        FUNC("jtag", 3, 39, 1),
-       FUNC("util", 2, 39, 1),
+       FUNC("utif", 2, 39, 1),
        FUNC("gpio", 1, 39, 1),
        FUNC("p4led_an", 0, 39, 1),
 };
 
 static struct rt2880_pmx_func p3led_an_grp_mt7628[] = {
        FUNC("jtag", 3, 40, 1),
-       FUNC("util", 2, 40, 1),
+       FUNC("utif", 2, 40, 1),
        FUNC("gpio", 1, 40, 1),
        FUNC("p3led_an", 0, 40, 1),
 };
 
 static struct rt2880_pmx_func p2led_an_grp_mt7628[] = {
        FUNC("jtag", 3, 41, 1),
-       FUNC("util", 2, 41, 1),
+       FUNC("utif", 2, 41, 1),
        FUNC("gpio", 1, 41, 1),
        FUNC("p2led_an", 0, 41, 1),
 };
 
 static struct rt2880_pmx_func p1led_an_grp_mt7628[] = {
        FUNC("jtag", 3, 42, 1),
-       FUNC("util", 2, 42, 1),
+       FUNC("utif", 2, 42, 1),
        FUNC("gpio", 1, 42, 1),
        FUNC("p1led_an", 0, 42, 1),
 };
@@ -509,6 +512,7 @@ void __init ralink_clk_init(void)
        unsigned long sys_rate;
        unsigned long dram_rate;
        unsigned long periph_rate;
+       unsigned long pcmi2s_rate;
 
        xtal_rate = mt7620_get_xtal_rate();
 
@@ -523,6 +527,7 @@ void __init ralink_clk_init(void)
                        cpu_rate = MHZ(575);
                dram_rate = sys_rate = cpu_rate / 3;
                periph_rate = MHZ(40);
+               pcmi2s_rate = MHZ(480);
 
                ralink_clk_add("10000d00.uartlite", periph_rate);
                ralink_clk_add("10000e00.uartlite", periph_rate);
@@ -534,6 +539,7 @@ void __init ralink_clk_init(void)
                dram_rate = mt7620_get_dram_rate(pll_rate);
                sys_rate = mt7620_get_sys_rate(cpu_rate);
                periph_rate = mt7620_get_periph_rate(xtal_rate);
+               pcmi2s_rate = periph_rate;
 
                pr_debug(RFMT("XTAL") RFMT("CPU_PLL") RFMT("PLL"),
                         RINT(xtal_rate), RFRAC(xtal_rate),
@@ -555,6 +561,8 @@ void __init ralink_clk_init(void)
        ralink_clk_add("cpu", cpu_rate);
        ralink_clk_add("10000100.timer", periph_rate);
        ralink_clk_add("10000120.watchdog", periph_rate);
+       ralink_clk_add("10000900.i2c", periph_rate);
+       ralink_clk_add("10000a00.i2s", pcmi2s_rate);
        ralink_clk_add("10000b00.spi", sys_rate);
        ralink_clk_add("10000b40.spi", sys_rate);
        ralink_clk_add("10000c00.uartlite", periph_rate);
index a45bbbe..0695c2d 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/module.h>
 
 #include <asm/mipsregs.h>
 #include <asm/smp-ops.h>
@@ -181,7 +180,7 @@ void prom_soc_init(struct ralink_soc_info *soc_info)
        } else {
                panic("mt7621: unknown SoC, n0:%08x n1:%08x\n", n0, n1);
        }
-
+       ralink_soc = MT762X_SOC_MT7621AT;
        rev = __raw_readl(sysc + SYSC_REG_CHIP_REV);
 
        snprintf(soc_info->sys_type, RAMIPS_SYS_TYPE_LEN,
index 0aa67a2..1ada849 100644 (file)
@@ -40,9 +40,9 @@ __iomem void *plat_of_remap_node(const char *node)
        if (of_address_to_resource(np, 0, &res))
                panic("Failed to get resource for %s", node);
 
-       if ((request_mem_region(res.start,
+       if (!request_mem_region(res.start,
                                resource_size(&res),
-                               res.name) < 0))
+                               res.name))
                panic("Failed to request resources for %s", node);
 
        return ioremap_nocache(res.start, resource_size(&res));
@@ -66,13 +66,21 @@ static int __init early_init_dt_find_memory(unsigned long node,
 
 void __init plat_mem_setup(void)
 {
+       void *dtb = NULL;
+
        set_io_port_base(KSEG1);
 
        /*
         * Load the builtin devicetree. This causes the chosen node to be
-        * parsed resulting in our memory appearing
+        * parsed resulting in our memory appearing. fw_passed_dtb is used
+        * by CONFIG_MIPS_APPENDED_RAW_DTB as well.
         */
-       __dt_setup_arch(__dtb_start);
+       if (fw_passed_dtb)
+               dtb = (void *)fw_passed_dtb;
+       else if (__dtb_start != __dtb_end)
+               dtb = (void *)__dtb_start;
+
+       __dt_setup_arch(dtb);
 
        of_scan_flat_dt(early_init_dt_find_memory, NULL);
        if (memory_dtb)
index 5a73c5e..23198c9 100644 (file)
@@ -30,8 +30,10 @@ const char *get_system_type(void)
        return soc_info.sys_type;
 }
 
-static __init void prom_init_cmdline(int argc, char **argv)
+static __init void prom_init_cmdline(void)
 {
+       int argc;
+       char **argv;
        int i;
 
        pr_debug("prom: fw_arg0=%08x fw_arg1=%08x fw_arg2=%08x fw_arg3=%08x\n",
@@ -60,14 +62,11 @@ static __init void prom_init_cmdline(int argc, char **argv)
 
 void __init prom_init(void)
 {
-       int argc;
-       char **argv;
-
        prom_soc_init(&soc_info);
 
        pr_info("SoC Type: %s\n", get_system_type());
 
-       prom_init_cmdline(argc, argv);
+       prom_init_cmdline();
 }
 
 void __init prom_free_prom_memory(void)
index 285796e..60e44cc 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/module.h>
 
 #include <asm/mipsregs.h>
 #include <asm/mach-ralink/ralink_regs.h>
@@ -40,16 +39,6 @@ static struct rt2880_pmx_group rt2880_pinmux_data_act[] = {
        { 0 }
 };
 
-static void rt288x_wdt_reset(void)
-{
-       u32 t;
-
-       /* enable WDT reset output on pin SRAM_CS_N */
-       t = rt_sysc_r32(SYSC_REG_CLKCFG);
-       t |= CLKCFG_SRAM_CS_N_WDT;
-       rt_sysc_w32(t, SYSC_REG_CLKCFG);
-}
-
 void __init ralink_clk_init(void)
 {
        unsigned long cpu_rate, wmac_rate = 40000000;
@@ -75,6 +64,7 @@ void __init ralink_clk_init(void)
        ralink_clk_add("300100.timer", cpu_rate / 2);
        ralink_clk_add("300120.watchdog", cpu_rate / 2);
        ralink_clk_add("300500.uart", cpu_rate / 2);
+       ralink_clk_add("300900.i2c", cpu_rate / 2);
        ralink_clk_add("300c00.uartlite", cpu_rate / 2);
        ralink_clk_add("400000.ethernet", cpu_rate / 2);
        ralink_clk_add("480000.wmac", wmac_rate);
index c8a28c4..93d472c 100644 (file)
@@ -12,8 +12,9 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/module.h>
+#include <linux/bug.h>
 
+#include <asm/io.h>
 #include <asm/mipsregs.h>
 #include <asm/mach-ralink/ralink_regs.h>
 #include <asm/mach-ralink/rt305x.h>
@@ -89,17 +90,6 @@ static struct rt2880_pmx_group rt5350_pinmux_data[] = {
        { 0 }
 };
 
-static void rt305x_wdt_reset(void)
-{
-       u32 t;
-
-       /* enable WDT reset output on pin SRAM_CS_N */
-       t = rt_sysc_r32(SYSC_REG_SYSTEM_CONFIG);
-       t |= RT305X_SYSCFG_SRAM_CS0_MODE_WDT <<
-               RT305X_SYSCFG_SRAM_CS0_MODE_SHIFT;
-       rt_sysc_w32(t, SYSC_REG_SYSTEM_CONFIG);
-}
-
 static unsigned long rt5350_get_mem_size(void)
 {
        void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT305X_SYSC_BASE);
@@ -200,6 +190,8 @@ void __init ralink_clk_init(void)
 
        ralink_clk_add("cpu", cpu_rate);
        ralink_clk_add("sys", sys_rate);
+       ralink_clk_add("10000900.i2c", uart_rate);
+       ralink_clk_add("10000a00.i2s", uart_rate);
        ralink_clk_add("10000b00.spi", sys_rate);
        ralink_clk_add("10000b40.spi", sys_rate);
        ralink_clk_add("10000100.timer", wdt_rate);
index 4cef916..c4ffd43 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/module.h>
 
 #include <asm/mipsregs.h>
 #include <asm/mach-ralink/ralink_regs.h>
@@ -63,16 +62,6 @@ static struct rt2880_pmx_group rt3883_pinmux_data[] = {
        { 0 }
 };
 
-static void rt3883_wdt_reset(void)
-{
-       u32 t;
-
-       /* enable WDT reset output on GPIO 2 */
-       t = rt_sysc_r32(RT3883_SYSC_REG_SYSCFG1);
-       t |= RT3883_SYSCFG1_GPIO2_AS_WDT_OUT;
-       rt_sysc_w32(t, RT3883_SYSC_REG_SYSCFG1);
-}
-
 void __init ralink_clk_init(void)
 {
        unsigned long cpu_rate, sys_rate;
@@ -108,6 +97,8 @@ void __init ralink_clk_init(void)
        ralink_clk_add("10000100.timer", sys_rate);
        ralink_clk_add("10000120.watchdog", sys_rate);
        ralink_clk_add("10000500.uart", 40000000);
+       ralink_clk_add("10000900.i2c", 40000000);
+       ralink_clk_add("10000a00.i2s", 40000000);
        ralink_clk_add("10000b00.spi", sys_rate);
        ralink_clk_add("10000b40.spi", sys_rate);
        ralink_clk_add("10000c00.uartlite", 40000000);
@@ -155,5 +146,5 @@ void prom_soc_init(struct ralink_soc_info *soc_info)
 
        rt2880_pinmux_data = rt3883_pinmux_data;
 
-       ralink_soc == RT3883_SOC;
+       ralink_soc = RT3883_SOC;
 }
index 8077ff3..d4469b2 100644 (file)
@@ -71,11 +71,6 @@ static int rt_timer_request(struct rt_timer *rt)
        return err;
 }
 
-static void rt_timer_free(struct rt_timer *rt)
-{
-       free_irq(rt->irq, rt);
-}
-
 static int rt_timer_config(struct rt_timer *rt, unsigned long divisor)
 {
        if (rt->timer_freq < divisor)
@@ -101,15 +96,6 @@ static int rt_timer_enable(struct rt_timer *rt)
        return 0;
 }
 
-static void rt_timer_disable(struct rt_timer *rt)
-{
-       u32 t;
-
-       t = rt_timer_r32(rt, TIMER_REG_TMR0CTL);
-       t &= ~TMR0CTL_ENABLE;
-       rt_timer_w32(rt, TIMER_REG_TMR0CTL, t);
-}
-
 static int rt_timer_probe(struct platform_device *pdev)
 {
        struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
index 3a431e8..25cc250 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/kernel_stat.h>
-#include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/types.h>
index 657210e..6484e4a 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/string.h>
 #include <linux/console.h>
 #include <linux/bootmem.h>
index b7a4b7e..e8f6b3a 100644 (file)
@@ -25,7 +25,7 @@ endif
 # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys
 #
 ifdef CONFIG_SGI_IP28
-  ifeq ($(call cc-option-yn,-mr10k-cache-barrier=store), n)
+  ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n)
       $(error gcc doesn't support needed option -mr10k-cache-barrier=store)
   endif
 endif
index bb70589..396956e 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (C) 1998 Ralf Baechle
  */
 
+#include <linux/export.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/types.h>
 
 #include <asm/io.h>
index 6b009c4..db5a640 100644 (file)
@@ -8,8 +8,9 @@
  */
 
 #include <linux/init.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/kernel.h>
+#include <linux/spinlock.h>
 
 #include <asm/io.h>
 #include <asm/bootinfo.h>
index e077036..cc6133b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2003 Ladislav Michl (ladis@linux-mips.org)
  */
-#include <linux/module.h>
+#include <linux/export.h>
 
 #include <asm/sgi/hpc3.h>
 #include <asm/sgi/ip22.h>
index 2f45b03..a36f6b8 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/rtc/ds1286.h>
-#include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index c7bdfe4..8721599 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/kernel.h>
 #include <linux/kdev_t.h>
 #include <linux/types.h>
-#include <linux/module.h>
 #include <linux/console.h>
 #include <linux/sched.h>
 #include <linux/tty.h>
index 2e0edb3..f8919b6 100644 (file)
@@ -9,11 +9,9 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/signal.h>      /* for SIGBUS */
 #include <linux/sched.h>       /* schow_regs(), force_sig() */
 
-#include <asm/module.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/sn0/hub.h>
index 570098b..e501c43 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/sched.h>
 #include <linux/smp.h>
 #include <linux/mm.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/cpumask.h>
 #include <asm/cpu.h>
 #include <asm/io.h>
index bda90cf..2beb039 100644 (file)
@@ -82,7 +82,7 @@ static __init void copy_kernel(nasid_t dest_nasid)
        memcpy((void *)dest_kern_start, (void *)source_start, kern_size);
 }
 
-void __init replicate_kernel_text()
+void __init replicate_kernel_text(void)
 {
        cnodeid_t cnode;
        nasid_t client_nasid;
index f1f8829..59133d0 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/memblock.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/nodemask.h>
 #include <linux/swap.h>
 #include <linux/bootmem.h>
index 563c614..a8e0c77 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <asm/bootinfo.h>
 #include <asm/io.h>
 #include <asm/mipsregs.h>
index e0c7d9e..838d858 100644 (file)
 #include <asm/ip32/ip32_ints.h>
 
 /* issue a PIO read to make sure no PIO writes are pending */
-static void inline flush_crime_bus(void)
+static inline void flush_crime_bus(void)
 {
        crime->control;
 }
 
-static void inline flush_mace_bus(void)
+static inline void flush_mace_bus(void)
 {
        mace->perif.ctrl.misc;
 }
index 8e2e04f..a05246c 100644 (file)
@@ -17,7 +17,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/reboot.h>
 #include <linux/string.h>
 
index 9d3c24e..90e4378 100644 (file)
@@ -15,8 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
+#include <linux/export.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/reboot.h>
 #include <linux/string.h>
index 566c58b..2203c25 100644 (file)
@@ -55,8 +55,8 @@ static ssize_t raw_store(struct device *dev,
        return size;
 }
 
-static DEVICE_ATTR(ascii, 0200, NULL, ascii_store);
-static DEVICE_ATTR(raw, 0200, NULL, raw_store);
+static DEVICE_ATTR_WO(ascii);
+static DEVICE_ATTR_WO(raw);
 
 static ssize_t map_seg7_show(struct device *dev,
                             struct device_attribute *attr,
index 285d84e..0bd2a1e 100644 (file)
@@ -55,7 +55,7 @@ int __init txx9_pci66_check(struct pci_controller *hose, int top_bus,
        /* It seems SLC90E66 needs some time after PCI reset... */
        mdelay(80);
 
-       printk(KERN_INFO "PCI: Checking 66MHz capabilities...\n");
+       pr_info("PCI: Checking 66MHz capabilities...\n");
 
        for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) {
                if (PCI_FUNC(pci_devfn))
@@ -74,9 +74,8 @@ int __init txx9_pci66_check(struct pci_controller *hose, int top_bus,
                        early_read_config_word(hose, top_bus, current_bus,
                                               pci_devfn, PCI_STATUS, &stat);
                        if (!(stat & PCI_STATUS_66MHZ)) {
-                               printk(KERN_DEBUG
-                                      "PCI: %02x:%02x not 66MHz capable.\n",
-                                      current_bus, pci_devfn);
+                               pr_debug("PCI: %02x:%02x not 66MHz capable.\n",
+                                        current_bus, pci_devfn);
                                cap66 = 0;
                                break;
                        }
@@ -209,8 +208,8 @@ txx9_alloc_pci_controller(struct pci_controller *pcic,
 
        pcic->mem_offset = 0;   /* busaddr == physaddr */
 
-       printk(KERN_INFO "PCI: IO %pR MEM %pR\n",
-              &pcic->mem_resource[1], &pcic->mem_resource[0]);
+       pr_info("PCI: IO %pR MEM %pR\n", &pcic->mem_resource[1],
+               &pcic->mem_resource[0]);
 
        /* register_pci_controller() will request MEM resource */
        release_resource(&pcic->mem_resource[0]);
@@ -219,7 +218,7 @@ txx9_alloc_pci_controller(struct pci_controller *pcic,
        release_resource(&pcic->mem_resource[0]);
  free_and_exit:
        kfree(new);
-       printk(KERN_ERR "PCI: Failed to allocate resources.\n");
+       pr_err("PCI: Failed to allocate resources.\n");
        return NULL;
 }
 
@@ -260,7 +259,7 @@ static int txx9_i8259_irq_setup(int irq)
        err = request_irq(irq, &i8259_interrupt, IRQF_SHARED,
                          "cascade(i8259)", (void *)(long)irq);
        if (!err)
-               printk(KERN_INFO "PCI-ISA bridge PIC (irq %d)\n", irq);
+               pr_info("PCI-ISA bridge PIC (irq %d)\n", irq);
        return err;
 }
 
@@ -308,13 +307,13 @@ static void quirk_slc90e66_ide(struct pci_dev *dev)
        /* SMSC SLC90E66 IDE uses irq 14, 15 (default) */
        pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 14);
        pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &dat);
-       printk(KERN_INFO "PCI: %s: IRQ %02x", pci_name(dev), dat);
+       pr_info("PCI: %s: IRQ %02x", pci_name(dev), dat);
        /* enable SMSC SLC90E66 IDE */
        for (i = 0; i < ARRAY_SIZE(regs); i++) {
                pci_read_config_byte(dev, regs[i], &dat);
                pci_write_config_byte(dev, regs[i], dat | 0x80);
                pci_read_config_byte(dev, regs[i], &dat);
-               printk(KERN_CONT " IDETIM%d %02x", i, dat);
+               pr_cont(" IDETIM%d %02x", i, dat);
        }
        pci_read_config_byte(dev, 0x5c, &dat);
        /*
@@ -329,8 +328,7 @@ static void quirk_slc90e66_ide(struct pci_dev *dev)
        dat |= 0x01;
        pci_write_config_byte(dev, 0x5c, dat);
        pci_read_config_byte(dev, 0x5c, &dat);
-       printk(KERN_CONT " REG5C %02x", dat);
-       printk(KERN_CONT "\n");
+       pr_cont(" REG5C %02x\n", dat);
 }
 #endif /* CONFIG_TOSHIBA_FPCIB0 */
 
@@ -352,7 +350,7 @@ static void final_fixup(struct pci_dev *dev)
            (bist & PCI_BIST_CAPABLE)) {
                unsigned long timeout;
                pci_set_power_state(dev, PCI_D0);
-               printk(KERN_INFO "PCI: %s BIST...", pci_name(dev));
+               pr_info("PCI: %s BIST...", pci_name(dev));
                pci_write_config_byte(dev, PCI_BIST, PCI_BIST_START);
                timeout = jiffies + HZ * 2;     /* timeout after 2 sec */
                do {
@@ -361,9 +359,9 @@ static void final_fixup(struct pci_dev *dev)
                                break;
                } while (bist & PCI_BIST_START);
                if (bist & (PCI_BIST_CODE_MASK | PCI_BIST_START))
-                       printk(KERN_CONT "failed. (0x%x)\n", bist);
+                       pr_cont("failed. (0x%x)\n", bist);
                else
-                       printk(KERN_CONT "OK.\n");
+                       pr_cont("OK.\n");
        }
 }
 
index a1d98b5..1791a44 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/string.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include <linux/err.h>
index d3b83a9..33f7a72 100644 (file)
@@ -67,9 +67,9 @@ void __init tx3927_setup(void)
        /* do reset on watchdog */
        tx3927_ccfgptr->ccfg |= TX3927_CCFG_WR;
 
-       printk(KERN_INFO "TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n",
-              tx3927_ccfgptr->crir,
-              tx3927_ccfgptr->ccfg, tx3927_ccfgptr->pcfg);
+       pr_info("TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n",
+               tx3927_ccfgptr->crir, tx3927_ccfgptr->ccfg,
+               tx3927_ccfgptr->pcfg);
 
        /* TMR */
        for (i = 0; i < TX3927_NR_TMR; i++)
index 8d80115..46e9c41 100644 (file)
@@ -183,15 +183,14 @@ void __init tx4927_setup(void)
        if (!(____raw_readq(&tx4927_ccfgptr->ccfg) & TX4927_CCFG_PCIARB))
                txx9_clear64(&tx4927_ccfgptr->pcfg, TX4927_PCFG_PCICLKEN_ALL);
 
-       printk(KERN_INFO "%s -- %dMHz(M%dMHz) CRIR:%08x CCFG:%llx PCFG:%llx\n",
-              txx9_pcode_str,
-              (cpuclk + 500000) / 1000000,
-              (txx9_master_clock + 500000) / 1000000,
-              (__u32)____raw_readq(&tx4927_ccfgptr->crir),
-              (unsigned long long)____raw_readq(&tx4927_ccfgptr->ccfg),
-              (unsigned long long)____raw_readq(&tx4927_ccfgptr->pcfg));
+       pr_info("%s -- %dMHz(M%dMHz) CRIR:%08x CCFG:%llx PCFG:%llx\n",
+               txx9_pcode_str, (cpuclk + 500000) / 1000000,
+               (txx9_master_clock + 500000) / 1000000,
+               (__u32)____raw_readq(&tx4927_ccfgptr->crir),
+               ____raw_readq(&tx4927_ccfgptr->ccfg),
+               ____raw_readq(&tx4927_ccfgptr->pcfg));
 
-       printk(KERN_INFO "%s SDRAMC --", txx9_pcode_str);
+       pr_info("%s SDRAMC --", txx9_pcode_str);
        for (i = 0; i < 4; i++) {
                __u64 cr = TX4927_SDRAMC_CR(i);
                unsigned long base, size;
@@ -199,15 +198,14 @@ void __init tx4927_setup(void)
                        continue;       /* disabled */
                base = (unsigned long)(cr >> 49) << 21;
                size = (((unsigned long)(cr >> 33) & 0x7fff) + 1) << 21;
-               printk(" CR%d:%016llx", i, (unsigned long long)cr);
+               pr_cont(" CR%d:%016llx", i, cr);
                tx4927_sdram_resource[i].name = "SDRAM";
                tx4927_sdram_resource[i].start = base;
                tx4927_sdram_resource[i].end = base + size - 1;
                tx4927_sdram_resource[i].flags = IORESOURCE_MEM;
                request_resource(&iomem_resource, &tx4927_sdram_resource[i]);
        }
-       printk(" TR:%09llx\n",
-              (unsigned long long)____raw_readq(&tx4927_sdramcptr->tr));
+       pr_cont(" TR:%09llx\n", ____raw_readq(&tx4927_sdramcptr->tr));
 
        /* TMR */
        /* disable all timers */
index ba265bf..85d1795 100644 (file)
@@ -196,15 +196,14 @@ void __init tx4938_setup(void)
        if (!(____raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCIARB))
                txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_PCICLKEN_ALL);
 
-       printk(KERN_INFO "%s -- %dMHz(M%dMHz) CRIR:%08x CCFG:%llx PCFG:%llx\n",
-              txx9_pcode_str,
-              (cpuclk + 500000) / 1000000,
-              (txx9_master_clock + 500000) / 1000000,
-              (__u32)____raw_readq(&tx4938_ccfgptr->crir),
-              (unsigned long long)____raw_readq(&tx4938_ccfgptr->ccfg),
-              (unsigned long long)____raw_readq(&tx4938_ccfgptr->pcfg));
-
-       printk(KERN_INFO "%s SDRAMC --", txx9_pcode_str);
+       pr_info("%s -- %dMHz(M%dMHz) CRIR:%08x CCFG:%llx PCFG:%llx\n",
+               txx9_pcode_str, (cpuclk + 500000) / 1000000,
+               (txx9_master_clock + 500000) / 1000000,
+               (__u32)____raw_readq(&tx4938_ccfgptr->crir),
+               ____raw_readq(&tx4938_ccfgptr->ccfg),
+               ____raw_readq(&tx4938_ccfgptr->pcfg));
+
+       pr_info("%s SDRAMC --", txx9_pcode_str);
        for (i = 0; i < 4; i++) {
                __u64 cr = TX4938_SDRAMC_CR(i);
                unsigned long base, size;
@@ -212,15 +211,14 @@ void __init tx4938_setup(void)
                        continue;       /* disabled */
                base = (unsigned long)(cr >> 49) << 21;
                size = (((unsigned long)(cr >> 33) & 0x7fff) + 1) << 21;
-               printk(" CR%d:%016llx", i, (unsigned long long)cr);
+               pr_cont(" CR%d:%016llx", i, cr);
                tx4938_sdram_resource[i].name = "SDRAM";
                tx4938_sdram_resource[i].start = base;
                tx4938_sdram_resource[i].end = base + size - 1;
                tx4938_sdram_resource[i].flags = IORESOURCE_MEM;
                request_resource(&iomem_resource, &tx4938_sdram_resource[i]);
        }
-       printk(" TR:%09llx\n",
-              (unsigned long long)____raw_readq(&tx4938_sdramcptr->tr));
+       pr_cont(" TR:%09llx\n", ____raw_readq(&tx4938_sdramcptr->tr));
 
        /* SRAM */
        if (txx9_pcode == 0x4938 && ____raw_readq(&tx4938_sramcptr->cr) & 1) {
@@ -254,20 +252,20 @@ void __init tx4938_setup(void)
                        txx9_clear64(&tx4938_ccfgptr->clkctr,
                                     TX4938_CLKCTR_PCIC1RST);
                } else {
-                       printk(KERN_INFO "%s: stop PCIC1\n", txx9_pcode_str);
+                       pr_info("%s: stop PCIC1\n", txx9_pcode_str);
                        /* stop PCIC1 */
                        txx9_set64(&tx4938_ccfgptr->clkctr,
                                   TX4938_CLKCTR_PCIC1CKD);
                }
                if (!(pcfg & TX4938_PCFG_ETH0_SEL)) {
-                       printk(KERN_INFO "%s: stop ETH0\n", txx9_pcode_str);
+                       pr_info("%s: stop ETH0\n", txx9_pcode_str);
                        txx9_set64(&tx4938_ccfgptr->clkctr,
                                   TX4938_CLKCTR_ETH0RST);
                        txx9_set64(&tx4938_ccfgptr->clkctr,
                                   TX4938_CLKCTR_ETH0CKD);
                }
                if (!(pcfg & TX4938_PCFG_ETH1_SEL)) {
-                       printk(KERN_INFO "%s: stop ETH1\n", txx9_pcode_str);
+                       pr_info("%s: stop ETH1\n", txx9_pcode_str);
                        txx9_set64(&tx4938_ccfgptr->clkctr,
                                   TX4938_CLKCTR_ETH1RST);
                        txx9_set64(&tx4938_ccfgptr->clkctr,
index 402ac2e..2749289 100644 (file)
@@ -221,8 +221,8 @@ void __init tx4939_setup(void)
                (txx9_master_clock + 500000) / 1000000,
                (txx9_gbus_clock + 500000) / 1000000,
                (__u32)____raw_readq(&tx4939_ccfgptr->crir),
-               (unsigned long long)____raw_readq(&tx4939_ccfgptr->ccfg),
-               (unsigned long long)____raw_readq(&tx4939_ccfgptr->pcfg));
+               ____raw_readq(&tx4939_ccfgptr->ccfg),
+               ____raw_readq(&tx4939_ccfgptr->pcfg));
 
        pr_info("%s DDRC -- EN:%08x", txx9_pcode_str,
                (__u32)____raw_readq(&tx4939_ddrcptr->winen));
@@ -230,7 +230,7 @@ void __init tx4939_setup(void)
                __u64 win = ____raw_readq(&tx4939_ddrcptr->win[i]);
                if (!((__u32)____raw_readq(&tx4939_ddrcptr->winen) & (1 << i)))
                        continue;       /* disabled */
-               printk(KERN_CONT " #%d:%016llx", i, (unsigned long long)win);
+               pr_cont(" #%d:%016llx", i, win);
                tx4939_sdram_resource[i].name = "DDR SDRAM";
                tx4939_sdram_resource[i].start =
                        (unsigned long)(win >> 48) << 20;
@@ -240,7 +240,7 @@ void __init tx4939_setup(void)
                tx4939_sdram_resource[i].flags = IORESOURCE_MEM;
                request_resource(&iomem_resource, &tx4939_sdram_resource[i]);
        }
-       printk(KERN_CONT "\n");
+       pr_cont("\n");
 
        /* SRAM */
        if (____raw_readq(&tx4939_sramcptr->cr) & 1) {
index f98baa6..40f4098 100644 (file)
@@ -105,9 +105,8 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
        u8 chip_id;
 
        if (g_smsc_fdc37m81x_base)
-               printk(KERN_WARNING "%s: stepping on old base=0x%0*lx\n",
-                      __func__,
-                      field, g_smsc_fdc37m81x_base);
+               pr_warn("%s: stepping on old base=0x%0*lx\n", __func__, field,
+                       g_smsc_fdc37m81x_base);
 
        g_smsc_fdc37m81x_base = port;
 
@@ -117,8 +116,7 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
        if (chip_id == SMSC_FDC37M81X_CHIP_ID)
                smsc_fdc37m81x_config_end();
        else {
-               printk(KERN_WARNING "%s: unknown chip id 0x%02x\n", __func__,
-                      chip_id);
+               pr_warn("%s: unknown chip id 0x%02x\n", __func__, chip_id);
                g_smsc_fdc37m81x_base = 0;
        }
 
@@ -128,9 +126,8 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
 #ifdef DEBUG
 static void smsc_fdc37m81x_config_dump_one(const char *key, u8 dev, u8 reg)
 {
-       printk(KERN_INFO "%s: dev=0x%02x reg=0x%02x val=0x%02x\n",
-              key, dev, reg,
-              smsc_fdc37m81x_rd(reg));
+       pr_info("%s: dev=0x%02x reg=0x%02x val=0x%02x\n", key, dev, reg,
+               smsc_fdc37m81x_rd(reg));
 }
 
 void smsc_fdc37m81x_config_dump(void)
@@ -142,7 +139,7 @@ void smsc_fdc37m81x_config_dump(void)
 
        orig = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DNUM);
 
-       printk(KERN_INFO "%s: common\n", fname);
+       pr_info("%s: common\n", fname);
        smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
                                       SMSC_FDC37M81X_DNUM);
        smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
@@ -154,7 +151,7 @@ void smsc_fdc37m81x_config_dump(void)
        smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
                                       SMSC_FDC37M81X_PMGT);
 
-       printk(KERN_INFO "%s: keyboard\n", fname);
+       pr_info("%s: keyboard\n", fname);
        smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, SMSC_FDC37M81X_KBD);
        smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD,
                                       SMSC_FDC37M81X_ACTIVE);
index c899c0c..68a9647 100644 (file)
@@ -45,7 +45,7 @@ void __init jmr3927_prom_init(void)
 {
        /* CCFG */
        if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0)
-               printk(KERN_ERR "TX3927 TLB off\n");
+               pr_err("TX3927 TLB off\n");
 
        add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM);
        txx9_sio_putchar_init(TX3927_SIO_REG(1));
index a455166..6139438 100644 (file)
@@ -150,12 +150,11 @@ static void __init jmr3927_board_init(void)
 
        jmr3927_led_set(0);
 
-       printk(KERN_INFO
-              "JMR-TX3927 (Rev %d) --- IOC(Rev %d) DIPSW:%d,%d,%d,%d\n",
-              jmr3927_ioc_reg_in(JMR3927_IOC_BREV_ADDR) & JMR3927_REV_MASK,
-              jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR) & JMR3927_REV_MASK,
-              jmr3927_dipsw1(), jmr3927_dipsw2(),
-              jmr3927_dipsw3(), jmr3927_dipsw4());
+       pr_info("JMR-TX3927 (Rev %d) --- IOC(Rev %d) DIPSW:%d,%d,%d,%d\n",
+               jmr3927_ioc_reg_in(JMR3927_IOC_BREV_ADDR) & JMR3927_REV_MASK,
+               jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR) & JMR3927_REV_MASK,
+               jmr3927_dipsw1(), jmr3927_dipsw2(),
+               jmr3927_dipsw3(), jmr3927_dipsw4());
 }
 
 /* This trick makes rtc-ds1742 driver usable as is. */
index 07939ed..e68eb2e 100644 (file)
@@ -123,15 +123,15 @@ static int __init rbtx4938_ethaddr_init(void)
 
        /* 0-3: "MAC\0", 4-9:eth0, 10-15:eth1, 16:sum */
        if (spi_eeprom_read(SPI_BUSNO, SEEPROM1_CS, 0, dat, sizeof(dat))) {
-               printk(KERN_ERR "seeprom: read error.\n");
+               pr_err("seeprom: read error.\n");
                return -ENODEV;
        } else {
                if (strcmp(dat, "MAC") != 0)
-                       printk(KERN_WARNING "seeprom: bad signature.\n");
+                       pr_warn("seeprom: bad signature.\n");
                for (i = 0, sum = 0; i < sizeof(dat); i++)
                        sum += dat[i];
                if (sum)
-                       printk(KERN_WARNING "seeprom: bad checksum.\n");
+                       pr_warn("seeprom: bad checksum.\n");
        }
        tx4938_ethaddr_init(&dat[4], &dat[4 + 6]);
 #endif /* CONFIG_PCI */
@@ -214,14 +214,14 @@ static void __init rbtx4938_mem_setup(void)
        rbtx4938_fpga_resource.end = CPHYSADDR(RBTX4938_FPGA_REG_ADDR) + 0xffff;
        rbtx4938_fpga_resource.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
        if (request_resource(&txx9_ce_res[2], &rbtx4938_fpga_resource))
-               printk(KERN_ERR "request resource for fpga failed\n");
+               pr_err("request resource for fpga failed\n");
 
        _machine_restart = rbtx4938_machine_restart;
 
        writeb(0xff, rbtx4938_led_addr);
-       printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n",
-              readb(rbtx4938_fpga_rev_addr),
-              readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr));
+       pr_info("RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n",
+               readb(rbtx4938_fpga_rev_addr),
+               readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr));
 }
 
 static void __init rbtx4938_ne_init(void)
index c3dc12a..b47d2a4 100644 (file)
@@ -11,6 +11,7 @@ cflags-vdso := $(ccflags-vdso) \
        $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
        -O2 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
        -DDISABLE_BRANCH_PROFILING \
+       $(call cc-option, -fno-asynchronous-unwind-tables) \
        $(call cc-option, -fno-stack-protector)
 aflags-vdso := $(ccflags-vdso) \
        -D__ASSEMBLY__ -Wa,-gdwarf-2
@@ -50,6 +51,9 @@ quiet_cmd_vdsold = VDSO    $@
       cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \
                    -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@
 
+quiet_cmd_vdsoas_o_S = AS       $@
+      cmd_vdsoas_o_S = $(CC) $(a_flags) -c -o $@ $<
+
 # Strip rule for the raw .so files
 $(obj)/%.so.raw: OBJCOPYFLAGS := -S
 $(obj)/%.so.raw: $(obj)/%.so.dbg.raw FORCE
@@ -110,7 +114,7 @@ $(obj-vdso-o32): KBUILD_CFLAGS := $(cflags-vdso) -mabi=32
 $(obj-vdso-o32): KBUILD_AFLAGS := $(aflags-vdso) -mabi=32
 
 $(obj)/%-o32.o: $(src)/%.S FORCE
-       $(call if_changed_dep,as_o_S)
+       $(call if_changed_dep,vdsoas_o_S)
 
 $(obj)/%-o32.o: $(src)/%.c FORCE
        $(call cmd,force_checksrc)
@@ -150,7 +154,7 @@ $(obj-vdso-n32): KBUILD_CFLAGS := $(cflags-vdso) -mabi=n32
 $(obj-vdso-n32): KBUILD_AFLAGS := $(aflags-vdso) -mabi=n32
 
 $(obj)/%-n32.o: $(src)/%.S FORCE
-       $(call if_changed_dep,as_o_S)
+       $(call if_changed_dep,vdsoas_o_S)
 
 $(obj)/%-n32.o: $(src)/%.c FORCE
        $(call cmd,force_checksrc)
index ff7d1c6..8290672 100644 (file)
  *  Yoichi Yuasa <yuasa@linux-mips.org>
  *  - Added support for NEC VR4133.
  */
+#include <linux/export.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/types.h>
 
+#include <asm/cpu-type.h>
 #include <asm/cpu.h>
 #include <asm/io.h>
 
index 89bac98..1534b35 100644 (file)
@@ -28,9 +28,9 @@
  *  Yoichi Yuasa <yuasa@linux-mips.org>
  *  - Added support for NEC VR4133.
  */
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
-#include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
index 41e873b..745b7b4 100644 (file)
  *  - Coped with INTASSIGN of NEC VR4133.
  */
 #include <linux/errno.h>
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/irq.h>
-#include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/types.h>
 
index ae0e4ee..28211f3 100644 (file)
@@ -17,8 +17,8 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#include <linux/export.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
 #include <linux/irq.h>
 
 #include <asm/irq_cpu.h>
index c4d1a71..a127cca 100644 (file)
 
 #include <linux/of.h>
 #include <linux/of_irq.h>
+#include <linux/irqchip.h>
 
 #include <asm/irq_cpu.h>
 
-static struct of_device_id of_irq_ids[] __initdata = {
-       { .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init },
-       {},
-};
 
 void __init arch_init_irq(void)
 {
-       of_irq_init(of_irq_ids);
+       irqchip_init();
 }
index d4bea3c..84cf2f3 100644 (file)
@@ -2112,7 +2112,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
                        continue;
 
                /* Allocate an alias_prop with enough space for the stem */
-               ap = dt_alloc(sizeof(*ap) + len + 1, 4);
+               ap = dt_alloc(sizeof(*ap) + len + 1, __alignof__(*ap));
                if (!ap)
                        continue;
                memset(ap, 0, sizeof(*ap) + len + 1);
index c9b5cac..82967b0 100644 (file)
@@ -738,9 +738,12 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
        const char *pathp;
        int offset, rc = 0, depth = -1;
 
-        for (offset = fdt_next_node(blob, -1, &depth);
-             offset >= 0 && depth >= 0 && !rc;
-             offset = fdt_next_node(blob, offset, &depth)) {
+       if (!blob)
+               return 0;
+
+       for (offset = fdt_next_node(blob, -1, &depth);
+            offset >= 0 && depth >= 0 && !rc;
+            offset = fdt_next_node(blob, offset, &depth)) {
 
                pathp = fdt_get_name(blob, offset, NULL);
                if (*pathp == '/')
index 1792198..d6ca649 100644 (file)
@@ -284,7 +284,7 @@ ksym_dep_filter =                                                            \
            $(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;;        \
          as_*_S|cpp_s_S)                                                    \
            $(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;;        \
-         boot*|build*|*cpp_lds_S|dtc|host*|vdso*) : ;;                      \
+         boot*|build*|cpp_its_S|*cpp_lds_S|dtc|host*|vdso*) : ;;            \
          *) echo "Don't know how to preprocess $(1)" >&2; false ;;          \
        esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p'