Skip to content

Commit 437d1a5

Browse files
committed
Merge tag 'xtensa-20210429' of git://github.com/jcmvbkbc/linux-xtensa
Pull Xtensa updates from Max Filippov: - switch to generic syscall generation scripts - new GDBIO implementation for xtensa semihosting interface - various small code fixes and cleanups - a few typo fixes in comments and Kconfig help text * tag 'xtensa-20210429' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: ISS: add GDBIO implementation to semihosting interface xtensa: ISS: split simcall implementation from semihosting interface xtensa: simcall.h: Change compitible to compatible xtensa: Couple of typo fixes xtensa: drop extraneous register load from initialize_mmu xtensa: fix pgprot_noncached assumptions xtensa: simplify coherent_kvaddr logic xtensa: syscalls: switch to generic syscallhdr.sh xtensa: syscalls: switch to generic syscalltbl.sh xtensa: stop filling syscall array with sys_ni_syscall xtensa: remove unneeded export in boot-elf/Makefile xtensa: move CONFIG_CPU_*_ENDIAN defines to Kconfig xtensa: fix warning comparing pointer to 0 xtensa: fix spelling mistake in Kconfig "wont" -> "won't"
2 parents 8ca5297 + 6a8eb99 commit 437d1a5

File tree

18 files changed

+198
-220
lines changed

18 files changed

+198
-220
lines changed

arch/xtensa/Kconfig

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ config KASAN_SHADOW_OFFSET
8484
hex
8585
default 0x6e400000
8686

87+
config CPU_BIG_ENDIAN
88+
def_bool $(success,test "$(shell,echo __XTENSA_EB__ | $(CC) -E -P -)" = 1)
89+
90+
config CPU_LITTLE_ENDIAN
91+
def_bool !CPU_BIG_ENDIAN
92+
8793
menu "Processor type and features"
8894

8995
choice
@@ -387,6 +393,28 @@ config PARSE_BOOTPARAM
387393

388394
If unsure, say Y.
389395

396+
choice
397+
prompt "Semihosting interface"
398+
default XTENSA_SIMCALL_ISS
399+
depends on XTENSA_PLATFORM_ISS
400+
help
401+
Choose semihosting interface that will be used for serial port,
402+
block device and networking.
403+
404+
config XTENSA_SIMCALL_ISS
405+
bool "simcall"
406+
help
407+
Use simcall instruction. simcall is only available on simulators,
408+
it does nothing on hardware.
409+
410+
config XTENSA_SIMCALL_GDBIO
411+
bool "GDBIO"
412+
help
413+
Use break instruction. It is available on real hardware when GDB
414+
is attached to it via JTAG.
415+
416+
endchoice
417+
390418
config BLK_DEV_SIMDISK
391419
tristate "Host file-based simulated block device support"
392420
default n
@@ -466,7 +494,7 @@ config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
466494
then enter your normal kernel breakpoints once the MMU was mapped
467495
to the kernel mappings (0XC0000000).
468496

469-
This unfortunately won't work for U-Boot and likely also wont
497+
This unfortunately won't work for U-Boot and likely also won't
470498
work for using KEXEC to have a hot kernel ready for doing a
471499
KDUMP.
472500

arch/xtensa/Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,7 @@ ifneq ($(CONFIG_LD_NO_RELAX),)
5252
KBUILD_LDFLAGS := --no-relax
5353
endif
5454

55-
ifeq ($(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1)
56-
CHECKFLAGS += -D__XTENSA_EB__
57-
KBUILD_CPPFLAGS += -DCONFIG_CPU_BIG_ENDIAN
58-
endif
59-
ifeq ($(shell echo __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1)
60-
CHECKFLAGS += -D__XTENSA_EL__
61-
KBUILD_CPPFLAGS += -DCONFIG_CPU_LITTLE_ENDIAN
62-
endif
55+
CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__)
6356

6457
vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
6558
plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))

arch/xtensa/boot/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
KBUILD_CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include
1313
HOSTFLAGS += -Iarch/$(ARCH)/boot/include
1414

15-
BIG_ENDIAN := $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
16-
17-
export BIG_ENDIAN
18-
1915
subdir-y := lib
2016
targets += vmlinux.bin vmlinux.bin.gz
2117
targets += uImage xipImage

arch/xtensa/boot/boot-elf/Makefile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@
44
# for more details.
55
#
66

