Commit 3e3a129d authored by Linus Torvalds's avatar Linus Torvalds

Manual merge of mmu context changes in cris patch

parents d1b858cb 3d10ee29
This diff is collapsed.
# $Id: Makefile,v 1.3 2002/01/21 15:21:23 bjornw Exp $ # $Id: Makefile,v 1.15 2003/07/04 12:47:53 tobiasa 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
...@@ -13,37 +13,40 @@ ...@@ -13,37 +13,40 @@
# A bug in ld prevents us from having a (constant-value) symbol in a # A bug in ld prevents us from having a (constant-value) symbol in a
# "ORIGIN =" or "LENGTH =" expression. # "ORIGIN =" or "LENGTH =" expression.
LD = $(CROSS_COMPILE)ld -mcrislinux arch-y := v10
arch-$(CONFIG_ETRAX_ARCH_V10) := v10
# No config avaiable for make clean etc
ifneq ($(arch-y),)
SARCH := arch-$(arch-y)
else
SARCH :=
endif
# objcopy is used to make binary images from the resulting linked file LD = $(CROSS_COMPILE)ld -mcrislinux
LDFLAGS_BLOB := --format binary --oformat elf32-cris \
-T arch/cris/$(SARCH)/output_arch.ld
OBJCOPYFLAGS := -O binary -R .note -R .comment -S OBJCOPYFLAGS := -O binary -R .note -R .comment -S
# -mlinux enables -march=v10, -fno-underscores, -D__linux__ among others AFLAGS_vmlinux.lds.o = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
AFLAGS += -mlinux
CFLAGS := $(CFLAGS) -mlinux -pipe CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
ifdef CONFIG_ETRAX_KGDB ifdef CONFIG_ETRAX_KGDB
CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
CFLAGS += -fno-omit-frame-pointer CFLAGS += -fno-omit-frame-pointer
endif endif
AFLAGS += -mlinux HEAD := arch/$(ARCH)/$(SARCH)/kernel/head.o
HEAD := arch/cris/kernel/head.o
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
LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a) LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
core-y += arch/cris/kernel/ arch/cris/mm/ core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
drivers-y += arch/cris/drivers/ core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
libs-y += arch/cris/lib/lib.a $(LIBGCC) drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux.bin: vmlinux vmlinux.bin: vmlinux
$(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin
...@@ -65,20 +68,43 @@ cramfs: ...@@ -65,20 +68,43 @@ cramfs:
clinux: vmlinux.bin decompress.bin rescue.bin clinux: vmlinux.bin decompress.bin rescue.bin
decompress.bin: FORCE decompress.bin: FORCE
@make -C arch/cris/boot/compressed decompress.bin @make -C arch/$(ARCH)/boot/compressed decompress.bin
rescue.bin: FORCE rescue.bin: FORCE
@make -C arch/cris/boot/rescue rescue.bin @make -C arch/$(ARCH)/boot/rescue rescue.bin
zImage: vmlinux.bin zImage: vmlinux.bin rescue.bin
## zImage - Compressed kernel (gzip) ## zImage - Compressed kernel (gzip)
@$(MAKEBOOT) zImage @make -C arch/$(ARCH)/boot/ zImage
compressed: zImage compressed: zImage
archmrproper:
archclean: archclean:
@$(MAKEBOOT) clean $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot
rm -f timage vmlinux.bin cramfs.img rm -f timage vmlinux.bin cramfs.img
rm -rf $(LD_SCRIPT).tmp rm -rf $(LD_SCRIPT).tmp
archmrproper: prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \
include/asm-$(ARCH)/$(SARCH)/offset.h
# Create some links to make all tools happy
arch/$(ARCH)/.links:
@ln -sfn $(SARCH)/drivers arch/$(ARCH)/drivers
@ln -sfn $(SARCH)/boot arch/$(ARCH)/boot
@ln -sfn $(SARCH)/lib arch/$(ARCH)/lib
@ln -sfn $(SARCH)/vmlinux.lds.S arch/$(ARCH)/vmlinux.lds.S
@touch $@
# Create link to sub arch includes
include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h)
@echo ' Making asm-$(ARCH)/arch -> asm-$(ARCH)/$(SARCH) symlink'
@rm -f include/asm-$(ARCH)/arch
@ln -sf $(SARCH) include/asm-$(ARCH)/arch
@touch $@
arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s
$(call filechk,gen-asm-offsets)
This diff is collapsed.
...@@ -3,8 +3,8 @@ Memory management for CRIS/MMU ...@@ -3,8 +3,8 @@ Memory management for CRIS/MMU
HISTORY: HISTORY:
$Log: README.mm,v $ $Log: README.mm,v $
Revision 1.1.1.1 2001/12/17 13:59:27 bjornw Revision 1.1 2001/12/17 13:59:27 bjornw
Import of Linux 2.5.1 Initial revision
Revision 1.1 2000/07/10 16:25:21 bjornw Revision 1.1 2000/07/10 16:25:21 bjornw
Initial revision Initial revision
......
Creation of the self-extracting compressed kernel image (vmlinuz) Creation of the self-extracting compressed kernel image (vmlinuz)
----------------------------------------------------------------- -----------------------------------------------------------------
$Id: README,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ $Id: README,v 1.1 2001/12/17 13:59:27 bjornw Exp $
This can be slightly confusing because it's a process with many steps. This can be slightly confusing because it's a process with many steps.
......
...@@ -13,6 +13,7 @@ SECTIONS ...@@ -13,6 +13,7 @@ SECTIONS
_stext = . ; _stext = . ;
*(.text) *(.text)
*(.rodata) *(.rodata)
*(.rodata.*)
_etext = . ; _etext = . ;
} > dram } > dram
.data : .data :
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <linux/config.h> #include <linux/config.h>
#define ASSEMBLER_MACROS_ONLY #define ASSEMBLER_MACROS_ONLY
#include <asm/sv_addr_ag.h> #include <asm/arch/sv_addr_ag.h>
#define RAM_INIT_MAGIC 0x56902387 #define RAM_INIT_MAGIC 0x56902387
......
/* /*
* misc.c * misc.c
* *
* $Id: misc.c,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ * $Id: misc.c,v 1.4 2003/04/09 05:20:45 starvik Exp $
* *
* This is a collection of several routines from gzip-1.0.3 * This is a collection of several routines from gzip-1.0.3
* adapted for Linux. * adapted for Linux.
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
/* where the piggybacked kernel image expects itself to live. /* where the piggybacked kernel image expects itself to live.
* it is the same address we use when we network load an uncompressed * it is the same address we use when we network load an uncompressed
* image into DRAM, and it is the address the kernel is linked to live * image into DRAM, and it is the address the kernel is linked to live
* at by etrax100.ld. * at by vmlinux.lds.S
*/ */
#define KERNEL_LOAD_ADR 0x40004000 #define KERNEL_LOAD_ADR 0x40004000
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/svinto.h> #include <asm/arch/svinto.h>
/* /*
* gzip declarations * gzip declarations
...@@ -109,7 +109,7 @@ static void puts(const char *); ...@@ -109,7 +109,7 @@ static void puts(const char *);
extern int end; extern int end;
static long free_mem_ptr = (long)&end; static long free_mem_ptr = (long)&end;
#include "../../../../lib/inflate.c" #include "../../../../../lib/inflate.c"
static void *malloc(int size) static void *malloc(int size)
{ {
......
/* $Id: head.S,v 1.2 2001/12/18 13:35:12 bjornw Exp $ /* $Id: head.S,v 1.6 2003/04/09 08:12:43 pkj Exp $
* *
* Rescue code, made to reside at the beginning of the * Rescue code, made to reside at the beginning of the
* flash-memory. when it starts, it checks a partition * flash-memory. when it starts, it checks a partition
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
* *
* Bit 0 in flags signifies RW or RO. The rescue code only bothers * Bit 0 in flags signifies RW or RO. The rescue code only bothers
* to check the checksum for RO partitions, since the others will * to check the checksum for RO partitions, since the others will
* change its data without updating the checksums. A 1 in bit 0 * change their data without updating the checksums. A 1 in bit 0
* means RO, 0 means RW. That way, it is possible to set a partition * means RO, 0 means RW. That way, it is possible to set a partition
* in RO mode initially, and later mark it as RW, since you can always * in RO mode initially, and later mark it as RW, since you can always
* write 0's to the flash. * write 0's to the flash.
...@@ -60,12 +60,12 @@ ...@@ -60,12 +60,12 @@
* During the wait for serial input, the status LED will flash so the * During the wait for serial input, the status LED will flash so the
* user knows something went wrong. * user knows something went wrong.
* *
* Copyright (C) 1999,2001 Axis Communications AB * Copyright (C) 1999, 2000, 2001, 2002, 2003 Axis Communications AB
*/ */
#include <linux/config.h> #include <linux/config.h>
#define ASSEMBLER_MACROS_ONLY #define ASSEMBLER_MACROS_ONLY
#include <asm/sv_addr_ag.h> #include <asm/arch/sv_addr_ag.h>
;; The partitiontable is looked for at the first sector after the boot ;; The partitiontable is looked for at the first sector after the boot
;; sector. Sector size is 65536 bytes in all flashes we use. ;; sector. Sector size is 65536 bytes in all flashes we use.
...@@ -192,7 +192,7 @@ no_newjump: ...@@ -192,7 +192,7 @@ no_newjump:
moveq -1, $r7 moveq -1, $r7
ploop: move.d [$r3+], $r1 ; partition offset (from ptable start) ploop: move.d [$r3+], $r1 ; partition offset (from ptable start)
bne notfirst ; check if its the partition containing ptable bne notfirst ; check if it is the partition containing ptable
nop ; yes.. nop ; yes..
move.d $r8, $r1 ; for its checksum check, skip the ptable move.d $r8, $r1 ; for its checksum check, skip the ptable
move.d [$r3+], $r2 ; partition length move.d [$r3+], $r2 ; partition length
......
/* $Id: kimagerescue.S,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ /* $Id: kimagerescue.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
* *
* Rescue code to be prepended on a kimage and copied to the * Rescue code to be prepended on a kimage and copied to the
* rescue serial port. * rescue serial port.
......
/* $Id: testrescue.S,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ /* $Id: testrescue.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
* *
* Simple testcode to download by the rescue block. * Simple testcode to download by the rescue block.
* Just lits some LEDs to show it was downloaded correctly. * Just lits some LEDs to show it was downloaded correctly.
......
This diff is collapsed.
...@@ -4,13 +4,11 @@ ...@@ -4,13 +4,11 @@
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_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_SYNCHRONOUS_SERIAL) += sync_serial.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 obj-$(CONFIG_ETRAX_PCF8563) += pcf8563.o
...@@ -7,8 +7,37 @@ ...@@ -7,8 +7,37 @@
*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init, get_rtc_status *! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init, get_rtc_status
*! *!
*! $Log: ds1302.c,v $ *! $Log: ds1302.c,v $
*! Revision 1.1.1.1 2001/12/17 13:59:27 bjornw *! Revision 1.9 2003/07/04 08:27:37 starvik
*! Import of Linux 2.5.1 *! Merge of Linux 2.5.74
*!
*! Revision 1.8 2003/04/09 05:20:47 starvik
*! Merge of Linux 2.5.67
*!
*! Revision 1.6 2003/01/09 14:42:51 starvik
*! Merge of Linux 2.5.55
*!
*! Revision 1.4 2002/12/11 13:13:57 starvik
*! Added arch/ to v10 specific includes
*! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
*!
*! Revision 1.3 2002/11/20 11:56:10 starvik
*! Merge of Linux 2.5.48
*!
*! Revision 1.2 2002/11/18 13:16:06 starvik
*! Linux 2.5 port of latest 2.4 drivers
*!
*! Revision 1.15 2002/10/11 16:14:33 johana
*! Added CONFIG_ETRAX_DS1302_TRICKLE_CHARGE and initial setting of the
*! trcklecharge register.
*!
*! Revision 1.14 2002/10/10 12:15:38 magnusmn
*! Added support for having the RST signal on bit g0
*!
*! Revision 1.13 2002/05/29 15:16:08 johana
*! Removed unused variables.
*!
*! Revision 1.12 2002/04/10 15:35:25 johana
*! Moved probe function closer to init function and marked it __init.
*! *!
*! Revision 1.11 2001/06/14 12:35:52 jonashg *! Revision 1.11 2001/06/14 12:35:52 jonashg
*! The ATA hack is back. It is unfortunately the only way to set g27 to output. *! The ATA hack is back. It is unfortunately the only way to set g27 to output.
...@@ -85,7 +114,7 @@ ...@@ -85,7 +114,7 @@
*! *!
*! (C) Copyright 1999, 2000, 2001 Axis Communications AB, LUND, SWEDEN *! (C) Copyright 1999, 2000, 2001 Axis Communications AB, LUND, SWEDEN
*! *!
*! $Id: ds1302.c,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ *! $Id: ds1302.c,v 1.9 2003/07/04 08:27:37 starvik Exp $
*! *!
*!***************************************************************************/ *!***************************************************************************/
...@@ -101,7 +130,7 @@ ...@@ -101,7 +130,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/svinto.h> #include <asm/arch/svinto.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/rtc.h> #include <asm/rtc.h>
...@@ -232,54 +261,6 @@ ds1302_wdisable(void) ...@@ -232,54 +261,6 @@ ds1302_wdisable(void)
stop(); stop();
} }
/* Probe for the chip by writing something to its RAM and try reading it back. */
#define MAGIC_PATTERN 0x42
static int
ds1302_probe(void)
{
int retval, res;
TK_RST_DIR(1);
TK_SCL_DIR(1);
TK_SDA_DIR(0);
/* Try to talk to timekeeper. */
ds1302_wenable();
start();
out_byte(0xc0); /* write RAM byte 0 */
out_byte(MAGIC_PATTERN); /* write something magic */
start();
out_byte(0xc1); /* read RAM byte 0 */
if((res = in_byte()) == MAGIC_PATTERN) {
char buf[100];
stop();
ds1302_wdisable();
printk("%s: RTC found.\n", ds1302_name);
printk("%s: SDA, SCL, RST on PB%i, PB%i, %s%i\n",
ds1302_name,
CONFIG_ETRAX_DS1302_SDABIT,
CONFIG_ETRAX_DS1302_SCLBIT,
#ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT
"GENIO",
#else
"PB",
#endif
CONFIG_ETRAX_DS1302_RSTBIT);
get_rtc_status(buf);
printk(buf);
retval = 1;
} else {
stop();
printk("%s: RTC not found.\n", ds1302_name);
retval = 0;
}
return retval;
}
/* Read a byte from the selected register in the DS1302. */ /* Read a byte from the selected register in the DS1302. */
...@@ -315,8 +296,8 @@ get_rtc_time(struct rtc_time *rtc_tm) ...@@ -315,8 +296,8 @@ get_rtc_time(struct rtc_time *rtc_tm)
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli(); local_irq_disable();
rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS); rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS);
rtc_tm->tm_min = CMOS_READ(RTC_MINUTES); rtc_tm->tm_min = CMOS_READ(RTC_MINUTES);
...@@ -325,7 +306,7 @@ get_rtc_time(struct rtc_time *rtc_tm) ...@@ -325,7 +306,7 @@ get_rtc_time(struct rtc_time *rtc_tm)
rtc_tm->tm_mon = CMOS_READ(RTC_MONTH); rtc_tm->tm_mon = CMOS_READ(RTC_MONTH);
rtc_tm->tm_year = CMOS_READ(RTC_YEAR); rtc_tm->tm_year = CMOS_READ(RTC_YEAR);
restore_flags(flags); local_irq_restore(flags);
BCD_TO_BIN(rtc_tm->tm_sec); BCD_TO_BIN(rtc_tm->tm_sec);
BCD_TO_BIN(rtc_tm->tm_min); BCD_TO_BIN(rtc_tm->tm_min);
...@@ -371,7 +352,6 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -371,7 +352,6 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{ {
struct rtc_time rtc_tm; struct rtc_time rtc_tm;
unsigned char mon, day, hrs, min, sec, leap_yr; unsigned char mon, day, hrs, min, sec, leap_yr;
unsigned char save_control, save_freq_select;
unsigned int yrs; unsigned int yrs;
if (!capable(CAP_SYS_TIME)) if (!capable(CAP_SYS_TIME))
...@@ -414,15 +394,15 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -414,15 +394,15 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
BIN_TO_BCD(mon); BIN_TO_BCD(mon);
BIN_TO_BCD(yrs); BIN_TO_BCD(yrs);
save_flags(flags); local_irq_save(flags);
cli(); local_irq_disable();
CMOS_WRITE(yrs, RTC_YEAR); CMOS_WRITE(yrs, RTC_YEAR);
CMOS_WRITE(mon, RTC_MONTH); CMOS_WRITE(mon, RTC_MONTH);
CMOS_WRITE(day, RTC_DAY_OF_MONTH); CMOS_WRITE(day, RTC_DAY_OF_MONTH);
CMOS_WRITE(hrs, RTC_HOURS); CMOS_WRITE(hrs, RTC_HOURS);
CMOS_WRITE(min, RTC_MINUTES); CMOS_WRITE(min, RTC_MINUTES);
CMOS_WRITE(sec, RTC_SECONDS); CMOS_WRITE(sec, RTC_SECONDS);
restore_flags(flags); local_irq_restore(flags);
/* Notice that at this point, the RTC is updated but /* Notice that at this point, the RTC is updated but
* the kernel is still running with the old time. * the kernel is still running with the old time.
...@@ -435,7 +415,6 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -435,7 +415,6 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case RTC_SET_CHARGE: /* set the RTC TRICKLE CHARGE register */ case RTC_SET_CHARGE: /* set the RTC TRICKLE CHARGE register */
{ {
int tcs_val; int tcs_val;
unsigned char save_control, save_freq_select;
if (!capable(CAP_SYS_TIME)) if (!capable(CAP_SYS_TIME))
return -EPERM; return -EPERM;
...@@ -484,6 +463,56 @@ static struct file_operations rtc_fops = { ...@@ -484,6 +463,56 @@ static struct file_operations rtc_fops = {
.ioctl = rtc_ioctl, .ioctl = rtc_ioctl,
}; };
/* Probe for the chip by writing something to its RAM and try reading it back. */
#define MAGIC_PATTERN 0x42
static int __init
ds1302_probe(void)
{
int retval, res;
TK_RST_DIR(1);
TK_SCL_DIR(1);
TK_SDA_DIR(0);
/* Try to talk to timekeeper. */
ds1302_wenable();
start();
out_byte(0xc0); /* write RAM byte 0 */
out_byte(MAGIC_PATTERN); /* write something magic */
start();
out_byte(0xc1); /* read RAM byte 0 */
if((res = in_byte()) == MAGIC_PATTERN) {
char buf[100];
stop();
ds1302_wdisable();
printk("%s: RTC found.\n", ds1302_name);
printk("%s: SDA, SCL, RST on PB%i, PB%i, %s%i\n",
ds1302_name,
CONFIG_ETRAX_DS1302_SDABIT,
CONFIG_ETRAX_DS1302_SCLBIT,
#ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT
"GENIO",
#else
"PB",
#endif
CONFIG_ETRAX_DS1302_RSTBIT);
get_rtc_status(buf);
printk(buf);
retval = 1;
} else {
stop();
printk("%s: RTC not found.\n", ds1302_name);
retval = 0;
}
return retval;
}
/* Just probe for the RTC and register the device to handle the ioctl needed. */ /* Just probe for the RTC and register the device to handle the ioctl needed. */
int __init int __init
...@@ -491,16 +520,24 @@ ds1302_init(void) ...@@ -491,16 +520,24 @@ ds1302_init(void)
{ {
if (!ds1302_probe()) { if (!ds1302_probe()) {
#ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT #ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT
#if CONFIG_ETRAX_DS1302_RSTBIT == 27
/* /*
* The only way to set g27 to output is to enable ATA. * The only way to set g27 to output is to enable ATA.
* *
* Make sure that R_GEN_CONFIG is setup correct. * Make sure that R_GEN_CONFIG is setup correct.
*/ */
genconfig_shadow = ((genconfig_shadow & genconfig_shadow = ((genconfig_shadow &
~IO_MASK(R_GEN_CONFIG, ata)) ~IO_MASK(R_GEN_CONFIG, ata)) |
|
(IO_STATE(R_GEN_CONFIG, ata, select))); (IO_STATE(R_GEN_CONFIG, ata, select)));
*R_GEN_CONFIG = genconfig_shadow; *R_GEN_CONFIG = genconfig_shadow;
#elif CONFIG_ETRAX_DS1302_RSTBIT == 0
/* Set the direction of this bit to out. */
genconfig_shadow = ((genconfig_shadow &
~IO_MASK(R_GEN_CONFIG, g0dir)) |
(IO_STATE(R_GEN_CONFIG, g0dir, out)));
*R_GEN_CONFIG = genconfig_shadow;
#endif
if (!ds1302_probe()) if (!ds1302_probe())
return -1; return -1;
#else #else
...@@ -508,10 +545,22 @@ ds1302_init(void) ...@@ -508,10 +545,22 @@ ds1302_init(void)
#endif #endif
} }
/* Initialise trickle charger */
ds1302_writereg(RTC_TRICKLECHARGER,
RTC_TCR_PATTERN |(CONFIG_ETRAX_DS1302_TRICKLE_CHARGE & 0x0F));
return 0;
}
static int __init ds1302_register(void)
{
ds1302_init();
if (register_chrdev(RTC_MAJOR_NR, ds1302_name, &rtc_fops)) { if (register_chrdev(RTC_MAJOR_NR, ds1302_name, &rtc_fops)) {
printk(KERN_INFO "%s: unable to get major %d for rtc\n", printk(KERN_INFO "%s: unable to get major %d for rtc\n",
ds1302_name, RTC_MAJOR_NR); ds1302_name, RTC_MAJOR_NR);
return -1; return -1;
} }
return 0; return 0;
} }
module_init(ds1302_register);
...@@ -20,8 +20,24 @@ ...@@ -20,8 +20,24 @@
*! in the spin-lock. *! in the spin-lock.
*! *!
*! $Log: eeprom.c,v $ *! $Log: eeprom.c,v $
*! Revision 1.1.1.1 2001/12/17 13:59:27 bjornw *! Revision 1.9 2003/07/04 08:27:37 starvik
*! Import of Linux 2.5.1 *! Merge of Linux 2.5.74
*!
*! Revision 1.8 2003/04/09 05:20:47 starvik
*! Merge of Linux 2.5.67
*!
*! Revision 1.6 2003/02/10 07:19:28 starvik
*! Removed misplaced ;
*!
*! Revision 1.5 2002/12/11 13:13:57 starvik
*! Added arch/ to v10 specific includes
*! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
*!
*! Revision 1.4 2002/11/20 11:56:10 starvik
*! Merge of Linux 2.5.48
*!
*! Revision 1.3 2002/11/18 13:16:06 starvik
*! Linux 2.5 port of latest 2.4 drivers
*! *!
*! Revision 1.8 2001/06/15 13:24:29 jonashg *! Revision 1.8 2001/06/15 13:24:29 jonashg
*! * Added verification of pointers from userspace in read and write. *! * Added verification of pointers from userspace in read and write.
...@@ -74,7 +90,7 @@ ...@@ -74,7 +90,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/smp_lock.h> #include <linux/interrupt.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "i2c.h" #include "i2c.h"
...@@ -425,9 +441,9 @@ int __init eeprom_init(void) ...@@ -425,9 +441,9 @@ int __init eeprom_init(void)
static int eeprom_open(struct inode * inode, struct file * file) static int eeprom_open(struct inode * inode, struct file * file)
{ {
if(MINOR(inode->i_rdev) != EEPROM_MINOR_NR) if(minor(inode->i_rdev) != EEPROM_MINOR_NR)
return -ENXIO; return -ENXIO;
if(MAJOR(inode->i_rdev) != EEPROM_MAJOR_NR) if(major(inode->i_rdev) != EEPROM_MAJOR_NR)
return -ENXIO; return -ENXIO;
if( eeprom.size > 0 ) if( eeprom.size > 0 )
...@@ -449,39 +465,36 @@ static loff_t eeprom_lseek(struct file * file, loff_t offset, int orig) ...@@ -449,39 +465,36 @@ static loff_t eeprom_lseek(struct file * file, loff_t offset, int orig)
* orig 1: relative from current position * orig 1: relative from current position
* orig 2: position from last eeprom address * orig 2: position from last eeprom address
*/ */
loff_t ret;
lock_kernel();
switch (orig) switch (orig)
{ {
case 0: case 0:
ret = file->f_pos = offset; file->f_pos = offset;
break; break;
case 1: case 1:
ret = file->f_pos += offset; file->f_pos += offset;
break; break;
case 2: case 2:
ret = file->f_pos = eeprom.size - offset; file->f_pos = eeprom.size - offset;
break; break;
default: default:
ret = -EINVAL; return -EINVAL;
} }
/* truncate position */ /* truncate position */
if (file->f_pos < 0) if (file->f_pos < 0)
{ {
file->f_pos = 0; file->f_pos = 0;
ret = -EOVERFLOW; return(-EOVERFLOW);
} }
if (file->f_pos >= eeprom.size) if (file->f_pos >= eeprom.size)
{ {
file->f_pos = eeprom.size - 1; file->f_pos = eeprom.size - 1;
ret = -EOVERFLOW; return(-EOVERFLOW);
} }
unlock_kernel(); return ( file->f_pos );
return ( ret );
} }
/* Reads data from eeprom. */ /* Reads data from eeprom. */
...@@ -500,7 +513,7 @@ static int eeprom_read_buf(loff_t addr, char * buf, int count) ...@@ -500,7 +513,7 @@ static int eeprom_read_buf(loff_t addr, char * buf, int count)
static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t *off) static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t *off)
{ {
int i, read=0; int read=0;
unsigned long p = file->f_pos; unsigned long p = file->f_pos;
unsigned char page; unsigned char page;
...@@ -526,7 +539,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t ...@@ -526,7 +539,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t
if(!eeprom_address(p)) if(!eeprom_address(p))
{ {
printk(KERN_INFO "%s: Read failed to address the eeprom: " printk(KERN_INFO "%s: Read failed to address the eeprom: "
"0x%08X (%i) page: %i\n", eeprom_name, p, p, page); "0x%08X (%i) page: %i\n", eeprom_name, (int)p, (int)p, page);
i2c_stop(); i2c_stop();
/* don't forget to wake them up */ /* don't forget to wake them up */
...@@ -609,7 +622,7 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count, ...@@ -609,7 +622,7 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
if(!eeprom_address(p)) if(!eeprom_address(p))
{ {
printk(KERN_INFO "%s: Write failed to address the eeprom: " printk(KERN_INFO "%s: Write failed to address the eeprom: "
"0x%08X (%i) \n", eeprom_name, p, p); "0x%08X (%i) \n", eeprom_name, (int)p, (int)p);
i2c_stop(); i2c_stop();
/* don't forget to wake them up */ /* don't forget to wake them up */
...@@ -747,7 +760,7 @@ static int eeprom_close(struct inode * inode, struct file * file) ...@@ -747,7 +760,7 @@ static int eeprom_close(struct inode * inode, struct file * file)
static int eeprom_address(unsigned long addr) static int eeprom_address(unsigned long addr)
{ {
int i, j; int i;
unsigned char page, offset; unsigned char page, offset;
page = (unsigned char) (addr >> 8); page = (unsigned char) (addr >> 8);
......
This diff is collapsed.
...@@ -12,8 +12,25 @@ ...@@ -12,8 +12,25 @@
*! don't use PB_I2C if DS1302 uses same bits, *! don't use PB_I2C if DS1302 uses same bits,
*! use PB. *! use PB.
*! $Log: i2c.c,v $ *! $Log: i2c.c,v $
*! Revision 1.1.1.1 2001/12/17 13:59:27 bjornw *! Revision 1.4 2002/12/11 13:13:57 starvik
*! Import of Linux 2.5.1 *! Added arch/ to v10 specific includes
*! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
*!
*! Revision 1.3 2002/11/20 11:56:11 starvik
*! Merge of Linux 2.5.48
*!
*! Revision 1.2 2002/11/18 13:16:06 starvik
*! Linux 2.5 port of latest 2.4 drivers
*!
*! Revision 1.9 2002/10/31 15:32:26 starvik
*! Update Port B register and shadow even when running with hardware support
*! to avoid glitches when reading bits
*! Never set direction to out in i2c_inbyte
*! Removed incorrect clock togling at end of i2c_inbyte
*!
*! Revision 1.8 2002/08/13 06:31:53 starvik
*! Made SDA and SCL line configurable
*! Modified i2c_inbyte to work with PCF8563
*! *!
*! Revision 1.7 2001/04/04 13:11:36 markusl *! Revision 1.7 2001/04/04 13:11:36 markusl
*! Updated according to review remarks *! Updated according to review remarks
...@@ -43,10 +60,11 @@ ...@@ -43,10 +60,11 @@
*! *!
*! --------------------------------------------------------------------------- *! ---------------------------------------------------------------------------
*! *!
*! (C) Copyright 1999, 2000, 2001 Axis Communications AB, LUND, SWEDEN *! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN
*! *!
*!***************************************************************************/ *!***************************************************************************/
/* $Id: i2c.c,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ */ /* $Id: i2c.c,v 1.4 2002/12/11 13:13:57 starvik Exp $ */
/****************** INCLUDE FILES SECTION ***********************************/ /****************** INCLUDE FILES SECTION ***********************************/
#include <linux/module.h> #include <linux/module.h>
...@@ -62,7 +80,7 @@ ...@@ -62,7 +80,7 @@
#include <asm/etraxi2c.h> #include <asm/etraxi2c.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/svinto.h> #include <asm/arch/svinto.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/delay.h> #include <asm/delay.h>
...@@ -96,8 +114,15 @@ static const char i2c_name[] = "i2c"; ...@@ -96,8 +114,15 @@ static const char i2c_name[] = "i2c";
#ifdef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C #ifdef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C
/* Use PB and not PB_I2C */ /* Use PB and not PB_I2C */
#define SDABIT 0 #ifndef CONFIG_ETRAX_I2C_DATA_PORT
#define SCLBIT 1 #define CONFIG_ETRAX_I2C_DATA_PORT 0
#endif
#ifndef CONFIG_ETRAX_I2C_CLK_PORT
#define CONFIG_ETRAX_I2C_CLK_PORT 1
#endif
#define SDABIT CONFIG_ETRAX_I2C_DATA_PORT
#define SCLBIT CONFIG_ETRAX_I2C_CLK_PORT
#define i2c_enable() #define i2c_enable()
#define i2c_disable() #define i2c_disable()
...@@ -117,7 +142,7 @@ static const char i2c_name[] = "i2c"; ...@@ -117,7 +142,7 @@ static const char i2c_name[] = "i2c";
/* read a bit from the i2c interface */ /* read a bit from the i2c interface */
#define i2c_getbit() (*R_PORT_PB_READ & (1 << SDABIT)) #define i2c_getbit() (((*R_PORT_PB_READ & (1 << SDABIT))) >> SDABIT)
#else #else
/* enable or disable the i2c interface */ /* enable or disable the i2c interface */
...@@ -127,16 +152,24 @@ static const char i2c_name[] = "i2c"; ...@@ -127,16 +152,24 @@ static const char i2c_name[] = "i2c";
/* enable or disable output-enable, to select output or input on the i2c bus */ /* enable or disable output-enable, to select output or input on the i2c bus */
#define i2c_dir_out() *R_PORT_PB_I2C = (port_pb_i2c_shadow &= ~IO_MASK(R_PORT_PB_I2C, i2c_oe_)) #define i2c_dir_out() \
#define i2c_dir_in() *R_PORT_PB_I2C = (port_pb_i2c_shadow |= IO_MASK(R_PORT_PB_I2C, i2c_oe_)) *R_PORT_PB_I2C = (port_pb_i2c_shadow &= ~IO_MASK(R_PORT_PB_I2C, i2c_oe_)); \
REG_SHADOW_SET(R_PORT_PB_DIR, port_pb_dir_shadow, 0, 1);
#define i2c_dir_in() \
*R_PORT_PB_I2C = (port_pb_i2c_shadow |= IO_MASK(R_PORT_PB_I2C, i2c_oe_)); \
REG_SHADOW_SET(R_PORT_PB_DIR, port_pb_dir_shadow, 0, 0);
/* control the i2c clock and data signals */ /* control the i2c clock and data signals */
#define i2c_clk(x) *R_PORT_PB_I2C = (port_pb_i2c_shadow = (port_pb_i2c_shadow & \ #define i2c_clk(x) \
~IO_MASK(R_PORT_PB_I2C, i2c_clk)) | IO_FIELD(R_PORT_PB_I2C, i2c_clk, (x))) *R_PORT_PB_I2C = (port_pb_i2c_shadow = (port_pb_i2c_shadow & \
~IO_MASK(R_PORT_PB_I2C, i2c_clk)) | IO_FIELD(R_PORT_PB_I2C, i2c_clk, (x))); \
REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 1, x);
#define i2c_data(x) *R_PORT_PB_I2C = (port_pb_i2c_shadow = (port_pb_i2c_shadow & \ #define i2c_data(x) \
~IO_MASK(R_PORT_PB_I2C, i2c_d)) | IO_FIELD(R_PORT_PB_I2C, i2c_d, (x))) *R_PORT_PB_I2C = (port_pb_i2c_shadow = (port_pb_i2c_shadow & \
~IO_MASK(R_PORT_PB_I2C, i2c_d)) | IO_FIELD(R_PORT_PB_I2C, i2c_d, (x))); \
REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 0, x);
/* read a bit from the i2c interface */ /* read a bit from the i2c interface */
...@@ -213,10 +246,11 @@ i2c_outbyte(unsigned char x) ...@@ -213,10 +246,11 @@ i2c_outbyte(unsigned char x)
i2c_dir_out(); i2c_dir_out();
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (x & 0x80) if (x & 0x80) {
i2c_data(I2C_DATA_HIGH); i2c_data(I2C_DATA_HIGH);
else } else {
i2c_data(I2C_DATA_LOW); i2c_data(I2C_DATA_LOW);
}
i2c_delay(CLOCK_LOW_TIME/2); i2c_delay(CLOCK_LOW_TIME/2);
i2c_clk(I2C_CLOCK_HIGH); i2c_clk(I2C_CLOCK_HIGH);
...@@ -241,65 +275,41 @@ i2c_inbyte(void) ...@@ -241,65 +275,41 @@ i2c_inbyte(void)
{ {
unsigned char aBitByte = 0; unsigned char aBitByte = 0;
int i; int i;
int iaa;
/* /* Switch off I2C to get bit */
* enable output i2c_disable();
*/
i2c_dir_out();
/*
* Release data bus by setting
* data high
*/
i2c_data(I2C_DATA_HIGH);
/*
* enable input
*/
i2c_dir_in(); i2c_dir_in();
/* i2c_delay(CLOCK_HIGH_TIME/2);
* Use PORT PB instead of I2C
* for input. (I2C not working) /* Get bit */
*/ aBitByte |= i2c_getbit();
i2c_clk(1);
i2c_data(1); /* Enable I2C */
/* i2c_enable();
* get bits
*/
for (i = 0; i < 8; i++) {
i2c_delay(CLOCK_LOW_TIME/2); i2c_delay(CLOCK_LOW_TIME/2);
/*
* low clock period for (i = 1; i < 8; i++) {
*/ aBitByte <<= 1;
/* Clock pulse */
i2c_clk(I2C_CLOCK_HIGH); i2c_clk(I2C_CLOCK_HIGH);
/* i2c_delay(CLOCK_HIGH_TIME);
* switch off I2C i2c_clk(I2C_CLOCK_LOW);
*/ i2c_delay(CLOCK_LOW_TIME);
i2c_data(1);
/* Switch off I2C to get bit */
i2c_disable(); i2c_disable();
i2c_dir_in(); i2c_dir_in();
/*
* wait before getting bit
*/
i2c_delay(CLOCK_HIGH_TIME/2);
aBitByte = (aBitByte << 1);
iaa = i2c_getbit();
aBitByte = aBitByte | iaa ;
/*
* wait
*/
i2c_delay(CLOCK_HIGH_TIME/2); i2c_delay(CLOCK_HIGH_TIME/2);
/*
* end clock puls /* Get bit */
*/ aBitByte |= i2c_getbit();
/* Enable I2C */
i2c_enable(); i2c_enable();
i2c_dir_out();
i2c_clk(I2C_CLOCK_LOW);
/*
* low clock period
*/
i2c_delay(CLOCK_LOW_TIME/2); i2c_delay(CLOCK_LOW_TIME/2);
} }
i2c_dir_out(); i2c_clk(I2C_CLOCK_HIGH);
i2c_delay(CLOCK_HIGH_TIME);
return aBitByte; return aBitByte;
} }
...@@ -435,33 +445,14 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg, ...@@ -435,33 +445,14 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg,
/* /*
* we don't like to be interrupted * we don't like to be interrupted
*/ */
save_flags(flags); local_irq_save(flags);
cli(); local_irq_disable();
/*
* generate start condition
*/
i2c_start();
/*
* dummy preamble
*/
i2c_outbyte(0x01);
i2c_data(I2C_DATA_HIGH);
i2c_clk(I2C_CLOCK_HIGH);
i2c_delay(CLOCK_HIGH_TIME); /* Dummy Acknowledge */
i2c_clk(I2C_CLOCK_LOW);
i2c_delay(CLOCK_LOW_TIME);
i2c_clk(I2C_CLOCK_HIGH);
i2c_delay(CLOCK_LOW_TIME); /* Repeated Start Condition */
i2c_data(I2C_DATA_LOW);
i2c_delay(CLOCK_HIGH_TIME);
i2c_clk(I2C_CLOCK_LOW);
i2c_delay(CLOCK_LOW_TIME);
i2c_start(); i2c_start();
/* /*
* send slave address * send slave address
*/ */
i2c_outbyte(theSlave); i2c_outbyte((theSlave & 0xfe));
/* /*
* wait for ack * wait for ack
*/ */
...@@ -493,7 +484,7 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg, ...@@ -493,7 +484,7 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg,
/* /*
* enable interrupt again * enable interrupt again
*/ */
restore_flags(flags); local_irq_restore(flags);
} while(error && cntr--); } while(error && cntr--);
...@@ -521,34 +512,17 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg) ...@@ -521,34 +512,17 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
/* /*
* we don't like to be interrupted * we don't like to be interrupted
*/ */
save_flags(flags); local_irq_save(flags);
cli(); local_irq_disable();
/* /*
* generate start condition * generate start condition
*/ */
i2c_start(); i2c_start();
/*
* dummy preamble
*/
i2c_outbyte(0x01);
i2c_data(I2C_DATA_HIGH);
i2c_clk(I2C_CLOCK_HIGH);
i2c_delay(CLOCK_HIGH_TIME); /* Dummy Acknowledge */
i2c_clk(I2C_CLOCK_LOW);
i2c_delay(CLOCK_LOW_TIME);
i2c_clk(I2C_CLOCK_HIGH);
i2c_delay(CLOCK_LOW_TIME); /* Repeated Start Condition */
i2c_data(I2C_DATA_LOW);
i2c_delay(CLOCK_HIGH_TIME);
i2c_clk(I2C_CLOCK_LOW);
i2c_delay(CLOCK_LOW_TIME);
i2c_start();
/* /*
* send slave address * send slave address
*/ */
i2c_outbyte(theSlave); i2c_outbyte((theSlave & 0xfe));
/* /*
* wait for ack * wait for ack
*/ */
...@@ -593,7 +567,7 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg) ...@@ -593,7 +567,7 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
/* /*
* enable interrupt again * enable interrupt again
*/ */
restore_flags(flags); local_irq_restore(flags);
} while(error && cntr--); } while(error && cntr--);
......
/* $Id: i2c.h,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ */ /* $Id: i2c.h,v 1.2 2002/11/18 13:16:06 starvik Exp $ */
/* High level I2C actions */ /* High level I2C actions */
int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue); int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue);
......
This diff is collapsed.
...@@ -25,6 +25,15 @@ ...@@ -25,6 +25,15 @@
#define SERIAL_RECV_DESCRIPTORS 8 #define SERIAL_RECV_DESCRIPTORS 8
struct etrax_recv_buffer {
struct etrax_recv_buffer *next;
unsigned short length;
unsigned char error;
unsigned char pad;
unsigned char buffer[0];
};
struct e100_serial { struct e100_serial {
int baud; int baud;
volatile u8 *port; /* R_SERIALx_CTRL */ volatile u8 *port; /* R_SERIALx_CTRL */
...@@ -79,10 +88,12 @@ struct e100_serial { ...@@ -79,10 +88,12 @@ struct e100_serial {
int count; /* # of fd on device */ int count; /* # of fd on device */
int blocked_open; /* # of blocked opens */ int blocked_open; /* # of blocked opens */
struct circ_buf xmit; struct circ_buf xmit;
struct circ_buf recv; struct etrax_recv_buffer *first_recv_buffer;
unsigned char *flag_buf; struct etrax_recv_buffer *last_recv_buffer;
unsigned int recv_cnt;
unsigned int max_recv_cnt;
struct tq_struct tqueue; struct work_struct work;
struct async_icount icount; /* error-statistics etc.*/ struct async_icount icount; /* error-statistics etc.*/
#ifdef DECLARE_WAITQUEUE #ifdef DECLARE_WAITQUEUE
wait_queue_head_t open_wait; wait_queue_head_t open_wait;
...@@ -101,7 +112,7 @@ struct e100_serial { ...@@ -101,7 +112,7 @@ struct e100_serial {
int break_detected_cnt; int break_detected_cnt;
int errorcode; int errorcode;
#ifdef CONFIG_RS485 #ifdef CONFIG_ETRAX_RS485
struct rs485_control rs485; /* RS-485 support */ struct rs485_control rs485; /* RS-485 support */
#endif #endif
}; };
......
# $Id: Makefile,v 1.4 2003/07/04 12:57:13 tobiasa Exp $
#
# Makefile for the linux kernel.
#
extra-y := head.o
obj-y := entry.o traps.o shadows.o debugport.o irq.o \
process.o setup.o signal.o traps.o time.o ptrace.o
obj-$(CONFIG_ETRAX_KGDB) += kgdb.o
obj-$(CONFIG_ETRAX_FAST_TIMER) += fasttimer.o
clean:
#include <linux/sched.h>
#include <asm/thread_info.h>
/*
* Generate definitions needed by assembly language modules.
* This code generates raw asm output which is post-processed to extract
* and format the required data.
*/
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
#define BLANK() asm volatile("\n->" : : )
int main(void)
{
#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
ENTRY(orig_r10);
ENTRY(r13);
ENTRY(r12);
ENTRY(r11);
ENTRY(r10);
ENTRY(r9);
ENTRY(mof);
ENTRY(dccr);
ENTRY(srp);
BLANK();
#undef ENTRY
#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
ENTRY(task);
ENTRY(flags);
ENTRY(preempt_count);
BLANK();
#undef ENTRY
#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
ENTRY(ksp);
ENTRY(usp);
ENTRY(dccr);
BLANK();
#undef ENTRY
#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
ENTRY(pid);
BLANK();
DEFINE(LCLONE_VM, CLONE_VM);
DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
return 0;
}
This diff is collapsed.
/* $Id: head.S,v 1.2 2001/12/18 13:35:19 bjornw Exp $ /* $Id: head.S,v 1.6 2003/04/28 05:31:46 starvik Exp $
* *
* Head of the kernel - alter with care * Head of the kernel - alter with care
* *
...@@ -7,6 +7,19 @@ ...@@ -7,6 +7,19 @@
* Authors: Bjorn Wesen (bjornw@axis.com) * Authors: Bjorn Wesen (bjornw@axis.com)
* *
* $Log: head.S,v $ * $Log: head.S,v $
* Revision 1.6 2003/04/28 05:31:46 starvik
* Added section attributes
*
* Revision 1.5 2002/12/11 15:42:02 starvik
* Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/*.c
*
* Revision 1.4 2002/11/07 09:00:44 starvik
* Names changed for init sections
* init_task_union -> init_thread_union
*
* Revision 1.3 2002/02/05 15:38:23 bjornw
* Oops.. non-CRAMFS_MAGIC should jump over the copying, not into it...
*
* Revision 1.2 2001/12/18 13:35:19 bjornw * Revision 1.2 2001/12/18 13:35:19 bjornw
* Applied the 2.4.13->2.4.16 CRIS patch to 2.5.1 (is a copy of 2.4.15). * Applied the 2.4.13->2.4.16 CRIS patch to 2.5.1 (is a copy of 2.4.15).
* *
...@@ -161,7 +174,7 @@ ...@@ -161,7 +174,7 @@
#define ASSEMBLER_MACROS_ONLY #define ASSEMBLER_MACROS_ONLY
/* The IO_* macros use the ## token concatenation operator, so /* The IO_* macros use the ## token concatenation operator, so
-traditional must not be used when assembling this file. */ -traditional must not be used when assembling this file. */
#include <asm/sv_addr_ag.h> #include <asm/arch/sv_addr_ag.h>
#define CRAMFS_MAGIC 0x28cd3d45 #define CRAMFS_MAGIC 0x28cd3d45
#define RAM_INIT_MAGIC 0x56902387 #define RAM_INIT_MAGIC 0x56902387
...@@ -311,7 +324,7 @@ _inflash0: ...@@ -311,7 +324,7 @@ _inflash0:
;; Put this in a suitable section where we can reclaim storage ;; Put this in a suitable section where we can reclaim storage
;; after init. ;; after init.
.section ".text.init" .section ".init.text", "ax"
_inflash: _inflash:
#ifdef CONFIG_ETRAX_ETHERNET #ifdef CONFIG_ETRAX_ETHERNET
;; Start MII clock to make sure it is running when tranceiver is reset ;; Start MII clock to make sure it is running when tranceiver is reset
...@@ -415,6 +428,7 @@ _inram: ...@@ -415,6 +428,7 @@ _inram:
jump _start_it ; enter code, cached this time jump _start_it ; enter code, cached this time
_no_romfs_in_flash: _no_romfs_in_flash:
;; Check if there is a cramfs (magic value). ;; Check if there is a cramfs (magic value).
;; Notice that we check for cramfs magic value - which is ;; Notice that we check for cramfs magic value - which is
;; the "rom fs" we'll possibly use in 2.4 if not JFFS (which does ;; the "rom fs" we'll possibly use in 2.4 if not JFFS (which does
...@@ -423,7 +437,7 @@ _no_romfs_in_flash: ...@@ -423,7 +437,7 @@ _no_romfs_in_flash:
move.d __vmlinux_end, $r0; the image will be after the vmlinux end address move.d __vmlinux_end, $r0; the image will be after the vmlinux end address
move.d [$r0], $r1 ; cramfs assumes same endian on host/target move.d [$r0], $r1 ; cramfs assumes same endian on host/target
cmp.d CRAMFS_MAGIC, $r1; magic value in cramfs superblock cmp.d CRAMFS_MAGIC, $r1; magic value in cramfs superblock
bne 1f bne 2f
nop nop
;; Ok. What is its size ? ;; Ok. What is its size ?
...@@ -454,6 +468,7 @@ _no_romfs_in_flash: ...@@ -454,6 +468,7 @@ _no_romfs_in_flash:
bne 1b bne 1b
nop nop
2:
;; Dont worry that the BSS is tainted. It will be cleared later. ;; Dont worry that the BSS is tainted. It will be cleared later.
moveq 0, $r0 moveq 0, $r0
...@@ -462,10 +477,11 @@ _no_romfs_in_flash: ...@@ -462,10 +477,11 @@ _no_romfs_in_flash:
jump _start_it ; better skip the additional cramfs check below jump _start_it ; better skip the additional cramfs check below
_start_it: _start_it:
;; the kernel stack is overlayed with the task structure for each ;; the kernel stack is overlayed with the task structure for each
;; task. thus the initial kernel stack is in the same page as the ;; task. thus the initial kernel stack is in the same page as the
;; init_task (but starts in the top of the page, size 8192) ;; init_task (but starts in the top of the page, size 8192)
move.d init_task_union + 8192, $sp move.d init_thread_union + 8192, $sp
move.d ibr_start,$r0 ; this symbol is set by the linker script move.d ibr_start,$r0 ; this symbol is set by the linker script
move $r0,$ibr move $r0,$ibr
move.d $r0,[etrax_irv] ; set the interrupt base register and pointer move.d $r0,[etrax_irv] ; set the interrupt base register and pointer
...@@ -839,5 +855,5 @@ swapper_pg_dir = 0x60002000 ...@@ -839,5 +855,5 @@ swapper_pg_dir = 0x60002000
swapper_pg_dir = 0xc0002000 swapper_pg_dir = 0xc0002000
#endif #endif
.section ".data.init" .section ".init.data", "aw"
#include "../lib/hw_settings.S" #include "../lib/hw_settings.S"
This diff is collapsed.
...@@ -18,8 +18,18 @@ ...@@ -18,8 +18,18 @@
*! Jul 21 1999 Bjorn Wesen eLinux port *! Jul 21 1999 Bjorn Wesen eLinux port
*! *!
*! $Log: kgdb.c,v $ *! $Log: kgdb.c,v $
*! Revision 1.1.1.1 2001/12/17 13:59:27 bjornw *! Revision 1.4 2003/04/09 05:20:44 starvik
*! Import of Linux 2.5.1 *! Merge of Linux 2.5.67
*!
*! Revision 1.3 2003/01/21 19:11:08 starvik
*! Modified include path for new dir layout
*!
*! Revision 1.2 2002/11/19 14:35:24 starvik
*! Changes from linux 2.4
*! Changed struct initializer syntax to the currently prefered notation
*!
*! Revision 1.1 2001/12/17 13:59:27 bjornw
*! Initial revision
*! *!
*! Revision 1.6 2001/10/09 13:10:03 matsfg *! Revision 1.6 2001/10/09 13:10:03 matsfg
*! Added $ on registers and removed some underscores *! Added $ on registers and removed some underscores
...@@ -58,7 +68,7 @@ ...@@ -58,7 +68,7 @@
*! *!
*!--------------------------------------------------------------------------- *!---------------------------------------------------------------------------
*! *!
*! $Id: kgdb.c,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ *! $Id: kgdb.c,v 1.4 2003/04/09 05:20:44 starvik Exp $
*! *!
*! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN *! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN
*! *!
...@@ -216,7 +226,7 @@ ...@@ -216,7 +226,7 @@
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/svinto.h> #include <asm/arch/svinto.h>
#include <asm/irq.h> #include <asm/irq.h>
static int kgdb_started = 0; static int kgdb_started = 0;
...@@ -1067,7 +1077,7 @@ handle_exception (int sigval) ...@@ -1067,7 +1077,7 @@ handle_exception (int sigval)
int regno = gdb_cris_strtol (&remcomInBuffer[1], &suffix, 16); int regno = gdb_cris_strtol (&remcomInBuffer[1], &suffix, 16);
int status; int status;
#ifdef PROCESS_SUPPORT #ifdef PROCESS_SUPPORT
if (current_thread_g =! executing_task) if (current_thread_g != executing_task)
status = write_stack_register (current_thread_g, regno, suffix+1); status = write_stack_register (current_thread_g, regno, suffix+1);
else else
#endif #endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* $Id: shadows.c,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $ /* $Id: shadows.c,v 1.1 2001/12/17 13:59:27 bjornw Exp $
* *
* Various shadow registers. Defines for these are in include/asm-etrax100/io.h * Various shadow registers. Defines for these are in include/asm-etrax100/io.h
*/ */
......
This diff is collapsed.
This diff is collapsed.
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# Makefile for Etrax-specific library files.. # Makefile for Etrax-specific library files..
# #
EXTRA_AFLAGS := -traditional EXTRA_AFLAGS := -traditional
lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o csumcpfruser.o lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o csumcpfruser.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* At the time of this writing, there's no equivalent ld option. */
OUTPUT_ARCH (cris)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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