Commit bafb8192 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull tensa fixes from Chris Zankel:
 "This series includes fixes for potentially serious bugs in the
  routines spilling processor registers to stack, as well as other
  issues and compiler errors and warnings.

   - allow booting xtfpga on boards with new uBoot and >128MBytes memory
   - drop nonexistent GPIO32 support from fsf variant
   - don't select USE_GENERIC_SMP_HELPERS
   - enable common clock framework support, set up ethoc clock on xtfpga
   - wire up sched_setattr and sched_getattr syscalls.
   - fix system call to spill the processor registers to stack.
   - improve kernel macro to spill the processor registers
   - export ccount_freq symbol
   - fix undefined symbol warning"

* tag 'xtensa-next-20140224' of git://github.com/czankel/xtensa-linux:
  xtensa: wire up sched_setattr and sched_getattr syscalls
  xtensa: xtfpga: set ethoc clock frequency
  xtensa: xtfpga: use common clock framework
  xtensa: support common clock framework
  xtensa: no need to select USE_GENERIC_SMP_HELPERS
  xtensa: fsf: drop nonexistent GPIO32 support
  xtensa: don't pass high memory to bootmem allocator
  xtensa: fix fast_syscall_spill_registers
  xtensa: fix fast_syscall_spill_registers
  xtensa: save current register frame in fast_syscall_spill_registers_fixup
  xtensa: introduce spill_registers_kernel macro
  xtensa: export ccount_freq
  xtensa: fix warning '"CONFIG_OF" is not defined'
