]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/tscan1.h
Merge branch 'master' into can-usb1
[lincan.git] / lincan / include / tscan1.h
1 /* template.h
2  * Header file for the Linux CAN-bus driver.
3  * Written by Arnaud Westenberg email:arnaud@wanadoo.nl
4  * Rewritten for new CAN queues by Pavel Pisa - OCERA team member
5  * email:pisa@cmp.felk.cvut.cz
6  * This software is released under the GPL-License.
7  * Version lincan-0.3  17 Jun 2004
8  */
9
10 //Ids SECTION
11 #define TSCAN1_ID0              0xF6
12 #define TSCAN1_ID1              0xB9
13 #define TS7KV_ID0               0x41
14 #define TS7KV_ID1               0x20
15
16 //MEMORY SECTION
17 #ifdef CONFIG_ARM
18 #include <asm-arm/arch-ep93xx/regmap.h>
19 #define TSXXX_BASE_IO   0x01E00000
20 #endif
21
22 #define TSCAN1_BASE_IO  0x150
23 #define TS7KV_BASE_IO   0xE0
24 #define TSXXX_IO_RANGE  0x8
25 #define TSXXX_CAN_RANGE 0x20
26
27 #define TSXXX_ID0_REG   0x0
28 #define TSXXX_ID1_REG   0x1
29 #define TSXXX_PLD_REG   0x2
30
31 #define TSCAN1_WIN_REG  0x4
32 #define TSCAN1_MOD_REG  0x5
33 #define TSCAN1_JMP_REG  0x6
34
35 #define TS7KV_CTR1_REG  0x4
36 #define TS7KV_CTR2_REG  0x5
37 #define TS7KV_FPGA_REG  0x6
38 #define TS7KV_JMP_REG   0x7
39 #define TS7KV_WIN_REG   0x1E
40
41 //IRQs
42 #ifdef CONFIG_ARM
43 #define TSXXX_IRQ5              5
44 #define TSXXX_IRQ6              33
45 #define TSXXX_IRQ7              40
46 #endif
47
48 #ifdef CONFIG_X86
49 #define TSXXX_IRQ5              5
50 #define TSXXX_IRQ6              6
51 #define TSXXX_IRQ7              7
52 #endif
53
54
55 int tscan1_request_io(struct candevice_t *candev);
56 int tscan1_release_io(struct candevice_t *candev);
57 int tscan1_reset(struct candevice_t *candev);
58 int tscan1_init_hw_data(struct candevice_t *candev);
59 int tscan1_init_chip_data(struct candevice_t *candev, int chipnr);
60 int tscan1_init_obj_data(struct canchip_t *chip, int objnr);
61 void tscan1_write_register(unsigned data, can_ioptr_t address);
62 unsigned tscan1_read_register(can_ioptr_t address);
63 int tscan1_program_irq(struct candevice_t *candev);
64
65 unsigned long tscan1_getmappedaddr(unsigned long address);
66 unsigned short tscan1_getcandevidx(unsigned long address);
67 unsigned long tscan1_setpage_getaddr(unsigned long address, signed short *nwinbak, unsigned long *winaddr);