Skip to content

Commit 4305f42

Browse files
committed
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "This is the main pull request for MIPS for 4.8. Also includes is a minor SSB cleanup as SSB code traditionally is merged through the MIPS tree: ATH25: - MIPS: Add default configuration for ath25 Boot: - For zboot, copy appended dtb to the end of the kernel - store the appended dtb address in a variable BPF: - Fix off by one error in offset allocation Cobalt code: - Fix typos Core code: - debugfs_create_file returns NULL on error, so don't use IS_ERR for testing for errors. - Fix double locking issue in RM7000 S-cache code. This would only affect RM7000 ARC systems on reboot. - Fix page table corruption on THP permission changes. - Use compat_sys_keyctl for 32 bit userspace on 64 bit kernels. David says, there are no compatibility issues raised by this fix. - Move some signal code around. - Rewrite r4k count/compare clockevent device registration such that min_delta_ticks/max_delta_ticks files are guaranteed to be initialized. - Only register r4k count/compare as clockevent device if we can assume the clock to be constant. - Fix MSA asm warnings in control reg accessors - uasm and tlbex fixes and tweaking. - Print segment physical address when EU=1. - Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO. - CP: Allow booting by VP other than VP 0 - Cache handling fixes and optimizations for r4k class caches - Add hotplug support for R6 processors - Cleanup hotplug bits in kconfig - traps: return correct si code for accessing nonmapped addresses - Remove cpu_has_safe_index_cacheops Lantiq: - Register IRQ handler for virtual IRQ number - Fix EIU interrupt loading code - Use the real EXIN count - Fix build error. Loongson 3: - Increase HPET_MIN_PROG_DELTA and decrease HPET_MIN_CYCLES Octeon: - Delete built-in DTB pruning code for D-Link DSR-1000N. - Clean up GPIO definitions in dlink_dsr-1000n.dts. - Add more LEDs to the DSR-100n DTS - Fix off by one in octeon_irq_gpio_map() - Typo fixes - Enable SATA by default in cavium_octeon_defconfig - Support readq/writeq() - Remove forced mappings of USB interrupts. - Ensure DMA descriptors are always in the low 4GB - Improve USB reset code for OCTEON II. Pistachio: - Add maintainers entry for pistachio SoC Support - Remove plat_setup_iocoherency Ralink: - Fix pwm UART in spis group pinmux. SSB: - Change bare unsigned to unsigned int to suit coding style Tools: - Fix reloc tool compiler warnings. Other: - Delete use of ARCH_WANT_OPTIONAL_GPIOLIB" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (61 commits) MIPS: mm: Fix definition of R6 cache instruction MIPS: tools: Fix relocs tool compiler warnings MIPS: Cobalt: Fix typo MIPS: Octeon: Fix typo MIPS: Lantiq: Fix build failure MIPS: Use CPHYSADDR to implement mips32 __pa MIPS: Octeon: Dlink_dsr-1000n.dts: add more leds. MIPS: Octeon: Clean up GPIO definitions in dlink_dsr-1000n.dts. MIPS: Octeon: Delete built-in DTB pruning code for D-Link DSR-1000N. MIPS: store the appended dtb address in a variable MIPS: ZBOOT: copy appended dtb to the end of the kernel MIPS: ralink: fix spis group pinmux MIPS: Factor o32 specific code into signal_o32.c MIPS: non-exec stack & heap when non-exec PT_GNU_STACK is present MIPS: Use per-mm page to execute branch delay slot instructions MIPS: Modify error handling MIPS: c-r4k: Use SMP calls for CM indexed cache ops MIPS: c-r4k: Avoid small flush_icache_range SMP calls MIPS: c-r4k: Local flush_icache_range cache op override MIPS: c-r4k: Split r4k_flush_kernel_vmap_range() ...
2 parents db82627 + 4a89cf8 commit 4305f42

69 files changed

Lines changed: 1418 additions & 806 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎MAINTAINERS‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9252,6 +9252,16 @@ W: http://www.st.com/spear
92529252
S: Maintained
92539253
F: drivers/pinctrl/spear/
92549254

