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

Merge tag 'mips_7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS updates from Thomas Bogendoerfer:
"Cleanups and fixes"

* tag 'mips_7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (28 commits)
Revert "clk: microchip: core: allow driver to be compiled with COMPILE_TEST"
Revert "clk: microchip: fix typo in reference to a config option"
MIPS: Implement ARCH_HAS_CC_CAN_LINK
MIPS: rb532: Fix MMIO UART resource registration
MIPS: Work around LLVM bug when gp is used as global register variable
MIPS: Loongson64: env: Fixup serial clock-frequency when using LEFI
MIPS: Loongson2ef: Use pcibios_align_resource() to block io range
MIPS: Loongson2ef: Register PCI controller in early stage
clk: microchip: fix typo in reference to a config option
MIPS: Loongson64: dts: fix phy-related definition of LS7A GMAC
clk: microchip: core: allow driver to be compiled with COMPILE_TEST
MIPS: drop unused pic32.h header
watchdog: pic32-wdt: update include to use pic32.h from platform_data
watchdog: pic32-dmt: update include to use pic32.h from platform_data
serial: pic32_uart: update include to use pic32.h from platform_data
rtc: pic32: update include to use pic32.h from platform_data
pinctrl: pic32: update include to use pic32.h from platform_data
mmc: sdhci-pic32: update include to use pic32.h from platform_data
irqchip/irq-pic32-evic: update include to use pic32.h from platform_data
clk: microchip: core: update include to use pic32.h from platform_data
...

