X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/af6f1816764635c4d495177b74fe89a9a0e5ac4f..9c8ab08d7e8fca3916a7f91a3c001d151989137c:/lincan/include/tscan1.h diff --git a/lincan/include/tscan1.h b/lincan/include/tscan1.h index 97efdb6..ea4a599 100644 --- a/lincan/include/tscan1.h +++ b/lincan/include/tscan1.h @@ -1,67 +1,83 @@ -/* template.h - * Header file for the Linux CAN-bus driver. - * Written by Arnaud Westenberg email:arnaud@wanadoo.nl - * Rewritten for new CAN queues by Pavel Pisa - OCERA team member - * email:pisa@cmp.felk.cvut.cz - * This software is released under the GPL-License. - * Version lincan-0.3 17 Jun 2004 - */ +/**************************************************************************/ +/* File: tscan1.h - support for TS-CAN1 PC104 card from */ +/* Technologic Systems */ +/* */ +/* LinCAN - (Not only) Linux CAN bus driver */ +/* Copyright (C) 2002-2009 DCE FEE CTU Prague */ +/* Copyright (C) 2002-2009 Pavel Pisa */ +/* Funded by OCERA and FRESCOR IST projects */ +/* Based on CAN driver code by Arnaud Westenberg */ +/* */ +/* LinCAN is free software; you can redistribute it and/or modify it */ +/* under terms of the GNU General Public License as published by the */ +/* Free Software Foundation; either version 2, or (at your option) any */ +/* later version. LinCAN is distributed in the hope that it will be */ +/* useful, but WITHOUT ANY WARRANTY; without even the implied warranty */ +/* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* General Public License for more details. You should have received a */ +/* copy of the GNU General Public License along with LinCAN; see file */ +/* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, */ +/* Cambridge, MA 02139, USA. */ +/* */ +/* To allow use of LinCAN in the compact embedded systems firmware */ +/* and RT-executives (RTEMS for example), main authors agree with next */ +/* special exception: */ +/* */ +/* Including LinCAN header files in a file, instantiating LinCAN generics */ +/* or templates, or linking other files with LinCAN objects to produce */ +/* an application image/executable, does not by itself cause the */ +/* resulting application image/executable to be covered by */ +/* the GNU General Public License. */ +/* This exception does not however invalidate any other reasons */ +/* why the executable file might be covered by the GNU Public License. */ +/* Publication of enhanced or derived LinCAN files is required although. */ +/**************************************************************************/ //Ids SECTION #define TSCAN1_ID0 0xF6 #define TSCAN1_ID1 0xB9 -#define TS7KV_ID0 0x41 -#define TS7KV_ID1 0x20 //MEMORY SECTION -#ifdef CONFIG_ARM -#include -#define TSXXX_BASE_IO 0x01E00000 +#if defined(CONFIG_TS7800_PLATFORM) +#define TSXXX_BASE_IO 0xee000000 +#elif defined(CONFIG_MACH_TS72XX) +#define TSXXX_BASE_IO 0x01E00000 +#elif defined(CONFIG_X86) +#define TSXXX_BASE_IO 0x0 #endif -#define TSCAN1_BASE_IO 0x150 -#define TS7KV_BASE_IO 0xE0 -#define TSXXX_IO_RANGE 0x8 -#define TSXXX_CAN_RANGE 0x20 +//IRQs +#if defined(CONFIG_TS7800_PLATFORM) +#define TSXXX_IRQ5 64+5 +#define TSXXX_IRQ6 64+6 +#define TSXXX_IRQ7 64+7 +#elif defined(CONFIG_MACH_TS72XX) +#define TSXXX_IRQ5 22 +#define TSXXX_IRQ6 33 +#define TSXXX_IRQ7 40 +#elif defined(CONFIG_X86) +#define TSXXX_IRQ5 5 +#define TSXXX_IRQ6 6 +#define TSXXX_IRQ7 7 +#endif -#define TSXXX_ID0_REG 0x0 -#define TSXXX_ID1_REG 0x1 -#define TSXXX_PLD_REG 0x2 +#define TSCAN1_BASE_IO 0x150 +#define TSCAN1_IO_RANGE 0x8 +#define TSCAN1_CAN_RANGE 0x20 +#define TSCAN1_ID0_REG 0x0 +#define TSCAN1_ID1_REG 0x1 +#define TSCAN1_PLD_REG 0x2 #define TSCAN1_WIN_REG 0x4 #define TSCAN1_MOD_REG 0x5 #define TSCAN1_JMP_REG 0x6 -#define TS7KV_CTR1_REG 0x4 -#define TS7KV_CTR2_REG 0x5 -#define TS7KV_FPGA_REG 0x6 -#define TS7KV_JMP_REG 0x7 -#define TS7KV_WIN_REG 0x1E - -//IRQs -#ifdef CONFIG_ARM -#define TSXXX_IRQ5 5 -#define TSXXX_IRQ6 33 -#define TSXXX_IRQ7 40 -#endif - -#ifdef CONFIG_X86 -#define TSXXX_IRQ5 5 -#define TSXXX_IRQ6 6 -#define TSXXX_IRQ7 7 -#endif - - int tscan1_request_io(struct candevice_t *candev); int tscan1_release_io(struct candevice_t *candev); int tscan1_reset(struct candevice_t *candev); int tscan1_init_hw_data(struct candevice_t *candev); int tscan1_init_chip_data(struct candevice_t *candev, int chipnr); int tscan1_init_obj_data(struct canchip_t *chip, int objnr); -void tscan1_write_register(unsigned data, unsigned long address); -unsigned tscan1_read_register(unsigned long address); +void tscan1_write_register(unsigned data, can_ioptr_t address); +unsigned tscan1_read_register(can_ioptr_t address); int tscan1_program_irq(struct candevice_t *candev); - -unsigned long tscan1_getmappedaddr(unsigned long address); -unsigned short tscan1_getcandevidx(unsigned long address); -unsigned long tscan1_setpage_getaddr(unsigned long address, signed short *nwinbak, unsigned long *winaddr);