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

Pull MIPS updates from Thomas Bogendoerfer:

- switch longson32 platform to DT and use MIPS_GENERIC framework

- cleanups/fixes for lantiq DTs

- other cleanups and fixes

* tag 'mips_6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (30 commits)
mips: math-emu: replace deprecated strcpy() in me-debugfs
MIPS: configs: Consolidate Loongson1 defconfigs
MIPS: Unify Loongson1 PRID_REV
MIPS: loongson32: Switch to generic core
MIPS: loongson: Add built-in DTB support
MIPS: dts: loongson: Add CQ-T300B board
MIPS: dts: loongson: Add Smartloong-1C board
MIPS: dts: loongson: Add LSGZ_1B_DEV board
MIPS: dts: loongson: Add LS1B-DEMO board
dt-bindings: mips: loongson: Add LS1B-DEMO and CQ-T300B
mips: lantiq: danube: rename stp node on EASY50712 reference board
mips: lantiq: xway: sysctrl: rename stp clock
MIPS: RB532: Replace deprecated strcpy() with memcpy() and strscpy()
MIPS: Loongson64: Replace deprecated strcpy() with strscpy_pad()
MIPS: generic: Replace deprecated strcpy() in ocelot_detect()
MIPS: octeon: Replace deprecated strcpy() in octeon_model_get_string_buffer()
MIPS: octeon: Replace memset(0) + deprecated strcpy() with strscpy_pad()
MIPS: arc: Replace deprecated strcpy() with memcpy()
MIPS: txx9: Replace deprecated strcpy() with strscpy()
MIPS: sni: Replace deprecated strcpy() in sni_console_setup()
...

