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

Merge tag 'mips_5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS updates from Thomas Bogendoerfer:

- removed support for PNX833x alias NXT_STB22x

- included Ingenic SoC support into generic MIPS kernels

- added support for new Ingenic SoCs

- converted workaround selection to use Kconfig

- replaced old boot mem functions by memblock_*

- enabled COP2 usage in kernel for Loongson64 to make use
of 16byte load/stores possible

- cleanups and fixes

* tag 'mips_5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (92 commits)
MIPS: DEC: Restore bootmem reservation for firmware working memory area
MIPS: dec: fix section mismatch
bcm963xx_tag.h: fix duplicated word
mips: ralink: enable zboot support
MIPS: ingenic: Remove CPU_SUPPORTS_HUGEPAGES
MIPS: cpu-probe: remove MIPS_CPU_BP_GHIST option bit
MIPS: cpu-probe: introduce exclusive R3k CPU probe
MIPS: cpu-probe: move fpu probing/handling into its own file
MIPS: replace add_memory_region with memblock
MIPS: Loongson64: Clean up numa.c
MIPS: Loongson64: Select SMP in Kconfig to avoid build error
mips: octeon: Add Ubiquiti E200 and E220 boards
MIPS: SGI-IP28: disable use of ll/sc in kernel
MIPS: tx49xx: move tx4939_add_memory_regions into only user
MIPS: pgtable: Remove used PAGE_USERIO define
MIPS: alchemy: Share prom_init implementation
MIPS: alchemy: Fix build breakage, if TOUCHSCREEN_WM97XX is disabled
MIPS: process: include exec.h header in process.c
MIPS: process: Add prototype for function arch_dup_task_struct
MIPS: idle: Add prototype for function check_wait
...

+1755 -3706
+5
Documentation/devicetree/bindings/mips/ingenic/devices.yaml
··· 47 47 items: 48 48 - const: yna,cu1830-neo 49 49 - const: ingenic,x1830 50 + 51 + - description: YSH & ATIL General Board, CU2000 Module with Neo Backplane 52 + items: 53 + - const: yna,cu2000-neo 54 + - const: ingenic,x2000e 50 55 ...
+3 -2
MAINTAINERS
··· 8675 8675 M: Paul Cercueil <paul@crapouillou.net> 8676 8676 S: Maintained 8677 8677 F: arch/mips/boot/dts/ingenic/ 8678 - F: arch/mips/include/asm/mach-jz4740/ 8679 - F: arch/mips/jz4740/ 8678 + F: arch/mips/generic/board-ingenic.c 8679 + F: arch/mips/include/asm/mach-ingenic/ 8680 + F: arch/mips/ingenic/Kconfig 8680 8681 F: drivers/clk/ingenic/ 8681 8682 F: drivers/dma/dma-jz4780.c 8682 8683 F: drivers/gpu/drm/ingenic/
-2
arch/mips/Kbuild.platforms
··· 13 13 platform-$(CONFIG_MACH_DECSTATION) += dec/ 14 14 platform-$(CONFIG_MIPS_GENERIC) += generic/ 15 15 platform-$(CONFIG_MACH_JAZZ) += jazz/ 16 - platform-$(CONFIG_MACH_INGENIC) += jz4740/ 17 16 platform-$(CONFIG_LANTIQ) += lantiq/ 18 17 platform-$(CONFIG_MACH_LOONGSON2EF) += loongson2ef/ 19 18 platform-$(CONFIG_MACH_LOONGSON32) += loongson32/ ··· 21 22 platform-$(CONFIG_NLM_COMMON) += netlogic/ 22 23 platform-$(CONFIG_PIC32MZDA) += pic32/ 23 24 platform-$(CONFIG_MACH_PISTACHIO) += pistachio/ 24 - platform-$(CONFIG_SOC_PNX833X) += pnx833x/ 25 25 platform-$(CONFIG_RALINK) += ralink/ 26 26 platform-$(CONFIG_MIKROTIK_RB532) += rb532/ 27 27 platform-$(CONFIG_SGI_IP22) += sgi-ip22/
+111 -47
arch/mips/Kconfig
··· 94 94 config MIPS_FIXUP_BIGPHYS_ADDR 95 95 bool 96 96 97 + config MIPS_GENERIC 98 + bool 99 + 100 + config MACH_INGENIC 101 + bool 102 + select SYS_SUPPORTS_32BIT_KERNEL 103 + select SYS_SUPPORTS_LITTLE_ENDIAN 104 + select SYS_SUPPORTS_ZBOOT 105 + select DMA_NONCOHERENT 106 + select IRQ_MIPS_CPU 107 + select PINCTRL 108 + select GPIOLIB 109 + select COMMON_CLK 110 + select GENERIC_IRQ_CHIP 111 + select BUILTIN_DTB if MIPS_NO_APPENDED_DTB 112 + select USE_OF 113 + select CPU_SUPPORTS_CPUFREQ 114 + select MIPS_EXTERNAL_TIMER 115 + 97 116 menu "Machine selection" 98 117 99 118 choice 100 119 prompt "System type" 101 - default MIPS_GENERIC 120 + default MIPS_GENERIC_KERNEL 102 121 103 - config MIPS_GENERIC 122 + config MIPS_GENERIC_KERNEL 104 123 bool "Generic board-agnostic MIPS kernel" 124 + select MIPS_GENERIC 105 125 select BOOT_RAW 106 126 select BUILTIN_DTB 107 127 select CEVT_R4K ··· 158 138 select SYS_SUPPORTS_MULTITHREADING 159 139 select SYS_SUPPORTS_RELOCATABLE 160 140 select SYS_SUPPORTS_SMARTMIPS 141 + select SYS_SUPPORTS_ZBOOT 161 142 select UHI_BOOT 162 143 select USB_EHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN 163 144 select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN ··· 411 390 Members include the Acer PICA, MIPS Magnum 4000, MIPS Millennium and 412 391 Olivetti M700-10 workstations. 413 392 414 - config MACH_INGENIC 393 + config MACH_INGENIC_SOC 415 394 bool "Ingenic SoC based machines" 416 - select SYS_SUPPORTS_32BIT_KERNEL 417 - select SYS_SUPPORTS_LITTLE_ENDIAN 395 + select MIPS_GENERIC 396 + select MACH_INGENIC 418 397 select SYS_SUPPORTS_ZBOOT_UART16550 419 - select CPU_SUPPORTS_HUGEPAGES 420 - select DMA_NONCOHERENT 421 - select IRQ_MIPS_CPU 422 - select PINCTRL 423 - select GPIOLIB 424 - select COMMON_CLK 425 - select GENERIC_IRQ_CHIP 426 - select BUILTIN_DTB if MIPS_NO_APPENDED_DTB 427 - select USE_OF 428 398 429 399 config LANTIQ 430 400 bool "Lantiq based platforms" ··· 488 476 select SYS_SUPPORTS_ZBOOT 489 477 select ZONE_DMA32 490 478 select NUMA 479 + select SMP 491 480 select COMMON_CLK 492 481 select USE_OF 493 482 select BUILTIN_DTB ··· 582 569 select SYS_SUPPORTS_VPE_LOADER 583 570 select SYS_SUPPORTS_ZBOOT 584 571 select USE_OF 572 + select WAR_ICACHE_REFILLS 585 573 select ZONE_DMA32 if 64BIT 586 574 help 587 575 This enables support for the MIPS Technologies Malta evaluation ··· 604 590 select SYS_SUPPORTS_MIPS16 605 591 select GPIOLIB 606 592 607 - config NXP_STB220 608 - bool "NXP STB220 board" 609 - select SOC_PNX833X 610 - help 611 - Support for NXP Semiconductors STB220 Development Board. 612 - 613 - config NXP_STB225 614 - bool "NXP 225 board" 615 - select SOC_PNX833X 616 - select SOC_PNX8335 617 - help 618 - Support for NXP Semiconductors STB225 Development Board. 619 - 620 593 config RALINK 621 594 bool "Ralink based machines" 622 595 select CEVT_R4K ··· 617 616 select SYS_SUPPORTS_32BIT_KERNEL 618 617 select SYS_SUPPORTS_LITTLE_ENDIAN 619 618 select SYS_SUPPORTS_MIPS16 619 + select SYS_SUPPORTS_ZBOOT 620 620 select SYS_HAS_EARLY_PRINTK 621 621 select CLKDEV_LOOKUP 622 622 select ARCH_HAS_RESET_CONTROLLER ··· 654 652 select SYS_SUPPORTS_32BIT_KERNEL 655 653 select SYS_SUPPORTS_64BIT_KERNEL 656 654 select SYS_SUPPORTS_BIG_ENDIAN 655 + select WAR_R4600_V1_INDEX_ICACHEOP 656 + select WAR_R4600_V1_HIT_CACHEOP 657 + select WAR_R4600_V2_HIT_CACHEOP 657 658 select MIPS_L1_CACHE_SHIFT_7 658 659 help 659 660 This are the SGI Indy, Challenge S and Indigo2, as well as certain ··· 684 679 select SYS_SUPPORTS_BIG_ENDIAN 685 680 select SYS_SUPPORTS_NUMA 686 681 select SYS_SUPPORTS_SMP 682 + select WAR_R10000_LLSC 687 683 select MIPS_L1_CACHE_SHIFT_7 688 684 select NUMA 689 685 help ··· 720 714 select SYS_HAS_EARLY_PRINTK 721 715 select SYS_SUPPORTS_64BIT_KERNEL 722 716 select SYS_SUPPORTS_BIG_ENDIAN 717 + select WAR_R10000_LLSC 723 718 select MIPS_L1_CACHE_SHIFT_7 724 719 help 725 720 This is the SGI Indigo2 with R10000 processor. To compile a Linux ··· 747 740 select SYS_SUPPORTS_64BIT_KERNEL 748 741 select SYS_SUPPORTS_BIG_ENDIAN 749 742 select SYS_SUPPORTS_SMP 743 + select WAR_R10000_LLSC 750 744 select MIPS_L1_CACHE_SHIFT_7 751 745 select ARC_MEMORY 752 746 help ··· 775 767 select SYS_HAS_CPU_NEVADA 776 768 select SYS_SUPPORTS_64BIT_KERNEL 777 769 select SYS_SUPPORTS_BIG_ENDIAN 770 + select WAR_ICACHE_REFILLS 778 771 help 779 772 If you want this kernel to run on SGI O2 workstation, say Y here. 780 773 ··· 899 890 select SYS_SUPPORTS_BIG_ENDIAN 900 891 select SYS_SUPPORTS_HIGHMEM 901 892 select SYS_SUPPORTS_LITTLE_ENDIAN 893 + select WAR_R4600_V2_HIT_CACHEOP 902 894 help 903 895 The SNI RM200/300/400 are MIPS-based machines manufactured by 904 896 Siemens Nixdorf Informationssysteme (SNI), parent company of Pyramid ··· 911 901 912 902 config MACH_TX49XX 913 903 bool "Toshiba TX49 series based machines" 904 + select WAR_TX49XX_ICACHE_INDEX_INV 914 905 915 906 config MIKROTIK_RB532 916 907 bool "Mikrotik RB532 boards" ··· 1037 1026 source "arch/mips/bcm63xx/Kconfig" 1038 1027 source "arch/mips/bmips/Kconfig" 1039 1028 source "arch/mips/generic/Kconfig" 1029 + source "arch/mips/ingenic/Kconfig" 1040 1030 source "arch/mips/jazz/Kconfig" 1041 - source "arch/mips/jz4740/Kconfig" 1042 1031 source "arch/mips/lantiq/Kconfig" 1043 1032 source "arch/mips/pic32/Kconfig" 1044 1033 source "arch/mips/pistachio/Kconfig" ··· 1277 1266 1278 1267 config NO_EXCEPT_FILL 1279 1268 bool 1280 - 1281 - config SOC_PNX833X 1282 - bool 1283 - select CEVT_R4K 1284 - select CSRC_R4K 1285 - select IRQ_MIPS_CPU 1286 - select DMA_NONCOHERENT 1287 - select SYS_HAS_CPU_MIPS32_R2 1288 - select SYS_SUPPORTS_32BIT_KERNEL 1289 - select SYS_SUPPORTS_LITTLE_ENDIAN 1290 - select SYS_SUPPORTS_BIG_ENDIAN 1291 - select SYS_SUPPORTS_MIPS16 1292 - select CPU_MIPSR2_IRQ_VI 1293 - 1294 - config SOC_PNX8335 1295 - bool 1296 - select SOC_PNX833X 1297 1269 1298 1270 config MIPS_SPRAM 1299 1271 bool ··· 1614 1620 select CPU_SUPPORTS_32BIT_KERNEL 1615 1621 select CPU_SUPPORTS_HIGHMEM 1616 1622 select CPU_SUPPORTS_MSA 1617 - select CPU_SUPPORTS_UNCACHED_ACCELERATED 1618 1623 select CPU_SUPPORTS_CPUFREQ 1619 1624 select CPU_MIPSR2_IRQ_VI 1620 1625 select CPU_MIPSR2_IRQ_EI ··· 1884 1891 select HAVE_KERNEL_LZMA 1885 1892 select HAVE_KERNEL_LZO 1886 1893 select HAVE_KERNEL_XZ 1894 + select HAVE_KERNEL_ZSTD 1887 1895 1888 1896 config SYS_SUPPORTS_ZBOOT_UART16550 1889 1897 bool ··· 2266 2272 default "13" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_32KB 2267 2273 range 12 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_16KB 2268 2274 default "12" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_16KB 2269 - range 11 64 2275 + range 0 64 2270 2276 default "11" 2271 2277 help 2272 2278 The kernel memory allocator divides physically contiguous memory ··· 2630 2636 bool 2631 2637 2632 2638 config MIPS_CRC_SUPPORT 2639 + bool 2640 + 2641 + # R4600 erratum. Due to the lack of errata information the exact 2642 + # technical details aren't known. I've experimentally found that disabling 2643 + # interrupts during indexed I-cache flushes seems to be sufficient to deal 2644 + # with the issue. 2645 + config WAR_R4600_V1_INDEX_ICACHEOP 2646 + bool 2647 + 2648 + # Pleasures of the R4600 V1.x. Cite from the IDT R4600 V1.7 errata: 2649 + # 2650 + # 18. The CACHE instructions Hit_Writeback_Invalidate_D, Hit_Writeback_D, 2651 + # Hit_Invalidate_D and Create_Dirty_Excl_D should only be 2652 + # executed if there is no other dcache activity. If the dcache is 2653 + # accessed for another instruction immeidately preceding when these 2654 + # cache instructions are executing, it is possible that the dcache 2655 + # tag match outputs used by these cache instructions will be 2656 + # incorrect. These cache instructions should be preceded by at least 2657 + # four instructions that are not any kind of load or store 2658 + # instruction. 2659 + # 2660 + # This is not allowed: lw 2661 + # nop 2662 + # nop 2663 + # nop 2664 + # cache Hit_Writeback_Invalidate_D 2665 + # 2666 + # This is allowed: lw 2667 + # nop 2668 + # nop 2669 + # nop 2670 + # nop 2671 + # cache Hit_Writeback_Invalidate_D 2672 + config WAR_R4600_V1_HIT_CACHEOP 2673 + bool 2674 + 2675 + # Writeback and invalidate the primary cache dcache before DMA. 2676 + # 2677 + # R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D, 2678 + # Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only 2679 + # operate correctly if the internal data cache refill buffer is empty. These 2680 + # CACHE instructions should be separated from any potential data cache miss 2681 + # by a load instruction to an uncached address to empty the response buffer." 2682 + # (Revision 2.0 device errata from IDT available on https://www.idt.com/ 2683 + # in .pdf format.) 2684 + config WAR_R4600_V2_HIT_CACHEOP 2685 + bool 2686 + 2687 + # From TX49/H2 manual: "If the instruction (i.e. CACHE) is issued for 2688 + # the line which this instruction itself exists, the following 2689 + # operation is not guaranteed." 2690 + # 2691 + # Workaround: do two phase flushing for Index_Invalidate_I 2692 + config WAR_TX49XX_ICACHE_INDEX_INV 2693 + bool 2694 + 2695 + # The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra 2696 + # opposes it being called that) where invalid instructions in the same 2697 + # I-cache line worth of instructions being fetched may case spurious 2698 + # exceptions. 2699 + config WAR_ICACHE_REFILLS 2700 + bool 2701 + 2702 + # On the R10000 up to version 2.6 (not sure about 2.7) there is a bug that 2703 + # may cause ll / sc and lld / scd sequences to execute non-atomically. 2704 + config WAR_R10000_LLSC 2705 + bool 2706 + 2707 + # 34K core erratum: "Problems Executing the TLBR Instruction" 2708 + config WAR_MIPS34K_MISSED_ITLB 2633 2709 bool 2634 2710 2635 2711 #
-11
arch/mips/alchemy/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - # au1000-style gpio and interrupt controllers 3 - config ALCHEMY_GPIOINT_AU1000 4 - bool 5 - 6 - # au1300-style GPIO/INT controller 7 - config ALCHEMY_GPIOINT_AU1300 8 - bool 9 - 10 2 choice 11 3 prompt "Machine type" 12 4 depends on MIPS_ALCHEMY ··· 7 15 config MIPS_MTX1 8 16 bool "4G Systems MTX-1 board" 9 17 select HAVE_PCI 10 - select ALCHEMY_GPIOINT_AU1000 11 18 select SYS_SUPPORTS_LITTLE_ENDIAN 12 19 select SYS_HAS_EARLY_PRINTK 13 20 ··· 24 33 25 34 config MIPS_XXS1500 26 35 bool "MyCable XXS1500 board" 27 - select ALCHEMY_GPIOINT_AU1000 28 36 select SYS_SUPPORTS_LITTLE_ENDIAN 29 37 select SYS_HAS_EARLY_PRINTK 30 38 31 39 config MIPS_GPR 32 40 bool "Trapeze ITS GPR board" 33 - select ALCHEMY_GPIOINT_AU1000 34 41 select HAVE_PCI 35 42 select SYS_SUPPORTS_LITTLE_ENDIAN 36 43 select SYS_HAS_EARLY_PRINTK
-17
arch/mips/alchemy/board-gpr.c
··· 31 31 return "GPR"; 32 32 } 33 33 34 - void __init prom_init(void) 35 - { 36 - unsigned char *memsize_str; 37 - unsigned long memsize; 38 - 39 - prom_argc = fw_arg0; 40 - prom_argv = (char **)fw_arg1; 41 - prom_envp = (char **)fw_arg2; 42 - 43 - prom_init_cmdline(); 44 - 45 - memsize_str = prom_getenv("memsize"); 46 - if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) 47 - memsize = 0x04000000; 48 - add_memory_region(0, memsize, BOOT_MEM_RAM); 49 - } 50 - 51 34 void prom_putchar(char c) 52 35 { 53 36 alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c);
-17
arch/mips/alchemy/board-mtx1.c
··· 30 30 return "MTX-1"; 31 31 } 32 32 33 - void __init prom_init(void) 34 - { 35 - unsigned char *memsize_str; 36 - unsigned long memsize; 37 - 38 - prom_argc = fw_arg0; 39 - prom_argv = (char **)fw_arg1; 40 - prom_envp = (char **)fw_arg2; 41 - 42 - prom_init_cmdline(); 43 - 44 - memsize_str = prom_getenv("memsize"); 45 - if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) 46 - memsize = 0x04000000; 47 - add_memory_region(0, memsize, BOOT_MEM_RAM); 48 - } 49 - 50 33 void prom_putchar(char c) 51 34 { 52 35 alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c);
-18
arch/mips/alchemy/board-xxs1500.c
··· 25 25 return "XXS1500"; 26 26 } 27 27 28 - void __init prom_init(void) 29 - { 30 - unsigned char *memsize_str; 31 - unsigned long memsize; 32 - 33 - prom_argc = fw_arg0; 34 - prom_argv = (char **)fw_arg1; 35 - prom_envp = (char **)fw_arg2; 36 - 37 - prom_init_cmdline(); 38 - 39 - memsize_str = prom_getenv("memsize"); 40 - if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) 41 - memsize = 0x04000000; 42 - 43 - add_memory_region(0, memsize, BOOT_MEM_RAM); 44 - } 45 - 46 28 void prom_putchar(char c) 47 29 { 48 30 alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c);
+21
arch/mips/alchemy/common/prom.c
··· 34 34 */ 35 35 36 36 #include <linux/init.h> 37 + #include <linux/kernel.h> 38 + #include <linux/memblock.h> 39 + #include <linux/sizes.h> 37 40 #include <linux/string.h> 38 41 39 42 #include <asm/bootinfo.h> ··· 77 74 } 78 75 79 76 return NULL; 77 + } 78 + 79 + void __init prom_init(void) 80 + { 81 + unsigned char *memsize_str; 82 + unsigned long memsize; 83 + 84 + prom_argc = (int)fw_arg0; 85 + prom_argv = (char **)fw_arg1; 86 + prom_envp = (char **)fw_arg2; 87 + 88 + prom_init_cmdline(); 89 + 90 + memsize_str = prom_getenv("memsize"); 91 + if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) 92 + memsize = SZ_64M; /* minimum memsize is 64MB RAM */ 93 + 94 + memblock_add(0, memsize); 80 95 } 81 96 82 97 static inline unsigned char str2hexnum(unsigned char c)
+7
arch/mips/alchemy/devboards/db1300.c
··· 731 731 732 732 /**********************************************************************/ 733 733 734 + #if IS_ENABLED(CONFIG_TOUCHSCREEN_WM97XX) 734 735 static void db1300_wm97xx_irqen(struct wm97xx *wm, int enable) 735 736 { 736 737 if (enable) ··· 763 762 764 763 return wm97xx_register_mach_ops(wm, &db1300_wm97xx_ops); 765 764 } 765 + #else 766 + static int db1300_wm97xx_probe(struct platform_device *pdev) 767 + { 768 + return -ENODEV; 769 + } 770 + #endif 766 771 767 772 static struct platform_driver db1300_wm97xx_driver = { 768 773 .driver.name = "wm97xx-touch",
-17
arch/mips/alchemy/devboards/platform.c
··· 20 20 21 21 #include <prom.h> 22 22 23 - void __init prom_init(void) 24 - { 25 - unsigned char *memsize_str; 26 - unsigned long memsize; 27 - 28 - prom_argc = (int)fw_arg0; 29 - prom_argv = (char **)fw_arg1; 30 - prom_envp = (char **)fw_arg2; 31 - 32 - prom_init_cmdline(); 33 - memsize_str = prom_getenv("memsize"); 34 - if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) 35 - memsize = 64 << 20; /* all devboards have at least 64MB RAM */ 36 - 37 - add_memory_region(0, memsize, BOOT_MEM_RAM); 38 - } 39 - 40 23 void prom_putchar(char c) 41 24 { 42 25 if (alchemy_get_cputype() == ALCHEMY_CPU_AU1300)
+1 -1
arch/mips/ar7/memory.c
··· 47 47 unsigned long pages; 48 48 49 49 pages = memsize() >> PAGE_SHIFT; 50 - add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT, BOOT_MEM_RAM); 50 + memblock_add(PHYS_OFFSET, pages << PAGE_SHIFT); 51 51 } 52 52 53 53 void __init prom_free_prom_memory(void)
+2 -1
arch/mips/ath25/ar2315.c
··· 19 19 #include <linux/bitops.h> 20 20 #include <linux/irqdomain.h> 21 21 #include <linux/interrupt.h> 22 + #include <linux/memblock.h> 22 23 #include <linux/platform_device.h> 23 24 #include <linux/reboot.h> 24 25 #include <asm/bootinfo.h> ··· 267 266 memsize <<= 1 + ATH25_REG_MS(memcfg, AR2315_MEM_CFG_COL_WIDTH); 268 267 memsize <<= 1 + ATH25_REG_MS(memcfg, AR2315_MEM_CFG_ROW_WIDTH); 269 268 memsize <<= 3; 270 - add_memory_region(0, memsize, BOOT_MEM_RAM); 269 + memblock_add(0, memsize); 271 270 iounmap(sdram_base); 272 271 273 272 ar2315_rst_base = ioremap(AR2315_RST_BASE, AR2315_RST_SIZE);
+2 -1
arch/mips/ath25/ar5312.c
··· 19 19 #include <linux/bitops.h> 20 20 #include <linux/irqdomain.h> 21 21 #include <linux/interrupt.h> 22 + #include <linux/memblock.h> 22 23 #include <linux/platform_device.h> 23 24 #include <linux/mtd/physmap.h> 24 25 #include <linux/reboot.h> ··· 364 363 memsize = (bank0_ac ? (1 << (bank0_ac + 1)) : 0) + 365 364 (bank1_ac ? (1 << (bank1_ac + 1)) : 0); 366 365 memsize <<= 20; 367 - add_memory_region(0, memsize, BOOT_MEM_RAM); 366 + memblock_add(0, memsize); 368 367 iounmap(sdram_base); 369 368 370 369 ar5312_rst_base = ioremap(AR5312_RST_BASE, AR5312_RST_SIZE);
+2 -1
arch/mips/bcm47xx/prom.c
··· 27 27 #include <linux/init.h> 28 28 #include <linux/types.h> 29 29 #include <linux/kernel.h> 30 + #include <linux/memblock.h> 30 31 #include <linux/spinlock.h> 31 32 #include <linux/ssb/ssb_driver_chipcommon.h> 32 33 #include <linux/ssb/ssb_regs.h> ··· 98 97 */ 99 98 if (c->cputype == CPU_74K && (mem == (128 << 20))) 100 99 mem -= 0x1000; 101 - add_memory_region(0, mem, BOOT_MEM_RAM); 100 + memblock_add(0, mem); 102 101 } 103 102 104 103 /*
+1 -1
arch/mips/bcm47xx/setup.c
··· 141 141 142 142 /* 143 143 * Memory setup is done in the early part of MIPS's arch_mem_init. It's supposed 144 - * to detect memory and record it with add_memory_region. 144 + * to detect memory and record it with memblock_add. 145 145 * Any extra initializaion performed here must not use kmalloc or bootmem. 146 146 */ 147 147 void __init plat_mem_setup(void)
+332 -345
arch/mips/bcm63xx/boards/board_bcm963xx.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 1 2 /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 3 * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr> 7 4 * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org> 8 5 */ ··· 29 32 30 33 #include <uapi/linux/bcm933xx_hcs.h> 31 34 32 - 33 35 #define HCS_OFFSET_128K 0x20000 34 36 35 37 static struct board_info board; ··· 38 42 */ 39 43 #ifdef CONFIG_BCM63XX_CPU_3368 40 44 static struct board_info __initdata board_cvg834g = { 41 - .name = "CVG834G_E15R3921", 42 - .expected_cpu_id = 0x3368, 45 + .name = "CVG834G_E15R3921", 46 + .expected_cpu_id = 0x3368, 43 47 44 - .has_uart0 = 1, 45 - .has_uart1 = 1, 48 + .ephy_reset_gpio = 36, 49 + .ephy_reset_gpio_flags = GPIOF_INIT_HIGH, 50 + .has_pci = 1, 51 + .has_uart0 = 1, 52 + .has_uart1 = 1, 46 53 47 - .has_enet0 = 1, 48 - .has_pci = 1, 49 - 54 + .has_enet0 = 1, 50 55 .enet0 = { 51 - .has_phy = 1, 52 - .use_internal_phy = 1, 56 + .has_phy = 1, 57 + .use_internal_phy = 1, 53 58 }, 54 59 55 60 .leds = { 56 61 { 57 - .name = "CVG834G:green:power", 58 - .gpio = 37, 62 + .name = "CVG834G:green:power", 63 + .gpio = 37, 59 64 .default_trigger= "default-on", 60 65 }, 61 66 }, 62 - 63 - .ephy_reset_gpio = 36, 64 - .ephy_reset_gpio_flags = GPIOF_INIT_HIGH, 65 67 }; 66 68 #endif /* CONFIG_BCM63XX_CPU_3368 */ 67 69 ··· 68 74 */ 69 75 #ifdef CONFIG_BCM63XX_CPU_6328 70 76 static struct board_info __initdata board_96328avng = { 71 - .name = "96328avng", 72 - .expected_cpu_id = 0x6328, 77 + .name = "96328avng", 78 + .expected_cpu_id = 0x6328, 73 79 74 - .has_uart0 = 1, 75 - .has_pci = 1, 76 - .has_usbd = 0, 80 + .has_pci = 1, 81 + .has_uart0 = 1, 77 82 83 + .has_usbd = 0, 78 84 .usbd = { 79 - .use_fullspeed = 0, 80 - .port_no = 0, 85 + .use_fullspeed = 0, 86 + .port_no = 0, 81 87 }, 82 88 83 89 .leds = { 84 90 { 85 - .name = "96328avng::ppp-fail", 86 - .gpio = 2, 87 - .active_low = 1, 91 + .name = "96328avng::ppp-fail", 92 + .gpio = 2, 93 + .active_low = 1, 88 94 }, 89 95 { 90 - .name = "96328avng::power", 91 - .gpio = 4, 92 - .active_low = 1, 96 + .name = "96328avng::power", 97 + .gpio = 4, 98 + .active_low = 1, 93 99 .default_trigger = "default-on", 94 100 }, 95 101 { 96 - .name = "96328avng::power-fail", 97 - .gpio = 8, 98 - .active_low = 1, 102 + .name = "96328avng::power-fail", 103 + .gpio = 8, 104 + .active_low = 1, 99 105 }, 100 106 { 101 - .name = "96328avng::wps", 102 - .gpio = 9, 103 - .active_low = 1, 107 + .name = "96328avng::wps", 108 + .gpio = 9, 109 + .active_low = 1, 104 110 }, 105 111 { 106 - .name = "96328avng::ppp", 107 - .gpio = 11, 108 - .active_low = 1, 112 + .name = "96328avng::ppp", 113 + .gpio = 11, 114 + .active_low = 1, 109 115 }, 110 116 }, 111 117 }; ··· 116 122 */ 117 123 #ifdef CONFIG_BCM63XX_CPU_6338 118 124 static struct board_info __initdata board_96338gw = { 119 - .name = "96338GW", 120 - .expected_cpu_id = 0x6338, 125 + .name = "96338GW", 126 + .expected_cpu_id = 0x6338, 121 127 122 - .has_uart0 = 1, 123 - .has_enet0 = 1, 128 + .has_ohci0 = 1, 129 + .has_uart0 = 1, 130 + 131 + .has_enet0 = 1, 124 132 .enet0 = { 125 - .force_speed_100 = 1, 126 - .force_duplex_full = 1, 133 + .force_speed_100 = 1, 134 + .force_duplex_full = 1, 127 135 }, 128 - 129 - .has_ohci0 = 1, 130 136 131 137 .leds = { 132 138 { 133 - .name = "adsl", 134 - .gpio = 3, 135 - .active_low = 1, 139 + .name = "adsl", 140 + .gpio = 3, 141 + .active_low = 1, 136 142 }, 137 143 { 138 - .name = "ses", 139 - .gpio = 5, 140 - .active_low = 1, 144 + .name = "ses", 145 + .gpio = 5, 146 + .active_low = 1, 141 147 }, 142 148 { 143 - .name = "ppp-fail", 144 - .gpio = 4, 145 - .active_low = 1, 149 + .name = "ppp-fail", 150 + .gpio = 4, 151 + .active_low = 1, 146 152 }, 147 153 { 148 - .name = "power", 149 - .gpio = 0, 150 - .active_low = 1, 154 + .name = "power", 155 + .gpio = 0, 156 + .active_low = 1, 151 157 .default_trigger = "default-on", 152 158 }, 153 159 { 154 - .name = "stop", 155 - .gpio = 1, 156 - .active_low = 1, 160 + .name = "stop", 161 + .gpio = 1, 162 + .active_low = 1, 157 163 } 158 164 }, 159 165 }; 160 166 161 167 static struct board_info __initdata board_96338w = { 162 - .name = "96338W", 163 - .expected_cpu_id = 0x6338, 168 + .name = "96338W", 169 + .expected_cpu_id = 0x6338, 164 170 165 - .has_uart0 = 1, 166 - .has_enet0 = 1, 171 + .has_uart0 = 1, 172 + 173 + .has_enet0 = 1, 167 174 .enet0 = { 168 - .force_speed_100 = 1, 169 - .force_duplex_full = 1, 175 + .force_speed_100 = 1, 176 + .force_duplex_full = 1, 170 177 }, 171 178 172 179 .leds = { 173 180 { 174 - .name = "adsl", 175 - .gpio = 3, 176 - .active_low = 1, 181 + .name = "adsl", 182 + .gpio = 3, 183 + .active_low = 1, 177 184 }, 178 185 { 179 - .name = "ses", 180 - .gpio = 5, 181 - .active_low = 1, 186 + .name = "ses", 187 + .gpio = 5, 188 + .active_low = 1, 182 189 }, 183 190 { 184 - .name = "ppp-fail", 185 - .gpio = 4, 186 - .active_low = 1, 191 + .name = "ppp-fail", 192 + .gpio = 4, 193 + .active_low = 1, 187 194 }, 188 195 { 189 - .name = "power", 190 - .gpio = 0, 191 - .active_low = 1, 196 + .name = "power", 197 + .gpio = 0, 198 + .active_low = 1, 192 199 .default_trigger = "default-on", 193 200 }, 194 201 { 195 - .name = "stop", 196 - .gpio = 1, 197 - .active_low = 1, 202 + .name = "stop", 203 + .gpio = 1, 204 + .active_low = 1, 198 205 }, 199 206 }, 200 207 }; ··· 206 211 */ 207 212 #ifdef CONFIG_BCM63XX_CPU_6345 208 213 static struct board_info __initdata board_96345gw2 = { 209 - .name = "96345GW2", 210 - .expected_cpu_id = 0x6345, 214 + .name = "96345GW2", 215 + .expected_cpu_id = 0x6345, 211 216 212 - .has_uart0 = 1, 217 + .has_uart0 = 1, 213 218 }; 214 219 #endif /* CONFIG_BCM63XX_CPU_6345 */ 215 220 ··· 218 223 */ 219 224 #ifdef CONFIG_BCM63XX_CPU_6348 220 225 static struct board_info __initdata board_96348r = { 221 - .name = "96348R", 222 - .expected_cpu_id = 0x6348, 226 + .name = "96348R", 227 + .expected_cpu_id = 0x6348, 223 228 224 - .has_uart0 = 1, 225 - .has_enet0 = 1, 226 - .has_pci = 1, 229 + .has_pci = 1, 230 + .has_uart0 = 1, 227 231 232 + .has_enet0 = 1, 228 233 .enet0 = { 229 - .has_phy = 1, 230 - .use_internal_phy = 1, 234 + .has_phy = 1, 235 + .use_internal_phy = 1, 231 236 }, 232 237 233 238 .leds = { 234 239 { 235 - .name = "adsl-fail", 236 - .gpio = 2, 237 - .active_low = 1, 240 + .name = "adsl-fail", 241 + .gpio = 2, 242 + .active_low = 1, 238 243 }, 239 244 { 240 - .name = "ppp", 241 - .gpio = 3, 242 - .active_low = 1, 245 + .name = "ppp", 246 + .gpio = 3, 247 + .active_low = 1, 243 248 }, 244 249 { 245 - .name = "ppp-fail", 246 - .gpio = 4, 247 - .active_low = 1, 250 + .name = "ppp-fail", 251 + .gpio = 4, 252 + .active_low = 1, 248 253 }, 249 254 { 250 - .name = "power", 251 - .gpio = 0, 252 - .active_low = 1, 255 + .name = "power", 256 + .gpio = 0, 257 + .active_low = 1, 253 258 .default_trigger = "default-on", 254 259 255 260 }, 256 261 { 257 - .name = "stop", 258 - .gpio = 1, 259 - .active_low = 1, 262 + .name = "stop", 263 + .gpio = 1, 264 + .active_low = 1, 260 265 }, 261 266 }, 262 267 }; 263 268 264 269 static struct board_info __initdata board_96348gw_10 = { 265 - .name = "96348GW-10", 266 - .expected_cpu_id = 0x6348, 270 + .name = "96348GW-10", 271 + .expected_cpu_id = 0x6348, 267 272 268 - .has_uart0 = 1, 269 - .has_enet0 = 1, 270 - .has_enet1 = 1, 271 - .has_pci = 1, 273 + .has_ohci0 = 1, 274 + .has_pccard = 1, 275 + .has_pci = 1, 276 + .has_uart0 = 1, 272 277 278 + .has_enet0 = 1, 273 279 .enet0 = { 274 - .has_phy = 1, 275 - .use_internal_phy = 1, 276 - }, 277 - .enet1 = { 278 - .force_speed_100 = 1, 279 - .force_duplex_full = 1, 280 + .has_phy = 1, 281 + .use_internal_phy = 1, 280 282 }, 281 283 282 - .has_ohci0 = 1, 283 - .has_pccard = 1, 284 - .has_ehci0 = 1, 284 + .has_enet1 = 1, 285 + .enet1 = { 286 + .force_speed_100 = 1, 287 + .force_duplex_full = 1, 288 + }, 285 289 286 290 .leds = { 287 291 { 288 - .name = "adsl-fail", 289 - .gpio = 2, 290 - .active_low = 1, 292 + .name = "adsl-fail", 293 + .gpio = 2, 294 + .active_low = 1, 291 295 }, 292 296 { 293 - .name = "ppp", 294 - .gpio = 3, 295 - .active_low = 1, 297 + .name = "ppp", 298 + .gpio = 3, 299 + .active_low = 1, 296 300 }, 297 301 { 298 - .name = "ppp-fail", 299 - .gpio = 4, 300 - .active_low = 1, 302 + .name = "ppp-fail", 303 + .gpio = 4, 304 + .active_low = 1, 301 305 }, 302 306 { 303 - .name = "power", 304 - .gpio = 0, 305 - .active_low = 1, 307 + .name = "power", 308 + .gpio = 0, 309 + .active_low = 1, 306 310 .default_trigger = "default-on", 307 311 }, 308 312 { 309 - .name = "stop", 310 - .gpio = 1, 311 - .active_low = 1, 313 + .name = "stop", 314 + .gpio = 1, 315 + .active_low = 1, 312 316 }, 313 317 }, 314 318 }; 315 319 316 320 static struct board_info __initdata board_96348gw_11 = { 317 - .name = "96348GW-11", 318 - .expected_cpu_id = 0x6348, 319 - 320 - .has_uart0 = 1, 321 - .has_enet0 = 1, 322 - .has_enet1 = 1, 323 - .has_pci = 1, 324 - 325 - .enet0 = { 326 - .has_phy = 1, 327 - .use_internal_phy = 1, 328 - }, 329 - 330 - .enet1 = { 331 - .force_speed_100 = 1, 332 - .force_duplex_full = 1, 333 - }, 334 - 321 + .name = "96348GW-11", 322 + .expected_cpu_id = 0x6348, 335 323 336 324 .has_ohci0 = 1, 337 325 .has_pccard = 1, 338 - .has_ehci0 = 1, 326 + .has_pci = 1, 327 + .has_uart0 = 1, 328 + 329 + .has_enet0 = 1, 330 + .enet0 = { 331 + .has_phy = 1, 332 + .use_internal_phy = 1, 333 + }, 334 + 335 + .has_enet1 = 1, 336 + .enet1 = { 337 + .force_speed_100 = 1, 338 + .force_duplex_full = 1, 339 + }, 339 340 340 341 .leds = { 341 342 { 342 - .name = "adsl-fail", 343 - .gpio = 2, 344 - .active_low = 1, 343 + .name = "adsl-fail", 344 + .gpio = 2, 345 + .active_low = 1, 345 346 }, 346 347 { 347 - .name = "ppp", 348 - .gpio = 3, 349 - .active_low = 1, 348 + .name = "ppp", 349 + .gpio = 3, 350 + .active_low = 1, 350 351 }, 351 352 { 352 - .name = "ppp-fail", 353 - .gpio = 4, 354 - .active_low = 1, 353 + .name = "ppp-fail", 354 + .gpio = 4, 355 + .active_low = 1, 355 356 }, 356 357 { 357 - .name = "power", 358 - .gpio = 0, 359 - .active_low = 1, 358 + .name = "power", 359 + .gpio = 0, 360 + .active_low = 1, 360 361 .default_trigger = "default-on", 361 362 }, 362 363 { 363 - .name = "stop", 364 - .gpio = 1, 365 - .active_low = 1, 364 + .name = "stop", 365 + .gpio = 1, 366 + .active_low = 1, 366 367 }, 367 368 }, 368 369 }; 369 370 370 371 static struct board_info __initdata board_96348gw = { 371 - .name = "96348GW", 372 - .expected_cpu_id = 0x6348, 373 - 374 - .has_uart0 = 1, 375 - .has_enet0 = 1, 376 - .has_enet1 = 1, 377 - .has_pci = 1, 378 - 379 - .enet0 = { 380 - .has_phy = 1, 381 - .use_internal_phy = 1, 382 - }, 383 - .enet1 = { 384 - .force_speed_100 = 1, 385 - .force_duplex_full = 1, 386 - }, 372 + .name = "96348GW", 373 + .expected_cpu_id = 0x6348, 387 374 388 375 .has_ohci0 = 1, 376 + .has_pci = 1, 377 + .has_uart0 = 1, 378 + 379 + .has_enet0 = 1, 380 + .enet0 = { 381 + .has_phy = 1, 382 + .use_internal_phy = 1, 383 + }, 384 + 385 + .has_enet1 = 1, 386 + .enet1 = { 387 + .force_speed_100 = 1, 388 + .force_duplex_full = 1, 389 + }, 389 390 390 391 .leds = { 391 392 { 392 - .name = "adsl-fail", 393 - .gpio = 2, 394 - .active_low = 1, 393 + .name = "adsl-fail", 394 + .gpio = 2, 395 + .active_low = 1, 395 396 }, 396 397 { 397 - .name = "ppp", 398 - .gpio = 3, 399 - .active_low = 1, 398 + .name = "ppp", 399 + .gpio = 3, 400 + .active_low = 1, 400 401 }, 401 402 { 402 - .name = "ppp-fail", 403 - .gpio = 4, 404 - .active_low = 1, 403 + .name = "ppp-fail", 404 + .gpio = 4, 405 + .active_low = 1, 405 406 }, 406 407 { 407 - .name = "power", 408 - .gpio = 0, 409 - .active_low = 1, 408 + .name = "power", 409 + .gpio = 0, 410 + .active_low = 1, 410 411 .default_trigger = "default-on", 411 412 }, 412 413 { 413 - .name = "stop", 414 - .gpio = 1, 415 - .active_low = 1, 414 + .name = "stop", 415 + .gpio = 1, 416 + .active_low = 1, 416 417 }, 417 418 }, 418 419 }; 419 420 420 421 static struct board_info __initdata board_FAST2404 = { 421 - .name = "F@ST2404", 422 - .expected_cpu_id = 0x6348, 422 + .name = "F@ST2404", 423 + .expected_cpu_id = 0x6348, 423 424 424 - .has_uart0 = 1, 425 - .has_enet0 = 1, 426 - .has_enet1 = 1, 427 - .has_pci = 1, 425 + .has_ohci0 = 1, 426 + .has_pccard = 1, 427 + .has_pci = 1, 428 + .has_uart0 = 1, 428 429 430 + .has_enet0 = 1, 429 431 .enet0 = { 430 - .has_phy = 1, 431 - .use_internal_phy = 1, 432 + .has_phy = 1, 433 + .use_internal_phy = 1, 432 434 }, 433 435 436 + .has_enet1 = 1, 434 437 .enet1 = { 435 - .force_speed_100 = 1, 436 - .force_duplex_full = 1, 438 + .force_speed_100 = 1, 439 + .force_duplex_full = 1, 437 440 }, 438 - 439 - .has_ohci0 = 1, 440 - .has_pccard = 1, 441 - .has_ehci0 = 1, 442 441 }; 443 442 444 443 static struct board_info __initdata board_rta1025w_16 = { 445 - .name = "RTA1025W_16", 446 - .expected_cpu_id = 0x6348, 444 + .name = "RTA1025W_16", 445 + .expected_cpu_id = 0x6348, 447 446 448 - .has_enet0 = 1, 449 - .has_enet1 = 1, 450 - .has_pci = 1, 447 + .has_pci = 1, 451 448 449 + .has_enet0 = 1, 452 450 .enet0 = { 453 - .has_phy = 1, 454 - .use_internal_phy = 1, 451 + .has_phy = 1, 452 + .use_internal_phy = 1, 455 453 }, 454 + 455 + .has_enet1 = 1, 456 456 .enet1 = { 457 - .force_speed_100 = 1, 458 - .force_duplex_full = 1, 457 + .force_speed_100 = 1, 458 + .force_duplex_full = 1, 459 459 }, 460 460 }; 461 461 462 462 static struct board_info __initdata board_DV201AMR = { 463 - .name = "DV201AMR", 464 - .expected_cpu_id = 0x6348, 463 + .name = "DV201AMR", 464 + .expected_cpu_id = 0x6348, 465 465 466 - .has_uart0 = 1, 467 - .has_pci = 1, 468 - .has_ohci0 = 1, 466 + .has_ohci0 = 1, 467 + .has_pci = 1, 468 + .has_uart0 = 1, 469 469 470 - .has_enet0 = 1, 471 - .has_enet1 = 1, 470 + .has_enet0 = 1, 472 471 .enet0 = { 473 - .has_phy = 1, 474 - .use_internal_phy = 1, 472 + .has_phy = 1, 473 + .use_internal_phy = 1, 475 474 }, 475 + 476 + .has_enet1 = 1, 476 477 .enet1 = { 477 - .force_speed_100 = 1, 478 - .force_duplex_full = 1, 478 + .force_speed_100 = 1, 479 + .force_duplex_full = 1, 479 480 }, 480 481 }; 481 482 482 483 static struct board_info __initdata board_96348gw_a = { 483 - .name = "96348GW-A", 484 - .expected_cpu_id = 0x6348, 485 - 486 - .has_uart0 = 1, 487 - .has_enet0 = 1, 488 - .has_enet1 = 1, 489 - .has_pci = 1, 490 - 491 - .enet0 = { 492 - .has_phy = 1, 493 - .use_internal_phy = 1, 494 - }, 495 - .enet1 = { 496 - .force_speed_100 = 1, 497 - .force_duplex_full = 1, 498 - }, 484 + .name = "96348GW-A", 485 + .expected_cpu_id = 0x6348, 499 486 500 487 .has_ohci0 = 1, 488 + .has_pci = 1, 489 + .has_uart0 = 1, 490 + 491 + .has_enet0 = 1, 492 + .enet0 = { 493 + .has_phy = 1, 494 + .use_internal_phy = 1, 495 + }, 496 + 497 + .has_enet1 = 1, 498 + .enet1 = { 499 + .force_speed_100 = 1, 500 + .force_duplex_full = 1, 501 + }, 501 502 }; 502 503 #endif /* CONFIG_BCM63XX_CPU_6348 */ 503 504 ··· 502 511 */ 503 512 #ifdef CONFIG_BCM63XX_CPU_6358 504 513 static struct board_info __initdata board_96358vw = { 505 - .name = "96358VW", 506 - .expected_cpu_id = 0x6358, 514 + .name = "96358VW", 515 + .expected_cpu_id = 0x6358, 507 516 508 - .has_uart0 = 1, 509 - .has_enet0 = 1, 510 - .has_enet1 = 1, 511 - .has_pci = 1, 512 - 513 - .enet0 = { 514 - .has_phy = 1, 515 - .use_internal_phy = 1, 516 - }, 517 - 518 - .enet1 = { 519 - .force_speed_100 = 1, 520 - .force_duplex_full = 1, 521 - }, 522 - 517 + .has_ehci0 = 1, 523 518 .has_ohci0 = 1, 524 519 .has_pccard = 1, 525 - .has_ehci0 = 1, 520 + .has_pci = 1, 521 + .has_uart0 = 1, 522 + 523 + .has_enet0 = 1, 524 + .enet0 = { 525 + .has_phy = 1, 526 + .use_internal_phy = 1, 527 + }, 528 + 529 + .has_enet1 = 1, 530 + .enet1 = { 531 + .force_speed_100 = 1, 532 + .force_duplex_full = 1, 533 + }, 526 534 527 535 .leds = { 528 536 { 529 - .name = "adsl-fail", 530 - .gpio = 15, 531 - .active_low = 1, 537 + .name = "adsl-fail", 538 + .gpio = 15, 539 + .active_low = 1, 532 540 }, 533 541 { 534 - .name = "ppp", 535 - .gpio = 22, 536 - .active_low = 1, 542 + .name = "ppp", 543 + .gpio = 22, 544 + .active_low = 1, 537 545 }, 538 546 { 539 - .name = "ppp-fail", 540 - .gpio = 23, 541 - .active_low = 1, 547 + .name = "ppp-fail", 548 + .gpio = 23, 549 + .active_low = 1, 542 550 }, 543 551 { 544 - .name = "power", 545 - .gpio = 4, 552 + .name = "power", 553 + .gpio = 4, 546 554 .default_trigger = "default-on", 547 555 }, 548 556 { 549 - .name = "stop", 550 - .gpio = 5, 557 + .name = "stop", 558 + .gpio = 5, 551 559 }, 552 560 }, 553 561 }; 554 562 555 563 static struct board_info __initdata board_96358vw2 = { 556 - .name = "96358VW2", 557 - .expected_cpu_id = 0x6358, 564 + .name = "96358VW2", 565 + .expected_cpu_id = 0x6358, 558 566 559 - .has_uart0 = 1, 560 - .has_enet0 = 1, 561 - .has_enet1 = 1, 562 - .has_pci = 1, 563 - 564 - .enet0 = { 565 - .has_phy = 1, 566 - .use_internal_phy = 1, 567 - }, 568 - 569 - .enet1 = { 570 - .force_speed_100 = 1, 571 - .force_duplex_full = 1, 572 - }, 573 - 574 - 567 + .has_ehci0 = 1, 575 568 .has_ohci0 = 1, 576 569 .has_pccard = 1, 577 - .has_ehci0 = 1, 570 + .has_pci = 1, 571 + .has_uart0 = 1, 572 + 573 + .has_enet0 = 1, 574 + .enet0 = { 575 + .has_phy = 1, 576 + .use_internal_phy = 1, 577 + }, 578 + 579 + .has_enet1 = 1, 580 + .enet1 = { 581 + .force_speed_100 = 1, 582 + .force_duplex_full = 1, 583 + }, 578 584 579 585 .leds = { 580 586 { 581 - .name = "adsl", 582 - .gpio = 22, 583 - .active_low = 1, 587 + .name = "adsl", 588 + .gpio = 22, 589 + .active_low = 1, 584 590 }, 585 591 { 586 - .name = "ppp-fail", 587 - .gpio = 23, 592 + .name = "ppp-fail", 593 + .gpio = 23, 588 594 }, 589 595 { 590 - .name = "power", 591 - .gpio = 5, 592 - .active_low = 1, 596 + .name = "power", 597 + .gpio = 5, 598 + .active_low = 1, 593 599 .default_trigger = "default-on", 594 600 }, 595 601 { 596 - .name = "stop", 597 - .gpio = 4, 598 - .active_low = 1, 602 + .name = "stop", 603 + .gpio = 4, 604 + .active_low = 1, 599 605 }, 600 606 }, 601 607 }; 602 608 603 609 static struct board_info __initdata board_AGPFS0 = { 604 - .name = "AGPF-S0", 605 - .expected_cpu_id = 0x6358, 610 + .name = "AGPF-S0", 611 + .expected_cpu_id = 0x6358, 606 612 607 - .has_uart0 = 1, 608 - .has_enet0 = 1, 609 - .has_enet1 = 1, 610 - .has_pci = 1, 611 - 612 - .enet0 = { 613 - .has_phy = 1, 614 - .use_internal_phy = 1, 615 - }, 616 - 617 - .enet1 = { 618 - .force_speed_100 = 1, 619 - .force_duplex_full = 1, 620 - }, 621 - 622 - .has_ohci0 = 1, 623 613 .has_ehci0 = 1, 614 + .has_ohci0 = 1, 615 + .has_pci = 1, 616 + .has_uart0 = 1, 617 + 618 + .has_enet0 = 1, 619 + .enet0 = { 620 + .has_phy = 1, 621 + .use_internal_phy = 1, 622 + }, 623 + 624 + .has_enet1 = 1, 625 + .enet1 = { 626 + .force_speed_100 = 1, 627 + .force_duplex_full = 1, 628 + }, 624 629 }; 625 630 626 631 static struct board_info __initdata board_DWVS0 = { 627 - .name = "DWV-S0", 628 - .expected_cpu_id = 0x6358, 632 + .name = "DWV-S0", 633 + .expected_cpu_id = 0x6358, 629 634 630 - .has_enet0 = 1, 631 - .has_enet1 = 1, 632 - .has_pci = 1, 635 + .has_ehci0 = 1, 636 + .has_ohci0 = 1, 637 + .has_pci = 1, 633 638 639 + .has_enet0 = 1, 634 640 .enet0 = { 635 - .has_phy = 1, 636 - .use_internal_phy = 1, 641 + .has_phy = 1, 642 + .use_internal_phy = 1, 637 643 }, 638 644 645 + .has_enet1 = 1, 639 646 .enet1 = { 640 - .force_speed_100 = 1, 641 - .force_duplex_full = 1, 647 + .force_speed_100 = 1, 648 + .force_duplex_full = 1, 642 649 }, 643 - 644 - .has_ohci0 = 1, 645 650 }; 646 651 #endif /* CONFIG_BCM63XX_CPU_6358 */ 647 652
+1 -1
arch/mips/bcm63xx/setup.c
··· 146 146 147 147 void __init plat_mem_setup(void) 148 148 { 149 - add_memory_region(0, bcm63xx_get_memory_size(), BOOT_MEM_RAM); 149 + memblock_add(0, bcm63xx_get_memory_size()); 150 150 151 151 _machine_halt = bcm63xx_machine_halt; 152 152 _machine_restart = __bcm63xx_machine_reboot;
+7 -1
arch/mips/boot/compressed/Makefile
··· 22 22 23 23 KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS)) 24 24 25 - KBUILD_CFLAGS := $(KBUILD_CFLAGS) -D__KERNEL__ \ 25 + # Disable lq/sq in zboot 26 + ifdef CONFIG_CPU_LOONGSON64 27 + KBUILD_CFLAGS := $(filter-out -march=loongson3a, $(KBUILD_CFLAGS)) -march=mips64r2 28 + endif 29 + 30 + KBUILD_CFLAGS := $(KBUILD_CFLAGS) -D__KERNEL__ -D__DISABLE_EXPORTS \ 26 31 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" 27 32 28 33 KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ ··· 75 70 tool_$(CONFIG_KERNEL_LZMA) = lzma 76 71 tool_$(CONFIG_KERNEL_LZO) = lzo 77 72 tool_$(CONFIG_KERNEL_XZ) = xzkern 73 + tool_$(CONFIG_KERNEL_ZSTD) = zstd22 78 74 79 75 targets += vmlinux.bin.z 80 76 $(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE
+4
arch/mips/boot/compressed/decompress.c
··· 72 72 #include "../../../../lib/decompress_unxz.c" 73 73 #endif 74 74 75 + #ifdef CONFIG_KERNEL_ZSTD 76 + #include "../../../../lib/decompress_unzstd.c" 77 + #endif 78 + 75 79 const unsigned long __stack_chk_guard = 0x000a0dff; 76 80 77 81 void __stack_chk_fail(void)
+17
arch/mips/boot/compressed/string.c
··· 5 5 * Very small subset of simple string routines 6 6 */ 7 7 8 + #include <linux/compiler_attributes.h> 8 9 #include <linux/types.h> 9 10 10 11 void *memcpy(void *dest, const void *src, size_t n) ··· 27 26 for (i = 0; i < n; i++) 28 27 ss[i] = c; 29 28 return s; 29 + } 30 + 31 + void * __weak memmove(void *dest, const void *src, size_t n) 32 + { 33 + unsigned int i; 34 + const char *s = src; 35 + char *d = dest; 36 + 37 + if ((uintptr_t)dest < (uintptr_t)src) { 38 + for (i = 0; i < n; i++) 39 + d[i] = s[i]; 40 + } else { 41 + for (i = n; i > 0; i--) 42 + d[i - 1] = s[i - 1]; 43 + } 44 + return dest; 30 45 }
+14
arch/mips/boot/dts/ingenic/jz4725b.dtsi
··· 7 7 #size-cells = <1>; 8 8 compatible = "ingenic,jz4725b"; 9 9 10 + cpus { 11 + #address-cells = <1>; 12 + #size-cells = <0>; 13 + 14 + cpu0: cpu@0 { 15 + device_type = "cpu"; 16 + compatible = "ingenic,xburst-mxu1.0"; 17 + reg = <0>; 18 + 19 + clocks = <&cgu JZ4725B_CLK_CCLK>; 20 + clock-names = "cpu"; 21 + }; 22 + }; 23 + 10 24 cpuintc: interrupt-controller { 11 25 #address-cells = <0>; 12 26 #interrupt-cells = <1>;
+14
arch/mips/boot/dts/ingenic/jz4740.dtsi
··· 7 7 #size-cells = <1>; 8 8 compatible = "ingenic,jz4740"; 9 9 10 + cpus { 11 + #address-cells = <1>; 12 + #size-cells = <0>; 13 + 14 + cpu0: cpu@0 { 15 + device_type = "cpu"; 16 + compatible = "ingenic,xburst-mxu1.0"; 17 + reg = <0>; 18 + 19 + clocks = <&cgu JZ4740_CLK_CCLK>; 20 + clock-names = "cpu"; 21 + }; 22 + }; 23 + 10 24 cpuintc: interrupt-controller { 11 25 #address-cells = <0>; 12 26 #interrupt-cells = <1>;
+14 -1
arch/mips/boot/dts/ingenic/jz4770.dtsi
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - 3 2 #include <dt-bindings/clock/jz4770-cgu.h> 4 3 #include <dt-bindings/clock/ingenic,tcu.h> 5 4 ··· 6 7 #address-cells = <1>; 7 8 #size-cells = <1>; 8 9 compatible = "ingenic,jz4770"; 10 + 11 + cpus { 12 + #address-cells = <1>; 13 + #size-cells = <0>; 14 + 15 + cpu0: cpu@0 { 16 + device_type = "cpu"; 17 + compatible = "ingenic,xburst-fpu1.0-mxu1.1"; 18 + reg = <0>; 19 + 20 + clocks = <&cgu JZ4770_CLK_CCLK>; 21 + clock-names = "cpu"; 22 + }; 23 + }; 9 24 10 25 cpuintc: interrupt-controller { 11 26 #address-cells = <0>;
+23
arch/mips/boot/dts/ingenic/jz4780.dtsi
··· 8 8 #size-cells = <1>; 9 9 compatible = "ingenic,jz4780"; 10 10 11 + cpus { 12 + #address-cells = <1>; 13 + #size-cells = <0>; 14 + 15 + cpu0: cpu@0 { 16 + device_type = "cpu"; 17 + compatible = "ingenic,xburst-fpu1.0-mxu1.1"; 18 + reg = <0>; 19 + 20 + clocks = <&cgu JZ4780_CLK_CPU>; 21 + clock-names = "cpu"; 22 + }; 23 + 24 + cpu1: cpu@1 { 25 + device_type = "cpu"; 26 + compatible = "ingenic,xburst-fpu1.0-mxu1.1"; 27 + reg = <1>; 28 + 29 + clocks = <&cgu JZ4780_CLK_CORE1>; 30 + clock-names = "cpu"; 31 + }; 32 + }; 33 + 11 34 cpuintc: interrupt-controller { 12 35 #address-cells = <0>; 13 36 #interrupt-cells = <1>;
+66 -67
arch/mips/boot/dts/ingenic/qi_lb60.dts
··· 109 109 debounce-delay-ms = <10>; 110 110 wakeup-source; 111 111 112 - row-gpios = <&gpd 18 0 &gpd 19 0 &gpd 20 0 &gpd 21 0 113 - &gpd 22 0 &gpd 23 0 &gpd 24 0 &gpd 26 0>; 114 - col-gpios = <&gpc 10 0 &gpc 11 0 &gpc 12 0 &gpc 13 0 115 - &gpc 14 0 &gpc 15 0 &gpc 16 0 &gpc 17 0>; 112 + row-gpios = <&gpd 18 0>, <&gpd 19 0>, <&gpd 20 0>, <&gpd 21 0>, 113 + <&gpd 22 0>, <&gpd 23 0>, <&gpd 24 0>, <&gpd 26 0>; 114 + col-gpios = <&gpc 10 0>, <&gpc 11 0>, <&gpc 12 0>, <&gpc 13 0>, 115 + <&gpc 14 0>, <&gpc 15 0>, <&gpc 16 0>, <&gpc 17 0>; 116 116 gpio-activelow; 117 117 118 - linux,keymap = < 119 - MATRIX_KEY(0, 0, KEY_F1) /* S2 */ 120 - MATRIX_KEY(0, 1, KEY_F2) /* S3 */ 121 - MATRIX_KEY(0, 2, KEY_F3) /* S4 */ 122 - MATRIX_KEY(0, 3, KEY_F4) /* S5 */ 123 - MATRIX_KEY(0, 4, KEY_F5) /* S6 */ 124 - MATRIX_KEY(0, 5, KEY_F6) /* S7 */ 125 - MATRIX_KEY(0, 6, KEY_F7) /* S8 */ 118 + linux,keymap = 119 + <MATRIX_KEY(0, 0, KEY_F1)>, /* S2 */ 120 + <MATRIX_KEY(0, 1, KEY_F2)>, /* S3 */ 121 + <MATRIX_KEY(0, 2, KEY_F3)>, /* S4 */ 122 + <MATRIX_KEY(0, 3, KEY_F4)>, /* S5 */ 123 + <MATRIX_KEY(0, 4, KEY_F5)>, /* S6 */ 124 + <MATRIX_KEY(0, 5, KEY_F6)>, /* S7 */ 125 + <MATRIX_KEY(0, 6, KEY_F7)>, /* S8 */ 126 126 127 - MATRIX_KEY(1, 0, KEY_Q) /* S10 */ 128 - MATRIX_KEY(1, 1, KEY_W) /* S11 */ 129 - MATRIX_KEY(1, 2, KEY_E) /* S12 */ 130 - MATRIX_KEY(1, 3, KEY_R) /* S13 */ 131 - MATRIX_KEY(1, 4, KEY_T) /* S14 */ 132 - MATRIX_KEY(1, 5, KEY_Y) /* S15 */ 133 - MATRIX_KEY(1, 6, KEY_U) /* S16 */ 134 - MATRIX_KEY(1, 7, KEY_I) /* S17 */ 135 - MATRIX_KEY(2, 0, KEY_A) /* S18 */ 136 - MATRIX_KEY(2, 1, KEY_S) /* S19 */ 137 - MATRIX_KEY(2, 2, KEY_D) /* S20 */ 138 - MATRIX_KEY(2, 3, KEY_F) /* S21 */ 139 - MATRIX_KEY(2, 4, KEY_G) /* S22 */ 140 - MATRIX_KEY(2, 5, KEY_H) /* S23 */ 141 - MATRIX_KEY(2, 6, KEY_J) /* S24 */ 142 - MATRIX_KEY(2, 7, KEY_K) /* S25 */ 143 - MATRIX_KEY(3, 0, KEY_ESC) /* S26 */ 144 - MATRIX_KEY(3, 1, KEY_Z) /* S27 */ 145 - MATRIX_KEY(3, 2, KEY_X) /* S28 */ 146 - MATRIX_KEY(3, 3, KEY_C) /* S29 */ 147 - MATRIX_KEY(3, 4, KEY_V) /* S30 */ 148 - MATRIX_KEY(3, 5, KEY_B) /* S31 */ 149 - MATRIX_KEY(3, 6, KEY_N) /* S32 */ 150 - MATRIX_KEY(3, 7, KEY_M) /* S33 */ 151 - MATRIX_KEY(4, 0, KEY_TAB) /* S34 */ 152 - MATRIX_KEY(4, 1, KEY_CAPSLOCK) /* S35 */ 153 - MATRIX_KEY(4, 2, KEY_BACKSLASH) /* S36 */ 154 - MATRIX_KEY(4, 3, KEY_APOSTROPHE) /* S37 */ 155 - MATRIX_KEY(4, 4, KEY_COMMA) /* S38 */ 156 - MATRIX_KEY(4, 5, KEY_DOT) /* S39 */ 157 - MATRIX_KEY(4, 6, KEY_SLASH) /* S40 */ 158 - MATRIX_KEY(4, 7, KEY_UP) /* S41 */ 159 - MATRIX_KEY(5, 0, KEY_O) /* S42 */ 160 - MATRIX_KEY(5, 1, KEY_L) /* S43 */ 161 - MATRIX_KEY(5, 2, KEY_EQUAL) /* S44 */ 162 - MATRIX_KEY(5, 3, KEY_QI_UPRED) /* S45 */ 163 - MATRIX_KEY(5, 4, KEY_SPACE) /* S46 */ 164 - MATRIX_KEY(5, 5, KEY_QI_QI) /* S47 */ 165 - MATRIX_KEY(5, 6, KEY_RIGHTCTRL) /* S48 */ 166 - MATRIX_KEY(5, 7, KEY_LEFT) /* S49 */ 167 - MATRIX_KEY(6, 0, KEY_F8) /* S50 */ 168 - MATRIX_KEY(6, 1, KEY_P) /* S51 */ 169 - MATRIX_KEY(6, 2, KEY_BACKSPACE)/* S52 */ 170 - MATRIX_KEY(6, 3, KEY_ENTER) /* S53 */ 171 - MATRIX_KEY(6, 4, KEY_QI_VOLUP) /* S54 */ 172 - MATRIX_KEY(6, 5, KEY_QI_VOLDOWN) /* S55 */ 173 - MATRIX_KEY(6, 6, KEY_DOWN) /* S56 */ 174 - MATRIX_KEY(6, 7, KEY_RIGHT) /* S57 */ 127 + <MATRIX_KEY(1, 0, KEY_Q)>, /* S10 */ 128 + <MATRIX_KEY(1, 1, KEY_W)>, /* S11 */ 129 + <MATRIX_KEY(1, 2, KEY_E)>, /* S12 */ 130 + <MATRIX_KEY(1, 3, KEY_R)>, /* S13 */ 131 + <MATRIX_KEY(1, 4, KEY_T)>, /* S14 */ 132 + <MATRIX_KEY(1, 5, KEY_Y)>, /* S15 */ 133 + <MATRIX_KEY(1, 6, KEY_U)>, /* S16 */ 134 + <MATRIX_KEY(1, 7, KEY_I)>, /* S17 */ 135 + <MATRIX_KEY(2, 0, KEY_A)>, /* S18 */ 136 + <MATRIX_KEY(2, 1, KEY_S)>, /* S19 */ 137 + <MATRIX_KEY(2, 2, KEY_D)>, /* S20 */ 138 + <MATRIX_KEY(2, 3, KEY_F)>, /* S21 */ 139 + <MATRIX_KEY(2, 4, KEY_G)>, /* S22 */ 140 + <MATRIX_KEY(2, 5, KEY_H)>, /* S23 */ 141 + <MATRIX_KEY(2, 6, KEY_J)>, /* S24 */ 142 + <MATRIX_KEY(2, 7, KEY_K)>, /* S25 */ 143 + <MATRIX_KEY(3, 0, KEY_ESC)>, /* S26 */ 144 + <MATRIX_KEY(3, 1, KEY_Z)>, /* S27 */ 145 + <MATRIX_KEY(3, 2, KEY_X)>, /* S28 */ 146 + <MATRIX_KEY(3, 3, KEY_C)>, /* S29 */ 147 + <MATRIX_KEY(3, 4, KEY_V)>, /* S30 */ 148 + <MATRIX_KEY(3, 5, KEY_B)>, /* S31 */ 149 + <MATRIX_KEY(3, 6, KEY_N)>, /* S32 */ 150 + <MATRIX_KEY(3, 7, KEY_M)>, /* S33 */ 151 + <MATRIX_KEY(4, 0, KEY_TAB)>, /* S34 */ 152 + <MATRIX_KEY(4, 1, KEY_CAPSLOCK)>, /* S35 */ 153 + <MATRIX_KEY(4, 2, KEY_BACKSLASH)>, /* S36 */ 154 + <MATRIX_KEY(4, 3, KEY_APOSTROPHE)>, /* S37 */ 155 + <MATRIX_KEY(4, 4, KEY_COMMA)>, /* S38 */ 156 + <MATRIX_KEY(4, 5, KEY_DOT)>, /* S39 */ 157 + <MATRIX_KEY(4, 6, KEY_SLASH)>, /* S40 */ 158 + <MATRIX_KEY(4, 7, KEY_UP)>, /* S41 */ 159 + <MATRIX_KEY(5, 0, KEY_O)>, /* S42 */ 160 + <MATRIX_KEY(5, 1, KEY_L)>, /* S43 */ 161 + <MATRIX_KEY(5, 2, KEY_EQUAL)>, /* S44 */ 162 + <MATRIX_KEY(5, 3, KEY_QI_UPRED)>, /* S45 */ 163 + <MATRIX_KEY(5, 4, KEY_SPACE)>, /* S46 */ 164 + <MATRIX_KEY(5, 5, KEY_QI_QI)>, /* S47 */ 165 + <MATRIX_KEY(5, 6, KEY_RIGHTCTRL)>, /* S48 */ 166 + <MATRIX_KEY(5, 7, KEY_LEFT)>, /* S49 */ 167 + <MATRIX_KEY(6, 0, KEY_F8)>, /* S50 */ 168 + <MATRIX_KEY(6, 1, KEY_P)>, /* S51 */ 169 + <MATRIX_KEY(6, 2, KEY_BACKSPACE)>,/* S52 */ 170 + <MATRIX_KEY(6, 3, KEY_ENTER)>, /* S53 */ 171 + <MATRIX_KEY(6, 4, KEY_QI_VOLUP)>, /* S54 */ 172 + <MATRIX_KEY(6, 5, KEY_QI_VOLDOWN)>, /* S55 */ 173 + <MATRIX_KEY(6, 6, KEY_DOWN)>, /* S56 */ 174 + <MATRIX_KEY(6, 7, KEY_RIGHT)>, /* S57 */ 175 175 176 - MATRIX_KEY(7, 0, KEY_LEFTSHIFT) /* S58 */ 177 - MATRIX_KEY(7, 1, KEY_LEFTALT) /* S59 */ 178 - MATRIX_KEY(7, 2, KEY_QI_FN) /* S60 */ 179 - >; 176 + <MATRIX_KEY(7, 0, KEY_LEFTSHIFT)>, /* S58 */ 177 + <MATRIX_KEY(7, 1, KEY_LEFTALT)>, /* S59 */ 178 + <MATRIX_KEY(7, 2, KEY_QI_FN)>; /* S60 */ 180 179 }; 181 180 182 181 spi { ··· 260 261 #address-cells = <1>; 261 262 #size-cells = <0>; 262 263 263 - ingenic,bch-controller = <&ecc>; 264 + ecc-engine = <&ecc>; 264 265 265 266 pinctrl-names = "default"; 266 267 pinctrl-0 = <&pins_nemc>; 267 268 268 - rb-gpios = <&gpc 30 GPIO_ACTIVE_LOW>; 269 + rb-gpios = <&gpc 30 GPIO_ACTIVE_HIGH>; 269 270 270 271 nand@1 { 271 272 reg = <1>; ··· 323 324 324 325 pins_nemc: nemc { 325 326 function = "nand"; 326 - groups = "nand-cs1"; 327 + groups = "nand-fre-fwe", "nand-cs1"; 327 328 }; 328 329 329 330 pins_uart0: uart0 {
+14
arch/mips/boot/dts/ingenic/x1000.dtsi
··· 8 8 #size-cells = <1>; 9 9 compatible = "ingenic,x1000", "ingenic,x1000e"; 10 10 11 + cpus { 12 + #address-cells = <1>; 13 + #size-cells = <0>; 14 + 15 + cpu0: cpu@0 { 16 + device_type = "cpu"; 17 + compatible = "ingenic,xburst-fpu1.0-mxu1.1"; 18 + reg = <0>; 19 + 20 + clocks = <&cgu X1000_CLK_CPU>; 21 + clock-names = "cpu"; 22 + }; 23 + }; 24 + 11 25 cpuintc: interrupt-controller { 12 26 #address-cells = <0>; 13 27 #interrupt-cells = <1>;
+14
arch/mips/boot/dts/ingenic/x1830.dtsi
··· 8 8 #size-cells = <1>; 9 9 compatible = "ingenic,x1830"; 10 10 11 + cpus { 12 + #address-cells = <1>; 13 + #size-cells = <0>; 14 + 15 + cpu0: cpu@0 { 16 + device_type = "cpu"; 17 + compatible = "ingenic,xburst-fpu2.0-mxu2.0"; 18 + reg = <0>; 19 + 20 + clocks = <&cgu X1830_CLK_CPU>; 21 + clock-names = "cpu"; 22 + }; 23 + }; 24 + 11 25 cpuintc: interrupt-controller { 12 26 #address-cells = <0>; 13 27 #interrupt-cells = <1>;
+39
arch/mips/boot/dts/loongson/ls7a-pch.dtsi
··· 19 19 #interrupt-cells = <2>; 20 20 }; 21 21 22 + ls7a_uart0: serial@10080000 { 23 + compatible = "ns16550a"; 24 + reg = <0 0x10080000 0 0x100>; 25 + clock-frequency = <50000000>; 26 + interrupt-parent = <&pic>; 27 + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; 28 + no-loopback-test; 29 + }; 30 + 31 + ls7a_uart1: serial@10080100 { 32 + status = "disabled"; 33 + compatible = "ns16550a"; 34 + reg = <0 0x10080100 0 0x100>; 35 + clock-frequency = <50000000>; 36 + interrupt-parent = <&pic>; 37 + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; 38 + no-loopback-test; 39 + }; 40 + 41 + ls7a_uart2: serial@10080200 { 42 + status = "disabled"; 43 + compatible = "ns16550a"; 44 + reg = <0 0x10080200 0 0x100>; 45 + clock-frequency = <50000000>; 46 + interrupt-parent = <&pic>; 47 + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; 48 + no-loopback-test; 49 + }; 50 + 51 + ls7a_uart3: serial@10080300 { 52 + status = "disabled"; 53 + compatible = "ns16550a"; 54 + reg = <0 0x10080300 0 0x100>; 55 + clock-frequency = <50000000>; 56 + interrupt-parent = <&pic>; 57 + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; 58 + no-loopback-test; 59 + }; 60 + 22 61 pci@1a000000 { 23 62 compatible = "loongson,ls7a-pci"; 24 63 device_type = "pci";
+11 -15
arch/mips/cavium-octeon/setup.c
··· 16 16 #include <linux/export.h> 17 17 #include <linux/interrupt.h> 18 18 #include <linux/io.h> 19 + #include <linux/memblock.h> 19 20 #include <linux/serial.h> 20 21 #include <linux/smp.h> 21 22 #include <linux/types.h> ··· 931 930 { 932 931 if (addr > *mem && addr < *mem + *size) { 933 932 u64 inc = addr - *mem; 934 - add_memory_region(*mem, inc, BOOT_MEM_RAM); 933 + memblock_add(*mem, inc); 935 934 *mem += inc; 936 935 *size -= inc; 937 936 } ··· 993 992 994 993 /* Crashkernel ignores bootmem list. It relies on mem=X@Y option */ 995 994 #ifdef CONFIG_CRASH_DUMP 996 - add_memory_region(reserve_low_mem, max_memory, BOOT_MEM_RAM); 995 + memblock_add(reserve_low_mem, max_memory); 997 996 total += max_memory; 998 997 #else 999 998 #ifdef CONFIG_KEXEC 1000 999 if (crashk_size > 0) { 1001 - add_memory_region(crashk_base, crashk_size, BOOT_MEM_RAM); 1000 + memblock_add(crashk_base, crashk_size); 1002 1001 crashk_end = crashk_base + crashk_size; 1003 1002 } 1004 1003 #endif 1005 1004 /* 1006 - * When allocating memory, we want incrementing addresses from 1007 - * bootmem_alloc so the code in add_memory_region can merge 1008 - * regions next to each other. 1005 + * When allocating memory, we want incrementing addresses, 1006 + * which is handled by memblock 1009 1007 */ 1010 1008 cvmx_bootmem_lock(); 1011 1009 while (total < max_memory) { ··· 1039 1039 */ 1040 1040 if (memory < crashk_base && end > crashk_end) { 1041 1041 /* region is fully in */ 1042 - add_memory_region(memory, 1043 - crashk_base - memory, 1044 - BOOT_MEM_RAM); 1042 + memblock_add(memory, crashk_base - memory); 1045 1043 total += crashk_base - memory; 1046 - add_memory_region(crashk_end, 1047 - end - crashk_end, 1048 - BOOT_MEM_RAM); 1044 + memblock_add(crashk_end, end - crashk_end); 1049 1045 total += end - crashk_end; 1050 1046 continue; 1051 1047 } ··· 1069 1073 */ 1070 1074 mem_alloc_size -= end - crashk_base; 1071 1075 #endif 1072 - add_memory_region(memory, mem_alloc_size, BOOT_MEM_RAM); 1076 + memblock_add(memory, mem_alloc_size); 1073 1077 total += mem_alloc_size; 1074 1078 /* Recovering mem_alloc_size */ 1075 1079 mem_alloc_size = 4 << 20; ··· 1084 1088 1085 1089 /* Adjust for physical offset. */ 1086 1090 kernel_start &= ~0xffffffff80000000ULL; 1087 - add_memory_region(kernel_start, kernel_size, BOOT_MEM_RAM); 1091 + memblock_add(kernel_start, kernel_size); 1088 1092 #endif /* CONFIG_CRASH_DUMP */ 1089 1093 1090 1094 #ifdef CONFIG_CAVIUM_RESERVE32 ··· 1122 1126 1123 1127 void __init prom_free_prom_memory(void) 1124 1128 { 1125 - if (CAVIUM_OCTEON_DCACHE_PREFETCH_WAR) { 1129 + if (OCTEON_IS_MODEL(OCTEON_CN6XXX)) { 1126 1130 /* Check for presence of Core-14449 fix. */ 1127 1131 u32 insn; 1128 1132 u32 *foo;
+2 -1
arch/mips/cobalt/setup.c
··· 13 13 #include <linux/interrupt.h> 14 14 #include <linux/io.h> 15 15 #include <linux/ioport.h> 16 + #include <linux/memblock.h> 16 17 #include <linux/pm.h> 17 18 18 19 #include <asm/bootinfo.h> ··· 113 112 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE); 114 113 } 115 114 116 - add_memory_region(0x0, memsz, BOOT_MEM_RAM); 115 + memblock_add(0, memsz); 117 116 118 117 setup_8250_early_printk_port(CKSEG1ADDR(0x1c800000), 0, 0); 119 118 }
+2 -2
arch/mips/configs/ci20_defconfig
··· 22 22 # CONFIG_VM_EVENT_COUNTERS is not set 23 23 # CONFIG_COMPAT_BRK is not set 24 24 CONFIG_SLAB=y 25 - CONFIG_MACH_INGENIC=y 25 + CONFIG_MACH_INGENIC_SOC=y 26 26 CONFIG_JZ4780_CI20=y 27 27 CONFIG_HIGHMEM=y 28 28 CONFIG_HZ_100=y ··· 42 42 # CONFIG_IPV6 is not set 43 43 # CONFIG_WIRELESS is not set 44 44 CONFIG_DEVTMPFS=y 45 - # CONFIG_FW_LOADER is not set 45 + CONFIG_FW_LOADER=m 46 46 # CONFIG_ALLOW_DEV_COREDUMP is not set 47 47 CONFIG_MTD=y 48 48 CONFIG_MTD_RAW_NAND=y
+2 -13
arch/mips/configs/cu1000-neo_defconfig
··· 1 - CONFIG_LOCALVERSION_AUTO=y 2 - CONFIG_KERNEL_GZIP=y 3 1 CONFIG_SYSVIPC=y 4 2 CONFIG_NO_HZ_IDLE=y 5 3 CONFIG_HIGH_RES_TIMERS=y ··· 7 9 CONFIG_LOG_BUF_SHIFT=14 8 10 CONFIG_CGROUPS=y 9 11 CONFIG_MEMCG=y 10 - CONFIG_MEMCG_KMEM=y 11 12 CONFIG_CGROUP_SCHED=y 12 13 CONFIG_CGROUP_FREEZER=y 13 14 CONFIG_CGROUP_DEVICE=y ··· 19 22 # CONFIG_VM_EVENT_COUNTERS is not set 20 23 # CONFIG_COMPAT_BRK is not set 21 24 CONFIG_SLAB=y 22 - CONFIG_MACH_INGENIC=y 25 + CONFIG_MACH_INGENIC_SOC=y 23 26 CONFIG_X1000_CU1000_NEO=y 24 27 CONFIG_HIGHMEM=y 25 28 CONFIG_HZ_100=y ··· 28 31 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 29 32 # CONFIG_COMPACTION is not set 30 33 CONFIG_CMA=y 31 - CONFIG_CMA_AREAS=7 32 34 CONFIG_NET=y 33 35 CONFIG_PACKET=y 34 36 CONFIG_UNIX=y ··· 36 40 CONFIG_UEVENT_HELPER=y 37 41 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 38 42 CONFIG_DEVTMPFS=y 39 - # CONFIG_FW_LOADER is not set 40 43 # CONFIG_ALLOW_DEV_COREDUMP is not set 41 44 CONFIG_NETDEVICES=y 42 45 CONFIG_STMMAC_ETH=y 43 46 CONFIG_SMSC_PHY=y 44 47 CONFIG_BRCMFMAC=y 45 - # CONFIG_INPUT_MOUSEDEV is not set 46 48 # CONFIG_INPUT_KEYBOARD is not set 47 49 # CONFIG_INPUT_MOUSE is not set 48 50 # CONFIG_SERIO is not set 49 51 CONFIG_VT_HW_CONSOLE_BINDING=y 50 52 CONFIG_LEGACY_PTY_COUNT=2 51 - CONFIG_SERIAL_EARLYCON=y 52 53 CONFIG_SERIAL_8250=y 53 54 CONFIG_SERIAL_8250_CONSOLE=y 54 55 CONFIG_SERIAL_8250_NR_UARTS=3 ··· 59 66 CONFIG_SENSORS_ADS7828=y 60 67 CONFIG_WATCHDOG=y 61 68 CONFIG_JZ4740_WDT=y 62 - # CONFIG_LCD_CLASS_DEVICE is not set 63 - # CONFIG_BACKLIGHT_CLASS_DEVICE is not set 64 69 # CONFIG_VGA_CONSOLE is not set 65 70 # CONFIG_HID is not set 66 71 # CONFIG_USB_SUPPORT is not set ··· 73 82 CONFIG_DMADEVICES=y 74 83 CONFIG_DMA_JZ4780=y 75 84 # CONFIG_IOMMU_SUPPORT is not set 76 - CONFIG_NVMEM=y 77 - CONFIG_NVMEM_SYSFS=y 78 85 CONFIG_EXT4_FS=y 79 86 # CONFIG_DNOTIFY is not set 80 87 CONFIG_AUTOFS_FS=y ··· 97 108 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7 98 109 CONFIG_DEBUG_INFO=y 99 110 CONFIG_STRIP_ASM_SYMS=y 100 - CONFIG_DEBUG_FS=y 101 111 CONFIG_MAGIC_SYSRQ=y 112 + CONFIG_DEBUG_FS=y 102 113 CONFIG_PANIC_ON_OOPS=y 103 114 CONFIG_PANIC_TIMEOUT=10 104 115 # CONFIG_SCHED_DEBUG is not set
+2 -13
arch/mips/configs/cu1830-neo_defconfig
··· 1 - CONFIG_LOCALVERSION_AUTO=y 2 - CONFIG_KERNEL_GZIP=y 3 1 CONFIG_SYSVIPC=y 4 2 CONFIG_NO_HZ_IDLE=y 5 3 CONFIG_HIGH_RES_TIMERS=y ··· 7 9 CONFIG_LOG_BUF_SHIFT=14 8 10 CONFIG_CGROUPS=y 9 11 CONFIG_MEMCG=y 10 - CONFIG_MEMCG_KMEM=y 11 12 CONFIG_CGROUP_SCHED=y 12 13 CONFIG_CGROUP_FREEZER=y 13 14 CONFIG_CGROUP_DEVICE=y ··· 19 22 # CONFIG_VM_EVENT_COUNTERS is not set 20 23 # CONFIG_COMPAT_BRK is not set 21 24 CONFIG_SLAB=y 22 - CONFIG_MACH_INGENIC=y 25 + CONFIG_MACH_INGENIC_SOC=y 23 26 CONFIG_X1830_CU1830_NEO=y 24 27 CONFIG_HIGHMEM=y 25 28 CONFIG_HZ_100=y ··· 28 31 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 29 32 # CONFIG_COMPACTION is not set 30 33 CONFIG_CMA=y 31 - CONFIG_CMA_AREAS=7 32 34 CONFIG_NET=y 33 35 CONFIG_PACKET=y 34 36 CONFIG_UNIX=y ··· 36 40 CONFIG_UEVENT_HELPER=y 37 41 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 38 42 CONFIG_DEVTMPFS=y 39 - # CONFIG_FW_LOADER is not set 40 43 # CONFIG_ALLOW_DEV_COREDUMP is not set 41 44 CONFIG_MD=y 42 45 CONFIG_BLK_DEV_MD=y ··· 44 49 CONFIG_STMMAC_ETH=y 45 50 CONFIG_ICPLUS_PHY=y 46 51 CONFIG_BRCMFMAC=y 47 - # CONFIG_INPUT_MOUSEDEV is not set 48 52 # CONFIG_INPUT_KEYBOARD is not set 49 53 # CONFIG_INPUT_MOUSE is not set 50 54 # CONFIG_SERIO is not set 51 55 CONFIG_VT_HW_CONSOLE_BINDING=y 52 56 CONFIG_LEGACY_PTY_COUNT=2 53 - CONFIG_SERIAL_EARLYCON=y 54 57 CONFIG_SERIAL_8250=y 55 58 CONFIG_SERIAL_8250_CONSOLE=y 56 59 CONFIG_SERIAL_8250_NR_UARTS=2 ··· 62 69 CONFIG_SENSORS_ADS7828=y 63 70 CONFIG_WATCHDOG=y 64 71 CONFIG_JZ4740_WDT=y 65 - # CONFIG_LCD_CLASS_DEVICE is not set 66 - # CONFIG_BACKLIGHT_CLASS_DEVICE is not set 67 72 # CONFIG_VGA_CONSOLE is not set 68 73 # CONFIG_HID is not set 69 74 # CONFIG_USB_SUPPORT is not set ··· 76 85 CONFIG_DMADEVICES=y 77 86 CONFIG_DMA_JZ4780=y 78 87 # CONFIG_IOMMU_SUPPORT is not set 79 - CONFIG_NVMEM=y 80 - CONFIG_NVMEM_SYSFS=y 81 88 CONFIG_EXT4_FS=y 82 89 # CONFIG_DNOTIFY is not set 83 90 CONFIG_AUTOFS_FS=y ··· 100 111 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7 101 112 CONFIG_DEBUG_INFO=y 102 113 CONFIG_STRIP_ASM_SYMS=y 103 - CONFIG_DEBUG_FS=y 104 114 CONFIG_MAGIC_SYSRQ=y 115 + CONFIG_DEBUG_FS=y 105 116 CONFIG_PANIC_ON_OOPS=y 106 117 CONFIG_PANIC_TIMEOUT=10 107 118 # CONFIG_SCHED_DEBUG is not set
+1 -1
arch/mips/configs/gcw0_defconfig
··· 4 4 CONFIG_PREEMPT_VOLUNTARY=y 5 5 CONFIG_EMBEDDED=y 6 6 CONFIG_PROFILING=y 7 - CONFIG_MACH_INGENIC=y 7 + CONFIG_MACH_INGENIC_SOC=y 8 8 CONFIG_JZ4770_GCW0=y 9 9 CONFIG_HIGHMEM=y 10 10 # CONFIG_SECCOMP is not set
-2
arch/mips/configs/loongson3_defconfig
··· 30 30 CONFIG_PERF_EVENTS=y 31 31 CONFIG_MACH_LOONGSON64=y 32 32 CONFIG_CPU_HAS_MSA=y 33 - CONFIG_SMP=y 34 33 CONFIG_NR_CPUS=16 35 34 CONFIG_HZ_256=y 36 35 CONFIG_KEXEC=y ··· 402 403 CONFIG_CRYPTO_TWOFISH=m 403 404 CONFIG_CRYPTO_DEFLATE=m 404 405 CONFIG_PRINTK_TIME=y 405 - CONFIG_FRAME_WARN=1024 406 406 CONFIG_STRIP_ASM_SYMS=y 407 407 CONFIG_MAGIC_SYSRQ=y 408 408 # CONFIG_SCHED_DEBUG is not set
-77
arch/mips/configs/pnx8335_stb225_defconfig
··· 1 - # CONFIG_LOCALVERSION_AUTO is not set 2 - # CONFIG_SWAP is not set 3 - CONFIG_SYSVIPC=y 4 - CONFIG_NO_HZ=y 5 - CONFIG_HIGH_RES_TIMERS=y 6 - CONFIG_PREEMPT_VOLUNTARY=y 7 - CONFIG_LOG_BUF_SHIFT=14 8 - CONFIG_EXPERT=y 9 - CONFIG_SLAB=y 10 - CONFIG_NXP_STB225=y 11 - CONFIG_CPU_LITTLE_ENDIAN=y 12 - CONFIG_HZ_128=y 13 - # CONFIG_SECCOMP is not set 14 - CONFIG_MODULES=y 15 - CONFIG_MODULE_UNLOAD=y 16 - # CONFIG_BLK_DEV_BSG is not set 17 - CONFIG_NET=y 18 - CONFIG_PACKET=y 19 - CONFIG_UNIX=y 20 - CONFIG_INET=y 21 - CONFIG_IP_MULTICAST=y 22 - CONFIG_IP_PNP=y 23 - CONFIG_IP_PNP_DHCP=y 24 - CONFIG_INET_AH=y 25 - # CONFIG_IPV6 is not set 26 - CONFIG_MTD=y 27 - CONFIG_MTD_CMDLINE_PARTS=y 28 - CONFIG_MTD_BLOCK=y 29 - CONFIG_MTD_CFI=y 30 - CONFIG_MTD_CFI_ADV_OPTIONS=y 31 - CONFIG_MTD_CFI_LE_BYTE_SWAP=y 32 - CONFIG_MTD_CFI_GEOMETRY=y 33 - CONFIG_MTD_CFI_AMDSTD=y 34 - CONFIG_MTD_PHYSMAP=y 35 - CONFIG_BLK_DEV_LOOP=y 36 - CONFIG_BLK_DEV_SD=y 37 - # CONFIG_SCSI_LOWLEVEL is not set 38 - CONFIG_ATA=y 39 - CONFIG_NETDEVICES=y 40 - CONFIG_INPUT_EVDEV=m 41 - CONFIG_INPUT_EVBUG=m 42 - # CONFIG_INPUT_KEYBOARD is not set 43 - # CONFIG_INPUT_MOUSE is not set 44 - # CONFIG_VT_CONSOLE is not set 45 - # CONFIG_LEGACY_PTYS is not set 46 - CONFIG_SERIAL_PNX8XXX=y 47 - CONFIG_SERIAL_PNX8XXX_CONSOLE=y 48 - CONFIG_HW_RANDOM=y 49 - CONFIG_I2C=y 50 - CONFIG_I2C_CHARDEV=y 51 - # CONFIG_HWMON is not set 52 - CONFIG_FB=y 53 - # CONFIG_VGA_CONSOLE is not set 54 - CONFIG_SOUND=m 55 - CONFIG_SND=m 56 - CONFIG_SND_VERBOSE_PRINTK=y 57 - CONFIG_SND_DEBUG=y 58 - CONFIG_SND_SEQUENCER=m 59 - CONFIG_EXT2_FS=m 60 - # CONFIG_DNOTIFY is not set 61 - CONFIG_MSDOS_FS=m 62 - CONFIG_VFAT_FS=m 63 - CONFIG_TMPFS=y 64 - CONFIG_JFFS2_FS=y 65 - CONFIG_CRAMFS=y 66 - CONFIG_NFS_FS=y 67 - CONFIG_ROOT_NFS=y 68 - CONFIG_NFSD=m 69 - CONFIG_NFSD_V3=y 70 - CONFIG_NLS=y 71 - CONFIG_NLS_CODEPAGE_437=m 72 - CONFIG_NLS_CODEPAGE_850=m 73 - CONFIG_NLS_CODEPAGE_932=m 74 - CONFIG_NLS_ASCII=m 75 - CONFIG_NLS_ISO8859_1=m 76 - CONFIG_NLS_ISO8859_15=m 77 - CONFIG_NLS_UTF8=m
+3 -4
arch/mips/configs/qi_lb60_defconfig
··· 7 7 # CONFIG_VM_EVENT_COUNTERS is not set 8 8 # CONFIG_COMPAT_BRK is not set 9 9 CONFIG_SLAB=y 10 - CONFIG_MACH_INGENIC=y 10 + CONFIG_MACH_INGENIC_SOC=y 11 + CONFIG_JZ4740_QI_LB60=y 11 12 CONFIG_HZ_100=y 12 13 # CONFIG_SECCOMP is not set 13 14 CONFIG_MODULES=y ··· 73 72 CONFIG_DRM_FBDEV_OVERALLOC=200 74 73 CONFIG_DRM_PANEL_SIMPLE=y 75 74 CONFIG_DRM_INGENIC=y 76 - # CONFIG_LCD_CLASS_DEVICE is not set 77 75 CONFIG_BACKLIGHT_CLASS_DEVICE=y 78 - # CONFIG_BACKLIGHT_GENERIC is not set 79 76 # CONFIG_VGA_CONSOLE is not set 80 77 CONFIG_FRAMEBUFFER_CONSOLE=y 81 78 CONFIG_LOGO=y ··· 169 170 CONFIG_DEBUG_INFO=y 170 171 CONFIG_STRIP_ASM_SYMS=y 171 172 CONFIG_READABLE_ASM=y 173 + CONFIG_KGDB=y 172 174 CONFIG_DEBUG_KMEMLEAK=y 173 175 CONFIG_DEBUG_MEMORY_INIT=y 174 176 CONFIG_DEBUG_STACKOVERFLOW=y 175 177 CONFIG_PANIC_ON_OOPS=y 176 178 # CONFIG_FTRACE is not set 177 - CONFIG_KGDB=y
+2 -2
arch/mips/configs/rs90_defconfig
··· 19 19 # CONFIG_PERF_EVENTS is not set 20 20 CONFIG_SLAB=y 21 21 CONFIG_PROFILING=y 22 - CONFIG_MACH_INGENIC=y 22 + CONFIG_MACH_INGENIC_SOC=y 23 23 CONFIG_JZ4740_RS90=y 24 24 CONFIG_PAGE_SIZE_16KB=y 25 25 CONFIG_HZ_100=y ··· 80 80 # CONFIG_INPUT_MOUSE is not set 81 81 # CONFIG_SERIO is not set 82 82 CONFIG_LEGACY_PTY_COUNT=2 83 - # CONFIG_DEVMEM is not set 84 83 # CONFIG_HW_RANDOM is not set 84 + # CONFIG_DEVMEM is not set 85 85 # CONFIG_I2C_COMPAT is not set 86 86 # CONFIG_I2C_HELPER_AUTO is not set 87 87 CONFIG_POWER_SUPPLY=y
+5 -7
arch/mips/dec/prom/memory.c
··· 12 12 #include <linux/types.h> 13 13 14 14 #include <asm/addrspace.h> 15 - #include <asm/bootinfo.h> 16 15 #include <asm/dec/machtype.h> 17 16 #include <asm/dec/prom.h> 18 17 #include <asm/page.h> ··· 27 28 28 29 #define CHUNK_SIZE 0x400000 29 30 30 - static inline void pmax_setup_memory_region(void) 31 + static __init void pmax_setup_memory_region(void) 31 32 { 32 33 volatile unsigned char *memory_page, dummy; 33 34 char old_handler[0x80]; ··· 49 50 } 50 51 memcpy((void *)(CKSEG0 + 0x80), &old_handler, 0x80); 51 52 52 - add_memory_region(0, (unsigned long)memory_page - CKSEG1 - CHUNK_SIZE, 53 - BOOT_MEM_RAM); 53 + memblock_add(0, (unsigned long)memory_page - CKSEG1 - CHUNK_SIZE); 54 54 } 55 55 56 56 /* 57 57 * Use the REX prom calls to get hold of the memory bitmap, and thence 58 58 * determine memory size. 59 59 */ 60 - static inline void rex_setup_memory_region(void) 60 + static __init void rex_setup_memory_region(void) 61 61 { 62 62 int i, bitmap_size; 63 63 unsigned long mem_start = 0, mem_size = 0; ··· 74 76 else if (!mem_size) 75 77 mem_start += (8 * bm->pagesize); 76 78 else { 77 - add_memory_region(mem_start, mem_size, BOOT_MEM_RAM); 79 + memblock_add(mem_start, mem_size); 78 80 mem_start += mem_size + (8 * bm->pagesize); 79 81 mem_size = 0; 80 82 } 81 83 } 82 84 if (mem_size) 83 - add_memory_region(mem_start, mem_size, BOOT_MEM_RAM); 85 + memblock_add(mem_start, mem_size); 84 86 } 85 87 86 88 void __init prom_meminit(u32 magic)
+8 -1
arch/mips/dec/setup.c
··· 6 6 * for more details. 7 7 * 8 8 * Copyright (C) 1998 Harald Koerfgen 9 - * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki 9 + * Copyright (C) 2000, 2001, 2002, 2003, 2005, 2020 Maciej W. Rozycki 10 10 */ 11 11 #include <linux/console.h> 12 12 #include <linux/export.h> ··· 15 15 #include <linux/ioport.h> 16 16 #include <linux/irq.h> 17 17 #include <linux/irqnr.h> 18 + #include <linux/memblock.h> 18 19 #include <linux/param.h> 19 20 #include <linux/percpu-defs.h> 20 21 #include <linux/sched.h> ··· 23 22 #include <linux/types.h> 24 23 #include <linux/pm.h> 25 24 25 + #include <asm/addrspace.h> 26 26 #include <asm/bootinfo.h> 27 27 #include <asm/cpu.h> 28 28 #include <asm/cpu-features.h> ··· 31 29 #include <asm/irq.h> 32 30 #include <asm/irq_cpu.h> 33 31 #include <asm/mipsregs.h> 32 + #include <asm/page.h> 34 33 #include <asm/reboot.h> 34 + #include <asm/sections.h> 35 35 #include <asm/time.h> 36 36 #include <asm/traps.h> 37 37 #include <asm/wbflush.h> ··· 150 146 151 147 ioport_resource.start = ~0UL; 152 148 ioport_resource.end = 0UL; 149 + 150 + /* Stay away from the firmware working memory area for now. */ 151 + memblock_reserve(PHYS_OFFSET, __pa_symbol(&_text) - PHYS_OFFSET); 153 152 } 154 153 155 154 /*
+20 -8
arch/mips/fw/arc/memory.c
··· 68 68 : arc_mtypes[a.arc] 69 69 #endif 70 70 71 + enum { 72 + mem_free, mem_prom_used, mem_reserved 73 + }; 74 + 71 75 static inline int memtype_classify_arcs(union linux_memtypes type) 72 76 { 73 77 switch (type.arcs) { 74 78 case arcs_fcontig: 75 79 case arcs_free: 76 - return BOOT_MEM_RAM; 80 + return mem_free; 77 81 case arcs_atmp: 78 - return BOOT_MEM_ROM_DATA; 82 + return mem_prom_used; 79 83 case arcs_eblock: 80 84 case arcs_rvpage: 81 85 case arcs_bmem: 82 86 case arcs_prog: 83 87 case arcs_aperm: 84 - return BOOT_MEM_RESERVED; 88 + return mem_reserved; 85 89 default: 86 90 BUG(); 87 91 } ··· 97 93 switch (type.arc) { 98 94 case arc_free: 99 95 case arc_fcontig: 100 - return BOOT_MEM_RAM; 96 + return mem_free; 101 97 case arc_atmp: 102 - return BOOT_MEM_ROM_DATA; 98 + return mem_prom_used; 103 99 case arc_eblock: 104 100 case arc_rvpage: 105 101 case arc_bmem: 106 102 case arc_prog: 107 103 case arc_aperm: 108 - return BOOT_MEM_RESERVED; 104 + return mem_reserved; 109 105 default: 110 106 BUG(); 111 107 } ··· 147 143 size = p->pages << ARC_PAGE_SHIFT; 148 144 type = prom_memtype_classify(p->type); 149 145 150 - add_memory_region(base, size, type); 146 + /* ignore mirrored RAM on IP28/IP30 */ 147 + if (base < PHYS_OFFSET) 148 + continue; 151 149 152 - if (type == BOOT_MEM_ROM_DATA) { 150 + memblock_add(base, size); 151 + 152 + if (type == mem_reserved) 153 + memblock_reserve(base, size); 154 + 155 + if (type == mem_prom_used) { 156 + memblock_reserve(base, size); 153 157 if (nr_prom_mem >= 5) { 154 158 pr_err("Too many ROM DATA regions"); 155 159 continue;
+2 -2
arch/mips/fw/sni/sniprom.c
··· 11 11 12 12 #include <linux/kernel.h> 13 13 #include <linux/init.h> 14 + #include <linux/memblock.h> 14 15 #include <linux/string.h> 15 16 #include <linux/console.h> 16 17 ··· 132 131 } 133 132 pr_debug("Bank%d: %08x @ %08x\n", i, 134 133 memconf[i].size, memconf[i].base); 135 - add_memory_region(memconf[i].base, memconf[i].size, 136 - BOOT_MEM_RAM); 134 + memblock_add(memconf[i].base, memconf[i].size); 137 135 } 138 136 } 139 137
+7 -1
arch/mips/generic/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - if MIPS_GENERIC 2 + if MIPS_GENERIC_KERNEL 3 3 4 4 config LEGACY_BOARDS 5 5 bool ··· 72 72 Enable this to include the FDT for the Ocelot development platforms 73 73 from Microsemi in the FIT kernel image. 74 74 This requires u-boot on the platform. 75 + 76 + config BOARD_INGENIC 77 + bool "Support boards based on Ingenic SoCs" 78 + select MACH_INGENIC_GENERIC 79 + help 80 + Enable support for boards based on Ingenic SoCs. 75 81 76 82 config VIRT_BOARD_RANCHU 77 83 bool "Support Ranchu platform for Android emulator"
+1
arch/mips/generic/Makefile
··· 11 11 obj-$(CONFIG_YAMON_DT_SHIM) += yamon-dt.o 12 12 obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o 13 13 obj-$(CONFIG_LEGACY_BOARD_OCELOT) += board-ocelot.o 14 + obj-$(CONFIG_MACH_INGENIC) += board-ingenic.o 14 15 obj-$(CONFIG_VIRT_BOARD_RANCHU) += board-ranchu.o
+4
arch/mips/generic/Platform
··· 8 8 # option) any later version. 9 9 # 10 10 11 + # Note: order matters, keep the asm/mach-generic include last. 12 + cflags-$(CONFIG_MACH_INGENIC_SOC) += -I$(srctree)/arch/mips/include/asm/mach-ingenic 11 13 cflags-$(CONFIG_MIPS_GENERIC) += -I$(srctree)/arch/mips/include/asm/mach-generic 14 + 12 15 load-$(CONFIG_MIPS_GENERIC) += 0xffffffff80100000 16 + zload-$(CONFIG_MIPS_GENERIC) += 0xffffffff81000000 13 17 all-$(CONFIG_MIPS_GENERIC) := vmlinux.gz.itb 14 18 15 19 its-y := vmlinux.its.S
+120
arch/mips/generic/board-ingenic.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * Support for Ingenic SoCs 4 + * 5 + * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de> 6 + * Copyright (C) 2011, Maarten ter Huurne <maarten@treewalker.org> 7 + * Copyright (C) 2020 Paul Cercueil <paul@crapouillou.net> 8 + */ 9 + 10 + #include <linux/of_address.h> 11 + #include <linux/of_fdt.h> 12 + #include <linux/pm.h> 13 + #include <linux/sizes.h> 14 + #include <linux/suspend.h> 15 + #include <linux/types.h> 16 + 17 + #include <asm/bootinfo.h> 18 + #include <asm/machine.h> 19 + #include <asm/reboot.h> 20 + 21 + static __init char *ingenic_get_system_type(unsigned long machtype) 22 + { 23 + switch (machtype) { 24 + case MACH_INGENIC_X2000E: 25 + return "X2000E"; 26 + case MACH_INGENIC_X2000: 27 + return "X2000"; 28 + case MACH_INGENIC_X1830: 29 + return "X1830"; 30 + case MACH_INGENIC_X1000E: 31 + return "X1000E"; 32 + case MACH_INGENIC_X1000: 33 + return "X1000"; 34 + case MACH_INGENIC_JZ4780: 35 + return "JZ4780"; 36 + case MACH_INGENIC_JZ4775: 37 + return "JZ4775"; 38 + case MACH_INGENIC_JZ4770: 39 + return "JZ4770"; 40 + case MACH_INGENIC_JZ4725B: 41 + return "JZ4725B"; 42 + default: 43 + return "JZ4740"; 44 + } 45 + } 46 + 47 + static __init const void *ingenic_fixup_fdt(const void *fdt, const void *match_data) 48 + { 49 + /* 50 + * Old devicetree files for the qi,lb60 board did not have a /memory 51 + * node. Hardcode the memory info here. 52 + */ 53 + if (!fdt_node_check_compatible(fdt, 0, "qi,lb60") && 54 + fdt_path_offset(fdt, "/memory") < 0) 55 + early_init_dt_add_memory_arch(0, SZ_32M); 56 + 57 + mips_machtype = (unsigned long)match_data; 58 + system_type = ingenic_get_system_type(mips_machtype); 59 + 60 + return fdt; 61 + } 62 + 63 + static const struct of_device_id ingenic_of_match[] __initconst = { 64 + { .compatible = "ingenic,jz4740", .data = (void *)MACH_INGENIC_JZ4740 }, 65 + { .compatible = "ingenic,jz4725b", .data = (void *)MACH_INGENIC_JZ4725B }, 66 + { .compatible = "ingenic,jz4770", .data = (void *)MACH_INGENIC_JZ4770 }, 67 + { .compatible = "ingenic,jz4775", .data = (void *)MACH_INGENIC_JZ4775 }, 68 + { .compatible = "ingenic,jz4780", .data = (void *)MACH_INGENIC_JZ4780 }, 69 + { .compatible = "ingenic,x1000", .data = (void *)MACH_INGENIC_X1000 }, 70 + { .compatible = "ingenic,x1000e", .data = (void *)MACH_INGENIC_X1000E }, 71 + { .compatible = "ingenic,x1830", .data = (void *)MACH_INGENIC_X1830 }, 72 + { .compatible = "ingenic,x2000", .data = (void *)MACH_INGENIC_X2000 }, 73 + { .compatible = "ingenic,x2000e", .data = (void *)MACH_INGENIC_X2000E }, 74 + {} 75 + }; 76 + 77 + MIPS_MACHINE(ingenic) = { 78 + .matches = ingenic_of_match, 79 + .fixup_fdt = ingenic_fixup_fdt, 80 + }; 81 + 82 + static void ingenic_wait_instr(void) 83 + { 84 + __asm__(".set push;\n" 85 + ".set mips3;\n" 86 + "wait;\n" 87 + ".set pop;\n" 88 + ); 89 + } 90 + 91 + static void ingenic_halt(void) 92 + { 93 + for (;;) 94 + ingenic_wait_instr(); 95 + } 96 + 97 + static int __maybe_unused ingenic_pm_enter(suspend_state_t state) 98 + { 99 + ingenic_wait_instr(); 100 + 101 + return 0; 102 + } 103 + 104 + static const struct platform_suspend_ops ingenic_pm_ops __maybe_unused = { 105 + .valid = suspend_valid_only_mem, 106 + .enter = ingenic_pm_enter, 107 + }; 108 + 109 + static int __init ingenic_pm_init(void) 110 + { 111 + if (boot_cpu_type() == CPU_XBURST) { 112 + if (IS_ENABLED(CONFIG_PM_SLEEP)) 113 + suspend_set_ops(&ingenic_pm_ops); 114 + _machine_halt = ingenic_halt; 115 + } 116 + 117 + return 0; 118 + 119 + } 120 + late_initcall(ingenic_pm_init);
+5 -6
arch/mips/generic/init.c
··· 39 39 /* Already set up */ 40 40 return (void *)fdt; 41 41 42 - if ((fw_arg0 == -2) && !fdt_check_header((void *)fw_passed_dtb)) { 42 + if (fw_passed_dtb && !fdt_check_header((void *)fw_passed_dtb)) { 43 43 /* 44 - * We booted using the UHI boot protocol, so we have been 45 - * provided with the appropriate device tree for the board. 46 - * Make use of it & search for any machine struct based upon 47 - * the root compatible string. 44 + * We have been provided with the appropriate device tree for 45 + * the board. Make use of it & search for any machine struct 46 + * based upon the root compatible string. 48 47 */ 49 48 fdt = (void *)fw_passed_dtb; 50 49 ··· 105 106 if (mach && mach->fixup_fdt) 106 107 fdt = mach->fixup_fdt(fdt, mach_match_data); 107 108 108 - strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); 109 + fw_init_cmdline(); 109 110 __dt_setup_arch((void *)fdt); 110 111 } 111 112
+5
arch/mips/generic/proc.c
··· 8 8 9 9 #include <asm/bootinfo.h> 10 10 11 + char *system_type; 12 + 11 13 const char *get_system_type(void) 12 14 { 13 15 const char *str; 14 16 int err; 17 + 18 + if (system_type) 19 + return system_type; 15 20 16 21 err = of_property_read_string(of_root, "model", &str); 17 22 if (!err)
+2 -7
arch/mips/include/asm/bootinfo.h
··· 79 79 MACH_INGENIC_JZ4775, 80 80 MACH_INGENIC_JZ4780, 81 81 MACH_INGENIC_X1000, 82 + MACH_INGENIC_X1000E, 82 83 MACH_INGENIC_X1830, 83 84 MACH_INGENIC_X2000, 85 + MACH_INGENIC_X2000E, 84 86 }; 85 87 86 88 extern char *system_type; ··· 90 88 91 89 extern unsigned long mips_machtype; 92 90 93 - #define BOOT_MEM_RAM 1 94 - #define BOOT_MEM_ROM_DATA 2 95 - #define BOOT_MEM_RESERVED 3 96 - #define BOOT_MEM_INIT_RAM 4 97 - #define BOOT_MEM_NOMAP 5 98 - 99 - extern void add_memory_region(phys_addr_t start, phys_addr_t size, long type); 100 91 extern void detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_addr_t sz_max); 101 92 102 93 extern void prom_init(void);
-3
arch/mips/include/asm/cpu-features.h
··· 171 171 #ifndef cpu_has_llsc 172 172 #define cpu_has_llsc __isa_ge_or_opt(1, MIPS_CPU_LLSC) 173 173 #endif 174 - #ifndef cpu_has_bp_ghist 175 - #define cpu_has_bp_ghist __opt(MIPS_CPU_BP_GHIST) 176 - #endif 177 174 #ifndef kernel_uses_llsc 178 175 #define kernel_uses_llsc cpu_has_llsc 179 176 #endif
-1
arch/mips/include/asm/cpu.h
··· 398 398 #define MIPS_CPU_RW_LLB BIT_ULL(32) /* LLADDR/LLB writes are allowed */ 399 399 #define MIPS_CPU_LPA BIT_ULL(33) /* CPU supports Large Physical Addressing */ 400 400 #define MIPS_CPU_CDMM BIT_ULL(34) /* CPU has Common Device Memory Map */ 401 - #define MIPS_CPU_BP_GHIST BIT_ULL(35) /* R12K+ Branch Prediction Global History */ 402 401 #define MIPS_CPU_SP BIT_ULL(36) /* Small (1KB) page support */ 403 402 #define MIPS_CPU_FTLB BIT_ULL(37) /* CPU has Fixed-page-size TLB */ 404 403 #define MIPS_CPU_NAN_LEGACY BIT_ULL(38) /* Legacy NaN implemented */
+2 -2
arch/mips/include/asm/futex.h
··· 21 21 22 22 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ 23 23 { \ 24 - if (cpu_has_llsc && R10000_LLSC_WAR) { \ 24 + if (cpu_has_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) { \ 25 25 __asm__ __volatile__( \ 26 26 " .set push \n" \ 27 27 " .set noat \n" \ ··· 133 133 if (!access_ok(uaddr, sizeof(u32))) 134 134 return -EFAULT; 135 135 136 - if (cpu_has_llsc && R10000_LLSC_WAR) { 136 + if (cpu_has_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) { 137 137 __asm__ __volatile__( 138 138 "# futex_atomic_cmpxchg_inatomic \n" 139 139 " .set push \n"
+2
arch/mips/include/asm/idle.h
··· 15 15 return cpu_wait == r4k_wait; 16 16 } 17 17 18 + extern void __init check_wait(void); 19 + 18 20 extern int mips_cpuidle_wait_enter(struct cpuidle_device *dev, 19 21 struct cpuidle_driver *drv, int index); 20 22
+1 -1
arch/mips/include/asm/llsc.h
··· 28 28 * works around a bug present in R10000 CPUs prior to revision 3.0 that could 29 29 * cause ll-sc sequences to execute non-atomically. 30 30 */ 31 - #if R10000_LLSC_WAR 31 + #ifdef CONFIG_WAR_R10000_LLSC 32 32 # define __SC_BEQZ "beqzl " 33 33 #elif MIPS_ISA_REV >= 6 34 34 # define __SC_BEQZ "beqzc "
+2 -2
arch/mips/include/asm/local.h
··· 31 31 { 32 32 unsigned long result; 33 33 34 - if (kernel_uses_llsc && R10000_LLSC_WAR) { 34 + if (kernel_uses_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) { 35 35 unsigned long temp; 36 36 37 37 __asm__ __volatile__( ··· 80 80 { 81 81 unsigned long result; 82 82 83 - if (kernel_uses_llsc && R10000_LLSC_WAR) { 83 + if (kernel_uses_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) { 84 84 unsigned long temp; 85 85 86 86 __asm__ __volatile__(
-36
arch/mips/include/asm/m48t37.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Registers for the SGS-Thomson M48T37 Timekeeper RAM chip 4 - */ 5 - #ifndef _ASM_M48T37_H 6 - #define _ASM_M48T37_H 7 - 8 - #include <linux/spinlock.h> 9 - 10 - extern spinlock_t rtc_lock; 11 - 12 - struct m48t37_rtc { 13 - volatile u8 pad[0x7ff0]; /* NVRAM */ 14 - volatile u8 flags; 15 - volatile u8 century; 16 - volatile u8 alarm_sec; 17 - volatile u8 alarm_min; 18 - volatile u8 alarm_hour; 19 - volatile u8 alarm_data; 20 - volatile u8 interrupts; 21 - volatile u8 watchdog; 22 - volatile u8 control; 23 - volatile u8 sec; 24 - volatile u8 min; 25 - volatile u8 hour; 26 - volatile u8 day; 27 - volatile u8 date; 28 - volatile u8 month; 29 - volatile u8 year; 30 - }; 31 - 32 - #define M48T37_RTC_SET 0x80 33 - #define M48T37_RTC_STOPPED 0x80 34 - #define M48T37_RTC_READ 0x40 35 - 36 - #endif /* _ASM_M48T37_H */
-1
arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
··· 39 39 #define cpu_has_guestctl2 0 40 40 #define cpu_has_guestid 0 41 41 #define cpu_has_drg 0 42 - #define cpu_has_bp_ghist 0 43 42 #define cpu_has_mips16 0 44 43 #define cpu_has_mips16e2 0 45 44 #define cpu_has_mdmx 0
-137
arch/mips/include/asm/mach-au1x00/gpio-au1300.h
··· 120 120 return (v >> gpio) & 1; 121 121 } 122 122 123 - /**********************************************************************/ 124 - 125 - /* Linux gpio framework integration. 126 - * 127 - * 4 use cases of Alchemy GPIOS: 128 - *(1) GPIOLIB=y, ALCHEMY_GPIO_INDIRECT=y: 129 - * Board must register gpiochips. 130 - *(2) GPIOLIB=y, ALCHEMY_GPIO_INDIRECT=n: 131 - * A gpiochip for the 75 GPIOs is registered. 132 - * 133 - *(3) GPIOLIB=n, ALCHEMY_GPIO_INDIRECT=y: 134 - * the boards' gpio.h must provide the linux gpio wrapper functions, 135 - * 136 - *(4) GPIOLIB=n, ALCHEMY_GPIO_INDIRECT=n: 137 - * inlinable gpio functions are provided which enable access to the 138 - * Au1300 gpios only by using the numbers straight out of the data- 139 - * sheets. 140 - 141 - * Cases 1 and 3 are intended for boards which want to provide their own 142 - * GPIO namespace and -operations (i.e. for example you have 8 GPIOs 143 - * which are in part provided by spare Au1300 GPIO pins and in part by 144 - * an external FPGA but you still want them to be accessible in linux 145 - * as gpio0-7. The board can of course use the alchemy_gpioX_* functions 146 - * as required). 147 - */ 148 - 149 - #ifndef CONFIG_GPIOLIB 150 - 151 - #ifdef CONFIG_ALCHEMY_GPIOINT_AU1300 152 - 153 - #ifndef CONFIG_ALCHEMY_GPIO_INDIRECT /* case (4) */ 154 - 155 - static inline int gpio_direction_input(unsigned int gpio) 156 - { 157 - return au1300_gpio_direction_input(gpio); 158 - } 159 - 160 - static inline int gpio_direction_output(unsigned int gpio, int v) 161 - { 162 - return au1300_gpio_direction_output(gpio, v); 163 - } 164 - 165 - static inline int gpio_get_value(unsigned int gpio) 166 - { 167 - return au1300_gpio_get_value(gpio); 168 - } 169 - 170 - static inline void gpio_set_value(unsigned int gpio, int v) 171 - { 172 - au1300_gpio_set_value(gpio, v); 173 - } 174 - 175 - static inline int gpio_get_value_cansleep(unsigned gpio) 176 - { 177 - return gpio_get_value(gpio); 178 - } 179 - 180 - static inline void gpio_set_value_cansleep(unsigned gpio, int value) 181 - { 182 - gpio_set_value(gpio, value); 183 - } 184 - 185 - static inline int gpio_is_valid(unsigned int gpio) 186 - { 187 - return au1300_gpio_is_valid(gpio); 188 - } 189 - 190 - static inline int gpio_cansleep(unsigned int gpio) 191 - { 192 - return au1300_gpio_cansleep(gpio); 193 - } 194 - 195 - static inline int gpio_to_irq(unsigned int gpio) 196 - { 197 - return au1300_gpio_to_irq(gpio); 198 - } 199 - 200 - static inline int irq_to_gpio(unsigned int irq) 201 - { 202 - return au1300_irq_to_gpio(irq); 203 - } 204 - 205 - static inline int gpio_request(unsigned int gpio, const char *label) 206 - { 207 - return 0; 208 - } 209 - 210 - static inline int gpio_request_one(unsigned gpio, 211 - unsigned long flags, const char *label) 212 - { 213 - return 0; 214 - } 215 - 216 - static inline int gpio_request_array(struct gpio *array, size_t num) 217 - { 218 - return 0; 219 - } 220 - 221 - static inline void gpio_free(unsigned gpio) 222 - { 223 - } 224 - 225 - static inline void gpio_free_array(struct gpio *array, size_t num) 226 - { 227 - } 228 - 229 - static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) 230 - { 231 - return -ENOSYS; 232 - } 233 - 234 - static inline void gpio_unexport(unsigned gpio) 235 - { 236 - } 237 - 238 - static inline int gpio_export(unsigned gpio, bool direction_may_change) 239 - { 240 - return -ENOSYS; 241 - } 242 - 243 - static inline int gpio_sysfs_set_active_low(unsigned gpio, int value) 244 - { 245 - return -ENOSYS; 246 - } 247 - 248 - static inline int gpio_export_link(struct device *dev, const char *name, 249 - unsigned gpio) 250 - { 251 - return -ENOSYS; 252 - } 253 - 254 - #endif /* !CONFIG_ALCHEMY_GPIO_INDIRECT */ 255 - 256 - #endif /* CONFIG_ALCHEMY_GPIOINT_AU1300 */ 257 - 258 - #endif /* CONFIG GPIOLIB */ 259 - 260 123 #endif /* _GPIO_AU1300_H_ */
+1 -3
arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
··· 10 10 #include <linux/bcma/bcma.h> 11 11 #include <linux/bcma/bcma_soc.h> 12 12 #include <linux/bcm47xx_nvram.h> 13 + #include <linux/bcm47xx_sprom.h> 13 14 14 15 enum bcm47xx_bus_type { 15 16 #ifdef CONFIG_BCM47XX_SSB ··· 32 31 33 32 extern union bcm47xx_bus bcm47xx_bus; 34 33 extern enum bcm47xx_bus_type bcm47xx_bus_type; 35 - 36 - void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix, 37 - bool fallback); 38 34 39 35 void bcm47xx_set_system_type(u16 chip_id); 40 36
-27
arch/mips/include/asm/mach-cavium-octeon/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - * Copyright (C) 2008 Cavium Networks <support@caviumnetworks.com> 8 - */ 9 - #ifndef __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H 10 - #define __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H 11 - 12 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 13 - #define R4600_V1_HIT_CACHEOP_WAR 0 14 - #define R4600_V2_HIT_CACHEOP_WAR 0 15 - #define BCM1250_M3_WAR 0 16 - #define SIBYTE_1956_WAR 0 17 - #define MIPS4K_ICACHE_REFILL_WAR 0 18 - #define MIPS_CACHE_SYNC_WAR 0 19 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 20 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 21 - #define R10000_LLSC_WAR 0 22 - #define MIPS34K_MISSED_ITLB_WAR 0 23 - 24 - #define CAVIUM_OCTEON_DCACHE_PREFETCH_WAR \ 25 - OCTEON_IS_MODEL(OCTEON_CN6XXX) 26 - 27 - #endif /* __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H */
+1 -1
arch/mips/include/asm/mach-generic/irq.h
··· 9 9 #define __ASM_MACH_GENERIC_IRQ_H 10 10 11 11 #ifndef NR_IRQS 12 - #define NR_IRQS 128 12 + #define NR_IRQS 256 13 13 #endif 14 14 15 15 #ifdef CONFIG_I8259
-23
arch/mips/include/asm/mach-generic/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MACH_GENERIC_WAR_H 9 - #define __ASM_MACH_GENERIC_WAR_H 10 - 11 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 - #define R4600_V1_HIT_CACHEOP_WAR 0 13 - #define R4600_V2_HIT_CACHEOP_WAR 0 14 - #define BCM1250_M3_WAR 0 15 - #define SIBYTE_1956_WAR 0 16 - #define MIPS4K_ICACHE_REFILL_WAR 0 17 - #define MIPS_CACHE_SYNC_WAR 0 18 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 19 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 20 - #define R10000_LLSC_WAR 0 21 - #define MIPS34K_MISSED_ITLB_WAR 0 22 - 23 - #endif /* __ASM_MACH_GENERIC_WAR_H */
-27
arch/mips/include/asm/mach-ip22/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_IP22_WAR_H 9 - #define __ASM_MIPS_MACH_IP22_WAR_H 10 - 11 - /* 12 - * R4600 CPU modules for the Indy come with both V1.7 and V2.0 processors. 13 - */ 14 - 15 - #define R4600_V1_INDEX_ICACHEOP_WAR 1 16 - #define R4600_V1_HIT_CACHEOP_WAR 1 17 - #define R4600_V2_HIT_CACHEOP_WAR 1 18 - #define BCM1250_M3_WAR 0 19 - #define SIBYTE_1956_WAR 0 20 - #define MIPS4K_ICACHE_REFILL_WAR 0 21 - #define MIPS_CACHE_SYNC_WAR 0 22 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 23 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 24 - #define R10000_LLSC_WAR 0 25 - #define MIPS34K_MISSED_ITLB_WAR 0 26 - 27 - #endif /* __ASM_MIPS_MACH_IP22_WAR_H */
-8
arch/mips/include/asm/mach-ip27/kmalloc.h
··· 1 - #ifndef __ASM_MACH_IP27_KMALLOC_H 2 - #define __ASM_MACH_IP27_KMALLOC_H 3 - 4 - /* 5 - * All happy, no need to define ARCH_DMA_MINALIGN 6 - */ 7 - 8 - #endif /* __ASM_MACH_IP27_KMALLOC_H */
-23
arch/mips/include/asm/mach-ip27/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_IP27_WAR_H 9 - #define __ASM_MIPS_MACH_IP27_WAR_H 10 - 11 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 - #define R4600_V1_HIT_CACHEOP_WAR 0 13 - #define R4600_V2_HIT_CACHEOP_WAR 0 14 - #define BCM1250_M3_WAR 0 15 - #define SIBYTE_1956_WAR 0 16 - #define MIPS4K_ICACHE_REFILL_WAR 0 17 - #define MIPS_CACHE_SYNC_WAR 0 18 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 19 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 20 - #define R10000_LLSC_WAR 1 21 - #define MIPS34K_MISSED_ITLB_WAR 0 22 - 23 - #endif /* __ASM_MIPS_MACH_IP27_WAR_H */
+1 -1
arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h
··· 25 25 #define cpu_has_mcheck 0 26 26 #define cpu_has_ejtag 0 27 27 28 - #define cpu_has_llsc 1 28 + #define cpu_has_llsc 0 29 29 #define cpu_has_vtag_icache 0 30 30 #define cpu_has_dc_aliases 0 /* see probe_pcache() */ 31 31 #define cpu_has_ic_fills_f_dc 0
-23
arch/mips/include/asm/mach-ip28/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_IP28_WAR_H 9 - #define __ASM_MIPS_MACH_IP28_WAR_H 10 - 11 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 - #define R4600_V1_HIT_CACHEOP_WAR 0 13 - #define R4600_V2_HIT_CACHEOP_WAR 0 14 - #define BCM1250_M3_WAR 0 15 - #define SIBYTE_1956_WAR 0 16 - #define MIPS4K_ICACHE_REFILL_WAR 0 17 - #define MIPS_CACHE_SYNC_WAR 0 18 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 19 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 20 - #define R10000_LLSC_WAR 1 21 - #define MIPS34K_MISSED_ITLB_WAR 0 22 - 23 - #endif /* __ASM_MIPS_MACH_IP28_WAR_H */
-87
arch/mips/include/asm/mach-ip30/irq.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * HEART IRQ defines 4 - * 5 - * Copyright (C) 2009 Johannes Dickgreber <tanzy@gmx.de> 6 - * 2014-2016 Joshua Kinard <kumba@gentoo.org> 7 - * 8 - */ 9 - 10 - #ifndef __ASM_MACH_IP30_IRQ_H 11 - #define __ASM_MACH_IP30_IRQ_H 12 - 13 - /* 14 - * HEART has 64 hardware interrupts, but use 128 to leave room for a few 15 - * software interrupts as well (such as the CPU timer interrupt. 16 - */ 17 - #define NR_IRQS 128 18 - 19 - extern void __init ip30_install_ipi(void); 20 - 21 - /* 22 - * HEART has 64 interrupt vectors available to it, subdivided into five 23 - * priority levels. They are numbered 0 to 63. 24 - */ 25 - #define HEART_NUM_IRQS 64 26 - 27 - /* 28 - * These are the five interrupt priority levels and their corresponding 29 - * CPU IPx interrupt pins. 30 - * 31 - * Level 4 - Error Interrupts. 32 - * Level 3 - HEART timer interrupt. 33 - * Level 2 - CPU IPI, CPU debug, power putton, general device interrupts. 34 - * Level 1 - General device interrupts. 35 - * Level 0 - General device GFX flow control interrupts. 36 - */ 37 - #define HEART_L4_INT_MASK 0xfff8000000000000ULL /* IP6 */ 38 - #define HEART_L3_INT_MASK 0x0004000000000000ULL /* IP5 */ 39 - #define HEART_L2_INT_MASK 0x0003ffff00000000ULL /* IP4 */ 40 - #define HEART_L1_INT_MASK 0x00000000ffff0000ULL /* IP3 */ 41 - #define HEART_L0_INT_MASK 0x000000000000ffffULL /* IP2 */ 42 - 43 - /* HEART L0 Interrupts (Low Priority) */ 44 - #define HEART_L0_INT_GENERIC 0 45 - #define HEART_L0_INT_FLOW_CTRL_HWTR_0 1 46 - #define HEART_L0_INT_FLOW_CTRL_HWTR_1 2 47 - 48 - /* HEART L2 Interrupts (High Priority) */ 49 - #define HEART_L2_INT_RESCHED_CPU_0 46 50 - #define HEART_L2_INT_RESCHED_CPU_1 47 51 - #define HEART_L2_INT_CALL_CPU_0 48 52 - #define HEART_L2_INT_CALL_CPU_1 49 53 - 54 - /* HEART L3 Interrupts (Compare/Counter Timer) */ 55 - #define HEART_L3_INT_TIMER 50 56 - 57 - /* HEART L4 Interrupts (Errors) */ 58 - #define HEART_L4_INT_XWID_ERR_9 51 59 - #define HEART_L4_INT_XWID_ERR_A 52 60 - #define HEART_L4_INT_XWID_ERR_B 53 61 - #define HEART_L4_INT_XWID_ERR_C 54 62 - #define HEART_L4_INT_XWID_ERR_D 55 63 - #define HEART_L4_INT_XWID_ERR_E 56 64 - #define HEART_L4_INT_XWID_ERR_F 57 65 - #define HEART_L4_INT_XWID_ERR_XBOW 58 66 - #define HEART_L4_INT_CPU_BUS_ERR_0 59 67 - #define HEART_L4_INT_CPU_BUS_ERR_1 60 68 - #define HEART_L4_INT_CPU_BUS_ERR_2 61 69 - #define HEART_L4_INT_CPU_BUS_ERR_3 62 70 - #define HEART_L4_INT_HEART_EXCP 63 71 - 72 - /* 73 - * Power Switch is wired via BaseIO BRIDGE slot #6. 74 - * 75 - * ACFail is wired via BaseIO BRIDGE slot #7. 76 - */ 77 - #define IP30_POWER_IRQ HEART_L2_INT_POWER_BTN 78 - 79 - #include <asm/mach-generic/irq.h> 80 - 81 - #define IP30_HEART_L0_IRQ (MIPS_CPU_IRQ_BASE + 2) 82 - #define IP30_HEART_L1_IRQ (MIPS_CPU_IRQ_BASE + 3) 83 - #define IP30_HEART_L2_IRQ (MIPS_CPU_IRQ_BASE + 4) 84 - #define IP30_HEART_TIMER_IRQ (MIPS_CPU_IRQ_BASE + 5) 85 - #define IP30_HEART_ERR_IRQ (MIPS_CPU_IRQ_BASE + 6) 86 - 87 - #endif /* __ASM_MACH_IP30_IRQ_H */
-24
arch/mips/include/asm/mach-ip30/war.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 4 - */ 5 - #ifndef __ASM_MIPS_MACH_IP30_WAR_H 6 - #define __ASM_MIPS_MACH_IP30_WAR_H 7 - 8 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 9 - #define R4600_V1_HIT_CACHEOP_WAR 0 10 - #define R4600_V2_HIT_CACHEOP_WAR 0 11 - #define BCM1250_M3_WAR 0 12 - #define SIBYTE_1956_WAR 0 13 - #define MIPS4K_ICACHE_REFILL_WAR 0 14 - #define MIPS_CACHE_SYNC_WAR 0 15 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 16 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 17 - #ifdef CONFIG_CPU_R10000 18 - #define R10000_LLSC_WAR 1 19 - #else 20 - #define R10000_LLSC_WAR 0 21 - #endif 22 - #define MIPS34K_MISSED_ITLB_WAR 0 23 - 24 - #endif /* __ASM_MIPS_MACH_IP30_WAR_H */
-23
arch/mips/include/asm/mach-ip32/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_IP32_WAR_H 9 - #define __ASM_MIPS_MACH_IP32_WAR_H 10 - 11 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 - #define R4600_V1_HIT_CACHEOP_WAR 0 13 - #define R4600_V2_HIT_CACHEOP_WAR 0 14 - #define BCM1250_M3_WAR 0 15 - #define SIBYTE_1956_WAR 0 16 - #define MIPS4K_ICACHE_REFILL_WAR 0 17 - #define MIPS_CACHE_SYNC_WAR 0 18 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 19 - #define ICACHE_REFILLS_WORKAROUND_WAR 1 20 - #define R10000_LLSC_WAR 0 21 - #define MIPS34K_MISSED_ITLB_WAR 0 22 - 23 - #endif /* __ASM_MIPS_MACH_IP32_WAR_H */
arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h arch/mips/include/asm/mach-ingenic/cpu-feature-overrides.h
-13
arch/mips/include/asm/mach-jz4740/irq.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de> 4 - * JZ4740 IRQ definitions 5 - */ 6 - 7 - #ifndef __ASM_MACH_JZ4740_IRQ_H__ 8 - #define __ASM_MACH_JZ4740_IRQ_H__ 9 - 10 - #define MIPS_CPU_IRQ_BASE 0 11 - #define NR_IRQS 256 12 - 13 - #endif
-36
arch/mips/include/asm/mach-loongson2ef/mc146818rtc.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 1998, 2001, 03, 07 by Ralf Baechle (ralf@linux-mips.org) 7 - * 8 - * RTC routines for PC style attached Dallas chip. 9 - */ 10 - #ifndef __ASM_MACH_LOONGSON2EF_MC146818RTC_H 11 - #define __ASM_MACH_LOONGSON2EF_MC146818RTC_H 12 - 13 - #include <linux/io.h> 14 - 15 - #define RTC_PORT(x) (0x70 + (x)) 16 - #define RTC_IRQ 8 17 - 18 - static inline unsigned char CMOS_READ(unsigned long addr) 19 - { 20 - outb_p(addr, RTC_PORT(0)); 21 - return inb_p(RTC_PORT(1)); 22 - } 23 - 24 - static inline void CMOS_WRITE(unsigned char data, unsigned long addr) 25 - { 26 - outb_p(addr, RTC_PORT(0)); 27 - outb_p(data, RTC_PORT(1)); 28 - } 29 - 30 - #define RTC_ALWAYS_BCD 0 31 - 32 - #ifndef mc146818_decode_year 33 - #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970) 34 - #endif 35 - 36 - #endif /* __ASM_MACH_LOONGSON2EF_MC146818RTC_H */
+2 -1
arch/mips/include/asm/mach-loongson64/irq.h
··· 5 5 /* cpu core interrupt numbers */ 6 6 #define NR_IRQS_LEGACY 16 7 7 #define NR_MIPS_CPU_IRQS 8 8 - #define NR_IRQS (NR_IRQS_LEGACY + NR_MIPS_CPU_IRQS + 256) 8 + #define NR_MAX_CHAINED_IRQS 40 /* Chained IRQs means those not directly used by devices */ 9 + #define NR_IRQS (NR_IRQS_LEGACY + NR_MIPS_CPU_IRQS + NR_MAX_CHAINED_IRQS + 256) 9 10 10 11 #define MIPS_CPU_IRQ_BASE NR_IRQS_LEGACY 11 12
+1 -5
arch/mips/include/asm/mach-loongson64/mmzone.h
··· 10 10 #define _ASM_MACH_LOONGSON64_MMZONE_H 11 11 12 12 #define NODE_ADDRSPACE_SHIFT 44 13 - #define NODE0_ADDRSPACE_OFFSET 0x000000000000UL 14 - #define NODE1_ADDRSPACE_OFFSET 0x100000000000UL 15 - #define NODE2_ADDRSPACE_OFFSET 0x200000000000UL 16 - #define NODE3_ADDRSPACE_OFFSET 0x300000000000UL 17 13 18 14 #define pa_to_nid(addr) (((addr) & 0xf00000000000) >> NODE_ADDRSPACE_SHIFT) 19 - #define nid_to_addrbase(nid) ((nid) << NODE_ADDRSPACE_SHIFT) 15 + #define nid_to_addrbase(nid) ((unsigned long)(nid) << NODE_ADDRSPACE_SHIFT) 20 16 21 17 extern struct pglist_data *__node_data[]; 22 18
-25
arch/mips/include/asm/mach-malta/malta-dtshim.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (C) 2015 Imagination Technologies 4 - * Author: Paul Burton <paul.burton@mips.com> 5 - */ 6 - 7 - #ifndef __MIPS_MALTA_DTSHIM_H__ 8 - #define __MIPS_MALTA_DTSHIM_H__ 9 - 10 - #include <linux/init.h> 11 - 12 - #ifdef CONFIG_MIPS_MALTA 13 - 14 - extern void __init *malta_dt_shim(void *fdt); 15 - 16 - #else /* !CONFIG_MIPS_MALTA */ 17 - 18 - static inline void *malta_dt_shim(void *fdt) 19 - { 20 - return fdt; 21 - } 22 - 23 - #endif /* !CONFIG_MIPS_MALTA */ 24 - 25 - #endif /* __MIPS_MALTA_DTSHIM_H__ */
-33
arch/mips/include/asm/mach-malta/malta-pm.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (C) 2014 Imagination Technologies 4 - * Author: Paul Burton <paul.burton@mips.com> 5 - */ 6 - 7 - #ifndef __ASM_MIPS_MACH_MALTA_PM_H__ 8 - #define __ASM_MIPS_MACH_MALTA_PM_H__ 9 - 10 - #include <asm/mips-boards/piix4.h> 11 - 12 - #ifdef CONFIG_MIPS_MALTA_PM 13 - 14 - /** 15 - * mips_pm_suspend - enter a suspend state 16 - * @state: the state to enter, one of PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_* 17 - * 18 - * Enters a suspend state via the Malta's PIIX4. If the state to be entered 19 - * is one which loses context (eg. SOFF) then this function will never 20 - * return. 21 - */ 22 - extern int mips_pm_suspend(unsigned state); 23 - 24 - #else /* !CONFIG_MIPS_MALTA_PM */ 25 - 26 - static inline int mips_pm_suspend(unsigned state) 27 - { 28 - return -EINVAL; 29 - } 30 - 31 - #endif /* !CONFIG_MIPS_MALTA_PM */ 32 - 33 - #endif /* __ASM_MIPS_MACH_MALTA_PM_H__ */
-23
arch/mips/include/asm/mach-malta/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_MIPS_WAR_H 9 - #define __ASM_MIPS_MACH_MIPS_WAR_H 10 - 11 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 - #define R4600_V1_HIT_CACHEOP_WAR 0 13 - #define R4600_V2_HIT_CACHEOP_WAR 0 14 - #define BCM1250_M3_WAR 0 15 - #define SIBYTE_1956_WAR 0 16 - #define MIPS4K_ICACHE_REFILL_WAR 1 17 - #define MIPS_CACHE_SYNC_WAR 1 18 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 19 - #define ICACHE_REFILLS_WORKAROUND_WAR 1 20 - #define R10000_LLSC_WAR 0 21 - #define MIPS34K_MISSED_ITLB_WAR 0 22 - 23 - #endif /* __ASM_MIPS_MACH_MIPS_WAR_H */
-35
arch/mips/include/asm/mach-paravirt/cpu-feature-overrides.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2013 Cavium, Inc. 7 - */ 8 - #ifndef __ASM_MACH_PARAVIRT_CPU_FEATURE_OVERRIDES_H 9 - #define __ASM_MACH_PARAVIRT_CPU_FEATURE_OVERRIDES_H 10 - 11 - #define cpu_has_4kex 1 12 - #define cpu_has_3k_cache 0 13 - #define cpu_has_tx39_cache 0 14 - #define cpu_has_counter 1 15 - #define cpu_has_llsc 1 16 - /* 17 - * We Disable LL/SC on non SMP systems as it is faster to disable 18 - * interrupts for atomic access than a LL/SC. 19 - */ 20 - #ifdef CONFIG_SMP 21 - # define kernel_uses_llsc 1 22 - #else 23 - # define kernel_uses_llsc 0 24 - #endif 25 - 26 - #ifdef CONFIG_CPU_CAVIUM_OCTEON 27 - #define cpu_dcache_line_size() 128 28 - #define cpu_icache_line_size() 128 29 - #define cpu_has_octeon_cache 1 30 - #define cpu_has_4k_cache 0 31 - #else 32 - #define cpu_has_4k_cache 1 33 - #endif 34 - 35 - #endif /* __ASM_MACH_PARAVIRT_CPU_FEATURE_OVERRIDES_H */
-19
arch/mips/include/asm/mach-paravirt/irq.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2013 Cavium, Inc. 7 - */ 8 - #ifndef __ASM_MACH_PARAVIRT_IRQ_H__ 9 - #define __ASM_MACH_PARAVIRT_IRQ_H__ 10 - 11 - #define NR_IRQS 64 12 - #define MIPS_CPU_IRQ_BASE 1 13 - 14 - #define MIPS_IRQ_PCIA (MIPS_CPU_IRQ_BASE + 8) 15 - 16 - #define MIPS_IRQ_MBOX0 (MIPS_CPU_IRQ_BASE + 32) 17 - #define MIPS_IRQ_MBOX1 (MIPS_CPU_IRQ_BASE + 33) 18 - 19 - #endif /* __ASM_MACH_PARAVIRT_IRQ_H__ */
-52
arch/mips/include/asm/mach-paravirt/kernel-entry-init.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2013 Cavium, Inc 7 - */ 8 - #ifndef __ASM_MACH_PARAVIRT_KERNEL_ENTRY_H 9 - #define __ASM_MACH_PARAVIRT_KERNEL_ENTRY_H 10 - 11 - #define CP0_EBASE $15, 1 12 - 13 - .macro kernel_entry_setup 14 - #ifdef CONFIG_SMP 15 - mfc0 t0, CP0_EBASE 16 - andi t0, t0, 0x3ff # CPUNum 17 - beqz t0, 1f 18 - # CPUs other than zero goto smp_bootstrap 19 - j smp_bootstrap 20 - #endif /* CONFIG_SMP */ 21 - 22 - 1: 23 - .endm 24 - 25 - /* 26 - * Do SMP slave processor setup necessary before we can safely execute 27 - * C code. 28 - */ 29 - .macro smp_slave_setup 30 - mfc0 t0, CP0_EBASE 31 - andi t0, t0, 0x3ff # CPUNum 32 - slti t1, t0, NR_CPUS 33 - bnez t1, 1f 34 - 2: 35 - di 36 - wait 37 - b 2b # Unknown CPU, loop forever. 38 - 1: 39 - PTR_LA t1, paravirt_smp_sp 40 - PTR_SLL t0, PTR_SCALESHIFT 41 - PTR_ADDU t1, t1, t0 42 - 3: 43 - PTR_L sp, 0(t1) 44 - beqz sp, 3b # Spin until told to proceed. 45 - 46 - PTR_LA t1, paravirt_smp_gp 47 - PTR_ADDU t1, t1, t0 48 - sync 49 - PTR_L gp, 0(t1) 50 - .endm 51 - 52 - #endif /* __ASM_MACH_PARAVIRT_KERNEL_ENTRY_H */
-159
arch/mips/include/asm/mach-pnx833x/gpio.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * gpio.h: GPIO Support for PNX833X. 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - */ 9 - #ifndef __ASM_MIPS_MACH_PNX833X_GPIO_H 10 - #define __ASM_MIPS_MACH_PNX833X_GPIO_H 11 - 12 - /* BIG FAT WARNING: races danger! 13 - No protections exist here. Current users are only early init code, 14 - when locking is not needed because no concurrency yet exists there, 15 - and GPIO IRQ dispatcher, which does locking. 16 - However, if many uses will ever happen, proper locking will be needed 17 - - including locking between different uses 18 - */ 19 - 20 - #include <asm/mach-pnx833x/pnx833x.h> 21 - 22 - #define SET_REG_BIT(reg, bit) do { (reg |= (1 << (bit))); } while (0) 23 - #define CLEAR_REG_BIT(reg, bit) do { (reg &= ~(1 << (bit))); } while (0) 24 - 25 - /* Initialize GPIO to a known state */ 26 - static inline void pnx833x_gpio_init(void) 27 - { 28 - PNX833X_PIO_DIR = 0; 29 - PNX833X_PIO_DIR2 = 0; 30 - PNX833X_PIO_SEL = 0; 31 - PNX833X_PIO_SEL2 = 0; 32 - PNX833X_PIO_INT_EDGE = 0; 33 - PNX833X_PIO_INT_HI = 0; 34 - PNX833X_PIO_INT_LO = 0; 35 - 36 - /* clear any GPIO interrupt requests */ 37 - PNX833X_PIO_INT_CLEAR = 0xffff; 38 - PNX833X_PIO_INT_CLEAR = 0; 39 - PNX833X_PIO_INT_ENABLE = 0; 40 - } 41 - 42 - /* Select GPIO direction for a pin */ 43 - static inline void pnx833x_gpio_select_input(unsigned int pin) 44 - { 45 - if (pin < 32) 46 - CLEAR_REG_BIT(PNX833X_PIO_DIR, pin); 47 - else 48 - CLEAR_REG_BIT(PNX833X_PIO_DIR2, pin & 31); 49 - } 50 - static inline void pnx833x_gpio_select_output(unsigned int pin) 51 - { 52 - if (pin < 32) 53 - SET_REG_BIT(PNX833X_PIO_DIR, pin); 54 - else 55 - SET_REG_BIT(PNX833X_PIO_DIR2, pin & 31); 56 - } 57 - 58 - /* Select GPIO or alternate function for a pin */ 59 - static inline void pnx833x_gpio_select_function_io(unsigned int pin) 60 - { 61 - if (pin < 32) 62 - CLEAR_REG_BIT(PNX833X_PIO_SEL, pin); 63 - else 64 - CLEAR_REG_BIT(PNX833X_PIO_SEL2, pin & 31); 65 - } 66 - static inline void pnx833x_gpio_select_function_alt(unsigned int pin) 67 - { 68 - if (pin < 32) 69 - SET_REG_BIT(PNX833X_PIO_SEL, pin); 70 - else 71 - SET_REG_BIT(PNX833X_PIO_SEL2, pin & 31); 72 - } 73 - 74 - /* Read GPIO pin */ 75 - static inline int pnx833x_gpio_read(unsigned int pin) 76 - { 77 - if (pin < 32) 78 - return (PNX833X_PIO_IN >> pin) & 1; 79 - else 80 - return (PNX833X_PIO_IN2 >> (pin & 31)) & 1; 81 - } 82 - 83 - /* Write GPIO pin */ 84 - static inline void pnx833x_gpio_write(unsigned int val, unsigned int pin) 85 - { 86 - if (pin < 32) { 87 - if (val) 88 - SET_REG_BIT(PNX833X_PIO_OUT, pin); 89 - else 90 - CLEAR_REG_BIT(PNX833X_PIO_OUT, pin); 91 - } else { 92 - if (val) 93 - SET_REG_BIT(PNX833X_PIO_OUT2, pin & 31); 94 - else 95 - CLEAR_REG_BIT(PNX833X_PIO_OUT2, pin & 31); 96 - } 97 - } 98 - 99 - /* Configure GPIO interrupt */ 100 - #define GPIO_INT_NONE 0 101 - #define GPIO_INT_LEVEL_LOW 1 102 - #define GPIO_INT_LEVEL_HIGH 2 103 - #define GPIO_INT_EDGE_RISING 3 104 - #define GPIO_INT_EDGE_FALLING 4 105 - #define GPIO_INT_EDGE_BOTH 5 106 - static inline void pnx833x_gpio_setup_irq(int when, unsigned int pin) 107 - { 108 - switch (when) { 109 - case GPIO_INT_LEVEL_LOW: 110 - CLEAR_REG_BIT(PNX833X_PIO_INT_EDGE, pin); 111 - CLEAR_REG_BIT(PNX833X_PIO_INT_HI, pin); 112 - SET_REG_BIT(PNX833X_PIO_INT_LO, pin); 113 - break; 114 - case GPIO_INT_LEVEL_HIGH: 115 - CLEAR_REG_BIT(PNX833X_PIO_INT_EDGE, pin); 116 - SET_REG_BIT(PNX833X_PIO_INT_HI, pin); 117 - CLEAR_REG_BIT(PNX833X_PIO_INT_LO, pin); 118 - break; 119 - case GPIO_INT_EDGE_RISING: 120 - SET_REG_BIT(PNX833X_PIO_INT_EDGE, pin); 121 - SET_REG_BIT(PNX833X_PIO_INT_HI, pin); 122 - CLEAR_REG_BIT(PNX833X_PIO_INT_LO, pin); 123 - break; 124 - case GPIO_INT_EDGE_FALLING: 125 - SET_REG_BIT(PNX833X_PIO_INT_EDGE, pin); 126 - CLEAR_REG_BIT(PNX833X_PIO_INT_HI, pin); 127 - SET_REG_BIT(PNX833X_PIO_INT_LO, pin); 128 - break; 129 - case GPIO_INT_EDGE_BOTH: 130 - SET_REG_BIT(PNX833X_PIO_INT_EDGE, pin); 131 - SET_REG_BIT(PNX833X_PIO_INT_HI, pin); 132 - SET_REG_BIT(PNX833X_PIO_INT_LO, pin); 133 - break; 134 - default: 135 - CLEAR_REG_BIT(PNX833X_PIO_INT_EDGE, pin); 136 - CLEAR_REG_BIT(PNX833X_PIO_INT_HI, pin); 137 - CLEAR_REG_BIT(PNX833X_PIO_INT_LO, pin); 138 - break; 139 - } 140 - } 141 - 142 - /* Enable/disable GPIO interrupt */ 143 - static inline void pnx833x_gpio_enable_irq(unsigned int pin) 144 - { 145 - SET_REG_BIT(PNX833X_PIO_INT_ENABLE, pin); 146 - } 147 - static inline void pnx833x_gpio_disable_irq(unsigned int pin) 148 - { 149 - CLEAR_REG_BIT(PNX833X_PIO_INT_ENABLE, pin); 150 - } 151 - 152 - /* Clear GPIO interrupt request */ 153 - static inline void pnx833x_gpio_clear_irq(unsigned int pin) 154 - { 155 - SET_REG_BIT(PNX833X_PIO_INT_CLEAR, pin); 156 - CLEAR_REG_BIT(PNX833X_PIO_INT_CLEAR, pin); 157 - } 158 - 159 - #endif
-112
arch/mips/include/asm/mach-pnx833x/irq-mapping.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - 3 - /* 4 - * irq.h: IRQ mappings for PNX833X. 5 - * 6 - * Copyright 2008 NXP Semiconductors 7 - * Chris Steel <chris.steel@nxp.com> 8 - * Daniel Laird <daniel.j.laird@nxp.com> 9 - */ 10 - 11 - #ifndef __ASM_MIPS_MACH_PNX833X_IRQ_MAPPING_H 12 - #define __ASM_MIPS_MACH_PNX833X_IRQ_MAPPING_H 13 - /* 14 - * The "IRQ numbers" are completely virtual. 15 - * 16 - * In PNX8330/1, we have 48 interrupt lines, numbered from 1 to 48. 17 - * Let's use numbers 1..48 for PIC interrupts, number 0 for timer interrupt, 18 - * numbers 49..64 for (virtual) GPIO interrupts. 19 - * 20 - * In PNX8335, we have 57 interrupt lines, numbered from 1 to 57, 21 - * connected to PIC, which uses core hardware interrupt 2, and also 22 - * a timer interrupt through hardware interrupt 5. 23 - * Let's use numbers 1..64 for PIC interrupts, number 0 for timer interrupt, 24 - * numbers 65..80 for (virtual) GPIO interrupts. 25 - * 26 - */ 27 - #include <irq.h> 28 - 29 - #define PNX833X_TIMER_IRQ (MIPS_CPU_IRQ_BASE + 7) 30 - 31 - /* Interrupts supported by PIC */ 32 - #define PNX833X_PIC_I2C0_INT (PNX833X_PIC_IRQ_BASE + 1) 33 - #define PNX833X_PIC_I2C1_INT (PNX833X_PIC_IRQ_BASE + 2) 34 - #define PNX833X_PIC_UART0_INT (PNX833X_PIC_IRQ_BASE + 3) 35 - #define PNX833X_PIC_UART1_INT (PNX833X_PIC_IRQ_BASE + 4) 36 - #define PNX833X_PIC_TS_IN0_DV_INT (PNX833X_PIC_IRQ_BASE + 5) 37 - #define PNX833X_PIC_TS_IN0_DMA_INT (PNX833X_PIC_IRQ_BASE + 6) 38 - #define PNX833X_PIC_GPIO_INT (PNX833X_PIC_IRQ_BASE + 7) 39 - #define PNX833X_PIC_AUDIO_DEC_INT (PNX833X_PIC_IRQ_BASE + 8) 40 - #define PNX833X_PIC_VIDEO_DEC_INT (PNX833X_PIC_IRQ_BASE + 9) 41 - #define PNX833X_PIC_CONFIG_INT (PNX833X_PIC_IRQ_BASE + 10) 42 - #define PNX833X_PIC_AOI_INT (PNX833X_PIC_IRQ_BASE + 11) 43 - #define PNX833X_PIC_SYNC_INT (PNX833X_PIC_IRQ_BASE + 12) 44 - #define PNX8330_PIC_SPU_INT (PNX833X_PIC_IRQ_BASE + 13) 45 - #define PNX8335_PIC_SATA_INT (PNX833X_PIC_IRQ_BASE + 13) 46 - #define PNX833X_PIC_OSD_INT (PNX833X_PIC_IRQ_BASE + 14) 47 - #define PNX833X_PIC_DISP1_INT (PNX833X_PIC_IRQ_BASE + 15) 48 - #define PNX833X_PIC_DEINTERLACER_INT (PNX833X_PIC_IRQ_BASE + 16) 49 - #define PNX833X_PIC_DISPLAY2_INT (PNX833X_PIC_IRQ_BASE + 17) 50 - #define PNX833X_PIC_VC_INT (PNX833X_PIC_IRQ_BASE + 18) 51 - #define PNX833X_PIC_SC_INT (PNX833X_PIC_IRQ_BASE + 19) 52 - #define PNX833X_PIC_IDE_INT (PNX833X_PIC_IRQ_BASE + 20) 53 - #define PNX833X_PIC_IDE_DMA_INT (PNX833X_PIC_IRQ_BASE + 21) 54 - #define PNX833X_PIC_TS_IN1_DV_INT (PNX833X_PIC_IRQ_BASE + 22) 55 - #define PNX833X_PIC_TS_IN1_DMA_INT (PNX833X_PIC_IRQ_BASE + 23) 56 - #define PNX833X_PIC_SGDX_DMA_INT (PNX833X_PIC_IRQ_BASE + 24) 57 - #define PNX833X_PIC_TS_OUT_INT (PNX833X_PIC_IRQ_BASE + 25) 58 - #define PNX833X_PIC_IR_INT (PNX833X_PIC_IRQ_BASE + 26) 59 - #define PNX833X_PIC_VMSP1_INT (PNX833X_PIC_IRQ_BASE + 27) 60 - #define PNX833X_PIC_VMSP2_INT (PNX833X_PIC_IRQ_BASE + 28) 61 - #define PNX833X_PIC_PIBC_INT (PNX833X_PIC_IRQ_BASE + 29) 62 - #define PNX833X_PIC_TS_IN0_TRD_INT (PNX833X_PIC_IRQ_BASE + 30) 63 - #define PNX833X_PIC_SGDX_TPD_INT (PNX833X_PIC_IRQ_BASE + 31) 64 - #define PNX833X_PIC_USB_INT (PNX833X_PIC_IRQ_BASE + 32) 65 - #define PNX833X_PIC_TS_IN1_TRD_INT (PNX833X_PIC_IRQ_BASE + 33) 66 - #define PNX833X_PIC_CLOCK_INT (PNX833X_PIC_IRQ_BASE + 34) 67 - #define PNX833X_PIC_SGDX_PARSER_INT (PNX833X_PIC_IRQ_BASE + 35) 68 - #define PNX833X_PIC_VMSP_DMA_INT (PNX833X_PIC_IRQ_BASE + 36) 69 - 70 - #if defined(CONFIG_SOC_PNX8335) 71 - #define PNX8335_PIC_MIU_INT (PNX833X_PIC_IRQ_BASE + 37) 72 - #define PNX8335_PIC_AVCHIP_IRQ_INT (PNX833X_PIC_IRQ_BASE + 38) 73 - #define PNX8335_PIC_SYNC_HD_INT (PNX833X_PIC_IRQ_BASE + 39) 74 - #define PNX8335_PIC_DISP_HD_INT (PNX833X_PIC_IRQ_BASE + 40) 75 - #define PNX8335_PIC_DISP_SCALER_INT (PNX833X_PIC_IRQ_BASE + 41) 76 - #define PNX8335_PIC_OSD_HD1_INT (PNX833X_PIC_IRQ_BASE + 42) 77 - #define PNX8335_PIC_DTL_WRITER_Y_INT (PNX833X_PIC_IRQ_BASE + 43) 78 - #define PNX8335_PIC_DTL_WRITER_C_INT (PNX833X_PIC_IRQ_BASE + 44) 79 - #define PNX8335_PIC_DTL_EMULATOR_Y_IR_INT (PNX833X_PIC_IRQ_BASE + 45) 80 - #define PNX8335_PIC_DTL_EMULATOR_C_IR_INT (PNX833X_PIC_IRQ_BASE + 46) 81 - #define PNX8335_PIC_DENC_TTX_INT (PNX833X_PIC_IRQ_BASE + 47) 82 - #define PNX8335_PIC_MMI_SIF0_INT (PNX833X_PIC_IRQ_BASE + 48) 83 - #define PNX8335_PIC_MMI_SIF1_INT (PNX833X_PIC_IRQ_BASE + 49) 84 - #define PNX8335_PIC_MMI_CDMMU_INT (PNX833X_PIC_IRQ_BASE + 50) 85 - #define PNX8335_PIC_PIBCS_INT (PNX833X_PIC_IRQ_BASE + 51) 86 - #define PNX8335_PIC_ETHERNET_INT (PNX833X_PIC_IRQ_BASE + 52) 87 - #define PNX8335_PIC_VMSP1_0_INT (PNX833X_PIC_IRQ_BASE + 53) 88 - #define PNX8335_PIC_VMSP1_1_INT (PNX833X_PIC_IRQ_BASE + 54) 89 - #define PNX8335_PIC_VMSP1_DMA_INT (PNX833X_PIC_IRQ_BASE + 55) 90 - #define PNX8335_PIC_TDGR_DE_INT (PNX833X_PIC_IRQ_BASE + 56) 91 - #define PNX8335_PIC_IR1_IRQ_INT (PNX833X_PIC_IRQ_BASE + 57) 92 - #endif 93 - 94 - /* GPIO interrupts */ 95 - #define PNX833X_GPIO_0_INT (PNX833X_GPIO_IRQ_BASE + 0) 96 - #define PNX833X_GPIO_1_INT (PNX833X_GPIO_IRQ_BASE + 1) 97 - #define PNX833X_GPIO_2_INT (PNX833X_GPIO_IRQ_BASE + 2) 98 - #define PNX833X_GPIO_3_INT (PNX833X_GPIO_IRQ_BASE + 3) 99 - #define PNX833X_GPIO_4_INT (PNX833X_GPIO_IRQ_BASE + 4) 100 - #define PNX833X_GPIO_5_INT (PNX833X_GPIO_IRQ_BASE + 5) 101 - #define PNX833X_GPIO_6_INT (PNX833X_GPIO_IRQ_BASE + 6) 102 - #define PNX833X_GPIO_7_INT (PNX833X_GPIO_IRQ_BASE + 7) 103 - #define PNX833X_GPIO_8_INT (PNX833X_GPIO_IRQ_BASE + 8) 104 - #define PNX833X_GPIO_9_INT (PNX833X_GPIO_IRQ_BASE + 9) 105 - #define PNX833X_GPIO_10_INT (PNX833X_GPIO_IRQ_BASE + 10) 106 - #define PNX833X_GPIO_11_INT (PNX833X_GPIO_IRQ_BASE + 11) 107 - #define PNX833X_GPIO_12_INT (PNX833X_GPIO_IRQ_BASE + 12) 108 - #define PNX833X_GPIO_13_INT (PNX833X_GPIO_IRQ_BASE + 13) 109 - #define PNX833X_GPIO_14_INT (PNX833X_GPIO_IRQ_BASE + 14) 110 - #define PNX833X_GPIO_15_INT (PNX833X_GPIO_IRQ_BASE + 15) 111 - 112 - #endif
-40
arch/mips/include/asm/mach-pnx833x/irq.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * irq.h: IRQ mappings for PNX833X. 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - */ 9 - 10 - #ifndef __ASM_MIPS_MACH_PNX833X_IRQ_H 11 - #define __ASM_MIPS_MACH_PNX833X_IRQ_H 12 - /* 13 - * The "IRQ numbers" are completely virtual. 14 - * 15 - * In PNX8330/1, we have 48 interrupt lines, numbered from 1 to 48. 16 - * Let's use numbers 1..48 for PIC interrupts, number 0 for timer interrupt, 17 - * numbers 49..64 for (virtual) GPIO interrupts. 18 - * 19 - * In PNX8335, we have 57 interrupt lines, numbered from 1 to 57, 20 - * connected to PIC, which uses core hardware interrupt 2, and also 21 - * a timer interrupt through hardware interrupt 5. 22 - * Let's use numbers 1..64 for PIC interrupts, number 0 for timer interrupt, 23 - * numbers 65..80 for (virtual) GPIO interrupts. 24 - * 25 - */ 26 - #if defined(CONFIG_SOC_PNX8335) 27 - #define PNX833X_PIC_NUM_IRQ 58 28 - #else 29 - #define PNX833X_PIC_NUM_IRQ 37 30 - #endif 31 - 32 - #define MIPS_CPU_NUM_IRQ 8 33 - #define PNX833X_GPIO_NUM_IRQ 16 34 - 35 - #define MIPS_CPU_IRQ_BASE 0 36 - #define PNX833X_PIC_IRQ_BASE (MIPS_CPU_IRQ_BASE + MIPS_CPU_NUM_IRQ) 37 - #define PNX833X_GPIO_IRQ_BASE (PNX833X_PIC_IRQ_BASE + PNX833X_PIC_NUM_IRQ) 38 - #define NR_IRQS (MIPS_CPU_NUM_IRQ + PNX833X_PIC_NUM_IRQ + PNX833X_GPIO_NUM_IRQ) 39 - 40 - #endif
-189
arch/mips/include/asm/mach-pnx833x/pnx833x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * pnx833x.h: Register mappings for PNX833X. 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - */ 9 - #ifndef __ASM_MIPS_MACH_PNX833X_PNX833X_H 10 - #define __ASM_MIPS_MACH_PNX833X_PNX833X_H 11 - 12 - /* All regs are accessed in KSEG1 */ 13 - #define PNX833X_BASE (0xa0000000ul + 0x17E00000ul) 14 - 15 - #define PNX833X_REG(offs) (*((volatile unsigned long *)(PNX833X_BASE + offs))) 16 - 17 - /* Registers are named exactly as in PNX833X docs, just with PNX833X_ prefix */ 18 - 19 - /* Read access to multibit fields */ 20 - #define PNX833X_BIT(val, reg, field) ((val) & PNX833X_##reg##_##field) 21 - #define PNX833X_REGBIT(reg, field) PNX833X_BIT(PNX833X_##reg, reg, field) 22 - 23 - /* Use PNX833X_FIELD to extract a field from val */ 24 - #define PNX_FIELD(cpu, val, reg, field) \ 25 - (((val) & PNX##cpu##_##reg##_##field##_MASK) >> \ 26 - PNX##cpu##_##reg##_##field##_SHIFT) 27 - #define PNX833X_FIELD(val, reg, field) PNX_FIELD(833X, val, reg, field) 28 - #define PNX8330_FIELD(val, reg, field) PNX_FIELD(8330, val, reg, field) 29 - #define PNX8335_FIELD(val, reg, field) PNX_FIELD(8335, val, reg, field) 30 - 31 - /* Use PNX833X_REGFIELD to extract a field from a register */ 32 - #define PNX833X_REGFIELD(reg, field) PNX833X_FIELD(PNX833X_##reg, reg, field) 33 - #define PNX8330_REGFIELD(reg, field) PNX8330_FIELD(PNX8330_##reg, reg, field) 34 - #define PNX8335_REGFIELD(reg, field) PNX8335_FIELD(PNX8335_##reg, reg, field) 35 - 36 - 37 - #define PNX_WRITEFIELD(cpu, val, reg, field) \ 38 - (PNX##cpu##_##reg = (PNX##cpu##_##reg & ~(PNX##cpu##_##reg##_##field##_MASK)) | \ 39 - ((val) << PNX##cpu##_##reg##_##field##_SHIFT)) 40 - #define PNX833X_WRITEFIELD(val, reg, field) \ 41 - PNX_WRITEFIELD(833X, val, reg, field) 42 - #define PNX8330_WRITEFIELD(val, reg, field) \ 43 - PNX_WRITEFIELD(8330, val, reg, field) 44 - #define PNX8335_WRITEFIELD(val, reg, field) \ 45 - PNX_WRITEFIELD(8335, val, reg, field) 46 - 47 - 48 - /* Macros to detect CPU type */ 49 - 50 - #define PNX833X_CONFIG_MODULE_ID PNX833X_REG(0x7FFC) 51 - #define PNX833X_CONFIG_MODULE_ID_MAJREV_MASK 0x0000f000 52 - #define PNX833X_CONFIG_MODULE_ID_MAJREV_SHIFT 12 53 - #define PNX8330_CONFIG_MODULE_MAJREV 4 54 - #define PNX8335_CONFIG_MODULE_MAJREV 5 55 - #define CPU_IS_PNX8330 (PNX833X_REGFIELD(CONFIG_MODULE_ID, MAJREV) == \ 56 - PNX8330_CONFIG_MODULE_MAJREV) 57 - #define CPU_IS_PNX8335 (PNX833X_REGFIELD(CONFIG_MODULE_ID, MAJREV) == \ 58 - PNX8335_CONFIG_MODULE_MAJREV) 59 - 60 - 61 - 62 - #define PNX833X_RESET_CONTROL PNX833X_REG(0x8004) 63 - #define PNX833X_RESET_CONTROL_2 PNX833X_REG(0x8014) 64 - 65 - #define PNX833X_PIC_REG(offs) PNX833X_REG(0x01000 + (offs)) 66 - #define PNX833X_PIC_INT_PRIORITY PNX833X_PIC_REG(0x0) 67 - #define PNX833X_PIC_INT_SRC PNX833X_PIC_REG(0x4) 68 - #define PNX833X_PIC_INT_SRC_INT_SRC_MASK 0x00000FF8ul /* bits 11:3 */ 69 - #define PNX833X_PIC_INT_SRC_INT_SRC_SHIFT 3 70 - #define PNX833X_PIC_INT_REG(irq) PNX833X_PIC_REG(0x10 + 4*(irq)) 71 - 72 - #define PNX833X_CLOCK_CPUCP_CTL PNX833X_REG(0x9228) 73 - #define PNX833X_CLOCK_CPUCP_CTL_EXIT_RESET 0x00000002ul /* bit 1 */ 74 - #define PNX833X_CLOCK_CPUCP_CTL_DIV_CLOCK_MASK 0x00000018ul /* bits 4:3 */ 75 - #define PNX833X_CLOCK_CPUCP_CTL_DIV_CLOCK_SHIFT 3 76 - 77 - #define PNX8335_CLOCK_PLL_CPU_CTL PNX833X_REG(0x9020) 78 - #define PNX8335_CLOCK_PLL_CPU_CTL_FREQ_MASK 0x1f 79 - #define PNX8335_CLOCK_PLL_CPU_CTL_FREQ_SHIFT 0 80 - 81 - #define PNX833X_CONFIG_MUX PNX833X_REG(0x7004) 82 - #define PNX833X_CONFIG_MUX_IDE_MUX 0x00000080 /* bit 7 */ 83 - 84 - #define PNX8330_CONFIG_POLYFUSE_7 PNX833X_REG(0x7040) 85 - #define PNX8330_CONFIG_POLYFUSE_7_BOOT_MODE_MASK 0x00180000 86 - #define PNX8330_CONFIG_POLYFUSE_7_BOOT_MODE_SHIFT 19 87 - 88 - #define PNX833X_PIO_IN PNX833X_REG(0xF000) 89 - #define PNX833X_PIO_OUT PNX833X_REG(0xF004) 90 - #define PNX833X_PIO_DIR PNX833X_REG(0xF008) 91 - #define PNX833X_PIO_SEL PNX833X_REG(0xF014) 92 - #define PNX833X_PIO_INT_EDGE PNX833X_REG(0xF020) 93 - #define PNX833X_PIO_INT_HI PNX833X_REG(0xF024) 94 - #define PNX833X_PIO_INT_LO PNX833X_REG(0xF028) 95 - #define PNX833X_PIO_INT_STATUS PNX833X_REG(0xFFE0) 96 - #define PNX833X_PIO_INT_ENABLE PNX833X_REG(0xFFE4) 97 - #define PNX833X_PIO_INT_CLEAR PNX833X_REG(0xFFE8) 98 - #define PNX833X_PIO_IN2 PNX833X_REG(0xF05C) 99 - #define PNX833X_PIO_OUT2 PNX833X_REG(0xF060) 100 - #define PNX833X_PIO_DIR2 PNX833X_REG(0xF064) 101 - #define PNX833X_PIO_SEL2 PNX833X_REG(0xF068) 102 - 103 - #define PNX833X_UART0_PORTS_START (PNX833X_BASE + 0xB000) 104 - #define PNX833X_UART0_PORTS_END (PNX833X_BASE + 0xBFFF) 105 - #define PNX833X_UART1_PORTS_START (PNX833X_BASE + 0xC000) 106 - #define PNX833X_UART1_PORTS_END (PNX833X_BASE + 0xCFFF) 107 - 108 - #define PNX833X_USB_PORTS_START (PNX833X_BASE + 0x19000) 109 - #define PNX833X_USB_PORTS_END (PNX833X_BASE + 0x19FFF) 110 - 111 - #define PNX833X_CONFIG_USB PNX833X_REG(0x7008) 112 - 113 - #define PNX833X_I2C0_PORTS_START (PNX833X_BASE + 0xD000) 114 - #define PNX833X_I2C0_PORTS_END (PNX833X_BASE + 0xDFFF) 115 - #define PNX833X_I2C1_PORTS_START (PNX833X_BASE + 0xE000) 116 - #define PNX833X_I2C1_PORTS_END (PNX833X_BASE + 0xEFFF) 117 - 118 - #define PNX833X_IDE_PORTS_START (PNX833X_BASE + 0x1A000) 119 - #define PNX833X_IDE_PORTS_END (PNX833X_BASE + 0x1AFFF) 120 - #define PNX833X_IDE_MODULE_ID PNX833X_REG(0x1AFFC) 121 - 122 - #define PNX833X_IDE_MODULE_ID_MODULE_ID_MASK 0xFFFF0000 123 - #define PNX833X_IDE_MODULE_ID_MODULE_ID_SHIFT 16 124 - #define PNX833X_IDE_MODULE_ID_VALUE 0xA009 125 - 126 - 127 - #define PNX833X_MIU_SEL0 PNX833X_REG(0x2004) 128 - #define PNX833X_MIU_SEL0_TIMING PNX833X_REG(0x2008) 129 - #define PNX833X_MIU_SEL1 PNX833X_REG(0x200C) 130 - #define PNX833X_MIU_SEL1_TIMING PNX833X_REG(0x2010) 131 - #define PNX833X_MIU_SEL2 PNX833X_REG(0x2014) 132 - #define PNX833X_MIU_SEL2_TIMING PNX833X_REG(0x2018) 133 - #define PNX833X_MIU_SEL3 PNX833X_REG(0x201C) 134 - #define PNX833X_MIU_SEL3_TIMING PNX833X_REG(0x2020) 135 - 136 - #define PNX833X_MIU_SEL0_SPI_MODE_ENABLE_MASK (1 << 14) 137 - #define PNX833X_MIU_SEL0_SPI_MODE_ENABLE_SHIFT 14 138 - 139 - #define PNX833X_MIU_SEL0_BURST_MODE_ENABLE_MASK (1 << 7) 140 - #define PNX833X_MIU_SEL0_BURST_MODE_ENABLE_SHIFT 7 141 - 142 - #define PNX833X_MIU_SEL0_BURST_PAGE_LEN_MASK (0xF << 9) 143 - #define PNX833X_MIU_SEL0_BURST_PAGE_LEN_SHIFT 9 144 - 145 - #define PNX833X_MIU_CONFIG_SPI PNX833X_REG(0x2000) 146 - 147 - #define PNX833X_MIU_CONFIG_SPI_OPCODE_MASK (0xFF << 3) 148 - #define PNX833X_MIU_CONFIG_SPI_OPCODE_SHIFT 3 149 - 150 - #define PNX833X_MIU_CONFIG_SPI_DATA_ENABLE_MASK (1 << 2) 151 - #define PNX833X_MIU_CONFIG_SPI_DATA_ENABLE_SHIFT 2 152 - 153 - #define PNX833X_MIU_CONFIG_SPI_ADDR_ENABLE_MASK (1 << 1) 154 - #define PNX833X_MIU_CONFIG_SPI_ADDR_ENABLE_SHIFT 1 155 - 156 - #define PNX833X_MIU_CONFIG_SPI_SYNC_MASK (1 << 0) 157 - #define PNX833X_MIU_CONFIG_SPI_SYNC_SHIFT 0 158 - 159 - #define PNX833X_WRITE_CONFIG_SPI(opcode, data_enable, addr_enable, sync) \ 160 - (PNX833X_MIU_CONFIG_SPI = \ 161 - ((opcode) << PNX833X_MIU_CONFIG_SPI_OPCODE_SHIFT) | \ 162 - ((data_enable) << PNX833X_MIU_CONFIG_SPI_DATA_ENABLE_SHIFT) | \ 163 - ((addr_enable) << PNX833X_MIU_CONFIG_SPI_ADDR_ENABLE_SHIFT) | \ 164 - ((sync) << PNX833X_MIU_CONFIG_SPI_SYNC_SHIFT)) 165 - 166 - #define PNX8335_IP3902_PORTS_START (PNX833X_BASE + 0x2F000) 167 - #define PNX8335_IP3902_PORTS_END (PNX833X_BASE + 0x2FFFF) 168 - #define PNX8335_IP3902_MODULE_ID PNX833X_REG(0x2FFFC) 169 - 170 - #define PNX8335_IP3902_MODULE_ID_MODULE_ID_MASK 0xFFFF0000 171 - #define PNX8335_IP3902_MODULE_ID_MODULE_ID_SHIFT 16 172 - #define PNX8335_IP3902_MODULE_ID_VALUE 0x3902 173 - 174 - /* I/O location(gets remapped)*/ 175 - #define PNX8335_NAND_BASE 0x18000000 176 - /* I/O location with CLE high */ 177 - #define PNX8335_NAND_CLE_MASK 0x00100000 178 - /* I/O location with ALE high */ 179 - #define PNX8335_NAND_ALE_MASK 0x00010000 180 - 181 - #define PNX8335_SATA_PORTS_START (PNX833X_BASE + 0x2E000) 182 - #define PNX8335_SATA_PORTS_END (PNX833X_BASE + 0x2EFFF) 183 - #define PNX8335_SATA_MODULE_ID PNX833X_REG(0x2EFFC) 184 - 185 - #define PNX8335_SATA_MODULE_ID_MODULE_ID_MASK 0xFFFF0000 186 - #define PNX8335_SATA_MODULE_ID_MODULE_ID_SHIFT 16 187 - #define PNX8335_SATA_MODULE_ID_VALUE 0xA099 188 - 189 - #endif
-23
arch/mips/include/asm/mach-rc32434/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_MIPS_WAR_H 9 - #define __ASM_MIPS_MACH_MIPS_WAR_H 10 - 11 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 - #define R4600_V1_HIT_CACHEOP_WAR 0 13 - #define R4600_V2_HIT_CACHEOP_WAR 0 14 - #define BCM1250_M3_WAR 0 15 - #define SIBYTE_1956_WAR 0 16 - #define MIPS4K_ICACHE_REFILL_WAR 1 17 - #define MIPS_CACHE_SYNC_WAR 0 18 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 19 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 20 - #define R10000_LLSC_WAR 0 21 - #define MIPS34K_MISSED_ITLB_WAR 0 22 - 23 - #endif /* __ASM_MIPS_MACH_MIPS_WAR_H */
-27
arch/mips/include/asm/mach-rm/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_RM_WAR_H 9 - #define __ASM_MIPS_MACH_RM_WAR_H 10 - 11 - /* 12 - * The RM200C seems to have been shipped only with V2.0 R4600s 13 - */ 14 - 15 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 16 - #define R4600_V1_HIT_CACHEOP_WAR 0 17 - #define R4600_V2_HIT_CACHEOP_WAR 1 18 - #define BCM1250_M3_WAR 0 19 - #define SIBYTE_1956_WAR 0 20 - #define MIPS4K_ICACHE_REFILL_WAR 0 21 - #define MIPS_CACHE_SYNC_WAR 0 22 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 23 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 24 - #define R10000_LLSC_WAR 0 25 - #define MIPS34K_MISSED_ITLB_WAR 0 26 - 27 - #endif /* __ASM_MIPS_MACH_RM_WAR_H */
-38
arch/mips/include/asm/mach-sibyte/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_SIBYTE_WAR_H 9 - #define __ASM_MIPS_MACH_SIBYTE_WAR_H 10 - 11 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 - #define R4600_V1_HIT_CACHEOP_WAR 0 13 - #define R4600_V2_HIT_CACHEOP_WAR 0 14 - 15 - #if defined(CONFIG_SB1_PASS_2_WORKAROUNDS) 16 - 17 - #ifndef __ASSEMBLY__ 18 - extern int sb1250_m3_workaround_needed(void); 19 - #endif 20 - 21 - #define BCM1250_M3_WAR sb1250_m3_workaround_needed() 22 - #define SIBYTE_1956_WAR 1 23 - 24 - #else 25 - 26 - #define BCM1250_M3_WAR 0 27 - #define SIBYTE_1956_WAR 0 28 - 29 - #endif 30 - 31 - #define MIPS4K_ICACHE_REFILL_WAR 0 32 - #define MIPS_CACHE_SYNC_WAR 0 33 - #define TX49XX_ICACHE_INDEX_INV_WAR 0 34 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 35 - #define R10000_LLSC_WAR 0 36 - #define MIPS34K_MISSED_ITLB_WAR 0 37 - 38 - #endif /* __ASM_MIPS_MACH_SIBYTE_WAR_H */
-23
arch/mips/include/asm/mach-tx49xx/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 - */ 8 - #ifndef __ASM_MIPS_MACH_TX49XX_WAR_H 9 - #define __ASM_MIPS_MACH_TX49XX_WAR_H 10 - 11 - #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 - #define R4600_V1_HIT_CACHEOP_WAR 0 13 - #define R4600_V2_HIT_CACHEOP_WAR 0 14 - #define BCM1250_M3_WAR 0 15 - #define SIBYTE_1956_WAR 0 16 - #define MIPS4K_ICACHE_REFILL_WAR 0 17 - #define MIPS_CACHE_SYNC_WAR 0 18 - #define TX49XX_ICACHE_INDEX_INV_WAR 1 19 - #define ICACHE_REFILLS_WORKAROUND_WAR 0 20 - #define R10000_LLSC_WAR 0 21 - #define MIPS34K_MISSED_ITLB_WAR 0 22 - 23 - #endif /* __ASM_MIPS_MACH_TX49XX_WAR_H */
+2
arch/mips/include/asm/mips-boards/malta.h
··· 92 92 93 93 #define MALTA_JMPRS_REG 0x1f000210 94 94 95 + extern void __init *malta_dt_shim(void *fdt); 96 + 95 97 #endif /* __ASM_MIPS_BOARDS_MALTA_H */
+9 -14
arch/mips/include/asm/mipsregs.h
··· 389 389 #define ST0_CU3 0x80000000 390 390 #define ST0_XX 0x80000000 /* MIPS IV naming */ 391 391 392 + /* in-kernel enabled CUs */ 393 + #ifdef CONFIG_CPU_LOONGSON64 394 + #define ST0_KERNEL_CUMASK (ST0_CU0 | ST0_CU2) 395 + #else 396 + #define ST0_KERNEL_CUMASK ST0_CU0 397 + #endif 398 + 392 399 /* 393 400 * Bitfields and bit numbers in the coprocessor 0 IntCtl register. (MIPSR2) 394 401 */ ··· 1713 1706 #define read_c0_count() __read_32bit_c0_register($9, 0) 1714 1707 #define write_c0_count(val) __write_32bit_c0_register($9, 0, val) 1715 1708 1716 - #define read_c0_count2() __read_32bit_c0_register($9, 6) /* pnx8550 */ 1717 - #define write_c0_count2(val) __write_32bit_c0_register($9, 6, val) 1718 - 1719 - #define read_c0_count3() __read_32bit_c0_register($9, 7) /* pnx8550 */ 1720 - #define write_c0_count3(val) __write_32bit_c0_register($9, 7, val) 1721 - 1722 1709 #define read_c0_entryhi() __read_ulong_c0_register($10, 0) 1723 1710 #define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val) 1724 1711 ··· 1730 1729 1731 1730 #define read_c0_guestctl0ext() __read_32bit_c0_register($11, 4) 1732 1731 #define write_c0_guestctl0ext(val) __write_32bit_c0_register($11, 4, val) 1733 - 1734 - #define read_c0_compare2() __read_32bit_c0_register($11, 6) /* pnx8550 */ 1735 - #define write_c0_compare2(val) __write_32bit_c0_register($11, 6, val) 1736 - 1737 - #define read_c0_compare3() __read_32bit_c0_register($11, 7) /* pnx8550 */ 1738 - #define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val) 1739 1732 1740 1733 #define read_c0_status() __read_32bit_c0_register($12, 0) 1741 1734 ··· 2723 2728 2724 2729 static inline void tlb_read(void) 2725 2730 { 2726 - #if MIPS34K_MISSED_ITLB_WAR 2731 + #ifdef CONFIG_WAR_MIPS34K_MISSED_ITLB 2727 2732 int res = 0; 2728 2733 2729 2734 __asm__ __volatile__( ··· 2745 2750 "tlbr\n\t" 2746 2751 ".set reorder"); 2747 2752 2748 - #if MIPS34K_MISSED_ITLB_WAR 2753 + #ifdef CONFIG_WAR_MIPS34K_MISSED_ITLB 2749 2754 if ((res & _ULCAST_(1))) 2750 2755 __asm__ __volatile__( 2751 2756 " .set push \n"
+1 -15
arch/mips/include/asm/netlogic/psb-bootinfo.h
··· 77 77 uint64_t avail_mem_map; 78 78 }; 79 79 80 - enum { 81 - NETLOGIC_IO_SPACE = 0x10, 82 - PCIX_IO_SPACE, 83 - PCIX_CFG_SPACE, 84 - PCIX_MEMORY_SPACE, 85 - HT_IO_SPACE, 86 - HT_CFG_SPACE, 87 - HT_MEMORY_SPACE, 88 - SRAM_SPACE, 89 - FLASH_CONTROLLER_SPACE 90 - }; 91 - 92 - #define NLM_MAX_ARGS 64 93 - #define NLM_MAX_ENVS 32 94 - 95 80 /* This is what netlboot passes and linux boot_mem_map is subtly different */ 96 81 #define NLM_BOOT_MEM_MAP_MAX 32 97 82 struct nlm_boot_mem_map { ··· 87 102 uint32_t type; /* type of memory segment */ 88 103 } map[NLM_BOOT_MEM_MAP_MAX]; 89 104 }; 105 + #define NLM_BOOT_MEM_RAM 1 90 106 91 107 /* Pointer to saved boot loader info */ 92 108 extern struct psb_info nlm_prom_info;
+4
arch/mips/include/asm/octeon/cvmx-bootinfo.h
··· 295 295 */ 296 296 CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, 297 297 CVMX_BOARD_TYPE_UBNT_E100 = 20002, 298 + CVMX_BOARD_TYPE_UBNT_E200 = 20003, 299 + CVMX_BOARD_TYPE_UBNT_E220 = 20005, 298 300 CVMX_BOARD_TYPE_CUST_DSR1000N = 20006, 299 301 CVMX_BOARD_TYPE_KONTRON_S1901 = 21901, 300 302 CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, ··· 398 396 /* Customer private range */ 399 397 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) 400 398 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) 399 + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200) 400 + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220) 401 401 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DSR1000N) 402 402 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901) 403 403 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX)
-5
arch/mips/include/asm/pgtable-bits.h
··· 249 249 250 250 #define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT) 251 251 252 - #elif defined(CONFIG_MACH_INGENIC) 253 - 254 - /* Ingenic uses the WA bit to achieve write-combine memory writes */ 255 - #define _CACHE_UNCACHED_ACCELERATED (1<<_CACHE_SHIFT) 256 - 257 252 #endif 258 253 259 254 #ifndef _CACHE_CACHABLE_NO_WA
-2
arch/mips/include/asm/pgtable.h
··· 37 37 _PAGE_GLOBAL | _page_cachable_default) 38 38 #define PAGE_KERNEL_NC __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ 39 39 _PAGE_GLOBAL | _CACHE_CACHABLE_NONCOHERENT) 40 - #define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_WRITE | \ 41 - _page_cachable_default) 42 40 #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ 43 41 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) 44 42
+1
arch/mips/include/asm/processor.h
··· 29 29 */ 30 30 31 31 extern unsigned int vced_count, vcei_count; 32 + extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); 32 33 33 34 #ifdef CONFIG_32BIT 34 35 #ifdef CONFIG_KVM_GUEST
+3 -3
arch/mips/include/asm/r4k-timer.h
··· 5 5 * 6 6 * Copyright (C) 2008 by Ralf Baechle (ralf@linux-mips.org) 7 7 */ 8 - #ifndef __ASM_R4K_TYPES_H 9 - #define __ASM_R4K_TYPES_H 8 + #ifndef __ASM_R4K_TIMER_H 9 + #define __ASM_R4K_TIMER_H 10 10 11 11 #include <linux/compiler.h> 12 12 ··· 27 27 28 28 #endif 29 29 30 - #endif /* __ASM_R4K_TYPES_H */ 30 + #endif /* __ASM_R4K_TIMER_H */
+51
arch/mips/include/asm/sgi/heart.h
··· 264 264 #define HC_NCOR_MEM_ERR BIT(1) 265 265 #define HC_COR_MEM_ERR BIT(0) 266 266 267 + /* 268 + * HEART has 64 interrupt vectors available to it, subdivided into five 269 + * priority levels. They are numbered 0 to 63. 270 + */ 271 + #define HEART_NUM_IRQS 64 272 + 273 + /* 274 + * These are the five interrupt priority levels and their corresponding 275 + * CPU IPx interrupt pins. 276 + * 277 + * Level 4 - Error Interrupts. 278 + * Level 3 - HEART timer interrupt. 279 + * Level 2 - CPU IPI, CPU debug, power putton, general device interrupts. 280 + * Level 1 - General device interrupts. 281 + * Level 0 - General device GFX flow control interrupts. 282 + */ 283 + #define HEART_L4_INT_MASK 0xfff8000000000000ULL /* IP6 */ 284 + #define HEART_L3_INT_MASK 0x0004000000000000ULL /* IP5 */ 285 + #define HEART_L2_INT_MASK 0x0003ffff00000000ULL /* IP4 */ 286 + #define HEART_L1_INT_MASK 0x00000000ffff0000ULL /* IP3 */ 287 + #define HEART_L0_INT_MASK 0x000000000000ffffULL /* IP2 */ 288 + 289 + /* HEART L0 Interrupts (Low Priority) */ 290 + #define HEART_L0_INT_GENERIC 0 291 + #define HEART_L0_INT_FLOW_CTRL_HWTR_0 1 292 + #define HEART_L0_INT_FLOW_CTRL_HWTR_1 2 293 + 294 + /* HEART L2 Interrupts (High Priority) */ 295 + #define HEART_L2_INT_RESCHED_CPU_0 46 296 + #define HEART_L2_INT_RESCHED_CPU_1 47 297 + #define HEART_L2_INT_CALL_CPU_0 48 298 + #define HEART_L2_INT_CALL_CPU_1 49 299 + 300 + /* HEART L3 Interrupts (Compare/Counter Timer) */ 301 + #define HEART_L3_INT_TIMER 50 302 + 303 + /* HEART L4 Interrupts (Errors) */ 304 + #define HEART_L4_INT_XWID_ERR_9 51 305 + #define HEART_L4_INT_XWID_ERR_A 52 306 + #define HEART_L4_INT_XWID_ERR_B 53 307 + #define HEART_L4_INT_XWID_ERR_C 54 308 + #define HEART_L4_INT_XWID_ERR_D 55 309 + #define HEART_L4_INT_XWID_ERR_E 56 310 + #define HEART_L4_INT_XWID_ERR_F 57 311 + #define HEART_L4_INT_XWID_ERR_XBOW 58 312 + #define HEART_L4_INT_CPU_BUS_ERR_0 59 313 + #define HEART_L4_INT_CPU_BUS_ERR_1 60 314 + #define HEART_L4_INT_CPU_BUS_ERR_2 61 315 + #define HEART_L4_INT_CPU_BUS_ERR_3 62 316 + #define HEART_L4_INT_HEART_EXCP 63 317 + 267 318 extern struct ip30_heart_regs __iomem *heart_regs; 268 319 269 320 #define heart_read ____raw_readq
+3 -3
arch/mips/include/asm/stackframe.h
··· 450 450 */ 451 451 .macro CLI 452 452 mfc0 t0, CP0_STATUS 453 - li t1, ST0_CU0 | STATMASK 453 + li t1, ST0_KERNEL_CUMASK | STATMASK 454 454 or t0, t1 455 455 xori t0, STATMASK 456 456 mtc0 t0, CP0_STATUS ··· 463 463 */ 464 464 .macro STI 465 465 mfc0 t0, CP0_STATUS 466 - li t1, ST0_CU0 | STATMASK 466 + li t1, ST0_KERNEL_CUMASK | STATMASK 467 467 or t0, t1 468 468 xori t0, STATMASK & ~1 469 469 mtc0 t0, CP0_STATUS ··· 477 477 */ 478 478 .macro KMODE 479 479 mfc0 t0, CP0_STATUS 480 - li t1, ST0_CU0 | (STATMASK & ~1) 480 + li t1, ST0_KERNEL_CUMASK | (STATMASK & ~1) 481 481 #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) 482 482 andi t2, t0, ST0_IEP 483 483 srl t2, 2
+3 -1
arch/mips/include/asm/switch_to.h
··· 117 117 __restore_dsp(next); \ 118 118 } \ 119 119 if (cop2_present) { \ 120 + u32 status = read_c0_status(); \ 121 + \ 120 122 set_c0_status(ST0_CU2); \ 121 123 if ((KSTK_STATUS(prev) & ST0_CU2)) { \ 122 124 if (cop2_lazy_restore) \ ··· 129 127 !cop2_lazy_restore) { \ 130 128 cop2_restore(next); \ 131 129 } \ 132 - clear_c0_status(ST0_CU2); \ 130 + write_c0_status(status); \ 133 131 } \ 134 132 __clear_r5_hw_ll_bit(); \ 135 133 __clear_software_ll_bit(); \
-1
arch/mips/include/asm/txx9/tx4939.h
··· 498 498 ((((mst) + 245/2) / 245UL * 429 * 16 + 19) / 19 / 2) 499 499 500 500 void tx4939_wdt_init(void); 501 - void tx4939_add_memory_regions(void); 502 501 void tx4939_setup(void); 503 502 void tx4939_time_init(unsigned int tmrnr); 504 503 void tx4939_sio_init(unsigned int sclk, unsigned int cts_mask);
-150
arch/mips/include/asm/war.h
··· 9 9 #ifndef _ASM_WAR_H 10 10 #define _ASM_WAR_H 11 11 12 - #include <war.h> 13 - 14 12 /* 15 13 * Work around certain R4000 CPU errata (as implemented by GCC): 16 14 * ··· 68 70 #define DADDI_WAR 1 69 71 #else 70 72 #define DADDI_WAR 0 71 - #endif 72 - 73 - /* 74 - * Another R4600 erratum. Due to the lack of errata information the exact 75 - * technical details aren't known. I've experimentally found that disabling 76 - * interrupts during indexed I-cache flushes seems to be sufficient to deal 77 - * with the issue. 78 - */ 79 - #ifndef R4600_V1_INDEX_ICACHEOP_WAR 80 - #error Check setting of R4600_V1_INDEX_ICACHEOP_WAR for your platform 81 - #endif 82 - 83 - /* 84 - * Pleasures of the R4600 V1.x. Cite from the IDT R4600 V1.7 errata: 85 - * 86 - * 18. The CACHE instructions Hit_Writeback_Invalidate_D, Hit_Writeback_D, 87 - * Hit_Invalidate_D and Create_Dirty_Excl_D should only be 88 - * executed if there is no other dcache activity. If the dcache is 89 - * accessed for another instruction immeidately preceding when these 90 - * cache instructions are executing, it is possible that the dcache 91 - * tag match outputs used by these cache instructions will be 92 - * incorrect. These cache instructions should be preceded by at least 93 - * four instructions that are not any kind of load or store 94 - * instruction. 95 - * 96 - * This is not allowed: lw 97 - * nop 98 - * nop 99 - * nop 100 - * cache Hit_Writeback_Invalidate_D 101 - * 102 - * This is allowed: lw 103 - * nop 104 - * nop 105 - * nop 106 - * nop 107 - * cache Hit_Writeback_Invalidate_D 108 - */ 109 - #ifndef R4600_V1_HIT_CACHEOP_WAR 110 - #error Check setting of R4600_V1_HIT_CACHEOP_WAR for your platform 111 - #endif 112 - 113 - 114 - /* 115 - * Writeback and invalidate the primary cache dcache before DMA. 116 - * 117 - * R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D, 118 - * Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only 119 - * operate correctly if the internal data cache refill buffer is empty. These 120 - * CACHE instructions should be separated from any potential data cache miss 121 - * by a load instruction to an uncached address to empty the response buffer." 122 - * (Revision 2.0 device errata from IDT available on https://www.idt.com/ 123 - * in .pdf format.) 124 - */ 125 - #ifndef R4600_V2_HIT_CACHEOP_WAR 126 - #error Check setting of R4600_V2_HIT_CACHEOP_WAR for your platform 127 - #endif 128 - 129 - /* 130 - * Workaround for the Sibyte M3 errata the text of which can be found at 131 - * 132 - * http://sibyte.broadcom.com/hw/bcm1250/docs/pass2errata.txt 133 - * 134 - * This will enable the use of a special TLB refill handler which does a 135 - * consistency check on the information in c0_badvaddr and c0_entryhi and 136 - * will just return and take the exception again if the information was 137 - * found to be inconsistent. 138 - */ 139 - #ifndef BCM1250_M3_WAR 140 - #error Check setting of BCM1250_M3_WAR for your platform 141 - #endif 142 - 143 - /* 144 - * This is a DUART workaround related to glitches around register accesses 145 - */ 146 - #ifndef SIBYTE_1956_WAR 147 - #error Check setting of SIBYTE_1956_WAR for your platform 148 - #endif 149 - 150 - /* 151 - * Fill buffers not flushed on CACHE instructions 152 - * 153 - * Hit_Invalidate_I cacheops invalidate an icache line but the refill 154 - * for that line can get stale data from the fill buffer instead of 155 - * accessing memory if the previous icache miss was also to that line. 156 - * 157 - * Workaround: generate an icache refill from a different line 158 - * 159 - * Affects: 160 - * MIPS 4K RTL revision <3.0, PRID revision <4 161 - */ 162 - #ifndef MIPS4K_ICACHE_REFILL_WAR 163 - #error Check setting of MIPS4K_ICACHE_REFILL_WAR for your platform 164 - #endif 165 - 166 - /* 167 - * Missing implicit forced flush of evictions caused by CACHE 168 - * instruction 169 - * 170 - * Evictions caused by a CACHE instructions are not forced on to the 171 - * bus. The BIU gives higher priority to fetches than to the data from 172 - * the eviction buffer and no collision detection is performed between 173 - * fetches and pending data from the eviction buffer. 174 - * 175 - * Workaround: Execute a SYNC instruction after the cache instruction 176 - * 177 - * Affects: 178 - * MIPS 5Kc,5Kf RTL revision <2.3, PRID revision <8 179 - * MIPS 20Kc RTL revision <4.0, PRID revision <? 180 - */ 181 - #ifndef MIPS_CACHE_SYNC_WAR 182 - #error Check setting of MIPS_CACHE_SYNC_WAR for your platform 183 - #endif 184 - 185 - /* 186 - * From TX49/H2 manual: "If the instruction (i.e. CACHE) is issued for 187 - * the line which this instruction itself exists, the following 188 - * operation is not guaranteed." 189 - * 190 - * Workaround: do two phase flushing for Index_Invalidate_I 191 - */ 192 - #ifndef TX49XX_ICACHE_INDEX_INV_WAR 193 - #error Check setting of TX49XX_ICACHE_INDEX_INV_WAR for your platform 194 - #endif 195 - 196 - /* 197 - * The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra 198 - * opposes it being called that) where invalid instructions in the same 199 - * I-cache line worth of instructions being fetched may case spurious 200 - * exceptions. 201 - */ 202 - #ifndef ICACHE_REFILLS_WORKAROUND_WAR 203 - #error Check setting of ICACHE_REFILLS_WORKAROUND_WAR for your platform 204 - #endif 205 - 206 - /* 207 - * On the R10000 up to version 2.6 (not sure about 2.7) there is a bug that 208 - * may cause ll / sc and lld / scd sequences to execute non-atomically. 209 - */ 210 - #ifndef R10000_LLSC_WAR 211 - #error Check setting of R10000_LLSC_WAR for your platform 212 - #endif 213 - 214 - /* 215 - * 34K core erratum: "Problems Executing the TLBR Instruction" 216 - */ 217 - #ifndef MIPS34K_MISSED_ITLB_WAR 218 - #error Check setting of MIPS34K_MISSED_ITLB_WAR for your platform 219 73 #endif 220 74 221 75 #endif /* _ASM_WAR_H */
+12 -6
arch/mips/jz4740/Kconfig arch/mips/ingenic/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - choice 3 - prompt "Machine type" 4 - depends on MACH_INGENIC 5 - default INGENIC_GENERIC_BOARD 6 2 7 - config INGENIC_GENERIC_BOARD 8 - bool "Generic board" 3 + config MACH_INGENIC_GENERIC 4 + bool 5 + select MACH_INGENIC 9 6 select MACH_JZ4740 10 7 select MACH_JZ4770 11 8 select MACH_JZ4780 12 9 select MACH_X1000 10 + 11 + choice 12 + prompt "Machine type" 13 + depends on MACH_INGENIC_SOC 14 + default INGENIC_GENERIC_BOARD 15 + 16 + config INGENIC_GENERIC_BOARD 17 + bool "Generic board" 18 + select MACH_INGENIC_GENERIC 13 19 14 20 config JZ4740_QI_LB60 15 21 bool "Qi Hardware Ben NanoNote"
-9
arch/mips/jz4740/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - # 3 - # Makefile for the Ingenic JZ4740. 4 - # 5 - 6 - # Object file lists. 7 - obj-y += setup.o 8 - 9 - CFLAGS_setup.o = -I$(src)/../../../scripts/dtc/libfdt
-3
arch/mips/jz4740/Platform
··· 1 - cflags-$(CONFIG_MACH_INGENIC) += -I$(srctree)/arch/mips/include/asm/mach-jz4740 2 - load-$(CONFIG_MACH_INGENIC) += 0xffffffff80010000 3 - zload-$(CONFIG_MACH_INGENIC) += 0xffffffff81000000
-145
arch/mips/jz4740/setup.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de> 4 - * Copyright (C) 2011, Maarten ter Huurne <maarten@treewalker.org> 5 - * JZ4740 setup code 6 - */ 7 - 8 - #include <linux/clocksource.h> 9 - #include <linux/init.h> 10 - #include <linux/io.h> 11 - #include <linux/irqchip.h> 12 - #include <linux/kernel.h> 13 - #include <linux/libfdt.h> 14 - #include <linux/of_clk.h> 15 - #include <linux/of_fdt.h> 16 - #include <linux/pm.h> 17 - #include <linux/sizes.h> 18 - #include <linux/suspend.h> 19 - 20 - #include <asm/bootinfo.h> 21 - #include <asm/fw/fw.h> 22 - #include <asm/prom.h> 23 - #include <asm/reboot.h> 24 - #include <asm/time.h> 25 - 26 - static unsigned long __init get_board_mach_type(const void *fdt) 27 - { 28 - if (!fdt_node_check_compatible(fdt, 0, "ingenic,x2000")) 29 - return MACH_INGENIC_X2000; 30 - if (!fdt_node_check_compatible(fdt, 0, "ingenic,x1830")) 31 - return MACH_INGENIC_X1830; 32 - if (!fdt_node_check_compatible(fdt, 0, "ingenic,x1000")) 33 - return MACH_INGENIC_X1000; 34 - if (!fdt_node_check_compatible(fdt, 0, "ingenic,jz4780")) 35 - return MACH_INGENIC_JZ4780; 36 - if (!fdt_node_check_compatible(fdt, 0, "ingenic,jz4770")) 37 - return MACH_INGENIC_JZ4770; 38 - if (!fdt_node_check_compatible(fdt, 0, "ingenic,jz4725b")) 39 - return MACH_INGENIC_JZ4725B; 40 - 41 - return MACH_INGENIC_JZ4740; 42 - } 43 - 44 - void __init plat_mem_setup(void) 45 - { 46 - void *dtb = (void *)fw_passed_dtb; 47 - 48 - __dt_setup_arch(dtb); 49 - 50 - /* 51 - * Old devicetree files for the qi,lb60 board did not have a /memory 52 - * node. Hardcode the memory info here. 53 - */ 54 - if (!fdt_node_check_compatible(dtb, 0, "qi,lb60") && 55 - fdt_path_offset(dtb, "/memory") < 0) 56 - early_init_dt_add_memory_arch(0, SZ_32M); 57 - 58 - mips_machtype = get_board_mach_type(dtb); 59 - } 60 - 61 - void __init device_tree_init(void) 62 - { 63 - if (!initial_boot_params) 64 - return; 65 - 66 - unflatten_and_copy_device_tree(); 67 - } 68 - 69 - const char *get_system_type(void) 70 - { 71 - switch (mips_machtype) { 72 - case MACH_INGENIC_X2000: 73 - return "X2000"; 74 - case MACH_INGENIC_X1830: 75 - return "X1830"; 76 - case MACH_INGENIC_X1000: 77 - return "X1000"; 78 - case MACH_INGENIC_JZ4780: 79 - return "JZ4780"; 80 - case MACH_INGENIC_JZ4770: 81 - return "JZ4770"; 82 - case MACH_INGENIC_JZ4725B: 83 - return "JZ4725B"; 84 - default: 85 - return "JZ4740"; 86 - } 87 - } 88 - 89 - void __init arch_init_irq(void) 90 - { 91 - irqchip_init(); 92 - } 93 - 94 - void __init plat_time_init(void) 95 - { 96 - of_clk_init(NULL); 97 - timer_probe(); 98 - } 99 - 100 - void __init prom_init(void) 101 - { 102 - fw_init_cmdline(); 103 - } 104 - 105 - void __init prom_free_prom_memory(void) 106 - { 107 - } 108 - 109 - static void jz4740_wait_instr(void) 110 - { 111 - __asm__(".set push;\n" 112 - ".set mips3;\n" 113 - "wait;\n" 114 - ".set pop;\n" 115 - ); 116 - } 117 - 118 - static void jz4740_halt(void) 119 - { 120 - for (;;) 121 - jz4740_wait_instr(); 122 - } 123 - 124 - static int __maybe_unused jz4740_pm_enter(suspend_state_t state) 125 - { 126 - jz4740_wait_instr(); 127 - 128 - return 0; 129 - } 130 - 131 - static const struct platform_suspend_ops jz4740_pm_ops __maybe_unused = { 132 - .valid = suspend_valid_only_mem, 133 - .enter = jz4740_pm_enter, 134 - }; 135 - 136 - static int __init jz4740_pm_init(void) 137 - { 138 - if (IS_ENABLED(CONFIG_PM_SLEEP)) 139 - suspend_set_ops(&jz4740_pm_ops); 140 - _machine_halt = jz4740_halt; 141 - 142 - return 0; 143 - 144 - } 145 - late_initcall(jz4740_pm_init);
+8 -1
arch/mips/kernel/Makefile
··· 5 5 6 6 extra-y := head.o vmlinux.lds 7 7 8 - obj-y += cmpxchg.o cpu-probe.o branch.o elf.o entry.o genex.o idle.o irq.o \ 8 + obj-y += branch.o cmpxchg.o elf.o entry.o genex.o idle.o irq.o \ 9 9 process.o prom.o ptrace.o reset.o setup.o signal.o \ 10 10 syscall.o time.o topology.o traps.o unaligned.o watch.o \ 11 11 vdso.o cacheinfo.o 12 + 13 + ifdef CONFIG_CPU_R3K_TLB 14 + obj-y += cpu-r3k-probe.o 15 + else 16 + obj-y += cpu-probe.o 17 + endif 12 18 13 19 ifdef CONFIG_FUNCTION_TRACER 14 20 CFLAGS_REMOVE_ftrace.o = -pg ··· 48 42 sw-$(CONFIG_CPU_CAVIUM_OCTEON) := octeon_switch.o 49 43 obj-y += $(sw-y) 50 44 45 + obj-$(CONFIG_MIPS_FP_SUPPORT) += fpu-probe.o 51 46 obj-$(CONFIG_CPU_R2300_FPU) += r2300_fpu.o 52 47 obj-$(CONFIG_CPU_R4K_FPU) += r4k_fpu.o 53 48
+2
arch/mips/kernel/branch.c
··· 20 20 #include <asm/ptrace.h> 21 21 #include <linux/uaccess.h> 22 22 23 + #include "probes-common.h" 24 + 23 25 /* 24 26 * Calculate and return exception PC in case of branch delay slot 25 27 * for microMIPS and MIPS16e. It does not clear the ISA mode bit.
+12 -332
arch/mips/kernel/cpu-probe.c
··· 28 28 #include <asm/spram.h> 29 29 #include <linux/uaccess.h> 30 30 31 + #include "fpu-probe.h" 32 + 31 33 #include <asm/mach-loongson64/cpucfg-emul.h> 32 34 33 35 /* Hardware capabilities */ 34 36 unsigned int elf_hwcap __read_mostly; 35 37 EXPORT_SYMBOL_GPL(elf_hwcap); 36 - 37 - #ifdef CONFIG_MIPS_FP_SUPPORT 38 - 39 - /* 40 - * Get the FPU Implementation/Revision. 41 - */ 42 - static inline unsigned long cpu_get_fpu_id(void) 43 - { 44 - unsigned long tmp, fpu_id; 45 - 46 - tmp = read_c0_status(); 47 - __enable_fpu(FPU_AS_IS); 48 - fpu_id = read_32bit_cp1_register(CP1_REVISION); 49 - write_c0_status(tmp); 50 - return fpu_id; 51 - } 52 - 53 - /* 54 - * Check if the CPU has an external FPU. 55 - */ 56 - static inline int __cpu_has_fpu(void) 57 - { 58 - return (cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE; 59 - } 60 - 61 - /* 62 - * Determine the FCSR mask for FPU hardware. 63 - */ 64 - static inline void cpu_set_fpu_fcsr_mask(struct cpuinfo_mips *c) 65 - { 66 - unsigned long sr, mask, fcsr, fcsr0, fcsr1; 67 - 68 - fcsr = c->fpu_csr31; 69 - mask = FPU_CSR_ALL_X | FPU_CSR_ALL_E | FPU_CSR_ALL_S | FPU_CSR_RM; 70 - 71 - sr = read_c0_status(); 72 - __enable_fpu(FPU_AS_IS); 73 - 74 - fcsr0 = fcsr & mask; 75 - write_32bit_cp1_register(CP1_STATUS, fcsr0); 76 - fcsr0 = read_32bit_cp1_register(CP1_STATUS); 77 - 78 - fcsr1 = fcsr | ~mask; 79 - write_32bit_cp1_register(CP1_STATUS, fcsr1); 80 - fcsr1 = read_32bit_cp1_register(CP1_STATUS); 81 - 82 - write_32bit_cp1_register(CP1_STATUS, fcsr); 83 - 84 - write_c0_status(sr); 85 - 86 - c->fpu_msk31 = ~(fcsr0 ^ fcsr1) & ~mask; 87 - } 88 - 89 - /* 90 - * Determine the IEEE 754 NaN encodings and ABS.fmt/NEG.fmt execution modes 91 - * supported by FPU hardware. 92 - */ 93 - static void cpu_set_fpu_2008(struct cpuinfo_mips *c) 94 - { 95 - if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | 96 - MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 97 - MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 98 - MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) { 99 - unsigned long sr, fir, fcsr, fcsr0, fcsr1; 100 - 101 - sr = read_c0_status(); 102 - __enable_fpu(FPU_AS_IS); 103 - 104 - fir = read_32bit_cp1_register(CP1_REVISION); 105 - if (fir & MIPS_FPIR_HAS2008) { 106 - fcsr = read_32bit_cp1_register(CP1_STATUS); 107 - 108 - /* 109 - * MAC2008 toolchain never landed in real world, so we're only 110 - * testing wether it can be disabled and don't try to enabled 111 - * it. 112 - */ 113 - fcsr0 = fcsr & ~(FPU_CSR_ABS2008 | FPU_CSR_NAN2008 | FPU_CSR_MAC2008); 114 - write_32bit_cp1_register(CP1_STATUS, fcsr0); 115 - fcsr0 = read_32bit_cp1_register(CP1_STATUS); 116 - 117 - fcsr1 = fcsr | FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 118 - write_32bit_cp1_register(CP1_STATUS, fcsr1); 119 - fcsr1 = read_32bit_cp1_register(CP1_STATUS); 120 - 121 - write_32bit_cp1_register(CP1_STATUS, fcsr); 122 - 123 - if (c->isa_level & (MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2)) { 124 - /* 125 - * The bit for MAC2008 might be reused by R6 in future, 126 - * so we only test for R2-R5. 127 - */ 128 - if (fcsr0 & FPU_CSR_MAC2008) 129 - c->options |= MIPS_CPU_MAC_2008_ONLY; 130 - } 131 - 132 - if (!(fcsr0 & FPU_CSR_NAN2008)) 133 - c->options |= MIPS_CPU_NAN_LEGACY; 134 - if (fcsr1 & FPU_CSR_NAN2008) 135 - c->options |= MIPS_CPU_NAN_2008; 136 - 137 - if ((fcsr0 ^ fcsr1) & FPU_CSR_ABS2008) 138 - c->fpu_msk31 &= ~FPU_CSR_ABS2008; 139 - else 140 - c->fpu_csr31 |= fcsr & FPU_CSR_ABS2008; 141 - 142 - if ((fcsr0 ^ fcsr1) & FPU_CSR_NAN2008) 143 - c->fpu_msk31 &= ~FPU_CSR_NAN2008; 144 - else 145 - c->fpu_csr31 |= fcsr & FPU_CSR_NAN2008; 146 - } else { 147 - c->options |= MIPS_CPU_NAN_LEGACY; 148 - } 149 - 150 - write_c0_status(sr); 151 - } else { 152 - c->options |= MIPS_CPU_NAN_LEGACY; 153 - } 154 - } 155 - 156 - /* 157 - * IEEE 754 conformance mode to use. Affects the NaN encoding and the 158 - * ABS.fmt/NEG.fmt execution mode. 159 - */ 160 - static enum { STRICT, LEGACY, STD2008, RELAXED } ieee754 = STRICT; 161 - 162 - /* 163 - * Set the IEEE 754 NaN encodings and the ABS.fmt/NEG.fmt execution modes 164 - * to support by the FPU emulator according to the IEEE 754 conformance 165 - * mode selected. Note that "relaxed" straps the emulator so that it 166 - * allows 2008-NaN binaries even for legacy processors. 167 - */ 168 - static void cpu_set_nofpu_2008(struct cpuinfo_mips *c) 169 - { 170 - c->options &= ~(MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY); 171 - c->fpu_csr31 &= ~(FPU_CSR_ABS2008 | FPU_CSR_NAN2008); 172 - c->fpu_msk31 &= ~(FPU_CSR_ABS2008 | FPU_CSR_NAN2008); 173 - 174 - switch (ieee754) { 175 - case STRICT: 176 - if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | 177 - MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 178 - MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 179 - MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) { 180 - c->options |= MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY; 181 - } else { 182 - c->options |= MIPS_CPU_NAN_LEGACY; 183 - c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 184 - } 185 - break; 186 - case LEGACY: 187 - c->options |= MIPS_CPU_NAN_LEGACY; 188 - c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 189 - break; 190 - case STD2008: 191 - c->options |= MIPS_CPU_NAN_2008; 192 - c->fpu_csr31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 193 - c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 194 - break; 195 - case RELAXED: 196 - c->options |= MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY; 197 - break; 198 - } 199 - } 200 - 201 - /* 202 - * Override the IEEE 754 NaN encoding and ABS.fmt/NEG.fmt execution mode 203 - * according to the "ieee754=" parameter. 204 - */ 205 - static void cpu_set_nan_2008(struct cpuinfo_mips *c) 206 - { 207 - switch (ieee754) { 208 - case STRICT: 209 - mips_use_nan_legacy = !!cpu_has_nan_legacy; 210 - mips_use_nan_2008 = !!cpu_has_nan_2008; 211 - break; 212 - case LEGACY: 213 - mips_use_nan_legacy = !!cpu_has_nan_legacy; 214 - mips_use_nan_2008 = !cpu_has_nan_legacy; 215 - break; 216 - case STD2008: 217 - mips_use_nan_legacy = !cpu_has_nan_2008; 218 - mips_use_nan_2008 = !!cpu_has_nan_2008; 219 - break; 220 - case RELAXED: 221 - mips_use_nan_legacy = true; 222 - mips_use_nan_2008 = true; 223 - break; 224 - } 225 - } 226 - 227 - /* 228 - * IEEE 754 NaN encoding and ABS.fmt/NEG.fmt execution mode override 229 - * settings: 230 - * 231 - * strict: accept binaries that request a NaN encoding supported by the FPU 232 - * legacy: only accept legacy-NaN binaries 233 - * 2008: only accept 2008-NaN binaries 234 - * relaxed: accept any binaries regardless of whether supported by the FPU 235 - */ 236 - static int __init ieee754_setup(char *s) 237 - { 238 - if (!s) 239 - return -1; 240 - else if (!strcmp(s, "strict")) 241 - ieee754 = STRICT; 242 - else if (!strcmp(s, "legacy")) 243 - ieee754 = LEGACY; 244 - else if (!strcmp(s, "2008")) 245 - ieee754 = STD2008; 246 - else if (!strcmp(s, "relaxed")) 247 - ieee754 = RELAXED; 248 - else 249 - return -1; 250 - 251 - if (!(boot_cpu_data.options & MIPS_CPU_FPU)) 252 - cpu_set_nofpu_2008(&boot_cpu_data); 253 - cpu_set_nan_2008(&boot_cpu_data); 254 - 255 - return 0; 256 - } 257 - 258 - early_param("ieee754", ieee754_setup); 259 - 260 - /* 261 - * Set the FIR feature flags for the FPU emulator. 262 - */ 263 - static void cpu_set_nofpu_id(struct cpuinfo_mips *c) 264 - { 265 - u32 value; 266 - 267 - value = 0; 268 - if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | 269 - MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 270 - MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 271 - MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) 272 - value |= MIPS_FPIR_D | MIPS_FPIR_S; 273 - if (c->isa_level & (MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 274 - MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 275 - MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) 276 - value |= MIPS_FPIR_F64 | MIPS_FPIR_L | MIPS_FPIR_W; 277 - if (c->options & MIPS_CPU_NAN_2008) 278 - value |= MIPS_FPIR_HAS2008; 279 - c->fpu_id = value; 280 - } 281 - 282 - /* Determined FPU emulator mask to use for the boot CPU with "nofpu". */ 283 - static unsigned int mips_nofpu_msk31; 284 - 285 - /* 286 - * Set options for FPU hardware. 287 - */ 288 - static void cpu_set_fpu_opts(struct cpuinfo_mips *c) 289 - { 290 - c->fpu_id = cpu_get_fpu_id(); 291 - mips_nofpu_msk31 = c->fpu_msk31; 292 - 293 - if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | 294 - MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 295 - MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 296 - MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) { 297 - if (c->fpu_id & MIPS_FPIR_3D) 298 - c->ases |= MIPS_ASE_MIPS3D; 299 - if (c->fpu_id & MIPS_FPIR_UFRP) 300 - c->options |= MIPS_CPU_UFR; 301 - if (c->fpu_id & MIPS_FPIR_FREP) 302 - c->options |= MIPS_CPU_FRE; 303 - } 304 - 305 - cpu_set_fpu_fcsr_mask(c); 306 - cpu_set_fpu_2008(c); 307 - cpu_set_nan_2008(c); 308 - } 309 - 310 - /* 311 - * Set options for the FPU emulator. 312 - */ 313 - static void cpu_set_nofpu_opts(struct cpuinfo_mips *c) 314 - { 315 - c->options &= ~MIPS_CPU_FPU; 316 - c->fpu_msk31 = mips_nofpu_msk31; 317 - 318 - cpu_set_nofpu_2008(c); 319 - cpu_set_nan_2008(c); 320 - cpu_set_nofpu_id(c); 321 - } 322 - 323 - static int mips_fpu_disabled; 324 - 325 - static int __init fpu_disable(char *s) 326 - { 327 - cpu_set_nofpu_opts(&boot_cpu_data); 328 - mips_fpu_disabled = 1; 329 - 330 - return 1; 331 - } 332 - 333 - __setup("nofpu", fpu_disable); 334 - 335 - #else /* !CONFIG_MIPS_FP_SUPPORT */ 336 - 337 - #define mips_fpu_disabled 1 338 - 339 - static inline unsigned long cpu_get_fpu_id(void) 340 - { 341 - return FPIR_IMP_NONE; 342 - } 343 - 344 - static inline int __cpu_has_fpu(void) 345 - { 346 - return 0; 347 - } 348 - 349 - static void cpu_set_fpu_opts(struct cpuinfo_mips *c) 350 - { 351 - /* no-op */ 352 - } 353 - 354 - static void cpu_set_nofpu_opts(struct cpuinfo_mips *c) 355 - { 356 - /* no-op */ 357 - } 358 - 359 - #endif /* CONFIG_MIPS_FP_SUPPORT */ 360 38 361 39 static inline unsigned long cpu_get_msa_id(void) 362 40 { ··· 1278 1600 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | 1279 1601 MIPS_CPU_FPU | MIPS_CPU_32FPR | 1280 1602 MIPS_CPU_COUNTER | MIPS_CPU_WATCH | 1281 - MIPS_CPU_LLSC | MIPS_CPU_BP_GHIST; 1603 + MIPS_CPU_LLSC; 1282 1604 c->tlbsize = 64; 1605 + write_c0_r10k_diag(read_c0_r10k_diag() | R10K_DIAG_E_GHIST); 1283 1606 break; 1284 1607 case PRID_IMP_R14000: 1285 1608 if (((c->processor_id >> 4) & 0x0f) > 2) { ··· 1294 1615 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | 1295 1616 MIPS_CPU_FPU | MIPS_CPU_32FPR | 1296 1617 MIPS_CPU_COUNTER | MIPS_CPU_WATCH | 1297 - MIPS_CPU_LLSC | MIPS_CPU_BP_GHIST; 1618 + MIPS_CPU_LLSC; 1298 1619 c->tlbsize = 64; 1620 + write_c0_r10k_diag(read_c0_r10k_diag() | R10K_DIAG_E_GHIST); 1299 1621 break; 1300 1622 case PRID_IMP_LOONGSON_64C: /* Loongson-2/3 */ 1301 1623 switch (c->processor_id & PRID_REV_MASK) { ··· 1803 2123 1804 2124 /* XBurst does not implement the CP0 counter. */ 1805 2125 c->options &= ~MIPS_CPU_COUNTER; 1806 - BUG_ON(!__builtin_constant_p(cpu_has_counter) || cpu_has_counter); 2126 + BUG_ON(__builtin_constant_p(cpu_has_counter) && cpu_has_counter); 2127 + 2128 + /* XBurst has virtually tagged icache */ 2129 + c->icache.flags |= MIPS_CACHE_VTAG; 1807 2130 1808 2131 switch (c->processor_id & PRID_IMP_MASK) { 1809 2132 ··· 1852 2169 1853 2170 /* XBurst®1 with MXU2.0 SIMD ISA */ 1854 2171 case PRID_IMP_XBURST_REV2: 2172 + /* Ingenic uses the WA bit to achieve write-combine memory writes */ 2173 + c->writecombine = _CACHE_CACHABLE_WA; 1855 2174 c->cputype = CPU_XBURST; 1856 - c->writecombine = _CACHE_UNCACHED_ACCELERATED; 1857 2175 __cpu_name[cpu] = "Ingenic XBurst"; 1858 2176 break; 1859 2177 ··· 2055 2371 cpu_set_fpu_opts(c); 2056 2372 else 2057 2373 cpu_set_nofpu_opts(c); 2058 - 2059 - if (cpu_has_bp_ghist) 2060 - write_c0_r10k_diag(read_c0_r10k_diag() | 2061 - R10K_DIAG_E_GHIST); 2062 2374 2063 2375 if (cpu_has_mips_r2_r6) { 2064 2376 c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
+171
arch/mips/kernel/cpu-r3k-probe.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * Processor capabilities determination functions. 4 + * 5 + * Copyright (C) xxxx the Anonymous 6 + * Copyright (C) 1994 - 2006 Ralf Baechle 7 + * Copyright (C) 2003, 2004 Maciej W. Rozycki 8 + * Copyright (C) 2001, 2004, 2011, 2012 MIPS Technologies, Inc. 9 + */ 10 + #include <linux/init.h> 11 + #include <linux/kernel.h> 12 + #include <linux/ptrace.h> 13 + #include <linux/smp.h> 14 + #include <linux/stddef.h> 15 + #include <linux/export.h> 16 + 17 + #include <asm/bugs.h> 18 + #include <asm/cpu.h> 19 + #include <asm/cpu-features.h> 20 + #include <asm/cpu-type.h> 21 + #include <asm/fpu.h> 22 + #include <asm/mipsregs.h> 23 + #include <asm/elf.h> 24 + 25 + #include "fpu-probe.h" 26 + 27 + /* Hardware capabilities */ 28 + unsigned int elf_hwcap __read_mostly; 29 + EXPORT_SYMBOL_GPL(elf_hwcap); 30 + 31 + void __init check_bugs32(void) 32 + { 33 + 34 + } 35 + 36 + /* 37 + * Probe whether cpu has config register by trying to play with 38 + * alternate cache bit and see whether it matters. 39 + * It's used by cpu_probe to distinguish between R3000A and R3081. 40 + */ 41 + static inline int cpu_has_confreg(void) 42 + { 43 + #ifdef CONFIG_CPU_R3000 44 + extern unsigned long r3k_cache_size(unsigned long); 45 + unsigned long size1, size2; 46 + unsigned long cfg = read_c0_conf(); 47 + 48 + size1 = r3k_cache_size(ST0_ISC); 49 + write_c0_conf(cfg ^ R30XX_CONF_AC); 50 + size2 = r3k_cache_size(ST0_ISC); 51 + write_c0_conf(cfg); 52 + return size1 != size2; 53 + #else 54 + return 0; 55 + #endif 56 + } 57 + 58 + static inline void set_elf_platform(int cpu, const char *plat) 59 + { 60 + if (cpu == 0) 61 + __elf_platform = plat; 62 + } 63 + 64 + const char *__cpu_name[NR_CPUS]; 65 + const char *__elf_platform; 66 + const char *__elf_base_platform; 67 + 68 + void cpu_probe(void) 69 + { 70 + struct cpuinfo_mips *c = &current_cpu_data; 71 + unsigned int cpu = smp_processor_id(); 72 + 73 + /* 74 + * Set a default elf platform, cpu probe may later 75 + * overwrite it with a more precise value 76 + */ 77 + set_elf_platform(cpu, "mips"); 78 + 79 + c->processor_id = PRID_IMP_UNKNOWN; 80 + c->fpu_id = FPIR_IMP_NONE; 81 + c->cputype = CPU_UNKNOWN; 82 + c->writecombine = _CACHE_UNCACHED; 83 + 84 + c->fpu_csr31 = FPU_CSR_RN; 85 + c->fpu_msk31 = FPU_CSR_RSVD | FPU_CSR_ABS2008 | FPU_CSR_NAN2008 | 86 + FPU_CSR_CONDX | FPU_CSR_FS; 87 + 88 + c->srsets = 1; 89 + 90 + c->processor_id = read_c0_prid(); 91 + switch (c->processor_id & (PRID_COMP_MASK | PRID_IMP_MASK)) { 92 + case PRID_COMP_LEGACY | PRID_IMP_R2000: 93 + c->cputype = CPU_R2000; 94 + __cpu_name[cpu] = "R2000"; 95 + c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | 96 + MIPS_CPU_NOFPUEX; 97 + if (__cpu_has_fpu()) 98 + c->options |= MIPS_CPU_FPU; 99 + c->tlbsize = 64; 100 + break; 101 + case PRID_COMP_LEGACY | PRID_IMP_R3000: 102 + if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) { 103 + if (cpu_has_confreg()) { 104 + c->cputype = CPU_R3081E; 105 + __cpu_name[cpu] = "R3081"; 106 + } else { 107 + c->cputype = CPU_R3000A; 108 + __cpu_name[cpu] = "R3000A"; 109 + } 110 + } else { 111 + c->cputype = CPU_R3000; 112 + __cpu_name[cpu] = "R3000"; 113 + } 114 + c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | 115 + MIPS_CPU_NOFPUEX; 116 + if (__cpu_has_fpu()) 117 + c->options |= MIPS_CPU_FPU; 118 + c->tlbsize = 64; 119 + break; 120 + case PRID_COMP_LEGACY | PRID_IMP_TX39: 121 + c->options = MIPS_CPU_TLB | MIPS_CPU_TX39_CACHE; 122 + 123 + if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) { 124 + c->cputype = CPU_TX3927; 125 + __cpu_name[cpu] = "TX3927"; 126 + c->tlbsize = 64; 127 + } else { 128 + switch (c->processor_id & PRID_REV_MASK) { 129 + case PRID_REV_TX3912: 130 + c->cputype = CPU_TX3912; 131 + __cpu_name[cpu] = "TX3912"; 132 + c->tlbsize = 32; 133 + break; 134 + case PRID_REV_TX3922: 135 + c->cputype = CPU_TX3922; 136 + __cpu_name[cpu] = "TX3922"; 137 + c->tlbsize = 64; 138 + break; 139 + } 140 + } 141 + break; 142 + } 143 + 144 + BUG_ON(!__cpu_name[cpu]); 145 + BUG_ON(c->cputype == CPU_UNKNOWN); 146 + 147 + /* 148 + * Platform code can force the cpu type to optimize code 149 + * generation. In that case be sure the cpu type is correctly 150 + * manually setup otherwise it could trigger some nasty bugs. 151 + */ 152 + BUG_ON(current_cpu_type() != c->cputype); 153 + 154 + if (mips_fpu_disabled) 155 + c->options &= ~MIPS_CPU_FPU; 156 + 157 + if (c->options & MIPS_CPU_FPU) 158 + cpu_set_fpu_opts(c); 159 + else 160 + cpu_set_nofpu_opts(c); 161 + } 162 + 163 + void cpu_report(void) 164 + { 165 + struct cpuinfo_mips *c = &current_cpu_data; 166 + 167 + pr_info("CPU%d revision is: %08x (%s)\n", 168 + smp_processor_id(), c->processor_id, cpu_name_string()); 169 + if (c->options & MIPS_CPU_FPU) 170 + pr_info("FPU revision is: %08x\n", c->fpu_id); 171 + }
+321
arch/mips/kernel/fpu-probe.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * Processor capabilities determination functions. 4 + * 5 + * Copyright (C) xxxx the Anonymous 6 + * Copyright (C) 1994 - 2006 Ralf Baechle 7 + * Copyright (C) 2003, 2004 Maciej W. Rozycki 8 + * Copyright (C) 2001, 2004, 2011, 2012 MIPS Technologies, Inc. 9 + */ 10 + 11 + #include <linux/init.h> 12 + #include <linux/kernel.h> 13 + 14 + #include <asm/bugs.h> 15 + #include <asm/cpu.h> 16 + #include <asm/cpu-features.h> 17 + #include <asm/cpu-type.h> 18 + #include <asm/elf.h> 19 + #include <asm/fpu.h> 20 + #include <asm/mipsregs.h> 21 + 22 + #include "fpu-probe.h" 23 + 24 + /* 25 + * Get the FPU Implementation/Revision. 26 + */ 27 + static inline unsigned long cpu_get_fpu_id(void) 28 + { 29 + unsigned long tmp, fpu_id; 30 + 31 + tmp = read_c0_status(); 32 + __enable_fpu(FPU_AS_IS); 33 + fpu_id = read_32bit_cp1_register(CP1_REVISION); 34 + write_c0_status(tmp); 35 + return fpu_id; 36 + } 37 + 38 + /* 39 + * Check if the CPU has an external FPU. 40 + */ 41 + int __cpu_has_fpu(void) 42 + { 43 + return (cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE; 44 + } 45 + 46 + /* 47 + * Determine the FCSR mask for FPU hardware. 48 + */ 49 + static inline void cpu_set_fpu_fcsr_mask(struct cpuinfo_mips *c) 50 + { 51 + unsigned long sr, mask, fcsr, fcsr0, fcsr1; 52 + 53 + fcsr = c->fpu_csr31; 54 + mask = FPU_CSR_ALL_X | FPU_CSR_ALL_E | FPU_CSR_ALL_S | FPU_CSR_RM; 55 + 56 + sr = read_c0_status(); 57 + __enable_fpu(FPU_AS_IS); 58 + 59 + fcsr0 = fcsr & mask; 60 + write_32bit_cp1_register(CP1_STATUS, fcsr0); 61 + fcsr0 = read_32bit_cp1_register(CP1_STATUS); 62 + 63 + fcsr1 = fcsr | ~mask; 64 + write_32bit_cp1_register(CP1_STATUS, fcsr1); 65 + fcsr1 = read_32bit_cp1_register(CP1_STATUS); 66 + 67 + write_32bit_cp1_register(CP1_STATUS, fcsr); 68 + 69 + write_c0_status(sr); 70 + 71 + c->fpu_msk31 = ~(fcsr0 ^ fcsr1) & ~mask; 72 + } 73 + 74 + /* 75 + * Determine the IEEE 754 NaN encodings and ABS.fmt/NEG.fmt execution modes 76 + * supported by FPU hardware. 77 + */ 78 + static void cpu_set_fpu_2008(struct cpuinfo_mips *c) 79 + { 80 + if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | 81 + MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 82 + MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 83 + MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) { 84 + unsigned long sr, fir, fcsr, fcsr0, fcsr1; 85 + 86 + sr = read_c0_status(); 87 + __enable_fpu(FPU_AS_IS); 88 + 89 + fir = read_32bit_cp1_register(CP1_REVISION); 90 + if (fir & MIPS_FPIR_HAS2008) { 91 + fcsr = read_32bit_cp1_register(CP1_STATUS); 92 + 93 + /* 94 + * MAC2008 toolchain never landed in real world, so 95 + * we're only testing whether it can be disabled and 96 + * don't try to enabled it. 97 + */ 98 + fcsr0 = fcsr & ~(FPU_CSR_ABS2008 | FPU_CSR_NAN2008 | 99 + FPU_CSR_MAC2008); 100 + write_32bit_cp1_register(CP1_STATUS, fcsr0); 101 + fcsr0 = read_32bit_cp1_register(CP1_STATUS); 102 + 103 + fcsr1 = fcsr | FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 104 + write_32bit_cp1_register(CP1_STATUS, fcsr1); 105 + fcsr1 = read_32bit_cp1_register(CP1_STATUS); 106 + 107 + write_32bit_cp1_register(CP1_STATUS, fcsr); 108 + 109 + if (c->isa_level & (MIPS_CPU_ISA_M32R2 | 110 + MIPS_CPU_ISA_M64R2)) { 111 + /* 112 + * The bit for MAC2008 might be reused by R6 113 + * in future, so we only test for R2-R5. 114 + */ 115 + if (fcsr0 & FPU_CSR_MAC2008) 116 + c->options |= MIPS_CPU_MAC_2008_ONLY; 117 + } 118 + 119 + if (!(fcsr0 & FPU_CSR_NAN2008)) 120 + c->options |= MIPS_CPU_NAN_LEGACY; 121 + if (fcsr1 & FPU_CSR_NAN2008) 122 + c->options |= MIPS_CPU_NAN_2008; 123 + 124 + if ((fcsr0 ^ fcsr1) & FPU_CSR_ABS2008) 125 + c->fpu_msk31 &= ~FPU_CSR_ABS2008; 126 + else 127 + c->fpu_csr31 |= fcsr & FPU_CSR_ABS2008; 128 + 129 + if ((fcsr0 ^ fcsr1) & FPU_CSR_NAN2008) 130 + c->fpu_msk31 &= ~FPU_CSR_NAN2008; 131 + else 132 + c->fpu_csr31 |= fcsr & FPU_CSR_NAN2008; 133 + } else { 134 + c->options |= MIPS_CPU_NAN_LEGACY; 135 + } 136 + 137 + write_c0_status(sr); 138 + } else { 139 + c->options |= MIPS_CPU_NAN_LEGACY; 140 + } 141 + } 142 + 143 + /* 144 + * IEEE 754 conformance mode to use. Affects the NaN encoding and the 145 + * ABS.fmt/NEG.fmt execution mode. 146 + */ 147 + static enum { STRICT, LEGACY, STD2008, RELAXED } ieee754 = STRICT; 148 + 149 + /* 150 + * Set the IEEE 754 NaN encodings and the ABS.fmt/NEG.fmt execution modes 151 + * to support by the FPU emulator according to the IEEE 754 conformance 152 + * mode selected. Note that "relaxed" straps the emulator so that it 153 + * allows 2008-NaN binaries even for legacy processors. 154 + */ 155 + static void cpu_set_nofpu_2008(struct cpuinfo_mips *c) 156 + { 157 + c->options &= ~(MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY); 158 + c->fpu_csr31 &= ~(FPU_CSR_ABS2008 | FPU_CSR_NAN2008); 159 + c->fpu_msk31 &= ~(FPU_CSR_ABS2008 | FPU_CSR_NAN2008); 160 + 161 + switch (ieee754) { 162 + case STRICT: 163 + if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | 164 + MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 165 + MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 166 + MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) { 167 + c->options |= MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY; 168 + } else { 169 + c->options |= MIPS_CPU_NAN_LEGACY; 170 + c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 171 + } 172 + break; 173 + case LEGACY: 174 + c->options |= MIPS_CPU_NAN_LEGACY; 175 + c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 176 + break; 177 + case STD2008: 178 + c->options |= MIPS_CPU_NAN_2008; 179 + c->fpu_csr31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 180 + c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; 181 + break; 182 + case RELAXED: 183 + c->options |= MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY; 184 + break; 185 + } 186 + } 187 + 188 + /* 189 + * Override the IEEE 754 NaN encoding and ABS.fmt/NEG.fmt execution mode 190 + * according to the "ieee754=" parameter. 191 + */ 192 + static void cpu_set_nan_2008(struct cpuinfo_mips *c) 193 + { 194 + switch (ieee754) { 195 + case STRICT: 196 + mips_use_nan_legacy = !!cpu_has_nan_legacy; 197 + mips_use_nan_2008 = !!cpu_has_nan_2008; 198 + break; 199 + case LEGACY: 200 + mips_use_nan_legacy = !!cpu_has_nan_legacy; 201 + mips_use_nan_2008 = !cpu_has_nan_legacy; 202 + break; 203 + case STD2008: 204 + mips_use_nan_legacy = !cpu_has_nan_2008; 205 + mips_use_nan_2008 = !!cpu_has_nan_2008; 206 + break; 207 + case RELAXED: 208 + mips_use_nan_legacy = true; 209 + mips_use_nan_2008 = true; 210 + break; 211 + } 212 + } 213 + 214 + /* 215 + * IEEE 754 NaN encoding and ABS.fmt/NEG.fmt execution mode override 216 + * settings: 217 + * 218 + * strict: accept binaries that request a NaN encoding supported by the FPU 219 + * legacy: only accept legacy-NaN binaries 220 + * 2008: only accept 2008-NaN binaries 221 + * relaxed: accept any binaries regardless of whether supported by the FPU 222 + */ 223 + static int __init ieee754_setup(char *s) 224 + { 225 + if (!s) 226 + return -1; 227 + else if (!strcmp(s, "strict")) 228 + ieee754 = STRICT; 229 + else if (!strcmp(s, "legacy")) 230 + ieee754 = LEGACY; 231 + else if (!strcmp(s, "2008")) 232 + ieee754 = STD2008; 233 + else if (!strcmp(s, "relaxed")) 234 + ieee754 = RELAXED; 235 + else 236 + return -1; 237 + 238 + if (!(boot_cpu_data.options & MIPS_CPU_FPU)) 239 + cpu_set_nofpu_2008(&boot_cpu_data); 240 + cpu_set_nan_2008(&boot_cpu_data); 241 + 242 + return 0; 243 + } 244 + 245 + early_param("ieee754", ieee754_setup); 246 + 247 + /* 248 + * Set the FIR feature flags for the FPU emulator. 249 + */ 250 + static void cpu_set_nofpu_id(struct cpuinfo_mips *c) 251 + { 252 + u32 value; 253 + 254 + value = 0; 255 + if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | 256 + MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 257 + MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 258 + MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) 259 + value |= MIPS_FPIR_D | MIPS_FPIR_S; 260 + if (c->isa_level & (MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 261 + MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 262 + MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) 263 + value |= MIPS_FPIR_F64 | MIPS_FPIR_L | MIPS_FPIR_W; 264 + if (c->options & MIPS_CPU_NAN_2008) 265 + value |= MIPS_FPIR_HAS2008; 266 + c->fpu_id = value; 267 + } 268 + 269 + /* Determined FPU emulator mask to use for the boot CPU with "nofpu". */ 270 + static unsigned int mips_nofpu_msk31; 271 + 272 + /* 273 + * Set options for FPU hardware. 274 + */ 275 + void cpu_set_fpu_opts(struct cpuinfo_mips *c) 276 + { 277 + c->fpu_id = cpu_get_fpu_id(); 278 + mips_nofpu_msk31 = c->fpu_msk31; 279 + 280 + if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | 281 + MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | 282 + MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5 | 283 + MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) { 284 + if (c->fpu_id & MIPS_FPIR_3D) 285 + c->ases |= MIPS_ASE_MIPS3D; 286 + if (c->fpu_id & MIPS_FPIR_UFRP) 287 + c->options |= MIPS_CPU_UFR; 288 + if (c->fpu_id & MIPS_FPIR_FREP) 289 + c->options |= MIPS_CPU_FRE; 290 + } 291 + 292 + cpu_set_fpu_fcsr_mask(c); 293 + cpu_set_fpu_2008(c); 294 + cpu_set_nan_2008(c); 295 + } 296 + 297 + /* 298 + * Set options for the FPU emulator. 299 + */ 300 + void cpu_set_nofpu_opts(struct cpuinfo_mips *c) 301 + { 302 + c->options &= ~MIPS_CPU_FPU; 303 + c->fpu_msk31 = mips_nofpu_msk31; 304 + 305 + cpu_set_nofpu_2008(c); 306 + cpu_set_nan_2008(c); 307 + cpu_set_nofpu_id(c); 308 + } 309 + 310 + int mips_fpu_disabled; 311 + 312 + static int __init fpu_disable(char *s) 313 + { 314 + cpu_set_nofpu_opts(&boot_cpu_data); 315 + mips_fpu_disabled = 1; 316 + 317 + return 1; 318 + } 319 + 320 + __setup("nofpu", fpu_disable); 321 +
+40
arch/mips/kernel/fpu-probe.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + 3 + #include <linux/kernel.h> 4 + 5 + #include <asm/cpu.h> 6 + #include <asm/cpu-info.h> 7 + 8 + #ifdef CONFIG_MIPS_FP_SUPPORT 9 + 10 + extern int mips_fpu_disabled; 11 + 12 + int __cpu_has_fpu(void); 13 + void cpu_set_fpu_opts(struct cpuinfo_mips *c); 14 + void cpu_set_nofpu_opts(struct cpuinfo_mips *c); 15 + 16 + #else /* !CONFIG_MIPS_FP_SUPPORT */ 17 + 18 + #define mips_fpu_disabled 1 19 + 20 + static inline unsigned long cpu_get_fpu_id(void) 21 + { 22 + return FPIR_IMP_NONE; 23 + } 24 + 25 + static inline int __cpu_has_fpu(void) 26 + { 27 + return 0; 28 + } 29 + 30 + static inline void cpu_set_fpu_opts(struct cpuinfo_mips *c) 31 + { 32 + /* no-op */ 33 + } 34 + 35 + static inline void cpu_set_nofpu_opts(struct cpuinfo_mips *c) 36 + { 37 + /* no-op */ 38 + } 39 + 40 + #endif /* CONFIG_MIPS_FP_SUPPORT */
-4
arch/mips/kernel/ftrace.c
··· 37 37 ftrace_modify_all_code(command); 38 38 } 39 39 40 - #endif 41 - 42 - #ifdef CONFIG_DYNAMIC_FTRACE 43 - 44 40 #define JAL 0x0c000000 /* jump & link: ip --> ra, jump to target */ 45 41 #define ADDR_MASK 0x03ffffff /* op_code|addr : 31...26|25 ....0 */ 46 42 #define JUMP_RANGE_MASK ((1UL << 28) - 1)
+1 -1
arch/mips/kernel/head.S
··· 35 35 .macro setup_c0_status set clr 36 36 .set push 37 37 mfc0 t0, CP0_STATUS 38 - or t0, ST0_CU0|\set|0x1f|\clr 38 + or t0, ST0_KERNEL_CUMASK|\set|0x1f|\clr 39 39 xor t0, 0x1f|\clr 40 40 mtc0 t0, CP0_STATUS 41 41 .set noreorder
+2 -2
arch/mips/kernel/mips-mt-fpaff.c
··· 167 167 return -EINVAL; 168 168 169 169 get_online_cpus(); 170 - read_lock(&tasklist_lock); 170 + rcu_read_lock(); 171 171 172 172 retval = -ESRCH; 173 173 p = find_process_by_pid(pid); ··· 181 181 cpumask_and(&mask, &allowed, cpu_active_mask); 182 182 183 183 out_unlock: 184 - read_unlock(&tasklist_lock); 184 + rcu_read_unlock(); 185 185 put_online_cpus(); 186 186 if (retval) 187 187 return retval;
+18 -3
arch/mips/kernel/process.c
··· 52 52 #include <asm/inst.h> 53 53 #include <asm/stacktrace.h> 54 54 #include <asm/irq_regs.h> 55 + #include <asm/exec.h> 55 56 56 57 #ifdef CONFIG_HOTPLUG_CPU 57 58 void arch_cpu_idle_dead(void) ··· 69 68 unsigned long status; 70 69 71 70 /* New thread loses kernel privileges. */ 72 - status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|ST0_FR|KU_MASK); 71 + status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|ST0_CU2|ST0_FR|KU_MASK); 73 72 status |= KU_USER; 74 73 regs->cp0_status = status; 75 74 lose_fpu(0); ··· 134 133 childregs = (struct pt_regs *) childksp - 1; 135 134 /* Put the stack after the struct pt_regs. */ 136 135 childksp = (unsigned long) childregs; 137 - p->thread.cp0_status = read_c0_status() & ~(ST0_CU2|ST0_CU1); 136 + p->thread.cp0_status = (read_c0_status() & ~(ST0_CU2|ST0_CU1)) | ST0_KERNEL_CUMASK; 138 137 if (unlikely(p->flags & PF_KTHREAD)) { 139 138 /* kernel thread */ 140 139 unsigned long status = p->thread.cp0_status; ··· 280 279 *poff = ip->i_format.simmediate / sizeof(ulong); 281 280 return 1; 282 281 } 283 - 282 + #ifdef CONFIG_CPU_LOONGSON64 283 + if ((ip->loongson3_lswc2_format.opcode == swc2_op) && 284 + (ip->loongson3_lswc2_format.ls == 1) && 285 + (ip->loongson3_lswc2_format.fr == 0) && 286 + (ip->loongson3_lswc2_format.base == 29)) { 287 + if (ip->loongson3_lswc2_format.rt == 31) { 288 + *poff = ip->loongson3_lswc2_format.offset << 1; 289 + return 1; 290 + } 291 + if (ip->loongson3_lswc2_format.rq == 31) { 292 + *poff = (ip->loongson3_lswc2_format.offset << 1) + 1; 293 + return 1; 294 + } 295 + } 296 + #endif 284 297 return 0; 285 298 #endif 286 299 }
-25
arch/mips/kernel/prom.c
··· 36 36 } 37 37 38 38 #ifdef CONFIG_USE_OF 39 - void __init early_init_dt_add_memory_arch(u64 base, u64 size) 40 - { 41 - if (base >= PHYS_ADDR_MAX) { 42 - pr_warn("Trying to add an invalid memory region, skipped\n"); 43 - return; 44 - } 45 - 46 - /* Truncate the passed memory region instead of type casting */ 47 - if (base + size - 1 >= PHYS_ADDR_MAX || base + size < base) { 48 - pr_warn("Truncate memory region %llx @ %llx to size %llx\n", 49 - size, base, PHYS_ADDR_MAX - base); 50 - size = PHYS_ADDR_MAX - base; 51 - } 52 - 53 - add_memory_region(base, size, BOOT_MEM_RAM); 54 - } 55 - 56 - int __init early_init_dt_reserve_memory_arch(phys_addr_t base, 57 - phys_addr_t size, bool nomap) 58 - { 59 - add_memory_region(base, size, 60 - nomap ? BOOT_MEM_NOMAP : BOOT_MEM_RESERVED); 61 - 62 - return 0; 63 - } 64 39 65 40 void __init __dt_setup_arch(void *bph) 66 41 {
+28 -48
arch/mips/kernel/setup.c
··· 91 91 EXPORT_SYMBOL(ARCH_PFN_OFFSET); 92 92 #endif 93 93 94 - void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type) 95 - { 96 - /* 97 - * Note: This function only exists for historical reason, 98 - * new code should use memblock_add or memblock_add_node instead. 99 - */ 100 - 101 - /* 102 - * If the region reaches the top of the physical address space, adjust 103 - * the size slightly so that (start + size) doesn't overflow 104 - */ 105 - if (start + size - 1 == PHYS_ADDR_MAX) 106 - --size; 107 - 108 - /* Sanity check */ 109 - if (start + size < start) { 110 - pr_warn("Trying to add an invalid memory region, skipped\n"); 111 - return; 112 - } 113 - 114 - if (start < PHYS_OFFSET) 115 - return; 116 - 117 - memblock_add(start, size); 118 - /* Reserve any memory except the ordinary RAM ranges. */ 119 - switch (type) { 120 - case BOOT_MEM_RAM: 121 - break; 122 - 123 - case BOOT_MEM_NOMAP: /* Discard the range from the system. */ 124 - memblock_remove(start, size); 125 - break; 126 - 127 - default: /* Reserve the rest of the memory types at boot time */ 128 - memblock_reserve(start, size); 129 - break; 130 - } 131 - } 132 - 133 94 void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_addr_t sz_max) 134 95 { 135 96 void *dm = &detect_magic; ··· 107 146 ((unsigned long long) sz_min) / SZ_1M, 108 147 ((unsigned long long) sz_max) / SZ_1M); 109 148 110 - add_memory_region(start, size, BOOT_MEM_RAM); 149 + memblock_add(start, size); 111 150 } 112 151 113 152 /* ··· 357 396 if (*p == '@') 358 397 start = memparse(p + 1, &p); 359 398 360 - add_memory_region(start, size, BOOT_MEM_RAM); 399 + memblock_add(start, size); 361 400 362 401 return 0; 363 402 } ··· 383 422 384 423 if (*p == '@') { 385 424 start_at = memparse(p+1, &p); 386 - add_memory_region(start_at, mem_size, BOOT_MEM_RAM); 425 + memblock_add(start_at, mem_size); 387 426 } else if (*p == '#') { 388 427 pr_err("\"memmap=nn#ss\" (force ACPI data) invalid on MIPS\n"); 389 428 return -EINVAL; 390 429 } else if (*p == '$') { 391 430 start_at = memparse(p+1, &p); 392 - add_memory_region(start_at, mem_size, BOOT_MEM_RESERVED); 431 + memblock_add(start_at, mem_size); 432 + memblock_reserve(start_at, mem_size); 393 433 } else { 394 434 pr_err("\"memmap\" invalid format!\n"); 395 435 return -EINVAL; ··· 405 443 early_param("memmap", early_parse_memmap); 406 444 407 445 #ifdef CONFIG_PROC_VMCORE 408 - unsigned long setup_elfcorehdr, setup_elfcorehdr_size; 446 + static unsigned long setup_elfcorehdr, setup_elfcorehdr_size; 409 447 static int __init early_parse_elfcorehdr(char *p) 410 448 { 411 449 phys_addr_t start, end; ··· 434 472 #endif 435 473 436 474 #ifdef CONFIG_KEXEC 475 + 476 + /* 64M alignment for crash kernel regions */ 477 + #define CRASH_ALIGN SZ_64M 478 + #define CRASH_ADDR_MAX SZ_512M 479 + 437 480 static void __init mips_parse_crashkernel(void) 438 481 { 439 482 unsigned long long total_mem; ··· 451 484 if (ret != 0 || crash_size <= 0) 452 485 return; 453 486 454 - if (!memblock_find_in_range(crash_base, crash_base + crash_size, crash_size, 1)) { 455 - pr_warn("Invalid memory region reserved for crash kernel\n"); 456 - return; 487 + if (crash_base <= 0) { 488 + crash_base = memblock_find_in_range(CRASH_ALIGN, CRASH_ADDR_MAX, 489 + crash_size, CRASH_ALIGN); 490 + if (!crash_base) { 491 + pr_warn("crashkernel reservation failed - No suitable area found.\n"); 492 + return; 493 + } 494 + } else { 495 + unsigned long long start; 496 + 497 + start = memblock_find_in_range(crash_base, crash_base + crash_size, 498 + crash_size, 1); 499 + if (start != crash_base) { 500 + pr_warn("Invalid memory region reserved for crash kernel\n"); 501 + return; 502 + } 457 503 } 458 504 459 505 crashk_res.start = crash_base; ··· 601 621 * arch_mem_init - initialize memory management subsystem 602 622 * 603 623 * o plat_mem_setup() detects the memory configuration and will record detected 604 - * memory areas using add_memory_region. 624 + * memory areas using memblock_add. 605 625 * 606 626 * At this stage the memory configuration of the system is known to the 607 627 * kernel but generic memory management system is still entirely uninitialized.
+7 -1
arch/mips/kernel/signal.c
··· 545 545 return err ?: protected_restore_fp_context(sc); 546 546 } 547 547 548 + #ifdef CONFIG_WAR_ICACHE_REFILLS 549 + #define SIGMASK ~(cpu_icache_line_size()-1) 550 + #else 551 + #define SIGMASK ALMASK 552 + #endif 553 + 548 554 void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, 549 555 size_t frame_size) 550 556 { ··· 571 565 572 566 sp = sigsp(sp, ksig); 573 567 574 - return (void __user *)((sp - frame_size) & (ICACHE_REFILLS_WORKAROUND_WAR ? ~(cpu_icache_line_size()-1) : ALMASK)); 568 + return (void __user *)((sp - frame_size) & SIGMASK); 575 569 } 576 570 577 571 /*
+1 -1
arch/mips/kernel/syscall.c
··· 106 106 if (unlikely(!access_ok((const void __user *)addr, 4))) 107 107 return -EINVAL; 108 108 109 - if (cpu_has_llsc && R10000_LLSC_WAR) { 109 + if (cpu_has_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) { 110 110 __asm__ __volatile__ ( 111 111 " .set push \n" 112 112 " .set arch=r4000 \n"
+1 -1
arch/mips/kernel/traps.c
··· 2204 2204 * flag that some firmware may have left set and the TS bit (for 2205 2205 * IP27). Set XX for ISA IV code to work. 2206 2206 */ 2207 - unsigned int status_set = ST0_CU0; 2207 + unsigned int status_set = ST0_KERNEL_CUMASK; 2208 2208 #ifdef CONFIG_64BIT 2209 2209 status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX; 2210 2210 #endif
+8 -2
arch/mips/lantiq/xway/sysctrl.c
··· 112 112 #define PMU_PPE_DP BIT(23) 113 113 #define PMU_PPE_DPLUS BIT(24) 114 114 #define PMU_USB1_P BIT(26) 115 + #define PMU_GPHY3 BIT(26) /* grx390 */ 115 116 #define PMU_USB1 BIT(27) 116 117 #define PMU_SWITCH BIT(28) 117 118 #define PMU_PPE_TOP BIT(29) 119 + #define PMU_GPHY0 BIT(29) /* ar10, xrx390 */ 118 120 #define PMU_GPHY BIT(30) 121 + #define PMU_GPHY1 BIT(30) /* ar10, xrx390 */ 119 122 #define PMU_PCIE_CLK BIT(31) 123 + #define PMU_GPHY2 BIT(31) /* ar10, xrx390 */ 120 124 121 125 #define PMU1_PCIE_PHY BIT(0) /* vr9-specific,moved in ar10/grx390 */ 122 126 #define PMU1_PCIE_CTL BIT(1) ··· 469 465 470 466 if (of_machine_is_compatible("lantiq,grx390") || 471 467 of_machine_is_compatible("lantiq,ar10")) { 468 + clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY0); 469 + clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY1); 470 + clkdev_add_pmu("1e108000.switch", "gphy2", 0, 0, PMU_GPHY2); 472 471 clkdev_add_pmu("1f203018.usb2-phy", "phy", 1, 2, PMU_ANALOG_USB0_P); 473 472 clkdev_add_pmu("1f203034.usb2-phy", "phy", 1, 2, PMU_ANALOG_USB1_P); 474 473 /* rc 0 */ ··· 503 496 } else if (of_machine_is_compatible("lantiq,grx390")) { 504 497 clkdev_add_static(ltq_grx390_cpu_hz(), ltq_grx390_fpi_hz(), 505 498 ltq_grx390_fpi_hz(), ltq_grx390_pp32_hz()); 499 + clkdev_add_pmu("1e108000.switch", "gphy3", 0, 0, PMU_GPHY3); 506 500 clkdev_add_pmu("1e101000.usb", "otg", 1, 0, PMU_USB0); 507 501 clkdev_add_pmu("1e106000.usb", "otg", 1, 0, PMU_USB1); 508 502 /* rc 2 */ ··· 522 514 clkdev_add_pmu("1e10b308.eth", NULL, 0, 0, PMU_SWITCH | 523 515 PMU_PPE_DP | PMU_PPE_TC); 524 516 clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF); 525 - clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY); 526 - clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY); 527 517 clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU); 528 518 clkdev_add_pmu("1e116000.mei", "afe", 1, 2, PMU_ANALOG_DSL_AFE); 529 519 clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);
+2 -10
arch/mips/loongson2ef/common/mem.c
··· 17 17 18 18 void __init prom_init_memory(void) 19 19 { 20 - add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); 21 - 22 - add_memory_region(memsize << 20, LOONGSON_PCI_MEM_START - (memsize << 23 - 20), BOOT_MEM_RESERVED); 20 + memblock_add(0x0, (memsize << 20)); 24 21 25 22 #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG 26 23 { ··· 38 41 39 42 #ifdef CONFIG_64BIT 40 43 if (highmemsize > 0) 41 - add_memory_region(LOONGSON_HIGHMEM_START, 42 - highmemsize << 20, BOOT_MEM_RAM); 43 - 44 - add_memory_region(LOONGSON_PCI_MEM_END + 1, LOONGSON_HIGHMEM_START - 45 - LOONGSON_PCI_MEM_END - 1, BOOT_MEM_RESERVED); 46 - 44 + memblock_add(LOONGSON_HIGHMEM_START, highmemsize << 20); 47 45 #endif /* !CONFIG_64BIT */ 48 46 } 49 47
+2 -2
arch/mips/loongson32/common/prom.c
··· 7 7 8 8 #include <linux/io.h> 9 9 #include <linux/init.h> 10 + #include <linux/memblock.h> 10 11 #include <linux/serial_reg.h> 11 - #include <asm/bootinfo.h> 12 12 #include <asm/fw/fw.h> 13 13 14 14 #include <loongson1.h> ··· 42 42 43 43 void __init plat_mem_setup(void) 44 44 { 45 - add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); 45 + memblock_add(0x0, (memsize << 20)); 46 46 }
+3 -26
arch/mips/loongson64/numa.c
··· 98 98 } 99 99 } 100 100 101 - static unsigned long nid_to_addroffset(unsigned int nid) 102 - { 103 - unsigned long result; 104 - switch (nid) { 105 - case 0: 106 - default: 107 - result = NODE0_ADDRSPACE_OFFSET; 108 - break; 109 - case 1: 110 - result = NODE1_ADDRSPACE_OFFSET; 111 - break; 112 - case 2: 113 - result = NODE2_ADDRSPACE_OFFSET; 114 - break; 115 - case 3: 116 - result = NODE3_ADDRSPACE_OFFSET; 117 - break; 118 - } 119 - return result; 120 - } 121 - 122 101 static void __init szmem(unsigned int node) 123 102 { 124 103 u32 i, mem_type; ··· 125 146 pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 126 147 start_pfn, end_pfn, num_physpages); 127 148 memblock_add_node(PFN_PHYS(start_pfn), 128 - PFN_PHYS(end_pfn - start_pfn), node); 149 + PFN_PHYS(node_psize), node); 129 150 break; 130 151 case SYSTEM_RAM_HIGH: 131 152 start_pfn = ((node_id << 44) + mem_start) >> PAGE_SHIFT; ··· 137 158 pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 138 159 start_pfn, end_pfn, num_physpages); 139 160 memblock_add_node(PFN_PHYS(start_pfn), 140 - PFN_PHYS(end_pfn - start_pfn), node); 161 + PFN_PHYS(node_psize), node); 141 162 break; 142 163 case SYSTEM_RAM_RESERVED: 143 164 pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", ··· 154 175 unsigned long node_addrspace_offset; 155 176 unsigned long start_pfn, end_pfn; 156 177 157 - node_addrspace_offset = nid_to_addroffset(node); 178 + node_addrspace_offset = nid_to_addrbase(node); 158 179 pr_info("Node%d's addrspace_offset is 0x%lx\n", 159 180 node, node_addrspace_offset); 160 181 ··· 221 242 unsigned long zones_size[MAX_NR_ZONES] = {0, }; 222 243 223 244 pagetable_init(); 224 - #ifdef CONFIG_ZONE_DMA32 225 245 zones_size[ZONE_DMA32] = MAX_DMA32_PFN; 226 - #endif 227 246 zones_size[ZONE_NORMAL] = max_low_pfn; 228 247 free_area_init(zones_size); 229 248 }
-5
arch/mips/loongson64/reset.c
··· 15 15 #include <loongson.h> 16 16 #include <boot_param.h> 17 17 18 - static inline void loongson_reboot(void) 19 - { 20 - ((void (*)(void))ioremap(LOONGSON_BOOT_BASE, 4)) (); 21 - } 22 - 23 18 static void loongson_restart(char *command) 24 19 { 25 20
+10 -7
arch/mips/mm/c-r4k.c
··· 130 130 131 131 #define R4600_HIT_CACHEOP_WAR_IMPL \ 132 132 do { \ 133 - if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) \ 133 + if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) && \ 134 + cpu_is_r4600_v2_x()) \ 134 135 *(volatile unsigned long *)CKSEG1; \ 135 - if (R4600_V1_HIT_CACHEOP_WAR) \ 136 + if (IS_ENABLED(CONFIG_WAR_R4600_V1_HIT_CACHEOP)) \ 136 137 __asm__ __volatile__("nop;nop;nop;nop"); \ 137 138 } while (0) 138 139 ··· 239 238 r4k_blast_dcache = blast_dcache128; 240 239 } 241 240 242 - /* force code alignment (used for TX49XX_ICACHE_INDEX_INV_WAR) */ 241 + /* force code alignment (used for CONFIG_WAR_TX49XX_ICACHE_INDEX_INV) */ 243 242 #define JUMP_TO_ALIGN(order) \ 244 243 __asm__ __volatile__( \ 245 244 "b\t1f\n\t" \ ··· 367 366 else if (ic_lsize == 16) 368 367 r4k_blast_icache_page_indexed = blast_icache16_page_indexed; 369 368 else if (ic_lsize == 32) { 370 - if (R4600_V1_INDEX_ICACHEOP_WAR && cpu_is_r4600_v1_x()) 369 + if (IS_ENABLED(CONFIG_WAR_R4600_V1_INDEX_ICACHEOP) && 370 + cpu_is_r4600_v1_x()) 371 371 r4k_blast_icache_page_indexed = 372 372 blast_icache32_r4600_v1_page_indexed; 373 - else if (TX49XX_ICACHE_INDEX_INV_WAR) 373 + else if (IS_ENABLED(CONFIG_WAR_TX49XX_ICACHE_INDEX_INV)) 374 374 r4k_blast_icache_page_indexed = 375 375 tx49_blast_icache32_page_indexed; 376 376 else if (current_cpu_type() == CPU_LOONGSON2EF) ··· 396 394 else if (ic_lsize == 16) 397 395 r4k_blast_icache = blast_icache16; 398 396 else if (ic_lsize == 32) { 399 - if (R4600_V1_INDEX_ICACHEOP_WAR && cpu_is_r4600_v1_x()) 397 + if (IS_ENABLED(CONFIG_WAR_R4600_V1_INDEX_ICACHEOP) && 398 + cpu_is_r4600_v1_x()) 400 399 r4k_blast_icache = blast_r4600_v1_icache32; 401 - else if (TX49XX_ICACHE_INDEX_INV_WAR) 400 + else if (IS_ENABLED(CONFIG_WAR_TX49XX_ICACHE_INDEX_INV)) 402 401 r4k_blast_icache = tx49_blast_icache32; 403 402 else if (current_cpu_type() == CPU_LOONGSON2EF) 404 403 r4k_blast_icache = loongson2_blast_icache32;
+10 -6
arch/mips/mm/page.c
··· 250 250 if (cpu_has_cache_cdex_s) { 251 251 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); 252 252 } else if (cpu_has_cache_cdex_p) { 253 - if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) { 253 + if (IS_ENABLED(CONFIG_WAR_R4600_V1_HIT_CACHEOP) && 254 + cpu_is_r4600_v1_x()) { 254 255 uasm_i_nop(buf); 255 256 uasm_i_nop(buf); 256 257 uasm_i_nop(buf); 257 258 uasm_i_nop(buf); 258 259 } 259 260 260 - if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 261 + if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) && 262 + cpu_is_r4600_v2_x()) 261 263 uasm_i_lw(buf, ZERO, ZERO, AT); 262 264 263 265 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); ··· 304 302 else 305 303 uasm_i_ori(&buf, A2, A0, off); 306 304 307 - if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 305 + if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) && cpu_is_r4600_v2_x()) 308 306 uasm_i_lui(&buf, AT, uasm_rel_hi(0xa0000000)); 309 307 310 308 off = cache_line_size ? min(8, pref_bias_clear_store / cache_line_size) ··· 404 402 if (cpu_has_cache_cdex_s) { 405 403 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); 406 404 } else if (cpu_has_cache_cdex_p) { 407 - if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) { 405 + if (IS_ENABLED(CONFIG_WAR_R4600_V1_HIT_CACHEOP) && 406 + cpu_is_r4600_v1_x()) { 408 407 uasm_i_nop(buf); 409 408 uasm_i_nop(buf); 410 409 uasm_i_nop(buf); 411 410 uasm_i_nop(buf); 412 411 } 413 412 414 - if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 413 + if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) && 414 + cpu_is_r4600_v2_x()) 415 415 uasm_i_lw(buf, ZERO, ZERO, AT); 416 416 417 417 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); ··· 457 453 else 458 454 uasm_i_ori(&buf, A2, A0, off); 459 455 460 - if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 456 + if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) && cpu_is_r4600_v2_x()) 461 457 uasm_i_lui(&buf, AT, uasm_rel_hi(0xa0000000)); 462 458 463 459 off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) *
+2
arch/mips/mm/sc-mips.c
··· 228 228 * contradicted by all documentation. 229 229 */ 230 230 case MACH_INGENIC_JZ4770: 231 + case MACH_INGENIC_JZ4775: 231 232 c->scache.ways = 4; 232 233 break; 233 234 ··· 237 236 * but that is contradicted by all documentation. 238 237 */ 239 238 case MACH_INGENIC_X1000: 239 + case MACH_INGENIC_X1000E: 240 240 c->scache.sets = 256; 241 241 c->scache.ways = 4; 242 242 break;
+6 -2
arch/mips/mm/tlbex.c
··· 83 83 return 0; 84 84 } 85 85 86 + extern int sb1250_m3_workaround_needed(void); 87 + 86 88 static inline int __maybe_unused bcm1250_m3_war(void) 87 89 { 88 - return BCM1250_M3_WAR; 90 + if (IS_ENABLED(CONFIG_SB1_PASS_2_WORKAROUNDS)) 91 + return sb1250_m3_workaround_needed(); 92 + return 0; 89 93 } 90 94 91 95 static inline int __maybe_unused r10000_llsc_war(void) 92 96 { 93 - return R10000_LLSC_WAR; 97 + return IS_ENABLED(CONFIG_WAR_R10000_LLSC); 94 98 } 95 99 96 100 static int use_bbit_insns(void)
+1 -1
arch/mips/mm/uasm.c
··· 394 394 void uasm_i_pref(u32 **buf, unsigned int a, signed int b, 395 395 unsigned int c) 396 396 { 397 - if (CAVIUM_OCTEON_DCACHE_PREFETCH_WAR && a <= 24 && a != 5) 397 + if (OCTEON_IS_MODEL(OCTEON_CN6XXX) && a <= 24 && a != 5) 398 398 /* 399 399 * As per erratum Core-14449, replace prefetches 0-4, 400 400 * 6-24 with 'pref 28'.
-1
arch/mips/mti-malta/malta-setup.c
··· 16 16 17 17 #include <asm/dma-coherence.h> 18 18 #include <asm/fw/fw.h> 19 - #include <asm/mach-malta/malta-dtshim.h> 20 19 #include <asm/mips-cps.h> 21 20 #include <asm/mips-boards/generic.h> 22 21 #include <asm/mips-boards/malta.h>
+1 -1
arch/mips/netlogic/xlp/setup.c
··· 89 89 if (map[i] > 0x10000000 && map[i] < 0x20000000) 90 90 map[i] = 0x20000000; 91 91 92 - add_memory_region(map[i], map[i+1] - map[i], BOOT_MEM_RAM); 92 + memblock_add(map[i], map[i+1] - map[i]); 93 93 } 94 94 } 95 95
+3 -2
arch/mips/netlogic/xlr/setup.c
··· 34 34 35 35 #include <linux/kernel.h> 36 36 #include <linux/serial_8250.h> 37 + #include <linux/memblock.h> 37 38 #include <linux/pm.h> 38 39 39 40 #include <asm/idle.h> ··· 150 149 151 150 bootm = (void *)(long)nlm_prom_info.psb_mem_map; 152 151 for (i = 0; i < bootm->nr_map; i++) { 153 - if (bootm->map[i].type != BOOT_MEM_RAM) 152 + if (bootm->map[i].type != NLM_BOOT_MEM_RAM) 154 153 continue; 155 154 start = bootm->map[i].addr; 156 155 size = bootm->map[i].size; ··· 159 158 if (i == 0 && start == 0 && size == 0x0c000000) 160 159 size = 0x0ff00000; 161 160 162 - add_memory_region(start, size - pref_backup, BOOT_MEM_RAM); 161 + memblock_add(start, size - pref_backup); 163 162 } 164 163 } 165 164
+2 -3
arch/mips/pci/pci-ar2315.c
··· 423 423 return -EINVAL; 424 424 apc->irq = irq; 425 425 426 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 427 - "ar2315-pci-ctrl"); 428 - apc->mmr_mem = devm_ioremap_resource(dev, res); 426 + apc->mmr_mem = devm_platform_ioremap_resource_byname(pdev, 427 + "ar2315-pci-ctrl"); 429 428 if (IS_ERR(apc->mmr_mem)) 430 429 return PTR_ERR(apc->mmr_mem); 431 430
+2 -2
arch/mips/pci/pci-ar71xx.c
··· 336 336 if (!apc) 337 337 return -ENOMEM; 338 338 339 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base"); 340 - apc->cfg_base = devm_ioremap_resource(&pdev->dev, res); 339 + apc->cfg_base = devm_platform_ioremap_resource_byname(pdev, 340 + "cfg_base"); 341 341 if (IS_ERR(apc->cfg_base)) 342 342 return PTR_ERR(apc->cfg_base); 343 343
+3 -6
arch/mips/pci/pci-ar724x.c
··· 372 372 if (!apc) 373 373 return -ENOMEM; 374 374 375 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl_base"); 376 - apc->ctrl_base = devm_ioremap_resource(&pdev->dev, res); 375 + apc->ctrl_base = devm_platform_ioremap_resource_byname(pdev, "ctrl_base"); 377 376 if (IS_ERR(apc->ctrl_base)) 378 377 return PTR_ERR(apc->ctrl_base); 379 378 380 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base"); 381 - apc->devcfg_base = devm_ioremap_resource(&pdev->dev, res); 379 + apc->devcfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg_base"); 382 380 if (IS_ERR(apc->devcfg_base)) 383 381 return PTR_ERR(apc->devcfg_base); 384 382 385 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "crp_base"); 386 - apc->crp_base = devm_ioremap_resource(&pdev->dev, res); 383 + apc->crp_base = devm_platform_ioremap_resource_byname(pdev, "crp_base"); 387 384 if (IS_ERR(apc->crp_base)) 388 385 return PTR_ERR(apc->crp_base); 389 386
-4
arch/mips/pnx833x/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - obj-$(CONFIG_SOC_PNX833X) += common/ 3 - obj-$(CONFIG_NXP_STB220) += stb22x/ 4 - obj-$(CONFIG_NXP_STB225) += stb22x/
-4
arch/mips/pnx833x/Platform
··· 1 - # NXP STB225 2 - cflags-$(CONFIG_SOC_PNX833X) += -I$(srctree)/arch/mips/include/asm/mach-pnx833x 3 - load-$(CONFIG_NXP_STB220) += 0xffffffff80001000 4 - load-$(CONFIG_NXP_STB225) += 0xffffffff80001000
-2
arch/mips/pnx833x/common/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - obj-y := interrupts.o platform.o prom.o setup.o reset.o
-303
arch/mips/pnx833x/common/interrupts.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * interrupts.c: Interrupt mappings for PNX833X. 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - */ 9 - #include <linux/kernel.h> 10 - #include <linux/irq.h> 11 - #include <linux/hardirq.h> 12 - #include <linux/interrupt.h> 13 - #include <asm/mipsregs.h> 14 - #include <asm/irq_cpu.h> 15 - #include <asm/setup.h> 16 - #include <irq.h> 17 - #include <irq-mapping.h> 18 - #include <gpio.h> 19 - 20 - static int mips_cpu_timer_irq; 21 - 22 - static const unsigned int irq_prio[PNX833X_PIC_NUM_IRQ] = 23 - { 24 - 0, /* unused */ 25 - 4, /* PNX833X_PIC_I2C0_INT 1 */ 26 - 4, /* PNX833X_PIC_I2C1_INT 2 */ 27 - 1, /* PNX833X_PIC_UART0_INT 3 */ 28 - 1, /* PNX833X_PIC_UART1_INT 4 */ 29 - 6, /* PNX833X_PIC_TS_IN0_DV_INT 5 */ 30 - 6, /* PNX833X_PIC_TS_IN0_DMA_INT 6 */ 31 - 7, /* PNX833X_PIC_GPIO_INT 7 */ 32 - 4, /* PNX833X_PIC_AUDIO_DEC_INT 8 */ 33 - 5, /* PNX833X_PIC_VIDEO_DEC_INT 9 */ 34 - 4, /* PNX833X_PIC_CONFIG_INT 10 */ 35 - 4, /* PNX833X_PIC_AOI_INT 11 */ 36 - 9, /* PNX833X_PIC_SYNC_INT 12 */ 37 - 9, /* PNX8335_PIC_SATA_INT 13 */ 38 - 4, /* PNX833X_PIC_OSD_INT 14 */ 39 - 9, /* PNX833X_PIC_DISP1_INT 15 */ 40 - 4, /* PNX833X_PIC_DEINTERLACER_INT 16 */ 41 - 9, /* PNX833X_PIC_DISPLAY2_INT 17 */ 42 - 4, /* PNX833X_PIC_VC_INT 18 */ 43 - 4, /* PNX833X_PIC_SC_INT 19 */ 44 - 9, /* PNX833X_PIC_IDE_INT 20 */ 45 - 9, /* PNX833X_PIC_IDE_DMA_INT 21 */ 46 - 6, /* PNX833X_PIC_TS_IN1_DV_INT 22 */ 47 - 6, /* PNX833X_PIC_TS_IN1_DMA_INT 23 */ 48 - 4, /* PNX833X_PIC_SGDX_DMA_INT 24 */ 49 - 4, /* PNX833X_PIC_TS_OUT_INT 25 */ 50 - 4, /* PNX833X_PIC_IR_INT 26 */ 51 - 3, /* PNX833X_PIC_VMSP1_INT 27 */ 52 - 3, /* PNX833X_PIC_VMSP2_INT 28 */ 53 - 4, /* PNX833X_PIC_PIBC_INT 29 */ 54 - 4, /* PNX833X_PIC_TS_IN0_TRD_INT 30 */ 55 - 4, /* PNX833X_PIC_SGDX_TPD_INT 31 */ 56 - 5, /* PNX833X_PIC_USB_INT 32 */ 57 - 4, /* PNX833X_PIC_TS_IN1_TRD_INT 33 */ 58 - 4, /* PNX833X_PIC_CLOCK_INT 34 */ 59 - 4, /* PNX833X_PIC_SGDX_PARSER_INT 35 */ 60 - 4, /* PNX833X_PIC_VMSP_DMA_INT 36 */ 61 - #if defined(CONFIG_SOC_PNX8335) 62 - 4, /* PNX8335_PIC_MIU_INT 37 */ 63 - 4, /* PNX8335_PIC_AVCHIP_IRQ_INT 38 */ 64 - 9, /* PNX8335_PIC_SYNC_HD_INT 39 */ 65 - 9, /* PNX8335_PIC_DISP_HD_INT 40 */ 66 - 9, /* PNX8335_PIC_DISP_SCALER_INT 41 */ 67 - 4, /* PNX8335_PIC_OSD_HD1_INT 42 */ 68 - 4, /* PNX8335_PIC_DTL_WRITER_Y_INT 43 */ 69 - 4, /* PNX8335_PIC_DTL_WRITER_C_INT 44 */ 70 - 4, /* PNX8335_PIC_DTL_EMULATOR_Y_IR_INT 45 */ 71 - 4, /* PNX8335_PIC_DTL_EMULATOR_C_IR_INT 46 */ 72 - 4, /* PNX8335_PIC_DENC_TTX_INT 47 */ 73 - 4, /* PNX8335_PIC_MMI_SIF0_INT 48 */ 74 - 4, /* PNX8335_PIC_MMI_SIF1_INT 49 */ 75 - 4, /* PNX8335_PIC_MMI_CDMMU_INT 50 */ 76 - 4, /* PNX8335_PIC_PIBCS_INT 51 */ 77 - 12, /* PNX8335_PIC_ETHERNET_INT 52 */ 78 - 3, /* PNX8335_PIC_VMSP1_0_INT 53 */ 79 - 3, /* PNX8335_PIC_VMSP1_1_INT 54 */ 80 - 4, /* PNX8335_PIC_VMSP1_DMA_INT 55 */ 81 - 4, /* PNX8335_PIC_TDGR_DE_INT 56 */ 82 - 4, /* PNX8335_PIC_IR1_IRQ_INT 57 */ 83 - #endif 84 - }; 85 - 86 - static void pnx833x_timer_dispatch(void) 87 - { 88 - do_IRQ(mips_cpu_timer_irq); 89 - } 90 - 91 - static void pic_dispatch(void) 92 - { 93 - unsigned int irq = PNX833X_REGFIELD(PIC_INT_SRC, INT_SRC); 94 - 95 - if ((irq >= 1) && (irq < (PNX833X_PIC_NUM_IRQ))) { 96 - unsigned long priority = PNX833X_PIC_INT_PRIORITY; 97 - PNX833X_PIC_INT_PRIORITY = irq_prio[irq]; 98 - 99 - if (irq == PNX833X_PIC_GPIO_INT) { 100 - unsigned long mask = PNX833X_PIO_INT_STATUS & PNX833X_PIO_INT_ENABLE; 101 - int pin; 102 - while ((pin = ffs(mask & 0xffff))) { 103 - pin -= 1; 104 - do_IRQ(PNX833X_GPIO_IRQ_BASE + pin); 105 - mask &= ~(1 << pin); 106 - } 107 - } else { 108 - do_IRQ(irq + PNX833X_PIC_IRQ_BASE); 109 - } 110 - 111 - PNX833X_PIC_INT_PRIORITY = priority; 112 - } else { 113 - printk(KERN_ERR "plat_irq_dispatch: unexpected irq %u\n", irq); 114 - } 115 - } 116 - 117 - asmlinkage void plat_irq_dispatch(void) 118 - { 119 - unsigned int pending = read_c0_status() & read_c0_cause(); 120 - 121 - if (pending & STATUSF_IP4) 122 - pic_dispatch(); 123 - else if (pending & STATUSF_IP7) 124 - do_IRQ(PNX833X_TIMER_IRQ); 125 - else 126 - spurious_interrupt(); 127 - } 128 - 129 - static inline void pnx833x_hard_enable_pic_irq(unsigned int irq) 130 - { 131 - /* Currently we do this by setting IRQ priority to 1. 132 - If priority support is being implemented, 1 should be repalced 133 - by a better value. */ 134 - PNX833X_PIC_INT_REG(irq) = irq_prio[irq]; 135 - } 136 - 137 - static inline void pnx833x_hard_disable_pic_irq(unsigned int irq) 138 - { 139 - /* Disable IRQ by writing setting it's priority to 0 */ 140 - PNX833X_PIC_INT_REG(irq) = 0; 141 - } 142 - 143 - static DEFINE_RAW_SPINLOCK(pnx833x_irq_lock); 144 - 145 - static unsigned int pnx833x_startup_pic_irq(unsigned int irq) 146 - { 147 - unsigned long flags; 148 - unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; 149 - 150 - raw_spin_lock_irqsave(&pnx833x_irq_lock, flags); 151 - pnx833x_hard_enable_pic_irq(pic_irq); 152 - raw_spin_unlock_irqrestore(&pnx833x_irq_lock, flags); 153 - return 0; 154 - } 155 - 156 - static void pnx833x_enable_pic_irq(struct irq_data *d) 157 - { 158 - unsigned long flags; 159 - unsigned int pic_irq = d->irq - PNX833X_PIC_IRQ_BASE; 160 - 161 - raw_spin_lock_irqsave(&pnx833x_irq_lock, flags); 162 - pnx833x_hard_enable_pic_irq(pic_irq); 163 - raw_spin_unlock_irqrestore(&pnx833x_irq_lock, flags); 164 - } 165 - 166 - static void pnx833x_disable_pic_irq(struct irq_data *d) 167 - { 168 - unsigned long flags; 169 - unsigned int pic_irq = d->irq - PNX833X_PIC_IRQ_BASE; 170 - 171 - raw_spin_lock_irqsave(&pnx833x_irq_lock, flags); 172 - pnx833x_hard_disable_pic_irq(pic_irq); 173 - raw_spin_unlock_irqrestore(&pnx833x_irq_lock, flags); 174 - } 175 - 176 - static DEFINE_RAW_SPINLOCK(pnx833x_gpio_pnx833x_irq_lock); 177 - 178 - static void pnx833x_enable_gpio_irq(struct irq_data *d) 179 - { 180 - int pin = d->irq - PNX833X_GPIO_IRQ_BASE; 181 - unsigned long flags; 182 - raw_spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); 183 - pnx833x_gpio_enable_irq(pin); 184 - raw_spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); 185 - } 186 - 187 - static void pnx833x_disable_gpio_irq(struct irq_data *d) 188 - { 189 - int pin = d->irq - PNX833X_GPIO_IRQ_BASE; 190 - unsigned long flags; 191 - raw_spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); 192 - pnx833x_gpio_disable_irq(pin); 193 - raw_spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); 194 - } 195 - 196 - static int pnx833x_set_type_gpio_irq(struct irq_data *d, unsigned int flow_type) 197 - { 198 - int pin = d->irq - PNX833X_GPIO_IRQ_BASE; 199 - int gpio_mode; 200 - 201 - switch (flow_type) { 202 - case IRQ_TYPE_EDGE_RISING: 203 - gpio_mode = GPIO_INT_EDGE_RISING; 204 - break; 205 - case IRQ_TYPE_EDGE_FALLING: 206 - gpio_mode = GPIO_INT_EDGE_FALLING; 207 - break; 208 - case IRQ_TYPE_EDGE_BOTH: 209 - gpio_mode = GPIO_INT_EDGE_BOTH; 210 - break; 211 - case IRQ_TYPE_LEVEL_HIGH: 212 - gpio_mode = GPIO_INT_LEVEL_HIGH; 213 - break; 214 - case IRQ_TYPE_LEVEL_LOW: 215 - gpio_mode = GPIO_INT_LEVEL_LOW; 216 - break; 217 - default: 218 - gpio_mode = GPIO_INT_NONE; 219 - break; 220 - } 221 - 222 - pnx833x_gpio_setup_irq(gpio_mode, pin); 223 - 224 - return 0; 225 - } 226 - 227 - static struct irq_chip pnx833x_pic_irq_type = { 228 - .name = "PNX-PIC", 229 - .irq_enable = pnx833x_enable_pic_irq, 230 - .irq_disable = pnx833x_disable_pic_irq, 231 - }; 232 - 233 - static struct irq_chip pnx833x_gpio_irq_type = { 234 - .name = "PNX-GPIO", 235 - .irq_enable = pnx833x_enable_gpio_irq, 236 - .irq_disable = pnx833x_disable_gpio_irq, 237 - .irq_set_type = pnx833x_set_type_gpio_irq, 238 - }; 239 - 240 - void __init arch_init_irq(void) 241 - { 242 - unsigned int irq; 243 - 244 - /* setup standard internal cpu irqs */ 245 - mips_cpu_irq_init(); 246 - 247 - /* Set IRQ information in irq_desc */ 248 - for (irq = PNX833X_PIC_IRQ_BASE; irq < (PNX833X_PIC_IRQ_BASE + PNX833X_PIC_NUM_IRQ); irq++) { 249 - pnx833x_hard_disable_pic_irq(irq); 250 - irq_set_chip_and_handler(irq, &pnx833x_pic_irq_type, 251 - handle_simple_irq); 252 - } 253 - 254 - for (irq = PNX833X_GPIO_IRQ_BASE; irq < (PNX833X_GPIO_IRQ_BASE + PNX833X_GPIO_NUM_IRQ); irq++) 255 - irq_set_chip_and_handler(irq, &pnx833x_gpio_irq_type, 256 - handle_simple_irq); 257 - 258 - /* Set PIC priority limiter register to 0 */ 259 - PNX833X_PIC_INT_PRIORITY = 0; 260 - 261 - /* Setup GPIO IRQ dispatching */ 262 - pnx833x_startup_pic_irq(PNX833X_PIC_GPIO_INT); 263 - 264 - /* Enable PIC IRQs (HWIRQ2) */ 265 - if (cpu_has_vint) 266 - set_vi_handler(4, pic_dispatch); 267 - 268 - write_c0_status(read_c0_status() | IE_IRQ2); 269 - } 270 - 271 - unsigned int get_c0_compare_int(void) 272 - { 273 - if (cpu_has_vint) 274 - set_vi_handler(cp0_compare_irq, pnx833x_timer_dispatch); 275 - 276 - mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; 277 - return mips_cpu_timer_irq; 278 - } 279 - 280 - void __init plat_time_init(void) 281 - { 282 - /* calculate mips_hpt_frequency based on PNX833X_CLOCK_CPUCP_CTL reg */ 283 - 284 - extern unsigned long mips_hpt_frequency; 285 - unsigned long reg = PNX833X_CLOCK_CPUCP_CTL; 286 - 287 - if (!(PNX833X_BIT(reg, CLOCK_CPUCP_CTL, EXIT_RESET))) { 288 - /* Functional clock is disabled so use crystal frequency */ 289 - mips_hpt_frequency = 25; 290 - } else { 291 - #if defined(CONFIG_SOC_PNX8335) 292 - /* Functional clock is enabled, so get clock multiplier */ 293 - mips_hpt_frequency = 90 + (10 * PNX8335_REGFIELD(CLOCK_PLL_CPU_CTL, FREQ)); 294 - #else 295 - static const unsigned long int freq[4] = {240, 160, 120, 80}; 296 - mips_hpt_frequency = freq[PNX833X_FIELD(reg, CLOCK_CPUCP_CTL, DIV_CLOCK)]; 297 - #endif 298 - } 299 - 300 - printk(KERN_INFO "CPU clock is %ld MHz\n", mips_hpt_frequency); 301 - 302 - mips_hpt_frequency *= 500000; 303 - }
-224
arch/mips/pnx833x/common/platform.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * platform.c: platform support for PNX833X. 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - * 9 - * Based on software written by: 10 - * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. 11 - */ 12 - #include <linux/device.h> 13 - #include <linux/dma-mapping.h> 14 - #include <linux/platform_device.h> 15 - #include <linux/kernel.h> 16 - #include <linux/init.h> 17 - #include <linux/resource.h> 18 - #include <linux/serial.h> 19 - #include <linux/serial_pnx8xxx.h> 20 - #include <linux/mtd/platnand.h> 21 - 22 - #include <irq.h> 23 - #include <irq-mapping.h> 24 - #include <pnx833x.h> 25 - 26 - static u64 uart_dmamask = DMA_BIT_MASK(32); 27 - 28 - static struct resource pnx833x_uart_resources[] = { 29 - [0] = { 30 - .start = PNX833X_UART0_PORTS_START, 31 - .end = PNX833X_UART0_PORTS_END, 32 - .flags = IORESOURCE_MEM, 33 - }, 34 - [1] = { 35 - .start = PNX833X_PIC_UART0_INT, 36 - .end = PNX833X_PIC_UART0_INT, 37 - .flags = IORESOURCE_IRQ, 38 - }, 39 - [2] = { 40 - .start = PNX833X_UART1_PORTS_START, 41 - .end = PNX833X_UART1_PORTS_END, 42 - .flags = IORESOURCE_MEM, 43 - }, 44 - [3] = { 45 - .start = PNX833X_PIC_UART1_INT, 46 - .end = PNX833X_PIC_UART1_INT, 47 - .flags = IORESOURCE_IRQ, 48 - }, 49 - }; 50 - 51 - struct pnx8xxx_port pnx8xxx_ports[] = { 52 - [0] = { 53 - .port = { 54 - .type = PORT_PNX8XXX, 55 - .iotype = UPIO_MEM, 56 - .membase = (void __iomem *)PNX833X_UART0_PORTS_START, 57 - .mapbase = PNX833X_UART0_PORTS_START, 58 - .irq = PNX833X_PIC_UART0_INT, 59 - .uartclk = 3692300, 60 - .fifosize = 16, 61 - .flags = UPF_BOOT_AUTOCONF, 62 - .line = 0, 63 - }, 64 - }, 65 - [1] = { 66 - .port = { 67 - .type = PORT_PNX8XXX, 68 - .iotype = UPIO_MEM, 69 - .membase = (void __iomem *)PNX833X_UART1_PORTS_START, 70 - .mapbase = PNX833X_UART1_PORTS_START, 71 - .irq = PNX833X_PIC_UART1_INT, 72 - .uartclk = 3692300, 73 - .fifosize = 16, 74 - .flags = UPF_BOOT_AUTOCONF, 75 - .line = 1, 76 - }, 77 - }, 78 - }; 79 - 80 - static struct platform_device pnx833x_uart_device = { 81 - .name = "pnx8xxx-uart", 82 - .id = -1, 83 - .dev = { 84 - .dma_mask = &uart_dmamask, 85 - .coherent_dma_mask = DMA_BIT_MASK(32), 86 - .platform_data = pnx8xxx_ports, 87 - }, 88 - .num_resources = ARRAY_SIZE(pnx833x_uart_resources), 89 - .resource = pnx833x_uart_resources, 90 - }; 91 - 92 - static u64 ehci_dmamask = DMA_BIT_MASK(32); 93 - 94 - static struct resource pnx833x_usb_ehci_resources[] = { 95 - [0] = { 96 - .start = PNX833X_USB_PORTS_START, 97 - .end = PNX833X_USB_PORTS_END, 98 - .flags = IORESOURCE_MEM, 99 - }, 100 - [1] = { 101 - .start = PNX833X_PIC_USB_INT, 102 - .end = PNX833X_PIC_USB_INT, 103 - .flags = IORESOURCE_IRQ, 104 - }, 105 - }; 106 - 107 - static struct platform_device pnx833x_usb_ehci_device = { 108 - .name = "pnx833x-ehci", 109 - .id = -1, 110 - .dev = { 111 - .dma_mask = &ehci_dmamask, 112 - .coherent_dma_mask = DMA_BIT_MASK(32), 113 - }, 114 - .num_resources = ARRAY_SIZE(pnx833x_usb_ehci_resources), 115 - .resource = pnx833x_usb_ehci_resources, 116 - }; 117 - 118 - static u64 ethernet_dmamask = DMA_BIT_MASK(32); 119 - 120 - static struct resource pnx833x_ethernet_resources[] = { 121 - [0] = { 122 - .start = PNX8335_IP3902_PORTS_START, 123 - .end = PNX8335_IP3902_PORTS_END, 124 - .flags = IORESOURCE_MEM, 125 - }, 126 - #ifdef CONFIG_SOC_PNX8335 127 - [1] = { 128 - .start = PNX8335_PIC_ETHERNET_INT, 129 - .end = PNX8335_PIC_ETHERNET_INT, 130 - .flags = IORESOURCE_IRQ, 131 - }, 132 - #endif 133 - }; 134 - 135 - static struct platform_device pnx833x_ethernet_device = { 136 - .name = "ip3902-eth", 137 - .id = -1, 138 - .dev = { 139 - .dma_mask = &ethernet_dmamask, 140 - .coherent_dma_mask = DMA_BIT_MASK(32), 141 - }, 142 - .num_resources = ARRAY_SIZE(pnx833x_ethernet_resources), 143 - .resource = pnx833x_ethernet_resources, 144 - }; 145 - 146 - static struct resource pnx833x_sata_resources[] = { 147 - [0] = { 148 - .start = PNX8335_SATA_PORTS_START, 149 - .end = PNX8335_SATA_PORTS_END, 150 - .flags = IORESOURCE_MEM, 151 - }, 152 - [1] = { 153 - .start = PNX8335_PIC_SATA_INT, 154 - .end = PNX8335_PIC_SATA_INT, 155 - .flags = IORESOURCE_IRQ, 156 - }, 157 - }; 158 - 159 - static struct platform_device pnx833x_sata_device = { 160 - .name = "pnx833x-sata", 161 - .id = -1, 162 - .num_resources = ARRAY_SIZE(pnx833x_sata_resources), 163 - .resource = pnx833x_sata_resources, 164 - }; 165 - 166 - static void 167 - pnx833x_flash_nand_cmd_ctrl(struct nand_chip *this, int cmd, unsigned int ctrl) 168 - { 169 - unsigned long nandaddr = (unsigned long)this->legacy.IO_ADDR_W; 170 - 171 - if (cmd == NAND_CMD_NONE) 172 - return; 173 - 174 - if (ctrl & NAND_CLE) 175 - writeb(cmd, (void __iomem *)(nandaddr + PNX8335_NAND_CLE_MASK)); 176 - else 177 - writeb(cmd, (void __iomem *)(nandaddr + PNX8335_NAND_ALE_MASK)); 178 - } 179 - 180 - static struct platform_nand_data pnx833x_flash_nand_data = { 181 - .chip = { 182 - .nr_chips = 1, 183 - .chip_delay = 25, 184 - }, 185 - .ctrl = { 186 - .cmd_ctrl = pnx833x_flash_nand_cmd_ctrl 187 - } 188 - }; 189 - 190 - /* 191 - * Set start to be the correct address (PNX8335_NAND_BASE with no 0xb!!), 192 - * 12 bytes more seems to be the standard that allows for NAND access. 193 - */ 194 - static struct resource pnx833x_flash_nand_resource = { 195 - .start = PNX8335_NAND_BASE, 196 - .end = PNX8335_NAND_BASE + 12, 197 - .flags = IORESOURCE_MEM, 198 - }; 199 - 200 - static struct platform_device pnx833x_flash_nand = { 201 - .name = "gen_nand", 202 - .id = -1, 203 - .num_resources = 1, 204 - .resource = &pnx833x_flash_nand_resource, 205 - .dev = { 206 - .platform_data = &pnx833x_flash_nand_data, 207 - }, 208 - }; 209 - 210 - static struct platform_device *pnx833x_platform_devices[] __initdata = { 211 - &pnx833x_uart_device, 212 - &pnx833x_usb_ehci_device, 213 - &pnx833x_ethernet_device, 214 - &pnx833x_sata_device, 215 - &pnx833x_flash_nand, 216 - }; 217 - 218 - static int __init pnx833x_platform_init(void) 219 - { 220 - return platform_add_devices(pnx833x_platform_devices, 221 - ARRAY_SIZE(pnx833x_platform_devices)); 222 - } 223 - 224 - arch_initcall(pnx833x_platform_init);
-51
arch/mips/pnx833x/common/prom.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * prom.c: 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - * 9 - * Based on software written by: 10 - * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. 11 - */ 12 - #include <linux/init.h> 13 - #include <asm/bootinfo.h> 14 - #include <linux/string.h> 15 - 16 - void __init prom_init_cmdline(void) 17 - { 18 - int argc = fw_arg0; 19 - char **argv = (char **)fw_arg1; 20 - char *c = &(arcs_cmdline[0]); 21 - int i; 22 - 23 - for (i = 1; i < argc; i++) { 24 - strcpy(c, argv[i]); 25 - c += strlen(argv[i]); 26 - if (i < argc-1) 27 - *c++ = ' '; 28 - } 29 - *c = 0; 30 - } 31 - 32 - char __init *prom_getenv(char *envname) 33 - { 34 - extern char **prom_envp; 35 - char **env = prom_envp; 36 - int i; 37 - 38 - i = strlen(envname); 39 - 40 - while (*env) { 41 - if (strncmp(envname, *env, i) == 0 && *(*env+i) == '=') 42 - return *env + i + 1; 43 - env++; 44 - } 45 - 46 - return 0; 47 - } 48 - 49 - void __init prom_free_prom_memory(void) 50 - { 51 - }
-31
arch/mips/pnx833x/common/reset.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * reset.c: reset support for PNX833X. 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - * 9 - * Based on software written by: 10 - * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. 11 - */ 12 - #include <linux/reboot.h> 13 - #include <pnx833x.h> 14 - 15 - void pnx833x_machine_restart(char *command) 16 - { 17 - PNX833X_RESET_CONTROL_2 = 0; 18 - PNX833X_RESET_CONTROL = 0; 19 - } 20 - 21 - void pnx833x_machine_halt(void) 22 - { 23 - while (1) 24 - __asm__ __volatile__ ("wait"); 25 - 26 - } 27 - 28 - void pnx833x_machine_power_off(void) 29 - { 30 - pnx833x_machine_halt(); 31 - }
-48
arch/mips/pnx833x/common/setup.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * setup.c: Setup PNX833X Soc. 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - * 9 - * Based on software written by: 10 - * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. 11 - */ 12 - #include <linux/init.h> 13 - #include <linux/interrupt.h> 14 - #include <linux/ioport.h> 15 - #include <linux/io.h> 16 - #include <linux/pci.h> 17 - #include <asm/reboot.h> 18 - #include <pnx833x.h> 19 - #include <gpio.h> 20 - 21 - extern void pnx833x_board_setup(void); 22 - extern void pnx833x_machine_restart(char *); 23 - extern void pnx833x_machine_halt(void); 24 - extern void pnx833x_machine_power_off(void); 25 - 26 - int __init plat_mem_setup(void) 27 - { 28 - /* set mips clock to 320MHz */ 29 - #if defined(CONFIG_SOC_PNX8335) 30 - PNX8335_WRITEFIELD(0x17, CLOCK_PLL_CPU_CTL, FREQ); 31 - #endif 32 - pnx833x_gpio_init(); /* so it will be ready in board_setup() */ 33 - 34 - pnx833x_board_setup(); 35 - 36 - _machine_restart = pnx833x_machine_restart; 37 - _machine_halt = pnx833x_machine_halt; 38 - pm_power_off = pnx833x_machine_power_off; 39 - 40 - /* IO/MEM resources. */ 41 - set_io_port_base(KSEG1); 42 - ioport_resource.start = 0; 43 - ioport_resource.end = ~0; 44 - iomem_resource.start = 0; 45 - iomem_resource.end = ~0; 46 - 47 - return 0; 48 - }
-2
arch/mips/pnx833x/stb22x/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - obj-y := board.o
-120
arch/mips/pnx833x/stb22x/board.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * board.c: STB225 board support. 4 - * 5 - * Copyright 2008 NXP Semiconductors 6 - * Chris Steel <chris.steel@nxp.com> 7 - * Daniel Laird <daniel.j.laird@nxp.com> 8 - * 9 - * Based on software written by: 10 - * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. 11 - */ 12 - #include <linux/init.h> 13 - #include <asm/bootinfo.h> 14 - #include <linux/mm.h> 15 - #include <pnx833x.h> 16 - #include <gpio.h> 17 - 18 - /* endianess twiddlers */ 19 - #define PNX8335_DEBUG0 0x4400 20 - #define PNX8335_DEBUG1 0x4404 21 - #define PNX8335_DEBUG2 0x4408 22 - #define PNX8335_DEBUG3 0x440c 23 - #define PNX8335_DEBUG4 0x4410 24 - #define PNX8335_DEBUG5 0x4414 25 - #define PNX8335_DEBUG6 0x4418 26 - #define PNX8335_DEBUG7 0x441c 27 - 28 - int prom_argc; 29 - char **prom_argv, **prom_envp; 30 - 31 - extern void prom_init_cmdline(void); 32 - extern char *prom_getenv(char *envname); 33 - 34 - const char *get_system_type(void) 35 - { 36 - return "NXP STB22x"; 37 - } 38 - 39 - static inline unsigned long env_or_default(char *env, unsigned long dfl) 40 - { 41 - char *str = prom_getenv(env); 42 - return str ? simple_strtol(str, 0, 0) : dfl; 43 - } 44 - 45 - void __init prom_init(void) 46 - { 47 - unsigned long memsize; 48 - 49 - prom_argc = fw_arg0; 50 - prom_argv = (char **)fw_arg1; 51 - prom_envp = (char **)fw_arg2; 52 - 53 - prom_init_cmdline(); 54 - 55 - memsize = env_or_default("memsize", 0x02000000); 56 - add_memory_region(0, memsize, BOOT_MEM_RAM); 57 - } 58 - 59 - void __init pnx833x_board_setup(void) 60 - { 61 - pnx833x_gpio_select_function_alt(4); 62 - pnx833x_gpio_select_output(4); 63 - pnx833x_gpio_select_function_alt(5); 64 - pnx833x_gpio_select_input(5); 65 - pnx833x_gpio_select_function_alt(6); 66 - pnx833x_gpio_select_input(6); 67 - pnx833x_gpio_select_function_alt(7); 68 - pnx833x_gpio_select_output(7); 69 - 70 - pnx833x_gpio_select_function_alt(25); 71 - pnx833x_gpio_select_function_alt(26); 72 - 73 - pnx833x_gpio_select_function_alt(27); 74 - pnx833x_gpio_select_function_alt(28); 75 - pnx833x_gpio_select_function_alt(29); 76 - pnx833x_gpio_select_function_alt(30); 77 - pnx833x_gpio_select_function_alt(31); 78 - pnx833x_gpio_select_function_alt(32); 79 - pnx833x_gpio_select_function_alt(33); 80 - 81 - #if IS_ENABLED(CONFIG_MTD_NAND_PLATFORM) 82 - /* Setup MIU for NAND access on CS0... 83 - * 84 - * (it seems that we must also configure CS1 for reliable operation, 85 - * otherwise the first read ID command will fail if it's read as 4 bytes 86 - * but pass if it's read as 1 word.) 87 - */ 88 - 89 - /* Setup MIU CS0 & CS1 timing */ 90 - PNX833X_MIU_SEL0 = 0; 91 - PNX833X_MIU_SEL1 = 0; 92 - PNX833X_MIU_SEL0_TIMING = 0x50003081; 93 - PNX833X_MIU_SEL1_TIMING = 0x50003081; 94 - 95 - /* Setup GPIO 00 for use as MIU CS1 (CS0 is not multiplexed, so does not need this) */ 96 - pnx833x_gpio_select_function_alt(0); 97 - 98 - /* Setup GPIO 04 to input NAND read/busy signal */ 99 - pnx833x_gpio_select_function_io(4); 100 - pnx833x_gpio_select_input(4); 101 - 102 - /* Setup GPIO 05 to disable NAND write protect */ 103 - pnx833x_gpio_select_function_io(5); 104 - pnx833x_gpio_select_output(5); 105 - pnx833x_gpio_write(1, 5); 106 - 107 - #elif IS_ENABLED(CONFIG_MTD_CFI) 108 - 109 - /* Set up MIU for 16-bit NOR access on CS0 and CS1... */ 110 - 111 - /* Setup MIU CS0 & CS1 timing */ 112 - PNX833X_MIU_SEL0 = 1; 113 - PNX833X_MIU_SEL1 = 1; 114 - PNX833X_MIU_SEL0_TIMING = 0x6A08D082; 115 - PNX833X_MIU_SEL1_TIMING = 0x6A08D082; 116 - 117 - /* Setup GPIO 00 for use as MIU CS1 (CS0 is not multiplexed, so does not need this) */ 118 - pnx833x_gpio_select_function_alt(0); 119 - #endif 120 - }
+1 -2
arch/mips/ralink/of.c
··· 84 84 if (memory_dtb) 85 85 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 86 86 else if (soc_info.mem_size) 87 - add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M, 88 - BOOT_MEM_RAM); 87 + memblock_add(soc_info.mem_base, soc_info.mem_size * SZ_1M); 89 88 else 90 89 detect_memory_region(soc_info.mem_base, 91 90 soc_info.mem_size_min * SZ_1M,
+1 -1
arch/mips/rb532/prom.c
··· 126 126 127 127 /* give all RAM to boot allocator, 128 128 * except for the first 0x400 and the last 0x200 bytes */ 129 - add_memory_region(ddrbase + 0x400, memsize - 0x600, BOOT_MEM_RAM); 129 + memblock_add(ddrbase + 0x400, memsize - 0x600); 130 130 }
+14
arch/mips/sgi-ip30/ip30-common.h
··· 3 3 #ifndef __IP30_COMMON_H 4 4 #define __IP30_COMMON_H 5 5 6 + /* 7 + * Power Switch is wired via BaseIO BRIDGE slot #6. 8 + * 9 + * ACFail is wired via BaseIO BRIDGE slot #7. 10 + */ 11 + #define IP30_POWER_IRQ HEART_L2_INT_POWER_BTN 12 + 13 + #define IP30_HEART_L0_IRQ (MIPS_CPU_IRQ_BASE + 2) 14 + #define IP30_HEART_L1_IRQ (MIPS_CPU_IRQ_BASE + 3) 15 + #define IP30_HEART_L2_IRQ (MIPS_CPU_IRQ_BASE + 4) 16 + #define IP30_HEART_TIMER_IRQ (MIPS_CPU_IRQ_BASE + 5) 17 + #define IP30_HEART_ERR_IRQ (MIPS_CPU_IRQ_BASE + 6) 18 + 19 + extern void __init ip30_install_ipi(void); 6 20 extern struct plat_smp_ops ip30_smp_ops; 7 21 extern void __init ip30_per_cpu_init(void); 8 22
+2
arch/mips/sgi-ip30/ip30-irq.c
··· 14 14 #include <asm/irq_cpu.h> 15 15 #include <asm/sgi/heart.h> 16 16 17 + #include "ip30-common.h" 18 + 17 19 struct heart_irq_data { 18 20 u64 *irq_mask; 19 21 int cpu;
+2 -1
arch/mips/sgi-ip32/ip32-memory.c
··· 9 9 #include <linux/types.h> 10 10 #include <linux/init.h> 11 11 #include <linux/kernel.h> 12 + #include <linux/memblock.h> 12 13 #include <linux/mm.h> 13 14 14 15 #include <asm/ip32/crime.h> ··· 37 36 38 37 printk("CRIME MC: bank %u base 0x%016Lx size %LuMiB\n", 39 38 bank, base, size >> 20); 40 - add_memory_region(base, size, BOOT_MEM_RAM); 39 + memblock_add(base, size); 41 40 } 42 41 } 43 42
-2
arch/mips/sgi-ip32/ip32-setup.c
··· 12 12 #include <linux/console.h> 13 13 #include <linux/init.h> 14 14 #include <linux/interrupt.h> 15 - #include <linux/mc146818rtc.h> 16 15 #include <linux/param.h> 17 16 #include <linux/sched.h> 18 17 19 18 #include <asm/bootinfo.h> 20 - #include <asm/mc146818-time.h> 21 19 #include <asm/mipsregs.h> 22 20 #include <asm/mmu_context.h> 23 21 #include <asm/sgialib.h>
+7 -9
arch/mips/sibyte/common/cfe.c
··· 114 114 if (initrd_start) { 115 115 if ((initrd_pstart > addr) && 116 116 (initrd_pstart < (addr + size))) { 117 - add_memory_region(addr, 118 - initrd_pstart - addr, 119 - BOOT_MEM_RAM); 117 + memblock_add(addr, 118 + initrd_pstart - addr); 120 119 rd_flag = 1; 121 120 } 122 121 if ((initrd_pend > addr) && 123 122 (initrd_pend < (addr + size))) { 124 - add_memory_region(initrd_pend, 125 - (addr + size) - initrd_pend, 126 - BOOT_MEM_RAM); 123 + memblock_add(initrd_pend, 124 + (addr + size) - initrd_pend); 127 125 rd_flag = 1; 128 126 } 129 127 } ··· 140 142 */ 141 143 if (size > 512) 142 144 size -= 512; 143 - add_memory_region(addr, size, BOOT_MEM_RAM); 145 + memblock_add(addr, size); 144 146 } 145 147 board_mem_region_addrs[board_mem_region_count] = addr; 146 148 board_mem_region_sizes[board_mem_region_count] = size; ··· 156 158 } 157 159 #ifdef CONFIG_BLK_DEV_INITRD 158 160 if (initrd_start) { 159 - add_memory_region(initrd_pstart, initrd_pend - initrd_pstart, 160 - BOOT_MEM_RESERVED); 161 + memblock_add(initrd_pstart, initrd_pend - initrd_pstart); 162 + memblock_reserve(initrd_pstart, initrd_pend - initrd_pstart); 161 163 } 162 164 #endif 163 165 }
-17
arch/mips/txx9/generic/setup_tx4939.c
··· 22 22 #include <linux/mtd/physmap.h> 23 23 #include <linux/platform_device.h> 24 24 #include <linux/platform_data/txx9/ndfmc.h> 25 - #include <asm/bootinfo.h> 26 25 #include <asm/reboot.h> 27 26 #include <asm/traps.h> 28 27 #include <asm/txx9irq.h> ··· 92 93 static struct resource tx4939_sdram_resource[4]; 93 94 static struct resource tx4939_sram_resource; 94 95 #define TX4939_SRAM_SIZE 0x800 95 - 96 - void __init tx4939_add_memory_regions(void) 97 - { 98 - int i; 99 - unsigned long start, size; 100 - u64 win; 101 - 102 - for (i = 0; i < 4; i++) { 103 - if (!((__u32)____raw_readq(&tx4939_ddrcptr->winen) & (1 << i))) 104 - continue; 105 - win = ____raw_readq(&tx4939_ddrcptr->win[i]); 106 - start = (unsigned long)(win >> 48); 107 - size = (((unsigned long)(win >> 32) & 0xffff) + 1) - start; 108 - add_memory_region(start << 20, size << 20, BOOT_MEM_RAM); 109 - } 110 - } 111 96 112 97 void __init tx4939_setup(void) 113 98 {
+2 -2
arch/mips/txx9/jmr3927/prom.c
··· 37 37 */ 38 38 #include <linux/init.h> 39 39 #include <linux/kernel.h> 40 - #include <asm/bootinfo.h> 40 + #include <linux/memblock.h> 41 41 #include <asm/txx9/generic.h> 42 42 #include <asm/txx9/jmr3927.h> 43 43 ··· 47 47 if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0) 48 48 pr_err("TX3927 TLB off\n"); 49 49 50 - add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM); 50 + memblock_add(0, JMR3927_SDRAM_SIZE); 51 51 txx9_sio_putchar_init(TX3927_SIO_REG(1)); 52 52 }
+3 -2
arch/mips/txx9/rbtx4927/prom.c
··· 29 29 * with this program; if not, write to the Free Software Foundation, Inc., 30 30 * 675 Mass Ave, Cambridge, MA 02139, USA. 31 31 */ 32 + 32 33 #include <linux/init.h> 33 - #include <asm/bootinfo.h> 34 + #include <linux/memblock.h> 34 35 #include <asm/txx9/generic.h> 35 36 #include <asm/txx9/rbtx4927.h> 36 37 37 38 void __init rbtx4927_prom_init(void) 38 39 { 39 - add_memory_region(0, tx4927_get_mem_size(), BOOT_MEM_RAM); 40 + memblock_add(0, tx4927_get_mem_size()); 40 41 txx9_sio_putchar_init(TX4927_SIO_REG(0) & 0xfffffffffULL); 41 42 }
+1 -2
arch/mips/txx9/rbtx4938/prom.c
··· 12 12 13 13 #include <linux/init.h> 14 14 #include <linux/memblock.h> 15 - #include <asm/bootinfo.h> 16 15 #include <asm/txx9/generic.h> 17 16 #include <asm/txx9/rbtx4938.h> 18 17 19 18 void __init rbtx4938_prom_init(void) 20 19 { 21 - add_memory_region(0, tx4938_get_mem_size(), BOOT_MEM_RAM); 20 + memblock_add(0, tx4938_get_mem_size()); 22 21 txx9_sio_putchar_init(TX4938_SIO_REG(0) & 0xfffffffffULL); 23 22 }
+13 -1
arch/mips/txx9/rbtx4939/prom.c
··· 7 7 */ 8 8 9 9 #include <linux/init.h> 10 + #include <linux/memblock.h> 10 11 #include <asm/txx9/generic.h> 11 12 #include <asm/txx9/rbtx4939.h> 12 13 13 14 void __init rbtx4939_prom_init(void) 14 15 { 15 - tx4939_add_memory_regions(); 16 + unsigned long start, size; 17 + u64 win; 18 + int i; 19 + 20 + for (i = 0; i < 4; i++) { 21 + if (!((__u32)____raw_readq(&tx4939_ddrcptr->winen) & (1 << i))) 22 + continue; 23 + win = ____raw_readq(&tx4939_ddrcptr->win[i]); 24 + start = (unsigned long)(win >> 48); 25 + size = (((unsigned long)(win >> 32) & 0xffff) + 1) - start; 26 + memblock_add(start << 20, size << 20); 27 + } 16 28 txx9_sio_putchar_init(TX4939_SIO_REG(0) & 0xfffffffffULL); 17 29 }
+1
drivers/firmware/broadcom/bcm47xx_sprom.c
··· 27 27 */ 28 28 29 29 #include <linux/bcm47xx_nvram.h> 30 + #include <linux/bcm47xx_sprom.h> 30 31 #include <linux/bcma/bcma.h> 31 32 #include <linux/etherdevice.h> 32 33 #include <linux/if_ether.h>
+4 -5
drivers/tty/serial/sb1250-duart.c
··· 35 35 36 36 #include <linux/refcount.h> 37 37 #include <asm/io.h> 38 - #include <asm/war.h> 39 38 40 39 #include <asm/sibyte/sb1250.h> 41 40 #include <asm/sibyte/sb1250_uart.h> ··· 156 157 unsigned char retval; 157 158 158 159 retval = __read_sbdchn(sport, reg); 159 - if (SIBYTE_1956_WAR) 160 + if (IS_ENABLED(CONFIG_SB1_PASS_2_WORKAROUNDS)) 160 161 __war_sbd1956(sport); 161 162 return retval; 162 163 } ··· 166 167 unsigned char retval; 167 168 168 169 retval = __read_sbdshr(sport, reg); 169 - if (SIBYTE_1956_WAR) 170 + if (IS_ENABLED(CONFIG_SB1_PASS_2_WORKAROUNDS)) 170 171 __war_sbd1956(sport); 171 172 return retval; 172 173 } ··· 174 175 static void write_sbdchn(struct sbd_port *sport, int reg, unsigned int value) 175 176 { 176 177 __write_sbdchn(sport, reg, value); 177 - if (SIBYTE_1956_WAR) 178 + if (IS_ENABLED(CONFIG_SB1_PASS_2_WORKAROUNDS)) 178 179 __war_sbd1956(sport); 179 180 } 180 181 181 182 static void write_sbdshr(struct sbd_port *sport, int reg, unsigned int value) 182 183 { 183 184 __write_sbdshr(sport, reg, value); 184 - if (SIBYTE_1956_WAR) 185 + if (IS_ENABLED(CONFIG_SB1_PASS_2_WORKAROUNDS)) 185 186 __war_sbd1956(sport); 186 187 } 187 188
+10
include/linux/bcm47xx_sprom.h
··· 9 9 #include <linux/kernel.h> 10 10 #include <linux/vmalloc.h> 11 11 12 + struct ssb_sprom; 13 + 12 14 #ifdef CONFIG_BCM47XX_SPROM 15 + void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix, 16 + bool fallback); 13 17 int bcm47xx_sprom_register_fallbacks(void); 14 18 #else 19 + static inline void bcm47xx_fill_sprom(struct ssb_sprom *sprom, 20 + const char *prefix, 21 + bool fallback) 22 + { 23 + } 24 + 15 25 static inline int bcm47xx_sprom_register_fallbacks(void) 16 26 { 17 27 return -ENOTSUPP;
+1 -1
include/linux/bcm963xx_tag.h
··· 84 84 char flash_layout_ver[FLASHLAYOUTVER_LEN]; 85 85 /* 196-199: kernel+rootfs CRC32 */ 86 86 __u32 fskernel_crc; 87 - /* 200-215: Unused except on Alice Gate where is is information */ 87 + /* 200-215: Unused except on Alice Gate where it is information */ 88 88 char information2[TAGINFO2_LEN]; 89 89 /* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */ 90 90 __u32 image_crc;
+6 -1
lib/decompress_unzstd.c
··· 178 178 int err; 179 179 size_t ret; 180 180 181 + /* 182 + * ZSTD decompression code won't be happy if the buffer size is so big 183 + * that its end address overflows. When the size is not provided, make 184 + * it as big as possible without having the end address overflow. 185 + */ 181 186 if (out_len == 0) 182 - out_len = LONG_MAX; /* no limit */ 187 + out_len = UINTPTR_MAX - (uintptr_t)out_buf; 183 188 184 189 if (fill == NULL && flush == NULL) 185 190 /*