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

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

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

Rough overview:

- MAINTAINERS: Add Paul Burton as MIPS co-maintainer

- Misc: Generic compiler intrinsics, Y2038 improvements, Perf+MT fixes

- Platform support: Netgear WNR1000 V3, Microsemi Ocelot integrated
switch, Ingenic watchdog cleanups

More detailed summary:

Maintainers:

- Add Paul Burton as MIPS co-maintainer, as I soon won't have access
to much MIPS hardware, nor enough time to properly maintain MIPS on
my own.

Miscellaneous:

- Use generic GCC library routines from lib/
- Add notrace to generic ucmpdi2 implementation
- Rename compiler intrinsic selects to GENERIC_LIB_*
- vmlinuz: Use generic ashldi3

- y2038: Convert update/read_persistent_clock() to *_clock64()
- sni: Remove read_persistent_clock()

- perf: Fix perf with MT counting other threads
- Probe for per-TC perf counters in cpu-probe.c
- Use correct VPE ID for VPE tracing

Minor cleanups:

- Avoid unneeded built-in.a in DTS dirs

- sc-debugfs: Re-use kstrtobool_from_user

- memset.S: Reinstate delay slot indentation

- VPE: Fix spelling "uneeded" -> "Unneeded"

Platform support:

BCM47xx:

- Add support for Netgear WNR1000 V3

- firmware: Support small NVRAM partitions

- Use __initdata for LEDs platform data

Ingenic:

- Watchdog driver & platform code improvements:
- Disable clock after stopping counter
- Use devm_* functions
- Drop module remove function
- Move platform reset code to restart handler in driver
- JZ4740: Convert watchdog instantiation to DT
- JZ4780: Fix watchdog DT node
- qi_lb60_defconfig: Enable watchdog driver

Microsemi:

- Ocelot: Add support for integrated switch
- pcb123: Connect phys to ports"

* tag 'mips_4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (30 commits)
MAINTAINERS: Add Paul Burton as MIPS co-maintainer
MIPS: ptrace: Make FPU context layout comments match reality
MIPS: memset.S: Reinstate delay slot indentation
MIPS: perf: Fix perf with MT counting other threads
MIPS: perf: Use correct VPE ID when setting up VPE tracing
MIPS: perf: More robustly probe for the presence of per-tc counters
MIPS: Probe for MIPS MT perf counters per TC
MIPS: mscc: Connect phys to ports on ocelot_pcb123
MIPS: mscc: Add switch to ocelot
MIPS: JZ4740: Drop old platform reset code
MIPS: qi_lb60: Enable the jz4740-wdt driver
MIPS: JZ4780: dts: Fix watchdog node
MIPS: JZ4740: dts: Add bindings for the jz4740-wdt driver
watchdog: JZ4740: Drop module remove function
watchdog: JZ4740: Register a restart handler
watchdog: JZ4740: Use devm_* functions
watchdog: JZ4740: Disable clock after stopping counter
MIPS: VPE: Fix spelling mistake: "uneeded" -> "unneeded"
MIPS: Re-use kstrtobool_from_user()
MIPS: Convert update_persistent_clock() to update_persistent_clock64()
...