+1459 -1509
+1
Documentation/devicetree/bindings/mips/cpus.yaml
··· 33 33 - mips,mips1004Kc 34 34 - mips,mips24KEc 35 35 - mips,mips24Kc 36 + - mips,mips34Kc 36 37 - mips,mips4KEc 37 38 - mips,mips4Kc 38 39 - mips,mips74Kc
+2
Documentation/devicetree/bindings/mips/loongson/devices.yaml
··· 40 40 - description: LS1B based boards 41 41 items: 42 42 - enum: 43 + - loongson,ls1b-demo 43 44 - loongson,lsgz-1b-dev 44 45 - const: loongson,ls1b 45 46 ··· 48 47 items: 49 48 - enum: 50 49 - loongmasses,smartloong-1c 50 + - loongson,cq-t300b 51 51 - const: loongson,ls1c 52 52 53 53 additionalProperties: true
+2 -1
MAINTAINERS
··· 17267 17267 L: linux-mips@vger.kernel.org 17268 17268 S: Maintained 17269 17269 F: Documentation/devicetree/bindings/*/loongson,ls1*.yaml 17270 - F: arch/mips/include/asm/mach-loongson32/ 17270 + F: arch/mips/boot/dts/loongson/loongson1* 17271 + F: arch/mips/configs/loongson1_defconfig 17271 17272 F: arch/mips/loongson32/ 17272 17273 F: drivers/*/*loongson1* 17273 17274 F: drivers/mtd/nand/raw/loongson-nand-controller.c
+32 -32
arch/mips/Kconfig
··· 479 479 480 480 config MACH_LOONGSON32 481 481 bool "Loongson 32-bit family of machines" 482 + select MACH_GENERIC_CORE 483 + select USE_OF 484 + select BUILTIN_DTB 485 + select BOOT_ELF32 486 + select CEVT_R4K 487 + select CSRC_R4K 488 + select COMMON_CLK 489 + select DMA_NONCOHERENT 490 + select GENERIC_IRQ_SHOW_LEVEL 491 + select IRQ_MIPS_CPU 492 + select LS1X_IRQ 493 + select SYS_HAS_CPU_LOONGSON32 494 + select SYS_HAS_EARLY_PRINTK 495 + select USE_GENERIC_EARLY_PRINTK_8250 496 + select SYS_SUPPORTS_32BIT_KERNEL 497 + select SYS_SUPPORTS_LITTLE_ENDIAN 498 + select SYS_SUPPORTS_HIGHMEM 482 499 select SYS_SUPPORTS_ZBOOT 483 500 help 484 501 This enables support for the Loongson-1 family of machines. ··· 1402 1385 have a similar programming interface with FPGA northbridge used in 1403 1386 Loongson2E. 1404 1387 1405 - config CPU_LOONGSON1B 1406 - bool "Loongson 1B" 1407 - depends on SYS_HAS_CPU_LOONGSON1B 1408 - select CPU_LOONGSON32 1388 + config CPU_LOONGSON32 1389 + bool "Loongson 32-bit CPU" 1390 + depends on SYS_HAS_CPU_LOONGSON32 1391 + select CPU_MIPS32 1392 + select CPU_MIPSR2 1393 + select CPU_HAS_PREFETCH 1394 + select CPU_HAS_LOAD_STORE_LR 1395 + select CPU_SUPPORTS_32BIT_KERNEL 1396 + select CPU_SUPPORTS_HIGHMEM 1397 + select CPU_SUPPORTS_CPUFREQ 1409 1398 select LEDS_GPIO_REGISTER 1410 1399 help 1411 - The Loongson 1B is a 32-bit SoC, which implements the MIPS32 1412 - Release 1 instruction set and part of the MIPS32 Release 2 1413 - instruction set. 1414 - 1415 - config CPU_LOONGSON1C 1416 - bool "Loongson 1C" 1417 - depends on SYS_HAS_CPU_LOONGSON1C 1418 - select CPU_LOONGSON32 1419 - select LEDS_GPIO_REGISTER 1420 - help 1421 - The Loongson 1C is a 32-bit SoC, which implements the MIPS32 1422 - Release 1 instruction set and part of the MIPS32 Release 2 1423 - instruction set. 1400 + The Loongson GS232 microarchitecture implements the MIPS32 Release 1 1401 + instruction set and part of the MIPS32 Release 2 instruction set. 1424 1402 1425 1403 config CPU_MIPS32_R1 1426 1404 bool "MIPS32 Release 1" ··· 1850 1838 select CPU_SUPPORTS_HUGEPAGES 1851 1839 select RTC_MC146818_LIB 1852 1840 1853 - config CPU_LOONGSON32 1854 - bool 1855 - select CPU_MIPS32 1856 - select CPU_MIPSR2 1857 - select CPU_HAS_PREFETCH 1858 - select CPU_SUPPORTS_32BIT_KERNEL 1859 - select CPU_SUPPORTS_HIGHMEM 1860 - select CPU_SUPPORTS_CPUFREQ 1861 - 1862 1841 config CPU_BMIPS32_3300 1863 1842 select SMP_UP if SMP 1864 1843 bool ··· 1887 1884 select CPU_SUPPORTS_CPUFREQ 1888 1885 select CPU_SUPPORTS_ADDRWINCFG if 64BIT 1889 1886 1890 - config SYS_HAS_CPU_LOONGSON1B 1891 - bool 1892 - 1893 - config SYS_HAS_CPU_LOONGSON1C 1887 + config SYS_HAS_CPU_LOONGSON32 1894 1888 bool 1895 1889 1896 1890 config SYS_HAS_CPU_MIPS32_R1 ··· 2986 2986 prompt "Kernel command line type" 2987 2987 depends on !CMDLINE_OVERRIDE 2988 2988 default MIPS_CMDLINE_FROM_DTB if USE_OF && !ATH79 && !MACH_INGENIC && \ 2989 - !MACH_LOONGSON64 && !MIPS_MALTA && \ 2990 - !CAVIUM_OCTEON_SOC 2989 + !MACH_LOONGSON64 && !MACH_LOONGSON32 && \ 2990 + !MIPS_MALTA && !CAVIUM_OCTEON_SOC 2991 2991 default MIPS_CMDLINE_FROM_BOOTLOADER 2992 2992 2993 2993 config MIPS_CMDLINE_FROM_DTB
+12 -8
arch/mips/alchemy/common/clock.c
··· 211 211 return 0; 212 212 } 213 213 214 - static long alchemy_clk_aux_roundr(struct clk_hw *hw, 215 - unsigned long rate, 216 - unsigned long *parent_rate) 214 + static int alchemy_clk_aux_determine_rate(struct clk_hw *hw, 215 + struct clk_rate_request *req) 217 216 { 218 217 struct alchemy_auxpll_clk *a = to_auxpll_clk(hw); 219 218 unsigned long mult; 220 219 221 - if (!rate || !*parent_rate) 222 - return 0; 220 + if (!req->rate || !req->best_parent_rate) { 221 + req->rate = 0; 223 222 224 - mult = rate / (*parent_rate); 223 + return 0; 224 + } 225 + 226 + mult = req->rate / req->best_parent_rate; 225 227 226 228 if (mult && (mult < 7)) 227 229 mult = 7; 228 230 if (mult > a->maxmult) 229 231 mult = a->maxmult; 230 232 231 - return (*parent_rate) * mult; 233 + req->rate = req->best_parent_rate * mult; 234 + 235 + return 0; 232 236 } 233 237 234 238 static const struct clk_ops alchemy_clkops_aux = { 235 239 .recalc_rate = alchemy_clk_aux_recalc, 236 240 .set_rate = alchemy_clk_aux_setr, 237 - .round_rate = alchemy_clk_aux_roundr, 241 + .determine_rate = alchemy_clk_aux_determine_rate, 238 242 }; 239 243 240 244 static struct clk __init *alchemy_clk_setup_aux(const char *parent_name,
+1
arch/mips/boot/dts/Makefile
··· 8 8 subdir-$(CONFIG_MACH_INGENIC) += ingenic 9 9 subdir-$(CONFIG_LANTIQ) += lantiq 10 10 subdir-$(CONFIG_MACH_LOONGSON64) += loongson 11 + subdir-$(CONFIG_MACH_LOONGSON32) += loongson 11 12 subdir-$(CONFIG_SOC_VCOREIII) += mscc 12 13 subdir-$(CONFIG_MIPS_MALTA) += mti 13 14 subdir-$(CONFIG_LEGACY_BOARD_SEAD3) += mti
+2 -1
arch/mips/boot/dts/brcm/bcm7346.dtsi
··· 531 531 }; 532 532 533 533 memc-ddr@2000 { 534 - compatible = "brcm,brcmstb-memc-ddr"; 534 + compatible = "brcm,brcmstb-memc-ddr-rev-a.0.0", 535 + "brcm,brcmstb-memc-ddr"; 535 536 reg = <0x2000 0x300>; 536 537 }; 537 538
+2 -1
arch/mips/boot/dts/brcm/bcm7360.dtsi
··· 450 450 }; 451 451 452 452 memc-ddr@2000 { 453 - compatible = "brcm,brcmstb-memc-ddr"; 453 + compatible = "brcm,brcmstb-memc-ddr-rev-a.0.0", 454 + "brcm,brcmstb-memc-ddr"; 454 455 reg = <0x2000 0x300>; 455 456 }; 456 457
+2 -1
arch/mips/boot/dts/brcm/bcm7362.dtsi
··· 446 446 }; 447 447 448 448 memc-ddr@2000 { 449 - compatible = "brcm,brcmstb-memc-ddr"; 449 + compatible = "brcm,brcmstb-memc-ddr-rev-a.0.0", 450 + "brcm,brcmstb-memc-ddr"; 450 451 reg = <0x2000 0x300>; 451 452 }; 452 453
+4 -2
arch/mips/boot/dts/brcm/bcm7425.dtsi
··· 542 542 }; 543 543 544 544 memc-ddr@2000 { 545 - compatible = "brcm,brcmstb-memc-ddr"; 545 + compatible = "brcm,brcmstb-memc-ddr-rev-a.0.0", 546 + "brcm,brcmstb-memc-ddr"; 546 547 reg = <0x2000 0x300>; 547 548 }; 548 549 ··· 570 569 }; 571 570 572 571 memc-ddr@2000 { 573 - compatible = "brcm,brcmstb-memc-ddr"; 572 + compatible = "brcm,brcmstb-memc-ddr-rev-a.0.0", 573 + "brcm,brcmstb-memc-ddr"; 574 574 reg = <0x2000 0x300>; 575 575 }; 576 576
+4 -2
arch/mips/boot/dts/brcm/bcm7435.dtsi
··· 558 558 }; 559 559 560 560 memc-ddr@2000 { 561 - compatible = "brcm,brcmstb-memc-ddr"; 561 + compatible = "brcm,brcmstb-memc-ddr-rev-a.0.0", 562 + "brcm,brcmstb-memc-ddr"; 562 563 reg = <0x2000 0x300>; 563 564 }; 564 565 ··· 586 585 }; 587 586 588 587 memc-ddr@2000 { 589 - compatible = "brcm,brcmstb-memc-ddr"; 588 + compatible = "brcm,brcmstb-memc-ddr-rev-a.0.0", 589 + "brcm,brcmstb-memc-ddr"; 590 590 reg = <0x2000 0x300>; 591 591 }; 592 592
+6
arch/mips/boot/dts/lantiq/danube.dtsi
··· 5 5 compatible = "lantiq,xway", "lantiq,danube"; 6 6 7 7 cpus { 8 + #address-cells = <1>; 9 + #size-cells = <0>; 10 + 8 11 cpu@0 { 9 12 compatible = "mips,mips24Kc"; 13 + reg = <0>; 10 14 }; 11 15 }; 12 16 ··· 104 100 0x1000000 0 0x00000000 0xae00000 0 0x200000>; /* io space */ 105 101 reg = <0x7000000 0x8000 /* config space */ 106 102 0xe105400 0x400>; /* pci bridge */ 103 + 104 + device_type = "pci"; 107 105 }; 108 106 }; 109 107 };
+3 -1
arch/mips/boot/dts/lantiq/danube_easy50712.dts
··· 4 4 /include/ "danube.dtsi" 5 5 6 6 / { 7 + model = "Intel EASY50712"; 8 + 7 9 chosen { 8 10 bootargs = "console=ttyLTQ0,115200 init=/etc/preinit"; 9 11 }; ··· 96 94 lantiq,tx-burst-length = <4>; 97 95 }; 98 96 99 - stp0: stp@e100bb0 { 97 + stp0: gpio@e100bb0 { 100 98 #gpio-cells = <2>; 101 99 compatible = "lantiq,gpio-stp-xway"; 102 100 gpio-controller;
+10
arch/mips/boot/dts/loongson/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 + 3 + ifneq ($(CONFIG_BUILTIN_DTB_NAME),) 4 + dtb-y := $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME)) 5 + else 2 6 dtb-$(CONFIG_MACH_LOONGSON64) += loongson64_2core_2k1000.dtb 3 7 dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_4core_ls7a.dtb 4 8 dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_4core_rs780e.dtb 5 9 dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_8core_rs780e.dtb 6 10 dtb-$(CONFIG_MACH_LOONGSON64) += loongson64g_4core_ls7a.dtb 7 11 dtb-$(CONFIG_MACH_LOONGSON64) += loongson64v_4core_virtio.dtb 12 + 13 + dtb-$(CONFIG_MACH_LOONGSON32) += cq-t300b.dtb 14 + dtb-$(CONFIG_MACH_LOONGSON32) += ls1b-demo.dtb 15 + dtb-$(CONFIG_MACH_LOONGSON32) += lsgz_1b_dev.dtb 16 + dtb-$(CONFIG_MACH_LOONGSON32) += smartloong-1c.dtb 17 + endif
+110
arch/mips/boot/dts/loongson/cq-t300b.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com> 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include <dt-bindings/gpio/gpio.h> 9 + 10 + #include "loongson1c.dtsi" 11 + 12 + / { 13 + compatible = "loongson,cq-t300b", "loongson,ls1c"; 14 + model = "CQ-T300B Board"; 15 + 16 + memory@0 { 17 + device_type = "memory"; 18 + reg = <0x0 0x8000000>; 19 + }; 20 + 21 + aliases { 22 + gpio0 = &gpio0; 23 + gpio1 = &gpio1; 24 + gpio2 = &gpio2; 25 + gpio3 = &gpio3; 26 + serial0 = &uart2; 27 + }; 28 + 29 + chosen { 30 + stdout-path = "serial0:115200n8"; 31 + }; 32 + 33 + leds { 34 + compatible = "gpio-leds"; 35 + 36 + led0 { 37 + label = "led0"; 38 + gpios = <&gpio1 20 GPIO_ACTIVE_LOW>; 39 + linux,default-trigger = "heartbeat"; 40 + }; 41 + 42 + led1 { 43 + label = "led1"; 44 + gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; 45 + linux,default-trigger = "nand-disk"; 46 + }; 47 + }; 48 + }; 49 + 50 + &xtal { 51 + clock-frequency = <24000000>; 52 + }; 53 + 54 + &emac { 55 + phy-handle = <&phy0>; 56 + phy-mode = "rmii"; 57 + status = "okay"; 58 + 59 + mdio { 60 + compatible = "snps,dwmac-mdio"; 61 + #address-cells = <1>; 62 + #size-cells = <0>; 63 + 64 + phy0: ethernet-phy@13 { 65 + reg = <0x13>; 66 + }; 67 + }; 68 + }; 69 + 70 + &nand { 71 + status = "okay"; 72 + 73 + nand@0 { 74 + partitions { 75 + compatible = "fixed-partitions"; 76 + #address-cells = <1>; 77 + #size-cells = <1>; 78 + 79 + partition@0 { 80 + label = "kernel"; 81 + reg = <0x0 0x1000000>; 82 + }; 83 + 84 + partition@1000000 { 85 + label = "rootfs"; 86 + reg = <0x1000000 0x3f000000>; 87 + }; 88 + }; 89 + }; 90 + }; 91 + 92 + &ehci { 93 + status = "okay"; 94 + }; 95 + 96 + &ohci { 97 + status = "okay"; 98 + }; 99 + 100 + &rtc { 101 + status = "okay"; 102 + }; 103 + 104 + &uart2 { 105 + status = "okay"; 106 + }; 107 + 108 + &watchdog { 109 + status = "okay"; 110 + };
+136
arch/mips/boot/dts/loongson/loongson1.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com> 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include <dt-bindings/clock/loongson,ls1x-clk.h> 9 + #include <dt-bindings/interrupt-controller/irq.h> 10 + 11 + / { 12 + #address-cells = <1>; 13 + #size-cells = <1>; 14 + 15 + xtal: clock { 16 + compatible = "fixed-clock"; 17 + clock-output-names = "xtal"; 18 + #clock-cells = <0>; 19 + }; 20 + 21 + cpus { 22 + #address-cells = <1>; 23 + #size-cells = <0>; 24 + 25 + cpu0: cpu@0 { 26 + reg = <0>; 27 + device_type = "cpu"; 28 + clocks = <&clkc LS1X_CLKID_CPU>; 29 + #clock-cells = <1>; 30 + }; 31 + }; 32 + 33 + cpu_intc: interrupt-controller { 34 + compatible = "mti,cpu-interrupt-controller"; 35 + interrupt-controller; 36 + #interrupt-cells = <1>; 37 + #address-cells = <0>; 38 + }; 39 + 40 + soc: bus@1fd00000 { 41 + compatible = "simple-bus"; 42 + #address-cells = <1>; 43 + #size-cells = <1>; 44 + ranges = <0x0 0x1fd00000 0x130000>; 45 + 46 + intc0: interrupt-controller@1040 { 47 + compatible = "loongson,ls1x-intc"; 48 + reg = <0x1040 0x18>; 49 + interrupt-controller; 50 + interrupt-parent = <&cpu_intc>; 51 + interrupts = <2>; 52 + #interrupt-cells = <2>; 53 + }; 54 + 55 + intc1: interrupt-controller@1058 { 56 + compatible = "loongson,ls1x-intc"; 57 + reg = <0x1058 0x18>; 58 + interrupt-controller; 59 + interrupt-parent = <&cpu_intc>; 60 + interrupts = <3>; 61 + #interrupt-cells = <2>; 62 + }; 63 + 64 + intc2: interrupt-controller@1070 { 65 + compatible = "loongson,ls1x-intc"; 66 + reg = <0x1070 0x18>; 67 + interrupt-controller; 68 + interrupt-parent = <&cpu_intc>; 69 + interrupts = <4>; 70 + #interrupt-cells = <2>; 71 + }; 72 + 73 + intc3: interrupt-controller@1088 { 74 + compatible = "loongson,ls1x-intc"; 75 + reg = <0x1088 0x18>; 76 + interrupt-controller; 77 + interrupt-parent = <&cpu_intc>; 78 + interrupts = <5>; 79 + #interrupt-cells = <2>; 80 + }; 81 + 82 + gpio0: gpio@10c0 { 83 + compatible = "loongson,ls1x-gpio"; 84 + reg = <0x10c0 0x4>; 85 + gpio-controller; 86 + #gpio-cells = <2>; 87 + }; 88 + 89 + gpio1: gpio@10c4 { 90 + compatible = "loongson,ls1x-gpio"; 91 + reg = <0x10c4 0x4>; 92 + gpio-controller; 93 + #gpio-cells = <2>; 94 + }; 95 + }; 96 + 97 + apb: bus@1fe40000 { 98 + compatible = "simple-bus"; 99 + #address-cells = <1>; 100 + #size-cells = <1>; 101 + ranges = <0x0 0x1fe40000 0xc0000>; 102 + 103 + uart0: serial@0 { 104 + compatible = "ns16550a"; 105 + reg = <0x0 0x8>; 106 + clocks = <&clkc LS1X_CLKID_APB>; 107 + interrupt-parent = <&intc0>; 108 + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; 109 + status = "disabled"; 110 + }; 111 + 112 + uart1: serial@4000 { 113 + compatible = "ns16550a"; 114 + reg = <0x4000 0x8>; 115 + clocks = <&clkc LS1X_CLKID_APB>; 116 + interrupt-parent = <&intc0>; 117 + status = "disabled"; 118 + }; 119 + 120 + uart2: serial@8000 { 121 + compatible = "ns16550a"; 122 + reg = <0x8000 0x8>; 123 + clocks = <&clkc LS1X_CLKID_APB>; 124 + interrupt-parent = <&intc0>; 125 + status = "disabled"; 126 + }; 127 + 128 + uart3: serial@c000 { 129 + compatible = "ns16550a"; 130 + reg = <0xc000 0x8>; 131 + clocks = <&clkc LS1X_CLKID_APB>; 132 + interrupt-parent = <&intc0>; 133 + status = "disabled"; 134 + }; 135 + }; 136 + };
+198
arch/mips/boot/dts/loongson/loongson1b.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com> 4 + */ 5 + 6 + /dts-v1/; 7 + #include "loongson1.dtsi" 8 + 9 + / { 10 + cpu_opp_table: opp-table { 11 + compatible = "operating-points-v2"; 12 + opp-shared; 13 + 14 + opp-44000000 { 15 + opp-hz = /bits/ 64 <44000000>; 16 + }; 17 + opp-47142000 { 18 + opp-hz = /bits/ 64 <47142000>; 19 + }; 20 + opp-50769000 { 21 + opp-hz = /bits/ 64 <50769000>; 22 + }; 23 + opp-55000000 { 24 + opp-hz = /bits/ 64 <55000000>; 25 + }; 26 + opp-60000000 { 27 + opp-hz = /bits/ 64 <60000000>; 28 + }; 29 + opp-66000000 { 30 + opp-hz = /bits/ 64 <66000000>; 31 + }; 32 + opp-73333000 { 33 + opp-hz = /bits/ 64 <73333000>; 34 + }; 35 + opp-82500000 { 36 + opp-hz = /bits/ 64 <82500000>; 37 + }; 38 + opp-94285000 { 39 + opp-hz = /bits/ 64 <94285000>; 40 + }; 41 + opp-110000000 { 42 + opp-hz = /bits/ 64 <110000000>; 43 + }; 44 + opp-132000000 { 45 + opp-hz = /bits/ 64 <132000000>; 46 + }; 47 + opp-165000000 { 48 + opp-hz = /bits/ 64 <165000000>; 49 + }; 50 + opp-220000000 { 51 + opp-hz = /bits/ 64 <220000000>; 52 + }; 53 + }; 54 + 55 + clkc: clock-controller@1fe78030 { 56 + compatible = "loongson,ls1b-clk"; 57 + reg = <0x1fe78030 0x8>; 58 + clocks = <&xtal>; 59 + #clock-cells = <1>; 60 + }; 61 + }; 62 + 63 + &soc { 64 + syscon: syscon@420 { 65 + compatible = "loongson,ls1b-syscon", "syscon"; 66 + reg = <0x420 0x8>; 67 + }; 68 + 69 + dma: dma-controller@1160 { 70 + compatible = "loongson,ls1b-apbdma"; 71 + reg = <0x1160 0x4>; 72 + interrupt-parent = <&intc0>; 73 + interrupts = <13 IRQ_TYPE_EDGE_RISING>, 74 + <14 IRQ_TYPE_EDGE_RISING>, 75 + <15 IRQ_TYPE_EDGE_RISING>; 76 + interrupt-names = "ch0", "ch1", "ch2"; 77 + #dma-cells = <1>; 78 + }; 79 + 80 + ehci: usb@100000 { 81 + compatible = "generic-ehci"; 82 + reg = <0x100000 0x100>; 83 + interrupt-parent = <&intc1>; 84 + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; 85 + status = "disabled"; 86 + }; 87 + 88 + ohci: usb@108000 { 89 + compatible = "generic-ohci"; 90 + reg = <0x108000 0x100>; 91 + interrupt-parent = <&intc1>; 92 + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; 93 + status = "disabled"; 94 + }; 95 + 96 + gmac0: ethernet@110000 { 97 + compatible = "loongson,ls1b-gmac", "snps,dwmac-3.50a"; 98 + reg = <0x110000 0x10000>; 99 + clocks = <&clkc LS1X_CLKID_AHB>; 100 + clock-names = "stmmaceth"; 101 + interrupt-parent = <&intc1>; 102 + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; 103 + interrupt-names = "macirq"; 104 + loongson,ls1-syscon = <&syscon>; 105 + snps,pbl = <1>; 106 + status = "disabled"; 107 + }; 108 + 109 + gmac1: ethernet@120000 { 110 + compatible = "loongson,ls1b-gmac", "snps,dwmac-3.50a"; 111 + reg = <0x120000 0x10000>; 112 + clocks = <&clkc LS1X_CLKID_AHB>; 113 + clock-names = "stmmaceth"; 114 + interrupt-parent = <&intc1>; 115 + interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; 116 + interrupt-names = "macirq"; 117 + loongson,ls1-syscon = <&syscon>; 118 + snps,pbl = <1>; 119 + status = "disabled"; 120 + }; 121 + }; 122 + 123 + &apb { 124 + clocksource: timer@1c030 { 125 + compatible = "loongson,ls1b-pwmtimer"; 126 + reg = <0x1c030 0x10>; 127 + clocks = <&clkc LS1X_CLKID_APB>; 128 + interrupt-parent = <&intc0>; 129 + interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; 130 + }; 131 + 132 + watchdog: watchdog@1c060 { 133 + compatible = "loongson,ls1b-wdt"; 134 + reg = <0x1c060 0xc>; 135 + clocks = <&clkc LS1X_CLKID_APB>; 136 + status = "disabled"; 137 + }; 138 + 139 + rtc: rtc@24000 { 140 + compatible = "loongson,ls1b-rtc"; 141 + reg = <0x24000 0x78>; 142 + interrupt-parent = <&intc0>; 143 + interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; 144 + status = "disabled"; 145 + }; 146 + 147 + ac97: audio-controller@34000 { 148 + compatible = "loongson,ls1b-ac97"; 149 + reg = <0x34000 0x60>, <0x32420 0x4>, <0x34c4c 0x4>; 150 + reg-names = "ac97", "audio-tx", "audio-rx"; 151 + dmas = <&dma 1>, <&dma 2>; 152 + dma-names = "tx", "rx"; 153 + #sound-dai-cells = <0>; 154 + status = "disabled"; 155 + }; 156 + 157 + nand: nand-controller@38000 { 158 + compatible = "loongson,ls1b-nand-controller"; 159 + reg = <0x38000 0x24>, <0x38040 0x4>; 160 + reg-names = "nand", "nand-dma"; 161 + dmas = <&dma 0>; 162 + dma-names = "rxtx"; 163 + #address-cells = <1>; 164 + #size-cells = <0>; 165 + status = "disabled"; 166 + 167 + nand@0 { 168 + reg = <0>; 169 + label = "ls1x-nand"; 170 + nand-use-soft-ecc-engine; 171 + nand-ecc-algo = "hamming"; 172 + }; 173 + }; 174 + }; 175 + 176 + &cpu0 { 177 + operating-points-v2 = <&cpu_opp_table>; 178 + }; 179 + 180 + &gpio0 { 181 + ngpios = <31>; 182 + }; 183 + 184 + &gpio1 { 185 + ngpios = <30>; 186 + }; 187 + 188 + &uart1 { 189 + interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; 190 + }; 191 + 192 + &uart2 { 193 + interrupts = <4 IRQ_TYPE_LEVEL_HIGH>; 194 + }; 195 + 196 + &uart3 { 197 + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; 198 + };
+141
arch/mips/boot/dts/loongson/loongson1c.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com> 4 + */ 5 + 6 + /dts-v1/; 7 + #include "loongson1.dtsi" 8 + 9 + / { 10 + clkc: clock-controller@1fe78030 { 11 + compatible = "loongson,ls1c-clk"; 12 + reg = <0x1fe78030 0x8>; 13 + clocks = <&xtal>; 14 + #clock-cells = <1>; 15 + }; 16 + }; 17 + 18 + &soc { 19 + syscon: syscon@420 { 20 + compatible = "loongson,ls1c-syscon", "syscon"; 21 + reg = <0x420 0x8>; 22 + }; 23 + 24 + intc4: interrupt-controller@10a0 { 25 + compatible = "loongson,ls1x-intc"; 26 + reg = <0x10a0 0x18>; 27 + interrupt-controller; 28 + interrupt-parent = <&cpu_intc>; 29 + interrupts = <6>; 30 + #interrupt-cells = <2>; 31 + }; 32 + 33 + gpio2: gpio@10c8 { 34 + compatible = "loongson,ls1x-gpio"; 35 + reg = <0x10c8 0x4>; 36 + gpio-controller; 37 + ngpios = <32>; 38 + #gpio-cells = <2>; 39 + }; 40 + 41 + gpio3: gpio@10cc { 42 + compatible = "loongson,ls1x-gpio"; 43 + reg = <0x10cc 0x4>; 44 + gpio-controller; 45 + ngpios = <32>; 46 + #gpio-cells = <2>; 47 + }; 48 + 49 + dma: dma-controller@1160 { 50 + compatible = "loongson,ls1c-apbdma", "loongson,ls1b-apbdma"; 51 + reg = <0x1160 0x4>; 52 + interrupt-parent = <&intc0>; 53 + interrupts = <13 IRQ_TYPE_EDGE_RISING>, 54 + <14 IRQ_TYPE_EDGE_RISING>, 55 + <15 IRQ_TYPE_EDGE_RISING>; 56 + interrupt-names = "ch0", "ch1", "ch2"; 57 + #dma-cells = <1>; 58 + }; 59 + 60 + emac: ethernet@110000 { 61 + compatible = "loongson,ls1c-emac", "snps,dwmac-3.50a"; 62 + reg = <0x110000 0x10000>; 63 + clocks = <&clkc LS1X_CLKID_AHB>; 64 + clock-names = "stmmaceth"; 65 + interrupt-parent = <&intc1>; 66 + interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; 67 + interrupt-names = "macirq"; 68 + loongson,ls1-syscon = <&syscon>; 69 + snps,pbl = <1>; 70 + status = "disabled"; 71 + }; 72 + 73 + ehci: usb@120000 { 74 + compatible = "generic-ehci"; 75 + reg = <0x120000 0x100>; 76 + interrupt-parent = <&intc1>; 77 + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; 78 + status = "disabled"; 79 + }; 80 + 81 + ohci: usb@128000 { 82 + compatible = "generic-ohci"; 83 + reg = <0x128000 0x100>; 84 + interrupt-parent = <&intc1>; 85 + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; 86 + status = "disabled"; 87 + }; 88 + }; 89 + 90 + &apb { 91 + watchdog: watchdog@1c060 { 92 + compatible = "loongson,ls1c-wdt"; 93 + reg = <0x1c060 0xc>; 94 + clocks = <&clkc LS1X_CLKID_APB>; 95 + status = "disabled"; 96 + }; 97 + 98 + rtc: rtc@24000 { 99 + compatible = "loongson,ls1c-rtc"; 100 + reg = <0x24000 0x78>; 101 + status = "disabled"; 102 + }; 103 + 104 + nand: nand-controller@38000 { 105 + compatible = "loongson,ls1c-nand-controller"; 106 + reg = <0x38000 0x24>, <0x38040 0x4>; 107 + reg-names = "nand", "nand-dma"; 108 + dmas = <&dma 0>; 109 + dma-names = "rxtx"; 110 + #address-cells = <1>; 111 + #size-cells = <0>; 112 + status = "disabled"; 113 + 114 + nand@0 { 115 + reg = <0>; 116 + label = "ls1x-nand"; 117 + nand-use-soft-ecc-engine; 118 + nand-ecc-algo = "hamming"; 119 + }; 120 + }; 121 + }; 122 + 123 + &gpio0 { 124 + ngpios = <32>; 125 + }; 126 + 127 + &gpio1 { 128 + ngpios = <32>; 129 + }; 130 + 131 + &uart1 { 132 + interrupts = <4 IRQ_TYPE_LEVEL_HIGH>; 133 + }; 134 + 135 + &uart2 { 136 + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; 137 + }; 138 + 139 + &uart3 { 140 + interrupts = <29 IRQ_TYPE_LEVEL_HIGH>; 141 + };
+125
arch/mips/boot/dts/loongson/ls1b-demo.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com> 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include <dt-bindings/gpio/gpio.h> 9 + 10 + #include "loongson1b.dtsi" 11 + 12 + / { 13 + compatible = "loongson,ls1b-demo", "loongson,ls1b"; 14 + model = "LS1B-DEMO Board"; 15 + 16 + memory@0 { 17 + device_type = "memory"; 18 + reg = <0x0 0x10000000>; 19 + }; 20 + 21 + aliases { 22 + ethernet0 = &gmac0; 23 + ethernet1 = &gmac1; 24 + gpio0 = &gpio0; 25 + gpio1 = &gpio1; 26 + serial0 = &uart0; 27 + }; 28 + 29 + chosen { 30 + stdout-path = "serial0:38400n8"; 31 + }; 32 + 33 + codec: audio-codec { 34 + compatible = "realtek,alc203"; 35 + #sound-dai-cells = <0>; 36 + }; 37 + 38 + sound { 39 + compatible = "simple-audio-card"; 40 + simple-audio-card,name = "ls1b-alc203"; 41 + simple-audio-card,format = "ac97"; 42 + simple-audio-card,widgets = 43 + "Speaker", "Line Out Jack", 44 + "Headphone", "Headphone Jack", 45 + "Microphone", "Microphone Jack"; 46 + simple-audio-card,routing = 47 + "Line Out Jack", "TX", 48 + "Headphone Jack", "TX", 49 + "RX", "Microphone Jack"; 50 + 51 + simple-audio-card,cpu { 52 + sound-dai = <&ac97>; 53 + }; 54 + 55 + simple-audio-card,codec { 56 + sound-dai = <&codec>; 57 + }; 58 + }; 59 + }; 60 + 61 + &xtal { 62 + clock-frequency = <33000000>; 63 + }; 64 + 65 + &gmac0 { 66 + phy-handle = <&phy0>; 67 + phy-mode = "rgmii-id"; 68 + status = "okay"; 69 + 70 + mdio { 71 + compatible = "snps,dwmac-mdio"; 72 + #address-cells = <1>; 73 + #size-cells = <0>; 74 + 75 + phy0: ethernet-phy@0 { 76 + reg = <0x0>; 77 + }; 78 + }; 79 + }; 80 + 81 + &nand { 82 + status = "okay"; 83 + 84 + nand@0 { 85 + partitions { 86 + compatible = "fixed-partitions"; 87 + #address-cells = <1>; 88 + #size-cells = <1>; 89 + 90 + partition@0 { 91 + label = "kernel"; 92 + reg = <0x0 0x1000000>; 93 + }; 94 + 95 + partition@1000000 { 96 + label = "rootfs"; 97 + reg = <0x1000000 0x7000000>; 98 + }; 99 + }; 100 + }; 101 + }; 102 + 103 + &ac97 { 104 + status = "okay"; 105 + }; 106 + 107 + &ehci { 108 + status = "okay"; 109 + }; 110 + 111 + &ohci { 112 + status = "okay"; 113 + }; 114 + 115 + &rtc { 116 + status = "okay"; 117 + }; 118 + 119 + &uart0 { 120 + status = "okay"; 121 + }; 122 + 123 + &watchdog { 124 + status = "okay"; 125 + };
+162
arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com> 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include <dt-bindings/gpio/gpio.h> 9 + 10 + #include "loongson1b.dtsi" 11 + 12 + / { 13 + compatible = "loongson,lsgz-1b-dev", "loongson,ls1b"; 14 + model = "LSGZ_1B_DEV Board"; 15 + 16 + memory@0 { 17 + device_type = "memory"; 18 + reg = <0x0 0x4000000>; 19 + }; 20 + 21 + aliases { 22 + ethernet0 = &gmac0; 23 + ethernet1 = &gmac1; 24 + gpio0 = &gpio0; 25 + gpio1 = &gpio1; 26 + serial0 = &uart2; 27 + serial1 = &uart3; 28 + }; 29 + 30 + chosen { 31 + stdout-path = "serial0:115200n8"; 32 + }; 33 + 34 + leds { 35 + compatible = "gpio-leds"; 36 + 37 + led9 { 38 + label = "led9"; 39 + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; 40 + linux,default-trigger = "heartbeat"; 41 + }; 42 + 43 + led6 { 44 + label = "led6"; 45 + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; 46 + linux,default-trigger = "nand-disk"; 47 + }; 48 + }; 49 + 50 + codec: audio-codec { 51 + compatible = "realtek,alc203"; 52 + #sound-dai-cells = <0>; 53 + }; 54 + 55 + sound { 56 + compatible = "simple-audio-card"; 57 + simple-audio-card,name = "ls1b-alc655"; 58 + simple-audio-card,format = "ac97"; 59 + simple-audio-card,widgets = 60 + "Speaker", "Line Out Jack", 61 + "Line", "Line In Jack", 62 + "Microphone", "Microphone Jack"; 63 + simple-audio-card,routing = 64 + "Line Out Jack", "TX", 65 + "RX", "Line In Jack", 66 + "RX", "Microphone Jack"; 67 + 68 + simple-audio-card,cpu { 69 + sound-dai = <&ac97>; 70 + }; 71 + 72 + simple-audio-card,codec { 73 + sound-dai = <&codec>; 74 + }; 75 + }; 76 + }; 77 + 78 + &xtal { 79 + clock-frequency = <33000000>; 80 + }; 81 + 82 + &gmac0 { 83 + phy-handle = <&phy0>; 84 + phy-mode = "mii"; 85 + status = "okay"; 86 + 87 + mdio { 88 + #address-cells = <1>; 89 + #size-cells = <0>; 90 + compatible = "snps,dwmac-mdio"; 91 + 92 + phy0: ethernet-phy@0 { 93 + reg = <0x0>; 94 + }; 95 + }; 96 + }; 97 + 98 + &gmac1 { 99 + phy-handle = <&phy1>; 100 + phy-mode = "mii"; 101 + status = "okay"; 102 + 103 + mdio { 104 + compatible = "snps,dwmac-mdio"; 105 + #address-cells = <1>; 106 + #size-cells = <0>; 107 + 108 + phy1: ethernet-phy@0 { 109 + reg = <0x0>; 110 + }; 111 + }; 112 + }; 113 + 114 + &nand { 115 + status = "okay"; 116 + 117 + nand@0 { 118 + partitions { 119 + compatible = "fixed-partitions"; 120 + #address-cells = <1>; 121 + #size-cells = <1>; 122 + 123 + partition@0 { 124 + label = "kernel"; 125 + reg = <0x0 0x1000000>; 126 + }; 127 + 128 + partition@1000000 { 129 + label = "rootfs"; 130 + reg = <0x1000000 0x7000000>; 131 + }; 132 + }; 133 + }; 134 + }; 135 + 136 + &ac97 { 137 + status = "okay"; 138 + }; 139 + 140 + &ehci { 141 + status = "okay"; 142 + }; 143 + 144 + &ohci { 145 + status = "okay"; 146 + }; 147 + 148 + &rtc { 149 + status = "okay"; 150 + }; 151 + 152 + &uart2 { 153 + status = "okay"; 154 + }; 155 + 156 + &uart3 { 157 + status = "okay"; 158 + }; 159 + 160 + &watchdog { 161 + status = "okay"; 162 + };
+110
arch/mips/boot/dts/loongson/smartloong-1c.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com> 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include <dt-bindings/gpio/gpio.h> 9 + 10 + #include "loongson1c.dtsi" 11 + 12 + / { 13 + compatible = "loongmasses,smartloong-1c", "loongson,ls1c"; 14 + model = "Smartloong-1C Board"; 15 + 16 + memory@0 { 17 + device_type = "memory"; 18 + reg = <0x0 0x4000000>; 19 + }; 20 + 21 + aliases { 22 + gpio0 = &gpio0; 23 + gpio1 = &gpio1; 24 + gpio2 = &gpio2; 25 + gpio3 = &gpio3; 26 + serial0 = &uart2; 27 + }; 28 + 29 + chosen { 30 + stdout-path = "serial0:115200n8"; 31 + }; 32 + 33 + leds { 34 + compatible = "gpio-leds"; 35 + 36 + led0 { 37 + label = "led0"; 38 + gpios = <&gpio1 20 GPIO_ACTIVE_LOW>; 39 + linux,default-trigger = "heartbeat"; 40 + }; 41 + 42 + led1 { 43 + label = "led1"; 44 + gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; 45 + linux,default-trigger = "nand-disk"; 46 + }; 47 + }; 48 + }; 49 + 50 + &xtal { 51 + clock-frequency = <24000000>; 52 + }; 53 + 54 + &emac { 55 + phy-handle = <&phy0>; 56 + phy-mode = "rmii"; 57 + status = "okay"; 58 + 59 + mdio { 60 + compatible = "snps,dwmac-mdio"; 61 + #address-cells = <1>; 62 + #size-cells = <0>; 63 + 64 + phy0: ethernet-phy@13 { 65 + reg = <0x13>; 66 + }; 67 + }; 68 + }; 69 + 70 + &nand { 71 + status = "okay"; 72 + 73 + nand@0 { 74 + partitions { 75 + compatible = "fixed-partitions"; 76 + #address-cells = <1>; 77 + #size-cells = <1>; 78 + 79 + partition@0 { 80 + label = "kernel"; 81 + reg = <0x0 0x1000000>; 82 + }; 83 + 84 + partition@1000000 { 85 + label = "rootfs"; 86 + reg = <0x1000000 0x7000000>; 87 + }; 88 + }; 89 + }; 90 + }; 91 + 92 + &ehci { 93 + status = "okay"; 94 + }; 95 + 96 + &ohci { 97 + status = "okay"; 98 + }; 99 + 100 + &rtc { 101 + status = "okay"; 102 + }; 103 + 104 + &uart2 { 105 + status = "okay"; 106 + }; 107 + 108 + &watchdog { 109 + status = "okay"; 110 + };
+16 -15
arch/mips/cavium-octeon/executive/octeon-model.c
··· 25 25 * Contact Cavium Networks for more information 26 26 ***********************license end**************************************/ 27 27 28 + #include <linux/string.h> 28 29 #include <asm/octeon/octeon.h> 29 30 30 31 enum octeon_feature_bits __octeon_feature_bits __read_mostly; ··· 209 208 */ 210 209 switch (chip_id & 0xf) { 211 210 case 0: 212 - strcpy(pass, "1.X"); 211 + strscpy(pass, "1.X"); 213 212 break; 214 213 case 1: 215 - strcpy(pass, "2.X"); 214 + strscpy(pass, "2.X"); 216 215 break; 217 216 case 3: 218 - strcpy(pass, "3.X"); 217 + strscpy(pass, "3.X"); 219 218 break; 220 219 default: 221 - strcpy(pass, "X.X"); 220 + strscpy(pass, "X.X"); 222 221 break; 223 222 } 224 223 break; ··· 233 232 */ 234 233 switch (chip_id & 0xf) { 235 234 case 0: 236 - strcpy(pass, "1.0"); 235 + strscpy(pass, "1.0"); 237 236 break; 238 237 case 2: 239 - strcpy(pass, "1.1"); 238 + strscpy(pass, "1.1"); 240 239 break; 241 240 default: 242 - strcpy(pass, "X.X"); 241 + strscpy(pass, "X.X"); 243 242 break; 244 243 } 245 244 break; ··· 254 253 */ 255 254 switch (chip_id & 0xf) { 256 255 case 0: 257 - strcpy(pass, "1.0"); 256 + strscpy(pass, "1.0"); 258 257 break; 259 258 case 2: 260 - strcpy(pass, "1.1"); 259 + strscpy(pass, "1.1"); 261 260 break; 262 261 default: 263 - strcpy(pass, "X.X"); 262 + strscpy(pass, "X.X"); 264 263 break; 265 264 } 266 265 break; ··· 274 273 if ((chip_id & 0xFF) < 0x8) { 275 274 switch (chip_id & 0x3) { 276 275 case 0: 277 - strcpy(pass, "1.0"); 276 + strscpy(pass, "1.0"); 278 277 break; 279 278 case 1: 280 - strcpy(pass, "1.1"); 279 + strscpy(pass, "1.1"); 281 280 break; 282 281 case 3: 283 - strcpy(pass, "1.2"); 282 + strscpy(pass, "1.2"); 284 283 break; 285 284 default: 286 - strcpy(pass, "1.X"); 285 + strscpy(pass, "1.X"); 287 286 break; 288 287 } 289 288 } ··· 448 447 default: 449 448 family = "XX"; 450 449 core_model = "XX"; 451 - strcpy(pass, "X.X"); 450 + strscpy(pass, "X.X"); 452 451 suffix = "XXX"; 453 452 break; 454 453 }
+2 -2
arch/mips/cavium-octeon/octeon-platform.c
··· 13 13 #include <linux/of_fdt.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/libfdt.h> 16 + #include <linux/string.h> 16 17 17 18 #include <asm/octeon/octeon.h> 18 19 #include <asm/octeon/cvmx-helper-board.h> ··· 539 538 540 539 if (octeon_has_88e1145()) { 541 540 fdt_nop_property(initial_boot_params, phy, "marvell,reg-init"); 542 - memset(new_name, 0, sizeof(new_name)); 543 - strcpy(new_name, "marvell,88e1145"); 541 + strscpy_pad(new_name, "marvell,88e1145"); 544 542 p = fdt_getprop(initial_boot_params, phy, "compatible", 545 543 &current_len); 546 544 if (p && current_len >= strlen(new_name))
+1 -1
arch/mips/cavium-octeon/smp.c
··· 334 334 new_mask = *p; 335 335 } 336 336 337 - pr_info("Reset core %d. Available Coremask = 0x%x \n", coreid, new_mask); 337 + pr_info("Reset core %d. Available Coremask = 0x%x\n", coreid, new_mask); 338 338 mb(); 339 339 cvmx_write_csr(CVMX_CIU_PP_RST, 1 << coreid); 340 340 cvmx_write_csr(CVMX_CIU_PP_RST, 0);
+180
arch/mips/configs/loongson1_defconfig
··· 1 + # CONFIG_LOCALVERSION_AUTO is not set 2 + CONFIG_KERNEL_XZ=y 3 + CONFIG_SYSVIPC=y 4 + CONFIG_PREEMPT=y 5 + CONFIG_BSD_PROCESS_ACCT=y 6 + CONFIG_BSD_PROCESS_ACCT_V3=y 7 + CONFIG_IKCONFIG=y 8 + CONFIG_IKCONFIG_PROC=y 9 + CONFIG_LOG_BUF_SHIFT=16 10 + CONFIG_NAMESPACES=y 11 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 12 + CONFIG_EXPERT=y 13 + CONFIG_PERF_EVENTS=y 14 + CONFIG_MACH_LOONGSON32=y 15 + # CONFIG_SUSPEND is not set 16 + # CONFIG_SECCOMP is not set 17 + # CONFIG_GCC_PLUGINS is not set 18 + CONFIG_MODULES=y 19 + CONFIG_MODULE_UNLOAD=y 20 + CONFIG_MODVERSIONS=y 21 + # CONFIG_BLOCK_LEGACY_AUTOLOAD is not set 22 + # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 23 + # CONFIG_COMPAT_BRK is not set 24 + CONFIG_NET=y 25 + CONFIG_PACKET=y 26 + CONFIG_UNIX=y 27 + CONFIG_INET=y 28 + CONFIG_IP_PNP=y 29 + CONFIG_IP_PNP_DHCP=y 30 + CONFIG_SYN_COOKIES=y 31 + # CONFIG_INET_DIAG is not set 32 + # CONFIG_IPV6 is not set 33 + # CONFIG_WIRELESS is not set 34 + # CONFIG_ETHTOOL_NETLINK is not set 35 + CONFIG_DEVTMPFS=y 36 + CONFIG_DEVTMPFS_MOUNT=y 37 + # CONFIG_STANDALONE is not set 38 + CONFIG_MTD=y 39 + CONFIG_MTD_CMDLINE_PARTS=y 40 + CONFIG_MTD_BLOCK=y 41 + CONFIG_MTD_RAW_NAND=y 42 + CONFIG_MTD_NAND_LOONGSON1=y 43 + CONFIG_MTD_UBI=y 44 + CONFIG_BLK_DEV_LOOP=y 45 + CONFIG_SCSI=m 46 + # CONFIG_SCSI_PROC_FS is not set 47 + CONFIG_BLK_DEV_SD=m 48 + # CONFIG_BLK_DEV_BSG is not set 49 + # CONFIG_SCSI_LOWLEVEL is not set 50 + CONFIG_NETDEVICES=y 51 + # CONFIG_NET_VENDOR_ALACRITECH is not set 52 + # CONFIG_NET_VENDOR_AMAZON is not set 53 + # CONFIG_NET_VENDOR_AQUANTIA is not set 54 + # CONFIG_NET_VENDOR_ARC is not set 55 + # CONFIG_NET_VENDOR_ASIX is not set 56 + # CONFIG_NET_VENDOR_BROADCOM is not set 57 + # CONFIG_NET_VENDOR_CADENCE is not set 58 + # CONFIG_NET_VENDOR_CAVIUM is not set 59 + # CONFIG_NET_VENDOR_CORTINA is not set 60 + # CONFIG_NET_VENDOR_DAVICOM is not set 61 + # CONFIG_NET_VENDOR_ENGLEDER is not set 62 + # CONFIG_NET_VENDOR_EZCHIP is not set 63 + # CONFIG_NET_VENDOR_FUNGIBLE is not set 64 + # CONFIG_NET_VENDOR_GOOGLE is not set 65 + # CONFIG_NET_VENDOR_HISILICON is not set 66 + # CONFIG_NET_VENDOR_HUAWEI is not set 67 + # CONFIG_NET_VENDOR_INTEL is not set 68 + # CONFIG_NET_VENDOR_LITEX is not set 69 + # CONFIG_NET_VENDOR_MARVELL is not set 70 + # CONFIG_NET_VENDOR_META is not set 71 + # CONFIG_NET_VENDOR_MICREL is not set 72 + # CONFIG_NET_VENDOR_MICROCHIP is not set 73 + # CONFIG_NET_VENDOR_MICROSEMI is not set 74 + # CONFIG_NET_VENDOR_MICROSOFT is not set 75 + # CONFIG_NET_VENDOR_NI is not set 76 + # CONFIG_NET_VENDOR_NATSEMI is not set 77 + # CONFIG_NET_VENDOR_NETRONOME is not set 78 + # CONFIG_NET_VENDOR_PENSANDO is not set 79 + # CONFIG_NET_VENDOR_QUALCOMM is not set 80 + # CONFIG_NET_VENDOR_RENESAS is not set 81 + # CONFIG_NET_VENDOR_ROCKER is not set 82 + # CONFIG_NET_VENDOR_SAMSUNG is not set 83 + # CONFIG_NET_VENDOR_SEEQ is not set 84 + # CONFIG_NET_VENDOR_SOLARFLARE is not set 85 + # CONFIG_NET_VENDOR_SMSC is not set 86 + # CONFIG_NET_VENDOR_SOCIONEXT is not set 87 + CONFIG_STMMAC_ETH=y 88 + # CONFIG_DWMAC_GENERIC is not set 89 + # CONFIG_NET_VENDOR_SYNOPSYS is not set 90 + # CONFIG_NET_VENDOR_VERTEXCOM is not set 91 + # CONFIG_NET_VENDOR_VIA is not set 92 + # CONFIG_NET_VENDOR_WANGXUN is not set 93 + # CONFIG_NET_VENDOR_WIZNET is not set 94 + # CONFIG_NET_VENDOR_XILINX is not set 95 + CONFIG_DAVICOM_PHY=y 96 + CONFIG_REALTEK_PHY=y 97 + # CONFIG_USB_NET_DRIVERS is not set 98 + # CONFIG_WLAN is not set 99 + CONFIG_INPUT_EVDEV=y 100 + # CONFIG_INPUT_KEYBOARD is not set 101 + # CONFIG_INPUT_MOUSE is not set 102 + # CONFIG_SERIO is not set 103 + # CONFIG_VT_CONSOLE is not set 104 + CONFIG_VT_HW_CONSOLE_BINDING=y 105 + CONFIG_LEGACY_PTY_COUNT=8 106 + CONFIG_SERIAL_8250=y 107 + CONFIG_SERIAL_8250_CONSOLE=y 108 + CONFIG_SERIAL_OF_PLATFORM=y 109 + # CONFIG_HW_RANDOM is not set 110 + # CONFIG_PTP_1588_CLOCK is not set 111 + CONFIG_GPIOLIB=y 112 + CONFIG_GPIO_LOONGSON1=y 113 + # CONFIG_HWMON is not set 114 + CONFIG_WATCHDOG=y 115 + CONFIG_WATCHDOG_NOWAYOUT=y 116 + CONFIG_WATCHDOG_SYSFS=y 117 + CONFIG_LOONGSON1_WDT=y 118 + CONFIG_SOUND=y 119 + CONFIG_SND=y 120 + # CONFIG_SND_SUPPORT_OLD_API is not set 121 + # CONFIG_SND_DRIVERS is not set 122 + # CONFIG_SND_MIPS is not set 123 + # CONFIG_SND_USB is not set 124 + CONFIG_SND_SOC=y 125 + CONFIG_SND_LOONGSON1_AC97=y 126 + CONFIG_SND_SIMPLE_CARD=y 127 + CONFIG_HID_GENERIC=m 128 + CONFIG_USB_HID=m 129 + CONFIG_USB=y 130 + CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 131 + CONFIG_USB_EHCI_HCD=y 132 + # CONFIG_USB_EHCI_TT_NEWSCHED is not set 133 + CONFIG_USB_EHCI_HCD_PLATFORM=y 134 + CONFIG_USB_STORAGE=m 135 + CONFIG_USB_SERIAL=m 136 + CONFIG_USB_SERIAL_PL2303=m 137 + CONFIG_NEW_LEDS=y 138 + CONFIG_LEDS_CLASS=y 139 + CONFIG_LEDS_GPIO=y 140 + CONFIG_LEDS_TRIGGERS=y 141 + CONFIG_LEDS_TRIGGER_MTD=y 142 + CONFIG_LEDS_TRIGGER_HEARTBEAT=y 143 + CONFIG_RTC_CLASS=y 144 + # CONFIG_RTC_NVMEM is not set 145 + CONFIG_RTC_DRV_LOONGSON=y 146 + CONFIG_DMADEVICES=y 147 + CONFIG_LOONGSON1_APB_DMA=y 148 + # CONFIG_VIRTIO_MENU is not set 149 + # CONFIG_VHOST_MENU is not set 150 + # CONFIG_MIPS_PLATFORM_DEVICES is not set 151 + # CONFIG_IOMMU_SUPPORT is not set 152 + # CONFIG_NVMEM is not set 153 + CONFIG_EXT4_FS=y 154 + CONFIG_EXT4_FS_POSIX_ACL=y 155 + # CONFIG_DNOTIFY is not set 156 + CONFIG_VFAT_FS=y 157 + CONFIG_PROC_KCORE=y 158 + CONFIG_TMPFS=y 159 + CONFIG_TMPFS_POSIX_ACL=y 160 + CONFIG_UBIFS_FS=y 161 + CONFIG_UBIFS_FS_ADVANCED_COMPR=y 162 + CONFIG_UBIFS_ATIME_SUPPORT=y 163 + # CONFIG_UBIFS_FS_SECURITY is not set 164 + CONFIG_NFS_FS=y 165 + CONFIG_ROOT_NFS=y 166 + CONFIG_NLS_CODEPAGE_437=m 167 + CONFIG_NLS_ISO8859_1=m 168 + # CONFIG_CRYPTO_HW is not set 169 + # CONFIG_XZ_DEC_X86 is not set 170 + # CONFIG_XZ_DEC_POWERPC is not set 171 + # CONFIG_XZ_DEC_ARM is not set 172 + # CONFIG_XZ_DEC_ARMTHUMB is not set 173 + # CONFIG_XZ_DEC_ARM64 is not set 174 + # CONFIG_XZ_DEC_SPARC is not set 175 + # CONFIG_XZ_DEC_RISCV is not set 176 + CONFIG_DYNAMIC_DEBUG=y 177 + # CONFIG_DEBUG_MISC is not set 178 + CONFIG_MAGIC_SYSRQ=y 179 + # CONFIG_FTRACE is not set 180 + # CONFIG_EARLY_PRINTK is not set
-120
arch/mips/configs/loongson1b_defconfig
··· 1 - # CONFIG_LOCALVERSION_AUTO is not set 2 - CONFIG_KERNEL_XZ=y 3 - CONFIG_SYSVIPC=y 4 - CONFIG_HIGH_RES_TIMERS=y 5 - CONFIG_PREEMPT=y 6 - CONFIG_BSD_PROCESS_ACCT=y 7 - CONFIG_BSD_PROCESS_ACCT_V3=y 8 - CONFIG_IKCONFIG=y 9 - CONFIG_IKCONFIG_PROC=y 10 - CONFIG_LOG_BUF_SHIFT=16 11 - CONFIG_NAMESPACES=y 12 - CONFIG_CC_OPTIMIZE_FOR_SIZE=y 13 - CONFIG_EXPERT=y 14 - CONFIG_PERF_EVENTS=y 15 - # CONFIG_COMPAT_BRK is not set 16 - CONFIG_MACH_LOONGSON32=y 17 - # CONFIG_SECCOMP is not set 18 - # CONFIG_SUSPEND is not set 19 - CONFIG_MODULES=y 20 - CONFIG_MODULE_UNLOAD=y 21 - CONFIG_MODVERSIONS=y 22 - # CONFIG_BLK_DEV_BSG is not set 23 - # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 24 - CONFIG_NET=y 25 - CONFIG_PACKET=y 26 - CONFIG_UNIX=y 27 - CONFIG_INET=y 28 - CONFIG_IP_PNP=y 29 - CONFIG_IP_PNP_DHCP=y 30 - CONFIG_SYN_COOKIES=y 31 - # CONFIG_INET_DIAG is not set 32 - # CONFIG_IPV6 is not set 33 - # CONFIG_WIRELESS is not set 34 - CONFIG_DEVTMPFS=y 35 - CONFIG_DEVTMPFS_MOUNT=y 36 - # CONFIG_STANDALONE is not set 37 - CONFIG_MTD=y 38 - CONFIG_MTD_CMDLINE_PARTS=y 39 - CONFIG_MTD_BLOCK=y 40 - CONFIG_MTD_RAW_NAND=y 41 - CONFIG_MTD_UBI=y 42 - CONFIG_BLK_DEV_LOOP=y 43 - CONFIG_SCSI=m 44 - # CONFIG_SCSI_PROC_FS is not set 45 - CONFIG_BLK_DEV_SD=m 46 - # CONFIG_SCSI_LOWLEVEL is not set 47 - CONFIG_NETDEVICES=y 48 - # CONFIG_NET_VENDOR_BROADCOM is not set 49 - # CONFIG_NET_VENDOR_INTEL is not set 50 - # CONFIG_NET_VENDOR_MARVELL is not set 51 - # CONFIG_NET_VENDOR_MICREL is not set 52 - # CONFIG_NET_VENDOR_NATSEMI is not set 53 - # CONFIG_NET_VENDOR_SEEQ is not set 54 - # CONFIG_NET_VENDOR_SMSC is not set 55 - CONFIG_STMMAC_ETH=y 56 - # CONFIG_NET_VENDOR_WIZNET is not set 57 - # CONFIG_WLAN is not set 58 - CONFIG_INPUT_EVDEV=y 59 - # CONFIG_INPUT_KEYBOARD is not set 60 - # CONFIG_INPUT_MOUSE is not set 61 - # CONFIG_SERIO is not set 62 - CONFIG_VT_HW_CONSOLE_BINDING=y 63 - CONFIG_LEGACY_PTY_COUNT=8 64 - CONFIG_SERIAL_8250=y 65 - CONFIG_SERIAL_8250_CONSOLE=y 66 - # CONFIG_HW_RANDOM is not set 67 - CONFIG_GPIOLIB=y 68 - CONFIG_GPIO_LOONGSON1=y 69 - # CONFIG_HWMON is not set 70 - CONFIG_WATCHDOG=y 71 - CONFIG_WATCHDOG_NOWAYOUT=y 72 - CONFIG_WATCHDOG_SYSFS=y 73 - CONFIG_LOONGSON1_WDT=y 74 - # CONFIG_VGA_CONSOLE is not set 75 - CONFIG_HID_GENERIC=m 76 - CONFIG_USB_HID=m 77 - CONFIG_USB=y 78 - CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 79 - CONFIG_USB_EHCI_HCD=y 80 - # CONFIG_USB_EHCI_TT_NEWSCHED is not set 81 - CONFIG_USB_EHCI_HCD_PLATFORM=y 82 - CONFIG_USB_STORAGE=m 83 - CONFIG_USB_SERIAL=m 84 - CONFIG_USB_SERIAL_PL2303=m 85 - CONFIG_NEW_LEDS=y 86 - CONFIG_LEDS_CLASS=y 87 - CONFIG_LEDS_GPIO=y 88 - CONFIG_LEDS_TRIGGERS=y 89 - CONFIG_LEDS_TRIGGER_HEARTBEAT=y 90 - CONFIG_RTC_CLASS=y 91 - CONFIG_RTC_DRV_LOONGSON1=y 92 - # CONFIG_IOMMU_SUPPORT is not set 93 - CONFIG_EXT2_FS=y 94 - CONFIG_EXT2_FS_XATTR=y 95 - CONFIG_EXT2_FS_POSIX_ACL=y 96 - CONFIG_EXT2_FS_SECURITY=y 97 - CONFIG_EXT3_FS=y 98 - CONFIG_EXT3_FS_POSIX_ACL=y 99 - CONFIG_EXT3_FS_SECURITY=y 100 - # CONFIG_DNOTIFY is not set 101 - CONFIG_VFAT_FS=y 102 - CONFIG_PROC_KCORE=y 103 - CONFIG_TMPFS=y 104 - CONFIG_TMPFS_POSIX_ACL=y 105 - CONFIG_UBIFS_FS=y 106 - CONFIG_UBIFS_FS_ADVANCED_COMPR=y 107 - CONFIG_UBIFS_ATIME_SUPPORT=y 108 - CONFIG_NFS_FS=y 109 - CONFIG_ROOT_NFS=y 110 - CONFIG_NLS_CODEPAGE_437=m 111 - CONFIG_NLS_ISO8859_1=m 112 - # CONFIG_CRYPTO_ECHAINIV is not set 113 - # CONFIG_CRYPTO_HW is not set 114 - CONFIG_DYNAMIC_DEBUG=y 115 - CONFIG_DEBUG_FS=y 116 - CONFIG_MAGIC_SYSRQ=y 117 - # CONFIG_SCHED_DEBUG is not set 118 - # CONFIG_DEBUG_PREEMPT is not set 119 - # CONFIG_FTRACE is not set 120 - # CONFIG_EARLY_PRINTK is not set
-121
arch/mips/configs/loongson1c_defconfig
··· 1 - # CONFIG_LOCALVERSION_AUTO is not set 2 - CONFIG_KERNEL_XZ=y 3 - CONFIG_SYSVIPC=y 4 - CONFIG_HIGH_RES_TIMERS=y 5 - CONFIG_PREEMPT=y 6 - CONFIG_BSD_PROCESS_ACCT=y 7 - CONFIG_BSD_PROCESS_ACCT_V3=y 8 - CONFIG_IKCONFIG=y 9 - CONFIG_IKCONFIG_PROC=y 10 - CONFIG_LOG_BUF_SHIFT=16 11 - CONFIG_NAMESPACES=y 12 - CONFIG_CC_OPTIMIZE_FOR_SIZE=y 13 - CONFIG_EXPERT=y 14 - CONFIG_PERF_EVENTS=y 15 - # CONFIG_COMPAT_BRK is not set 16 - CONFIG_MACH_LOONGSON32=y 17 - CONFIG_LOONGSON1_LS1C=y 18 - # CONFIG_SECCOMP is not set 19 - # CONFIG_SUSPEND is not set 20 - CONFIG_MODULES=y 21 - CONFIG_MODULE_UNLOAD=y 22 - CONFIG_MODVERSIONS=y 23 - # CONFIG_BLK_DEV_BSG is not set 24 - # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 25 - CONFIG_NET=y 26 - CONFIG_PACKET=y 27 - CONFIG_UNIX=y 28 - CONFIG_INET=y 29 - CONFIG_IP_PNP=y 30 - CONFIG_IP_PNP_DHCP=y 31 - CONFIG_SYN_COOKIES=y 32 - # CONFIG_INET_DIAG is not set 33 - # CONFIG_IPV6 is not set 34 - # CONFIG_WIRELESS is not set 35 - CONFIG_DEVTMPFS=y 36 - CONFIG_DEVTMPFS_MOUNT=y 37 - # CONFIG_STANDALONE is not set 38 - CONFIG_MTD=y 39 - CONFIG_MTD_CMDLINE_PARTS=y 40 - CONFIG_MTD_BLOCK=y 41 - CONFIG_MTD_RAW_NAND=y 42 - CONFIG_MTD_UBI=y 43 - CONFIG_BLK_DEV_LOOP=y 44 - CONFIG_SCSI=m 45 - # CONFIG_SCSI_PROC_FS is not set 46 - CONFIG_BLK_DEV_SD=m 47 - # CONFIG_SCSI_LOWLEVEL is not set 48 - CONFIG_NETDEVICES=y 49 - # CONFIG_NET_VENDOR_BROADCOM is not set 50 - # CONFIG_NET_VENDOR_INTEL is not set 51 - # CONFIG_NET_VENDOR_MARVELL is not set 52 - # CONFIG_NET_VENDOR_MICREL is not set 53 - # CONFIG_NET_VENDOR_NATSEMI is not set 54 - # CONFIG_NET_VENDOR_SEEQ is not set 55 - # CONFIG_NET_VENDOR_SMSC is not set 56 - CONFIG_STMMAC_ETH=y 57 - # CONFIG_NET_VENDOR_WIZNET is not set 58 - # CONFIG_WLAN is not set 59 - CONFIG_INPUT_EVDEV=y 60 - # CONFIG_INPUT_KEYBOARD is not set 61 - # CONFIG_INPUT_MOUSE is not set 62 - # CONFIG_SERIO is not set 63 - CONFIG_VT_HW_CONSOLE_BINDING=y 64 - CONFIG_LEGACY_PTY_COUNT=8 65 - CONFIG_SERIAL_8250=y 66 - CONFIG_SERIAL_8250_CONSOLE=y 67 - # CONFIG_HW_RANDOM is not set 68 - CONFIG_GPIOLIB=y 69 - CONFIG_GPIO_LOONGSON1=y 70 - # CONFIG_HWMON is not set 71 - CONFIG_WATCHDOG=y 72 - CONFIG_WATCHDOG_NOWAYOUT=y 73 - CONFIG_WATCHDOG_SYSFS=y 74 - CONFIG_LOONGSON1_WDT=y 75 - # CONFIG_VGA_CONSOLE is not set 76 - CONFIG_HID_GENERIC=m 77 - CONFIG_USB_HID=m 78 - CONFIG_USB=y 79 - CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 80 - CONFIG_USB_EHCI_HCD=y 81 - # CONFIG_USB_EHCI_TT_NEWSCHED is not set 82 - CONFIG_USB_EHCI_HCD_PLATFORM=y 83 - CONFIG_USB_STORAGE=m 84 - CONFIG_USB_SERIAL=m 85 - CONFIG_USB_SERIAL_PL2303=m 86 - CONFIG_NEW_LEDS=y 87 - CONFIG_LEDS_CLASS=y 88 - CONFIG_LEDS_GPIO=y 89 - CONFIG_LEDS_TRIGGERS=y 90 - CONFIG_LEDS_TRIGGER_HEARTBEAT=y 91 - CONFIG_RTC_CLASS=y 92 - CONFIG_RTC_DRV_LOONGSON1=y 93 - # CONFIG_IOMMU_SUPPORT is not set 94 - CONFIG_EXT2_FS=y 95 - CONFIG_EXT2_FS_XATTR=y 96 - CONFIG_EXT2_FS_POSIX_ACL=y 97 - CONFIG_EXT2_FS_SECURITY=y 98 - CONFIG_EXT3_FS=y 99 - CONFIG_EXT3_FS_POSIX_ACL=y 100 - CONFIG_EXT3_FS_SECURITY=y 101 - # CONFIG_DNOTIFY is not set 102 - CONFIG_VFAT_FS=y 103 - CONFIG_PROC_KCORE=y 104 - CONFIG_TMPFS=y 105 - CONFIG_TMPFS_POSIX_ACL=y 106 - CONFIG_UBIFS_FS=y 107 - CONFIG_UBIFS_FS_ADVANCED_COMPR=y 108 - CONFIG_UBIFS_ATIME_SUPPORT=y 109 - CONFIG_NFS_FS=y 110 - CONFIG_ROOT_NFS=y 111 - CONFIG_NLS_CODEPAGE_437=m 112 - CONFIG_NLS_ISO8859_1=m 113 - # CONFIG_CRYPTO_ECHAINIV is not set 114 - # CONFIG_CRYPTO_HW is not set 115 - CONFIG_DYNAMIC_DEBUG=y 116 - CONFIG_DEBUG_FS=y 117 - CONFIG_MAGIC_SYSRQ=y 118 - # CONFIG_SCHED_DEBUG is not set 119 - # CONFIG_DEBUG_PREEMPT is not set 120 - # CONFIG_FTRACE is not set 121 - # CONFIG_EARLY_PRINTK is not set
+13 -9
arch/mips/fw/arc/cmdline.c
··· 42 42 { 43 43 char *s; 44 44 int actr, i; 45 + size_t len; 45 46 46 47 actr = 1; /* Always ignore argv[0] */ 47 48 48 49 while (actr < argc) { 49 - for(i = 0; i < ARRAY_SIZE(used_arc); i++) { 50 - int len = strlen(used_arc[i][0]); 50 + for (i = 0; i < ARRAY_SIZE(used_arc); i++) { 51 + len = strlen(used_arc[i][0]); 51 52 52 53 if (!strncmp(prom_argv(actr), used_arc[i][0], len)) { 53 54 /* Ok, we want it. First append the replacement... */ ··· 58 57 s = strchr(prom_argv(actr), '='); 59 58 if (s) { 60 59 s++; 61 - strcpy(cp, s); 62 - cp += strlen(s); 60 + len = strlen(s); 61 + memcpy(cp, s, len + 1); 62 + cp += len; 63 63 } 64 64 *cp++ = ' '; 65 65 break; ··· 76 74 { 77 75 char *cp; 78 76 int actr, i; 77 + size_t len; 79 78 80 79 actr = 1; /* Always ignore argv[0] */ 81 80 ··· 89 86 90 87 while (actr < argc) { 91 88 for (i = 0; i < ARRAY_SIZE(ignored); i++) { 92 - int len = strlen(ignored[i]); 93 - 89 + len = strlen(ignored[i]); 94 90 if (!strncmp(prom_argv(actr), ignored[i], len)) 95 91 goto pic_cont; 96 92 } 93 + 97 94 /* Ok, we want it. */ 98 - strcpy(cp, prom_argv(actr)); 99 - cp += strlen(prom_argv(actr)); 95 + len = strlen(prom_argv(actr)); 96 + memcpy(cp, prom_argv(actr), len + 1); 97 + cp += len; 100 98 *cp++ = ' '; 101 99 102 100 pic_cont: ··· 109 105 *cp = '\0'; 110 106 111 107 #ifdef DEBUG_CMDLINE 112 - printk(KERN_DEBUG "prom cmdline: %s\n", arcs_cmdline); 108 + pr_debug("prom cmdline: %s\n", arcs_cmdline); 113 109 #endif 114 110 }
+2 -1
arch/mips/generic/board-ocelot.c
··· 4 4 * 5 5 * Copyright (c) 2017 Microsemi Corporation 6 6 */ 7 + #include <linux/string.h> 7 8 #include <asm/machine.h> 8 9 #include <asm/prom.h> 9 10 ··· 42 41 43 42 if (prom_argc > 1 && strlen(prom_argv[1]) > 0) 44 43 /* ignore all built-in args if any f/w args given */ 45 - strcpy(arcs_cmdline, prom_argv[1]); 44 + strscpy(arcs_cmdline, prom_argv[1]); 46 45 } 47 46 48 47 return true;
+2 -2
arch/mips/include/asm/addrspace.h
··· 15 15 /* 16 16 * Configure language 17 17 */ 18 - #ifdef __ASSEMBLY__ 18 + #ifdef __ASSEMBLER__ 19 19 #define _ATYPE_ 20 20 #define _ATYPE32_ 21 21 #define _ATYPE64_ ··· 34 34 /* 35 35 * 32-bit MIPS address spaces 36 36 */ 37 - #ifdef __ASSEMBLY__ 37 + #ifdef __ASSEMBLER__ 38 38 #define _ACAST32_ 39 39 #define _ACAST64_ 40 40 #else
+3 -3
arch/mips/include/asm/asm-eva.h
··· 10 10 #ifndef __ASM_ASM_EVA_H 11 11 #define __ASM_ASM_EVA_H 12 12 13 - #ifndef __ASSEMBLY__ 13 + #ifndef __ASSEMBLER__ 14 14 15 15 /* Kernel variants */ 16 16 ··· 99 99 100 100 #endif /* CONFIG_EVA */ 101 101 102 - #else /* __ASSEMBLY__ */ 102 + #else /* __ASSEMBLER__ */ 103 103 104 104 #define kernel_cache(op, base) cache op, base 105 105 #define kernel_pref(hint, base) pref hint, base ··· 185 185 186 186 #endif /* CONFIG_EVA */ 187 187 188 - #endif /* __ASSEMBLY__ */ 188 + #endif /* __ASSEMBLER__ */ 189 189 190 190 #endif /* __ASM_ASM_EVA_H */
+4 -4
arch/mips/include/asm/asm.h
··· 37 37 #define CFI_SECTIONS 38 38 #endif 39 39 40 - #ifdef __ASSEMBLY__ 40 + #ifdef __ASSEMBLER__ 41 41 /* 42 42 * LEAF - declare leaf routine 43 43 */ ··· 123 123 #define ASM_PRINT(string) 124 124 #endif 125 125 126 - #endif /* __ASSEMBLY__ */ 126 + #endif /* __ASSEMBLER__ */ 127 127 128 128 /* 129 129 * Stack alignment ··· 228 228 #define LONG_INS ins 229 229 #define LONG_EXT ext 230 230 231 - #ifdef __ASSEMBLY__ 231 + #ifdef __ASSEMBLER__ 232 232 #define LONG .word 233 233 #endif 234 234 #define LONGSIZE 4 ··· 257 257 #define LONG_INS dins 258 258 #define LONG_EXT dext 259 259 260 - #ifdef __ASSEMBLY__ 260 + #ifdef __ASSEMBLER__ 261 261 #define LONG .dword 262 262 #endif 263 263 #define LONGSIZE 8
+2 -2
arch/mips/include/asm/bmips.h
··· 42 42 43 43 #define ZSCM_REG_BASE 0x97000000 44 44 45 - #if !defined(__ASSEMBLY__) 45 + #if !defined(__ASSEMBLER__) 46 46 47 47 #include <linux/cpumask.h> 48 48 #include <asm/r4kcache.h> ··· 124 124 barrier(); 125 125 } 126 126 127 - #endif /* !defined(__ASSEMBLY__) */ 127 + #endif /* !defined(__ASSEMBLER__) */ 128 128 129 129 #endif /* _ASM_BMIPS_H */
+1 -2
arch/mips/include/asm/cpu-type.h
··· 24 24 case CPU_LOONGSON64: 25 25 #endif 26 26 27 - #if defined(CONFIG_SYS_HAS_CPU_LOONGSON1B) || \ 28 - defined(CONFIG_SYS_HAS_CPU_LOONGSON1C) 27 + #ifdef CONFIG_SYS_HAS_CPU_LOONGSON32 29 28 case CPU_LOONGSON32: 30 29 #endif 31 30
+3 -4
arch/mips/include/asm/cpu.h
··· 248 248 #define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */ 249 249 #define PRID_REV_VR4130 0x0080 250 250 #define PRID_REV_34K_V1_0_2 0x0022 251 - #define PRID_REV_LOONGSON1B 0x0020 252 - #define PRID_REV_LOONGSON1C 0x0020 /* Same as Loongson-1B */ 251 + #define PRID_REV_LOONGSON1 0x0020 253 252 #define PRID_REV_LOONGSON2E 0x0002 254 253 #define PRID_REV_LOONGSON2F 0x0003 255 254 #define PRID_REV_LOONGSON2K_R1_0 0x0000 ··· 287 288 288 289 #define FPIR_IMP_NONE 0x0000 289 290 290 - #if !defined(__ASSEMBLY__) 291 + #if !defined(__ASSEMBLER__) 291 292 292 293 enum cpu_type_enum { 293 294 CPU_UNKNOWN, ··· 328 329 CPU_LAST 329 330 }; 330 331 331 - #endif /* !__ASSEMBLY */ 332 + #endif /* !__ASSEMBLER__ */ 332 333 333 334 /* 334 335 * ISA Level encodings
+1 -1
arch/mips/include/asm/dec/ecc.h
··· 37 37 #define KN0X_ESR_SYNLO (0x7f<<0) /* syndrome from ECC logic */ 38 38 39 39 40 - #ifndef __ASSEMBLY__ 40 + #ifndef __ASSEMBLER__ 41 41 42 42 #include <linux/interrupt.h> 43 43
+2 -2
arch/mips/include/asm/dec/interrupts.h
··· 95 95 #define DEC_CPU_IRQ_ALL (0xff << CAUSEB_IP) 96 96 97 97 98 - #ifndef __ASSEMBLY__ 98 + #ifndef __ASSEMBLER__ 99 99 100 100 /* 101 101 * Interrupt table structures to hide differences between systems. ··· 121 121 extern void dec_intr_unimplemented(void); 122 122 extern void asic_intr_unimplemented(void); 123 123 124 - #endif /* __ASSEMBLY__ */ 124 + #endif /* __ASSEMBLER__ */ 125 125 126 126 #endif
+1 -1
arch/mips/include/asm/dec/kn01.h
··· 71 71 #define KN01_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ 72 72 73 73 74 - #ifndef __ASSEMBLY__ 74 + #ifndef __ASSEMBLER__ 75 75 76 76 #include <linux/interrupt.h> 77 77 #include <linux/spinlock.h>
+1 -1
arch/mips/include/asm/dec/kn02.h
··· 80 80 #define KN02_IRQ_ALL 0xff 81 81 82 82 83 - #ifndef __ASSEMBLY__ 83 + #ifndef __ASSEMBLER__ 84 84 85 85 #include <linux/types.h> 86 86
+1 -1
arch/mips/include/asm/dec/kn02xa.h
··· 70 70 #define KN02XA_EAR_RES_0 (0x3<<0) /* unused */ 71 71 72 72 73 - #ifndef __ASSEMBLY__ 73 + #ifndef __ASSEMBLER__ 74 74 75 75 #include <linux/interrupt.h> 76 76
+2 -2
arch/mips/include/asm/eva.h
··· 13 13 14 14 #include <kernel-entry-init.h> 15 15 16 - #ifdef __ASSEMBLY__ 16 + #ifdef __ASSEMBLER__ 17 17 18 18 #ifdef CONFIG_EVA 19 19 ··· 38 38 39 39 #endif /* CONFIG_EVA */ 40 40 41 - #endif /* __ASSEMBLY__ */ 41 + #endif /* __ASSEMBLER__ */ 42 42 43 43 #endif
+4 -4
arch/mips/include/asm/ftrace.h
··· 15 15 #define MCOUNT_ADDR ((unsigned long)(_mcount)) 16 16 #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ 17 17 18 - #ifndef __ASSEMBLY__ 18 + #ifndef __ASSEMBLER__ 19 19 extern void _mcount(void); 20 20 #define mcount _mcount 21 21 ··· 89 89 void prepare_ftrace_return(unsigned long *parent_ra_addr, unsigned long self_ra, 90 90 unsigned long fp); 91 91 92 - #endif /* __ASSEMBLY__ */ 92 + #endif /* __ASSEMBLER__ */ 93 93 #endif /* CONFIG_FUNCTION_TRACER */ 94 94 95 95 #ifdef CONFIG_FTRACE_SYSCALLS 96 - #ifndef __ASSEMBLY__ 96 + #ifndef __ASSEMBLER__ 97 97 /* 98 98 * Some syscall entry functions on mips start with "__sys_" (fork and clone, 99 99 * for instance). We should also match the sys_ variant with those. ··· 105 105 return !strcmp(sym, name) || 106 106 (!strncmp(sym, "__sys_", 6) && !strcmp(sym + 6, name + 4)); 107 107 } 108 - #endif /* __ASSEMBLY__ */ 108 + #endif /* __ASSEMBLER__ */ 109 109 #endif /* CONFIG_FTRACE_SYSCALLS */ 110 110 #endif /* _ASM_MIPS_FTRACE_H */
+2 -2
arch/mips/include/asm/hazards.h
··· 301 301 302 302 #endif 303 303 304 - #ifdef __ASSEMBLY__ 304 + #ifdef __ASSEMBLER__ 305 305 306 306 #define _ssnop ___ssnop 307 307 #define _ehb ___ehb ··· 417 417 */ 418 418 extern void mips_ihb(void); 419 419 420 - #endif /* __ASSEMBLY__ */ 420 + #endif /* __ASSEMBLER__ */ 421 421 422 422 #endif /* _ASM_HAZARDS_H */
+2 -2
arch/mips/include/asm/irqflags.h
··· 11 11 #ifndef _ASM_IRQFLAGS_H 12 12 #define _ASM_IRQFLAGS_H 13 13 14 - #ifndef __ASSEMBLY__ 14 + #ifndef __ASSEMBLER__ 15 15 16 16 #include <linux/compiler.h> 17 17 #include <linux/stringify.h> ··· 142 142 return arch_irqs_disabled_flags(arch_local_save_flags()); 143 143 } 144 144 145 - #endif /* #ifndef __ASSEMBLY__ */ 145 + #endif /* #ifndef __ASSEMBLER__ */ 146 146 147 147 /* 148 148 * Do the CPU's IRQ-state tracing from assembly code.
+8 -8
arch/mips/include/asm/jazz.h
··· 70 70 #define LED_E 0x9e 71 71 #define LED_F 0x8e 72 72 73 - #ifndef __ASSEMBLY__ 73 + #ifndef __ASSEMBLER__ 74 74 75 75 static __inline__ void pica_set_led(unsigned int bits) 76 76 { ··· 79 79 *led_register = bits; 80 80 } 81 81 82 - #endif /* !__ASSEMBLY__ */ 82 + #endif /* !__ASSEMBLER__ */ 83 83 84 84 /* 85 85 * Base address of the Sonic Ethernet adapter in Jazz machines. ··· 100 100 #define JAZZ_KEYBOARD_DATA 0xe0005000 101 101 #define JAZZ_KEYBOARD_COMMAND 0xe0005001 102 102 103 - #ifndef __ASSEMBLY__ 103 + #ifndef __ASSEMBLER__ 104 104 105 105 typedef struct { 106 106 unsigned char data; ··· 121 121 */ 122 122 #define keyboard_hardware jazz_keyboard_hardware 123 123 124 - #endif /* !__ASSEMBLY__ */ 124 + #endif /* !__ASSEMBLER__ */ 125 125 126 126 /* 127 127 * i8042 keyboard controller for most other Mips machines. ··· 154 154 /* 155 155 * DRAM configuration register 156 156 */ 157 - #ifndef __ASSEMBLY__ 157 + #ifndef __ASSEMBLER__ 158 158 #ifdef __MIPSEL__ 159 159 typedef struct { 160 160 unsigned int bank2 : 3; ··· 174 174 unsigned int bank2 : 3; 175 175 } dram_configuration; 176 176 #endif 177 - #endif /* !__ASSEMBLY__ */ 177 + #endif /* !__ASSEMBLER__ */ 178 178 179 179 #define PICA_DRAM_CONFIG 0xe00fffe0 180 180 ··· 260 260 /* 261 261 * Access the R4030 DMA and I/O Controller 262 262 */ 263 - #ifndef __ASSEMBLY__ 263 + #ifndef __ASSEMBLER__ 264 264 265 265 static inline void r4030_delay(void) 266 266 { ··· 299 299 r4030_delay(); 300 300 } 301 301 302 - #endif /* !__ASSEMBLY__ */ 302 + #endif /* !__ASSEMBLER__ */ 303 303 304 304 #define JAZZ_FDC_BASE 0xe0003000 305 305 #define JAZZ_RTC_BASE 0xe0004000
+2 -2
arch/mips/include/asm/jump_label.h
··· 10 10 11 11 #define arch_jump_label_transform_static arch_jump_label_transform 12 12 13 - #ifndef __ASSEMBLY__ 13 + #ifndef __ASSEMBLER__ 14 14 15 15 #include <linux/types.h> 16 16 #include <asm/isa-rev.h> ··· 76 76 jump_label_t key; 77 77 }; 78 78 79 - #endif /* __ASSEMBLY__ */ 79 + #endif /* __ASSEMBLER__ */ 80 80 #endif /* _ASM_MIPS_JUMP_LABEL_H */
+1 -1
arch/mips/include/asm/linkage.h
··· 2 2 #ifndef __ASM_LINKAGE_H 3 3 #define __ASM_LINKAGE_H 4 4 5 - #ifdef __ASSEMBLY__ 5 + #ifdef __ASSEMBLER__ 6 6 #include <asm/asm.h> 7 7 #endif 8 8
+2 -2
arch/mips/include/asm/mach-generic/spaces.h
··· 21 21 /* 22 22 * This gives the physical RAM offset. 23 23 */ 24 - #ifndef __ASSEMBLY__ 24 + #ifndef __ASSEMBLER__ 25 25 # if defined(CONFIG_MIPS_AUTO_PFN_OFFSET) 26 26 # define PHYS_OFFSET ((unsigned long)PFN_PHYS(ARCH_PFN_OFFSET)) 27 27 # elif !defined(PHYS_OFFSET) 28 28 # define PHYS_OFFSET _AC(0, UL) 29 29 # endif 30 - #endif /* __ASSEMBLY__ */ 30 + #endif /* __ASSEMBLER__ */ 31 31 32 32 #ifdef CONFIG_32BIT 33 33 #define CAC_BASE _AC(0x80000000, UL)
-107
arch/mips/include/asm/mach-loongson32/irq.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 4 - * 5 - * IRQ mappings for Loongson 1 6 - */ 7 - 8 - #ifndef __ASM_MACH_LOONGSON32_IRQ_H 9 - #define __ASM_MACH_LOONGSON32_IRQ_H 10 - 11 - /* 12 - * CPU core Interrupt Numbers 13 - */ 14 - #define MIPS_CPU_IRQ_BASE 0 15 - #define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) 16 - 17 - #define SOFTINT0_IRQ MIPS_CPU_IRQ(0) 18 - #define SOFTINT1_IRQ MIPS_CPU_IRQ(1) 19 - #define INT0_IRQ MIPS_CPU_IRQ(2) 20 - #define INT1_IRQ MIPS_CPU_IRQ(3) 21 - #define INT2_IRQ MIPS_CPU_IRQ(4) 22 - #define INT3_IRQ MIPS_CPU_IRQ(5) 23 - #define INT4_IRQ MIPS_CPU_IRQ(6) 24 - #define TIMER_IRQ MIPS_CPU_IRQ(7) /* cpu timer */ 25 - 26 - #define MIPS_CPU_IRQS (MIPS_CPU_IRQ(7) + 1 - MIPS_CPU_IRQ_BASE) 27 - 28 - /* 29 - * INT0~3 Interrupt Numbers 30 - */ 31 - #define LS1X_IRQ_BASE MIPS_CPU_IRQS 32 - #define LS1X_IRQ(n, x) (LS1X_IRQ_BASE + (n << 5) + (x)) 33 - 34 - #define LS1X_UART0_IRQ LS1X_IRQ(0, 2) 35 - #if defined(CONFIG_LOONGSON1_LS1B) 36 - #define LS1X_UART1_IRQ LS1X_IRQ(0, 3) 37 - #define LS1X_UART2_IRQ LS1X_IRQ(0, 4) 38 - #define LS1X_UART3_IRQ LS1X_IRQ(0, 5) 39 - #elif defined(CONFIG_LOONGSON1_LS1C) 40 - #define LS1X_UART1_IRQ LS1X_IRQ(0, 4) 41 - #define LS1X_UART2_IRQ LS1X_IRQ(0, 5) 42 - #endif 43 - #define LS1X_CAN0_IRQ LS1X_IRQ(0, 6) 44 - #define LS1X_CAN1_IRQ LS1X_IRQ(0, 7) 45 - #define LS1X_SPI0_IRQ LS1X_IRQ(0, 8) 46 - #define LS1X_SPI1_IRQ LS1X_IRQ(0, 9) 47 - #define LS1X_AC97_IRQ LS1X_IRQ(0, 10) 48 - #define LS1X_DMA0_IRQ LS1X_IRQ(0, 13) 49 - #define LS1X_DMA1_IRQ LS1X_IRQ(0, 14) 50 - #define LS1X_DMA2_IRQ LS1X_IRQ(0, 15) 51 - #if defined(CONFIG_LOONGSON1_LS1C) 52 - #define LS1X_NAND_IRQ LS1X_IRQ(0, 16) 53 - #endif 54 - #define LS1X_PWM0_IRQ LS1X_IRQ(0, 17) 55 - #define LS1X_PWM1_IRQ LS1X_IRQ(0, 18) 56 - #define LS1X_PWM2_IRQ LS1X_IRQ(0, 19) 57 - #define LS1X_PWM3_IRQ LS1X_IRQ(0, 20) 58 - #define LS1X_RTC_INT0_IRQ LS1X_IRQ(0, 21) 59 - #define LS1X_RTC_INT1_IRQ LS1X_IRQ(0, 22) 60 - #define LS1X_RTC_INT2_IRQ LS1X_IRQ(0, 23) 61 - #if defined(CONFIG_LOONGSON1_LS1B) 62 - #define LS1X_TOY_INT0_IRQ LS1X_IRQ(0, 24) 63 - #define LS1X_TOY_INT1_IRQ LS1X_IRQ(0, 25) 64 - #define LS1X_TOY_INT2_IRQ LS1X_IRQ(0, 26) 65 - #define LS1X_RTC_TICK_IRQ LS1X_IRQ(0, 27) 66 - #define LS1X_TOY_TICK_IRQ LS1X_IRQ(0, 28) 67 - #define LS1X_UART4_IRQ LS1X_IRQ(0, 29) 68 - #define LS1X_UART5_IRQ LS1X_IRQ(0, 30) 69 - #elif defined(CONFIG_LOONGSON1_LS1C) 70 - #define LS1X_UART3_IRQ LS1X_IRQ(0, 29) 71 - #define LS1X_ADC_IRQ LS1X_IRQ(0, 30) 72 - #define LS1X_SDIO_IRQ LS1X_IRQ(0, 31) 73 - #endif 74 - 75 - #define LS1X_EHCI_IRQ LS1X_IRQ(1, 0) 76 - #define LS1X_OHCI_IRQ LS1X_IRQ(1, 1) 77 - #if defined(CONFIG_LOONGSON1_LS1B) 78 - #define LS1X_GMAC0_IRQ LS1X_IRQ(1, 2) 79 - #define LS1X_GMAC1_IRQ LS1X_IRQ(1, 3) 80 - #elif defined(CONFIG_LOONGSON1_LS1C) 81 - #define LS1X_OTG_IRQ LS1X_IRQ(1, 2) 82 - #define LS1X_GMAC0_IRQ LS1X_IRQ(1, 3) 83 - #define LS1X_CAM_IRQ LS1X_IRQ(1, 4) 84 - #define LS1X_UART4_IRQ LS1X_IRQ(1, 5) 85 - #define LS1X_UART5_IRQ LS1X_IRQ(1, 6) 86 - #define LS1X_UART6_IRQ LS1X_IRQ(1, 7) 87 - #define LS1X_UART7_IRQ LS1X_IRQ(1, 8) 88 - #define LS1X_UART8_IRQ LS1X_IRQ(1, 9) 89 - #define LS1X_UART9_IRQ LS1X_IRQ(1, 13) 90 - #define LS1X_UART10_IRQ LS1X_IRQ(1, 14) 91 - #define LS1X_UART11_IRQ LS1X_IRQ(1, 15) 92 - #define LS1X_I2C0_IRQ LS1X_IRQ(1, 17) 93 - #define LS1X_I2C1_IRQ LS1X_IRQ(1, 18) 94 - #define LS1X_I2C2_IRQ LS1X_IRQ(1, 19) 95 - #endif 96 - 97 - #if defined(CONFIG_LOONGSON1_LS1B) 98 - #define INTN 4 99 - #elif defined(CONFIG_LOONGSON1_LS1C) 100 - #define INTN 5 101 - #endif 102 - 103 - #define LS1X_IRQS (LS1X_IRQ(INTN, 31) + 1 - LS1X_IRQ_BASE) 104 - 105 - #define NR_IRQS (MIPS_CPU_IRQS + LS1X_IRQS) 106 - 107 - #endif /* __ASM_MACH_LOONGSON32_IRQ_H */
-50
arch/mips/include/asm/mach-loongson32/loongson1.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 4 - * 5 - * Register mappings for Loongson 1 6 - */ 7 - 8 - #ifndef __ASM_MACH_LOONGSON32_LOONGSON1_H 9 - #define __ASM_MACH_LOONGSON32_LOONGSON1_H 10 - 11 - #if defined(CONFIG_LOONGSON1_LS1B) 12 - #define DEFAULT_MEMSIZE 64 /* If no memsize provided */ 13 - #elif defined(CONFIG_LOONGSON1_LS1C) 14 - #define DEFAULT_MEMSIZE 32 15 - #endif 16 - 17 - /* Loongson 1 Register Bases */ 18 - #define LS1X_MUX_BASE 0x1fd00420 19 - #define LS1X_INTC_BASE 0x1fd01040 20 - #define LS1X_GPIO0_BASE 0x1fd010c0 21 - #define LS1X_GPIO1_BASE 0x1fd010c4 22 - #define LS1X_DMAC_BASE 0x1fd01160 23 - #define LS1X_CBUS_BASE 0x1fd011c0 24 - #define LS1X_EHCI_BASE 0x1fe00000 25 - #define LS1X_OHCI_BASE 0x1fe08000 26 - #define LS1X_GMAC0_BASE 0x1fe10000 27 - #define LS1X_GMAC1_BASE 0x1fe20000 28 - 29 - #define LS1X_UART0_BASE 0x1fe40000 30 - #define LS1X_UART1_BASE 0x1fe44000 31 - #define LS1X_UART2_BASE 0x1fe48000 32 - #define LS1X_UART3_BASE 0x1fe4c000 33 - #define LS1X_CAN0_BASE 0x1fe50000 34 - #define LS1X_CAN1_BASE 0x1fe54000 35 - #define LS1X_I2C0_BASE 0x1fe58000 36 - #define LS1X_I2C1_BASE 0x1fe68000 37 - #define LS1X_I2C2_BASE 0x1fe70000 38 - #define LS1X_PWM0_BASE 0x1fe5c000 39 - #define LS1X_PWM1_BASE 0x1fe5c010 40 - #define LS1X_PWM2_BASE 0x1fe5c020 41 - #define LS1X_PWM3_BASE 0x1fe5c030 42 - #define LS1X_WDT_BASE 0x1fe5c060 43 - #define LS1X_RTC_BASE 0x1fe64000 44 - #define LS1X_AC97_BASE 0x1fe74000 45 - #define LS1X_NAND_BASE 0x1fe78000 46 - #define LS1X_CLK_BASE 0x1fe78030 47 - 48 - #include <regs-mux.h> 49 - 50 - #endif /* __ASM_MACH_LOONGSON32_LOONGSON1_H */
-23
arch/mips/include/asm/mach-loongson32/platform.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 4 - */ 5 - 6 - #ifndef __ASM_MACH_LOONGSON32_PLATFORM_H 7 - #define __ASM_MACH_LOONGSON32_PLATFORM_H 8 - 9 - #include <linux/platform_device.h> 10 - 11 - extern struct platform_device ls1x_uart_pdev; 12 - extern struct platform_device ls1x_eth0_pdev; 13 - extern struct platform_device ls1x_eth1_pdev; 14 - extern struct platform_device ls1x_ehci_pdev; 15 - extern struct platform_device ls1x_gpio0_pdev; 16 - extern struct platform_device ls1x_gpio1_pdev; 17 - extern struct platform_device ls1x_rtc_pdev; 18 - extern struct platform_device ls1x_wdt_pdev; 19 - 20 - void __init ls1x_rtc_set_extclk(struct platform_device *pdev); 21 - void __init ls1x_serial_set_uartclk(struct platform_device *pdev); 22 - 23 - #endif /* __ASM_MACH_LOONGSON32_PLATFORM_H */
-124
arch/mips/include/asm/mach-loongson32/regs-mux.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (c) 2014 Zhang, Keguang <keguang.zhang@gmail.com> 4 - * 5 - * Loongson 1 MUX Register Definitions. 6 - */ 7 - 8 - #ifndef __ASM_MACH_LOONGSON32_REGS_MUX_H 9 - #define __ASM_MACH_LOONGSON32_REGS_MUX_H 10 - 11 - #define LS1X_MUX_REG(x) \ 12 - ((void __iomem *)KSEG1ADDR(LS1X_MUX_BASE + (x))) 13 - 14 - #define LS1X_MUX_CTRL0 LS1X_MUX_REG(0x0) 15 - #define LS1X_MUX_CTRL1 LS1X_MUX_REG(0x4) 16 - 17 - #if defined(CONFIG_LOONGSON1_LS1B) 18 - /* MUX CTRL0 Register Bits */ 19 - #define UART0_USE_PWM23 BIT(28) 20 - #define UART0_USE_PWM01 BIT(27) 21 - #define UART1_USE_LCD0_5_6_11 BIT(26) 22 - #define I2C2_USE_CAN1 BIT(25) 23 - #define I2C1_USE_CAN0 BIT(24) 24 - #define NAND3_USE_UART5 BIT(23) 25 - #define NAND3_USE_UART4 BIT(22) 26 - #define NAND3_USE_UART1_DAT BIT(21) 27 - #define NAND3_USE_UART1_CTS BIT(20) 28 - #define NAND3_USE_PWM23 BIT(19) 29 - #define NAND3_USE_PWM01 BIT(18) 30 - #define NAND2_USE_UART5 BIT(17) 31 - #define NAND2_USE_UART4 BIT(16) 32 - #define NAND2_USE_UART1_DAT BIT(15) 33 - #define NAND2_USE_UART1_CTS BIT(14) 34 - #define NAND2_USE_PWM23 BIT(13) 35 - #define NAND2_USE_PWM01 BIT(12) 36 - #define NAND1_USE_UART5 BIT(11) 37 - #define NAND1_USE_UART4 BIT(10) 38 - #define NAND1_USE_UART1_DAT BIT(9) 39 - #define NAND1_USE_UART1_CTS BIT(8) 40 - #define NAND1_USE_PWM23 BIT(7) 41 - #define NAND1_USE_PWM01 BIT(6) 42 - #define GMAC1_USE_UART1 BIT(4) 43 - #define GMAC1_USE_UART0 BIT(3) 44 - #define LCD_USE_UART0_DAT BIT(2) 45 - #define LCD_USE_UART15 BIT(1) 46 - #define LCD_USE_UART0 BIT(0) 47 - 48 - /* MUX CTRL1 Register Bits */ 49 - #define USB_RESET BIT(31) 50 - #define SPI1_CS_USE_PWM01 BIT(24) 51 - #define SPI1_USE_CAN BIT(23) 52 - #define DISABLE_DDR_CONFSPACE BIT(20) 53 - #define DDR32TO16EN BIT(16) 54 - #define GMAC1_SHUT BIT(13) 55 - #define GMAC0_SHUT BIT(12) 56 - #define USB_SHUT BIT(11) 57 - #define UART1_3_USE_CAN1 BIT(5) 58 - #define UART1_2_USE_CAN0 BIT(4) 59 - #define GMAC1_USE_TXCLK BIT(3) 60 - #define GMAC0_USE_TXCLK BIT(2) 61 - #define GMAC1_USE_PWM23 BIT(1) 62 - #define GMAC0_USE_PWM01 BIT(0) 63 - 64 - #elif defined(CONFIG_LOONGSON1_LS1C) 65 - 66 - /* SHUT_CTRL Register Bits */ 67 - #define UART_SPLIT GENMASK(31, 30) 68 - #define OUTPUT_CLK GENMASK(29, 26) 69 - #define ADC_SHUT BIT(25) 70 - #define SDIO_SHUT BIT(24) 71 - #define DMA2_SHUT BIT(23) 72 - #define DMA1_SHUT BIT(22) 73 - #define DMA0_SHUT BIT(21) 74 - #define SPI1_SHUT BIT(20) 75 - #define SPI0_SHUT BIT(19) 76 - #define I2C2_SHUT BIT(18) 77 - #define I2C1_SHUT BIT(17) 78 - #define I2C0_SHUT BIT(16) 79 - #define AC97_SHUT BIT(15) 80 - #define I2S_SHUT BIT(14) 81 - #define UART3_SHUT BIT(13) 82 - #define UART2_SHUT BIT(12) 83 - #define UART1_SHUT BIT(11) 84 - #define UART0_SHUT BIT(10) 85 - #define CAN1_SHUT BIT(9) 86 - #define CAN0_SHUT BIT(8) 87 - #define ECC_SHUT BIT(7) 88 - #define GMAC_SHUT BIT(6) 89 - #define USBHOST_SHUT BIT(5) 90 - #define USBOTG_SHUT BIT(4) 91 - #define SDRAM_SHUT BIT(3) 92 - #define SRAM_SHUT BIT(2) 93 - #define CAM_SHUT BIT(1) 94 - #define LCD_SHUT BIT(0) 95 - 96 - #define UART_SPLIT_SHIFT 30 97 - #define OUTPUT_CLK_SHIFT 26 98 - 99 - /* MISC_CTRL Register Bits */ 100 - #define USBHOST_RSTN BIT(31) 101 - #define PHY_INTF_SELI GENMASK(30, 28) 102 - #define AC97_EN BIT(25) 103 - #define SDIO_DMA_EN GENMASK(24, 23) 104 - #define ADC_DMA_EN BIT(22) 105 - #define SDIO_USE_SPI1 BIT(17) 106 - #define SDIO_USE_SPI0 BIT(16) 107 - #define SRAM_CTRL GENMASK(15, 0) 108 - 109 - #define PHY_INTF_SELI_SHIFT 28 110 - #define SDIO_DMA_EN_SHIFT 23 111 - #define SRAM_CTRL_SHIFT 0 112 - 113 - #define LS1X_CBUS_REG(n, x) \ 114 - ((void __iomem *)KSEG1ADDR(LS1X_CBUS_BASE + (n * 0x04) + (x))) 115 - 116 - #define LS1X_CBUS_FIRST(n) LS1X_CBUS_REG(n, 0x00) 117 - #define LS1X_CBUS_SECOND(n) LS1X_CBUS_REG(n, 0x10) 118 - #define LS1X_CBUS_THIRD(n) LS1X_CBUS_REG(n, 0x20) 119 - #define LS1X_CBUS_FOURTHT(n) LS1X_CBUS_REG(n, 0x30) 120 - #define LS1X_CBUS_FIFTHT(n) LS1X_CBUS_REG(n, 0x40) 121 - 122 - #endif 123 - 124 - #endif /* __ASM_MACH_LOONGSON32_REGS_MUX_H */
+2 -2
arch/mips/include/asm/mips-boards/bonito64.h
··· 21 21 #ifndef _ASM_MIPS_BOARDS_BONITO64_H 22 22 #define _ASM_MIPS_BOARDS_BONITO64_H 23 23 24 - #ifdef __ASSEMBLY__ 24 + #ifdef __ASSEMBLER__ 25 25 26 26 /* offsets from base register */ 27 27 #define BONITO(x) (x) ··· 36 36 37 37 #define BONITO(x) *(volatile u32 *)(_pcictrl_bonito + (x)) 38 38 39 - #endif /* __ASSEMBLY__ */ 39 + #endif /* __ASSEMBLER__ */ 40 40 41 41 42 42 #define BONITO_BOOT_BASE 0x1fc00000
+3 -3
arch/mips/include/asm/mipsmtregs.h
··· 10 10 11 11 #include <asm/mipsregs.h> 12 12 13 - #ifndef __ASSEMBLY__ 13 + #ifndef __ASSEMBLER__ 14 14 15 15 /* 16 16 * C macros ··· 176 176 /* TCHalt */ 177 177 #define TCHALT_H (_ULCAST_(1)) 178 178 179 - #ifndef __ASSEMBLY__ 179 + #ifndef __ASSEMBLER__ 180 180 181 181 static inline unsigned core_nvpes(void) 182 182 { ··· 469 469 470 470 __BUILD_SET_C0(mvpcontrol) 471 471 472 - #endif /* Not __ASSEMBLY__ */ 472 + #endif /* Not __ASSEMBLER__ */ 473 473 474 474 #endif
+3 -3
arch/mips/include/asm/mipsregs.h
··· 32 32 /* 33 33 * Configure language 34 34 */ 35 - #ifdef __ASSEMBLY__ 35 + #ifdef __ASSEMBLER__ 36 36 #define _ULCAST_ 37 37 #define _U64CAST_ 38 38 #else ··· 1346 1346 #define FPU_CSR_RD 0x3 /* towards -Infinity */ 1347 1347 1348 1348 1349 - #ifndef __ASSEMBLY__ 1349 + #ifndef __ASSEMBLER__ 1350 1350 1351 1351 /* 1352 1352 * Macros for handling the ISA mode bit for MIPS16 and microMIPS. ··· 3095 3095 return read_c0_ebase() & MIPS_EBASE_CPUNUM; 3096 3096 } 3097 3097 3098 - #endif /* !__ASSEMBLY__ */ 3098 + #endif /* !__ASSEMBLER__ */ 3099 3099 3100 3100 #endif /* _ASM_MIPSREGS_H */
+2 -2
arch/mips/include/asm/msa.h
··· 8 8 9 9 #include <asm/mipsregs.h> 10 10 11 - #ifndef __ASSEMBLY__ 11 + #ifndef __ASSEMBLER__ 12 12 13 13 #include <asm/inst.h> 14 14 ··· 218 218 __BUILD_MSA_CTL_REG(map, 6) 219 219 __BUILD_MSA_CTL_REG(unmap, 7) 220 220 221 - #endif /* !__ASSEMBLY__ */ 221 + #endif /* !__ASSEMBLER__ */ 222 222 223 223 #define MSA_IR 0 224 224 #define MSA_CSR 1
+2 -2
arch/mips/include/asm/pci/bridge.h
··· 43 43 * Bridge address map 44 44 */ 45 45 46 - #ifndef __ASSEMBLY__ 46 + #ifndef __ASSEMBLER__ 47 47 48 48 #define ATE_V 0x01 49 49 #define ATE_CO 0x02 ··· 288 288 }; 289 289 290 290 #define berr_field berr_un.berr_st 291 - #endif /* !__ASSEMBLY__ */ 291 + #endif /* !__ASSEMBLER__ */ 292 292 293 293 /* 294 294 * The values of these macros can and should be crosschecked
+3 -3
arch/mips/include/asm/pm.h
··· 8 8 #ifndef __ASM_PM_H 9 9 #define __ASM_PM_H 10 10 11 - #ifdef __ASSEMBLY__ 11 + #ifdef __ASSEMBLER__ 12 12 13 13 #include <asm/asm-offsets.h> 14 14 #include <asm/asm.h> ··· 130 130 RESUME_RESTORE_REGS_RETURN 131 131 .endm 132 132 133 - #else /* __ASSEMBLY__ */ 133 + #else /* __ASSEMBLER__ */ 134 134 135 135 /** 136 136 * struct mips_static_suspend_state - Core saved CPU state across S2R. ··· 150 150 unsigned long sp; 151 151 }; 152 152 153 - #endif /* !__ASSEMBLY__ */ 153 + #endif /* !__ASSEMBLER__ */ 154 154 155 155 #endif /* __ASM_PM_HELPERS_H */
+1 -1
arch/mips/include/asm/prefetch.h
··· 42 42 #define Pref_WriteBackInvalidate 25 43 43 #define Pref_PrepareForStore 30 44 44 45 - #ifdef __ASSEMBLY__ 45 + #ifdef __ASSEMBLER__ 46 46 47 47 .macro __pref hint addr 48 48 #ifdef CONFIG_CPU_HAS_PREFETCH
+2 -2
arch/mips/include/asm/regdef.h
··· 103 103 104 104 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */ 105 105 106 - #ifdef __ASSEMBLY__ 106 + #ifdef __ASSEMBLER__ 107 107 #if _MIPS_SIM == _MIPS_SIM_ABI32 108 108 109 109 /* ··· 192 192 #define ra $31 /* return address */ 193 193 194 194 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */ 195 - #endif /* __ASSEMBLY__ */ 195 + #endif /* __ASSEMBLER__ */ 196 196 197 197 #endif /* _ASM_REGDEF_H */
+2 -2
arch/mips/include/asm/sibyte/board.h
··· 19 19 #include <asm/sibyte/bigsur.h> 20 20 #endif 21 21 22 - #ifdef __ASSEMBLY__ 22 + #ifdef __ASSEMBLER__ 23 23 24 24 #ifdef LEDS_PHYS 25 25 #define setleds(t0, t1, c0, c1, c2, c3) \ ··· 46 46 #define setleds(s) do { } while (0) 47 47 #endif /* LEDS_PHYS */ 48 48 49 - #endif /* __ASSEMBLY__ */ 49 + #endif /* __ASSEMBLER__ */ 50 50 51 51 #endif /* _SIBYTE_BOARD_H */
+1 -1
arch/mips/include/asm/sibyte/sb1250.h
··· 19 19 20 20 #define SB1250_DUART_MINOR_BASE 64 21 21 22 - #ifndef __ASSEMBLY__ 22 + #ifndef __ASSEMBLER__ 23 23 24 24 #include <asm/addrspace.h> 25 25
+3 -3
arch/mips/include/asm/sibyte/sb1250_defs.h
··· 199 199 * Note: you'll need to define uint32_t and uint64_t in your headers. 200 200 */ 201 201 202 - #if !defined(__ASSEMBLY__) 202 + #if !defined(__ASSEMBLER__) 203 203 #define _SB_MAKE64(x) ((uint64_t)(x)) 204 204 #define _SB_MAKE32(x) ((uint32_t)(x)) 205 205 #else ··· 238 238 */ 239 239 240 240 241 - #if defined(__mips64) && !defined(__ASSEMBLY__) 241 + #if defined(__mips64) && !defined(__ASSEMBLER__) 242 242 #define SBWRITECSR(csr, val) *((volatile uint64_t *) PHYS_TO_K1(csr)) = (val) 243 243 #define SBREADCSR(csr) (*((volatile uint64_t *) PHYS_TO_K1(csr))) 244 - #endif /* __ASSEMBLY__ */ 244 + #endif /* __ASSEMBLER__ */ 245 245 246 246 #endif
+3 -3
arch/mips/include/asm/smp-cps.h
··· 9 9 10 10 #define CPS_ENTRY_PATCH_INSNS 6 11 11 12 - #ifndef __ASSEMBLY__ 12 + #ifndef __ASSEMBLER__ 13 13 14 14 struct vpe_boot_config { 15 15 unsigned long pc; ··· 55 55 56 56 #endif /* !CONFIG_MIPS_CPS */ 57 57 58 - #else /* __ASSEMBLY__ */ 58 + #else /* __ASSEMBLER__ */ 59 59 60 60 .extern mips_cps_bootcfg; 61 61 62 - #endif /* __ASSEMBLY__ */ 62 + #endif /* __ASSEMBLER__ */ 63 63 #endif /* __MIPS_ASM_SMP_CPS_H__ */
+9 -9
arch/mips/include/asm/sn/addrs.h
··· 10 10 #define _ASM_SN_ADDRS_H 11 11 12 12 13 - #ifndef __ASSEMBLY__ 13 + #ifndef __ASSEMBLER__ 14 14 #include <linux/smp.h> 15 15 #include <linux/types.h> 16 - #endif /* !__ASSEMBLY__ */ 16 + #endif /* !__ASSEMBLER__ */ 17 17 18 18 #include <asm/addrspace.h> 19 19 #include <asm/sn/kldir.h> ··· 25 25 #endif 26 26 27 27 28 - #ifndef __ASSEMBLY__ 28 + #ifndef __ASSEMBLER__ 29 29 30 30 #define UINT64_CAST (unsigned long) 31 31 32 - #else /* __ASSEMBLY__ */ 32 + #else /* __ASSEMBLER__ */ 33 33 34 34 #define UINT64_CAST 35 35 36 - #endif /* __ASSEMBLY__ */ 36 + #endif /* __ASSEMBLER__ */ 37 37 38 38 39 39 #define NASID_GET_META(_n) ((_n) >> NASID_LOCAL_BITS) ··· 254 254 #define LOCAL_HUB_ADDR(_x) (IALIAS_BASE + (_x)) 255 255 #define REMOTE_HUB_ADDR(_n, _x) ((NODE_SWIN_BASE(_n, 1) + 0x800000 + (_x))) 256 256 257 - #ifndef __ASSEMBLY__ 257 + #ifndef __ASSEMBLER__ 258 258 259 259 #define LOCAL_HUB_PTR(_x) ((u64 *)LOCAL_HUB_ADDR((_x))) 260 260 #define REMOTE_HUB_PTR(_n, _x) ((u64 *)REMOTE_HUB_ADDR((_n), (_x))) ··· 265 265 #define REMOTE_HUB_S(_n, _r, _d) __raw_writeq((_d), \ 266 266 REMOTE_HUB_PTR((_n), (_r))) 267 267 268 - #endif /* !__ASSEMBLY__ */ 268 + #endif /* !__ASSEMBLER__ */ 269 269 270 270 /* 271 271 * Software structure locations -- permanently fixed ··· 315 315 #define KLI_KERN_XP 8 316 316 #define KLI_KERN_PARTID 9 317 317 318 - #ifndef __ASSEMBLY__ 318 + #ifndef __ASSEMBLER__ 319 319 320 320 #define KLD_BASE(nasid) ((kldir_ent_t *) KLDIR_ADDR(nasid)) 321 321 #define KLD_LAUNCH(nasid) (KLD_BASE(nasid) + KLI_LAUNCH) ··· 371 371 #define KERN_VARS_ADDR(nasid) KLD_KERN_VARS(nasid)->pointer 372 372 #define KERN_VARS_SIZE(nasid) KLD_KERN_VARS(nasid)->size 373 373 374 - #endif /* !__ASSEMBLY__ */ 374 + #endif /* !__ASSEMBLER__ */ 375 375 376 376 377 377 #endif /* _ASM_SN_ADDRS_H */
+2 -2
arch/mips/include/asm/sn/gda.h
··· 39 39 #define G_PARTIDOFF 40 40 40 #define G_TABLEOFF 128 41 41 42 - #ifndef __ASSEMBLY__ 42 + #ifndef __ASSEMBLER__ 43 43 44 44 typedef struct gda { 45 45 u32 g_magic; /* GDA magic number */ ··· 63 63 64 64 #define GDA ((gda_t*) GDA_ADDR(get_nasid())) 65 65 66 - #endif /* !__ASSEMBLY__ */ 66 + #endif /* !__ASSEMBLER__ */ 67 67 /* 68 68 * Define: PART_GDA_VERSION 69 69 * Purpose: Define the minimum version of the GDA required, lower
+2 -2
arch/mips/include/asm/sn/kldir.h
··· 15 15 #define KLDIR_ENT_SIZE 0x40 16 16 #define KLDIR_MAX_ENTRIES (0x400 / 0x40) 17 17 18 - #ifndef __ASSEMBLY__ 18 + #ifndef __ASSEMBLER__ 19 19 typedef struct kldir_ent_s { 20 20 u64 magic; /* Indicates validity of entry */ 21 21 off_t offset; /* Offset from start of node space */ ··· 27 27 /* NOTE: These 16 bytes are used in the Partition KLDIR 28 28 entry to store partition info. Refer to klpart.h for this. */ 29 29 } kldir_ent_t; 30 - #endif /* !__ASSEMBLY__ */ 30 + #endif /* !__ASSEMBLER__ */ 31 31 32 32 #ifdef CONFIG_SGI_IP27 33 33 #include <asm/sn/sn0/kldir.h>
+2 -2
arch/mips/include/asm/sn/klkernvars.h
··· 12 12 13 13 #define KV_MAGIC 0x5f4b565f 14 14 15 - #ifndef __ASSEMBLY__ 15 + #ifndef __ASSEMBLER__ 16 16 17 17 #include <asm/sn/types.h> 18 18 ··· 24 24 unsigned long kv_rw_baseaddr; 25 25 } kern_vars_t; 26 26 27 - #endif /* !__ASSEMBLY__ */ 27 + #endif /* !__ASSEMBLER__ */ 28 28 29 29 #endif /* __ASM_SN_KLKERNVARS_H */
+2 -2
arch/mips/include/asm/sn/launch.h
··· 59 59 * clears the BUSY flag after control is returned to it. 60 60 */ 61 61 62 - #ifndef __ASSEMBLY__ 62 + #ifndef __ASSEMBLER__ 63 63 64 64 typedef int launch_state_t; 65 65 typedef void (*launch_proc_t)(u64 call_parm); ··· 101 101 #define LAUNCH_FLASH (*(void (*)(void)) \ 102 102 IP27PROM_FLASHLEDS) 103 103 104 - #endif /* !__ASSEMBLY__ */ 104 + #endif /* !__ASSEMBLER__ */ 105 105 106 106 #endif /* _ASM_SN_LAUNCH_H */
+4 -4
arch/mips/include/asm/sn/nmi.h
··· 48 48 * 49 49 */ 50 50 51 - #ifndef __ASSEMBLY__ 51 + #ifndef __ASSEMBLER__ 52 52 53 53 typedef struct nmi_s { 54 54 volatile unsigned long magic; /* Magic number */ ··· 59 59 volatile unsigned long gmaster; /* Flag true only on global master*/ 60 60 } nmi_t; 61 61 62 - #endif /* !__ASSEMBLY__ */ 62 + #endif /* !__ASSEMBLER__ */ 63 63 64 64 /* Following definitions are needed both in the prom & the kernel 65 65 * to identify the format of the nmi cpu register save area in the 66 66 * low memory on each node. 67 67 */ 68 - #ifndef __ASSEMBLY__ 68 + #ifndef __ASSEMBLER__ 69 69 70 70 struct reg_struct { 71 71 unsigned long gpr[32]; ··· 78 78 unsigned long nmi_sr; 79 79 }; 80 80 81 - #endif /* !__ASSEMBLY__ */ 81 + #endif /* !__ASSEMBLER__ */ 82 82 83 83 /* These are the assembly language offsets into the reg_struct structure */ 84 84
+7 -7
arch/mips/include/asm/sn/sn0/addrs.h
··· 84 84 #define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \ 85 85 NASID_SHFT) & NASID_BITMASK) 86 86 87 - #if !defined(__ASSEMBLY__) 87 + #if !defined(__ASSEMBLER__) 88 88 89 89 #define NODE_SWIN_BASE(nasid, widget) \ 90 90 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \ 91 91 : RAW_NODE_SWIN_BASE(nasid, widget)) 92 - #else /* __ASSEMBLY__ */ 92 + #else /* __ASSEMBLER__ */ 93 93 #define NODE_SWIN_BASE(nasid, widget) \ 94 94 (NODE_IO_BASE(nasid) + (UINT64_CAST(widget) << SWIN_SIZE_BITS)) 95 - #endif /* __ASSEMBLY__ */ 95 + #endif /* __ASSEMBLER__ */ 96 96 97 97 /* 98 98 * The following definitions pertain to the IO special address ··· 139 139 /* Turn on sable logging for the processors whose bits are set. */ 140 140 #define SABLE_LOG_TRIGGER(_map) 141 141 142 - #ifndef __ASSEMBLY__ 142 + #ifndef __ASSEMBLER__ 143 143 #define KERN_NMI_ADDR(nasid, slice) \ 144 144 TO_NODE_UNCAC((nasid), IP27_NMI_KREGS_OFFSET + \ 145 145 (IP27_NMI_KREGS_CPU_SIZE * (slice))) 146 - #endif /* !__ASSEMBLY__ */ 146 + #endif /* !__ASSEMBLER__ */ 147 147 148 148 #ifdef PROM 149 149 ··· 248 248 #define KL_UART_DATA LOCAL_HUB_ADDR(MD_UREG0_1) /* UART data reg */ 249 249 #define KL_I2C_REG MD_UREG0_0 /* I2C reg */ 250 250 251 - #ifndef __ASSEMBLY__ 251 + #ifndef __ASSEMBLER__ 252 252 253 253 /* Address 0x400 to 0x1000 ualias points to cache error eframe + misc 254 254 * CACHE_ERR_SP_PTR could either contain an address to the stack, or ··· 266 266 #define CACHE_ERR_SP (CACHE_ERR_SP_PTR - 16) 267 267 #define CACHE_ERR_AREA_SIZE (ARCS_SPB_OFFSET - CACHE_ERR_EFRAME) 268 268 269 - #endif /* !__ASSEMBLY__ */ 269 + #endif /* !__ASSEMBLER__ */ 270 270 271 271 #define _ARCSPROM 272 272
+1 -1
arch/mips/include/asm/sn/sn0/hub.h
··· 37 37 #define UATTR_MSPEC 2 38 38 #define UATTR_UNCAC 3 39 39 40 - #ifdef __ASSEMBLY__ 40 + #ifdef __ASSEMBLER__ 41 41 /* 42 42 * Returns the local nasid into res. 43 43 */
+18 -18
arch/mips/include/asm/sn/sn0/hubio.h
··· 169 169 /* 170 170 * The IO LLP control status register and widget control register 171 171 */ 172 - #ifndef __ASSEMBLY__ 172 + #ifndef __ASSEMBLER__ 173 173 174 174 typedef union hubii_wid_u { 175 175 u64 wid_reg_value; ··· 292 292 } perf_cnt_bits; 293 293 } io_perf_cnt_t; 294 294 295 - #endif /* !__ASSEMBLY__ */ 295 + #endif /* !__ASSEMBLER__ */ 296 296 297 297 298 298 #define LNK_STAT_WORKING 0x2 ··· 440 440 /* 441 441 * Fields in CRB Register A 442 442 */ 443 - #ifndef __ASSEMBLY__ 443 + #ifndef __ASSEMBLER__ 444 444 typedef union icrba_u { 445 445 u64 reg_value; 446 446 struct { ··· 486 486 #define ICRBN_A_CERR_SHFT 54 487 487 #define ICRBN_A_ERR_MASK 0x3ff 488 488 489 - #endif /* !__ASSEMBLY__ */ 489 + #endif /* !__ASSEMBLER__ */ 490 490 491 491 #define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */ 492 492 ··· 509 509 /* 510 510 * Fields in CRB Register B 511 511 */ 512 - #ifndef __ASSEMBLY__ 512 + #ifndef __ASSEMBLER__ 513 513 typedef union icrbb_u { 514 514 u64 reg_value; 515 515 struct { ··· 608 608 #define b_imsg icrbb_field_s.imsg 609 609 #define b_initiator icrbb_field_s.initiator 610 610 611 - #endif /* !__ASSEMBLY__ */ 611 + #endif /* !__ASSEMBLER__ */ 612 612 613 613 /* 614 614 * values for field xtsize ··· 666 666 * Fields in CRB Register C 667 667 */ 668 668 669 - #ifndef __ASSEMBLY__ 669 + #ifndef __ASSEMBLER__ 670 670 671 671 typedef union icrbc_s { 672 672 u64 reg_value; ··· 698 698 #define c_barrop icrbc_field_s.barrop 699 699 #define c_doresp icrbc_field_s.doresp 700 700 #define c_gbr icrbc_field_s.gbr 701 - #endif /* !__ASSEMBLY__ */ 701 + #endif /* !__ASSEMBLER__ */ 702 702 703 703 /* 704 704 * Fields in CRB Register D 705 705 */ 706 706 707 - #ifndef __ASSEMBLY__ 707 + #ifndef __ASSEMBLER__ 708 708 typedef union icrbd_s { 709 709 u64 reg_value; 710 710 struct { ··· 737 737 } hi_ifdr_fields; 738 738 } hubii_ifdr_t; 739 739 740 - #endif /* !__ASSEMBLY__ */ 740 + #endif /* !__ASSEMBLER__ */ 741 741 742 742 /* 743 743 * Hardware designed names for the BTE control registers. ··· 784 784 * IO PIO Read Table Entry format 785 785 */ 786 786 787 - #ifndef __ASSEMBLY__ 787 + #ifndef __ASSEMBLER__ 788 788 789 789 typedef union iprte_a { 790 790 u64 entry; ··· 806 806 #define iprte_init iprte_fields.initiator 807 807 #define iprte_addr iprte_fields.addr 808 808 809 - #endif /* !__ASSEMBLY__ */ 809 + #endif /* !__ASSEMBLER__ */ 810 810 811 811 #define IPRTE_ADDRSHFT 3 812 812 ··· 814 814 * Hub IIO PRB Register format. 815 815 */ 816 816 817 - #ifndef __ASSEMBLY__ 817 + #ifndef __ASSEMBLER__ 818 818 /* 819 819 * Note: Fields bnakctr, anakctr, xtalkctrmode, ovflow fields are 820 820 * "Status" fields, and should only be used in case of clean up after errors. ··· 846 846 #define iprb_anakctr iprb_fields_s.anakctr 847 847 #define iprb_xtalkctr iprb_fields_s.xtalkctr 848 848 849 - #endif /* !__ASSEMBLY__ */ 849 + #endif /* !__ASSEMBLER__ */ 850 850 851 851 /* 852 852 * values for mode field in iprb_t. ··· 861 861 /* 862 862 * IO CRB entry C_A to E_A : Partial (cache) CRBS 863 863 */ 864 - #ifndef __ASSEMBLY__ 864 + #ifndef __ASSEMBLER__ 865 865 typedef union icrbp_a { 866 866 u64 ip_reg; /* the entire register value */ 867 867 struct { ··· 895 895 } ip_fmt; 896 896 } icrbp_a_t; 897 897 898 - #endif /* !__ASSEMBLY__ */ 898 + #endif /* !__ASSEMBLER__ */ 899 899 900 900 /* 901 901 * A couple of defines to go with the above structure. ··· 903 903 #define ICRBP_A_CERR_SHFT 54 904 904 #define ICRBP_A_ERR_MASK 0x3ff 905 905 906 - #ifndef __ASSEMBLY__ 906 + #ifndef __ASSEMBLER__ 907 907 typedef union hubii_idsr { 908 908 u64 iin_reg; 909 909 struct { ··· 917 917 level : 7; 918 918 } iin_fmt; 919 919 } hubii_idsr_t; 920 - #endif /* !__ASSEMBLY__ */ 920 + #endif /* !__ASSEMBLER__ */ 921 921 922 922 /* 923 923 * IO BTE Length/Status (IIO_IBLS) register bit field definitions
+2 -2
arch/mips/include/asm/sn/sn0/hubmd.h
··· 423 423 * Operations on page migration threshold register 424 424 */ 425 425 426 - #ifndef __ASSEMBLY__ 426 + #ifndef __ASSEMBLER__ 427 427 428 428 /* 429 429 * LED register macros ··· 735 735 } md_perf_cnt_t; 736 736 737 737 738 - #endif /* !__ASSEMBLY__ */ 738 + #endif /* !__ASSEMBLER__ */ 739 739 740 740 741 741 #define DIR_ERROR_VALID_MASK 0xe000000000000000
+3 -3
arch/mips/include/asm/sn/sn0/hubni.h
··· 11 11 #ifndef _ASM_SGI_SN0_HUBNI_H 12 12 #define _ASM_SGI_SN0_HUBNI_H 13 13 14 - #ifndef __ASSEMBLY__ 14 + #ifndef __ASSEMBLER__ 15 15 #include <linux/types.h> 16 16 #endif 17 17 ··· 226 226 227 227 #define NLT_EXIT_PORT_MASK (UINT64_CAST 0xf) 228 228 229 - #ifndef __ASSEMBLY__ 229 + #ifndef __ASSEMBLER__ 230 230 231 231 typedef union hubni_port_error_u { 232 232 u64 nipe_reg_value; ··· 258 258 return NASID_TO_COARSEREG_SHFT; 259 259 } 260 260 261 - #endif /* !__ASSEMBLY__ */ 261 + #endif /* !__ASSEMBLER__ */ 262 262 263 263 #endif /* _ASM_SGI_SN0_HUBNI_H */
+2 -2
arch/mips/include/asm/sn/sn0/hubpi.h
··· 306 306 #define ERR_STACK_SIZE_BYTES(_sz) \ 307 307 ((_sz) ? (PI_MIN_STACK_SIZE << ((_sz) - 1)) : 0) 308 308 309 - #ifndef __ASSEMBLY__ 309 + #ifndef __ASSEMBLER__ 310 310 /* 311 311 * format of error stack and error status registers. 312 312 */ ··· 359 359 360 360 typedef u64 rtc_time_t; 361 361 362 - #endif /* !__ASSEMBLY__ */ 362 + #endif /* !__ASSEMBLER__ */ 363 363 364 364 365 365 /* Bits in PI_SYSAD_ERRCHK_EN */
+1 -1
arch/mips/include/asm/sn/types.h
··· 11 11 12 12 #include <linux/types.h> 13 13 14 - #ifndef __ASSEMBLY__ 14 + #ifndef __ASSEMBLER__ 15 15 16 16 typedef unsigned long cpuid_t; 17 17 typedef signed short nasid_t; /* node id in numa-as-id space */
+1 -1
arch/mips/include/asm/sync.h
··· 193 193 * Preprocessor magic to expand macros used as arguments before we insert them 194 194 * into assembly code. 195 195 */ 196 - #ifdef __ASSEMBLY__ 196 + #ifdef __ASSEMBLER__ 197 197 # define ___SYNC(type, reason, else) \ 198 198 ____SYNC(type, reason, else) 199 199 #else
+2 -2
arch/mips/include/asm/thread_info.h
··· 11 11 #ifdef __KERNEL__ 12 12 13 13 14 - #ifndef __ASSEMBLY__ 14 + #ifndef __ASSEMBLER__ 15 15 16 16 #include <asm/processor.h> 17 17 ··· 73 73 register unsigned long current_stack_pointer __asm__("sp"); 74 74 #endif 75 75 76 - #endif /* !__ASSEMBLY__ */ 76 + #endif /* !__ASSEMBLER__ */ 77 77 78 78 /* thread information allocation */ 79 79 #if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT)
+2 -2
arch/mips/include/asm/unistd.h
··· 29 29 #define NR_syscalls (__NR_O32_Linux + __NR_O32_Linux_syscalls) 30 30 #endif 31 31 32 - #ifndef __ASSEMBLY__ 32 + #ifndef __ASSEMBLER__ 33 33 34 34 #define __ARCH_WANT_NEW_STAT 35 35 #define __ARCH_WANT_OLD_READDIR ··· 62 62 /* whitelists for checksyscalls */ 63 63 #define __IGNORE_fadvise64_64 64 64 65 - #endif /* !__ASSEMBLY__ */ 65 + #endif /* !__ASSEMBLER__ */ 66 66 67 67 #endif /* _ASM_UNISTD_H */
+2 -2
arch/mips/include/asm/vdso/gettimeofday.h
··· 11 11 #ifndef __ASM_VDSO_GETTIMEOFDAY_H 12 12 #define __ASM_VDSO_GETTIMEOFDAY_H 13 13 14 - #ifndef __ASSEMBLY__ 14 + #ifndef __ASSEMBLER__ 15 15 16 16 #include <asm/vdso/vdso.h> 17 17 #include <asm/clocksource.h> ··· 215 215 } 216 216 #define __arch_get_vdso_u_time_data __arch_get_vdso_u_time_data 217 217 218 - #endif /* !__ASSEMBLY__ */ 218 + #endif /* !__ASSEMBLER__ */ 219 219 220 220 #endif /* __ASM_VDSO_GETTIMEOFDAY_H */
+2 -2
arch/mips/include/asm/vdso/processor.h
··· 5 5 #ifndef __ASM_VDSO_PROCESSOR_H 6 6 #define __ASM_VDSO_PROCESSOR_H 7 7 8 - #ifndef __ASSEMBLY__ 8 + #ifndef __ASSEMBLER__ 9 9 10 10 #ifdef CONFIG_CPU_LOONGSON64 11 11 /* ··· 22 22 #define cpu_relax() barrier() 23 23 #endif 24 24 25 - #endif /* __ASSEMBLY__ */ 25 + #endif /* __ASSEMBLER__ */ 26 26 27 27 #endif /* __ASM_VDSO_PROCESSOR_H */
+2 -2
arch/mips/include/asm/vdso/vdso.h
··· 9 9 10 10 #define __VDSO_PAGES 4 11 11 12 - #ifndef __ASSEMBLY__ 12 + #ifndef __ASSEMBLER__ 13 13 14 14 #include <asm/asm.h> 15 15 #include <asm/vdso.h> ··· 69 69 70 70 #endif /* CONFIG_CLKSRC_MIPS_GIC */ 71 71 72 - #endif /* __ASSEMBLY__ */ 72 + #endif /* __ASSEMBLER__ */
+2 -2
arch/mips/include/asm/vdso/vsyscall.h
··· 4 4 5 5 #include <asm/page.h> 6 6 7 - #ifndef __ASSEMBLY__ 7 + #ifndef __ASSEMBLER__ 8 8 9 9 #include <vdso/datapage.h> 10 10 11 11 /* The asm-generic header needs to be included after the definitions above */ 12 12 #include <asm-generic/vdso/vsyscall.h> 13 13 14 - #endif /* !__ASSEMBLY__ */ 14 + #endif /* !__ASSEMBLER__ */ 15 15 16 16 #endif /* __ASM_VDSO_VSYSCALL_H */
+2 -2
arch/mips/include/asm/xtalk/xtalk.h
··· 12 12 #ifndef _ASM_XTALK_XTALK_H 13 13 #define _ASM_XTALK_XTALK_H 14 14 15 - #ifndef __ASSEMBLY__ 15 + #ifndef __ASSEMBLER__ 16 16 /* 17 17 * User-level device driver visible types 18 18 */ ··· 47 47 #define XIO_PORT(x) ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT)) 48 48 #define XIO_PACK(p, o) ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS)) 49 49 50 - #endif /* !__ASSEMBLY__ */ 50 + #endif /* !__ASSEMBLER__ */ 51 51 52 52 #endif /* _ASM_XTALK_XTALK_H */
+2 -2
arch/mips/include/asm/xtalk/xwidget.h
··· 203 203 * widget target flush register are widget dependent thus will not be 204 204 * defined here 205 205 */ 206 - #ifndef __ASSEMBLY__ 206 + #ifndef __ASSEMBLER__ 207 207 typedef u32 widgetreg_t; 208 208 209 209 /* widget configuration registers */ ··· 274 274 ((hwid2)->mfg_num == XWIDGET_MFG_NUM_NONE) || \ 275 275 ((hwid1)->mfg_num == (hwid2)->mfg_num))) 276 276 277 - #endif /* !__ASSEMBLY__ */ 277 + #endif /* !__ASSEMBLER__ */ 278 278 279 279 #endif /* _ASM_XTALK_XWIDGET_H */
+3 -3
arch/mips/kernel/cpu-probe.c
··· 1288 1288 set_cpu_asid_mask(c, MIPS_ENTRYHI_ASID); 1289 1289 c->writecombine = _CACHE_UNCACHED_ACCELERATED; 1290 1290 break; 1291 - case PRID_IMP_LOONGSON_32: /* Loongson-1 */ 1291 + case PRID_IMP_LOONGSON_32: 1292 1292 decode_configs(c); 1293 1293 1294 1294 c->cputype = CPU_LOONGSON32; 1295 1295 1296 1296 switch (c->processor_id & PRID_REV_MASK) { 1297 - case PRID_REV_LOONGSON1B: 1298 - __cpu_name[cpu] = "Loongson 1B"; 1297 + case PRID_REV_LOONGSON1: 1298 + __cpu_name[cpu] = "ICT Loongson-1"; 1299 1299 break; 1300 1300 } 1301 1301
+1 -1
arch/mips/lantiq/xway/sysctrl.c
··· 485 485 /* add our generic xway clocks */ 486 486 clkdev_add_pmu("10000000.fpi", NULL, 0, 0, PMU_FPI); 487 487 clkdev_add_pmu("1e100a00.gptu", NULL, 1, 0, PMU_GPT); 488 - clkdev_add_pmu("1e100bb0.stp", NULL, 1, 0, PMU_STP); 488 + clkdev_add_pmu("1e100bb0.gpio", NULL, 1, 0, PMU_STP); 489 489 clkdev_add_pmu("1e100c00.serial", NULL, 0, 0, PMU_ASC1); 490 490 clkdev_add_pmu("1e104100.dma", NULL, 1, 0, PMU_DMA); 491 491 clkdev_add_pmu("1e100800.spi", NULL, 1, 0, PMU_SPI);
+7 -36
arch/mips/loongson32/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - if MACH_LOONGSON32 3 2 4 - choice 5 - prompt "Machine Type" 6 - 7 - config LOONGSON1_LS1B 8 - bool "Loongson LS1B board" 9 - select CEVT_R4K if !MIPS_EXTERNAL_TIMER 10 - select CSRC_R4K if !MIPS_EXTERNAL_TIMER 11 - select SYS_HAS_CPU_LOONGSON1B 12 - select DMA_NONCOHERENT 13 - select BOOT_ELF32 14 - select IRQ_MIPS_CPU 15 - select SYS_SUPPORTS_32BIT_KERNEL 16 - select SYS_SUPPORTS_LITTLE_ENDIAN 17 - select SYS_SUPPORTS_HIGHMEM 18 - select SYS_HAS_EARLY_PRINTK 19 - select USE_GENERIC_EARLY_PRINTK_8250 20 - select COMMON_CLK 21 - 22 - config LOONGSON1_LS1C 23 - bool "Loongson LS1C board" 24 - select CEVT_R4K if !MIPS_EXTERNAL_TIMER 25 - select CSRC_R4K if !MIPS_EXTERNAL_TIMER 26 - select SYS_HAS_CPU_LOONGSON1C 27 - select DMA_NONCOHERENT 28 - select BOOT_ELF32 29 - select IRQ_MIPS_CPU 30 - select SYS_SUPPORTS_32BIT_KERNEL 31 - select SYS_SUPPORTS_LITTLE_ENDIAN 32 - select SYS_SUPPORTS_HIGHMEM 33 - select SYS_HAS_EARLY_PRINTK 34 - select USE_GENERIC_EARLY_PRINTK_8250 35 - select COMMON_CLK 36 - endchoice 37 - 38 - endif # MACH_LOONGSON32 3 + config BUILTIN_DTB_NAME 4 + string "Source file for built-in DTB" 5 + depends on BUILTIN_DTB 6 + help 7 + Base name (without suffix, relative to arch/mips/boot/dts/loongson) 8 + for the DTS file that will be used to produce the DTB linked into 9 + the kernel.
-17
arch/mips/loongson32/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - # 3 - # Common code for all Loongson 1 based systems 4 - # 5 - 6 - obj-$(CONFIG_MACH_LOONGSON32) += common/ 7 - 8 - # 9 - # Loongson LS1B board 10 - # 11 - 12 - obj-$(CONFIG_LOONGSON1_LS1B) += ls1b/ 13 - 14 - # 15 - # Loongson LS1C board 16 - # 17 - 18 - obj-$(CONFIG_LOONGSON1_LS1C) += ls1c/
-1
arch/mips/loongson32/Platform
··· 1 1 cflags-$(CONFIG_CPU_LOONGSON32) += -march=mips32r2 -Wa,--trap 2 - cflags-$(CONFIG_MACH_LOONGSON32) += -I$(srctree)/arch/mips/include/asm/mach-loongson32 3 2 load-$(CONFIG_CPU_LOONGSON32) += 0xffffffff80200000
-6
arch/mips/loongson32/common/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - # 3 - # Makefile for common code of loongson1 based machines. 4 - # 5 - 6 - obj-y += time.o irq.o platform.o prom.o setup.o
-191
arch/mips/loongson32/common/irq.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 4 - */ 5 - 6 - #include <linux/interrupt.h> 7 - #include <linux/irq.h> 8 - #include <asm/irq_cpu.h> 9 - 10 - #include <loongson1.h> 11 - #include <irq.h> 12 - 13 - #define LS1X_INTC_REG(n, x) \ 14 - ((void __iomem *)KSEG1ADDR(LS1X_INTC_BASE + (n * 0x18) + (x))) 15 - 16 - #define LS1X_INTC_INTISR(n) LS1X_INTC_REG(n, 0x0) 17 - #define LS1X_INTC_INTIEN(n) LS1X_INTC_REG(n, 0x4) 18 - #define LS1X_INTC_INTSET(n) LS1X_INTC_REG(n, 0x8) 19 - #define LS1X_INTC_INTCLR(n) LS1X_INTC_REG(n, 0xc) 20 - #define LS1X_INTC_INTPOL(n) LS1X_INTC_REG(n, 0x10) 21 - #define LS1X_INTC_INTEDGE(n) LS1X_INTC_REG(n, 0x14) 22 - 23 - static void ls1x_irq_ack(struct irq_data *d) 24 - { 25 - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; 26 - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; 27 - 28 - __raw_writel(__raw_readl(LS1X_INTC_INTCLR(n)) 29 - | (1 << bit), LS1X_INTC_INTCLR(n)); 30 - } 31 - 32 - static void ls1x_irq_mask(struct irq_data *d) 33 - { 34 - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; 35 - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; 36 - 37 - __raw_writel(__raw_readl(LS1X_INTC_INTIEN(n)) 38 - & ~(1 << bit), LS1X_INTC_INTIEN(n)); 39 - } 40 - 41 - static void ls1x_irq_mask_ack(struct irq_data *d) 42 - { 43 - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; 44 - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; 45 - 46 - __raw_writel(__raw_readl(LS1X_INTC_INTIEN(n)) 47 - & ~(1 << bit), LS1X_INTC_INTIEN(n)); 48 - __raw_writel(__raw_readl(LS1X_INTC_INTCLR(n)) 49 - | (1 << bit), LS1X_INTC_INTCLR(n)); 50 - } 51 - 52 - static void ls1x_irq_unmask(struct irq_data *d) 53 - { 54 - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; 55 - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; 56 - 57 - __raw_writel(__raw_readl(LS1X_INTC_INTIEN(n)) 58 - | (1 << bit), LS1X_INTC_INTIEN(n)); 59 - } 60 - 61 - static int ls1x_irq_settype(struct irq_data *d, unsigned int type) 62 - { 63 - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; 64 - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; 65 - 66 - switch (type) { 67 - case IRQ_TYPE_LEVEL_HIGH: 68 - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) 69 - | (1 << bit), LS1X_INTC_INTPOL(n)); 70 - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) 71 - & ~(1 << bit), LS1X_INTC_INTEDGE(n)); 72 - break; 73 - case IRQ_TYPE_LEVEL_LOW: 74 - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) 75 - & ~(1 << bit), LS1X_INTC_INTPOL(n)); 76 - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) 77 - & ~(1 << bit), LS1X_INTC_INTEDGE(n)); 78 - break; 79 - case IRQ_TYPE_EDGE_RISING: 80 - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) 81 - | (1 << bit), LS1X_INTC_INTPOL(n)); 82 - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) 83 - | (1 << bit), LS1X_INTC_INTEDGE(n)); 84 - break; 85 - case IRQ_TYPE_EDGE_FALLING: 86 - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) 87 - & ~(1 << bit), LS1X_INTC_INTPOL(n)); 88 - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) 89 - | (1 << bit), LS1X_INTC_INTEDGE(n)); 90 - break; 91 - case IRQ_TYPE_EDGE_BOTH: 92 - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) 93 - & ~(1 << bit), LS1X_INTC_INTPOL(n)); 94 - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) 95 - | (1 << bit), LS1X_INTC_INTEDGE(n)); 96 - break; 97 - case IRQ_TYPE_NONE: 98 - break; 99 - default: 100 - return -EINVAL; 101 - } 102 - 103 - return 0; 104 - } 105 - 106 - static struct irq_chip ls1x_irq_chip = { 107 - .name = "LS1X-INTC", 108 - .irq_ack = ls1x_irq_ack, 109 - .irq_mask = ls1x_irq_mask, 110 - .irq_mask_ack = ls1x_irq_mask_ack, 111 - .irq_unmask = ls1x_irq_unmask, 112 - .irq_set_type = ls1x_irq_settype, 113 - }; 114 - 115 - static void ls1x_irq_dispatch(int n) 116 - { 117 - u32 int_status, irq; 118 - 119 - /* Get pending sources, masked by current enables */ 120 - int_status = __raw_readl(LS1X_INTC_INTISR(n)) & 121 - __raw_readl(LS1X_INTC_INTIEN(n)); 122 - 123 - if (int_status) { 124 - irq = LS1X_IRQ(n, __ffs(int_status)); 125 - do_IRQ(irq); 126 - } 127 - } 128 - 129 - asmlinkage void plat_irq_dispatch(void) 130 - { 131 - unsigned int pending; 132 - 133 - pending = read_c0_cause() & read_c0_status() & ST0_IM; 134 - 135 - if (pending & CAUSEF_IP7) 136 - do_IRQ(TIMER_IRQ); 137 - else if (pending & CAUSEF_IP2) 138 - ls1x_irq_dispatch(0); /* INT0 */ 139 - else if (pending & CAUSEF_IP3) 140 - ls1x_irq_dispatch(1); /* INT1 */ 141 - else if (pending & CAUSEF_IP4) 142 - ls1x_irq_dispatch(2); /* INT2 */ 143 - else if (pending & CAUSEF_IP5) 144 - ls1x_irq_dispatch(3); /* INT3 */ 145 - else if (pending & CAUSEF_IP6) 146 - ls1x_irq_dispatch(4); /* INT4 */ 147 - else 148 - spurious_interrupt(); 149 - 150 - } 151 - 152 - static void __init ls1x_irq_init(int base) 153 - { 154 - int n; 155 - 156 - /* Disable interrupts and clear pending, 157 - * setup all IRQs as high level triggered 158 - */ 159 - for (n = 0; n < INTN; n++) { 160 - __raw_writel(0x0, LS1X_INTC_INTIEN(n)); 161 - __raw_writel(0xffffffff, LS1X_INTC_INTCLR(n)); 162 - __raw_writel(0xffffffff, LS1X_INTC_INTPOL(n)); 163 - /* set DMA0, DMA1 and DMA2 to edge trigger */ 164 - __raw_writel(n ? 0x0 : 0xe000, LS1X_INTC_INTEDGE(n)); 165 - } 166 - 167 - 168 - for (n = base; n < NR_IRQS; n++) { 169 - irq_set_chip_and_handler(n, &ls1x_irq_chip, 170 - handle_level_irq); 171 - } 172 - 173 - if (request_irq(INT0_IRQ, no_action, IRQF_NO_THREAD, "cascade", NULL)) 174 - pr_err("Failed to request irq %d (cascade)\n", INT0_IRQ); 175 - if (request_irq(INT1_IRQ, no_action, IRQF_NO_THREAD, "cascade", NULL)) 176 - pr_err("Failed to request irq %d (cascade)\n", INT1_IRQ); 177 - if (request_irq(INT2_IRQ, no_action, IRQF_NO_THREAD, "cascade", NULL)) 178 - pr_err("Failed to request irq %d (cascade)\n", INT2_IRQ); 179 - if (request_irq(INT3_IRQ, no_action, IRQF_NO_THREAD, "cascade", NULL)) 180 - pr_err("Failed to request irq %d (cascade)\n", INT3_IRQ); 181 - #if defined(CONFIG_LOONGSON1_LS1C) 182 - if (request_irq(INT4_IRQ, no_action, IRQF_NO_THREAD, "cascade", NULL)) 183 - pr_err("Failed to request irq %d (cascade)\n", INT4_IRQ); 184 - #endif 185 - } 186 - 187 - void __init arch_init_irq(void) 188 - { 189 - mips_cpu_irq_init(); 190 - ls1x_irq_init(LS1X_IRQ_BASE); 191 - }
-285
arch/mips/loongson32/common/platform.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com> 4 - */ 5 - 6 - #include <linux/clk.h> 7 - #include <linux/dma-mapping.h> 8 - #include <linux/err.h> 9 - #include <linux/mtd/partitions.h> 10 - #include <linux/sizes.h> 11 - #include <linux/phy.h> 12 - #include <linux/serial_8250.h> 13 - #include <linux/stmmac.h> 14 - #include <linux/usb/ehci_pdriver.h> 15 - 16 - #include <platform.h> 17 - #include <loongson1.h> 18 - 19 - /* 8250/16550 compatible UART */ 20 - #define LS1X_UART(_id) \ 21 - { \ 22 - .mapbase = LS1X_UART ## _id ## _BASE, \ 23 - .irq = LS1X_UART ## _id ## _IRQ, \ 24 - .iotype = UPIO_MEM, \ 25 - .flags = UPF_IOREMAP | UPF_FIXED_TYPE, \ 26 - .type = PORT_16550A, \ 27 - } 28 - 29 - static struct plat_serial8250_port ls1x_serial8250_pdata[] = { 30 - LS1X_UART(0), 31 - LS1X_UART(1), 32 - LS1X_UART(2), 33 - LS1X_UART(3), 34 - {}, 35 - }; 36 - 37 - struct platform_device ls1x_uart_pdev = { 38 - .name = "serial8250", 39 - .id = PLAT8250_DEV_PLATFORM, 40 - .dev = { 41 - .platform_data = ls1x_serial8250_pdata, 42 - }, 43 - }; 44 - 45 - void __init ls1x_serial_set_uartclk(struct platform_device *pdev) 46 - { 47 - struct clk *clk; 48 - struct plat_serial8250_port *p; 49 - 50 - clk = clk_get(&pdev->dev, pdev->name); 51 - if (IS_ERR(clk)) { 52 - pr_err("unable to get %s clock, err=%ld", 53 - pdev->name, PTR_ERR(clk)); 54 - return; 55 - } 56 - clk_prepare_enable(clk); 57 - 58 - for (p = pdev->dev.platform_data; p->flags != 0; ++p) 59 - p->uartclk = clk_get_rate(clk); 60 - } 61 - 62 - /* Synopsys Ethernet GMAC */ 63 - static struct stmmac_mdio_bus_data ls1x_mdio_bus_data = { 64 - .phy_mask = 0, 65 - }; 66 - 67 - static struct stmmac_dma_cfg ls1x_eth_dma_cfg = { 68 - .pbl = 1, 69 - }; 70 - 71 - int ls1x_eth_mux_init(struct platform_device *pdev, void *priv) 72 - { 73 - struct plat_stmmacenet_data *plat_dat = NULL; 74 - u32 val; 75 - 76 - val = __raw_readl(LS1X_MUX_CTRL1); 77 - 78 - #if defined(CONFIG_LOONGSON1_LS1B) 79 - plat_dat = dev_get_platdata(&pdev->dev); 80 - if (plat_dat->bus_id) { 81 - __raw_writel(__raw_readl(LS1X_MUX_CTRL0) | GMAC1_USE_UART1 | 82 - GMAC1_USE_UART0, LS1X_MUX_CTRL0); 83 - switch (plat_dat->phy_interface) { 84 - case PHY_INTERFACE_MODE_RGMII: 85 - val &= ~(GMAC1_USE_TXCLK | GMAC1_USE_PWM23); 86 - break; 87 - case PHY_INTERFACE_MODE_MII: 88 - val |= (GMAC1_USE_TXCLK | GMAC1_USE_PWM23); 89 - break; 90 - default: 91 - pr_err("unsupported mii mode %d\n", 92 - plat_dat->phy_interface); 93 - return -ENOTSUPP; 94 - } 95 - val &= ~GMAC1_SHUT; 96 - } else { 97 - switch (plat_dat->phy_interface) { 98 - case PHY_INTERFACE_MODE_RGMII: 99 - val &= ~(GMAC0_USE_TXCLK | GMAC0_USE_PWM01); 100 - break; 101 - case PHY_INTERFACE_MODE_MII: 102 - val |= (GMAC0_USE_TXCLK | GMAC0_USE_PWM01); 103 - break; 104 - default: 105 - pr_err("unsupported mii mode %d\n", 106 - plat_dat->phy_interface); 107 - return -ENOTSUPP; 108 - } 109 - val &= ~GMAC0_SHUT; 110 - } 111 - __raw_writel(val, LS1X_MUX_CTRL1); 112 - #elif defined(CONFIG_LOONGSON1_LS1C) 113 - plat_dat = dev_get_platdata(&pdev->dev); 114 - 115 - val &= ~PHY_INTF_SELI; 116 - if (plat_dat->phy_interface == PHY_INTERFACE_MODE_RMII) 117 - val |= 0x4 << PHY_INTF_SELI_SHIFT; 118 - __raw_writel(val, LS1X_MUX_CTRL1); 119 - 120 - val = __raw_readl(LS1X_MUX_CTRL0); 121 - __raw_writel(val & (~GMAC_SHUT), LS1X_MUX_CTRL0); 122 - #endif 123 - 124 - return 0; 125 - } 126 - 127 - static struct plat_stmmacenet_data ls1x_eth0_pdata = { 128 - .bus_id = 0, 129 - .phy_addr = -1, 130 - #if defined(CONFIG_LOONGSON1_LS1B) 131 - .phy_interface = PHY_INTERFACE_MODE_MII, 132 - #elif defined(CONFIG_LOONGSON1_LS1C) 133 - .phy_interface = PHY_INTERFACE_MODE_RMII, 134 - #endif 135 - .mdio_bus_data = &ls1x_mdio_bus_data, 136 - .dma_cfg = &ls1x_eth_dma_cfg, 137 - .has_gmac = 1, 138 - .tx_coe = 1, 139 - .rx_queues_to_use = 1, 140 - .tx_queues_to_use = 1, 141 - .init = ls1x_eth_mux_init, 142 - }; 143 - 144 - static struct resource ls1x_eth0_resources[] = { 145 - [0] = { 146 - .start = LS1X_GMAC0_BASE, 147 - .end = LS1X_GMAC0_BASE + SZ_64K - 1, 148 - .flags = IORESOURCE_MEM, 149 - }, 150 - [1] = { 151 - .name = "macirq", 152 - .start = LS1X_GMAC0_IRQ, 153 - .flags = IORESOURCE_IRQ, 154 - }, 155 - }; 156 - 157 - struct platform_device ls1x_eth0_pdev = { 158 - .name = "stmmaceth", 159 - .id = 0, 160 - .num_resources = ARRAY_SIZE(ls1x_eth0_resources), 161 - .resource = ls1x_eth0_resources, 162 - .dev = { 163 - .platform_data = &ls1x_eth0_pdata, 164 - }, 165 - }; 166 - 167 - #ifdef CONFIG_LOONGSON1_LS1B 168 - static struct plat_stmmacenet_data ls1x_eth1_pdata = { 169 - .bus_id = 1, 170 - .phy_addr = -1, 171 - .phy_interface = PHY_INTERFACE_MODE_MII, 172 - .mdio_bus_data = &ls1x_mdio_bus_data, 173 - .dma_cfg = &ls1x_eth_dma_cfg, 174 - .has_gmac = 1, 175 - .tx_coe = 1, 176 - .rx_queues_to_use = 1, 177 - .tx_queues_to_use = 1, 178 - .init = ls1x_eth_mux_init, 179 - }; 180 - 181 - static struct resource ls1x_eth1_resources[] = { 182 - [0] = { 183 - .start = LS1X_GMAC1_BASE, 184 - .end = LS1X_GMAC1_BASE + SZ_64K - 1, 185 - .flags = IORESOURCE_MEM, 186 - }, 187 - [1] = { 188 - .name = "macirq", 189 - .start = LS1X_GMAC1_IRQ, 190 - .flags = IORESOURCE_IRQ, 191 - }, 192 - }; 193 - 194 - struct platform_device ls1x_eth1_pdev = { 195 - .name = "stmmaceth", 196 - .id = 1, 197 - .num_resources = ARRAY_SIZE(ls1x_eth1_resources), 198 - .resource = ls1x_eth1_resources, 199 - .dev = { 200 - .platform_data = &ls1x_eth1_pdata, 201 - }, 202 - }; 203 - #endif /* CONFIG_LOONGSON1_LS1B */ 204 - 205 - /* GPIO */ 206 - static struct resource ls1x_gpio0_resources[] = { 207 - [0] = { 208 - .start = LS1X_GPIO0_BASE, 209 - .end = LS1X_GPIO0_BASE + SZ_4 - 1, 210 - .flags = IORESOURCE_MEM, 211 - }, 212 - }; 213 - 214 - struct platform_device ls1x_gpio0_pdev = { 215 - .name = "ls1x-gpio", 216 - .id = 0, 217 - .num_resources = ARRAY_SIZE(ls1x_gpio0_resources), 218 - .resource = ls1x_gpio0_resources, 219 - }; 220 - 221 - static struct resource ls1x_gpio1_resources[] = { 222 - [0] = { 223 - .start = LS1X_GPIO1_BASE, 224 - .end = LS1X_GPIO1_BASE + SZ_4 - 1, 225 - .flags = IORESOURCE_MEM, 226 - }, 227 - }; 228 - 229 - struct platform_device ls1x_gpio1_pdev = { 230 - .name = "ls1x-gpio", 231 - .id = 1, 232 - .num_resources = ARRAY_SIZE(ls1x_gpio1_resources), 233 - .resource = ls1x_gpio1_resources, 234 - }; 235 - 236 - /* USB EHCI */ 237 - static u64 ls1x_ehci_dmamask = DMA_BIT_MASK(32); 238 - 239 - static struct resource ls1x_ehci_resources[] = { 240 - [0] = { 241 - .start = LS1X_EHCI_BASE, 242 - .end = LS1X_EHCI_BASE + SZ_32K - 1, 243 - .flags = IORESOURCE_MEM, 244 - }, 245 - [1] = { 246 - .start = LS1X_EHCI_IRQ, 247 - .flags = IORESOURCE_IRQ, 248 - }, 249 - }; 250 - 251 - static struct usb_ehci_pdata ls1x_ehci_pdata = { 252 - }; 253 - 254 - struct platform_device ls1x_ehci_pdev = { 255 - .name = "ehci-platform", 256 - .id = -1, 257 - .num_resources = ARRAY_SIZE(ls1x_ehci_resources), 258 - .resource = ls1x_ehci_resources, 259 - .dev = { 260 - .dma_mask = &ls1x_ehci_dmamask, 261 - .platform_data = &ls1x_ehci_pdata, 262 - }, 263 - }; 264 - 265 - /* Real Time Clock */ 266 - struct platform_device ls1x_rtc_pdev = { 267 - .name = "ls1x-rtc", 268 - .id = -1, 269 - }; 270 - 271 - /* Watchdog */ 272 - static struct resource ls1x_wdt_resources[] = { 273 - { 274 - .start = LS1X_WDT_BASE, 275 - .end = LS1X_WDT_BASE + SZ_16 - 1, 276 - .flags = IORESOURCE_MEM, 277 - }, 278 - }; 279 - 280 - struct platform_device ls1x_wdt_pdev = { 281 - .name = "ls1x-wdt", 282 - .id = -1, 283 - .num_resources = ARRAY_SIZE(ls1x_wdt_resources), 284 - .resource = ls1x_wdt_resources, 285 - };
-42
arch/mips/loongson32/common/prom.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 4 - * 5 - * Modified from arch/mips/pnx833x/common/prom.c. 6 - */ 7 - 8 - #include <linux/io.h> 9 - #include <linux/init.h> 10 - #include <linux/memblock.h> 11 - #include <linux/serial_reg.h> 12 - #include <asm/fw/fw.h> 13 - 14 - #include <loongson1.h> 15 - 16 - unsigned long memsize; 17 - 18 - void __init prom_init(void) 19 - { 20 - void __iomem *uart_base; 21 - 22 - fw_init_cmdline(); 23 - 24 - memsize = fw_getenvl("memsize"); 25 - if(!memsize) 26 - memsize = DEFAULT_MEMSIZE; 27 - 28 - if (strstr(arcs_cmdline, "console=ttyS3")) 29 - uart_base = ioremap(LS1X_UART3_BASE, 0x0f); 30 - else if (strstr(arcs_cmdline, "console=ttyS2")) 31 - uart_base = ioremap(LS1X_UART2_BASE, 0x0f); 32 - else if (strstr(arcs_cmdline, "console=ttyS1")) 33 - uart_base = ioremap(LS1X_UART1_BASE, 0x0f); 34 - else 35 - uart_base = ioremap(LS1X_UART0_BASE, 0x0f); 36 - setup_8250_early_printk_port((unsigned long)uart_base, 0, 0); 37 - } 38 - 39 - void __init plat_mem_setup(void) 40 - { 41 - memblock_add(0x0, (memsize << 20)); 42 - }
-26
arch/mips/loongson32/common/setup.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 4 - */ 5 - 6 - #include <linux/io.h> 7 - #include <linux/init.h> 8 - #include <linux/smp.h> 9 - #include <asm/cpu-info.h> 10 - #include <asm/bootinfo.h> 11 - 12 - const char *get_system_type(void) 13 - { 14 - unsigned int processor_id = (&current_cpu_data)->processor_id; 15 - 16 - switch (processor_id & PRID_REV_MASK) { 17 - case PRID_REV_LOONGSON1B: 18 - #if defined(CONFIG_LOONGSON1_LS1B) 19 - return "LOONGSON LS1B"; 20 - #elif defined(CONFIG_LOONGSON1_LS1C) 21 - return "LOONGSON LS1C"; 22 - #endif 23 - default: 24 - return "LOONGSON (unknown)"; 25 - } 26 - }
-23
arch/mips/loongson32/common/time.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Copyright (c) 2014 Zhang, Keguang <keguang.zhang@gmail.com> 4 - */ 5 - 6 - #include <linux/clk.h> 7 - #include <linux/of_clk.h> 8 - #include <asm/time.h> 9 - 10 - void __init plat_time_init(void) 11 - { 12 - struct clk *clk = NULL; 13 - 14 - /* initialize LS1X clocks */ 15 - of_clk_init(NULL); 16 - 17 - /* setup mips r4k timer */ 18 - clk = clk_get(NULL, "cpu_clk"); 19 - if (IS_ERR(clk)) 20 - panic("unable to get cpu clock, err=%ld", PTR_ERR(clk)); 21 - 22 - mips_hpt_frequency = clk_get_rate(clk) / 2; 23 - }
-6
arch/mips/loongson32/ls1b/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - # 3 - # Makefile for loongson1B based machines. 4 - # 5 - 6 - obj-y += board.o
-55
arch/mips/loongson32/ls1b/board.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com> 4 - */ 5 - 6 - #include <linux/leds.h> 7 - #include <linux/mtd/partitions.h> 8 - #include <linux/sizes.h> 9 - 10 - #include <loongson1.h> 11 - #include <platform.h> 12 - 13 - static const struct gpio_led ls1x_gpio_leds[] __initconst = { 14 - { 15 - .name = "LED9", 16 - .default_trigger = "heartbeat", 17 - .gpio = 38, 18 - .active_low = 1, 19 - .default_state = LEDS_GPIO_DEFSTATE_OFF, 20 - }, { 21 - .name = "LED6", 22 - .default_trigger = "nand-disk", 23 - .gpio = 39, 24 - .active_low = 1, 25 - .default_state = LEDS_GPIO_DEFSTATE_OFF, 26 - }, 27 - }; 28 - 29 - static const struct gpio_led_platform_data ls1x_led_pdata __initconst = { 30 - .num_leds = ARRAY_SIZE(ls1x_gpio_leds), 31 - .leds = ls1x_gpio_leds, 32 - }; 33 - 34 - static struct platform_device *ls1b_platform_devices[] __initdata = { 35 - &ls1x_uart_pdev, 36 - &ls1x_eth0_pdev, 37 - &ls1x_eth1_pdev, 38 - &ls1x_ehci_pdev, 39 - &ls1x_gpio0_pdev, 40 - &ls1x_gpio1_pdev, 41 - &ls1x_rtc_pdev, 42 - &ls1x_wdt_pdev, 43 - }; 44 - 45 - static int __init ls1b_platform_init(void) 46 - { 47 - ls1x_serial_set_uartclk(&ls1x_uart_pdev); 48 - 49 - gpio_led_register_device(-1, &ls1x_led_pdata); 50 - 51 - return platform_add_devices(ls1b_platform_devices, 52 - ARRAY_SIZE(ls1b_platform_devices)); 53 - } 54 - 55 - arch_initcall(ls1b_platform_init);
-6
arch/mips/loongson32/ls1c/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - # 3 - # Makefile for loongson1C based machines. 4 - # 5 - 6 - obj-y += board.o
-23
arch/mips/loongson32/ls1c/board.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Copyright (c) 2016 Yang Ling <gnaygnil@gmail.com> 4 - */ 5 - 6 - #include <platform.h> 7 - 8 - static struct platform_device *ls1c_platform_devices[] __initdata = { 9 - &ls1x_uart_pdev, 10 - &ls1x_eth0_pdev, 11 - &ls1x_rtc_pdev, 12 - &ls1x_wdt_pdev, 13 - }; 14 - 15 - static int __init ls1c_platform_init(void) 16 - { 17 - ls1x_serial_set_uartclk(&ls1x_uart_pdev); 18 - 19 - return platform_add_devices(ls1c_platform_devices, 20 - ARRAY_SIZE(ls1c_platform_devices)); 21 - } 22 - 23 - arch_initcall(ls1c_platform_init);
+5 -4
arch/mips/loongson64/boardinfo.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <linux/kobject.h> 3 + #include <linux/string.h> 3 4 #include <boot_param.h> 4 5 5 6 static ssize_t boardinfo_show(struct kobject *kobj, 6 7 struct kobj_attribute *attr, char *buf) 7 8 { 8 - char board_manufacturer[64] = {0}; 9 + char board_manufacturer[64]; 9 10 char *tmp_board_manufacturer = board_manufacturer; 10 - char bios_vendor[64] = {0}; 11 + char bios_vendor[64]; 11 12 char *tmp_bios_vendor = bios_vendor; 12 13 13 - strcpy(board_manufacturer, eboard->name); 14 - strcpy(bios_vendor, einter->description); 14 + strscpy_pad(board_manufacturer, eboard->name); 15 + strscpy_pad(bios_vendor, einter->description); 15 16 16 17 return sprintf(buf, 17 18 "Board Info\n"
+3 -3
arch/mips/math-emu/me-debugfs.c
··· 37 37 * used in debugfs item names to be clearly associated to corresponding 38 38 * MIPS FPU instructions. 39 39 */ 40 - static void adjust_instruction_counter_name(char *out_name, char *in_name) 40 + static void adjust_instruction_counter_name(char *out_name, char *in_name, size_t len) 41 41 { 42 42 int i = 0; 43 43 44 - strcpy(out_name, in_name); 44 + strscpy(out_name, in_name, len); 45 45 while (in_name[i] != '\0') { 46 46 if (out_name[i] == '_') 47 47 out_name[i] = '.'; ··· 226 226 227 227 #define FPU_STAT_CREATE_EX(m) \ 228 228 do { \ 229 - adjust_instruction_counter_name(name, #m); \ 229 + adjust_instruction_counter_name(name, #m, sizeof(name)); \ 230 230 \ 231 231 debugfs_create_file(name, 0444, fpuemu_debugfs_inst_dir, \ 232 232 (void *)FPU_EMU_STAT_OFFSET(m), \
+9 -8
arch/mips/rb532/prom.c
··· 53 53 int prom_argc; 54 54 char **prom_argv; 55 55 int i; 56 + size_t len; 56 57 57 58 prom_argc = fw_arg0; 58 59 prom_argv = (char **) fw_arg1; ··· 83 82 mips_machtype = MACH_MIKROTIK_RB532; 84 83 } 85 84 86 - strcpy(cp, prom_argv[i]); 87 - cp += strlen(prom_argv[i]); 85 + len = strlen(prom_argv[i]); 86 + memcpy(cp, prom_argv[i], len + 1); 87 + cp += len; 88 88 } 89 89 *(cp++) = ' '; 90 90 91 - i = strlen(arcs_cmdline); 92 - if (i > 0) { 91 + len = strlen(arcs_cmdline); 92 + if (len > 0) { 93 93 *(cp++) = ' '; 94 - strcpy(cp, arcs_cmdline); 95 - cp += strlen(arcs_cmdline); 94 + memcpy(cp, arcs_cmdline, len + 1); 95 + cp += len; 96 96 } 97 97 cmd_line[COMMAND_LINE_SIZE - 1] = '\0'; 98 - 99 - strcpy(arcs_cmdline, cmd_line); 98 + strscpy(arcs_cmdline, cmd_line); 100 99 } 101 100 102 101 void __init prom_init(void)
+2 -1
arch/mips/sgi-ip22/ip22-setup.c
··· 11 11 #include <linux/types.h> 12 12 #include <linux/console.h> 13 13 #include <linux/sched.h> 14 + #include <linux/string.h> 14 15 #include <linux/tty.h> 15 16 16 17 #include <asm/addrspace.h> ··· 66 65 static char options[8] __initdata; 67 66 char *baud = ArcGetEnvironmentVariable("dbaud"); 68 67 if (baud) 69 - strcpy(options, baud); 68 + strscpy(options, baud); 70 69 add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0, 71 70 baud ? options : NULL); 72 71 } else if (!ctype || *ctype != 'g') {
+2 -1
arch/mips/sgi-ip32/ip32-setup.c
··· 14 14 #include <linux/interrupt.h> 15 15 #include <linux/param.h> 16 16 #include <linux/sched.h> 17 + #include <linux/string.h> 17 18 18 19 #include <asm/bootinfo.h> 19 20 #include <asm/mipsregs.h> ··· 91 90 static char options[8] __initdata; 92 91 char *baud = ArcGetEnvironmentVariable("dbaud"); 93 92 if (baud) 94 - strcpy(options, baud); 93 + strscpy(options, baud); 95 94 add_preferred_console("ttyS", *(con + 1) == '2' ? 1 : 0, 96 95 baud ? options : NULL); 97 96 }
+2 -1
arch/mips/sni/setup.c
··· 13 13 #include <linux/export.h> 14 14 #include <linux/console.h> 15 15 #include <linux/screen_info.h> 16 + #include <linux/string.h> 16 17 17 18 #ifdef CONFIG_FW_ARC 18 19 #include <asm/fw/arc/types.h> ··· 81 80 break; 82 81 } 83 82 if (baud) 84 - strcpy(options, baud); 83 + strscpy(options, baud); 85 84 if (strncmp(cdev, "tty552", 6) == 0) 86 85 add_preferred_console("ttyS", port, 87 86 baud ? options : NULL);
+2 -2
arch/mips/txx9/generic/setup.c
··· 200 200 static char cmdline[COMMAND_LINE_SIZE] __initdata; 201 201 char *s; 202 202 203 - strcpy(cmdline, arcs_cmdline); 203 + strscpy(cmdline, arcs_cmdline); 204 204 s = cmdline; 205 205 arcs_cmdline[0] = '\0'; 206 206 while (s && *s) { ··· 270 270 preprocess_cmdline(); 271 271 select_board(); 272 272 273 - strcpy(txx9_system_type, txx9_board_vec->system); 273 + strscpy(txx9_system_type, txx9_board_vec->system); 274 274 275 275 txx9_board_vec->prom_init(); 276 276 }
+1 -1
drivers/soc/bcm/brcmstb/pm/pm.h
··· 60 60 PM_DEEP_STANDBY | \ 61 61 PM_PLL_PWRDOWN | PM_PWR_DOWN) 62 62 63 - #ifndef __ASSEMBLY__ 63 + #ifndef __ASSEMBLER__ 64 64 65 65 #ifndef CONFIG_MIPS 66 66 extern const unsigned long brcmstb_pm_do_s2_sz;