1 /**************************************************************************/
2 /* File: ns_dev_can.h - FPGA version of C_CAN ARM device specific */
3 /* Ported to FS Forth-Systeme GmbH A9M9750DEVx development boardscode */
5 /* LinCAN - (Not only) Linux CAN bus driver */
6 /* Copyright (C) 2002-2009 DCE FEE CTU Prague <http://dce.felk.cvut.cz> */
7 /* Copyright (C) 2002-2009 Pavel Pisa <pisa@cmp.felk.cvut.cz> */
8 /* Copyright (C) 2004 Sebastian Stolzenberg <stolzi@sebastian-stolzenberg.de> */
9 /* Copyright (C) 2005 Neil Bryan <nbryan@embebidos.com> */
10 /* Funded by OCERA and FRESCOR IST projects */
11 /* Based on CAN driver code by Arnaud Westenberg <arnaud@wanadoo.nl> */
12 /* and Ake Hedman, eurosource <akhe@eurosource.se> */
14 /* LinCAN is free software; you can redistribute it and/or modify it */
15 /* under terms of the GNU General Public License as published by the */
16 /* Free Software Foundation; either version 2, or (at your option) any */
17 /* later version. LinCAN is distributed in the hope that it will be */
18 /* useful, but WITHOUT ANY WARRANTY; without even the implied warranty */
19 /* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
20 /* General Public License for more details. You should have received a */
21 /* copy of the GNU General Public License along with LinCAN; see file */
22 /* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, */
23 /* Cambridge, MA 02139, USA. */
25 /* To allow use of LinCAN in the compact embedded systems firmware */
26 /* and RT-executives (RTEMS for example), main authors agree with next */
27 /* special exception: */
29 /* Including LinCAN header files in a file, instantiating LinCAN generics */
30 /* or templates, or linking other files with LinCAN objects to produce */
31 /* an application image/executable, does not by itself cause the */
32 /* resulting application image/executable to be covered by */
33 /* the GNU General Public License. */
34 /* This exception does not however invalidate any other reasons */
35 /* why the executable file might be covered by the GNU Public License. */
36 /* Publication of enhanced or derived LinCAN files is required although. */
37 /**************************************************************************/
39 #ifndef __NS_DEV_CAN__
40 #define __NS_DEV_CAN__
42 int ns_dev_init_hw_data(struct candevice_t *candev);
43 int ns_dev_init_chip_data(struct candevice_t *candev, int chipnr);
44 int ns_dev_request_io(struct candevice_t *candev);
45 int ns_dev_release_io(struct candevice_t *candev);
46 int ns_dev_reset(struct candevice_t *candev);
47 void ns_dev_write_register(unsigned data, can_ioptr_t address);
48 unsigned ns_dev_read_register(can_ioptr_t address);
50 int ns_dev_init_obj_data(struct canchip_t *chip, int objnr);
51 int ns_dev_program_irq(struct candevice_t *candev);
53 #define NS9750_PERIPHERAL_BASE_ADDRESS 0xA0700000
54 #define NS9750_PERIPHERAL_MAP_SIZE 0x400
55 #define NS9750_SYSTEM_CONTROLLER_OFFSET 0x240
57 #define BUS_WIDTH_16BIT 1
58 #define ACTIVE_LOW_CHIP_SELECT (1<<7)
60 #define C_CAN_CLOCK_INPUT_FREQUENCY 20000000
62 #endif /* __NS_DEV_CAN__ */