+339 -392
+6 -1
Documentation/devicetree/bindings/watchdog/ingenic,jz4740-wdt.txt
··· 3 3 Required properties: 4 4 compatible: "ingenic,jz4740-watchdog" or "ingenic,jz4780-watchdog" 5 5 reg: Register address and length for watchdog registers 6 + clocks: phandle to the RTC clock 7 + clock-names: should be "rtc" 6 8 7 9 Example: 8 10 9 11 watchdog: jz4740-watchdog@10002000 { 10 12 compatible = "ingenic,jz4740-watchdog"; 11 - reg = <0x10002000 0x100>; 13 + reg = <0x10002000 0x10>; 14 + 15 + clocks = <&cgu JZ4740_CLK_RTC>; 16 + clock-names = "rtc"; 12 17 };
+2
MAINTAINERS
··· 9417 9417 9418 9418 MIPS 9419 9419 M: Ralf Baechle <ralf@linux-mips.org> 9420 + M: Paul Burton <paul.burton@mips.com> 9420 9421 M: James Hogan <jhogan@kernel.org> 9421 9422 L: linux-mips@linux-mips.org 9422 9423 W: http://www.linux-mips.org/ 9423 9424 T: git git://git.linux-mips.org/pub/scm/ralf/linux.git 9425 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git 9424 9426 Q: http://patchwork.linux-mips.org/project/linux-mips/list/ 9425 9427 S: Supported 9426 9428 F: Documentation/devicetree/bindings/mips/
+5
arch/mips/Kconfig
··· 22 22 select GENERIC_CPU_AUTOPROBE 23 23 select GENERIC_IRQ_PROBE 24 24 select GENERIC_IRQ_SHOW 25 + select GENERIC_LIB_ASHLDI3 26 + select GENERIC_LIB_ASHRDI3 27 + select GENERIC_LIB_CMPDI2 28 + select GENERIC_LIB_LSHRDI3 29 + select GENERIC_LIB_UCMPDI2 25 30 select GENERIC_PCI_IOMAP 26 31 select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC 27 32 select GENERIC_SMP_IDLE_THREAD
+2
arch/mips/bcm47xx/board.c
··· 172 172 {{BCM47XX_BOARD_NETGEAR_WNDR4000, "Netgear WNDR4000"}, "U12H181T00_NETGEAR"}, 173 173 {{BCM47XX_BOARD_NETGEAR_WNDR4500V1, "Netgear WNDR4500 V1"}, "U12H189T00_NETGEAR"}, 174 174 {{BCM47XX_BOARD_NETGEAR_WNDR4500V2, "Netgear WNDR4500 V2"}, "U12H224T00_NETGEAR"}, 175 + {{BCM47XX_BOARD_NETGEAR_WNR1000_V3, "Netgear WNR1000 V3"}, "U12H139T00_NETGEAR"}, 176 + {{BCM47XX_BOARD_NETGEAR_WNR1000_V3, "Netgear WNR1000 V3"}, "U12H139T50_NETGEAR"}, 175 177 {{BCM47XX_BOARD_NETGEAR_WNR2000, "Netgear WNR2000"}, "U12H114T00_NETGEAR"}, 176 178 {{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "U12H136T99_NETGEAR"}, 177 179 {{BCM47XX_BOARD_NETGEAR_WNR3500U, "Netgear WNR3500U"}, "U12H136T00_NETGEAR"},
+9
arch/mips/bcm47xx/buttons.c
··· 412 412 }; 413 413 414 414 static const struct gpio_keys_button 415 + bcm47xx_buttons_netgear_wnr1000_v3[] __initconst = { 416 + BCM47XX_GPIO_KEY(2, KEY_WPS_BUTTON), 417 + BCM47XX_GPIO_KEY(3, KEY_RESTART), 418 + }; 419 + 420 + static const struct gpio_keys_button 415 421 bcm47xx_buttons_netgear_wnr3500lv1[] __initconst = { 416 422 BCM47XX_GPIO_KEY(4, KEY_RESTART), 417 423 BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON), ··· 675 669 break; 676 670 case BCM47XX_BOARD_NETGEAR_WNDR4500V1: 677 671 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500v1); 672 + break; 673 + case BCM47XX_BOARD_NETGEAR_WNR1000_V3: 674 + err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr1000_v3); 678 675 break; 679 676 case BCM47XX_BOARD_NETGEAR_WNR3500L: 680 677 err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
+10 -1
arch/mips/bcm47xx/leds.c
··· 498 498 }; 499 499 500 500 static const struct gpio_led 501 + bcm47xx_leds_netgear_wnr1000_v3[] __initconst = { 502 + BCM47XX_GPIO_LED(0, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), 503 + BCM47XX_GPIO_LED(1, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF), 504 + }; 505 + 506 + static const struct gpio_led 501 507 bcm47xx_leds_netgear_wnr3500lv1[] __initconst = { 502 508 BCM47XX_GPIO_LED(0, "blue", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), 503 509 BCM47XX_GPIO_LED(1, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), ··· 538 532 * Init 539 533 **************************************************/ 540 534 541 - static struct gpio_led_platform_data bcm47xx_leds_pdata; 535 + static struct gpio_led_platform_data bcm47xx_leds_pdata __initdata; 542 536 543 537 #define bcm47xx_set_pdata(dev_leds) do { \ 544 538 bcm47xx_leds_pdata.leds = dev_leds; \ ··· 763 757 break; 764 758 case BCM47XX_BOARD_NETGEAR_WNDR4500V1: 765 759 bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr4500v1); 760 + break; 761 + case BCM47XX_BOARD_NETGEAR_WNR1000_V3: 762 + bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr1000_v3); 766 763 break; 767 764 case BCM47XX_BOARD_NETGEAR_WNR3500L: 768 765 bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1);
+7 -4
arch/mips/boot/compressed/Makefile
··· 46 46 47 47 vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o 48 48 49 - extra-y += ashldi3.c bswapsi.c 50 - $(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib 51 - $(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c 52 - $(call cmd,shipped) 49 + extra-y += ashldi3.c 50 + $(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE 51 + $(call if_changed,shipped) 52 + 53 + extra-y += bswapsi.c 54 + $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE 55 + $(call if_changed,shipped) 53 56 54 57 targets := $(notdir $(vmlinuzobjs-y)) 55 58
+1 -1
arch/mips/boot/dts/brcm/Makefile
··· 34 34 bcm97425svmb.dtb \ 35 35 bcm97435svmb.dtb 36 36 37 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 37 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+1 -1
arch/mips/boot/dts/cavium-octeon/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 dtb-$(CONFIG_CAVIUM_OCTEON_SOC) += octeon_3xxx.dtb octeon_68xx.dtb 3 3 4 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 4 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+1 -1
arch/mips/boot/dts/ingenic/Makefile
··· 3 3 dtb-$(CONFIG_JZ4770_GCW0) += gcw0.dtb 4 4 dtb-$(CONFIG_JZ4780_CI20) += ci20.dtb 5 5 6 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 6 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+8
arch/mips/boot/dts/ingenic/jz4740.dtsi
··· 45 45 #clock-cells = <1>; 46 46 }; 47 47 48 + watchdog: watchdog@10002000 { 49 + compatible = "ingenic,jz4740-watchdog"; 50 + reg = <0x10002000 0x10>; 51 + 52 + clocks = <&cgu JZ4740_CLK_RTC>; 53 + clock-names = "rtc"; 54 + }; 55 + 48 56 rtc_dev: rtc@10003000 { 49 57 compatible = "ingenic,jz4740-rtc"; 50 58 reg = <0x10003000 0x40>;
+4 -1
arch/mips/boot/dts/ingenic/jz4780.dtsi
··· 222 222 223 223 watchdog: watchdog@10002000 { 224 224 compatible = "ingenic,jz4780-watchdog"; 225 - reg = <0x10002000 0x100>; 225 + reg = <0x10002000 0x10>; 226 + 227 + clocks = <&cgu JZ4780_CLK_RTCLK>; 228 + clock-names = "rtc"; 226 229 }; 227 230 228 231 nemc: nemc@13410000 {
+1 -1
arch/mips/boot/dts/lantiq/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 dtb-$(CONFIG_DT_EASY50712) += easy50712.dtb 3 3 4 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 4 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+1 -1
arch/mips/boot/dts/mscc/Makefile
··· 1 1 dtb-$(CONFIG_LEGACY_BOARD_OCELOT) += ocelot_pcb123.dtb 2 2 3 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 3 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+88
arch/mips/boot/dts/mscc/ocelot.dtsi
··· 91 91 status = "disabled"; 92 92 }; 93 93 94 + switch@1010000 { 95 + compatible = "mscc,vsc7514-switch"; 96 + reg = <0x1010000 0x10000>, 97 + <0x1030000 0x10000>, 98 + <0x1080000 0x100>, 99 + <0x10d0000 0x10000>, 100 + <0x11e0000 0x100>, 101 + <0x11f0000 0x100>, 102 + <0x1200000 0x100>, 103 + <0x1210000 0x100>, 104 + <0x1220000 0x100>, 105 + <0x1230000 0x100>, 106 + <0x1240000 0x100>, 107 + <0x1250000 0x100>, 108 + <0x1260000 0x100>, 109 + <0x1270000 0x100>, 110 + <0x1280000 0x100>, 111 + <0x1800000 0x80000>, 112 + <0x1880000 0x10000>; 113 + reg-names = "sys", "rew", "qs", "hsio", "port0", 114 + "port1", "port2", "port3", "port4", "port5", 115 + "port6", "port7", "port8", "port9", "port10", 116 + "qsys", "ana"; 117 + interrupts = <21 22>; 118 + interrupt-names = "xtr", "inj"; 119 + 120 + ethernet-ports { 121 + #address-cells = <1>; 122 + #size-cells = <0>; 123 + 124 + port0: port@0 { 125 + reg = <0>; 126 + }; 127 + port1: port@1 { 128 + reg = <1>; 129 + }; 130 + port2: port@2 { 131 + reg = <2>; 132 + }; 133 + port3: port@3 { 134 + reg = <3>; 135 + }; 136 + port4: port@4 { 137 + reg = <4>; 138 + }; 139 + port5: port@5 { 140 + reg = <5>; 141 + }; 142 + port6: port@6 { 143 + reg = <6>; 144 + }; 145 + port7: port@7 { 146 + reg = <7>; 147 + }; 148 + port8: port@8 { 149 + reg = <8>; 150 + }; 151 + port9: port@9 { 152 + reg = <9>; 153 + }; 154 + port10: port@10 { 155 + reg = <10>; 156 + }; 157 + }; 158 + }; 159 + 94 160 reset@1070008 { 95 161 compatible = "mscc,ocelot-chip-reset"; 96 162 reg = <0x1070008 0x4>; ··· 177 111 uart2_pins: uart2-pins { 178 112 pins = "GPIO_12", "GPIO_13"; 179 113 function = "uart2"; 114 + }; 115 + }; 116 + 117 + mdio0: mdio@107009c { 118 + #address-cells = <1>; 119 + #size-cells = <0>; 120 + compatible = "mscc,ocelot-miim"; 121 + reg = <0x107009c 0x36>, <0x10700f0 0x8>; 122 + interrupts = <14>; 123 + status = "disabled"; 124 + 125 + phy0: ethernet-phy@0 { 126 + reg = <0>; 127 + }; 128 + phy1: ethernet-phy@1 { 129 + reg = <1>; 130 + }; 131 + phy2: ethernet-phy@2 { 132 + reg = <2>; 133 + }; 134 + phy3: ethernet-phy@3 { 135 + reg = <3>; 180 136 }; 181 137 }; 182 138 };
+20
arch/mips/boot/dts/mscc/ocelot_pcb123.dts
··· 25 25 &uart2 { 26 26 status = "okay"; 27 27 }; 28 + 29 + &mdio0 { 30 + status = "okay"; 31 + }; 32 + 33 + &port0 { 34 + phy-handle = <&phy0>; 35 + }; 36 + 37 + &port1 { 38 + phy-handle = <&phy1>; 39 + }; 40 + 41 + &port2 { 42 + phy-handle = <&phy2>; 43 + }; 44 + 45 + &port3 { 46 + phy-handle = <&phy3>; 47 + };
+1 -1
arch/mips/boot/dts/mti/Makefile
··· 2 2 dtb-$(CONFIG_MIPS_MALTA) += malta.dtb 3 3 dtb-$(CONFIG_LEGACY_BOARD_SEAD3) += sead3.dtb 4 4 5 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 5 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+1 -1
arch/mips/boot/dts/netlogic/Makefile
··· 5 5 dtb-$(CONFIG_DT_XLP_GVP) += xlp_gvp.dtb 6 6 dtb-$(CONFIG_DT_XLP_RVP) += xlp_rvp.dtb 7 7 8 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 8 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+1 -1
arch/mips/boot/dts/pic32/Makefile
··· 4 4 dtb-$(CONFIG_DTB_PIC32_NONE) += \ 5 5 pic32mzda_sk.dtb 6 6 7 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 7 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+1 -1
arch/mips/boot/dts/ralink/Makefile
··· 6 6 dtb-$(CONFIG_DTB_OMEGA2P) += omega2p.dtb 7 7 dtb-$(CONFIG_DTB_VOCORE2) += vocore2.dtb 8 8 9 - obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 9 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+2
arch/mips/configs/qi_lb60_defconfig
··· 72 72 CONFIG_BATTERY_JZ4740=y 73 73 CONFIG_CHARGER_GPIO=y 74 74 # CONFIG_HWMON is not set 75 + CONFIG_WATCHDOG=y 76 + CONFIG_JZ4740_WDT=y 75 77 CONFIG_MFD_JZ4740_ADC=y 76 78 CONFIG_REGULATOR=y 77 79 CONFIG_REGULATOR_FIXED_VOLTAGE=y
+6 -6
arch/mips/dec/time.c
··· 19 19 #include <asm/dec/ioasic.h> 20 20 #include <asm/dec/machtype.h> 21 21 22 - void read_persistent_clock(struct timespec *ts) 22 + void read_persistent_clock64(struct timespec64 *ts) 23 23 { 24 24 unsigned int year, mon, day, hour, min, sec, real_year; 25 25 unsigned long flags; ··· 54 54 55 55 year += real_year - 72 + 2000; 56 56 57 - ts->tv_sec = mktime(year, mon, day, hour, min, sec); 57 + ts->tv_sec = mktime64(year, mon, day, hour, min, sec); 58 58 ts->tv_nsec = 0; 59 59 } 60 60 61 61 /* 62 - * In order to set the CMOS clock precisely, rtc_mips_set_mmss has to 62 + * In order to set the CMOS clock precisely, update_persistent_clock64 has to 63 63 * be called 500 ms after the second nowtime has started, because when 64 64 * nowtime is written into the registers of the CMOS clock, it will 65 65 * jump to the next second precisely 500 ms later. Check the Dallas 66 66 * DS1287 data sheet for details. 67 67 */ 68 - int rtc_mips_set_mmss(unsigned long nowtime) 68 + int update_persistent_clock64(struct timespec64 now) 69 69 { 70 + time64_t nowtime = now.tv_sec; 70 71 int retval = 0; 71 72 int real_seconds, real_minutes, cmos_minutes; 72 73 unsigned char save_control, save_freq_select; ··· 92 91 * messing with unknown time zones but requires your 93 92 * RTC not to be off by more than 15 minutes 94 93 */ 95 - real_seconds = nowtime % 60; 96 - real_minutes = nowtime / 60; 94 + real_minutes = div_s64_rem(nowtime, 60, &real_seconds); 97 95 if (((abs(real_minutes - cmos_minutes) + 15) / 30) & 1) 98 96 real_minutes += 30; /* correct for half hour time zone */ 99 97 real_minutes %= 60;
+7
arch/mips/include/asm/cpu-features.h
··· 535 535 # define cpu_has_shared_ftlb_entries 0 536 536 #endif 537 537 538 + #ifdef CONFIG_MIPS_MT_SMP 539 + # define cpu_has_mipsmt_pertccounters \ 540 + (cpu_data[0].options & MIPS_CPU_MT_PER_TC_PERF_COUNTERS) 541 + #else 542 + # define cpu_has_mipsmt_pertccounters 0 543 + #endif /* CONFIG_MIPS_MT_SMP */ 544 + 538 545 /* 539 546 * Guest capabilities 540 547 */
+2
arch/mips/include/asm/cpu.h
··· 418 418 MBIT_ULL(54) /* CPU shares FTLB RAM with another */ 419 419 #define MIPS_CPU_SHARED_FTLB_ENTRIES \ 420 420 MBIT_ULL(55) /* CPU shares FTLB entries with another */ 421 + #define MIPS_CPU_MT_PER_TC_PERF_COUNTERS \ 422 + MBIT_ULL(56) /* CPU has perf counters implemented per TC (MIPSMT ASE) */ 421 423 422 424 /* 423 425 * CPU ASE encodings
+1
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
··· 110 110 BCM47XX_BOARD_NETGEAR_WNDR4000, 111 111 BCM47XX_BOARD_NETGEAR_WNDR4500V1, 112 112 BCM47XX_BOARD_NETGEAR_WNDR4500V2, 113 + BCM47XX_BOARD_NETGEAR_WNR1000_V3, 113 114 BCM47XX_BOARD_NETGEAR_WNR2000, 114 115 BCM47XX_BOARD_NETGEAR_WNR3500L, 115 116 BCM47XX_BOARD_NETGEAR_WNR3500U,
-1
arch/mips/include/asm/mach-jz4740/platform.h
··· 29 29 extern struct platform_device jz4740_pcm_device; 30 30 extern struct platform_device jz4740_codec_device; 31 31 extern struct platform_device jz4740_adc_device; 32 - extern struct platform_device jz4740_wdt_device; 33 32 extern struct platform_device jz4740_pwm_device; 34 33 extern struct platform_device jz4740_dma_device; 35 34
+2 -2
arch/mips/include/asm/mc146818-time.h
··· 86 86 return retval; 87 87 } 88 88 89 - static inline unsigned long mc146818_get_cmos_time(void) 89 + static inline time64_t mc146818_get_cmos_time(void) 90 90 { 91 91 unsigned int year, mon, day, hour, min, sec; 92 92 unsigned long flags; ··· 113 113 spin_unlock_irqrestore(&rtc_lock, flags); 114 114 year = mc146818_decode_year(year); 115 115 116 - return mktime(year, mon, day, hour, min, sec); 116 + return mktime64(year, mon, day, hour, min, sec); 117 117 } 118 118 119 119 #endif /* __ASM_MC146818_TIME_H */
+5
arch/mips/include/asm/mipsregs.h
··· 685 685 #define MIPS_CONF7_IAR (_ULCAST_(1) << 10) 686 686 #define MIPS_CONF7_AR (_ULCAST_(1) << 16) 687 687 688 + /* Config7 Bits specific to MIPS Technologies. */ 689 + 690 + /* Performance counters implemented Per TC */ 691 + #define MTI_CONF7_PTC (_ULCAST_(1) << 19) 692 + 688 693 /* WatchLo* register definitions */ 689 694 #define MIPS_WATCHLO_IRW (_ULCAST_(0x7) << 0) 690 695
-9
arch/mips/include/asm/time.h
··· 22 22 extern spinlock_t rtc_lock; 23 23 24 24 /* 25 - * RTC ops. By default, they point to weak no-op RTC functions. 26 - * rtc_mips_set_time - reverse the above translation and set time to RTC. 27 - * rtc_mips_set_mmss - similar to rtc_set_time, but only min and sec need 28 - * to be set. Used by RTC sync-up. 29 - */ 30 - extern int rtc_mips_set_time(unsigned long); 31 - extern int rtc_mips_set_mmss(unsigned long); 32 - 33 - /* 34 25 * board specific routines required by time_init(). 35 26 */ 36 27 extern void plat_time_init(void);
-16
arch/mips/jz4740/platform.c
··· 233 233 .resource = jz4740_adc_resources, 234 234 }; 235 235 236 - /* Watchdog */ 237 - static struct resource jz4740_wdt_resources[] = { 238 - { 239 - .start = JZ4740_WDT_BASE_ADDR, 240 - .end = JZ4740_WDT_BASE_ADDR + 0x10 - 1, 241 - .flags = IORESOURCE_MEM, 242 - }, 243 - }; 244 - 245 - struct platform_device jz4740_wdt_device = { 246 - .name = "jz4740-wdt", 247 - .id = -1, 248 - .num_resources = ARRAY_SIZE(jz4740_wdt_resources), 249 - .resource = jz4740_wdt_resources, 250 - }; 251 - 252 236 /* PWM */ 253 237 struct platform_device jz4740_pwm_device = { 254 238 .name = "jz4740-pwm",
-31
arch/mips/jz4740/reset.c
··· 12 12 * 13 13 */ 14 14 15 - #include <linux/clk.h> 16 - #include <linux/io.h> 17 - #include <linux/kernel.h> 18 - #include <linux/pm.h> 19 - 20 15 #include <asm/reboot.h> 21 16 22 - #include <asm/mach-jz4740/base.h> 23 - #include <asm/mach-jz4740/timer.h> 24 - 25 17 #include "reset.h" 26 - #include "clock.h" 27 18 28 19 static void jz4740_halt(void) 29 20 { ··· 27 36 } 28 37 } 29 38 30 - #define JZ_REG_WDT_DATA 0x00 31 - #define JZ_REG_WDT_COUNTER_ENABLE 0x04 32 - #define JZ_REG_WDT_COUNTER 0x08 33 - #define JZ_REG_WDT_CTRL 0x0c 34 - 35 - static void jz4740_restart(char *command) 36 - { 37 - void __iomem *wdt_base = ioremap(JZ4740_WDT_BASE_ADDR, 0x0f); 38 - 39 - jz4740_timer_enable_watchdog(); 40 - 41 - writeb(0, wdt_base + JZ_REG_WDT_COUNTER_ENABLE); 42 - 43 - writew(0, wdt_base + JZ_REG_WDT_COUNTER); 44 - writew(0, wdt_base + JZ_REG_WDT_DATA); 45 - writew(BIT(2), wdt_base + JZ_REG_WDT_CTRL); 46 - 47 - writeb(1, wdt_base + JZ_REG_WDT_COUNTER_ENABLE); 48 - jz4740_halt(); 49 - } 50 - 51 39 void jz4740_reset_init(void) 52 40 { 53 - _machine_restart = jz4740_restart; 54 41 _machine_halt = jz4740_halt; 55 42 }
+12
arch/mips/kernel/cpu-probe.c
··· 414 414 415 415 __setup("noftlb", ftlb_disable); 416 416 417 + /* 418 + * Check if the CPU has per tc perf counters 419 + */ 420 + static inline void cpu_set_mt_per_tc_perf(struct cpuinfo_mips *c) 421 + { 422 + if (read_c0_config7() & MTI_CONF7_PTC) 423 + c->options |= MIPS_CPU_MT_PER_TC_PERF_COUNTERS; 424 + } 417 425 418 426 static inline void check_errata(void) 419 427 { ··· 1580 1572 c->cputype = CPU_34K; 1581 1573 c->writecombine = _CACHE_UNCACHED; 1582 1574 __cpu_name[cpu] = "MIPS 34Kc"; 1575 + cpu_set_mt_per_tc_perf(c); 1583 1576 break; 1584 1577 case PRID_IMP_74K: 1585 1578 c->cputype = CPU_74K; ··· 1601 1592 c->cputype = CPU_1004K; 1602 1593 c->writecombine = _CACHE_UNCACHED; 1603 1594 __cpu_name[cpu] = "MIPS 1004Kc"; 1595 + cpu_set_mt_per_tc_perf(c); 1604 1596 break; 1605 1597 case PRID_IMP_1074K: 1606 1598 c->cputype = CPU_1074K; ··· 1611 1601 case PRID_IMP_INTERAPTIV_UP: 1612 1602 c->cputype = CPU_INTERAPTIV; 1613 1603 __cpu_name[cpu] = "MIPS interAptiv"; 1604 + cpu_set_mt_per_tc_perf(c); 1614 1605 break; 1615 1606 case PRID_IMP_INTERAPTIV_MP: 1616 1607 c->cputype = CPU_INTERAPTIV; 1617 1608 __cpu_name[cpu] = "MIPS interAptiv (multi)"; 1609 + cpu_set_mt_per_tc_perf(c); 1618 1610 break; 1619 1611 case PRID_IMP_PROAPTIV_UP: 1620 1612 c->cputype = CPU_PROAPTIV;
+40 -51
arch/mips/kernel/perf_event_mipsxx.c
··· 129 129 130 130 131 131 #ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS 132 - static int cpu_has_mipsmt_pertccounters; 133 - 134 132 static DEFINE_RWLOCK(pmuint_rwlock); 135 133 136 134 #if defined(CONFIG_CPU_BMIPS5000) 137 135 #define vpe_id() (cpu_has_mipsmt_pertccounters ? \ 138 136 0 : (smp_processor_id() & MIPS_CPUID_TO_COUNTER_MASK)) 139 137 #else 140 - /* 141 - * FIXME: For VSMP, vpe_id() is redefined for Perf-events, because 142 - * cpu_data[cpuid].vpe_id reports 0 for _both_ CPUs. 143 - */ 144 138 #define vpe_id() (cpu_has_mipsmt_pertccounters ? \ 145 - 0 : smp_processor_id()) 139 + 0 : cpu_vpe_id(&current_cpu_data)) 146 140 #endif 147 141 148 142 /* Copied from op_model_mipsxx.c */ ··· 323 329 324 330 static void mipsxx_pmu_enable_event(struct hw_perf_event *evt, int idx) 325 331 { 332 + struct perf_event *event = container_of(evt, struct perf_event, hw); 326 333 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); 334 + #ifdef CONFIG_MIPS_MT_SMP 335 + unsigned int range = evt->event_base >> 24; 336 + #endif /* CONFIG_MIPS_MT_SMP */ 327 337 328 338 WARN_ON(idx < 0 || idx >= mipspmu.num_counters); 329 339 ··· 335 337 (evt->config_base & M_PERFCTL_CONFIG_MASK) | 336 338 /* Make sure interrupt enabled. */ 337 339 MIPS_PERFCTRL_IE; 338 - if (IS_ENABLED(CONFIG_CPU_BMIPS5000)) 340 + 341 + #ifdef CONFIG_CPU_BMIPS5000 342 + { 339 343 /* enable the counter for the calling thread */ 340 344 cpuc->saved_ctrl[idx] |= 341 345 (1 << (12 + vpe_id())) | BRCM_PERFCTRL_TC; 346 + } 347 + #else 348 + #ifdef CONFIG_MIPS_MT_SMP 349 + if (range > V) { 350 + /* The counter is processor wide. Set it up to count all TCs. */ 351 + pr_debug("Enabling perf counter for all TCs\n"); 352 + cpuc->saved_ctrl[idx] |= M_TC_EN_ALL; 353 + } else 354 + #endif /* CONFIG_MIPS_MT_SMP */ 355 + { 356 + unsigned int cpu, ctrl; 342 357 358 + /* 359 + * Set up the counter for a particular CPU when event->cpu is 360 + * a valid CPU number. Otherwise set up the counter for the CPU 361 + * scheduling this thread. 362 + */ 363 + cpu = (event->cpu >= 0) ? event->cpu : smp_processor_id(); 364 + 365 + ctrl = M_PERFCTL_VPEID(cpu_vpe_id(&cpu_data[cpu])); 366 + ctrl |= M_TC_EN_VPE; 367 + cpuc->saved_ctrl[idx] |= ctrl; 368 + pr_debug("Enabling perf counter for CPU%d\n", cpu); 369 + } 370 + #endif /* CONFIG_CPU_BMIPS5000 */ 343 371 /* 344 372 * We do not actually let the counter run. Leave it until start(). 345 373 */ ··· 679 655 * event_id. 680 656 */ 681 657 #ifdef CONFIG_MIPS_MT_SMP 682 - return ((unsigned int)pev->range << 24) | 683 - (pev->cntr_mask & 0xffff00) | 684 - (pev->event_id & 0xff); 685 - #else 686 - return (pev->cntr_mask & 0xffff00) | 687 - (pev->event_id & 0xff); 688 - #endif 658 + if (num_possible_cpus() > 1) 659 + return ((unsigned int)pev->range << 24) | 660 + (pev->cntr_mask & 0xffff00) | 661 + (pev->event_id & 0xff); 662 + else 663 + #endif /* CONFIG_MIPS_MT_SMP */ 664 + return ((pev->cntr_mask & 0xffff00) | 665 + (pev->event_id & 0xff)); 689 666 } 690 667 691 668 static const struct mips_perf_event *mipspmu_map_general_event(int idx) ··· 1290 1265 }, 1291 1266 }; 1292 1267 1293 - #ifdef CONFIG_MIPS_MT_SMP 1294 - static void check_and_calc_range(struct perf_event *event, 1295 - const struct mips_perf_event *pev) 1296 - { 1297 - struct hw_perf_event *hwc = &event->hw; 1298 - 1299 - if (event->cpu >= 0) { 1300 - if (pev->range > V) { 1301 - /* 1302 - * The user selected an event that is processor 1303 - * wide, while expecting it to be VPE wide. 1304 - */ 1305 - hwc->config_base |= M_TC_EN_ALL; 1306 - } else { 1307 - /* 1308 - * FIXME: cpu_data[event->cpu].vpe_id reports 0 1309 - * for both CPUs. 1310 - */ 1311 - hwc->config_base |= M_PERFCTL_VPEID(event->cpu); 1312 - hwc->config_base |= M_TC_EN_VPE; 1313 - } 1314 - } else 1315 - hwc->config_base |= M_TC_EN_ALL; 1316 - } 1317 - #else 1318 - static void check_and_calc_range(struct perf_event *event, 1319 - const struct mips_perf_event *pev) 1320 - { 1321 - } 1322 - #endif 1323 - 1324 1268 static int __hw_perf_event_init(struct perf_event *event) 1325 1269 { 1326 1270 struct perf_event_attr *attr = &event->attr; ··· 1324 1330 * by the single CPU operates (the mode exclusion and the range). 1325 1331 */ 1326 1332 hwc->config_base = MIPS_PERFCTRL_IE; 1327 - 1328 - /* Calculate range bits and validate it. */ 1329 - if (num_possible_cpus() > 1) 1330 - check_and_calc_range(event, pev); 1331 1333 1332 1334 hwc->event_base = mipspmu_perf_event_encode(pev); 1333 1335 if (PERF_TYPE_RAW == event->attr.type) ··· 1713 1723 } 1714 1724 1715 1725 #ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS 1716 - cpu_has_mipsmt_pertccounters = read_c0_config7() & (1<<19); 1717 1726 if (!cpu_has_mipsmt_pertccounters) 1718 1727 counters = counters_total_to_per_cpu(counters); 1719 1728 #endif
+2 -2
arch/mips/kernel/ptrace.c
··· 811 811 /* 812 812 * The odd registers are actually the high 813 813 * order bits of the values stored in the even 814 - * registers - unless we're using r2k_switch.S. 814 + * registers. 815 815 */ 816 816 tmp = get_fpr32(&fregs[(addr & ~1) - FPR_BASE], 817 817 addr & 1); ··· 906 906 /* 907 907 * The odd registers are actually the high 908 908 * order bits of the values stored in the even 909 - * registers - unless we're using r2k_switch.S. 909 + * registers. 910 910 */ 911 911 set_fpr32(&fregs[(addr & ~1) - FPR_BASE], 912 912 addr & 1, data);
+2 -2
arch/mips/kernel/ptrace32.c
··· 103 103 /* 104 104 * The odd registers are actually the high 105 105 * order bits of the values stored in the even 106 - * registers - unless we're using r2k_switch.S. 106 + * registers. 107 107 */ 108 108 tmp = get_fpr32(&fregs[(addr & ~1) - FPR_BASE], 109 109 addr & 1); ··· 216 216 /* 217 217 * The odd registers are actually the high 218 218 * order bits of the values stored in the even 219 - * registers - unless we're using r2k_switch.S. 219 + * registers. 220 220 */ 221 221 set_fpr32(&fregs[(addr & ~1) - FPR_BASE], 222 222 addr & 1, data);
-15
arch/mips/kernel/time.c
··· 34 34 DEFINE_SPINLOCK(rtc_lock); 35 35 EXPORT_SYMBOL(rtc_lock); 36 36 37 - int __weak rtc_mips_set_time(unsigned long sec) 38 - { 39 - return -ENODEV; 40 - } 41 - 42 - int __weak rtc_mips_set_mmss(unsigned long nowtime) 43 - { 44 - return rtc_mips_set_time(nowtime); 45 - } 46 - 47 - int update_persistent_clock(struct timespec now) 48 - { 49 - return rtc_mips_set_mmss(now.tv_sec); 50 - } 51 - 52 37 static int null_perf_irq(void) 53 38 { 54 39 return 0;
+1 -1
arch/mips/kernel/vpe.c
··· 872 872 return -ENODEV; 873 873 874 874 if ((count + v->len) > v->plen) { 875 - pr_warn("VPE loader: elf size too big. Perhaps strip uneeded symbols\n"); 875 + pr_warn("VPE loader: elf size too big. Perhaps strip unneeded symbols\n"); 876 876 return -ENOMEM; 877 877 } 878 878
+8 -3
arch/mips/lasat/ds1603.c
··· 136 136 lasat_ndelay(1000); 137 137 } 138 138 139 - void read_persistent_clock(struct timespec *ts) 139 + void read_persistent_clock64(struct timespec64 *ts) 140 140 { 141 141 unsigned long word; 142 142 unsigned long flags; ··· 152 152 ts->tv_nsec = 0; 153 153 } 154 154 155 - int rtc_mips_set_mmss(unsigned long time) 155 + int update_persistent_clock64(struct timespec64 now) 156 156 { 157 + time64_t time = now.tv_sec; 157 158 unsigned long flags; 158 159 159 160 spin_lock_irqsave(&rtc_lock, flags); 160 161 rtc_init_op(); 161 162 rtc_write_byte(SET_TIME_CMD); 162 - rtc_write_word(time); 163 + /* 164 + * Due to the hardware limitation, we cast to 'unsigned long' type, 165 + * so it will overflow in year 2106 on 32-bit machine. 166 + */ 167 + rtc_write_word((unsigned long)time); 163 168 rtc_end_op(); 164 169 spin_unlock_irqrestore(&rtc_lock, flags); 165 170
+10 -2
arch/mips/lasat/sysctl.c
··· 73 73 if (r) 74 74 return r; 75 75 76 - if (write) 77 - rtc_mips_set_mmss(rtctmp); 76 + if (write) { 77 + /* 78 + * Due to the RTC hardware limitation, we can not actually 79 + * use the full 64-bit range here. 80 + */ 81 + ts.tv_sec = rtctmp; 82 + ts.tv_nsec = 0; 83 + 84 + update_persistent_clock64(ts); 85 + } 78 86 79 87 return 0; 80 88 }
+1 -2
arch/mips/lib/Makefile
··· 16 16 obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o 17 17 18 18 # libgcc-style stuff needed in the kernel 19 - obj-y += ashldi3.o ashrdi3.o bswapsi.o bswapdi.o cmpdi2.o lshrdi3.o multi3.o \ 20 - ucmpdi2.o 19 + obj-y += bswapsi.o bswapdi.o multi3.o
-30
arch/mips/lib/ashldi3.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/export.h> 3 - 4 - #include "libgcc.h" 5 - 6 - long long notrace __ashldi3(long long u, word_type b) 7 - { 8 - DWunion uu, w; 9 - word_type bm; 10 - 11 - if (b == 0) 12 - return u; 13 - 14 - uu.ll = u; 15 - bm = 32 - b; 16 - 17 - if (bm <= 0) { 18 - w.s.low = 0; 19 - w.s.high = (unsigned int) uu.s.low << -bm; 20 - } else { 21 - const unsigned int carries = (unsigned int) uu.s.low >> bm; 22 - 23 - w.s.low = (unsigned int) uu.s.low << b; 24 - w.s.high = ((unsigned int) uu.s.high << b) | carries; 25 - } 26 - 27 - return w.ll; 28 - } 29 - 30 - EXPORT_SYMBOL(__ashldi3);
-32
arch/mips/lib/ashrdi3.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/export.h> 3 - 4 - #include "libgcc.h" 5 - 6 - long long notrace __ashrdi3(long long u, word_type b) 7 - { 8 - DWunion uu, w; 9 - word_type bm; 10 - 11 - if (b == 0) 12 - return u; 13 - 14 - uu.ll = u; 15 - bm = 32 - b; 16 - 17 - if (bm <= 0) { 18 - /* w.s.high = 1..1 or 0..0 */ 19 - w.s.high = 20 - uu.s.high >> 31; 21 - w.s.low = uu.s.high >> -bm; 22 - } else { 23 - const unsigned int carries = (unsigned int) uu.s.high << bm; 24 - 25 - w.s.high = uu.s.high >> b; 26 - w.s.low = ((unsigned int) uu.s.low >> b) | carries; 27 - } 28 - 29 - return w.ll; 30 - } 31 - 32 - EXPORT_SYMBOL(__ashrdi3);
-28
arch/mips/lib/cmpdi2.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/export.h> 3 - 4 - #include "libgcc.h" 5 - 6 - word_type notrace __cmpdi2(long long a, long long b) 7 - { 8 - const DWunion au = { 9 - .ll = a 10 - }; 11 - const DWunion bu = { 12 - .ll = b 13 - }; 14 - 15 - if (au.s.high < bu.s.high) 16 - return 0; 17 - else if (au.s.high > bu.s.high) 18 - return 2; 19 - 20 - if ((unsigned int) au.s.low < (unsigned int) bu.s.low) 21 - return 0; 22 - else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) 23 - return 2; 24 - 25 - return 1; 26 - } 27 - 28 - EXPORT_SYMBOL(__cmpdi2);
-30
arch/mips/lib/lshrdi3.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/export.h> 3 - 4 - #include "libgcc.h" 5 - 6 - long long notrace __lshrdi3(long long u, word_type b) 7 - { 8 - DWunion uu, w; 9 - word_type bm; 10 - 11 - if (b == 0) 12 - return u; 13 - 14 - uu.ll = u; 15 - bm = 32 - b; 16 - 17 - if (bm <= 0) { 18 - w.s.high = 0; 19 - w.s.low = (unsigned int) uu.s.high >> -bm; 20 - } else { 21 - const unsigned int carries = (unsigned int) uu.s.high << bm; 22 - 23 - w.s.high = (unsigned int) uu.s.high >> b; 24 - w.s.low = ((unsigned int) uu.s.low >> b) | carries; 25 - } 26 - 27 - return w.ll; 28 - } 29 - 30 - EXPORT_SYMBOL(__lshrdi3);
+14 -14
arch/mips/lib/memset.S
··· 95 95 96 96 sltiu t0, a2, STORSIZE /* very small region? */ 97 97 bnez t0, .Lsmall_memset\@ 98 - andi t0, a0, STORMASK /* aligned? */ 98 + andi t0, a0, STORMASK /* aligned? */ 99 99 100 100 #ifdef CONFIG_CPU_MICROMIPS 101 101 move t8, a1 /* used by 'swp' instruction */ ··· 103 103 #endif 104 104 #ifndef CONFIG_CPU_DADDI_WORKAROUNDS 105 105 beqz t0, 1f 106 - PTR_SUBU t0, STORSIZE /* alignment in bytes */ 106 + PTR_SUBU t0, STORSIZE /* alignment in bytes */ 107 107 #else 108 108 .set noat 109 109 li AT, STORSIZE 110 110 beqz t0, 1f 111 - PTR_SUBU t0, AT /* alignment in bytes */ 111 + PTR_SUBU t0, AT /* alignment in bytes */ 112 112 .set at 113 113 #endif 114 114 ··· 149 149 1: ori t1, a2, 0x3f /* # of full blocks */ 150 150 xori t1, 0x3f 151 151 beqz t1, .Lmemset_partial\@ /* no block to fill */ 152 - andi t0, a2, 0x40-STORSIZE 152 + andi t0, a2, 0x40-STORSIZE 153 153 154 154 PTR_ADDU t1, a0 /* end address */ 155 155 .set reorder ··· 174 174 .set at 175 175 #endif 176 176 jr t1 177 - PTR_ADDU a0, t0 /* dest ptr */ 177 + PTR_ADDU a0, t0 /* dest ptr */ 178 178 179 179 .set push 180 180 .set noreorder ··· 186 186 187 187 beqz a2, 1f 188 188 #ifndef CONFIG_CPU_MIPSR6 189 - PTR_ADDU a0, a2 /* What's left */ 189 + PTR_ADDU a0, a2 /* What's left */ 190 190 R10KCBARRIER(0(ra)) 191 191 #ifdef __MIPSEB__ 192 192 EX(LONG_S_R, a1, -1(a0), .Llast_fixup\@) ··· 194 194 EX(LONG_S_L, a1, -1(a0), .Llast_fixup\@) 195 195 #endif 196 196 #else 197 - PTR_SUBU t0, $0, a2 197 + PTR_SUBU t0, $0, a2 198 198 PTR_ADDIU t0, 1 199 199 STORE_BYTE(0) 200 200 STORE_BYTE(1) ··· 210 210 0: 211 211 #endif 212 212 1: jr ra 213 - move a2, zero 213 + move a2, zero 214 214 215 215 .Lsmall_memset\@: 216 216 beqz a2, 2f 217 - PTR_ADDU t1, a0, a2 217 + PTR_ADDU t1, a0, a2 218 218 219 219 1: PTR_ADDIU a0, 1 /* fill bytewise */ 220 220 R10KCBARRIER(0(ra)) ··· 222 222 EX(sb, a1, -1(a0), .Lsmall_fixup\@) 223 223 224 224 2: jr ra /* done */ 225 - move a2, zero 225 + move a2, zero 226 226 .if __memset == 1 227 227 END(memset) 228 228 .set __memset, 0 ··· 238 238 239 239 .Lfirst_fixup\@: 240 240 jr ra 241 - nop 241 + nop 242 242 243 243 .Lfwd_fixup\@: 244 244 PTR_L t0, TI_TASK($28) ··· 246 246 LONG_L t0, THREAD_BUADDR(t0) 247 247 LONG_ADDU a2, t1 248 248 jr ra 249 - LONG_SUBU a2, t0 249 + LONG_SUBU a2, t0 250 250 251 251 .Lpartial_fixup\@: 252 252 PTR_L t0, TI_TASK($28) ··· 254 254 LONG_L t0, THREAD_BUADDR(t0) 255 255 LONG_ADDU a2, a0 256 256 jr ra 257 - LONG_SUBU a2, t0 257 + LONG_SUBU a2, t0 258 258 259 259 .Llast_fixup\@: 260 260 jr ra ··· 278 278 LEAF(memset) 279 279 EXPORT_SYMBOL(memset) 280 280 beqz a1, 1f 281 - move v0, a0 /* result */ 281 + move v0, a0 /* result */ 282 282 283 283 andi a1, 0xff /* spread fillword */ 284 284 LONG_SLL t1, a1, 8
-22
arch/mips/lib/ucmpdi2.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/export.h> 3 - 4 - #include "libgcc.h" 5 - 6 - word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b) 7 - { 8 - const DWunion au = {.ll = a}; 9 - const DWunion bu = {.ll = b}; 10 - 11 - if ((unsigned int) au.s.high < (unsigned int) bu.s.high) 12 - return 0; 13 - else if ((unsigned int) au.s.high > (unsigned int) bu.s.high) 14 - return 2; 15 - if ((unsigned int) au.s.low < (unsigned int) bu.s.low) 16 - return 0; 17 - else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) 18 - return 2; 19 - return 1; 20 - } 21 - 22 - EXPORT_SYMBOL(__ucmpdi2);
+1 -1
arch/mips/loongson64/common/time.c
··· 29 29 #endif 30 30 } 31 31 32 - void read_persistent_clock(struct timespec *ts) 32 + void read_persistent_clock64(struct timespec64 *ts) 33 33 { 34 34 ts->tv_sec = mc146818_get_cmos_time(); 35 35 ts->tv_nsec = 0;
+1 -8
arch/mips/mm/sc-debugfs.c
··· 31 31 const char __user *user_buf, 32 32 size_t count, loff_t *ppos) 33 33 { 34 - char buf[32]; 35 - ssize_t buf_size; 36 34 bool enabled; 37 35 int err; 38 36 39 - buf_size = min(count, sizeof(buf) - 1); 40 - if (copy_from_user(buf, user_buf, buf_size)) 41 - return -EFAULT; 42 - 43 - buf[buf_size] = '\0'; 44 - err = strtobool(buf, &enabled); 37 + err = kstrtobool_from_user(user_buf, count, &enabled); 45 38 if (err) 46 39 return err; 47 40
+1 -1
arch/mips/mti-malta/malta-time.c
··· 134 134 } 135 135 } 136 136 137 - void read_persistent_clock(struct timespec *ts) 137 + void read_persistent_clock64(struct timespec64 *ts) 138 138 { 139 139 ts->tv_sec = mc146818_get_cmos_time(); 140 140 ts->tv_nsec = 0;
-2
arch/mips/oprofile/op_model_mipsxx.c
··· 36 36 #endif 37 37 38 38 #ifdef CONFIG_MIPS_MT_SMP 39 - static int cpu_has_mipsmt_pertccounters; 40 39 #define WHAT (MIPS_PERFCTRL_MT_EN_VPE | \ 41 40 M_PERFCTL_VPEID(cpu_vpe_id(&current_cpu_data))) 42 41 #define vpe_id() (cpu_has_mipsmt_pertccounters ? \ ··· 325 326 } 326 327 327 328 #ifdef CONFIG_MIPS_MT_SMP 328 - cpu_has_mipsmt_pertccounters = read_c0_config7() & (1<<19); 329 329 if (!cpu_has_mipsmt_pertccounters) 330 330 counters = counters_total_to_per_cpu(counters); 331 331 #endif
+4 -4
arch/mips/sibyte/swarm/rtc_m41t81.c
··· 141 141 return 0; 142 142 } 143 143 144 - int m41t81_set_time(unsigned long t) 144 + int m41t81_set_time(time64_t t) 145 145 { 146 146 struct rtc_time tm; 147 147 unsigned long flags; 148 148 149 149 /* Note we don't care about the century */ 150 - rtc_time_to_tm(t, &tm); 150 + rtc_time64_to_tm(t, &tm); 151 151 152 152 /* 153 153 * Note the write order matters as it ensures the correctness. ··· 188 188 return 0; 189 189 } 190 190 191 - unsigned long m41t81_get_time(void) 191 + time64_t m41t81_get_time(void) 192 192 { 193 193 unsigned int year, mon, day, hour, min, sec; 194 194 unsigned long flags; ··· 218 218 219 219 year += 2000; 220 220 221 - return mktime(year, mon, day, hour, min, sec); 221 + return mktime64(year, mon, day, hour, min, sec); 222 222 } 223 223 224 224 int m41t81_probe(void)
+4 -4
arch/mips/sibyte/swarm/rtc_xicor1241.c
··· 109 109 } 110 110 } 111 111 112 - int xicor_set_time(unsigned long t) 112 + int xicor_set_time(time64_t t) 113 113 { 114 114 struct rtc_time tm; 115 115 int tmp; 116 116 unsigned long flags; 117 117 118 - rtc_time_to_tm(t, &tm); 118 + rtc_time64_to_tm(t, &tm); 119 119 tm.tm_year += 1900; 120 120 121 121 spin_lock_irqsave(&rtc_lock, flags); ··· 168 168 return 0; 169 169 } 170 170 171 - unsigned long xicor_get_time(void) 171 + time64_t xicor_get_time(void) 172 172 { 173 173 unsigned int year, mon, day, hour, min, sec, y2k; 174 174 unsigned long flags; ··· 201 201 202 202 year += (y2k * 100); 203 203 204 - return mktime(year, mon, day, hour, min, sec); 204 + return mktime64(year, mon, day, hour, min, sec); 205 205 } 206 206 207 207 int xicor_probe(void)
+10 -8
arch/mips/sibyte/swarm/setup.c
··· 57 57 #endif 58 58 59 59 extern int xicor_probe(void); 60 - extern int xicor_set_time(unsigned long); 61 - extern unsigned long xicor_get_time(void); 60 + extern int xicor_set_time(time64_t); 61 + extern time64_t xicor_get_time(void); 62 62 63 63 extern int m41t81_probe(void); 64 - extern int m41t81_set_time(unsigned long); 65 - extern unsigned long m41t81_get_time(void); 64 + extern int m41t81_set_time(time64_t); 65 + extern time64_t m41t81_get_time(void); 66 66 67 67 const char *get_system_type(void) 68 68 { ··· 87 87 88 88 enum swarm_rtc_type swarm_rtc_type; 89 89 90 - void read_persistent_clock(struct timespec *ts) 90 + void read_persistent_clock64(struct timespec64 *ts) 91 91 { 92 - unsigned long sec; 92 + time64_t sec; 93 93 94 94 switch (swarm_rtc_type) { 95 95 case RTC_XICOR: ··· 102 102 103 103 case RTC_NONE: 104 104 default: 105 - sec = mktime(2000, 1, 1, 0, 0, 0); 105 + sec = mktime64(2000, 1, 1, 0, 0, 0); 106 106 break; 107 107 } 108 108 ts->tv_sec = sec; 109 109 ts->tv_nsec = 0; 110 110 } 111 111 112 - int rtc_mips_set_time(unsigned long sec) 112 + int update_persistent_clock64(struct timespec64 now) 113 113 { 114 + time64_t sec = now.tv_sec; 115 + 114 116 switch (swarm_rtc_type) { 115 117 case RTC_XICOR: 116 118 return xicor_set_time(sec);
-6
arch/mips/sni/time.c
··· 171 171 } 172 172 setup_pit_timer(); 173 173 } 174 - 175 - void read_persistent_clock(struct timespec *ts) 176 - { 177 - ts->tv_sec = -1; 178 - ts->tv_nsec = 0; 179 - }
+3 -3
arch/riscv/Kconfig
··· 103 103 config ARCH_RV32I 104 104 bool "RV32I" 105 105 select 32BIT 106 - select GENERIC_ASHLDI3 107 - select GENERIC_ASHRDI3 108 - select GENERIC_LSHRDI3 106 + select GENERIC_LIB_ASHLDI3 107 + select GENERIC_LIB_ASHRDI3 108 + select GENERIC_LIB_LSHRDI3 109 109 110 110 config ARCH_RV64I 111 111 bool "RV64I"
+1 -1
drivers/firmware/broadcom/bcm47xx_nvram.c
··· 36 36 37 37 static char nvram_buf[NVRAM_SPACE]; 38 38 static size_t nvram_len; 39 - static const u32 nvram_sizes[] = {0x8000, 0xF000, 0x10000}; 39 + static const u32 nvram_sizes[] = {0x6000, 0x8000, 0xF000, 0x10000}; 40 40 41 41 static u32 find_nvram_size(void __iomem *end) 42 42 {
+16 -26
drivers/watchdog/jz4740_wdt.c
··· 124 124 { 125 125 struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev); 126 126 127 - jz4740_timer_disable_watchdog(); 128 127 writeb(0x0, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE); 128 + jz4740_timer_disable_watchdog(); 129 129 130 + return 0; 131 + } 132 + 133 + static int jz4740_wdt_restart(struct watchdog_device *wdt_dev, 134 + unsigned long action, void *data) 135 + { 136 + wdt_dev->timeout = 0; 137 + jz4740_wdt_start(wdt_dev); 130 138 return 0; 131 139 } 132 140 ··· 149 141 .stop = jz4740_wdt_stop, 150 142 .ping = jz4740_wdt_ping, 151 143 .set_timeout = jz4740_wdt_set_timeout, 144 + .restart = jz4740_wdt_restart, 152 145 }; 153 146 154 147 #ifdef CONFIG_OF ··· 188 179 189 180 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 190 181 drvdata->base = devm_ioremap_resource(&pdev->dev, res); 191 - if (IS_ERR(drvdata->base)) { 192 - ret = PTR_ERR(drvdata->base); 193 - goto err_out; 194 - } 182 + if (IS_ERR(drvdata->base)) 183 + return PTR_ERR(drvdata->base); 195 184 196 - drvdata->rtc_clk = clk_get(&pdev->dev, "rtc"); 185 + drvdata->rtc_clk = devm_clk_get(&pdev->dev, "rtc"); 197 186 if (IS_ERR(drvdata->rtc_clk)) { 198 187 dev_err(&pdev->dev, "cannot find RTC clock\n"); 199 - ret = PTR_ERR(drvdata->rtc_clk); 200 - goto err_out; 188 + return PTR_ERR(drvdata->rtc_clk); 201 189 } 202 190 203 - ret = watchdog_register_device(&drvdata->wdt); 191 + ret = devm_watchdog_register_device(&pdev->dev, &drvdata->wdt); 204 192 if (ret < 0) 205 - goto err_disable_clk; 193 + return ret; 206 194 207 195 platform_set_drvdata(pdev, drvdata); 208 - return 0; 209 - 210 - err_disable_clk: 211 - clk_put(drvdata->rtc_clk); 212 - err_out: 213 - return ret; 214 - } 215 - 216 - static int jz4740_wdt_remove(struct platform_device *pdev) 217 - { 218 - struct jz4740_wdt_drvdata *drvdata = platform_get_drvdata(pdev); 219 - 220 - jz4740_wdt_stop(&drvdata->wdt); 221 - watchdog_unregister_device(&drvdata->wdt); 222 - clk_put(drvdata->rtc_clk); 223 196 224 197 return 0; 225 198 } 226 199 227 200 static struct platform_driver jz4740_wdt_driver = { 228 201 .probe = jz4740_wdt_probe, 229 - .remove = jz4740_wdt_remove, 230 202 .driver = { 231 203 .name = "jz4740-wdt", 232 204 .of_match_table = of_match_ptr(jz4740_wdt_of_matches),
+6 -6
lib/Kconfig
··· 642 642 643 643 endmenu 644 644 645 - config GENERIC_ASHLDI3 645 + config GENERIC_LIB_ASHLDI3 646 646 bool 647 647 648 - config GENERIC_ASHRDI3 648 + config GENERIC_LIB_ASHRDI3 649 649 bool 650 650 651 - config GENERIC_LSHRDI3 651 + config GENERIC_LIB_LSHRDI3 652 652 bool 653 653 654 - config GENERIC_MULDI3 654 + config GENERIC_LIB_MULDI3 655 655 bool 656 656 657 - config GENERIC_CMPDI2 657 + config GENERIC_LIB_CMPDI2 658 658 bool 659 659 660 - config GENERIC_UCMPDI2 660 + config GENERIC_LIB_UCMPDI2 661 661 bool
+6 -6
lib/Makefile
··· 261 261 obj-$(CONFIG_PARMAN) += parman.o 262 262 263 263 # GCC library routines 264 - obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o 265 - obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o 266 - obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o 267 - obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o 268 - obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o 269 - obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o 264 + obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o 265 + obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o 266 + obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o 267 + obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o 268 + obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o 269 + obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o
+1 -1
lib/ucmpdi2.c
··· 17 17 #include <linux/module.h> 18 18 #include <linux/libgcc.h> 19 19 20 - word_type __ucmpdi2(unsigned long long a, unsigned long long b) 20 + word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b) 21 21 { 22 22 const DWunion au = {.ll = a}; 23 23 const DWunion bu = {.ll = b};