CRIS changes for 3.14

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iEYEABECAAYFAlLmNJMACgkQ31LbvUHyf1fmoACeMUgwEh02hnxaiYfwtybH6wox
 nUUAn3a+yOwSHvghH8ZbXl8HUNMutoWQ
 =OLbC
 -----END PGP SIGNATURE-----

Merge tag 'cris-for-3.14' of git://jni.nu/cris

Pull cris changes from Jesper Nilsson:
 "Mostly removal of deprecated or old code, but also a long promised
  update of the CRIS syscalls"

* tag 'cris-for-3.14' of git://jni.nu/cris:
  Drop code for CRISv10 CPU simulator
  Cleanup whitespace, remove old author tag
  CRIS: Add missing syscalls
  cris: sync_serial: remove interruptible_sleep_on
  cris: remove deprecated IRQF_DISABLED
This commit is contained in:
Linus Torvalds 2014-01-27 08:12:20 -08:00
commit 562e74fefc
28 changed files with 298 additions and 332 deletions

View File

@ -122,12 +122,6 @@ config ETRAX100LX_V2
help help
Support version 2 of the ETRAX 100LX. Support version 2 of the ETRAX 100LX.
config SVINTO_SIM
bool "ETRAX-100LX-for-xsim-simulator"
select ARCH_USES_GETTIMEOFFSET
help
Support the xsim ETRAX Simulator.
config ETRAXFS config ETRAXFS
bool "ETRAX-FS-V32" bool "ETRAX-FS-V32"
help help

View File

@ -838,13 +838,13 @@ static int __init gpio_init(void)
* in some tests. * in some tests.
*/ */
res = request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt, res = request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt,
IRQF_SHARED | IRQF_DISABLED, "gpio poll", gpio_name); IRQF_SHARED, "gpio poll", gpio_name);
if (res) { if (res) {
printk(KERN_CRIT "err: timer0 irq for gpio\n"); printk(KERN_CRIT "err: timer0 irq for gpio\n");
return res; return res;
} }
res = request_irq(PA_IRQ_NBR, gpio_interrupt, res = request_irq(PA_IRQ_NBR, gpio_interrupt,
IRQF_SHARED | IRQF_DISABLED, "gpio PA", gpio_name); IRQF_SHARED, "gpio PA", gpio_name);
if (res) if (res)
printk(KERN_CRIT "err: PA irq for gpio\n"); printk(KERN_CRIT "err: PA irq for gpio\n");

View File

