]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/src/boardlist.c
Included support for directly mapped SJA1000 into PCI mem region 0.
[lincan.git] / lincan / src / boardlist.c
1 /**************************************************************************/
2 /* File: boardslist.c - list to translate hardware option to board struct */
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 /* Funded by OCERA and FRESCOR IST projects                               */
8 /* Based on CAN driver code by Arnaud Westenberg <arnaud@wanadoo.nl>      */
9 /*                                                                        */
10 /* LinCAN is free software; you can redistribute it and/or modify it      */
11 /* under terms of the GNU General Public License as published by the      */
12 /* Free Software Foundation; either version 2, or (at your option) any    */
13 /* later version.  LinCAN is distributed in the hope that it will be      */
14 /* useful, but WITHOUT ANY WARRANTY; without even the implied warranty    */
15 /* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU    */
16 /* General Public License for more details. You should have received a    */
17 /* copy of the GNU General Public License along with LinCAN; see file     */
18 /* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,  */
19 /* Cambridge, MA 02139, USA.                                              */
20 /*                                                                        */
21 /* To allow use of LinCAN in the compact embedded systems firmware        */
22 /* and RT-executives (RTEMS for example), main authors agree with next    */
23 /* special exception:                                                     */
24 /*                                                                        */
25 /* Including LinCAN header files in a file, instantiating LinCAN generics */
26 /* or templates, or linking other files with LinCAN objects to produce    */
27 /* an application image/executable, does not by itself cause the          */
28 /* resulting application image/executable to be covered by                */
29 /* the GNU General Public License.                                        */
30 /* This exception does not however invalidate any other reasons           */
31 /* why the executable file might be covered by the GNU Public License.    */
32 /* Publication of enhanced or derived LinCAN files is required although.  */
33 /**************************************************************************/
34
35 #include "../include/can.h"
36 #include "../include/can_sysdep.h"
37 #include "../include/main.h"
38
39 extern int template_register(struct hwspecops_t *hwspecops);
40 extern int virtual_register(struct hwspecops_t *hwspecops);
41 extern int oscar_register(struct hwspecops_t *hwspecops);
42 extern int pip_register(struct hwspecops_t *hwspecops);
43 extern int m437_register(struct hwspecops_t *hwspecops);
44 extern int smartcan_register(struct hwspecops_t *hwspecops);
45 extern int pccanf_register(struct hwspecops_t *hwspecops);
46 extern int pccand_register(struct hwspecops_t *hwspecops);
47 extern int pccanq_register(struct hwspecops_t *hwspecops);
48 extern int kv_pcican_register(struct hwspecops_t *hwspecops);
49 extern int ems_cpcpci_register(struct hwspecops_t *hwspecops);
50 extern int nsi_register(struct hwspecops_t *hwspecops);
51 extern int cc104_register(struct hwspecops_t *hwspecops);
52 extern int pci03_register(struct hwspecops_t *hwspecops);
53 extern int pcm3680_register(struct hwspecops_t *hwspecops);
54 extern int aim104_register(struct hwspecops_t *hwspecops);
55 extern int pcccan_register(struct hwspecops_t *hwspecops);
56 extern int ssv_register(struct hwspecops_t *hwspecops);
57 extern int bfadcan_register(struct hwspecops_t *hwspecops);
58 extern int gensja1000mm_register(struct hwspecops_t *hwspecops);
59 extern int gensja1000io_register(struct hwspecops_t *hwspecops);
60 extern int pcisja1000mm_register(struct hwspecops_t *hwspecops);
61 extern int pimx1_register(struct hwspecops_t *hwspecops);
62 extern int msmcan_register(struct hwspecops_t *hwspecops);
63 extern int unican_register(struct hwspecops_t *hwspecops);
64 extern int unican_pci_register(struct hwspecops_t *hwspecops);
65 extern int unican_vme_register(struct hwspecops_t *hwspecops);
66 extern int ipci165_register(struct hwspecops_t *hwspecops);
67 extern int pcan_dongle_register(struct hwspecops_t *hwspecops);
68 extern int eb8245_register(struct hwspecops_t *hwspecops);
69 extern int adlink7841_register(struct hwspecops_t *hwspecops);
70 extern int tscan1_register(struct hwspecops_t *hwspecops);
71 extern int tscan1mmio_register(struct hwspecops_t *hwspecops);
72 extern int ts7kv_register(struct hwspecops_t *hwspecops);
73 extern int ns_dev_register(struct hwspecops_t *hwspecops);
74 extern int hms30c7202_register(struct hwspecops_t *hwspecops);
75 extern int nsi_canpci_register(struct hwspecops_t *hwspecops);
76 extern int usbcan_register(struct hwspecops_t *hwspecops);
77 extern int pcan_pci_register(struct hwspecops_t *hwspecops);
78 extern int esdpci200_register(struct hwspecops_t *hwspecops);
79 extern int esdpci266_register(struct hwspecops_t *hwspecops);
80 extern int sh7760_register(struct hwspecops_t *hwspecops);
81 extern int mpc5200_register(struct hwspecops_t *hwspecops);
82 extern int mpc5200_midam_register(struct hwspecops_t *hwspecops);
83
84 const struct boardtype_t can_boardtypes[]={
85     #ifdef CONFIG_OC_LINCAN_CARD_template
86         {"template", template_register, 1},
87     #endif
88     #ifdef CONFIG_OC_LINCAN_CARD_virtual
89         {"virtual", virtual_register, 0},
90     #endif
91     #ifdef CONFIG_OC_LINCAN_CARD_oscar
92         {"oscar", oscar_register, 1},
93     #endif
94     #ifdef CONFIG_OC_LINCAN_CARD_pip
95         {"pip5", pip_register, 1},
96         {"pip6", pip_register, 1},
97         {"pip7", pip_register, 1},
98         {"pip8", pip_register, 1},
99     #endif
100     #ifdef CONFIG_OC_LINCAN_CARD_smartcan
101         {"smartcan", smartcan_register, 1},
102     #endif
103     #ifdef CONFIG_OC_LINCAN_CARD_nsi
104         {"nsican", nsi_register, 1},
105     #endif
106     #ifdef CONFIG_OC_LINCAN_CARD_cc_can104
107         {"cc104", cc104_register, 1},
108     #endif
109     #ifdef CONFIG_OC_LINCAN_CARD_aim104
110         {"aim104", aim104_register, 1},
111     #endif
112     #ifdef CONFIG_OC_LINCAN_CARD_pc_i03
113         {"pc-i03", pci03_register, 1},
114     #endif
115     #ifdef CONFIG_OC_LINCAN_CARD_pcm3680
116         {"pcm3680", pcm3680_register, 2},
117     #endif
118     #ifdef CONFIG_OC_LINCAN_CARD_pccan
119         {"pccan-f", pccanf_register, 1},
120         {"pccan-s", pccanf_register, 1},
121         {"pccan-d", pccand_register, 2},
122         {"pccan-q", pccanq_register, 4},
123     #endif
124     #if defined(CONFIG_OC_LINCAN_CARD_kv_pcican)&&defined(CAN_ENABLE_PCI_SUPPORT)
125         {"pcican-s", kv_pcican_register, 0},
126         {"pcican-d", kv_pcican_register, 0},
127         {"pcican-q", kv_pcican_register, 0},
128     #endif
129     #if defined(CONFIG_OC_LINCAN_CARD_ems_cpcpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
130         {"ems_cpcpci", ems_cpcpci_register, 0},
131     #endif
132     #ifdef CONFIG_OC_LINCAN_CARD_m437
133         {"m437", m437_register, 1},
134     #endif
135     #ifdef CONFIG_OC_LINCAN_CARD_pcccan
136         {"pcccan", pcccan_register, 1},
137     #endif
138     #ifdef CONFIG_OC_LINCAN_CARD_ssv
139         {"ssv", ssv_register, 2},
140     #endif
141     #ifdef CONFIG_OC_LINCAN_CARD_bfadcan
142         {"bfadcan", bfadcan_register, 1},
143     #endif
144     #ifdef CONFIG_OC_LINCAN_CARD_gensja1000mm
145         {"gensja1000mm", gensja1000mm_register, 1},
146     #endif
147     #ifdef CONFIG_OC_LINCAN_CARD_gensja1000io
148         {"gensja1000io", gensja1000io_register, 1},
149     #endif
150     #ifdef CONFIG_OC_LINCAN_CARD_pcisja1000mm
151         {"pcisja1000mm", pcisja1000mm_register, 0},
152     #endif
153     #ifdef CONFIG_OC_LINCAN_CARD_pimx1
154         {"pimx1", pimx1_register, 0},
155     #endif
156     #ifdef CONFIG_OC_LINCAN_CARD_msmcan
157         {"msmcan", msmcan_register, 1},
158     #endif
159     #ifdef CONFIG_OC_LINCAN_CARD_unican
160         {"unican", unican_register, 1},
161     #endif
162     #ifdef CONFIG_OC_LINCAN_CARD_ipci165
163         {"ipci165", ipci165_register, 0},
164     #endif
165     #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_PCI_SUPPORT)
166         {"unican-pci", unican_pci_register, 0},
167     #endif
168     #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_VME_SUPPORT)
169         {"unican-vme", unican_vme_register, 1},
170     #endif
171     #if defined(CONFIG_OC_LINCAN_CARD_pcan_dongle)
172         {"pcan_dongle", pcan_dongle_register, 1},
173     #endif
174     #if defined(CONFIG_OC_LINCAN_CARD_eb8245)
175         {"eb8245", eb8245_register, 1},
176     #endif
177     #if defined(CONFIG_OC_LINCAN_CARD_adlink7841)
178         {"adlink7841", adlink7841_register, 0},
179     #endif
180     #if defined(CONFIG_OC_LINCAN_CARD_esdpci200)
181         {"esdpci200", esdpci200_register, 0},
182     #endif
183     #if defined(CONFIG_OC_LINCAN_CARD_esdpci266)
184         {"esdpci266", esdpci200_register, 0},
185     #endif
186     #if defined(CONFIG_OC_LINCAN_CARD_tscan1)
187         {"tscan1", tscan1_register, 1},
188         {"tscan1mmio", tscan1mmio_register, 1},
189     #endif
190     #if defined(CONFIG_OC_LINCAN_CARD_ts7kv)
191         {"ts7kv",  ts7kv_register, 1},
192     #endif
193     #if defined(CONFIG_OC_LINCAN_CARD_ns_dev_can)
194         {"ns_dev", ns_dev_register, 1},
195     #endif
196     #if defined(CONFIG_OC_LINCAN_CARD_sh7760)
197         {"sh7760", sh7760_register, 2},
198     #endif
199     #if defined(CONFIG_OC_LINCAN_CARD_hms30c7202_can)
200         {"hms30c7202", hms30c7202_register, 1},
201     #endif
202     #if defined(CONFIG_OC_LINCAN_CARD_nsi_canpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
203         {"nsicanpci", nsi_canpci_register, 1},
204     #endif
205     #if defined(CONFIG_OC_LINCAN_CARD_pcan_pci)&&defined(CAN_ENABLE_PCI_SUPPORT)
206         {"pcan_pci", pcan_pci_register, 0},
207     #endif
208     #if defined(CONFIG_OC_LINCAN_CARD_usbcan)
209         {"usbcan", usbcan_register, 0},
210     #endif
211     #if defined(CONFIG_OC_LINCAN_CARD_mpc5200)
212         {"mpc5200", mpc5200_register, 0},
213         {"mpc5200_midam", mpc5200_midam_register, 0},
214     #endif
215         {NULL}
216 };
217
218 const struct boardtype_t* boardtype_find(const char *str)
219 {
220         const struct boardtype_t *brp;
221
222         for(brp=can_boardtypes;brp->boardtype;brp++) {
223                 if(!strcmp(str,brp->boardtype))
224                         return brp;
225         }
226
227         return NULL;
228 }