9255+
PISTACHIO SOC SUPPORT
9256+
M: James Hartley <james.hartley@imgtec.com>
9257+
M: Ionela Voinescu <ionela.voinescu@imgtec.com>
9258+
L: linux-mips@linux-mips.org
9259+
S: Maintained
9260+
F: arch/mips/pistachio/
9261+
F: arch/mips/include/asm/mach-pistachio/
9262+
F: arch/mips/boot/dts/pistachio/
9263+
F: arch/mips/configs/pistachio*_defconfig
9264+
92559265
PKTCDVD DRIVER
92569266
M: Jiri Kosina <jikos@kernel.org>
92579267
S: Maintained

‎arch/mips/Kconfig‎

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ config MIPS
6464
select GENERIC_TIME_VSYSCALL
6565
select ARCH_CLOCKSOURCE_DATA
6666
select HANDLE_DOMAIN_IRQ
67+
select HAVE_EXIT_THREAD
6768

6869
menu "Machine selection"
6970

@@ -384,7 +385,7 @@ config MACH_PISTACHIO
384385
select CLKSRC_MIPS_GIC
385386
select COMMON_CLK
386387
select CSRC_R4K
387-
select DMA_MAYBE_COHERENT
388+
select DMA_NONCOHERENT
388389
select GPIOLIB
389390
select IRQ_MIPS_CPU
390391
select LIBFDT
@@ -880,7 +881,6 @@ config CAVIUM_OCTEON_SOC
880881
select SYS_SUPPORTS_HOTPLUG_CPU if CPU_BIG_ENDIAN
881882
select SYS_HAS_EARLY_PRINTK
882883
select SYS_HAS_CPU_CAVIUM_OCTEON
883-
select SWAP_IO_SPACE
884884
select HW_HAS_PCI
885885
select ZONE_DMA32
886886
select HOLES_IN_ZONE
@@ -1111,16 +1111,6 @@ config NEED_DMA_MAP_STATE
11111111
config SYS_HAS_EARLY_PRINTK
11121112
bool
11131113

1114-
config HOTPLUG_CPU
1115-
bool "Support for hot-pluggable CPUs"
1116-
depends on SMP && SYS_SUPPORTS_HOTPLUG_CPU
1117-
help
1118-
Say Y here to allow turning CPUs off and on. CPUs can be
1119-
controlled through /sys/devices/system/cpu.
1120-
(Note: power management support will enable this option
1121-
automatically on SMP systems. )
1122-
Say N if you want to disable CPU hotplug.
1123-
11241114
config SYS_SUPPORTS_HOTPLUG_CPU
11251115
bool
11261116

@@ -1406,7 +1396,6 @@ config CPU_LOONGSON1B
14061396
bool "Loongson 1B"
14071397
depends on SYS_HAS_CPU_LOONGSON1B
14081398
select CPU_LOONGSON1
1409-
select ARCH_WANT_OPTIONAL_GPIOLIB
14101399
select LEDS_GPIO_REGISTER
14111400
help
14121401
The Loongson 1B is a 32-bit SoC, which implements the MIPS32
@@ -2636,6 +2625,16 @@ config SMP
26362625

26372626
If you don't know what to do here, say N.
26382627

2628+
config HOTPLUG_CPU
2629+
bool "Support for hot-pluggable CPUs"
2630+
depends on SMP && SYS_SUPPORTS_HOTPLUG_CPU
2631+
help
2632+
Say Y here to allow turning CPUs off and on. CPUs can be
2633+
controlled through /sys/devices/system/cpu.
2634+
(Note: power management support will enable this option
2635+
automatically on SMP systems. )
2636+
Say N if you want to disable CPU hotplug.
2637+
26392638
config SMP_UP
26402639
bool
26412640

@@ -2887,10 +2886,10 @@ choice
28872886
the documented boot protocol using a device tree.
28882887

28892888
config MIPS_RAW_APPENDED_DTB
2890-
bool "vmlinux.bin"
2889+
bool "vmlinux.bin or vmlinuz.bin"
28912890
help
28922891
With this option, the boot code will look for a device tree binary
2893-
DTB) appended to raw vmlinux.bin (without decompressor).
2892+
DTB) appended to raw vmlinux.bin or vmlinuz.bin.
28942893
(e.g. cat vmlinux.bin <filename>.dtb > vmlinux_w_dtb).
28952894

