source: rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h @ 459d67d

55-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since 459d67d was 459d67d, checked in by Chris Johns <chrisj@…>, on 06/27/16 at 03:35:08

Move the Nexus bus driver decls available to users.

  • Property mode set to 100644
File size: 9.9 KB
Line 
1/*
2 * Copyright (c) 2013-2015 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * Copyright (c) 2016 Chris Johns <chrisj@rtems.org> All rights reserved.
11
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 *    notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 *    notice, this list of conditions and the following disclaimer in the
19 *    documentation and/or other materials provided with the distribution.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34/*
35 * The Nexus bus devices.
36 *
37 * Driver Summary is:
38 *
39 *  Devices:
40 *   RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0
41 *
42 *  Buses:
43 *   RTEMS_BSD_DRIVER_PC_LEGACY
44 *
45 *  USB:
46 *   RTEMS_BSD_DRIVER_DWCOTG0
47 *   RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR
48 *    RTEMS_BSD_DRIVER_DWCOTG0_IRQ
49 *   RTEMS_BSD_DRIVER_DWC_MMC
50 *   RTEMS_BSD_DRIVER_MMC
51 *   RTEMS_BSD_DRIVER_USB
52 *   RTEMS_BSD_DRIVER_USB_MASS
53 *
54 *  Networking:
55 *   RTEMS_BSD_DRIVER_SMC0
56 *    RTEMS_BSD_DRIVER_SMC0_BASE_ADDR
57 *    RTEMS_BSD_DRIVER_SMC0_IRQ
58 *   RTEMS_BSD_DRIVER_FEC
59 *   RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0
60 *    RTEMS_BSD_DRIVER_CGEM0_IRQ
61 *   RTEMS_BSD_DRIVER_DWC0
62 *    RTEMS_BSD_DRIVER_DWC0_BASE_ADDR
63 *    RTEMS_BSD_DRIVER_DWC0_IRQ
64 *   RTEMS_BSD_DRIVER_TSEC
65 *    RTEMS_BSD_DRIVER_TSEC_BASE_ADDR
66 *    RTEMS_BSD_DRIVER_TSEC_TX_IRQ
67 *    RTEMS_BSD_DRIVER_TSEC_RX_IRQ
68 *    RTEMS_BSD_DRIVER_TSEC_ER_IRQ
69 *   RTEMS_BSD_DRIVER_PCI_LEM
70 *   RTEMS_BSD_DRIVER_PCI_IGB
71 *   RTEMS_BSD_DRIVER_PCI_EM
72 *   RTEMS_BSD_DRIVER_PCI_RE
73 *
74 *  MMI PHY:
75 *   RTEMS_BSD_DRIVER_E1000PHY
76 *   RTEMS_BSD_DRIVER_REPHY
77 *   RTEMS_BSD_DRIVER_MIPHY
78 */
79
80#if !defined(RTEMS_BSD_NEXUS_BUS_h)
81#define RTEMS_BSD_NEXUS_BUS_h
82
83#include <rtems/bsd/bsd.h>
84
85#ifdef __cplusplus
86extern "C" {
87#endif /* __cplusplus */
88
89/**
90 * Keep the order of the groups.
91 **/
92
93/**
94 ** Devices
95 **
96 **/
97
98/*
99 * Xilinx Zynq System Level Control Core 0 (SLCR0).
100 */
101#if defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0)
102/*
103 * Hard IP part of the Zynq so a fixed address.
104 */
105static const rtems_bsd_device_resource zy7_slcr0_res[] = {
106  {
107    .type = RTEMS_BSD_RES_MEMORY,
108    .start_request = 0,
109    .start_actual = 0xf8000000
110  }
111};
112RTEMS_BSD_DEFINE_NEXUS_DEVICE(zy7_slcr, 0,
113                              RTEMS_ARRAY_SIZE(zy7_slcr0_res),
114                              &zy7_slcr0_res[0]);
115#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0 */
116
117/**
118 ** Physical Buses
119 **/
120
121/*
122 * PC legacy bus.
123 */
124#if defined(RTEMS_BSD_DRIVER_PC_LEGACY)
125#define RTEMS_BSD_DRIVER_HAS_PCI
126RTEMS_BSD_DEFINE_NEXUS_DEVICE(legacy, 0, 0, NULL);
127SYSINIT_DRIVER_REFERENCE(pcib, legacy);
128SYSINIT_DRIVER_REFERENCE(pci, pcib);
129#endif /* RTEMS_BSD_DRIVER_PC_LEGACY */
130
131/**
132 ** USB
133 **/
134
135/*
136 * Designware/Synopsys OTG USB Controller.
137 */
138#if defined(RTEMS_BSD_DRIVER_DWCOTG0)
139#define RTEMS_BSD_DRIVER_USB
140#if !defined(RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR)
141 #error DWCOTG0 base address not defined (RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR)
142#endif
143#if !defined(RTEMS_BSD_DRIVER_DWC0_IRQ)
144 #error DWCOTG0 IRQ not defined (RTEMS_BSD_DRIVER_DWCOTG0_IRQ)
145#endif
146static const rtems_bsd_device_resource dwcotg0_res[] = {
147  {
148    .type = RTEMS_BSD_RES_MEMORY,
149    .start_request = 0,
150    .start_actual = RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR
151  }, {
152    .type = RTEMS_BSD_RES_IRQ,
153    .start_request = 0,
154    .start_actual = RTEMS_BSD_DRIVER_DWCOTG0_IRQ
155  }
156};
157RTEMS_BSD_DEFINE_NEXUS_DEVICE(dwcotg, 0,
158                              RTEMS_ARRAY_SIZE(dwcotg0_res),
159                              &dwcotg0_res[0]);
160#endif /* RTEMS_BSD_DRIVER_DWCOTG0 */
161
162/*
163 * Designware/Synopsys MMC.
164 */
165#if defined(RTEMS_BSD_DRIVER_DWC_MMC)
166#define RTEMS_BSD_DRIVER_MMC
167RTEMS_BSD_DEFINE_NEXUS_DEVICE(dw_mmc, 0, 0, NULL);
168SYSINIT_DRIVER_REFERENCE(mmc, dw_mmc);
169#endif /* RTEMS_BSD_DRIVER_DWC_MMC */
170
171/*
172 * MMC Driver.
173 */
174#if defined(RTEMS_BSD_DRIVER_MMC)
175SYSINIT_DRIVER_REFERENCE(mmcsd, mmc);
176#endif /* RTEMS_BSD_DRIVER_MMC */
177
178/*
179 * USB Drivers.
180 */
181#if defined(RTEMS_BSD_DRIVER_USB)
182SYSINIT_REFERENCE(usb_quirk_init);
183SYSINIT_DRIVER_REFERENCE(uhub, usbus);
184#endif /* RTEMS_BSD_DRIVER_USB */
185
186/*
187 * USB Mass Storage Class driver.
188 */
189#if defined(RTEMS_BSD_DRIVER_USB_MASS)
190SYSINIT_DRIVER_REFERENCE(umass, uhub);
191#endif /* RTEMS_BSD_DRIVER_USB_MASS */
192
193/**
194 ** Networking
195 **/
196
197/*
198 * SMC0 driver
199 */
200#if defined(RTEMS_BSD_DRIVER_SMC0)
201#if !defined(RTEMS_BSD_DRIVER_SMC0_BASE_ADDR)
202 #error SMC base address not defined (RTEMS_BSD_DRIVER_SMC0_BASE_ADDR)
203#endif
204#if !defined(RTEMS_BSD_DRIVER_SMC0_IRQ)
205 #error SMC IRQ not defined (RTEMS_BSD_DRIVER_SMC0_IRQ)
206#endif
207static const rtems_bsd_device_resource smc0_res[] = {
208  {
209    .type = RTEMS_BSD_RES_MEMORY,
210    .start_request = 0,
211    .start_actual = RTEMS_BSD_DRIVER_SMC0_BASE_ADDR
212  }, {
213    .type = RTEMS_BSD_RES_IRQ,
214    .start_request = 0,
215    .start_actual = RTEMS_BSD_DRIVER_SMC0_IRQ
216  }
217};
218RTEMS_BSD_DEFINE_NEXUS_DEVICE(smc, 0,
219                              RTEMS_ARRAY_SIZE(smc0_res),
220                              &smc0_res[0]);
221#endif /* RTEMS_BSD_DRIVER_SMC */
222
223/*
224 * Coldfire Fast Ethernet Controller (FEC) driver.
225 */
226#if defined(RTEMS_BSD_DRIVER_FEC)
227RTEMS_BSD_DEFINE_NEXUS_DEVICE(fec, 0, 0, NULL);
228#endif /* RTEMS_BSD_DRIVER_FEC */
229
230/*
231 * Xilinx Zynq Cadence Gigbit Ethernet MAC 0 (CGEM0).
232 */
233#if defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0)
234#if !defined(RTEMS_BSD_DRIVER_CGEM0_IRQ)
235 #error Zynq CGEM0 IRQ not defined (RTEMS_BSD_DRIVER_CGEM0_IRQ)
236#endif
237static const rtems_bsd_device_resource cgem0_res[] = {
238  {
239    .type = RTEMS_BSD_RES_MEMORY,
240    .start_request = 0,
241    .start_actual = 0xe000b000
242  }, {
243    .type = RTEMS_BSD_RES_IRQ,
244    .start_request = 0,
245    .start_actual = RTEMS_BSD_DRIVER_CGEM0_IRQ
246  }
247};
248RTEMS_BSD_DEFINE_NEXUS_DEVICE(cgem, 0,
249                              RTEMS_ARRAY_SIZE(cgem0_res),
250                              &cgem0_res[0]);
251#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0 */
252
253/*
254 * Designware/Synopsys Ethernet MAC Controller.
255 */
256#if defined(RTEMS_BSD_DRIVER_DWC0)
257#define RTEMS_BSD_DRIVER_USB
258#if !defined(RTEMS_BSD_DRIVER_DWC0_BASE_ADDR)
259 #error DWC0 base address not defined (RTEMS_BSD_DRIVER_DWC0_BASE_ADDR)
260#endif
261#if !defined(RTEMS_BSD_DRIVER_DWC0_IRQ)
262 #error DWC0 IRQ not defined (RTEMS_BSD_DRIVER_DWC0_IRQ)
263#endif
264static const rtems_bsd_device_resource dwc0_res[] = {
265  {
266    .type = RTEMS_BSD_RES_MEMORY,
267    .start_request = 0,
268    .start_actual = RTEMS_BSD_DRIVER_DWC0_BASE_ADDR
269  }, {
270    .type = RTEMS_BSD_RES_IRQ,
271    .start_request = 0,
272    .start_actual = RTEMS_BSD_DRIVER_DWC0_IRQ
273  }
274};
275RTEMS_BSD_DEFINE_NEXUS_DEVICE(dwc, 0,
276                              RTEMS_ARRAY_SIZE(dwc0_res),
277                              &dwc0_res[0]);
278#endif /* RTEMS_BSD_DRIVER_DWC0 */
279
280/*
281 * NXP QorIQ Network Driver.
282 */
283#if defined(RTEMS_BSD_DRIVER_TSEC)
284#if !defined(RTEMS_BSD_DRIVER_TSEC_BASE_ADDR)
285 #error TSEC base address not defined (RTEMS_BSD_DRIVER_TSEC_BASE_ADDR)
286#endif
287#if !defined(RTEMS_BSD_DRIVER_TSEC_TX_IRQ)
288 #error TSEC TX IRQ not defined (RTEMS_BSD_DRIVER_TSEC_TX_IRQ)
289#endif
290#if !defined(RTEMS_BSD_DRIVER_TSEC_RX_IRQ)
291 #error TSEC RX IRQ not defined (RTEMS_BSD_DRIVER_TSEC_RX_IRQ)
292#endif
293#if !defined(RTEMS_BSD_DRIVER_TSEC_ER_IRQ)
294 #error TSEC ER IRQ not defined (RTEMS_BSD_DRIVER_TSEC_ER_IRQ)
295#endif
296static const rtems_bsd_device_resource tsec0_res[] = {
297  {
298    .type = RTEMS_BSD_RES_MEMORY,
299    .start_request = 0,
300    .start_actual = RTEMS_BSD_DRIVER_TSEC_BASE_ADDR
301  }, {
302    .type = RTEMS_BSD_RES_IRQ,
303    .start_request = 0,
304    .start_actual = RTEMS_BSD_DRIVER_TSEC_TX_IRQ
305  }, {
306    .type = RTEMS_BSD_RES_IRQ,
307    .start_request = 1,
308    .start_actual = RTEMS_BSD_DRIVER_TSEC_RX_IRQ
309  }, {
310    .type = RTEMS_BSD_RES_IRQ,
311    .start_request = 2,
312    .start_actual = RTEMS_BSD_DRIVER_TSEC_ER_IRQ
313  }
314};
315RTEMS_BSD_DEFINE_NEXUS_DEVICE(tsec, 0,
316                              RTEMS_ARRAY_SIZE(tsec0_res),
317                              &tsec0_res[0]);
318#endif /* RTEMS_BSD_DRIVER_TSEC */
319
320/*
321 * Intel's Legacy EM driver.
322 */
323#if defined(RTEMS_BSD_DRIVER_PCI_LEM)
324#if !defined(RTEMS_BSD_DRIVER_HAS_PCI)
325 #error PCI bus not found, check BSP bus support.
326#endif
327SYSINIT_DRIVER_REFERENCE(lem, pci);
328#endif /* RTEMS_BSD_DRIVER_PCI_LEM */
329
330/*
331 * Intel's Gigabit Driver.
332 */
333#if defined(RTEMS_BSD_DRIVER_PCI_IGB)
334#if !defined(RTEMS_BSD_DRIVER_HAS_PCI)
335 #error PCI bus not found, check BSP bus support.
336#endif
337SYSINIT_DRIVER_REFERENCE(igb, pci);
338#endif /* RTEMS_BSD_DRIVER_PCI_IGB */
339
340/*
341 * Intel's EM Driver.
342 */
343#if defined(RTEMS_BSD_DRIVER_PCI_EM)
344#if !defined(RTEMS_BSD_DRIVER_HAS_PCI)
345 #error PCI bus not found, check BSP bus support.
346#endif
347SYSINIT_DRIVER_REFERENCE(em, pci);
348#endif /* RTEMS_BSD_DRIVER_PCI_EM */
349
350/*
351 * Realtek Driver
352 */
353#if defined(RTEMS_BSD_DRIVER_PCI_RE)
354#if !defined(RTEMS_BSD_DRIVER_HAS_PCI)
355 #error PCI bus not found, check BSP bus support.
356#endif
357SYSINIT_DRIVER_REFERENCE(re, pci);
358#endif /* RTEMS_BSD_DRIVER_PCI_RE */
359
360/**
361 ** MMI Physical Layer Support.
362 **/
363
364/*
365 * E1000 PHY
366 */
367#if defined(RTEMS_BSD_DRIVER_E1000PHY)
368SYSINIT_DRIVER_REFERENCE(e1000phy, miibus);
369#endif /* RTEMS_BSD_DRIVER_E1000PHY */
370
371/*
372 * Reltek PHY
373 */
374#if defined(RTEMS_BSD_DRIVER_REPHY)
375SYSINIT_DRIVER_REFERENCE(rgephy, miibus);
376#endif /* RTEMS_BSD_DRIVER_REPHY */
377
378/*
379 * MI PHY.
380 */
381#if defined(RTEMS_BSD_DRIVER_MIPHY)
382SYSINIT_DRIVER_REFERENCE(micphy, miibus);
383#endif /* RTEMS_BSD_DRIVER_MIPHY */
384
385#ifdef __cplusplus
386}
387#endif /* __cplusplus */
388
389#endif
Note: See TracBrowser for help on using the repository browser.