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

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

Pull MIPS updates from James Hogan:
"These are the main MIPS changes for 4.15.

Fixes:
- ralink: Fix MT7620 PCI build issues (4.5)
- Disable cmpxchg64() and HAVE_VIRT_CPU_ACCOUNTING_GEN for 32-bit SMP
(4.1)
- Fix MIPS64 FP save/restore on 32-bit kernels (4.0)
- ptrace: Pick up ptrace/seccomp changed syscall numbers (3.19)
- ralink: Fix MT7628 pinmux (3.19)
- BCM47XX: Fix LED inversion on WRT54GSv1 (3.17)
- Fix n32 core dumping as o32 since regset support (3.13)
- ralink: Drop obsolete USB_ARCH_HAS_HCD select

Build system:
- Default to "generic" (multiplatform) system type instead of IP22
- Use generic little endian MIPS32 r2 configuration as default
defconfig instead of ip22_defconfig

FPU emulation:
- Fix exception generation for certain R6 FPU instructions

SMP:
- Allow __cpu_number_map to be larger than NR_CPUS for sparse CPU id
spaces

Miscellaneous:
- Add iomem resource for kernel bss section for kexec/kdump
- Atomics: Nudge writes on bit unlock
- DT files: Standardise "ok" -> "okay"

Minor cleanups:
- Define virt_to_pfn()
- Make thread_saved_pc static
- Simplify 32-bit sign extension in __read_64bit_c0_split()
- DMA: Use vma_pages() helper
- FPU emulation: Replace unsigned with unsigned int
- MM: Removed unused lastpfn
- Alchemy: Make clk_ops const
- Lasat: Use setup_timer() helper
- ralink: Use BIT() in MT7620 PCI driver

Platform support:

BMIPS:
- Enable HARDIRQS_SW_RESEND

Broadcom BCM63XX:
- Add clkdev lookup support
- Update clk driver, UART driver, DTs to handle named refclk from DTs
- Split apart various clocks to more closely match hardware
- Add ethernet clocks

Cavium Octeon:
- Remove usage of cvmx_wait() in favour of __delay()

ImgTec Pistachio:
- DT: Drop deprecated dwmmc num-slots property

Ingenic JZ4780:
- Add NFS root to Ci20 defconfig
- Add watchdog to Ci20 DT & defconfig, and allow building of watchdog
driver with this SoC

Generic (multiplatform):
- Migrate xilfpga (MIPSfpga) platform to the generic platform

Lantiq xway:
- Fix ASC0/ASC1 clocks"

* tag 'mips_4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips: (46 commits)
MIPS: Add iomem resource for kernel bss section.
MIPS: cmpxchg64() and HAVE_VIRT_CPU_ACCOUNTING_GEN don't work for 32-bit SMP
MIPS: BMIPS: Enable HARDIRQS_SW_RESEND
MIPS: pci: Make use of the BIT() macro inside the mt7620 driver
MIPS: pci: Remove KERN_WARN instance inside the mt7620 driver
MIPS: pci: Remove duplicate define in mt7620 driver
MIPS: ralink: Fix typo in mt7628 pinmux function
MIPS: ralink: Fix MT7628 pinmux
MIPS: Fix odd fp register warnings with MIPS64r2
watchdog: jz4780: Allow selection of jz4740-wdt driver
MIPS/ptrace: Update syscall nr on register changes
MIPS/ptrace: Pick up ptrace/seccomp changed syscalls
MIPS: Fix an n32 core file generation regset support regression
MIPS: Fix MIPS64 FP save/restore on 32-bit kernels
MIPS: page.h: Define virt_to_pfn()
MIPS: Xilfpga: Switch to using generic defconfigs
MIPS: generic: Add support for MIPSfpga
MIPS: Set defconfig target to a generic system for 32r2el
MIPS: Kconfig: Set default MIPS system type as generic
MIPS: DTS: Remove num-slots from Pistachio SoC
...