28962895
This is meant as a backward compatibility convenience for those
@@ -2902,24 +2901,6 @@ choice
29022901
look like a DTB header after a reboot if no actual DTB is appended
29032902
to vmlinux.bin. Do not leave this option active in a production kernel
29042903
if you don't intend to always append a DTB.
2905-
2906-
config MIPS_ZBOOT_APPENDED_DTB
2907-
bool "vmlinuz.bin"
2908-
depends on SYS_SUPPORTS_ZBOOT
2909-
help
2910-
With this option, the boot code will look for a device tree binary
2911-
DTB) appended to raw vmlinuz.bin (with decompressor).
2912-
(e.g. cat vmlinuz.bin <filename>.dtb > vmlinuz_w_dtb).
2913-
2914-
This is meant as a backward compatibility convenience for those
2915-
systems with a bootloader that can't be upgraded to accommodate
2916-
the documented boot protocol using a device tree.
2917-
2918-
Beware that there is very little in terms of protection against
2919-
this option being confused by leftover garbage in memory that might
2920-
look like a DTB header after a reboot if no actual DTB is appended
2921-
to vmlinuz.bin. Do not leave this option active in a production kernel
2922-
if you don't intend to always append a DTB.
29232904
endchoice
29242905

29252906
choice

‎arch/mips/ath79/setup.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ void __init plat_mem_setup(void)
203203
fdt_start = fw_getenvl("fdt_start");
204204
if (fdt_start)
205205
__dt_setup_arch((void *)KSEG0ADDR(fdt_start));
206-
else if (fw_arg0 == -2)
207-
__dt_setup_arch((void *)KSEG0ADDR(fw_arg1));
206+
else if (fw_passed_dtb)
207+
__dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb));
208208

209209
if (mips_machtype != ATH79_MACH_GENERIC_OF) {
210210
ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,

‎arch/mips/bmips/setup.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ void __init plat_mem_setup(void)
162162
/* intended to somewhat resemble ARM; see Documentation/arm/Booting */
163163
if (fw_arg0 == 0 && fw_arg1 == 0xffffffff)
164164
dtb = phys_to_virt(fw_arg2);
165-
else if (fw_arg0 == -2) /* UHI interface */
166-
dtb = (void *)fw_arg1;
165+
else if (fw_passed_dtb) /* UHI interface */
166+
dtb = (void *)fw_passed_dtb;
167167
else if (__dtb_start != __dtb_end)
168168
dtb = (void *)__dtb_start;
169169
else

‎arch/mips/boot/compressed/decompress.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/types.h>
1515
#include <linux/kernel.h>
1616
#include <linux/string.h>
17+
#include <linux/libfdt.h>
1718

1819
#include <asm/addrspace.h>
1920

@@ -36,6 +37,8 @@ extern void puthex(unsigned long long val);
3637
#define puthex(val) do {} while (0)
3738
#endif
3839

40+
extern char __appended_dtb[];
41+
3942
void error(char *x)
4043
{
4144
puts("\n\n");
@@ -114,6 +117,20 @@ void decompress_kernel(unsigned long boot_heap_start)
114117
__decompress((char *)zimage_start, zimage_size, 0, 0,
115118
(void *)VMLINUX_LOAD_ADDRESS_ULL, 0, 0, error);
116119

120+
if (IS_ENABLED(CONFIG_MIPS_RAW_APPENDED_DTB) &&
121+
fdt_magic((void *)&__appended_dtb) == FDT_MAGIC) {
122+
unsigned int image_size, dtb_size;
123+
124+
dtb_size = fdt_totalsize((void *)&__appended_dtb);
125+
126+
/* last four bytes is always image size in little endian */
127+
image_size = le32_to_cpup((void *)&__image_end - 4);
128+
129+
/* copy dtb to where the booted kernel will expect it */
130+
memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size,
131+
__appended_dtb, dtb_size);
132+
}
133+
117134
/* FIXME: should we flush cache here? */
118135
puts("Now, booting the kernel...\n");
119136
}

‎arch/mips/boot/compressed/head.S‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,6 @@ start:
2525
move s2, a2
2626
move s3, a3
2727

