]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/tscan1.h
TS-CAN1 and TS-7KV support separated and updated. Needs testing.
[lincan.git] / lincan / include / tscan1.h
1 /* tscan1.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
14 //MEMORY SECTION
15 #if defined(CONFIG_TS7800_PLATFORM)
16 #define TSXXX_BASE_IO   0xee000000
17 #elif defined(CONFIG_MACH_TS72XX)
18 #define TSXXX_BASE_IO   0x01E00000
19 #elif defined(CONFIG_X86)
20 #define TSXXX_BASE_IO   0x0
21 #endif
22
23 //IRQs
24 #if defined(CONFIG_TS7800_PLATFORM)
25 #define TSXXX_IRQ5              64+5
26 #define TSXXX_IRQ6              64+6
27 #define TSXXX_IRQ7              64+7
28 #elif defined(CONFIG_MACH_TS72XX)
29 #define TSXXX_IRQ5              22
30 #define TSXXX_IRQ6              33
31 #define TSXXX_IRQ7              40
32 #elif defined(CONFIG_X86)
33 #define TSXXX_IRQ5              5
34 #define TSXXX_IRQ6              6
35 #define TSXXX_IRQ7              7
36 #endif
37
38 #define TSCAN1_BASE_IO  0x150
39 #define TSCAN1_IO_RANGE 0x8
40 #define TSCAN1_CAN_RANGE        0x20
41
42 #define TSCAN1_ID0_REG  0x0
43 #define TSCAN1_ID1_REG  0x1
44 #define TSCAN1_PLD_REG  0x2
45 #define TSCAN1_WIN_REG  0x4
46 #define TSCAN1_MOD_REG  0x5
47 #define TSCAN1_JMP_REG  0x6
48
49 int tscan1_request_io(struct candevice_t *candev);
50 int tscan1_release_io(struct candevice_t *candev);
51 int tscan1_reset(struct candevice_t *candev);
52 int tscan1_init_hw_data(struct candevice_t *candev);
53 int tscan1_init_chip_data(struct candevice_t *candev, int chipnr);
54 int tscan1_init_obj_data(struct canchip_t *chip, int objnr);
55 void tscan1_write_register(unsigned data, can_ioptr_t address);
56 unsigned tscan1_read_register(can_ioptr_t address);
57 int tscan1_program_irq(struct candevice_t *candev);