Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fffad3e1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'xtensa-next-20160320' of git://github.com/czankel/xtensa-linux

Pull Xtensa updates from Chris Zankel:
 "Xtensa improvements for 4.6:

   - control whether perf IRQ is treated as NMI from Kconfig
   - implement ioremap for regions outside KIO segment
   - fix ISS serial port behaviour when EOF is reached
   - fix preemption in {clear,copy}_user_highpage
   - fix endianness issues for XTFPGA devices, big-endian cores are now
     fully functional
   - clean up debug infrastructure and add support for hardware
     breakpoints and watchpoints
   - add processor configurations for Three Core HiFi-2 MX and HiFi3
     cpus"

* tag 'xtensa-next-20160320' of git://github.com/czankel/xtensa-linux:
  xtensa: add test_kc705_hifi variant
  xtensa: add Three Core HiFi-2 MX Variant.
  xtensa: support hardware breakpoints/watchpoints
  xtensa: use context structure for debug exceptions
  xtensa: remove remaining non-functional KGDB bits
  xtensa: clear all DBREAKC registers on start
  xtensa: xtfpga: fix earlycon endianness
  xtensa: xtfpga: fix i2c controller register width and endianness
  xtensa: xtfpga: fix ethernet controller endianness
  xtensa: xtfpga: fix serial port register width and endianness
  xtensa: define CONFIG_CPU_{BIG,LITTLE}_ENDIAN
  xtensa: fix preemption in {clear,copy}_user_highpage
  xtensa: ISS: don't hang if stdin EOF is reached
  xtensa: support ioremap for memory outside KIO region
  xtensa: use XTENSA_INT_LEVEL macro in asm/timex.h
  xtensa: make fake NMI configurable
parents 1e75a9f3 9da8320b
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ config XTENSA
	select HAVE_DMA_API_DEBUG
	select HAVE_FUNCTION_TRACER
	select HAVE_FUTEX_CMPXCHG if !MMU
	select HAVE_HW_BREAKPOINT if PERF_EVENTS
	select HAVE_IRQ_TIME_ACCOUNTING
	select HAVE_OPROFILE
	select HAVE_PERF_EVENTS
@@ -138,6 +139,22 @@ config XTENSA_VARIANT_HAVE_PERF_EVENTS

	  If unsure, say N.

config XTENSA_FAKE_NMI
	bool "Treat PMM IRQ as NMI"
	depends on XTENSA_VARIANT_HAVE_PERF_EVENTS
	default n
	help
	  If PMM IRQ is the only IRQ at EXCM level it is safe to
	  treat it as NMI, which improves accuracy of profiling.

	  If there are other interrupts at or above PMM IRQ priority level
	  but not above the EXCM level, PMM IRQ still may be treated as NMI,
	  but only if these IRQs are not used. There will be a build warning
	  saying that this is not safe, and a bugcheck if one of these IRQs
	  actually fire.

	  If unsure, say N.

config XTENSA_UNALIGNED_USER
	bool "Unaligned memory access in use space"
	help
+2 −0
Original line number Diff line number Diff line
@@ -53,9 +53,11 @@ endif

ifeq ($(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1)
CHECKFLAGS += -D__XTENSA_EB__
KBUILD_CPPFLAGS += -DCONFIG_CPU_BIG_ENDIAN
endif
ifeq ($(shell echo __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1)
CHECKFLAGS += -D__XTENSA_EL__
KBUILD_CPPFLAGS += -DCONFIG_CPU_LITTLE_ENDIAN
endif

vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
/ {
	compatible = "cdns,xtensa-kc705";
	chosen {
		bootargs = "earlycon=uart8250,mmio32,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000";
		bootargs = "earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000";
	};
	memory@0 {
		device_type = "memory";
+6 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
	interrupt-parent = <&pic>;

	chosen {
		bootargs = "earlycon=uart8250,mmio32,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug";
		bootargs = "earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug";
	};

	memory@0 {
@@ -60,6 +60,8 @@
			no-loopback-test;
			reg = <0x0d050020 0x20>;
			reg-shift = <2>;
			reg-io-width = <4>;
			native-endian;
			interrupts = <0 1>; /* external irq 0 */
			clocks = <&osc>;
		};
@@ -67,6 +69,7 @@
		enet0: ethoc@0d030000 {
			compatible = "opencores,ethoc";
			reg = <0x0d030000 0x4000 0x0d800000 0x4000>;
			native-endian;
			interrupts = <1 1>; /* external irq 1 */
			local-mac-address = [00 50 c2 13 6f 00];
			clocks = <&osc>;
@@ -86,7 +89,8 @@
			#size-cells = <0>;
			reg = <0x0d090000 0x20>;
			reg-shift = <2>;
			reg-io-width = <1>;
			reg-io-width = <4>;
			native-endian;
			interrupts = <4 1>;
			clocks = <&osc>;

+58 −0
Original line number Diff line number Diff line
/*
 * Xtensa hardware breakpoints/watchpoints handling functions
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2016 Cadence Design Systems Inc.
 */

#ifndef __ASM_XTENSA_HW_BREAKPOINT_H
#define __ASM_XTENSA_HW_BREAKPOINT_H

#ifdef CONFIG_HAVE_HW_BREAKPOINT

#include <linux/kdebug.h>
#include <linux/types.h>
#include <uapi/linux/hw_breakpoint.h>

/* Breakpoint */
#define XTENSA_BREAKPOINT_EXECUTE	0

/* Watchpoints */
#define XTENSA_BREAKPOINT_LOAD		1
#define XTENSA_BREAKPOINT_STORE		2

struct arch_hw_breakpoint {
	unsigned long address;
	u16 len;
	u16 type;
};

struct perf_event;
struct pt_regs;
struct task_struct;

int hw_breakpoint_slots(int type);
int arch_check_bp_in_kernelspace(struct perf_event *bp);
int arch_validate_hwbkpt_settings(struct perf_event *bp);
int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
				    unsigned long val, void *data);

int arch_install_hw_breakpoint(struct perf_event *bp);
void arch_uninstall_hw_breakpoint(struct perf_event *bp);
void hw_breakpoint_pmu_read(struct perf_event *bp);
int check_hw_breakpoint(struct pt_regs *regs);
void clear_ptrace_hw_breakpoint(struct task_struct *tsk);

#else

struct task_struct;

static inline void clear_ptrace_hw_breakpoint(struct task_struct *tsk)
{
}

#endif /* CONFIG_HAVE_HW_BREAKPOINT */
#endif /* __ASM_XTENSA_HW_BREAKPOINT_H */
Loading