28-
#ifdef CONFIG_MIPS_ZBOOT_APPENDED_DTB
29-
PTR_LA t0, __appended_dtb
30-
#ifdef CONFIG_CPU_BIG_ENDIAN
31-
li t1, 0xd00dfeed
32-
#else
33-
li t1, 0xedfe0dd0
34-
#endif
35-
lw t2, (t0)
36-
bne t1, t2, not_found
37-
nop
38-
39-
move s1, t0
40-
PTR_LI s0, -2
41-
not_found:
42-
#endif
43-
4428
/* Clear BSS */
4529
PTR_LA a0, _edata
4630
PTR_LA a2, _end

‎arch/mips/boot/dts/cavium-octeon/dlink_dsr-1000n.dts‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
/include/ "octeon_3xxx.dtsi"
12+
#include <dt-bindings/gpio/gpio.h>
1213

1314
/ {
1415
model = "dlink,dsr-1000n";
@@ -63,12 +64,27 @@
6364

6465
usb1 {
6566
label = "usb1";
66-
gpios = <&gpio 9 1>; /* Active low */
67+
gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
6768
};
6869

6970
usb2 {
7071
label = "usb2";
71-
gpios = <&gpio 10 1>; /* Active low */
72+
gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
73+
};
74+
75+
wps {
76+
label = "wps";
77+
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
78+
};
79+
80+
wireless1 {
81+
label = "5g";
82+
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
83+
};
84+
85+
wireless2 {
86+
label = "2.4g";
87+
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
7288
};
7389
};
7490

‎arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,4 @@
388388
usbn = &usbn;
389389
led0 = &led0;
390390
};
391-
392-
dsr1000n-leds {
393-
compatible = "gpio-leds";
394-
usb1 {
395-
label = "usb1";
396-
gpios = <&gpio 9 1>; /* Active low */
397-
};
398-
usb2 {
399-
label = "usb2";
400-
gpios = <&gpio 10 1>; /* Active low */
401-
};
402-
};
403391
};

‎arch/mips/boot/tools/relocs_64.c‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@
99

1010
typedef uint8_t Elf64_Byte;
1111

12-
typedef struct {
13-
Elf64_Word r_sym; /* Symbol index. */
14-
Elf64_Byte r_ssym; /* Special symbol. */
15-
Elf64_Byte r_type3; /* Third relocation. */
16-
Elf64_Byte r_type2; /* Second relocation. */
17-
Elf64_Byte r_type; /* First relocation. */
12+
typedef union {
13+
struct {
14+
Elf64_Word r_sym; /* Symbol index. */
15+
Elf64_Byte r_ssym; /* Special symbol. */
16+
Elf64_Byte r_type3; /* Third relocation. */
17+
Elf64_Byte r_type2; /* Second relocation. */
18+
Elf64_Byte r_type; /* First relocation. */
19+
} fields;
20+
Elf64_Xword unused;
1821
} Elf64_Mips_Rela;
1922

2023
#define ELF_CLASS ELFCLASS64
21-
#define ELF_R_SYM(val) (((Elf64_Mips_Rela *)(&val))->r_sym)
22-
#define ELF_R_TYPE(val) (((Elf64_Mips_Rela *)(&val))->r_type)
24+
#define ELF_R_SYM(val) (((Elf64_Mips_Rela *)(&val))->fields.r_sym)
25+
#define ELF_R_TYPE(val) (((Elf64_Mips_Rela *)(&val))->fields.r_type)
2326
#define ELF_ST_TYPE(o) ELF64_ST_TYPE(o)
2427
#define ELF_ST_BIND(o) ELF64_ST_BIND(o)
2528
#define ELF_ST_VISIBILITY(o) ELF64_ST_VISIBILITY(o)

‎arch/mips/cavium-octeon/executive/cvmx-bootmem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr,
668668
/*
669669
* Round size up to mult of minimum alignment bytes We need
670670
* the actual size allocated to allow for blocks to be
671-
* coallesced when they are freed. The alloc routine does the
671+
* coalesced when they are freed. The alloc routine does the
672672
* same rounding up on all allocations.
673673
*/
674674
size = ALIGN(size, CVMX_BOOTMEM_ALIGNMENT_SIZE);

0 commit comments

Comments
 (0)