2 * ISP Firmware Modules for FreeBSD
4 * Copyright (c) 2000, 2001, 2006 by Matthew Jacob
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice immediately at the beginning of the file, without modification,
12 * this list of conditions, and the following disclaimer.
13 * 2. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
32 #include <sys/param.h>
33 #include <sys/kernel.h>
34 #include <sys/module.h>
35 #include <sys/param.h>
36 #include <sys/systm.h>
37 #include <sys/linker.h>
38 #include <sys/firmware.h>
40 #if defined(ISP_ALL) || !defined(KLD_MODULE)
46 #define ISP_12160_IT 1
55 #define MODULE_NAME "ispfw"
58 #if defined(ISP_1040) || defined(ISP_1040_IT)
59 #include <dev/ispfw/asm_1040.h>
61 #if defined(ISP_1080) || defined(ISP_1080_IT)
62 #include <dev/ispfw/asm_1080.h>
64 #if defined(ISP_12160) || defined(ISP_12160_IT)
65 #include <dev/ispfw/asm_12160.h>
68 #include <dev/ispfw/asm_2100.h>
71 #include <dev/ispfw/asm_2200.h>
74 #include <dev/ispfw/asm_2300.h>
77 #include <dev/ispfw/asm_2322.h>
80 #include <dev/ispfw/asm_2400.h>
83 #include <dev/ispfw/asm_1000.h>
86 #define ISPFW_VERSION 1
87 #define RMACRO(token) \
88 if (firmware_register(#token, token##_risc_code, \
89 token##_risc_code [3] * sizeof token##_risc_code [3], \
90 ISPFW_VERSION, NULL) == NULL) { \
91 printf("unable to register firmware '%s'\n", #token); \
93 printf("registered firmware set <%s>\n", #token); \
96 #define UMACRO(token) \
97 firmware_unregister(#token); \
98 printf("unregistered firmware set <%s>\n", #token);
103 #if defined(ISP_1000)
106 #if defined(ISP_1040)
109 #if defined(ISP_1040_IT)
112 #if defined(ISP_1080)
115 #if defined(ISP_1080_IT)
118 #if defined(ISP_12160)
121 #if defined(ISP_12160_IT)
122 RMACRO(isp_12160_it);
124 #if defined(ISP_2100)
127 #if defined(ISP_2200)
130 #if defined(ISP_2300)
133 #if defined(ISP_2322)
136 #if defined(ISP_2400)
145 #if defined(ISP_1000)
147 #elif defined(ISP_1040)
149 #elif defined(ISP_1040_IT)
151 #elif defined(ISP_1080)
153 #elif defined(ISP_1080_IT)
155 #elif defined(ISP_12160)
157 #elif defined(ISP_12160_IT)
158 UMACRO(isp_12160_it);
159 #elif defined(ISP_2100)
161 #elif defined(ISP_2200)
163 #elif defined(ISP_2300)
165 #elif defined(ISP_2322)
167 #elif defined(ISP_2400)
174 module_handler(module_t mod, int what, void *arg)
190 static moduledata_t ispfw_mod = {
191 MODULE_NAME, module_handler, NULL
194 DECLARE_MODULE(isp, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
196 #if defined(ISP_1000)
197 DECLARE_MODULE(isp_1000, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
198 #elif defined(ISP_1040)
199 DECLARE_MODULE(isp_1040, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
200 #elif defined(ISP_1040_IT)
201 DECLARE_MODULE(isp_1040_it, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
202 #elif defined(ISP_1080)
203 DECLARE_MODULE(isp_1080, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
204 #elif defined(ISP_1080_IT)
205 DECLARE_MODULE(isp_1080_it, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
206 #elif defined(ISP_12160)
207 DECLARE_MODULE(isp_12160, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
208 #elif defined(ISP_12160_IT)
209 DECLARE_MODULE(isp_12160_IT, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
210 #elif defined(ISP_2100)
211 DECLARE_MODULE(isp_2100, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
212 #elif defined(ISP_2200)
213 DECLARE_MODULE(isp_2200, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
214 #elif defined(ISP_2300)
215 DECLARE_MODULE(isp_2300, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
216 #elif defined(ISP_2322)
217 DECLARE_MODULE(isp_2322, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
218 #elif defined(ISP_2400)
219 DECLARE_MODULE(isp_2400, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);