@ -22,6 +22,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/wait.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/io.h> #include <asm/io.h>
@ -580,7 +581,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
if (port == &ports[0]) { if (port == &ports[0]) {
if (request_irq(8, if (request_irq(8,
manual_interrupt, manual_interrupt,
IRQF_SHARED | IRQF_DISABLED, IRQF_SHARED,
"synchronous serial manual irq", "synchronous serial manual irq",
&ports[0])) { &ports[0])) {
printk(KERN_CRIT "Can't alloc " printk(KERN_CRIT "Can't alloc "
@ -590,7 +591,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
} else if (port == &ports[1]) { } else if (port == &ports[1]) {
if (request_irq(8, if (request_irq(8,
manual_interrupt, manual_interrupt,
IRQF_SHARED | IRQF_DISABLED, IRQF_SHARED,
"synchronous serial manual irq", "synchronous serial manual irq",
&ports[1])) { &ports[1])) {
printk(KERN_CRIT "Can't alloc " printk(KERN_CRIT "Can't alloc "
@ -1136,7 +1137,8 @@ static ssize_t sync_serial_read(struct file *file, char *buf,
if (file->f_flags & O_NONBLOCK) if (file->f_flags & O_NONBLOCK)
return -EAGAIN; return -EAGAIN;
interruptible_sleep_on(&port->in_wait_q); wait_event_interruptible(port->in_wait_q,
!(start == end && !port->full));
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;

View File

@ -1,4 +1,3 @@
# $Id: Makefile,v 1.6 2004/12/13 12:21:51 starvik Exp $
# #
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #

View File

@ -19,7 +19,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <asm/io.h> /* Get SIMCOUT. */
extern void reset_watchdog(void); extern void reset_watchdog(void);
@ -318,12 +317,6 @@ console_write(struct console *co, const char *buf, unsigned int len)
if (!port) if (!port)
return; return;
#ifdef CONFIG_SVINTO_SIM
/* no use to simulate the serial debug output */
SIMCOUT(buf, len);
return;
#endif
console_write_direct(co, buf, len); console_write_direct(co, buf, len);
} }

View File

@ -457,7 +457,7 @@ IRQ1_interrupt:
ba _Rexit ; Return the standard way ba _Rexit ; Return the standard way
nop nop
wdog: wdog:
#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) #if defined(CONFIG_ETRAX_WATCHDOG)
;; Check if we're waiting for reset to happen, as signalled by ;; Check if we're waiting for reset to happen, as signalled by
;; hard_reset_now setting cause_of_death to a magic value. If so, just ;; hard_reset_now setting cause_of_death to a magic value. If so, just
;; get stuck until reset happens. ;; get stuck until reset happens.
@ -523,7 +523,7 @@ _watchdogmsg:
.ascii "Oops: bitten by watchdog\n\0" .ascii "Oops: bitten by watchdog\n\0"
.previous .previous
#endif /* CONFIG_ETRAX_WATCHDOG and not CONFIG_SVINTO_SIM */ #endif /* CONFIG_ETRAX_WATCHDOG */
spurious_interrupt: spurious_interrupt:
di di
@ -713,7 +713,7 @@ sys_call_table:
.long sys_newlstat .long sys_newlstat
.long sys_newfstat .long sys_newfstat
.long sys_ni_syscall /* old sys_uname holder */ .long sys_ni_syscall /* old sys_uname holder */
.long sys_ni_syscall /* sys_iopl in i386 */ .long sys_ni_syscall /* 110 */ /* sys_iopl in i386 */
.long sys_vhangup .long sys_vhangup
.long sys_ni_syscall /* old "idle" system call */ .long sys_ni_syscall /* old "idle" system call */
.long sys_ni_syscall /* vm86old in i386 */ .long sys_ni_syscall /* vm86old in i386 */
@ -795,7 +795,7 @@ sys_call_table:
.long sys_ni_syscall /* streams2 */ .long sys_ni_syscall /* streams2 */
.long sys_vfork /* 190 */ .long sys_vfork /* 190 */
.long sys_getrlimit .long sys_getrlimit
.long sys_mmap2 .long sys_mmap2 /* mmap_pgoff */
.long sys_truncate64 .long sys_truncate64
.long sys_ftruncate64 .long sys_ftruncate64
.long sys_stat64 /* 195 */ .long sys_stat64 /* 195 */
@ -886,7 +886,7 @@ sys_call_table:
.long sys_mq_timedreceive /* 280 */ .long sys_mq_timedreceive /* 280 */
.long sys_mq_notify .long sys_mq_notify
.long sys_mq_getsetattr .long sys_mq_getsetattr
.long sys_ni_syscall /* reserved for kexec */ .long sys_ni_syscall
.long sys_waitid .long sys_waitid
.long sys_ni_syscall /* 285 */ /* available */ .long sys_ni_syscall /* 285 */ /* available */
.long sys_add_key .long sys_add_key
@ -939,6 +939,22 @@ sys_call_table:
.long sys_preadv .long sys_preadv
.long sys_pwritev .long sys_pwritev
.long sys_setns /* 335 */ .long sys_setns /* 335 */
.long sys_name_to_handle_at
.long sys_open_by_handle_at
.long sys_rt_tgsigqueueinfo
.long sys_perf_event_open
.long sys_recvmmsg /* 340 */
.long sys_accept4
.long sys_fanotify_init
.long sys_fanotify_mark
.long sys_prlimit64
.long sys_clock_adjtime /* 345 */
.long sys_syncfs
.long sys_sendmmsg
.long sys_process_vm_readv
.long sys_process_vm_writev
.long sys_kcmp /* 350 */
.long sys_finit_module
/* /*
* NOTE!! This doesn't have to be exact - we just have * NOTE!! This doesn't have to be exact - we just have

View File

@ -1,9 +1,7 @@
/* /*
* Head of the kernel - alter with care * Head of the kernel - alter with care
* *
* Copyright (C) 2000, 2001 Axis Communications AB * Copyright (C) 2000, 2001, 2010 Axis Communications AB
*
* Authors: Bjorn Wesen (bjornw@axis.com)
* *
*/ */
@ -170,13 +168,11 @@ _inflash:
#endif #endif
;; Set up waitstates etc according to kernel configuration. ;; Set up waitstates etc according to kernel configuration.
#ifndef CONFIG_SVINTO_SIM
move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
move.d $r0, [R_WAITSTATES] move.d $r0, [R_WAITSTATES]
move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0 move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
move.d $r0, [R_BUS_CONFIG] move.d $r0, [R_BUS_CONFIG]
#endif
;; We need to initialze DRAM registers before we start using the DRAM ;; We need to initialze DRAM registers before we start using the DRAM
@ -468,7 +464,6 @@ no_command_line:
move.d $r0,[genconfig_shadow] ; init a shadow register of R_GEN_CONFIG move.d $r0,[genconfig_shadow] ; init a shadow register of R_GEN_CONFIG
#ifndef CONFIG_SVINTO_SIM
move.d $r0,[R_GEN_CONFIG] move.d $r0,[R_GEN_CONFIG]
#if 0 #if 0
@ -703,8 +698,6 @@ no_command_line:
move.b $r0,[R_SERIAL3_TR_CTRL] move.b $r0,[R_SERIAL3_TR_CTRL]
#endif #endif
#endif /* CONFIG_SVINTO_SIM */
jump start_kernel ; jump into the C-function start_kernel in init/main.c jump start_kernel ; jump into the C-function start_kernel in init/main.c
.data .data

View File

@ -182,19 +182,14 @@ void do_multiple_IRQ(struct pt_regs* regs)
setting the irq vector table. setting the irq vector table.
*/ */
void __init void __init init_IRQ(void)
init_IRQ(void)
{ {
int i; int i;
/* clear all interrupt masks */ /* clear all interrupt masks */
#ifndef CONFIG_SVINTO_SIM
*R_IRQ_MASK0_CLR = 0xffffffff; *R_IRQ_MASK0_CLR = 0xffffffff;
*R_IRQ_MASK1_CLR = 0xffffffff; *R_IRQ_MASK1_CLR = 0xffffffff;
*R_IRQ_MASK2_CLR = 0xffffffff; *R_IRQ_MASK2_CLR = 0xffffffff;
#endif
*R_VECT_MASK_CLR = 0xffffffff; *R_VECT_MASK_CLR = 0xffffffff;
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
@ -211,25 +206,20 @@ init_IRQ(void)
executed by the associated break handler, rather than just a jump executed by the associated break handler, rather than just a jump
address. therefore we need to setup a default breakpoint handler address. therefore we need to setup a default breakpoint handler
for all breakpoints */ for all breakpoints */
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
set_break_vector(i, do_sigtrap); set_break_vector(i, do_sigtrap);
/* except IRQ 15 which is the multiple-IRQ handler on Etrax100 */ /* except IRQ 15 which is the multiple-IRQ handler on Etrax100 */
set_int_vector(15, multiple_interrupt); set_int_vector(15, multiple_interrupt);
/* 0 and 1 which are special breakpoint/NMI traps */ /* 0 and 1 which are special breakpoint/NMI traps */
set_int_vector(0, hwbreakpoint); set_int_vector(0, hwbreakpoint);
set_int_vector(1, IRQ1_interrupt); set_int_vector(1, IRQ1_interrupt);
/* and irq 14 which is the mmu bus fault handler */ /* and irq 14 which is the mmu bus fault handler */
set_int_vector(14, mmu_bus_fault); set_int_vector(14, mmu_bus_fault);
/* setup the system-call trap, which is reached by BREAK 13 */ /* setup the system-call trap, which is reached by BREAK 13 */
set_break_vector(13, system_call); set_break_vector(13, system_call);
/* setup a breakpoint handler for debugging used for both user and /* setup a breakpoint handler for debugging used for both user and

View File

@ -14,7 +14,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <arch/svinto.h>
#include <linux/init.h> #include <linux/init.h>
#include <arch/system.h> #include <arch/system.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
@ -56,14 +55,14 @@ void hard_reset_now (void)
* code to know about it than the watchdog handler in entry.S and * code to know about it than the watchdog handler in entry.S and
* this code, implementing hard reset through the watchdog. * this code, implementing hard reset through the watchdog.
*/ */
#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) #if defined(CONFIG_ETRAX_WATCHDOG)
extern int cause_of_death; extern int cause_of_death;
#endif #endif
printk("*** HARD RESET ***\n"); printk("*** HARD RESET ***\n");
local_irq_disable(); local_irq_disable();
#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) #if defined(CONFIG_ETRAX_WATCHDOG)
cause_of_death = 0xbedead; cause_of_death = 0xbedead;
#else #else
/* Since we dont plan to keep on resetting the watchdog, /* Since we dont plan to keep on resetting the watchdog,

View File

@ -14,7 +14,6 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <arch/svinto.h>
#include <asm/types.h> #include <asm/types.h>
#include <asm/signal.h> #include <asm/signal.h>
#include <asm/io.h> #include <asm/io.h>
@ -97,7 +96,7 @@ static u32 cris_v10_gettimeoffset(void)
/* right now, starting the watchdog is the same as resetting it */ /* right now, starting the watchdog is the same as resetting it */
#define start_watchdog reset_watchdog #define start_watchdog reset_watchdog
#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) #ifdef CONFIG_ETRAX_WATCHDOG
static int watchdog_key = 0; /* arbitrary number */ static int watchdog_key = 0; /* arbitrary number */
#endif #endif
@ -107,10 +106,9 @@ static int watchdog_key = 0; /* arbitrary number */
#define WATCHDOG_MIN_FREE_PAGES 8 #define WATCHDOG_MIN_FREE_PAGES 8
void void reset_watchdog(void)
reset_watchdog(void)
{ {
#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) #if defined(CONFIG_ETRAX_WATCHDOG)
/* only keep watchdog happy as long as we have memory left! */ /* only keep watchdog happy as long as we have memory left! */
if(nr_free_pages() > WATCHDOG_MIN_FREE_PAGES) { if(nr_free_pages() > WATCHDOG_MIN_FREE_PAGES) {
/* reset the watchdog with the inverse of the old key */ /* reset the watchdog with the inverse of the old key */
@ -123,10 +121,9 @@ reset_watchdog(void)
/* stop the watchdog - we still need the correct key */ /* stop the watchdog - we still need the correct key */
void void stop_watchdog(void)
stop_watchdog(void)
{ {
#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) #ifdef CONFIG_ETRAX_WATCHDOG
watchdog_key ^= 0x7; /* invert key, which is 3 bits */ watchdog_key ^= 0x7; /* invert key, which is 3 bits */
*R_WATCHDOG = IO_FIELD(R_WATCHDOG, key, watchdog_key) | *R_WATCHDOG = IO_FIELD(R_WATCHDOG, key, watchdog_key) |
IO_STATE(R_WATCHDOG, enable, stop); IO_STATE(R_WATCHDOG, enable, stop);
@ -134,17 +131,13 @@ stop_watchdog(void)
} }
extern void cris_do_profile(struct pt_regs *regs);
/* /*
* timer_interrupt() needs to keep up the real-time clock, * timer_interrupt() needs to keep up the real-time clock,
* as well as call the "xtime_update()" routine every clocktick * as well as call the "xtime_update()" routine every clocktick
*/ */
static inline irqreturn_t timer_interrupt(int irq, void *dev_id)
//static unsigned short myjiff; /* used by our debug routine print_timestamp */
extern void cris_do_profile(struct pt_regs *regs);
static inline irqreturn_t
timer_interrupt(int irq, void *dev_id)
{ {
struct pt_regs *regs = get_irq_regs(); struct pt_regs *regs = get_irq_regs();
/* acknowledge the timer irq */ /* acknowledge the timer irq */
@ -160,8 +153,7 @@ timer_interrupt(int irq, void *dev_id)
IO_STATE( R_TIMER_CTRL, tm0, run) | IO_STATE( R_TIMER_CTRL, tm0, run) |
IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz);
#else #else
*R_TIMER_CTRL = r_timer_ctrl_shadow | *R_TIMER_CTRL = r_timer_ctrl_shadow | IO_STATE(R_TIMER_CTRL, i0, clr);
IO_STATE(R_TIMER_CTRL, i0, clr);
#endif #endif
/* reset watchdog otherwise it resets us! */ /* reset watchdog otherwise it resets us! */
@ -171,25 +163,21 @@ timer_interrupt(int irq, void *dev_id)
update_process_times(user_mode(regs)); update_process_times(user_mode(regs));
/* call the real timer interrupt handler */ /* call the real timer interrupt handler */
xtime_update(1); xtime_update(1);
cris_do_profile(regs); /* Save profiling information */ cris_do_profile(regs); /* Save profiling information */
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain /* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain */
* it needs to be IRQF_DISABLED to make the jiffies update work properly
*/
static struct irqaction irq2 = { static struct irqaction irq2 = {
.handler = timer_interrupt, .handler = timer_interrupt,
.flags = IRQF_SHARED | IRQF_DISABLED, .flags = IRQF_SHARED,
.name = "timer", .name = "timer",
}; };
void __init void __init time_init(void)
time_init(void)
{ {
arch_gettimeoffset = cris_v10_gettimeoffset; arch_gettimeoffset = cris_v10_gettimeoffset;
@ -253,16 +241,14 @@ time_init(void)
*R_TIMER_PRESCALE = PRESCALE_VALUE; *R_TIMER_PRESCALE = PRESCALE_VALUE;
#endif #endif
*R_IRQ_MASK0_SET = /* unmask the timer irq */
IO_STATE(R_IRQ_MASK0_SET, timer0, set); /* unmask the timer irq */ *R_IRQ_MASK0_SET = IO_STATE(R_IRQ_MASK0_SET, timer0, set);
/* now actually register the timer irq handler that calls timer_interrupt() */
/* now actually register the irq handler that calls timer_interrupt() */
setup_irq(2, &irq2); /* irq 2 is the timer0 irq in etrax */ setup_irq(2, &irq2); /* irq 2 is the timer0 irq in etrax */
/* enable watchdog if we should use one */ /* enable watchdog if we should use one */
#if defined(CONFIG_ETRAX_WATCHDOG)
#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
printk("Enabling watchdog...\n"); printk("Enabling watchdog...\n");
start_watchdog(); start_watchdog();
@ -275,9 +261,7 @@ time_init(void)
driver or infrastructure support yet. */ driver or infrastructure support yet. */
asm ("setf m"); asm ("setf m");
*R_IRQ_MASK0_SET = *R_IRQ_MASK0_SET = IO_STATE(R_IRQ_MASK0_SET, watchdog_nmi, set);
IO_STATE(R_IRQ_MASK0_SET, watchdog_nmi, set); *R_VECT_MASK_SET = IO_STATE(R_VECT_MASK_SET, nmi, set);
*R_VECT_MASK_SET =
IO_STATE(R_VECT_MASK_SET, nmi, set);
#endif #endif
} }

View File

@ -5,9 +5,7 @@
* Note: This file may not modify r9 because r9 is used to carry * Note: This file may not modify r9 because r9 is used to carry
* information from the decompresser to the kernel * information from the decompresser to the kernel
* *
* Copyright (C) 2000, 2001 Axis Communications AB * Copyright (C) 2000-2012 Axis Communications AB
*
* Authors: Mikael Starvik (starvik@axis.com)
* *
*/ */
@ -21,7 +19,6 @@
;; information from the decompressor (if the kernel was compressed). ;; information from the decompressor (if the kernel was compressed).
;; They should not be used in the code below. ;; They should not be used in the code below.
#ifndef CONFIG_SVINTO_SIM
move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
move.d $r0, [R_WAITSTATES] move.d $r0, [R_WAITSTATES]
@ -147,4 +144,3 @@ _sdram_commands_start:
.byte 0 ; nop .byte 0 ; nop
_sdram_commands_end: _sdram_commands_end:
#endif #endif
#endif

View File

@ -978,7 +978,7 @@ static int __init gpio_init(void)
CRIS_LED_DISK_WRITE(0); CRIS_LED_DISK_WRITE(0);
int res2 = request_irq(GIO_INTR_VECT, gpio_interrupt, int res2 = request_irq(GIO_INTR_VECT, gpio_interrupt,
IRQF_SHARED | IRQF_DISABLED, "gpio", &alarmlist); IRQF_SHARED, "gpio", &alarmlist);
if (res2) { if (res2) {
printk(KERN_ERR "err: irq for gpio\n"); printk(KERN_ERR "err: irq for gpio\n");
return res2; return res2;

View File

@ -964,11 +964,11 @@ gpio_init(void)
* in some tests. * in some tests.
*/ */
if (request_irq(TIMER0_INTR_VECT, gpio_poll_timer_interrupt, if (request_irq(TIMER0_INTR_VECT, gpio_poll_timer_interrupt,
IRQF_SHARED | IRQF_DISABLED, "gpio poll", &alarmlist)) IRQF_SHARED, "gpio poll", &alarmlist))
printk(KERN_ERR "timer0 irq for gpio\n"); printk(KERN_ERR "timer0 irq for gpio\n");
if (request_irq(GIO_INTR_VECT, gpio_pa_interrupt, if (request_irq(GIO_INTR_VECT, gpio_pa_interrupt,
IRQF_SHARED | IRQF_DISABLED, "gpio PA", &alarmlist)) IRQF_SHARED, "gpio PA", &alarmlist))
printk(KERN_ERR "PA irq for gpio\n"); printk(KERN_ERR "PA irq for gpio\n");
#ifdef CONFIG_ETRAX_VIRTUAL_GPIO #ifdef CONFIG_ETRAX_VIRTUAL_GPIO

View File

@ -19,6 +19,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/wait.h>
#include <asm/io.h> #include <asm/io.h>
#include <dma.h> #include <dma.h>
@ -1144,7 +1145,8 @@ static ssize_t sync_serial_read(struct file * file, char * buf,
if (file->f_flags & O_NONBLOCK) if (file->f_flags & O_NONBLOCK)
return -EAGAIN; return -EAGAIN;
interruptible_sleep_on(&port->in_wait_q); wait_event_interruptible(port->in_wait_q,
!(start == end && !port->full));
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;

View File

@ -452,7 +452,7 @@ spurious_interrupt:
nop nop
;; This handles the case when multiple interrupts arrive at the same ;; This handles the case when multiple interrupts arrive at the same
;; time. Jump to the first set interrupt bit in a priotiry fashion. The ;; time. Jump to the first set interrupt bit in a priority fashion. The
;; hardware will call the unserved interrupts after the handler ;; hardware will call the unserved interrupts after the handler
;; finishes. ;; finishes.
.type multiple_interrupt, @function .type multiple_interrupt, @function
@ -885,6 +885,22 @@ sys_call_table:
.long sys_preadv .long sys_preadv
.long sys_pwritev .long sys_pwritev
.long sys_setns /* 335 */ .long sys_setns /* 335 */
.long sys_name_to_handle_at
.long sys_open_by_handle_at
.long sys_rt_tgsigqueueinfo
.long sys_perf_event_open
.long sys_recvmmsg /* 340 */
.long sys_accept4
.long sys_fanotify_init
.long sys_fanotify_mark
.long sys_prlimit64
.long sys_clock_adjtime /* 345 */
.long sys_syncfs
.long sys_sendmmsg
.long sys_process_vm_readv
.long sys_process_vm_writev
.long sys_kcmp /* 350 */
.long sys_finit_module
/* /*
* NOTE!! This doesn't have to be exact - we just have * NOTE!! This doesn't have to be exact - we just have

View File

@ -786,7 +786,7 @@ int fast_timer_init(void)
proc_create("fasttimer", 0, NULL, &proc_fasttimer_fops); proc_create("fasttimer", 0, NULL, &proc_fasttimer_fops);
#endif /* PROC_FS */ #endif /* PROC_FS */
if (request_irq(TIMER0_INTR_VECT, timer_trig_interrupt, if (request_irq(TIMER0_INTR_VECT, timer_trig_interrupt,
IRQF_SHARED | IRQF_DISABLED, IRQF_SHARED,
"fast timer int", &fast_timer_list)) "fast timer int", &fast_timer_list))
printk(KERN_ERR "err: fasttimer irq\n"); printk(KERN_ERR "err: fasttimer irq\n");
fast_timer_is_init = 1; fast_timer_is_init = 1;

View File

@ -331,10 +331,10 @@ extern void do_IRQ(int irq, struct pt_regs * regs);
void void
crisv32_do_IRQ(int irq, int block, struct pt_regs* regs) crisv32_do_IRQ(int irq, int block, struct pt_regs* regs)
{ {
/* Interrupts that may not be moved to another CPU and /* Interrupts that may not be moved to another CPU may
* are IRQF_DISABLED may skip blocking. This is currently * skip blocking. This is currently only valid for the
* only valid for the timer IRQ and the IPI and is used * timer IRQ and the IPI and is used for the timer
* for the timer interrupt to avoid watchdog starvation. * interrupt to avoid watchdog starvation.
*/ */
if (!block) { if (!block) {
do_IRQ(irq, regs); do_IRQ(irq, regs);

View File

@ -64,7 +64,7 @@ static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id);
static int send_ipi(int vector, int wait, cpumask_t cpu_mask); static int send_ipi(int vector, int wait, cpumask_t cpu_mask);
static struct irqaction irq_ipi = { static struct irqaction irq_ipi = {
.handler = crisv32_ipi_interrupt, .handler = crisv32_ipi_interrupt,
.flags = IRQF_DISABLED, .flags = 0,
.name = "ipi", .name = "ipi",
}; };

View File

@ -216,12 +216,10 @@ static inline irqreturn_t timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/* Timer is IRQF_SHARED so drivers can add stuff to the timer irq chain. /* Timer is IRQF_SHARED so drivers can add stuff to the timer irq chain. */
* It needs to be IRQF_DISABLED to make the jiffies update work properly.
*/
static struct irqaction irq_timer = { static struct irqaction irq_timer = {
.handler = timer_interrupt, .handler = timer_interrupt,
.flags = IRQF_SHARED | IRQF_DISABLED, .flags = IRQF_SHARED,
.name = "timer" .name = "timer"
}; };

View File

@ -256,11 +256,11 @@ static void crisv32_arbiter_init(void)
crisv32_arbiter_config(1, EXT_REGION, 0); crisv32_arbiter_config(1, EXT_REGION, 0);
if (request_irq(MEMARB_FOO_INTR_VECT, crisv32_foo_arbiter_irq, if (request_irq(MEMARB_FOO_INTR_VECT, crisv32_foo_arbiter_irq,
IRQF_DISABLED, "arbiter", NULL)) 0, "arbiter", NULL))
printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");
if (request_irq(MEMARB_BAR_INTR_VECT, crisv32_bar_arbiter_irq, if (request_irq(MEMARB_BAR_INTR_VECT, crisv32_bar_arbiter_irq,
IRQF_DISABLED, "arbiter", NULL)) 0, "arbiter", NULL))
printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");
#ifndef CONFIG_ETRAX_KGDB #ifndef CONFIG_ETRAX_KGDB

View File

@ -184,7 +184,7 @@ static void crisv32_arbiter_init(void)
crisv32_arbiter_config(EXT_REGION, 0); crisv32_arbiter_config(EXT_REGION, 0);
crisv32_arbiter_config(INT_REGION, 0); crisv32_arbiter_config(INT_REGION, 0);
if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, IRQF_DISABLED, if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, 0,
"arbiter", NULL)) "arbiter", NULL))
printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");

View File

@ -50,7 +50,6 @@
nop nop
di di
#ifndef CONFIG_SVINTO_SIM
;; setup port PA and PB default initial directions and data ;; setup port PA and PB default initial directions and data
;; (so we can flash LEDs, and so that DTR and others are set) ;; (so we can flash LEDs, and so that DTR and others are set)
@ -67,7 +66,6 @@
;; We need to setup the bus registers before we start using the DRAM ;; We need to setup the bus registers before we start using the DRAM
#include "../../lib/dram_init.S" #include "../../lib/dram_init.S"
#endif
;; Setup the stack to a suitably high address. ;; Setup the stack to a suitably high address.
;; We assume 8 MB is the minimum DRAM in an eLinux ;; We assume 8 MB is the minimum DRAM in an eLinux
;; product and put the sp at the top for now. ;; product and put the sp at the top for now.

View File

@ -1,8 +1,6 @@
#ifndef _ASM_ARCH_CRIS_IO_H #ifndef _ASM_ARCH_CRIS_IO_H
#define _ASM_ARCH_CRIS_IO_H #define _ASM_ARCH_CRIS_IO_H
#include <arch/svinto.h>
/* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */ /* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */
extern unsigned long gen_config_ii_shadow; extern unsigned long gen_config_ii_shadow;
@ -34,7 +32,7 @@ extern volatile unsigned long *port_csp4_addr;
/* The LED's on various Etrax-based products are set differently. */ /* The LED's on various Etrax-based products are set differently. */
#if defined(CONFIG_ETRAX_NO_LEDS) || defined(CONFIG_SVINTO_SIM) #if defined(CONFIG_ETRAX_NO_LEDS)
#undef CONFIG_ETRAX_PA_LEDS #undef CONFIG_ETRAX_PA_LEDS
#undef CONFIG_ETRAX_PB_LEDS #undef CONFIG_ETRAX_PB_LEDS
#undef CONFIG_ETRAX_CSP0_LEDS #undef CONFIG_ETRAX_CSP0_LEDS
@ -171,29 +169,4 @@ extern volatile unsigned long *port_csp4_addr;
#define SOFT_SHUTDOWN() #define SOFT_SHUTDOWN()
#endif #endif
/* Console I/O for simulated etrax100. Use #ifdef so erroneous
use will be evident. */
#ifdef CONFIG_SVINTO_SIM
/* Let's use the ucsim interface since it lets us do write(2, ...) */
#define SIMCOUT(s,len) \
asm ("moveq 4,$r9 \n\t" \
"moveq 2,$r10 \n\t" \
"move.d %0,$r11 \n\t" \
"move.d %1,$r12 \n\t" \
"push $irp \n\t" \
"move 0f,$irp \n\t" \
"jump -6809 \n" \
"0: \n\t" \
"pop $irp" \
: : "rm" (s), "rm" (len) : "r9","r10","r11","r12","memory")
#define TRACE_ON() __extension__ \
({ int _Foofoo; __asm__ volatile ("bmod [%0],%0" : "=r" (_Foofoo) : "0" \
(255)); _Foofoo; })
#define TRACE_OFF() do { __asm__ volatile ("bmod [%0],%0" :: "r" (254)); } while (0)
#define SIM_END() do { __asm__ volatile ("bmod [%0],%0" :: "r" (28)); } while (0)
#define CRIS_CYCLES() __extension__ \
({ unsigned long c; asm ("bmod [%1],%0" : "=r" (c) : "r" (27)); c;})
#endif /* ! defined CONFIG_SVINTO_SIM */
#endif #endif

View File

@ -141,9 +141,9 @@ __asm__ ( \
* handler is run and it prioritizes the timer interrupt. However if we had BLOCK'ed * handler is run and it prioritizes the timer interrupt. However if we had BLOCK'ed
* it here, we would not get the multiple_irq at all. * it here, we would not get the multiple_irq at all.
* *
* The non-blocking here is based on the knowledge that the timer interrupt is * The non-blocking here is based on the knowledge that the timer interrupt runs
* registered as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not * with interrupts disabled, and therefore there will not be an sti() before the
* be an sti() before the timer irq handler is run to acknowledge the interrupt. * timer irq handler is run to acknowledge the interrupt.
*/ */
#define BUILD_TIMER_IRQ(nr,mask) \ #define BUILD_TIMER_IRQ(nr,mask) \

View File

@ -102,9 +102,9 @@ __asm__ ( \
* multiple_irq handler is run and it prioritizes the timer interrupt. However * multiple_irq handler is run and it prioritizes the timer interrupt. However
* if we had BLOCK'edit here, we would not get the multiple_irq at all. * if we had BLOCK'edit here, we would not get the multiple_irq at all.
* *
* The non-blocking here is based on the knowledge that the timer interrupt is * The non-blocking here is based on the knowledge that the timer interrupt runs
* registered as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not * with interrupts disabled, and therefore there will not be an sti() before the
* be an sti() before the timer irq handler is run to acknowledge the interrupt. * timer irq handler is run to acknowledge the interrupt.
*/ */
#define BUILD_TIMER_IRQ(nr, mask) \ #define BUILD_TIMER_IRQ(nr, mask) \
void IRQ_NAME(nr); \ void IRQ_NAME(nr); \

View File

@ -4,7 +4,7 @@
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
#define NR_syscalls 336 #define NR_syscalls 360
#include <arch/unistd.h> #include <arch/unistd.h>

View File

@ -340,5 +340,21 @@
#define __NR_preadv 333 #define __NR_preadv 333
#define __NR_pwritev 334 #define __NR_pwritev 334
#define __NR_setns 335 #define __NR_setns 335
#define __NR_name_to_handle_at 336
#define __NR_open_by_handle_at 337
#define __NR_rt_tgsigqueueinfo 338
#define __NR_perf_event_open 339
#define __NR_recvmmsg 340
#define __NR_accept4 341
#define __NR_fanotify_init 342
#define __NR_fanotify_mark 343
#define __NR_prlimit64 344
#define __NR_clock_adjtime 345
#define __NR_syncfs 346
#define __NR_sendmmsg 347
#define __NR_process_vm_readv 348
#define __NR_process_vm_writev 349
#define __NR_kcmp 350
#define __NR_finit_module 351
#endif /* _UAPI_ASM_CRIS_UNISTD_H_ */ #endif /* _UAPI_ASM_CRIS_UNISTD_H_ */

View File

@ -40,9 +40,6 @@
/* called by the assembler IRQ entry functions defined in irq.h /* called by the assembler IRQ entry functions defined in irq.h
* to dispatch the interrupts to registered handlers * to dispatch the interrupts to registered handlers
* interrupts are disabled upon entry - depending on if the
* interrupt was registered with IRQF_DISABLED or not, interrupts
* are re-enabled or not.
*/ */
asmlinkage void do_IRQ(int irq, struct pt_regs * regs) asmlinkage void do_IRQ(int irq, struct pt_regs * regs)