From 2051f9be6e95720d3b24470ec468b8ca73275b63 Mon Sep 17 00:00:00 2001 From: Lukas Graber Date: Thu, 4 Nov 2021 16:15:22 +0100 Subject: [PATCH] [DEV] Add RPi4 platform --- plat/rpi4/plat_nic.camkes | 49 +++++++++++++++++++++++++++++++++++++++ plat/rpi4/plat_nic.cmake | 11 +++++++++ 2 files changed, 60 insertions(+) create mode 100644 plat/rpi4/plat_nic.camkes create mode 100644 plat/rpi4/plat_nic.cmake diff --git a/plat/rpi4/plat_nic.camkes b/plat/rpi4/plat_nic.camkes new file mode 100644 index 0000000..78deac9 --- /dev/null +++ b/plat/rpi4/plat_nic.camkes @@ -0,0 +1,49 @@ +/* + * Network API Test System, RPi4 board configuration + * + * Copyright (C) 2021, HENSOLDT Cyber GmbH + */ + +#pragma once + +#include "NIC_RPi4/NIC_RPi4.camkes" +NIC_RPi4_COMPONENT_DEFINE(NIC_RPi4, NIC_DRIVER_RINGBUFFER_SIZE) +NIC_RPi4_Mailbox_COMPONENT_DEFINE(NIC_RPi4_Mailbox) +NIC_RPi4_Genet_COMPONENT_DEFINE(NIC_RPi4_Genet) + + +#define NETWORK_TEST_NIC_INSTANCE(_nic_) \ + component NIC_RPi4 _nic_; \ + component NIC_RPi4_Mailbox nic_mailbox; \ + component NIC_RPi4_Genet nic_genet; \ + \ + NIC_RPi4_INSTANCE_CONNECT( \ + _nic_, \ + nic_mailbox, \ + nic_genet \ + ) + +/* Macro used to configure the RPi4 driver component. It sets up a DMA pool + * of 1024 pages (4 KiB each) + */ +#define NETWORK_TEST_NIC_CONFIG(_nic_) \ + NIC_RPi4_Mailbox_INSTANCE_CONFIGURE_SELF( \ + nic_mailbox \ + ) \ + NIC_RPi4_Genet_INSTANCE_CONFIGURE_SELF( \ + nic_genet \ + ) \ + NIC_RPi4_INSTANCE_CONFIGURE( \ + _nic_, \ + 1024*4096 \ + ) + +/* macros used to connect platform specific components to the timerserver. + * Due to the fact that it's used to connect platform specific components, + * the comma needs to be part of the macro expansion + */ +#define NETWORK_TEST_OPTIONAL_TIMESERVER_CLIENTS_NETWORK_DRIVER(_nic_) \ + _nic_.timeServer_rpc, _nic_.timeServer_notify, + +#define NETWORK_TEST_OPTIONAL_TIMESERVER_CLIENTS_NETWORK_DRIVER_BADGES(_nic_) \ + _nic_.timeServer_rpc, diff --git a/plat/rpi4/plat_nic.cmake b/plat/rpi4/plat_nic.cmake new file mode 100644 index 0000000..8cccf73 --- /dev/null +++ b/plat/rpi4/plat_nic.cmake @@ -0,0 +1,11 @@ +# +# Network API Test System, RPi4 configuration +# +# Copyright (C) 2021, HENSOLDT Cyber GmbH +# + +cmake_minimum_required(VERSION 3.7.2) + +NIC_RPi4_DeclareCAmkESComponent( + NIC_RPi4 +)