+191 -38
+1
MAINTAINERS
··· 17611 17611 F: arch/mips/ 17612 17612 F: drivers/platform/mips/ 17613 17613 F: include/dt-bindings/mips/ 17614 + F: include/linux/platform_data/pic32.h 17614 17615 17615 17616 MIPS BOSTON DEVELOPMENT BOARD 17616 17617 M: Paul Burton <paulburton@kernel.org>
+28 -1
arch/mips/Kconfig
··· 4 4 default y 5 5 select ARCH_32BIT_OFF_T if !64BIT 6 6 select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT 7 + select ARCH_HAS_CC_CAN_LINK 7 8 select ARCH_HAS_CPU_CACHE_ALIASING 8 9 select ARCH_HAS_CPU_FINALIZE_INIT 9 10 select ARCH_HAS_CURRENT_STACK_POINTER ··· 1410 1409 select CPU_MIPS32 1411 1410 select CPU_MIPSR2 1412 1411 select CPU_HAS_PREFETCH 1413 - select CPU_HAS_LOAD_STORE_LR 1414 1412 select CPU_SUPPORTS_32BIT_KERNEL 1415 1413 select CPU_SUPPORTS_HIGHMEM 1416 1414 select CPU_SUPPORTS_CPUFREQ ··· 3126 3126 # https://github.com/llvm/llvm-project/issues/61045 3127 3127 config CC_HAS_BROKEN_INLINE_COMPAT_BRANCH 3128 3128 def_bool y if CC_IS_CLANG 3129 + 3130 + config ARCH_CC_CAN_LINK_N32 3131 + bool 3132 + default $(cc_can_link_user,-mabi=n32 -EL) if MIPS32_N32 && CPU_LITTLE_ENDIAN 3133 + default $(cc_can_link_user,-mabi=n32 -EB) if MIPS32_N32 && CPU_BIG_ENDIAN 3134 + 3135 + config ARCH_CC_CAN_LINK_N64 3136 + bool 3137 + default $(cc_can_link_user,-mabi=64 -EL) if 64BIT && CPU_LITTLE_ENDIAN 3138 + default $(cc_can_link_user,-mabi=64 -EB) if 64BIT && CPU_BIG_ENDIAN 3139 + 3140 + config ARCH_CC_CAN_LINK_O32 3141 + bool 3142 + default $(cc_can_link_user,-mabi=32 -EL) if (32BIT || MIPS32_O32) && CPU_LITTLE_ENDIAN 3143 + default $(cc_can_link_user,-mabi=32 -EB) if (32BIT || MIPS32_O32) && CPU_BIG_ENDIAN 3144 + 3145 + config ARCH_CC_CAN_LINK 3146 + def_bool ARCH_CC_CAN_LINK_N32 || ARCH_CC_CAN_LINK_N64 || ARCH_CC_CAN_LINK_O32 3147 + 3148 + config ARCH_USERFLAGS 3149 + string 3150 + default "-mabi=n32 -EL" if ARCH_CC_CAN_LINK_N32 && CPU_LITTLE_ENDIAN 3151 + default "-mabi=n32 -EB" if ARCH_CC_CAN_LINK_N32 && CPU_BIG_ENDIAN 3152 + default "-mabi=64 -EL" if ARCH_CC_CAN_LINK_N64 && CPU_LITTLE_ENDIAN 3153 + default "-mabi=64 -EB" if ARCH_CC_CAN_LINK_N64 && CPU_BIG_ENDIAN 3154 + default "-mabi=32 -EL" if ARCH_CC_CAN_LINK_O32 && CPU_LITTLE_ENDIAN 3155 + default "-mabi=32 -EB" if ARCH_CC_CAN_LINK_O32 && CPU_BIG_ENDIAN 3129 3156 3130 3157 menu "Power management options" 3131 3158
+4 -2
arch/mips/boot/dts/loongson/ls7a-pch.dtsi
··· 199 199 <13 IRQ_TYPE_LEVEL_HIGH>; 200 200 interrupt-names = "macirq", "eth_lpi"; 201 201 interrupt-parent = <&pic>; 202 - phy-mode = "rgmii"; 202 + phy-mode = "rgmii-id"; 203 + phy-handle = <&phy0>; 203 204 mdio { 204 205 #address-cells = <1>; 205 206 #size-cells = <0>; ··· 223 222 <15 IRQ_TYPE_LEVEL_HIGH>; 224 223 interrupt-names = "macirq", "eth_lpi"; 225 224 interrupt-parent = <&pic>; 226 - phy-mode = "rgmii"; 225 + phy-mode = "rgmii-id"; 226 + phy-handle = <&phy1>; 227 227 mdio { 228 228 #address-cells = <1>; 229 229 #size-cells = <0>;
+6
arch/mips/include/asm/mach-loongson2ef/loongson.h
··· 324 324 325 325 #endif /* ! CONFIG_CPU_SUPPORTS_ADDRWINCFG */ 326 326 327 + #ifdef CONFIG_PCI 328 + void loongson2ef_pcibios_init(void); 329 + #else 330 + static inline void loongson2ef_pcibios_init(void) { } 331 + #endif 332 + 327 333 #endif /* __ASM_MACH_LOONGSON2EF_LOONGSON_H */
+1 -1
arch/mips/include/asm/mach-loongson64/topology.h
··· 7 7 #define cpu_to_node(cpu) (cpu_logical_map(cpu) >> 2) 8 8 9 9 extern cpumask_t __node_cpumask[]; 10 - #define cpumask_of_node(node) (&__node_cpumask[node]) 10 + #define cpumask_of_node(node) ((node) == NUMA_NO_NODE ? cpu_all_mask : &__node_cpumask[node]) 11 11 12 12 struct pci_bus; 13 13 extern int pcibus_to_node(struct pci_bus *);
+10 -7
arch/mips/include/asm/mach-pic32/pic32.h include/linux/platform_data/pic32.h
··· 3 3 * Joshua Henderson <joshua.henderson@microchip.com> 4 4 * Copyright (C) 2015 Microchip Technology Inc. All rights reserved. 5 5 */ 6 - #ifndef _ASM_MACH_PIC32_H 7 - #define _ASM_MACH_PIC32_H 6 + #ifndef __LINUX_PLATFORM_DATA_PIC32_H 7 + #define __LINUX_PLATFORM_DATA_PIC32_H 8 8 9 - #include <linux/io.h> 9 + #include <linux/types.h> 10 10 11 11 /* 12 12 * PIC32 register offsets for SET/CLR/INV where supported. ··· 26 26 #define PIC32_BASE_PORT 0x1f860000 27 27 #define PIC32_BASE_DEVCFG2 0x1fc4ff44 28 28 29 - /* 30 - * Register unlock sequence required for some register access. 31 - */ 29 + #if defined(CONFIG_MACH_PIC32) 30 + /* Register unlock sequence required for some register access. */ 32 31 void pic32_syskey_unlock_debug(const char *fn, const ulong ln); 33 32 #define pic32_syskey_unlock() \ 34 33 pic32_syskey_unlock_debug(__func__, __LINE__) 34 + #else 35 + /* COMPILE_TEST on all other architectures */ 36 + #define pic32_syskey_unlock() 37 + #endif 35 38 36 - #endif /* _ASM_MACH_PIC32_H */ 39 + #endif /* __LINUX_PLATFORM_DATA_PIC32_H */
+13
arch/mips/kernel/relocate.c
··· 420 420 goto out; 421 421 422 422 /* The current thread is now within the relocated image */ 423 + #ifndef CONFIG_CC_IS_CLANG 423 424 __current_thread_info = RELOCATED(&init_thread_union); 425 + #else 426 + /* 427 + * LLVM may wrongly restore $gp ($28) in epilog even if it's 428 + * intentionally modified. Work around this by using inline 429 + * assembly to assign $gp. $gp couldn't be listed as output or 430 + * clobber, or LLVM will still restore its original value. 431 + * See also LLVM upstream issue 432 + * https://github.com/llvm/llvm-project/issues/176546 433 + */ 434 + asm volatile("move $28, %0" : : 435 + "r" (RELOCATED(&init_thread_union))); 436 + #endif 424 437 425 438 /* Return the new kernel's entry point */ 426 439 kernel_entry = RELOCATED(start_kernel);
+11 -7
arch/mips/loongson2ef/common/pci.c
··· 17 17 18 18 static struct resource loongson_pci_io_resource = { 19 19 .name = "pci io space", 20 - .start = LOONGSON_PCI_IO_START, 20 + .start = 0x00000000UL, /* See loongson2ef_pcibios_init(). */ 21 21 .end = IO_SPACE_LIMIT, 22 22 .flags = IORESOURCE_IO, 23 23 }; ··· 73 73 #endif 74 74 } 75 75 76 - static int __init pcibios_init(void) 76 + void __init loongson2ef_pcibios_init(void) 77 77 { 78 78 setup_pcimap(); 79 79 80 + /* 81 + * ISA-mode only IDE controllers have a hard dependency on ISA IO ports. 82 + * 83 + * Claim them by setting PCI IO space to start at 0x00000000, and set 84 + * PCIBIOS_MIN_IO to prevent non-legacy PCI devices from touching 85 + * reserved regions. 86 + */ 87 + PCIBIOS_MIN_IO = LOONGSON_PCI_IO_START; 88 + 80 89 loongson_pci_controller.io_map_base = mips_io_port_base; 81 90 register_pci_controller(&loongson_pci_controller); 82 - 83 - 84 - return 0; 85 91 } 86 - 87 - arch_initcall(pcibios_init);
+1
arch/mips/loongson2ef/common/setup.c
··· 27 27 28 28 void __init plat_mem_setup(void) 29 29 { 30 + loongson2ef_pcibios_init(); 30 31 }
+98
arch/mips/loongson64/env.c
··· 16 16 17 17 #include <linux/dma-map-ops.h> 18 18 #include <linux/export.h> 19 + #include <linux/libfdt.h> 19 20 #include <linux/pci_ids.h> 20 21 #include <linux/string_choices.h> 21 22 #include <asm/bootinfo.h> ··· 56 55 loongson_fdt_blob = __dtb_loongson64_2core_2k1000_begin; 57 56 else 58 57 loongson_fdt_blob = (void *)fw_arg2; 58 + } 59 + 60 + static int __init lefi_fixup_fdt_serial(void *fdt, u64 uart_addr, u32 uart_clk) 61 + { 62 + int node, len, depth = -1; 63 + const fdt64_t *reg; 64 + fdt32_t *clk; 65 + 66 + for (node = fdt_next_node(fdt, -1, &depth); 67 + node >= 0 && depth >= 0; 68 + node = fdt_next_node(fdt, node, &depth)) { 69 + reg = fdt_getprop(fdt, node, "reg", &len); 70 + if (!reg || len <= 8 || fdt64_ld(reg) != uart_addr) 71 + continue; 72 + 73 + clk = fdt_getprop_w(fdt, node, "clock-frequency", &len); 74 + if (!clk) { 75 + pr_warn("UART 0x%llx misses clock-frequency property\n", 76 + uart_addr); 77 + return -ENOENT; 78 + } else if (len != 4) { 79 + pr_warn("UART 0x%llx has invalid clock-frequency property\n", 80 + uart_addr); 81 + return -EINVAL; 82 + } 83 + 84 + fdt32_st(clk, uart_clk); 85 + 86 + return 0; 87 + } 88 + 89 + return -ENODEV; 90 + } 91 + 92 + static void __init lefi_fixup_fdt(struct system_loongson *system) 93 + { 94 + static unsigned char fdt_buf[16 << 10] __initdata; 95 + struct uart_device *uartdev; 96 + bool is_loongson64g; 97 + u64 uart_base; 98 + int ret, i; 99 + 100 + ret = fdt_open_into(loongson_fdt_blob, fdt_buf, sizeof(fdt_buf)); 101 + if (ret) { 102 + pr_err("Failed to open FDT to fix up\n"); 103 + return; 104 + } 105 + 106 + is_loongson64g = (read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64G; 107 + 108 + for (i = 0; i < system->nr_uarts; i++) { 109 + uartdev = &system->uarts[i]; 110 + 111 + ret = lefi_fixup_fdt_serial(fdt_buf, uartdev->uart_base, 112 + uartdev->uartclk); 113 + /* 114 + * LOONGSON64G's CPU serials are mapped to two different 115 + * addresses, one full-featured but differs from 116 + * previous generations, one fully compatible with them. 117 + * 118 + * It's unspecified that which mapping should uart_base refer 119 + * to, thus we should try fixing up with both. 120 + */ 121 + if (ret == -ENODEV && is_loongson64g) { 122 + switch (uartdev->uart_base) { 123 + case 0x1fe00100: 124 + uart_base = 0x1fe001e0; 125 + break; 126 + case 0x1fe00110: 127 + uart_base = 0x1fe001e8; 128 + break; 129 + case 0x1fe001e0: 130 + uart_base = 0x1fe00100; 131 + break; 132 + case 0x1fe001e8: 133 + uart_base = 0x1fe00110; 134 + break; 135 + default: 136 + pr_err("Unexpected UART address 0x%llx passed by firmware\n", 137 + uartdev->uart_base); 138 + ret = -EINVAL; 139 + goto err_fixup; 140 + } 141 + 142 + ret = lefi_fixup_fdt_serial(fdt_buf, uart_base, 143 + uartdev->uartclk); 144 + } 145 + 146 + err_fixup: 147 + if (ret) 148 + pr_err("Couldn't fix up FDT node for UART 0x%llx\n", 149 + uartdev->uart_base); 150 + } 151 + 152 + loongson_fdt_blob = fdt_buf; 59 153 } 60 154 61 155 void __init prom_lefi_init_env(void) ··· 333 237 334 238 if (!loongson_fdt_blob) 335 239 pr_err("Failed to determine built-in Loongson64 dtb\n"); 240 + else 241 + lefi_fixup_fdt(esys); 336 242 }
+2 -1
arch/mips/pic32/common/reset.c
··· 4 4 * Copyright (C) 2015 Microchip Technology Inc. All rights reserved. 5 5 */ 6 6 #include <linux/init.h> 7 + #include <linux/io.h> 8 + #include <linux/platform_data/pic32.h> 7 9 #include <linux/pm.h> 8 10 #include <asm/reboot.h> 9 - #include <asm/mach-pic32/pic32.h> 10 11 11 12 #define PIC32_RSWRST 0x10 12 13
+1 -2
arch/mips/pic32/pic32mzda/config.c
··· 5 5 */ 6 6 #include <linux/init.h> 7 7 #include <linux/io.h> 8 + #include <linux/platform_data/pic32.h> 8 9 #include <linux/spinlock.h> 9 - 10 - #include <asm/mach-pic32/pic32.h> 11 10 12 11 #include "pic32mzda.h" 13 12
+2 -1
arch/mips/pic32/pic32mzda/early_clk.c
··· 3 3 * Joshua Henderson <joshua.henderson@microchip.com> 4 4 * Copyright (C) 2015 Microchip Technology Inc. All rights reserved. 5 5 */ 6 - #include <asm/mach-pic32/pic32.h> 6 + #include <linux/io.h> 7 + #include <linux/platform_data/pic32.h> 7 8 8 9 #include "pic32mzda.h" 9 10
+2 -1
arch/mips/pic32/pic32mzda/early_console.c
··· 3 3 * Joshua Henderson <joshua.henderson@microchip.com> 4 4 * Copyright (C) 2015 Microchip Technology Inc. All rights reserved. 5 5 */ 6 - #include <asm/mach-pic32/pic32.h> 6 + #include <linux/io.h> 7 + #include <linux/platform_data/pic32.h> 7 8 #include <asm/fw/fw.h> 8 9 #include <asm/setup.h> 9 10
+3 -2
arch/mips/rb532/devices.c
··· 213 213 static struct plat_serial8250_port rb532_uart_res[] = { 214 214 { 215 215 .type = PORT_16550A, 216 - .membase = (char *)KSEG1ADDR(REGBASE + UART0BASE), 216 + .mapbase = REGBASE + UART0BASE, 217 + .mapsize = 0x1000, 217 218 .irq = UART0_IRQ, 218 219 .regshift = 2, 219 220 .iotype = UPIO_MEM, 220 - .flags = UPF_BOOT_AUTOCONF, 221 + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, 221 222 }, 222 223 { 223 224 .flags = 0,
+1 -1
drivers/clk/microchip/clk-core.c
··· 9 9 #include <linux/interrupt.h> 10 10 #include <linux/io.h> 11 11 #include <linux/iopoll.h> 12 - #include <asm/mach-pic32/pic32.h> 12 + #include <linux/platform_data/pic32.h> 13 13 14 14 #include "clk-core.h" 15 15
+1 -1
drivers/irqchip/irq-pic32-evic.c
··· 13 13 #include <linux/io.h> 14 14 #include <linux/irqchip.h> 15 15 #include <linux/irq.h> 16 + #include <linux/platform_data/pic32.h> 16 17 17 18 #include <asm/irq.h> 18 19 #include <asm/traps.h> 19 - #include <asm/mach-pic32/pic32.h> 20 20 21 21 #define REG_INTCON 0x0000 22 22 #define REG_INTSTAT 0x0020
+1 -1
drivers/mmc/host/sdhci-pic32.c
··· 18 18 #include <linux/interrupt.h> 19 19 #include <linux/irq.h> 20 20 #include <linux/of.h> 21 + #include <linux/platform_data/sdhci-pic32.h> 21 22 #include <linux/platform_device.h> 22 23 #include <linux/pm.h> 23 24 #include <linux/slab.h> ··· 26 25 #include <linux/io.h> 27 26 #include "sdhci.h" 28 27 #include "sdhci-pltfm.h" 29 - #include <linux/platform_data/sdhci-pic32.h> 30 28 31 29 #define SDH_SHARED_BUS_CTRL 0x000000E0 32 30 #define SDH_SHARED_BUS_NR_CLK_PINS_MASK 0x7
+1 -2
drivers/pinctrl/pinctrl-pic32.c
··· 15 15 #include <linux/pinctrl/pinconf-generic.h> 16 16 #include <linux/pinctrl/pinctrl.h> 17 17 #include <linux/pinctrl/pinmux.h> 18 + #include <linux/platform_data/pic32.h> 18 19 #include <linux/platform_device.h> 19 20 #include <linux/seq_file.h> 20 21 #include <linux/slab.h> 21 22 #include <linux/spinlock.h> 22 - 23 - #include <asm/mach-pic32/pic32.h> 24 23 25 24 #include "pinctrl-utils.h" 26 25 #include "pinctrl-pic32.h"
+1 -2
drivers/rtc/rtc-pic32.c
··· 15 15 #include <linux/clk.h> 16 16 #include <linux/rtc.h> 17 17 #include <linux/bcd.h> 18 - 19 - #include <asm/mach-pic32/pic32.h> 18 + #include <linux/platform_data/pic32.h> 20 19 21 20 #define PIC32_RTCCON 0x00 22 21 #define PIC32_RTCCON_ON BIT(15)
+1 -2
drivers/tty/serial/pic32_uart.c
··· 22 22 #include <linux/tty_flip.h> 23 23 #include <linux/serial_core.h> 24 24 #include <linux/delay.h> 25 - 26 - #include <asm/mach-pic32/pic32.h> 25 + #include <linux/platform_data/pic32.h> 27 26 28 27 /* UART name and device definitions */ 29 28 #define PIC32_DEV_NAME "pic32-uart"
+1 -2
drivers/watchdog/pic32-dmt.c
··· 12 12 #include <linux/kernel.h> 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 + #include <linux/platform_data/pic32.h> 15 16 #include <linux/platform_device.h> 16 17 #include <linux/pm.h> 17 18 #include <linux/watchdog.h> 18 - 19 - #include <asm/mach-pic32/pic32.h> 20 19 21 20 /* Deadman Timer Regs */ 22 21 #define DMTCON_REG 0x00
+1 -2
drivers/watchdog/pic32-wdt.c
··· 12 12 #include <linux/kernel.h> 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 + #include <linux/platform_data/pic32.h> 15 16 #include <linux/platform_device.h> 16 17 #include <linux/pm.h> 17 18 #include <linux/watchdog.h> 18 - 19 - #include <asm/mach-pic32/pic32.h> 20 19 21 20 /* Watchdog Timer Registers */ 22 21 #define WDTCON_REG 0x00