diff options
author | Evan Lojewski <github@meklort.com> | 2019-05-01 19:16:55 -0600 |
---|---|---|
committer | Evan Lojewski <github@meklort.com> | 2019-05-01 19:16:55 -0600 |
commit | 2122fe004c9f32c1df39ce0162966023ac9eccc4 (patch) | |
tree | f145d2e060d20e1de5e6db29228f734397632483 | |
parent | 0bbe3af5b17d1dde47c837207c7b0bd84fcca753 (diff) | |
download | bcm5719-ortega-2122fe004c9f32c1df39ce0162966023ac9eccc4.tar.gz bcm5719-ortega-2122fe004c9f32c1df39ce0162966023ac9eccc4.zip |
Add tx init code.
-rw-r--r-- | ape/main.c | 14 | ||||
-rw-r--r-- | ape/rx_from_network.c | 33 |
2 files changed, 47 insertions, 0 deletions
@@ -45,6 +45,8 @@ #include "ape.h" #include <APE_SHM.h> +#include <APE_APE.h> +#include <APE_APE_PERI.h> void __attribute__((noreturn)) loaderLoop(void) { @@ -95,7 +97,19 @@ void __attribute__((noreturn)) loaderLoop(void) void __attribute__((noreturn)) __start() { + RegAPETxToNetPoolModeStatus0_t txMode; + txMode.r32 = 0; + txMode.bits.Reset = 1; + APE.TxToNetPoolModeStatus0 = txMode; + + txMode.bits.Reset = 0; + txMode.bits.Enable = 1; + APE.TxToNetPoolModeStatus0 = txMode; + initRxFromNetwork(); initRMU(); + + // APE.Tick10hz.r32++; + loaderLoop(); }
\ No newline at end of file diff --git a/ape/rx_from_network.c b/ape/rx_from_network.c index a1b09fb..430409c 100644 --- a/ape/rx_from_network.c +++ b/ape/rx_from_network.c @@ -45,6 +45,8 @@ #include "ape.h" #include <APE_FILTERS.h> +#include <APE_APE.h> +#include <APE_DEVICE.h> typedef struct { RegFILTERSElementConfig_t cfg; @@ -654,4 +656,35 @@ void initRxFromNetwork(void) } FILTERS.RuleConfiguration.r32 = 0; + + + // REG_APE_PERFECT_MATCH1_{HIGH,LOW}. For non-broadcast/multicast traffic, the hardware uses this register to match MACs and pass traffic to the APE. + // The first two bytes of a MAC are put in the HIGH register, and the remaining four bytes in the LOW. + // Note that this is a device (PCI) register, not an APE register. Set it to the BMC MAC. + + + // REG_APE__BMC_NC_RX_SRC_MAC_MATCHN_{HIGH,LOW}. + // This appears to relate to the RMU, not network RX, but its exact purpose is unknown. + // Set it to the BMC MAC. Unlike the "perfect match" register above, it takes a different format: + // for an example MAC AABB.CCDD.EEFF, set HIGH=0xAABBCCDD, LOW=0xEEFF0000. + // *** NOTE: set to 0 in rmu.c *** + + + // Ensure REG_RECEIVE_MAC_MODE has ENABLE set. + // I recommend also setting APE_PROMISCUOUS_MODE and PROMISCUOUS_MODE, + // as these will cause you less headaches during development. + DEVICE.ReceiveMacMode.bits.Enable = 1; + // DEVICE.ReceiveMacMode.bits.PromiscuousMode = 1; + // DEVICE.ReceiveMacMode.bits.APEPromiscuousMode = 1; + + // Ensure REG_EMAC_MODE__ENABLE_APE_{TX,RX}_PATH are set. + // *** NOTE: Both bits are set in rmu.c ***/ + + + + // Enable RX for funciton 0 + RegAPERxPoolModeStatus0_t poolMode; + poolMode.r32 = 0; + poolMode.bits.Enable = 1; + APE.RxPoolModeStatus0 = poolMode; } |