1 /**************************************************************************/
2 /* File: boardslist.c - list to translate hardware option to board struct */
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> */
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. */
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: */
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 /**************************************************************************/
35 #include "../include/can.h"
36 #include "../include/can_sysdep.h"
37 #include "../include/main.h"
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 pimx1_register(struct hwspecops_t *hwspecops);
61 extern int msmcan_register(struct hwspecops_t *hwspecops);
62 extern int unican_register(struct hwspecops_t *hwspecops);
63 extern int unican_pci_register(struct hwspecops_t *hwspecops);
64 extern int unican_vme_register(struct hwspecops_t *hwspecops);
65 extern int ipci165_register(struct hwspecops_t *hwspecops);
66 extern int pcan_dongle_register(struct hwspecops_t *hwspecops);
67 extern int eb8245_register(struct hwspecops_t *hwspecops);
68 extern int adlink7841_register(struct hwspecops_t *hwspecops);
69 extern int tscan1_register(struct hwspecops_t *hwspecops);
70 extern int tscan1mmio_register(struct hwspecops_t *hwspecops);
71 extern int ts7kv_register(struct hwspecops_t *hwspecops);
72 extern int ns_dev_register(struct hwspecops_t *hwspecops);
73 extern int hms30c7202_register(struct hwspecops_t *hwspecops);
74 extern int nsi_canpci_register(struct hwspecops_t *hwspecops);
75 extern int usbcan_register(struct hwspecops_t *hwspecops);
76 extern int omap2_spican_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);
84 const struct boardtype_t can_boardtypes[]={
85 #ifdef CONFIG_OC_LINCAN_CARD_template
86 {"template", template_register, 1},
88 #ifdef CONFIG_OC_LINCAN_CARD_virtual
89 {"virtual", virtual_register, 0},
91 #ifdef CONFIG_OC_LINCAN_CARD_oscar
92 {"oscar", oscar_register, 1},
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},
100 #ifdef CONFIG_OC_LINCAN_CARD_smartcan
101 {"smartcan", smartcan_register, 1},
103 #ifdef CONFIG_OC_LINCAN_CARD_nsi
104 {"nsican", nsi_register, 1},
106 #ifdef CONFIG_OC_LINCAN_CARD_cc_can104
107 {"cc104", cc104_register, 1},
109 #ifdef CONFIG_OC_LINCAN_CARD_aim104
110 {"aim104", aim104_register, 1},
112 #ifdef CONFIG_OC_LINCAN_CARD_pc_i03
113 {"pc-i03", pci03_register, 1},
115 #ifdef CONFIG_OC_LINCAN_CARD_pcm3680
116 {"pcm3680", pcm3680_register, 2},
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},
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},
129 #if defined(CONFIG_OC_LINCAN_CARD_ems_cpcpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
130 {"ems_cpcpci", ems_cpcpci_register, 0},
132 #ifdef CONFIG_OC_LINCAN_CARD_m437
133 {"m437", m437_register, 1},
135 #ifdef CONFIG_OC_LINCAN_CARD_pcccan
136 {"pcccan", pcccan_register, 1},
138 #ifdef CONFIG_OC_LINCAN_CARD_ssv
139 {"ssv", ssv_register, 2},
141 #ifdef CONFIG_OC_LINCAN_CARD_bfadcan
142 {"bfadcan", bfadcan_register, 1},
144 #ifdef CONFIG_OC_LINCAN_CARD_gensja1000mm
145 {"gensja1000mm", gensja1000mm_register, 1},
147 #ifdef CONFIG_OC_LINCAN_CARD_gensja1000io
148 {"gensja1000io", gensja1000io_register, 1},
150 #ifdef CONFIG_OC_LINCAN_CARD_pimx1
151 {"pimx1", pimx1_register, 0},
153 #ifdef CONFIG_OC_LINCAN_CARD_msmcan
154 {"msmcan", msmcan_register, 1},
156 #ifdef CONFIG_OC_LINCAN_CARD_unican
157 {"unican", unican_register, 1},
159 #ifdef CONFIG_OC_LINCAN_CARD_ipci165
160 {"ipci165", ipci165_register, 0},
162 #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_PCI_SUPPORT)
163 {"unican-pci", unican_pci_register, 0},
165 #if defined(CONFIG_OC_LINCAN_CARD_unican)&&defined(CAN_ENABLE_VME_SUPPORT)
166 {"unican-vme", unican_vme_register, 1},
168 #if defined(CONFIG_OC_LINCAN_CARD_pcan_dongle)
169 {"pcan_dongle", pcan_dongle_register, 1},
171 #if defined(CONFIG_OC_LINCAN_CARD_eb8245)
172 {"eb8245", eb8245_register, 1},
174 #if defined(CONFIG_OC_LINCAN_CARD_adlink7841)
175 {"adlink7841", adlink7841_register, 0},
177 #if defined(CONFIG_OC_LINCAN_CARD_esdpci200)
178 {"esdpci200", esdpci200_register, 0},
180 #if defined(CONFIG_OC_LINCAN_CARD_esdpci266)
181 {"esdpci266", esdpci200_register, 0},
183 #if defined(CONFIG_OC_LINCAN_CARD_tscan1)
184 {"tscan1", tscan1_register, 1},
185 {"tscan1mmio", tscan1mmio_register, 1},
187 #if defined(CONFIG_OC_LINCAN_CARD_ts7kv)
188 {"ts7kv", ts7kv_register, 1},
190 #if defined(CONFIG_OC_LINCAN_CARD_ns_dev_can)
191 {"ns_dev", ns_dev_register, 1},
193 #if defined(CONFIG_OC_LINCAN_CARD_sh7760)
194 {"sh7760", sh7760_register, 2},
196 #if defined(CONFIG_OC_LINCAN_CARD_hms30c7202_can)
197 {"hms30c7202", hms30c7202_register, 1},
199 #if defined(CONFIG_OC_LINCAN_CARD_nsi_canpci)&&defined(CAN_ENABLE_PCI_SUPPORT)
200 {"nsicanpci", nsi_canpci_register, 1},
202 #if defined(CONFIG_OC_LINCAN_CARD_pcan_pci)&&defined(CAN_ENABLE_PCI_SUPPORT)
203 {"pcan_pci", pcan_pci_register, 0},
205 #if defined(CONFIG_OC_LINCAN_CARD_usbcan)
206 {"usbcan", usbcan_register, 0},
208 #if defined(CONFIG_OC_LINCAN_CARD_omap2_spican)
209 {"omap2_spican", omap2_spican_register, 0},
211 #if defined(CONFIG_OC_LINCAN_CARD_mpc5200)
212 {"mpc5200", mpc5200_register, 0},
213 {"mpc5200_midam", mpc5200_midam_register, 0},
218 const struct boardtype_t* boardtype_find(const char *str)
220 const struct boardtype_t *brp;
222 for(brp=can_boardtypes;brp->boardtype;brp++) {
223 if(!strcmp(str,brp->boardtype))