parents 7472e009 b3fdfc1b
...@@ -20,6 +20,7 @@ config XTENSA ...@@ -20,6 +20,7 @@ config XTENSA
select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_TRACER
select HAVE_IRQ_TIME_ACCOUNTING select HAVE_IRQ_TIME_ACCOUNTING
select HAVE_PERF_EVENTS select HAVE_PERF_EVENTS
select COMMON_CLK
help help
Xtensa processors are 32-bit RISC machines designed by Tensilica Xtensa processors are 32-bit RISC machines designed by Tensilica
primarily for embedded systems. These processors are both primarily for embedded systems. These processors are both
...@@ -80,7 +81,6 @@ choice ...@@ -80,7 +81,6 @@ choice
config XTENSA_VARIANT_FSF config XTENSA_VARIANT_FSF
bool "fsf - default (not generic) configuration" bool "fsf - default (not generic) configuration"
select MMU select MMU
select HAVE_XTENSA_GPIO32
config XTENSA_VARIANT_DC232B config XTENSA_VARIANT_DC232B
bool "dc232b - Diamond 232L Standard Core Rev.B (LE)" bool "dc232b - Diamond 232L Standard Core Rev.B (LE)"
...@@ -135,7 +135,6 @@ config HAVE_SMP ...@@ -135,7 +135,6 @@ config HAVE_SMP
config SMP config SMP
bool "Enable Symmetric multi-processing support" bool "Enable Symmetric multi-processing support"
depends on HAVE_SMP depends on HAVE_SMP
select USE_GENERIC_SMP_HELPERS
select GENERIC_SMP_IDLE_THREAD select GENERIC_SMP_IDLE_THREAD
help help
Enabled SMP Software; allows more than one CPU/CORE Enabled SMP Software; allows more than one CPU/CORE
......
...@@ -35,6 +35,13 @@ pic: pic { ...@@ -35,6 +35,13 @@ pic: pic {
interrupt-controller; interrupt-controller;
}; };
clocks {
osc: main-oscillator {
#clock-cells = <0>;
compatible = "fixed-clock";
};
};
serial0: serial@fd050020 { serial0: serial@fd050020 {
device_type = "serial"; device_type = "serial";
compatible = "ns16550a"; compatible = "ns16550a";
...@@ -42,9 +49,7 @@ serial0: serial@fd050020 { ...@@ -42,9 +49,7 @@ serial0: serial@fd050020 {
reg = <0xfd050020 0x20>; reg = <0xfd050020 0x20>;
reg-shift = <2>; reg-shift = <2>;
interrupts = <0 1>; /* external irq 0 */ interrupts = <0 1>; /* external irq 0 */
/* Filled in by platform_setup from FPGA register clocks = <&osc>;
* clock-frequency = <100000000>;
*/
}; };
enet0: ethoc@fd030000 { enet0: ethoc@fd030000 {
...@@ -52,5 +57,6 @@ enet0: ethoc@fd030000 { ...@@ -52,5 +57,6 @@ enet0: ethoc@fd030000 {
reg = <0xfd030000 0x4000 0xfd800000 0x4000>; reg = <0xfd030000 0x4000 0xfd800000 0x4000>;
interrupts = <1 1>; /* external irq 1 */ interrupts = <1 1>; /* external irq 1 */
local-mac-address = [00 50 c2 13 6f 00]; local-mac-address = [00 50 c2 13 6f 00];
clocks = <&osc>;
}; };
}; };
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
extern unsigned long xtensa_kio_paddr; extern unsigned long xtensa_kio_paddr;
static inline unsigned long xtensa_get_kio_paddr(void) static inline unsigned long xtensa_get_kio_paddr(void)
......
...@@ -23,25 +23,37 @@ void secondary_trap_init(void); ...@@ -23,25 +23,37 @@ void secondary_trap_init(void);
static inline void spill_registers(void) static inline void spill_registers(void)
{ {
#if XCHAL_NUM_AREGS > 16
__asm__ __volatile__ ( __asm__ __volatile__ (
"movi a14, "__stringify((1 << PS_EXCM_BIT) | LOCKLEVEL)"\n\t" " call12 1f\n"
"mov a12, a0\n\t" " _j 2f\n"
"rsr a13, sar\n\t" " retw\n"
"xsr a14, ps\n\t" " .align 4\n"
"movi a0, _spill_registers\n\t" "1:\n"
"rsync\n\t" " _entry a1, 48\n"
"callx0 a0\n\t" " addi a12, a0, 3\n"
"mov a0, a12\n\t" #if XCHAL_NUM_AREGS > 32
"wsr a13, sar\n\t" " .rept (" __stringify(XCHAL_NUM_AREGS) " - 32) / 12\n"
"wsr a14, ps\n\t" " _entry a1, 48\n"
: : " mov a12, a0\n"
#if defined(CONFIG_FRAME_POINTER) " .endr\n"
: "a2", "a3", "a4", "a11", "a12", "a13", "a14", "a15", #endif
" _entry a1, 48\n"
#if XCHAL_NUM_AREGS % 12 == 0
" mov a8, a8\n"
#elif XCHAL_NUM_AREGS % 12 == 4
" mov a12, a12\n"
#elif XCHAL_NUM_AREGS % 12 == 8
" mov a4, a4\n"
#endif
" retw\n"
"2:\n"
: : : "a12", "a13", "memory");
#else #else
: "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", __asm__ __volatile__ (
" mov a12, a12\n"
: : : "memory");
#endif #endif
"memory");
} }
#endif /* _XTENSA_TRAPS_H */ #endif /* _XTENSA_TRAPS_H */
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define XCHAL_KIO_DEFAULT_PADDR 0xf0000000 #define XCHAL_KIO_DEFAULT_PADDR 0xf0000000
#define XCHAL_KIO_SIZE 0x10000000 #define XCHAL_KIO_SIZE 0x10000000
#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
#define XCHAL_KIO_PADDR xtensa_get_kio_paddr() #define XCHAL_KIO_PADDR xtensa_get_kio_paddr()
#else #else
#define XCHAL_KIO_PADDR XCHAL_KIO_DEFAULT_PADDR #define XCHAL_KIO_PADDR XCHAL_KIO_DEFAULT_PADDR
......
...@@ -734,7 +734,12 @@ __SYSCALL(332, sys_finit_module, 3) ...@@ -734,7 +734,12 @@ __SYSCALL(332, sys_finit_module, 3)
#define __NR_accept4 333 #define __NR_accept4 333
__SYSCALL(333, sys_accept4, 4) __SYSCALL(333, sys_accept4, 4)
#define __NR_syscall_count 334 #define __NR_sched_setattr 334
__SYSCALL(334, sys_sched_setattr, 2)
#define __NR_sched_getattr 335
__SYSCALL(335, sys_sched_getattr, 3)
#define __NR_syscall_count 336
/* /*
* sysxtensa syscall handler * sysxtensa syscall handler
......
This diff is collapsed.
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/clk-provider.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/of_fdt.h> #include <linux/of_fdt.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
...@@ -276,6 +277,7 @@ void __init early_init_devtree(void *params) ...@@ -276,6 +277,7 @@ void __init early_init_devtree(void *params)
static int __init xtensa_device_probe(void) static int __init xtensa_device_probe(void)
{ {
of_clk_init(NULL);
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
return 0; return 0;
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <asm/platform.h> #include <asm/platform.h>
unsigned long ccount_freq; /* ccount Hz */ unsigned long ccount_freq; /* ccount Hz */
EXPORT_SYMBOL(ccount_freq);
static cycle_t ccount_read(struct clocksource *cs) static cycle_t ccount_read(struct clocksource *cs)
{ {
......
...@@ -235,7 +235,7 @@ ENTRY(_DoubleExceptionVector) ...@@ -235,7 +235,7 @@ ENTRY(_DoubleExceptionVector)
/* Check for overflow/underflow exception, jump if overflow. */ /* Check for overflow/underflow exception, jump if overflow. */
_bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow
/* /*
* Restart window underflow exception. * Restart window underflow exception.
......
...@@ -122,9 +122,7 @@ EXPORT_SYMBOL(insw); ...@@ -122,9 +122,7 @@ EXPORT_SYMBOL(insw);
EXPORT_SYMBOL(insl); EXPORT_SYMBOL(insl);
extern long common_exception_return; extern long common_exception_return;
extern long _spill_registers;
EXPORT_SYMBOL(common_exception_return); EXPORT_SYMBOL(common_exception_return);
EXPORT_SYMBOL(_spill_registers);
#ifdef CONFIG_FUNCTION_TRACER #ifdef CONFIG_FUNCTION_TRACER
EXPORT_SYMBOL(_mcount); EXPORT_SYMBOL(_mcount);
......
...@@ -90,7 +90,7 @@ int __init mem_reserve(unsigned long start, unsigned long end, int must_exist) ...@@ -90,7 +90,7 @@ int __init mem_reserve(unsigned long start, unsigned long end, int must_exist)
/* /*
* Initialize the bootmem system and give it all the memory we have available. * Initialize the bootmem system and give it all low memory we have available.
*/ */
void __init bootmem_init(void) void __init bootmem_init(void)
...@@ -142,9 +142,14 @@ void __init bootmem_init(void) ...@@ -142,9 +142,14 @@ void __init bootmem_init(void)
/* Add all remaining memory pieces into the bootmem map */ /* Add all remaining memory pieces into the bootmem map */
for (i=0; i<sysmem.nr_banks; i++) for (i = 0; i < sysmem.nr_banks; i++) {
free_bootmem(sysmem.bank[i].start, if (sysmem.bank[i].start >> PAGE_SHIFT < max_low_pfn) {
sysmem.bank[i].end - sysmem.bank[i].start); unsigned long end = min(max_low_pfn << PAGE_SHIFT,
sysmem.bank[i].end);
free_bootmem(sysmem.bank[i].start,
end - sysmem.bank[i].start);
}
}
} }
......
...@@ -39,7 +39,7 @@ void init_mmu(void) ...@@ -39,7 +39,7 @@ void init_mmu(void)
set_itlbcfg_register(0); set_itlbcfg_register(0);
set_dtlbcfg_register(0); set_dtlbcfg_register(0);
#endif #endif
#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
/* /*
* Update the IO area mapping in case xtensa_kio_paddr has changed * Update the IO area mapping in case xtensa_kio_paddr has changed
*/ */
......
...@@ -135,11 +135,11 @@ static void __init update_local_mac(struct device_node *node) ...@@ -135,11 +135,11 @@ static void __init update_local_mac(struct device_node *node)
static int __init machine_setup(void) static int __init machine_setup(void)
{ {
struct device_node *serial; struct device_node *clock;
struct device_node *eth = NULL; struct device_node *eth = NULL;
for_each_compatible_node(serial, NULL, "ns16550a") for_each_node_by_name(clock, "main-oscillator")
update_clock_frequency(serial); update_clock_frequency(clock);
if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc"))) if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
update_local_mac(eth); update_local_mac(eth);
...@@ -290,6 +290,7 @@ static int __init xtavnet_init(void) ...@@ -290,6 +290,7 @@ static int __init xtavnet_init(void)
* knows whether they set it correctly on the DIP switches. * knows whether they set it correctly on the DIP switches.
*/ */
pr_info("XTFPGA: Ethernet MAC %pM\n", ethoc_pdata.hwaddr); pr_info("XTFPGA: Ethernet MAC %pM\n", ethoc_pdata.hwaddr);
ethoc_pdata.eth_clkfreq = *(long *)XTFPGA_CLKFRQ_VADDR;
return 0; return 0;
} }
......
...@@ -18,13 +18,6 @@ ...@@ -18,13 +18,6 @@
#define XCHAL_CP_MASK 0x00 /* bitmask of all CPs by ID */ #define XCHAL_CP_MASK 0x00 /* bitmask of all CPs by ID */
#define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */ #define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */
/* Basic parameters of each coprocessor: */
#define XCHAL_CP7_NAME "XTIOP"
#define XCHAL_CP7_IDENT XTIOP
#define XCHAL_CP7_SA_SIZE 0 /* size of state save area */
#define XCHAL_CP7_SA_ALIGN 1 /* min alignment of save area */
#define XCHAL_CP_ID_XTIOP 7 /* coprocessor ID (0..7) */
/* Filler info for unassigned coprocessors, to simplify arrays etc: */ /* Filler info for unassigned coprocessors, to simplify arrays etc: */
#define XCHAL_NCP_SA_SIZE 0 #define XCHAL_NCP_SA_SIZE 0
#define XCHAL_NCP_SA_ALIGN 1 #define XCHAL_NCP_SA_ALIGN 1
...@@ -42,6 +35,8 @@ ...@@ -42,6 +35,8 @@
#define XCHAL_CP5_SA_ALIGN 1 #define XCHAL_CP5_SA_ALIGN 1
#define XCHAL_CP6_SA_SIZE 0 #define XCHAL_CP6_SA_SIZE 0
#define XCHAL_CP6_SA_ALIGN 1 #define XCHAL_CP6_SA_ALIGN 1
#define XCHAL_CP7_SA_SIZE 0
#define XCHAL_CP7_SA_ALIGN 1
/* Save area for non-coprocessor optional and custom (TIE) state: */ /* Save area for non-coprocessor optional and custom (TIE) state: */
#define XCHAL_NCP_SA_SIZE 0 #define XCHAL_NCP_SA_SIZE 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment