]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/sh7760.h
The LinCAN driver license unified according to DCE FEE CTU head and superiors request.
[lincan.git] / lincan / include / sh7760.h
1 /**************************************************************************/
2 /* File: sh7760.h - Renesas SH7760 HCAN2 integrated controller mappings   */
3 /*                                                                        */
4 /* LinCAN - (Not only) Linux CAN bus driver                               */
5 /* Copyright (C) 2002-2009 DCE FEE CTU Prague <http://dce.felk.cvut.cz>   */
6 /* Copyright (C) 2002-2009 Pavel Pisa <pisa@cmp.felk.cvut.cz>             */
7 /* Copyright (C) 2007-2008 Martin Petera <peterm4@fel.cvut.cz>            */
8 /* Funded by OCERA and FRESCOR IST projects                               */
9 /* Based on CAN driver code by Arnaud Westenberg <arnaud@wanadoo.nl>      */
10 /*                                                                        */
11 /* LinCAN is free software; you can redistribute it and/or modify it      */
12 /* under terms of the GNU General Public License as published by the      */
13 /* Free Software Foundation; either version 2, or (at your option) any    */
14 /* later version.  LinCAN is distributed in the hope that it will be      */
15 /* useful, but WITHOUT ANY WARRANTY; without even the implied warranty    */
16 /* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU    */
17 /* General Public License for more details. You should have received a    */
18 /* copy of the GNU General Public License along with LinCAN; see file     */
19 /* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,  */
20 /* Cambridge, MA 02139, USA.                                              */
21 /*                                                                        */
22 /* To allow use of LinCAN in the compact embedded systems firmware        */
23 /* and RT-executives (RTEMS for example), main authors agree with next    */
24 /* special exception:                                                     */
25 /*                                                                        */
26 /* Including LinCAN header files in a file, instantiating LinCAN generics */
27 /* or templates, or linking other files with LinCAN objects to produce    */
28 /* an application image/executable, does not by itself cause the          */
29 /* resulting application image/executable to be covered by                */
30 /* the GNU General Public License.                                        */
31 /* This exception does not however invalidate any other reasons           */
32 /* why the executable file might be covered by the GNU Public License.    */
33 /* Publication of enhanced or derived LinCAN files is required although.  */
34 /**************************************************************************/
35
36 #define NR_82527        0
37 #define NR_SJA1000      0
38 #define NR_ALL          2
39
40 #define SH7760_CAN_IRQ          56
41 #define SH7760_CAN_CHIP_OFFSET  0x10000
42 #define SH7760_CAN_CLOCK        33333330          /* 33.3 MHz */
43
44 #define IO_RANGE                0x10000
45
46 /* static CAN_DEFINE_SPINLOCK(sh7760_port_lock); */
47
48
49
50 int sh7760_request_io(struct candevice_t *candev);
51 int sh7760_release_io(struct candevice_t *candev);
52 int sh7760_reset(struct candevice_t *candev); 
53 int sh7760_init_hw_data(struct candevice_t *candev);
54 int sh7760_init_chip_data(struct candevice_t *candev, int chipnr);
55 int sh7760_init_obj_data(struct canchip_t *chip, int objnr);
56 int sh7760_program_irq(struct candevice_t *candev);
57 void sh7760_write_register(unsigned data, can_ioptr_t address);
58 unsigned sh7760_read_register(can_ioptr_t address);
59