Commit 17023327 authored by Linus Torvalds's avatar Linus Torvalds

v2.4.6 -> v2.4.6.1

  - merge with Alan (irda, s390, mips64, chris, sk98lin, mips/mm)
  - rth: fix alpha RTC calibration
  - Paul Mackerras: fix PPC typo
parent 740d9a78
...@@ -957,6 +957,12 @@ S: P.O. Box 76, Epping ...@@ -957,6 +957,12 @@ S: P.O. Box 76, Epping
S: New South Wales, 2121 S: New South Wales, 2121
S: Australia S: Australia
N: Carlos E. Gorges
E: carlos@techlinux.com.br
D: fix smp support on cmpci driver
P: 2048G/EA3C4B19 FF31 33A6 0362 4915 B7EB E541 17D0 0379 EA3C 4B19
S: Brazil
N: Dmitry S. Gorodchanin N: Dmitry S. Gorodchanin
E: pgmdsg@ibi.com E: pgmdsg@ibi.com
D: RISCom/8 driver, misc kernel fixes. D: RISCom/8 driver, misc kernel fixes.
......
WorkBiT NinjaSCSI-3/32Bi driver for Linux
1. Comment
This is Workbit corp.'s(http://www.workbit.co.jp/) NinjaSCSI-3
(http://www.workbit.co.jp/ts/z_nj3r.html) and NinjaSCSI-32Bi
(http://www.workbit.co.jp/ts/z_njsc32bi.html) PCMCIA card driver module
for Linux.
2. My Linux environment
Linux kernel: 2.4.0 / 2.2.18
pcmcia-cs: 3.1.24
gcc: gcc-2.95.2
PC card: I-O data PCSC-F (NinjaSCSI-3)
I-O data CBSC-II in 16 bit mode (NinjaSCSI-32Bi)
SCSI device: I-O data CDPS-PX24 (CD-ROM drive)
Media Intelligent MMO-640GT (Optical disk drive)
3. Install
[1] Check your PC card is true "NinjaSCSI-3" card.
If you installed pcmcia-cs already, pcmcia reports your card as UNKNOWN
card, and write ["WBT", "NinjaSCSI-3", "R1.0"] or some other string to
your console or log file.
You can also use "cardctl" program (this program is in pcmcia-cs source
code) to get more info.
# cat /var/log/messgaes
...
Jan 2 03:45:06 lindberg cardmgr[78]: unsupported card in socket 1
Jan 2 03:45:06 lindberg cardmgr[78]: product info: "WBT", "NinjaSCSI-3", "R1.0"
...
# cardctl ident
Socket 0:
no product info available
Socket 1:
product info: "IO DATA", "CBSC16 ", "1"
[2] Get Linux kernel source, and extract it to /usr/src.
Because NinjaSCSI driver requiers some SCSI header files in Linux kernel
source.
I recomend rebuilding your kernel. This eliminate some versioning problem.
$ cd /usr/src
$ tar -zxvf linux-x.x.x.tar.gz
$ cd linux
$ make config
...
[3] If you use this driver with Kernel 2.2, Unpack pcmcia-cs in some directory
and make & install. This driver requies pcmcia-cs header file.
$ cd /usr/src
$ tar zxvf cs-pcmcia-cs-3.x.x.tar.gz
...
[4] Extract this driver's archive somewhere, and edit Makefile, then do make.
$ tar -zxvf nsp_cs-x.x.tar.gz
$ cd nsp_cs-x.x
$ make
[5] Copy nsp_cs.o to suitable plase, like /lib/modules/<Kernel version>/pcmcia/ .
[6] Add these lines to /etc/pcmcia/config .
If you yse pcmcia-cs-3.1.8 or later, we can use "nsp_cs.conf" file.
So, you don't need to edit file. Just copy to /etc/pcmcia/ .
-------------------------------------
device "nsp_cs"
class "scsi" module "nsp_cs"
card "WorkBit NinjaSCSI-3"
version "WBT", "NinjaSCSI-3", "R1.0"
bind "nsp_cs"
card "WorkBit NinjaSCSI-32Bi (16bit)"
version "WORKBIT", "UltraNinja-16", "1"
bind "nsp_cs"
# OEM
card "WorkBit NinjaSCSI-32Bi (16bit) / IO-DATA"
version "IO DATA", "CBSC16 ", "1"
bind "nsp_cs"
# OEM
card "WorkBit NinjaSCSI-32Bi (16bit) / KME-1"
version "KME ", "SCSI-CARD-001", "1"
bind "nsp_cs"
card "WorkBit NinjaSCSI-32Bi (16bit) / KME-2"
version "KME ", "SCSI-CARD-002", "1"
bind "nsp_cs"
card "WorkBit NinjaSCSI-32Bi (16bit) / KME-3"
version "KME ", "SCSI-CARD-003", "1"
bind "nsp_cs"
card "WorkBit NinjaSCSI-32Bi (16bit) / KME-4"
version "KME ", "SCSI-CARD-004", "1"
bind "nsp_cs"
-------------------------------------
[7] Boot (or reboot) pcmcia-cs.
# /etc/rc.d/rc.pcmcia start (BSD style)
or
# /etc/init.d/pcmcia start (SYSV style)
4. History
See README.nin_cs .
5. Caution
If you eject card when doing some operation for your SCSI device or suspend
your computer, you encount some *BAD* error like disk crash.
It works good when I using this driver right way. But I'm not guarantee
your data. Please backup your data when you use this driver.
6. Known Bugs
Some write error occurs when you use slow device.
7. Testing
Please send me some reports(bug reports etc..) of this software.
When you send report, please tell me these or more.
card name
kernel version
your SCSI device name(hard drive, CD-ROM, etc...)
8. Copyright
See GPL.
2001/02/01 yokota@netlab.is.tsukuba.ac.jp <YOKOTA Hiroshi>
...@@ -39,11 +39,13 @@ hp-plus YES YES YES Hardware ...@@ -39,11 +39,13 @@ hp-plus YES YES YES Hardware
hp YES YES YES Hardware hp YES YES YES Hardware
hp100 YES YES YES Hardware hp100 YES YES YES Hardware
ibmtr NO NO NO N/A ibmtr NO NO NO N/A
ioc3-eth YES YES YES Hardware
lance YES YES YES Software(#) lance YES YES YES Software(#)
ne YES YES YES Hardware ne YES YES YES Hardware
ni52 <------------------ Buggy ------------------> ni52 <------------------ Buggy ------------------>
ni65 YES YES YES Software(#) ni65 YES YES YES Software(#)
seeq NO NO NO N/A seeq NO NO NO N/A
sgiseek <------------------ Buggy ------------------>
sk_g16 NO NO YES N/A sk_g16 NO NO YES N/A
smc-ultra YES YES YES Hardware smc-ultra YES YES YES Hardware
sunlance YES YES YES Hardware sunlance YES YES YES Hardware
......
...@@ -8,59 +8,80 @@ C-Media CMI8738 ...@@ -8,59 +8,80 @@ C-Media CMI8738
On-board C-Media chips On-board C-Media chips
WHAT'S NEW STEPS TO BUILD DRIVER
================================================================================ ================================================================================
1. Support modem interface for 8738. (select in kernel configuration) 1. Backup the Config.in and Makefile in the sound driver directory
2. Enable S/PDIF-in to S/PDIF-out (S/PDIF loop). (/usr/src/linux/driver/sound).
3. Enable 4 channels analog duplicate mode on 3 jack or 4 jack The Configure.help provide help when you config driver in step
configuration. 4, please backup the original one (/usr/src/linux/Document) and
copy this file.
The cmpci is document for the driver in detail, please copy it
to /usr/src/linux/Document/sound so you can refer it. Backup if
there is already one.
2. Extract the tar file by 'tar xvzf cmpci-xx.tar.gz' in the above
directory.
Be aware: C-Media Electronics Inc. is basically an IC design house, 3. Change directory to /usr/src/linux
and whose development of software drivers is mainly for use by its OEM
customers in their products. C-Media Electronics Inc. itself does not
manufacture end-user products, such as PC or sound cards, so it can
not fully control the drivers provided to consumers. Drivers provided
at this site, therefore, MAY NOT BE APPLICABLE to all sound cards.
Drivers you download from this site may function well at certain
situation, but C-Media Electronics Inc. does not give any guarantee or
assurances. Please be aware that these drivers might cause some
technical difficulties when installed
4. Config cm8338 driver by 'make menuconfig', 'make config' or
'make xconfig' command.
1. Config cm8338 driver by 'make menuconfig' or 'make config' command. 5. Please select Sound Card (CONFIG_SOUND=m) support and CMPCI
driver (CONFIG_SOUND_CMPCI=m) as modules. Resident mode not tested.
For driver option, please refer 'DRIVER PARAMETER'
2. Please select Sound Card (CONFIG_SOUND=m) support and CMPCI driver (CONFIG_SOUND_CMPCI=m) as modules. Resident mode not tested. 6. Compile the kernel if necessary.
3. Compile the kernel if necessary. 7. Compile the modules by 'make modules'.
4. Compile the modules by 'make modules'. 8. Install the modules by 'make modules_install'
5. Install the modules by 'make modules_install'
6. Before first time to run the driver, create module dependency by 'depmod -a' INSTALL DRIVER
================================================================================
1. Before first time to run the driver, create module dependency by
'depmod -a'
2. To install the driver manually, enter 'modprobe cmpci'.
3. Driver installation for various distributions:
7. To install the driver, enter 'modprobe cmpci'. a. Slackware 4.0
Add the 'modprobe cmpci' command in your /etc/rc.d/rc.modules
file.so you can start the driver automatically each time booting.
b. Caldera OpenLinux 2.2
Use LISA to load the cmpci module.
DRIVER PARAMETERS c. RedHat 6.0 and S.u.S.E. 6.1
Add following command in /etc/conf.modules:
alias sound cmpci
also visit http://www.cmedia.com.tw for installation instruction.
DRIVER PARAMETER
================================================================================ ================================================================================
Some functions for the cm8738 can be configured in Kernel Configuration Some functions for the cm8738 can be configured in Kernel Configuration
or modules parameters. Set these parameters to 1 to enable. or modules parameters. Set these parameters to 1 to enable.
mpu_io: I/O ports base for MPU-401, 0 if disabled.
fm_io: I/O ports base for OPL-3, 0 if disabled.
spdif_inverse:Inverse the S/PDIF-in signal, this depends on your
CD-ROM or DVD-ROM.
spdif_loop: Enable S/PDIF loop, this route S/PDIF-in to S/PDIF-out spdif_loop: Enable S/PDIF loop, this route S/PDIF-in to S/PDIF-out
directly. directly.
four_ch: Enable 4 channels mode, rear-out or line-in will output speakers: Number of speakers used.
the same as line-out. use_line_as_rear:Enable this if you want to use line-in as
rear_out: Enable this if you have independent rear-out jacket on
your sound card, otherwise line-in will be used as
rear-out. rear-out.
use_line_as_bass:Enable this if you want to use line-in as
bass-out.
modem: You will need to set this parameter if you want to use modem: You will need to set this parameter if you want to use
the HSP modem. You need install the pctel.o, the modem the HSP modem. You need install the pctel.o, the modem
driver itself. driver itself.
joystick: Enable joystick. You will need to install Linux joystick
(You will need to get the pctel driver (binary only) and the support for driver.
this option from the CMI site. It is not included in the Linux kernel
proper as it is non-free).
...@@ -34,6 +34,10 @@ palette ...@@ -34,6 +34,10 @@ palette
specificly, red and blue are swapped), try palette=bgr24 or specificly, red and blue are swapped), try palette=bgr24 or
palette=rgb24. palette=rgb24.
Only the native yuv420/yuv420p format is supported by the in kernel driver.
If you want to use other formats with in-kernel conversion download the
driver from the URL given. [Alan]
fbufs fbufs
This paramter specifies the number of internal buffers to use for storing This paramter specifies the number of internal buffers to use for storing
frames from the cam. This will help if the process that reads images from frames from the cam. This will help if the process that reads images from
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 6 SUBLEVEL = 7
EXTRAVERSION = EXTRAVERSION =-pre1
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
......
...@@ -169,6 +169,77 @@ common_init_rtc(void) ...@@ -169,6 +169,77 @@ common_init_rtc(void)
init_rtc_irq(); init_rtc_irq();
} }
/*
* Calibrate CPU clock using legacy 8254 timer/counter. Stolen from
* arch/i386/time.c.
*/
#define CALIBRATE_LATCH (52 * LATCH)
#define CALIBRATE_TIME (52 * 1000020 / HZ)
static unsigned long __init
calibrate_cc_with_pic(void)
{
int cc;
unsigned long count = 0;
/* Set the Gate high, disable speaker */
outb((inb(0x61) & ~0x02) | 0x01, 0x61);
/*
* Now let's take care of CTC channel 2
*
* Set the Gate high, program CTC channel 2 for mode 0,
* (interrupt on terminal count mode), binary count,
* load 5 * LATCH count, (LSB and MSB) to begin countdown.
*/
outb(0xb0, 0x43); /* binary, mode 0, LSB/MSB, Ch 2 */
outb(CALIBRATE_LATCH & 0xff, 0x42); /* LSB of count */
outb(CALIBRATE_LATCH >> 8, 0x42); /* MSB of count */
cc = rpcc();
do {
count++;
} while ((inb(0x61) & 0x20) == 0);
cc = rpcc() - cc;
/* Error: ECTCNEVERSET */
if (count <= 1)
goto bad_ctc;
/* Error: ECPUTOOFAST */
if (count >> 32)
goto bad_ctc;
/* Error: ECPUTOOSLOW */
if (cc <= CALIBRATE_TIME)
goto bad_ctc;
return ((long)cc * 1000000) / CALIBRATE_TIME;
/*
* The CTC wasn't reliable: we got a hit on the very first read,
* or the CPU was so fast/slow that the quotient wouldn't fit in
* 32 bits..
*/
bad_ctc:
return 0;
}
/* The Linux interpretation of the CMOS clock register contents:
When the Update-In-Progress (UIP) flag goes from 1 to 0, the
RTC registers show the second which has precisely just started.
Let's hope other operating systems interpret the RTC the same way. */
static unsigned long __init
rpcc_after_update_in_progress(void)
{
do { } while (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP));
do { } while (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
return rpcc();
}
void __init void __init
time_init(void) time_init(void)
{ {
...@@ -176,24 +247,15 @@ time_init(void) ...@@ -176,24 +247,15 @@ time_init(void)
unsigned long cycle_freq, one_percent; unsigned long cycle_freq, one_percent;
long diff; long diff;
/* /* Calibrate CPU clock -- attempt #1. */
* The Linux interpretation of the CMOS clock register contents: if (!est_cycle_freq)
* When the Update-In-Progress (UIP) flag goes from 1 to 0, the est_cycle_freq = calibrate_cc_with_pic();
* RTC registers show the second which has precisely just started.
* Let's hope other operating systems interpret the RTC the same way.
*/
do { } while (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP));
do { } while (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
/* Read cycle counter exactly on falling edge of update flag */ cc1 = rpcc_after_update_in_progress();
cc1 = rpcc();
/* Calibrate CPU clock -- attempt #2. */
if (!est_cycle_freq) { if (!est_cycle_freq) {
/* Sometimes the hwrpb->cycle_freq value is bogus. cc2 = rpcc_after_update_in_progress();
Go another round to check up on it and see. */
do { } while (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP));
do { } while (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
cc2 = rpcc();
est_cycle_freq = cc2 - cc1; est_cycle_freq = cc2 - cc1;
cc1 = cc2; cc1 = cc2;
} }
......
...@@ -61,202 +61,6 @@ static char * ireg_name[] = {"v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6", ...@@ -61,202 +61,6 @@ static char * ireg_name[] = {"v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6",
"a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9", "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9",
"t10", "t11", "ra", "pv", "at", "gp", "sp", "zero"}; "t10", "t11", "ra", "pv", "at", "gp", "sp", "zero"};
static char * inst_name[] = {"call_pal", "", "", "", "", "", "", "",
"lda", "ldah", "ldbu", "ldq_u", "ldwu", "stw", "stb", "stq_u",
"ALU", "ALU", "ALU", "ALU", "SQRT", "FVAX", "FIEEE", "FLOAT",
"MISC", "PAL19", "JMP", "PAL1B", "GRAPH", "PAL1D", "PAL1E", "PAL1F",
"ldf", "ldg", "lds", "ldt", "stf", "stg", "sts", "stt",
"ldl", "ldq", "ldl_l", "ldq_l", "stl", "stq", "stl_c", "stq_c",
"br", "fbeq", "fblt", "fble", "bsr", "fbne", "fbge", "fbgt"
"blbc", "beq", "blt", "ble", "blbs", "bne", "bge", "bgt"
};
static char * jump_name[] = {"jmp", "jsr", "ret", "jsr_coroutine"};
typedef struct {int func; char * text;} alist;
static alist inta_name[] = {{0, "addl"}, {2, "s4addl"}, {9, "subl"},
{0xb, "s4subl"}, {0xf, "cmpbge"}, {0x12, "s8addl"}, {0x1b, "s8subl"},
{0x1d, "cmpult"}, {0x20, "addq"}, {0x22, "s4addq"}, {0x29, "subq"},
{0x2b, "s4subq"}, {0x2d, "cmpeq"}, {0x32, "s8addq"}, {0x3b, "s8subq"},
{0x3d, "cmpule"}, {0x40, "addl/v"}, {0x49, "subl/v"}, {0x4d, "cmplt"},
{0x60, "addq/v"}, {0x69, "subq/v"}, {0x6d, "cmple"}, {-1, 0}};
static alist intl_name[] = {{0, "and"}, {8, "andnot"}, {0x14, "cmovlbs"},
{0x16, "cmovlbc"}, {0x20, "or"}, {0x24, "cmoveq"}, {0x26, "cmovne"},
{0x28, "ornot"}, {0x40, "xor"}, {0x44, "cmovlt"}, {0x46, "cmovge"},
{0x48, "eqv"}, {0x61, "amask"}, {0x64, "cmovle"}, {0x66, "cmovgt"},
{0x6c, "implver"}, {-1, 0}};
static alist ints_name[] = {{2, "mskbl"}, {6, "extbl"}, {0xb, "insbl"},
{0x12, "mskwl"}, {0x16, "extwl"}, {0x1b, "inswl"}, {0x22, "mskll"},
{0x26, "extll"}, {0x2b, "insll"}, {0x30, "zap"}, {0x31, "zapnot"},
{0x32, "mskql"}, {0x34, "srl"}, {0x36, "extql"}, {0x39, "sll"},
{0x3b, "insql"}, {0x3c, "sra"}, {0x52, "mskwh"}, {0x57, "inswh"},
{0x5a, "extwh"}, {0x62, "msklh"}, {0x67, "inslh"}, {0x6a, "extlh"},
{0x72, "mskqh"}, {0x77, "insqh"}, {0x7a, "extqh"}, {-1, 0}};
static alist intm_name[] = {{0, "mull"}, {0x20, "mulq"}, {0x30, "umulh"},
{0x40, "mull/v"}, {0x60, "mulq/v"}, {-1, 0}};
static alist * int_name[] = {inta_name, intl_name, ints_name, intm_name};
static char *
assoc(int fcode, alist * a)
{
while ((fcode != a->func) && (a->func != -1))
++a;
return a->text;
}
static char *
iname(unsigned int instr)
{
int opcode = instr >> 26;
char * name = inst_name[opcode];
switch (opcode) {
default:
break;
case 0x10:
case 0x11:
case 0x12:
case 0x13: {
char * specific_name
= assoc((instr >> 5) & 0x3f, int_name[opcode - 0x10]);
if (specific_name)
name = specific_name;
break;
}
case 0x1a:
name = jump_name[(instr >> 14) & 3];
break;
}
return name;
}
static enum {NOT_INST, PAL, BRANCH, MEMORY, JUMP, OPERATE, FOPERATE, MISC}
iformat(int opcode)
{
if (opcode >= 0x30)
return BRANCH;
if (opcode >= 0x20)
return MEMORY;
if (opcode == 0)
return PAL;
if (opcode < 8)
return NOT_INST;
if (opcode < 0x10)
return MEMORY;
if (opcode < 0x14)
return OPERATE;
if (opcode < 0x18)
return FOPERATE;
switch (opcode) {
case 0x18:
return MISC;
case 0x1A:
return JUMP;
case 0x1C:
return OPERATE;
default:
return NOT_INST;
}
}
/*
* The purpose here is to provide useful clues about a kernel crash, so
* less likely instructions, e.g. floating point, aren't fully decoded.
*/
static void
disassemble(unsigned int instr)
{
int optype = instr >> 26;
char buf[40], *s = buf;
s += sprintf(buf, "%08x %s ", instr, iname(instr));
switch (iformat(optype)) {
default:
case NOT_INST:
case MISC:
break;
case PAL:
s += sprintf(s, "%d", instr);
break;
case BRANCH: {
int reg = (instr >> 21) & 0x1f;
int offset = instr & 0x1fffff;
if (offset >= 0x100000)
offset -= 0x200000;
if (((optype & 3) == 0) || (optype >= 0x38)) {
if ((optype != 0x30) || (reg != 0x1f))
s += sprintf(s, "%s,", ireg_name[reg]);
} else
s += sprintf(s, "f%d,", reg);
s += sprintf(s, ".%+d", (offset + 1) << 2);
break;
}
case MEMORY: {
int addr_reg = (instr >> 16) & 0x1f;
int value_reg = (instr >> 21) & 0x1f;
int offset = instr & 0xffff;
if (offset >= 0x8000)
offset -= 0x10000;
if ((optype >= 0x20) && (optype < 0x28))
s += sprintf(s, "f%d", value_reg);
else
s += sprintf(s, "%s", ireg_name[value_reg]);
s += sprintf(s, ",%d(%s)", offset, ireg_name[addr_reg]);
break;
}
case JUMP: {
int target_reg = (instr >> 16) & 0x1f;
int return_reg = (instr >> 21) & 0x1f;
s += sprintf(s, "%s,", ireg_name[return_reg]);
s += sprintf(s, "(%s)", ireg_name[target_reg]);
break;
}
case OPERATE: {
int areg = (instr >> 21) & 0x1f;
int breg = (instr >> 16) & 0x1f;
int creg = instr & 0x1f;
int litflag = instr & (1<<12);
int lit = (instr >> 13) & 0xff;
s += sprintf(s, "%s,", ireg_name[areg]);
if (litflag)
s += sprintf(s, "%d", lit);
else
s += sprintf(s, "%s", ireg_name[breg]);
s += sprintf(s, ",%s", ireg_name[creg]);
break;
}
case FOPERATE: {
int areg = (instr >> 21) & 0x1f;
int breg = (instr >> 16) & 0x1f;
int creg = instr & 0x1f;
s += sprintf(s, "f%d,f%d,f%d", areg, breg, creg);
break;
}
}
buf[s-buf] = 0;
printk("%s\n", buf);
}
static void static void
dik_show_code(unsigned int *pc) dik_show_code(unsigned int *pc)
{ {
...@@ -267,8 +71,7 @@ dik_show_code(unsigned int *pc) ...@@ -267,8 +71,7 @@ dik_show_code(unsigned int *pc)
unsigned int insn; unsigned int insn;
if (__get_user(insn, pc+i)) if (__get_user(insn, pc+i))
break; break;
printk("%c", i ? ' ' : '*'); printk("%c%08x%c", i ? ' ' : '<', insn, i ? ' ' : '>');
disassemble(insn);
} }
printk("\n"); printk("\n");
} }
...@@ -286,17 +89,11 @@ dik_show_trace(unsigned long *sp) ...@@ -286,17 +89,11 @@ dik_show_trace(unsigned long *sp)
continue; continue;
if (tmp >= (unsigned long) &_etext) if (tmp >= (unsigned long) &_etext)
continue; continue;
/* printk("%lx%c", tmp, ' ');
* Assume that only the low 24-bits of a kernel text address
* is interesting.
*/
printk("%6x%c", (int)tmp & 0xffffff, (++i % 11) ? ' ' : '\n');
#if 0
if (i > 40) { if (i > 40) {
printk(" ..."); printk(" ...");
break; break;
} }
#endif
} }
printk("\n"); printk("\n");
} }
...@@ -337,8 +134,8 @@ die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15) ...@@ -337,8 +134,8 @@ die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
#endif #endif
printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err); printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err);
dik_show_regs(regs, r9_15); dik_show_regs(regs, r9_15);
dik_show_code((unsigned int *)regs->pc);
dik_show_trace((unsigned long *)(regs+1)); dik_show_trace((unsigned long *)(regs+1));
dik_show_code((unsigned int *)regs->pc);
if (current->thread.flags & (1UL << 63)) { if (current->thread.flags & (1UL << 63)) {
printk("die_if_kernel recursion detected.\n"); printk("die_if_kernel recursion detected.\n");
......
# $Id: Makefile,v 1.18 2001/04/17 13:58:38 orjanf Exp $ # $Id: Makefile,v 1.19 2001/06/11 12:06:40 bjornw Exp $
# cris/Makefile # cris/Makefile
# #
# This file is included by the global makefile so that you can add your own # This file is included by the global makefile so that you can add your own
...@@ -49,7 +49,12 @@ endif ...@@ -49,7 +49,12 @@ endif
HEAD := arch/cris/kernel/head.o HEAD := arch/cris/kernel/head.o
SUBDIRS += arch/cris/kernel arch/cris/mm arch/cris/lib arch/cris/drivers arch/cris/boot/rescue SUBDIRS += arch/cris/kernel arch/cris/mm arch/cris/lib arch/cris/drivers
ifdef CONFIG_ETRAX_AXISFLASHMAP
# only build this if axis flash map is used, because they depend on
# each others config options
SUBDIRS += arch/cris/boot/rescue
endif
CORE_FILES += arch/cris/kernel/kernel.o arch/cris/mm/mm.o arch/cris/drivers/drivers.o CORE_FILES += arch/cris/kernel/kernel.o arch/cris/mm/mm.o arch/cris/drivers/drivers.o
LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a) LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LIBGCC) LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LIBGCC)
......
...@@ -18,11 +18,10 @@ comment 'General setup' ...@@ -18,11 +18,10 @@ comment 'General setup'
bool 'Networking support' CONFIG_NET bool 'Networking support' CONFIG_NET
bool 'System V IPC' CONFIG_SYSVIPC bool 'System V IPC' CONFIG_SYSVIPC
bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
bool 'Sysctl support' CONFIG_SYSCTL
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'Kernel support for JAVA binaries' CONFIG_BINFMT_JAVA
fi
bool 'Use kernel gdb debugger' CONFIG_ETRAX_KGDB bool 'Use kernel gdb debugger' CONFIG_ETRAX_KGDB
...@@ -38,9 +37,9 @@ choice 'Processor type' \ ...@@ -38,9 +37,9 @@ choice 'Processor type' \
Etrax-100-LX-v2 CONFIG_ETRAX100LX_V2 \ Etrax-100-LX-v2 CONFIG_ETRAX100LX_V2 \
Etrax-100-LX-for-xsim-simulator CONFIG_SVINTO_SIM" Etrax-100-LX-v1 Etrax-100-LX-for-xsim-simulator CONFIG_SVINTO_SIM" Etrax-100-LX-v1
# For both LX version 1 and the current simulator we enable the low VM mapping # Etrax100 LX v1 has a MMU "feature" requiring a low mapping
if [ "$CONFIG_ETRAX100LX" = "y" -o "$CONFIG_SVINTO_SIM" = "y" ]; then if [ "$CONFIG_ETRAX100LX" = "y" ]; then
define_bool CONFIG_CRIS_LOW_MAP y define_bool CONFIG_CRIS_LOW_MAP y
define_hex CONFIG_ETRAX_DRAM_VIRTUAL_BASE 60000000 define_hex CONFIG_ETRAX_DRAM_VIRTUAL_BASE 60000000
else else
...@@ -98,7 +97,7 @@ choice 'Product rescue-port' \ ...@@ -98,7 +97,7 @@ choice 'Product rescue-port' \
hex 'R_WAITSTATES' CONFIG_ETRAX_DEF_R_WAITSTATES 95a6 hex 'R_WAITSTATES' CONFIG_ETRAX_DEF_R_WAITSTATES 95a6
hex 'R_BUS_CONFIG' CONFIG_ETRAX_DEF_R_BUS_CONFIG 104 hex 'R_BUS_CONFIG' CONFIG_ETRAX_DEF_R_BUS_CONFIG 104
bool 'SDRAM support' CONFIG_ETRAX_SDRAM n bool 'SDRAM support' CONFIG_ETRAX_SDRAM
if [ "$CONFIG_ETRAX_SDRAM" = "n" ]; then if [ "$CONFIG_ETRAX_SDRAM" = "n" ]; then
hex 'R_DRAM_CONFIG' CONFIG_ETRAX_DEF_R_DRAM_CONFIG 1a200040 hex 'R_DRAM_CONFIG' CONFIG_ETRAX_DEF_R_DRAM_CONFIG 1a200040
hex 'R_DRAM_TIMING' CONFIG_ETRAX_DEF_R_DRAM_TIMING 5611 hex 'R_DRAM_TIMING' CONFIG_ETRAX_DEF_R_DRAM_TIMING 5611
...@@ -115,6 +114,12 @@ hex 'R_PORT_PB_CONFIG' CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG 00 ...@@ -115,6 +114,12 @@ hex 'R_PORT_PB_CONFIG' CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG 00
hex 'R_PORT_PB_DIR' CONFIG_ETRAX_DEF_R_PORT_PB_DIR 00 hex 'R_PORT_PB_DIR' CONFIG_ETRAX_DEF_R_PORT_PB_DIR 00
hex 'R_PORT_PB_DATA' CONFIG_ETRAX_DEF_R_PORT_PB_DATA ff hex 'R_PORT_PB_DATA' CONFIG_ETRAX_DEF_R_PORT_PB_DATA ff
bool 'Software Shutdown Support' CONFIG_ETRAX_SOFT_SHUTDOWN
if [ "$CONFIG_ETRAX_SOFT_SHUTDOWN" = "y" ]; then
int 'Shutdown bit on port CSP0' CONFIG_ETRAX_SHUTDOWN_BIT 12
int 'Power button bit on port G' CONFIG_ETRAX_POWERBUTTON_BIT 25
fi
endmenu endmenu
# bring in Etrax built-in drivers # bring in Etrax built-in drivers
...@@ -164,7 +169,7 @@ endmenu ...@@ -164,7 +169,7 @@ endmenu
source drivers/ieee1394/Config.in source drivers/ieee1394/Config.in
source drivers/i2o/Config.in source drivers/message/i2o/Config.in
if [ "$CONFIG_NET" = "y" ]; then if [ "$CONFIG_NET" = "y" ]; then
mainmenu_option next_comment mainmenu_option next_comment
...@@ -215,8 +220,6 @@ source drivers/media/Config.in ...@@ -215,8 +220,6 @@ source drivers/media/Config.in
source fs/Config.in source fs/Config.in
source drivers/char/Config.in
mainmenu_option next_comment mainmenu_option next_comment
comment 'Sound' comment 'Sound'
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# #
CONFIG_UID16=y CONFIG_UID16=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
# #
# Code maturity level options # Code maturity level options
...@@ -13,8 +15,9 @@ CONFIG_EXPERIMENTAL=y ...@@ -13,8 +15,9 @@ CONFIG_EXPERIMENTAL=y
# #
CONFIG_NET=y CONFIG_NET=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_SYSCTL is not set
CONFIG_BINFMT_ELF=y CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_JAVA is not set
# CONFIG_ETRAX_KGDB is not set # CONFIG_ETRAX_KGDB is not set
# CONFIG_ETRAX_WATCHDOG is not set # CONFIG_ETRAX_WATCHDOG is not set
...@@ -27,16 +30,30 @@ CONFIG_ETRAX100LX=y ...@@ -27,16 +30,30 @@ CONFIG_ETRAX100LX=y
CONFIG_CRIS_LOW_MAP=y CONFIG_CRIS_LOW_MAP=y
CONFIG_ETRAX_DRAM_VIRTUAL_BASE=60000000 CONFIG_ETRAX_DRAM_VIRTUAL_BASE=60000000
CONFIG_ETRAX_DRAM_SIZE=8 CONFIG_ETRAX_DRAM_SIZE=8
CONFIG_ETRAX_FLASH_LENGTH=2
CONFIG_ETRAX_FLASH_BUSWIDTH=2 CONFIG_ETRAX_FLASH_BUSWIDTH=2
CONFIG_ETRAX_PA_LEDS=y CONFIG_ETRAX_PA_LEDS=y
# CONFIG_ETRAX_PB_LEDS is not set # CONFIG_ETRAX_PB_LEDS is not set
# CONFIG_ETRAX_90000000_LEDS is not set # CONFIG_ETRAX_CSP0_LEDS is not set
# CONFIG_ETRAX_NO_LEDS is not set # CONFIG_ETRAX_NO_LEDS is not set
CONFIG_ETRAX_LED1G=2 CONFIG_ETRAX_LED1G=2
CONFIG_ETRAX_LED1R=2 CONFIG_ETRAX_LED1R=2
CONFIG_ETRAX_LED2G=2 CONFIG_ETRAX_LED2G=2
CONFIG_ETRAX_LED2R=2 CONFIG_ETRAX_LED2R=2
CONFIG_ETRAX_LED3R=2
CONFIG_ETRAX_LED3G=2
CONFIG_ETRAX_LED4R=2
CONFIG_ETRAX_LED4G=2
CONFIG_ETRAX_LED5R=2
CONFIG_ETRAX_LED5G=2
CONFIG_ETRAX_LED6R=2
CONFIG_ETRAX_LED6G=2
CONFIG_ETRAX_LED7R=2
CONFIG_ETRAX_LED7G=2
CONFIG_ETRAX_LED8Y=2
CONFIG_ETRAX_LED9Y=2
CONFIG_ETRAX_LED10Y=2
CONFIG_ETRAX_LED11Y=2
CONFIG_ETRAX_LED12R=2
CONFIG_ETRAX_DEBUG_PORT0=y CONFIG_ETRAX_DEBUG_PORT0=y
# CONFIG_ETRAX_DEBUG_PORT1 is not set # CONFIG_ETRAX_DEBUG_PORT1 is not set
# CONFIG_ETRAX_DEBUG_PORT2 is not set # CONFIG_ETRAX_DEBUG_PORT2 is not set
...@@ -55,13 +72,17 @@ CONFIG_ETRAX_DEF_R_PORT_PA_DATA=f0 ...@@ -55,13 +72,17 @@ CONFIG_ETRAX_DEF_R_PORT_PA_DATA=f0
CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=00 CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=00
CONFIG_ETRAX_DEF_R_PORT_PB_DIR=1e CONFIG_ETRAX_DEF_R_PORT_PB_DIR=1e
CONFIG_ETRAX_DEF_R_PORT_PB_DATA=f3 CONFIG_ETRAX_DEF_R_PORT_PB_DATA=f3
# CONFIG_ETRAX_SOFT_SHUTDOWN is not set
# #
# Drivers for Etrax built-in interfaces # Drivers for ETRAX 100LX built-in interfaces
# #
CONFIG_ETRAX_ETHERNET=y CONFIG_ETRAX_ETHERNET=y
CONFIG_NET_ETHERNET=y CONFIG_NET_ETHERNET=y
CONFIG_ETRAX_SERIAL=y # CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
C# CONFIG_ETRAX_ETHERNET_LPSLAVE is not set
ONFIG_ETRAX_SERIAL=y
# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set # CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set
CONFIG_ETRAX_SERIAL_PORT1=y CONFIG_ETRAX_SERIAL_PORT1=y
# CONFIG_ETRAX_SER1_DTR_RI_DSR_CD_ON_PB is not set # CONFIG_ETRAX_SER1_DTR_RI_DSR_CD_ON_PB is not set
...@@ -71,6 +92,7 @@ CONFIG_ETRAX_SERIAL_PORT1=y ...@@ -71,6 +92,7 @@ CONFIG_ETRAX_SERIAL_PORT1=y
# CONFIG_ETRAX_SYNCHRONOUS_SERIAL is not set # CONFIG_ETRAX_SYNCHRONOUS_SERIAL is not set
# CONFIG_ETRAX_IDE is not set # CONFIG_ETRAX_IDE is not set
CONFIG_ETRAX_AXISFLASHMAP=y CONFIG_ETRAX_AXISFLASHMAP=y
CONFIG_ETRAX_PTABLE_SECTOR=65536
CONFIG_MTD=y CONFIG_MTD=y
CONFIG_MTD_CFI=y CONFIG_MTD_CFI=y
# CONFIG_MTD_CFI_INTELEXT is not set # CONFIG_MTD_CFI_INTELEXT is not set
...@@ -80,6 +102,7 @@ CONFIG_MTD_CHAR=y ...@@ -80,6 +102,7 @@ CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y CONFIG_MTD_BLOCK=y
CONFIG_ETRAX_I2C=y CONFIG_ETRAX_I2C=y
CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C=y CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C=y
# CONFIG_ETRAX_I2C_EEPROM is not set
CONFIG_ETRAX_GPIO=y CONFIG_ETRAX_GPIO=y
CONFIG_ETRAX_PA_BUTTON_BITMASK=02 CONFIG_ETRAX_PA_BUTTON_BITMASK=02
CONFIG_ETRAX_PA_CHANGEABLE_DIR=00 CONFIG_ETRAX_PA_CHANGEABLE_DIR=00
...@@ -87,21 +110,35 @@ CONFIG_ETRAX_PA_CHANGEABLE_BITS=FF ...@@ -87,21 +110,35 @@ CONFIG_ETRAX_PA_CHANGEABLE_BITS=FF
CONFIG_ETRAX_PB_CHANGEABLE_DIR=00 CONFIG_ETRAX_PB_CHANGEABLE_DIR=00
CONFIG_ETRAX_PB_CHANGEABLE_BITS=FF CONFIG_ETRAX_PB_CHANGEABLE_BITS=FF
# CONFIG_ETRAX_USB_HOST is not set # CONFIG_ETRAX_USB_HOST is not set
# CONFIG_USB is not set
# CONFIG_ETRAX_DS1302 is not set
# #
# Memory Technology Devices (MTD) # Memory Technology Devices (MTD)
# #
CONFIG_MTD=y CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set # CONFIG_MTD_DEBUG is not set
#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC1000 is not set # CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set # CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set # CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOCPROBE is not set # CONFIG_MTD_DOCPROBE is not set
#
# RAM/ROM Device Drivers
#
# CONFIG_MTD_PMC551 is not set # CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set # CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_RAM is not set # CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set # CONFIG_MTD_ROM is not set
# CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_MTDRAM is not set
#
# Linearly Mapped Flash Device Drivers
#
CONFIG_MTD_CFI=y CONFIG_MTD_CFI=y
# CONFIG_MTD_CFI_GEOMETRY is not set # CONFIG_MTD_CFI_GEOMETRY is not set
# CONFIG_MTD_CFI_INTELEXT is not set # CONFIG_MTD_CFI_INTELEXT is not set
...@@ -112,6 +149,7 @@ CONFIG_MTD_AMDSTD=y ...@@ -112,6 +149,7 @@ CONFIG_MTD_AMDSTD=y
# CONFIG_MTD_NORA is not set # CONFIG_MTD_NORA is not set
# CONFIG_MTD_PNC2000 is not set # CONFIG_MTD_PNC2000 is not set
# CONFIG_MTD_RPXLITE is not set # CONFIG_MTD_RPXLITE is not set
# CONFIG_MTD_SC520CDP is not set
# CONFIG_MTD_SBC_MEDIAGX is not set # CONFIG_MTD_SBC_MEDIAGX is not set
# CONFIG_MTD_ELAN_104NC is not set # CONFIG_MTD_ELAN_104NC is not set
# CONFIG_MTD_SA1100 is not set # CONFIG_MTD_SA1100 is not set
...@@ -121,8 +159,16 @@ CONFIG_MTD_AMDSTD=y ...@@ -121,8 +159,16 @@ CONFIG_MTD_AMDSTD=y
# CONFIG_MTD_MIXMEM is not set # CONFIG_MTD_MIXMEM is not set
# CONFIG_MTD_OCTAGON is not set # CONFIG_MTD_OCTAGON is not set
# CONFIG_MTD_VMAX is not set # CONFIG_MTD_VMAX is not set
#
# NAND Flash Device Drivers
#
# CONFIG_MTD_NAND is not set # CONFIG_MTD_NAND is not set
# CONFIG_MTD_NAND_SPIA is not set # CONFIG_MTD_NAND_SPIA is not set
#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set # CONFIG_FTL is not set
......
...@@ -6,10 +6,21 @@ if [ "$CONFIG_ETRAX_ETHERNET" = "y" ]; then ...@@ -6,10 +6,21 @@ if [ "$CONFIG_ETRAX_ETHERNET" = "y" ]; then
# this is just so that the user does not have to go into the # this is just so that the user does not have to go into the
# normal ethernet driver section just to enable ethernetworking # normal ethernet driver section just to enable ethernetworking
define_bool CONFIG_NET_ETHERNET y define_bool CONFIG_NET_ETHERNET y
choice 'Network LED behavior' \
"LED_on_when_link CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK \
LED_on_when_activity CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY" \
LED_on_when_activity
else else
define_bool CONFIG_NET_ETHERNET n define_bool CONFIG_NET_ETHERNET n
fi fi
bool 'Etrax Ethernet slave support (over lp0/1)' CONFIG_ETRAX_ETHERNET_LPSLAVE
if [ "$CONFIG_ETRAX_ETHERNET_LPSLAVE" = "y" ]; then
bool ' Slave has its own LEDs' CONFIG_ETRAX_ETHERNET_LPSLAVE_HAS_LEDS
fi
bool 'Serial-port support' CONFIG_ETRAX_SERIAL bool 'Serial-port support' CONFIG_ETRAX_SERIAL
if [ "$CONFIG_ETRAX_SERIAL" = "y" ]; then if [ "$CONFIG_ETRAX_SERIAL" = "y" ]; then
comment ' Port 0 is always enabled' comment ' Port 0 is always enabled'
...@@ -99,7 +110,7 @@ if [ "$CONFIG_ETRAX_IDE" = "y" ]; then ...@@ -99,7 +110,7 @@ if [ "$CONFIG_ETRAX_IDE" = "y" ]; then
define_bool CONFIG_BLK_DEV_IDEDMA y define_bool CONFIG_BLK_DEV_IDEDMA y
define_bool CONFIG_DMA_NONPCI y define_bool CONFIG_DMA_NONPCI y
int 'Delay for drives to regain consciousness' CONFIG_IDE_DELAY 15 int 'Delay for drives to regain consciousness' CONFIG_ETRAX_IDE_DELAY 15
choice 'IDE reset pin' \ choice 'IDE reset pin' \
"Port_PB_Bit_7 CONFIG_ETRAX_IDE_PB7_RESET\ "Port_PB_Bit_7 CONFIG_ETRAX_IDE_PB7_RESET\
......
...@@ -7,18 +7,21 @@ O_TARGET := drivers.o ...@@ -7,18 +7,21 @@ O_TARGET := drivers.o
obj-y := obj-y :=
obj-$(CONFIG_ETRAX_ETHERNET) += ethernet.o obj-$(CONFIG_ETRAX_ETHERNET) += ethernet.o
obj-$(CONFIG_ETRAX_SERIAL) += serial.o obj-$(CONFIG_ETRAX_SERIAL) += serial.o
obj-$(CONFIG_ETRAX_IDE) += ide.o obj-$(CONFIG_ETRAX_IDE) += ide.o
obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o
obj-$(CONFIG_ETRAX_I2C) += i2c.o obj-$(CONFIG_ETRAX_I2C) += i2c.o
obj-$(CONFIG_ETRAX_I2C_EEPROM) += eeprom.o obj-$(CONFIG_ETRAX_I2C_EEPROM) += eeprom.o
obj-$(CONFIG_ETRAX_GPIO) += gpio.o obj-$(CONFIG_ETRAX_GPIO) += gpio.o
obj-$(CONFIG_ETRAX_USB_HOST) += usb-host.o obj-$(CONFIG_ETRAX_USB_HOST) += usb-host.o
obj-$(CONFIG_ETRAX_SYNCHRONOUS_SERIAL) += sync_serial.o obj-$(CONFIG_ETRAX_SYNCHRONOUS_SERIAL) += sync_serial.o
obj-$(CONFIG_ETRAX_PARPORT) += parport.o obj-$(CONFIG_ETRAX_PARPORT) += parport.o
obj-$(CONFIG_ETRAX_DS1302) += ds1302.o obj-$(CONFIG_ETRAX_DS1302) += ds1302.o
obj-$(CONFIG_ETRAX_ETHERNET_LPSLAVE) += lpslave/lpslavedrivers.o
subdir-$(CONFIG_ETRAX_ETHERNET_LPSLAVE) += lpslave
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -11,6 +11,23 @@ ...@@ -11,6 +11,23 @@
* partition split defined below. * partition split defined below.
* *
* $Log: axisflashmap.c,v $ * $Log: axisflashmap.c,v $
* Revision 1.12 2001/06/11 09:50:30 jonashg
* Oops, 2MB is 0x200000 bytes.
*
* Revision 1.11 2001/06/08 11:39:44 jonashg
* Changed sizes and offsets in axis_default_partitions to use
* CONFIG_ETRAX_PTABLE_SECTOR.
*
* Revision 1.10 2001/05/29 09:42:03 jonashg
* Use macro for end marker length instead of sizeof.
*
* Revision 1.9 2001/05/29 08:52:52 jonashg
* Gave names to the magic fours (size of the ptable end marker).
*
* Revision 1.8 2001/05/28 15:36:20 jonashg
* * Removed old comment about ptable location in flash (it's a CONFIG_ option).
* * Variable ptable was initialized twice to the same value.
*
* Revision 1.7 2001/04/05 13:41:46 markusl * Revision 1.7 2001/04/05 13:41:46 markusl
* Updated according to review remarks * Updated according to review remarks
* *
...@@ -130,6 +147,10 @@ static struct map_info axis_map = { ...@@ -130,6 +147,10 @@ static struct map_info axis_map = {
#define MAX_PARTITIONS 7 #define MAX_PARTITIONS 7
#define NUM_DEFAULT_PARTITIONS 3 #define NUM_DEFAULT_PARTITIONS 3
/* Default flash size is 2MB. CONFIG_ETRAX_PTABLE_SECTOR is most likely the
* size of one flash block and "filesystem"-partition needs 5 blocks to be able
* to use JFFS.
*/
static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = { static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
{ {
name: "boot firmware", name: "boot firmware",
...@@ -138,13 +159,13 @@ static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = { ...@@ -138,13 +159,13 @@ static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
}, },
{ {
name: "kernel", name: "kernel",
size: 0x1a0000, size: 0x200000 - (6 * CONFIG_ETRAX_PTABLE_SECTOR),
offset: CONFIG_ETRAX_PTABLE_SECTOR offset: CONFIG_ETRAX_PTABLE_SECTOR
}, },
{ {
name: "filesystem", name: "filesystem",
size: 0x50000, size: 5 * CONFIG_ETRAX_PTABLE_SECTOR,
offset: (0x1a0000 + CONFIG_ETRAX_PTABLE_SECTOR) offset: 0x200000 - (5 * CONFIG_ETRAX_PTABLE_SECTOR)
} }
}; };
...@@ -223,21 +244,17 @@ init_axis_flash(void) ...@@ -223,21 +244,17 @@ init_axis_flash(void)
mymtd->module = THIS_MODULE; mymtd->module = THIS_MODULE;
/* The partition-table is at an offset within the second
* sector of the flash. We _define_ this to be at offset 64k
* even if the actual sector-size in the flash changes.. for
* now at least.
*/
ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR + ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR +
CONFIG_ETRAX_PTABLE_SECTOR + PARTITION_TABLE_OFFSET); CONFIG_ETRAX_PTABLE_SECTOR + PARTITION_TABLE_OFFSET);
pidx++; /* first partition is always set to the default */ pidx++; /* first partition is always set to the default */
if ((ptable_head->magic == PARTITION_TABLE_MAGIC) if ((ptable_head->magic == PARTITION_TABLE_MAGIC)
&& (ptable_head->size < && (ptable_head->size <
(MAX_PARTITIONS * sizeof(struct partitiontable_entry) + 4)) (MAX_PARTITIONS * sizeof(struct partitiontable_entry) +
PARTITIONTABLE_END_MARKER_SIZE))
&& (*(unsigned long*)((void*)ptable_head + sizeof(*ptable_head) + && (*(unsigned long*)((void*)ptable_head + sizeof(*ptable_head) +
ptable_head->size - 4) ptable_head->size -
PARTITIONTABLE_END_MARKER_SIZE)
== PARTITIONTABLE_END_MARKER)) { == PARTITIONTABLE_END_MARKER)) {
/* Looks like a start, sane length and end of a /* Looks like a start, sane length and end of a
* partition table, lets check csum etc. * partition table, lets check csum etc.
...@@ -268,9 +285,6 @@ init_axis_flash(void) ...@@ -268,9 +285,6 @@ init_axis_flash(void)
ptable_ok = (csum == ptable_head->checksum); ptable_ok = (csum == ptable_head->checksum);
/* Read the entries and use/show the info. */ /* Read the entries and use/show the info. */
ptable = (struct partitiontable_entry *)
((unsigned long)ptable_head + sizeof(*ptable_head));
printk(" Found %s partition table at 0x%08lX-0x%08lX.\n", printk(" Found %s partition table at 0x%08lX-0x%08lX.\n",
(ptable_ok ? "valid" : "invalid"), (ptable_ok ? "valid" : "invalid"),
(unsigned long)ptable_head, (unsigned long)ptable_head,
......
This diff is collapsed.
This diff is collapsed.
/* $Id: ethernet.c,v 1.12 2001/04/05 11:43:11 tobiasa Exp $ /* $Id: ethernet.c,v 1.17 2001/06/11 12:43:46 olof Exp $
* *
* e100net.c: A network driver for the ETRAX 100LX network controller. * e100net.c: A network driver for the ETRAX 100LX network controller.
* *
...@@ -7,6 +7,23 @@ ...@@ -7,6 +7,23 @@
* The outline of this driver comes from skeleton.c. * The outline of this driver comes from skeleton.c.
* *
* $Log: ethernet.c,v $ * $Log: ethernet.c,v $
* Revision 1.17 2001/06/11 12:43:46 olof
* Modified defines for network LED behavior
*
* Revision 1.16 2001/05/30 06:12:46 markusl
* TxDesc.next should not be set to NULL
*
* Revision 1.15 2001/05/29 10:27:04 markusl
* Updated after review remarks:
* +Use IO_EXTRACT
* +Handle underrun
*
* Revision 1.14 2001/05/29 09:20:14 jonashg
* Use driver name on printk output so one can tell which driver that complains.
*
* Revision 1.13 2001/05/09 12:35:59 johana
* Use DMA_NBR and IRQ_NBR defines from dma.h and irq.h
*
* Revision 1.12 2001/04/05 11:43:11 tobiasa * Revision 1.12 2001/04/05 11:43:11 tobiasa
* Check dev before panic. * Check dev before panic.
* *
...@@ -80,6 +97,7 @@ ...@@ -80,6 +97,7 @@
#include <asm/svinto.h> /* DMA and register descriptions */ #include <asm/svinto.h> /* DMA and register descriptions */
#include <asm/io.h> /* LED_* I/O functions */ #include <asm/io.h> /* LED_* I/O functions */
#include <asm/irq.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/bitops.h> #include <asm/bitops.h>
...@@ -87,8 +105,6 @@ ...@@ -87,8 +105,6 @@
//#define ETHDEBUG //#define ETHDEBUG
#define D(x) #define D(x)
#define ETH_TX_DMA 0
#define ETH_RX_DMA 1
/* /*
* The name of the card. Is used for messages and in the requests for * The name of the card. Is used for messages and in the requests for
...@@ -116,9 +132,6 @@ struct net_local { ...@@ -116,9 +132,6 @@ struct net_local {
spinlock_t lock; spinlock_t lock;
}; };
#define NETWORK_DMARX_IRQ 17 /* irq 17 is the DMA1 irq */
#define NETWORK_DMATX_IRQ 16 /* irq 16 is the DMA0 irq */
#define NETWORK_STATUS_IRQ 6 /* irq 6 is the network irq */
/* Dma descriptors etc. */ /* Dma descriptors etc. */
...@@ -231,7 +244,8 @@ etrax_ethernet_init(struct net_device *dev) ...@@ -231,7 +244,8 @@ etrax_ethernet_init(struct net_device *dev)
/* make Linux aware of the new hardware */ /* make Linux aware of the new hardware */
if (!dev) { if (!dev) {
printk("dev == NULL. Should this happen?\n"); printk(KERN_WARNING "%s: dev == NULL. Should this happen?\n",
cardname);
dev = init_etherdev(dev, sizeof(struct net_local)); dev = init_etherdev(dev, sizeof(struct net_local));
if (!dev) if (!dev)
panic("init_etherdev failed\n"); panic("init_etherdev failed\n");
...@@ -250,8 +264,8 @@ etrax_ethernet_init(struct net_device *dev) ...@@ -250,8 +264,8 @@ etrax_ethernet_init(struct net_device *dev)
/* now setup our etrax specific stuff */ /* now setup our etrax specific stuff */
dev->irq = NETWORK_DMARX_IRQ; /* we really use DMATX as well... */ dev->irq = NETWORK_DMA_RX_IRQ_NBR; /* we really use DMATX as well... */
dev->dma = 1; dev->dma = NETWORK_RX_DMA_NBR;
/* fill in our handlers so the network layer can talk to us in the future */ /* fill in our handlers so the network layer can talk to us in the future */
...@@ -381,30 +395,30 @@ e100_open(struct net_device *dev) ...@@ -381,30 +395,30 @@ e100_open(struct net_device *dev)
/* Reset and wait for the DMA channels */ /* Reset and wait for the DMA channels */
RESET_DMA(0); RESET_DMA(NETWORK_TX_DMA_NBR);
RESET_DMA(1); RESET_DMA(NETWORK_RX_DMA_NBR);
WAIT_DMA(0); WAIT_DMA(NETWORK_TX_DMA_NBR);
WAIT_DMA(1); WAIT_DMA(NETWORK_RX_DMA_NBR);
/* Initialise the etrax network controller */ /* Initialise the etrax network controller */
/* allocate the irq corresponding to the receiving DMA */ /* allocate the irq corresponding to the receiving DMA */
if (request_irq(NETWORK_DMARX_IRQ, e100rx_interrupt, 0, if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rx_interrupt, 0,
cardname, (void *)dev)) { cardname, (void *)dev)) {
goto grace_exit; goto grace_exit;
} }
/* allocate the irq corresponding to the transmitting DMA */ /* allocate the irq corresponding to the transmitting DMA */
if (request_irq(NETWORK_DMATX_IRQ, e100tx_interrupt, 0, if (request_irq(NETWORK_DMA_TX_IRQ_NBR, e100tx_interrupt, 0,
cardname, (void *)dev)) { cardname, (void *)dev)) {
goto grace_exit; goto grace_exit;
} }
/* allocate the irq corresponding to the network errors etc */ /* allocate the irq corresponding to the network errors etc */
if (request_irq(NETWORK_STATUS_IRQ, e100nw_interrupt, 0, if (request_irq(NETWORK_STATUS_IRQ_NBR, e100nw_interrupt, 0,
cardname, (void *)dev)) { cardname, (void *)dev)) {
goto grace_exit; goto grace_exit;
} }
...@@ -414,17 +428,17 @@ e100_open(struct net_device *dev) ...@@ -414,17 +428,17 @@ e100_open(struct net_device *dev)
* and clean up on failure. * and clean up on failure.
*/ */
if(request_dma(ETH_TX_DMA, cardname)) { if(request_dma(NETWORK_TX_DMA_NBR, cardname)) {
goto grace_exit; goto grace_exit;
} }
if(request_dma(ETH_RX_DMA, cardname)) { if(request_dma(NETWORK_RX_DMA_NBR, cardname)) {
grace_exit: grace_exit:
/* this will cause some 'trying to free free irq' but what the heck... */ /* this will cause some 'trying to free free irq' but what the heck... */
free_dma(ETH_TX_DMA); free_dma(NETWORK_TX_DMA_NBR);
free_irq(NETWORK_DMARX_IRQ, (void *)dev); free_irq(NETWORK_DMA_RX_IRQ_NBR, (void *)dev);
free_irq(NETWORK_DMATX_IRQ, (void *)dev); free_irq(NETWORK_DMA_TX_IRQ_NBR, (void *)dev);
free_irq(NETWORK_STATUS_IRQ, (void *)dev); free_irq(NETWORK_STATUS_IRQ_NBR, (void *)dev);
return -EAGAIN; return -EAGAIN;
} }
...@@ -625,8 +639,8 @@ e100_tx_timeout(struct net_device *dev) ...@@ -625,8 +639,8 @@ e100_tx_timeout(struct net_device *dev)
/* reset the TX DMA in case it has hung on something */ /* reset the TX DMA in case it has hung on something */
RESET_DMA(0); RESET_DMA(NETWORK_TX_DMA_NBR);
WAIT_DMA(0); WAIT_DMA(NETWORK_TX_DMA_NBR);
/* Reset the tranceiver. */ /* Reset the tranceiver. */
...@@ -751,7 +765,8 @@ e100tx_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -751,7 +765,8 @@ e100tx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
tx_skb = 0; tx_skb = 0;
netif_wake_queue(dev); netif_wake_queue(dev);
} else { } else {
printk("tx weird interrupt\n"); printk(KERN_WARNING "%s: tx weird interrupt\n",
cardname);
} }
spin_unlock(&np->lock); spin_unlock(&np->lock);
...@@ -765,6 +780,13 @@ e100nw_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -765,6 +780,13 @@ e100nw_interrupt(int irq, void *dev_id, struct pt_regs * regs)
struct net_local *np = (struct net_local *)dev->priv; struct net_local *np = (struct net_local *)dev->priv;
unsigned long irqbits = *R_IRQ_MASK0_RD; unsigned long irqbits = *R_IRQ_MASK0_RD;
/* check for underrun irq */
if(irqbits & IO_STATE(R_IRQ_MASK0_RD, underrun, active)) {
*R_NETWORK_TR_CTRL = IO_STATE(R_NETWORK_TR_CTRL, clr_error, clr);
np->stats.tx_errors++;
D(printk("ethernet receiver underrun!\n"));
}
/* check for overrun irq */ /* check for overrun irq */
if(irqbits & IO_STATE(R_IRQ_MASK0_RD, overrun, active)) { if(irqbits & IO_STATE(R_IRQ_MASK0_RD, overrun, active)) {
update_rx_stats(&np->stats); /* this will ack the irq */ update_rx_stats(&np->stats); /* this will ack the irq */
...@@ -900,17 +922,17 @@ e100_close(struct net_device *dev) ...@@ -900,17 +922,17 @@ e100_close(struct net_device *dev)
/* Stop the receiver and the transmitter */ /* Stop the receiver and the transmitter */
RESET_DMA(0); RESET_DMA(NETWORK_TX_DMA_NBR);
RESET_DMA(1); RESET_DMA(NETWORK_RX_DMA_NBR);
/* Flush the Tx and disable Rx here. */ /* Flush the Tx and disable Rx here. */
free_irq(NETWORK_DMARX_IRQ, (void *)dev); free_irq(NETWORK_DMA_RX_IRQ_NBR, (void *)dev);
free_irq(NETWORK_DMATX_IRQ, (void *)dev); free_irq(NETWORK_DMA_TX_IRQ_NBR, (void *)dev);
free_irq(NETWORK_STATUS_IRQ, (void *)dev); free_irq(NETWORK_STATUS_IRQ_NBR, (void *)dev);
free_dma(ETH_TX_DMA); free_dma(NETWORK_TX_DMA_NBR);
free_dma(ETH_RX_DMA); free_dma(NETWORK_RX_DMA_NBR);
/* Update the statistics here. */ /* Update the statistics here. */
...@@ -925,10 +947,10 @@ update_rx_stats(struct net_device_stats *es) ...@@ -925,10 +947,10 @@ update_rx_stats(struct net_device_stats *es)
{ {
unsigned long r = *R_REC_COUNTERS; unsigned long r = *R_REC_COUNTERS;
/* update stats relevant to reception errors */ /* update stats relevant to reception errors */
es->rx_fifo_errors += r >> 24; /* fifo overrun */ es->rx_fifo_errors += IO_EXTRACT(R_REC_COUNTERS, congestion, r);
es->rx_crc_errors += r & 0xff; /* crc error */ es->rx_crc_errors += IO_EXTRACT(R_REC_COUNTERS, crc_error, r);
es->rx_frame_errors += (r >> 8) & 0xff; /* alignment error */ es->rx_frame_errors += IO_EXTRACT(R_REC_COUNTERS, alignment_error, r);
es->rx_length_errors += (r >> 16) & 0xff; /* oversized frames */ es->rx_length_errors += IO_EXTRACT(R_REC_COUNTERS, oversize, r);
} }
static void static void
...@@ -936,8 +958,10 @@ update_tx_stats(struct net_device_stats *es) ...@@ -936,8 +958,10 @@ update_tx_stats(struct net_device_stats *es)
{ {
unsigned long r = *R_TR_COUNTERS; unsigned long r = *R_TR_COUNTERS;
/* update stats relevant to transmission errors */ /* update stats relevant to transmission errors */
es->collisions += (r & 0xff) + ((r >> 8) & 0xff); /* single_col + multiple_col */ es->collisions +=
es->tx_errors += (r >> 24) & 0xff; /* deferred transmit frames */ IO_EXTRACT(R_TR_COUNTERS, single_col, r) +
IO_EXTRACT(R_TR_COUNTERS, multiple_col, r);
es->tx_errors += IO_EXTRACT(R_TR_COUNTERS, deferred, r);
} }
/* /*
...@@ -1082,10 +1106,12 @@ e100_clear_network_leds(unsigned long dummy) ...@@ -1082,10 +1106,12 @@ e100_clear_network_leds(unsigned long dummy)
static void static void
e100_set_network_leds(int active) e100_set_network_leds(int active)
{ {
#ifdef CONFIG_LED_OFF_DURING_ACTIVITY #if defined(CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK)
int light_leds = (active == NO_NETWORK_ACTIVITY); int light_leds = (active == NO_NETWORK_ACTIVITY);
#else #elif defined(CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY)
int light_leds = (active == NETWORK_ACTIVITY); int light_leds = (active == NETWORK_ACTIVITY);
#else
#error "Define either CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK or CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY"
#endif #endif
if (!current_speed) { if (!current_speed) {
......
/* $Id: gpio.c,v 1.7 2001/04/04 13:30:08 matsfg Exp $ /* $Id: gpio.c,v 1.9 2001/05/04 14:16:07 matsfg Exp $
* *
* Etrax general port I/O device * Etrax general port I/O device
* *
...@@ -9,6 +9,14 @@ ...@@ -9,6 +9,14 @@
* Johan Adolfsson (read/set directions) * Johan Adolfsson (read/set directions)
* *
* $Log: gpio.c,v $ * $Log: gpio.c,v $
* Revision 1.9 2001/05/04 14:16:07 matsfg
* Corrected spelling error
*
* Revision 1.8 2001/04/27 13:55:26 matsfg
* Moved initioremap.
* Turns off all LEDS on init.
* Added support for shutdown and powerbutton.
*
* Revision 1.7 2001/04/04 13:30:08 matsfg * Revision 1.7 2001/04/04 13:30:08 matsfg
* Added bitset and bitclear for leds. Calls init_ioremap to set up memmapping * Added bitset and bitclear for leds. Calls init_ioremap to set up memmapping
* *
...@@ -247,6 +255,16 @@ gpio_ioctl(struct inode *inode, struct file *file, ...@@ -247,6 +255,16 @@ gpio_ioctl(struct inode *inode, struct file *file,
*priv->dir = *priv->dir_shadow |= *priv->dir = *priv->dir_shadow |=
((unsigned char)arg & priv->changeable_dir); ((unsigned char)arg & priv->changeable_dir);
return *priv->dir_shadow; return *priv->dir_shadow;
case IO_SHUTDOWN:
SOFT_SHUTDOWN();
break;
case IO_GET_PWR_BT:
#if defined (CONFIG_ETRAX_SOFT_SHUTDOWN)
return (*R_PORT_G_DATA &
( 1 << CONFIG_ETRAX_POWERBUTTON_BIT));
#else
return 0;
#endif
default: default:
if(priv->minor == LEDS) if(priv->minor == LEDS)
return gpio_leds_ioctl(cmd, arg); return gpio_leds_ioctl(cmd, arg);
...@@ -262,12 +280,6 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) ...@@ -262,12 +280,6 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
{ {
unsigned char green; unsigned char green;
unsigned char red; unsigned char red;
static int initialized = 0;
if(!initialized)
{
initialized = 1;
init_ioremap();
}
switch (_IOC_NR(cmd)) { switch (_IOC_NR(cmd)) {
case IO_LEDACTIVE_SET: case IO_LEDACTIVE_SET:
green = ((unsigned char) arg) & 1; green = ((unsigned char) arg) & 1;
...@@ -298,7 +310,7 @@ struct file_operations gpio_fops = { ...@@ -298,7 +310,7 @@ struct file_operations gpio_fops = {
static __init int static __init int
gpio_init(void) gpio_init(void)
{ {
int res; int res,i;
/* do the formalities */ /* do the formalities */
...@@ -307,6 +319,24 @@ gpio_init(void) ...@@ -307,6 +319,24 @@ gpio_init(void)
printk(KERN_ERR "gpio: couldn't get a major number.\n"); printk(KERN_ERR "gpio: couldn't get a major number.\n");
return res; return res;
} }
/* Clear all leds */
#if defined (CONFIG_ETRAX_CSP0_LEDS) || defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS)
init_ioremap();
LED_NETWORK_SET(0);
LED_ACTIVE_SET(0);
LED_DISK_READ(0);
LED_DISK_WRITE(0);
#if defined (CONFIG_ETRAX_CSP0_LEDS)
for( i = 0; i < 32; i ++)
{
LED_BIT_SET(i);
}
#endif
#endif
printk("ETRAX 100LX GPIO driver v2.1, (c) 2001 Axis Communications AB\n"); printk("ETRAX 100LX GPIO driver v2.1, (c) 2001 Axis Communications AB\n");
......
/* $Id: ide.c,v 1.16 2001/04/05 08:30:07 matsfg Exp $ /* $Id: ide.c,v 1.19 2001/05/09 12:53:16 johana Exp $
* *
* Etrax specific IDE functions, like init and PIO-mode setting etc. * Etrax specific IDE functions, like init and PIO-mode setting etc.
* Almost the entire ide.c is used for the rest of the Etrax ATA driver. * Almost the entire ide.c is used for the rest of the Etrax ATA driver.
...@@ -8,6 +8,15 @@ ...@@ -8,6 +8,15 @@
* Mikael Starvik (pio setup stuff) * Mikael Starvik (pio setup stuff)
* *
* $Log: ide.c,v $ * $Log: ide.c,v $
* Revision 1.19 2001/05/09 12:53:16 johana
* Added #include <asm/dma.h>
*
* Revision 1.18 2001/05/09 12:37:00 johana
* Use DMA_NBR macros from dma.h.
*
* Revision 1.17 2001/04/23 13:36:30 matsfg
* Changed CONFIG_IDE_DELAY to CONFIG_ETRAX_IDE_DELAY
*
* Revision 1.16 2001/04/05 08:30:07 matsfg * Revision 1.16 2001/04/05 08:30:07 matsfg
* Corrected cse1 and csp0 reset. * Corrected cse1 and csp0 reset.
* *
...@@ -98,6 +107,7 @@ ...@@ -98,6 +107,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/svinto.h> #include <asm/svinto.h>
#include <asm/dma.h>
/* number of Etrax DMA descriptors */ /* number of Etrax DMA descriptors */
#define MAX_DMA_DESCRS 64 #define MAX_DMA_DESCRS 64
...@@ -341,17 +351,17 @@ init_e100_ide (void) ...@@ -341,17 +351,17 @@ init_e100_ide (void)
IO_STATE( R_IRQ_MASK0_SET, ata_irq2, set ) | IO_STATE( R_IRQ_MASK0_SET, ata_irq2, set ) |
IO_STATE( R_IRQ_MASK0_SET, ata_irq3, set ) ); IO_STATE( R_IRQ_MASK0_SET, ata_irq3, set ) );
printk("ide: waiting %d seconds for drives to regain consciousness\n", CONFIG_IDE_DELAY); printk("ide: waiting %d seconds for drives to regain consciousness\n", CONFIG_ETRAX_IDE_DELAY);
h = jiffies + (CONFIG_IDE_DELAY * HZ); h = jiffies + (CONFIG_ETRAX_IDE_DELAY * HZ);
while(jiffies < h) ; while(jiffies < h) ;
/* reset the dma channels we will use */ /* reset the dma channels we will use */
RESET_DMA(2); RESET_DMA(ATA_TX_DMA_NBR);
RESET_DMA(3); RESET_DMA(ATA_RX_DMA_NBR);
WAIT_DMA(2); WAIT_DMA(ATA_TX_DMA_NBR);
WAIT_DMA(3); WAIT_DMA(ATA_RX_DMA_NBR);
} }
...@@ -378,8 +388,8 @@ e100_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount ...@@ -378,8 +388,8 @@ e100_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount
} }
/* make sure the DMA channel is available */ /* make sure the DMA channel is available */
RESET_DMA(3); RESET_DMA(ATA_RX_DMA_NBR);
WAIT_DMA(3); WAIT_DMA(ATA_RX_DMA_NBR);
/* setup DMA descriptor */ /* setup DMA descriptor */
...@@ -406,7 +416,7 @@ e100_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount ...@@ -406,7 +416,7 @@ e100_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount
/* wait for completion */ /* wait for completion */
LED_DISK_READ(1); LED_DISK_READ(1);
WAIT_DMA(3); WAIT_DMA(ATA_RX_DMA_NBR);
LED_DISK_READ(0); LED_DISK_READ(0);
#if 0 #if 0
...@@ -457,8 +467,8 @@ e100_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecoun ...@@ -457,8 +467,8 @@ e100_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecoun
} }
/* make sure the DMA channel is available */ /* make sure the DMA channel is available */
RESET_DMA(2); RESET_DMA(ATA_TX_DMA_NBR);
WAIT_DMA(2); WAIT_DMA(ATA_TX_DMA_NBR);
/* setup DMA descriptor */ /* setup DMA descriptor */
...@@ -485,7 +495,7 @@ e100_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecoun ...@@ -485,7 +495,7 @@ e100_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecoun
/* wait for completion */ /* wait for completion */
LED_DISK_WRITE(1); LED_DISK_WRITE(1);
WAIT_DMA(2); WAIT_DMA(ATA_TX_DMA_NBR);
LED_DISK_WRITE(0); LED_DISK_WRITE(0);
#if 0 #if 0
...@@ -794,8 +804,8 @@ static int e100_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -794,8 +804,8 @@ static int e100_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
if(reading) { if(reading) {
RESET_DMA(3); /* sometimes the DMA channel get stuck so we need to do this */ RESET_DMA(ATA_RX_DMA_NBR); /* sometimes the DMA channel get stuck so we need to do this */
WAIT_DMA(3); WAIT_DMA(ATA_RX_DMA_NBR);
/* set up the Etrax DMA descriptors */ /* set up the Etrax DMA descriptors */
...@@ -837,8 +847,8 @@ static int e100_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -837,8 +847,8 @@ static int e100_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
} else { } else {
/* writing */ /* writing */
RESET_DMA(2); /* sometimes the DMA channel get stuck so we need to do this */ RESET_DMA(ATA_TX_DMA_NBR); /* sometimes the DMA channel get stuck so we need to do this */
WAIT_DMA(2); WAIT_DMA(ATA_TX_DMA_NBR);
/* set up the Etrax DMA descriptors */ /* set up the Etrax DMA descriptors */
......
#
# Makefile for parallel port slave drivers
#
O_TARGET := lpslavedrivers.o
obj-y = e100lpslavenet.o e100lpslave_code.o
include $(TOPDIR)/Rules.make
e100lpslave_code.o: e100lpslave.o e100lpslaveld
$(CROSS_COMPILE)ld -qmagic -Te100lpslaveld e100lpslave.o -o e100lpslave
$(CROSS_COMPILE)objcopy -O binary --remove-section=.data --remove-section=.bss e100lpslave e100lpslave.text
$(CROSS_COMPILE)objcopy -O binary --remove-section=.text --remove-section=.bss e100lpslave e100lpslave.data
cat e100lpslave.text e100lpslave.data |\
./bintocarr.pl e100lpslaveprog |\
$(CC) $(CFLAGS) -pipe -o e100lpslave_code.o -c -x c -
ls -l e100lpslave.text e100lpslave.data
rm -f e100lpslave e100lpslave.text e100lpslave.data
#!/usr/bin/perl -w
# $Id: bintocarr.pl,v 1.3 2001/06/08 08:46:50 olof Exp $
# Copy of mkjulbin.pl made by Olof
# convert a binary stdin to a C-file containing a char array of the input
# first argument is the symbol name
$symbol = shift @ARGV;
print "#include <linux/init.h>\n\n";
print "unsigned char $symbol", "[] __initdata = {\n";
my $char;
$bcount = 0;
while(read STDIN, $char, 1) {
printf("0x%x, ", ord($char));
$bcount++;
if(!($bcount % 16)) {
print "\n";
}
}
print "\n};\n";
$lensymb = ("_" . ($symbol . "_length"));
print "__asm__(\"\\t.globl $lensymb\\n$lensymb = $bcount\\n\");\n";
***** MODIFICATIONS
To use a 5600 as a slave device it has to somewhat modified.
This has to be done on a 5600 (art no 16144 R2) to automatically set it to parallel port boot mode:
1)
Close to the LPT1 connector there are two resistors, between the "Pulse" inductor and
the LS245. The one closest to the LS245 is a 4k7 pull up (R105). Remove it.
2)
Between the other "Pulse" inductor and Etrax there is a black 5-pin inverter
(D15). Short connectors 2 and 3 with a solder blob.
***** PINOUT
To use this driver use cables connected like this:
DSUB25-Male DSUB25Male
1 10
2-9 2-9
10 1
11 14
12 18
13 NC
14 11
15 NC
16 NC
17 NC
18 12
19 NC
20-25 20-25
Thus the cables are symmetrical with most cables straight through,
some crossed (1-10, 11-14 and 12-18)
and some Not connected (NC 13,15,16,17 and 19).
******* Only for reference
To ease the use of flat-cable connectors, here are the notes of wich wires to cross and cut with pin 1 being cable 1:
Cross:
1 19
2 21
10 23
Cut:
4
6
8
12
25
jonas.dellenvall@axis.com
This diff is collapsed.
#define HOST_CMD_SENDPACK 0
#define HOST_CMD_SETMAC 1
MEMORY
{
cache : ORIGIN = 0x380000f0,
LENGTH = 784
}
SECTIONS
{
.text :
{
*(.text)
} > cache
.data :
{
*(.data)
*(COMMON)
} > cache
.bss :
{
*(.bss)
} > cache
}
This diff is collapsed.
/* $Id: parport.c,v 1.4 2001/04/06 13:04:02 hugo Exp $ /* $Id: parport.c,v 1.5 2001/05/09 12:38:42 johana Exp $
* *
* Elinux parallel port driver * Elinux parallel port driver
* NOTE! * NOTE!
...@@ -501,8 +501,8 @@ parport_etrax_init_registers(void) ...@@ -501,8 +501,8 @@ parport_etrax_init_registers(void)
#ifdef CONFIG_ETRAX_PARALLEL_PORT0 #ifdef CONFIG_ETRAX_PARALLEL_PORT0
#ifdef CONFIG_ETRAX_PAR0_DMA #ifdef CONFIG_ETRAX_PAR0_DMA
RESET_DMA(2); RESET_DMA(PAR0_TX_DMA_NBR);
WAIT_DMA(2); WAIT_DMA(PAR0_TX_DMA_NBR);
#ifdef CONFIG_ETRAX_SERIAL_PORT2 #ifdef CONFIG_ETRAX_SERIAL_PORT2
printk(" Warning - DMA clash with ser2!\n"); printk(" Warning - DMA clash with ser2!\n");
#endif /* SERIAL_PORT2 */ #endif /* SERIAL_PORT2 */
...@@ -511,8 +511,8 @@ parport_etrax_init_registers(void) ...@@ -511,8 +511,8 @@ parport_etrax_init_registers(void)
#ifdef CONFIG_ETRAX_PARALLEL_PORT1 #ifdef CONFIG_ETRAX_PARALLEL_PORT1
#ifdef CONFIG_ETRAX_PAR1_DMA #ifdef CONFIG_ETRAX_PAR1_DMA
RESET_DMA(4); RESET_DMA(PAR1_TX_DMA_NBR);
WAIT_DMA(4); WAIT_DMA(PAR1_TX_DMA_NBR);
#ifdef CONFIG_ETRAX_SERIAL_PORT3 #ifdef CONFIG_ETRAX_SERIAL_PORT3
printk(" Warning - DMA clash with ser3!\n"); printk(" Warning - DMA clash with ser3!\n");
#endif /* SERIAL_PORT3 */ #endif /* SERIAL_PORT3 */
......
/* $Id: serial.c,v 1.12 2001/04/19 12:23:07 bjornw Exp $ /* $Id: serial.c,v 1.13 2001/05/09 12:40:31 johana Exp $
* *
* Serial port driver for the ETRAX 100LX chip * Serial port driver for the ETRAX 100LX chip
* *
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
* Many, many authors. Based once upon a time on serial.c for 16x50. * Many, many authors. Based once upon a time on serial.c for 16x50.
* *
* $Log: serial.c,v $ * $Log: serial.c,v $
* Revision 1.13 2001/05/09 12:40:31 johana
* Use DMA_NBR and IRQ_NBR defines from dma.h and irq.h
*
* Revision 1.12 2001/04/19 12:23:07 bjornw * Revision 1.12 2001/04/19 12:23:07 bjornw
* CONFIG_RS485 -> CONFIG_ETRAX_RS485 * CONFIG_RS485 -> CONFIG_ETRAX_RS485
* *
...@@ -199,7 +202,7 @@ ...@@ -199,7 +202,7 @@
* *
*/ */
static char *serial_version = "$Revision: 1.12 $"; static char *serial_version = "$Revision: 1.13 $";
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h> #include <linux/version.h>
...@@ -495,7 +498,6 @@ static struct semaphore tmp_buf_sem = MUTEX; ...@@ -495,7 +498,6 @@ static struct semaphore tmp_buf_sem = MUTEX;
#endif #endif
#ifdef CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST #ifdef CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST
#define TIMER1_IRQ_NBR 3
/* clock select 10 for timer 1 gives 230400 Hz */ /* clock select 10 for timer 1 gives 230400 Hz */
#define FASTTIMER_SELECT (10) #define FASTTIMER_SELECT (10)
...@@ -3049,32 +3051,32 @@ rs_init(void) ...@@ -3049,32 +3051,32 @@ rs_init(void)
#ifndef CONFIG_SVINTO_SIM #ifndef CONFIG_SVINTO_SIM
/* Not needed in simulator. May only complicate stuff. */ /* Not needed in simulator. May only complicate stuff. */
/* hook the irq's for DMA channel 6 and 7, serial output and input, and some more... */ /* hook the irq's for DMA channel 6 and 7, serial output and input, and some more... */
if(request_irq(22, tr_interrupt, SA_INTERRUPT, "serial 0 dma tr", NULL)) if(request_irq(SER0_DMA_TX_IRQ_NBR, tr_interrupt, SA_INTERRUPT, "serial 0 dma tr", NULL))
panic("irq22"); panic("irq22");
if(request_irq(23, rec_interrupt, SA_INTERRUPT, "serial 0 dma rec", NULL)) if(request_irq(SER0_DMA_RX_IRQ_NBR, rec_interrupt, SA_INTERRUPT, "serial 0 dma rec", NULL))
panic("irq23"); panic("irq23");
#ifdef SERIAL_HANDLE_EARLY_ERRORS #ifdef SERIAL_HANDLE_EARLY_ERRORS
if(request_irq(8, ser_interrupt, SA_INTERRUPT, "serial ", NULL)) if(request_irq(SERIAL_IRQ_NBR, ser_interrupt, SA_INTERRUPT, "serial ", NULL))
panic("irq8"); panic("irq8");
#endif #endif
#ifdef CONFIG_ETRAX_SERIAL_PORT1 #ifdef CONFIG_ETRAX_SERIAL_PORT1
if(request_irq(24, tr_interrupt, SA_INTERRUPT, "serial 1 dma tr", NULL)) if(request_irq(SER1_DMA_TX_IRQ_NBR, tr_interrupt, SA_INTERRUPT, "serial 1 dma tr", NULL))
panic("irq24"); panic("irq24");
if(request_irq(25, rec_interrupt, SA_INTERRUPT, "serial 1 dma rec", NULL)) if(request_irq(SER1_DMA_RX_IRQ_NBR, rec_interrupt, SA_INTERRUPT, "serial 1 dma rec", NULL))
panic("irq25"); panic("irq25");
#endif #endif
#ifdef CONFIG_ETRAX_SERIAL_PORT2 #ifdef CONFIG_ETRAX_SERIAL_PORT2
/* DMA Shared with par0 (and SCSI0 and ATA) */ /* DMA Shared with par0 (and SCSI0 and ATA) */
if(request_irq(18, tr_interrupt, SA_SHIRQ, "serial 2 dma tr", NULL)) if(request_irq(SER2_DMA_TX_IRQ_NBR, tr_interrupt, SA_SHIRQ, "serial 2 dma tr", NULL))
panic("irq18"); panic("irq18");
if(request_irq(19, rec_interrupt, SA_SHIRQ, "serial 2 dma rec", NULL)) if(request_irq(SER2_DMA_RX_IRQ_NBR, rec_interrupt, SA_SHIRQ, "serial 2 dma rec", NULL))
panic("irq19"); panic("irq19");
#endif #endif
#ifdef CONFIG_ETRAX_SERIAL_PORT3 #ifdef CONFIG_ETRAX_SERIAL_PORT3
/* DMA Shared with par1 (and SCSI1 and Extern DMA 0) */ /* DMA Shared with par1 (and SCSI1 and Extern DMA 0) */
if(request_irq(20, tr_interrupt, SA_SHIRQ, "serial 3 dma tr", NULL)) if(request_irq(SER3_DMA_TX_IRQ_NBR, tr_interrupt, SA_SHIRQ, "serial 3 dma tr", NULL))
panic("irq20"); panic("irq20");
if(request_irq(21, rec_interrupt, SA_SHIRQ, "serial 3 dma rec", NULL)) if(request_irq(SER3_DMA_RX_IRQ_NBR, rec_interrupt, SA_SHIRQ, "serial 3 dma rec", NULL))
panic("irq21"); panic("irq21");
#endif #endif
#ifdef CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST #ifdef CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2001 Axis Communications AB. * Copyright (c) 2001 Axis Communications AB.
* *
* $Id: usb-host.c,v 1.8 2001/02/27 13:52:48 bjornw Exp $ * $Id: usb-host.c,v 1.9 2001/05/09 12:54:12 johana Exp $
* *
*/ */
...@@ -23,17 +23,18 @@ ...@@ -23,17 +23,18 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/dma.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/svinto.h> #include <asm/svinto.h>
#include <linux/usb.h> #include <linux/usb.h>
#include "usb-host.h" #include "usb-host.h"
#define ETRAX_USB_HC_IRQ 31 #define ETRAX_USB_HC_IRQ USB_HC_IRQ_NBR
#define ETRAX_USB_RX_IRQ 25 #define ETRAX_USB_RX_IRQ USB_DMA_RX_IRQ_NBR
#define ETRAX_USB_TX_IRQ 24 #define ETRAX_USB_TX_IRQ USB_DMA_TX_IRQ_NBR
static const char *usb_hcd_version = "$Revision: 1.8 $"; static const char *usb_hcd_version = "$Revision: 1.9 $";
#undef KERN_DEBUG #undef KERN_DEBUG
#define KERN_DEBUG "" #define KERN_DEBUG ""
...@@ -2034,21 +2035,21 @@ static int etrax_rh_submit_urb(urb_t *urb) ...@@ -2034,21 +2035,21 @@ static int etrax_rh_submit_urb(urb_t *urb)
OK (4); /* hub power ** */ OK (4); /* hub power ** */
case RH_GET_STATUS | RH_OTHER | RH_CLASS: case RH_GET_STATUS | RH_OTHER | RH_CLASS:
if (wIndex == 1) { if (wIndex == 1) {
*((__u16*)data) = cpu_to_le16(hc->rh.prev_wPortStatus_1); *((__u16*)data) = cpu_to_le16(hc->rh.prev_wPortStatus_1);
*((__u16*)data + 1) = cpu_to_le16(hc->rh.wPortChange_1); *((__u16*)data + 1) = cpu_to_le16(hc->rh.wPortChange_1);
} }
else if (wIndex == 2) { else if (wIndex == 2) {
*((__u16*)data) = cpu_to_le16(hc->rh.prev_wPortStatus_2); *((__u16*)data) = cpu_to_le16(hc->rh.prev_wPortStatus_2);
*((__u16*)data + 1) = cpu_to_le16(hc->rh.wPortChange_2); *((__u16*)data + 1) = cpu_to_le16(hc->rh.wPortChange_2);
} }
else { else {
dbg_rh("RH_GET_STATUS whith invalid wIndex !!"); dbg_rh("RH_GET_STATUS whith invalid wIndex !!");
OK(0); OK(0);
} }
OK(4); OK(4);
case RH_CLEAR_FEATURE | RH_ENDPOINT: case RH_CLEAR_FEATURE | RH_ENDPOINT:
switch (wValue) { switch (wValue) {
case (RH_ENDPOINT_STALL): case (RH_ENDPOINT_STALL):
...@@ -2114,16 +2115,16 @@ static int etrax_rh_submit_urb(urb_t *urb) ...@@ -2114,16 +2115,16 @@ static int etrax_rh_submit_urb(urb_t *urb)
OK (0); /* port power ** */ OK (0); /* port power ** */
case (RH_C_PORT_CONNECTION): case (RH_C_PORT_CONNECTION):
if (wIndex == 1) { if (wIndex == 1) {
hc->rh.wPortChange_1 &= ~(1 << RH_PORT_CONNECTION); hc->rh.wPortChange_1 &= ~(1 << RH_PORT_CONNECTION);
} }
else if (wIndex == 2) { else if (wIndex == 2) {
hc->rh.wPortChange_2 &= ~(1 << RH_PORT_CONNECTION); hc->rh.wPortChange_2 &= ~(1 << RH_PORT_CONNECTION);
} }
else { else {
dbg_rh("RH_CLEAR_FEATURE->RH_C_PORT_CONNECTION " dbg_rh("RH_CLEAR_FEATURE->RH_C_PORT_CONNECTION "
"with invalid wIndex == %d!!", wIndex); "with invalid wIndex == %d!!", wIndex);
} }
OK (0); OK (0);
case (RH_C_PORT_ENABLE): case (RH_C_PORT_ENABLE):
...@@ -2182,7 +2183,7 @@ static int etrax_rh_submit_urb(urb_t *urb) ...@@ -2182,7 +2183,7 @@ static int etrax_rh_submit_urb(urb_t *urb)
OK (0); OK (0);
case (RH_PORT_RESET): case (RH_PORT_RESET):
if (wIndex == 1) { if (wIndex == 1) {
int port1_retry; int port1_retry;
port1_redo: port1_redo:
...@@ -2205,8 +2206,8 @@ static int etrax_rh_submit_urb(urb_t *urb) ...@@ -2205,8 +2206,8 @@ static int etrax_rh_submit_urb(urb_t *urb)
not even schedule() works !!! WHY ?? */ not even schedule() works !!! WHY ?? */
udelay(15000); udelay(15000);
} }
else if (wIndex == 2) { else if (wIndex == 2) {
int port2_retry; int port2_retry;
port2_redo: port2_redo:
...@@ -2229,7 +2230,7 @@ static int etrax_rh_submit_urb(urb_t *urb) ...@@ -2229,7 +2230,7 @@ static int etrax_rh_submit_urb(urb_t *urb)
not even schedule() works !!! WHY ?? */ not even schedule() works !!! WHY ?? */
udelay(15000); udelay(15000);
} }
/* Try to bring the HC into running state */ /* Try to bring the HC into running state */
*R_USB_COMMAND = *R_USB_COMMAND =
...@@ -2237,21 +2238,21 @@ static int etrax_rh_submit_urb(urb_t *urb) ...@@ -2237,21 +2238,21 @@ static int etrax_rh_submit_urb(urb_t *urb)
nop(); while (*R_USB_COMMAND & IO_MASK(R_USB_COMMAND, busy)); nop(); while (*R_USB_COMMAND & IO_MASK(R_USB_COMMAND, busy));
dbg_rh("...Done"); dbg_rh("...Done");
OK(0); OK(0);
case (RH_PORT_POWER): case (RH_PORT_POWER):
OK (0); /* port power ** */ OK (0); /* port power ** */
case (RH_PORT_ENABLE): case (RH_PORT_ENABLE):
/* There is no rh port enable command in the Etrax USB interface!!!! */ /* There is no rh port enable command in the Etrax USB interface!!!! */
OK (0); OK (0);
} }
break; break;
case RH_SET_ADDRESS: case RH_SET_ADDRESS:
hc->rh.devnum = wValue; hc->rh.devnum = wValue;
dbg_rh("RH address set to: %d", hc->rh.devnum); dbg_rh("RH address set to: %d", hc->rh.devnum);
OK (0); OK (0);
case RH_GET_DESCRIPTOR: case RH_GET_DESCRIPTOR:
...@@ -2324,7 +2325,7 @@ static int __init etrax_usb_hc_init(void) ...@@ -2324,7 +2325,7 @@ static int __init etrax_usb_hc_init(void)
etrax_usb_bus = bus = usb_alloc_bus(&etrax_usb_device_operations); etrax_usb_bus = bus = usb_alloc_bus(&etrax_usb_device_operations);
hc->bus = bus; hc->bus = bus;
bus->hcpriv = hc; bus->hcpriv = hc;
/* Initalize RH to the default address. /* Initalize RH to the default address.
And make sure that we have no status change indication */ And make sure that we have no status change indication */
hc->rh.numports = 2; /* The RH has two ports */ hc->rh.numports = 2; /* The RH has two ports */
...@@ -2339,7 +2340,7 @@ static int __init etrax_usb_hc_init(void) ...@@ -2339,7 +2340,7 @@ static int __init etrax_usb_hc_init(void)
/* Initialize the intr-traffic flags */ /* Initialize the intr-traffic flags */
hc->intr.sleeping = 0; hc->intr.sleeping = 0;
hc->intr.wq = NULL; hc->intr.wq = NULL;
/* Initially all ep's are free except ep 0 */ /* Initially all ep's are free except ep 0 */
ep_usage_bitmask = 0; ep_usage_bitmask = 0;
set_bit(0, (void *)&ep_usage_bitmask); set_bit(0, (void *)&ep_usage_bitmask);
...@@ -2349,20 +2350,20 @@ static int __init etrax_usb_hc_init(void) ...@@ -2349,20 +2350,20 @@ static int __init etrax_usb_hc_init(void)
/* This code should really be moved */ /* This code should really be moved */
if (request_dma(8, "ETRAX 100LX built-in USB (Tx)")) { if (request_dma(USB_TX_DMA_NBR, "ETRAX 100LX built-in USB (Tx)")) {
err("Could not allocate DMA ch 8 for USB"); err("Could not allocate DMA ch 8 for USB");
etrax_usb_hc_cleanup(); etrax_usb_hc_cleanup();
DBFEXIT; DBFEXIT;
return -1; return -1;
} }
if (request_dma(9, "ETRAX 100LX built-in USB (Rx)")) { if (request_dma(USB_RX_DMA_NBR, "ETRAX 100LX built-in USB (Rx)")) {
err("Could not allocate DMA ch 9 for USB"); err("Could not allocate DMA ch 9 for USB");
etrax_usb_hc_cleanup(); etrax_usb_hc_cleanup();
DBFEXIT; DBFEXIT;
return -1; return -1;
} }
#if 0 /* Moved to head.S */ #if 0 /* Moved to head.S */
*R_GEN_CONFIG = genconfig_shadow = *R_GEN_CONFIG = genconfig_shadow =
(genconfig_shadow & ~(IO_MASK(R_GEN_CONFIG, usb1) | (genconfig_shadow & ~(IO_MASK(R_GEN_CONFIG, usb1) |
IO_MASK(R_GEN_CONFIG, usb2) | IO_MASK(R_GEN_CONFIG, usb2) |
...@@ -2490,8 +2491,8 @@ static void etrax_usb_hc_cleanup(void) ...@@ -2490,8 +2491,8 @@ static void etrax_usb_hc_cleanup(void)
free_irq(ETRAX_USB_RX_IRQ, NULL); free_irq(ETRAX_USB_RX_IRQ, NULL);
free_irq(ETRAX_USB_TX_IRQ, NULL); free_irq(ETRAX_USB_TX_IRQ, NULL);
free_dma(8); free_dma(USB_TX_DMA_NBR);
free_dma(9); free_dma(USB_RX_DMA_NBR);
usb_deregister_bus(etrax_usb_bus); usb_deregister_bus(etrax_usb_bus);
DBFEXIT; DBFEXIT;
......
# $Id: Makefile,v 1.4 2001/04/17 13:58:39 orjanf Exp $ # $Id: Makefile,v 1.5 2001/05/15 05:10:00 hp Exp $
# #
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
...@@ -20,6 +20,11 @@ obj-y := process.o signal.o entry.o traps.o irq.o \ ...@@ -20,6 +20,11 @@ obj-y := process.o signal.o entry.o traps.o irq.o \
obj-$(CONFIG_ETRAX_KGDB) += kgdb.o obj-$(CONFIG_ETRAX_KGDB) += kgdb.o
entry.o: entryoffsets.s
entryoffsets.s: entryoffsets.c
$(CC) $(CFLAGS) -S -c $<
clean: clean:
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
/* $Id: entry.S,v 1.22 2001/04/17 13:58:39 orjanf Exp $ /* $Id: entry.S,v 1.27 2001/05/29 11:25:27 markusl Exp $
* *
* linux/arch/cris/entry.S * linux/arch/cris/entry.S
* *
...@@ -7,6 +7,21 @@ ...@@ -7,6 +7,21 @@
* Authors: Bjorn Wesen (bjornw@axis.com) * Authors: Bjorn Wesen (bjornw@axis.com)
* *
* $Log: entry.S,v $ * $Log: entry.S,v $
* Revision 1.27 2001/05/29 11:25:27 markusl
* In case of "spurious_interrupt", do hard_reset instead of hanging system in a loop...
*
* Revision 1.26 2001/05/15 15:46:03 bjornw
* Include config.h now that we use some CONFIG_ options
*
* Revision 1.25 2001/05/15 05:38:47 hp
* Tweaked code in _ret_from_sys_call
*
* Revision 1.24 2001/05/15 05:27:49 hp
* Save r9 in r1 over function call rather than on stack.
*
* Revision 1.23 2001/05/15 05:10:00 hp
* Generate entry.S structure offsets from C
*
* Revision 1.22 2001/04/17 13:58:39 orjanf * Revision 1.22 2001/04/17 13:58:39 orjanf
* * Renamed CONFIG_KGDB to CONFIG_ETRAX_KGDB. * * Renamed CONFIG_KGDB to CONFIG_ETRAX_KGDB.
* *
...@@ -140,39 +155,21 @@ ...@@ -140,39 +155,21 @@
LENOSYS = 38 LENOSYS = 38
;; offsets into the task_struct (found at sp aligned to THREAD_SIZE, 8192) ;; Get offsets into various structs.
;; linux/sched.h .include "entryoffsets.s"
LTASK_SIGPENDING = 8
LTASK_NEEDRESCHED = 20
LTASK_PTRACE = 24
LTASK_PID = 105
;; process bits for ptrace ;; process bits for ptrace. FIXME: Should be in a header file.
PT_TRACESYS_BIT = 1 PT_TRACESYS_BIT = 1
;; some pt_regs offsets (from ptrace.h)
LORIG_R10 = 4
LR13 = 8
LR12 = 12
LR11 = 16
LR10 = 20
LR9 = 24
LMOF = 64
LDCCR = 68
LSRP = 72
LIRP = 76
;; below are various parts of system_call which are not in the fast-path ;; below are various parts of system_call which are not in the fast-path
;; handle software irqs ;; handle software irqs
handle_softirq: handle_softirq:
push r9 move.d r9,r1
jsr _do_softirq ; call the C routine for softirq handling jsr _do_softirq ; call the C routine for softirq handling
pop r9 move.d r1,r9
;; fall-through ;; fall-through
...@@ -188,11 +185,10 @@ _ret_from_intr: ...@@ -188,11 +185,10 @@ _ret_from_intr:
reschedule: reschedule:
;; keep r9 intact ;; keep r9 intact
push r9 move.d r9,r1
jsr _schedule jsr _schedule
pop r9
ba _ret_from_sys_call ba _ret_from_sys_call
nop move.d r1,r9
;; return but call do_signal first ;; return but call do_signal first
signal_return: signal_return:
...@@ -275,8 +271,9 @@ _ret_from_sys_call: ...@@ -275,8 +271,9 @@ _ret_from_sys_call:
;; check if any bottom halves need service ;; check if any bottom halves need service
move.d [_irq_stat],r0 ; softirq_active move.d _irq_stat,r10
and.d [_irq_stat+4],r0 ; softirq_mask move.d [r10+],r0 ; softirq_active
and.d [r10],r0 ; softirq_mask
bne handle_softirq bne handle_softirq
nop nop
...@@ -378,12 +375,6 @@ tracesys: ...@@ -378,12 +375,6 @@ tracesys:
ba _ret_from_sys_call ba _ret_from_sys_call
nop nop
;; from asm/processor.h, the thread_struct
LTHREAD_KSP = 0
LTHREAD_USP = 4
LTHREAD_DCCR = 8
;; _resume performs the actual task-switching, by switching stack pointers ;; _resume performs the actual task-switching, by switching stack pointers
;; input arguments: r10 = prev, r11 = next, r12 = thread offset in task struct ;; input arguments: r10 = prev, r11 = next, r12 = thread offset in task struct
;; returns old current in r10 ;; returns old current in r10
...@@ -495,7 +486,7 @@ nobp: pop r11 ...@@ -495,7 +486,7 @@ nobp: pop r11
_IRQ1_interrupt: _IRQ1_interrupt:
_spurious_interrupt: _spurious_interrupt:
di di
basse2: ba basse2 jsr _hard_reset_now
nop nop
;; this handles the case when multiple interrupts arrive at the same time ;; this handles the case when multiple interrupts arrive at the same time
......
/* linux/arch/cris/entryoffsets.c
*
* Copyright (C) 2001 Axis Communications AB
*
* Generate structure offsets for use in entry.S. No extra processing
* needed more than compiling this file to assembly code. Horrendous
* assembly code will be generated, so don't look at that.
*
* Authors: Hans-Peter Nilsson (hp@axis.com)
*/
/* There can be string constants fallout from inline functions, so we'd
better make sure we don't assemble anything emitted from inclusions. */
__asm__ (".if 0");
#include <linux/sched.h>
#include <linux/ptrace.h>
#include <asm/processor.h>
/* Exclude everything except the assembly by wrapping it in ".if 0". */
#undef OF
#define OF(NAME, TYPE, MEMBER) \
void NAME ## _fun (void) \
{ \
__asm__ (".endif \n" \
#NAME " = %0 \n" \
".if 0\n" \
: : "i" (offsetof (TYPE, MEMBER))); \
}
/* task_struct offsets. */
OF (LTASK_SIGPENDING, struct task_struct, sigpending)
OF (LTASK_NEEDRESCHED, struct task_struct, need_resched)
OF (LTASK_PTRACE, struct task_struct, ptrace)
OF (LTASK_PID, struct task_struct, pid)
/* pt_regs offsets. */
OF (LORIG_R10, struct pt_regs, orig_r10)
OF (LR13, struct pt_regs, r13)
OF (LR12, struct pt_regs, r12)
OF (LR11, struct pt_regs, r11)
OF (LR10, struct pt_regs, r10)
OF (LR9, struct pt_regs, r9)
OF (LMOF, struct pt_regs, mof)
OF (LDCCR, struct pt_regs, dccr)
OF (LSRP, struct pt_regs, srp)
OF (LIRP, struct pt_regs, irp)
/* thread_struct offsets. */
OF (LTHREAD_KSP, struct thread_struct, ksp)
OF (LTHREAD_USP, struct thread_struct, usp)
OF (LTHREAD_DCCR, struct thread_struct, dccr)
__asm__ (".endif");
/* $Id: head.S,v 1.29 2001/04/18 12:51:59 orjanf Exp $ /* $Id: head.S,v 1.34 2001/05/15 07:08:14 hp Exp $
* *
* Head of the kernel - alter with care * Head of the kernel - alter with care
* *
...@@ -7,6 +7,21 @@ ...@@ -7,6 +7,21 @@
* Authors: Bjorn Wesen (bjornw@axis.com) * Authors: Bjorn Wesen (bjornw@axis.com)
* *
* $Log: head.S,v $ * $Log: head.S,v $
* Revision 1.34 2001/05/15 07:08:14 hp
* Tweak "notice" to reflect that both r8 r9 are used
*
* Revision 1.33 2001/05/15 06:40:05 hp
* Put bulk of code in .text.init, data in .data.init
*
* Revision 1.32 2001/05/15 06:18:56 hp
* Execute review comment: s/bcc/bhs/g; s/bcs/blo/g
*
* Revision 1.31 2001/05/15 06:08:40 hp
* Add sentence about autodetecting the bit31-MMU-bug
*
* Revision 1.30 2001/05/15 06:00:05 hp
* Update comment: LOW_MAP is not forced on xsim anymore.
*
* Revision 1.29 2001/04/18 12:51:59 orjanf * Revision 1.29 2001/04/18 12:51:59 orjanf
* * Reverted review change regarding the use of bcs/bcc. * * Reverted review change regarding the use of bcs/bcc.
* * Removed non-working LED-clearing code. * * Removed non-working LED-clearing code.
...@@ -127,9 +142,9 @@ ...@@ -127,9 +142,9 @@
;; since etrax actually starts at address 2 when booting from flash, we ;; since etrax actually starts at address 2 when booting from flash, we
;; put a nop (2 bytes) here first so we dont accidentally skip the di ;; put a nop (2 bytes) here first so we dont accidentally skip the di
;; ;;
;; NOTICE! The registers r8 and r9 are used as a parameter carrying ;; NOTICE! The registers r8 and r9 are used as parameters carrying
;; 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 until it is read. ;; They should not be used in the code below until read.
nop nop
di di
...@@ -143,8 +158,11 @@ ...@@ -143,8 +158,11 @@
;; temporarily map those segments linearily. ;; temporarily map those segments linearily.
;; ;;
;; Due to a bug in Etrax-100 LX version 1 we need to map the memory ;; Due to a bug in Etrax-100 LX version 1 we need to map the memory
;; slightly different. We also let the simulator get this mapping for now. ;; slightly different. The bug is that you can't remap bit 31 of
;; (The bug is that you can't remap bit 31.) ;; an address. Though we can check the version register for
;; whether the bug is present, some constants would then have to
;; be variables, so we don't. The drawback is that you can "only" map
;; 1G per process with CONFIG_CRIS_LOW_MAP.
#ifdef CONFIG_CRIS_LOW_MAP #ifdef CONFIG_CRIS_LOW_MAP
move.d 0x0004b098, r0 ; kseg mappings, temporary map of 0xc0->0x40 move.d 0x0004b098, r0 ; kseg mappings, temporary map of 0xc0->0x40
...@@ -190,11 +208,18 @@ ...@@ -190,11 +208,18 @@
move.d pc,r0 move.d pc,r0
and.d 0x7fffffff,r0 ; get rid of the non-cache bit and.d 0x7fffffff,r0 ; get rid of the non-cache bit
cmp.d 0x10000,r0 ; arbitrary... just something above this code cmp.d 0x10000,r0 ; arbitrary... just something above this code
bcs inflash blo inflash0
nop nop
jump inram ; enter cached ram jump inram ; enter cached ram
;; Jumpgate for branches.
inflash0:
jump inflash
;; Put this in a suitable section where we can reclaim storage
;; after init.
.section ".text.init"
inflash: inflash:
;; We need to initialze DRAM registers before we start using the DRAM ;; We need to initialze DRAM registers before we start using the DRAM
...@@ -225,7 +250,7 @@ dram_init_finished: ...@@ -225,7 +250,7 @@ dram_init_finished:
1: move.w [r0+], r3 1: move.w [r0+], r3
move.w r3, [r1+] move.w r3, [r1+]
cmp.d r2, r1 cmp.d r2, r1
bcs 1b blo 1b
nop nop
;; We keep the cramfs in the flash. ;; We keep the cramfs in the flash.
...@@ -271,7 +296,7 @@ inram: ...@@ -271,7 +296,7 @@ inram:
;; to a cramfs magic is small.. ) ;; to a cramfs magic is small.. )
cmp.d 0x0ffffff8, r9 cmp.d 0x0ffffff8, r9
bcc no_romfs_in_flash ; r9 points outside the flash area bhs no_romfs_in_flash ; r9 points outside the flash area
nop nop
move.d [r9], r0 ; cramfs_super.magic move.d [r9], r0 ; cramfs_super.magic
cmp.d CRAMFS_MAGIC, r0 cmp.d CRAMFS_MAGIC, r0
...@@ -353,7 +378,7 @@ start_it: ...@@ -353,7 +378,7 @@ start_it:
move.d _end, r1 move.d _end, r1
1: clear.d [r0+] 1: clear.d [r0+]
cmp.d r1, r0 cmp.d r1, r0
bcs 1b blo 1b
nop nop
#ifdef CONFIG_BLK_DEV_ETRAXIDE #ifdef CONFIG_BLK_DEV_ETRAXIDE
...@@ -575,5 +600,6 @@ _swapper_pg_dir = 0x60002000 ...@@ -575,5 +600,6 @@ _swapper_pg_dir = 0x60002000
#else #else
_swapper_pg_dir = 0xc0002000 _swapper_pg_dir = 0xc0002000
#endif #endif
.section ".data.init"
#include "../lib/hw_settings.S" #include "../lib/hw_settings.S"
/* $Id: irq.c,v 1.14 2001/04/17 13:58:39 orjanf Exp $ /* $Id: irq.c,v 1.15 2001/06/10 11:18:46 bjornw Exp $
* *
* linux/arch/cris/kernel/irq.c * linux/arch/cris/kernel/irq.c
* *
...@@ -485,3 +485,10 @@ void init_IRQ(void) ...@@ -485,3 +485,10 @@ void init_IRQ(void)
#endif #endif
} }
#if defined(CONFIG_PROC_FS) && defined(CONFIG_SYSCTL)
/* Used by other archs to show/control IRQ steering during SMP */
void init_irq_proc(void)
{
}
#endif
/* $Id: process.c,v 1.13 2001/03/20 19:44:06 bjornw Exp $ /* $Id: process.c,v 1.14 2001/05/29 11:27:59 markusl Exp $
* *
* linux/arch/cris/kernel/process.c * linux/arch/cris/kernel/process.c
* *
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
* Authors: Bjorn Wesen (bjornw@axis.com) * Authors: Bjorn Wesen (bjornw@axis.com)
* *
* $Log: process.c,v $ * $Log: process.c,v $
* Revision 1.14 2001/05/29 11:27:59 markusl
* Fixed so that hard_reset_now will do reset even if watchdog wasn't enabled
*
* Revision 1.13 2001/03/20 19:44:06 bjornw * Revision 1.13 2001/03/20 19:44:06 bjornw
* Use the 7th syscall argument for regs instead of current_regs * Use the 7th syscall argument for regs instead of current_regs
* *
...@@ -90,12 +93,21 @@ int cpu_idle(void *unused) ...@@ -90,12 +93,21 @@ int cpu_idle(void *unused)
/* if the watchdog is enabled, we can simply disable interrupts and go /* if the watchdog is enabled, we can simply disable interrupts and go
* into an eternal loop, and the watchdog will reset the CPU after 0.1s * into an eternal loop, and the watchdog will reset the CPU after 0.1s
* if on the other hand the watchdog wasn't enabled, we just enable it and wait
*/ */
void hard_reset_now (void) void hard_reset_now (void)
{ {
printk("*** HARD RESET ***\n"); printk("*** HARD RESET ***\n");
cli(); cli();
#ifndef CONFIG_ETRAX_WATCHDOG
/* Since we dont plan to keep on reseting the watchdog,
the key can be arbitrary hence three */
*R_WATCHDOG = IO_FIELD(R_WATCHDOG, key, 3) |
IO_STATE(R_WATCHDOG, enable, start);
#endif
while(1) /* waiting for RETRIBUTION! */ ; while(1) /* waiting for RETRIBUTION! */ ;
} }
......
/* $Id: setup.c,v 1.14 2001/04/03 12:54:12 starvik Exp $ /* $Id: setup.c,v 1.16 2001/05/15 01:23:13 hp Exp $
* *
* linux/arch/cris/kernel/setup.c * linux/arch/cris/kernel/setup.c
* *
...@@ -190,14 +190,10 @@ static struct cpu_info { ...@@ -190,14 +190,10 @@ static struct cpu_info {
unsigned short cache; unsigned short cache;
unsigned short flags; unsigned short flags;
} cpu_info[] = { } cpu_info[] = {
/* The first four models will never ever run this code and are
only here for display. */
{ "ETRAX 1", 0, 0 }, { "ETRAX 1", 0, 0 },
{ "ETRAX 2", 0, 0 }, /* Don't say it HAS_TOKENRING - there are { "ETRAX 2", 0, 0 },
lethal bugs in that chip that
prevents T-R from ever working.
Never go there, and never lead anyone
into believing it can work. BTW:
Anyone working on a T-R network
driver? :-) :-) :-) :-/ */
{ "ETRAX 3", 0, HAS_TOKENRING }, { "ETRAX 3", 0, HAS_TOKENRING },
{ "ETRAX 4", 0, HAS_TOKENRING | HAS_SCSI }, { "ETRAX 4", 0, HAS_TOKENRING | HAS_SCSI },
{ "Unknown", 0, 0 }, { "Unknown", 0, 0 },
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* Ideas also taken from arch/arm. * Ideas also taken from arch/arm.
* *
* Copyright (C) 2000 Axis Communications AB * Copyright (C) 2000, 2001 Axis Communications AB
* *
* Authors: Bjorn Wesen (bjornw@axis.com) * Authors: Bjorn Wesen (bjornw@axis.com)
* *
...@@ -101,7 +101,14 @@ sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof, ...@@ -101,7 +101,14 @@ sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof,
current->state = TASK_INTERRUPTIBLE; current->state = TASK_INTERRUPTIBLE;
schedule(); schedule();
if (do_signal(0, &saveset, regs)) if (do_signal(0, &saveset, regs))
return -EINTR; /* We will get here twice: once to call the signal
handler, then again to return from the
sigsuspend system call. When calling the
signal handler, R10 holds the signal number as
set through do_signal. The sigsuspend call
will return with the restored value set above;
always -EINTR. */
return regs->r10;
} }
} }
...@@ -133,7 +140,14 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, long r12, long r13, ...@@ -133,7 +140,14 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, long r12, long r13,
current->state = TASK_INTERRUPTIBLE; current->state = TASK_INTERRUPTIBLE;
schedule(); schedule();
if (do_signal(0, &saveset, regs)) if (do_signal(0, &saveset, regs))
return -EINTR; /* We will get here twice: once to call the signal
handler, then again to return from the
sigsuspend system call. When calling the
signal handler, R10 holds the signal number as
set through do_signal. The sigsuspend call
will return with the restored value set above;
always -EINTR. */
return regs->r10;
} }
} }
...@@ -413,6 +427,7 @@ static void setup_frame(int sig, struct k_sigaction *ka, ...@@ -413,6 +427,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
regs->irp = (unsigned long) ka->sa.sa_handler; /* what we enter NOW */ regs->irp = (unsigned long) ka->sa.sa_handler; /* what we enter NOW */
regs->srp = return_ip; /* what we enter LATER */ regs->srp = return_ip; /* what we enter LATER */
regs->r10 = sig; /* first argument is signo */
/* actually move the usp to reflect the stacked frame */ /* actually move the usp to reflect the stacked frame */
...@@ -462,7 +477,6 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -462,7 +477,6 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
/* trampoline - the desired return ip is the retcode itself */ /* trampoline - the desired return ip is the retcode itself */
return_ip = (unsigned long)&frame->retcode; return_ip = (unsigned long)&frame->retcode;
/* This is movu.w __NR_sigreturn, r9; break 13; */ /* This is movu.w __NR_sigreturn, r9; break 13; */
/* TODO: check byteorder */
err |= __put_user(0x9c5f, (short *)(frame->retcode+0)); err |= __put_user(0x9c5f, (short *)(frame->retcode+0));
err |= __put_user(__NR_sigreturn, (short *)(frame->retcode+2)); err |= __put_user(__NR_sigreturn, (short *)(frame->retcode+2));
err |= __put_user(0xe93d, (short *)(frame->retcode+4)); err |= __put_user(0xe93d, (short *)(frame->retcode+4));
...@@ -477,6 +491,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -477,6 +491,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
regs->irp = (unsigned long) ka->sa.sa_handler; /* what we enter NOW */ regs->irp = (unsigned long) ka->sa.sa_handler; /* what we enter NOW */
regs->srp = return_ip; /* what we enter LATER */ regs->srp = return_ip; /* what we enter LATER */
regs->r10 = sig; /* first argument is signo */
/* actually move the usp to reflect the stacked frame */ /* actually move the usp to reflect the stacked frame */
......
/* $Id: sys_cris.c,v 1.7 2001/04/17 11:52:15 orjanf Exp $ /* $Id: sys_cris.c,v 1.9 2001/05/30 06:20:26 markusl Exp $
* *
* linux/arch/cris/kernel/sys_cris.c * linux/arch/cris/kernel/sys_cris.c
* *
......
/* $Id: time.c,v 1.4 2000/10/17 14:44:58 bjornw Exp $ /* $Id: time.c,v 1.6 2001/05/29 11:29:42 markusl Exp $
* *
* linux/arch/cris/kernel/time.c * linux/arch/cris/kernel/time.c
* *
...@@ -83,12 +83,9 @@ static unsigned long do_slow_gettimeoffset(void) ...@@ -83,12 +83,9 @@ static unsigned long do_slow_gettimeoffset(void)
* avoiding timer inconsistencies (they are rare, but they happen)... * avoiding timer inconsistencies (they are rare, but they happen)...
* there are three kinds of problems that must be avoided here: * there are three kinds of problems that must be avoided here:
* 1. the timer counter underflows * 1. the timer counter underflows
* 2. hardware problem with the timer, not giving us continuous time, * 2. we are after the timer interrupt, but the bottom half handler
* the counter does small "jumps" upwards on some Pentium systems,
* thus causes time warps
* 3. we are after the timer interrupt, but the bottom half handler
* hasn't executed yet. * hasn't executed yet.
*/ */
if( jiffies_t == jiffies_p ) { if( jiffies_t == jiffies_p ) {
if( count > count_p ) { if( count > count_p ) {
} }
...@@ -195,7 +192,7 @@ static int set_rtc_mmss(unsigned long nowtime) ...@@ -195,7 +192,7 @@ static int set_rtc_mmss(unsigned long nowtime)
return retval; return retval;
} }
/* Except from the Etrax100 HSDD about the built-in watchdog: /* Excerpt from the Etrax100 HSDD about the built-in watchdog:
* *
* 3.10.4 Watchdog timer * 3.10.4 Watchdog timer
...@@ -231,14 +228,12 @@ static int watchdog_key = 0; /* arbitrary number */ ...@@ -231,14 +228,12 @@ static int watchdog_key = 0; /* arbitrary number */
#define WATCHDOG_MIN_FREE_PAGES 8 #define WATCHDOG_MIN_FREE_PAGES 8
extern int nr_free_pages;
static inline void static inline void
reset_watchdog(void) reset_watchdog(void)
{ {
#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
/* 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 */
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) |
......
/* $Id: traps.c,v 1.11 2001/04/04 09:43:31 orjanf Exp $ /* $Id: traps.c,v 1.12 2001/05/15 15:46:40 bjornw Exp $
* *
* linux/arch/cris/traps.c * linux/arch/cris/traps.c
* *
......
/* $Id: checksum.S,v 1.4 2001/02/19 11:11:33 bjornw Exp $ /* $Id: checksum.S,v 1.5 2001/05/29 11:40:14 markusl Exp $
* A fast checksum routine using movem * A fast checksum routine using movem
* Copyright (c) 1998-2001 Axis Communications AB * Copyright (c) 1998-2001 Axis Communications AB
* *
...@@ -13,6 +13,8 @@ _csum_partial: ...@@ -13,6 +13,8 @@ _csum_partial:
;; r12 - checksum ;; r12 - checksum
;; check for breakeven length between movem and normal word looping versions ;; check for breakeven length between movem and normal word looping versions
;; we also do _NOT_ want to compute a checksum over more than the
;; actual length when length < 40
cmpu.w 80,r11 cmpu.w 80,r11
blo word_loop blo word_loop
...@@ -20,6 +22,8 @@ _csum_partial: ...@@ -20,6 +22,8 @@ _csum_partial:
;; need to save the registers we use below in the movem loop ;; need to save the registers we use below in the movem loop
;; this overhead is why we have a check above for breakeven length ;; this overhead is why we have a check above for breakeven length
;; only r0 - r8 have to be saved, the other ones are clobber-able
;; according to the ABI
subq 9*4,sp subq 9*4,sp
movem r8,[sp] movem r8,[sp]
......
/* $Id: checksumcopy.S,v 1.4 2001/02/19 11:11:34 bjornw Exp $ /* $Id: checksumcopy.S,v 1.5 2001/05/29 11:40:14 markusl Exp $
* A fast checksum+copy routine using movem * A fast checksum+copy routine using movem
* Copyright (c) 1998, 2001 Axis Communications AB * Copyright (c) 1998, 2001 Axis Communications AB
* *
...@@ -17,6 +17,8 @@ _csum_partial_copy_nocheck: ...@@ -17,6 +17,8 @@ _csum_partial_copy_nocheck:
;; r13 - checksum ;; r13 - checksum
;; check for breakeven length between movem and normal word looping versions ;; check for breakeven length between movem and normal word looping versions
;; we also do _NOT_ want to compute a checksum over more than the
;; actual length when length < 40
cmpu.w 80,r12 cmpu.w 80,r12
blo word_loop blo word_loop
...@@ -24,6 +26,8 @@ _csum_partial_copy_nocheck: ...@@ -24,6 +26,8 @@ _csum_partial_copy_nocheck:
;; need to save the registers we use below in the movem loop ;; need to save the registers we use below in the movem loop
;; this overhead is why we have a check above for breakeven length ;; this overhead is why we have a check above for breakeven length
;; only r0 - r8 have to be saved, the other ones are clobber-able
;; according to the ABI
subq 9*4,sp subq 9*4,sp
movem r8,[sp] movem r8,[sp]
......
/* $Id: dram_init.S,v 1.7 2001/04/18 12:05:39 bjornw Exp $ /* $Id: dram_init.S,v 1.8 2001/05/15 07:12:45 hp Exp $
* *
* DRAM/SDRAM initialization - alter with care * DRAM/SDRAM initialization - alter with care
* This file is intended to be included from other assembler files * This file is intended to be included from other assembler files
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
* Authors: Mikael Starvik (starvik@axis.com) * Authors: Mikael Starvik (starvik@axis.com)
* *
* $Log: dram_init.S,v $ * $Log: dram_init.S,v $
* Revision 1.8 2001/05/15 07:12:45 hp
* Copy warning from head.S about r8 and r9
*
* Revision 1.7 2001/04/18 12:05:39 bjornw * Revision 1.7 2001/04/18 12:05:39 bjornw
* Fixed comments, and explicitely include config.h to be sure its there * Fixed comments, and explicitely include config.h to be sure its there
* *
...@@ -44,6 +47,9 @@ ...@@ -44,6 +47,9 @@
#include <linux/config.h> #include <linux/config.h>
;; WARNING! The registers r8 and r9 are used as parameters carrying
;; information from the decompressor (if the kernel was compressed).
;; They should not be used in the code below.
#ifndef CONFIG_SVINTO_SIM #ifndef CONFIG_SVINTO_SIM
move.d CONFIG_ETRAX_DEF_R_WAITSTATES, r0 move.d CONFIG_ETRAX_DEF_R_WAITSTATES, r0
......
;; $Id: hw_settings.S,v 1.2 2001/04/03 11:11:09 starvik Exp $ /*
;; * $Id: hw_settings.S,v 1.3 2001/04/21 17:02:46 bjornw Exp $
;; This table is used by some tools to extract hardware parameters. *
;; The table should be included in the kernel and the decompressor. * This table is used by some tools to extract hardware parameters.
;; Don't forget to update the tools if you change this table. * The table should be included in the kernel and the decompressor.
;; * Don't forget to update the tools if you change this table.
;; Copyright (C) 2001 Axis Communications AB *
;; * Copyright (C) 2001 Axis Communications AB
;; Authors: Mikael Starvik (starvik@axis.com) *
* Authors: Mikael Starvik (starvik@axis.com)
*/
#define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \ #define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \
(CONFIG_ETRAX_DEF_R_PORT_PA_DATA)) (CONFIG_ETRAX_DEF_R_PORT_PA_DATA))
#define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \ #define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \
......
...@@ -273,20 +273,27 @@ __copy_user_zeroing (void *pdst, const void *psrc, unsigned long pn) ...@@ -273,20 +273,27 @@ __copy_user_zeroing (void *pdst, const void *psrc, unsigned long pn)
movem r10,[r13+] movem r10,[r13+]
addq 44,r12 ;; compensate for last loop underflowing n addq 44,r12 ;; compensate for last loop underflowing n
8:
;; Restore registers from stack ;; Restore registers from stack
movem [sp+],r10 movem [sp+],r10
.section .fixup,\"ax\" .section .fixup,\"ax\"
; To provide a correct count in r10 of bytes that failed to be copied, ;; Do not jump back into the loop if we fail. For some uses, we get a
; we jump back into the loop if the loop-branch was taken. ;; page fault but for performance reasons we care to not get further
; There is no performance penalty; the program will segfault soon ;; faults. For example, fs/super.c at one time did
; enough. ;; i = size - copy_from_user((void *)page, data, size);
;; which would cause repeated faults while clearing the remainder of
;; the SIZE bytes at PAGE after the first fault.
3: 3:
move.d [sp],r10 move.d [sp],r10
;; Number of remaining bytes, cleared but not copied, is r12 + 44.
add.d r12,r10
addq 44,r10 addq 44,r10
move.d r10,[sp] move.d r10,[sp]
clear.d r0 clear.d r0
clear.d r1 clear.d r1
...@@ -299,7 +306,40 @@ __copy_user_zeroing (void *pdst, const void *psrc, unsigned long pn) ...@@ -299,7 +306,40 @@ __copy_user_zeroing (void *pdst, const void *psrc, unsigned long pn)
clear.d r8 clear.d r8
clear.d r9 clear.d r9
clear.d r10 clear.d r10
jump 1b
;; Perform clear similar to the copy-loop.
4:
subq 44,r12
bge 4b
movem r10,[r13+]
;; Clear by four for the remaining multiples.
addq 40,r12
bmi 6f
nop
5:
subq 4,r12
bpl 5b
clear.d [r13+]
6:
addq 4,r12
beq 7f
nop
subq 1,r12
beq 7f
clear.b [r13+]
subq 1,r12
beq 7f
clear.b [r13+]
clear.d r12
clear.b [r13+]
7:
jump 8b
.previous .previous
.section __ex_table,\"a\" .section __ex_table,\"a\"
......
...@@ -6,6 +6,19 @@ ...@@ -6,6 +6,19 @@
* Authors: Bjorn Wesen * Authors: Bjorn Wesen
* *
* $Log: fault.c,v $ * $Log: fault.c,v $
* Revision 1.16 2001/06/13 00:06:08 bjornw
* current_pgd should be volatile
*
* Revision 1.15 2001/06/13 00:02:23 bjornw
* Use a separate variable to store the current pgd to avoid races in schedule
*
* Revision 1.14 2001/05/16 17:41:07 hp
* Last comment tweak further tweaked.
*
* Revision 1.13 2001/05/15 00:58:44 hp
* Expand a bit on the comment why we compare address >= TASK_SIZE rather
* than >= VMALLOC_START.
*
* Revision 1.12 2001/04/04 10:51:14 bjornw * Revision 1.12 2001/04/04 10:51:14 bjornw
* mmap_sem is grabbed for reading * mmap_sem is grabbed for reading
* *
...@@ -59,6 +72,10 @@ asmlinkage void do_page_fault(unsigned long address, struct pt_regs *regs, ...@@ -59,6 +72,10 @@ asmlinkage void do_page_fault(unsigned long address, struct pt_regs *regs,
/* debug of higher-level faults */ /* debug of higher-level faults */
#define DPG(x) #define DPG(x)
/* current active page directory */
volatile pgd_t *current_pgd;
/* fast TLB-fill fault handler */ /* fast TLB-fill fault handler */
void void
...@@ -94,9 +111,11 @@ handle_mmu_bus_fault(struct pt_regs *regs) ...@@ -94,9 +111,11 @@ handle_mmu_bus_fault(struct pt_regs *regs)
if(miss) { if(miss) {
/* see if the pte exists at all */ /* see if the pte exists at all
* refer through current_pgd, dont use mm->pgd
*/
pmd = (pmd_t *)pgd_offset(mm, address); pmd = (pmd_t *)(current_pgd + pgd_index(address));
if(pmd_none(*pmd)) if(pmd_none(*pmd))
goto dofault; goto dofault;
if(pmd_bad(*pmd)) { if(pmd_bad(*pmd)) {
...@@ -206,7 +225,9 @@ do_page_fault(unsigned long address, struct pt_regs *regs, ...@@ -206,7 +225,9 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
* should really be >= VMALLOC_START, however, kernel fixup errors * should really be >= VMALLOC_START, however, kernel fixup errors
* will be handled more quickly by going through vmalloc_fault and then * will be handled more quickly by going through vmalloc_fault and then
* into bad_area_nosemaphore than falling through the find_vma user-mode * into bad_area_nosemaphore than falling through the find_vma user-mode
* tests. * tests. As an aside can be mentioned that the difference in
* compiled code is neglibible; the instruction is the same, just a
* comparison with a different address of the same size.
*/ */
if (address >= TASK_SIZE) if (address >= TASK_SIZE)
...@@ -384,12 +405,17 @@ do_page_fault(unsigned long address, struct pt_regs *regs, ...@@ -384,12 +405,17 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
/* /*
* Synchronize this task's top level page-table * Synchronize this task's top level page-table
* with the 'reference' page table. * with the 'reference' page table.
*
* Use current_pgd instead of tsk->active_mm->pgd
* since the latter might be unavailable if this
* code is executed in a misfortunately run irq
*/ */
int offset = pgd_index(address); int offset = pgd_index(address);
pgd_t *pgd, *pgd_k; pgd_t *pgd, *pgd_k;
pmd_t *pmd, *pmd_k; pmd_t *pmd, *pmd_k;
pgd = tsk->active_mm->pgd + offset; pgd = current_pgd + offset;
pgd_k = init_mm.pgd + offset; pgd_k = init_mm.pgd + offset;
if (!pgd_present(*pgd)) { if (!pgd_present(*pgd)) {
......
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.
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.
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