source: rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h @ 7eb064c

55-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since 7eb064c was f588325, checked in by Chris Johns <chrisj@…>, on 06/28/16 at 03:30:44

Change the Nexus bus to defines and have the BSP declare them.

  • Property mode set to 100644
File size: 13.4 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_SLCR)
102  /*
103   * Hard IP part of the Zynq so a fixed address.
104   */
105  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0                            \
106    static const rtems_bsd_device_resource zy7_slcr0_res[] = {          \
107      {                                                                 \
108        .type = RTEMS_BSD_RES_MEMORY,                                   \
109        .start_request = 0,                                             \
110        .start_actual = 0xf8000000                                      \
111      }                                                                 \
112    };                                                                  \
113    RTEMS_BSD_DEFINE_NEXUS_DEVICE(zy7_slcr, 0,                          \
114                                  RTEMS_ARRAY_SIZE(zy7_slcr0_res),      \
115                                  &zy7_slcr0_res[0])
116#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR0 */
117
118/**
119 ** Physical Buses
120 **/
121
122/*
123 * PC legacy bus.
124 */
125#if !defined(RTEMS_BSD_DRIVER_PC_LEGACY)
126  #define RTEMS_BSD_DRIVER_PC_LEGACY                      \
127    RTEMS_BSD_DEFINE_NEXUS_DEVICE(legacy, 0, 0, NULL);    \
128    SYSINIT_DRIVER_REFERENCE(pcib, legacy);               \
129    SYSINIT_DRIVER_REFERENCE(pci, pcib)
130#endif /* RTEMS_BSD_DRIVER_PC_LEGACY */
131
132/**
133 ** USB
134 **/
135
136/*
137 * Designware/Synopsys OTG USB Controller.
138 */
139#if !defined(RTEMS_BSD_DRIVER_DWCOTG0)
140  #define RTEMS_BSD_DRIVER_DWCOTG0(_base, _irq)                  \
141    static const rtems_bsd_device_resource dwcotg0_res[] = {     \
142      {                                                          \
143        .type = RTEMS_BSD_RES_MEMORY,                            \
144        .start_request = 0,                                      \
145        .start_actual = (_base)                                  \
146      }, {                                                       \
147        .type = RTEMS_BSD_RES_IRQ,                               \
148        .start_request = 0,                                      \
149        .start_actual = (_irq)                                   \
150      }                                                          \
151    };                                                           \
152    RTEMS_BSD_DEFINE_NEXUS_DEVICE(dwcotg, 0,                     \
153                                  RTEMS_ARRAY_SIZE(dwcotg0_res), \
154                                  &dwcotg0_res[0])
155#endif /* RTEMS_BSD_DRIVER_DWCOTG0 */
156
157/*
158 * Designware/Synopsys MMC.
159 */
160#if !defined(RTEMS_BSD_DRIVER_DWC_MMC)
161  #define RTEMS_BSD_DRIVER_DWC_MMC                                \
162    RTEMS_BSD_DEFINE_NEXUS_DEVICE(dw_mmc, 0, 0, NULL);            \
163    SYSINIT_DRIVER_REFERENCE(mmc, dw_mmc)
164#endif /* RTEMS_BSD_DRIVER_DWC_MMC */
165
166/*
167 * MMC Driver.
168 */
169#if !defined(RTEMS_BSD_DRIVER_MMC)
170  #define RTEMS_BSD_DRIVER_MMC                    \
171    SYSINIT_DRIVER_REFERENCE(mmcsd, mmc)
172#endif /* RTEMS_BSD_DRIVER_MMC */
173
174/*
175 * USB Drivers.
176 */
177#if !defined(RTEMS_BSD_DRIVER_USB)
178  #define RTEMS_BSD_DRIVER_USB                    \
179    SYSINIT_REFERENCE(usb_quirk_init);            \
180    SYSINIT_DRIVER_REFERENCE(uhub, usbus)
181#endif /* RTEMS_BSD_DRIVER_USB */
182
183/*
184 * USB Mass Storage Class driver.
185 */
186#if !defined(RTEMS_BSD_DRIVER_USB_MASS)
187  #define RTEMS_BSD_DRIVER_USB_MASS               \
188    SYSINIT_DRIVER_REFERENCE(umass, uhub)
189#endif /* RTEMS_BSD_DRIVER_USB_MASS */
190
191/**
192 ** Networking
193 **/
194
195/*
196 * SMC0 driver
197 */
198#if !defined(RTEMS_BSD_DRIVER_SMC0)
199  #define RTEMS_BSD_DRIVER_SMC0(_base, _irq)                     \
200    static const rtems_bsd_device_resource smc0_res[] = {        \
201      {                                                          \
202        .type = RTEMS_BSD_RES_MEMORY,                            \
203        .start_request = 0,                                      \
204        .start_actual = (_base)                                  \
205      }, {                                                       \
206        .type = RTEMS_BSD_RES_IRQ,                               \
207        .start_request = 0,                                      \
208        .start_actual = (_irq)                                   \
209      }                                                          \
210    };                                                           \
211    RTEMS_BSD_DEFINE_NEXUS_DEVICE(smc, 0,                        \
212                                  RTEMS_ARRAY_SIZE(smc0_res),    \
213                                  &smc0_res[0])
214#endif /* RTEMS_BSD_DRIVER_SMC */
215
216/*
217 * Coldfire Fast Ethernet Controller (FEC) driver.
218 */
219#if !defined(RTEMS_BSD_DRIVER_FEC)
220  #define RTEMS_BSD_DRIVER_FEC                            \
221    RTEMS_BSD_DEFINE_NEXUS_DEVICE(fec, 0, 0, NULL);
222#endif /* RTEMS_BSD_DRIVER_FEC */
223
224/*
225 * Xilinx Zynq Cadence Gigbit Ethernet MAC (CGEM).
226 */
227#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM)
228  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(_num, _base, _irq)              \
229    static const rtems_bsd_device_resource cgem ## _num ## _res[] = {       \
230      {                                                                     \
231        .type = RTEMS_BSD_RES_MEMORY,                                       \
232        .start_request = 0,                                                 \
233        .start_actual = (_base)                                             \
234      }, {                                                                  \
235        .type = RTEMS_BSD_RES_IRQ,                                          \
236        .start_request = 0,                                                 \
237        .start_actual = (_irq)                                              \
238      }                                                                     \
239    };                                                                      \
240    RTEMS_BSD_DEFINE_NEXUS_DEVICE(cgem, _num,                               \
241                                  RTEMS_ARRAY_SIZE(cgem ## _num ## _res),   \
242                                  &cgem ## _num ## _res[0])
243#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM */
244#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0)
245  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(_irq)                \
246    RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(0, 0xe000b000, _irq)
247#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0 */
248#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM1)
249  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM1(_irq)       \
250    RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(1, 0xe000c000, _irq)
251#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM1 */
252
253/*
254 * Designware/Synopsys Ethernet MAC Controller.
255 */
256#if !defined(RTEMS_BSD_DRIVER_DWC0)
257  #define RTEMS_BSD_DRIVER_DWC0(_base, _irq)                     \
258    static const rtems_bsd_device_resource dwc0_res[] = {        \
259      {                                                          \
260        .type = RTEMS_BSD_RES_MEMORY,                            \
261        .start_request = 0,                                      \
262        .start_actual = (_base)                                  \
263      }, {                                                       \
264        .type = RTEMS_BSD_RES_IRQ,                               \
265        .start_request = 0,                                      \
266        .start_actual = (_irq)                                   \
267      }                                                          \
268    };                                                           \
269    RTEMS_BSD_DEFINE_NEXUS_DEVICE(dwc, 0,                        \
270                                  RTEMS_ARRAY_SIZE(dwc0_res),    \
271                                  &dwc0_res[0])
272#endif /* RTEMS_BSD_DRIVER_DWC0 */
273
274/*
275 * NXP QorIQ Network Driver.
276 */
277#if !defined(RTEMS_BSD_DRIVER_TSEC)
278  #define RTEMS_BSD_DRIVER_TSEC(_base, _tx_irq, _rx_irq, _er_irq)   \
279    static const rtems_bsd_device_resource tsec0_res[] = {          \
280      {                                                             \
281        .type = RTEMS_BSD_RES_MEMORY,                               \
282        .start_request = 0,                                         \
283        .start_actual = (_base)                                     \
284      }, {                                                          \
285        .type = RTEMS_BSD_RES_IRQ,                                  \
286        .start_request = 0,                                         \
287        .start_actual = (_tx_irq)                                   \
288      }, {                                                          \
289        .type = RTEMS_BSD_RES_IRQ,                                  \
290        .start_request = 1,                                         \
291        .start_actual = (_rx_irq)                                   \
292      }, {                                                          \
293        .type = RTEMS_BSD_RES_IRQ,                                  \
294        .start_request = 2,                                         \
295        .start_actual = (_er_irq)                                   \
296      }                                                             \
297    };                                                              \
298    RTEMS_BSD_DEFINE_NEXUS_DEVICE(tsec, 0,                          \
299                                  RTEMS_ARRAY_SIZE(tsec0_res),      \
300                                  &tsec0_res[0])
301#endif /* RTEMS_BSD_DRIVER_TSEC */
302
303/*
304 * Intel's Legacy EM driver.
305 */
306#if !defined(RTEMS_BSD_DRIVER_PCI_LEM)
307  #define RTEMS_BSD_DRIVER_PCI_LEM                \
308    SYSINIT_DRIVER_REFERENCE(lem, pci);
309#endif /* RTEMS_BSD_DRIVER_PCI_LEM */
310
311/*
312 * Intel's Gigabit Driver.
313 */
314#if !defined(RTEMS_BSD_DRIVER_PCI_IGB)
315  #define RTEMS_BSD_DRIVER_PCI_IGB                \
316    SYSINIT_DRIVER_REFERENCE(igb, pci);
317#endif /* RTEMS_BSD_DRIVER_PCI_IGB */
318
319/*
320 * Intel's EM Driver.
321 */
322#if !defined(RTEMS_BSD_DRIVER_PCI_EM)
323  #define RTEMS_BSD_DRIVER_PCI_EM                 \
324    SYSINIT_DRIVER_REFERENCE(em, pci);
325#endif /* RTEMS_BSD_DRIVER_PCI_EM */
326
327/*
328 * Realtek Driver
329 */
330#if !defined(RTEMS_BSD_DRIVER_PCI_RE)
331  #define RTEMS_BSD_DRIVER_PCI_RE                 \
332    SYSINIT_DRIVER_REFERENCE(re, pci);
333#endif /* RTEMS_BSD_DRIVER_PCI_RE */
334
335/**
336 ** MMI Physical Layer Support.
337 **/
338
339/*
340 * E1000 PHY
341 */
342#if !defined(RTEMS_BSD_DRIVER_E1000PHY)
343  #define RTEMS_BSD_DRIVER_E1000PHY               \
344    SYSINIT_DRIVER_REFERENCE(e1000phy, miibus);
345#endif /* RTEMS_BSD_DRIVER_E1000PHY */
346
347/*
348 * Reltek PHY
349 */
350#if !defined(RTEMS_BSD_DRIVER_REPHY)
351  #define RTEMS_BSD_DRIVER_REPHY                  \
352    SYSINIT_DRIVER_REFERENCE(rgephy, miibus);
353#endif /* RTEMS_BSD_DRIVER_REPHY */
354
355/*
356 * MI PHY.
357 */
358#if !defined(RTEMS_BSD_DRIVER_MIPHY)
359  #define RTEMS_BSD_DRIVER_MIPHY                  \
360    SYSINIT_DRIVER_REFERENCE(micphy, miibus);
361#endif /* RTEMS_BSD_DRIVER_MIPHY */
362
363#ifdef __cplusplus
364}
365#endif /* __cplusplus */
366
367#endif
Note: See TracBrowser for help on using the repository browser.