Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'mips_4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips

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
...

+4089 -1028
+10
Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt
··· 1 + Imagination Technologies' Pistachio SoC based Marduk Board 2 + ========================================================== 3 + 4 + Compatible string must be "img,pistachio-marduk", "img,pistachio" 5 + 6 + Hardware and other related documentation is available at 7 + https://docs.creatordev.io/ci40/ 8 + 9 + It is also known as Creator Ci40. Marduk is legacy name and will 10 + be there for decades.
+7 -1
MAINTAINERS
··· 7707 7707 L: linux-man@vger.kernel.org 7708 7708 S: Maintained 7709 7709 7710 + MARDUK (CREATOR CI40) DEVICE TREE SUPPORT 7711 + M: Rahul Bedarkar <rahul.bedarkar@imgtec.com> 7712 + L: linux-mips@linux-mips.org 7713 + S: Maintained 7714 + F: arch/mips/boot/dts/img/pistachio_marduk.dts 7715 + 7710 7716 MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER 7711 7717 M: Andrew Lunn <andrew@lunn.ch> 7712 7718 M: Vivien Didelot <vivien.didelot@savoirfairelinux.com> ··· 9801 9795 S: Maintained 9802 9796 F: arch/mips/pistachio/ 9803 9797 F: arch/mips/include/asm/mach-pistachio/ 9804 - F: arch/mips/boot/dts/pistachio/ 9798 + F: arch/mips/boot/dts/img/pistachio* 9805 9799 F: arch/mips/configs/pistachio*_defconfig 9806 9800 9807 9801 PKTCDVD DRIVER
+29 -12
arch/mips/Kconfig
··· 9 9 select HAVE_CONTEXT_TRACKING 10 10 select HAVE_GENERIC_DMA_COHERENT 11 11 select HAVE_IDE 12 + select HAVE_IRQ_EXIT_ON_IRQ_STACK 12 13 select HAVE_OPROFILE 13 14 select HAVE_PERF_EVENTS 14 15 select PERF_USE_VMALLOC 15 16 select HAVE_ARCH_KGDB 17 + select HAVE_ARCH_MMAP_RND_BITS if MMU 18 + select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT 16 19 select HAVE_ARCH_SECCOMP_FILTER 17 20 select HAVE_ARCH_TRACEHOOK 18 21 select HAVE_CBPF_JIT if !CPU_MICROMIPS ··· 97 94 select PCI_DRIVERS_GENERIC 98 95 select PINCTRL 99 96 select SMP_UP if SMP 97 + select SWAP_IO_SPACE 100 98 select SYS_HAS_CPU_MIPS32_R1 101 99 select SYS_HAS_CPU_MIPS32_R2 102 100 select SYS_HAS_CPU_MIPS32_R6 ··· 482 478 select SYS_SUPPORTS_ZBOOT_UART16550 483 479 select USE_OF 484 480 select USE_GENERIC_EARLY_PRINTK_8250 481 + select XILINX_INTC 485 482 help 486 483 This enables support for the IMG University Program MIPSfpga platform. 487 484 ··· 914 909 select NR_CPUS_DEFAULT_16 915 910 select BUILTIN_DTB 916 911 select MTD_COMPLEX_MAPPINGS 912 + select SYS_SUPPORTS_RELOCATABLE 917 913 help 918 914 This option supports all of the Octeon reference boards from Cavium 919 915 Networks. It builds a kernel that dynamically determines the Octeon ··· 1433 1427 bool "Loongson 1C" 1434 1428 depends on SYS_HAS_CPU_LOONGSON1C 1435 1429 select CPU_LOONGSON1 1436 - select ARCH_WANT_OPTIONAL_GPIOLIB 1437 1430 select LEDS_GPIO_REGISTER 1438 1431 help 1439 1432 The Loongson 1C is a 32-bit SoC, which implements the MIPS32 ··· 2293 2288 2294 2289 config MIPSR2_TO_R6_EMULATOR 2295 2290 bool "MIPS R2-to-R6 emulator" 2296 - depends on CPU_MIPSR6 && !SMP 2291 + depends on CPU_MIPSR6 2297 2292 default y 2298 2293 help 2299 2294 Choose this option if you want to run non-R6 MIPS userland code. ··· 2301 2296 default. You can enable it using the 'mipsr2emu' kernel option. 2302 2297 The only reason this is a build-time option is to save ~14K from the 2303 2298 final kernel image. 2304 - comment "MIPS R2-to-R6 emulator is only available for UP kernels" 2305 - depends on SMP && CPU_MIPSR6 2306 2299 2307 2300 config MIPS_VPE_LOADER 2308 2301 bool "VPE loader support." ··· 2575 2572 2576 2573 config RELOCATABLE 2577 2574 bool "Relocatable kernel" 2578 - depends on SYS_SUPPORTS_RELOCATABLE && (CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_MIPS32_R6 || CPU_MIPS64_R6) 2575 + depends on SYS_SUPPORTS_RELOCATABLE && (CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_MIPS32_R6 || CPU_MIPS64_R6 || CAVIUM_OCTEON_SOC) 2579 2576 help 2580 2577 This builds a kernel image that retains relocation information 2581 2578 so it can be loaded someplace besides the default 1MB. ··· 2831 2828 made. 2832 2829 2833 2830 config CRASH_DUMP 2834 - bool "Kernel crash dumps" 2835 - help 2831 + bool "Kernel crash dumps" 2832 + help 2836 2833 Generate crash dump after being started by kexec. 2837 2834 This should be normally only set in special crash dump kernels 2838 2835 which are loaded in the main kernel with kexec-tools into ··· 2842 2839 PHYSICAL_START. 2843 2840 2844 2841 config PHYSICAL_START 2845 - hex "Physical address where the kernel is loaded" 2846 - default "0xffffffff84000000" if 64BIT 2847 - default "0x84000000" if 32BIT 2848 - depends on CRASH_DUMP 2849 - help 2842 + hex "Physical address where the kernel is loaded" 2843 + default "0xffffffff84000000" if 64BIT 2844 + default "0x84000000" if 32BIT 2845 + depends on CRASH_DUMP 2846 + help 2850 2847 This gives the CKSEG0 or KSEG0 address where the kernel is loaded. 2851 2848 If you plan to use kernel for capturing the crash dump change 2852 2849 this value to start of the reserved region (the "X" value as ··· 3077 3074 config MMU 3078 3075 bool 3079 3076 default y 3077 + 3078 + config ARCH_MMAP_RND_BITS_MIN 3079 + default 12 if 64BIT 3080 + default 8 3081 + 3082 + config ARCH_MMAP_RND_BITS_MAX 3083 + default 18 if 64BIT 3084 + default 15 3085 + 3086 + config ARCH_MMAP_RND_COMPAT_BITS_MIN 3087 + default 8 3088 + 3089 + config ARCH_MMAP_RND_COMPAT_BITS_MAX 3090 + default 15 3080 3091 3081 3092 config I8253 3082 3093 bool
+21 -14
arch/mips/Makefile
··· 131 131 132 132 cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \ 133 133 -fno-omit-frame-pointer 134 + 135 + # Some distribution-specific toolchains might pass the -fstack-check 136 + # option during the build, which adds a simple stack-probe at the beginning 137 + # of every function. This stack probe is to ensure that there is enough 138 + # stack space, else a SEGV is generated. This is not desirable for MIPS 139 + # as kernel stacks are small, placed in unmapped virtual memory, and do not 140 + # grow when overflowed. Especially on SGI IP27 platforms, this check will 141 + # lead to a NULL pointer dereference in _raw_spin_lock_irq. 142 + # 143 + # In disassembly, this stack probe appears at the top of a function as: 144 + # sd zero,<offset>(sp) 145 + # Where <offset> is a negative value. 146 + # 147 + cflags-y += -fno-stack-check 148 + 134 149 # 135 150 # CPU-dependent compiler/assembler options for optimization. 136 151 # ··· 335 320 bootz-y += vmlinuz.bin 336 321 bootz-y += vmlinuz.ecoff 337 322 bootz-y += vmlinuz.srec 323 + ifeq ($(shell expr $(zload-y) \< 0xffffffff80000000 2> /dev/null), 0) 324 + bootz-y += uzImage.bin 325 + endif 338 326 339 327 ifdef CONFIG_LASAT 340 328 rom.bin rom.sw: vmlinux 341 329 $(Q)$(MAKE) $(build)=arch/mips/lasat/image \ 342 330 $(bootvars-y) $@ 343 331 endif 344 - 345 - CMD_RELOCS = arch/mips/boot/tools/relocs 346 - quiet_cmd_relocs = RELOCS $< 347 - cmd_relocs = $(CMD_RELOCS) $< 348 332 349 333 # 350 334 # Some machines like the Indy need 32-bit ELF binaries for booting purposes. ··· 353 339 quiet_cmd_32 = OBJCOPY $@ 354 340 cmd_32 = $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@ 355 341 vmlinux.32: vmlinux 356 - ifeq ($(CONFIG_RELOCATABLE)$(CONFIG_64BIT),yy) 357 - # Currently, objcopy fails to handle the relocations in the elf64 358 - # So the relocs tool must be run here to remove them first 359 - $(call cmd,relocs) 360 - endif 361 342 $(call cmd,32) 362 343 363 344 # ··· 368 359 369 360 # boot 370 361 $(boot-y): $(vmlinux-32) FORCE 371 - ifeq ($(CONFIG_RELOCATABLE)$(CONFIG_32BIT),yy) 372 - $(call cmd,relocs) 373 - endif 374 362 $(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) \ 375 363 $(bootvars-y) arch/mips/boot/$@ 376 364 ··· 401 395 402 396 archprepare: 403 397 ifdef CONFIG_MIPS32_N32 404 - @echo ' Checking missing-syscalls for N32' 398 + @$(kecho) ' Checking missing-syscalls for N32' 405 399 $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=n32" 406 400 endif 407 401 ifdef CONFIG_MIPS32_O32 408 - @echo ' Checking missing-syscalls for O32' 402 + @$(kecho) ' Checking missing-syscalls for O32' 409 403 $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=32" 410 404 endif 411 405 ··· 439 433 echo ' uImage.gz - U-Boot image (gzip)' 440 434 echo ' uImage.lzma - U-Boot image (lzma)' 441 435 echo ' uImage.lzo - U-Boot image (lzo)' 436 + echo ' uzImage.bin - U-Boot image (self-extracting)' 442 437 echo ' dtbs - Device-tree blobs for enabled boards' 443 438 echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)' 444 439 echo
-1
arch/mips/alchemy/board-gpr.c
··· 236 236 static struct i2c_board_info gpr_i2c_info[] __initdata = { 237 237 { 238 238 I2C_BOARD_INFO("lm83", 0x18), 239 - .type = "lm83" 240 239 } 241 240 }; 242 241
+1 -1
arch/mips/alchemy/common/dbdma.c
··· 35 35 #include <linux/slab.h> 36 36 #include <linux/spinlock.h> 37 37 #include <linux/interrupt.h> 38 - #include <linux/module.h> 38 + #include <linux/export.h> 39 39 #include <linux/syscore_ops.h> 40 40 #include <asm/mach-au1x00/au1000.h> 41 41 #include <asm/mach-au1x00/au1xxx_dbdma.h>
+1 -1
arch/mips/alchemy/common/dma.c
··· 31 31 */ 32 32 33 33 #include <linux/init.h> 34 - #include <linux/module.h> 34 + #include <linux/export.h> 35 35 #include <linux/kernel.h> 36 36 #include <linux/errno.h> 37 37 #include <linux/spinlock.h>
-1
arch/mips/alchemy/common/gpiolib.c
··· 32 32 33 33 #include <linux/init.h> 34 34 #include <linux/kernel.h> 35 - #include <linux/module.h> 36 35 #include <linux/types.h> 37 36 #include <linux/gpio.h> 38 37 #include <asm/mach-au1x00/gpio-au1000.h>
-1
arch/mips/alchemy/common/prom.c
··· 33 33 * 675 Mass Ave, Cambridge, MA 02139, USA. 34 34 */ 35 35 36 - #include <linux/module.h> 37 36 #include <linux/init.h> 38 37 #include <linux/string.h> 39 38
+1 -1
arch/mips/alchemy/common/usb.c
··· 10 10 */ 11 11 12 12 #include <linux/clk.h> 13 + #include <linux/export.h> 13 14 #include <linux/init.h> 14 15 #include <linux/io.h> 15 - #include <linux/module.h> 16 16 #include <linux/spinlock.h> 17 17 #include <linux/syscore_ops.h> 18 18 #include <asm/cpu.h>
+1 -1
arch/mips/alchemy/common/vss.c
··· 6 6 * for various media blocks are enabled/disabled. 7 7 */ 8 8 9 - #include <linux/module.h> 9 + #include <linux/export.h> 10 10 #include <linux/spinlock.h> 11 11 #include <asm/mach-au1x00/au1000.h> 12 12
+2 -1
arch/mips/alchemy/devboards/bcsr.c
··· 9 9 10 10 #include <linux/interrupt.h> 11 11 #include <linux/irqchip/chained_irq.h> 12 - #include <linux/module.h> 12 + #include <linux/init.h> 13 + #include <linux/export.h> 13 14 #include <linux/spinlock.h> 14 15 #include <linux/irq.h> 15 16 #include <asm/addrspace.h>
+1 -1
arch/mips/ar7/clock.c
··· 21 21 #include <linux/kernel.h> 22 22 #include <linux/init.h> 23 23 #include <linux/types.h> 24 - #include <linux/module.h> 24 + #include <linux/export.h> 25 25 #include <linux/delay.h> 26 26 #include <linux/gcd.h> 27 27 #include <linux/io.h>
+2 -1
arch/mips/ar7/gpio.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 19 */ 20 20 21 - #include <linux/module.h> 21 + #include <linux/init.h> 22 + #include <linux/export.h> 22 23 #include <linux/gpio.h> 23 24 24 25 #include <asm/mach-ar7/ar7.h>
-1
arch/mips/ar7/memory.c
··· 19 19 #include <linux/bootmem.h> 20 20 #include <linux/init.h> 21 21 #include <linux/mm.h> 22 - #include <linux/module.h> 23 22 #include <linux/pfn.h> 24 23 #include <linux/proc_fs.h> 25 24 #include <linux/string.h>
-1
arch/mips/ar7/platform.c
··· 19 19 20 20 #include <linux/init.h> 21 21 #include <linux/types.h> 22 - #include <linux/module.h> 23 22 #include <linux/delay.h> 24 23 #include <linux/dma-mapping.h> 25 24 #include <linux/platform_device.h>
+1 -1
arch/mips/ar7/prom.c
··· 21 21 #include <linux/kernel.h> 22 22 #include <linux/serial_reg.h> 23 23 #include <linux/spinlock.h> 24 - #include <linux/module.h> 24 + #include <linux/export.h> 25 25 #include <linux/string.h> 26 26 #include <linux/io.h> 27 27 #include <asm/bootinfo.h>
+6 -4
arch/mips/ath79/clock.c
··· 12 12 */ 13 13 14 14 #include <linux/kernel.h> 15 - #include <linux/module.h> 16 15 #include <linux/init.h> 17 16 #include <linux/err.h> 18 17 #include <linux/clk.h> ··· 44 45 int err; 45 46 46 47 clk = clk_register_fixed_rate(NULL, id, NULL, 0, rate); 47 - if (!clk) 48 + if (IS_ERR(clk)) 48 49 panic("failed to allocate %s clock structure", id); 49 50 50 51 err = clk_register_clkdev(clk, id, NULL); ··· 507 508 ar9330_clk_init(ref_clk, pll_base); 508 509 else { 509 510 pr_err("%s: could not find any appropriate clk_init()\n", dnfn); 510 - goto err_clk; 511 + goto err_iounmap; 511 512 } 512 513 513 514 if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data)) { 514 515 pr_err("%s: could not register clk provider\n", dnfn); 515 - goto err_clk; 516 + goto err_iounmap; 516 517 } 517 518 518 519 return; 520 + 521 + err_iounmap: 522 + iounmap(pll_base); 519 523 520 524 err_clk: 521 525 clk_put(ref_clk);
+1 -1
arch/mips/ath79/common.c
··· 13 13 */ 14 14 15 15 #include <linux/kernel.h> 16 - #include <linux/module.h> 16 + #include <linux/export.h> 17 17 #include <linux/types.h> 18 18 #include <linux/spinlock.h> 19 19
+9
arch/mips/bcm47xx/board.c
··· 149 149 /* board_id */ 150 150 static const 151 151 struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = { 152 + {{BCM47XX_BOARD_LUXUL_ABR_4400_V1, "Luxul ABR-4400 V1"}, "luxul_abr4400_v1"}, 153 + {{BCM47XX_BOARD_LUXUL_XAP_310_V1, "Luxul XAP-310 V1"}, "luxul_xap310_v1"}, 154 + {{BCM47XX_BOARD_LUXUL_XAP_1210_V1, "Luxul XAP-1210 V1"}, "luxul_xap1210_v1"}, 155 + {{BCM47XX_BOARD_LUXUL_XAP_1230_V1, "Luxul XAP-1230 V1"}, "luxul_xap1230_v1"}, 156 + {{BCM47XX_BOARD_LUXUL_XAP_1240_V1, "Luxul XAP-1240 V1"}, "luxul_xap1240_v1"}, 157 + {{BCM47XX_BOARD_LUXUL_XAP_1500_V1, "Luxul XAP-1500 V1"}, "luxul_xap1500_v1"}, 158 + {{BCM47XX_BOARD_LUXUL_XBR_4400_V1, "Luxul XBR-4400 V1"}, "luxul_xbr4400_v1"}, 159 + {{BCM47XX_BOARD_LUXUL_XVW_P30_V1, "Luxul XVW-P30 V1"}, "luxul_xvwp30_v1"}, 160 + {{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"}, 152 161 {{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"}, 153 162 {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"}, 154 163 {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
+80 -2
arch/mips/bcm47xx/buttons.c
··· 17 17 .active_low = 1, \ 18 18 } 19 19 20 + #define BCM47XX_GPIO_KEY_H(_gpio, _code) \ 21 + { \ 22 + .code = _code, \ 23 + .gpio = _gpio, \ 24 + } 25 + 20 26 /* Asus */ 21 27 22 28 static const struct gpio_keys_button ··· 85 79 86 80 static const struct gpio_keys_button 87 81 bcm47xx_buttons_asus_wl500w[] __initconst = { 88 - BCM47XX_GPIO_KEY(6, KEY_RESTART), 89 - BCM47XX_GPIO_KEY(7, KEY_WPS_BUTTON), 82 + BCM47XX_GPIO_KEY_H(6, KEY_RESTART), 83 + BCM47XX_GPIO_KEY_H(7, KEY_WPS_BUTTON), 90 84 }; 91 85 92 86 static const struct gpio_keys_button ··· 306 300 }; 307 301 308 302 /* Luxul */ 303 + 304 + static const struct gpio_keys_button 305 + bcm47xx_buttons_luxul_abr_4400_v1[] = { 306 + BCM47XX_GPIO_KEY(14, KEY_RESTART), 307 + }; 308 + 309 + static const struct gpio_keys_button 310 + bcm47xx_buttons_luxul_xap_310_v1[] = { 311 + BCM47XX_GPIO_KEY(20, KEY_RESTART), 312 + }; 313 + 314 + static const struct gpio_keys_button 315 + bcm47xx_buttons_luxul_xap_1210_v1[] = { 316 + BCM47XX_GPIO_KEY(8, KEY_RESTART), 317 + }; 318 + 319 + static const struct gpio_keys_button 320 + bcm47xx_buttons_luxul_xap_1230_v1[] = { 321 + BCM47XX_GPIO_KEY(8, KEY_RESTART), 322 + }; 323 + 324 + static const struct gpio_keys_button 325 + bcm47xx_buttons_luxul_xap_1240_v1[] = { 326 + BCM47XX_GPIO_KEY(8, KEY_RESTART), 327 + }; 328 + 329 + static const struct gpio_keys_button 330 + bcm47xx_buttons_luxul_xap_1500_v1[] = { 331 + BCM47XX_GPIO_KEY(14, KEY_RESTART), 332 + }; 333 + 334 + static const struct gpio_keys_button 335 + bcm47xx_buttons_luxul_xbr_4400_v1[] = { 336 + BCM47XX_GPIO_KEY(14, KEY_RESTART), 337 + }; 338 + 339 + static const struct gpio_keys_button 340 + bcm47xx_buttons_luxul_xvw_p30_v1[] = { 341 + BCM47XX_GPIO_KEY(20, KEY_RESTART), 342 + }; 343 + 344 + static const struct gpio_keys_button 345 + bcm47xx_buttons_luxul_xwr_600_v1[] = { 346 + BCM47XX_GPIO_KEY(8, KEY_RESTART), 347 + }; 309 348 310 349 static const struct gpio_keys_button 311 350 bcm47xx_buttons_luxul_xwr_1750_v1[] = { ··· 612 561 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs); 613 562 break; 614 563 564 + case BCM47XX_BOARD_LUXUL_ABR_4400_V1: 565 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_abr_4400_v1); 566 + break; 567 + case BCM47XX_BOARD_LUXUL_XAP_310_V1: 568 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_310_v1); 569 + break; 570 + case BCM47XX_BOARD_LUXUL_XAP_1210_V1: 571 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1210_v1); 572 + break; 573 + case BCM47XX_BOARD_LUXUL_XAP_1230_V1: 574 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1230_v1); 575 + break; 576 + case BCM47XX_BOARD_LUXUL_XAP_1240_V1: 577 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1240_v1); 578 + break; 579 + case BCM47XX_BOARD_LUXUL_XAP_1500_V1: 580 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1500_v1); 581 + break; 582 + case BCM47XX_BOARD_LUXUL_XBR_4400_V1: 583 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xbr_4400_v1); 584 + break; 585 + case BCM47XX_BOARD_LUXUL_XVW_P30_V1: 586 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xvw_p30_v1); 587 + break; 588 + case BCM47XX_BOARD_LUXUL_XWR_600_V1: 589 + err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_600_v1); 590 + break; 615 591 case BCM47XX_BOARD_LUXUL_XWR_1750_V1: 616 592 err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_1750_v1); 617 593 break;
+81
arch/mips/bcm47xx/leds.c
··· 373 373 /* Luxul */ 374 374 375 375 static const struct gpio_led 376 + bcm47xx_leds_luxul_abr_4400_v1[] __initconst = { 377 + BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), 378 + BCM47XX_GPIO_LED_TRIGGER(15, "green", "status", 0, "timer"), 379 + }; 380 + 381 + static const struct gpio_led 382 + bcm47xx_leds_luxul_xap_310_v1[] __initconst = { 383 + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"), 384 + }; 385 + 386 + static const struct gpio_led 387 + bcm47xx_leds_luxul_xap_1210_v1[] __initconst = { 388 + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"), 389 + }; 390 + 391 + static const struct gpio_led 392 + bcm47xx_leds_luxul_xap_1230_v1[] __initconst = { 393 + BCM47XX_GPIO_LED(3, "blue", "2ghz", 0, LEDS_GPIO_DEFSTATE_OFF), 394 + BCM47XX_GPIO_LED(4, "green", "bridge", 0, LEDS_GPIO_DEFSTATE_OFF), 395 + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"), 396 + }; 397 + 398 + static const struct gpio_led 399 + bcm47xx_leds_luxul_xap_1240_v1[] __initconst = { 400 + BCM47XX_GPIO_LED(3, "blue", "2ghz", 0, LEDS_GPIO_DEFSTATE_OFF), 401 + BCM47XX_GPIO_LED(4, "green", "bridge", 0, LEDS_GPIO_DEFSTATE_OFF), 402 + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"), 403 + }; 404 + 405 + static const struct gpio_led 406 + bcm47xx_leds_luxul_xap_1500_v1[] __initconst = { 407 + BCM47XX_GPIO_LED_TRIGGER(13, "green", "status", 1, "timer"), 408 + }; 409 + 410 + static const struct gpio_led 411 + bcm47xx_leds_luxul_xbr_4400_v1[] __initconst = { 412 + BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), 413 + BCM47XX_GPIO_LED_TRIGGER(15, "green", "status", 0, "timer"), 414 + }; 415 + 416 + static const struct gpio_led 417 + bcm47xx_leds_luxul_xvw_p30_v1[] __initconst = { 418 + BCM47XX_GPIO_LED_TRIGGER(0, "blue", "status", 1, "timer"), 419 + BCM47XX_GPIO_LED(1, "green", "link", 1, LEDS_GPIO_DEFSTATE_OFF), 420 + }; 421 + 422 + static const struct gpio_led 423 + bcm47xx_leds_luxul_xwr_600_v1[] __initconst = { 424 + BCM47XX_GPIO_LED(3, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF), 425 + BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"), 426 + BCM47XX_GPIO_LED(9, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), 427 + }; 428 + 429 + static const struct gpio_led 376 430 bcm47xx_leds_luxul_xwr_1750_v1[] __initconst = { 377 431 BCM47XX_GPIO_LED(5, "green", "5ghz", 0, LEDS_GPIO_DEFSTATE_OFF), 378 432 BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), ··· 687 633 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs); 688 634 break; 689 635 636 + case BCM47XX_BOARD_LUXUL_ABR_4400_V1: 637 + bcm47xx_set_pdata(bcm47xx_leds_luxul_abr_4400_v1); 638 + break; 639 + case BCM47XX_BOARD_LUXUL_XAP_310_V1: 640 + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_310_v1); 641 + break; 642 + case BCM47XX_BOARD_LUXUL_XAP_1210_V1: 643 + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1210_v1); 644 + break; 645 + case BCM47XX_BOARD_LUXUL_XAP_1230_V1: 646 + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1230_v1); 647 + break; 648 + case BCM47XX_BOARD_LUXUL_XAP_1240_V1: 649 + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1240_v1); 650 + break; 651 + case BCM47XX_BOARD_LUXUL_XAP_1500_V1: 652 + bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1500_v1); 653 + break; 654 + case BCM47XX_BOARD_LUXUL_XBR_4400_V1: 655 + bcm47xx_set_pdata(bcm47xx_leds_luxul_xbr_4400_v1); 656 + break; 657 + case BCM47XX_BOARD_LUXUL_XVW_P30_V1: 658 + bcm47xx_set_pdata(bcm47xx_leds_luxul_xvw_p30_v1); 659 + break; 660 + case BCM47XX_BOARD_LUXUL_XWR_600_V1: 661 + bcm47xx_set_pdata(bcm47xx_leds_luxul_xwr_600_v1); 662 + break; 690 663 case BCM47XX_BOARD_LUXUL_XWR_1750_V1: 691 664 bcm47xx_set_pdata(bcm47xx_leds_luxul_xwr_1750_v1); 692 665 break;
+2 -1
arch/mips/bcm63xx/clk.c
··· 6 6 * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr> 7 7 */ 8 8 9 - #include <linux/module.h> 9 + #include <linux/init.h> 10 + #include <linux/export.h> 10 11 #include <linux/mutex.h> 11 12 #include <linux/err.h> 12 13 #include <linux/clk.h>
+1 -1
arch/mips/bcm63xx/cpu.c
··· 8 8 */ 9 9 10 10 #include <linux/kernel.h> 11 - #include <linux/module.h> 11 + #include <linux/export.h> 12 12 #include <linux/cpu.h> 13 13 #include <asm/cpu.h> 14 14 #include <asm/cpu-info.h>
+2 -1
arch/mips/bcm63xx/cs.c
··· 7 7 */ 8 8 9 9 #include <linux/kernel.h> 10 - #include <linux/module.h> 10 + #include <linux/errno.h> 11 + #include <linux/export.h> 11 12 #include <linux/spinlock.h> 12 13 #include <linux/log2.h> 13 14 #include <bcm63xx_cpu.h>
+1 -1
arch/mips/bcm63xx/gpio.c
··· 8 8 */ 9 9 10 10 #include <linux/kernel.h> 11 - #include <linux/module.h> 11 + #include <linux/init.h> 12 12 #include <linux/spinlock.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/gpio/driver.h>
-1
arch/mips/bcm63xx/irq.c
··· 10 10 #include <linux/kernel.h> 11 11 #include <linux/init.h> 12 12 #include <linux/interrupt.h> 13 - #include <linux/module.h> 14 13 #include <linux/irq.h> 15 14 #include <linux/spinlock.h> 16 15 #include <asm/irq_cpu.h>
+2 -1
arch/mips/bcm63xx/reset.c
··· 6 6 * Copyright (C) 2012 Jonas Gorski <jonas.gorski@gmail.com> 7 7 */ 8 8 9 - #include <linux/module.h> 9 + #include <linux/init.h> 10 + #include <linux/export.h> 10 11 #include <linux/mutex.h> 11 12 #include <linux/err.h> 12 13 #include <linux/clk.h>
+2 -1
arch/mips/bcm63xx/timer.c
··· 8 8 9 9 #include <linux/kernel.h> 10 10 #include <linux/err.h> 11 - #include <linux/module.h> 11 + #include <linux/init.h> 12 + #include <linux/export.h> 12 13 #include <linux/spinlock.h> 13 14 #include <linux/interrupt.h> 14 15 #include <linux/clk.h>
+7 -3
arch/mips/boot/compressed/Makefile
··· 18 18 BOOT_HEAP_SIZE := 0x400000 19 19 20 20 # Disable Function Tracer 21 - KBUILD_CFLAGS := $(shell echo $(KBUILD_CFLAGS) | sed -e "s/-pg//") 21 + KBUILD_CFLAGS := $(filter-out -pg, $(KBUILD_CFLAGS)) 22 22 23 23 KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS)) 24 24 25 - KBUILD_CFLAGS := $(LINUXINCLUDE) $(KBUILD_CFLAGS) -D__KERNEL__ \ 25 + KBUILD_CFLAGS := $(KBUILD_CFLAGS) -D__KERNEL__ \ 26 26 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" 27 27 28 - KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ 28 + KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ 29 29 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \ 30 30 -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS) 31 31 ··· 84 84 VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \ 85 85 $(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS)) 86 86 endif 87 + UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS) 87 88 88 89 vmlinuzobjs-y += $(obj)/piggy.o 89 90 ··· 129 128 OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec 130 129 vmlinuz.srec: vmlinuz 131 130 $(call cmd,objcopy) 131 + 132 + uzImage.bin: vmlinuz.bin FORCE 133 + $(call if_changed,uimage,none) 132 134 133 135 clean-files := $(objtree)/vmlinuz $(objtree)/vmlinuz.{32,ecoff,bin,srec}
+1
arch/mips/boot/dts/Makefile
··· 1 1 dts-dirs += brcm 2 2 dts-dirs += cavium-octeon 3 + dts-dirs += img 3 4 dts-dirs += ingenic 4 5 dts-dirs += lantiq 5 6 dts-dirs += mti
+46 -3
arch/mips/boot/dts/brcm/bcm7125.dtsi
··· 91 91 compatible = "brcm,bcm7120-l2-intc"; 92 92 reg = <0x406780 0x8>; 93 93 94 - brcm,int-map-mask = <0x44>, <0xf000000>; 94 + brcm,int-map-mask = <0x44>, <0xf000000>, <0x100000>; 95 95 brcm,int-fwd-mask = <0x70000>; 96 96 97 97 interrupt-controller; 98 98 #interrupt-cells = <1>; 99 99 100 100 interrupt-parent = <&periph_intc>; 101 - interrupts = <18>, <19>; 102 - interrupt-names = "upg_main", "upg_bsc"; 101 + interrupts = <18>, <19>, <20>; 102 + interrupt-names = "upg_main", "upg_bsc", "upg_spi"; 103 103 }; 104 104 105 105 sun_top_ctrl: syscon@404000 { ··· 224 224 native-endian; 225 225 interrupt-parent = <&periph_intc>; 226 226 interrupts = <61>; 227 + status = "disabled"; 228 + }; 229 + 230 + spi_l2_intc: interrupt-controller@411d00 { 231 + compatible = "brcm,l2-intc"; 232 + reg = <0x411d00 0x30>; 233 + interrupt-controller; 234 + #interrupt-cells = <1>; 235 + interrupt-parent = <&periph_intc>; 236 + interrupts = <79>; 237 + }; 238 + 239 + qspi: spi@443000 { 240 + #address-cells = <0x1>; 241 + #size-cells = <0x0>; 242 + compatible = "brcm,spi-bcm-qspi", 243 + "brcm,spi-brcmstb-qspi"; 244 + clocks = <&upg_clk>; 245 + reg = <0x440920 0x4 0x443200 0x188 0x443000 0x50>; 246 + reg-names = "cs_reg", "hif_mspi", "bspi"; 247 + interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>; 248 + interrupt-parent = <&spi_l2_intc>; 249 + interrupt-names = "spi_lr_fullness_reached", 250 + "spi_lr_session_aborted", 251 + "spi_lr_impatient", 252 + "spi_lr_session_done", 253 + "spi_lr_overread", 254 + "mspi_done", 255 + "mspi_halted"; 256 + status = "disabled"; 257 + }; 258 + 259 + mspi: spi@406400 { 260 + #address-cells = <1>; 261 + #size-cells = <0>; 262 + compatible = "brcm,spi-bcm-qspi", 263 + "brcm,spi-brcmstb-mspi"; 264 + clocks = <&upg_clk>; 265 + reg = <0x406400 0x180>; 266 + reg-names = "mspi"; 267 + interrupts = <0x14>; 268 + interrupt-parent = <&upg_irq0_intc>; 269 + interrupt-names = "mspi_done"; 227 270 status = "disabled"; 228 271 }; 229 272 };
+43
arch/mips/boot/dts/brcm/bcm7346.dtsi
··· 439 439 interrupts = <85>; 440 440 status = "disabled"; 441 441 }; 442 + 443 + spi_l2_intc: interrupt-controller@411d00 { 444 + compatible = "brcm,l2-intc"; 445 + reg = <0x411d00 0x30>; 446 + interrupt-controller; 447 + #interrupt-cells = <1>; 448 + interrupt-parent = <&periph_intc>; 449 + interrupts = <31>; 450 + }; 451 + 452 + qspi: spi@413000 { 453 + #address-cells = <0x1>; 454 + #size-cells = <0x0>; 455 + compatible = "brcm,spi-bcm-qspi", 456 + "brcm,spi-brcmstb-qspi"; 457 + clocks = <&upg_clk>; 458 + reg = <0x410920 0x4 0x413200 0x188 0x413000 0x50>; 459 + reg-names = "cs_reg", "hif_mspi", "bspi"; 460 + interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>; 461 + interrupt-parent = <&spi_l2_intc>; 462 + interrupt-names = "spi_lr_fullness_reached", 463 + "spi_lr_session_aborted", 464 + "spi_lr_impatient", 465 + "spi_lr_session_done", 466 + "spi_lr_overread", 467 + "mspi_done", 468 + "mspi_halted"; 469 + status = "disabled"; 470 + }; 471 + 472 + mspi: spi@408a00 { 473 + #address-cells = <1>; 474 + #size-cells = <0>; 475 + compatible = "brcm,spi-bcm-qspi", 476 + "brcm,spi-brcmstb-mspi"; 477 + clocks = <&upg_clk>; 478 + reg = <0x408a00 0x180>; 479 + reg-names = "mspi"; 480 + interrupts = <0x14>; 481 + interrupt-parent = <&upg_aon_irq0_intc>; 482 + interrupt-names = "mspi_done"; 483 + status = "disabled"; 484 + }; 442 485 }; 443 486 };
+43
arch/mips/boot/dts/brcm/bcm7358.dtsi
··· 318 318 interrupts = <24>; 319 319 status = "disabled"; 320 320 }; 321 + 322 + spi_l2_intc: interrupt-controller@411d00 { 323 + compatible = "brcm,l2-intc"; 324 + reg = <0x411d00 0x30>; 325 + interrupt-controller; 326 + #interrupt-cells = <1>; 327 + interrupt-parent = <&periph_intc>; 328 + interrupts = <31>; 329 + }; 330 + 331 + qspi: spi@413000 { 332 + #address-cells = <0x1>; 333 + #size-cells = <0x0>; 334 + compatible = "brcm,spi-bcm-qspi", 335 + "brcm,spi-brcmstb-qspi"; 336 + clocks = <&upg_clk>; 337 + reg = <0x410920 0x4 0x413200 0x188 0x413000 0x50>; 338 + reg-names = "cs_reg", "hif_mspi", "bspi"; 339 + interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>; 340 + interrupt-parent = <&spi_l2_intc>; 341 + interrupt-names = "spi_lr_fullness_reached", 342 + "spi_lr_session_aborted", 343 + "spi_lr_impatient", 344 + "spi_lr_session_done", 345 + "spi_lr_overread", 346 + "mspi_done", 347 + "mspi_halted"; 348 + status = "disabled"; 349 + }; 350 + 351 + mspi: spi@408a00 { 352 + #address-cells = <1>; 353 + #size-cells = <0>; 354 + compatible = "brcm,spi-bcm-qspi", 355 + "brcm,spi-brcmstb-mspi"; 356 + clocks = <&upg_clk>; 357 + reg = <0x408a00 0x180>; 358 + reg-names = "mspi"; 359 + interrupts = <0x14>; 360 + interrupt-parent = <&upg_aon_irq0_intc>; 361 + interrupt-names = "mspi_done"; 362 + status = "disabled"; 363 + }; 321 364 }; 322 365 };
+43
arch/mips/boot/dts/brcm/bcm7360.dtsi
··· 358 358 interrupts = <82>; 359 359 status = "disabled"; 360 360 }; 361 + 362 + spi_l2_intc: interrupt-controller@411d00 { 363 + compatible = "brcm,l2-intc"; 364 + reg = <0x411d00 0x30>; 365 + interrupt-controller; 366 + #interrupt-cells = <1>; 367 + interrupt-parent = <&periph_intc>; 368 + interrupts = <31>; 369 + }; 370 + 371 + qspi: spi@413000 { 372 + #address-cells = <0x1>; 373 + #size-cells = <0x0>; 374 + compatible = "brcm,spi-bcm-qspi", 375 + "brcm,spi-brcmstb-qspi"; 376 + clocks = <&upg_clk>; 377 + reg = <0x410920 0x4 0x413200 0x188 0x413000 0x50>; 378 + reg-names = "cs_reg", "hif_mspi", "bspi"; 379 + interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>; 380 + interrupt-parent = <&spi_l2_intc>; 381 + interrupt-names = "spi_lr_fullness_reached", 382 + "spi_lr_session_aborted", 383 + "spi_lr_impatient", 384 + "spi_lr_session_done", 385 + "spi_lr_overread", 386 + "mspi_done", 387 + "mspi_halted"; 388 + status = "disabled"; 389 + }; 390 + 391 + mspi: spi@408a00 { 392 + #address-cells = <1>; 393 + #size-cells = <0>; 394 + compatible = "brcm,spi-bcm-qspi", 395 + "brcm,spi-brcmstb-mspi"; 396 + clocks = <&upg_clk>; 397 + reg = <0x408a00 0x180>; 398 + reg-names = "mspi"; 399 + interrupts = <0x14>; 400 + interrupt-parent = <&upg_aon_irq0_intc>; 401 + interrupt-names = "mspi_done"; 402 + status = "disabled"; 403 + }; 361 404 }; 362 405 };
+43
arch/mips/boot/dts/brcm/bcm7362.dtsi
··· 354 354 interrupts = <82>; 355 355 status = "disabled"; 356 356 }; 357 + 358 + spi_l2_intc: interrupt-controller@411d00 { 359 + compatible = "brcm,l2-intc"; 360 + reg = <0x411d00 0x30>; 361 + interrupt-controller; 362 + #interrupt-cells = <1>; 363 + interrupt-parent = <&periph_intc>; 364 + interrupts = <31>; 365 + }; 366 + 367 + qspi: spi@413000 { 368 + #address-cells = <0x1>; 369 + #size-cells = <0x0>; 370 + compatible = "brcm,spi-bcm-qspi", 371 + "brcm,spi-brcmstb-qspi"; 372 + clocks = <&upg_clk>; 373 + reg = <0x410920 0x4 0x413200 0x188 0x413000 0x50>; 374 + reg-names = "cs_reg", "hif_mspi", "bspi"; 375 + interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>; 376 + interrupt-parent = <&spi_l2_intc>; 377 + interrupt-names = "spi_lr_fullness_reached", 378 + "spi_lr_session_aborted", 379 + "spi_lr_impatient", 380 + "spi_lr_session_done", 381 + "spi_lr_overread", 382 + "mspi_done", 383 + "mspi_halted"; 384 + status = "disabled"; 385 + }; 386 + 387 + mspi: spi@408a00 { 388 + #address-cells = <1>; 389 + #size-cells = <0>; 390 + compatible = "brcm,spi-bcm-qspi", 391 + "brcm,spi-brcmstb-mspi"; 392 + clocks = <&upg_clk>; 393 + reg = <0x408a00 0x180>; 394 + reg-names = "mspi"; 395 + interrupts = <0x14>; 396 + interrupt-parent = <&upg_aon_irq0_intc>; 397 + interrupt-names = "mspi_done"; 398 + status = "disabled"; 399 + }; 357 400 }; 358 401 };
+46 -3
arch/mips/boot/dts/brcm/bcm7420.dtsi
··· 92 92 compatible = "brcm,bcm7120-l2-intc"; 93 93 reg = <0x406780 0x8>; 94 94 95 - brcm,int-map-mask = <0x44>, <0x1f000000>; 95 + brcm,int-map-mask = <0x44>, <0x1f000000>, <0x100000>; 96 96 brcm,int-fwd-mask = <0x70000>; 97 97 98 98 interrupt-controller; 99 99 #interrupt-cells = <1>; 100 100 101 101 interrupt-parent = <&periph_intc>; 102 - interrupts = <18>, <19>; 103 - interrupt-names = "upg_main", "upg_bsc"; 102 + interrupts = <18>, <19>, <20>; 103 + interrupt-names = "upg_main", "upg_bsc", "upg_spi"; 104 104 }; 105 105 106 106 sun_top_ctrl: syscon@404000 { ··· 285 285 no-big-frame-no; 286 286 interrupt-parent = <&periph_intc>; 287 287 interrupts = <62>; 288 + status = "disabled"; 289 + }; 290 + 291 + spi_l2_intc: interrupt-controller@411d00 { 292 + compatible = "brcm,l2-intc"; 293 + reg = <0x411d00 0x30>; 294 + interrupt-controller; 295 + #interrupt-cells = <1>; 296 + interrupt-parent = <&periph_intc>; 297 + interrupts = <78>; 298 + }; 299 + 300 + qspi: spi@443000 { 301 + #address-cells = <0x1>; 302 + #size-cells = <0x0>; 303 + compatible = "brcm,spi-bcm-qspi", 304 + "brcm,spi-brcmstb-qspi"; 305 + clocks = <&upg_clk>; 306 + reg = <0x440920 0x4 0x443200 0x188 0x443000 0x50>; 307 + reg-names = "cs_reg", "hif_mspi", "bspi"; 308 + interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>; 309 + interrupt-parent = <&spi_l2_intc>; 310 + interrupt-names = "spi_lr_fullness_reached", 311 + "spi_lr_session_aborted", 312 + "spi_lr_impatient", 313 + "spi_lr_session_done", 314 + "spi_lr_overread", 315 + "mspi_done", 316 + "mspi_halted"; 317 + status = "disabled"; 318 + }; 319 + 320 + mspi: spi@406400 { 321 + #address-cells = <1>; 322 + #size-cells = <0>; 323 + compatible = "brcm,spi-bcm-qspi", 324 + "brcm,spi-brcmstb-mspi"; 325 + clocks = <&upg_clk>; 326 + reg = <0x406400 0x180>; 327 + reg-names = "mspi"; 328 + interrupts = <0x14>; 329 + interrupt-parent = <&upg_irq0_intc>; 330 + interrupt-names = "mspi_done"; 288 331 status = "disabled"; 289 332 }; 290 333 };
+43
arch/mips/boot/dts/brcm/bcm7425.dtsi
··· 450 450 mmc-hs200-1_8v; 451 451 status = "disabled"; 452 452 }; 453 + 454 + spi_l2_intc: interrupt-controller@41ad00 { 455 + compatible = "brcm,l2-intc"; 456 + reg = <0x41ad00 0x30>; 457 + interrupt-controller; 458 + #interrupt-cells = <1>; 459 + interrupt-parent = <&periph_intc>; 460 + interrupts = <25>; 461 + }; 462 + 463 + qspi: spi@41c000 { 464 + #address-cells = <0x1>; 465 + #size-cells = <0x0>; 466 + compatible = "brcm,spi-bcm-qspi", 467 + "brcm,spi-brcmstb-qspi"; 468 + clocks = <&upg_clk>; 469 + reg = <0x419920 0x4 0x41c200 0x188 0x41c000 0x50>; 470 + reg-names = "cs_reg", "hif_mspi", "bspi"; 471 + interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>; 472 + interrupt-parent = <&spi_l2_intc>; 473 + interrupt-names = "spi_lr_fullness_reached", 474 + "spi_lr_session_aborted", 475 + "spi_lr_impatient", 476 + "spi_lr_session_done", 477 + "spi_lr_overread", 478 + "mspi_done", 479 + "mspi_halted"; 480 + status = "disabled"; 481 + }; 482 + 483 + mspi: spi@409200 { 484 + #address-cells = <1>; 485 + #size-cells = <0>; 486 + compatible = "brcm,spi-bcm-qspi", 487 + "brcm,spi-brcmstb-mspi"; 488 + clocks = <&upg_clk>; 489 + reg = <0x409200 0x180>; 490 + reg-names = "mspi"; 491 + interrupts = <0x14>; 492 + interrupt-parent = <&upg_aon_irq0_intc>; 493 + interrupt-names = "mspi_done"; 494 + status = "disabled"; 495 + }; 453 496 }; 454 497 };
+43
arch/mips/boot/dts/brcm/bcm7435.dtsi
··· 465 465 mmc-hs200-1_8v; 466 466 status = "disabled"; 467 467 }; 468 + 469 + spi_l2_intc: interrupt-controller@41bd00 { 470 + compatible = "brcm,l2-intc"; 471 + reg = <0x41bd00 0x30>; 472 + interrupt-controller; 473 + #interrupt-cells = <1>; 474 + interrupt-parent = <&periph_intc>; 475 + interrupts = <25>; 476 + }; 477 + 478 + qspi: spi@41d200 { 479 + #address-cells = <0x1>; 480 + #size-cells = <0x0>; 481 + compatible = "brcm,spi-bcm-qspi", 482 + "brcm,spi-brcmstb-qspi"; 483 + clocks = <&upg_clk>; 484 + reg = <0x41a920 0x4 0x41d400 0x188 0x41d200 0x50>; 485 + reg-names = "cs_reg", "hif_mspi", "bspi"; 486 + interrupts = <0x0 0x1 0x2 0x3 0x4 0x5 0x6>; 487 + interrupt-parent = <&spi_l2_intc>; 488 + interrupt-names = "spi_lr_fullness_reached", 489 + "spi_lr_session_aborted", 490 + "spi_lr_impatient", 491 + "spi_lr_session_done", 492 + "spi_lr_overread", 493 + "mspi_done", 494 + "mspi_halted"; 495 + status = "disabled"; 496 + }; 497 + 498 + mspi: spi@409200 { 499 + #address-cells = <1>; 500 + #size-cells = <0>; 501 + compatible = "brcm,spi-bcm-qspi", 502 + "brcm,spi-brcmstb-mspi"; 503 + clocks = <&upg_clk>; 504 + reg = <0x409200 0x180>; 505 + reg-names = "mspi"; 506 + interrupts = <0x14>; 507 + interrupt-parent = <&upg_aon_irq0_intc>; 508 + interrupt-names = "mspi_done"; 509 + status = "disabled"; 510 + }; 468 511 }; 469 512 };
+4
arch/mips/boot/dts/brcm/bcm97125cbmb.dts
··· 57 57 &ohci0 { 58 58 status = "disabled"; 59 59 }; 60 + 61 + &mspi { 62 + status = "okay"; 63 + };
+4
arch/mips/boot/dts/brcm/bcm97346dbsmb.dts
··· 109 109 &sdhci0 { 110 110 status = "okay"; 111 111 }; 112 + 113 + &mspi { 114 + status = "okay"; 115 + };
+36
arch/mips/boot/dts/brcm/bcm97358svmb.dts
··· 69 69 &nand { 70 70 status = "okay"; 71 71 }; 72 + 73 + &qspi { 74 + status = "okay"; 75 + 76 + m25p80@0 { 77 + compatible = "m25p80"; 78 + reg = <0>; 79 + spi-max-frequency = <40000000>; 80 + spi-cpol; 81 + spi-cpha; 82 + use-bspi; 83 + m25p,fast-read; 84 + 85 + partitions { 86 + compatible = "fixed-partitions"; 87 + #address-cells = <1>; 88 + #size-cells = <1>; 89 + 90 + flash0.cfe@0 { 91 + reg = <0x0 0x200000>; 92 + }; 93 + 94 + flash0.mac@200000 { 95 + reg = <0x200000 0x40000>; 96 + }; 97 + 98 + flash0.nvram@240000 { 99 + reg = <0x240000 0x10000>; 100 + }; 101 + }; 102 + }; 103 + }; 104 + 105 + &mspi { 106 + status = "okay"; 107 + };
+36
arch/mips/boot/dts/brcm/bcm97360svmb.dts
··· 72 72 &sdhci0 { 73 73 status = "okay"; 74 74 }; 75 + 76 + &qspi { 77 + status = "okay"; 78 + 79 + m25p80@0 { 80 + compatible = "m25p80"; 81 + reg = <0>; 82 + spi-max-frequency = <40000000>; 83 + spi-cpol; 84 + spi-cpha; 85 + use-bspi; 86 + m25p,fast-read; 87 + 88 + partitions { 89 + compatible = "fixed-partitions"; 90 + #address-cells = <1>; 91 + #size-cells = <1>; 92 + 93 + flash0.cfe@0 { 94 + reg = <0x0 0x200000>; 95 + }; 96 + 97 + flash0.mac@200000 { 98 + reg = <0x200000 0x40000>; 99 + }; 100 + 101 + flash0.nvram@240000 { 102 + reg = <0x240000 0x10000>; 103 + }; 104 + }; 105 + }; 106 + }; 107 + 108 + &mspi { 109 + status = "okay"; 110 + };
+4
arch/mips/boot/dts/brcm/bcm97362svmb.dts
··· 73 73 &sdhci0 { 74 74 status = "okay"; 75 75 }; 76 + 77 + &mspi { 78 + status = "okay"; 79 + };
+4
arch/mips/boot/dts/brcm/bcm97420c.dts
··· 79 79 &ohci1 { 80 80 status = "okay"; 81 81 }; 82 + 83 + &mspi { 84 + status = "okay"; 85 + };
+36
arch/mips/boot/dts/brcm/bcm97425svmb.dts
··· 107 107 &sdhci1 { 108 108 status = "okay"; 109 109 }; 110 + 111 + &qspi { 112 + status = "okay"; 113 + 114 + m25p80@0 { 115 + compatible = "m25p80"; 116 + reg = <0>; 117 + spi-max-frequency = <40000000>; 118 + spi-cpol; 119 + spi-cpha; 120 + use-bspi; 121 + m25p,fast-read; 122 + 123 + partitions { 124 + compatible = "fixed-partitions"; 125 + #address-cells = <1>; 126 + #size-cells = <1>; 127 + 128 + flash0.cfe@0 { 129 + reg = <0x0 0x200000>; 130 + }; 131 + 132 + flash0.mac@200000 { 133 + reg = <0x200000 0x40000>; 134 + }; 135 + 136 + flash0.nvram@240000 { 137 + reg = <0x240000 0x10000>; 138 + }; 139 + }; 140 + }; 141 + }; 142 + 143 + &mspi { 144 + status = "okay"; 145 + };
+4
arch/mips/boot/dts/brcm/bcm97435svmb.dts
··· 115 115 &sdhci1 { 116 116 status = "okay"; 117 117 }; 118 + 119 + &mspi { 120 + status = "okay"; 121 + };
+9
arch/mips/boot/dts/img/Makefile
··· 1 + dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb 2 + 3 + obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 4 + 5 + # Force kbuild to make empty built-in.o if necessary 6 + obj- += dummy.o 7 + 8 + always := $(dtb-y) 9 + clean-files := *.dtb *.dtb.S
+924
arch/mips/boot/dts/img/pistachio.dtsi
··· 1 + /* 2 + * Copyright (C) 2015, 2016 Imagination Technologies Ltd. 3 + * Copyright (C) 2015 Google, Inc. 4 + * 5 + * This program is free software; you can redistribute it and/or modify 6 + * it under the terms of the GNU General Public License version 2 as 7 + * published by the Free Software Foundation. 8 + */ 9 + 10 + #include <dt-bindings/clock/pistachio-clk.h> 11 + #include <dt-bindings/gpio/gpio.h> 12 + #include <dt-bindings/interrupt-controller/irq.h> 13 + #include <dt-bindings/interrupt-controller/mips-gic.h> 14 + #include <dt-bindings/reset/pistachio-resets.h> 15 + 16 + / { 17 + compatible = "img,pistachio"; 18 + 19 + #address-cells = <1>; 20 + #size-cells = <1>; 21 + 22 + interrupt-parent = <&gic>; 23 + 24 + cpus { 25 + #address-cells = <1>; 26 + #size-cells = <0>; 27 + 28 + cpu0: cpu@0 { 29 + device_type = "cpu"; 30 + compatible = "mti,interaptiv"; 31 + reg = <0>; 32 + clocks = <&clk_core CLK_MIPS_PLL>; 33 + clock-names = "cpu"; 34 + clock-latency = <1000>; 35 + operating-points = < 36 + /* kHz uV(dummy) */ 37 + 546000 1150000 38 + 520000 1100000 39 + 494000 1000000 40 + 468000 950000 41 + 442000 900000 42 + 416000 800000 43 + >; 44 + }; 45 + }; 46 + 47 + i2c0: i2c@18100000 { 48 + compatible = "img,scb-i2c"; 49 + reg = <0x18100000 0x200>; 50 + interrupts = <GIC_SHARED 2 IRQ_TYPE_LEVEL_HIGH>; 51 + clocks = <&clk_periph PERIPH_CLK_I2C0>, 52 + <&cr_periph SYS_CLK_I2C0>; 53 + clock-names = "scb", "sys"; 54 + assigned-clocks = <&clk_periph PERIPH_CLK_I2C0_PRE_DIV>, 55 + <&clk_periph PERIPH_CLK_I2C0_DIV>; 56 + assigned-clock-rates = <100000000>, <33333334>; 57 + status = "disabled"; 58 + pinctrl-names = "default"; 59 + pinctrl-0 = <&i2c0_pins>; 60 + 61 + #address-cells = <1>; 62 + #size-cells = <0>; 63 + }; 64 + 65 + i2c1: i2c@18100200 { 66 + compatible = "img,scb-i2c"; 67 + reg = <0x18100200 0x200>; 68 + interrupts = <GIC_SHARED 3 IRQ_TYPE_LEVEL_HIGH>; 69 + clocks = <&clk_periph PERIPH_CLK_I2C1>, 70 + <&cr_periph SYS_CLK_I2C1>; 71 + clock-names = "scb", "sys"; 72 + assigned-clocks = <&clk_periph PERIPH_CLK_I2C1_PRE_DIV>, 73 + <&clk_periph PERIPH_CLK_I2C1_DIV>; 74 + assigned-clock-rates = <100000000>, <33333334>; 75 + status = "disabled"; 76 + pinctrl-names = "default"; 77 + pinctrl-0 = <&i2c1_pins>; 78 + 79 + #address-cells = <1>; 80 + #size-cells = <0>; 81 + }; 82 + 83 + i2c2: i2c@18100400 { 84 + compatible = "img,scb-i2c"; 85 + reg = <0x18100400 0x200>; 86 + interrupts = <GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>; 87 + clocks = <&clk_periph PERIPH_CLK_I2C2>, 88 + <&cr_periph SYS_CLK_I2C2>; 89 + clock-names = "scb", "sys"; 90 + assigned-clocks = <&clk_periph PERIPH_CLK_I2C2_PRE_DIV>, 91 + <&clk_periph PERIPH_CLK_I2C2_DIV>; 92 + assigned-clock-rates = <100000000>, <33333334>; 93 + status = "disabled"; 94 + pinctrl-names = "default"; 95 + pinctrl-0 = <&i2c2_pins>; 96 + 97 + #address-cells = <1>; 98 + #size-cells = <0>; 99 + }; 100 + 101 + i2c3: i2c@18100600 { 102 + compatible = "img,scb-i2c"; 103 + reg = <0x18100600 0x200>; 104 + interrupts = <GIC_SHARED 5 IRQ_TYPE_LEVEL_HIGH>; 105 + clocks = <&clk_periph PERIPH_CLK_I2C3>, 106 + <&cr_periph SYS_CLK_I2C3>; 107 + clock-names = "scb", "sys"; 108 + assigned-clocks = <&clk_periph PERIPH_CLK_I2C3_PRE_DIV>, 109 + <&clk_periph PERIPH_CLK_I2C3_DIV>; 110 + assigned-clock-rates = <100000000>, <33333334>; 111 + status = "disabled"; 112 + pinctrl-names = "default"; 113 + pinctrl-0 = <&i2c3_pins>; 114 + 115 + #address-cells = <1>; 116 + #size-cells = <0>; 117 + }; 118 + 119 + i2s_in: i2s-in@18100800 { 120 + compatible = "img,i2s-in"; 121 + reg = <0x18100800 0x200>; 122 + interrupts = <GIC_SHARED 7 IRQ_TYPE_LEVEL_HIGH>; 123 + dmas = <&mdc 30 0xffffffff 0>; 124 + dma-names = "rx"; 125 + clocks = <&cr_periph SYS_CLK_I2S_IN>; 126 + clock-names = "sys"; 127 + img,i2s-channels = <6>; 128 + pinctrl-names = "default"; 129 + pinctrl-0 = <&i2s_in_pins>; 130 + status = "disabled"; 131 + 132 + #sound-dai-cells = <0>; 133 + }; 134 + 135 + i2s_out: i2s-out@18100a00 { 136 + compatible = "img,i2s-out"; 137 + reg = <0x18100a00 0x200>; 138 + interrupts = <GIC_SHARED 13 IRQ_TYPE_LEVEL_HIGH>; 139 + dmas = <&mdc 23 0xffffffff 0>; 140 + dma-names = "tx"; 141 + clocks = <&cr_periph SYS_CLK_I2S_OUT>, 142 + <&clk_core CLK_I2S>; 143 + clock-names = "sys", "ref"; 144 + assigned-clocks = <&clk_core CLK_I2S_DIV>; 145 + assigned-clock-rates = <12288000>; 146 + img,i2s-channels = <6>; 147 + pinctrl-names = "default"; 148 + pinctrl-0 = <&i2s_out_pins>; 149 + status = "disabled"; 150 + resets = <&pistachio_reset PISTACHIO_RESET_I2S_OUT>; 151 + reset-names = "rst"; 152 + #sound-dai-cells = <0>; 153 + }; 154 + 155 + parallel_out: parallel-audio-out@18100c00 { 156 + compatible = "img,parallel-out"; 157 + reg = <0x18100c00 0x100>; 158 + interrupts = <GIC_SHARED 19 IRQ_TYPE_LEVEL_HIGH>; 159 + dmas = <&mdc 16 0xffffffff 0>; 160 + dma-names = "tx"; 161 + clocks = <&cr_periph SYS_CLK_PAUD_OUT>, 162 + <&clk_core CLK_AUDIO_DAC>; 163 + clock-names = "sys", "ref"; 164 + assigned-clocks = <&clk_core CLK_AUDIO_DAC_DIV>; 165 + assigned-clock-rates = <12288000>; 166 + status = "disabled"; 167 + resets = <&pistachio_reset PISTACHIO_RESET_PRL_OUT>; 168 + reset-names = "rst"; 169 + #sound-dai-cells = <0>; 170 + }; 171 + 172 + spdif_out: spdif-out@18100d00 { 173 + compatible = "img,spdif-out"; 174 + reg = <0x18100d00 0x100>; 175 + interrupts = <GIC_SHARED 21 IRQ_TYPE_LEVEL_HIGH>; 176 + dmas = <&mdc 14 0xffffffff 0>; 177 + dma-names = "tx"; 178 + clocks = <&cr_periph SYS_CLK_SPDIF_OUT>, 179 + <&clk_core CLK_SPDIF>; 180 + clock-names = "sys", "ref"; 181 + assigned-clocks = <&clk_core CLK_SPDIF_DIV>; 182 + assigned-clock-rates = <12288000>; 183 + pinctrl-names = "default"; 184 + pinctrl-0 = <&spdif_out_pin>; 185 + status = "disabled"; 186 + resets = <&pistachio_reset PISTACHIO_RESET_SPDIF_OUT>; 187 + reset-names = "rst"; 188 + #sound-dai-cells = <0>; 189 + }; 190 + 191 + spdif_in: spdif-in@18100e00 { 192 + compatible = "img,spdif-in"; 193 + reg = <0x18100e00 0x100>; 194 + interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>; 195 + dmas = <&mdc 15 0xffffffff 0>; 196 + dma-names = "rx"; 197 + clocks = <&cr_periph SYS_CLK_SPDIF_IN>; 198 + clock-names = "sys"; 199 + pinctrl-names = "default"; 200 + pinctrl-0 = <&spdif_in_pin>; 201 + status = "disabled"; 202 + 203 + #sound-dai-cells = <0>; 204 + }; 205 + 206 + internal_dac: internal-dac { 207 + compatible = "img,pistachio-internal-dac"; 208 + img,cr-top = <&cr_top>; 209 + img,voltage-select = <1>; 210 + 211 + #sound-dai-cells = <0>; 212 + }; 213 + 214 + spfi0: spi@18100f00 { 215 + compatible = "img,spfi"; 216 + reg = <0x18100f00 0x100>; 217 + interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>; 218 + clocks = <&clk_core CLK_SPI0>, <&cr_periph SYS_CLK_SPI0_MASTER>; 219 + clock-names = "sys", "spfi"; 220 + dmas = <&mdc 9 0xffffffff 0>, <&mdc 10 0xffffffff 0>; 221 + dma-names = "rx", "tx"; 222 + spfi-max-frequency = <50000000>; 223 + status = "disabled"; 224 + 225 + #address-cells = <1>; 226 + #size-cells = <0>; 227 + }; 228 + 229 + spfi1: spi@18101000 { 230 + compatible = "img,spfi"; 231 + reg = <0x18101000 0x100>; 232 + interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>; 233 + clocks = <&clk_core CLK_SPI1>, <&cr_periph SYS_CLK_SPI1>; 234 + clock-names = "sys", "spfi"; 235 + dmas = <&mdc 1 0xffffffff 0>, <&mdc 2 0xffffffff 0>; 236 + dma-names = "rx", "tx"; 237 + img,supports-quad-mode; 238 + spfi-max-frequency = <50000000>; 239 + status = "disabled"; 240 + 241 + #address-cells = <1>; 242 + #size-cells = <0>; 243 + }; 244 + 245 + pwm: pwm@18101300 { 246 + compatible = "img,pistachio-pwm"; 247 + reg = <0x18101300 0x100>; 248 + clocks = <&clk_periph PERIPH_CLK_PWM>, 249 + <&cr_periph SYS_CLK_PWM>; 250 + clock-names = "pwm", "sys"; 251 + img,cr-periph = <&cr_periph>; 252 + #pwm-cells = <2>; 253 + status = "disabled"; 254 + }; 255 + 256 + uart0: uart@18101400 { 257 + compatible = "snps,dw-apb-uart"; 258 + reg = <0x18101400 0x100>; 259 + interrupts = <GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>; 260 + clocks = <&clk_core CLK_UART0>, <&cr_periph SYS_CLK_UART0>; 261 + clock-names = "baudclk", "apb_pclk"; 262 + assigned-clocks = <&clk_core CLK_UART0_INTERNAL_DIV>, 263 + <&clk_core CLK_UART0_DIV>; 264 + reg-shift = <2>; 265 + reg-io-width = <4>; 266 + pinctrl-0 = <&uart0_pins>, <&uart0_rts_cts_pins>; 267 + pinctrl-names = "default"; 268 + status = "disabled"; 269 + }; 270 + 271 + uart1: uart@18101500 { 272 + compatible = "snps,dw-apb-uart"; 273 + reg = <0x18101500 0x100>; 274 + interrupts = <GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>; 275 + clocks = <&clk_core CLK_UART1>, <&cr_periph SYS_CLK_UART1>; 276 + clock-names = "baudclk", "apb_pclk"; 277 + assigned-clocks = <&clk_core CLK_UART1_INTERNAL_DIV>, 278 + <&clk_core CLK_UART1_DIV>; 279 + assigned-clock-rates = <114278400>, <1843200>; 280 + reg-shift = <2>; 281 + reg-io-width = <4>; 282 + pinctrl-0 = <&uart1_pins>; 283 + pinctrl-names = "default"; 284 + status = "disabled"; 285 + }; 286 + 287 + adc: adc@18101600 { 288 + compatible = "cosmic,10001-adc"; 289 + reg = <0x18101600 0x24>; 290 + adc-reserved-channels = <0x30>; 291 + clocks = <&clk_core CLK_AUX_ADC>; 292 + clock-names = "adc"; 293 + assigned-clocks = <&clk_core CLK_AUX_ADC_INTERNAL_DIV>, 294 + <&clk_core CLK_AUX_ADC_DIV>; 295 + assigned-clock-rates = <100000000>, <1000000>; 296 + status = "disabled"; 297 + 298 + #io-channel-cells = <1>; 299 + }; 300 + 301 + pinctrl: pinctrl@18101c00 { 302 + compatible = "img,pistachio-system-pinctrl"; 303 + reg = <0x18101c00 0x400>; 304 + 305 + gpio0: gpio0 { 306 + interrupts = <GIC_SHARED 71 IRQ_TYPE_LEVEL_HIGH>; 307 + 308 + gpio-controller; 309 + #gpio-cells = <2>; 310 + gpio-ranges = <&pinctrl 0 0 16>; 311 + 312 + interrupt-controller; 313 + #interrupt-cells = <2>; 314 + }; 315 + 316 + gpio1: gpio1 { 317 + interrupts = <GIC_SHARED 72 IRQ_TYPE_LEVEL_HIGH>; 318 + 319 + gpio-controller; 320 + #gpio-cells = <2>; 321 + gpio-ranges = <&pinctrl 0 16 16>; 322 + 323 + interrupt-controller; 324 + #interrupt-cells = <2>; 325 + }; 326 + 327 + gpio2: gpio2 { 328 + interrupts = <GIC_SHARED 73 IRQ_TYPE_LEVEL_HIGH>; 329 + 330 + gpio-controller; 331 + #gpio-cells = <2>; 332 + gpio-ranges = <&pinctrl 0 32 16>; 333 + 334 + interrupt-controller; 335 + #interrupt-cells = <2>; 336 + }; 337 + 338 + gpio3: gpio3 { 339 + interrupts = <GIC_SHARED 74 IRQ_TYPE_LEVEL_HIGH>; 340 + 341 + gpio-controller; 342 + #gpio-cells = <2>; 343 + gpio-ranges = <&pinctrl 0 48 16>; 344 + 345 + interrupt-controller; 346 + #interrupt-cells = <2>; 347 + }; 348 + 349 + gpio4: gpio4 { 350 + interrupts = <GIC_SHARED 75 IRQ_TYPE_LEVEL_HIGH>; 351 + 352 + gpio-controller; 353 + #gpio-cells = <2>; 354 + gpio-ranges = <&pinctrl 0 64 16>; 355 + 356 + interrupt-controller; 357 + #interrupt-cells = <2>; 358 + }; 359 + 360 + gpio5: gpio5 { 361 + interrupts = <GIC_SHARED 76 IRQ_TYPE_LEVEL_HIGH>; 362 + 363 + gpio-controller; 364 + #gpio-cells = <2>; 365 + gpio-ranges = <&pinctrl 0 80 10>; 366 + 367 + interrupt-controller; 368 + #interrupt-cells = <2>; 369 + }; 370 + 371 + i2c0_pins: i2c0-pins { 372 + pin_i2c0: i2c0 { 373 + pins = "mfio28", "mfio29"; 374 + function = "i2c0"; 375 + drive-strength = <4>; 376 + }; 377 + }; 378 + 379 + i2c1_pins: i2c1-pins { 380 + pin_i2c1: i2c1 { 381 + pins = "mfio30", "mfio31"; 382 + function = "i2c1"; 383 + drive-strength = <4>; 384 + }; 385 + }; 386 + 387 + i2c2_pins: i2c2-pins { 388 + pin_i2c2: i2c2 { 389 + pins = "mfio32", "mfio33"; 390 + function = "i2c2"; 391 + drive-strength = <4>; 392 + }; 393 + }; 394 + 395 + i2c3_pins: i2c3-pins { 396 + pin_i2c3: i2c3 { 397 + pins = "mfio34", "mfio35"; 398 + function = "i2c3"; 399 + drive-strength = <4>; 400 + }; 401 + }; 402 + 403 + spim0_pins: spim0-pins { 404 + pin_spim0: spim0 { 405 + pins = "mfio9", "mfio10"; 406 + function = "spim0"; 407 + drive-strength = <4>; 408 + }; 409 + spim0_clk: spim0-clk { 410 + pins = "mfio8"; 411 + function = "spim0"; 412 + drive-strength = <4>; 413 + }; 414 + }; 415 + 416 + spim0_cs0_alt_pin: spim0-cs0-alt-pin { 417 + spim0-cs0 { 418 + pins = "mfio2"; 419 + drive-strength = <2>; 420 + }; 421 + }; 422 + 423 + spim0_cs1_pin: spim0-cs1-pin { 424 + spim0-cs1 { 425 + pins = "mfio1"; 426 + drive-strength = <2>; 427 + }; 428 + }; 429 + 430 + spim0_cs2_pin: spim0-cs2-pin { 431 + spim0-cs2 { 432 + pins = "mfio55"; 433 + drive-strength = <2>; 434 + }; 435 + }; 436 + 437 + spim0_cs2_alt_pin: spim0-cs2-alt-pin { 438 + spim0-cs2 { 439 + pins = "mfio28"; 440 + drive-strength = <2>; 441 + }; 442 + }; 443 + 444 + spim0_cs3_pin: spim0-cs3-pin { 445 + spim0-cs3 { 446 + pins = "mfio56"; 447 + drive-strength = <2>; 448 + }; 449 + }; 450 + 451 + spim0_cs3_alt_pin: spim0-cs3-alt-pin { 452 + spim0-cs3 { 453 + pins = "mfio29"; 454 + drive-strength = <2>; 455 + }; 456 + }; 457 + 458 + spim0_cs4_pin: spim0-cs4-pin { 459 + spim0-cs4 { 460 + pins = "mfio57"; 461 + drive-strength = <2>; 462 + }; 463 + }; 464 + 465 + spim0_cs4_alt_pin: spim0-cs4-alt-pin { 466 + spim0-cs4 { 467 + pins = "mfio30"; 468 + drive-strength = <2>; 469 + }; 470 + }; 471 + 472 + spim1_pins: spim1-pins { 473 + spim1 { 474 + pins = "mfio3", "mfio4", "mfio5"; 475 + function = "spim1"; 476 + drive-strength = <2>; 477 + }; 478 + }; 479 + 480 + spim1_quad_pins: spim1-quad-pins { 481 + spim1-quad { 482 + pins = "mfio6", "mfio7"; 483 + function = "spim1"; 484 + drive-strength = <2>; 485 + }; 486 + }; 487 + 488 + spim1_cs0_pin: spim1-cs0-pins { 489 + spim1-cs0 { 490 + pins = "mfio0"; 491 + function = "spim1"; 492 + drive-strength = <2>; 493 + }; 494 + }; 495 + 496 + spim1_cs1_pin: spim1-cs1-pin { 497 + spim1-cs1 { 498 + pins = "mfio1"; 499 + function = "spim1"; 500 + drive-strength = <2>; 501 + }; 502 + }; 503 + 504 + spim1_cs1_alt_pin: spim1-cs1-alt-pin { 505 + spim1-cs1 { 506 + pins = "mfio58"; 507 + function = "spim1"; 508 + drive-strength = <2>; 509 + }; 510 + }; 511 + 512 + spim1_cs2_pin: spim1-cs2-pin { 513 + spim1-cs2 { 514 + pins = "mfio2"; 515 + function = "spim1"; 516 + drive-strength = <2>; 517 + }; 518 + }; 519 + 520 + spim1_cs2_alt0_pin: spim1-cs2-alt0-pin { 521 + spim1-cs2 { 522 + pins = "mfio31"; 523 + function = "spim1"; 524 + drive-strength = <2>; 525 + }; 526 + }; 527 + 528 + spim1_cs2_alt1_pin: spim1-cs2-alt1-pin { 529 + spim1-cs2 { 530 + pins = "mfio55"; 531 + function = "spim1"; 532 + drive-strength = <2>; 533 + }; 534 + }; 535 + 536 + spim1_cs3_pin: spim1-cs3-pin { 537 + spim1-cs3 { 538 + pins = "mfio56"; 539 + function = "spim1"; 540 + drive-strength = <2>; 541 + }; 542 + }; 543 + 544 + spim1_cs4_pin: spim1-cs4-pin { 545 + spim1-cs4 { 546 + pins = "mfio57"; 547 + function = "spim1"; 548 + drive-strength = <2>; 549 + }; 550 + }; 551 + 552 + uart0_pins: uart0-pins { 553 + uart0 { 554 + pins = "mfio55", "mfio56"; 555 + function = "uart0"; 556 + drive-strength = <2>; 557 + }; 558 + }; 559 + 560 + uart0_rts_cts_pins: uart0-rts-cts-pins { 561 + uart0-rts-cts { 562 + pins = "mfio57", "mfio58"; 563 + function = "uart0"; 564 + drive-strength = <2>; 565 + }; 566 + }; 567 + 568 + uart1_pins: uart1-pins { 569 + uart1 { 570 + pins = "mfio59", "mfio60"; 571 + function = "uart1"; 572 + drive-strength = <2>; 573 + }; 574 + }; 575 + 576 + uart1_rts_cts_pins: uart1-rts-cts-pins { 577 + uart1-rts-cts { 578 + pins = "mfio1", "mfio2"; 579 + function = "uart1"; 580 + drive-strength = <2>; 581 + }; 582 + }; 583 + 584 + enet_pins: enet-pins { 585 + pin_enet: enet { 586 + pins = "mfio63", "mfio64", "mfio65", "mfio66", 587 + "mfio67", "mfio68", "mfio69", "mfio70"; 588 + function = "eth"; 589 + slew-rate = <1>; 590 + drive-strength = <4>; 591 + }; 592 + pin_enet_phy_clk: enet-phy-clk { 593 + pins = "mfio71"; 594 + function = "eth"; 595 + slew-rate = <1>; 596 + drive-strength = <8>; 597 + }; 598 + }; 599 + 600 + sdhost_pins: sdhost-pins { 601 + pin_sdhost_clk: sdhost-clk { 602 + pins = "mfio15"; 603 + function = "sdhost"; 604 + slew-rate = <1>; 605 + drive-strength = <4>; 606 + }; 607 + pin_sdhost_cmd: sdhost-cmd { 608 + pins = "mfio16"; 609 + function = "sdhost"; 610 + slew-rate = <1>; 611 + drive-strength = <4>; 612 + }; 613 + pin_sdhost_data: sdhost-data { 614 + pins = "mfio17", "mfio18", "mfio19", "mfio20", 615 + "mfio21", "mfio22", "mfio23", "mfio24"; 616 + function = "sdhost"; 617 + slew-rate = <1>; 618 + drive-strength = <4>; 619 + }; 620 + pin_sdhost_power_select: sdhost-power-select { 621 + pins = "mfio25"; 622 + function = "sdhost"; 623 + slew-rate = <1>; 624 + drive-strength = <2>; 625 + }; 626 + pin_sdhost_card_detect: sdhost-card-detect { 627 + pins = "mfio26"; 628 + function = "sdhost"; 629 + drive-strength = <2>; 630 + }; 631 + pin_sdhost_write_protect: sdhost-write-protect { 632 + pins = "mfio27"; 633 + function = "sdhost"; 634 + drive-strength = <2>; 635 + }; 636 + }; 637 + 638 + ir_pin: ir-pin { 639 + ir-data { 640 + pins = "mfio72"; 641 + function = "ir"; 642 + drive-strength = <2>; 643 + }; 644 + }; 645 + 646 + pwmpdm0_pin: pwmpdm0-pin { 647 + pwmpdm0 { 648 + pins = "mfio73"; 649 + function = "pwmpdm"; 650 + drive-strength = <2>; 651 + }; 652 + }; 653 + 654 + pwmpdm1_pin: pwmpdm1-pin { 655 + pwmpdm1 { 656 + pins = "mfio74"; 657 + function = "pwmpdm"; 658 + drive-strength = <2>; 659 + }; 660 + }; 661 + 662 + pwmpdm2_pin: pwmpdm2-pin { 663 + pwmpdm2 { 664 + pins = "mfio75"; 665 + function = "pwmpdm"; 666 + drive-strength = <2>; 667 + }; 668 + }; 669 + 670 + pwmpdm3_pin: pwmpdm3-pin { 671 + pwmpdm3 { 672 + pins = "mfio76"; 673 + function = "pwmpdm"; 674 + drive-strength = <2>; 675 + }; 676 + }; 677 + 678 + dac_clk_pin: dac-clk-pin { 679 + pin_dac_clk: dac-clk { 680 + pins = "mfio45"; 681 + function = "i2s_dac_clk"; 682 + drive-strength = <4>; 683 + }; 684 + }; 685 + 686 + i2s_mclk_pin: i2s-mclk-pin { 687 + pin_i2s_mclk: i2s-mclk { 688 + pins = "mfio36"; 689 + function = "i2s_out"; 690 + drive-strength = <4>; 691 + }; 692 + }; 693 + 694 + spdif_out_pin: spdif-out-pin { 695 + spdif-out { 696 + pins = "mfio61"; 697 + function = "spdif_out"; 698 + slew-rate = <1>; 699 + drive-strength = <2>; 700 + }; 701 + }; 702 + 703 + spdif_in_pin: spdif-in-pin { 704 + spdif-in { 705 + pins = "mfio62"; 706 + function = "spdif_in"; 707 + drive-strength = <2>; 708 + }; 709 + }; 710 + 711 + i2s_out_pins: i2s-out-pins { 712 + pins_i2s_out_clk: i2s-out-clk { 713 + pins = "mfio37", "mfio38"; 714 + function = "i2s_out"; 715 + drive-strength = <4>; 716 + }; 717 + pins_i2s_out: i2s-out { 718 + pins = "mfio39", "mfio40", 719 + "mfio41", "mfio42", 720 + "mfio43", "mfio44"; 721 + function = "i2s_out"; 722 + drive-strength = <2>; 723 + }; 724 + }; 725 + 726 + i2s_in_pins: i2s-in-pins { 727 + i2s-in { 728 + pins = "mfio47", "mfio48", "mfio49", 729 + "mfio50", "mfio51", "mfio52", 730 + "mfio53", "mfio54"; 731 + function = "i2s_in"; 732 + drive-strength = <2>; 733 + }; 734 + }; 735 + }; 736 + 737 + timer: timer@18102000 { 738 + compatible = "img,pistachio-gptimer"; 739 + reg = <0x18102000 0x100>; 740 + interrupts = <GIC_SHARED 60 IRQ_TYPE_LEVEL_HIGH>; 741 + clocks = <&clk_periph PERIPH_CLK_COUNTER_FAST>, 742 + <&cr_periph SYS_CLK_TIMER>; 743 + clock-names = "fast", "sys"; 744 + img,cr-periph = <&cr_periph>; 745 + }; 746 + 747 + wdt: watchdog@18102100 { 748 + compatible = "img,pdc-wdt"; 749 + reg = <0x18102100 0x100>; 750 + interrupts = <GIC_SHARED 52 IRQ_TYPE_LEVEL_HIGH>; 751 + clocks = <&clk_periph PERIPH_CLK_WD>, <&cr_periph SYS_CLK_WD>; 752 + clock-names = "wdt", "sys"; 753 + assigned-clocks = <&clk_periph PERIPH_CLK_WD_PRE_DIV>, 754 + <&clk_periph PERIPH_CLK_WD_DIV>; 755 + assigned-clock-rates = <4000000>, <32768>; 756 + }; 757 + 758 + ir: ir@18102200 { 759 + compatible = "img,ir-rev1"; 760 + reg = <0x18102200 0x100>; 761 + interrupts = <GIC_SHARED 51 IRQ_TYPE_LEVEL_HIGH>; 762 + clocks = <&clk_periph PERIPH_CLK_IR>, <&cr_periph SYS_CLK_IR>; 763 + clock-names = "core", "sys"; 764 + assigned-clocks = <&clk_periph PERIPH_CLK_IR_PRE_DIV>, 765 + <&clk_periph PERIPH_CLK_IR_DIV>; 766 + assigned-clock-rates = <4000000>, <32768>; 767 + pinctrl-0 = <&ir_pin>; 768 + pinctrl-names = "default"; 769 + status = "disabled"; 770 + }; 771 + 772 + usb: usb@18120000 { 773 + compatible = "snps,dwc2"; 774 + reg = <0x18120000 0x1c000>; 775 + interrupts = <GIC_SHARED 49 IRQ_TYPE_LEVEL_HIGH>; 776 + phys = <&usb_phy>; 777 + phy-names = "usb2-phy"; 778 + g-tx-fifo-size = <256 256 256 256>; 779 + status = "disabled"; 780 + }; 781 + 782 + enet: ethernet@18140000 { 783 + compatible = "snps,dwmac"; 784 + reg = <0x18140000 0x2000>; 785 + interrupts = <GIC_SHARED 50 IRQ_TYPE_LEVEL_HIGH>; 786 + interrupt-names = "macirq"; 787 + clocks = <&clk_core CLK_ENET>, <&cr_periph SYS_CLK_ENET>; 788 + clock-names = "stmmaceth", "pclk"; 789 + assigned-clocks = <&clk_core CLK_ENET_MUX>, 790 + <&clk_core CLK_ENET_DIV>; 791 + assigned-clock-parents = <&clk_core CLK_SYS_INTERNAL_DIV>; 792 + assigned-clock-rates = <0>, <50000000>; 793 + pinctrl-0 = <&enet_pins>; 794 + pinctrl-names = "default"; 795 + phy-mode = "rmii"; 796 + status = "disabled"; 797 + }; 798 + 799 + sdhost: mmc@18142000 { 800 + compatible = "img,pistachio-dw-mshc"; 801 + reg = <0x18142000 0x400>; 802 + interrupts = <GIC_SHARED 39 IRQ_TYPE_LEVEL_HIGH>; 803 + clocks = <&clk_core CLK_SD_HOST>, <&cr_periph SYS_CLK_SD_HOST>; 804 + clock-names = "ciu", "biu"; 805 + pinctrl-0 = <&sdhost_pins>; 806 + pinctrl-names = "default"; 807 + fifo-depth = <0x20>; 808 + num-slots = <1>; 809 + clock-frequency = <50000000>; 810 + bus-width = <8>; 811 + cap-mmc-highspeed; 812 + cap-sd-highspeed; 813 + status = "disabled"; 814 + }; 815 + 816 + sram: sram@1b000000 { 817 + compatible = "mmio-sram"; 818 + reg = <0x1b000000 0x10000>; 819 + }; 820 + 821 + mdc: dma-controller@18143000 { 822 + compatible = "img,pistachio-mdc-dma"; 823 + reg = <0x18143000 0x1000>; 824 + interrupts = <GIC_SHARED 27 IRQ_TYPE_LEVEL_HIGH>, 825 + <GIC_SHARED 28 IRQ_TYPE_LEVEL_HIGH>, 826 + <GIC_SHARED 29 IRQ_TYPE_LEVEL_HIGH>, 827 + <GIC_SHARED 30 IRQ_TYPE_LEVEL_HIGH>, 828 + <GIC_SHARED 31 IRQ_TYPE_LEVEL_HIGH>, 829 + <GIC_SHARED 32 IRQ_TYPE_LEVEL_HIGH>, 830 + <GIC_SHARED 33 IRQ_TYPE_LEVEL_HIGH>, 831 + <GIC_SHARED 34 IRQ_TYPE_LEVEL_HIGH>, 832 + <GIC_SHARED 35 IRQ_TYPE_LEVEL_HIGH>, 833 + <GIC_SHARED 36 IRQ_TYPE_LEVEL_HIGH>, 834 + <GIC_SHARED 37 IRQ_TYPE_LEVEL_HIGH>, 835 + <GIC_SHARED 38 IRQ_TYPE_LEVEL_HIGH>; 836 + clocks = <&cr_periph SYS_CLK_MDC>; 837 + clock-names = "sys"; 838 + 839 + img,max-burst-multiplier = <16>; 840 + img,cr-periph = <&cr_periph>; 841 + 842 + #dma-cells = <3>; 843 + }; 844 + 845 + clk_core: clk@18144000 { 846 + compatible = "img,pistachio-clk", "syscon"; 847 + clocks = <&xtal>, <&cr_top EXT_CLK_AUDIO_IN>, 848 + <&cr_top EXT_CLK_ENET_IN>; 849 + clock-names = "xtal", "audio_refclk_ext_gate", 850 + "ext_enet_in_gate"; 851 + reg = <0x18144000 0x800>; 852 + #clock-cells = <1>; 853 + }; 854 + 855 + clk_periph: clk@18144800 { 856 + compatible = "img,pistachio-clk-periph"; 857 + reg = <0x18144800 0x1000>; 858 + clocks = <&clk_core CLK_PERIPH_SYS>; 859 + clock-names = "periph_sys_core"; 860 + #clock-cells = <1>; 861 + }; 862 + 863 + cr_periph: clk@18148000 { 864 + compatible = "img,pistachio-cr-periph", "syscon", "simple-bus"; 865 + reg = <0x18148000 0x1000>; 866 + clocks = <&clk_periph PERIPH_CLK_SYS>; 867 + clock-names = "sys"; 868 + #clock-cells = <1>; 869 + 870 + pistachio_reset: reset-controller { 871 + compatible = "img,pistachio-reset"; 872 + #reset-cells = <1>; 873 + }; 874 + }; 875 + 876 + cr_top: clk@18149000 { 877 + compatible = "img,pistachio-cr-top", "syscon"; 878 + reg = <0x18149000 0x200>; 879 + #clock-cells = <1>; 880 + }; 881 + 882 + hash: hash@18149600 { 883 + compatible = "img,hash-accelerator"; 884 + reg = <0x18149600 0x100>, <0x18101100 0x4>; 885 + interrupts = <GIC_SHARED 59 IRQ_TYPE_LEVEL_HIGH>; 886 + dmas = <&mdc 8 0xffffffff 0>; 887 + dma-names = "tx"; 888 + clocks = <&cr_periph SYS_CLK_HASH>, 889 + <&clk_periph PERIPH_CLK_ROM>; 890 + clock-names = "sys", "hash"; 891 + }; 892 + 893 + gic: interrupt-controller@1bdc0000 { 894 + compatible = "mti,gic"; 895 + reg = <0x1bdc0000 0x20000>; 896 + 897 + interrupt-controller; 898 + #interrupt-cells = <3>; 899 + 900 + timer { 901 + compatible = "mti,gic-timer"; 902 + interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>; 903 + clocks = <&clk_core CLK_MIPS>; 904 + }; 905 + }; 906 + 907 + usb_phy: usb-phy { 908 + compatible = "img,pistachio-usb-phy"; 909 + clocks = <&clk_core CLK_USB_PHY>; 910 + clock-names = "usb_phy"; 911 + assigned-clocks = <&clk_core CLK_USB_PHY_DIV>; 912 + assigned-clock-rates = <50000000>; 913 + img,refclk = <0x2>; 914 + img,cr-top = <&cr_top>; 915 + #phy-cells = <0>; 916 + }; 917 + 918 + xtal: xtal { 919 + compatible = "fixed-clock"; 920 + #clock-cells = <0>; 921 + clock-frequency = <52000000>; 922 + clock-output-names = "xtal"; 923 + }; 924 + };
+163
arch/mips/boot/dts/img/pistachio_marduk.dts
··· 1 + /* 2 + * Copyright (C) 2015, 2016 Imagination Technologies Ltd. 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + * 8 + * IMG Marduk board is also known as Creator Ci40. 9 + */ 10 + 11 + /dts-v1/; 12 + 13 + #include "pistachio.dtsi" 14 + 15 + / { 16 + model = "IMG Marduk (Creator Ci40)"; 17 + compatible = "img,pistachio-marduk", "img,pistachio"; 18 + 19 + aliases { 20 + serial0 = &uart0; 21 + serial1 = &uart1; 22 + ethernet0 = &enet; 23 + spi0 = &spfi0; 24 + spi1 = &spfi1; 25 + }; 26 + 27 + chosen { 28 + bootargs = "root=/dev/sda1 rootwait ro lpj=723968"; 29 + stdout-path = "serial1:115200"; 30 + }; 31 + 32 + memory { 33 + device_type = "memory"; 34 + reg = <0x00000000 0x10000000>; 35 + }; 36 + 37 + reg_1v8: fixed-regulator { 38 + compatible = "regulator-fixed"; 39 + regulator-name = "aux_adc_vref"; 40 + regulator-min-microvolt = <1800000>; 41 + regulator-max-microvolt = <1800000>; 42 + regulator-boot-on; 43 + }; 44 + 45 + internal_dac_supply: internal-dac-supply { 46 + compatible = "regulator-fixed"; 47 + regulator-name = "internal_dac_supply"; 48 + regulator-min-microvolt = <1800000>; 49 + regulator-max-microvolt = <1800000>; 50 + }; 51 + 52 + leds { 53 + compatible = "pwm-leds"; 54 + heartbeat { 55 + label = "marduk:red:heartbeat"; 56 + pwms = <&pwm 3 300000>; 57 + max-brightness = <255>; 58 + linux,default-trigger = "heartbeat"; 59 + }; 60 + }; 61 + 62 + keys { 63 + compatible = "gpio-keys"; 64 + button@1 { 65 + label = "Button 1"; 66 + linux,code = <0x101>; /* BTN_1 */ 67 + gpios = <&gpio3 6 GPIO_ACTIVE_LOW>; 68 + }; 69 + button@2 { 70 + label = "Button 2"; 71 + linux,code = <0x102>; /* BTN_2 */ 72 + gpios = <&gpio2 14 GPIO_ACTIVE_LOW>; 73 + }; 74 + }; 75 + }; 76 + 77 + &internal_dac { 78 + VDD-supply = <&internal_dac_supply>; 79 + }; 80 + 81 + &spfi1 { 82 + status = "okay"; 83 + 84 + pinctrl-0 = <&spim1_pins>, <&spim1_quad_pins>, <&spim1_cs0_pin>, 85 + <&spim1_cs1_pin>; 86 + pinctrl-names = "default"; 87 + cs-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>; 88 + 89 + flash@0 { 90 + compatible = "spansion,s25fl016k", "jedec,spi-nor"; 91 + reg = <0>; 92 + spi-max-frequency = <50000000>; 93 + }; 94 + }; 95 + 96 + &uart0 { 97 + status = "okay"; 98 + assigned-clock-rates = <114278400>, <1843200>; 99 + }; 100 + 101 + &uart1 { 102 + status = "okay"; 103 + }; 104 + 105 + &usb { 106 + status = "okay"; 107 + }; 108 + 109 + &enet { 110 + status = "okay"; 111 + }; 112 + 113 + &pin_enet { 114 + drive-strength = <2>; 115 + }; 116 + 117 + &pin_enet_phy_clk { 118 + drive-strength = <2>; 119 + }; 120 + 121 + &sdhost { 122 + status = "okay"; 123 + bus-width = <4>; 124 + disable-wp; 125 + }; 126 + 127 + &pin_sdhost_cmd { 128 + drive-strength = <2>; 129 + }; 130 + 131 + &pin_sdhost_data { 132 + drive-strength = <2>; 133 + }; 134 + 135 + &pwm { 136 + status = "okay"; 137 + 138 + pinctrl-0 = <&pwmpdm0_pin>, <&pwmpdm1_pin>, <&pwmpdm2_pin>, 139 + <&pwmpdm3_pin>; 140 + pinctrl-names = "default"; 141 + }; 142 + 143 + &adc { 144 + status = "okay"; 145 + vref-supply = <&reg_1v8>; 146 + adc-reserved-channels = <0x10>; 147 + }; 148 + 149 + &i2c2 { 150 + status = "okay"; 151 + clock-frequency = <400000>; 152 + 153 + tpm@20 { 154 + compatible = "infineon,slb9645tt"; 155 + reg = <0x20>; 156 + }; 157 + 158 + }; 159 + 160 + &i2c3 { 161 + status = "okay"; 162 + clock-frequency = <400000>; 163 + };
+63
arch/mips/boot/dts/xilfpga/nexys4ddr.dts
··· 17 17 compatible = "mti,cpu-interrupt-controller"; 18 18 }; 19 19 20 + axi_intc: interrupt-controller@10200000 { 21 + #interrupt-cells = <1>; 22 + compatible = "xlnx,xps-intc-1.00.a"; 23 + interrupt-controller; 24 + reg = <0x10200000 0x10000>; 25 + xlnx,kind-of-intr = <0x0>; 26 + xlnx,num-intr-inputs = <0x6>; 27 + 28 + interrupt-parent = <&cpuintc>; 29 + interrupts = <6>; 30 + }; 31 + 20 32 axi_gpio: gpio@10600000 { 21 33 #gpio-cells = <1>; 22 34 compatible = "xlnx,xps-gpio-1.00.a"; ··· 42 30 xlnx,tri-default = <0xffffffff>; 43 31 } ; 44 32 33 + axi_ethernetlite: ethernet@10e00000 { 34 + compatible = "xlnx,xps-ethernetlite-3.00.a"; 35 + device_type = "network"; 36 + interrupt-parent = <&axi_intc>; 37 + interrupts = <1>; 38 + phy-handle = <&phy0>; 39 + reg = <0x10e00000 0x10000>; 40 + xlnx,duplex = <0x1>; 41 + xlnx,include-global-buffers = <0x1>; 42 + xlnx,include-internal-loopback = <0x0>; 43 + xlnx,include-mdio = <0x1>; 44 + xlnx,instance = "axi_ethernetlite_inst"; 45 + xlnx,rx-ping-pong = <0x1>; 46 + xlnx,s-axi-id-width = <0x1>; 47 + xlnx,tx-ping-pong = <0x1>; 48 + xlnx,use-internal = <0x0>; 49 + mdio { 50 + #address-cells = <1>; 51 + #size-cells = <0>; 52 + phy0: phy@1 { 53 + device_type = "ethernet-phy"; 54 + reg = <1>; 55 + }; 56 + }; 57 + }; 58 + 45 59 axi_uart16550: serial@10400000 { 46 60 compatible = "ns16550a"; 47 61 reg = <0x10400000 0x10000>; ··· 76 38 reg-offset = <0x1000>; 77 39 78 40 clocks = <&ext>; 41 + 42 + interrupt-parent = <&axi_intc>; 43 + interrupts = <0>; 79 44 }; 45 + 46 + axi_i2c: i2c@10A00000 { 47 + compatible = "xlnx,xps-iic-2.00.a"; 48 + interrupt-parent = <&axi_intc>; 49 + interrupts = <4>; 50 + reg = < 0x10A00000 0x10000 >; 51 + clocks = <&ext>; 52 + xlnx,clk-freq = <0x5f5e100>; 53 + xlnx,family = "Artix7"; 54 + xlnx,gpo-width = <0x1>; 55 + xlnx,iic-freq = <0x186a0>; 56 + xlnx,scl-inertial-delay = <0x0>; 57 + xlnx,sda-inertial-delay = <0x0>; 58 + xlnx,ten-bit-adr = <0x0>; 59 + #address-cells = <1>; 60 + #size-cells = <0>; 61 + 62 + ad7420@4B { 63 + compatible = "adi,adt7420"; 64 + reg = <0x4B>; 65 + }; 66 + } ; 80 67 }; 81 68 82 69 &ext {
+1
arch/mips/cavium-octeon/Makefile
··· 18 18 obj-$(CONFIG_MTD) += flash_setup.o 19 19 obj-$(CONFIG_SMP) += smp.o 20 20 obj-$(CONFIG_OCTEON_ILM) += oct_ilm.o 21 + obj-$(CONFIG_USB) += octeon-usb.o
+1 -1
arch/mips/cavium-octeon/crypto/octeon-crypto.c
··· 7 7 */ 8 8 9 9 #include <asm/cop2.h> 10 - #include <linux/module.h> 10 + #include <linux/export.h> 11 11 #include <linux/interrupt.h> 12 12 13 13 #include "octeon-crypto.h"
+5 -10
arch/mips/cavium-octeon/dma-octeon.c
··· 164 164 /* ignore region specifiers */ 165 165 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); 166 166 167 - #ifdef CONFIG_ZONE_DMA 168 - if (dev == NULL) 167 + if (IS_ENABLED(CONFIG_ZONE_DMA) && dev == NULL) 169 168 gfp |= __GFP_DMA; 170 - else if (dev->coherent_dma_mask <= DMA_BIT_MASK(24)) 169 + else if (IS_ENABLED(CONFIG_ZONE_DMA) && 170 + dev->coherent_dma_mask <= DMA_BIT_MASK(24)) 171 171 gfp |= __GFP_DMA; 172 - else 173 - #endif 174 - #ifdef CONFIG_ZONE_DMA32 175 - if (dev->coherent_dma_mask <= DMA_BIT_MASK(32)) 172 + else if (IS_ENABLED(CONFIG_ZONE_DMA32) && 173 + dev->coherent_dma_mask <= DMA_BIT_MASK(32)) 176 174 gfp |= __GFP_DMA32; 177 - else 178 - #endif 179 - ; 180 175 181 176 /* Don't invoke OOM killer */ 182 177 gfp |= __GFP_NORETRY;
+1 -1
arch/mips/cavium-octeon/executive/cvmx-bootmem.c
··· 30 30 * application start time. 31 31 */ 32 32 33 + #include <linux/export.h> 33 34 #include <linux/kernel.h> 34 - #include <linux/module.h> 35 35 36 36 #include <asm/octeon/cvmx.h> 37 37 #include <asm/octeon/cvmx-spinlock.h>
+1 -1
arch/mips/cavium-octeon/executive/cvmx-helper-errata.c
··· 33 33 * these functions directly. 34 34 * 35 35 */ 36 - #include <linux/module.h> 36 + #include <linux/export.h> 37 37 38 38 #include <asm/octeon/octeon.h> 39 39
+1 -2
arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c
··· 287 287 * Configure an IPD/PKO port for the specified link state. This 288 288 * function does not influence auto negotiation at the PHY level. 289 289 * The passed link state must always match the link state returned 290 - * by cvmx_helper_link_get(). It is normally best to use 291 - * cvmx_helper_link_autoconf() instead. 290 + * by cvmx_helper_link_get(). 292 291 * 293 292 * @ipd_port: IPD/PKO port to configure 294 293 * @link_info: The new link state
+1 -2
arch/mips/cavium-octeon/executive/cvmx-helper-sgmii.c
··· 500 500 * Configure an IPD/PKO port for the specified link state. This 501 501 * function does not influence auto negotiation at the PHY level. 502 502 * The passed link state must always match the link state returned 503 - * by cvmx_helper_link_get(). It is normally best to use 504 - * cvmx_helper_link_autoconf() instead. 503 + * by cvmx_helper_link_get(). 505 504 * 506 505 * @ipd_port: IPD/PKO port to configure 507 506 * @link_info: The new link state
+1 -2
arch/mips/cavium-octeon/executive/cvmx-helper-spi.c
··· 188 188 * Configure an IPD/PKO port for the specified link state. This 189 189 * function does not influence auto negotiation at the PHY level. 190 190 * The passed link state must always match the link state returned 191 - * by cvmx_helper_link_get(). It is normally best to use 192 - * cvmx_helper_link_autoconf() instead. 191 + * by cvmx_helper_link_get(). 193 192 * 194 193 * @ipd_port: IPD/PKO port to configure 195 194 * @link_info: The new link state
+1 -2
arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c
··· 295 295 * Configure an IPD/PKO port for the specified link state. This 296 296 * function does not influence auto negotiation at the PHY level. 297 297 * The passed link state must always match the link state returned 298 - * by cvmx_helper_link_get(). It is normally best to use 299 - * cvmx_helper_link_autoconf() instead. 298 + * by cvmx_helper_link_get(). 300 299 * 301 300 * @ipd_port: IPD/PKO port to configure 302 301 * @link_info: The new link state
+1 -46
arch/mips/cavium-octeon/executive/cvmx-helper.c
··· 69 69 /* Port count per interface */ 70 70 static int interface_port_count[5]; 71 71 72 - /* Port last configured link info index by IPD/PKO port */ 73 - static cvmx_helper_link_info_t 74 - port_link_info[CVMX_PIP_NUM_INPUT_PORTS]; 75 - 76 72 /** 77 73 * Return the number of interfaces the chip has. Each interface 78 74 * may have multiple ports. Most chips support two interfaces, ··· 1132 1136 } 1133 1137 1134 1138 /** 1135 - * Auto configure an IPD/PKO port link state and speed. This 1136 - * function basically does the equivalent of: 1137 - * cvmx_helper_link_set(ipd_port, cvmx_helper_link_get(ipd_port)); 1138 - * 1139 - * @ipd_port: IPD/PKO port to auto configure 1140 - * 1141 - * Returns Link state after configure 1142 - */ 1143 - cvmx_helper_link_info_t cvmx_helper_link_autoconf(int ipd_port) 1144 - { 1145 - cvmx_helper_link_info_t link_info; 1146 - int interface = cvmx_helper_get_interface_num(ipd_port); 1147 - int index = cvmx_helper_get_interface_index_num(ipd_port); 1148 - 1149 - if (index >= cvmx_helper_ports_on_interface(interface)) { 1150 - link_info.u64 = 0; 1151 - return link_info; 1152 - } 1153 - 1154 - link_info = cvmx_helper_link_get(ipd_port); 1155 - if (link_info.u64 == port_link_info[ipd_port].u64) 1156 - return link_info; 1157 - 1158 - /* If we fail to set the link speed, port_link_info will not change */ 1159 - cvmx_helper_link_set(ipd_port, link_info); 1160 - 1161 - /* 1162 - * port_link_info should be the current value, which will be 1163 - * different than expect if cvmx_helper_link_set() failed. 1164 - */ 1165 - return port_link_info[ipd_port]; 1166 - } 1167 - EXPORT_SYMBOL_GPL(cvmx_helper_link_autoconf); 1168 - 1169 - /** 1170 1139 * Return the link state of an IPD/PKO port as returned by 1171 1140 * auto negotiation. The result of this function may not match 1172 1141 * Octeon's link config if auto negotiation has changed since ··· 1194 1233 * Configure an IPD/PKO port for the specified link state. This 1195 1234 * function does not influence auto negotiation at the PHY level. 1196 1235 * The passed link state must always match the link state returned 1197 - * by cvmx_helper_link_get(). It is normally best to use 1198 - * cvmx_helper_link_autoconf() instead. 1236 + * by cvmx_helper_link_get(). 1199 1237 * 1200 1238 * @ipd_port: IPD/PKO port to configure 1201 1239 * @link_info: The new link state ··· 1236 1276 case CVMX_HELPER_INTERFACE_MODE_LOOP: 1237 1277 break; 1238 1278 } 1239 - /* Set the port_link_info here so that the link status is updated 1240 - no matter how cvmx_helper_link_set is called. We don't change 1241 - the value if link_set failed */ 1242 - if (result == 0) 1243 - port_link_info[ipd_port].u64 = link_info.u64; 1244 1279 return result; 1245 1280 } 1246 1281 EXPORT_SYMBOL_GPL(cvmx_helper_link_set);
+1 -1
arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
··· 29 29 * This module provides system/board/application information obtained 30 30 * by the bootloader. 31 31 */ 32 - #include <linux/module.h> 32 + #include <linux/export.h> 33 33 34 34 #include <asm/octeon/cvmx.h> 35 35 #include <asm/octeon/cvmx-sysinfo.h>
+17 -8
arch/mips/cavium-octeon/octeon-memcpy.S
··· 15 15 16 16 #include <asm/asm.h> 17 17 #include <asm/asm-offsets.h> 18 + #include <asm/export.h> 18 19 #include <asm/regdef.h> 19 20 20 21 #define dst a0 ··· 143 142 * t7 is used as a flag to note inatomic mode. 144 143 */ 145 144 LEAF(__copy_user_inatomic) 145 + EXPORT_SYMBOL(__copy_user_inatomic) 146 146 b __copy_user_common 147 147 li t7, 1 148 148 END(__copy_user_inatomic) ··· 156 154 */ 157 155 .align 5 158 156 LEAF(memcpy) /* a0=dst a1=src a2=len */ 157 + EXPORT_SYMBOL(memcpy) 159 158 move v0, dst /* return value */ 160 159 __memcpy: 161 160 FEXPORT(__copy_user) 161 + EXPORT_SYMBOL(__copy_user) 162 162 li t7, 0 /* not inatomic */ 163 163 __copy_user_common: 164 164 /* ··· 212 208 ADD src, src, 16*NBYTES 213 209 EXC( STORE t3, UNIT(7)(dst), s_exc_p9u) 214 210 ADD dst, dst, 16*NBYTES 215 - EXC( LOAD t0, UNIT(-8)(src), l_exc_copy) 216 - EXC( LOAD t1, UNIT(-7)(src), l_exc_copy) 217 - EXC( LOAD t2, UNIT(-6)(src), l_exc_copy) 218 - EXC( LOAD t3, UNIT(-5)(src), l_exc_copy) 211 + EXC( LOAD t0, UNIT(-8)(src), l_exc_copy_rewind16) 212 + EXC( LOAD t1, UNIT(-7)(src), l_exc_copy_rewind16) 213 + EXC( LOAD t2, UNIT(-6)(src), l_exc_copy_rewind16) 214 + EXC( LOAD t3, UNIT(-5)(src), l_exc_copy_rewind16) 219 215 EXC( STORE t0, UNIT(-8)(dst), s_exc_p8u) 220 216 EXC( STORE t1, UNIT(-7)(dst), s_exc_p7u) 221 217 EXC( STORE t2, UNIT(-6)(dst), s_exc_p6u) 222 218 EXC( STORE t3, UNIT(-5)(dst), s_exc_p5u) 223 - EXC( LOAD t0, UNIT(-4)(src), l_exc_copy) 224 - EXC( LOAD t1, UNIT(-3)(src), l_exc_copy) 225 - EXC( LOAD t2, UNIT(-2)(src), l_exc_copy) 226 - EXC( LOAD t3, UNIT(-1)(src), l_exc_copy) 219 + EXC( LOAD t0, UNIT(-4)(src), l_exc_copy_rewind16) 220 + EXC( LOAD t1, UNIT(-3)(src), l_exc_copy_rewind16) 221 + EXC( LOAD t2, UNIT(-2)(src), l_exc_copy_rewind16) 222 + EXC( LOAD t3, UNIT(-1)(src), l_exc_copy_rewind16) 227 223 EXC( STORE t0, UNIT(-4)(dst), s_exc_p4u) 228 224 EXC( STORE t1, UNIT(-3)(dst), s_exc_p3u) 229 225 EXC( STORE t2, UNIT(-2)(dst), s_exc_p2u) ··· 387 383 nop 388 384 END(memcpy) 389 385 386 + l_exc_copy_rewind16: 387 + /* Rewind src and dst by 16*NBYTES for l_exc_copy */ 388 + SUB src, src, 16*NBYTES 389 + SUB dst, dst, 16*NBYTES 390 390 l_exc_copy: 391 391 /* 392 392 * Copy bytes from src until faulting load address (or until a ··· 467 459 468 460 .align 5 469 461 LEAF(memmove) 462 + EXPORT_SYMBOL(memmove) 470 463 ADD t0, a0, a2 471 464 ADD t1, a1, a2 472 465 sltu t0, a1, t0 # dst + len <= src -> memcpy
+1
arch/mips/cavium-octeon/octeon-platform.c
··· 448 448 { .compatible = "cavium,octeon-3860-bootbus", }, 449 449 { .compatible = "cavium,mdio-mux", }, 450 450 { .compatible = "gpio-leds", }, 451 + { .compatible = "cavium,octeon-7130-usb-uctl", }, 451 452 {}, 452 453 }; 453 454
+552
arch/mips/cavium-octeon/octeon-usb.c
··· 1 + /* 2 + * XHCI HCD glue for Cavium Octeon III SOCs. 3 + * 4 + * Copyright (C) 2010-2017 Cavium Networks 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + 11 + #include <linux/module.h> 12 + #include <linux/device.h> 13 + #include <linux/mutex.h> 14 + #include <linux/delay.h> 15 + #include <linux/of_platform.h> 16 + 17 + #include <asm/octeon/octeon.h> 18 + #include <asm/octeon/cvmx-gpio-defs.h> 19 + 20 + /* USB Control Register */ 21 + union cvm_usbdrd_uctl_ctl { 22 + uint64_t u64; 23 + struct cvm_usbdrd_uctl_ctl_s { 24 + /* 1 = BIST and set all USB RAMs to 0x0, 0 = BIST */ 25 + __BITFIELD_FIELD(uint64_t clear_bist:1, 26 + /* 1 = Start BIST and cleared by hardware */ 27 + __BITFIELD_FIELD(uint64_t start_bist:1, 28 + /* Reference clock select for SuperSpeed and HighSpeed PLLs: 29 + * 0x0 = Both PLLs use DLMC_REF_CLK0 for reference clock 30 + * 0x1 = Both PLLs use DLMC_REF_CLK1 for reference clock 31 + * 0x2 = SuperSpeed PLL uses DLMC_REF_CLK0 for reference clock & 32 + * HighSpeed PLL uses PLL_REF_CLK for reference clck 33 + * 0x3 = SuperSpeed PLL uses DLMC_REF_CLK1 for reference clock & 34 + * HighSpeed PLL uses PLL_REF_CLK for reference clck 35 + */ 36 + __BITFIELD_FIELD(uint64_t ref_clk_sel:2, 37 + /* 1 = Spread-spectrum clock enable, 0 = SS clock disable */ 38 + __BITFIELD_FIELD(uint64_t ssc_en:1, 39 + /* Spread-spectrum clock modulation range: 40 + * 0x0 = -4980 ppm downspread 41 + * 0x1 = -4492 ppm downspread 42 + * 0x2 = -4003 ppm downspread 43 + * 0x3 - 0x7 = Reserved 44 + */ 45 + __BITFIELD_FIELD(uint64_t ssc_range:3, 46 + /* Enable non-standard oscillator frequencies: 47 + * [55:53] = modules -1 48 + * [52:47] = 2's complement push amount, 0 = Feature disabled 49 + */ 50 + __BITFIELD_FIELD(uint64_t ssc_ref_clk_sel:9, 51 + /* Reference clock multiplier for non-standard frequencies: 52 + * 0x19 = 100MHz on DLMC_REF_CLK* if REF_CLK_SEL = 0x0 or 0x1 53 + * 0x28 = 125MHz on DLMC_REF_CLK* if REF_CLK_SEL = 0x0 or 0x1 54 + * 0x32 = 50MHz on DLMC_REF_CLK* if REF_CLK_SEL = 0x0 or 0x1 55 + * Other Values = Reserved 56 + */ 57 + __BITFIELD_FIELD(uint64_t mpll_multiplier:7, 58 + /* Enable reference clock to prescaler for SuperSpeed functionality. 59 + * Should always be set to "1" 60 + */ 61 + __BITFIELD_FIELD(uint64_t ref_ssp_en:1, 62 + /* Divide the reference clock by 2 before entering the 63 + * REF_CLK_FSEL divider: 64 + * If REF_CLK_SEL = 0x0 or 0x1, then only 0x0 is legal 65 + * If REF_CLK_SEL = 0x2 or 0x3, then: 66 + * 0x1 = DLMC_REF_CLK* is 125MHz 67 + * 0x0 = DLMC_REF_CLK* is another supported frequency 68 + */ 69 + __BITFIELD_FIELD(uint64_t ref_clk_div2:1, 70 + /* Select reference clock freqnuency for both PLL blocks: 71 + * 0x27 = REF_CLK_SEL is 0x0 or 0x1 72 + * 0x07 = REF_CLK_SEL is 0x2 or 0x3 73 + */ 74 + __BITFIELD_FIELD(uint64_t ref_clk_fsel:6, 75 + /* Reserved */ 76 + __BITFIELD_FIELD(uint64_t reserved_31_31:1, 77 + /* Controller clock enable. */ 78 + __BITFIELD_FIELD(uint64_t h_clk_en:1, 79 + /* Select bypass input to controller clock divider: 80 + * 0x0 = Use divided coprocessor clock from H_CLKDIV 81 + * 0x1 = Use clock from GPIO pins 82 + */ 83 + __BITFIELD_FIELD(uint64_t h_clk_byp_sel:1, 84 + /* Reset controller clock divider. */ 85 + __BITFIELD_FIELD(uint64_t h_clkdiv_rst:1, 86 + /* Reserved */ 87 + __BITFIELD_FIELD(uint64_t reserved_27_27:1, 88 + /* Clock divider select: 89 + * 0x0 = divide by 1 90 + * 0x1 = divide by 2 91 + * 0x2 = divide by 4 92 + * 0x3 = divide by 6 93 + * 0x4 = divide by 8 94 + * 0x5 = divide by 16 95 + * 0x6 = divide by 24 96 + * 0x7 = divide by 32 97 + */ 98 + __BITFIELD_FIELD(uint64_t h_clkdiv_sel:3, 99 + /* Reserved */ 100 + __BITFIELD_FIELD(uint64_t reserved_22_23:2, 101 + /* USB3 port permanently attached: 0x0 = No, 0x1 = Yes */ 102 + __BITFIELD_FIELD(uint64_t usb3_port_perm_attach:1, 103 + /* USB2 port permanently attached: 0x0 = No, 0x1 = Yes */ 104 + __BITFIELD_FIELD(uint64_t usb2_port_perm_attach:1, 105 + /* Reserved */ 106 + __BITFIELD_FIELD(uint64_t reserved_19_19:1, 107 + /* Disable SuperSpeed PHY: 0x0 = No, 0x1 = Yes */ 108 + __BITFIELD_FIELD(uint64_t usb3_port_disable:1, 109 + /* Reserved */ 110 + __BITFIELD_FIELD(uint64_t reserved_17_17:1, 111 + /* Disable HighSpeed PHY: 0x0 = No, 0x1 = Yes */ 112 + __BITFIELD_FIELD(uint64_t usb2_port_disable:1, 113 + /* Reserved */ 114 + __BITFIELD_FIELD(uint64_t reserved_15_15:1, 115 + /* Enable PHY SuperSpeed block power: 0x0 = No, 0x1 = Yes */ 116 + __BITFIELD_FIELD(uint64_t ss_power_en:1, 117 + /* Reserved */ 118 + __BITFIELD_FIELD(uint64_t reserved_13_13:1, 119 + /* Enable PHY HighSpeed block power: 0x0 = No, 0x1 = Yes */ 120 + __BITFIELD_FIELD(uint64_t hs_power_en:1, 121 + /* Reserved */ 122 + __BITFIELD_FIELD(uint64_t reserved_5_11:7, 123 + /* Enable USB UCTL interface clock: 0xx = No, 0x1 = Yes */ 124 + __BITFIELD_FIELD(uint64_t csclk_en:1, 125 + /* Controller mode: 0x0 = Host, 0x1 = Device */ 126 + __BITFIELD_FIELD(uint64_t drd_mode:1, 127 + /* PHY reset */ 128 + __BITFIELD_FIELD(uint64_t uphy_rst:1, 129 + /* Software reset UAHC */ 130 + __BITFIELD_FIELD(uint64_t uahc_rst:1, 131 + /* Software resets UCTL */ 132 + __BITFIELD_FIELD(uint64_t uctl_rst:1, 133 + ;))))))))))))))))))))))))))))))))) 134 + } s; 135 + }; 136 + 137 + /* UAHC Configuration Register */ 138 + union cvm_usbdrd_uctl_host_cfg { 139 + uint64_t u64; 140 + struct cvm_usbdrd_uctl_host_cfg_s { 141 + /* Reserved */ 142 + __BITFIELD_FIELD(uint64_t reserved_60_63:4, 143 + /* Indicates minimum value of all received BELT values */ 144 + __BITFIELD_FIELD(uint64_t host_current_belt:12, 145 + /* Reserved */ 146 + __BITFIELD_FIELD(uint64_t reserved_38_47:10, 147 + /* HS jitter adjustment */ 148 + __BITFIELD_FIELD(uint64_t fla:6, 149 + /* Reserved */ 150 + __BITFIELD_FIELD(uint64_t reserved_29_31:3, 151 + /* Bus-master enable: 0x0 = Disabled (stall DMAs), 0x1 = enabled */ 152 + __BITFIELD_FIELD(uint64_t bme:1, 153 + /* Overcurrent protection enable: 0x0 = unavailable, 0x1 = available */ 154 + __BITFIELD_FIELD(uint64_t oci_en:1, 155 + /* Overcurrent sene selection: 156 + * 0x0 = Overcurrent indication from off-chip is active-low 157 + * 0x1 = Overcurrent indication from off-chip is active-high 158 + */ 159 + __BITFIELD_FIELD(uint64_t oci_active_high_en:1, 160 + /* Port power control enable: 0x0 = unavailable, 0x1 = available */ 161 + __BITFIELD_FIELD(uint64_t ppc_en:1, 162 + /* Port power control sense selection: 163 + * 0x0 = Port power to off-chip is active-low 164 + * 0x1 = Port power to off-chip is active-high 165 + */ 166 + __BITFIELD_FIELD(uint64_t ppc_active_high_en:1, 167 + /* Reserved */ 168 + __BITFIELD_FIELD(uint64_t reserved_0_23:24, 169 + ;))))))))))) 170 + } s; 171 + }; 172 + 173 + /* UCTL Shim Features Register */ 174 + union cvm_usbdrd_uctl_shim_cfg { 175 + uint64_t u64; 176 + struct cvm_usbdrd_uctl_shim_cfg_s { 177 + /* Out-of-bound UAHC register access: 0 = read, 1 = write */ 178 + __BITFIELD_FIELD(uint64_t xs_ncb_oob_wrn:1, 179 + /* Reserved */ 180 + __BITFIELD_FIELD(uint64_t reserved_60_62:3, 181 + /* SRCID error log for out-of-bound UAHC register access: 182 + * [59:58] = chipID 183 + * [57] = Request source: 0 = core, 1 = NCB-device 184 + * [56:51] = Core/NCB-device number, [56] always 0 for NCB devices 185 + * [50:48] = SubID 186 + */ 187 + __BITFIELD_FIELD(uint64_t xs_ncb_oob_osrc:12, 188 + /* Error log for bad UAHC DMA access: 0 = Read log, 1 = Write log */ 189 + __BITFIELD_FIELD(uint64_t xm_bad_dma_wrn:1, 190 + /* Reserved */ 191 + __BITFIELD_FIELD(uint64_t reserved_44_46:3, 192 + /* Encoded error type for bad UAHC DMA */ 193 + __BITFIELD_FIELD(uint64_t xm_bad_dma_type:4, 194 + /* Reserved */ 195 + __BITFIELD_FIELD(uint64_t reserved_13_39:27, 196 + /* Select the IOI read command used by DMA accesses */ 197 + __BITFIELD_FIELD(uint64_t dma_read_cmd:1, 198 + /* Reserved */ 199 + __BITFIELD_FIELD(uint64_t reserved_10_11:2, 200 + /* Select endian format for DMA accesses to the L2c: 201 + * 0x0 = Little endian 202 + *` 0x1 = Big endian 203 + * 0x2 = Reserved 204 + * 0x3 = Reserved 205 + */ 206 + __BITFIELD_FIELD(uint64_t dma_endian_mode:2, 207 + /* Reserved */ 208 + __BITFIELD_FIELD(uint64_t reserved_2_7:6, 209 + /* Select endian format for IOI CSR access to UAHC: 210 + * 0x0 = Little endian 211 + *` 0x1 = Big endian 212 + * 0x2 = Reserved 213 + * 0x3 = Reserved 214 + */ 215 + __BITFIELD_FIELD(uint64_t csr_endian_mode:2, 216 + ;)))))))))))) 217 + } s; 218 + }; 219 + 220 + #define OCTEON_H_CLKDIV_SEL 8 221 + #define OCTEON_MIN_H_CLK_RATE 150000000 222 + #define OCTEON_MAX_H_CLK_RATE 300000000 223 + 224 + static DEFINE_MUTEX(dwc3_octeon_clocks_mutex); 225 + static uint8_t clk_div[OCTEON_H_CLKDIV_SEL] = {1, 2, 4, 6, 8, 16, 24, 32}; 226 + 227 + 228 + static int dwc3_octeon_config_power(struct device *dev, u64 base) 229 + { 230 + #define UCTL_HOST_CFG 0xe0 231 + union cvm_usbdrd_uctl_host_cfg uctl_host_cfg; 232 + union cvmx_gpio_bit_cfgx gpio_bit; 233 + uint32_t gpio_pwr[3]; 234 + int gpio, len, power_active_low; 235 + struct device_node *node = dev->of_node; 236 + int index = (base >> 24) & 1; 237 + 238 + if (of_find_property(node, "power", &len) != NULL) { 239 + if (len == 12) { 240 + of_property_read_u32_array(node, "power", gpio_pwr, 3); 241 + power_active_low = gpio_pwr[2] & 0x01; 242 + gpio = gpio_pwr[1]; 243 + } else if (len == 8) { 244 + of_property_read_u32_array(node, "power", gpio_pwr, 2); 245 + power_active_low = 0; 246 + gpio = gpio_pwr[1]; 247 + } else { 248 + dev_err(dev, "dwc3 controller clock init failure.\n"); 249 + return -EINVAL; 250 + } 251 + if ((OCTEON_IS_MODEL(OCTEON_CN73XX) || 252 + OCTEON_IS_MODEL(OCTEON_CNF75XX)) 253 + && gpio <= 31) { 254 + gpio_bit.u64 = cvmx_read_csr(CVMX_GPIO_BIT_CFGX(gpio)); 255 + gpio_bit.s.tx_oe = 1; 256 + gpio_bit.cn73xx.output_sel = (index == 0 ? 0x14 : 0x15); 257 + cvmx_write_csr(CVMX_GPIO_BIT_CFGX(gpio), gpio_bit.u64); 258 + } else if (gpio <= 15) { 259 + gpio_bit.u64 = cvmx_read_csr(CVMX_GPIO_BIT_CFGX(gpio)); 260 + gpio_bit.s.tx_oe = 1; 261 + gpio_bit.cn70xx.output_sel = (index == 0 ? 0x14 : 0x19); 262 + cvmx_write_csr(CVMX_GPIO_BIT_CFGX(gpio), gpio_bit.u64); 263 + } else { 264 + gpio_bit.u64 = cvmx_read_csr(CVMX_GPIO_XBIT_CFGX(gpio)); 265 + gpio_bit.s.tx_oe = 1; 266 + gpio_bit.cn70xx.output_sel = (index == 0 ? 0x14 : 0x19); 267 + cvmx_write_csr(CVMX_GPIO_XBIT_CFGX(gpio), gpio_bit.u64); 268 + } 269 + 270 + /* Enable XHCI power control and set if active high or low. */ 271 + uctl_host_cfg.u64 = cvmx_read_csr(base + UCTL_HOST_CFG); 272 + uctl_host_cfg.s.ppc_en = 1; 273 + uctl_host_cfg.s.ppc_active_high_en = !power_active_low; 274 + cvmx_write_csr(base + UCTL_HOST_CFG, uctl_host_cfg.u64); 275 + } else { 276 + /* Disable XHCI power control and set if active high. */ 277 + uctl_host_cfg.u64 = cvmx_read_csr(base + UCTL_HOST_CFG); 278 + uctl_host_cfg.s.ppc_en = 0; 279 + uctl_host_cfg.s.ppc_active_high_en = 0; 280 + cvmx_write_csr(base + UCTL_HOST_CFG, uctl_host_cfg.u64); 281 + dev_warn(dev, "dwc3 controller clock init failure.\n"); 282 + } 283 + return 0; 284 + } 285 + 286 + static int dwc3_octeon_clocks_start(struct device *dev, u64 base) 287 + { 288 + union cvm_usbdrd_uctl_ctl uctl_ctl; 289 + int ref_clk_sel = 2; 290 + u64 div; 291 + u32 clock_rate; 292 + int mpll_mul; 293 + int i; 294 + u64 h_clk_rate; 295 + u64 uctl_ctl_reg = base; 296 + 297 + if (dev->of_node) { 298 + const char *ss_clock_type; 299 + const char *hs_clock_type; 300 + 301 + i = of_property_read_u32(dev->of_node, 302 + "refclk-frequency", &clock_rate); 303 + if (i) { 304 + pr_err("No UCTL \"refclk-frequency\"\n"); 305 + return -EINVAL; 306 + } 307 + i = of_property_read_string(dev->of_node, 308 + "refclk-type-ss", &ss_clock_type); 309 + if (i) { 310 + pr_err("No UCTL \"refclk-type-ss\"\n"); 311 + return -EINVAL; 312 + } 313 + i = of_property_read_string(dev->of_node, 314 + "refclk-type-hs", &hs_clock_type); 315 + if (i) { 316 + pr_err("No UCTL \"refclk-type-hs\"\n"); 317 + return -EINVAL; 318 + } 319 + if (strcmp("dlmc_ref_clk0", ss_clock_type) == 0) { 320 + if (strcmp(hs_clock_type, "dlmc_ref_clk0") == 0) 321 + ref_clk_sel = 0; 322 + else if (strcmp(hs_clock_type, "pll_ref_clk") == 0) 323 + ref_clk_sel = 2; 324 + else 325 + pr_err("Invalid HS clock type %s, using pll_ref_clk instead\n", 326 + hs_clock_type); 327 + } else if (strcmp(ss_clock_type, "dlmc_ref_clk1") == 0) { 328 + if (strcmp(hs_clock_type, "dlmc_ref_clk1") == 0) 329 + ref_clk_sel = 1; 330 + else if (strcmp(hs_clock_type, "pll_ref_clk") == 0) 331 + ref_clk_sel = 3; 332 + else { 333 + pr_err("Invalid HS clock type %s, using pll_ref_clk instead\n", 334 + hs_clock_type); 335 + ref_clk_sel = 3; 336 + } 337 + } else 338 + pr_err("Invalid SS clock type %s, using dlmc_ref_clk0 instead\n", 339 + ss_clock_type); 340 + 341 + if ((ref_clk_sel == 0 || ref_clk_sel == 1) && 342 + (clock_rate != 100000000)) 343 + pr_err("Invalid UCTL clock rate of %u, using 100000000 instead\n", 344 + clock_rate); 345 + 346 + } else { 347 + pr_err("No USB UCTL device node\n"); 348 + return -EINVAL; 349 + } 350 + 351 + /* 352 + * Step 1: Wait for all voltages to be stable...that surely 353 + * happened before starting the kernel. SKIP 354 + */ 355 + 356 + /* Step 2: Select GPIO for overcurrent indication, if desired. SKIP */ 357 + 358 + /* Step 3: Assert all resets. */ 359 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 360 + uctl_ctl.s.uphy_rst = 1; 361 + uctl_ctl.s.uahc_rst = 1; 362 + uctl_ctl.s.uctl_rst = 1; 363 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 364 + 365 + /* Step 4a: Reset the clock dividers. */ 366 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 367 + uctl_ctl.s.h_clkdiv_rst = 1; 368 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 369 + 370 + /* Step 4b: Select controller clock frequency. */ 371 + for (div = 0; div < OCTEON_H_CLKDIV_SEL; div++) { 372 + h_clk_rate = octeon_get_io_clock_rate() / clk_div[div]; 373 + if (h_clk_rate <= OCTEON_MAX_H_CLK_RATE && 374 + h_clk_rate >= OCTEON_MIN_H_CLK_RATE) 375 + break; 376 + } 377 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 378 + uctl_ctl.s.h_clkdiv_sel = div; 379 + uctl_ctl.s.h_clk_en = 1; 380 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 381 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 382 + if ((div != uctl_ctl.s.h_clkdiv_sel) || (!uctl_ctl.s.h_clk_en)) { 383 + dev_err(dev, "dwc3 controller clock init failure.\n"); 384 + return -EINVAL; 385 + } 386 + 387 + /* Step 4c: Deassert the controller clock divider reset. */ 388 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 389 + uctl_ctl.s.h_clkdiv_rst = 0; 390 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 391 + 392 + /* Step 5a: Reference clock configuration. */ 393 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 394 + uctl_ctl.s.ref_clk_sel = ref_clk_sel; 395 + uctl_ctl.s.ref_clk_fsel = 0x07; 396 + uctl_ctl.s.ref_clk_div2 = 0; 397 + switch (clock_rate) { 398 + default: 399 + dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n", 400 + clock_rate); 401 + case 100000000: 402 + mpll_mul = 0x19; 403 + if (ref_clk_sel < 2) 404 + uctl_ctl.s.ref_clk_fsel = 0x27; 405 + break; 406 + case 50000000: 407 + mpll_mul = 0x32; 408 + break; 409 + case 125000000: 410 + mpll_mul = 0x28; 411 + break; 412 + } 413 + uctl_ctl.s.mpll_multiplier = mpll_mul; 414 + 415 + /* Step 5b: Configure and enable spread-spectrum for SuperSpeed. */ 416 + uctl_ctl.s.ssc_en = 1; 417 + 418 + /* Step 5c: Enable SuperSpeed. */ 419 + uctl_ctl.s.ref_ssp_en = 1; 420 + 421 + /* Step 5d: Cofngiure PHYs. SKIP */ 422 + 423 + /* Step 6a & 6b: Power up PHYs. */ 424 + uctl_ctl.s.hs_power_en = 1; 425 + uctl_ctl.s.ss_power_en = 1; 426 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 427 + 428 + /* Step 7: Wait 10 controller-clock cycles to take effect. */ 429 + udelay(10); 430 + 431 + /* Step 8a: Deassert UCTL reset signal. */ 432 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 433 + uctl_ctl.s.uctl_rst = 0; 434 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 435 + 436 + /* Step 8b: Wait 10 controller-clock cycles. */ 437 + udelay(10); 438 + 439 + /* Steo 8c: Setup power-power control. */ 440 + if (dwc3_octeon_config_power(dev, base)) { 441 + dev_err(dev, "Error configuring power.\n"); 442 + return -EINVAL; 443 + } 444 + 445 + /* Step 8d: Deassert UAHC reset signal. */ 446 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 447 + uctl_ctl.s.uahc_rst = 0; 448 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 449 + 450 + /* Step 8e: Wait 10 controller-clock cycles. */ 451 + udelay(10); 452 + 453 + /* Step 9: Enable conditional coprocessor clock of UCTL. */ 454 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 455 + uctl_ctl.s.csclk_en = 1; 456 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 457 + 458 + /*Step 10: Set for host mode only. */ 459 + uctl_ctl.u64 = cvmx_read_csr(uctl_ctl_reg); 460 + uctl_ctl.s.drd_mode = 0; 461 + cvmx_write_csr(uctl_ctl_reg, uctl_ctl.u64); 462 + 463 + return 0; 464 + } 465 + 466 + static void __init dwc3_octeon_set_endian_mode(u64 base) 467 + { 468 + #define UCTL_SHIM_CFG 0xe8 469 + union cvm_usbdrd_uctl_shim_cfg shim_cfg; 470 + 471 + shim_cfg.u64 = cvmx_read_csr(base + UCTL_SHIM_CFG); 472 + #ifdef __BIG_ENDIAN 473 + shim_cfg.s.dma_endian_mode = 1; 474 + shim_cfg.s.csr_endian_mode = 1; 475 + #else 476 + shim_cfg.s.dma_endian_mode = 0; 477 + shim_cfg.s.csr_endian_mode = 0; 478 + #endif 479 + cvmx_write_csr(base + UCTL_SHIM_CFG, shim_cfg.u64); 480 + } 481 + 482 + #define CVMX_USBDRDX_UCTL_CTL(index) \ 483 + (CVMX_ADD_IO_SEG(0x0001180068000000ull) + \ 484 + ((index & 1) * 0x1000000ull)) 485 + static void __init dwc3_octeon_phy_reset(u64 base) 486 + { 487 + union cvm_usbdrd_uctl_ctl uctl_ctl; 488 + int index = (base >> 24) & 1; 489 + 490 + uctl_ctl.u64 = cvmx_read_csr(CVMX_USBDRDX_UCTL_CTL(index)); 491 + uctl_ctl.s.uphy_rst = 0; 492 + cvmx_write_csr(CVMX_USBDRDX_UCTL_CTL(index), uctl_ctl.u64); 493 + } 494 + 495 + static int __init dwc3_octeon_device_init(void) 496 + { 497 + const char compat_node_name[] = "cavium,octeon-7130-usb-uctl"; 498 + struct platform_device *pdev; 499 + struct device_node *node; 500 + struct resource *res; 501 + void __iomem *base; 502 + 503 + /* 504 + * There should only be three universal controllers, "uctl" 505 + * in the device tree. Two USB and a SATA, which we ignore. 506 + */ 507 + node = NULL; 508 + do { 509 + node = of_find_node_by_name(node, "uctl"); 510 + if (!node) 511 + return -ENODEV; 512 + 513 + if (of_device_is_compatible(node, compat_node_name)) { 514 + pdev = of_find_device_by_node(node); 515 + if (!pdev) 516 + return -ENODEV; 517 + 518 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 519 + if (res == NULL) { 520 + dev_err(&pdev->dev, "No memory resources\n"); 521 + return -ENXIO; 522 + } 523 + 524 + /* 525 + * The code below maps in the registers necessary for 526 + * setting up the clocks and reseting PHYs. We must 527 + * release the resources so the dwc3 subsystem doesn't 528 + * know the difference. 529 + */ 530 + base = devm_ioremap_resource(&pdev->dev, res); 531 + if (IS_ERR(base)) 532 + return PTR_ERR(base); 533 + 534 + mutex_lock(&dwc3_octeon_clocks_mutex); 535 + dwc3_octeon_clocks_start(&pdev->dev, (u64)base); 536 + dwc3_octeon_set_endian_mode((u64)base); 537 + dwc3_octeon_phy_reset((u64)base); 538 + dev_info(&pdev->dev, "clocks initialized.\n"); 539 + mutex_unlock(&dwc3_octeon_clocks_mutex); 540 + devm_iounmap(&pdev->dev, base); 541 + devm_release_mem_region(&pdev->dev, res->start, 542 + resource_size(res)); 543 + } 544 + } while (node != NULL); 545 + 546 + return 0; 547 + } 548 + device_initcall(dwc3_octeon_device_init); 549 + 550 + MODULE_AUTHOR("David Daney <david.daney@cavium.com>"); 551 + MODULE_LICENSE("GPL"); 552 + MODULE_DESCRIPTION("USB driver for OCTEON III SoC");
+23
arch/mips/cavium-octeon/setup.c
··· 949 949 } 950 950 #endif /* CONFIG_CRASH_DUMP */ 951 951 952 + void __init fw_init_cmdline(void) 953 + { 954 + int i; 955 + 956 + octeon_boot_desc_ptr = (struct octeon_boot_descriptor *)fw_arg3; 957 + for (i = 0; i < octeon_boot_desc_ptr->argc; i++) { 958 + const char *arg = 959 + cvmx_phys_to_ptr(octeon_boot_desc_ptr->argv[i]); 960 + if (strlen(arcs_cmdline) + strlen(arg) + 1 < 961 + sizeof(arcs_cmdline) - 1) { 962 + strcat(arcs_cmdline, " "); 963 + strcat(arcs_cmdline, arg); 964 + } 965 + } 966 + } 967 + 968 + void __init *plat_get_fdt(void) 969 + { 970 + octeon_bootinfo = 971 + cvmx_phys_to_ptr(octeon_boot_desc_ptr->cvmx_desc_vaddr); 972 + return phys_to_virt(octeon_bootinfo->fdt_addr); 973 + } 974 + 952 975 void __init plat_mem_setup(void) 953 976 { 954 977 uint64_t mem_alloc_size;
+20 -4
arch/mips/cavium-octeon/smp.c
··· 11 11 #include <linux/interrupt.h> 12 12 #include <linux/kernel_stat.h> 13 13 #include <linux/sched.h> 14 - #include <linux/module.h> 14 + #include <linux/init.h> 15 + #include <linux/export.h> 15 16 16 17 #include <asm/mmu_context.h> 17 18 #include <asm/time.h> ··· 25 24 volatile unsigned long octeon_processor_boot = 0xff; 26 25 volatile unsigned long octeon_processor_sp; 27 26 volatile unsigned long octeon_processor_gp; 27 + #ifdef CONFIG_RELOCATABLE 28 + volatile unsigned long octeon_processor_relocated_kernel_entry; 29 + #endif /* CONFIG_RELOCATABLE */ 28 30 29 31 #ifdef CONFIG_HOTPLUG_CPU 30 32 uint64_t octeon_bootloader_entry_addr; 31 33 EXPORT_SYMBOL(octeon_bootloader_entry_addr); 32 34 #endif 35 + 36 + extern void kernel_entry(unsigned long arg1, ...); 33 37 34 38 static void octeon_icache_flush(void) 35 39 { ··· 186 180 octeon_smp_hotplug_setup(); 187 181 } 188 182 183 + 184 + #ifdef CONFIG_RELOCATABLE 185 + int plat_post_relocation(long offset) 186 + { 187 + unsigned long entry = (unsigned long)kernel_entry; 188 + 189 + /* Send secondaries into relocated kernel */ 190 + octeon_processor_relocated_kernel_entry = entry + offset; 191 + 192 + return 0; 193 + } 194 + #endif /* CONFIG_RELOCATABLE */ 195 + 189 196 /** 190 197 * Firmware CPU startup hook 191 198 * ··· 291 272 292 273 set_cpu_online(cpu, false); 293 274 calculate_cpu_foreign_map(); 294 - cpumask_clear_cpu(cpu, &cpu_callin_map); 295 275 octeon_fixup_irqs(); 296 276 297 277 __flush_cache_all(); ··· 350 332 while (1) /* core will be reset here */ 351 333 ; 352 334 } 353 - 354 - extern void kernel_entry(unsigned long arg1, ...); 355 335 356 336 static void start_after_reset(void) 357 337 {
+1
arch/mips/configs/cavium_octeon_defconfig
··· 45 45 # CONFIG_INET_LRO is not set 46 46 CONFIG_IPV6=y 47 47 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 48 + CONFIG_DEVTMPFS=y 48 49 # CONFIG_FW_LOADER is not set 49 50 CONFIG_MTD=y 50 51 # CONFIG_MTD_OF_PARTS is not set
+2 -2
arch/mips/configs/ip22_defconfig
··· 67 67 CONFIG_NF_CONNTRACK=m 68 68 CONFIG_NF_CONNTRACK_SECMARK=y 69 69 CONFIG_NF_CONNTRACK_EVENTS=y 70 - CONFIG_NF_CT_PROTO_DCCP=m 71 - CONFIG_NF_CT_PROTO_UDPLITE=m 70 + CONFIG_NF_CT_PROTO_DCCP=y 71 + CONFIG_NF_CT_PROTO_UDPLITE=y 72 72 CONFIG_NF_CONNTRACK_AMANDA=m 73 73 CONFIG_NF_CONNTRACK_FTP=m 74 74 CONFIG_NF_CONNTRACK_H323=m
+1 -2
arch/mips/configs/ip27_defconfig
··· 133 133 CONFIG_SCSI_QLOGIC_1280=y 134 134 CONFIG_SCSI_PMCRAID=m 135 135 CONFIG_SCSI_BFA_FC=m 136 - CONFIG_SCSI_DH=m 136 + CONFIG_SCSI_DH=y 137 137 CONFIG_SCSI_DH_RDAC=m 138 138 CONFIG_SCSI_DH_HP_SW=m 139 139 CONFIG_SCSI_DH_EMC=m ··· 205 205 # CONFIG_MLX4_DEBUG is not set 206 206 CONFIG_TEHUTI=m 207 207 CONFIG_BNX2X=m 208 - CONFIG_QLGE=m 209 208 CONFIG_SFC=m 210 209 CONFIG_BE2NET=m 211 210 CONFIG_LIBERTAS_THINFIRM=m
+1 -1
arch/mips/configs/lemote2f_defconfig
··· 39 39 CONFIG_PM_STD_PARTITION="/dev/hda3" 40 40 CONFIG_CPU_FREQ=y 41 41 CONFIG_CPU_FREQ_DEBUG=y 42 - CONFIG_CPU_FREQ_STAT=m 42 + CONFIG_CPU_FREQ_STAT=y 43 43 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 44 44 CONFIG_CPU_FREQ_GOV_POWERSAVE=m 45 45 CONFIG_CPU_FREQ_GOV_USERSPACE=m
+4
arch/mips/configs/loongson1b_defconfig
··· 74 74 CONFIG_GPIOLIB=y 75 75 CONFIG_GPIO_LOONGSON1=y 76 76 # CONFIG_HWMON is not set 77 + CONFIG_WATCHDOG=y 78 + CONFIG_WATCHDOG_NOWAYOUT=y 79 + CONFIG_WATCHDOG_SYSFS=y 80 + CONFIG_LOONGSON1_WDT=y 77 81 # CONFIG_VGA_CONSOLE is not set 78 82 CONFIG_HID_GENERIC=m 79 83 CONFIG_USB_HID=m
+4
arch/mips/configs/loongson1c_defconfig
··· 75 75 CONFIG_GPIOLIB=y 76 76 CONFIG_GPIO_LOONGSON1=y 77 77 # CONFIG_HWMON is not set 78 + CONFIG_WATCHDOG=y 79 + CONFIG_WATCHDOG_NOWAYOUT=y 80 + CONFIG_WATCHDOG_SYSFS=y 81 + CONFIG_LOONGSON1_WDT=y 78 82 # CONFIG_VGA_CONSOLE is not set 79 83 CONFIG_HID_GENERIC=m 80 84 CONFIG_USB_HID=m
+2 -2
arch/mips/configs/malta_defconfig
··· 59 59 CONFIG_NF_CONNTRACK=m 60 60 CONFIG_NF_CONNTRACK_SECMARK=y 61 61 CONFIG_NF_CONNTRACK_EVENTS=y 62 - CONFIG_NF_CT_PROTO_DCCP=m 63 - CONFIG_NF_CT_PROTO_UDPLITE=m 62 + CONFIG_NF_CT_PROTO_DCCP=y 63 + CONFIG_NF_CT_PROTO_UDPLITE=y 64 64 CONFIG_NF_CONNTRACK_AMANDA=m 65 65 CONFIG_NF_CONNTRACK_FTP=m 66 66 CONFIG_NF_CONNTRACK_H323=m
+2 -2
arch/mips/configs/malta_kvm_defconfig
··· 60 60 CONFIG_NF_CONNTRACK=m 61 61 CONFIG_NF_CONNTRACK_SECMARK=y 62 62 CONFIG_NF_CONNTRACK_EVENTS=y 63 - CONFIG_NF_CT_PROTO_DCCP=m 64 - CONFIG_NF_CT_PROTO_UDPLITE=m 63 + CONFIG_NF_CT_PROTO_DCCP=y 64 + CONFIG_NF_CT_PROTO_UDPLITE=y 65 65 CONFIG_NF_CONNTRACK_AMANDA=m 66 66 CONFIG_NF_CONNTRACK_FTP=m 67 67 CONFIG_NF_CONNTRACK_H323=m
+2 -2
arch/mips/configs/malta_kvm_guest_defconfig
··· 59 59 CONFIG_NF_CONNTRACK=m 60 60 CONFIG_NF_CONNTRACK_SECMARK=y 61 61 CONFIG_NF_CONNTRACK_EVENTS=y 62 - CONFIG_NF_CT_PROTO_DCCP=m 63 - CONFIG_NF_CT_PROTO_UDPLITE=m 62 + CONFIG_NF_CT_PROTO_DCCP=y 63 + CONFIG_NF_CT_PROTO_UDPLITE=y 64 64 CONFIG_NF_CONNTRACK_AMANDA=m 65 65 CONFIG_NF_CONNTRACK_FTP=m 66 66 CONFIG_NF_CONNTRACK_H323=m
+2 -2
arch/mips/configs/maltaup_xpa_defconfig
··· 61 61 CONFIG_NF_CONNTRACK=m 62 62 CONFIG_NF_CONNTRACK_SECMARK=y 63 63 CONFIG_NF_CONNTRACK_EVENTS=y 64 - CONFIG_NF_CT_PROTO_DCCP=m 65 - CONFIG_NF_CT_PROTO_UDPLITE=m 64 + CONFIG_NF_CT_PROTO_DCCP=y 65 + CONFIG_NF_CT_PROTO_UDPLITE=y 66 66 CONFIG_NF_CONNTRACK_AMANDA=m 67 67 CONFIG_NF_CONNTRACK_FTP=m 68 68 CONFIG_NF_CONNTRACK_H323=m
+1 -1
arch/mips/configs/nlm_xlp_defconfig
··· 110 110 CONFIG_NF_CONNTRACK=m 111 111 CONFIG_NF_CONNTRACK_SECMARK=y 112 112 CONFIG_NF_CONNTRACK_EVENTS=y 113 - CONFIG_NF_CT_PROTO_UDPLITE=m 113 + CONFIG_NF_CT_PROTO_UDPLITE=y 114 114 CONFIG_NF_CONNTRACK_AMANDA=m 115 115 CONFIG_NF_CONNTRACK_FTP=m 116 116 CONFIG_NF_CONNTRACK_H323=m
+1 -1
arch/mips/configs/nlm_xlr_defconfig
··· 90 90 CONFIG_NF_CONNTRACK=m 91 91 CONFIG_NF_CONNTRACK_SECMARK=y 92 92 CONFIG_NF_CONNTRACK_EVENTS=y 93 - CONFIG_NF_CT_PROTO_UDPLITE=m 93 + CONFIG_NF_CT_PROTO_UDPLITE=y 94 94 CONFIG_NF_CONNTRACK_AMANDA=m 95 95 CONFIG_NF_CONNTRACK_FTP=m 96 96 CONFIG_NF_CONNTRACK_H323=m
+36 -1
arch/mips/configs/xilfpga_defconfig
··· 7 7 CONFIG_SLAB=y 8 8 # CONFIG_BLOCK is not set 9 9 # CONFIG_SUSPEND is not set 10 + CONFIG_NET=y 11 + CONFIG_PACKET=y 12 + CONFIG_UNIX=y 13 + CONFIG_INET=y 14 + # CONFIG_IPV6 is not set 15 + # CONFIG_WIRELESS is not set 10 16 # CONFIG_UEVENT_HELPER is not set 11 17 CONFIG_DEVTMPFS=y 12 18 CONFIG_DEVTMPFS_MOUNT=y ··· 20 14 # CONFIG_PREVENT_FIRMWARE_BUILD is not set 21 15 # CONFIG_FW_LOADER is not set 22 16 # CONFIG_ALLOW_DEV_COREDUMP is not set 17 + CONFIG_NETDEVICES=y 18 + # CONFIG_NET_CORE is not set 19 + # CONFIG_NET_VENDOR_ARC is not set 20 + # CONFIG_NET_CADENCE is not set 21 + # CONFIG_NET_VENDOR_BROADCOM is not set 22 + # CONFIG_NET_VENDOR_EZCHIP is not set 23 + # CONFIG_NET_VENDOR_INTEL is not set 24 + # CONFIG_NET_VENDOR_MARVELL is not set 25 + # CONFIG_NET_VENDOR_MICREL is not set 26 + # CONFIG_NET_VENDOR_NATSEMI is not set 27 + # CONFIG_NET_VENDOR_NETRONOME is not set 28 + # CONFIG_NET_VENDOR_QUALCOMM is not set 29 + # CONFIG_NET_VENDOR_RENESAS is not set 30 + # CONFIG_NET_VENDOR_ROCKER is not set 31 + # CONFIG_NET_VENDOR_SAMSUNG is not set 32 + # CONFIG_NET_VENDOR_SEEQ is not set 33 + # CONFIG_NET_VENDOR_SMSC is not set 34 + # CONFIG_NET_VENDOR_STMICRO is not set 35 + # CONFIG_NET_VENDOR_SYNOPSYS is not set 36 + # CONFIG_NET_VENDOR_VIA is not set 37 + # CONFIG_NET_VENDOR_WIZNET is not set 38 + CONFIG_XILINX_EMACLITE=y 39 + CONFIG_SMSC_PHY=y 40 + # CONFIG_WLAN is not set 23 41 # CONFIG_INPUT_MOUSEDEV is not set 24 42 # CONFIG_INPUT_KEYBOARD is not set 25 43 # CONFIG_INPUT_MOUSE is not set ··· 55 25 CONFIG_SERIAL_8250_CONSOLE=y 56 26 CONFIG_SERIAL_OF_PLATFORM=y 57 27 # CONFIG_HW_RANDOM is not set 28 + CONFIG_I2C=y 29 + CONFIG_I2C_CHARDEV=y 30 + # CONFIG_I2C_HELPER_AUTO is not set 31 + CONFIG_I2C_XILINX=y 58 32 CONFIG_GPIO_SYSFS=y 59 33 CONFIG_GPIO_XILINX=y 60 - # CONFIG_HWMON is not set 34 + CONFIG_SENSORS_ADT7410=y 61 35 # CONFIG_USB_SUPPORT is not set 62 36 # CONFIG_MIPS_PLATFORM_DEVICES is not set 63 37 # CONFIG_IOMMU_SUPPORT is not set 64 38 # CONFIG_PROC_PAGE_MONITOR is not set 39 + CONFIG_TMPFS=y 65 40 # CONFIG_MISC_FILESYSTEMS is not set 66 41 CONFIG_PANIC_ON_OOPS=y 67 42 # CONFIG_SCHED_DEBUG is not set
+13 -8
arch/mips/configs/xway_defconfig
··· 1 1 CONFIG_LANTIQ=y 2 + CONFIG_PCI_LANTIQ=y 2 3 CONFIG_XRX200_PHY_FW=y 3 4 CONFIG_CPU_MIPS32_R2=y 5 + CONFIG_MIPS_MT_SMP=y 6 + CONFIG_MIPS_VPE_LOADER=y 4 7 # CONFIG_COMPACTION is not set 5 - # CONFIG_CROSS_MEMORY_ATTACH is not set 8 + CONFIG_NR_CPUS=2 6 9 CONFIG_HZ_100=y 7 10 # CONFIG_SECCOMP is not set 8 11 # CONFIG_LOCALVERSION_AUTO is not set 9 12 CONFIG_SYSVIPC=y 13 + # CONFIG_CROSS_MEMORY_ATTACH is not set 10 14 CONFIG_HIGH_RES_TIMERS=y 11 15 CONFIG_BLK_DEV_INITRD=y 12 16 # CONFIG_RD_GZIP is not set ··· 26 22 # CONFIG_BLK_DEV_BSG is not set 27 23 CONFIG_PARTITION_ADVANCED=y 28 24 # CONFIG_IOSCHED_CFQ is not set 25 + CONFIG_PCI=y 29 26 # CONFIG_COREDUMP is not set 30 - # CONFIG_SUSPEND is not set 31 27 CONFIG_NET=y 32 28 CONFIG_PACKET=y 33 29 CONFIG_UNIX=y ··· 39 35 CONFIG_IP_ROUTE_VERBOSE=y 40 36 CONFIG_IP_MROUTE=y 41 37 CONFIG_IP_MROUTE_MULTIPLE_TABLES=y 42 - CONFIG_ARPD=y 43 38 CONFIG_SYN_COOKIES=y 44 39 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 45 40 # CONFIG_INET_XFRM_MODE_TUNNEL is not set 46 41 # CONFIG_INET_XFRM_MODE_BEET is not set 47 - # CONFIG_INET_LRO is not set 48 42 # CONFIG_INET_DIAG is not set 49 43 CONFIG_TCP_CONG_ADVANCED=y 50 44 # CONFIG_TCP_CONG_BIC is not set ··· 64 62 CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 65 63 CONFIG_NETFILTER_XT_MATCH_STATE=m 66 64 CONFIG_NF_CONNTRACK_IPV4=m 67 - # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set 68 65 CONFIG_IP_NF_IPTABLES=m 69 66 CONFIG_IP_NF_FILTER=m 70 67 CONFIG_IP_NF_TARGET_REJECT=m ··· 85 84 CONFIG_MTD_PHYSMAP=y 86 85 CONFIG_MTD_PHYSMAP_OF=y 87 86 CONFIG_MTD_LANTIQ=y 87 + CONFIG_MTD_NAND=y 88 + CONFIG_MTD_NAND_XWAY=y 88 89 CONFIG_EEPROM_93CX6=m 89 90 CONFIG_SCSI=y 90 91 CONFIG_BLK_DEV_SD=y ··· 94 91 CONFIG_LANTIQ_ETOP=y 95 92 # CONFIG_NET_VENDOR_WIZNET is not set 96 93 CONFIG_PHYLIB=y 94 + CONFIG_INTEL_XWAY_PHY=y 97 95 CONFIG_PPP=m 98 96 CONFIG_PPP_FILTER=y 99 97 CONFIG_PPP_MULTILINK=y ··· 115 111 CONFIG_SERIAL_8250_CONSOLE=y 116 112 CONFIG_SERIAL_8250_RUNTIME_UARTS=2 117 113 CONFIG_SERIAL_OF_PLATFORM=y 114 + CONFIG_SERIAL_LANTIQ=y 118 115 CONFIG_SPI=y 119 116 CONFIG_GPIO_MM_LANTIQ=y 120 117 CONFIG_GPIO_STP_XWAY=y 121 118 # CONFIG_HWMON is not set 122 119 CONFIG_WATCHDOG=y 120 + CONFIG_LANTIQ_WDT=y 123 121 # CONFIG_HID is not set 124 122 # CONFIG_USB_HID is not set 125 123 CONFIG_USB=y 126 124 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 127 125 CONFIG_USB_STORAGE=y 128 126 CONFIG_USB_STORAGE_DEBUG=y 127 + CONFIG_USB_DWC2=y 128 + CONFIG_USB_DWC2_PCI=y 129 129 CONFIG_NEW_LEDS=y 130 130 CONFIG_LEDS_CLASS=y 131 131 CONFIG_LEDS_TRIGGERS=y ··· 159 151 # CONFIG_SCHED_DEBUG is not set 160 152 # CONFIG_FTRACE is not set 161 153 CONFIG_CMDLINE_BOOL=y 162 - CONFIG_CRYPTO_MANAGER=m 163 154 CONFIG_CRYPTO_ARC4=m 164 - # CONFIG_CRYPTO_ANSI_CPRNG is not set 165 155 CONFIG_CRC_ITU_T=m 166 156 CONFIG_CRC32_SARWATE=y 167 - CONFIG_AVERAGE=y
+1 -1
arch/mips/dec/prom/identify.c
··· 7 7 #include <linux/init.h> 8 8 #include <linux/kernel.h> 9 9 #include <linux/mc146818rtc.h> 10 - #include <linux/module.h> 10 + #include <linux/export.h> 11 11 #include <linux/string.h> 12 12 #include <linux/types.h> 13 13
+1 -1
arch/mips/dec/setup.c
··· 9 9 * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki 10 10 */ 11 11 #include <linux/console.h> 12 + #include <linux/export.h> 12 13 #include <linux/init.h> 13 14 #include <linux/interrupt.h> 14 15 #include <linux/ioport.h> 15 16 #include <linux/irq.h> 16 17 #include <linux/irqnr.h> 17 - #include <linux/module.h> 18 18 #include <linux/param.h> 19 19 #include <linux/percpu-defs.h> 20 20 #include <linux/sched.h>
+1 -3
arch/mips/dec/wbflush.c
··· 14 14 * Copyright (C) 2002 Maciej W. Rozycki 15 15 */ 16 16 17 + #include <linux/export.h> 17 18 #include <linux/init.h> 18 19 19 20 #include <asm/bootinfo.h> ··· 89 88 { 90 89 __fast_iob(); 91 90 } 92 - 93 - #include <linux/module.h> 94 - 95 91 EXPORT_SYMBOL(__wbflush);
+1 -1
arch/mips/emma/markeins/setup.c
··· 90 90 static void markeins_board_init(void); 91 91 extern void markeins_irq_setup(void); 92 92 93 - static void inline __init markeins_sio_setup(void) 93 + static inline void __init markeins_sio_setup(void) 94 94 { 95 95 } 96 96
+1
arch/mips/generic/Makefile
··· 13 13 obj-y += proc.o 14 14 15 15 obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o 16 + obj-$(CONFIG_KEXEC) += kexec.o
+13
arch/mips/generic/init.c
··· 88 88 return (void *)fdt; 89 89 } 90 90 91 + void __init plat_fdt_relocated(void *new_location) 92 + { 93 + /* 94 + * reset fdt as the cached value would point to the location 95 + * before relocations happened and update the location argument 96 + * if it was passed using UHI 97 + */ 98 + fdt = NULL; 99 + 100 + if (fw_arg0 == -2) 101 + fw_arg1 = (unsigned long)new_location; 102 + } 103 + 91 104 void __init plat_mem_setup(void) 92 105 { 93 106 if (mach && mach->fixup_fdt)
+44
arch/mips/generic/kexec.c
··· 1 + /* 2 + * Copyright (C) 2016 Imagination Technologies 3 + * Author: Marcin Nowakowski <marcin.nowakowski@imgtec.com> 4 + * 5 + * This program is free software; you can redistribute it and/or modify it 6 + * under the terms of the GNU General Public License as published by the 7 + * Free Software Foundation; either version 2 of the License, or (at your 8 + * option) any later version. 9 + */ 10 + 11 + #include <linux/kexec.h> 12 + #include <linux/libfdt.h> 13 + #include <linux/uaccess.h> 14 + 15 + static int generic_kexec_prepare(struct kimage *image) 16 + { 17 + int i; 18 + 19 + for (i = 0; i < image->nr_segments; i++) { 20 + struct fdt_header fdt; 21 + 22 + if (image->segment[i].memsz <= sizeof(fdt)) 23 + continue; 24 + 25 + if (copy_from_user(&fdt, image->segment[i].buf, sizeof(fdt))) 26 + continue; 27 + 28 + if (fdt_check_header(&fdt)) 29 + continue; 30 + 31 + kexec_args[0] = -2; 32 + kexec_args[1] = (unsigned long) 33 + phys_to_virt((unsigned long)image->segment[i].mem); 34 + break; 35 + } 36 + return 0; 37 + } 38 + 39 + static int __init register_generic_kexec(void) 40 + { 41 + _machine_kexec_prepare = generic_kexec_prepare; 42 + return 0; 43 + } 44 + arch_initcall(register_generic_kexec);
+2
arch/mips/include/asm/Kbuild
··· 4 4 generic-y += current.h 5 5 generic-y += dma-contiguous.h 6 6 generic-y += emergency-restart.h 7 + generic-y += export.h 7 8 generic-y += irq_work.h 8 9 generic-y += local64.h 9 10 generic-y += mcs_spinlock.h ··· 16 15 generic-y += segment.h 17 16 generic-y += serial.h 18 17 generic-y += trace_clock.h 18 + generic-y += unaligned.h 19 19 generic-y += user.h 20 20 generic-y += word-at-a-time.h 21 21 generic-y += xor.h
+5
arch/mips/include/asm/asm-prototypes.h
··· 1 + #include <asm/checksum.h> 2 + #include <asm/page.h> 3 + #include <asm/fpu.h> 4 + #include <asm-generic/asm-prototypes.h> 5 + #include <asm/uaccess.h>
+6 -4
arch/mips/include/asm/asm.h
··· 54 54 .align 2; \ 55 55 .type symbol, @function; \ 56 56 .ent symbol, 0; \ 57 - symbol: .frame sp, 0, ra 57 + symbol: .frame sp, 0, ra; \ 58 + .insn 58 59 59 60 /* 60 61 * NESTED - declare nested routine entry point ··· 64 63 .globl symbol; \ 65 64 .align 2; \ 66 65 .type symbol, @function; \ 67 - .ent symbol, 0; \ 68 - symbol: .frame sp, framesize, rpc 66 + .ent symbol, 0; \ 67 + symbol: .frame sp, framesize, rpc; \ 68 + .insn 69 69 70 70 /* 71 71 * END - mark end of function ··· 88 86 #define FEXPORT(symbol) \ 89 87 .globl symbol; \ 90 88 .type symbol, @function; \ 91 - symbol: 89 + symbol: .insn 92 90 93 91 /* 94 92 * ABS - export absolute symbol
+13
arch/mips/include/asm/bootinfo.h
··· 164 164 * Return: Pointer to the flattened device tree blob. 165 165 */ 166 166 extern void *plat_get_fdt(void); 167 + 168 + #ifdef CONFIG_RELOCATABLE 169 + 170 + /** 171 + * plat_fdt_relocated() - Update platform's information about relocated dtb 172 + * 173 + * This function provides a platform-independent API to set platform's 174 + * information about relocated DTB if it needs to be moved due to kernel 175 + * relocation occurring at boot. 176 + */ 177 + void plat_fdt_relocated(void *new_location); 178 + 179 + #endif /* CONFIG_RELOCATABLE */ 167 180 #endif /* CONFIG_USE_OF */ 168 181 169 182 #endif /* _ASM_BOOTINFO_H */
+2
arch/mips/include/asm/checksum.h
··· 186 186 " daddu %0, %4 \n" 187 187 " dsll32 $1, %0, 0 \n" 188 188 " daddu %0, $1 \n" 189 + " sltu $1, %0, $1 \n" 189 190 " dsra32 %0, %0, 0 \n" 191 + " addu %0, $1 \n" 190 192 #endif 191 193 " .set pop" 192 194 : "=r" (sum)
+9
arch/mips/include/asm/elf.h
··· 210 210 typedef double elf_fpreg_t; 211 211 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; 212 212 213 + void mips_dump_regs32(u32 *uregs, const struct pt_regs *regs); 214 + void mips_dump_regs64(u64 *uregs, const struct pt_regs *regs); 215 + 213 216 #ifdef CONFIG_32BIT 214 217 /* 215 218 * This is used to ensure we don't load something for the wrong architecture. ··· 223 220 * These are used to set parameters in the core dumps. 224 221 */ 225 222 #define ELF_CLASS ELFCLASS32 223 + 224 + #define ELF_CORE_COPY_REGS(dest, regs) \ 225 + mips_dump_regs32((u32 *)&(dest), (regs)); 226 226 227 227 #endif /* CONFIG_32BIT */ 228 228 ··· 239 233 * These are used to set parameters in the core dumps. 240 234 */ 241 235 #define ELF_CLASS ELFCLASS64 236 + 237 + #define ELF_CORE_COPY_REGS(dest, regs) \ 238 + mips_dump_regs64((u64 *)&(dest), (regs)); 242 239 243 240 #endif /* CONFIG_64BIT */ 244 241
-3
arch/mips/include/asm/highmem.h
··· 25 25 #include <asm/cpu-features.h> 26 26 #include <asm/kmap_types.h> 27 27 28 - /* undef for production */ 29 - #define HIGHMEM_DEBUG 1 30 - 31 28 /* declarations for highmem.c */ 32 29 extern unsigned long highstart_pfn, highend_pfn; 33 30
-1
arch/mips/include/asm/i8259.h
··· 40 40 extern void make_8259A_irq(unsigned int irq); 41 41 42 42 extern void init_i8259_irqs(void); 43 - extern int i8259_of_init(struct device_node *node, struct device_node *parent); 44 43 45 44 /** 46 45 * i8159_set_poll() - Override the i8259 polling function
+12
arch/mips/include/asm/irq.h
··· 17 17 18 18 #include <irq.h> 19 19 20 + #define IRQ_STACK_SIZE THREAD_SIZE 21 + 22 + extern void *irq_stack[NR_CPUS]; 23 + 24 + static inline bool on_irq_stack(int cpu, unsigned long sp) 25 + { 26 + unsigned long low = (unsigned long)irq_stack[cpu]; 27 + unsigned long high = low + IRQ_STACK_SIZE; 28 + 29 + return (low <= sp && sp <= high); 30 + } 31 + 20 32 #ifdef CONFIG_I8259 21 33 static inline int irq_canonicalize(int irq) 22 34 {
+9
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
··· 80 80 BCM47XX_BOARD_LINKSYS_WRT610NV2, 81 81 BCM47XX_BOARD_LINKSYS_WRTSL54GS, 82 82 83 + BCM47XX_BOARD_LUXUL_ABR_4400_V1, 84 + BCM47XX_BOARD_LUXUL_XAP_310_V1, 85 + BCM47XX_BOARD_LUXUL_XAP_1210_V1, 86 + BCM47XX_BOARD_LUXUL_XAP_1230_V1, 87 + BCM47XX_BOARD_LUXUL_XAP_1240_V1, 88 + BCM47XX_BOARD_LUXUL_XAP_1500_V1, 89 + BCM47XX_BOARD_LUXUL_XBR_4400_V1, 90 + BCM47XX_BOARD_LUXUL_XVW_P30_V1, 91 + BCM47XX_BOARD_LUXUL_XWR_600_V1, 83 92 BCM47XX_BOARD_LUXUL_XWR_1750_V1, 84 93 85 94 BCM47XX_BOARD_MICROSOFT_MN700,
+13 -2
arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h
··· 99 99 # to begin 100 100 # 101 101 102 - # This is the variable where the next core to boot os stored 103 - PTR_LA t0, octeon_processor_boot 104 102 octeon_spin_wait_boot: 103 + #ifdef CONFIG_RELOCATABLE 104 + PTR_LA t0, octeon_processor_relocated_kernel_entry 105 + LONG_L t0, (t0) 106 + beq zero, t0, 1f 107 + nop 108 + 109 + jr t0 110 + nop 111 + 1: 112 + #endif /* CONFIG_RELOCATABLE */ 113 + 114 + # This is the variable where the next core to boot is stored 115 + PTR_LA t0, octeon_processor_boot 105 116 # Get the core id of the next to be booted 106 117 LONG_L t1, (t0) 107 118 # Keep looping if it isn't me
+4 -2
arch/mips/include/asm/mach-ip27/spaces.h
··· 12 12 13 13 /* 14 14 * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects 15 - * uncached memory addressing. 15 + * uncached memory addressing. Hide the definitions on 32-bit compilation 16 + * of the compat-vdso code. 16 17 */ 17 - 18 + #ifdef CONFIG_64BIT 18 19 #define HSPEC_BASE 0x9000000000000000 19 20 #define IO_BASE 0x9200000000000000 20 21 #define MSPEC_BASE 0x9400000000000000 21 22 #define UNCAC_BASE 0x9600000000000000 22 23 #define CAC_BASE 0xa800000000000000 24 + #endif 23 25 24 26 #define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK)) 25 27 #define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK))
+5 -4
arch/mips/include/asm/mach-loongson32/loongson1.h
··· 3 3 * 4 4 * Register mappings for Loongson 1 5 5 * 6 - * This program is free software; you can redistribute it and/or modify it 7 - * under the terms of the GNU General Public License as published by the 8 - * Free Software Foundation; either version 2 of the License, or (at your 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License as published by the 8 + * Free Software Foundation; either version 2 of the License, or (at your 9 9 * option) any later version. 10 10 */ 11 11 ··· 13 13 #define __ASM_MACH_LOONGSON32_LOONGSON1_H 14 14 15 15 #if defined(CONFIG_LOONGSON1_LS1B) 16 - #define DEFAULT_MEMSIZE 256 /* If no memsize provided */ 16 + #define DEFAULT_MEMSIZE 64 /* If no memsize provided */ 17 17 #elif defined(CONFIG_LOONGSON1_LS1C) 18 18 #define DEFAULT_MEMSIZE 32 19 19 #endif ··· 52 52 #include <regs-clk.h> 53 53 #include <regs-mux.h> 54 54 #include <regs-pwm.h> 55 + #include <regs-rtc.h> 55 56 #include <regs-wdt.h> 56 57 57 58 #endif /* __ASM_MACH_LOONGSON32_LOONGSON1_H */
+5 -4
arch/mips/include/asm/mach-loongson32/platform.h
··· 1 1 /* 2 2 * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 3 3 * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms of the GNU General Public License as published by the 6 - * Free Software Foundation; either version 2 of the License, or (at your 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 7 * option) any later version. 8 8 */ 9 9 ··· 25 25 extern struct platform_device ls1x_gpio1_pdev; 26 26 extern struct platform_device ls1x_nand_pdev; 27 27 extern struct platform_device ls1x_rtc_pdev; 28 + extern struct platform_device ls1x_wdt_pdev; 28 29 29 30 void __init ls1x_clk_init(void); 30 31 void __init ls1x_dma_set_platdata(struct plat_ls1x_dma *pdata); 31 32 void __init ls1x_nand_set_platdata(struct plat_ls1x_nand *pdata); 32 - void __init ls1x_serial_set_uartclk(struct platform_device *pdev); 33 33 void __init ls1x_rtc_set_extclk(struct platform_device *pdev); 34 + void __init ls1x_serial_set_uartclk(struct platform_device *pdev); 34 35 35 36 #endif /* __ASM_MACH_LOONGSON32_PLATFORM_H */
+23
arch/mips/include/asm/mach-loongson32/regs-rtc.h
··· 1 + /* 2 + * Copyright (c) 2016 Yang Ling <gnaygnil@gmail.com> 3 + * 4 + * Loongson 1 RTC timer Register Definitions. 5 + * 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License as published by the 8 + * Free Software Foundation; either version 2 of the License, or (at your 9 + * option) any later version. 10 + */ 11 + 12 + #ifndef __ASM_MACH_LOONGSON32_REGS_RTC_H 13 + #define __ASM_MACH_LOONGSON32_REGS_RTC_H 14 + 15 + #define LS1X_RTC_REG(x) \ 16 + ((void __iomem *)KSEG1ADDR(LS1X_RTC_BASE + (x))) 17 + 18 + #define LS1X_RTC_CTRL LS1X_RTC_REG(0x40) 19 + 20 + #define RTC_EXTCLK_OK (BIT(5) | BIT(8)) 21 + #define RTC_EXTCLK_EN BIT(8) 22 + 23 + #endif /* __ASM_MACH_LOONGSON32_REGS_RTC_H */
+6 -1
arch/mips/include/asm/mach-ralink/mt7620.h
··· 115 115 #define MT7620_GPIO_MODE_WDT_MASK 0x3 116 116 #define MT7620_GPIO_MODE_WDT_SHIFT 21 117 117 118 + #define MT7620_GPIO_MODE_MDIO 0 119 + #define MT7620_GPIO_MODE_MDIO_REFCLK 1 120 + #define MT7620_GPIO_MODE_MDIO_GPIO 2 121 + #define MT7620_GPIO_MODE_MDIO_MASK 0x3 122 + #define MT7620_GPIO_MODE_MDIO_SHIFT 7 123 + 118 124 #define MT7620_GPIO_MODE_I2C 0 119 125 #define MT7620_GPIO_MODE_UART1 5 120 - #define MT7620_GPIO_MODE_MDIO 8 121 126 #define MT7620_GPIO_MODE_RGMII1 9 122 127 #define MT7620_GPIO_MODE_RGMII2 10 123 128 #define MT7620_GPIO_MODE_SPI 11
+7
arch/mips/include/asm/mips-cm.h
··· 187 187 BUILD_CM_RW(base, MIPS_CM_GCB_OFS + 0x08) 188 188 BUILD_CM_RW(access, MIPS_CM_GCB_OFS + 0x20) 189 189 BUILD_CM_R_(rev, MIPS_CM_GCB_OFS + 0x30) 190 + BUILD_CM_RW(err_control, MIPS_CM_GCB_OFS + 0x38) 190 191 BUILD_CM_RW(error_mask, MIPS_CM_GCB_OFS + 0x40) 191 192 BUILD_CM_RW(error_cause, MIPS_CM_GCB_OFS + 0x48) 192 193 BUILD_CM_RW(error_addr, MIPS_CM_GCB_OFS + 0x50) ··· 266 265 #define CM_REV_CM2 CM_ENCODE_REV(6, 0) 267 266 #define CM_REV_CM2_5 CM_ENCODE_REV(7, 0) 268 267 #define CM_REV_CM3 CM_ENCODE_REV(8, 0) 268 + 269 + /* GCR_ERR_CONTROL register fields */ 270 + #define CM_GCR_ERR_CONTROL_L2_ECC_EN_SHF 1 271 + #define CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK (_ULCAST_(0x1) << 1) 272 + #define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_SHF 0 273 + #define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK (_ULCAST_(0x1) << 0) 269 274 270 275 /* GCR_ERROR_CAUSE register fields */ 271 276 #define CM_GCR_ERROR_CAUSE_ERRTYPE_SHF 27
+33
arch/mips/include/asm/mipsregs.h
··· 685 685 #define MIPS_WATCHHI_W (_ULCAST_(1) << 0) 686 686 #define MIPS_WATCHHI_IRW (_ULCAST_(0x7) << 0) 687 687 688 + /* PerfCnt control register definitions */ 689 + #define MIPS_PERFCTRL_EXL (_ULCAST_(1) << 0) 690 + #define MIPS_PERFCTRL_K (_ULCAST_(1) << 1) 691 + #define MIPS_PERFCTRL_S (_ULCAST_(1) << 2) 692 + #define MIPS_PERFCTRL_U (_ULCAST_(1) << 3) 693 + #define MIPS_PERFCTRL_IE (_ULCAST_(1) << 4) 694 + #define MIPS_PERFCTRL_EVENT_S 5 695 + #define MIPS_PERFCTRL_EVENT (_ULCAST_(0x3ff) << MIPS_PERFCTRL_EVENT_S) 696 + #define MIPS_PERFCTRL_PCTD (_ULCAST_(1) << 15) 697 + #define MIPS_PERFCTRL_EC (_ULCAST_(0x3) << 23) 698 + #define MIPS_PERFCTRL_EC_R (_ULCAST_(0) << 23) 699 + #define MIPS_PERFCTRL_EC_RI (_ULCAST_(1) << 23) 700 + #define MIPS_PERFCTRL_EC_G (_ULCAST_(2) << 23) 701 + #define MIPS_PERFCTRL_EC_GRI (_ULCAST_(3) << 23) 702 + #define MIPS_PERFCTRL_W (_ULCAST_(1) << 30) 703 + #define MIPS_PERFCTRL_M (_ULCAST_(1) << 31) 704 + 705 + /* PerfCnt control register MT extensions used by MIPS cores */ 706 + #define MIPS_PERFCTRL_VPEID_S 16 707 + #define MIPS_PERFCTRL_VPEID (_ULCAST_(0xf) << MIPS_PERFCTRL_VPEID_S) 708 + #define MIPS_PERFCTRL_TCID_S 22 709 + #define MIPS_PERFCTRL_TCID (_ULCAST_(0xff) << MIPS_PERFCTRL_TCID_S) 710 + #define MIPS_PERFCTRL_MT_EN (_ULCAST_(0x3) << 20) 711 + #define MIPS_PERFCTRL_MT_EN_ALL (_ULCAST_(0) << 20) 712 + #define MIPS_PERFCTRL_MT_EN_VPE (_ULCAST_(1) << 20) 713 + #define MIPS_PERFCTRL_MT_EN_TC (_ULCAST_(2) << 20) 714 + 715 + /* PerfCnt control register MT extensions used by BMIPS5000 */ 716 + #define BRCM_PERFCTRL_TC (_ULCAST_(1) << 30) 717 + 718 + /* PerfCnt control register MT extensions used by Netlogic XLR */ 719 + #define XLR_PERFCTRL_ALLTHREADS (_ULCAST_(1) << 13) 720 + 688 721 /* MAAR bit definitions */ 689 722 #define MIPS_MAAR_ADDR ((BIT_ULL(BITS_PER_LONG - 12) - 1) << 12) 690 723 #define MIPS_MAAR_ADDR_SHIFT 12
+6 -2
arch/mips/include/asm/octeon/cvmx-gpio-defs.h
··· 46 46 uint64_t u64; 47 47 struct cvmx_gpio_bit_cfgx_s { 48 48 #ifdef __BIG_ENDIAN_BITFIELD 49 - uint64_t reserved_17_63:47; 49 + uint64_t reserved_21_63:42; 50 + uint64_t output_sel:5; 50 51 uint64_t synce_sel:2; 51 52 uint64_t clk_gen:1; 52 53 uint64_t clk_sel:2; ··· 67 66 uint64_t clk_sel:2; 68 67 uint64_t clk_gen:1; 69 68 uint64_t synce_sel:2; 70 - uint64_t reserved_17_63:47; 69 + uint64_t output_sel:5; 70 + uint64_t reserved_21_63:42; 71 71 #endif 72 72 } s; 73 73 struct cvmx_gpio_bit_cfgx_cn30xx { ··· 128 126 struct cvmx_gpio_bit_cfgx_s cn66xx; 129 127 struct cvmx_gpio_bit_cfgx_s cn68xx; 130 128 struct cvmx_gpio_bit_cfgx_s cn68xxp1; 129 + struct cvmx_gpio_bit_cfgx_s cn70xx; 130 + struct cvmx_gpio_bit_cfgx_s cn73xx; 131 131 struct cvmx_gpio_bit_cfgx_s cnf71xx; 132 132 }; 133 133
+1 -2
arch/mips/include/asm/octeon/cvmx-helper-rgmii.h
··· 80 80 * Configure an IPD/PKO port for the specified link state. This 81 81 * function does not influence auto negotiation at the PHY level. 82 82 * The passed link state must always match the link state returned 83 - * by cvmx_helper_link_get(). It is normally best to use 84 - * cvmx_helper_link_autoconf() instead. 83 + * by cvmx_helper_link_get(). 85 84 * 86 85 * @ipd_port: IPD/PKO port to configure 87 86 * @link_info: The new link state
+1 -2
arch/mips/include/asm/octeon/cvmx-helper-sgmii.h
··· 74 74 * Configure an IPD/PKO port for the specified link state. This 75 75 * function does not influence auto negotiation at the PHY level. 76 76 * The passed link state must always match the link state returned 77 - * by cvmx_helper_link_get(). It is normally best to use 78 - * cvmx_helper_link_autoconf() instead. 77 + * by cvmx_helper_link_get(). 79 78 * 80 79 * @ipd_port: IPD/PKO port to configure 81 80 * @link_info: The new link state
+1 -2
arch/mips/include/asm/octeon/cvmx-helper-spi.h
··· 71 71 * Configure an IPD/PKO port for the specified link state. This 72 72 * function does not influence auto negotiation at the PHY level. 73 73 * The passed link state must always match the link state returned 74 - * by cvmx_helper_link_get(). It is normally best to use 75 - * cvmx_helper_link_autoconf() instead. 74 + * by cvmx_helper_link_get(). 76 75 * 77 76 * @ipd_port: IPD/PKO port to configure 78 77 * @link_info: The new link state
+1 -2
arch/mips/include/asm/octeon/cvmx-helper-xaui.h
··· 74 74 * Configure an IPD/PKO port for the specified link state. This 75 75 * function does not influence auto negotiation at the PHY level. 76 76 * The passed link state must always match the link state returned 77 - * by cvmx_helper_link_get(). It is normally best to use 78 - * cvmx_helper_link_autoconf() instead. 77 + * by cvmx_helper_link_get(). 79 78 * 80 79 * @ipd_port: IPD/PKO port to configure 81 80 * @link_info: The new link state
+1 -13
arch/mips/include/asm/octeon/cvmx-helper.h
··· 156 156 interface); 157 157 158 158 /** 159 - * Auto configure an IPD/PKO port link state and speed. This 160 - * function basically does the equivalent of: 161 - * cvmx_helper_link_set(ipd_port, cvmx_helper_link_get(ipd_port)); 162 - * 163 - * @ipd_port: IPD/PKO port to auto configure 164 - * 165 - * Returns Link state after configure 166 - */ 167 - extern cvmx_helper_link_info_t cvmx_helper_link_autoconf(int ipd_port); 168 - 169 - /** 170 159 * Return the link state of an IPD/PKO port as returned by 171 160 * auto negotiation. The result of this function may not match 172 161 * Octeon's link config if auto negotiation has changed since ··· 171 182 * Configure an IPD/PKO port for the specified link state. This 172 183 * function does not influence auto negotiation at the PHY level. 173 184 * The passed link state must always match the link state returned 174 - * by cvmx_helper_link_get(). It is normally best to use 175 - * cvmx_helper_link_autoconf() instead. 185 + * by cvmx_helper_link_get(). 176 186 * 177 187 * @ipd_port: IPD/PKO port to configure 178 188 * @link_info: The new link state
+1 -15
arch/mips/include/asm/pgalloc.h
··· 43 43 * Initialize a new pgd / pmd table with invalid pointers. 44 44 */ 45 45 extern void pgd_init(unsigned long page); 46 - 47 - static inline pgd_t *pgd_alloc(struct mm_struct *mm) 48 - { 49 - pgd_t *ret, *init; 50 - 51 - ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); 52 - if (ret) { 53 - init = pgd_offset(&init_mm, 0UL); 54 - pgd_init((unsigned long)ret); 55 - memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, 56 - (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); 57 - } 58 - 59 - return ret; 60 - } 46 + extern pgd_t *pgd_alloc(struct mm_struct *mm); 61 47 62 48 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) 63 49 {
+39 -22
arch/mips/include/asm/r4kcache.h
··· 147 147 } 148 148 149 149 #define protected_cache_op(op,addr) \ 150 + ({ \ 151 + int __err = 0; \ 150 152 __asm__ __volatile__( \ 151 153 " .set push \n" \ 152 154 " .set noreorder \n" \ 153 155 " .set "MIPS_ISA_ARCH_LEVEL" \n" \ 154 - "1: cache %0, (%1) \n" \ 155 - "2: .set pop \n" \ 156 + "1: cache %1, (%2) \n" \ 157 + "2: .insn \n" \ 158 + " .set pop \n" \ 159 + " .section .fixup,\"ax\" \n" \ 160 + "3: li %0, %3 \n" \ 161 + " j 2b \n" \ 162 + " .previous \n" \ 156 163 " .section __ex_table,\"a\" \n" \ 157 - " "STR(PTR)" 1b, 2b \n" \ 164 + " "STR(PTR)" 1b, 3b \n" \ 158 165 " .previous" \ 159 - : \ 160 - : "i" (op), "r" (addr)) 166 + : "+r" (__err) \ 167 + : "i" (op), "r" (addr), "i" (-EFAULT)); \ 168 + __err; \ 169 + }) 170 + 161 171 162 172 #define protected_cachee_op(op,addr) \ 173 + ({ \ 174 + int __err = 0; \ 163 175 __asm__ __volatile__( \ 164 176 " .set push \n" \ 165 177 " .set noreorder \n" \ 166 178 " .set mips0 \n" \ 167 179 " .set eva \n" \ 168 - "1: cachee %0, (%1) \n" \ 169 - "2: .set pop \n" \ 180 + "1: cachee %1, (%2) \n" \ 181 + "2: .insn \n" \ 182 + " .set pop \n" \ 183 + " .section .fixup,\"ax\" \n" \ 184 + "3: li %0, %3 \n" \ 185 + " j 2b \n" \ 186 + " .previous \n" \ 170 187 " .section __ex_table,\"a\" \n" \ 171 - " "STR(PTR)" 1b, 2b \n" \ 188 + " "STR(PTR)" 1b, 3b \n" \ 172 189 " .previous" \ 173 - : \ 174 - : "i" (op), "r" (addr)) 190 + : "+r" (__err) \ 191 + : "i" (op), "r" (addr), "i" (-EFAULT)); \ 192 + __err; \ 193 + }) 175 194 176 195 /* 177 196 * The next two are for badland addresses like signal trampolines. 178 197 */ 179 - static inline void protected_flush_icache_line(unsigned long addr) 198 + static inline int protected_flush_icache_line(unsigned long addr) 180 199 { 181 200 switch (boot_cpu_type()) { 182 201 case CPU_LOONGSON2: 183 - protected_cache_op(Hit_Invalidate_I_Loongson2, addr); 184 - break; 202 + return protected_cache_op(Hit_Invalidate_I_Loongson2, addr); 185 203 186 204 default: 187 205 #ifdef CONFIG_EVA 188 - protected_cachee_op(Hit_Invalidate_I, addr); 206 + return protected_cachee_op(Hit_Invalidate_I, addr); 189 207 #else 190 - protected_cache_op(Hit_Invalidate_I, addr); 208 + return protected_cache_op(Hit_Invalidate_I, addr); 191 209 #endif 192 - break; 193 210 } 194 211 } 195 212 ··· 216 199 * caches. We're talking about one cacheline unnecessarily getting invalidated 217 200 * here so the penalty isn't overly hard. 218 201 */ 219 - static inline void protected_writeback_dcache_line(unsigned long addr) 202 + static inline int protected_writeback_dcache_line(unsigned long addr) 220 203 { 221 204 #ifdef CONFIG_EVA 222 - protected_cachee_op(Hit_Writeback_Inv_D, addr); 205 + return protected_cachee_op(Hit_Writeback_Inv_D, addr); 223 206 #else 224 - protected_cache_op(Hit_Writeback_Inv_D, addr); 207 + return protected_cache_op(Hit_Writeback_Inv_D, addr); 225 208 #endif 226 209 } 227 210 228 - static inline void protected_writeback_scache_line(unsigned long addr) 211 + static inline int protected_writeback_scache_line(unsigned long addr) 229 212 { 230 213 #ifdef CONFIG_EVA 231 - protected_cachee_op(Hit_Writeback_Inv_SD, addr); 214 + return protected_cachee_op(Hit_Writeback_Inv_SD, addr); 232 215 #else 233 - protected_cache_op(Hit_Writeback_Inv_SD, addr); 216 + return protected_cache_op(Hit_Writeback_Inv_SD, addr); 234 217 #endif 235 218 } 236 219
+1 -9
arch/mips/include/asm/smp.h
··· 42 42 #define SMP_CALL_FUNCTION 0x2 43 43 /* Octeon - Tell another core to flush its icache */ 44 44 #define SMP_ICACHE_FLUSH 0x4 45 - /* Used by kexec crashdump to save all cpu's state */ 46 - #define SMP_DUMP 0x8 47 - #define SMP_ASK_C0COUNT 0x10 48 - 49 - extern cpumask_t cpu_callin_map; 45 + #define SMP_ASK_C0COUNT 0x8 50 46 51 47 /* Mask of CPUs which are currently definitely operating coherently */ 52 48 extern cpumask_t cpu_coherent_mask; ··· 109 113 mp_ops->send_ipi_mask(mask, SMP_CALL_FUNCTION); 110 114 } 111 115 112 - #if defined(CONFIG_KEXEC) 113 - extern void (*dump_ipi_function_ptr)(void *); 114 - void dump_send_ipi(void (*dump_ipi_callback)(void *)); 115 - #endif 116 116 #endif /* __ASM_SMP_H */
+11 -8
arch/mips/include/asm/stackframe.h
··· 216 216 LONG_S $25, PT_R25(sp) 217 217 LONG_S $28, PT_R28(sp) 218 218 LONG_S $31, PT_R31(sp) 219 + 220 + /* Set thread_info if we're coming from user mode */ 221 + mfc0 k0, CP0_STATUS 222 + sll k0, 3 /* extract cu0 bit */ 223 + bltz k0, 9f 224 + 219 225 ori $28, sp, _THREAD_MASK 220 226 xori $28, _THREAD_MASK 221 227 #ifdef CONFIG_CPU_CAVIUM_OCTEON 222 228 .set mips64 223 229 pref 0, 0($28) /* Prefetch the current pointer */ 224 230 #endif 231 + 9: 225 232 .set pop 226 233 .endm 227 234 ··· 364 357 365 358 .macro RESTORE_SP_AND_RET 366 359 LONG_L sp, PT_R29(sp) 360 + #ifdef CONFIG_CPU_MIPSR6 361 + eretnc 362 + #else 367 363 .set arch=r4000 368 364 eret 369 365 .set mips0 366 + #endif 370 367 .endm 371 368 372 369 #endif ··· 385 374 RESTORE_AT 386 375 RESTORE_SOME 387 376 RESTORE_SP 388 - .endm 389 - 390 - .macro RESTORE_ALL_AND_RET 391 - RESTORE_TEMP 392 - RESTORE_STATIC 393 - RESTORE_AT 394 - RESTORE_SOME 395 - RESTORE_SP_AND_RET 396 377 .endm 397 378 398 379 /*
+12 -6
arch/mips/include/asm/switch_to.h
··· 66 66 #define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0) 67 67 #endif 68 68 69 - #define __clear_software_ll_bit() \ 70 - do { if (cpu_has_rw_llb) { \ 69 + /* 70 + * Clear LLBit during context switches on MIPSr6 such that eretnc can be used 71 + * unconditionally when returning to userland in entry.S. 72 + */ 73 + #define __clear_r6_hw_ll_bit() do { \ 74 + if (cpu_has_mips_r6) \ 71 75 write_c0_lladdr(0); \ 72 - } else { \ 73 - if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc)\ 74 - ll_bit = 0; \ 75 - } \ 76 + } while (0) 77 + 78 + #define __clear_software_ll_bit() do { \ 79 + if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc) \ 80 + ll_bit = 0; \ 76 81 } while (0) 77 82 78 83 /* ··· 125 120 } \ 126 121 clear_c0_status(ST0_CU2); \ 127 122 } \ 123 + __clear_r6_hw_ll_bit(); \ 128 124 __clear_software_ll_bit(); \ 129 125 if (cpu_has_userlocal) \ 130 126 write_c0_userlocal(task_thread_info(next)->tp_value); \
-1
arch/mips/include/asm/thread_info.h
··· 27 27 unsigned long tp_value; /* thread pointer */ 28 28 __u32 cpu; /* current CPU */ 29 29 int preempt_count; /* 0 => preemptable, <0 => BUG */ 30 - int r2_emul_return; /* 1 => Returning from R2 emulator */ 31 30 mm_segment_t addr_limit; /* 32 31 * thread address space limit: 33 32 * 0x7fffffff for user-thead
+26
arch/mips/include/asm/tlbex.h
··· 1 + #ifndef __ASM_TLBEX_H 2 + #define __ASM_TLBEX_H 3 + 4 + #include <asm/uasm.h> 5 + 6 + /* 7 + * Write random or indexed TLB entry, and care about the hazards from 8 + * the preceding mtc0 and for the following eret. 9 + */ 10 + enum tlb_write_entry { 11 + tlb_random, 12 + tlb_indexed 13 + }; 14 + 15 + extern int pgd_reg; 16 + 17 + void build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, 18 + unsigned int tmp, unsigned int ptr); 19 + void build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr); 20 + void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr); 21 + void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep); 22 + void build_tlb_write_entry(u32 **p, struct uasm_label **l, 23 + struct uasm_reloc **r, 24 + enum tlb_write_entry wmode); 25 + 26 + #endif /* __ASM_TLBEX_H */
+18
arch/mips/include/asm/uaccess.h
··· 1241 1241 __cu_len; \ 1242 1242 }) 1243 1243 1244 + extern __kernel_size_t __bzero_kernel(void __user *addr, __kernel_size_t size); 1245 + extern __kernel_size_t __bzero(void __user *addr, __kernel_size_t size); 1246 + 1244 1247 /* 1245 1248 * __clear_user: - Zero a block of memory in user space, with less checking. 1246 1249 * @to: Destination address, in user space. ··· 1296 1293 __cl_size; \ 1297 1294 }) 1298 1295 1296 + extern long __strncpy_from_kernel_nocheck_asm(char *__to, const char __user *__from, long __len); 1297 + extern long __strncpy_from_user_nocheck_asm(char *__to, const char __user *__from, long __len); 1298 + 1299 1299 /* 1300 1300 * __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking. 1301 1301 * @dst: Destination address, in kernel space. This buffer must be at ··· 1350 1344 return res; 1351 1345 } 1352 1346 1347 + extern long __strncpy_from_kernel_asm(char *__to, const char __user *__from, long __len); 1348 + extern long __strncpy_from_user_asm(char *__to, const char __user *__from, long __len); 1349 + 1353 1350 /* 1354 1351 * strncpy_from_user: - Copy a NUL terminated string from userspace. 1355 1352 * @dst: Destination address, in kernel space. This buffer must be at ··· 1402 1393 return res; 1403 1394 } 1404 1395 1396 + extern long __strlen_kernel_asm(const char __user *s); 1397 + extern long __strlen_user_asm(const char __user *s); 1398 + 1405 1399 /* 1406 1400 * strlen_user: - Get the size of a string in user space. 1407 1401 * @str: The string to measure. ··· 1446 1434 return res; 1447 1435 } 1448 1436 1437 + extern long __strnlen_kernel_nocheck_asm(const char __user *s, long n); 1438 + extern long __strnlen_user_nocheck_asm(const char __user *s, long n); 1439 + 1449 1440 /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ 1450 1441 static inline long __strnlen_user(const char __user *s, long n) 1451 1442 { ··· 1477 1462 1478 1463 return res; 1479 1464 } 1465 + 1466 + extern long __strnlen_kernel_asm(const char __user *s, long n); 1467 + extern long __strnlen_user_asm(const char __user *s, long n); 1480 1468 1481 1469 /* 1482 1470 * strnlen_user: - Get the size of a string in user space.
+5
arch/mips/include/asm/uasm.h
··· 9 9 * Copyright (C) 2012, 2013 MIPS Technologies, Inc. All rights reserved. 10 10 */ 11 11 12 + #ifndef __ASM_UASM_H 13 + #define __ASM_UASM_H 14 + 12 15 #include <linux/types.h> 13 16 14 17 #ifdef CONFIG_EXPORT_UASM ··· 312 309 void uasm_il_bne(u32 **p, struct uasm_reloc **r, unsigned int reg1, 313 310 unsigned int reg2, int lid); 314 311 void uasm_il_bnez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid); 312 + 313 + #endif /* __ASM_UASM_H */
-28
arch/mips/include/asm/unaligned.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org) 7 - */ 8 - #ifndef _ASM_MIPS_UNALIGNED_H 9 - #define _ASM_MIPS_UNALIGNED_H 10 - 11 - #include <linux/compiler.h> 12 - #if defined(__MIPSEB__) 13 - # include <linux/unaligned/be_struct.h> 14 - # include <linux/unaligned/le_byteshift.h> 15 - # define get_unaligned __get_unaligned_be 16 - # define put_unaligned __put_unaligned_be 17 - #elif defined(__MIPSEL__) 18 - # include <linux/unaligned/le_struct.h> 19 - # include <linux/unaligned/be_byteshift.h> 20 - # define get_unaligned __get_unaligned_le 21 - # define put_unaligned __put_unaligned_le 22 - #else 23 - # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" 24 - #endif 25 - 26 - # include <linux/unaligned/generic.h> 27 - 28 - #endif /* _ASM_MIPS_UNALIGNED_H */
+1 -1
arch/mips/jazz/jazzdma.c
··· 9 9 */ 10 10 #include <linux/kernel.h> 11 11 #include <linux/init.h> 12 - #include <linux/module.h> 12 + #include <linux/export.h> 13 13 #include <linux/errno.h> 14 14 #include <linux/mm.h> 15 15 #include <linux/bootmem.h>
+1 -1
arch/mips/jz4740/gpio.c
··· 14 14 */ 15 15 16 16 #include <linux/kernel.h> 17 - #include <linux/module.h> 17 + #include <linux/export.h> 18 18 #include <linux/init.h> 19 19 20 20 #include <linux/io.h>
-1
arch/mips/jz4740/prom.c
··· 13 13 * 14 14 */ 15 15 16 - #include <linux/module.h> 17 16 #include <linux/kernel.h> 18 17 #include <linux/init.h> 19 18 #include <linux/string.h>
+2 -1
arch/mips/jz4740/timer.c
··· 13 13 * 14 14 */ 15 15 16 + #include <linux/export.h> 16 17 #include <linux/io.h> 18 + #include <linux/init.h> 17 19 #include <linux/kernel.h> 18 - #include <linux/module.h> 19 20 20 21 #include <asm/mach-jz4740/base.h> 21 22 #include <asm/mach-jz4740/timer.h>
+2 -2
arch/mips/kernel/Makefile
··· 7 7 obj-y += cpu-probe.o branch.o elf.o entry.o genex.o idle.o irq.o \ 8 8 process.o prom.o ptrace.o reset.o setup.o signal.o \ 9 9 syscall.o time.o topology.o traps.o unaligned.o watch.o \ 10 - vdso.o 10 + vdso.o cacheinfo.o 11 11 12 12 ifdef CONFIG_FUNCTION_TRACER 13 13 CFLAGS_REMOVE_ftrace.o = -pg ··· 30 30 31 31 obj-$(CONFIG_DEBUG_FS) += segment.o 32 32 obj-$(CONFIG_STACKTRACE) += stacktrace.o 33 - obj-$(CONFIG_MODULES) += mips_ksyms.o module.o 33 + obj-$(CONFIG_MODULES) += module.o 34 34 obj-$(CONFIG_MODULES_USE_ELF_RELA) += module-rela.o 35 35 36 36 obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
+1 -1
arch/mips/kernel/asm-offsets.c
··· 97 97 OFFSET(TI_TP_VALUE, thread_info, tp_value); 98 98 OFFSET(TI_CPU, thread_info, cpu); 99 99 OFFSET(TI_PRE_COUNT, thread_info, preempt_count); 100 - OFFSET(TI_R2_EMUL_RET, thread_info, r2_emul_return); 101 100 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); 102 101 OFFSET(TI_REGS, thread_info, regs); 103 102 DEFINE(_THREAD_SIZE, THREAD_SIZE); 104 103 DEFINE(_THREAD_MASK, THREAD_MASK); 104 + DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE); 105 105 BLANK(); 106 106 } 107 107
+87
arch/mips/kernel/cacheinfo.c
··· 1 + /* 2 + * MIPS cacheinfo support 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + * 8 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any 9 + * kind, whether express or implied; without even the implied warranty 10 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + * 13 + * You should have received a copy of the GNU General Public License 14 + * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 + */ 16 + #include <linux/cacheinfo.h> 17 + 18 + /* Populates leaf and increments to next leaf */ 19 + #define populate_cache(cache, leaf, c_level, c_type) \ 20 + do { \ 21 + leaf->type = c_type; \ 22 + leaf->level = c_level; \ 23 + leaf->coherency_line_size = c->cache.linesz; \ 24 + leaf->number_of_sets = c->cache.sets; \ 25 + leaf->ways_of_associativity = c->cache.ways; \ 26 + leaf->size = c->cache.linesz * c->cache.sets * \ 27 + c->cache.ways; \ 28 + leaf++; \ 29 + } while (0) 30 + 31 + static int __init_cache_level(unsigned int cpu) 32 + { 33 + struct cpuinfo_mips *c = &current_cpu_data; 34 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); 35 + int levels = 0, leaves = 0; 36 + 37 + /* 38 + * If Dcache is not set, we assume the cache structures 39 + * are not properly initialized. 40 + */ 41 + if (c->dcache.waysize) 42 + levels += 1; 43 + else 44 + return -ENOENT; 45 + 46 + 47 + leaves += (c->icache.waysize) ? 2 : 1; 48 + 49 + if (c->scache.waysize) { 50 + levels++; 51 + leaves++; 52 + } 53 + 54 + if (c->tcache.waysize) { 55 + levels++; 56 + leaves++; 57 + } 58 + 59 + this_cpu_ci->num_levels = levels; 60 + this_cpu_ci->num_leaves = leaves; 61 + return 0; 62 + } 63 + 64 + static int __populate_cache_leaves(unsigned int cpu) 65 + { 66 + struct cpuinfo_mips *c = &current_cpu_data; 67 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); 68 + struct cacheinfo *this_leaf = this_cpu_ci->info_list; 69 + 70 + if (c->icache.waysize) { 71 + populate_cache(dcache, this_leaf, 1, CACHE_TYPE_DATA); 72 + populate_cache(icache, this_leaf, 1, CACHE_TYPE_INST); 73 + } else { 74 + populate_cache(dcache, this_leaf, 1, CACHE_TYPE_UNIFIED); 75 + } 76 + 77 + if (c->scache.waysize) 78 + populate_cache(scache, this_leaf, 2, CACHE_TYPE_UNIFIED); 79 + 80 + if (c->tcache.waysize) 81 + populate_cache(tcache, this_leaf, 3, CACHE_TYPE_UNIFIED); 82 + 83 + return 0; 84 + } 85 + 86 + DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level) 87 + DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
+12 -12
arch/mips/kernel/cpu-bugs64.c
··· 148 148 bug = 1; 149 149 150 150 if (bug == 0) { 151 - printk("no.\n"); 151 + pr_cont("no.\n"); 152 152 return; 153 153 } 154 154 155 - printk("yes, workaround... "); 155 + pr_cont("yes, workaround... "); 156 156 157 157 fix = 1; 158 158 for (i = 0; i < 8; i++) ··· 160 160 fix = 0; 161 161 162 162 if (fix == 1) { 163 - printk("yes.\n"); 163 + pr_cont("yes.\n"); 164 164 return; 165 165 } 166 166 167 - printk("no.\n"); 167 + pr_cont("no.\n"); 168 168 panic(bug64hit, !R4000_WAR ? r4kwar : nowar); 169 169 } 170 170 ··· 218 218 local_irq_restore(flags); 219 219 220 220 if (daddi_ov) { 221 - printk("no.\n"); 221 + pr_cont("no.\n"); 222 222 return; 223 223 } 224 224 225 - printk("yes, workaround... "); 225 + pr_cont("yes, workaround... "); 226 226 227 227 local_irq_save(flags); 228 228 handler = set_except_vector(EXCCODE_OV, handle_daddi_ov); ··· 236 236 local_irq_restore(flags); 237 237 238 238 if (daddi_ov) { 239 - printk("yes.\n"); 239 + pr_cont("yes.\n"); 240 240 return; 241 241 } 242 242 243 - printk("no.\n"); 243 + pr_cont("no.\n"); 244 244 panic(bug64hit, !DADDI_WAR ? daddiwar : nowar); 245 245 } 246 246 ··· 288 288 daddiu_bug = v != w; 289 289 290 290 if (!daddiu_bug) { 291 - printk("no.\n"); 291 + pr_cont("no.\n"); 292 292 return; 293 293 } 294 294 295 - printk("yes, workaround... "); 295 + pr_cont("yes, workaround... "); 296 296 297 297 asm volatile( 298 298 "addiu %2, $0, %3\n\t" ··· 304 304 : "I" (0xffffffffffffdb9aUL), "I" (0x1234)); 305 305 306 306 if (v == w) { 307 - printk("yes.\n"); 307 + pr_cont("yes.\n"); 308 308 return; 309 309 } 310 310 311 - printk("no.\n"); 311 + pr_cont("no.\n"); 312 312 panic(bug64hit, !DADDI_WAR ? daddiwar : nowar); 313 313 } 314 314
+1 -1
arch/mips/kernel/crash.c
··· 56 56 57 57 ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */ 58 58 59 - dump_send_ipi(crash_shutdown_secondary); 59 + smp_call_function(crash_shutdown_secondary, NULL, 0); 60 60 smp_wmb(); 61 61 62 62 /*
-18
arch/mips/kernel/entry.S
··· 47 47 local_irq_disable # make sure we dont miss an 48 48 # interrupt setting need_resched 49 49 # between sampling and return 50 - #ifdef CONFIG_MIPSR2_TO_R6_EMULATOR 51 - lw k0, TI_R2_EMUL_RET($28) 52 - bnez k0, restore_all_from_r2_emul 53 - #endif 54 - 55 50 LONG_L a2, TI_FLAGS($28) # current->work 56 51 andi t0, a2, _TIF_WORK_MASK # (ignoring syscall_trace) 57 52 bnez t0, work_pending ··· 114 119 RESTORE_SOME 115 120 RESTORE_SP_AND_RET 116 121 .set at 117 - 118 - #ifdef CONFIG_MIPSR2_TO_R6_EMULATOR 119 - restore_all_from_r2_emul: # restore full frame 120 - .set noat 121 - sw zero, TI_R2_EMUL_RET($28) # reset it 122 - RESTORE_TEMP 123 - RESTORE_AT 124 - RESTORE_STATIC 125 - RESTORE_SOME 126 - LONG_L sp, PT_R29(sp) 127 - eretnc 128 - .set at 129 - #endif 130 122 131 123 work_pending: 132 124 andi t0, a2, _TIF_NEED_RESCHED # a2 is preloaded with TI_FLAGS
+76 -5
arch/mips/kernel/genex.S
··· 187 187 188 188 LONG_L s0, TI_REGS($28) 189 189 LONG_S sp, TI_REGS($28) 190 - PTR_LA ra, ret_from_irq 191 - PTR_LA v0, plat_irq_dispatch 192 - jr v0 190 + 191 + /* 192 + * SAVE_ALL ensures we are using a valid kernel stack for the thread. 193 + * Check if we are already using the IRQ stack. 194 + */ 195 + move s1, sp # Preserve the sp 196 + 197 + /* Get IRQ stack for this CPU */ 198 + ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG 199 + #if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) 200 + lui k1, %hi(irq_stack) 201 + #else 202 + lui k1, %highest(irq_stack) 203 + daddiu k1, %higher(irq_stack) 204 + dsll k1, 16 205 + daddiu k1, %hi(irq_stack) 206 + dsll k1, 16 207 + #endif 208 + LONG_SRL k0, SMP_CPUID_PTRSHIFT 209 + LONG_ADDU k1, k0 210 + LONG_L t0, %lo(irq_stack)(k1) 211 + 212 + # Check if already on IRQ stack 213 + PTR_LI t1, ~(_THREAD_SIZE-1) 214 + and t1, t1, sp 215 + beq t0, t1, 2f 216 + 217 + /* Switch to IRQ stack */ 218 + li t1, _IRQ_STACK_SIZE 219 + PTR_ADD sp, t0, t1 220 + 221 + 2: 222 + jal plat_irq_dispatch 223 + 224 + /* Restore sp */ 225 + move sp, s1 226 + 227 + j ret_from_irq 193 228 #ifdef CONFIG_CPU_MICROMIPS 194 229 nop 195 230 #endif ··· 297 262 298 263 LONG_L s0, TI_REGS($28) 299 264 LONG_S sp, TI_REGS($28) 300 - PTR_LA ra, ret_from_irq 301 - jr v0 265 + 266 + /* 267 + * SAVE_ALL ensures we are using a valid kernel stack for the thread. 268 + * Check if we are already using the IRQ stack. 269 + */ 270 + move s1, sp # Preserve the sp 271 + 272 + /* Get IRQ stack for this CPU */ 273 + ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG 274 + #if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) 275 + lui k1, %hi(irq_stack) 276 + #else 277 + lui k1, %highest(irq_stack) 278 + daddiu k1, %higher(irq_stack) 279 + dsll k1, 16 280 + daddiu k1, %hi(irq_stack) 281 + dsll k1, 16 282 + #endif 283 + LONG_SRL k0, SMP_CPUID_PTRSHIFT 284 + LONG_ADDU k1, k0 285 + LONG_L t0, %lo(irq_stack)(k1) 286 + 287 + # Check if already on IRQ stack 288 + PTR_LI t1, ~(_THREAD_SIZE-1) 289 + and t1, t1, sp 290 + beq t0, t1, 2f 291 + 292 + /* Switch to IRQ stack */ 293 + li t1, _IRQ_STACK_SIZE 294 + PTR_ADD sp, t0, t1 295 + 296 + 2: 297 + jalr v0 298 + 299 + /* Restore sp */ 300 + move sp, s1 301 + 302 + j ret_from_irq 302 303 END(except_vec_vi_handler) 303 304 304 305 /*
+11
arch/mips/kernel/irq.c
··· 25 25 #include <linux/atomic.h> 26 26 #include <linux/uaccess.h> 27 27 28 + void *irq_stack[NR_CPUS]; 29 + 28 30 /* 29 31 * 'what should we do if we get a hw irq event on an illegal vector'. 30 32 * each architecture has to answer this themselves. ··· 60 58 clear_c0_status(ST0_IM); 61 59 62 60 arch_init_irq(); 61 + 62 + for_each_possible_cpu(i) { 63 + int irq_pages = IRQ_STACK_SIZE / PAGE_SIZE; 64 + void *s = (void *)__get_free_pages(GFP_KERNEL, irq_pages); 65 + 66 + irq_stack[i] = s; 67 + pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i, 68 + irq_stack[i], irq_stack[i] + IRQ_STACK_SIZE); 69 + } 63 70 } 64 71 65 72 #ifdef CONFIG_DEBUG_STACKOVERFLOW
+3 -8
arch/mips/kernel/linux32.c
··· 64 64 unsigned long, prot, unsigned long, flags, unsigned long, fd, 65 65 unsigned long, pgoff) 66 66 { 67 - unsigned long error; 68 - 69 - error = -EINVAL; 70 67 if (pgoff & (~PAGE_MASK >> 12)) 71 - goto out; 72 - error = sys_mmap_pgoff(addr, len, prot, flags, fd, 73 - pgoff >> (PAGE_SHIFT-12)); 74 - out: 75 - return error; 68 + return -EINVAL; 69 + return sys_mmap_pgoff(addr, len, prot, flags, fd, 70 + pgoff >> (PAGE_SHIFT-12)); 76 71 } 77 72 78 73 #define RLIM_INFINITY32 0x7fffffff
+22
arch/mips/kernel/machine_kexec.c
··· 28 28 void (*_crash_smp_send_stop)(void) = NULL; 29 29 #endif 30 30 31 + static void kexec_image_info(const struct kimage *kimage) 32 + { 33 + unsigned long i; 34 + 35 + pr_debug("kexec kimage info:\n"); 36 + pr_debug(" type: %d\n", kimage->type); 37 + pr_debug(" start: %lx\n", kimage->start); 38 + pr_debug(" head: %lx\n", kimage->head); 39 + pr_debug(" nr_segments: %lu\n", kimage->nr_segments); 40 + 41 + for (i = 0; i < kimage->nr_segments; i++) { 42 + pr_debug(" segment[%lu]: %016lx - %016lx, 0x%lx bytes, %lu pages\n", 43 + i, 44 + kimage->segment[i].mem, 45 + kimage->segment[i].mem + kimage->segment[i].memsz, 46 + (unsigned long)kimage->segment[i].memsz, 47 + (unsigned long)kimage->segment[i].memsz / PAGE_SIZE); 48 + } 49 + } 50 + 31 51 int 32 52 machine_kexec_prepare(struct kimage *kimage) 33 53 { 54 + kexec_image_info(kimage); 55 + 34 56 if (_machine_kexec_prepare) 35 57 return _machine_kexec_prepare(kimage); 36 58 return 0;
+3
arch/mips/kernel/mcount.S
··· 10 10 * Author: Wu Zhangjin <wuzhangjin@gmail.com> 11 11 */ 12 12 13 + #include <asm/export.h> 13 14 #include <asm/regdef.h> 14 15 #include <asm/stackframe.h> 15 16 #include <asm/ftrace.h> ··· 67 66 NESTED(ftrace_caller, PT_SIZE, ra) 68 67 .globl _mcount 69 68 _mcount: 69 + EXPORT_SYMBOL(_mcount) 70 70 b ftrace_stub 71 71 #ifdef CONFIG_32BIT 72 72 addiu sp,sp,8 ··· 116 114 #else /* ! CONFIG_DYNAMIC_FTRACE */ 117 115 118 116 NESTED(_mcount, PT_SIZE, ra) 117 + EXPORT_SYMBOL(_mcount) 119 118 PTR_LA t1, ftrace_stub 120 119 PTR_L t2, ftrace_trace_function /* Prepare t2 for (1) */ 121 120 bne t1, t2, static_trace
+3 -2
arch/mips/kernel/mips-mt-fpaff.c
··· 99 99 retval = -ENOMEM; 100 100 goto out_free_new_mask; 101 101 } 102 - retval = -EPERM; 103 - if (!check_same_owner(p) && !capable(CAP_SYS_NICE)) 102 + if (!check_same_owner(p) && !capable(CAP_SYS_NICE)) { 103 + retval = -EPERM; 104 104 goto out_unlock; 105 + } 105 106 106 107 retval = security_task_setscheduler(p); 107 108 if (retval)
+6 -6
arch/mips/kernel/mips-r2-to-r6-emul.c
··· 433 433 rs = regs->regs[MIPSInst_RS(ir)]; 434 434 res = (u64)rt * (u64)rs; 435 435 rt = res; 436 - regs->lo = (s64)rt; 437 - regs->hi = (s64)(res >> 32); 436 + regs->lo = (s64)(s32)rt; 437 + regs->hi = (s64)(s32)(res >> 32); 438 438 439 439 MIPS_R2_STATS(muls); 440 440 ··· 670 670 res += ((((s64)rt) << 32) | (u32)rs); 671 671 672 672 rt = res; 673 - regs->lo = (s64)rt; 673 + regs->lo = (s64)(s32)rt; 674 674 rs = res >> 32; 675 - regs->hi = (s64)rs; 675 + regs->hi = (s64)(s32)rs; 676 676 677 677 MIPS_R2_STATS(dsps); 678 678 ··· 728 728 res = ((((s64)rt) << 32) | (u32)rs) - res; 729 729 730 730 rt = res; 731 - regs->lo = (s64)rt; 731 + regs->lo = (s64)(s32)rt; 732 732 rs = res >> 32; 733 - regs->hi = (s64)rs; 733 + regs->hi = (s64)(s32)rs; 734 734 735 735 MIPS_R2_STATS(dsps); 736 736
-94
arch/mips/kernel/mips_ksyms.c
··· 1 - /* 2 - * Export MIPS-specific functions needed for loadable modules. 3 - * 4 - * This file is subject to the terms and conditions of the GNU General Public 5 - * License. See the file "COPYING" in the main directory of this archive 6 - * for more details. 7 - * 8 - * Copyright (C) 1996, 97, 98, 99, 2000, 01, 03, 04, 05, 12 by Ralf Baechle 9 - * Copyright (C) 1999, 2000, 01 Silicon Graphics, Inc. 10 - */ 11 - #include <linux/interrupt.h> 12 - #include <linux/export.h> 13 - #include <asm/checksum.h> 14 - #include <linux/mm.h> 15 - #include <linux/uaccess.h> 16 - #include <asm/ftrace.h> 17 - #include <asm/fpu.h> 18 - #include <asm/msa.h> 19 - 20 - extern void *__bzero_kernel(void *__s, size_t __count); 21 - extern void *__bzero(void *__s, size_t __count); 22 - extern long __strncpy_from_kernel_nocheck_asm(char *__to, 23 - const char *__from, long __len); 24 - extern long __strncpy_from_kernel_asm(char *__to, const char *__from, 25 - long __len); 26 - extern long __strncpy_from_user_nocheck_asm(char *__to, 27 - const char *__from, long __len); 28 - extern long __strncpy_from_user_asm(char *__to, const char *__from, 29 - long __len); 30 - extern long __strlen_kernel_asm(const char *s); 31 - extern long __strlen_user_asm(const char *s); 32 - extern long __strnlen_kernel_nocheck_asm(const char *s); 33 - extern long __strnlen_kernel_asm(const char *s); 34 - extern long __strnlen_user_nocheck_asm(const char *s); 35 - extern long __strnlen_user_asm(const char *s); 36 - 37 - /* 38 - * Core architecture code 39 - */ 40 - EXPORT_SYMBOL_GPL(_save_fp); 41 - #ifdef CONFIG_CPU_HAS_MSA 42 - EXPORT_SYMBOL_GPL(_save_msa); 43 - #endif 44 - 45 - /* 46 - * String functions 47 - */ 48 - EXPORT_SYMBOL(memset); 49 - EXPORT_SYMBOL(memcpy); 50 - EXPORT_SYMBOL(memmove); 51 - 52 - /* 53 - * Functions that operate on entire pages. Mostly used by memory management. 54 - */ 55 - EXPORT_SYMBOL(clear_page); 56 - EXPORT_SYMBOL(copy_page); 57 - 58 - /* 59 - * Userspace access stuff. 60 - */ 61 - EXPORT_SYMBOL(__copy_user); 62 - EXPORT_SYMBOL(__copy_user_inatomic); 63 - #ifdef CONFIG_EVA 64 - EXPORT_SYMBOL(__copy_from_user_eva); 65 - EXPORT_SYMBOL(__copy_in_user_eva); 66 - EXPORT_SYMBOL(__copy_to_user_eva); 67 - EXPORT_SYMBOL(__copy_user_inatomic_eva); 68 - EXPORT_SYMBOL(__bzero_kernel); 69 - #endif 70 - EXPORT_SYMBOL(__bzero); 71 - EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm); 72 - EXPORT_SYMBOL(__strncpy_from_kernel_asm); 73 - EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm); 74 - EXPORT_SYMBOL(__strncpy_from_user_asm); 75 - EXPORT_SYMBOL(__strlen_kernel_asm); 76 - EXPORT_SYMBOL(__strlen_user_asm); 77 - EXPORT_SYMBOL(__strnlen_kernel_nocheck_asm); 78 - EXPORT_SYMBOL(__strnlen_kernel_asm); 79 - EXPORT_SYMBOL(__strnlen_user_nocheck_asm); 80 - EXPORT_SYMBOL(__strnlen_user_asm); 81 - 82 - #ifndef CONFIG_CPU_MIPSR6 83 - EXPORT_SYMBOL(csum_partial); 84 - EXPORT_SYMBOL(csum_partial_copy_nocheck); 85 - EXPORT_SYMBOL(__csum_partial_copy_kernel); 86 - EXPORT_SYMBOL(__csum_partial_copy_to_user); 87 - EXPORT_SYMBOL(__csum_partial_copy_from_user); 88 - #endif 89 - 90 - EXPORT_SYMBOL(invalid_pte_table); 91 - #ifdef CONFIG_FUNCTION_TRACER 92 - /* _mcount is defined in arch/mips/kernel/mcount.S */ 93 - EXPORT_SYMBOL(_mcount); 94 - #endif
+23 -32
arch/mips/kernel/perf_event_mipsxx.c
··· 101 101 102 102 static struct mips_pmu mipspmu; 103 103 104 - #define M_PERFCTL_EXL (1 << 0) 105 - #define M_PERFCTL_KERNEL (1 << 1) 106 - #define M_PERFCTL_SUPERVISOR (1 << 2) 107 - #define M_PERFCTL_USER (1 << 3) 108 - #define M_PERFCTL_INTERRUPT_ENABLE (1 << 4) 109 - #define M_PERFCTL_EVENT(event) (((event) & 0x3ff) << 5) 110 - #define M_PERFCTL_VPEID(vpe) ((vpe) << 16) 104 + #define M_PERFCTL_EVENT(event) (((event) << MIPS_PERFCTRL_EVENT_S) & \ 105 + MIPS_PERFCTRL_EVENT) 106 + #define M_PERFCTL_VPEID(vpe) ((vpe) << MIPS_PERFCTRL_VPEID_S) 111 107 112 108 #ifdef CONFIG_CPU_BMIPS5000 113 109 #define M_PERFCTL_MT_EN(filter) 0 114 110 #else /* !CONFIG_CPU_BMIPS5000 */ 115 - #define M_PERFCTL_MT_EN(filter) ((filter) << 20) 111 + #define M_PERFCTL_MT_EN(filter) (filter) 116 112 #endif /* CONFIG_CPU_BMIPS5000 */ 117 113 118 - #define M_TC_EN_ALL M_PERFCTL_MT_EN(0) 119 - #define M_TC_EN_VPE M_PERFCTL_MT_EN(1) 120 - #define M_TC_EN_TC M_PERFCTL_MT_EN(2) 121 - #define M_PERFCTL_TCID(tcid) ((tcid) << 22) 122 - #define M_PERFCTL_WIDE (1 << 30) 123 - #define M_PERFCTL_MORE (1 << 31) 124 - #define M_PERFCTL_TC (1 << 30) 114 + #define M_TC_EN_ALL M_PERFCTL_MT_EN(MIPS_PERFCTRL_MT_EN_ALL) 115 + #define M_TC_EN_VPE M_PERFCTL_MT_EN(MIPS_PERFCTRL_MT_EN_VPE) 116 + #define M_TC_EN_TC M_PERFCTL_MT_EN(MIPS_PERFCTRL_MT_EN_TC) 125 117 126 - #define M_PERFCTL_COUNT_EVENT_WHENEVER (M_PERFCTL_EXL | \ 127 - M_PERFCTL_KERNEL | \ 128 - M_PERFCTL_USER | \ 129 - M_PERFCTL_SUPERVISOR | \ 130 - M_PERFCTL_INTERRUPT_ENABLE) 118 + #define M_PERFCTL_COUNT_EVENT_WHENEVER (MIPS_PERFCTRL_EXL | \ 119 + MIPS_PERFCTRL_K | \ 120 + MIPS_PERFCTRL_U | \ 121 + MIPS_PERFCTRL_S | \ 122 + MIPS_PERFCTRL_IE) 131 123 132 124 #ifdef CONFIG_MIPS_MT_SMP 133 125 #define M_PERFCTL_CONFIG_MASK 0x3fff801f 134 126 #else 135 127 #define M_PERFCTL_CONFIG_MASK 0x1f 136 128 #endif 137 - #define M_PERFCTL_EVENT_MASK 0xfe0 138 129 139 130 140 131 #ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS ··· 336 345 cpuc->saved_ctrl[idx] = M_PERFCTL_EVENT(evt->event_base & 0xff) | 337 346 (evt->config_base & M_PERFCTL_CONFIG_MASK) | 338 347 /* Make sure interrupt enabled. */ 339 - M_PERFCTL_INTERRUPT_ENABLE; 348 + MIPS_PERFCTRL_IE; 340 349 if (IS_ENABLED(CONFIG_CPU_BMIPS5000)) 341 350 /* enable the counter for the calling thread */ 342 351 cpuc->saved_ctrl[idx] |= 343 - (1 << (12 + vpe_id())) | M_PERFCTL_TC; 352 + (1 << (12 + vpe_id())) | BRCM_PERFCTRL_TC; 344 353 345 354 /* 346 355 * We do not actually let the counter run. Leave it until start(). ··· 745 754 { 746 755 if (!cpu_has_perf) 747 756 return 0; 748 - if (!(read_c0_perfctrl0() & M_PERFCTL_MORE)) 757 + if (!(read_c0_perfctrl0() & MIPS_PERFCTRL_M)) 749 758 return 1; 750 - if (!(read_c0_perfctrl1() & M_PERFCTL_MORE)) 759 + if (!(read_c0_perfctrl1() & MIPS_PERFCTRL_M)) 751 760 return 2; 752 - if (!(read_c0_perfctrl2() & M_PERFCTL_MORE)) 761 + if (!(read_c0_perfctrl2() & MIPS_PERFCTRL_M)) 753 762 return 3; 754 763 755 764 return 4; ··· 1330 1339 * We allow max flexibility on how each individual counter shared 1331 1340 * by the single CPU operates (the mode exclusion and the range). 1332 1341 */ 1333 - hwc->config_base = M_PERFCTL_INTERRUPT_ENABLE; 1342 + hwc->config_base = MIPS_PERFCTRL_IE; 1334 1343 1335 1344 /* Calculate range bits and validate it. */ 1336 1345 if (num_possible_cpus() > 1) ··· 1341 1350 mutex_unlock(&raw_event_mutex); 1342 1351 1343 1352 if (!attr->exclude_user) 1344 - hwc->config_base |= M_PERFCTL_USER; 1353 + hwc->config_base |= MIPS_PERFCTRL_U; 1345 1354 if (!attr->exclude_kernel) { 1346 - hwc->config_base |= M_PERFCTL_KERNEL; 1355 + hwc->config_base |= MIPS_PERFCTRL_K; 1347 1356 /* MIPS kernel mode: KSU == 00b || EXL == 1 || ERL == 1 */ 1348 - hwc->config_base |= M_PERFCTL_EXL; 1357 + hwc->config_base |= MIPS_PERFCTRL_EXL; 1349 1358 } 1350 1359 if (!attr->exclude_hv) 1351 - hwc->config_base |= M_PERFCTL_SUPERVISOR; 1360 + hwc->config_base |= MIPS_PERFCTRL_S; 1352 1361 1353 1362 hwc->config_base &= M_PERFCTL_CONFIG_MASK; 1354 1363 /* ··· 1821 1830 mipspmu.num_counters = counters; 1822 1831 mipspmu.irq = irq; 1823 1832 1824 - if (read_c0_perfctrl0() & M_PERFCTL_WIDE) { 1833 + if (read_c0_perfctrl0() & MIPS_PERFCTRL_W) { 1825 1834 mipspmu.max_period = (1ULL << 63) - 1; 1826 1835 mipspmu.valid_count = (1ULL << 63) - 1; 1827 1836 mipspmu.overflow = 1ULL << 63;
+157 -57
arch/mips/kernel/process.c
··· 33 33 #include <asm/dsemul.h> 34 34 #include <asm/dsp.h> 35 35 #include <asm/fpu.h> 36 + #include <asm/irq.h> 36 37 #include <asm/msa.h> 37 38 #include <asm/pgtable.h> 38 39 #include <asm/mipsregs.h> ··· 50 49 #ifdef CONFIG_HOTPLUG_CPU 51 50 void arch_cpu_idle_dead(void) 52 51 { 53 - /* What the heck is this check doing ? */ 54 - if (!cpumask_test_cpu(smp_processor_id(), &cpu_callin_map)) 55 - play_dead(); 52 + play_dead(); 56 53 } 57 54 #endif 58 55 ··· 194 195 #define J_TARGET(pc,target) \ 195 196 (((unsigned long)(pc) & 0xf0000000) | ((target) << 2)) 196 197 197 - static inline int is_ra_save_ins(union mips_instruction *ip) 198 + static inline int is_ra_save_ins(union mips_instruction *ip, int *poff) 198 199 { 199 200 #ifdef CONFIG_CPU_MICROMIPS 200 - union mips_instruction mmi; 201 - 202 201 /* 203 202 * swsp ra,offset 204 203 * swm16 reglist,offset(sp) ··· 206 209 * 207 210 * microMIPS is way more fun... 208 211 */ 209 - if (mm_insn_16bit(ip->halfword[0])) { 210 - mmi.word = (ip->halfword[0] << 16); 211 - return (mmi.mm16_r5_format.opcode == mm_swsp16_op && 212 - mmi.mm16_r5_format.rt == 31) || 213 - (mmi.mm16_m_format.opcode == mm_pool16c_op && 214 - mmi.mm16_m_format.func == mm_swm16_op); 212 + if (mm_insn_16bit(ip->halfword[1])) { 213 + switch (ip->mm16_r5_format.opcode) { 214 + case mm_swsp16_op: 215 + if (ip->mm16_r5_format.rt != 31) 216 + return 0; 217 + 218 + *poff = ip->mm16_r5_format.simmediate; 219 + *poff = (*poff << 2) / sizeof(ulong); 220 + return 1; 221 + 222 + case mm_pool16c_op: 223 + switch (ip->mm16_m_format.func) { 224 + case mm_swm16_op: 225 + *poff = ip->mm16_m_format.imm; 226 + *poff += 1 + ip->mm16_m_format.rlist; 227 + *poff = (*poff << 2) / sizeof(ulong); 228 + return 1; 229 + 230 + default: 231 + return 0; 232 + } 233 + 234 + default: 235 + return 0; 236 + } 215 237 } 216 - else { 217 - mmi.halfword[0] = ip->halfword[1]; 218 - mmi.halfword[1] = ip->halfword[0]; 219 - return (mmi.mm_m_format.opcode == mm_pool32b_op && 220 - mmi.mm_m_format.rd > 9 && 221 - mmi.mm_m_format.base == 29 && 222 - mmi.mm_m_format.func == mm_swm32_func) || 223 - (mmi.i_format.opcode == mm_sw32_op && 224 - mmi.i_format.rs == 29 && 225 - mmi.i_format.rt == 31); 238 + 239 + switch (ip->i_format.opcode) { 240 + case mm_sw32_op: 241 + if (ip->i_format.rs != 29) 242 + return 0; 243 + if (ip->i_format.rt != 31) 244 + return 0; 245 + 246 + *poff = ip->i_format.simmediate / sizeof(ulong); 247 + return 1; 248 + 249 + case mm_pool32b_op: 250 + switch (ip->mm_m_format.func) { 251 + case mm_swm32_func: 252 + if (ip->mm_m_format.rd < 0x10) 253 + return 0; 254 + if (ip->mm_m_format.base != 29) 255 + return 0; 256 + 257 + *poff = ip->mm_m_format.simmediate; 258 + *poff += (ip->mm_m_format.rd & 0xf) * sizeof(u32); 259 + *poff /= sizeof(ulong); 260 + return 1; 261 + default: 262 + return 0; 263 + } 264 + 265 + default: 266 + return 0; 226 267 } 227 268 #else 228 269 /* sw / sd $ra, offset($sp) */ 229 - return (ip->i_format.opcode == sw_op || ip->i_format.opcode == sd_op) && 230 - ip->i_format.rs == 29 && 231 - ip->i_format.rt == 31; 270 + if ((ip->i_format.opcode == sw_op || ip->i_format.opcode == sd_op) && 271 + ip->i_format.rs == 29 && ip->i_format.rt == 31) { 272 + *poff = ip->i_format.simmediate / sizeof(ulong); 273 + return 1; 274 + } 275 + 276 + return 0; 232 277 #endif 233 278 } 234 279 ··· 285 246 * 286 247 * microMIPS is kind of more fun... 287 248 */ 288 - union mips_instruction mmi; 249 + if (mm_insn_16bit(ip->halfword[1])) { 250 + if ((ip->mm16_r5_format.opcode == mm_pool16c_op && 251 + (ip->mm16_r5_format.rt & mm_jr16_op) == mm_jr16_op)) 252 + return 1; 253 + return 0; 254 + } 289 255 290 - mmi.word = (ip->halfword[0] << 16); 291 - 292 - if ((mmi.mm16_r5_format.opcode == mm_pool16c_op && 293 - (mmi.mm16_r5_format.rt & mm_jr16_op) == mm_jr16_op) || 294 - ip->j_format.opcode == mm_jal32_op) 256 + if (ip->j_format.opcode == mm_j32_op) 257 + return 1; 258 + if (ip->j_format.opcode == mm_jal32_op) 295 259 return 1; 296 260 if (ip->r_format.opcode != mm_pool32a_op || 297 261 ip->r_format.func != mm_pool32axf_op) ··· 322 280 * 323 281 * microMIPS is not more fun... 324 282 */ 325 - if (mm_insn_16bit(ip->halfword[0])) { 326 - union mips_instruction mmi; 327 - 328 - mmi.word = (ip->halfword[0] << 16); 329 - return (mmi.mm16_r3_format.opcode == mm_pool16d_op && 330 - mmi.mm16_r3_format.simmediate && mm_addiusp_func) || 331 - (mmi.mm16_r5_format.opcode == mm_pool16d_op && 332 - mmi.mm16_r5_format.rt == 29); 283 + if (mm_insn_16bit(ip->halfword[1])) { 284 + return (ip->mm16_r3_format.opcode == mm_pool16d_op && 285 + ip->mm16_r3_format.simmediate && mm_addiusp_func) || 286 + (ip->mm16_r5_format.opcode == mm_pool16d_op && 287 + ip->mm16_r5_format.rt == 29); 333 288 } 289 + 334 290 return ip->mm_i_format.opcode == mm_addiu32_op && 335 291 ip->mm_i_format.rt == 29 && ip->mm_i_format.rs == 29; 336 292 #else ··· 343 303 344 304 static int get_frame_info(struct mips_frame_info *info) 345 305 { 346 - #ifdef CONFIG_CPU_MICROMIPS 347 - union mips_instruction *ip = (void *) (((char *) info->func) - 1); 348 - #else 349 - union mips_instruction *ip = info->func; 350 - #endif 351 - unsigned max_insns = info->func_size / sizeof(union mips_instruction); 352 - unsigned i; 306 + bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS); 307 + union mips_instruction insn, *ip, *ip_end; 308 + const unsigned int max_insns = 128; 309 + unsigned int i; 353 310 354 311 info->pc_offset = -1; 355 312 info->frame_size = 0; 356 313 314 + ip = (void *)msk_isa16_mode((ulong)info->func); 357 315 if (!ip) 358 316 goto err; 359 317 360 - if (max_insns == 0) 361 - max_insns = 128U; /* unknown function size */ 362 - max_insns = min(128U, max_insns); 318 + ip_end = (void *)ip + info->func_size; 363 319 364 - for (i = 0; i < max_insns; i++, ip++) { 320 + for (i = 0; i < max_insns && ip < ip_end; i++, ip++) { 321 + if (is_mmips && mm_insn_16bit(ip->halfword[0])) { 322 + insn.halfword[0] = 0; 323 + insn.halfword[1] = ip->halfword[0]; 324 + } else if (is_mmips) { 325 + insn.halfword[0] = ip->halfword[1]; 326 + insn.halfword[1] = ip->halfword[0]; 327 + } else { 328 + insn.word = ip->word; 329 + } 365 330 366 - if (is_jump_ins(ip)) 331 + if (is_jump_ins(&insn)) 367 332 break; 333 + 368 334 if (!info->frame_size) { 369 - if (is_sp_move_ins(ip)) 335 + if (is_sp_move_ins(&insn)) 370 336 { 371 337 #ifdef CONFIG_CPU_MICROMIPS 372 338 if (mm_insn_16bit(ip->halfword[0])) ··· 395 349 } 396 350 continue; 397 351 } 398 - if (info->pc_offset == -1 && is_ra_save_ins(ip)) { 399 - info->pc_offset = 400 - ip->i_format.simmediate / sizeof(long); 352 + if (info->pc_offset == -1 && 353 + is_ra_save_ins(&insn, &info->pc_offset)) 401 354 break; 402 - } 403 355 } 404 356 if (info->frame_size && info->pc_offset >= 0) /* nested */ 405 357 return 0; ··· 555 511 unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, 556 512 unsigned long pc, unsigned long *ra) 557 513 { 558 - unsigned long stack_page = (unsigned long)task_stack_page(task); 514 + unsigned long stack_page = 0; 515 + int cpu; 516 + 517 + for_each_possible_cpu(cpu) { 518 + if (on_irq_stack(cpu, *sp)) { 519 + stack_page = (unsigned long)irq_stack[cpu]; 520 + break; 521 + } 522 + } 523 + 524 + if (!stack_page) 525 + stack_page = (unsigned long)task_stack_page(task); 526 + 559 527 return unwind_stack_by_address(stack_page, sp, pc, ra); 560 528 } 561 529 #endif ··· 729 673 730 674 return 0; 731 675 } 676 + 677 + #if defined(CONFIG_32BIT) || defined(CONFIG_MIPS32_O32) 678 + void mips_dump_regs32(u32 *uregs, const struct pt_regs *regs) 679 + { 680 + unsigned int i; 681 + 682 + for (i = MIPS32_EF_R1; i <= MIPS32_EF_R31; i++) { 683 + /* k0/k1 are copied as zero. */ 684 + if (i == MIPS32_EF_R26 || i == MIPS32_EF_R27) 685 + uregs[i] = 0; 686 + else 687 + uregs[i] = regs->regs[i - MIPS32_EF_R0]; 688 + } 689 + 690 + uregs[MIPS32_EF_LO] = regs->lo; 691 + uregs[MIPS32_EF_HI] = regs->hi; 692 + uregs[MIPS32_EF_CP0_EPC] = regs->cp0_epc; 693 + uregs[MIPS32_EF_CP0_BADVADDR] = regs->cp0_badvaddr; 694 + uregs[MIPS32_EF_CP0_STATUS] = regs->cp0_status; 695 + uregs[MIPS32_EF_CP0_CAUSE] = regs->cp0_cause; 696 + } 697 + #endif /* CONFIG_32BIT || CONFIG_MIPS32_O32 */ 698 + 699 + #ifdef CONFIG_64BIT 700 + void mips_dump_regs64(u64 *uregs, const struct pt_regs *regs) 701 + { 702 + unsigned int i; 703 + 704 + for (i = MIPS64_EF_R1; i <= MIPS64_EF_R31; i++) { 705 + /* k0/k1 are copied as zero. */ 706 + if (i == MIPS64_EF_R26 || i == MIPS64_EF_R27) 707 + uregs[i] = 0; 708 + else 709 + uregs[i] = regs->regs[i - MIPS64_EF_R0]; 710 + } 711 + 712 + uregs[MIPS64_EF_LO] = regs->lo; 713 + uregs[MIPS64_EF_HI] = regs->hi; 714 + uregs[MIPS64_EF_CP0_EPC] = regs->cp0_epc; 715 + uregs[MIPS64_EF_CP0_BADVADDR] = regs->cp0_badvaddr; 716 + uregs[MIPS64_EF_CP0_STATUS] = regs->cp0_status; 717 + uregs[MIPS64_EF_CP0_CAUSE] = regs->cp0_cause; 718 + } 719 + #endif /* CONFIG_64BIT */
+7
arch/mips/kernel/prom.c
··· 49 49 return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); 50 50 } 51 51 52 + int __init early_init_dt_reserve_memory_arch(phys_addr_t base, 53 + phys_addr_t size, bool nomap) 54 + { 55 + add_memory_region(base, size, BOOT_MEM_RESERVED); 56 + return 0; 57 + } 58 + 52 59 void __init __dt_setup_arch(void *bph) 53 60 { 54 61 if (!early_init_dt_scan(bph))
+2 -32
arch/mips/kernel/ptrace.c
··· 294 294 { 295 295 struct pt_regs *regs = task_pt_regs(target); 296 296 u32 uregs[ELF_NGREG] = {}; 297 - unsigned i; 298 297 299 - for (i = MIPS32_EF_R1; i <= MIPS32_EF_R31; i++) { 300 - /* k0/k1 are copied as zero. */ 301 - if (i == MIPS32_EF_R26 || i == MIPS32_EF_R27) 302 - continue; 303 - 304 - uregs[i] = regs->regs[i - MIPS32_EF_R0]; 305 - } 306 - 307 - uregs[MIPS32_EF_LO] = regs->lo; 308 - uregs[MIPS32_EF_HI] = regs->hi; 309 - uregs[MIPS32_EF_CP0_EPC] = regs->cp0_epc; 310 - uregs[MIPS32_EF_CP0_BADVADDR] = regs->cp0_badvaddr; 311 - uregs[MIPS32_EF_CP0_STATUS] = regs->cp0_status; 312 - uregs[MIPS32_EF_CP0_CAUSE] = regs->cp0_cause; 313 - 298 + mips_dump_regs32(uregs, regs); 314 299 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, uregs, 0, 315 300 sizeof(uregs)); 316 301 } ··· 358 373 { 359 374 struct pt_regs *regs = task_pt_regs(target); 360 375 u64 uregs[ELF_NGREG] = {}; 361 - unsigned i; 362 376 363 - for (i = MIPS64_EF_R1; i <= MIPS64_EF_R31; i++) { 364 - /* k0/k1 are copied as zero. */ 365 - if (i == MIPS64_EF_R26 || i == MIPS64_EF_R27) 366 - continue; 367 - 368 - uregs[i] = regs->regs[i - MIPS64_EF_R0]; 369 - } 370 - 371 - uregs[MIPS64_EF_LO] = regs->lo; 372 - uregs[MIPS64_EF_HI] = regs->hi; 373 - uregs[MIPS64_EF_CP0_EPC] = regs->cp0_epc; 374 - uregs[MIPS64_EF_CP0_BADVADDR] = regs->cp0_badvaddr; 375 - uregs[MIPS64_EF_CP0_STATUS] = regs->cp0_status; 376 - uregs[MIPS64_EF_CP0_CAUSE] = regs->cp0_cause; 377 - 377 + mips_dump_regs64(uregs, regs); 378 378 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, uregs, 0, 379 379 sizeof(uregs)); 380 380 }
+2
arch/mips/kernel/r2300_switch.S
··· 12 12 */ 13 13 #include <asm/asm.h> 14 14 #include <asm/cachectl.h> 15 + #include <asm/export.h> 15 16 #include <asm/fpregdef.h> 16 17 #include <asm/mipsregs.h> 17 18 #include <asm/asm-offsets.h> ··· 73 72 * Save a thread's fp context. 74 73 */ 75 74 LEAF(_save_fp) 75 + EXPORT_SYMBOL(_save_fp) 76 76 fpu_save_single a0, t1 # clobbers t1 77 77 jr ra 78 78 END(_save_fp)
+3
arch/mips/kernel/r4k_switch.S
··· 12 12 */ 13 13 #include <asm/asm.h> 14 14 #include <asm/cachectl.h> 15 + #include <asm/export.h> 15 16 #include <asm/fpregdef.h> 16 17 #include <asm/mipsregs.h> 17 18 #include <asm/asm-offsets.h> ··· 76 75 * Save a thread's fp context. 77 76 */ 78 77 LEAF(_save_fp) 78 + EXPORT_SYMBOL(_save_fp) 79 79 #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ 80 80 defined(CONFIG_CPU_MIPS32_R6) 81 81 mfc0 t0, CP0_STATUS ··· 103 101 * Save a thread's MSA vector context. 104 102 */ 105 103 LEAF(_save_msa) 104 + EXPORT_SYMBOL(_save_msa) 106 105 msa_save_all a0 107 106 jr ra 108 107 END(_save_msa)
+55 -1
arch/mips/kernel/relocate.c
··· 31 31 extern long __start___ex_table; /* Start exception table */ 32 32 extern long __stop___ex_table; /* End exception table */ 33 33 34 + extern void __weak plat_fdt_relocated(void *new_location); 35 + 36 + /* 37 + * This function may be defined for a platform to perform any post-relocation 38 + * fixup necessary. 39 + * Return non-zero to abort relocation 40 + */ 41 + int __weak plat_post_relocation(long offset) 42 + { 43 + return 0; 44 + } 45 + 34 46 static inline u32 __init get_synci_step(void) 35 47 { 36 48 u32 res; ··· 303 291 int res = 1; 304 292 /* Default to original kernel entry point */ 305 293 void *kernel_entry = start_kernel; 294 + void *fdt = NULL; 306 295 307 296 /* Get the command line */ 308 297 fw_init_cmdline(); 309 298 #if defined(CONFIG_USE_OF) 310 299 /* Deal with the device tree */ 311 - early_init_dt_scan(plat_get_fdt()); 300 + fdt = plat_get_fdt(); 301 + early_init_dt_scan(fdt); 312 302 if (boot_command_line[0]) { 313 303 /* Boot command line was passed in device tree */ 314 304 strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); ··· 330 316 arcs_cmdline[0] = '\0'; 331 317 332 318 if (offset) { 319 + void (*fdt_relocated_)(void *) = NULL; 320 + #if defined(CONFIG_USE_OF) 321 + unsigned long fdt_phys = virt_to_phys(fdt); 322 + 323 + /* 324 + * If built-in dtb is used then it will have been relocated 325 + * during kernel _text relocation. If appended DTB is used 326 + * then it will not be relocated, but it should remain 327 + * intact in the original location. If dtb is loaded by 328 + * the bootloader then it may need to be moved if it crosses 329 + * the target memory area 330 + */ 331 + 332 + if (fdt_phys >= virt_to_phys(RELOCATED(&_text)) && 333 + fdt_phys <= virt_to_phys(RELOCATED(&_end))) { 334 + void *fdt_relocated = 335 + RELOCATED(ALIGN((long)&_end, PAGE_SIZE)); 336 + memcpy(fdt_relocated, fdt, fdt_totalsize(fdt)); 337 + fdt = fdt_relocated; 338 + fdt_relocated_ = RELOCATED(&plat_fdt_relocated); 339 + } 340 + #endif /* CONFIG_USE_OF */ 341 + 333 342 /* Copy the kernel to it's new location */ 334 343 memcpy(loc_new, &_text, kernel_length); 335 344 ··· 374 337 * stored to it so make a copy in the new location. 375 338 */ 376 339 memcpy(RELOCATED(&__bss_start), &__bss_start, bss_length); 340 + 341 + /* 342 + * If fdt was stored outside of the kernel image and 343 + * had to be moved then update platform's state data 344 + * with the new fdt location 345 + */ 346 + if (fdt_relocated_) 347 + fdt_relocated_(fdt); 348 + 349 + /* 350 + * Last chance for the platform to abort relocation. 351 + * This may also be used by the platform to perform any 352 + * initialisation required now that the new kernel is 353 + * resident in memory and ready to be executed. 354 + */ 355 + if (plat_post_relocation(offset)) 356 + goto out; 377 357 378 358 /* The current thread is now within the relocated image */ 379 359 __current_thread_info = RELOCATED(&init_thread_union);
+91 -3
arch/mips/kernel/setup.c
··· 27 27 #include <linux/device.h> 28 28 #include <linux/dma-contiguous.h> 29 29 #include <linux/decompress/generic.h> 30 + #include <linux/of_fdt.h> 30 31 31 32 #include <asm/addrspace.h> 32 33 #include <asm/bootinfo.h> ··· 152 151 ((unsigned long long) sz_max) / SZ_1M); 153 152 154 153 add_memory_region(start, size, BOOT_MEM_RAM); 154 + } 155 + 156 + bool __init memory_region_available(phys_addr_t start, phys_addr_t size) 157 + { 158 + int i; 159 + bool in_ram = false, free = true; 160 + 161 + for (i = 0; i < boot_mem_map.nr_map; i++) { 162 + phys_addr_t start_, end_; 163 + 164 + start_ = boot_mem_map.map[i].addr; 165 + end_ = boot_mem_map.map[i].addr + boot_mem_map.map[i].size; 166 + 167 + switch (boot_mem_map.map[i].type) { 168 + case BOOT_MEM_RAM: 169 + if (start >= start_ && start + size <= end_) 170 + in_ram = true; 171 + break; 172 + case BOOT_MEM_RESERVED: 173 + if ((start >= start_ && start < end_) || 174 + (start < start_ && start + size >= start_)) 175 + free = false; 176 + break; 177 + default: 178 + continue; 179 + } 180 + } 181 + 182 + return in_ram && free; 155 183 } 156 184 157 185 static void __init print_memory_map(void) ··· 362 332 363 333 #else /* !CONFIG_SGI_IP27 */ 364 334 335 + static unsigned long __init bootmap_bytes(unsigned long pages) 336 + { 337 + unsigned long bytes = DIV_ROUND_UP(pages, 8); 338 + 339 + return ALIGN(bytes, sizeof(long)); 340 + } 341 + 365 342 static void __init bootmem_init(void) 366 343 { 367 344 unsigned long reserved_end; 368 345 unsigned long mapstart = ~0UL; 369 346 unsigned long bootmap_size; 347 + bool bootmap_valid = false; 370 348 int i; 371 349 372 350 /* ··· 468 430 #endif 469 431 470 432 /* 433 + * check that mapstart doesn't overlap with any of 434 + * memory regions that have been reserved through eg. DTB 435 + */ 436 + bootmap_size = bootmap_bytes(max_low_pfn - min_low_pfn); 437 + 438 + bootmap_valid = memory_region_available(PFN_PHYS(mapstart), 439 + bootmap_size); 440 + for (i = 0; i < boot_mem_map.nr_map && !bootmap_valid; i++) { 441 + unsigned long mapstart_addr; 442 + 443 + switch (boot_mem_map.map[i].type) { 444 + case BOOT_MEM_RESERVED: 445 + mapstart_addr = PFN_ALIGN(boot_mem_map.map[i].addr + 446 + boot_mem_map.map[i].size); 447 + if (PHYS_PFN(mapstart_addr) < mapstart) 448 + break; 449 + 450 + bootmap_valid = memory_region_available(mapstart_addr, 451 + bootmap_size); 452 + if (bootmap_valid) 453 + mapstart = PHYS_PFN(mapstart_addr); 454 + break; 455 + default: 456 + break; 457 + } 458 + } 459 + 460 + if (!bootmap_valid) 461 + panic("No memory area to place a bootmap bitmap"); 462 + 463 + /* 471 464 * Initialize the boot-time allocator with low memory only. 472 465 */ 473 - bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart, 474 - min_low_pfn, max_low_pfn); 475 - 466 + if (bootmap_size != init_bootmem_node(NODE_DATA(0), mapstart, 467 + min_low_pfn, max_low_pfn)) 468 + panic("Unexpected memory size required for bootmap"); 476 469 477 470 for (i = 0; i < boot_mem_map.nr_map; i++) { 478 471 unsigned long start, end; ··· 552 483 continue; 553 484 default: 554 485 /* Not usable memory */ 486 + if (start > min_low_pfn && end < max_low_pfn) 487 + reserve_bootmem(boot_mem_map.map[i].addr, 488 + boot_mem_map.map[i].size, 489 + BOOTMEM_DEFAULT); 555 490 continue; 556 491 } 557 492 ··· 662 589 start = memparse(p + 1, &p); 663 590 664 591 add_memory_region(start, size, BOOT_MEM_RAM); 592 + 593 + if (start && start > PHYS_OFFSET) 594 + add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET, 595 + BOOT_MEM_RESERVED); 665 596 return 0; 666 597 } 667 598 early_param("mem", early_parse_mem); ··· 741 664 if (ret != 0 || crash_size <= 0) 742 665 return; 743 666 667 + if (!memory_region_available(crash_base, crash_size)) { 668 + pr_warn("Invalid memory region reserved for crash kernel\n"); 669 + return; 670 + } 671 + 744 672 crashk_res.start = crash_base; 745 673 crashk_res.end = crash_base + crash_size - 1; 746 674 } ··· 753 671 static void __init request_crashkernel(struct resource *res) 754 672 { 755 673 int ret; 674 + 675 + if (crashk_res.start == crashk_res.end) 676 + return; 756 677 757 678 ret = request_resource(res, &crashk_res); 758 679 if (!ret) ··· 841 756 pr_info("User-defined physical RAM map:\n"); 842 757 print_memory_map(); 843 758 } 759 + 760 + early_init_fdt_reserve_self(); 761 + early_init_fdt_scan_reserved_mem(); 844 762 845 763 bootmem_init(); 846 764 #ifdef CONFIG_PROC_VMCORE
+1 -1
arch/mips/kernel/smp-bmips.c
··· 364 364 365 365 set_cpu_online(cpu, false); 366 366 calculate_cpu_foreign_map(); 367 - cpumask_clear_cpu(cpu, &cpu_callin_map); 367 + irq_cpu_offline(); 368 368 clear_c0_status(IE_IRQ5); 369 369 370 370 local_flush_tlb_all();
+5 -2
arch/mips/kernel/smp-cps.c
··· 326 326 if (cpu_online(remote)) 327 327 break; 328 328 } 329 - BUG_ON(remote >= NR_CPUS); 329 + if (remote >= NR_CPUS) { 330 + pr_crit("No online CPU in core %u to start CPU%d\n", 331 + core, cpu); 332 + goto out; 333 + } 330 334 331 335 err = smp_call_function_single(remote, remote_vpe_boot, 332 336 NULL, 1); ··· 403 399 smp_mb__after_atomic(); 404 400 set_cpu_online(cpu, false); 405 401 calculate_cpu_foreign_map(); 406 - cpumask_clear_cpu(cpu, &cpu_callin_map); 407 402 408 403 return 0; 409 404 }
+9 -25
arch/mips/kernel/smp.c
··· 48 48 #include <asm/setup.h> 49 49 #include <asm/maar.h> 50 50 51 - cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ 52 - 53 51 int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ 54 52 EXPORT_SYMBOL(__cpu_number_map); 55 53 ··· 65 67 /* representing the core map of multi-core chips of each logical CPU */ 66 68 cpumask_t cpu_core_map[NR_CPUS] __read_mostly; 67 69 EXPORT_SYMBOL(cpu_core_map); 70 + 71 + static DECLARE_COMPLETION(cpu_running); 68 72 69 73 /* 70 74 * A logcal cpu mask containing only one VPE per core to ··· 369 369 cpumask_set_cpu(cpu, &cpu_coherent_mask); 370 370 notify_cpu_starting(cpu); 371 371 372 - cpumask_set_cpu(cpu, &cpu_callin_map); 372 + complete(&cpu_running); 373 373 synchronise_count_slave(cpu); 374 374 375 375 set_cpu_online(cpu, true); ··· 430 430 { 431 431 set_cpu_possible(0, true); 432 432 set_cpu_online(0, true); 433 - cpumask_set_cpu(0, &cpu_callin_map); 434 433 } 435 434 436 435 int __cpu_up(unsigned int cpu, struct task_struct *tidle) ··· 437 438 mp_ops->boot_secondary(cpu, tidle); 438 439 439 440 /* 440 - * Trust is futile. We should really have timeouts ... 441 + * We must check for timeout here, as the CPU will not be marked 442 + * online until the counters are synchronised. 441 443 */ 442 - while (!cpumask_test_cpu(cpu, &cpu_callin_map)) { 443 - udelay(100); 444 - schedule(); 444 + if (!wait_for_completion_timeout(&cpu_running, 445 + msecs_to_jiffies(1000))) { 446 + pr_crit("CPU%u: failed to start\n", cpu); 447 + return -EIO; 445 448 } 446 449 447 450 synchronise_count_master(cpu); ··· 637 636 638 637 EXPORT_SYMBOL(flush_tlb_page); 639 638 EXPORT_SYMBOL(flush_tlb_one); 640 - 641 - #if defined(CONFIG_KEXEC) 642 - void (*dump_ipi_function_ptr)(void *) = NULL; 643 - void dump_send_ipi(void (*dump_ipi_callback)(void *)) 644 - { 645 - int i; 646 - int cpu = smp_processor_id(); 647 - 648 - dump_ipi_function_ptr = dump_ipi_callback; 649 - smp_mb(); 650 - for_each_online_cpu(i) 651 - if (i != cpu) 652 - mp_ops->send_ipi_single(i, SMP_DUMP); 653 - 654 - } 655 - EXPORT_SYMBOL(dump_send_ipi); 656 - #endif 657 639 658 640 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST 659 641
+2 -2
arch/mips/kernel/sync-r4k.c
··· 29 29 int i; 30 30 unsigned long flags; 31 31 32 - printk(KERN_INFO "Synchronize counters for CPU %u: ", cpu); 32 + pr_info("Synchronize counters for CPU %u: ", cpu); 33 33 34 34 local_irq_save(flags); 35 35 ··· 83 83 * count registers were almost certainly out of sync 84 84 * so no point in alarming people 85 85 */ 86 - printk("done.\n"); 86 + pr_cont("done.\n"); 87 87 } 88 88 89 89 void synchronise_count_slave(int cpu)
+2 -10
arch/mips/kernel/syscall.c
··· 36 36 #include <asm/sim.h> 37 37 #include <asm/shmparam.h> 38 38 #include <asm/sysmips.h> 39 - #include <linux/uaccess.h> 40 39 #include <asm/switch_to.h> 41 40 42 41 /* ··· 59 60 unsigned long, prot, unsigned long, flags, unsigned long, 60 61 fd, off_t, offset) 61 62 { 62 - unsigned long result; 63 - 64 - result = -EINVAL; 65 63 if (offset & ~PAGE_MASK) 66 - goto out; 67 - 68 - result = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); 69 - 70 - out: 71 - return result; 64 + return -EINVAL; 65 + return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); 72 66 } 73 67 74 68 SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
+60 -5
arch/mips/kernel/traps.c
··· 51 51 #include <asm/idle.h> 52 52 #include <asm/mips-cm.h> 53 53 #include <asm/mips-r2-to-r6-emul.h> 54 + #include <asm/mips-cm.h> 54 55 #include <asm/mipsregs.h> 55 56 #include <asm/mipsmtregs.h> 56 57 #include <asm/module.h> ··· 1108 1107 switch (status) { 1109 1108 case 0: 1110 1109 case SIGEMT: 1111 - task_thread_info(current)->r2_emul_return = 1; 1112 1110 return; 1113 1111 case SIGILL: 1114 1112 goto no_r2_instr; ··· 1115 1115 process_fpemu_return(status, 1116 1116 &current->thread.cp0_baduaddr, 1117 1117 fcr31); 1118 - task_thread_info(current)->r2_emul_return = 1; 1119 1118 return; 1120 1119 } 1121 1120 } ··· 1643 1644 */ 1644 1645 static inline void parity_protection_init(void) 1645 1646 { 1647 + #define ERRCTL_PE 0x80000000 1648 + #define ERRCTL_L2P 0x00800000 1649 + 1650 + if (mips_cm_revision() >= CM_REV_CM3) { 1651 + ulong gcr_ectl, cp0_ectl; 1652 + 1653 + /* 1654 + * With CM3 systems we need to ensure that the L1 & L2 1655 + * parity enables are set to the same value, since this 1656 + * is presumed by the hardware engineers. 1657 + * 1658 + * If the user disabled either of L1 or L2 ECC checking, 1659 + * disable both. 1660 + */ 1661 + l1parity &= l2parity; 1662 + l2parity &= l1parity; 1663 + 1664 + /* Probe L1 ECC support */ 1665 + cp0_ectl = read_c0_ecc(); 1666 + write_c0_ecc(cp0_ectl | ERRCTL_PE); 1667 + back_to_back_c0_hazard(); 1668 + cp0_ectl = read_c0_ecc(); 1669 + 1670 + /* Probe L2 ECC support */ 1671 + gcr_ectl = read_gcr_err_control(); 1672 + 1673 + if (!(gcr_ectl & CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK) || 1674 + !(cp0_ectl & ERRCTL_PE)) { 1675 + /* 1676 + * One of L1 or L2 ECC checking isn't supported, 1677 + * so we cannot enable either. 1678 + */ 1679 + l1parity = l2parity = 0; 1680 + } 1681 + 1682 + /* Configure L1 ECC checking */ 1683 + if (l1parity) 1684 + cp0_ectl |= ERRCTL_PE; 1685 + else 1686 + cp0_ectl &= ~ERRCTL_PE; 1687 + write_c0_ecc(cp0_ectl); 1688 + back_to_back_c0_hazard(); 1689 + WARN_ON(!!(read_c0_ecc() & ERRCTL_PE) != l1parity); 1690 + 1691 + /* Configure L2 ECC checking */ 1692 + if (l2parity) 1693 + gcr_ectl |= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; 1694 + else 1695 + gcr_ectl &= ~CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; 1696 + write_gcr_err_control(gcr_ectl); 1697 + gcr_ectl = read_gcr_err_control(); 1698 + gcr_ectl &= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; 1699 + WARN_ON(!!gcr_ectl != l2parity); 1700 + 1701 + pr_info("Cache parity protection %sabled\n", 1702 + l1parity ? "en" : "dis"); 1703 + return; 1704 + } 1705 + 1646 1706 switch (current_cpu_type()) { 1647 1707 case CPU_24K: 1648 1708 case CPU_34K: ··· 1712 1654 case CPU_PROAPTIV: 1713 1655 case CPU_P5600: 1714 1656 case CPU_QEMU_GENERIC: 1715 - case CPU_I6400: 1716 1657 case CPU_P6600: 1717 1658 { 1718 - #define ERRCTL_PE 0x80000000 1719 - #define ERRCTL_L2P 0x00800000 1720 1659 unsigned long errctl; 1721 1660 unsigned int l1parity_present, l2parity_present; 1722 1661
+1 -1
arch/mips/kernel/uprobes.c
··· 226 226 return uprobe_write_opcode(mm, vaddr, UPROBE_SWBP_INSN); 227 227 } 228 228 229 - void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, 229 + void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, 230 230 void *src, unsigned long len) 231 231 { 232 232 unsigned long kaddr, kstart;
+1 -1
arch/mips/kernel/vmlinux.lds.S
··· 182 182 * Force .bss to 64K alignment so that .bss..swapper_pg_dir 183 183 * gets that alignment. .sbss should be empty, so there will be 184 184 * no holes after __init_end. */ 185 - BSS_SECTION(0, 0x10000, 0) 185 + BSS_SECTION(0, 0x10000, 8) 186 186 187 187 _end = . ; 188 188
+16 -20
arch/mips/lantiq/irq.c
··· 269 269 DEFINE_HWx_IRQDISPATCH(5) 270 270 #endif 271 271 272 + static void ltq_hw_irq_handler(struct irq_desc *desc) 273 + { 274 + ltq_hw_irqdispatch(irq_desc_get_irq(desc) - 2); 275 + } 276 + 272 277 #ifdef CONFIG_MIPS_MT_SMP 273 278 void __init arch_init_ipiirq(int irq, struct irqaction *action) 274 279 { ··· 318 313 asmlinkage void plat_irq_dispatch(void) 319 314 { 320 315 unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; 321 - unsigned int i; 316 + int irq; 322 317 323 - if ((MIPS_CPU_TIMER_IRQ == 7) && (pending & CAUSEF_IP7)) { 324 - do_IRQ(MIPS_CPU_TIMER_IRQ); 325 - goto out; 326 - } else { 327 - for (i = 0; i < MAX_IM; i++) { 328 - if (pending & (CAUSEF_IP2 << i)) { 329 - ltq_hw_irqdispatch(i); 330 - goto out; 331 - } 332 - } 318 + if (!pending) { 319 + spurious_interrupt(); 320 + return; 333 321 } 334 - pr_alert("Spurious IRQ: CAUSE=0x%08x\n", read_c0_status()); 335 322 336 - out: 337 - return; 323 + pending >>= CAUSEB_IP; 324 + while (pending) { 325 + irq = fls(pending) - 1; 326 + do_IRQ(MIPS_CPU_IRQ_BASE + irq); 327 + pending &= ~BIT(irq); 328 + } 338 329 } 339 330 340 331 static int icu_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) ··· 353 352 static const struct irq_domain_ops irq_domain_ops = { 354 353 .xlate = irq_domain_xlate_onetwocell, 355 354 .map = icu_map, 356 - }; 357 - 358 - static struct irqaction cascade = { 359 - .handler = no_action, 360 - .name = "cascade", 361 355 }; 362 356 363 357 int __init icu_of_init(struct device_node *node, struct device_node *parent) ··· 386 390 mips_cpu_irq_init(); 387 391 388 392 for (i = 0; i < MAX_IM; i++) 389 - setup_irq(i + 2, &cascade); 393 + irq_set_chained_handler(i + 2, ltq_hw_irq_handler); 390 394 391 395 if (cpu_has_vint) { 392 396 pr_info("Setting up vectored interrupts\n");
+6
arch/mips/lantiq/prom.c
··· 26 26 EXPORT_SYMBOL_GPL(ebu_lock); 27 27 28 28 /* 29 + * This is needed by the VPE loader code, just set it to 0 and assume 30 + * that the firmware hardcodes this value to something useful. 31 + */ 32 + unsigned long physical_memsize = 0L; 33 + 34 + /* 29 35 * this struct is filled by the soc specific detection code and holds 30 36 * information about the specific soc type, revision and name 31 37 */
+21 -20
arch/mips/lantiq/xway/dma.c
··· 19 19 #include <linux/platform_device.h> 20 20 #include <linux/io.h> 21 21 #include <linux/dma-mapping.h> 22 - #include <linux/module.h> 22 + #include <linux/export.h> 23 + #include <linux/spinlock.h> 23 24 #include <linux/clk.h> 24 25 #include <linux/err.h> 25 26 ··· 60 59 ltq_dma_membase + (z)) 61 60 62 61 static void __iomem *ltq_dma_membase; 62 + static DEFINE_SPINLOCK(ltq_dma_lock); 63 63 64 64 void 65 65 ltq_dma_enable_irq(struct ltq_dma_channel *ch) 66 66 { 67 67 unsigned long flags; 68 68 69 - local_irq_save(flags); 69 + spin_lock_irqsave(&ltq_dma_lock, flags); 70 70 ltq_dma_w32(ch->nr, LTQ_DMA_CS); 71 71 ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN); 72 - local_irq_restore(flags); 72 + spin_unlock_irqrestore(&ltq_dma_lock, flags); 73 73 } 74 74 EXPORT_SYMBOL_GPL(ltq_dma_enable_irq); 75 75 ··· 79 77 { 80 78 unsigned long flags; 81 79 82 - local_irq_save(flags); 80 + spin_lock_irqsave(&ltq_dma_lock, flags); 83 81 ltq_dma_w32(ch->nr, LTQ_DMA_CS); 84 82 ltq_dma_w32_mask(1 << ch->nr, 0, LTQ_DMA_IRNEN); 85 - local_irq_restore(flags); 83 + spin_unlock_irqrestore(&ltq_dma_lock, flags); 86 84 } 87 85 EXPORT_SYMBOL_GPL(ltq_dma_disable_irq); 88 86 ··· 91 89 { 92 90 unsigned long flags; 93 91 94 - local_irq_save(flags); 92 + spin_lock_irqsave(&ltq_dma_lock, flags); 95 93 ltq_dma_w32(ch->nr, LTQ_DMA_CS); 96 94 ltq_dma_w32(DMA_IRQ_ACK, LTQ_DMA_CIS); 97 - local_irq_restore(flags); 95 + spin_unlock_irqrestore(&ltq_dma_lock, flags); 98 96 } 99 97 EXPORT_SYMBOL_GPL(ltq_dma_ack_irq); 100 98 ··· 103 101 { 104 102 unsigned long flag; 105 103 106 - local_irq_save(flag); 104 + spin_lock_irqsave(&ltq_dma_lock, flag); 107 105 ltq_dma_w32(ch->nr, LTQ_DMA_CS); 108 106 ltq_dma_w32_mask(0, DMA_CHAN_ON, LTQ_DMA_CCTRL); 109 - ltq_dma_enable_irq(ch); 110 - local_irq_restore(flag); 107 + ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN); 108 + spin_unlock_irqrestore(&ltq_dma_lock, flag); 111 109 } 112 110 EXPORT_SYMBOL_GPL(ltq_dma_open); 113 111 ··· 116 114 { 117 115 unsigned long flag; 118 116 119 - local_irq_save(flag); 117 + spin_lock_irqsave(&ltq_dma_lock, flag); 120 118 ltq_dma_w32(ch->nr, LTQ_DMA_CS); 121 119 ltq_dma_w32_mask(DMA_CHAN_ON, 0, LTQ_DMA_CCTRL); 122 - ltq_dma_disable_irq(ch); 123 - local_irq_restore(flag); 120 + ltq_dma_w32_mask(1 << ch->nr, 0, LTQ_DMA_IRNEN); 121 + spin_unlock_irqrestore(&ltq_dma_lock, flag); 124 122 } 125 123 EXPORT_SYMBOL_GPL(ltq_dma_close); 126 124 ··· 135 133 &ch->phys, GFP_ATOMIC); 136 134 memset(ch->desc_base, 0, LTQ_DESC_NUM * LTQ_DESC_SIZE); 137 135 138 - local_irq_save(flags); 136 + spin_lock_irqsave(&ltq_dma_lock, flags); 139 137 ltq_dma_w32(ch->nr, LTQ_DMA_CS); 140 138 ltq_dma_w32(ch->phys, LTQ_DMA_CDBA); 141 139 ltq_dma_w32(LTQ_DESC_NUM, LTQ_DMA_CDLEN); ··· 144 142 ltq_dma_w32_mask(0, DMA_CHAN_RST, LTQ_DMA_CCTRL); 145 143 while (ltq_dma_r32(LTQ_DMA_CCTRL) & DMA_CHAN_RST) 146 144 ; 147 - local_irq_restore(flags); 145 + spin_unlock_irqrestore(&ltq_dma_lock, flags); 148 146 } 149 147 150 148 void ··· 154 152 155 153 ltq_dma_alloc(ch); 156 154 157 - local_irq_save(flags); 155 + spin_lock_irqsave(&ltq_dma_lock, flags); 158 156 ltq_dma_w32(DMA_DESCPT, LTQ_DMA_CIE); 159 157 ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN); 160 158 ltq_dma_w32(DMA_WEIGHT | DMA_TX, LTQ_DMA_CCTRL); 161 - local_irq_restore(flags); 159 + spin_unlock_irqrestore(&ltq_dma_lock, flags); 162 160 } 163 161 EXPORT_SYMBOL_GPL(ltq_dma_alloc_tx); 164 162 ··· 169 167 170 168 ltq_dma_alloc(ch); 171 169 172 - local_irq_save(flags); 170 + spin_lock_irqsave(&ltq_dma_lock, flags); 173 171 ltq_dma_w32(DMA_DESCPT, LTQ_DMA_CIE); 174 172 ltq_dma_w32_mask(0, 1 << ch->nr, LTQ_DMA_IRNEN); 175 173 ltq_dma_w32(DMA_WEIGHT, LTQ_DMA_CCTRL); 176 - local_irq_restore(flags); 174 + spin_unlock_irqrestore(&ltq_dma_lock, flags); 177 175 } 178 176 EXPORT_SYMBOL_GPL(ltq_dma_alloc_rx); 179 177 ··· 257 255 { .compatible = "lantiq,dma-xway" }, 258 256 {}, 259 257 }; 260 - MODULE_DEVICE_TABLE(of, dma_match); 261 258 262 259 static struct platform_driver dma_driver = { 263 260 .probe = ltq_dma_init,
+1 -2
arch/mips/lantiq/xway/gptu.c
··· 9 9 10 10 #include <linux/interrupt.h> 11 11 #include <linux/ioport.h> 12 - #include <linux/module.h> 12 + #include <linux/init.h> 13 13 #include <linux/of_platform.h> 14 14 #include <linux/of_irq.h> 15 15 ··· 187 187 { .compatible = "lantiq,gptu-xway" }, 188 188 {}, 189 189 }; 190 - MODULE_DEVICE_TABLE(of, dma_match); 191 190 192 191 static struct platform_driver dma_driver = { 193 192 .probe = gptu_probe,
+6 -6
arch/mips/lantiq/xway/sysctrl.c
··· 469 469 panic("Failed to load xbar nodes from devicetree"); 470 470 if (of_address_to_resource(np_pmu, 0, &res_xbar)) 471 471 panic("Failed to get xbar resources"); 472 - if (request_mem_region(res_xbar.start, resource_size(&res_xbar), 473 - res_xbar.name) < 0) 472 + if (!request_mem_region(res_xbar.start, resource_size(&res_xbar), 473 + res_xbar.name)) 474 474 panic("Failed to get xbar resources"); 475 475 476 476 ltq_xbar_membase = ioremap_nocache(res_xbar.start, ··· 545 545 clkdev_add_pmu("1a800000.pcie", "msi", 1, 1, PMU1_PCIE2_MSI); 546 546 clkdev_add_pmu("1a800000.pcie", "pdi", 1, 1, PMU1_PCIE2_PDI); 547 547 clkdev_add_pmu("1a800000.pcie", "ctl", 1, 1, PMU1_PCIE2_CTL); 548 - clkdev_add_pmu("1e108000.eth", NULL, 1, 0, PMU_SWITCH | PMU_PPE_DP); 548 + clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH | PMU_PPE_DP); 549 549 clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF); 550 550 clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU); 551 551 } else if (of_machine_is_compatible("lantiq,ar10")) { ··· 553 553 ltq_ar10_fpi_hz(), ltq_ar10_pp32_hz()); 554 554 clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0); 555 555 clkdev_add_pmu("1e106000.usb", "ctl", 1, 0, PMU_USB1); 556 - clkdev_add_pmu("1e108000.eth", NULL, 1, 0, PMU_SWITCH | 556 + clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH | 557 557 PMU_PPE_DP | PMU_PPE_TC); 558 558 clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF); 559 559 clkdev_add_pmu("1f203000.rcu", "gphy", 1, 0, PMU_GPHY); ··· 575 575 clkdev_add_pmu(NULL, "ahb", 1, 0, PMU_AHBM | PMU_AHBS); 576 576 577 577 clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF); 578 - clkdev_add_pmu("1e108000.eth", NULL, 1, 0, 578 + clkdev_add_pmu("1e108000.eth", NULL, 0, 0, 579 579 PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM | 580 580 PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 | 581 581 PMU_PPE_QSB | PMU_PPE_TOP); 582 - clkdev_add_pmu("1f203000.rcu", "gphy", 1, 0, PMU_GPHY); 582 + clkdev_add_pmu("1f203000.rcu", "gphy", 0, 0, PMU_GPHY); 583 583 clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO); 584 584 clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU); 585 585 clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);
-1
arch/mips/lasat/at93c.c
··· 7 7 #include <linux/kernel.h> 8 8 #include <linux/delay.h> 9 9 #include <asm/lasat/lasat.h> 10 - #include <linux/module.h> 11 10 12 11 #include "at93c.h" 13 12
-1
arch/mips/lasat/sysctl.c
··· 20 20 #include <linux/types.h> 21 21 #include <asm/lasat/lasat.h> 22 22 23 - #include <linux/module.h> 24 23 #include <linux/sysctl.h> 25 24 #include <linux/stddef.h> 26 25 #include <linux/init.h>
+6
arch/mips/lib/csum_partial.S
··· 13 13 #include <linux/errno.h> 14 14 #include <asm/asm.h> 15 15 #include <asm/asm-offsets.h> 16 + #include <asm/export.h> 16 17 #include <asm/regdef.h> 17 18 18 19 #ifdef CONFIG_64BIT ··· 104 103 .set noreorder 105 104 .align 5 106 105 LEAF(csum_partial) 106 + EXPORT_SYMBOL(csum_partial) 107 107 move sum, zero 108 108 move t7, zero 109 109 ··· 462 460 #endif 463 461 .if \__nocheck == 1 464 462 FEXPORT(csum_partial_copy_nocheck) 463 + EXPORT_SYMBOL(csum_partial_copy_nocheck) 465 464 .endif 466 465 move sum, zero 467 466 move odd, zero ··· 826 823 .endm 827 824 828 825 LEAF(__csum_partial_copy_kernel) 826 + EXPORT_SYMBOL(__csum_partial_copy_kernel) 829 827 #ifndef CONFIG_EVA 830 828 FEXPORT(__csum_partial_copy_to_user) 829 + EXPORT_SYMBOL(__csum_partial_copy_to_user) 831 830 FEXPORT(__csum_partial_copy_from_user) 831 + EXPORT_SYMBOL(__csum_partial_copy_from_user) 832 832 #endif 833 833 __BUILD_CSUM_PARTIAL_COPY_USER LEGACY_MODE USEROP USEROP 1 834 834 END(__csum_partial_copy_kernel)
+9
arch/mips/lib/memcpy.S
··· 31 31 32 32 #include <asm/asm.h> 33 33 #include <asm/asm-offsets.h> 34 + #include <asm/export.h> 34 35 #include <asm/regdef.h> 35 36 36 37 #define dst a0 ··· 623 622 624 623 .align 5 625 624 LEAF(memmove) 625 + EXPORT_SYMBOL(memmove) 626 626 ADD t0, a0, a2 627 627 ADD t1, a1, a2 628 628 sltu t0, a1, t0 # dst + len <= src -> memcpy ··· 676 674 * t6 is used as a flag to note inatomic mode. 677 675 */ 678 676 LEAF(__copy_user_inatomic) 677 + EXPORT_SYMBOL(__copy_user_inatomic) 679 678 b __copy_user_common 680 679 li t6, 1 681 680 END(__copy_user_inatomic) ··· 689 686 */ 690 687 .align 5 691 688 LEAF(memcpy) /* a0=dst a1=src a2=len */ 689 + EXPORT_SYMBOL(memcpy) 692 690 move v0, dst /* return value */ 693 691 .L__memcpy: 694 692 FEXPORT(__copy_user) 693 + EXPORT_SYMBOL(__copy_user) 695 694 li t6, 0 /* not inatomic */ 696 695 __copy_user_common: 697 696 /* Legacy Mode, user <-> user */ ··· 709 704 */ 710 705 711 706 LEAF(__copy_user_inatomic_eva) 707 + EXPORT_SYMBOL(__copy_user_inatomic_eva) 712 708 b __copy_from_user_common 713 709 li t6, 1 714 710 END(__copy_user_inatomic_eva) ··· 719 713 */ 720 714 721 715 LEAF(__copy_from_user_eva) 716 + EXPORT_SYMBOL(__copy_from_user_eva) 722 717 li t6, 0 /* not inatomic */ 723 718 __copy_from_user_common: 724 719 __BUILD_COPY_USER EVA_MODE USEROP KERNELOP ··· 732 725 */ 733 726 734 727 LEAF(__copy_to_user_eva) 728 + EXPORT_SYMBOL(__copy_to_user_eva) 735 729 __BUILD_COPY_USER EVA_MODE KERNELOP USEROP 736 730 END(__copy_to_user_eva) 737 731 ··· 741 733 */ 742 734 743 735 LEAF(__copy_in_user_eva) 736 + EXPORT_SYMBOL(__copy_in_user_eva) 744 737 __BUILD_COPY_USER EVA_MODE USEROP USEROP 745 738 END(__copy_in_user_eva) 746 739
+5
arch/mips/lib/memset.S
··· 10 10 */ 11 11 #include <asm/asm.h> 12 12 #include <asm/asm-offsets.h> 13 + #include <asm/export.h> 13 14 #include <asm/regdef.h> 14 15 15 16 #if LONGSIZE == 4 ··· 271 270 */ 272 271 273 272 LEAF(memset) 273 + EXPORT_SYMBOL(memset) 274 274 beqz a1, 1f 275 275 move v0, a0 /* result */ 276 276 ··· 287 285 1: 288 286 #ifndef CONFIG_EVA 289 287 FEXPORT(__bzero) 288 + EXPORT_SYMBOL(__bzero) 290 289 #else 291 290 FEXPORT(__bzero_kernel) 291 + EXPORT_SYMBOL(__bzero_kernel) 292 292 #endif 293 293 __BUILD_BZERO LEGACY_MODE 294 294 295 295 #ifdef CONFIG_EVA 296 296 LEAF(__bzero) 297 + EXPORT_SYMBOL(__bzero) 297 298 __BUILD_BZERO EVA_MODE 298 299 END(__bzero) 299 300 #endif
+4
arch/mips/lib/strlen_user.S
··· 9 9 */ 10 10 #include <asm/asm.h> 11 11 #include <asm/asm-offsets.h> 12 + #include <asm/export.h> 12 13 #include <asm/regdef.h> 13 14 14 15 #define EX(insn,reg,addr,handler) \ ··· 49 48 /* Set aliases */ 50 49 .global __strlen_user_asm 51 50 .set __strlen_user_asm, __strlen_kernel_asm 51 + EXPORT_SYMBOL(__strlen_user_asm) 52 52 #endif 53 53 54 54 __BUILD_STRLEN_ASM kernel 55 + EXPORT_SYMBOL(__strlen_kernel_asm) 55 56 56 57 #ifdef CONFIG_EVA 57 58 ··· 61 58 .set eva 62 59 __BUILD_STRLEN_ASM user 63 60 .set pop 61 + EXPORT_SYMBOL(__strlen_user_asm) 64 62 #endif
+7
arch/mips/lib/strncpy_user.S
··· 9 9 #include <linux/errno.h> 10 10 #include <asm/asm.h> 11 11 #include <asm/asm-offsets.h> 12 + #include <asm/export.h> 12 13 #include <asm/regdef.h> 13 14 14 15 #define EX(insn,reg,addr,handler) \ ··· 73 72 .global __strncpy_from_user_nocheck_asm 74 73 .set __strncpy_from_user_asm, __strncpy_from_kernel_asm 75 74 .set __strncpy_from_user_nocheck_asm, __strncpy_from_kernel_nocheck_asm 75 + EXPORT_SYMBOL(__strncpy_from_user_asm) 76 + EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm) 76 77 #endif 77 78 78 79 __BUILD_STRNCPY_ASM kernel 80 + EXPORT_SYMBOL(__strncpy_from_kernel_asm) 81 + EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm) 79 82 80 83 #ifdef CONFIG_EVA 81 84 .set push 82 85 .set eva 83 86 __BUILD_STRNCPY_ASM user 84 87 .set pop 88 + EXPORT_SYMBOL(__strncpy_from_user_asm) 89 + EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm) 85 90 #endif
+7
arch/mips/lib/strnlen_user.S
··· 8 8 */ 9 9 #include <asm/asm.h> 10 10 #include <asm/asm-offsets.h> 11 + #include <asm/export.h> 11 12 #include <asm/regdef.h> 12 13 13 14 #define EX(insn,reg,addr,handler) \ ··· 71 70 .global __strnlen_user_nocheck_asm 72 71 .set __strnlen_user_asm, __strnlen_kernel_asm 73 72 .set __strnlen_user_nocheck_asm, __strnlen_kernel_nocheck_asm 73 + EXPORT_SYMBOL(__strnlen_user_asm) 74 + EXPORT_SYMBOL(__strnlen_user_nocheck_asm) 74 75 #endif 75 76 76 77 __BUILD_STRNLEN_ASM kernel 78 + EXPORT_SYMBOL(__strnlen_kernel_asm) 79 + EXPORT_SYMBOL(__strnlen_kernel_nocheck_asm) 77 80 78 81 #ifdef CONFIG_EVA 79 82 ··· 85 80 .set eva 86 81 __BUILD_STRNLEN_ASM user 87 82 .set pop 83 + EXPORT_SYMBOL(__strnlen_user_asm) 84 + EXPORT_SYMBOL(__strnlen_user_nocheck_asm) 88 85 #endif
+28 -17
arch/mips/loongson32/common/platform.c
··· 1 1 /* 2 2 * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com> 3 3 * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms of the GNU General Public License as published by the 6 - * Free Software Foundation; either version 2 of the License, or (at your 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 7 * option) any later version. 8 8 */ 9 9 ··· 22 22 #include <cpufreq.h> 23 23 #include <dma.h> 24 24 #include <nand.h> 25 - 26 - #define LS1X_RTC_CTRL ((void __iomem *)KSEG1ADDR(LS1X_RTC_BASE + 0x40)) 27 - #define RTC_EXTCLK_OK (BIT(5) | BIT(8)) 28 - #define RTC_EXTCLK_EN BIT(8) 29 25 30 26 /* 8250/16550 compatible UART */ 31 27 #define LS1X_UART(_id) \ ··· 66 70 p->uartclk = clk_get_rate(clk); 67 71 } 68 72 69 - void __init ls1x_rtc_set_extclk(struct platform_device *pdev) 70 - { 71 - u32 val; 72 - 73 - val = __raw_readl(LS1X_RTC_CTRL); 74 - if (!(val & RTC_EXTCLK_OK)) 75 - __raw_writel(val | RTC_EXTCLK_EN, LS1X_RTC_CTRL); 76 - } 77 - 78 73 /* CPUFreq */ 79 74 static struct plat_ls1x_cpufreq ls1x_cpufreq_pdata = { 80 75 .clk_name = "cpu_clk", 81 - .osc_clk_name = "osc_33m_clk", 76 + .osc_clk_name = "osc_clk", 82 77 .max_freq = 266 * 1000, 83 78 .min_freq = 33 * 1000, 84 79 }; ··· 344 357 }; 345 358 346 359 /* Real Time Clock */ 360 + void __init ls1x_rtc_set_extclk(struct platform_device *pdev) 361 + { 362 + u32 val = __raw_readl(LS1X_RTC_CTRL); 363 + 364 + if (!(val & RTC_EXTCLK_OK)) 365 + __raw_writel(val | RTC_EXTCLK_EN, LS1X_RTC_CTRL); 366 + } 367 + 347 368 struct platform_device ls1x_rtc_pdev = { 348 369 .name = "ls1x-rtc", 349 370 .id = -1, 371 + }; 372 + 373 + /* Watchdog */ 374 + static struct resource ls1x_wdt_resources[] = { 375 + { 376 + .start = LS1X_WDT_BASE, 377 + .end = LS1X_WDT_BASE + SZ_16 - 1, 378 + .flags = IORESOURCE_MEM, 379 + }, 380 + }; 381 + 382 + struct platform_device ls1x_wdt_pdev = { 383 + .name = "ls1x-wdt", 384 + .id = -1, 385 + .num_resources = ARRAY_SIZE(ls1x_wdt_resources), 386 + .resource = ls1x_wdt_resources, 350 387 };
+4 -3
arch/mips/loongson32/ls1b/board.c
··· 1 1 /* 2 2 * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com> 3 3 * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms of the GNU General Public License as published by the 6 - * Free Software Foundation; either version 2 of the License, or (at your 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 7 * option) any later version. 8 8 */ 9 9 ··· 72 72 &ls1x_gpio1_pdev, 73 73 &ls1x_nand_pdev, 74 74 &ls1x_rtc_pdev, 75 + &ls1x_wdt_pdev, 75 76 }; 76 77 77 78 static int __init ls1b_platform_init(void)
+4 -3
arch/mips/loongson32/ls1c/board.c
··· 1 1 /* 2 2 * Copyright (c) 2016 Yang Ling <gnaygnil@gmail.com> 3 3 * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms of the GNU General Public License as published by the 6 - * Free Software Foundation; either version 2 of the License, or (at your 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 7 * option) any later version. 8 8 */ 9 9 ··· 13 13 &ls1x_uart_pdev, 14 14 &ls1x_eth0_pdev, 15 15 &ls1x_rtc_pdev, 16 + &ls1x_wdt_pdev, 16 17 }; 17 18 18 19 static int __init ls1c_platform_init(void)
+1 -1
arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c
··· 17 17 18 18 #include <linux/io.h> 19 19 #include <linux/init.h> 20 - #include <linux/module.h> 20 + #include <linux/export.h> 21 21 #include <linux/jiffies.h> 22 22 #include <linux/spinlock.h> 23 23 #include <linux/interrupt.h>
+6 -14
arch/mips/loongson64/common/dma-swiotlb.c
··· 17 17 /* ignore region specifiers */ 18 18 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); 19 19 20 - #ifdef CONFIG_ISA 21 - if (dev == NULL) 20 + if ((IS_ENABLED(CONFIG_ISA) && dev == NULL) || 21 + (IS_ENABLED(CONFIG_ZONE_DMA) && 22 + dev->coherent_dma_mask < DMA_BIT_MASK(32))) 22 23 gfp |= __GFP_DMA; 23 - else 24 - #endif 25 - #ifdef CONFIG_ZONE_DMA 26 - if (dev->coherent_dma_mask < DMA_BIT_MASK(32)) 27 - gfp |= __GFP_DMA; 28 - else 29 - #endif 30 - #ifdef CONFIG_ZONE_DMA32 31 - if (dev->coherent_dma_mask < DMA_BIT_MASK(40)) 24 + else if (IS_ENABLED(CONFIG_ZONE_DMA32) && 25 + dev->coherent_dma_mask < DMA_BIT_MASK(40)) 32 26 gfp |= __GFP_DMA32; 33 - else 34 - #endif 35 - ; 27 + 36 28 gfp |= __GFP_NORETRY; 37 29 38 30 ret = swiotlb_alloc_coherent(dev, size, dma_handle, gfp);
+1 -1
arch/mips/loongson64/common/env.c
··· 17 17 * Free Software Foundation; either version 2 of the License, or (at your 18 18 * option) any later version. 19 19 */ 20 - #include <linux/module.h> 20 + #include <linux/export.h> 21 21 #include <asm/bootinfo.h> 22 22 #include <loongson.h> 23 23 #include <boot_param.h>
+2 -1
arch/mips/loongson64/common/setup.c
··· 7 7 * Free Software Foundation; either version 2 of the License, or (at your 8 8 * option) any later version. 9 9 */ 10 - #include <linux/module.h> 10 + #include <linux/export.h> 11 + #include <linux/init.h> 11 12 12 13 #include <asm/wbflush.h> 13 14 #include <asm/bootinfo.h>
+1 -1
arch/mips/loongson64/common/uart_base.c
··· 8 8 * option) any later version. 9 9 */ 10 10 11 - #include <linux/module.h> 11 + #include <linux/export.h> 12 12 #include <asm/bootinfo.h> 13 13 14 14 #include <loongson.h>
+2 -1
arch/mips/loongson64/lemote-2f/ec_kb3310b.c
··· 10 10 * (at your option) any later version. 11 11 */ 12 12 13 - #include <linux/module.h> 13 + #include <linux/io.h> 14 + #include <linux/export.h> 14 15 #include <linux/spinlock.h> 15 16 #include <linux/delay.h> 16 17
+2 -1
arch/mips/loongson64/lemote-2f/irq.c
··· 8 8 * option) any later version. 9 9 */ 10 10 11 + #include <linux/export.h> 12 + #include <linux/init.h> 11 13 #include <linux/interrupt.h> 12 - #include <linux/module.h> 13 14 14 15 #include <asm/irq_cpu.h> 15 16 #include <asm/i8259.h>
+1 -1
arch/mips/loongson64/lemote-2f/pm.c
··· 14 14 #include <linux/interrupt.h> 15 15 #include <linux/pm.h> 16 16 #include <linux/i8042.h> 17 - #include <linux/module.h> 17 + #include <linux/export.h> 18 18 19 19 #include <asm/i8259.h> 20 20 #include <asm/mipsregs.h>
+1 -1
arch/mips/loongson64/loongson-3/irq.c
··· 1 1 #include <loongson.h> 2 2 #include <irq.h> 3 3 #include <linux/interrupt.h> 4 - #include <linux/module.h> 4 + #include <linux/init.h> 5 5 6 6 #include <asm/irq_cpu.h> 7 7 #include <asm/i8259.h>
+1 -1
arch/mips/loongson64/loongson-3/numa.c
··· 14 14 #include <linux/kernel.h> 15 15 #include <linux/mm.h> 16 16 #include <linux/mmzone.h> 17 - #include <linux/module.h> 17 + #include <linux/export.h> 18 18 #include <linux/nodemask.h> 19 19 #include <linux/swap.h> 20 20 #include <linux/memblock.h>
-1
arch/mips/loongson64/loongson-3/smp.c
··· 418 418 419 419 set_cpu_online(cpu, false); 420 420 calculate_cpu_foreign_map(); 421 - cpumask_clear_cpu(cpu, &cpu_callin_map); 422 421 local_irq_save(flags); 423 422 fixup_irqs(); 424 423 local_irq_restore(flags);
+1 -1
arch/mips/mm/Makefile
··· 4 4 5 5 obj-y += cache.o dma-default.o extable.o fault.o \ 6 6 gup.o init.o mmap.o page.o page-funcs.o \ 7 - tlbex.o tlbex-fault.o tlb-funcs.o 7 + pgtable.o tlbex.o tlbex-fault.o tlb-funcs.o 8 8 9 9 ifdef CONFIG_CPU_MICROMIPS 10 10 obj-y += uasm-micromips.o
+5 -1
arch/mips/mm/c-r4k.c
··· 1452 1452 switch (current_cpu_type()) { 1453 1453 case CPU_20KC: 1454 1454 case CPU_25KF: 1455 + case CPU_I6400: 1455 1456 case CPU_SB1: 1456 1457 case CPU_SB1A: 1457 1458 case CPU_XLR: ··· 1479 1478 case CPU_PROAPTIV: 1480 1479 case CPU_M5150: 1481 1480 case CPU_QEMU_GENERIC: 1482 - case CPU_I6400: 1483 1481 case CPU_P6600: 1484 1482 case CPU_M6250: 1485 1483 if (!(read_c0_config7() & MIPS_CONF7_IAR) && ··· 1496 1496 if (has_74k_erratum || c->dcache.waysize > PAGE_SIZE) 1497 1497 c->dcache.flags |= MIPS_CACHE_ALIASES; 1498 1498 } 1499 + 1500 + /* Physically indexed caches don't suffer from virtual aliasing */ 1501 + if (c->dcache.flags & MIPS_CACHE_PINDEX) 1502 + c->dcache.flags &= ~MIPS_CACHE_ALIASES; 1499 1503 1500 1504 switch (current_cpu_type()) { 1501 1505 case CPU_20KC:
+3
arch/mips/mm/init.c
··· 30 30 #include <linux/hardirq.h> 31 31 #include <linux/gfp.h> 32 32 #include <linux/kcore.h> 33 + #include <linux/export.h> 33 34 34 35 #include <asm/asm-offsets.h> 35 36 #include <asm/bootinfo.h> ··· 539 538 pgd_t swapper_pg_dir[_PTRS_PER_PGD] __section(.bss..swapper_pg_dir); 540 539 #ifndef __PAGETABLE_PMD_FOLDED 541 540 pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned_bss; 541 + EXPORT_SYMBOL_GPL(invalid_pmd_table); 542 542 #endif 543 543 pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss; 544 + EXPORT_SYMBOL(invalid_pte_table);
+5 -5
arch/mips/mm/mmap.c
··· 146 146 { 147 147 unsigned long rnd; 148 148 149 - rnd = get_random_long(); 150 - rnd <<= PAGE_SHIFT; 149 + #ifdef CONFIG_COMPAT 151 150 if (TASK_IS_32BIT_ADDR) 152 - rnd &= 0xfffffful; 151 + rnd = get_random_long() & ((1UL << mmap_rnd_compat_bits) - 1); 153 152 else 154 - rnd &= 0xffffffful; 153 + #endif /* CONFIG_COMPAT */ 154 + rnd = get_random_long() & ((1UL << mmap_rnd_bits) - 1); 155 155 156 - return rnd; 156 + return rnd << PAGE_SHIFT; 157 157 } 158 158 159 159 void arch_pick_mmap_layout(struct mm_struct *mm)
+3
arch/mips/mm/page-funcs.S
··· 9 9 * Copyright (C) 2012 Ralf Baechle <ralf@linux-mips.org> 10 10 */ 11 11 #include <asm/asm.h> 12 + #include <asm/export.h> 12 13 #include <asm/regdef.h> 13 14 14 15 #ifdef CONFIG_SIBYTE_DMA_PAGEOPS ··· 30 29 */ 31 30 EXPORT(__clear_page_start) 32 31 LEAF(cpu_clear_page_function_name) 32 + EXPORT_SYMBOL(cpu_clear_page_function_name) 33 33 1: j 1b /* Dummy, will be replaced. */ 34 34 .space 288 35 35 END(cpu_clear_page_function_name) ··· 46 44 */ 47 45 EXPORT(__copy_page_start) 48 46 LEAF(cpu_copy_page_function_name) 47 + EXPORT_SYMBOL(cpu_copy_page_function_name) 49 48 1: j 1b /* Dummy, will be replaced. */ 50 49 .space 1344 51 50 END(cpu_copy_page_function_name)
+2
arch/mips/mm/page.c
··· 661 661 ; 662 662 __raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); 663 663 } 664 + EXPORT_SYMBOL(clear_page); 664 665 665 666 void copy_page(void *to, void *from) 666 667 { ··· 688 687 ; 689 688 __raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); 690 689 } 690 + EXPORT_SYMBOL(copy_page); 691 691 692 692 #endif /* CONFIG_SIBYTE_DMA_PAGEOPS */
+2
arch/mips/mm/pgtable-64.c
··· 6 6 * Copyright (C) 1999, 2000 by Silicon Graphics 7 7 * Copyright (C) 2003 by Ralf Baechle 8 8 */ 9 + #include <linux/export.h> 9 10 #include <linux/init.h> 10 11 #include <linux/mm.h> 11 12 #include <asm/fixmap.h> ··· 61 60 p[-1] = pagetable; 62 61 } while (p != end); 63 62 } 63 + EXPORT_SYMBOL_GPL(pmd_init); 64 64 #endif 65 65 66 66 pmd_t mk_pmd(struct page *page, pgprot_t prot)
+25
arch/mips/mm/pgtable.c
··· 1 + /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + */ 6 + #include <linux/export.h> 7 + #include <linux/mm.h> 8 + #include <linux/string.h> 9 + #include <asm/pgalloc.h> 10 + 11 + pgd_t *pgd_alloc(struct mm_struct *mm) 12 + { 13 + pgd_t *ret, *init; 14 + 15 + ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); 16 + if (ret) { 17 + init = pgd_offset(&init_mm, 0UL); 18 + pgd_init((unsigned long)ret); 19 + memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, 20 + (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); 21 + } 22 + 23 + return ret; 24 + } 25 + EXPORT_SYMBOL_GPL(pgd_alloc);
+34 -20
arch/mips/mm/sc-ip22.c
··· 31 31 unsigned long tmp; 32 32 33 33 __asm__ __volatile__( 34 - ".set\tpush\t\t\t# indy_sc_wipe\n\t" 35 - ".set\tnoreorder\n\t" 36 - ".set\tmips3\n\t" 37 - ".set\tnoat\n\t" 38 - "mfc0\t%2, $12\n\t" 39 - "li\t$1, 0x80\t\t\t# Go 64 bit\n\t" 40 - "mtc0\t$1, $12\n\t" 41 - 42 - "dli\t$1, 0x9000000080000000\n\t" 43 - "or\t%0, $1\t\t\t# first line to flush\n\t" 44 - "or\t%1, $1\t\t\t# last line to flush\n\t" 45 - ".set\tat\n\t" 46 - 47 - "1:\tsw\t$0, 0(%0)\n\t" 48 - "bne\t%0, %1, 1b\n\t" 49 - " daddu\t%0, 32\n\t" 50 - 51 - "mtc0\t%2, $12\t\t\t# Back to 32 bit\n\t" 52 - "nop; nop; nop; nop;\n\t" 53 - ".set\tpop" 34 + " .set push # indy_sc_wipe \n" 35 + " .set noreorder \n" 36 + " .set mips3 \n" 37 + " .set noat \n" 38 + " mfc0 %2, $12 \n" 39 + " li $1, 0x80 # Go 64 bit \n" 40 + " mtc0 $1, $12 \n" 41 + " \n" 42 + " # \n" 43 + " # Open code a dli $1, 0x9000000080000000 \n" 44 + " # \n" 45 + " # Required because binutils 2.25 will happily accept \n" 46 + " # 64 bit instructions in .set mips3 mode but puke on \n" 47 + " # 64 bit constants when generating 32 bit ELF \n" 48 + " # \n" 49 + " lui $1,0x9000 \n" 50 + " dsll $1,$1,0x10 \n" 51 + " ori $1,$1,0x8000 \n" 52 + " dsll $1,$1,0x10 \n" 53 + " \n" 54 + " or %0, $1 # first line to flush \n" 55 + " or %1, $1 # last line to flush \n" 56 + " .set at \n" 57 + " \n" 58 + "1: sw $0, 0(%0) \n" 59 + " bne %0, %1, 1b \n" 60 + " daddu %0, 32 \n" 61 + " \n" 62 + " mtc0 %2, $12 # Back to 32 bit \n" 63 + " nop # pipeline hazard \n" 64 + " nop \n" 65 + " nop \n" 66 + " nop \n" 67 + " .set pop \n" 54 68 : "=r" (first), "=r" (last), "=&r" (tmp) 55 69 : "0" (first), "1" (last)); 56 70 }
+1
arch/mips/mm/sc-mips.c
··· 181 181 182 182 if (c->scache.linesz) { 183 183 c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; 184 + c->options |= MIPS_CPU_INCLUSIVE_CACHES; 184 185 return 1; 185 186 } 186 187
+23 -21
arch/mips/mm/tlbex.c
··· 22 22 */ 23 23 24 24 #include <linux/bug.h> 25 + #include <linux/export.h> 25 26 #include <linux/kernel.h> 26 27 #include <linux/types.h> 27 28 #include <linux/smp.h> ··· 35 34 #include <asm/war.h> 36 35 #include <asm/uasm.h> 37 36 #include <asm/setup.h> 37 + #include <asm/tlbex.h> 38 38 39 39 static int mips_xpa_disabled; 40 40 ··· 346 344 } 347 345 348 346 static int scratch_reg; 349 - static int pgd_reg; 347 + int pgd_reg; 348 + EXPORT_SYMBOL_GPL(pgd_reg); 350 349 enum vmalloc64_mode {not_refill, refill_scratch, refill_noscratch}; 351 350 352 351 static struct work_registers build_get_work_registers(u32 **p) ··· 499 496 } 500 497 } 501 498 502 - /* 503 - * Write random or indexed TLB entry, and care about the hazards from 504 - * the preceding mtc0 and for the following eret. 505 - */ 506 - enum tlb_write_entry { tlb_random, tlb_indexed }; 507 - 508 - static void build_tlb_write_entry(u32 **p, struct uasm_label **l, 509 - struct uasm_reloc **r, 510 - enum tlb_write_entry wmode) 499 + void build_tlb_write_entry(u32 **p, struct uasm_label **l, 500 + struct uasm_reloc **r, 501 + enum tlb_write_entry wmode) 511 502 { 512 503 void(*tlbw)(u32 **) = NULL; 513 504 ··· 624 627 break; 625 628 } 626 629 } 630 + EXPORT_SYMBOL_GPL(build_tlb_write_entry); 627 631 628 632 static __maybe_unused void build_convert_pte_to_entrylo(u32 **p, 629 633 unsigned int reg) ··· 779 781 * TMP and PTR are scratch. 780 782 * TMP will be clobbered, PTR will hold the pmd entry. 781 783 */ 782 - static void 783 - build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, 784 - unsigned int tmp, unsigned int ptr) 784 + void build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, 785 + unsigned int tmp, unsigned int ptr) 785 786 { 786 787 #ifndef CONFIG_MIPS_PGD_C0_CONTEXT 787 788 long pgdc = (long)pgd_current; ··· 856 859 uasm_i_daddu(p, ptr, ptr, tmp); /* add in pmd offset */ 857 860 #endif 858 861 } 862 + EXPORT_SYMBOL_GPL(build_get_pmde64); 859 863 860 864 /* 861 865 * BVADDR is the faulting address, PTR is scratch. ··· 932 934 * TMP and PTR are scratch. 933 935 * TMP will be clobbered, PTR will hold the pgd entry. 934 936 */ 935 - static void __maybe_unused 936 - build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) 937 + void build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) 937 938 { 938 939 if (pgd_reg != -1) { 939 940 /* pgd is in pgd_reg */ ··· 957 960 uasm_i_sll(p, tmp, tmp, PGD_T_LOG2); 958 961 uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ 959 962 } 963 + EXPORT_SYMBOL_GPL(build_get_pgde32); 960 964 961 965 #endif /* !CONFIG_64BIT */ 962 966 ··· 987 989 uasm_i_andi(p, ctx, ctx, mask); 988 990 } 989 991 990 - static void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) 992 + void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) 991 993 { 992 994 /* 993 995 * Bug workaround for the Nevada. It seems as if under certain ··· 1011 1013 build_adjust_context(p, tmp); 1012 1014 UASM_i_ADDU(p, ptr, ptr, tmp); /* add in offset */ 1013 1015 } 1016 + EXPORT_SYMBOL_GPL(build_get_ptep); 1014 1017 1015 - static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep) 1018 + void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep) 1016 1019 { 1017 1020 int pte_off_even = 0; 1018 1021 int pte_off_odd = sizeof(pte_t); ··· 1062 1063 UASM_i_MTC0(p, 0, C0_ENTRYLO1); 1063 1064 UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */ 1064 1065 } 1066 + EXPORT_SYMBOL_GPL(build_update_entries); 1065 1067 1066 1068 struct mips_huge_tlb_info { 1067 1069 int huge_pte; ··· 1536 1536 extern u32 handle_tlbl[], handle_tlbl_end[]; 1537 1537 extern u32 handle_tlbs[], handle_tlbs_end[]; 1538 1538 extern u32 handle_tlbm[], handle_tlbm_end[]; 1539 - extern u32 tlbmiss_handler_setup_pgd_start[], tlbmiss_handler_setup_pgd[]; 1539 + extern u32 tlbmiss_handler_setup_pgd_start[]; 1540 + extern u32 tlbmiss_handler_setup_pgd[]; 1541 + EXPORT_SYMBOL_GPL(tlbmiss_handler_setup_pgd); 1540 1542 extern u32 tlbmiss_handler_setup_pgd_end[]; 1541 1543 1542 1544 static void build_setup_pgd(void) ··· 2043 2041 2044 2042 static void build_r4000_tlb_load_handler(void) 2045 2043 { 2046 - u32 *p = handle_tlbl; 2044 + u32 *p = (u32 *)msk_isa16_mode((ulong)handle_tlbl); 2047 2045 const int handle_tlbl_size = handle_tlbl_end - handle_tlbl; 2048 2046 struct uasm_label *l = labels; 2049 2047 struct uasm_reloc *r = relocs; ··· 2226 2224 2227 2225 static void build_r4000_tlb_store_handler(void) 2228 2226 { 2229 - u32 *p = handle_tlbs; 2227 + u32 *p = (u32 *)msk_isa16_mode((ulong)handle_tlbs); 2230 2228 const int handle_tlbs_size = handle_tlbs_end - handle_tlbs; 2231 2229 struct uasm_label *l = labels; 2232 2230 struct uasm_reloc *r = relocs; ··· 2281 2279 2282 2280 static void build_r4000_tlb_modify_handler(void) 2283 2281 { 2284 - u32 *p = handle_tlbm; 2282 + u32 *p = (u32 *)msk_isa16_mode((ulong)handle_tlbm); 2285 2283 const int handle_tlbm_size = handle_tlbm_end - handle_tlbm; 2286 2284 struct uasm_label *l = labels; 2287 2285 struct uasm_reloc *r = relocs;
-1
arch/mips/mti-malta/malta-platform.c
··· 23 23 */ 24 24 #include <linux/init.h> 25 25 #include <linux/serial_8250.h> 26 - #include <linux/module.h> 27 26 #include <linux/irq.h> 28 27 #include <linux/platform_device.h> 29 28 #include <asm/mips-boards/maltaint.h>
+2 -2
arch/mips/netlogic/common/irq.c
··· 275 275 do_IRQ(nlm_irq_to_xirq(node, i)); 276 276 } 277 277 278 - #ifdef CONFIG_OF 278 + #ifdef CONFIG_CPU_XLP 279 279 static const struct irq_domain_ops xlp_pic_irq_domain_ops = { 280 280 .xlate = irq_domain_xlate_onetwocell, 281 281 }; ··· 348 348 #if defined(CONFIG_CPU_XLR) 349 349 nlm_setup_fmn_irq(); 350 350 #endif 351 - #if defined(CONFIG_OF) 351 + #ifdef CONFIG_CPU_XLP 352 352 of_irq_init(xlp_pic_irq_ids); 353 353 #endif 354 354 }
+2 -2
arch/mips/netlogic/common/smpboot.S
··· 59 59 sync 60 60 /* find the location to which nlm_boot_siblings was relocated */ 61 61 li t0, CKSEG1ADDR(RESET_VEC_PHYS) 62 - dla t1, nlm_reset_entry 63 - dla t2, nlm_boot_siblings 62 + PTR_LA t1, nlm_reset_entry 63 + PTR_LA t2, nlm_boot_siblings 64 64 dsubu t2, t1 65 65 daddu t2, t0 66 66 /* call it */
+1 -1
arch/mips/netlogic/xlp/wakeup.c
··· 197 197 } 198 198 } 199 199 200 - void xlp_wakeup_secondary_cpus() 200 + void xlp_wakeup_secondary_cpus(void) 201 201 { 202 202 /* 203 203 * In case of u-boot, the secondaries are in reset
+13 -27
arch/mips/oprofile/op_model_mipsxx.c
··· 15 15 16 16 #include "op_impl.h" 17 17 18 - #define M_PERFCTL_EXL (1UL << 0) 19 - #define M_PERFCTL_KERNEL (1UL << 1) 20 - #define M_PERFCTL_SUPERVISOR (1UL << 2) 21 - #define M_PERFCTL_USER (1UL << 3) 22 - #define M_PERFCTL_INTERRUPT_ENABLE (1UL << 4) 23 - #define M_PERFCTL_EVENT(event) (((event) & 0x3ff) << 5) 24 - #define M_PERFCTL_VPEID(vpe) ((vpe) << 16) 25 - #define M_PERFCTL_MT_EN(filter) ((filter) << 20) 26 - #define M_TC_EN_ALL M_PERFCTL_MT_EN(0) 27 - #define M_TC_EN_VPE M_PERFCTL_MT_EN(1) 28 - #define M_TC_EN_TC M_PERFCTL_MT_EN(2) 29 - #define M_PERFCTL_TCID(tcid) ((tcid) << 22) 30 - #define M_PERFCTL_WIDE (1UL << 30) 31 - #define M_PERFCTL_MORE (1UL << 31) 18 + #define M_PERFCTL_EVENT(event) (((event) << MIPS_PERFCTRL_EVENT_S) & \ 19 + MIPS_PERFCTRL_EVENT) 20 + #define M_PERFCTL_VPEID(vpe) ((vpe) << MIPS_PERFCTRL_VPEID_S) 32 21 33 22 #define M_COUNTER_OVERFLOW (1UL << 31) 34 - 35 - /* Netlogic XLR specific, count events in all threads in a core */ 36 - #define M_PERFCTL_COUNT_ALL_THREADS (1UL << 13) 37 23 38 24 static int (*save_perf_irq)(void); 39 25 static int perfcount_irq; ··· 37 51 38 52 #ifdef CONFIG_MIPS_MT_SMP 39 53 static int cpu_has_mipsmt_pertccounters; 40 - #define WHAT (M_TC_EN_VPE | \ 54 + #define WHAT (MIPS_PERFCTRL_MT_EN_VPE | \ 41 55 M_PERFCTL_VPEID(cpu_data[smp_processor_id()].vpe_id)) 42 56 #define vpe_id() (cpu_has_mipsmt_pertccounters ? \ 43 57 0 : cpu_data[smp_processor_id()].vpe_id) ··· 147 161 continue; 148 162 149 163 reg.control[i] = M_PERFCTL_EVENT(ctr[i].event) | 150 - M_PERFCTL_INTERRUPT_ENABLE; 164 + MIPS_PERFCTRL_IE; 151 165 if (ctr[i].kernel) 152 - reg.control[i] |= M_PERFCTL_KERNEL; 166 + reg.control[i] |= MIPS_PERFCTRL_K; 153 167 if (ctr[i].user) 154 - reg.control[i] |= M_PERFCTL_USER; 168 + reg.control[i] |= MIPS_PERFCTRL_U; 155 169 if (ctr[i].exl) 156 - reg.control[i] |= M_PERFCTL_EXL; 170 + reg.control[i] |= MIPS_PERFCTRL_EXL; 157 171 if (boot_cpu_type() == CPU_XLR) 158 - reg.control[i] |= M_PERFCTL_COUNT_ALL_THREADS; 172 + reg.control[i] |= XLR_PERFCTRL_ALLTHREADS; 159 173 reg.counter[i] = 0x80000000 - ctr[i].count; 160 174 } 161 175 } ··· 240 254 case n + 1: \ 241 255 control = r_c0_perfctrl ## n(); \ 242 256 counter = r_c0_perfcntr ## n(); \ 243 - if ((control & M_PERFCTL_INTERRUPT_ENABLE) && \ 257 + if ((control & MIPS_PERFCTRL_IE) && \ 244 258 (counter & M_COUNTER_OVERFLOW)) { \ 245 259 oprofile_add_sample(get_irq_regs(), n); \ 246 260 w_c0_perfcntr ## n(reg.counter[n]); \ ··· 259 273 { 260 274 if (!cpu_has_perf) 261 275 return 0; 262 - if (!(read_c0_perfctrl0() & M_PERFCTL_MORE)) 276 + if (!(read_c0_perfctrl0() & MIPS_PERFCTRL_M)) 263 277 return 1; 264 - if (!(read_c0_perfctrl1() & M_PERFCTL_MORE)) 278 + if (!(read_c0_perfctrl1() & MIPS_PERFCTRL_M)) 265 279 return 2; 266 - if (!(read_c0_perfctrl2() & M_PERFCTL_MORE)) 280 + if (!(read_c0_perfctrl2() & MIPS_PERFCTRL_M)) 267 281 return 3; 268 282 269 283 return 4;
+11 -11
arch/mips/pci/pci-tx4927.c
··· 21 21 { 22 22 int pciclk = 0; 23 23 24 - printk(KERN_INFO "PCIC --%s PCICLK:", 25 - (__raw_readq(&tx4927_ccfgptr->ccfg) & TX4927_CCFG_PCI66) ? 26 - " PCI66" : ""); 24 + pr_info("PCIC --%s PCICLK:", 25 + (__raw_readq(&tx4927_ccfgptr->ccfg) & TX4927_CCFG_PCI66) ? 26 + " PCI66" : ""); 27 27 if (__raw_readq(&tx4927_ccfgptr->pcfg) & TX4927_PCFG_PCICLKEN_ALL) { 28 28 u64 ccfg = __raw_readq(&tx4927_ccfgptr->ccfg); 29 29 switch ((unsigned long)ccfg & ··· 37 37 case TX4927_CCFG_PCIDIVMODE_6: 38 38 pciclk = txx9_cpu_clock / 6; break; 39 39 } 40 - printk("Internal(%u.%uMHz)", 41 - (pciclk + 50000) / 1000000, 42 - ((pciclk + 50000) / 100000) % 10); 40 + pr_cont("Internal(%u.%uMHz)", 41 + (pciclk + 50000) / 1000000, 42 + ((pciclk + 50000) / 100000) % 10); 43 43 } else { 44 - printk("External"); 44 + pr_cont("External"); 45 45 pciclk = -1; 46 46 } 47 - printk("\n"); 47 + pr_cont("\n"); 48 48 return pciclk; 49 49 } 50 50 ··· 74 74 } 75 75 tx4927_ccfg_change(TX4927_CCFG_PCIDIVMODE_MASK, 76 76 pcidivmode); 77 - printk(KERN_DEBUG "PCICLK: ccfg:%08lx\n", 78 - (unsigned long)__raw_readq(&tx4927_ccfgptr->ccfg)); 77 + pr_debug("PCICLK: ccfg:%08lx\n", 78 + (unsigned long)__raw_readq(&tx4927_ccfgptr->ccfg)); 79 79 } else 80 80 pciclk = -1; 81 81 return pciclk; ··· 87 87 tx4927_pcierr_interrupt, 88 88 0, "PCI error", 89 89 (void *)TX4927_PCIC_REG)) 90 - printk(KERN_WARNING "Failed to request irq for PCIERR\n"); 90 + pr_warn("Failed to request irq for PCIERR\n"); 91 91 }
+15 -15
arch/mips/pci/pci-tx4938.c
··· 21 21 { 22 22 int pciclk = 0; 23 23 24 - printk(KERN_INFO "PCIC --%s PCICLK:", 25 - (__raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCI66) ? 26 - " PCI66" : ""); 24 + pr_info("PCIC --%s PCICLK:", 25 + (__raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCI66) ? 26 + " PCI66" : ""); 27 27 if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_PCICLKEN_ALL) { 28 28 u64 ccfg = __raw_readq(&tx4938_ccfgptr->ccfg); 29 29 switch ((unsigned long)ccfg & ··· 45 45 case TX4938_CCFG_PCIDIVMODE_11: 46 46 pciclk = txx9_cpu_clock / 11; break; 47 47 } 48 - printk("Internal(%u.%uMHz)", 49 - (pciclk + 50000) / 1000000, 50 - ((pciclk + 50000) / 100000) % 10); 48 + pr_cont("Internal(%u.%uMHz)", 49 + (pciclk + 50000) / 1000000, 50 + ((pciclk + 50000) / 100000) % 10); 51 51 } else { 52 - printk("External"); 52 + pr_cont("External"); 53 53 pciclk = -1; 54 54 } 55 - printk("\n"); 55 + pr_cont("\n"); 56 56 return pciclk; 57 57 } 58 58 ··· 62 62 unsigned int pciclk = 63 63 txx9_gbus_clock / ((ccfg & TX4938_CCFG_PCI1DMD) ? 4 : 2); 64 64 65 - printk(KERN_INFO "PCIC1 -- %sPCICLK:%u.%uMHz\n", 66 - (ccfg & TX4938_CCFG_PCI1_66) ? "PCI66 " : "", 67 - (pciclk + 50000) / 1000000, 68 - ((pciclk + 50000) / 100000) % 10); 65 + pr_info("PCIC1 -- %sPCICLK:%u.%uMHz\n", 66 + (ccfg & TX4938_CCFG_PCI1_66) ? "PCI66 " : "", 67 + (pciclk + 50000) / 1000000, 68 + ((pciclk + 50000) / 100000) % 10); 69 69 } 70 70 71 71 int __init tx4938_pciclk66_setup(void) ··· 105 105 } 106 106 tx4938_ccfg_change(TX4938_CCFG_PCIDIVMODE_MASK, 107 107 pcidivmode); 108 - printk(KERN_DEBUG "PCICLK: ccfg:%08lx\n", 109 - (unsigned long)__raw_readq(&tx4938_ccfgptr->ccfg)); 108 + pr_debug("PCICLK: ccfg:%08lx\n", 109 + (unsigned long)__raw_readq(&tx4938_ccfgptr->ccfg)); 110 110 } else 111 111 pciclk = -1; 112 112 return pciclk; ··· 138 138 tx4927_pcierr_interrupt, 139 139 0, "PCI error", 140 140 (void *)TX4927_PCIC_REG)) 141 - printk(KERN_WARNING "Failed to request irq for PCIERR\n"); 141 + pr_warn("Failed to request irq for PCIERR\n"); 142 142 }
+5 -5
arch/mips/pci/pci-tx4939.c
··· 28 28 pciclk = txx9_master_clock * 20 / 6; 29 29 if (!(__raw_readq(&tx4939_ccfgptr->ccfg) & TX4939_CCFG_PCI66)) 30 30 pciclk /= 2; 31 - printk(KERN_CONT "Internal(%u.%uMHz)", 32 - (pciclk + 50000) / 1000000, 33 - ((pciclk + 50000) / 100000) % 10); 31 + pr_cont("Internal(%u.%uMHz)", 32 + (pciclk + 50000) / 1000000, 33 + ((pciclk + 50000) / 100000) % 10); 34 34 } else { 35 - printk(KERN_CONT "External"); 35 + pr_cont("External"); 36 36 pciclk = -1; 37 37 } 38 - printk(KERN_CONT "\n"); 38 + pr_cont("\n"); 39 39 return pciclk; 40 40 } 41 41
+2 -3
arch/mips/pic32/pic32mzda/Makefile
··· 2 2 # Joshua Henderson, <joshua.henderson@microchip.com> 3 3 # Copyright (C) 2015 Microchip Technology, Inc. All rights reserved. 4 4 # 5 - obj-y := init.o time.o config.o 5 + obj-y := config.o early_clk.o init.o time.o 6 6 7 7 obj-$(CONFIG_EARLY_PRINTK) += early_console.o \ 8 - early_pin.o \ 9 - early_clk.o 8 + early_pin.o
+1 -1
arch/mips/pmcs-msp71xx/msp_prom.c
··· 34 34 * 675 Mass Ave, Cambridge, MA 02139, USA. 35 35 */ 36 36 37 - #include <linux/module.h> 37 + #include <linux/export.h> 38 38 #include <linux/kernel.h> 39 39 #include <linux/init.h> 40 40 #include <linux/string.h>
-1
arch/mips/pmcs-msp71xx/msp_time.c
··· 26 26 #include <linux/kernel_stat.h> 27 27 #include <linux/sched.h> 28 28 #include <linux/spinlock.h> 29 - #include <linux/module.h> 30 29 #include <linux/ptrace.h> 31 30 32 31 #include <asm/cevt-r4k.h>
+1
arch/mips/ralink/Kconfig
··· 46 46 select SYS_SUPPORTS_MULTITHREADING 47 47 select SYS_SUPPORTS_SMP 48 48 select SYS_SUPPORTS_MIPS_CPS 49 + select SYS_SUPPORTS_HIGHMEM 49 50 select MIPS_GIC 50 51 select COMMON_CLK 51 52 select CLKSRC_MIPS_GIC
+8 -1
arch/mips/ralink/clk.c
··· 8 8 */ 9 9 10 10 #include <linux/kernel.h> 11 - #include <linux/module.h> 11 + #include <linux/init.h> 12 + #include <linux/export.h> 12 13 #include <linux/clkdev.h> 13 14 #include <linux/clk.h> 14 15 ··· 62 61 return -1; 63 62 } 64 63 EXPORT_SYMBOL_GPL(clk_set_rate); 64 + 65 + long clk_round_rate(struct clk *clk, unsigned long rate) 66 + { 67 + return -1; 68 + } 69 + EXPORT_SYMBOL_GPL(clk_round_rate); 65 70 66 71 void __init plat_time_init(void) 67 72 {
+2 -2
arch/mips/ralink/irq.c
··· 163 163 if (of_address_to_resource(node, 0, &res)) 164 164 panic("Failed to get intc memory range"); 165 165 166 - if (request_mem_region(res.start, resource_size(&res), 167 - res.name) < 0) 166 + if (!request_mem_region(res.start, resource_size(&res), 167 + res.name)) 168 168 pr_err("Failed to request intc memory"); 169 169 170 170 rt_intc_membase = ioremap_nocache(res.start,
+20 -12
arch/mips/ralink/mt7620.c
··· 12 12 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> 15 - #include <linux/module.h> 16 15 17 16 #include <asm/mipsregs.h> 18 17 #include <asm/mach-ralink/ralink_regs.h> ··· 54 55 static struct rt2880_pmx_func i2c_grp[] = { FUNC("i2c", 0, 1, 2) }; 55 56 static struct rt2880_pmx_func spi_grp[] = { FUNC("spi", 0, 3, 4) }; 56 57 static struct rt2880_pmx_func uartlite_grp[] = { FUNC("uartlite", 0, 15, 2) }; 57 - static struct rt2880_pmx_func mdio_grp[] = { FUNC("mdio", 0, 22, 2) }; 58 + static struct rt2880_pmx_func mdio_grp[] = { 59 + FUNC("mdio", MT7620_GPIO_MODE_MDIO, 22, 2), 60 + FUNC("refclk", MT7620_GPIO_MODE_MDIO_REFCLK, 22, 2), 61 + }; 58 62 static struct rt2880_pmx_func rgmii1_grp[] = { FUNC("rgmii1", 0, 24, 12) }; 59 63 static struct rt2880_pmx_func refclk_grp[] = { FUNC("spi refclk", 0, 37, 3) }; 60 64 static struct rt2880_pmx_func ephy_grp[] = { FUNC("ephy", 0, 40, 5) }; ··· 94 92 GRP("uartlite", uartlite_grp, 1, MT7620_GPIO_MODE_UART1), 95 93 GRP_G("wdt", wdt_grp, MT7620_GPIO_MODE_WDT_MASK, 96 94 MT7620_GPIO_MODE_WDT_GPIO, MT7620_GPIO_MODE_WDT_SHIFT), 97 - GRP("mdio", mdio_grp, 1, MT7620_GPIO_MODE_MDIO), 95 + GRP_G("mdio", mdio_grp, MT7620_GPIO_MODE_MDIO_MASK, 96 + MT7620_GPIO_MODE_MDIO_GPIO, MT7620_GPIO_MODE_MDIO_SHIFT), 98 97 GRP("rgmii1", rgmii1_grp, 1, MT7620_GPIO_MODE_RGMII1), 99 98 GRP("spi refclk", refclk_grp, 1, MT7620_GPIO_MODE_SPI_REF_CLK), 100 99 GRP_G("pcie", pcie_rst_grp, MT7620_GPIO_MODE_PCIE_MASK, ··· 179 176 180 177 static struct rt2880_pmx_func spis_grp_mt7628[] = { 181 178 FUNC("pwm_uart2", 3, 14, 4), 182 - FUNC("util", 2, 14, 4), 179 + FUNC("utif", 2, 14, 4), 183 180 FUNC("gpio", 1, 14, 4), 184 181 FUNC("spis", 0, 14, 4), 185 182 }; ··· 193 190 194 191 static struct rt2880_pmx_func p4led_kn_grp_mt7628[] = { 195 192 FUNC("jtag", 3, 30, 1), 196 - FUNC("util", 2, 30, 1), 193 + FUNC("utif", 2, 30, 1), 197 194 FUNC("gpio", 1, 30, 1), 198 195 FUNC("p4led_kn", 0, 30, 1), 199 196 }; 200 197 201 198 static struct rt2880_pmx_func p3led_kn_grp_mt7628[] = { 202 199 FUNC("jtag", 3, 31, 1), 203 - FUNC("util", 2, 31, 1), 200 + FUNC("utif", 2, 31, 1), 204 201 FUNC("gpio", 1, 31, 1), 205 202 FUNC("p3led_kn", 0, 31, 1), 206 203 }; 207 204 208 205 static struct rt2880_pmx_func p2led_kn_grp_mt7628[] = { 209 206 FUNC("jtag", 3, 32, 1), 210 - FUNC("util", 2, 32, 1), 207 + FUNC("utif", 2, 32, 1), 211 208 FUNC("gpio", 1, 32, 1), 212 209 FUNC("p2led_kn", 0, 32, 1), 213 210 }; 214 211 215 212 static struct rt2880_pmx_func p1led_kn_grp_mt7628[] = { 216 213 FUNC("jtag", 3, 33, 1), 217 - FUNC("util", 2, 33, 1), 214 + FUNC("utif", 2, 33, 1), 218 215 FUNC("gpio", 1, 33, 1), 219 216 FUNC("p1led_kn", 0, 33, 1), 220 217 }; ··· 235 232 236 233 static struct rt2880_pmx_func p4led_an_grp_mt7628[] = { 237 234 FUNC("jtag", 3, 39, 1), 238 - FUNC("util", 2, 39, 1), 235 + FUNC("utif", 2, 39, 1), 239 236 FUNC("gpio", 1, 39, 1), 240 237 FUNC("p4led_an", 0, 39, 1), 241 238 }; 242 239 243 240 static struct rt2880_pmx_func p3led_an_grp_mt7628[] = { 244 241 FUNC("jtag", 3, 40, 1), 245 - FUNC("util", 2, 40, 1), 242 + FUNC("utif", 2, 40, 1), 246 243 FUNC("gpio", 1, 40, 1), 247 244 FUNC("p3led_an", 0, 40, 1), 248 245 }; 249 246 250 247 static struct rt2880_pmx_func p2led_an_grp_mt7628[] = { 251 248 FUNC("jtag", 3, 41, 1), 252 - FUNC("util", 2, 41, 1), 249 + FUNC("utif", 2, 41, 1), 253 250 FUNC("gpio", 1, 41, 1), 254 251 FUNC("p2led_an", 0, 41, 1), 255 252 }; 256 253 257 254 static struct rt2880_pmx_func p1led_an_grp_mt7628[] = { 258 255 FUNC("jtag", 3, 42, 1), 259 - FUNC("util", 2, 42, 1), 256 + FUNC("utif", 2, 42, 1), 260 257 FUNC("gpio", 1, 42, 1), 261 258 FUNC("p1led_an", 0, 42, 1), 262 259 }; ··· 512 509 unsigned long sys_rate; 513 510 unsigned long dram_rate; 514 511 unsigned long periph_rate; 512 + unsigned long pcmi2s_rate; 515 513 516 514 xtal_rate = mt7620_get_xtal_rate(); 517 515 ··· 527 523 cpu_rate = MHZ(575); 528 524 dram_rate = sys_rate = cpu_rate / 3; 529 525 periph_rate = MHZ(40); 526 + pcmi2s_rate = MHZ(480); 530 527 531 528 ralink_clk_add("10000d00.uartlite", periph_rate); 532 529 ralink_clk_add("10000e00.uartlite", periph_rate); ··· 539 534 dram_rate = mt7620_get_dram_rate(pll_rate); 540 535 sys_rate = mt7620_get_sys_rate(cpu_rate); 541 536 periph_rate = mt7620_get_periph_rate(xtal_rate); 537 + pcmi2s_rate = periph_rate; 542 538 543 539 pr_debug(RFMT("XTAL") RFMT("CPU_PLL") RFMT("PLL"), 544 540 RINT(xtal_rate), RFRAC(xtal_rate), ··· 561 555 ralink_clk_add("cpu", cpu_rate); 562 556 ralink_clk_add("10000100.timer", periph_rate); 563 557 ralink_clk_add("10000120.watchdog", periph_rate); 558 + ralink_clk_add("10000900.i2c", periph_rate); 559 + ralink_clk_add("10000a00.i2s", pcmi2s_rate); 564 560 ralink_clk_add("10000b00.spi", sys_rate); 565 561 ralink_clk_add("10000b40.spi", sys_rate); 566 562 ralink_clk_add("10000c00.uartlite", periph_rate);
+1 -2
arch/mips/ralink/mt7621.c
··· 9 9 10 10 #include <linux/kernel.h> 11 11 #include <linux/init.h> 12 - #include <linux/module.h> 13 12 14 13 #include <asm/mipsregs.h> 15 14 #include <asm/smp-ops.h> ··· 180 181 } else { 181 182 panic("mt7621: unknown SoC, n0:%08x n1:%08x\n", n0, n1); 182 183 } 183 - 184 + ralink_soc = MT762X_SOC_MT7621AT; 184 185 rev = __raw_readl(sysc + SYSC_REG_CHIP_REV); 185 186 186 187 snprintf(soc_info->sys_type, RAMIPS_SYS_TYPE_LEN,
+12 -4
arch/mips/ralink/of.c
··· 40 40 if (of_address_to_resource(np, 0, &res)) 41 41 panic("Failed to get resource for %s", node); 42 42 43 - if ((request_mem_region(res.start, 43 + if (!request_mem_region(res.start, 44 44 resource_size(&res), 45 - res.name) < 0)) 45 + res.name)) 46 46 panic("Failed to request resources for %s", node); 47 47 48 48 return ioremap_nocache(res.start, resource_size(&res)); ··· 66 66 67 67 void __init plat_mem_setup(void) 68 68 { 69 + void *dtb = NULL; 70 + 69 71 set_io_port_base(KSEG1); 70 72 71 73 /* 72 74 * Load the builtin devicetree. This causes the chosen node to be 73 - * parsed resulting in our memory appearing 75 + * parsed resulting in our memory appearing. fw_passed_dtb is used 76 + * by CONFIG_MIPS_APPENDED_RAW_DTB as well. 74 77 */ 75 - __dt_setup_arch(__dtb_start); 78 + if (fw_passed_dtb) 79 + dtb = (void *)fw_passed_dtb; 80 + else if (__dtb_start != __dtb_end) 81 + dtb = (void *)__dtb_start; 82 + 83 + __dt_setup_arch(dtb); 76 84 77 85 of_scan_flat_dt(early_init_dt_find_memory, NULL); 78 86 if (memory_dtb)
+4 -5
arch/mips/ralink/prom.c
··· 30 30 return soc_info.sys_type; 31 31 } 32 32 33 - static __init void prom_init_cmdline(int argc, char **argv) 33 + static __init void prom_init_cmdline(void) 34 34 { 35 + int argc; 36 + char **argv; 35 37 int i; 36 38 37 39 pr_debug("prom: fw_arg0=%08x fw_arg1=%08x fw_arg2=%08x fw_arg3=%08x\n", ··· 62 60 63 61 void __init prom_init(void) 64 62 { 65 - int argc; 66 - char **argv; 67 - 68 63 prom_soc_init(&soc_info); 69 64 70 65 pr_info("SoC Type: %s\n", get_system_type()); 71 66 72 - prom_init_cmdline(argc, argv); 67 + prom_init_cmdline(); 73 68 } 74 69 75 70 void __init prom_free_prom_memory(void)
+1 -11
arch/mips/ralink/rt288x.c
··· 12 12 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> 15 - #include <linux/module.h> 16 15 17 16 #include <asm/mipsregs.h> 18 17 #include <asm/mach-ralink/ralink_regs.h> ··· 39 40 { 0 } 40 41 }; 41 42 42 - static void rt288x_wdt_reset(void) 43 - { 44 - u32 t; 45 - 46 - /* enable WDT reset output on pin SRAM_CS_N */ 47 - t = rt_sysc_r32(SYSC_REG_CLKCFG); 48 - t |= CLKCFG_SRAM_CS_N_WDT; 49 - rt_sysc_w32(t, SYSC_REG_CLKCFG); 50 - } 51 - 52 43 void __init ralink_clk_init(void) 53 44 { 54 45 unsigned long cpu_rate, wmac_rate = 40000000; ··· 64 75 ralink_clk_add("300100.timer", cpu_rate / 2); 65 76 ralink_clk_add("300120.watchdog", cpu_rate / 2); 66 77 ralink_clk_add("300500.uart", cpu_rate / 2); 78 + ralink_clk_add("300900.i2c", cpu_rate / 2); 67 79 ralink_clk_add("300c00.uartlite", cpu_rate / 2); 68 80 ralink_clk_add("400000.ethernet", cpu_rate / 2); 69 81 ralink_clk_add("480000.wmac", wmac_rate);
+4 -12
arch/mips/ralink/rt305x.c
··· 12 12 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> 15 - #include <linux/module.h> 15 + #include <linux/bug.h> 16 16 17 + #include <asm/io.h> 17 18 #include <asm/mipsregs.h> 18 19 #include <asm/mach-ralink/ralink_regs.h> 19 20 #include <asm/mach-ralink/rt305x.h> ··· 89 88 GRP("spi_cs1", rt5350_cs1_func, 2, RT5350_GPIO_MODE_SPI_CS1), 90 89 { 0 } 91 90 }; 92 - 93 - static void rt305x_wdt_reset(void) 94 - { 95 - u32 t; 96 - 97 - /* enable WDT reset output on pin SRAM_CS_N */ 98 - t = rt_sysc_r32(SYSC_REG_SYSTEM_CONFIG); 99 - t |= RT305X_SYSCFG_SRAM_CS0_MODE_WDT << 100 - RT305X_SYSCFG_SRAM_CS0_MODE_SHIFT; 101 - rt_sysc_w32(t, SYSC_REG_SYSTEM_CONFIG); 102 - } 103 91 104 92 static unsigned long rt5350_get_mem_size(void) 105 93 { ··· 190 200 191 201 ralink_clk_add("cpu", cpu_rate); 192 202 ralink_clk_add("sys", sys_rate); 203 + ralink_clk_add("10000900.i2c", uart_rate); 204 + ralink_clk_add("10000a00.i2s", uart_rate); 193 205 ralink_clk_add("10000b00.spi", sys_rate); 194 206 ralink_clk_add("10000b40.spi", sys_rate); 195 207 ralink_clk_add("10000100.timer", wdt_rate);
+3 -12
arch/mips/ralink/rt3883.c
··· 12 12 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> 15 - #include <linux/module.h> 16 15 17 16 #include <asm/mipsregs.h> 18 17 #include <asm/mach-ralink/ralink_regs.h> ··· 62 63 { 0 } 63 64 }; 64 65 65 - static void rt3883_wdt_reset(void) 66 - { 67 - u32 t; 68 - 69 - /* enable WDT reset output on GPIO 2 */ 70 - t = rt_sysc_r32(RT3883_SYSC_REG_SYSCFG1); 71 - t |= RT3883_SYSCFG1_GPIO2_AS_WDT_OUT; 72 - rt_sysc_w32(t, RT3883_SYSC_REG_SYSCFG1); 73 - } 74 - 75 66 void __init ralink_clk_init(void) 76 67 { 77 68 unsigned long cpu_rate, sys_rate; ··· 97 108 ralink_clk_add("10000100.timer", sys_rate); 98 109 ralink_clk_add("10000120.watchdog", sys_rate); 99 110 ralink_clk_add("10000500.uart", 40000000); 111 + ralink_clk_add("10000900.i2c", 40000000); 112 + ralink_clk_add("10000a00.i2s", 40000000); 100 113 ralink_clk_add("10000b00.spi", sys_rate); 101 114 ralink_clk_add("10000b40.spi", sys_rate); 102 115 ralink_clk_add("10000c00.uartlite", 40000000); ··· 146 155 147 156 rt2880_pinmux_data = rt3883_pinmux_data; 148 157 149 - ralink_soc == RT3883_SOC; 158 + ralink_soc = RT3883_SOC; 150 159 }
-14
arch/mips/ralink/timer.c
··· 71 71 return err; 72 72 } 73 73 74 - static void rt_timer_free(struct rt_timer *rt) 75 - { 76 - free_irq(rt->irq, rt); 77 - } 78 - 79 74 static int rt_timer_config(struct rt_timer *rt, unsigned long divisor) 80 75 { 81 76 if (rt->timer_freq < divisor) ··· 94 99 rt_timer_w32(rt, TIMER_REG_TMR0CTL, t); 95 100 96 101 return 0; 97 - } 98 - 99 - static void rt_timer_disable(struct rt_timer *rt) 100 - { 101 - u32 t; 102 - 103 - t = rt_timer_r32(rt, TIMER_REG_TMR0CTL); 104 - t &= ~TMR0CTL_ENABLE; 105 - rt_timer_w32(rt, TIMER_REG_TMR0CTL, t); 106 102 } 107 103 108 104 static int rt_timer_probe(struct platform_device *pdev)
-1
arch/mips/rb532/irq.c
··· 29 29 #include <linux/init.h> 30 30 #include <linux/io.h> 31 31 #include <linux/kernel_stat.h> 32 - #include <linux/module.h> 33 32 #include <linux/signal.h> 34 33 #include <linux/sched.h> 35 34 #include <linux/types.h>
+1 -1
arch/mips/rb532/prom.c
··· 26 26 27 27 #include <linux/init.h> 28 28 #include <linux/mm.h> 29 - #include <linux/module.h> 29 + #include <linux/export.h> 30 30 #include <linux/string.h> 31 31 #include <linux/console.h> 32 32 #include <linux/bootmem.h>
+1 -1
arch/mips/sgi-ip22/Platform
··· 25 25 # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys 26 26 # 27 27 ifdef CONFIG_SGI_IP28 28 - ifeq ($(call cc-option-yn,-mr10k-cache-barrier=store), n) 28 + ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n) 29 29 $(error gcc doesn't support needed option -mr10k-cache-barrier=store) 30 30 endif 31 31 endif
+1 -1
arch/mips/sgi-ip22/ip22-hpc.c
··· 5 5 * Copyright (C) 1998 Ralf Baechle 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/init.h> 9 - #include <linux/module.h> 10 10 #include <linux/types.h> 11 11 12 12 #include <asm/io.h>
+2 -1
arch/mips/sgi-ip22/ip22-mc.c
··· 8 8 */ 9 9 10 10 #include <linux/init.h> 11 - #include <linux/module.h> 11 + #include <linux/export.h> 12 12 #include <linux/kernel.h> 13 + #include <linux/spinlock.h> 13 14 14 15 #include <asm/io.h> 15 16 #include <asm/bootinfo.h>
+1 -1
arch/mips/sgi-ip22/ip22-nvram.c
··· 3 3 * 4 4 * Copyright (C) 2003 Ladislav Michl (ladis@linux-mips.org) 5 5 */ 6 - #include <linux/module.h> 6 + #include <linux/export.h> 7 7 8 8 #include <asm/sgi/hpc3.h> 9 9 #include <asm/sgi/ip22.h>
-1
arch/mips/sgi-ip22/ip22-reset.c
··· 8 8 #include <linux/linkage.h> 9 9 #include <linux/init.h> 10 10 #include <linux/rtc/ds1286.h> 11 - #include <linux/module.h> 12 11 #include <linux/interrupt.h> 13 12 #include <linux/kernel.h> 14 13 #include <linux/sched.h>
-1
arch/mips/sgi-ip22/ip22-setup.c
··· 8 8 #include <linux/kernel.h> 9 9 #include <linux/kdev_t.h> 10 10 #include <linux/types.h> 11 - #include <linux/module.h> 12 11 #include <linux/console.h> 13 12 #include <linux/sched.h> 14 13 #include <linux/tty.h>
-2
arch/mips/sgi-ip27/ip27-berr.c
··· 9 9 */ 10 10 #include <linux/init.h> 11 11 #include <linux/kernel.h> 12 - #include <linux/module.h> 13 12 #include <linux/signal.h> /* for SIGBUS */ 14 13 #include <linux/sched.h> /* schow_regs(), force_sig() */ 15 14 16 - #include <asm/module.h> 17 15 #include <asm/sn/addrs.h> 18 16 #include <asm/sn/arch.h> 19 17 #include <asm/sn/sn0/hub.h>
+1 -1
arch/mips/sgi-ip27/ip27-init.c
··· 11 11 #include <linux/sched.h> 12 12 #include <linux/smp.h> 13 13 #include <linux/mm.h> 14 - #include <linux/module.h> 14 + #include <linux/export.h> 15 15 #include <linux/cpumask.h> 16 16 #include <asm/cpu.h> 17 17 #include <asm/io.h>
+1 -1
arch/mips/sgi-ip27/ip27-klnuma.c
··· 82 82 memcpy((void *)dest_kern_start, (void *)source_start, kern_size); 83 83 } 84 84 85 - void __init replicate_kernel_text() 85 + void __init replicate_kernel_text(void) 86 86 { 87 87 cnodeid_t cnode; 88 88 nasid_t client_nasid;
+1 -1
arch/mips/sgi-ip27/ip27-memory.c
··· 15 15 #include <linux/memblock.h> 16 16 #include <linux/mm.h> 17 17 #include <linux/mmzone.h> 18 - #include <linux/module.h> 18 + #include <linux/export.h> 19 19 #include <linux/nodemask.h> 20 20 #include <linux/swap.h> 21 21 #include <linux/bootmem.h>
+1 -1
arch/mips/sgi-ip32/crime.c
··· 10 10 #include <linux/init.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/interrupt.h> 13 - #include <linux/module.h> 13 + #include <linux/export.h> 14 14 #include <asm/bootinfo.h> 15 15 #include <asm/io.h> 16 16 #include <asm/mipsregs.h>
+2 -2
arch/mips/sgi-ip32/ip32-irq.c
··· 28 28 #include <asm/ip32/ip32_ints.h> 29 29 30 30 /* issue a PIO read to make sure no PIO writes are pending */ 31 - static void inline flush_crime_bus(void) 31 + static inline void flush_crime_bus(void) 32 32 { 33 33 crime->control; 34 34 } 35 35 36 - static void inline flush_mace_bus(void) 36 + static inline void flush_mace_bus(void) 37 37 { 38 38 mace->perif.ctrl.misc; 39 39 }
+1 -1
arch/mips/sibyte/bcm1480/setup.c
··· 17 17 */ 18 18 #include <linux/init.h> 19 19 #include <linux/kernel.h> 20 - #include <linux/module.h> 20 + #include <linux/export.h> 21 21 #include <linux/reboot.h> 22 22 #include <linux/string.h> 23 23
+1 -1
arch/mips/sibyte/sb1250/setup.c
··· 15 15 * along with this program; if not, write to the Free Software 16 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 17 */ 18 + #include <linux/export.h> 18 19 #include <linux/init.h> 19 - #include <linux/module.h> 20 20 #include <linux/kernel.h> 21 21 #include <linux/reboot.h> 22 22 #include <linux/string.h>
+2 -2
arch/mips/txx9/generic/7segled.c
··· 55 55 return size; 56 56 } 57 57 58 - static DEVICE_ATTR(ascii, 0200, NULL, ascii_store); 59 - static DEVICE_ATTR(raw, 0200, NULL, raw_store); 58 + static DEVICE_ATTR_WO(ascii); 59 + static DEVICE_ATTR_WO(raw); 60 60 61 61 static ssize_t map_seg7_show(struct device *dev, 62 62 struct device_attribute *attr,
+13 -15
arch/mips/txx9/generic/pci.c
··· 55 55 /* It seems SLC90E66 needs some time after PCI reset... */ 56 56 mdelay(80); 57 57 58 - printk(KERN_INFO "PCI: Checking 66MHz capabilities...\n"); 58 + pr_info("PCI: Checking 66MHz capabilities...\n"); 59 59 60 60 for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) { 61 61 if (PCI_FUNC(pci_devfn)) ··· 74 74 early_read_config_word(hose, top_bus, current_bus, 75 75 pci_devfn, PCI_STATUS, &stat); 76 76 if (!(stat & PCI_STATUS_66MHZ)) { 77 - printk(KERN_DEBUG 78 - "PCI: %02x:%02x not 66MHz capable.\n", 79 - current_bus, pci_devfn); 77 + pr_debug("PCI: %02x:%02x not 66MHz capable.\n", 78 + current_bus, pci_devfn); 80 79 cap66 = 0; 81 80 break; 82 81 } ··· 208 209 209 210 pcic->mem_offset = 0; /* busaddr == physaddr */ 210 211 211 - printk(KERN_INFO "PCI: IO %pR MEM %pR\n", 212 - &pcic->mem_resource[1], &pcic->mem_resource[0]); 212 + pr_info("PCI: IO %pR MEM %pR\n", &pcic->mem_resource[1], 213 + &pcic->mem_resource[0]); 213 214 214 215 /* register_pci_controller() will request MEM resource */ 215 216 release_resource(&pcic->mem_resource[0]); ··· 218 219 release_resource(&pcic->mem_resource[0]); 219 220 free_and_exit: 220 221 kfree(new); 221 - printk(KERN_ERR "PCI: Failed to allocate resources.\n"); 222 + pr_err("PCI: Failed to allocate resources.\n"); 222 223 return NULL; 223 224 } 224 225 ··· 259 260 err = request_irq(irq, &i8259_interrupt, IRQF_SHARED, 260 261 "cascade(i8259)", (void *)(long)irq); 261 262 if (!err) 262 - printk(KERN_INFO "PCI-ISA bridge PIC (irq %d)\n", irq); 263 + pr_info("PCI-ISA bridge PIC (irq %d)\n", irq); 263 264 return err; 264 265 } 265 266 ··· 307 308 /* SMSC SLC90E66 IDE uses irq 14, 15 (default) */ 308 309 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 14); 309 310 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &dat); 310 - printk(KERN_INFO "PCI: %s: IRQ %02x", pci_name(dev), dat); 311 + pr_info("PCI: %s: IRQ %02x", pci_name(dev), dat); 311 312 /* enable SMSC SLC90E66 IDE */ 312 313 for (i = 0; i < ARRAY_SIZE(regs); i++) { 313 314 pci_read_config_byte(dev, regs[i], &dat); 314 315 pci_write_config_byte(dev, regs[i], dat | 0x80); 315 316 pci_read_config_byte(dev, regs[i], &dat); 316 - printk(KERN_CONT " IDETIM%d %02x", i, dat); 317 + pr_cont(" IDETIM%d %02x", i, dat); 317 318 } 318 319 pci_read_config_byte(dev, 0x5c, &dat); 319 320 /* ··· 328 329 dat |= 0x01; 329 330 pci_write_config_byte(dev, 0x5c, dat); 330 331 pci_read_config_byte(dev, 0x5c, &dat); 331 - printk(KERN_CONT " REG5C %02x", dat); 332 - printk(KERN_CONT "\n"); 332 + pr_cont(" REG5C %02x\n", dat); 333 333 } 334 334 #endif /* CONFIG_TOSHIBA_FPCIB0 */ 335 335 ··· 350 352 (bist & PCI_BIST_CAPABLE)) { 351 353 unsigned long timeout; 352 354 pci_set_power_state(dev, PCI_D0); 353 - printk(KERN_INFO "PCI: %s BIST...", pci_name(dev)); 355 + pr_info("PCI: %s BIST...", pci_name(dev)); 354 356 pci_write_config_byte(dev, PCI_BIST, PCI_BIST_START); 355 357 timeout = jiffies + HZ * 2; /* timeout after 2 sec */ 356 358 do { ··· 359 361 break; 360 362 } while (bist & PCI_BIST_START); 361 363 if (bist & (PCI_BIST_CODE_MASK | PCI_BIST_START)) 362 - printk(KERN_CONT "failed. (0x%x)\n", bist); 364 + pr_cont("failed. (0x%x)\n", bist); 363 365 else 364 - printk(KERN_CONT "OK.\n"); 366 + pr_cont("OK.\n"); 365 367 } 366 368 } 367 369
+1 -1
arch/mips/txx9/generic/setup.c
··· 14 14 #include <linux/types.h> 15 15 #include <linux/interrupt.h> 16 16 #include <linux/string.h> 17 - #include <linux/module.h> 17 + #include <linux/export.h> 18 18 #include <linux/clk-provider.h> 19 19 #include <linux/clkdev.h> 20 20 #include <linux/err.h>
+3 -3
arch/mips/txx9/generic/setup_tx3927.c
··· 67 67 /* do reset on watchdog */ 68 68 tx3927_ccfgptr->ccfg |= TX3927_CCFG_WR; 69 69 70 - printk(KERN_INFO "TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n", 71 - tx3927_ccfgptr->crir, 72 - tx3927_ccfgptr->ccfg, tx3927_ccfgptr->pcfg); 70 + pr_info("TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n", 71 + tx3927_ccfgptr->crir, tx3927_ccfgptr->ccfg, 72 + tx3927_ccfgptr->pcfg); 73 73 74 74 /* TMR */ 75 75 for (i = 0; i < TX3927_NR_TMR; i++)
+9 -11
arch/mips/txx9/generic/setup_tx4927.c
··· 183 183 if (!(____raw_readq(&tx4927_ccfgptr->ccfg) & TX4927_CCFG_PCIARB)) 184 184 txx9_clear64(&tx4927_ccfgptr->pcfg, TX4927_PCFG_PCICLKEN_ALL); 185 185 186 - printk(KERN_INFO "%s -- %dMHz(M%dMHz) CRIR:%08x CCFG:%llx PCFG:%llx\n", 187 - txx9_pcode_str, 188 - (cpuclk + 500000) / 1000000, 189 - (txx9_master_clock + 500000) / 1000000, 190 - (__u32)____raw_readq(&tx4927_ccfgptr->crir), 191 - (unsigned long long)____raw_readq(&tx4927_ccfgptr->ccfg), 192 - (unsigned long long)____raw_readq(&tx4927_ccfgptr->pcfg)); 186 + pr_info("%s -- %dMHz(M%dMHz) CRIR:%08x CCFG:%llx PCFG:%llx\n", 187 + txx9_pcode_str, (cpuclk + 500000) / 1000000, 188 + (txx9_master_clock + 500000) / 1000000, 189 + (__u32)____raw_readq(&tx4927_ccfgptr->crir), 190 + ____raw_readq(&tx4927_ccfgptr->ccfg), 191 + ____raw_readq(&tx4927_ccfgptr->pcfg)); 193 192 194 - printk(KERN_INFO "%s SDRAMC --", txx9_pcode_str); 193 + pr_info("%s SDRAMC --", txx9_pcode_str); 195 194 for (i = 0; i < 4; i++) { 196 195 __u64 cr = TX4927_SDRAMC_CR(i); 197 196 unsigned long base, size; ··· 198 199 continue; /* disabled */ 199 200 base = (unsigned long)(cr >> 49) << 21; 200 201 size = (((unsigned long)(cr >> 33) & 0x7fff) + 1) << 21; 201 - printk(" CR%d:%016llx", i, (unsigned long long)cr); 202 + pr_cont(" CR%d:%016llx", i, cr); 202 203 tx4927_sdram_resource[i].name = "SDRAM"; 203 204 tx4927_sdram_resource[i].start = base; 204 205 tx4927_sdram_resource[i].end = base + size - 1; 205 206 tx4927_sdram_resource[i].flags = IORESOURCE_MEM; 206 207 request_resource(&iomem_resource, &tx4927_sdram_resource[i]); 207 208 } 208 - printk(" TR:%09llx\n", 209 - (unsigned long long)____raw_readq(&tx4927_sdramcptr->tr)); 209 + pr_cont(" TR:%09llx\n", ____raw_readq(&tx4927_sdramcptr->tr)); 210 210 211 211 /* TMR */ 212 212 /* disable all timers */
+12 -14
arch/mips/txx9/generic/setup_tx4938.c
··· 196 196 if (!(____raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCIARB)) 197 197 txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_PCICLKEN_ALL); 198 198 199 - printk(KERN_INFO "%s -- %dMHz(M%dMHz) CRIR:%08x CCFG:%llx PCFG:%llx\n", 200 - txx9_pcode_str, 201 - (cpuclk + 500000) / 1000000, 202 - (txx9_master_clock + 500000) / 1000000, 203 - (__u32)____raw_readq(&tx4938_ccfgptr->crir), 204 - (unsigned long long)____raw_readq(&tx4938_ccfgptr->ccfg), 205 - (unsigned long long)____raw_readq(&tx4938_ccfgptr->pcfg)); 199 + pr_info("%s -- %dMHz(M%dMHz) CRIR:%08x CCFG:%llx PCFG:%llx\n", 200 + txx9_pcode_str, (cpuclk + 500000) / 1000000, 201 + (txx9_master_clock + 500000) / 1000000, 202 + (__u32)____raw_readq(&tx4938_ccfgptr->crir), 203 + ____raw_readq(&tx4938_ccfgptr->ccfg), 204 + ____raw_readq(&tx4938_ccfgptr->pcfg)); 206 205 207 - printk(KERN_INFO "%s SDRAMC --", txx9_pcode_str); 206 + pr_info("%s SDRAMC --", txx9_pcode_str); 208 207 for (i = 0; i < 4; i++) { 209 208 __u64 cr = TX4938_SDRAMC_CR(i); 210 209 unsigned long base, size; ··· 211 212 continue; /* disabled */ 212 213 base = (unsigned long)(cr >> 49) << 21; 213 214 size = (((unsigned long)(cr >> 33) & 0x7fff) + 1) << 21; 214 - printk(" CR%d:%016llx", i, (unsigned long long)cr); 215 + pr_cont(" CR%d:%016llx", i, cr); 215 216 tx4938_sdram_resource[i].name = "SDRAM"; 216 217 tx4938_sdram_resource[i].start = base; 217 218 tx4938_sdram_resource[i].end = base + size - 1; 218 219 tx4938_sdram_resource[i].flags = IORESOURCE_MEM; 219 220 request_resource(&iomem_resource, &tx4938_sdram_resource[i]); 220 221 } 221 - printk(" TR:%09llx\n", 222 - (unsigned long long)____raw_readq(&tx4938_sdramcptr->tr)); 222 + pr_cont(" TR:%09llx\n", ____raw_readq(&tx4938_sdramcptr->tr)); 223 223 224 224 /* SRAM */ 225 225 if (txx9_pcode == 0x4938 && ____raw_readq(&tx4938_sramcptr->cr) & 1) { ··· 252 254 txx9_clear64(&tx4938_ccfgptr->clkctr, 253 255 TX4938_CLKCTR_PCIC1RST); 254 256 } else { 255 - printk(KERN_INFO "%s: stop PCIC1\n", txx9_pcode_str); 257 + pr_info("%s: stop PCIC1\n", txx9_pcode_str); 256 258 /* stop PCIC1 */ 257 259 txx9_set64(&tx4938_ccfgptr->clkctr, 258 260 TX4938_CLKCTR_PCIC1CKD); 259 261 } 260 262 if (!(pcfg & TX4938_PCFG_ETH0_SEL)) { 261 - printk(KERN_INFO "%s: stop ETH0\n", txx9_pcode_str); 263 + pr_info("%s: stop ETH0\n", txx9_pcode_str); 262 264 txx9_set64(&tx4938_ccfgptr->clkctr, 263 265 TX4938_CLKCTR_ETH0RST); 264 266 txx9_set64(&tx4938_ccfgptr->clkctr, 265 267 TX4938_CLKCTR_ETH0CKD); 266 268 } 267 269 if (!(pcfg & TX4938_PCFG_ETH1_SEL)) { 268 - printk(KERN_INFO "%s: stop ETH1\n", txx9_pcode_str); 270 + pr_info("%s: stop ETH1\n", txx9_pcode_str); 269 271 txx9_set64(&tx4938_ccfgptr->clkctr, 270 272 TX4938_CLKCTR_ETH1RST); 271 273 txx9_set64(&tx4938_ccfgptr->clkctr,
+4 -4
arch/mips/txx9/generic/setup_tx4939.c
··· 221 221 (txx9_master_clock + 500000) / 1000000, 222 222 (txx9_gbus_clock + 500000) / 1000000, 223 223 (__u32)____raw_readq(&tx4939_ccfgptr->crir), 224 - (unsigned long long)____raw_readq(&tx4939_ccfgptr->ccfg), 225 - (unsigned long long)____raw_readq(&tx4939_ccfgptr->pcfg)); 224 + ____raw_readq(&tx4939_ccfgptr->ccfg), 225 + ____raw_readq(&tx4939_ccfgptr->pcfg)); 226 226 227 227 pr_info("%s DDRC -- EN:%08x", txx9_pcode_str, 228 228 (__u32)____raw_readq(&tx4939_ddrcptr->winen)); ··· 230 230 __u64 win = ____raw_readq(&tx4939_ddrcptr->win[i]); 231 231 if (!((__u32)____raw_readq(&tx4939_ddrcptr->winen) & (1 << i))) 232 232 continue; /* disabled */ 233 - printk(KERN_CONT " #%d:%016llx", i, (unsigned long long)win); 233 + pr_cont(" #%d:%016llx", i, win); 234 234 tx4939_sdram_resource[i].name = "DDR SDRAM"; 235 235 tx4939_sdram_resource[i].start = 236 236 (unsigned long)(win >> 48) << 20; ··· 240 240 tx4939_sdram_resource[i].flags = IORESOURCE_MEM; 241 241 request_resource(&iomem_resource, &tx4939_sdram_resource[i]); 242 242 } 243 - printk(KERN_CONT "\n"); 243 + pr_cont("\n"); 244 244 245 245 /* SRAM */ 246 246 if (____raw_readq(&tx4939_sramcptr->cr) & 1) {
+7 -10
arch/mips/txx9/generic/smsc_fdc37m81x.c
··· 105 105 u8 chip_id; 106 106 107 107 if (g_smsc_fdc37m81x_base) 108 - printk(KERN_WARNING "%s: stepping on old base=0x%0*lx\n", 109 - __func__, 110 - field, g_smsc_fdc37m81x_base); 108 + pr_warn("%s: stepping on old base=0x%0*lx\n", __func__, field, 109 + g_smsc_fdc37m81x_base); 111 110 112 111 g_smsc_fdc37m81x_base = port; 113 112 ··· 116 117 if (chip_id == SMSC_FDC37M81X_CHIP_ID) 117 118 smsc_fdc37m81x_config_end(); 118 119 else { 119 - printk(KERN_WARNING "%s: unknown chip id 0x%02x\n", __func__, 120 - chip_id); 120 + pr_warn("%s: unknown chip id 0x%02x\n", __func__, chip_id); 121 121 g_smsc_fdc37m81x_base = 0; 122 122 } 123 123 ··· 126 128 #ifdef DEBUG 127 129 static void smsc_fdc37m81x_config_dump_one(const char *key, u8 dev, u8 reg) 128 130 { 129 - printk(KERN_INFO "%s: dev=0x%02x reg=0x%02x val=0x%02x\n", 130 - key, dev, reg, 131 - smsc_fdc37m81x_rd(reg)); 131 + pr_info("%s: dev=0x%02x reg=0x%02x val=0x%02x\n", key, dev, reg, 132 + smsc_fdc37m81x_rd(reg)); 132 133 } 133 134 134 135 void smsc_fdc37m81x_config_dump(void) ··· 139 142 140 143 orig = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DNUM); 141 144 142 - printk(KERN_INFO "%s: common\n", fname); 145 + pr_info("%s: common\n", fname); 143 146 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, 144 147 SMSC_FDC37M81X_DNUM); 145 148 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, ··· 151 154 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, 152 155 SMSC_FDC37M81X_PMGT); 153 156 154 - printk(KERN_INFO "%s: keyboard\n", fname); 157 + pr_info("%s: keyboard\n", fname); 155 158 smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, SMSC_FDC37M81X_KBD); 156 159 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD, 157 160 SMSC_FDC37M81X_ACTIVE);
+1 -1
arch/mips/txx9/jmr3927/prom.c
··· 45 45 { 46 46 /* CCFG */ 47 47 if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0) 48 - printk(KERN_ERR "TX3927 TLB off\n"); 48 + pr_err("TX3927 TLB off\n"); 49 49 50 50 add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM); 51 51 txx9_sio_putchar_init(TX3927_SIO_REG(1));
+5 -6
arch/mips/txx9/jmr3927/setup.c
··· 150 150 151 151 jmr3927_led_set(0); 152 152 153 - printk(KERN_INFO 154 - "JMR-TX3927 (Rev %d) --- IOC(Rev %d) DIPSW:%d,%d,%d,%d\n", 155 - jmr3927_ioc_reg_in(JMR3927_IOC_BREV_ADDR) & JMR3927_REV_MASK, 156 - jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR) & JMR3927_REV_MASK, 157 - jmr3927_dipsw1(), jmr3927_dipsw2(), 158 - jmr3927_dipsw3(), jmr3927_dipsw4()); 153 + pr_info("JMR-TX3927 (Rev %d) --- IOC(Rev %d) DIPSW:%d,%d,%d,%d\n", 154 + jmr3927_ioc_reg_in(JMR3927_IOC_BREV_ADDR) & JMR3927_REV_MASK, 155 + jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR) & JMR3927_REV_MASK, 156 + jmr3927_dipsw1(), jmr3927_dipsw2(), 157 + jmr3927_dipsw3(), jmr3927_dipsw4()); 159 158 } 160 159 161 160 /* This trick makes rtc-ds1742 driver usable as is. */
+7 -7
arch/mips/txx9/rbtx4938/setup.c
··· 123 123 124 124 /* 0-3: "MAC\0", 4-9:eth0, 10-15:eth1, 16:sum */ 125 125 if (spi_eeprom_read(SPI_BUSNO, SEEPROM1_CS, 0, dat, sizeof(dat))) { 126 - printk(KERN_ERR "seeprom: read error.\n"); 126 + pr_err("seeprom: read error.\n"); 127 127 return -ENODEV; 128 128 } else { 129 129 if (strcmp(dat, "MAC") != 0) 130 - printk(KERN_WARNING "seeprom: bad signature.\n"); 130 + pr_warn("seeprom: bad signature.\n"); 131 131 for (i = 0, sum = 0; i < sizeof(dat); i++) 132 132 sum += dat[i]; 133 133 if (sum) 134 - printk(KERN_WARNING "seeprom: bad checksum.\n"); 134 + pr_warn("seeprom: bad checksum.\n"); 135 135 } 136 136 tx4938_ethaddr_init(&dat[4], &dat[4 + 6]); 137 137 #endif /* CONFIG_PCI */ ··· 214 214 rbtx4938_fpga_resource.end = CPHYSADDR(RBTX4938_FPGA_REG_ADDR) + 0xffff; 215 215 rbtx4938_fpga_resource.flags = IORESOURCE_MEM | IORESOURCE_BUSY; 216 216 if (request_resource(&txx9_ce_res[2], &rbtx4938_fpga_resource)) 217 - printk(KERN_ERR "request resource for fpga failed\n"); 217 + pr_err("request resource for fpga failed\n"); 218 218 219 219 _machine_restart = rbtx4938_machine_restart; 220 220 221 221 writeb(0xff, rbtx4938_led_addr); 222 - printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n", 223 - readb(rbtx4938_fpga_rev_addr), 224 - readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr)); 222 + pr_info("RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n", 223 + readb(rbtx4938_fpga_rev_addr), 224 + readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr)); 225 225 } 226 226 227 227 static void __init rbtx4938_ne_init(void)
+6 -2
arch/mips/vdso/Makefile
··· 11 11 $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \ 12 12 -O2 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \ 13 13 -DDISABLE_BRANCH_PROFILING \ 14 + $(call cc-option, -fno-asynchronous-unwind-tables) \ 14 15 $(call cc-option, -fno-stack-protector) 15 16 aflags-vdso := $(ccflags-vdso) \ 16 17 -D__ASSEMBLY__ -Wa,-gdwarf-2 ··· 50 49 quiet_cmd_vdsold = VDSO $@ 51 50 cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \ 52 51 -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@ 52 + 53 + quiet_cmd_vdsoas_o_S = AS $@ 54 + cmd_vdsoas_o_S = $(CC) $(a_flags) -c -o $@ $< 53 55 54 56 # Strip rule for the raw .so files 55 57 $(obj)/%.so.raw: OBJCOPYFLAGS := -S ··· 114 110 $(obj-vdso-o32): KBUILD_AFLAGS := $(aflags-vdso) -mabi=32 115 111 116 112 $(obj)/%-o32.o: $(src)/%.S FORCE 117 - $(call if_changed_dep,as_o_S) 113 + $(call if_changed_dep,vdsoas_o_S) 118 114 119 115 $(obj)/%-o32.o: $(src)/%.c FORCE 120 116 $(call cmd,force_checksrc) ··· 154 150 $(obj-vdso-n32): KBUILD_AFLAGS := $(aflags-vdso) -mabi=n32 155 151 156 152 $(obj)/%-n32.o: $(src)/%.S FORCE 157 - $(call if_changed_dep,as_o_S) 153 + $(call if_changed_dep,vdsoas_o_S) 158 154 159 155 $(obj)/%-n32.o: $(src)/%.c FORCE 160 156 $(call cmd,force_checksrc)
+2 -1
arch/mips/vr41xx/common/bcu.c
··· 28 28 * Yoichi Yuasa <yuasa@linux-mips.org> 29 29 * - Added support for NEC VR4133. 30 30 */ 31 + #include <linux/export.h> 31 32 #include <linux/kernel.h> 32 - #include <linux/module.h> 33 33 #include <linux/smp.h> 34 34 #include <linux/types.h> 35 35 36 + #include <asm/cpu-type.h> 36 37 #include <asm/cpu.h> 37 38 #include <asm/io.h> 38 39
+1 -1
arch/mips/vr41xx/common/cmu.c
··· 28 28 * Yoichi Yuasa <yuasa@linux-mips.org> 29 29 * - Added support for NEC VR4133. 30 30 */ 31 + #include <linux/export.h> 31 32 #include <linux/init.h> 32 33 #include <linux/ioport.h> 33 - #include <linux/module.h> 34 34 #include <linux/smp.h> 35 35 #include <linux/spinlock.h> 36 36 #include <linux/types.h>
+1 -1
arch/mips/vr41xx/common/icu.c
··· 29 29 * - Coped with INTASSIGN of NEC VR4133. 30 30 */ 31 31 #include <linux/errno.h> 32 + #include <linux/export.h> 32 33 #include <linux/init.h> 33 34 #include <linux/ioport.h> 34 35 #include <linux/irq.h> 35 - #include <linux/module.h> 36 36 #include <linux/smp.h> 37 37 #include <linux/types.h> 38 38
+1 -1
arch/mips/vr41xx/common/irq.c
··· 17 17 * along with this program; if not, write to the Free Software 18 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 + #include <linux/export.h> 20 21 #include <linux/interrupt.h> 21 - #include <linux/module.h> 22 22 #include <linux/irq.h> 23 23 24 24 #include <asm/irq_cpu.h>
+2 -5
arch/mips/xilfpga/intc.c
··· 11 11 12 12 #include <linux/of.h> 13 13 #include <linux/of_irq.h> 14 + #include <linux/irqchip.h> 14 15 15 16 #include <asm/irq_cpu.h> 16 17 17 - static struct of_device_id of_irq_ids[] __initdata = { 18 - { .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init }, 19 - {}, 20 - }; 21 18 22 19 void __init arch_init_irq(void) 23 20 { 24 - of_irq_init(of_irq_ids); 21 + irqchip_init(); 25 22 }
+1 -1
drivers/of/base.c
··· 2112 2112 continue; 2113 2113 2114 2114 /* Allocate an alias_prop with enough space for the stem */ 2115 - ap = dt_alloc(sizeof(*ap) + len + 1, 4); 2115 + ap = dt_alloc(sizeof(*ap) + len + 1, __alignof__(*ap)); 2116 2116 if (!ap) 2117 2117 continue; 2118 2118 memset(ap, 0, sizeof(*ap) + len + 1);
+6 -3
drivers/of/fdt.c
··· 738 738 const char *pathp; 739 739 int offset, rc = 0, depth = -1; 740 740 741 - for (offset = fdt_next_node(blob, -1, &depth); 742 - offset >= 0 && depth >= 0 && !rc; 743 - offset = fdt_next_node(blob, offset, &depth)) { 741 + if (!blob) 742 + return 0; 743 + 744 + for (offset = fdt_next_node(blob, -1, &depth); 745 + offset >= 0 && depth >= 0 && !rc; 746 + offset = fdt_next_node(blob, offset, &depth)) { 744 747 745 748 pathp = fdt_get_name(blob, offset, NULL); 746 749 if (*pathp == '/')
+1 -1
scripts/Kbuild.include
··· 284 284 $(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;; \ 285 285 as_*_S|cpp_s_S) \ 286 286 $(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;; \ 287 - boot*|build*|*cpp_lds_S|dtc|host*|vdso*) : ;; \ 287 + boot*|build*|cpp_its_S|*cpp_lds_S|dtc|host*|vdso*) : ;; \ 288 288 *) echo "Don't know how to preprocess $(1)" >&2; false ;; \ 289 289 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' 290 290