7-
ifeq ($(BIG_ENDIAN),1)
8-
OBJCOPY_ARGS := -O elf32-xtensa-be
9-
else
10-
OBJCOPY_ARGS := -O elf32-xtensa-le
11-
endif
7+
OBJCOPY_ARGS := -O $(if $(CONFIG_CPU_BIG_ENDIAN),elf32-xtensa-be,elf32-xtensa-le)
128

13-
export OBJCOPY_ARGS
14-
export CPPFLAGS_boot.lds += -P -C
15-
export KBUILD_AFLAGS += -mtext-section-literals
9+
CPPFLAGS_boot.lds += -P -C
10+
KBUILD_AFLAGS += -mtext-section-literals
1611

1712
boot-y := bootstrap.o
1813
targets += $(boot-y) boot.lds

arch/xtensa/boot/boot-redboot/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
# for more details.
55
#
66

7-
ifeq ($(BIG_ENDIAN),1)
8-
OBJCOPY_ARGS := -O elf32-xtensa-be
9-
else
10-
OBJCOPY_ARGS := -O elf32-xtensa-le
11-
endif
7+
OBJCOPY_ARGS := -O $(if $(CONFIG_CPU_BIG_ENDIAN),elf32-xtensa-be,elf32-xtensa-le)
128

139
LD_ARGS = -T $(srctree)/$(obj)/boot.ld
1410

arch/xtensa/include/asm/initialize_mmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
_j 2f
7474

7575
.align 4
76-
1: movi a2, 0x10000000
76+
1:
7777

7878
#if CONFIG_KERNEL_LOAD_ADDRESS < 0x40000000ul
7979
#define TEMP_MAPPING_VADDR 0x40000000

arch/xtensa/include/asm/pgtable.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ static inline pte_t pte_mkyoung(pte_t pte)
280280
static inline pte_t pte_mkwrite(pte_t pte)
281281
{ pte_val(pte) |= _PAGE_WRITABLE; return pte; }
282282

283-
#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) & ~_PAGE_CA_MASK))
283+
#define pgprot_noncached(prot) \
284+
((__pgprot((pgprot_val(prot) & ~_PAGE_CA_MASK) | \
285+
_PAGE_CA_BYPASS)))
284286

285287
/*
286288
* Conversion functions: convert a page and protection to a page entry,

arch/xtensa/kernel/head.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ ENTRY(_startup)
212212
*
213213
* The linker script used to build the Linux kernel image
214214
* creates a table located at __boot_reloc_table_start
215-
* that contans the information what data needs to be unpacked.
215+
* that contains the information what data needs to be unpacked.
216216
*
217217
* Uses a2-a7.
218218
*/
@@ -222,7 +222,7 @@ ENTRY(_startup)
222222

223223
1: beq a2, a3, 3f # no more entries?
224224
l32i a4, a2, 0 # start destination (in RAM)
225-
l32i a5, a2, 4 # end desination (in RAM)
225+
l32i a5, a2, 4 # end destination (in RAM)
226226
l32i a6, a2, 8 # start source (in ROM)
227227
addi a2, a2, 12 # next entry
228228
beq a4, a5, 1b # skip, empty entry

arch/xtensa/kernel/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma)
7676
struct pci_controller *pci_ctrl = (struct pci_controller*) pdev->sysdata;
7777
resource_size_t ioaddr = pci_resource_start(pdev, bar);
7878

79-
if (pci_ctrl == 0)
79+
if (!pci_ctrl)
8080
return -EINVAL; /* should never happen */
8181

8282
/* Convert to an offset within this PCI controller */

arch/xtensa/kernel/syscall.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
#include <linux/uaccess.h>
1919
#include <asm/syscall.h>
20-
#include <asm/unistd.h>
2120
#include <linux/linkage.h>
2221
#include <linux/stringify.h>
2322
#include <linux/errno.h>
@@ -28,12 +27,9 @@
2827
#include <linux/sched/mm.h>
2928
#include <linux/shm.h>
3029

31-
syscall_t sys_call_table[__NR_syscalls] /* FIXME __cacheline_aligned */= {
32-
[0 ... __NR_syscalls - 1] = (syscall_t)&sys_ni_syscall,
33-
34-
#define __SYSCALL(nr, entry, nargs)[nr] = (syscall_t)entry,
30+
syscall_t sys_call_table[] /* FIXME __cacheline_aligned */= {
31+
#define __SYSCALL(nr, entry) (syscall_t)entry,
3532
#include <asm/syscall_table.h>
36-
#undef __SYSCALL
3733
};
3834

3935
#define COLOUR_ALIGN(addr, pgoff) \

0 commit comments

Comments
 (0)