Commit 8012a7f7 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-ntfs.bkbits.net/ntfs-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 2d0fc731 ed97349f
......@@ -259,6 +259,47 @@ e-mail discussions.
11) Sign your work
To improve tracking of who did what, especially with patches that can
percolate to their final resting place in the kernel through several
layers of maintainers, we've introduced a "sign-off" procedure on
patches that are being emailed around.
The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right to
pass it on as a open-source patch. The rules are pretty simple: if you
can certify the below:
Developer's Certificate of Origin 1.0
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
then you just add a line saying
Signed-off-by: Random J Developer <random@developer.org>
Some people also put extra tags at the end. They'll just be ignored for
now, but you can do this to mark internal company procedures or just
point out some special detail about the sign-off.
-----------------------------------
SECTION 2 - HINTS, TIPS, AND TRICKS
-----------------------------------
......
......@@ -146,6 +146,10 @@ pmipal Use the protected mode interface for palette changes.
mtrr setup memory type range registers for the vesafb framebuffer.
vram:n remap 'n' MiB of video RAM. If 0 or not specified, remap memory
according to video mode. (2.5.66 patch/idea by Antonino Daplas
reversed to give override possibility (allocate more fb memory
than the kernel would) to 2.4 by tmb@iki.fi)
Have fun!
......
......@@ -904,6 +904,7 @@ help:
@echo ' rpm - Build a kernel as an RPM package'
@echo ' tags/TAGS - Generate tags file for editors'
@echo ' cscope - Generate cscope index'
@echo ' checkstack - Generate a list of stack hogs'
@echo ''
@echo 'Documentation targets:'
@$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
......
......@@ -447,7 +447,7 @@ static void do_pending_irqs(struct pt_regs *regs)
* come via this function. Instead, they should provide their
* own 'handler'
*/
asmlinkage void asm_do_IRQ(int irq, struct pt_regs *regs)
asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
{
struct irqdesc *desc = irq_desc + irq;
......
......@@ -108,7 +108,7 @@ arch_initcall(integrator_init);
#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET
static spinlock_t cm_lock;
static spinlock_t cm_lock = SPIN_LOCK_UNLOCKED;
/**
* cm_control - update the CM_CTRL register.
......
......@@ -83,12 +83,21 @@ unsigned int get_clk_frequency_khz(int info)
EXPORT_SYMBOL(get_clk_frequency_khz);
/*
* Return the current lclk requency in units of 10kHz
* Return the current memory clock frequency in units of 10kHz
*/
unsigned int get_lclk_frequency_10khz(void)
unsigned int get_memclk_frequency_10khz(void)
{
return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000;
}
EXPORT_SYMBOL(get_lclk_frequency_10khz);
EXPORT_SYMBOL(get_memclk_frequency_10khz);
/*
* Return the current LCD clock frequency in units of 10kHz
*/
unsigned int get_lcdclk_frequency_10khz(void)
{
return get_memclk_frequency_10khz();
}
EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
......@@ -21,100 +21,98 @@
#include "generic.h"
/* Crystal clock : 13-MHZ*/
/* Crystal clock: 13MHz */
#define BASE_CLK 13000000
/*
* Get the clock frequency as reflected by CCSR and the turbo flag.
* We assume these values have been applied via a fcs.
* If info is not 0 we also display the current settings.
*
* For more details, refer to Bulverde Manual, section 3.8.2.1
*/
unsigned int get_clk_frequency_khz( int info)
{
unsigned long ccsr, turbo, b, ht;
unsigned int l, L, m, M, n2, N, S, cccra;
unsigned long ccsr, clkcfg;
unsigned int l, L, m, M, n2, N, S;
int cccr_a, t, ht, b;
ccsr = CCSR;
cccra = CCCR & (0x1 << 25);
cccr_a = CCCR & (1 << 25);
/* Read clkcfg register: it has turbo, b, half-turbo (and f) */
asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (turbo) );
b = (turbo & (0x1 << 3));
ht = (turbo & (0x1 << 2));
asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
t = clkcfg & (1 << 1);
ht = clkcfg & (1 << 2);
b = clkcfg & (1 << 3);
l = ccsr & 0x1f;
n2 = (ccsr>>7) & 0xf;
if (l == 31) {
/* The calculation from the Yellow Book is incorrect:
it says M=4 for L=21-30 (which is easy to calculate
by subtracting 1 and then dividing by 10, but not
with 31, so we'll do it manually */
m = 1 << 2;
} else {
m = 1 << ((l-1)/10);
}
m = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
L = l * BASE_CLK;
N = (n2 * L) / 2;
S = (b) ? L : (L/2);
if (cccra == 0)
M = L/m;
else
M = (b) ? L : (L/2);
L = l * BASE_CLK;
N = (L * n2) / 2;
M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
S = (b) ? L : (L/2);
if (info) {
printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
L / 1000000, (L % 1000000) / 10000, l );
printk( KERN_INFO "Memory clock: %d.%02dMHz (/%d)\n",
M / 1000000, (M % 1000000) / 10000, m );
printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
N / 1000000, (N % 1000000)/10000, n2 / 2, (n2 % 2)*5,
(turbo & 1) ? "" : "in" );
(t) ? "" : "in" );
printk( KERN_INFO "Memory clock: %d.%02dMHz (/%d)\n",
M / 1000000, (M % 1000000) / 10000, m );
printk( KERN_INFO "System bus clock: %d.%02dMHz \n",
S / 1000000, (S % 1000000) / 10000 );
}
return (turbo & 1) ? (N/1000) : (L/1000);
return (t) ? (N/1000) : (L/1000);
}
/*
* Return the current mem clock frequency in units of 10kHz as
* reflected by CCCR[A], B, and L
*/
unsigned int get_lclk_frequency_10khz(void)
unsigned int get_memclk_frequency_10khz(void)
{
unsigned long ccsr, clkcfg, b;
unsigned int l, L, m, M, cccra;
unsigned long ccsr, clkcfg;
unsigned int l, L, m, M;
int cccr_a, b;
cccra = CCCR & (0x1 << 25);
ccsr = CCSR;
cccr_a = CCCR & (1 << 25);
/* Read clkcfg register to obtain b */
/* Read clkcfg register: it has turbo, b, half-turbo (and f) */
asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
b = (clkcfg & (0x1 << 3));
b = clkcfg & (1 << 3);
ccsr = CCSR;
l = ccsr & 0x1f;
if (l == 31) {
/* The calculation from the Yellow Book is incorrect:
it says M=4 for L=21-30 (which is easy to calculate
by subtracting 1 and then dividing by 10, but not
with 31, so we'll do it manually */
m = 1 << 2;
} else {
m = 1 << ((l-1)/10);
}
l = ccsr & 0x1f;
m = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
L = l * BASE_CLK;
if (cccra == 0)
M = L/m;
else
M = (b) ? L : L/2;
M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
return (M / 10000);
}
EXPORT_SYMBOL(get_clk_frequency_khz);
EXPORT_SYMBOL(get_lclk_frequency_10khz);
/*
* Return the current LCD clock frequency in units of 10kHz as
*/
unsigned int get_lcdclk_frequency_10khz(void)
{
unsigned long ccsr;
unsigned int l, L, k, K;
ccsr = CCSR;
l = ccsr & 0x1f;
k = (l <= 7) ? 1 : (l <= 16) ? 2 : 4;
L = l * BASE_CLK;
K = L / k;
return (K / 10000);
}
EXPORT_SYMBOL(get_clk_frequency_khz);
EXPORT_SYMBOL(get_memclk_frequency_10khz);
EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
......@@ -281,6 +281,7 @@ static int __init check_initrd(struct meminfo *mi)
static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int bootmap_pages)
{
pg_data_t *pgdat = NODE_DATA(0);
unsigned long res_size = 0;
/*
* Register the kernel text and data with bootmem.
......@@ -304,31 +305,32 @@ static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int boot
bootmap_pages << PAGE_SHIFT);
/*
* Hmm... This should go elsewhere, but we really really
* need to stop things allocating the low memory; we need
* a better implementation of GFP_DMA which does not assume
* that DMA-able memory starts at zero.
* Hmm... This should go elsewhere, but we really really need to
* stop things allocating the low memory; ideally we need a better
* implementation of GFP_DMA which does not assume that DMA-able
* memory starts at zero.
*/
if (machine_is_integrator())
reserve_bootmem_node(pgdat, 0, __pa(swapper_pg_dir));
if (machine_is_integrator() || machine_is_cintegrator())
res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
/*
* These should likewise go elsewhere. They pre-reserve
* the screen memory region at the start of main system
* memory.
* These should likewise go elsewhere. They pre-reserve the
* screen memory region at the start of main system memory.
*/
if (machine_is_archimedes() || machine_is_a5k())
reserve_bootmem_node(pgdat, 0x02000000, 0x00080000);
if (machine_is_edb7211())
reserve_bootmem_node(pgdat, 0xc0000000, 0x00020000);
res_size = 0x00020000;
if (machine_is_p720t())
reserve_bootmem_node(pgdat, PHYS_OFFSET, 0x00014000);
res_size = 0x00014000;
#ifdef CONFIG_SA1111
/*
* Because of the SA1111 DMA bug, we want to preserve
* our precious DMA-able memory...
* Because of the SA1111 DMA bug, we want to preserve our
* precious DMA-able memory...
*/
reserve_bootmem_node(pgdat, PHYS_OFFSET, __pa(swapper_pg_dir)-PHYS_OFFSET);
res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
#endif
if (res_size)
reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size);
}
/*
......@@ -601,7 +603,7 @@ void __init mem_init(void)
void free_initmem(void)
{
if (!machine_is_integrator()) {
if (!machine_is_integrator() && !machine_is_cintegrator()) {
free_area((unsigned long)(&__init_begin),
(unsigned long)(&__init_end),
"init");
......
......@@ -27,19 +27,11 @@ menu "General setup"
source "fs/Kconfig.binfmt"
config ETRAX_KGDB
bool "Use kernel gdb debugger"
---help---
The CRIS version of gdb can be used to remotely debug a running
Linux kernel via the serial debug port. Provided you have gdb-cris
installed, run gdb-cris vmlinux, then type
(gdb) set remotebaud 115200 <- kgdb uses 115200 as default
(gdb) target remote /dev/ttyS0 <- maybe you use another port
This should connect you to your booted kernel (or boot it now if you
didn't before). The kernel halts when it boots, waiting for gdb if
this option is turned on!
config ETRAX_CMDLINE
string "Kernel command line"
default "root=/dev/mtdblock3"
help
Pass additional commands to the kernel.
config ETRAX_WATCHDOG
bool "Enable ETRAX watchdog"
......@@ -99,11 +91,6 @@ config SVINTO_SIM
help
Support the xsim ETRAX Simulator.
config ETRAX200LX
bool "ETRAX-200LX-V32"
help
Support CRIS V32.
endchoice
config ETRAX_ARCH_V10
......@@ -111,11 +98,6 @@ config ETRAX_ARCH_V10
default y if ETRAX100LX || ETRAX100LX_V2
default n if !(ETRAX100LX || ETRAX100LX_V2)
config ETRAX_ARCH_V32
bool
default y if ETRAX200LX
default n if !(ETRAX200LX)
config ETRAX_DRAM_SIZE
int "DRAM size (dec, in MB)"
default "8"
......@@ -128,35 +110,18 @@ config ETRAX_FLASH_BUSWIDTH
help
Width in bytes of the Flash bus (1, 2 or 4). Is usually 2.
config ETRAX_ROOT_DEVICE
string "Root device name"
default "/dev/mtdblock3"
help
Specifies the device that should be mounted as root file system
when booting from flash. The axisflashmap driver adds an additional
mtd partition for the appended root file system image, so this option
should normally be the mtdblock device for the partition after the
last partition in the partition table.
# duplicate choice configs are not yet supported, so the followinguse
# doesn't work:
source arch/cris/arch-v10/Kconfig
endmenu
# bring in ETRAX built-in drivers
menu "Drivers for built-in interfaces"
source arch/cris/arch-v10/drivers/Kconfig
endmenu
source "drivers/base/Kconfig"
# bring in Etrax built-in drivers
source "arch/cris/drivers/Kconfig"
# standard linux drivers
source "drivers/mtd/Kconfig"
......@@ -212,6 +177,37 @@ config PROFILE_SHIFT
depends on PROFILE
default "2"
config ETRAX_KGDB
bool "Use kernel GDB debugger"
---help---
The CRIS version of gdb can be used to remotely debug a running
Linux kernel via the serial debug port. Provided you have gdb-cris
installed, run gdb-cris vmlinux, then type
(gdb) set remotebaud 115200 <- kgdb uses 115200 as default
(gdb) target remote /dev/ttyS0 <- maybe you use another port
This should connect you to your booted kernel (or boot it now if you
didn't before). The kernel halts when it boots, waiting for gdb if
this option is turned on!
config DEBUG_INFO
bool "Compile the kernel with debug info"
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
config FRAME_POINTER
bool "Compile the kernel with frame pointers"
help
If you say Y here the resulting kernel image will be slightly larger
and slower, but it will give very useful debugging information.
If you don't debug the kernel, you can say N, but we may not be able
to solve problems without frame pointers.
endmenu
source "security/Kconfig"
......
# $Id: Makefile,v 1.15 2003/07/04 12:47:53 tobiasa Exp $
# $Id: Makefile,v 1.20 2004/05/14 14:35:58 orjanf Exp $
# cris/Makefile
#
# This file is included by the global makefile so that you can add your own
......@@ -34,7 +34,7 @@ AFLAGS += -mlinux
CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
ifdef CONFIG_ETRAX_KGDB
ifdef CONFIG_FRAME_POINTER
CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
CFLAGS += -fno-omit-frame-pointer
endif
......@@ -90,10 +90,14 @@ prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \
# Create some links to make all tools happy
arch/$(ARCH)/.links:
@rm -rf arch/$(ARCH)/drivers
@ln -sfn $(SARCH)/drivers arch/$(ARCH)/drivers
@rm -rf arch/$(ARCH)/boot
@ln -sfn $(SARCH)/boot arch/$(ARCH)/boot
@rm -rf arch/$(ARCH)/lib
@ln -sfn $(SARCH)/lib arch/$(ARCH)/lib
@ln -sfn $(SARCH)/vmlinux.lds.S arch/$(ARCH)/kernel/vmlinux.lds.S
@ln -sfn $(SARCH) arch/$(ARCH)/arch
@ln -sfn ../$(SARCH)/vmlinux.lds.S arch/$(ARCH)/kernel/vmlinux.lds.S
@touch $@
# Create link to sub arch includes
......
/*
* misc.c
*
* $Id: misc.c,v 1.4 2003/04/09 05:20:45 starvik Exp $
* $Id: misc.c,v 1.6 2003/10/27 08:04:31 starvik Exp $
*
* This is a collection of several routines from gzip-1.0.3
* adapted for Linux.
......@@ -263,7 +263,7 @@ decompress_kernel()
__asm__ volatile ("move vr,%0" : "=rm" (revision));
if (revision < 10)
{
puts("You need an ETRAX 100LX to run linux 2.4\n");
puts("You need an ETRAX 100LX to run linux 2.6\n");
while(1);
}
......
......@@ -267,6 +267,7 @@ CONFIG_INET=y
# CONFIG_BLK_DEV_ISAPNP is not set
# CONFIG_IDE_CHIPSETS is not set
# CONFIG_IDEDMA_AUTO is not set
# CONFIG_BLK_DEV_IDE_MODES is not set
#
# SCSI support
......
......@@ -11,29 +11,6 @@ config NET_ETHERNET
bool
depends on ETRAX_ETHERNET
default y
---help---
Ethernet (also called IEEE 802.3 or ISO 8802-2) is the most common
type of Local Area Network (LAN) in universities and companies.
Common varieties of Ethernet are: 10BASE-2 or Thinnet (10 Mbps over
coaxial cable, linking computers in a chain), 10BASE-T or twisted
pair (10 Mbps over twisted pair cable, linking computers to central
hubs), 10BASE-F (10 Mbps over optical fiber links, using hubs),
100BASE-TX (100 Mbps over two twisted pair cables, using hubs),
100BASE-T4 (100 Mbps over 4 standard voice-grade twisted pair
cables, using hubs), 100BASE-FX (100 Mbps over optical fiber links)
[the 100BASE varieties are also known as Fast Ethernet], and Gigabit
Ethernet (1 Gbps over optical fiber or short copper links).
If your Linux machine will be connected to an Ethernet and you have
an Ethernet network interface card (NIC) installed in your computer,
say Y here and read the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>. You will then also have
to say Y to the driver for your particular NIC.
Note that the answer to this question won't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about Ethernet network cards. If unsure, say N.
choice
prompt "Network LED behavior"
......@@ -109,6 +86,32 @@ config ETRAX_SERIAL_PORT0
Normally you want this on, unless you use external DMA 1 that uses
the same DMA channels.
choice
prompt "Ser0 DMA out assignment"
depends on ETRAX_SERIAL_PORT0
default ETRAX_SERIAL_PORT0_DMA6_OUT
config CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT
bool "No DMA out"
config CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
bool "DMA 6"
endchoice
choice
prompt "Ser0 DMA in assignment"
depends on ETRAX_SERIAL_PORT0
default ETRAX_SERIAL_PORT0_DMA7_IN
config CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN
bool "No DMA in"
config CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
bool "DMA 7"
endchoice
choice
prompt "Ser0 DTR, RI, DSR and CD assignment"
depends on ETRAX_SERIAL_PORT0
......@@ -197,6 +200,32 @@ config ETRAX_SERIAL_PORT1
help
Enables the ETRAX 100 serial driver for ser1 (ttyS1).
choice
prompt "Ser1 DMA out assignment"
depends on ETRAX_SERIAL_PORT1
default ETRAX_SERIAL_PORT1_DMA8_OUT
config CONFIG_ETRAX_SERIAL_PORT1_NO_DMA_OUT
bool "No DMA out"
config CONFIG_ETRAX_SERIAL_PORT1_DMA8_OUT
bool "DMA 8"
endchoice
choice
prompt "Ser1 DMA in assignment"
depends on ETRAX_SERIAL_PORT1
default ETRAX_SERIAL_PORT1_DMA9_IN
config CONFIG_ETRAX_SERIAL_PORT1_NO_DMA_IN
bool "No DMA in"
config CONFIG_ETRAX_SERIAL_PORT1_DMA9_IN
bool "DMA 9"
endchoice
choice
prompt "Ser1 DTR, RI, DSR and CD assignment"
depends on ETRAX_SERIAL_PORT1
......@@ -288,6 +317,32 @@ config ETRAX_SERIAL_PORT2
help
Enables the ETRAX 100 serial driver for ser2 (ttyS2).
choice
prompt "Ser2 DMA out assignment"
depends on ETRAX_SERIAL_PORT2
default ETRAX_SERIAL_PORT2_DMA2_OUT
config CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT
bool "No DMA out"
config CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
bool "DMA 2"
endchoice
choice
prompt "Ser2 DMA in assignment"
depends on ETRAX_SERIAL_PORT2
default ETRAX_SERIAL_PORT2_DMA3_IN
config CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN
bool "No DMA in"
config CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
bool "DMA 3"
endchoice
choice
prompt "Ser2 DTR, RI, DSR and CD assignment"
depends on ETRAX_SERIAL_PORT2
......@@ -376,6 +431,32 @@ config ETRAX_SERIAL_PORT3
help
Enables the ETRAX 100 serial driver for ser3 (ttyS3).
choice
prompt "Ser3 DMA out assignment"
depends on ETRAX_SERIAL_PORT3
default ETRAX_SERIAL_PORT3_DMA4_OUT
config CONFIG_ETRAX_SERIAL_PORT3_NO_DMA_OUT
bool "No DMA out"
config CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT
bool "DMA 4"
endchoice
choice
prompt "Ser3 DMA in assignment"
depends on ETRAX_SERIAL_PORT3
default ETRAX_SERIAL_PORT3_DMA5_IN
config CONFIG_ETRAX_SERIAL_PORT3_NO_DMA_IN
bool "No DMA in"
config CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN
bool "DMA 5"
endchoice
choice
prompt "Ser3 DTR, RI, DSR and CD assignment"
depends on ETRAX_SERIAL_PORT3
......@@ -466,6 +547,95 @@ config ETRAX_RS485_DISABLE_RECEIVER
loopback. Not all products are able to do this in software only.
Axis 2400/2401 must disable receiver.
config ETRAX_IDE
bool "ATA/IDE support"
help
Enable this to get support for ATA/IDE.
You can't use parallell ports or SCSI ports
at the same time.
# here we should add the CONFIG_'s necessary to enable the basic
# general ide drivers so the common case does not need to go
# into that config submenu. enable disk and CD support. others
# need to go fiddle in the submenu..
config IDE
tristate
depends on ETRAX_IDE
default y
config BLK_DEV_IDE
tristate
depends on ETRAX_IDE
default y
config BLK_DEV_IDEDISK
tristate
depends on ETRAX_IDE
default y
config BLK_DEV_IDECD
tristate
depends on ETRAX_IDE
default y
config BLK_DEV_IDEDMA
bool
depends on ETRAX_IDE
default y
config DMA_NONPCI
bool
depends on ETRAX_IDE
default y
config ETRAX_IDE_DELAY
int "Delay for drives to regain consciousness"
depends on ETRAX_IDE
default 15
help
Number of seconds to wait for IDE drives to spin up after an IDE
reset.
choice
prompt "IDE reset pin"
depends on ETRAX_IDE
default ETRAX_IDE_PB7_RESET
config ETRAX_IDE_PB7_RESET
bool "Port_PB_Bit_7"
help
IDE reset on pin 7 on port B
config ETRAX_IDE_G27_RESET
bool "Port_G_Bit_27"
help
IDE reset on pin 27 on port G
endchoice
config ETRAX_USB_HOST
bool "USB host"
help
This option enables the host functionality of the ETRAX 100LX
built-in USB controller. In host mode the controller is designed
for CTRL and BULK traffic only, INTR traffic may work as well
however (depending on the requirements of timeliness).
config USB
tristate
depends on ETRAX_USB_HOST
default y
config ETRAX_USB_HOST_PORT1
bool " USB port 1 enabled"
depends on ETRAX_USB_HOST
default n
config ETRAX_USB_HOST_PORT2
bool " USB port 2 enabled"
depends on ETRAX_USB_HOST
default n
config ETRAX_AXISFLASHMAP
bool "Axis flash-map support"
depends on ETRAX_ARCH_V10
......
......@@ -10,5 +10,7 @@ obj-$(CONFIG_ETRAX_I2C_EEPROM) += eeprom.o
obj-$(CONFIG_ETRAX_GPIO) += gpio.o
obj-$(CONFIG_ETRAX_DS1302) += ds1302.o
obj-$(CONFIG_ETRAX_PCF8563) += pcf8563.o
obj-$(CONFIG_ETRAX_IDE) += ide.o
obj-$(CONFIG_ETRAX_USB_HOST) += usb-host.o
......@@ -11,6 +11,9 @@
* partition split defined below.
*
* $Log: axisflashmap.c,v $
* Revision 1.8 2004/05/14 07:58:03 starvik
* Merge of changes from 2.4
*
* Revision 1.6 2003/07/04 08:27:37 starvik
* Merge of Linux 2.5.74
*
......@@ -153,6 +156,9 @@
/* From head.S */
extern unsigned long romfs_start, romfs_length, romfs_in_flash;
/* The master mtd for the entire flash. */
struct mtd_info* axisflash_mtd = NULL;
/* Map driver functions. */
static __u8 flash_read8(struct map_info *map, unsigned long ofs)
......@@ -314,7 +320,8 @@ static struct mtd_info *probe_cs(struct map_info *map_cs)
{
struct mtd_info *mtd_cs = NULL;
printk("%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
printk(KERN_INFO
"%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
map_cs->name, map_cs->size, map_cs->map_priv_1);
#ifdef CONFIG_MTD_AMDSTD
......@@ -398,7 +405,7 @@ static int __init init_axis_flash(void)
struct mtd_info *mymtd;
int err = 0;
int pidx = 0;
struct partitiontable_head *ptable_head;
struct partitiontable_head *ptable_head = NULL;
struct partitiontable_entry *ptable;
int use_default_ptable = 1; /* Until proven otherwise. */
const char *pmsg = " /dev/flash%d at 0x%08x, size 0x%08x\n";
......@@ -407,19 +414,22 @@ static int __init init_axis_flash(void)
/* There's no reason to use this module if no flash chip can
* be identified. Make sure that's understood.
*/
panic("axisflashmap found no flash chip!\n");
printk(KERN_INFO "axisflashmap: Found no flash chip.\n");
} else {
printk(KERN_INFO "%s: 0x%08x bytes of flash memory.\n",
mymtd->name, mymtd->size);
axisflash_mtd = mymtd;
}
printk("%s: 0x%08x bytes of flash memory.\n",
mymtd->name, mymtd->size);
mymtd->owner = THIS_MODULE;
ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR +
CONFIG_ETRAX_PTABLE_SECTOR + PARTITION_TABLE_OFFSET);
if (mymtd) {
mymtd->owner = THIS_MODULE;
ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR +
CONFIG_ETRAX_PTABLE_SECTOR +
PARTITION_TABLE_OFFSET);
}
pidx++; /* First partition is always set to the default. */
if ((ptable_head->magic == PARTITION_TABLE_MAGIC)
if (ptable_head && (ptable_head->magic == PARTITION_TABLE_MAGIC)
&& (ptable_head->size <
(MAX_PARTITIONS * sizeof(struct partitiontable_entry) +
PARTITIONTABLE_END_MARKER_SIZE))
......@@ -454,7 +464,7 @@ static int __init init_axis_flash(void)
ptable_ok = (csum == ptable_head->checksum);
/* Read the entries and use/show the info. */
printk(" Found a%s partition table at 0x%p-0x%p.\n",
printk(KERN_INFO " Found a%s partition table at 0x%p-0x%p.\n",
(ptable_ok ? " valid" : "n invalid"), ptable_head,
max_addr);
......@@ -486,22 +496,25 @@ static int __init init_axis_flash(void)
axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;
printk(" Adding readonly flash partition for romfs image:\n");
printk(KERN_INFO
" Adding readonly flash partition for romfs image:\n");
printk(pmsg, pidx, axis_partitions[pidx].offset,
axis_partitions[pidx].size);
pidx++;
}
if (use_default_ptable) {
printk(" Using default partition table.\n");
err = add_mtd_partitions(mymtd, axis_default_partitions,
NUM_DEFAULT_PARTITIONS);
} else {
err = add_mtd_partitions(mymtd, axis_partitions, pidx);
}
if (mymtd) {
if (use_default_ptable) {
printk(KERN_INFO " Using default partition table.\n");
err = add_mtd_partitions(mymtd, axis_default_partitions,
NUM_DEFAULT_PARTITIONS);
} else {
err = add_mtd_partitions(mymtd, axis_partitions, pidx);
}
if (err) {
panic("axisflashmap could not add MTD partitions!\n");
if (err) {
panic("axisflashmap could not add MTD partitions!\n");
}
}
if (!romfs_in_flash) {
......@@ -522,7 +535,7 @@ static int __init init_axis_flash(void)
"mtd_info!\n");
}
printk(" Adding RAM partition for romfs image:\n");
printk(KERN_INFO " Adding RAM partition for romfs image:\n");
printk(pmsg, pidx, romfs_start, romfs_length);
err = mtdram_init_device(mtd_ram, (void*)romfs_start,
......@@ -539,3 +552,5 @@ static int __init init_axis_flash(void)
/* This adds the above to the kernels init-call chain. */
module_init(init_axis_flash);
EXPORT_SYMBOL(axisflash_mtd);
......@@ -4,9 +4,18 @@
*!
*! DESCRIPTION: Implements an interface for the DS1302 RTC through Etrax I/O
*!
*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init, get_rtc_status
*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init
*!
*! $Log: ds1302.c,v $
*! Revision 1.13 2004/05/28 09:26:59 starvik
*! Modified I2C initialization to work in 2.6.
*!
*! Revision 1.12 2004/05/14 07:58:03 starvik
*! Merge of changes from 2.4
*!
*! Revision 1.10 2004/02/04 09:25:12 starvik
*! Merge of Linux 2.6.2
*!
*! Revision 1.9 2003/07/04 08:27:37 starvik
*! Merge of Linux 2.5.74
*!
......@@ -114,7 +123,7 @@
*!
*! (C) Copyright 1999, 2000, 2001 Axis Communications AB, LUND, SWEDEN
*!
*! $Id: ds1302.c,v 1.9 2003/07/04 08:27:37 starvik Exp $
*! $Id: ds1302.c,v 1.13 2004/05/28 09:26:59 starvik Exp $
*!
*!***************************************************************************/
......@@ -283,12 +292,23 @@ ds1302_readreg(int reg)
void
ds1302_writereg(int reg, unsigned char val)
{
ds1302_wenable();
start();
out_byte(0x80 | (reg << 1)); /* write register */
out_byte(val);
stop();
ds1302_wdisable();
#ifndef CONFIG_ETRAX_RTC_READONLY
int do_writereg = 1;
#else
int do_writereg = 0;
if (reg == RTC_TRICKLECHARGER)
do_writereg = 1;
#endif
if (do_writereg) {
ds1302_wenable();
start();
out_byte(0x80 | (reg << 1)); /* write register */
out_byte(val);
stop();
ds1302_wdisable();
}
}
void
......@@ -426,20 +446,33 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
tcs_val = RTC_TCR_PATTERN | (tcs_val & 0x0F);
ds1302_writereg(RTC_TRICKLECHARGER, tcs_val);
return 0;
}
}
case RTC_VLOW_RD:
{
/* TODO:
* Implement voltage low detection support
*/
printk(KERN_WARNING "DS1302: RTC Voltage Low detection"
" is not supported\n");
return 0;
}
case RTC_VLOW_SET:
{
/* TODO:
* Nothing to do since Voltage Low detection is not supported
*/
return 0;
}
default:
return -ENOIOCTLCMD;
}
}
int
get_rtc_status(char *buf)
static void
print_rtc_status(void)
{
char *p;
struct rtc_time tm;
p = buf;
get_rtc_time(&tm);
/*
......@@ -447,16 +480,12 @@ get_rtc_status(char *buf)
* time or for Universal Standard Time (GMT). Probably local though.
*/
p += sprintf(p,
"rtc_time\t: %02d:%02d:%02d\n"
"rtc_date\t: %04d-%02d-%02d\n",
tm.tm_hour, tm.tm_min, tm.tm_sec,
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
return p - buf;
printk(KERN_INFO "rtc_time\t: %02d:%02d:%02d\n",
tm.tm_hour, tm.tm_min, tm.tm_sec);
printk(KERN_INFO "rtc_date\t: %04d-%02d-%02d\n",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
}
/* The various file operations we support. */
static struct file_operations rtc_fops = {
......@@ -487,11 +516,10 @@ ds1302_probe(void)
out_byte(0xc1); /* read RAM byte 0 */
if((res = in_byte()) == MAGIC_PATTERN) {
char buf[100];
stop();
ds1302_wdisable();
printk("%s: RTC found.\n", ds1302_name);
printk("%s: SDA, SCL, RST on PB%i, PB%i, %s%i\n",
printk(KERN_INFO "%s: RTC found.\n", ds1302_name);
printk(KERN_INFO "%s: SDA, SCL, RST on PB%i, PB%i, %s%i\n",
ds1302_name,
CONFIG_ETRAX_DS1302_SDABIT,
CONFIG_ETRAX_DS1302_SCLBIT,
......@@ -501,12 +529,10 @@ ds1302_probe(void)
"PB",
#endif
CONFIG_ETRAX_DS1302_RSTBIT);
get_rtc_status(buf);
printk(buf);
print_rtc_status();
retval = 1;
} else {
stop();
printk("%s: RTC not found.\n", ds1302_name);
retval = 0;
}
......@@ -518,7 +544,9 @@ ds1302_probe(void)
int __init
ds1302_init(void)
{
{
i2c_init();
if (!ds1302_probe()) {
#ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT
#if CONFIG_ETRAX_DS1302_RSTBIT == 27
......@@ -539,16 +567,20 @@ ds1302_init(void)
(IO_STATE(R_GEN_CONFIG, g0dir, out)));
*R_GEN_CONFIG = genconfig_shadow;
#endif
if (!ds1302_probe())
if (!ds1302_probe()) {
printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name);
return -1;
}
#else
printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name);
return -1;
#endif
}
/* Initialise trickle charger */
ds1302_writereg(RTC_TRICKLECHARGER,
RTC_TCR_PATTERN |(CONFIG_ETRAX_DS1302_TRICKLE_CHARGE & 0x0F));
/* Start clock by resetting CLOCK_HALT */
ds1302_writereg(RTC_SECONDS, (ds1302_readreg(RTC_SECONDS) & 0x7F));
return 0;
}
......
......@@ -20,6 +20,9 @@
*! in the spin-lock.
*!
*! $Log: eeprom.c,v $
*! Revision 1.10 2003/09/11 07:29:48 starvik
*! Merge of Linux 2.6.0-test5
*!
*! Revision 1.9 2003/07/04 08:27:37 starvik
*! Merge of Linux 2.5.74
*!
......@@ -441,9 +444,9 @@ int __init eeprom_init(void)
static int eeprom_open(struct inode * inode, struct file * file)
{
if(iminor(inode) != EEPROM_MINOR_NR)
if(MINOR(inode->i_rdev) != EEPROM_MINOR_NR)
return -ENXIO;
if(imajor(inode) != EEPROM_MAJOR_NR)
if(MAJOR(inode->i_rdev) != EEPROM_MAJOR_NR)
return -ENXIO;
if( eeprom.size > 0 )
......
This diff is collapsed.
/* $Id: gpio.c,v 1.8 2003/07/04 08:27:37 starvik Exp $
/* $Id: gpio.c,v 1.11 2004/05/14 07:58:03 starvik Exp $
*
* Etrax general port I/O device
*
......@@ -9,6 +9,12 @@
* Johan Adolfsson (read/set directions, write, port G)
*
* $Log: gpio.c,v $
* Revision 1.11 2004/05/14 07:58:03 starvik
* Merge of changes from 2.4
*
* Revision 1.9 2003/09/11 07:29:48 starvik
* Merge of Linux 2.6.0-test5
*
* Revision 1.8 2003/07/04 08:27:37 starvik
* Merge of Linux 2.5.74
*
......@@ -183,6 +189,7 @@ struct gpio_private {
static struct gpio_private *alarmlist = 0;
static int gpio_some_alarms = 0; /* Set if someone uses alarm */
static unsigned long gpio_pa_irq_enabled_mask = 0;
/* Port A and B use 8 bit access, but Port G is 32 bit */
#define NUM_PORTS (GPIO_MINOR_B+1)
......@@ -252,13 +259,19 @@ gpio_poll(struct file *file,
unsigned long data;
poll_wait(file, &priv->alarm_wq, wait);
if (priv->minor == GPIO_MINOR_A) {
unsigned long flags;
unsigned long tmp;
data = *R_PORT_PA_DATA;
/* PA has support for high level interrupt -
* lets activate for those low and with highalarm set
*/
tmp = ~data & priv->highalarm & 0xFF;
*R_IRQ_MASK1_SET = (tmp << R_IRQ_MASK1_SET__pa0__BITNR);
tmp = (tmp << R_IRQ_MASK1_SET__pa0__BITNR);
save_flags(flags); cli();
gpio_pa_irq_enabled_mask |= tmp;
*R_IRQ_MASK1_SET = tmp;
restore_flags(flags);
} else if (priv->minor == GPIO_MINOR_B)
data = *R_PORT_PB_DATA;
else if (priv->minor == GPIO_MINOR_G)
......@@ -312,12 +325,15 @@ gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long tmp;
/* Find what PA interrupts are active */
tmp = (*R_IRQ_READ1 >> R_IRQ_READ1__pa0__BITNR) & 0xFF;
tmp = (*R_IRQ_READ1);
/* Find those that we have enabled */
tmp &= gpio_pa_irq_enabled_mask;
/* Clear them.. */
/* NOTE: Maybe we need to be more careful here if some other
* driver uses PA interrupt as well?
*/
*R_IRQ_MASK1_CLR = (tmp << R_IRQ_MASK1_CLR__pa0__BITNR);
*R_IRQ_MASK1_CLR = tmp;
gpio_pa_irq_enabled_mask &= ~tmp;
if (gpio_some_alarms) {
return IRQ_RETVAL(etrax_gpio_wake_up_check());
}
......@@ -386,7 +402,7 @@ static int
gpio_open(struct inode *inode, struct file *filp)
{
struct gpio_private *priv;
int p = iminor(inode);
int p = MINOR(inode->i_rdev);
if (p > GPIO_MINOR_LAST)
return -EINVAL;
......@@ -479,6 +495,7 @@ unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
return ~(*priv->dir_shadow) & 0xFF; /* Only 8 bits */
} else if (priv->minor == GPIO_MINOR_G) {
/* We must fiddle with R_GEN_CONFIG to change dir */
save_flags(flags); cli();
if (((arg & dir_g_in_bits) != arg) &&
(arg & changeable_dir_g)) {
arg &= changeable_dir_g;
......@@ -503,16 +520,17 @@ unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
dir_g_in_bits |= (1<<24);
dir_g_out_bits &= ~(1<<24);
}
printk("gpio: SETINPUT on port G set "
"genconfig to 0x%08lX "
"in_bits: 0x%08lX "
"out_bits: 0x%08lX\n",
(unsigned long)genconfig_shadow,
dir_g_in_bits, dir_g_out_bits);
D(printk(KERN_INFO "gpio: SETINPUT on port G set "
"genconfig to 0x%08lX "
"in_bits: 0x%08lX "
"out_bits: 0x%08lX\n",
(unsigned long)genconfig_shadow,
dir_g_in_bits, dir_g_out_bits));
*R_GEN_CONFIG = genconfig_shadow;
/* Must be a >120 ns delay before writing this again */
}
restore_flags(flags);
return dir_g_in_bits;
}
return 0;
......@@ -529,6 +547,7 @@ unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg)
return *priv->dir_shadow;
} else if (priv->minor == GPIO_MINOR_G) {
/* We must fiddle with R_GEN_CONFIG to change dir */
save_flags(flags); cli();
if (((arg & dir_g_out_bits) != arg) &&
(arg & changeable_dir_g)) {
/* Set bits in genconfig to set to output */
......@@ -552,15 +571,16 @@ unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg)
dir_g_out_bits |= (1<<24);
dir_g_in_bits &= ~(1<<24);
}
printk("gpio: SETOUTPUT on port G set "
"genconfig to 0x%08lX "
"in_bits: 0x%08lX "
"out_bits: 0x%08lX\n",
(unsigned long)genconfig_shadow,
dir_g_in_bits, dir_g_out_bits);
D(printk(KERN_INFO "gpio: SETOUTPUT on port G set "
"genconfig to 0x%08lX "
"in_bits: 0x%08lX "
"out_bits: 0x%08lX\n",
(unsigned long)genconfig_shadow,
dir_g_in_bits, dir_g_out_bits));
*R_GEN_CONFIG = genconfig_shadow;
/* Must be a >120 ns delay before writing this again */
}
restore_flags(flags);
return dir_g_out_bits & 0x7FFFFFFF;
}
return 0;
......@@ -625,6 +645,20 @@ gpio_ioctl(struct inode *inode, struct file *file,
// clear alarm for bits with 1 in arg
priv->highalarm &= ~arg;
priv->lowalarm &= ~arg;
{
/* Must update gpio_some_alarms */
struct gpio_private *p = alarmlist;
int some_alarms;
some_alarms = 0;
while (p) {
if (p->highalarm | p->lowalarm) {
some_alarms = 1;
break;
}
p = p->next;
}
gpio_some_alarms = some_alarms;
}
break;
case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */
/* Read direction 0=input 1=output */
......@@ -844,9 +878,9 @@ static void __init gpio_init_port_g(void)
dir_g_in_bits |= (~dir_g_shadow & changeable_dir_g);
printk("GPIO port G: in_bits: 0x%08lX out_bits: 0x%08lX val: %08lX\n",
printk(KERN_INFO "GPIO port G: in_bits: 0x%08lX out_bits: 0x%08lX val: %08lX\n",
dir_g_in_bits, dir_g_out_bits, (unsigned long)*R_PORT_G_DATA);
printk("GPIO port G: dir: %08lX changeable: %08lX\n",
printk(KERN_INFO "GPIO port G: dir: %08lX changeable: %08lX\n",
dir_g_shadow, changeable_dir_g);
}
......@@ -883,7 +917,7 @@ gpio_init(void)
#endif
gpio_init_port_g();
printk("ETRAX 100LX GPIO driver v2.5, (c) 2001, 2002 Axis Communications AB\n");
printk(KERN_INFO "ETRAX 100LX GPIO driver v2.5, (c) 2001, 2002 Axis Communications AB\n");
/* We call etrax_gpio_wake_up_check() from timer interrupt and
* from cpu_idle() in kernel/process.c
* The check in cpu_idle() reduces latency from ~15 ms to ~6 ms
......@@ -891,11 +925,11 @@ gpio_init(void)
*/
if (request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt,
SA_SHIRQ | SA_INTERRUPT,"gpio poll", NULL)) {
printk("err: timer0 irq for gpio\n");
printk(KERN_CRIT "err: timer0 irq for gpio\n");
}
if (request_irq(PA_IRQ_NBR, gpio_pa_interrupt,
SA_SHIRQ | SA_INTERRUPT,"gpio PA", NULL)) {
printk("err: PA irq for gpio\n");
printk(KERN_CRIT "err: PA irq for gpio\n");
}
......
......@@ -12,6 +12,12 @@
*! don't use PB_I2C if DS1302 uses same bits,
*! use PB.
*! $Log: i2c.c,v $
*! Revision 1.7 2004/05/28 09:26:59 starvik
*! Modified I2C initialization to work in 2.6.
*!
*! Revision 1.6 2004/05/14 07:58:03 starvik
*! Merge of changes from 2.4
*!
*! Revision 1.4 2002/12/11 13:13:57 starvik
*! Added arch/ to v10 specific includes
*! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
......@@ -63,7 +69,7 @@
*! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN
*!
*!***************************************************************************/
/* $Id: i2c.c,v 1.4 2002/12/11 13:13:57 starvik Exp $ */
/* $Id: i2c.c,v 1.7 2004/05/28 09:26:59 starvik Exp $ */
/****************** INCLUDE FILES SECTION ***********************************/
......@@ -310,6 +316,12 @@ i2c_inbyte(void)
}
i2c_clk(I2C_CLOCK_HIGH);
i2c_delay(CLOCK_HIGH_TIME);
/*
* we leave the clock low, getbyte is usually followed
* by sendack/nack, they assume the clock to be low
*/
i2c_clk(I2C_CLOCK_LOW);
return aBitByte;
}
......@@ -371,6 +383,13 @@ i2c_getack(void)
i2c_delay(CLOCK_HIGH_TIME/2);
}
/*
* our clock is high now, make sure data is low
* before we enable our output. If we keep data high
* and enable output, we would generate a stop condition.
*/
i2c_data(I2C_DATA_LOW);
/*
* end clock pulse
*/
......@@ -426,6 +445,37 @@ i2c_sendack(void)
i2c_dir_in();
}
/*#---------------------------------------------------------------------------
*#
*# FUNCTION NAME: i2c_sendnack
*#
*# DESCRIPTION : Sends NACK on received data
*#
*#--------------------------------------------------------------------------*/
void
i2c_sendnack(void)
{
/*
* enable output
*/
i2c_delay(CLOCK_LOW_TIME);
i2c_dir_out();
/*
* set data high
*/
i2c_data(I2C_DATA_HIGH);
/*
* generate clock pulse
*/
i2c_delay(CLOCK_HIGH_TIME/6);
i2c_clk(I2C_CLOCK_HIGH);
i2c_delay(CLOCK_HIGH_TIME);
i2c_clk(I2C_CLOCK_LOW);
i2c_delay(CLOCK_LOW_TIME);
i2c_dir_in();
}
/*#---------------------------------------------------------------------------
*#
*# FUNCTION NAME: i2c_writereg
......@@ -489,7 +539,7 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg,
} while(error && cntr--);
i2c_delay(CLOCK_LOW_TIME);
return -error;
}
......@@ -557,7 +607,8 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
*/
b = i2c_inbyte();
/*
* send Ack
* last received byte needs to be nacked
* instead of acked
*/
i2c_sendack();
/*
......@@ -634,11 +685,9 @@ static struct file_operations i2c_fops = {
.release = i2c_release,
};
static int __init
int __init
i2c_init(void)
{
int res;
/* Setup and enable the Port B I2C interface */
#ifndef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C
......@@ -656,21 +705,28 @@ i2c_init(void)
IO_STATE(R_PORT_PB_DIR, dir0, input) |
IO_STATE(R_PORT_PB_DIR, dir1, output));
/* register char device */
return 0;
}
static int __init
i2c_register(void)
{
int res;
res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
i2c_init();
res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
if(res < 0) {
printk(KERN_ERR "i2c: couldn't get a major number.\n");
return res;
}
printk("I2C driver v2.2, (c) 1999-2001 Axis Communications AB\n");
printk(KERN_INFO "I2C driver v2.2, (c) 1999-2001 Axis Communications AB\n");
return 0;
}
/* this makes sure that i2c_init is called during boot */
/* this makes sure that i2c_register is called during boot */
module_init(i2c_init);
module_init(i2c_register);
/****************** END OF FILE i2c.c ********************************/
/* $Id: i2c.h,v 1.2 2002/11/18 13:16:06 starvik Exp $ */
/* $Id: i2c.h,v 1.3 2004/05/28 09:26:59 starvik Exp $ */
int i2c_init(void);
/* High level I2C actions */
int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue);
......
This diff is collapsed.
......@@ -15,7 +15,7 @@
*
* Author: Tobias Anderberg <tobiasa@axis.com>.
*
* $Id: pcf8563.c,v 1.1 2002/12/12 08:27:26 starvik Exp $
* $Id: pcf8563.c,v 1.4 2004/05/28 09:26:59 starvik Exp $
*/
#include <linux/config.h>
......@@ -28,6 +28,7 @@
#include <linux/fs.h>
#include <linux/ioctl.h>
#include <linux/delay.h>
#include <linux/bcd.h>
#include <asm/uaccess.h>
#include <asm/system.h>
......@@ -39,7 +40,7 @@
#define PCF8563_MAJOR 121 /* Local major number. */
#define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */
#define PCF8563_NAME "PCF8563"
#define DRIVER_VERSION "$Revision: 1.1 $"
#define DRIVER_VERSION "$Revision: 1.4 $"
/* I2C bus slave registers. */
#define RTC_I2C_READ 0xa3
......@@ -85,7 +86,12 @@ pcf8563_readreg(int reg)
void
pcf8563_writereg(int reg, unsigned char val)
{
i2c_writereg(RTC_I2C_WRITE,reg,val);
#ifdef CONFIG_ETRAX_RTC_READONLY
if (reg == RTC_CONTROL1 || (reg >= RTC_SECONDS && reg <= RTC_YEAR))
return;
#endif
rtc_write(reg, val);
}
void
......@@ -120,6 +126,9 @@ int __init
pcf8563_init(void)
{
unsigned char ret;
i2c_init();
/*
* First of all we need to reset the chip. This is done by
* clearing control1, control2 and clk freq, clear the
......@@ -152,14 +161,6 @@ pcf8563_init(void)
if (rtc_write(RTC_WEEKDAY_ALARM, 0x00) < 0)
goto err;
if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) {
printk(KERN_INFO "%s: Unable to get major numer %d for RTC device.\n",
PCF8563_NAME, PCF8563_MAJOR);
return -1;
}
printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME, DRIVER_VERSION);
/* Check for low voltage, and warn about it.. */
if (rtc_read(RTC_SECONDS) & 0x80)
......@@ -210,9 +211,11 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
break;
case RTC_SET_TIME:
{
#ifdef CONFIG_ETRAX_RTC_READONLY
return -EPERM;
#else
int leap;
int century;
unsigned long flags;
struct rtc_time tm;
memset(&tm, 0, sizeof (struct rtc_time));
......@@ -256,8 +259,35 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
rtc_write(RTC_SECONDS, tm.tm_sec);
return 0;
#endif /* !CONFIG_ETRAX_RTC_READONLY */
}
break;
case RTC_VLOW_RD:
{
int vl_bit = 0;
if (rtc_read(RTC_SECONDS) & 0x80) {
vl_bit = 1;
printk(KERN_WARNING "%s: RTC Voltage Low - reliable "
"date/time information is no longer guaranteed!\n",
PCF8563_NAME);
}
if (copy_to_user((int *) arg, &vl_bit, sizeof(int)))
return -EFAULT;
return 0;
}
case RTC_VLOW_SET:
{
/* Clear the VL bit in the seconds register */
int ret = rtc_read(RTC_SECONDS);
rtc_write(RTC_SECONDS, (ret & 0x7F));
return 0;
}
default:
return -ENOTTY;
}
......@@ -265,5 +295,19 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
return 0;
}
module_init(pcf8563_init);
static int __init
pcf8563_register(void)
{
pcf8563_init();
if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) {
printk(KERN_INFO "%s: Unable to get major numer %d for RTC device.\n",
PCF8563_NAME, PCF8563_MAJOR);
return -1;
}
printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME, DRIVER_VERSION);
return 0;
}
module_init(pcf8563_register);
module_exit(pcf8563_exit);
This diff is collapsed.
......@@ -44,15 +44,11 @@ struct e100_serial {
volatile u32 *ofirstadr; /* adr to R_DMA_CHx_FIRST */
volatile u8 *ocmdadr; /* adr to R_DMA_CHx_CMD */
const volatile u8 *ostatusadr; /* adr to R_DMA_CHx_STATUS */
volatile u32 *ohwswadr; /* adr to R_DMA_CHx_HWSW */
volatile u32 *odescradr; /* adr to R_DMA_CHx_DESCR */
/* Input registers */
volatile u8 *iclrintradr; /* adr to R_DMA_CHx_CLR_INTR */
volatile u32 *ifirstadr; /* adr to R_DMA_CHx_FIRST */
volatile u8 *icmdadr; /* adr to R_DMA_CHx_CMD */
const volatile u8 *istatusadr; /* adr to R_DMA_CHx_STATUS */
volatile u32 *ihwswadr; /* adr to R_DMA_CHx_HWSW */
volatile u32 *idescradr; /* adr to R_DMA_CHx_DESCR */
int flags; /* defined in tty.h */
......@@ -60,14 +56,17 @@ struct e100_serial {
u8 rx_ctrl; /* shadow for R_SERIALx_REC_CTRL */
u8 tx_ctrl; /* shadow for R_SERIALx_TR_CTRL */
u8 iseteop; /* bit number for R_SET_EOP for the input dma */
int enabled; /* Set to 1 if the port is enabled in HW config */
/* end of fields defined in rs_table[] in .c-file */
int uses_dma; /* Set to 1 if DMA should be used */
unsigned char forced_eop; /* a fifo eop has been forced */
u8 dma_out_enabled:1; /* Set to 1 if DMA should be used */
u8 dma_in_enabled:1; /* Set to 1 if DMA should be used */
/* end of fields defined in rs_table[] in .c-file */
u8 uses_dma_in; /* Set to 1 if DMA is used */
u8 uses_dma_out; /* Set to 1 if DMA is used */
u8 forced_eop; /* a fifo eop has been forced */
int baud_base; /* For special baudrates */
int custom_divisor; /* For special baudrates */
struct etrax_dma_descr tr_descr;
struct etrax_dma_descr rec_descr[SERIAL_RECV_DESCRIPTORS];
int cur_rec_descr;
......@@ -95,6 +94,8 @@ struct e100_serial {
struct work_struct work;
struct async_icount icount; /* error-statistics etc.*/
struct termios normal_termios;
struct termios callout_termios;
#ifdef DECLARE_WAITQUEUE
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
......@@ -104,6 +105,7 @@ struct e100_serial {
#endif
unsigned long char_time_usec; /* The time for 1 char, in usecs */
unsigned long flush_time_usec; /* How often we should flush */
unsigned long last_tx_active_usec; /* Last tx usec in the jiffies */
unsigned long last_tx_active; /* Last tx time in jiffies */
unsigned long last_rx_active_usec; /* Last rx usec in the jiffies */
......
......@@ -12,6 +12,15 @@
* init_etrax_debug()
*
* $Log: debugport.c,v $
* Revision 1.14 2004/05/17 13:11:29 starvik
* Disable DMA until real serial driver is up
*
* Revision 1.13 2004/05/14 07:58:01 starvik
* Merge of changes from 2.4
*
* Revision 1.12 2003/09/11 07:29:49 starvik
* Merge of Linux 2.6.0-test5
*
* Revision 1.11 2003/07/07 09:53:36 starvik
* Revert all the 2.5.74 merge changes to make the console work again
*
......@@ -59,7 +68,7 @@
#include <linux/init.h>
#include <linux/major.h>
#include <linux/delay.h>
#include <linux/tty.h>
#include <asm/system.h>
#include <asm/arch/svinto.h>
#include <asm/io.h> /* Get SIMCOUT. */
......@@ -124,22 +133,28 @@
#define MIN_SIZE 32 /* Size that triggers the FIFO to flush characters to interface */
/* Write a string of count length to the console (debug port) using DMA, polled
* for completion. Interrupts are disabled during the whole process. Some
* caution needs to be taken to not interfere with ttyS business on this port.
*/
static struct tty_driver *serial_driver;
typedef int (*debugport_write_function)(int i, const char *buf, unsigned int len);
debugport_write_function debug_write_function = NULL;
static void
console_write_direct(struct console *co, const char *buf, unsigned int len)
{
int i;
/* Send data */
for (i = 0; i < len; i++) {
/* Wait until transmitter is ready and send.*/
while(!(*DEBUG_READ & IO_MASK(R_SERIAL0_READ, tr_ready)));
*DEBUG_WRITE = buf[i];
}
}
static void
console_write(struct console *co, const char *buf, unsigned int len)
{
static struct etrax_dma_descr descr;
static struct etrax_dma_descr descr2;
static char tmp_buf[MIN_SIZE];
static int tmp_size = 0;
unsigned long flags;
unsigned long flags;
#ifdef CONFIG_ETRAX_DEBUG_PORT_NULL
/* no debug printout at all */
return;
......@@ -150,86 +165,18 @@ console_write(struct console *co, const char *buf, unsigned int len)
SIMCOUT(buf,len);
return;
#endif
local_save_flags(flags);
local_irq_disable();
#ifdef CONFIG_ETRAX_KGDB
/* kgdb needs to output debug info using the gdb protocol */
putDebugString(buf, len);
local_irq_restore(flags);
return;
#endif
/* To make this work together with the real serial port driver
* we have to make sure that everything is flushed when we leave
* here. The following steps are made to assure this:
* 1. Wait until DMA stops, FIFO is empty and serial port pipeline empty.
* 2. Write at least half the FIFO to trigger flush to serial port.
* 3. Wait until DMA stops, FIFO is empty and serial port pipeline empty.
*/
/* Do we have enough characters to make the DMA/FIFO happy? */
if (tmp_size + len < MIN_SIZE)
{
int size = min((int)(MIN_SIZE - tmp_size),(int)len);
memcpy(&tmp_buf[tmp_size], buf, size);
tmp_size += size;
len -= size;
/* Pad with space if complete line */
if (tmp_buf[tmp_size-1] == '\n')
{
memset(&tmp_buf[tmp_size-1], ' ', MIN_SIZE - tmp_size);
tmp_buf[MIN_SIZE - 1] = '\n';
tmp_size = MIN_SIZE;
len = 0;
}
else
{
/* Wait for more characters */
local_irq_restore(flags);
local_irq_save(flags);
if (debug_write_function)
if (debug_write_function(co->index, buf, len))
return;
}
}
/* make sure the transmitter is enabled.
* NOTE: this overrides any setting done in ttySx, to 8N1, no auto-CTS.
* in the future, move the tr/rec_ctrl shadows from etrax100ser.c to
* shadows.c and use it here as well...
*/
*DEBUG_TR_CTRL = 0x40;
while(*DEBUG_OCMD & 7); /* Until DMA is not running */
while(*DEBUG_STATUS & 0x7f); /* wait until output FIFO is empty as well */
udelay(200); /* Wait for last two characters to leave the serial transmitter */
if (tmp_size)
{
descr.ctrl = len ? 0 : d_eop | d_wait | d_eol;
descr.sw_len = tmp_size;
descr.buf = virt_to_phys(tmp_buf);
descr.next = virt_to_phys(&descr2);
descr2.ctrl = d_eop | d_wait | d_eol;
descr2.sw_len = len;
descr2.buf = virt_to_phys((char*)buf);
}
else
{
descr.ctrl = d_eop | d_wait | d_eol;
descr.sw_len = len;
descr.buf = virt_to_phys((char*)buf);
}
*DEBUG_FIRST = virt_to_phys(&descr); /* write to R_DMAx_FIRST */
*DEBUG_OCMD = 1; /* dma command start -> R_DMAx_CMD */
/* wait until the output dma channel is ready again */
while(*DEBUG_OCMD & 7);
while(*DEBUG_STATUS & 0x7f);
udelay(200);
tmp_size = 0;
console_write_direct(co, buf, len);
local_irq_restore(flags);
}
......@@ -279,10 +226,11 @@ enableDebugIRQ(void)
*DEBUG_REC_CTRL = IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable);
}
static kdev_t
console_device(struct console *c)
static struct tty_driver*
console_device(struct console *c, int *index)
{
return mk_kdev(TTY_MAJOR, 64 + c->index);
*index = c->index;
return serial_driver;
}
static int __init
......@@ -311,5 +259,33 @@ static struct console sercons = {
void __init
init_etrax_debug(void)
{
#if CONFIG_ETRAX_DEBUG_PORT_NULL
return;
#endif
#if DEBUG_PORT_IDX == 0
genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma6);
genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma6, unused);
#elif DEBUG_PORT_IDX == 1
genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma8);
genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma8, usb);
#elif DEBUG_PORT_IDX == 2
genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma2);
genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma2, par0);
#elif DEBUG_PORT_IDX == 3
genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma4);
genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma4, par1);
#endif
*R_GEN_CONFIG = genconfig_shadow;
register_console(&sercons);
}
int __init
init_console(void)
{
serial_driver = alloc_tty_driver(1);
if (!serial_driver)
return -ENOMEM;
return 0;
}
/* $Id: entry.S,v 1.16 2003/07/04 08:27:41 starvik Exp $
/* $Id: entry.S,v 1.18 2004/05/11 12:28:25 starvik Exp $
*
* linux/arch/cris/entry.S
*
......@@ -7,6 +7,12 @@
* Authors: Bjorn Wesen (bjornw@axis.com)
*
* $Log: entry.S,v $
* Revision 1.18 2004/05/11 12:28:25 starvik
* Merge of Linux 2.6.6
*
* Revision 1.17 2003/09/11 07:29:49 starvik
* Merge of Linux 2.6.0-test5
*
* Revision 1.16 2003/07/04 08:27:41 starvik
* Merge of Linux 2.5.74
*
......@@ -1060,6 +1066,19 @@ sys_call_table:
.long sys_clock_nanosleep
.long sys_statfs64
.long sys_fstatfs64
.long sys_tgkill /* 270 */
.long sys_utimes
.long sys_fadvise64_64
.long sys_ni_syscall /* sys_vserver */
.long sys_ni_syscall /* sys_mbind */
.long sys_ni_syscall /* 275 sys_get_mempolicy */
.long sys_ni_syscall /* sys_set_mempolicy */
.long sys_mq_open
.long sys_mq_unlink
.long sys_mq_timedsend
.long sys_mq_timedreceive /* 280 */
.long sys_mq_notify
.long sys_mq_getsetattr
/*
* NOTE!! This doesn't have to be exact - we just have
......
/* $Id: fasttimer.c,v 1.4 2003/07/04 08:27:41 starvik Exp $
/* $Id: fasttimer.c,v 1.6 2004/05/14 10:18:39 starvik Exp $
* linux/arch/cris/kernel/fasttimer.c
*
* Fast timers for ETRAX100/ETRAX100LX
* This may be useful in other OS than Linux so use 2 space indentation...
*
* $Log: fasttimer.c,v $
* Revision 1.6 2004/05/14 10:18:39 starvik
* Export fast_timer_list
*
* Revision 1.5 2004/05/14 07:58:01 starvik
* Merge of changes from 2.4
*
* Revision 1.4 2003/07/04 08:27:41 starvik
* Merge of Linux 2.5.74
*
......@@ -130,7 +136,7 @@ static int fast_timers_deleted = 0;
static int fast_timer_is_init = 0;
static int fast_timer_ints = 0;
static struct fast_timer *fast_timer_list = NULL;
struct fast_timer *fast_timer_list = NULL;
#ifdef DEBUG_LOG_INCLUDED
#define DEBUG_LOG_MAX 128
......@@ -325,7 +331,8 @@ void start_one_shot_timer(struct fast_timer *t,
{
if (tmp == t)
{
printk("timer name: %s data: 0x%08lX already in list!\n", name, data);
printk(KERN_WARNING
"timer name: %s data: 0x%08lX already in list!\n", name, data);
sanity_failed++;
return;
}
......@@ -784,7 +791,7 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
cli();
if (t->next != nextt)
{
printk("timer removed!\n");
printk(KERN_WARNING "timer removed!\n");
}
t = nextt;
}
......@@ -965,7 +972,7 @@ void fast_timer_init(void)
int i;
#endif
printk("fast_timer_init()\n");
printk(KERN_INFO "fast_timer_init()\n");
#if 0 && defined(FAST_TIMER_TEST)
for (i = 0; i <= TIMER0_DIV; i++)
......
/* $Id: head.S,v 1.6 2003/04/28 05:31:46 starvik Exp $
/* $Id: head.S,v 1.7 2004/05/14 07:58:01 starvik Exp $
*
* Head of the kernel - alter with care
*
......@@ -7,6 +7,9 @@
* Authors: Bjorn Wesen (bjornw@axis.com)
*
* $Log: head.S,v $
* Revision 1.7 2004/05/14 07:58:01 starvik
* Merge of changes from 2.4
*
* Revision 1.6 2003/04/28 05:31:46 starvik
* Added section attributes
*
......@@ -331,7 +334,16 @@ _inflash:
move.d START_ETHERNET_CLOCK, $r0
move.d $r0, [R_NETWORK_GEN_CONFIG]
#endif
;; Set up waitstates etc according to kernel configuration.
#ifndef CONFIG_SVINTO_SIM
move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
move.d $r0, [R_WAITSTATES]
move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
move.d $r0, [R_BUS_CONFIG]
#endif
;; We need to initialze DRAM registers before we start using the DRAM
cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized?
......@@ -626,8 +638,19 @@ _start_it:
| IO_STATE (R_GEN_CONFIG, dma4, extdma0),$r0
#endif
#if defined(CONFIG_BLUETOOTH) && (defined(CONFIG_BLUETOOTH_RESET_G10) || defined(CONFIG_BLUETOOTH_RESET_G11))
or.d IO_STATE (R_GEN_CONFIG, g8_15dir, out),$r0
#if defined(CONFIG_ETRAX_DEF_R_PORT_G0_DIR_OUT)
or.d IO_STATE (R_GEN_CONFIG, g0dir, out),$r0
#endif
#if defined(CONFIG_ETRAX_DEF_R_PORT_G8_15_DIR_OUT)
or.d IO_STATE (R_GEN_CONFIG, g8_15dir, out),$r0
#endif
#if defined(CONFIG_ETRAX_DEF_R_PORT_G16_23_DIR_OUT)
or.d IO_STATE (R_GEN_CONFIG, g16_23dir, out),$r0
#endif
#if defined(CONFIG_ETRAX_DEF_R_PORT_G24_DIR_OUT)
or.d IO_STATE (R_GEN_CONFIG, g24dir, out),$r0
#endif
move.d $r0,[genconfig_shadow] ; init a shadow register of R_GEN_CONFIG
......
/* $Id: process.c,v 1.3 2003/07/04 08:27:41 starvik Exp $
/* $Id: process.c,v 1.6 2004/05/11 12:28:25 starvik Exp $
*
* linux/arch/cris/kernel/process.c
*
......@@ -16,6 +16,7 @@
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <asm/arch/svinto.h>
#include <linux/init.h>
#ifdef CONFIG_ETRAX_GPIO
......@@ -249,3 +250,19 @@ unsigned long get_wchan(struct task_struct *p)
}
#undef last_sched
#undef first_sched
void show_regs(struct pt_regs * regs)
{
unsigned long usp = rdusp();
printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n",
regs->irp, regs->srp, regs->dccr, usp, regs->mof );
printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n",
regs->r0, regs->r1, regs->r2, regs->r3);
printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n",
regs->r4, regs->r5, regs->r6, regs->r7);
printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n",
regs->r8, regs->r9, regs->r10, regs->r11);
printk("r12: %08lx r13: %08lx oR10: %08lx\n",
regs->r12, regs->r13, regs->orig_r10);
}
......@@ -118,19 +118,13 @@ sys_ptrace(long request, long pid, long addr, long data)
/* Read the word at location address in the USER area. */
case PTRACE_PEEKUSR: {
unsigned long tmp;
ret = -EIO;
if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
if ((addr & 3) || addr < 0 || addr > PT_MAX << 2)
break;
tmp = 0; /* Default return condition */
ret = -EIO;
if (addr < sizeof(struct pt_regs)) {
tmp = get_reg(child, addr >> 2);
ret = put_user(tmp, (unsigned long *)data);
}
tmp = get_reg(child, addr >> 2);
ret = put_user(tmp, (unsigned long *)data);
break;
}
......@@ -148,28 +142,21 @@ sys_ptrace(long request, long pid, long addr, long data)
/* Write the word at location address in the USER area. */
case PTRACE_POKEUSR:
ret = -EIO;
if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
if ((addr & 3) || addr < 0 || addr > PT_MAX << 2)
break;
if (addr < sizeof(struct pt_regs)) {
addr >>= 2;
addr >>= 2;
if (addr == PT_DCCR) {
/*
* Don't allow the tracing process to
* change stuff like interrupt enable,
* kernel/user bit, etc.
*/
data &= DCCR_MASK;
data |= get_reg(child, PT_DCCR) & ~DCCR_MASK;
}
if (put_reg(child, addr, data))
break;
ret = 0;
if (addr == PT_DCCR) {
/* don't allow the tracing process to change stuff like
* interrupt enable, kernel/user bit, dma enables etc.
*/
data &= DCCR_MASK;
data |= get_reg(child, PT_DCCR) & ~DCCR_MASK;
}
if (put_reg(child, addr, data))
break;
ret = 0;
break;
case PTRACE_SYSCALL:
......@@ -237,7 +224,7 @@ sys_ptrace(long request, long pid, long addr, long data)
if (put_user(tmp, (unsigned long *) data)) {
ret = -EFAULT;
break;
goto out_tsk;
}
data += sizeof(long);
......@@ -255,7 +242,7 @@ sys_ptrace(long request, long pid, long addr, long data)
for (i = 0; i <= PT_MAX; i++) {
if (get_user(tmp, (unsigned long *) data)) {
ret = -EFAULT;
break;
goto out_tsk;
}
if (i == PT_DCCR) {
......@@ -290,12 +277,10 @@ void do_syscall_trace(void)
if (!(current->ptrace & PT_PTRACED))
return;
current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
? 0x80 : 0);
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
schedule();
/* the 0x80 provides a way for the tracing parent to distinguish
between a syscall stop and SIGTRAP delivery */
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
? 0x80 : 0));
/*
* This isn't the same as continuing with a signal, but it will do for
......
/* $Id: setup.c,v 1.1 2002/12/11 15:42:02 starvik Exp $
/*
*
* linux/arch/cris/arch-v10/kernel/setup.c
*
......@@ -94,3 +94,10 @@ int show_cpuinfo(struct seq_file *m, void *v)
}
#endif /* CONFIG_PROC_FS */
void
show_etrax_copyright(void)
{
printk(KERN_INFO
"Linux/CRIS port on ETRAX 100LX (c) 2001 Axis Communications AB\n");
}
......@@ -180,6 +180,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
unsigned int err = 0;
unsigned long old_usp;
/* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall;
/* restore the regs from &sc->regs (same as sc, since regs is first)
* (sc is already checked for VERIFY_READ since the sigframe was
* checked in sys_sigreturn previously)
......@@ -492,7 +495,6 @@ handle_signal(int canrestart, unsigned long sig,
/* If so, check system call restarting.. */
switch (regs->r10) {
case -ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn = do_no_restart_syscall;
case -ERESTARTNOHAND:
/* ERESTARTNOHAND means that the syscall should only be
restarted if there was no handler for the signal, and since
......
/* $Id: time.c,v 1.2 2003/07/04 08:27:41 starvik Exp $
/* $Id: time.c,v 1.3 2004/06/01 05:38:42 starvik Exp $
*
* linux/arch/cris/arch-v10/kernel/time.c
*
......@@ -277,6 +277,12 @@ time_init(void)
update_xtime_from_cmos();
}
/*
* Initialize wall_to_monotonic such that adding it to xtime will yield zero, the
* tv_nsec field must be normalized (i.e., 0 <= nsec < NSEC_PER_SEC).
*/
set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
/* Setup the etrax timers
* Base frequency is 25000 hz, divider 250 -> 100 HZ
* In normal mode, we use timer0, so timer1 is free. In cascade
......
/* $Id: dram_init.S,v 1.3 2003/03/31 09:38:37 starvik Exp $
/* $Id: dram_init.S,v 1.4 2003/09/22 09:21:59 starvik Exp $
*
* DRAM/SDRAM initialization - alter with care
* This file is intended to be included from other assembler files
......@@ -11,6 +11,10 @@
* Authors: Mikael Starvik (starvik@axis.com)
*
* $Log: dram_init.S,v $
* Revision 1.4 2003/09/22 09:21:59 starvik
* Decompresser is linked to 0x407xxxxx and sdram commands are at 0x000xxxxx
* so we need to mask off 12 bits.
*
* Revision 1.3 2003/03/31 09:38:37 starvik
* Corrected calculation of end of sdram init commands
*
......@@ -152,9 +156,9 @@ _set_timing:
; Issue initialization command sequence
move.d _sdram_commands_start, $r2
and.d 0x00ffffff, $r2 ; Make sure commands are read from flash
and.d 0x000fffff, $r2 ; Make sure commands are read from flash
move.d _sdram_commands_end, $r3
and.d 0x00ffffff, $r3
and.d 0x000fffff, $r3
1: clear.d $r4
move.b [$r2+], $r4
lslq 9, $r4 ; Command starts at bit 9
......
/* $Id: old_checksum.c,v 1.2 2002/11/05 06:45:12 starvik Exp $
/* $Id: old_checksum.c,v 1.3 2003/10/27 08:04:32 starvik Exp $
*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
......@@ -76,7 +76,7 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
sum += *((unsigned short *)buff)++;
}
if(endMarker - buff > 0) {
sum += *buff; /* add extra byte separately */
sum += *buff; /* add extra byte seperately */
}
BITOFF;
return(sum);
......
......@@ -30,7 +30,7 @@ extern const struct exception_table_entry
*search_exception_tables(unsigned long addr);
asmlinkage void do_page_fault(unsigned long address, struct pt_regs *regs,
int error_code);
int protection, int writeaccess);
/* fast TLB-fill fault handler
* this is called from entry.S with interrupts disabled
......@@ -39,8 +39,9 @@ asmlinkage void do_page_fault(unsigned long address, struct pt_regs *regs,
void
handle_mmu_bus_fault(struct pt_regs *regs)
{
int cause, select;
int cause;
#ifdef DEBUG
int select;
int index;
int page_id;
int acc, inv;
......@@ -48,15 +49,14 @@ handle_mmu_bus_fault(struct pt_regs *regs)
int miss, we, writeac;
pmd_t *pmd;
pte_t pte;
int errcode;
unsigned long address;
cause = *R_MMU_CAUSE;
select = *R_TLB_SELECT;
address = cause & PAGE_MASK; /* get faulting address */
#ifdef DEBUG
select = *R_TLB_SELECT;
page_id = IO_EXTRACT(R_MMU_CAUSE, page_id, cause);
acc = IO_EXTRACT(R_MMU_CAUSE, acc_excp, cause);
inv = IO_EXTRACT(R_MMU_CAUSE, inv_excp, cause);
......@@ -82,12 +82,6 @@ handle_mmu_bus_fault(struct pt_regs *regs)
if(writeac)
regs->csrinstr &= ~(1 << 5);
/* Set errcode's R/W flag according to the mode which caused the
* fault
*/
errcode = writeac << 1;
D(printk("bus_fault from IRP 0x%lx: addr 0x%lx, miss %d, inv %d, we %d, acc %d, dx %d pid %d\n",
regs->irp, address, miss, inv, we, acc, index, page_id));
......@@ -99,16 +93,20 @@ handle_mmu_bus_fault(struct pt_regs *regs)
*/
pmd = (pmd_t *)(current_pgd + pgd_index(address));
if (pmd_none(*pmd))
goto dofault;
if (pmd_none(*pmd)) {
do_page_fault(address, regs, 0, writeac);
return;
}
if (pmd_bad(*pmd)) {
printk("bad pgdir entry 0x%lx at 0x%p\n", *(unsigned long*)pmd, pmd);
pmd_clear(pmd);
return;
}
pte = *pte_offset_kernel(pmd, address);
if (!pte_present(pte))
goto dofault;
if (!pte_present(pte)) {
do_page_fault(address, regs, 0, writeac);
return;
}
#ifdef DEBUG
printk(" found pte %lx pg %p ", pte_val(pte), pte_page(pte));
......@@ -143,14 +141,10 @@ handle_mmu_bus_fault(struct pt_regs *regs)
*R_TLB_LO = pte_val(pte);
return;
}
errcode = 1 | (we << 1);
}
dofault:
/* leave it to the MM system fault handler below */
D(printk("do_page_fault %lx errcode %d\n", address, errcode));
do_page_fault(address, regs, errcode);
/* leave it to the MM system fault handler */
do_page_fault(address, regs, 1, we);
}
/* Called from arch/cris/mm/fault.c to find fixup code. */
......
......@@ -212,7 +212,7 @@ dump_tlb_all(void)
void
switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk, int cpu)
struct task_struct *tsk)
{
/* make sure we have a context */
......
This diff is collapsed.
# $Id: Makefile,v 1.8 2003/04/09 05:20:47 starvik Exp $
# $Id: Makefile,v 1.10 2004/05/14 10:18:12 starvik Exp $
#
# Makefile for the linux kernel.
#
extra-y := vmlinux.lds.s
extra-y := vmlinux.lds.s
obj-y := process.o traps.o irq.o ptrace.o setup.o \
time.o sys_cris.o semaphore.o
obj-$(CONFIG_MODULES) += ksyms.o
obj-$(CONFIG_MODULES) += crisksyms.o
obj-$(CONFIG_MODULES) += module.o
clean:
......
......@@ -10,7 +10,7 @@
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/tty.h>
#include <asm/semaphore.h>
#include <asm/processor.h>
#include <asm/uaccess.h>
......@@ -20,6 +20,7 @@
#include <asm/delay.h>
#include <asm/irq.h>
#include <asm/pgtable.h>
#include <asm/fasttimer.h>
extern void dump_thread(struct pt_regs *, struct user *);
extern unsigned long get_cmos_time(void);
......@@ -93,4 +94,11 @@ extern void * memcpy(void *, const void *, __kernel_size_t);
EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL_NOVERS(memset);
#ifdef CONFIG_ETRAX_FAST_TIMER
/* Fast timer functions */
EXPORT_SYMBOL(fast_timer_list);
EXPORT_SYMBOL(start_one_shot_timer);
EXPORT_SYMBOL(del_fast_timer);
EXPORT_SYMBOL(schedule_usleep);
#endif
#include <stdio.h>
void main()
{
int c;
int comma=0;
int count=0;
while((c=getchar())!=EOF)
{
unsigned char x=c;
if(comma)
printf(",");
else
comma=1;
if(count==8)
{
count=0;
printf("\n");
}
if(count==0)
printf("\t");
printf("0x%02X",c);
count++;
}
if(count)
printf("\n");
exit(0);
}
/* $Id: irq.c,v 1.8 2003/07/04 08:27:52 starvik Exp $
/*
*
* linux/arch/cris/kernel/irq.c
*
......@@ -99,7 +99,7 @@ int show_interrupts(struct seq_file *p, void *v)
if (!action)
goto skip;
seq_printf(p, "%2d: %10u %c %s",
i, kstat_cpu(0).irqs[i],
i, kstat_this_cpu.irqs[i],
(action->flags & SA_INTERRUPT) ? '+' : ' ',
action->name);
for (action = action->next; action; action = action->next) {
......@@ -129,13 +129,12 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
cpu = smp_processor_id();
irq_enter();
kstat_cpu(cpu).irqs[irq]++;
kstat_cpu(cpu).irqs[irq - FIRST_IRQ]++;
action = irq_action[irq - FIRST_IRQ];
action = irq_action[irq];
if (action) {
if (!(action->flags & SA_INTERRUPT))
local_irq_enable();
action = irq_action[irq];
do_random = 0;
do {
do_random |= action->flags;
......@@ -175,7 +174,7 @@ int setup_irq(int irq, struct irqaction * new)
struct irqaction *old, **p;
unsigned long flags;
p = irq_action + irq;
p = irq_action + irq - FIRST_IRQ;
if ((old = *p) != NULL) {
/* Can't share interrupts unless both agree to */
if (!(old->flags & new->flags & SA_SHIRQ))
......@@ -230,12 +229,6 @@ int request_irq(unsigned int irq,
int retval;
struct irqaction * action;
/* interrupts 0 and 1 are hardware breakpoint and NMI and we can't support
these yet. interrupt 15 is the multiple irq, it's special. */
if(irq < 2 || irq == 15 || irq >= NR_IRQS)
return -EINVAL;
if(!handler)
return -EINVAL;
......@@ -270,7 +263,7 @@ void free_irq(unsigned int irq, void *dev_id)
printk("Trying to free IRQ%d\n",irq);
return;
}
for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {
for (p = irq - FIRST_IRQ + irq_action; (action = *p) != NULL; p = &action->next) {
if (action->dev_id != dev_id)
continue;
......@@ -278,7 +271,7 @@ void free_irq(unsigned int irq, void *dev_id)
local_save_flags(flags);
local_irq_disable();
*p = action->next;
if (!irq_action[irq]) {
if (!irq_action[irq - FIRST_IRQ]) {
mask_irq(irq);
arch_free_irq(irq);
}
......
......@@ -75,8 +75,6 @@ int apply_relocate(Elf32_Shdr *sechdrs,
sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
+ ELF32_R_SYM(rel[i].r_info);
/* TODO: This is probably not correct */
printk("Beware: untested code in module.c!\n");
/* We add the value into the location given */
*location += sym->st_value;
}
......@@ -89,9 +87,26 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
unsigned int relsec,
struct module *me)
{
printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
me->name);
return -ENOEXEC;
unsigned int i;
Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;
DEBUGP ("Applying relocate section %u to %u\n", relsec,
sechdrs[relsec].sh_info);
for (i = 0; i < sechdrs[relsec].sh_size / sizeof (*rela); i++) {
/* This is where to make the change */
uint32_t *loc
= ((void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
+ rela[i].r_offset);
/* This is the symbol it is referring to. Note that all
undefined symbols have been resolved. */
Elf32_Sym *sym
= ((Elf32_Sym *)sechdrs[symindex].sh_addr
+ ELF32_R_SYM (rela[i].r_info));
*loc = sym->st_value + rela[i].r_addend;
}
return 0;
}
int module_finalize(const Elf_Ehdr *hdr,
......
/* $Id: process.c,v 1.14 2003/06/10 10:21:12 johana Exp $
/* $Id: process.c,v 1.17 2004/04/05 13:53:48 starvik Exp $
*
* linux/arch/cris/kernel/process.c
*
......@@ -8,9 +8,18 @@
* Authors: Bjorn Wesen (bjornw@axis.com)
*
* $Log: process.c,v $
* Revision 1.17 2004/04/05 13:53:48 starvik
* Merge of Linux 2.6.5
*
* Revision 1.16 2003/10/27 08:04:33 starvik
* Merge of Linux 2.6.0-test9
*
* Revision 1.15 2003/09/11 07:29:52 starvik
* Merge of Linux 2.6.0-test5
*
* Revision 1.14 2003/06/10 10:21:12 johana
* Moved thread_saved_pc() from arch/cris/kernel/process.c to
* subarch specific process.c.
* subarch specific process.c. arch-v32 has an erp, no irp.
*
* Revision 1.13 2003/04/09 05:20:47 starvik
* Merge of Linux 2.5.67
......@@ -94,6 +103,7 @@
#include <asm/atomic.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/irq.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/fs_struct.h>
......@@ -182,13 +192,17 @@ void cpu_idle (void)
{
/* endless idle loop with no priority at all */
while (1) {
void (*idle)(void) = pm_idle;
if (!idle)
idle = default_idle;
while (!need_resched())
while (!need_resched()) {
void (*idle)(void) = pm_idle;
if (!idle)
idle = default_idle;
idle();
}
schedule();
}
}
void hard_reset_now (void);
......
/* $Id: setup.c,v 1.7 2003/07/04 08:27:52 starvik Exp $
/*
*
* linux/arch/cris/kernel/setup.c
*
......@@ -10,6 +10,7 @@
* This file handles the architecture-dependent parts of initialization
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
......@@ -38,6 +39,8 @@ extern unsigned long dram_start, dram_end;
extern unsigned long romfs_start, romfs_length, romfs_in_flash; /* from head.S */
extern void show_etrax_copyright(void); /* arch-vX/kernel/setup.c */
/* This mainly sets up the memory area, and can be really confusing.
*
* The physical DRAM is virtually mapped into dram_start to dram_end
......@@ -153,18 +156,16 @@ setup_arch(char **cmdline_p)
*cmdline_p = command_line;
#ifdef CONFIG_ETRAX_CMDLINE
strlcpy(command_line, CONFIG_ETRAX_CMDLINE, sizeof(command_line));
#elif defined(CONFIG_ETRAX_ROOT_DEVICE)
strlcpy(command_line, "root=", sizeof(command_line));
strlcat(command_line, CONFIG_ETRAX_ROOT_DEVICE,
sizeof(command_line));
#endif
strlcpy(command_line, CONFIG_ETRAX_CMDLINE, COMMAND_LINE_SIZE);
command_line[COMMAND_LINE_SIZE - 1] = '\0';
/* give credit for the CRIS port */
printk("Linux/CRIS port on ETRAX 100LX (c) 2001 Axis Communications AB\n");
/* Save command line for future references. */
memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
saved_command_line[COMMAND_LINE_SIZE - 1] = '\0';
#endif
/* give credit for the CRIS port */
show_etrax_copyright();
}
static void *c_start(struct seq_file *m, loff_t *pos)
......
/* $Id: sys_cris.c,v 1.5 2003/07/04 08:27:52 starvik Exp $
/* $Id: sys_cris.c,v 1.6 2004/03/11 11:38:40 starvik Exp $
*
* linux/arch/cris/kernel/sys_cris.c
*
......
/* $Id: time.c,v 1.9 2003/07/04 08:27:52 starvik Exp $
/* $Id: time.c,v 1.14 2004/06/01 05:38:11 starvik Exp $
*
* linux/arch/cris/kernel/time.c
*
......@@ -29,6 +29,7 @@
#include <linux/jiffies.h>
#include <linux/bcd.h>
#include <linux/timex.h>
#include <linux/init.h>
u64 jiffies_64 = INITIAL_JIFFIES;
......@@ -39,6 +40,8 @@ int have_rtc; /* used to remember if we have an RTC or not */;
#define TICK_SIZE tick
extern unsigned long wall_jiffies;
extern unsigned long loops_per_jiffy; /* init/main.c */
unsigned long loops_per_usec;
extern unsigned long do_slow_gettimeoffset(void);
static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;
......@@ -62,6 +65,15 @@ void do_gettimeofday(struct timeval *tv)
if (lost)
usec += lost * (1000000 / HZ);
}
/*
* If time_adjust is negative then NTP is slowing the clock
* so make sure not to go into next possible interval.
* Better to lose some accuracy than have time go backwards..
*/
if (unlikely(time_adjust < 0) && usec > tickadj)
usec = tickadj;
sec = xtime.tv_sec;
usec += xtime.tv_nsec / 1000;
local_irq_restore(flags);
......@@ -79,35 +91,33 @@ EXPORT_SYMBOL(do_gettimeofday);
int do_settimeofday(struct timespec *tv)
{
unsigned long flags;
time_t wtm_sec, sec = tv->tv_sec;
long wtm_nsec, nsec = tv->tv_nsec;
if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
return -EINVAL;
local_irq_save(flags);
local_irq_disable();
/* This is revolting. We need to set the xtime.tv_usec
* correctly. However, the value in this location is
* is value at the last tick.
* Discover what correction gettimeofday
* would have done, and then undo it!
write_seqlock_irq(&xtime_lock);
/*
* This is revolting. We need to set "xtime" correctly. However, the
* value in this location is the value at the most recent update of
* wall time. Discover what correction gettimeofday() would have
* made, and then undo it!
*/
tv->tv_nsec -= do_gettimeoffset() * 1000;
tv->tv_nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
nsec -= do_gettimeoffset() * NSEC_PER_USEC;
nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
set_normalized_timespec(&xtime, sec, nsec);
set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
while (tv->tv_nsec < 0) {
tv->tv_nsec += NSEC_PER_SEC;
tv->tv_sec--;
}
xtime.tv_sec = tv->tv_sec;
xtime.tv_nsec = tv->tv_nsec;
time_adjust = 0; /* stop active adjtime() */
time_status |= STA_UNSYNC;
time_state = TIME_ERROR; /* p. 24, (a) */
time_maxerror = NTP_PHASE_LIMIT;
time_esterror = NTP_PHASE_LIMIT;
local_irq_restore(flags);
write_sequnlock_irq(&xtime_lock);
clock_was_set();
return 0;
}
......@@ -125,7 +135,7 @@ int set_rtc_mmss(unsigned long nowtime)
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
printk("set_rtc_mmss(%lu)\n", nowtime);
printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime);
if(!have_rtc)
return 0;
......@@ -174,7 +184,8 @@ get_cmos_time(void)
mon = CMOS_READ(RTC_MONTH);
year = CMOS_READ(RTC_YEAR);
printk("rtc: sec 0x%x min 0x%x hour 0x%x day 0x%x mon 0x%x year 0x%x\n",
printk(KERN_DEBUG
"rtc: sec 0x%x min 0x%x hour 0x%x day 0x%x mon 0x%x year 0x%x\n",
sec, min, hour, day, mon, year);
BCD_TO_BIN(sec);
......@@ -202,3 +213,20 @@ update_xtime_from_cmos(void)
xtime.tv_nsec = 0;
}
}
/*
* Scheduler clock - returns current time in nanosec units.
*/
unsigned long long sched_clock(void)
{
return (unsigned long long)jiffies * (1000000000 / HZ);
}
static int
__init init_udelay(void)
{
loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
return 0;
}
__initcall(init_udelay);
/* $Id: traps.c,v 1.7 2003/07/04 08:27:52 starvik Exp $
/* $Id: traps.c,v 1.9 2004/05/11 12:28:26 starvik Exp $
*
* linux/arch/cris/traps.c
*
......@@ -14,6 +14,7 @@
*/
#include <linux/init.h>
#include <linux/module.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
......
......@@ -6,9 +6,18 @@
* Authors: Bjorn Wesen
*
* $Log: fault.c,v $
* Revision 1.11 2004/05/14 07:58:05 starvik
* Merge of changes from 2.4
*
* Revision 1.10 2003/10/27 14:51:24 starvik
* Removed debugcode
*
* Revision 1.9 2003/10/27 14:50:42 starvik
* Changed do_page_fault signature
*
* Revision 1.8 2003/07/04 13:02:48 tobiasa
* Moved code snippet from arch/cris/mm/fault.c that searches for fixup code
* to separate function in arch-specific files.
* to seperate function in arch-specific files.
*
* Revision 1.7 2003/01/22 06:48:38 starvik
* Fixed warnings issued by GCC 3.2.1
......@@ -95,10 +104,6 @@
extern int find_fixup_code(struct pt_regs *);
extern void die_if_kernel(const char *, struct pt_regs *, long);
asmlinkage void do_invalid_op (struct pt_regs *, unsigned long);
asmlinkage void do_page_fault(unsigned long address, struct pt_regs *regs,
int error_code);
/* debug of low-level TLB reload */
#undef DEBUG
......@@ -134,14 +139,16 @@ volatile pgd_t *current_pgd;
asmlinkage void
do_page_fault(unsigned long address, struct pt_regs *regs,
int error_code)
int protection, int writeaccess)
{
struct task_struct *tsk;
struct mm_struct *mm;
struct vm_area_struct * vma;
int writeaccess;
siginfo_t info;
D(printk("Page fault for %X at %X, prot %d write %d\n",
address, regs->erp, protection, writeaccess));
tsk = current;
/*
......@@ -164,7 +171,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
*/
if (address >= VMALLOC_START &&
!(error_code & 1) &&
!protection &&
!user_mode(regs))
goto vmalloc_fault;
......@@ -172,7 +179,6 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
sti();
mm = tsk->mm;
writeaccess = error_code & 2;
info.si_code = SEGV_MAPERR;
/*
......@@ -291,7 +297,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
printk(KERN_ALERT "Unable to handle kernel access");
printk(" at virtual address %08lx\n",address);
die_if_kernel("Oops", regs, error_code);
die_if_kernel("Oops", regs, (writeaccess << 1) | protection);
do_exit(SIGKILL);
......
This diff is collapsed.
This diff is collapsed.
......@@ -270,6 +270,7 @@ ENTRY(do_suspend_lowlevel)
call save_registers
pushl $3
call acpi_enter_sleep_state
addl $4,%esp
ret
.p2align 4,,7
ret_point:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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