1/*
2 * Copyright 2019, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the GNU General Public License version 2. Note that NO WARRANTY is provided.
8 * See "LICENSE_GPLv2.txt" for details.
9 *
10 * @TAG(DATA61_GPL)
11 */
12#pragma once
13
14#include <camkes-fdt-bind-driver.h>
15
16#define HARDWARE_ETHERNET_EXTRA_IMPORTS
17
18#define HARDWARE_ETHERNET_COMPONENT
19
20#define HARDWARE_ETHERNET_INTERFACES                                                \
21    consumes Dummy EthDriver;                                                       \
22    consumes Dummy ocotp;                                                           \
23    consumes Dummy iomux;                                                           \
24    consumes Dummy ccm;                                                             \
25    consumes Dummy analog;                                                          \
26    consumes Dummy gpio1;                                                           \
27    emits Dummy dummy_source; \
28    fdt_bind_drivers_interfaces(["/ethernet@30be0000"]);
29
30#define HARDWARE_ETHERNET_COMPOSITION                                               \
31    connection seL4DTBHardwareThreadless ethernet_conn(from dummy_source, to EthDriver);      \
32    connection seL4DTBHardwareThreadless ocotp_conn(from dummy_source, to ocotp);             \
33    connection seL4DTBHardwareThreadless iomux_conn(from dummy_source, to iomux);             \
34    connection seL4DTBHardwareThreadless ccm_conn(from dummy_source, to ccm);                 \
35    connection seL4DTBHardwareThreadless analog_conn(from dummy_source, to analog);           \
36    connection seL4DTBHardwareThreadless gpio1_conn(from dummy_source, to gpio1); \
37    fdt_bind_driver_connections();
38
39#define HARDWARE_ETHERNET_CONFIG                                                    \
40    EthDriver.dtb = dtb({ "path" : "/ethernet@30be0000" });     \
41    EthDriver.generate_interrupts = 1;                                              \
42    ocotp.dtb = dtb({ "path" : "/ocotp-ctrl@30350000" });            \
43    iomux.dtb = dtb({ "path" : "/iomuxc@30330000" });           \
44    ccm.dtb = dtb({ "path" : "/ccm@30380000" });                \
45    analog.dtb = dtb({ "path" : "/anatop@30360000" });          \
46    gpio1.dtb = dtb({"path" : "/gpio@30200000"});
47