+514 -436
+6
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
··· 11 11 - clocks: Clock driving the hardware; used to figure out the baud rate 12 12 divisor. 13 13 14 + 15 + Optional properties: 16 + 17 + - clock-names: Should be "refclk". 18 + 14 19 Example: 15 20 16 21 uart0: serial@14e00520 { ··· 24 19 interrupt-parent = <&periph_intc>; 25 20 interrupts = <2>; 26 21 clocks = <&periph_clk>; 22 + clock-names = "refclk"; 27 23 }; 28 24 29 25 clocks {
-1
arch/mips/Kbuild.platforms
··· 34 34 platforms += sni 35 35 platforms += txx9 36 36 platforms += vr41xx 37 - platforms += xilfpga 38 37 39 38 # include the platform specific files 40 39 include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
+15 -27
arch/mips/Kconfig
··· 65 65 select HAVE_PERF_EVENTS 66 66 select HAVE_REGS_AND_STACK_ACCESS_API 67 67 select HAVE_SYSCALL_TRACEPOINTS 68 - select HAVE_VIRT_CPU_ACCOUNTING_GEN 68 + select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP 69 69 select IRQ_FORCED_THREADING 70 70 select MODULES_USE_ELF_RELA if MODULES && 64BIT 71 71 select MODULES_USE_ELF_REL if MODULES ··· 78 78 79 79 choice 80 80 prompt "System type" 81 - default SGI_IP22 81 + default MIPS_GENERIC 82 82 83 83 config MIPS_GENERIC 84 84 bool "Generic board-agnostic MIPS kernel" ··· 233 233 select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN 234 234 select USB_OHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN 235 235 select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN 236 + select HARDIRQS_SW_RESEND 236 237 help 237 238 Build a generic DT-based kernel image that boots on select 238 239 BCM33xx cable modem chips, BCM63xx DSL chips, and BCM7xxx set-top ··· 277 276 select GPIOLIB 278 277 select HAVE_CLK 279 278 select MIPS_L1_CACHE_SHIFT_4 279 + select CLKDEV_LOOKUP 280 280 help 281 281 Support for BCM63XX based boards 282 282 ··· 469 467 select USE_OF 470 468 help 471 469 This enables support for the IMG Pistachio SoC platform. 472 - 473 - config MACH_XILFPGA 474 - bool "MIPSfpga Xilinx based boards" 475 - select BOOT_ELF32 476 - select BOOT_RAW 477 - select BUILTIN_DTB 478 - select CEVT_R4K 479 - select COMMON_CLK 480 - select CSRC_R4K 481 - select GPIOLIB 482 - select IRQ_MIPS_CPU 483 - select LIBFDT 484 - select MIPS_CPU_SCACHE 485 - select SYS_HAS_EARLY_PRINTK 486 - select SYS_HAS_CPU_MIPS32_R2 487 - select SYS_SUPPORTS_32BIT_KERNEL 488 - select SYS_SUPPORTS_LITTLE_ENDIAN 489 - select SYS_SUPPORTS_ZBOOT_UART16550 490 - select USE_OF 491 - select USE_GENERIC_EARLY_PRINTK_8250 492 - select XILINX_INTC 493 - help 494 - This enables support for the IMG University Program MIPSfpga platform. 495 470 496 471 config MIPS_MALTA 497 472 bool "MIPS Malta board" ··· 895 916 select USE_OF 896 917 select ARCH_SPARSEMEM_ENABLE 897 918 select SYS_SUPPORTS_SMP 898 - select NR_CPUS_DEFAULT_16 919 + select NR_CPUS_DEFAULT_64 920 + select MIPS_NR_CPU_NR_MAP_1024 899 921 select BUILTIN_DTB 900 922 select MTD_COMPLEX_MAPPINGS 901 923 select SYS_SUPPORTS_RELOCATABLE ··· 1014 1034 source "arch/mips/loongson64/Kconfig" 1015 1035 source "arch/mips/netlogic/Kconfig" 1016 1036 source "arch/mips/paravirt/Kconfig" 1017 - source "arch/mips/xilfpga/Kconfig" 1018 1037 1019 1038 endmenu 1020 1039 ··· 2704 2725 2705 2726 config MIPS_PERF_SHARED_TC_COUNTERS 2706 2727 bool 2728 + 2729 + config MIPS_NR_CPU_NR_MAP_1024 2730 + bool 2731 + 2732 + config MIPS_NR_CPU_NR_MAP 2733 + int 2734 + depends on SMP 2735 + default 1024 if MIPS_NR_CPU_NR_MAP_1024 2736 + default NR_CPUS if !MIPS_NR_CPU_NR_MAP_1024 2707 2737 2708 2738 # 2709 2739 # Timer Interrupt Frequency Configuration
+5 -1
arch/mips/Makefile
··· 15 15 archscripts: scripts_basic 16 16 $(Q)$(MAKE) $(build)=arch/mips/boot/tools relocs 17 17 18 - KBUILD_DEFCONFIG := ip22_defconfig 18 + KBUILD_DEFCONFIG := 32r2el_defconfig 19 19 20 20 # 21 21 # Select the object file format to substitute into the linker script. ··· 544 544 .PHONY: sead3micro_defconfig 545 545 sead3micro_defconfig: 546 546 $(Q)$(MAKE) -f $(srctree)/Makefile micro32r2el_defconfig BOARDS=sead-3 547 + 548 + .PHONY: xilfpga_defconfig 549 + xilfpga_defconfig: 550 + $(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=xilfpga
+5 -5
arch/mips/alchemy/common/clock.c
··· 143 143 preset_lpj /= 2 * HZ; 144 144 } 145 145 146 - static struct clk_ops alchemy_clkops_cpu = { 146 + static const struct clk_ops alchemy_clkops_cpu = { 147 147 .recalc_rate = alchemy_clk_cpu_recalc, 148 148 }; 149 149 ··· 224 224 return (*parent_rate) * mult; 225 225 } 226 226 227 - static struct clk_ops alchemy_clkops_aux = { 227 + static const struct clk_ops alchemy_clkops_aux = { 228 228 .recalc_rate = alchemy_clk_aux_recalc, 229 229 .set_rate = alchemy_clk_aux_setr, 230 230 .round_rate = alchemy_clk_aux_roundr, ··· 576 576 } 577 577 578 578 /* Au1000, Au1100, Au15x0, Au12x0 */ 579 - static struct clk_ops alchemy_clkops_fgenv1 = { 579 + static const struct clk_ops alchemy_clkops_fgenv1 = { 580 580 .recalc_rate = alchemy_clk_fgv1_recalc, 581 581 .determine_rate = alchemy_clk_fgv1_detr, 582 582 .set_rate = alchemy_clk_fgv1_setr, ··· 717 717 } 718 718 719 719 /* Au1300 larger input mux, no separate disable bit, flexible divider */ 720 - static struct clk_ops alchemy_clkops_fgenv2 = { 720 + static const struct clk_ops alchemy_clkops_fgenv2 = { 721 721 .recalc_rate = alchemy_clk_fgv2_recalc, 722 722 .determine_rate = alchemy_clk_fgv2_detr, 723 723 .set_rate = alchemy_clk_fgv2_setr, ··· 925 925 return alchemy_clk_fgcs_detr(hw, req, scale, 4); 926 926 } 927 927 928 - static struct clk_ops alchemy_clkops_csrc = { 928 + static const struct clk_ops alchemy_clkops_csrc = { 929 929 .recalc_rate = alchemy_clk_csrc_recalc, 930 930 .determine_rate = alchemy_clk_csrc_detr, 931 931 .set_rate = alchemy_clk_csrc_setr,
+1 -1
arch/mips/bcm47xx/leds.c
··· 331 331 /* Verified on: WRT54GS V1.0 */ 332 332 static const struct gpio_led 333 333 bcm47xx_leds_linksys_wrt54g_type_0101[] __initconst = { 334 - BCM47XX_GPIO_LED(0, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), 334 + BCM47XX_GPIO_LED(0, "green", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), 335 335 BCM47XX_GPIO_LED(1, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON), 336 336 BCM47XX_GPIO_LED(7, "green", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), 337 337 };
+195 -47
arch/mips/bcm63xx/clk.c
··· 11 11 #include <linux/mutex.h> 12 12 #include <linux/err.h> 13 13 #include <linux/clk.h> 14 + #include <linux/clkdev.h> 14 15 #include <linux/delay.h> 15 16 #include <bcm63xx_cpu.h> 16 17 #include <bcm63xx_io.h> ··· 122 121 }; 123 122 124 123 /* 124 + * Ethernet switch SAR clock 125 + */ 126 + static void swpkt_sar_set(struct clk *clk, int enable) 127 + { 128 + if (BCMCPU_IS_6368()) 129 + bcm_hwclock_set(CKCTL_6368_SWPKT_SAR_EN, enable); 130 + else 131 + return; 132 + } 133 + 134 + static struct clk clk_swpkt_sar = { 135 + .set = swpkt_sar_set, 136 + }; 137 + 138 + /* 139 + * Ethernet switch USB clock 140 + */ 141 + static void swpkt_usb_set(struct clk *clk, int enable) 142 + { 143 + if (BCMCPU_IS_6368()) 144 + bcm_hwclock_set(CKCTL_6368_SWPKT_USB_EN, enable); 145 + else 146 + return; 147 + } 148 + 149 + static struct clk clk_swpkt_usb = { 150 + .set = swpkt_usb_set, 151 + }; 152 + 153 + /* 125 154 * Ethernet switch clock 126 155 */ 127 156 static void enetsw_set(struct clk *clk, int enable) 128 157 { 129 - if (BCMCPU_IS_6328()) 158 + if (BCMCPU_IS_6328()) { 130 159 bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable); 131 - else if (BCMCPU_IS_6362()) 160 + } else if (BCMCPU_IS_6362()) { 132 161 bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable); 133 - else if (BCMCPU_IS_6368()) 134 - bcm_hwclock_set(CKCTL_6368_ROBOSW_EN | 135 - CKCTL_6368_SWPKT_USB_EN | 136 - CKCTL_6368_SWPKT_SAR_EN, 137 - enable); 138 - else 162 + } else if (BCMCPU_IS_6368()) { 163 + if (enable) { 164 + clk_enable_unlocked(&clk_swpkt_sar); 165 + clk_enable_unlocked(&clk_swpkt_usb); 166 + } else { 167 + clk_disable_unlocked(&clk_swpkt_usb); 168 + clk_disable_unlocked(&clk_swpkt_sar); 169 + } 170 + bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable); 171 + } else { 139 172 return; 173 + } 140 174 141 175 if (enable) { 142 176 /* reset switch core afer clock change */ ··· 283 247 .set = hsspi_set, 284 248 }; 285 249 250 + /* 251 + * HSSPI PLL 252 + */ 253 + static struct clk clk_hsspi_pll; 286 254 287 255 /* 288 256 * XTM clock ··· 296 256 if (!BCMCPU_IS_6368()) 297 257 return; 298 258 299 - bcm_hwclock_set(CKCTL_6368_SAR_EN | 300 - CKCTL_6368_SWPKT_SAR_EN, enable); 259 + if (enable) 260 + clk_enable_unlocked(&clk_swpkt_sar); 261 + else 262 + clk_disable_unlocked(&clk_swpkt_sar); 263 + 264 + bcm_hwclock_set(CKCTL_6368_SAR_EN, enable); 301 265 302 266 if (enable) { 303 267 /* reset sar core afer clock change */ ··· 403 359 } 404 360 EXPORT_SYMBOL_GPL(clk_round_rate); 405 361 406 - struct clk *clk_get(struct device *dev, const char *id) 407 - { 408 - if (!strcmp(id, "enet0")) 409 - return &clk_enet0; 410 - if (!strcmp(id, "enet1")) 411 - return &clk_enet1; 412 - if (!strcmp(id, "enetsw")) 413 - return &clk_enetsw; 414 - if (!strcmp(id, "ephy")) 415 - return &clk_ephy; 416 - if (!strcmp(id, "usbh")) 417 - return &clk_usbh; 418 - if (!strcmp(id, "usbd")) 419 - return &clk_usbd; 420 - if (!strcmp(id, "spi")) 421 - return &clk_spi; 422 - if (!strcmp(id, "hsspi")) 423 - return &clk_hsspi; 424 - if (!strcmp(id, "xtm")) 425 - return &clk_xtm; 426 - if (!strcmp(id, "periph")) 427 - return &clk_periph; 428 - if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm")) 429 - return &clk_pcm; 430 - if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec")) 431 - return &clk_ipsec; 432 - if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie")) 433 - return &clk_pcie; 434 - return ERR_PTR(-ENOENT); 435 - } 362 + static struct clk_lookup bcm3368_clks[] = { 363 + /* fixed rate clocks */ 364 + CLKDEV_INIT(NULL, "periph", &clk_periph), 365 + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), 366 + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), 367 + /* gated clocks */ 368 + CLKDEV_INIT(NULL, "enet0", &clk_enet0), 369 + CLKDEV_INIT(NULL, "enet1", &clk_enet1), 370 + CLKDEV_INIT(NULL, "ephy", &clk_ephy), 371 + CLKDEV_INIT(NULL, "usbh", &clk_usbh), 372 + CLKDEV_INIT(NULL, "usbd", &clk_usbd), 373 + CLKDEV_INIT(NULL, "spi", &clk_spi), 374 + CLKDEV_INIT(NULL, "pcm", &clk_pcm), 375 + CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0), 376 + CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), 377 + }; 436 378 437 - EXPORT_SYMBOL(clk_get); 379 + static struct clk_lookup bcm6328_clks[] = { 380 + /* fixed rate clocks */ 381 + CLKDEV_INIT(NULL, "periph", &clk_periph), 382 + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), 383 + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), 384 + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), 385 + /* gated clocks */ 386 + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), 387 + CLKDEV_INIT(NULL, "usbh", &clk_usbh), 388 + CLKDEV_INIT(NULL, "usbd", &clk_usbd), 389 + CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), 390 + CLKDEV_INIT(NULL, "pcie", &clk_pcie), 391 + }; 438 392 439 - void clk_put(struct clk *clk) 440 - { 441 - } 393 + static struct clk_lookup bcm6338_clks[] = { 394 + /* fixed rate clocks */ 395 + CLKDEV_INIT(NULL, "periph", &clk_periph), 396 + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), 397 + /* gated clocks */ 398 + CLKDEV_INIT(NULL, "enet0", &clk_enet0), 399 + CLKDEV_INIT(NULL, "enet1", &clk_enet1), 400 + CLKDEV_INIT(NULL, "ephy", &clk_ephy), 401 + CLKDEV_INIT(NULL, "usbh", &clk_usbh), 402 + CLKDEV_INIT(NULL, "usbd", &clk_usbd), 403 + CLKDEV_INIT(NULL, "spi", &clk_spi), 404 + CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), 405 + }; 442 406 443 - EXPORT_SYMBOL(clk_put); 407 + static struct clk_lookup bcm6345_clks[] = { 408 + /* fixed rate clocks */ 409 + CLKDEV_INIT(NULL, "periph", &clk_periph), 410 + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), 411 + /* gated clocks */ 412 + CLKDEV_INIT(NULL, "enet0", &clk_enet0), 413 + CLKDEV_INIT(NULL, "enet1", &clk_enet1), 414 + CLKDEV_INIT(NULL, "ephy", &clk_ephy), 415 + CLKDEV_INIT(NULL, "usbh", &clk_usbh), 416 + CLKDEV_INIT(NULL, "usbd", &clk_usbd), 417 + CLKDEV_INIT(NULL, "spi", &clk_spi), 418 + CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), 419 + }; 420 + 421 + static struct clk_lookup bcm6348_clks[] = { 422 + /* fixed rate clocks */ 423 + CLKDEV_INIT(NULL, "periph", &clk_periph), 424 + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), 425 + /* gated clocks */ 426 + CLKDEV_INIT(NULL, "enet0", &clk_enet0), 427 + CLKDEV_INIT(NULL, "enet1", &clk_enet1), 428 + CLKDEV_INIT(NULL, "ephy", &clk_ephy), 429 + CLKDEV_INIT(NULL, "usbh", &clk_usbh), 430 + CLKDEV_INIT(NULL, "usbd", &clk_usbd), 431 + CLKDEV_INIT(NULL, "spi", &clk_spi), 432 + CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), 433 + CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet_misc), 434 + }; 435 + 436 + static struct clk_lookup bcm6358_clks[] = { 437 + /* fixed rate clocks */ 438 + CLKDEV_INIT(NULL, "periph", &clk_periph), 439 + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), 440 + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), 441 + /* gated clocks */ 442 + CLKDEV_INIT(NULL, "enet0", &clk_enet0), 443 + CLKDEV_INIT(NULL, "enet1", &clk_enet1), 444 + CLKDEV_INIT(NULL, "ephy", &clk_ephy), 445 + CLKDEV_INIT(NULL, "usbh", &clk_usbh), 446 + CLKDEV_INIT(NULL, "usbd", &clk_usbd), 447 + CLKDEV_INIT(NULL, "spi", &clk_spi), 448 + CLKDEV_INIT(NULL, "pcm", &clk_pcm), 449 + CLKDEV_INIT(NULL, "swpkt_sar", &clk_swpkt_sar), 450 + CLKDEV_INIT(NULL, "swpkt_usb", &clk_swpkt_usb), 451 + CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0), 452 + CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), 453 + }; 454 + 455 + static struct clk_lookup bcm6362_clks[] = { 456 + /* fixed rate clocks */ 457 + CLKDEV_INIT(NULL, "periph", &clk_periph), 458 + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), 459 + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), 460 + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), 461 + /* gated clocks */ 462 + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), 463 + CLKDEV_INIT(NULL, "usbh", &clk_usbh), 464 + CLKDEV_INIT(NULL, "usbd", &clk_usbd), 465 + CLKDEV_INIT(NULL, "spi", &clk_spi), 466 + CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), 467 + CLKDEV_INIT(NULL, "pcie", &clk_pcie), 468 + CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), 469 + }; 470 + 471 + static struct clk_lookup bcm6368_clks[] = { 472 + /* fixed rate clocks */ 473 + CLKDEV_INIT(NULL, "periph", &clk_periph), 474 + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), 475 + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), 476 + /* gated clocks */ 477 + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), 478 + CLKDEV_INIT(NULL, "usbh", &clk_usbh), 479 + CLKDEV_INIT(NULL, "usbd", &clk_usbd), 480 + CLKDEV_INIT(NULL, "spi", &clk_spi), 481 + CLKDEV_INIT(NULL, "xtm", &clk_xtm), 482 + CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), 483 + }; 444 484 445 485 #define HSSPI_PLL_HZ_6328 133333333 446 486 #define HSSPI_PLL_HZ_6362 400000000 ··· 532 404 static int __init bcm63xx_clk_init(void) 533 405 { 534 406 switch (bcm63xx_get_cpu_id()) { 407 + case BCM3368_CPU_ID: 408 + clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks)); 409 + break; 535 410 case BCM6328_CPU_ID: 536 - clk_hsspi.rate = HSSPI_PLL_HZ_6328; 411 + clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328; 412 + clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks)); 413 + break; 414 + case BCM6338_CPU_ID: 415 + clkdev_add_table(bcm6338_clks, ARRAY_SIZE(bcm6338_clks)); 416 + break; 417 + case BCM6345_CPU_ID: 418 + clkdev_add_table(bcm6345_clks, ARRAY_SIZE(bcm6345_clks)); 419 + break; 420 + case BCM6348_CPU_ID: 421 + clkdev_add_table(bcm6348_clks, ARRAY_SIZE(bcm6348_clks)); 422 + break; 423 + case BCM6358_CPU_ID: 424 + clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks)); 537 425 break; 538 426 case BCM6362_CPU_ID: 539 - clk_hsspi.rate = HSSPI_PLL_HZ_6362; 427 + clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362; 428 + clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks)); 429 + break; 430 + case BCM6368_CPU_ID: 431 + clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks)); 540 432 break; 541 433 } 542 434
+2
arch/mips/boot/dts/brcm/bcm3368.dtsi
··· 83 83 interrupts = <2>; 84 84 85 85 clocks = <&periph_clk>; 86 + clock-names = "refclk"; 86 87 87 88 status = "disabled"; 88 89 }; ··· 96 95 interrupts = <3>; 97 96 98 97 clocks = <&periph_clk>; 98 + clock-names = "refclk"; 99 99 100 100 status = "disabled"; 101 101 };
+1 -1
arch/mips/boot/dts/brcm/bcm63268-comtrend-vr-3032u.dts
··· 19 19 }; 20 20 21 21 &leds0 { 22 - status = "ok"; 22 + status = "okay"; 23 23 brcm,serial-leds; 24 24 brcm,serial-dat-low; 25 25 brcm,serial-shift-inv;
+2
arch/mips/boot/dts/brcm/bcm63268.dtsi
··· 84 84 interrupts = <5>; 85 85 86 86 clocks = <&periph_clk>; 87 + clock-names = "refclk"; 87 88 88 89 status = "disabled"; 89 90 }; ··· 97 96 interrupts = <34>; 98 97 99 98 clocks = <&periph_clk>; 99 + clock-names = "refclk"; 100 100 101 101 status = "disabled"; 102 102 };
+2
arch/mips/boot/dts/brcm/bcm6328.dtsi
··· 69 69 interrupt-parent = <&periph_intc>; 70 70 interrupts = <28>; 71 71 clocks = <&periph_clk>; 72 + clock-names = "refclk"; 72 73 status = "disabled"; 73 74 }; 74 75 ··· 79 78 interrupt-parent = <&periph_intc>; 80 79 interrupts = <39>; 81 80 clocks = <&periph_clk>; 81 + clock-names = "refclk"; 82 82 status = "disabled"; 83 83 }; 84 84
+1 -1
arch/mips/boot/dts/brcm/bcm6358-neufbox4-sercomm.dts
··· 19 19 }; 20 20 21 21 &leds0 { 22 - status = "ok"; 22 + status = "okay"; 23 23 24 24 led@0 { 25 25 reg = <0>;
+2
arch/mips/boot/dts/brcm/bcm6358.dtsi
··· 93 93 interrupts = <2>; 94 94 95 95 clocks = <&periph_clk>; 96 + clock-names = "refclk"; 96 97 97 98 status = "disabled"; 98 99 }; ··· 106 105 interrupts = <3>; 107 106 108 107 clocks = <&periph_clk>; 108 + clock-names = "refclk"; 109 109 110 110 status = "disabled"; 111 111 };
+2
arch/mips/boot/dts/brcm/bcm6362.dtsi
··· 84 84 interrupts = <3>; 85 85 86 86 clocks = <&periph_clk>; 87 + clock-names = "refclk"; 87 88 88 89 status = "disabled"; 89 90 }; ··· 97 96 interrupts = <4>; 98 97 99 98 clocks = <&periph_clk>; 99 + clock-names = "refclk"; 100 100 101 101 status = "disabled"; 102 102 };
+2
arch/mips/boot/dts/brcm/bcm6368.dtsi
··· 90 90 interrupt-parent = <&periph_intc>; 91 91 interrupts = <2>; 92 92 clocks = <&periph_clk>; 93 + clock-names = "refclk"; 93 94 status = "disabled"; 94 95 }; 95 96 ··· 100 99 interrupt-parent = <&periph_intc>; 101 100 interrupts = <3>; 102 101 clocks = <&periph_clk>; 102 + clock-names = "refclk"; 103 103 status = "disabled"; 104 104 }; 105 105
-1
arch/mips/boot/dts/img/pistachio.dtsi
··· 805 805 pinctrl-0 = <&sdhost_pins>; 806 806 pinctrl-names = "default"; 807 807 fifo-depth = <0x20>; 808 - num-slots = <1>; 809 808 clock-frequency = <50000000>; 810 809 bus-width = <8>; 811 810 cap-mmc-highspeed;
+5
arch/mips/boot/dts/ingenic/jz4780.dtsi
··· 219 219 status = "disabled"; 220 220 }; 221 221 222 + watchdog: watchdog@10002000 { 223 + compatible = "ingenic,jz4780-watchdog"; 224 + reg = <0x10002000 0x100>; 225 + }; 226 + 222 227 nemc: nemc@13410000 { 223 228 compatible = "ingenic,jz4780-nemc"; 224 229 reg = <0x13410000 0x10000>;
+1 -1
arch/mips/boot/dts/ralink/rt3052_eval.dts
··· 47 47 }; 48 48 49 49 usb@101c0000 { 50 - status = "ok"; 50 + status = "okay"; 51 51 }; 52 52 };
+1 -1
arch/mips/boot/dts/xilfpga/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - dtb-$(CONFIG_XILFPGA_NEXYS4DDR) += nexys4ddr.dtb 2 + dtb-$(CONFIG_FIT_IMAGE_FDT_XILFPGA) += nexys4ddr.dtb 3 3 4 4 obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 5 5
+8
arch/mips/boot/dts/xilfpga/nexys4ddr.dts
··· 6 6 / { 7 7 compatible = "digilent,nexys4ddr"; 8 8 9 + aliases { 10 + serial0 = &axi_uart16550; 11 + }; 12 + chosen { 13 + bootargs = "console=ttyS0,115200"; 14 + stdout-path = "serial0:115200n8"; 15 + }; 16 + 9 17 memory { 10 18 device_type = "memory"; 11 19 reg = <0x0 0x08000000>;
+1 -1
arch/mips/cavium-octeon/executive/cvmx-helper.c
··· 862 862 */ 863 863 cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT)), 0); 864 864 865 - cvmx_wait(100000000ull); 865 + __delay(100000000ull); 866 866 867 867 for (retry_loop_cnt = 0; retry_loop_cnt < 10; retry_loop_cnt++) { 868 868 retry_cnt = 100000;
+5 -5
arch/mips/cavium-octeon/executive/cvmx-spi.c
··· 215 215 spxx_clk_ctl.u64 = 0; 216 216 spxx_clk_ctl.s.runbist = 1; 217 217 cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64); 218 - cvmx_wait(10 * MS); 218 + __delay(10 * MS); 219 219 spxx_bist_stat.u64 = cvmx_read_csr(CVMX_SPXX_BIST_STAT(interface)); 220 220 if (spxx_bist_stat.s.stat0) 221 221 cvmx_dprintf ··· 265 265 spxx_clk_ctl.s.rcvtrn = 0; 266 266 spxx_clk_ctl.s.srxdlck = 0; 267 267 cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64); 268 - cvmx_wait(100 * MS); 268 + __delay(100 * MS); 269 269 270 270 /* Reset SRX0 DLL */ 271 271 spxx_clk_ctl.s.srxdlck = 1; 272 272 cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64); 273 273 274 274 /* Waiting for Inf0 Spi4 RX DLL to lock */ 275 - cvmx_wait(100 * MS); 275 + __delay(100 * MS); 276 276 277 277 /* Enable dynamic alignment */ 278 278 spxx_trn4_ctl.s.trntest = 0; ··· 527 527 spxx_clk_ctl.s.rcvtrn = 1; 528 528 spxx_clk_ctl.s.srxdlck = 1; 529 529 cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64); 530 - cvmx_wait(1000 * MS); 530 + __delay(1000 * MS); 531 531 532 532 /* SRX0 clear the boot bit */ 533 533 spxx_trn4_ctl.u64 = cvmx_read_csr(CVMX_SPXX_TRN4_CTL(interface)); ··· 536 536 537 537 /* Wait for the training sequence to complete */ 538 538 cvmx_dprintf("SPI%d: Waiting for training\n", interface); 539 - cvmx_wait(1000 * MS); 539 + __delay(1000 * MS); 540 540 /* Wait a really long time here */ 541 541 timeout_time = cvmx_get_cycle() + 1000ull * MS * 600; 542 542 /*
+6 -1
arch/mips/configs/ci20_defconfig
··· 38 38 CONFIG_PACKET=y 39 39 CONFIG_UNIX=y 40 40 CONFIG_INET=y 41 + CONFIG_IP_PNP=y 42 + CONFIG_IP_PNP_DHCP=y 41 43 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 42 44 # CONFIG_INET_XFRM_MODE_TUNNEL is not set 43 45 # CONFIG_INET_XFRM_MODE_BEET is not set ··· 95 93 CONFIG_GPIO_SYSFS=y 96 94 CONFIG_GPIO_INGENIC=y 97 95 # CONFIG_HWMON is not set 96 + CONFIG_WATCHDOG=y 97 + CONFIG_JZ4740_WDT=y 98 98 CONFIG_REGULATOR=y 99 99 CONFIG_REGULATOR_DEBUG=y 100 100 CONFIG_REGULATOR_FIXED_VOLTAGE=y ··· 114 110 CONFIG_TMPFS=y 115 111 CONFIG_CONFIGFS_FS=y 116 112 CONFIG_UBIFS_FS=y 117 - # CONFIG_NETWORK_FILESYSTEMS is not set 113 + CONFIG_NFS_FS=y 114 + CONFIG_ROOT_NFS=y 118 115 CONFIG_NLS=y 119 116 CONFIG_NLS_CODEPAGE_437=y 120 117 CONFIG_NLS_CODEPAGE_737=y
+22
arch/mips/configs/generic/board-xilfpga.config
··· 1 + # require CONFIG_CPU_MIPS32_R2=y 2 + # require CONFIG_CPU_LITTLE_ENDIAN=y 3 + 4 + CONFIG_SERIAL_8250=y 5 + CONFIG_SERIAL_8250_CONSOLE=y 6 + CONFIG_SERIAL_OF_PLATFORM=y 7 + CONFIG_GPIO_SYSFS=y 8 + CONFIG_GPIO_XILINX=y 9 + CONFIG_PANIC_ON_OOPS=y 10 + CONFIG_FIT_IMAGE_FDT_XILFPGA=y 11 + CONFIG_I2C=y 12 + CONFIG_I2C_CHARDEV=y 13 + CONFIG_I2C_XILINX=y 14 + CONFIG_SENSORS_ADT7410=y 15 + CONFIG_TMPFS=y 16 + CONFIG_NET=y 17 + CONFIG_PACKET=y 18 + CONFIG_UNIX=y 19 + CONFIG_INET=y 20 + CONFIG_NETDEVICES=y 21 + CONFIG_XILINX_EMACLITE=y 22 + CONFIG_SMSC_PHY=y
+1
arch/mips/configs/ip22_defconfig
··· 1 + CONFIG_SGI_IP22=y 1 2 CONFIG_ARC_CONSOLE=y 2 3 CONFIG_CPU_R5000=y 3 4 CONFIG_NO_HZ=y
-75
arch/mips/configs/xilfpga_defconfig
··· 1 - CONFIG_MACH_XILFPGA=y 2 - # CONFIG_COMPACTION is not set 3 - # CONFIG_LOCALVERSION_AUTO is not set 4 - CONFIG_EMBEDDED=y 5 - # CONFIG_VM_EVENT_COUNTERS is not set 6 - # CONFIG_COMPAT_BRK is not set 7 - CONFIG_SLAB=y 8 - # CONFIG_BLOCK is not set 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 16 - # CONFIG_UEVENT_HELPER is not set 17 - CONFIG_DEVTMPFS=y 18 - CONFIG_DEVTMPFS_MOUNT=y 19 - # CONFIG_STANDALONE is not set 20 - # CONFIG_PREVENT_FIRMWARE_BUILD is not set 21 - # CONFIG_FW_LOADER is not set 22 - # CONFIG_ALLOW_DEV_COREDUMP is not set 23 - CONFIG_NETDEVICES=y 24 - # CONFIG_NET_CORE is not set 25 - # CONFIG_NET_VENDOR_ARC is not set 26 - # CONFIG_NET_CADENCE is not set 27 - # CONFIG_NET_VENDOR_BROADCOM is not set 28 - # CONFIG_NET_VENDOR_EZCHIP is not set 29 - # CONFIG_NET_VENDOR_INTEL is not set 30 - # CONFIG_NET_VENDOR_MARVELL is not set 31 - # CONFIG_NET_VENDOR_MICREL is not set 32 - # CONFIG_NET_VENDOR_NATSEMI is not set 33 - # CONFIG_NET_VENDOR_NETRONOME is not set 34 - # CONFIG_NET_VENDOR_QUALCOMM is not set 35 - # CONFIG_NET_VENDOR_RENESAS is not set 36 - # CONFIG_NET_VENDOR_ROCKER is not set 37 - # CONFIG_NET_VENDOR_SAMSUNG is not set 38 - # CONFIG_NET_VENDOR_SEEQ is not set 39 - # CONFIG_NET_VENDOR_SMSC is not set 40 - # CONFIG_NET_VENDOR_STMICRO is not set 41 - # CONFIG_NET_VENDOR_SYNOPSYS is not set 42 - # CONFIG_NET_VENDOR_VIA is not set 43 - # CONFIG_NET_VENDOR_WIZNET is not set 44 - CONFIG_XILINX_EMACLITE=y 45 - CONFIG_SMSC_PHY=y 46 - # CONFIG_WLAN is not set 47 - # CONFIG_INPUT_MOUSEDEV is not set 48 - # CONFIG_INPUT_KEYBOARD is not set 49 - # CONFIG_INPUT_MOUSE is not set 50 - # CONFIG_SERIO is not set 51 - CONFIG_VT_HW_CONSOLE_BINDING=y 52 - # CONFIG_UNIX98_PTYS is not set 53 - # CONFIG_LEGACY_PTYS is not set 54 - CONFIG_SERIAL_8250=y 55 - CONFIG_SERIAL_8250_CONSOLE=y 56 - CONFIG_SERIAL_OF_PLATFORM=y 57 - # CONFIG_HW_RANDOM is not set 58 - CONFIG_I2C=y 59 - CONFIG_I2C_CHARDEV=y 60 - # CONFIG_I2C_HELPER_AUTO is not set 61 - CONFIG_I2C_XILINX=y 62 - CONFIG_GPIO_SYSFS=y 63 - CONFIG_GPIO_XILINX=y 64 - CONFIG_SENSORS_ADT7410=y 65 - # CONFIG_USB_SUPPORT is not set 66 - # CONFIG_MIPS_PLATFORM_DEVICES is not set 67 - # CONFIG_IOMMU_SUPPORT is not set 68 - # CONFIG_PROC_PAGE_MONITOR is not set 69 - CONFIG_TMPFS=y 70 - # CONFIG_MISC_FILESYSTEMS is not set 71 - CONFIG_PANIC_ON_OOPS=y 72 - # CONFIG_SCHED_DEBUG is not set 73 - # CONFIG_FTRACE is not set 74 - CONFIG_CMDLINE_BOOL=y 75 - CONFIG_CMDLINE="console=ttyS0,115200"
+6
arch/mips/generic/Kconfig
··· 43 43 Enable this to include the FDT for the 169445 platform from 44 44 National Instruments in the FIT kernel image. 45 45 46 + config FIT_IMAGE_FDT_XILFPGA 47 + bool "Include FDT for Xilfpga" 48 + help 49 + Enable this to include the FDT for the MIPSfpga platform 50 + from Imagination Technologies in the FIT kernel image. 51 + 46 52 endif
+22
arch/mips/generic/board-xilfpga.its.S
··· 1 + / { 2 + images { 3 + fdt@xilfpga { 4 + description = "MIPSfpga (xilfpga) Device Tree"; 5 + data = /incbin/("boot/dts/xilfpga/nexys4ddr.dtb"); 6 + type = "flat_dt"; 7 + arch = "mips"; 8 + compression = "none"; 9 + hash@0 { 10 + algo = "sha1"; 11 + }; 12 + }; 13 + }; 14 + 15 + configurations { 16 + conf@xilfpga { 17 + description = "MIPSfpga Linux kernel"; 18 + kernel = "kernel@0"; 19 + fdt = "fdt@xilfpga"; 20 + }; 21 + }; 22 + };
+9 -7
arch/mips/include/asm/asmmacro.h
··· 19 19 #include <asm/asmmacro-64.h> 20 20 #endif 21 21 22 + /* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */ 23 + #undef fp 24 + 22 25 /* 23 26 * Helper macros for generating raw instruction encodings. 24 27 */ ··· 108 105 .macro fpu_save_16odd thread 109 106 .set push 110 107 .set mips64r2 108 + .set fp=64 111 109 SET_HARDFLOAT 112 110 sdc1 $f1, THREAD_FPR1(\thread) 113 111 sdc1 $f3, THREAD_FPR3(\thread) ··· 130 126 .endm 131 127 132 128 .macro fpu_save_double thread status tmp 133 - #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ 134 - defined(CONFIG_CPU_MIPS32_R6) 129 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ 130 + defined(CONFIG_CPU_MIPSR6) 135 131 sll \tmp, \status, 5 136 132 bgez \tmp, 10f 137 133 fpu_save_16odd \thread ··· 167 163 .macro fpu_restore_16odd thread 168 164 .set push 169 165 .set mips64r2 166 + .set fp=64 170 167 SET_HARDFLOAT 171 168 ldc1 $f1, THREAD_FPR1(\thread) 172 169 ldc1 $f3, THREAD_FPR3(\thread) ··· 189 184 .endm 190 185 191 186 .macro fpu_restore_double thread status tmp 192 - #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ 193 - defined(CONFIG_CPU_MIPS32_R6) 187 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ 188 + defined(CONFIG_CPU_MIPSR6) 194 189 sll \tmp, \status, 5 195 190 bgez \tmp, 10f # 16 register mode? 196 191 ··· 239 234 .endm 240 235 241 236 #ifdef TOOLCHAIN_SUPPORTS_MSA 242 - /* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */ 243 - #undef fp 244 - 245 237 .macro _cfcmsa rd, cs 246 238 .set push 247 239 .set mips32r2
+1
arch/mips/include/asm/bitops.h
··· 456 456 { 457 457 smp_mb__before_llsc(); 458 458 __clear_bit(nr, addr); 459 + nudge_writes(); 459 460 } 460 461 461 462 /*
+2
arch/mips/include/asm/cmpxchg.h
··· 204 204 #else 205 205 #include <asm-generic/cmpxchg-local.h> 206 206 #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 207 + #ifndef CONFIG_SMP 207 208 #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) 209 + #endif 208 210 #endif 209 211 210 212 #undef __scbeqz
+6 -8
arch/mips/include/asm/mipsregs.h
··· 1355 1355 if (sel == 0) \ 1356 1356 __asm__ __volatile__( \ 1357 1357 ".set\tmips64\n\t" \ 1358 - "dmfc0\t%M0, " #source "\n\t" \ 1359 - "dsll\t%L0, %M0, 32\n\t" \ 1360 - "dsra\t%M0, %M0, 32\n\t" \ 1361 - "dsra\t%L0, %L0, 32\n\t" \ 1358 + "dmfc0\t%L0, " #source "\n\t" \ 1359 + "dsra\t%M0, %L0, 32\n\t" \ 1360 + "sll\t%L0, %L0, 0\n\t" \ 1362 1361 ".set\tmips0" \ 1363 1362 : "=r" (__val)); \ 1364 1363 else \ 1365 1364 __asm__ __volatile__( \ 1366 1365 ".set\tmips64\n\t" \ 1367 - "dmfc0\t%M0, " #source ", " #sel "\n\t" \ 1368 - "dsll\t%L0, %M0, 32\n\t" \ 1369 - "dsra\t%M0, %M0, 32\n\t" \ 1370 - "dsra\t%L0, %L0, 32\n\t" \ 1366 + "dmfc0\t%L0, " #source ", " #sel "\n\t" \ 1367 + "dsra\t%M0, %L0, 32\n\t" \ 1368 + "sll\t%L0, %L0, 0\n\t" \ 1371 1369 ".set\tmips0" \ 1372 1370 : "=r" (__val)); \ 1373 1371 local_irq_restore(__flags); \
+3 -1
arch/mips/include/asm/octeon/cvmx-fpa.h
··· 36 36 #ifndef __CVMX_FPA_H__ 37 37 #define __CVMX_FPA_H__ 38 38 39 + #include <linux/delay.h> 40 + 39 41 #include <asm/octeon/cvmx-address.h> 40 42 #include <asm/octeon/cvmx-fpa-defs.h> 41 43 ··· 167 165 } 168 166 169 167 /* Enforce a 10 cycle delay between config and enable */ 170 - cvmx_wait(10); 168 + __delay(10); 171 169 } 172 170 173 171 /* FIXME: CVMX_FPA_CTL_STATUS read is unmodelled */
+2 -13
arch/mips/include/asm/octeon/cvmx.h
··· 30 30 31 31 #include <linux/kernel.h> 32 32 #include <linux/string.h> 33 + #include <linux/delay.h> 33 34 34 35 enum cvmx_mips_space { 35 36 CVMX_MIPS_SPACE_XKSEG = 3LL, ··· 430 429 } 431 430 432 431 /** 433 - * Wait for the specified number of cycle 434 - * 435 - */ 436 - static inline void cvmx_wait(uint64_t cycles) 437 - { 438 - uint64_t done = cvmx_get_cycle() + cycles; 439 - 440 - while (cvmx_get_cycle() < done) 441 - ; /* Spin */ 442 - } 443 - 444 - /** 445 432 * Reads a chip global cycle counter. This counts CPU cycles since 446 433 * chip reset. The counter is 64 bit. 447 434 * This register does not exist on CN38XX pass 1 silicion ··· 470 481 result = -1; \ 471 482 break; \ 472 483 } else \ 473 - cvmx_wait(100); \ 484 + __delay(100); \ 474 485 } \ 475 486 } while (0); \ 476 487 result; \
+2 -2
arch/mips/include/asm/page.h
··· 240 240 241 241 #endif 242 242 243 - #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \ 244 - (kaddr)))) 243 + #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr))) 244 + #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr)) 245 245 246 246 extern int __virt_addr_valid(const volatile void *kaddr); 247 247 #define virt_addr_valid(kaddr) \
-2
arch/mips/include/asm/processor.h
··· 368 368 /* Free all resources held by a thread. */ 369 369 #define release_thread(thread) do { } while(0) 370 370 371 - extern unsigned long thread_saved_pc(struct task_struct *tsk); 372 - 373 371 /* 374 372 * Do necessary setup to start up a newly executed thread. 375 373 */
+1 -1
arch/mips/include/asm/smp.h
··· 29 29 30 30 /* Map from cpu id to sequential logical cpu number. This will only 31 31 not be idempotent when cpus failed to come on-line. */ 32 - extern int __cpu_number_map[NR_CPUS]; 32 + extern int __cpu_number_map[CONFIG_MIPS_NR_CPU_NR_MAP]; 33 33 #define cpu_number_map(cpu) __cpu_number_map[cpu] 34 34 35 35 /* The reverse map from sequential logical cpu number to cpu id. */
+25 -4
arch/mips/include/asm/syscall.h
··· 26 26 #define __NR_syscall 4000 27 27 #endif 28 28 29 + static inline bool mips_syscall_is_indirect(struct task_struct *task, 30 + struct pt_regs *regs) 31 + { 32 + /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */ 33 + return (IS_ENABLED(CONFIG_32BIT) || 34 + test_tsk_thread_flag(task, TIF_32BIT_REGS)) && 35 + (regs->regs[2] == __NR_syscall); 36 + } 37 + 29 38 static inline long syscall_get_nr(struct task_struct *task, 30 39 struct pt_regs *regs) 31 40 { 32 41 return current_thread_info()->syscall; 42 + } 43 + 44 + static inline void mips_syscall_update_nr(struct task_struct *task, 45 + struct pt_regs *regs) 46 + { 47 + /* 48 + * v0 is the system call number, except for O32 ABI syscall(), where it 49 + * ends up in a0. 50 + */ 51 + if (mips_syscall_is_indirect(task, regs)) 52 + task_thread_info(task)->syscall = regs->regs[4]; 53 + else 54 + task_thread_info(task)->syscall = regs->regs[2]; 33 55 } 34 56 35 57 static inline unsigned long mips_get_syscall_arg(unsigned long *arg, ··· 120 98 unsigned long *args) 121 99 { 122 100 int ret; 123 - /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */ 124 - if ((IS_ENABLED(CONFIG_32BIT) || 125 - test_tsk_thread_flag(task, TIF_32BIT_REGS)) && 126 - (regs->regs[2] == __NR_syscall)) 101 + 102 + /* O32 ABI syscall() */ 103 + if (mips_syscall_is_indirect(task, regs)) 127 104 i++; 128 105 129 106 while (n--)
+1 -1
arch/mips/kernel/process.c
··· 487 487 /* 488 488 * Return saved PC of a blocked thread. 489 489 */ 490 - unsigned long thread_saved_pc(struct task_struct *tsk) 490 + static unsigned long thread_saved_pc(struct task_struct *tsk) 491 491 { 492 492 struct thread_struct *t = &tsk->thread; 493 493
+38 -3
arch/mips/kernel/ptrace.c
··· 144 144 145 145 /* badvaddr, status, and cause may not be written. */ 146 146 147 + /* System call number may have been changed */ 148 + mips_syscall_update_nr(child, regs); 149 + 147 150 return 0; 148 151 } 149 152 ··· 348 345 } 349 346 } 350 347 348 + /* System call number may have been changed */ 349 + mips_syscall_update_nr(target, regs); 350 + 351 351 return 0; 352 352 } 353 353 ··· 410 404 break; 411 405 } 412 406 } 407 + 408 + /* System call number may have been changed */ 409 + mips_syscall_update_nr(target, regs); 413 410 414 411 return 0; 415 412 } ··· 627 618 .n = ARRAY_SIZE(mips64_regsets), 628 619 }; 629 620 621 + #ifdef CONFIG_MIPS32_N32 622 + 623 + static const struct user_regset_view user_mipsn32_view = { 624 + .name = "mipsn32", 625 + .e_flags = EF_MIPS_ABI2, 626 + .e_machine = ELF_ARCH, 627 + .ei_osabi = ELF_OSABI, 628 + .regsets = mips64_regsets, 629 + .n = ARRAY_SIZE(mips64_regsets), 630 + }; 631 + 632 + #endif /* CONFIG_MIPS32_N32 */ 633 + 630 634 #endif /* CONFIG_64BIT */ 631 635 632 636 const struct user_regset_view *task_user_regset_view(struct task_struct *task) ··· 650 628 #ifdef CONFIG_MIPS32_O32 651 629 if (test_tsk_thread_flag(task, TIF_32BIT_REGS)) 652 630 return &user_mips_view; 631 + #endif 632 + #ifdef CONFIG_MIPS32_N32 633 + if (test_tsk_thread_flag(task, TIF_32BIT_ADDR)) 634 + return &user_mipsn32_view; 653 635 #endif 654 636 return &user_mips64_view; 655 637 #endif ··· 779 753 switch (addr) { 780 754 case 0 ... 31: 781 755 regs->regs[addr] = data; 756 + /* System call number may have been changed */ 757 + if (addr == 2) 758 + mips_syscall_update_nr(child, regs); 759 + else if (addr == 4 && 760 + mips_syscall_is_indirect(child, regs)) 761 + mips_syscall_update_nr(child, regs); 782 762 break; 783 763 case FPR_BASE ... FPR_BASE + 31: { 784 764 union fpureg *fregs = get_fpu_regs(child); ··· 896 864 897 865 current_thread_info()->syscall = syscall; 898 866 899 - if (test_thread_flag(TIF_SYSCALL_TRACE) && 900 - tracehook_report_syscall_entry(regs)) 901 - return -1; 867 + if (test_thread_flag(TIF_SYSCALL_TRACE)) { 868 + if (tracehook_report_syscall_entry(regs)) 869 + return -1; 870 + syscall = current_thread_info()->syscall; 871 + } 902 872 903 873 #ifdef CONFIG_SECCOMP 904 874 if (unlikely(test_thread_flag(TIF_SECCOMP))) { ··· 918 884 ret = __secure_computing(&sd); 919 885 if (ret == -1) 920 886 return ret; 887 + syscall = current_thread_info()->syscall; 921 888 } 922 889 #endif 923 890
+7
arch/mips/kernel/ptrace32.c
··· 33 33 #include <asm/pgtable.h> 34 34 #include <asm/page.h> 35 35 #include <asm/reg.h> 36 + #include <asm/syscall.h> 36 37 #include <linux/uaccess.h> 37 38 #include <asm/bootinfo.h> 38 39 ··· 196 195 switch (addr) { 197 196 case 0 ... 31: 198 197 regs->regs[addr] = data; 198 + /* System call number may have been changed */ 199 + if (addr == 2) 200 + mips_syscall_update_nr(child, regs); 201 + else if (addr == 4 && 202 + mips_syscall_is_indirect(child, regs)) 203 + mips_syscall_update_nr(child, regs); 199 204 break; 200 205 case FPR_BASE ... FPR_BASE + 31: { 201 206 union fpureg *fregs = get_fpu_regs(child);
+10 -10
arch/mips/kernel/r4k_fpu.S
··· 40 40 */ 41 41 LEAF(_save_fp) 42 42 EXPORT_SYMBOL(_save_fp) 43 - #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ 44 - defined(CONFIG_CPU_MIPS32_R6) 43 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ 44 + defined(CONFIG_CPU_MIPSR6) 45 45 mfc0 t0, CP0_STATUS 46 46 #endif 47 47 fpu_save_double a0 t0 t1 # clobbers t1 ··· 52 52 * Restore a thread's fp context. 53 53 */ 54 54 LEAF(_restore_fp) 55 - #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ 56 - defined(CONFIG_CPU_MIPS32_R6) 55 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ 56 + defined(CONFIG_CPU_MIPSR6) 57 57 mfc0 t0, CP0_STATUS 58 58 #endif 59 59 fpu_restore_double a0 t0 t1 # clobbers t1 ··· 246 246 cfc1 t1, fcr31 247 247 .set pop 248 248 249 - #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ 250 - defined(CONFIG_CPU_MIPS32_R6) 249 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ 250 + defined(CONFIG_CPU_MIPSR6) 251 251 .set push 252 252 SET_HARDFLOAT 253 - #ifdef CONFIG_CPU_MIPS32_R2 253 + #ifdef CONFIG_CPU_MIPSR2 254 254 .set mips32r2 255 255 .set fp=64 256 256 mfc0 t0, CP0_STATUS ··· 314 314 LEAF(_restore_fp_context) 315 315 EX lw t1, 0(a1) 316 316 317 - #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ 318 - defined(CONFIG_CPU_MIPS32_R6) 317 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ 318 + defined(CONFIG_CPU_MIPSR6) 319 319 .set push 320 320 SET_HARDFLOAT 321 - #ifdef CONFIG_CPU_MIPS32_R2 321 + #ifdef CONFIG_CPU_MIPSR2 322 322 .set mips32r2 323 323 .set fp=64 324 324 mfc0 t0, CP0_STATUS
+4
arch/mips/kernel/setup.c
··· 80 80 81 81 static struct resource code_resource = { .name = "Kernel code", }; 82 82 static struct resource data_resource = { .name = "Kernel data", }; 83 + static struct resource bss_resource = { .name = "Kernel bss", }; 83 84 84 85 static void *detect_magic __initdata = detect_memory_region; 85 86 ··· 928 927 code_resource.end = __pa_symbol(&_etext) - 1; 929 928 data_resource.start = __pa_symbol(&_etext); 930 929 data_resource.end = __pa_symbol(&_edata) - 1; 930 + bss_resource.start = __pa_symbol(&__bss_start); 931 + bss_resource.end = __pa_symbol(&__bss_stop) - 1; 931 932 932 933 for (i = 0; i < boot_mem_map.nr_map; i++) { 933 934 struct resource *res; ··· 969 966 */ 970 967 request_resource(res, &code_resource); 971 968 request_resource(res, &data_resource); 969 + request_resource(res, &bss_resource); 972 970 request_crashkernel(res); 973 971 } 974 972 }
+1 -1
arch/mips/kernel/smp.c
··· 48 48 #include <asm/setup.h> 49 49 #include <asm/maar.h> 50 50 51 - int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ 51 + int __cpu_number_map[CONFIG_MIPS_NR_CPU_NR_MAP]; /* Map physical to logical */ 52 52 EXPORT_SYMBOL(__cpu_number_map); 53 53 54 54 int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
+2 -4
arch/mips/lantiq/xway/sysctrl.c
··· 446 446 447 447 /* add our generic xway clocks */ 448 448 clkdev_add_pmu("10000000.fpi", NULL, 0, 0, PMU_FPI); 449 - clkdev_add_pmu("1e100400.serial", NULL, 0, 0, PMU_ASC0); 450 449 clkdev_add_pmu("1e100a00.gptu", NULL, 1, 0, PMU_GPT); 451 450 clkdev_add_pmu("1e100bb0.stp", NULL, 1, 0, PMU_STP); 451 + clkdev_add_pmu("1e100c00.serial", NULL, 0, 0, PMU_ASC1); 452 452 clkdev_add_pmu("1e104100.dma", NULL, 1, 0, PMU_DMA); 453 453 clkdev_add_pmu("1e100800.spi", NULL, 1, 0, PMU_SPI); 454 454 clkdev_add_pmu("1e105300.ebu", NULL, 0, 0, PMU_EBU); ··· 462 462 clkdev_add_pmu("1e180000.etop", NULL, 1, 0, PMU_PPE); 463 463 } 464 464 465 - if (!of_machine_is_compatible("lantiq,ase")) { 466 - clkdev_add_pmu("1e100c00.serial", NULL, 0, 0, PMU_ASC1); 465 + if (!of_machine_is_compatible("lantiq,ase")) 467 466 clkdev_add_pci(); 468 - } 469 467 470 468 if (of_machine_is_compatible("lantiq,grx390") || 471 469 of_machine_is_compatible("lantiq,ar10")) {
+1 -2
arch/mips/lasat/picvue_proc.c
··· 197 197 if (proc_entry == NULL) 198 198 goto error; 199 199 200 - init_timer(&timer); 201 - timer.function = pvc_proc_timerfunc; 200 + setup_timer(&timer, pvc_proc_timerfunc, 0UL); 202 201 203 202 return 0; 204 203 error:
+24 -22
arch/mips/math-emu/cp1emu.c
··· 810 810 #define SITOREG(si, x) \ 811 811 do { \ 812 812 if (cop1_64bit(xcp) && !hybrid_fprs()) { \ 813 - unsigned i; \ 813 + unsigned int i; \ 814 814 set_fpr32(&ctx->fpr[x], 0, si); \ 815 815 for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val32); i++) \ 816 816 set_fpr32(&ctx->fpr[x], i, 0); \ ··· 823 823 824 824 #define SITOHREG(si, x) \ 825 825 do { \ 826 - unsigned i; \ 826 + unsigned int i; \ 827 827 set_fpr32(&ctx->fpr[x], 1, si); \ 828 828 for (i = 2; i < ARRAY_SIZE(ctx->fpr[x].val32); i++) \ 829 829 set_fpr32(&ctx->fpr[x], i, 0); \ ··· 834 834 835 835 #define DITOREG(di, x) \ 836 836 do { \ 837 - unsigned fpr, i; \ 837 + unsigned int fpr, i; \ 838 838 fpr = (x) & ~(cop1_64bit(xcp) ^ 1); \ 839 839 set_fpr64(&ctx->fpr[fpr], 0, di); \ 840 840 for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++) \ ··· 1465 1465 static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, 1466 1466 mips_instruction ir, void __user **fault_addr) 1467 1467 { 1468 - unsigned rcsr = 0; /* resulting csr */ 1468 + unsigned int rcsr = 0; /* resulting csr */ 1469 1469 1470 1470 MIPS_FPU_EMU_INC_STATS(cp1xops); 1471 1471 ··· 1661 1661 mips_instruction ir) 1662 1662 { 1663 1663 int rfmt; /* resulting format */ 1664 - unsigned rcsr = 0; /* resulting csr */ 1664 + unsigned int rcsr = 0; /* resulting csr */ 1665 1665 unsigned int oldrm; 1666 1666 unsigned int cbit; 1667 - unsigned cond; 1667 + unsigned int cond; 1668 1668 union { 1669 1669 union ieee754dp d; 1670 1670 union ieee754sp s; ··· 1795 1795 SPFROMREG(fs, MIPSInst_FS(ir)); 1796 1796 SPFROMREG(fd, MIPSInst_FD(ir)); 1797 1797 rv.s = ieee754sp_maddf(fd, fs, ft); 1798 - break; 1798 + goto copcsr; 1799 1799 } 1800 1800 1801 1801 case fmsubf_op: { ··· 1809 1809 SPFROMREG(fs, MIPSInst_FS(ir)); 1810 1810 SPFROMREG(fd, MIPSInst_FD(ir)); 1811 1811 rv.s = ieee754sp_msubf(fd, fs, ft); 1812 - break; 1812 + goto copcsr; 1813 1813 } 1814 1814 1815 1815 case frint_op: { ··· 1834 1834 SPFROMREG(fs, MIPSInst_FS(ir)); 1835 1835 rv.w = ieee754sp_2008class(fs); 1836 1836 rfmt = w_fmt; 1837 - break; 1837 + goto copcsr; 1838 1838 } 1839 1839 1840 1840 case fmin_op: { ··· 1847 1847 SPFROMREG(ft, MIPSInst_FT(ir)); 1848 1848 SPFROMREG(fs, MIPSInst_FS(ir)); 1849 1849 rv.s = ieee754sp_fmin(fs, ft); 1850 - break; 1850 + goto copcsr; 1851 1851 } 1852 1852 1853 1853 case fmina_op: { ··· 1860 1860 SPFROMREG(ft, MIPSInst_FT(ir)); 1861 1861 SPFROMREG(fs, MIPSInst_FS(ir)); 1862 1862 rv.s = ieee754sp_fmina(fs, ft); 1863 - break; 1863 + goto copcsr; 1864 1864 } 1865 1865 1866 1866 case fmax_op: { ··· 1873 1873 SPFROMREG(ft, MIPSInst_FT(ir)); 1874 1874 SPFROMREG(fs, MIPSInst_FS(ir)); 1875 1875 rv.s = ieee754sp_fmax(fs, ft); 1876 - break; 1876 + goto copcsr; 1877 1877 } 1878 1878 1879 1879 case fmaxa_op: { ··· 1886 1886 SPFROMREG(ft, MIPSInst_FT(ir)); 1887 1887 SPFROMREG(fs, MIPSInst_FS(ir)); 1888 1888 rv.s = ieee754sp_fmaxa(fs, ft); 1889 - break; 1889 + goto copcsr; 1890 1890 } 1891 1891 1892 1892 case fabs_op: ··· 2029 2029 2030 2030 default: 2031 2031 if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) { 2032 - unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op; 2032 + unsigned int cmpop; 2033 2033 union ieee754sp fs, ft; 2034 2034 2035 + cmpop = MIPSInst_FUNC(ir) - fcmp_op; 2035 2036 SPFROMREG(fs, MIPSInst_FS(ir)); 2036 2037 SPFROMREG(ft, MIPSInst_FT(ir)); 2037 2038 rv.w = ieee754sp_cmp(fs, ft, ··· 2166 2165 DPFROMREG(fs, MIPSInst_FS(ir)); 2167 2166 DPFROMREG(fd, MIPSInst_FD(ir)); 2168 2167 rv.d = ieee754dp_maddf(fd, fs, ft); 2169 - break; 2168 + goto copcsr; 2170 2169 } 2171 2170 2172 2171 case fmsubf_op: { ··· 2180 2179 DPFROMREG(fs, MIPSInst_FS(ir)); 2181 2180 DPFROMREG(fd, MIPSInst_FD(ir)); 2182 2181 rv.d = ieee754dp_msubf(fd, fs, ft); 2183 - break; 2182 + goto copcsr; 2184 2183 } 2185 2184 2186 2185 case frint_op: { ··· 2205 2204 DPFROMREG(fs, MIPSInst_FS(ir)); 2206 2205 rv.l = ieee754dp_2008class(fs); 2207 2206 rfmt = l_fmt; 2208 - break; 2207 + goto copcsr; 2209 2208 } 2210 2209 2211 2210 case fmin_op: { ··· 2218 2217 DPFROMREG(ft, MIPSInst_FT(ir)); 2219 2218 DPFROMREG(fs, MIPSInst_FS(ir)); 2220 2219 rv.d = ieee754dp_fmin(fs, ft); 2221 - break; 2220 + goto copcsr; 2222 2221 } 2223 2222 2224 2223 case fmina_op: { ··· 2231 2230 DPFROMREG(ft, MIPSInst_FT(ir)); 2232 2231 DPFROMREG(fs, MIPSInst_FS(ir)); 2233 2232 rv.d = ieee754dp_fmina(fs, ft); 2234 - break; 2233 + goto copcsr; 2235 2234 } 2236 2235 2237 2236 case fmax_op: { ··· 2244 2243 DPFROMREG(ft, MIPSInst_FT(ir)); 2245 2244 DPFROMREG(fs, MIPSInst_FS(ir)); 2246 2245 rv.d = ieee754dp_fmax(fs, ft); 2247 - break; 2246 + goto copcsr; 2248 2247 } 2249 2248 2250 2249 case fmaxa_op: { ··· 2257 2256 DPFROMREG(ft, MIPSInst_FT(ir)); 2258 2257 DPFROMREG(fs, MIPSInst_FS(ir)); 2259 2258 rv.d = ieee754dp_fmaxa(fs, ft); 2260 - break; 2259 + goto copcsr; 2261 2260 } 2262 2261 2263 2262 case fabs_op: ··· 2380 2379 2381 2380 default: 2382 2381 if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) { 2383 - unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op; 2382 + unsigned int cmpop; 2384 2383 union ieee754dp fs, ft; 2385 2384 2385 + cmpop = MIPSInst_FUNC(ir) - fcmp_op; 2386 2386 DPFROMREG(fs, MIPSInst_FS(ir)); 2387 2387 DPFROMREG(ft, MIPSInst_FT(ir)); 2388 2388 rv.w = ieee754dp_cmp(fs, ft,
+4 -4
arch/mips/math-emu/dp_maddf.c
··· 45 45 { 46 46 int re; 47 47 int rs; 48 - unsigned lxm; 49 - unsigned hxm; 50 - unsigned lym; 51 - unsigned hym; 48 + unsigned int lxm; 49 + unsigned int hxm; 50 + unsigned int lym; 51 + unsigned int hym; 52 52 u64 lrm; 53 53 u64 hrm; 54 54 u64 lzm;
+4 -4
arch/mips/math-emu/dp_mul.c
··· 26 26 int re; 27 27 int rs; 28 28 u64 rm; 29 - unsigned lxm; 30 - unsigned hxm; 31 - unsigned lym; 32 - unsigned hym; 29 + unsigned int lxm; 30 + unsigned int hxm; 31 + unsigned int lym; 32 + unsigned int hym; 33 33 u64 lrm; 34 34 u64 hrm; 35 35 u64 t;
+2 -2
arch/mips/math-emu/dp_sqrt.c
··· 21 21 22 22 #include "ieee754dp.h" 23 23 24 - static const unsigned table[] = { 24 + static const unsigned int table[] = { 25 25 0, 1204, 3062, 5746, 9193, 13348, 18162, 23592, 26 26 29598, 36145, 43202, 50740, 58733, 67158, 75992, 27 27 85215, 83599, 71378, 60428, 50647, 41945, 34246, ··· 33 33 { 34 34 struct _ieee754_csr oldcsr; 35 35 union ieee754dp y, z, t; 36 - unsigned scalx, yh; 36 + unsigned int scalx, yh; 37 37 COMPXDP; 38 38 39 39 EXPLODEXDP;
+8 -7
arch/mips/math-emu/ieee754.h
··· 165 165 }; 166 166 #define ieee754_csr (*(struct _ieee754_csr *)(&current->thread.fpu.fcr31)) 167 167 168 - static inline unsigned ieee754_getrm(void) 168 + static inline unsigned int ieee754_getrm(void) 169 169 { 170 170 return (ieee754_csr.rm); 171 171 } 172 - static inline unsigned ieee754_setrm(unsigned rm) 172 + 173 + static inline unsigned int ieee754_setrm(unsigned int rm) 173 174 { 174 175 return (ieee754_csr.rm = rm); 175 176 } ··· 178 177 /* 179 178 * get current exceptions 180 179 */ 181 - static inline unsigned ieee754_getcx(void) 180 + static inline unsigned int ieee754_getcx(void) 182 181 { 183 182 return (ieee754_csr.cx); 184 183 } 185 184 186 185 /* test for current exception condition 187 186 */ 188 - static inline int ieee754_cxtest(unsigned n) 187 + static inline int ieee754_cxtest(unsigned int n) 189 188 { 190 189 return (ieee754_csr.cx & n); 191 190 } ··· 193 192 /* 194 193 * get sticky exceptions 195 194 */ 196 - static inline unsigned ieee754_getsx(void) 195 + static inline unsigned int ieee754_getsx(void) 197 196 { 198 197 return (ieee754_csr.sx); 199 198 } 200 199 201 200 /* clear sticky conditions 202 201 */ 203 - static inline unsigned ieee754_clrsx(void) 202 + static inline unsigned int ieee754_clrsx(void) 204 203 { 205 204 return (ieee754_csr.sx = 0); 206 205 } 207 206 208 207 /* test for sticky exception condition 209 208 */ 210 - static inline int ieee754_sxtest(unsigned n) 209 + static inline int ieee754_sxtest(unsigned int n) 211 210 { 212 211 return (ieee754_csr.sx & n); 213 212 }
+3 -3
arch/mips/math-emu/ieee754int.h
··· 54 54 } 55 55 56 56 #define COMPXSP \ 57 - unsigned xm; int xe; int xs __maybe_unused; int xc 57 + unsigned int xm; int xe; int xs __maybe_unused; int xc 58 58 59 59 #define COMPYSP \ 60 - unsigned ym; int ye; int ys; int yc 60 + unsigned int ym; int ye; int ys; int yc 61 61 62 62 #define COMPZSP \ 63 - unsigned zm; int ze; int zs; int zc 63 + unsigned int zm; int ze; int zs; int zc 64 64 65 65 #define EXPLODESP(v, vc, vs, ve, vm) \ 66 66 { \
+2 -2
arch/mips/math-emu/ieee754sp.c
··· 65 65 return r; 66 66 } 67 67 68 - static unsigned ieee754sp_get_rounding(int sn, unsigned xm) 68 + static unsigned int ieee754sp_get_rounding(int sn, unsigned int xm) 69 69 { 70 70 /* inexact must round of 3 bits 71 71 */ ··· 96 96 * xe is an unbiased exponent 97 97 * xm is 3bit extended precision value. 98 98 */ 99 - union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm) 99 + union ieee754sp ieee754sp_format(int sn, int xe, unsigned int xm) 100 100 { 101 101 assert(xm); /* we don't gen exact zeros (probably should) */ 102 102
+1 -1
arch/mips/math-emu/ieee754sp.h
··· 69 69 #define SPDNORMY SPDNORMx(ym, ye) 70 70 #define SPDNORMZ SPDNORMx(zm, ze) 71 71 72 - static inline union ieee754sp buildsp(int s, int bx, unsigned m) 72 + static inline union ieee754sp buildsp(int s, int bx, unsigned int m) 73 73 { 74 74 union ieee754sp r; 75 75
+2 -2
arch/mips/math-emu/sp_div.c
··· 23 23 24 24 union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y) 25 25 { 26 - unsigned rm; 26 + unsigned int rm; 27 27 int re; 28 - unsigned bm; 28 + unsigned int bm; 29 29 30 30 COMPXSP; 31 31 COMPYSP;
+1 -1
arch/mips/math-emu/sp_fint.c
··· 23 23 24 24 union ieee754sp ieee754sp_fint(int x) 25 25 { 26 - unsigned xm; 26 + unsigned int xm; 27 27 int xe; 28 28 int xs; 29 29
+3 -3
arch/mips/math-emu/sp_maddf.c
··· 20 20 { 21 21 int re; 22 22 int rs; 23 - unsigned rm; 24 - uint64_t rm64; 25 - uint64_t zm64; 23 + unsigned int rm; 24 + u64 rm64; 25 + u64 zm64; 26 26 int s; 27 27 28 28 COMPXSP;
+5 -5
arch/mips/math-emu/sp_mul.c
··· 25 25 { 26 26 int re; 27 27 int rs; 28 - unsigned rm; 28 + unsigned int rm; 29 29 unsigned short lxm; 30 30 unsigned short hxm; 31 31 unsigned short lym; 32 32 unsigned short hym; 33 - unsigned lrm; 34 - unsigned hrm; 35 - unsigned t; 36 - unsigned at; 33 + unsigned int lrm; 34 + unsigned int hrm; 35 + unsigned int t; 36 + unsigned int at; 37 37 38 38 COMPXSP; 39 39 COMPYSP;
+1 -1
arch/mips/mm/dma-default.c
··· 179 179 void *cpu_addr, dma_addr_t dma_addr, size_t size, 180 180 unsigned long attrs) 181 181 { 182 - unsigned long user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 182 + unsigned long user_count = vma_pages(vma); 183 183 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; 184 184 unsigned long addr = (unsigned long)cpu_addr; 185 185 unsigned long off = vma->vm_pgoff;
-4
arch/mips/mm/init.c
··· 402 402 void __init paging_init(void) 403 403 { 404 404 unsigned long max_zone_pfns[MAX_NR_ZONES]; 405 - unsigned long lastpfn __maybe_unused; 406 405 407 406 pagetable_init(); 408 407 ··· 415 416 max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; 416 417 #endif 417 418 max_zone_pfns[ZONE_NORMAL] = max_low_pfn; 418 - lastpfn = max_low_pfn; 419 419 #ifdef CONFIG_HIGHMEM 420 420 max_zone_pfns[ZONE_HIGHMEM] = highend_pfn; 421 - lastpfn = highend_pfn; 422 421 423 422 if (cpu_has_dc_aliases && max_low_pfn != highend_pfn) { 424 423 printk(KERN_WARNING "This processor doesn't support highmem." 425 424 " %ldk highmem ignored\n", 426 425 (highend_pfn - max_low_pfn) << (PAGE_SHIFT - 10)); 427 426 max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn; 428 - lastpfn = max_low_pfn; 429 427 } 430 428 #endif 431 429
+7 -8
arch/mips/pci/pci-mt7620.c
··· 33 33 #define RALINK_GPIOMODE 0x60 34 34 35 35 #define PPLL_CFG1 0x9c 36 - #define PDRV_SW_SET BIT(23) 37 36 38 37 #define PPLL_DRV 0xa0 39 - #define PDRV_SW_SET (1<<31) 40 - #define LC_CKDRVPD (1<<19) 41 - #define LC_CKDRVOHZ (1<<18) 42 - #define LC_CKDRVHZ (1<<17) 43 - #define LC_CKTEST (1<<16) 38 + #define PDRV_SW_SET BIT(31) 39 + #define LC_CKDRVPD BIT(19) 40 + #define LC_CKDRVOHZ BIT(18) 41 + #define LC_CKDRVHZ BIT(17) 42 + #define LC_CKTEST BIT(16) 44 43 45 44 /* PCI Bridge registers */ 46 45 #define RALINK_PCI_PCICFG_ADDR 0x00 ··· 65 66 #define PCIEPHY0_CFG 0x90 66 67 67 68 #define RALINK_PCIEPHY_P0_CTL_OFFSET 0x7498 68 - #define RALINK_PCIE0_CLK_EN (1 << 26) 69 + #define RALINK_PCIE0_CLK_EN BIT(26) 69 70 70 71 #define BUSY 0x80000000 71 72 #define WAITRETRY_MAX 10 ··· 120 121 else 121 122 break; 122 123 if (retry++ > WAITRETRY_MAX) { 123 - printk(KERN_WARN "PCIE-PHY retry failed.\n"); 124 + pr_warn("PCIE-PHY retry failed.\n"); 124 125 return -1; 125 126 } 126 127 }
+6 -6
arch/mips/pci/pcie-octeon.c
··· 639 639 cvmx_dprintf("PCIe: Port %d link timeout\n", pcie_port); 640 640 return -1; 641 641 } 642 - cvmx_wait(10000); 642 + __delay(10000); 643 643 pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); 644 644 } while (pciercx_cfg032.s.dlla == 0); 645 645 ··· 821 821 * don't poll PESCX_CTL_STATUS2[PCIERST], but simply wait a 822 822 * fixed number of cycles. 823 823 */ 824 - cvmx_wait(400000); 824 + __delay(400000); 825 825 826 826 /* 827 827 * PESCX_BIST_STATUS2[PCLK_RUN] was missing on pass 1 of ··· 1018 1018 i = in_p_offset; 1019 1019 while (i--) { 1020 1020 cvmx_write64_uint32(write_address, 0); 1021 - cvmx_wait(10000); 1021 + __delay(10000); 1022 1022 } 1023 1023 1024 1024 /* ··· 1034 1034 dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA); 1035 1035 old_in_fif_p_count = dbg_data.s.data & 0xff; 1036 1036 cvmx_write64_uint32(write_address, 0); 1037 - cvmx_wait(10000); 1037 + __delay(10000); 1038 1038 dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA); 1039 1039 in_fif_p_count = dbg_data.s.data & 0xff; 1040 1040 } while (in_fif_p_count != ((old_in_fif_p_count+1) & 0xff)); ··· 1053 1053 cvmx_dprintf("PCIe: Port %d aligning TLP counters as workaround to maintain ordering\n", pcie_port); 1054 1054 while (in_fif_p_count != 0) { 1055 1055 cvmx_write64_uint32(write_address, 0); 1056 - cvmx_wait(10000); 1056 + __delay(10000); 1057 1057 in_fif_p_count = (in_fif_p_count + 1) & 0xff; 1058 1058 } 1059 1059 /* ··· 1105 1105 do { 1106 1106 if (cvmx_get_cycle() - start_cycle > octeon_get_clock_rate()) 1107 1107 return -1; 1108 - cvmx_wait(10000); 1108 + __delay(10000); 1109 1109 pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); 1110 1110 } while ((pciercx_cfg032.s.dlla == 0) || (pciercx_cfg032.s.lt == 1)); 1111 1111
-1
arch/mips/ralink/Kconfig
··· 31 31 32 32 config SOC_RT305X 33 33 bool "RT305x" 34 - select USB_ARCH_HAS_HCD 35 34 36 35 config SOC_RT3883 37 36 bool "RT3883"
+2 -2
arch/mips/ralink/mt7620.c
··· 145 145 FUNC("i2c", 0, 4, 2), 146 146 }; 147 147 148 - static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 36, 1) }; 149 - static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 37, 1) }; 148 + static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("refclk", 0, 37, 1) }; 149 + static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 36, 1) }; 150 150 static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) }; 151 151 static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) }; 152 152
-10
arch/mips/xilfpga/Kconfig
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - choice 3 - prompt "Machine type" 4 - depends on MACH_XILFPGA 5 - default XILFPGA_NEXYS4DDR 6 - 7 - config XILFPGA_NEXYS4DDR 8 - bool "Nexys4DDR by Digilent" 9 - 10 - endchoice
-7
arch/mips/xilfpga/Makefile
··· 1 - # 2 - # Makefile for the Xilfpga 3 - # 4 - 5 - obj-y += init.o 6 - obj-y += intc.o 7 - obj-y += time.o
-3
arch/mips/xilfpga/Platform
··· 1 - platform-$(CONFIG_MACH_XILFPGA) += xilfpga/ 2 - cflags-$(CONFIG_MACH_XILFPGA) += -I$(srctree)/arch/mips/include/asm/mach-xilfpga 3 - load-$(CONFIG_MACH_XILFPGA) += 0xffffffff80100000
-44
arch/mips/xilfpga/init.c
··· 1 - /* 2 - * Xilfpga platform setup 3 - * 4 - * Copyright (C) 2015 Imagination Technologies 5 - * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify it 8 - * under the terms and conditions of the GNU General Public License, 9 - * version 2, as published by the Free Software Foundation. 10 - */ 11 - 12 - #include <linux/of_fdt.h> 13 - 14 - #include <asm/prom.h> 15 - 16 - #define XILFPGA_UART_BASE 0xb0401000 17 - 18 - const char *get_system_type(void) 19 - { 20 - return "MIPSfpga"; 21 - } 22 - 23 - void __init plat_mem_setup(void) 24 - { 25 - __dt_setup_arch(__dtb_start); 26 - strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); 27 - } 28 - 29 - void __init prom_init(void) 30 - { 31 - setup_8250_early_printk_port(XILFPGA_UART_BASE, 2, 50000); 32 - } 33 - 34 - void __init prom_free_prom_memory(void) 35 - { 36 - } 37 - 38 - void __init device_tree_init(void) 39 - { 40 - if (!initial_boot_params) 41 - return; 42 - 43 - unflatten_and_copy_device_tree(); 44 - }
-22
arch/mips/xilfpga/intc.c
··· 1 - /* 2 - * Xilfpga interrupt controller setup 3 - * 4 - * Copyright (C) 2015 Imagination Technologies 5 - * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify it 8 - * under the terms and conditions of the GNU General Public License, 9 - * version 2, as published by the Free Software Foundation. 10 - */ 11 - 12 - #include <linux/of.h> 13 - #include <linux/of_irq.h> 14 - #include <linux/irqchip.h> 15 - 16 - #include <asm/irq_cpu.h> 17 - 18 - 19 - void __init arch_init_irq(void) 20 - { 21 - irqchip_init(); 22 - }
-41
arch/mips/xilfpga/time.c
··· 1 - /* 2 - * Xilfpga clocksource/timer setup 3 - * 4 - * Copyright (C) 2015 Imagination Technologies 5 - * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify it 8 - * under the terms and conditions of the GNU General Public License, 9 - * version 2, as published by the Free Software Foundation. 10 - */ 11 - 12 - #include <linux/clk.h> 13 - #include <linux/clk-provider.h> 14 - #include <linux/clocksource.h> 15 - #include <linux/of.h> 16 - 17 - #include <asm/time.h> 18 - 19 - void __init plat_time_init(void) 20 - { 21 - struct device_node *np; 22 - struct clk *clk; 23 - 24 - of_clk_init(NULL); 25 - timer_probe(); 26 - 27 - np = of_get_cpu_node(0, NULL); 28 - if (!np) { 29 - pr_err("Failed to get CPU node\n"); 30 - return; 31 - } 32 - 33 - clk = of_clk_get(np, 0); 34 - if (IS_ERR(clk)) { 35 - pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk)); 36 - return; 37 - } 38 - 39 - mips_hpt_frequency = clk_get_rate(clk) / 2; 40 - clk_put(clk); 41 - }
+4 -2
drivers/tty/serial/bcm63xx_uart.c
··· 843 843 if (!res_irq) 844 844 return -ENODEV; 845 845 846 - clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) : 847 - clk_get(&pdev->dev, "periph"); 846 + clk = clk_get(&pdev->dev, "refclk"); 847 + if (IS_ERR(clk) && pdev->dev.of_node) 848 + clk = of_clk_get(pdev->dev.of_node, 0); 849 + 848 850 if (IS_ERR(clk)) 849 851 return -ENODEV; 850 852
+1 -1
drivers/watchdog/Kconfig
··· 1460 1460 1461 1461 config JZ4740_WDT 1462 1462 tristate "Ingenic jz4740 SoC hardware watchdog" 1463 - depends on MACH_JZ4740 1463 + depends on MACH_JZ4740 || MACH_JZ4780 1464 1464 select WATCHDOG_CORE 1465 1465 help 1466 1466 Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.