### Install and Setup TFTP Server Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Installs the tftpd-hpa package for transferring files to the reference board and sets appropriate permissions for the TFTP boot directory. ```bash sudo apt-get install tftpd-hpa sudo chmod 777 /var/lib/tftpboot/ ``` -------------------------------- ### List Available Mesa Examples Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/examples/introduction.adoc Lists all the known examples that can be initialized and run within the MESA-DEMO application. ```bash # mesa-cmd example list Known example list: tas vlan stp evlan eflow aggr ``` -------------------------------- ### Mesa Example Command Help Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/examples/introduction.adoc Displays the general usage help for the mesa-cmd example command. ```bash # mesa-cmd example Usage: example [help|list|init|run|uninit] [] ``` -------------------------------- ### VLAN Example Help and Initialization Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/examples/introduction.adoc Shows the help text for the VLAN example, detailing its parameters, and then demonstrates how to initialize it with specific port configurations. ```bash # mesa-cmd example help vlan Basic VLAN example USAGE: vlan uport aport tport hport Help: uport: Unaware port, VID 10 aport: Access port, VID 20 tport: Trunk port, VID 10 and 20 hport: Hybrid port, VID 10 (untagged) and VID 20 ``` ```bash # mesa-cmd example init vlan uport 1 aport 2 tport 3 hport 4 ``` -------------------------------- ### Handle Missing Toolchain Dependency Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Example of the script's output when a required toolchain is missing. It provides instructions for downloading and installing the toolchain. ```bash $ ./.cmake/create_cmake_project.rb --external mipsel BSP: mchp-brsdk-mipsel-2025.03 TC: /opt/mchp/mchp-toolchain-bin-2024.02.6-001 Please install the toolchain: mchp-toolchain-bin-2024.02.6-001 into /opt/mchp/ This may be done by using the following command (ensure you have the needed permissions): sh -c "mkdir -p /opt/mchp && wget -O- http://mscc-ent-open-source.s3-eu-west-1.amazonaws.com/public_root/toolchain/mchp-toolchain-bin-2024.02.6-001.tar.gz | tar -xz -C /opt/mchp/" ``` -------------------------------- ### Uninitialize Mesa Example Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/examples/introduction.adoc Demonstrates the command to uninitialize the currently active MESA example, reverting any configuration changes made by the example. ```bash # mesa-cmd example uninit ``` -------------------------------- ### Collect Example Source Files Source: https://github.com/microchip-ung/mesa/blob/master/mesa/demo/CMakeLists.txt Uses file globbing to find all .c files within the 'examples' directory and adds them to the 'EXAMPLE_SRC' variable. ```cmake file(GLOB_RECURSE EXAMPLE_SRC LIST_DIRECTORIES false CONFIGURE-DEPENDS #RELATIVE "" "${CMAKE_CURRENT_SOURCE_DIR}/examples/*.c") add_library(mesa_demo_examples_lib INTERFACE) target_sources(mesa_demo_examples_lib INTERFACE ${EXAMPLE_SRC}) ``` -------------------------------- ### Handle Missing BSP Dependency Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Example of the script's output when a required Board Support Package (BSP) is missing. It provides instructions on how to download and install it. ```bash $ ./.cmake/create_cmake_project.rb --external mipsel BSP: mchp-brsdk-mipsel-2025.03 Please install the BSP: /opt/mchp/mchp-brsdk-mipsel-2025.03 This may be done by using the following command (ensure you have the needed permissions): sh -c "mkdir -p /opt/mchp && wget -O- http://mscc-ent-open-source.s3-eu-west-1.amazonaws.com/public_root/bsp/mchp-brsdk-mipsel-2025.03.tar.gz | tar -xz -C /opt/mchp/" ``` -------------------------------- ### Download and Install BSP Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/old/articles/ug1070-SW_MESA_Introduction.adoc Downloads a specific version of the Binary Support Package (BSP) and installs it to a designated directory. Includes a version check of the installed cross-compiler. ```console cd wget -q http://mscc-ent-open-source.s3-eu-west-1.amazonaws.com/public_root/bsp/mscc-brsdk-mips-2017.02-035.tar.gz sudo mkdir -p /opt/mscc sudo tar xf mscc-brsdk-mips-2017.02-035.tar.gz -C /opt/mscc /opt/mscc/mscc-brsdk-mips-2017.02-035/stage2/smb/x86_64-linux/usr/bin/mipsel-buildroot-linux-gnu-gcc --version ``` -------------------------------- ### Install Basic SW Dependencies on Ubuntu Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/getting-started.adoc Installs essential host tools required by MEPA on Ubuntu 18.04. Ensure you have root access. ```bash sudo apt-get install cmake cmake-curses-gui build-essential ruby ruby-parslet libjson-c-dev ``` -------------------------------- ### Start Mesa Demo Application Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Starts the Mesa demo application in the background. This allows 'mesa-cmd' to issue commands. ```bash $ mesa-demo ``` -------------------------------- ### Install Me Headers Source: https://github.com/microchip-ung/mesa/blob/master/CMakeLists.txt Copies me headers to the common include directory. ```cmake FOREACH(f ${API_ME_HDR}) # Add all me headers configure_file("me/include/${f}" "${CMAKE_CURRENT_BINARY_DIR}/include_common/${f}" COPYONLY) ENDFOREACH() ``` -------------------------------- ### Example ccmake GUI Configuration for LAN8814 Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/getting-started.adoc This shows an example of the ccmake GUI configuration, highlighting the selection of the MEPA_lan8814 target. Press 'c' to configure and 'g' to generate Makefiles. ```text BUILD_mepa ON CMAKE_BUILD_TYPE CMAKE_INSTALL_PREFIX /usr/local MEPA_aqr OFF MEPA_gpy211 OFF MEPA_ksz9031 OFF MEPA_lan8814 ON MEPA_vtss OFF MEPA_vtss_opt_10g OFF MEPA_vtss_opt_1g OFF MEPA_vtss_opt_cnt 64 MEPA_vtss_opt_macsec OFF MEPA_vtss_opt_ts OFF MEPA_lan80xx_ts OFF MEPA_lan80xx_ts_msec OFF MEPA_lan8814: Add LAN8814 support in libmeba Press [enter] to edit option Press [d] to delete an entry CMake Version 3.16.3 Press [c] to configure Press [h] for help Press [q] to quit without generating Press [t] to toggle advanced mode (Currently Off) ``` -------------------------------- ### Example MEPA Device Array Usage Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/mepa_instantiation.adoc An example showing how MEPA devices are stored in an array and how to reference the mepa_device_t pointer when calling MEPA APIs. ```c void APPL_example1(int port_no) { mepa_rc rc; // ... APPL_mepa_devices array usage ... } ``` -------------------------------- ### MEPA Configuration Get and Set Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/mepa_instantiation.adoc Demonstrates the recommended pattern of getting the current MEPA configuration before setting new values. This ensures backward compatibility by accounting for potential new members in future releases. ```c void APPL_example3(int port_no) { mepa_rc rc; mepa_conf_t conf; rc = mepa_conf_get(APPL_mepa_devices[port_no], &conf); if (rc != MEPA_RC_OK) { // handle error! } // Update config conf.admin.enable = 1; rc = mepa_conf_set(APPL_mepa_devices[port_no], &conf); if (rc != MEPA_RC_OK) { // handle error! } } ``` -------------------------------- ### Project and Include Directory Setup Source: https://github.com/microchip-ung/mesa/blob/master/meba/CMakeLists.txt Initializes the CMake project and specifies directories to include for header files. ```cmake # SPDX-License-Identifier: MIT project(meba) cmake_minimum_required(VERSION 3.15) include_directories(include) include_directories(../mesa/include) include_directories(../include) include_directories(./src) include_directories(./src/drivers) include_directories(../mepa/vtss/include) ``` -------------------------------- ### Disable Clock Output (Generic Example) Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/synce.adoc A generic example demonstrating how to disable a clock output by setting the source to disabled. Applicable to all devices. ```c mepa_synce_clock_conf_t conf = { .src = MEPA_SYNCE_CLOCK_SRC_DISABLED, .dst = MEPA_SYNCE_CLOCK_DST_1, .freq = MEPA_FREQ_125M, }; mepa_synce_clock_conf_set(dev, &conf); ``` -------------------------------- ### Install Required Packages on Ubuntu Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/old/articles/ug1070-SW_MESA_Introduction.adoc Installs essential packages for development using the Ubuntu package system. Requires root access via sudo. ```console sudo apt-get install bc build-essential bzip2 coreutils cpio findutils gawk git grep gzip libc6-i386 libcrypt-openssl-rsa-perl libncurses5-dev patch perl python ruby sed squashfs-tools tcl tar wget libyaml-tiny-perl libcgi-fast-perl ruby-parslet cmake ``` -------------------------------- ### Install Meba Headers Source: https://github.com/microchip-ung/mesa/blob/master/CMakeLists.txt Copies meba headers to the common include directory. ```cmake FOREACH(f ${API_MEBA_HDR}) configure_file("meba/include/${f}" "${CMAKE_CURRENT_BINARY_DIR}/include_common/${f}" COPYONLY) ENDFOREACH() ``` -------------------------------- ### Install Mepa Headers Source: https://github.com/microchip-ung/mesa/blob/master/CMakeLists.txt Copies mepa headers to the common include directory. ```cmake FOREACH(f ${API_MEPA_HDR}) # Add all mepa headers configure_file("mepa/include/${f}" "${CMAKE_CURRENT_BINARY_DIR}/include_common/${f}" COPYONLY) ENDFOREACH() ``` -------------------------------- ### CMake Configuration Output Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/old/articles/ug1070-SW_MESA_Introduction.adoc Example output from CMake during project configuration, showing compiler identification and checks. ```text -- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 -- Check for working C compiler: /opt/mscc/mscc-brsdk-mips-2017.02-035/stage2/smb/x86_64-linux/usr/bin/mipsel-buildroot-linux-gnu-gcc -- Check for working C compiler: /opt/mscc/mscc-brsdk-mips-2017.02-035/stage2/smb/x86_64-linux/usr/bin/mipsel-buildroot-linux-gnu-gcc - works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /opt/mscc/mscc-brsdk-mips-2017.02-035/stage2/smb/x86_64-linux/usr/bin/mipsel-buildroot-linux-gnu-g++ -- Check for working CXX compiler: /opt/mscc/mscc-brsdk-mips-2017.02-035/stage2/smb/x86_64-linux/usr/bin/mipsel-buildroot-linux-gnu-g++ - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Project name = vtss_api -- Type = Release -- cxx_flags = -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -std=c++11 ``` -------------------------------- ### Install Mepa Vtss Headers Source: https://github.com/microchip-ung/mesa/blob/master/CMakeLists.txt Copies mepa vtss headers to the common include directory. ```cmake FOREACH(f ${API_MEPA_VTSS_HDR}) configure_file("mepa/vtss/include/${f}" "${CMAKE_CURRENT_BINARY_DIR}/include_common/${f}" COPYONLY) ENDFOREACH() ``` -------------------------------- ### Boot FIT Image with Configuration Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Use the `bootm` command with the image address and configuration name to boot a FIT image. ```bash # bootm ${loadaddr}#fireant ``` -------------------------------- ### MEPA Initialization with Callbacks and Instance Creation Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/release-notes/mesa-2021.12.adoc Demonstrates the updated MEPA initialization process using mepa_callout_t for callbacks and mepa_create for instance creation. This example includes application-specific implementations for MMD/MIIM access, memory allocation, and tracing. ```c typedef struct mepa_callout_cxt { // Add application specific stuff needed to reach the PHY registers here. } mepa_callout_cxt_t; // board/bsp specific content goes here mepa_rc APPL_mmd_read(struct mepa_callout_cxt *cxt, uint8_t mmd, uint16_t addr, uint16_t *const value) { return -1; } mepa_rc APPL_mmd_read_inc(struct mepa_callout_cxt *cxt, uint8_t mmd, uint16_t addr, uint16_t *const buf, uint8_t count) { return -1; } mepa_rc APPL_mmd_write(struct mepa_callout_cxt *cxt, uint8_t mmd, uint16_t addr, uint16_t value) { return -1; } mepa_rc APPL_miim_read(struct mepa_callout_cxt *cxt, uint8_t addr, uint16_t *const value) { return -1; } mepa_rc APPL_miim_write(struct mepa_callout_cxt *cxt, uint8_t addr, uint16_t value) { return -1; } void APPL_trace_func(const mepa_trace_data_t *data, va_list args) { // Do filtering, and optionally add more details. vprintf(data->format, args); } void *APPL_mem_alloc(struct mepa_callout_cxt *cxt, size_t size) { return malloc(size); } void APPL_mem_free(struct mepa_callout_cxt *cxt, void *ptr) { free(ptr); } static mepa_callout_t APPL_mepa_callout = { .mepa_mmd_read = APPL_mmd_read, .mepa_mmd_read_inc = APPL_mmd_read_inc, .mepa_mmd_write = APPL_mmd_write, .mepa_miim_read = APPL_miim_read, .mepa_miim_write = APPL_miim_write, .mepa_mem_alloc = APPL_mem_alloc, .mepa_mem_free = APPL_mem_free, // .lock_enter must be set if used with multi-thread // .lock_exit must be set if used with multi-thread }; static mepa_callout_cxt_t APPL_mepa_callout_cxt[APPL_PORT_CNT]; static mepa_device *APPL_mepa_devices[APPL_PORT_CNT]; void mepa_init() { int i; MEPA_TRACE_FUNCTION = APPL_trace_func; for (i = 0; i < APPL_PORT_CNT; ++i) { mepa_board_conf conf = {}; conf.numeric_handle = i; APPL_fill_port_data(i, &APPL_mepa_callout_cxt[i]); APPL_mepa_devices[i] = mepa_create(&APPL_mepa_callout, ``` -------------------------------- ### Get Tx Secure Channel Status Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/macsec.adoc Retrieves the current status of a Transmit Secure Channel (Tx SC), including its SCI, creation time, start time, and stop time. These times are used for MACsec key rollover. ```c mepa_macsec_tx_sc_status_get() ``` -------------------------------- ### Configure Bootable Demo Image Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Configure the project to build a specific bootable demo image by setting the corresponding CMake variable to 'on'. This example configures the `IMG_mipsel_vsc7514_pcb123_mfi` target. ```bash $ ./cmake .. -DIMG_mipsel_vsc7514_pcb123_mfi=on -- Project name = vtss_api -- Type = Release -- c_flags = -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -O2 -g0 -Wall -Wno-unknown-pragmas -Wno-array-bounds -Wno-stringop-overflow -Wno-nonnull -fasynchronous-unwind-tables -std=c11 -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DEFAULT_SOURCE -ldl -O3 -Wall -Wno-unknown-pragmas -Wno-array-bounds -Wno-stringop-overflow -Wno-nonnull -fasynchronous-unwind-tables -std=c11 -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DEFAULT_SOURCE -ldl -O3 -DNDEBUG -- EXE_LINKER_FLAGS = -- shared_linker_flags = -- Build mepa including -- CMAKE_TOOLCHAIN_FILE='/opt/mchp/mchp-brsdk-mipsel-2025.03/mipsel-mips32r2-linux-gnu/xstax/release/x86_64-linux/share/buildroot/toolchainfile.cmake' -- Configuring done (0.1s) -- Generating done (0.7s) -- Build files have been written to: /home/m31684/work/mesa2/build-mipsel ``` -------------------------------- ### Download and Boot FIT Image on BeagleBone Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Download a FIT image via TFTP and set boot arguments for booting on a BeagleBone. ```bash # tftp ${loadaddr} 10.99.10.1:armv7_vsc7514.itb # setenv bootargs 'console=ttyO0,115200n8 root=/dev/ram0 ip=dhcp rw loglevel=0' ``` -------------------------------- ### Timestamp FIFO Read Install Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/timestamp.adoc Installs a callback function to read timestamp data (signature + timestamp) from the TX TSFIFO. ```APIDOC ## mepa_ts_fifo_read_install() ### Description Registers a callback function to be invoked when timestamp data is available in the TX TSFIFO. This is used for MDIO or Parallel interface access. ### Method Callback registration ### Parameters * **callback_func** (function) - Required - The function to be called when timestamp data is ready. ### Response * **Success**: Callback is registered. * **Failure**: Indicates an error during registration. ``` -------------------------------- ### Build the Project with Make Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/getting-started.adoc After configuring with ccmake, run 'make' to build the project. This command compiles the source code and links the libraries. ```bash $ make Scanning dependencies of target mepa_common [ 0%] Building C object CMakeFiles/mepa_common.dir/common/src/phy.c.o [ 33%] Linking C static library libmepa_common.a [ 33%] Built target mepa_common Scanning dependencies of target mepa_drv_lan8814 [ 66%] Building C object microchip/lan8814/CMakeFiles/mepa_drv_lan8814.dir/src/lan8814.c.o [ 66%] Building C object microchip/lan8814/CMakeFiles/mepa_drv_lan8814.dir/src/lan8814_ts.c.o [ 66%] Linking C static library libmepa_drv_lan8814.a [ 66%] Built target mepa_drv_lan8814 Scanning dependencies of target mepa_target [100%] Bundling mepa [100%] Built target mepa_target $ ``` -------------------------------- ### Run MESA Demo Application Help Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/old/articles/ug1070-SW_MESA_Introduction.adoc Command to display help information for the mesa_demo application. ```cli # mesa_demo -h ``` -------------------------------- ### Build the Project Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Build the configured project using the `make` command. The `-jN` option specifies the number of parallel jobs to use for faster compilation. ```bash $ make -j12 .... [100%] Linking C executable mesa-demo-vsc7514 [100%] Built target app_vsc7514 [100%] Generating mipsel_vsc7514_pcb123.mfi [100%] Built target mipsel_vsc7514_pcb123_mfi ``` -------------------------------- ### Example Initialization Sequence Source: https://github.com/microchip-ung/mesa/blob/master/mepa/intel/GPY_API_v2.7.1.1/doc/macsec_test_commands.txt A sequence of commands to initialize the GPHY and enable MACsec settings, followed by GMAC configuration and MACsec device initialization. ```shell //Initi GPHY and Enable MACSec settings gpy2xx_init gpy2xx_gmacf_count_ctrl_cfg rstCnt=1 stopRoll=1 conRead=1 frzCnt=0 pstCnt=0 psthFull=0 cntbcDrop=1 gpy2xx_gmacx_pm_pdi_cfg bpMsec=0 dropCrc=1 dropPerr=1 dropSfail=1 dropClass=1 gpy2xx_gmacf_pkt_cfg pcStrip=1 crcStrip=1 macIpg=0 gpy2xx_gmacf_pm_cfg crcPad=0 gpy2xx_gmacl_pm_cfg crcPad=0 //Init MACSec Ingress and Egress devices gpy2xx_msec_init_ing_dev gpy2xx_msec_init_egr_dev ``` -------------------------------- ### Get Rx Secure Association Status Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/macsec.adoc Retrieves the status of an Rx SA. Similar to `mepa_macsec_rx_sa_get()`, parameter updates do not affect older SAs, and adjustments may be needed to get the actual value. ```c mepa_macsec_rx_sa_status_get() ``` -------------------------------- ### Configure PHY SOF (Start Of Frame) Pulse Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/basic.adoc The `mepa_start_of_frame_conf_set()` API configures the Start Of Frame pulse generation for receive and transmit paths using the `mepa_start_of_frame_conf_t` structure. The `mepa_start_of_frame_conf_get()` API retrieves this configuration. ```APIDOC ## mepa_start_of_frame_conf_set() and mepa_start_of_frame_conf_get() ### Description Configures and retrieves the Start Of Frame (SOF) pulse generation settings for PHY receive and transmit paths. ### Method `mepa_start_of_frame_conf_set(mepa_start_of_frame_conf_t *conf)` `mepa_start_of_frame_conf_get(mepa_start_of_frame_conf_t *conf)` ### Parameters - **conf** (`mepa_start_of_frame_conf_t` *) - Pointer to the structure containing SOF configuration. - **sof_no** (int) - Configurable SOF outputs. - **ingress** (bool) - True for ingress packet detection, false for egress. - **sof_preemption_mode** (`mepa_preemption_mode_t`) - Enum for SOF pulse generation mode (e.g., `MEPA_PREEMPTION_NORMAL_SFD`, `MEPA_PREEMPTION_SMD_E`, `MEPA_PREEMPTION_SMD_EXCEPT_CONTINUOUS`, `MEPA_PREEMPTION_SMD_ALL`). ### Endpoint N/A (Function call) ### Request Example (set) ```c mepa_start_of_frame_conf_t sof_conf; sof_conf.sof_no = 0; // Example value sof_conf.ingress = true; // Example value sof_conf.sof_preemption_mode = MEPA_PREEMPTION_NORMAL_SFD; mepa_start_of_frame_conf_set(&sof_conf); ``` ### Response (get) - **conf** (`mepa_start_of_frame_conf_t` *) - Structure populated with the current SOF configuration. ``` -------------------------------- ### Build Nano Demo Application Source: https://github.com/microchip-ung/mesa/blob/master/phy_demo_appl/README.txt Compile the demo application for the Nano family (e.g., VSC8502). This creates an executable that requires the evaluation board's IP address as an argument. ```shell ./build_nano_vsc8502ev.sh ./vtss_api_nano_vsc8502ev www.xxx.yyy.zzz ``` -------------------------------- ### Create CMake Project Usage Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/getting-started.adoc Shows the usage instructions for the create_cmake_project script. It lists the available presets for different architectures and build types. ```bash ./.cmake/create_cmake_project.rb Usage: create_cmake_project [output-folder] Valid presets: mipsel mipsel-debug arm64 arm64-debug arm64-asan arm arm-debug x86 ``` -------------------------------- ### Get Rx Secure Association (Non-XPN) Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/macsec.adoc Retrieves the configuration of an active Rx SA for a non-XPN cipher suite. Note that parameter updates do not affect older SAs; adjustments may be needed to get the actual value. ```c mepa_macsec_rx_sa_get() ``` -------------------------------- ### Timestamp Statistics Get Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/timestamp.adoc Retrieves timestamping statistics. ```APIDOC ## mepa_ts_stats_get() ### Description Retrieves statistics related to the timestamping functionality. The statistics are returned in a `mepa_ts_stats_t` structure. ### Method Statistics retrieval ### Response * **stats** (mepa_ts_stats_t) - An object containing various timestamping statistics. * **Success**: Returns the timestamping statistics. * **Failure**: Indicates an error retrieving statistics. ``` -------------------------------- ### Build Elise Demo Application Source: https://github.com/microchip-ung/mesa/blob/master/phy_demo_appl/README.txt Compile the demo application for the Elise family (e.g., VSC8514). This creates an executable that requires the evaluation board's IP address as an argument. ```shell ./build_elise_vsc8514ev.sh ./vtss_api_elise_vsc8514ev www.xxx.yyy.zzz ``` -------------------------------- ### Timestamp Event Get Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/timestamp.adoc Retrieves the status of currently enabled timestamp events. ```APIDOC ## mepa_ts_event_get(event_mask) ### Description Retrieves the status of currently enabled timestamp events based on a provided event mask. This helps in checking which events are active. ### Method Event status retrieval ### Parameters * **event_mask** (uint32_t) - Required - A mask to filter the events for which status is requested. ### Response * **enabled_events** (uint32_t) - A bitmask representing the status of the enabled events. * **Success**: Returns the status of enabled events. * **Failure**: Indicates an error retrieving event status. ``` -------------------------------- ### Build 10G PHY Library Source: https://github.com/microchip-ung/mesa/blob/master/phy_demo_appl/README.txt Use this command to build a library for the 10G PHY. ```makefile make -f Makefile_10g ``` -------------------------------- ### Timestamp PPS Configuration Get Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/timestamp.adoc Retrieves the configured offset for PPS generation. ```APIDOC ## mepa_ts_pps_conf_get() ### Description Retrieves the currently configured offset for the Pulse Per Second (PPS) signal generation. This offset determines when the PPS signal is generated relative to the nano-second rollover point. ### Method Configuration retrieval ### Response * **pps_config** (mepa_ts_pps_conf_t) - An object containing the PPS configuration, including the offset. * **Success**: Returns the PPS configuration. * **Failure**: Indicates an error retrieving the PPS configuration. ``` -------------------------------- ### Unicast Flood Control Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/l2/l2.adoc Functions to get and set unicast flood members. ```APIDOC ## Unicast Flood Control ### Description Functions to get and set unicast flood members. ### Functions - `mesa_uc_flood_members_get()` - `mesa_uc_flood_members_set()` ``` -------------------------------- ### Create Mesa Demo Library Source: https://github.com/microchip-ung/mesa/blob/master/mesa/demo/CMakeLists.txt Builds a static library named 'mesa_demo_lib' including various source files and the generated MESA RPC sources. ```cmake add_library(mesa_demo_lib STATIC trace.c cli.c port.c mac.c vlan.c packet.c ip.c debug.c symreg.c test.c spi.c udmabuf.c uio.c ${MESA_RPC} json_rpc.c example.c kr.c intr.c) target_include_directories(mesa_demo_lib PUBLIC ${CMAKE_BINARY_DIR}/mesa-ag/) ``` -------------------------------- ### Learning Mode Configuration Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/l2/l2.adoc Functions to get and set the learning mode for ports. ```APIDOC ## Learning Mode Configuration ### Description Functions to get and set the learning mode for ports. ### Functions - `mesa_learn_port_mode_get()` - `mesa_learn_port_mode_set()` ``` -------------------------------- ### Get MAC Table Entry Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/l2/l2.adoc Retrieves an entry from the MAC address table. ```c mesa_mac_table_get(chip_no, &mac_addr, &mac_entry); ``` -------------------------------- ### Create CMake Project Script Help Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Displays help information for the create_cmake_project.rb script, detailing its usage and available options for configuring the build environment. ```bash ./.cmake/create_cmake_project.rb --help ``` -------------------------------- ### Load firmware via TFTP Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Load a firmware image into memory using the 'tftp' command. Ensure the firmware file is in the TFTP server's directory and replace placeholders with your TFTP server IP and firmware filename. ```bash ocelot # tftp ${loadaddr} 10.99.10.1:firmware.ext Using switch@1010000 device TFTP from server 10.99.10.1; our IP address is 10.99.10.10 Filename 'mipsel_vsc7415.mfi'. Load address: 0x81000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################### 11.1 MiB/s done Bytes transferred = 6953696 (6a1ae0 hex) ocelot # ``` -------------------------------- ### AFI Port Control Functions Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/packet/packet.adoc Functions to start and stop AFI operations on a port. ```APIDOC ## AFI Port Control Functions ### Description Functions to start and stop AFI operations on a port. ### Functions - `mesa_afi_port_start()`: Starts AFI on a port. - `mesa_afi_port_stop()`: Stops AFI on a port. ``` -------------------------------- ### Aggregation Port Management Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/l2/l2.adoc Functions to get and set aggregation port members and modes. ```APIDOC ## Aggregation Port Management ### Description Functions to get and set aggregation port members and modes. ### Functions - `mesa_aggr_port_members_get()` - `mesa_aggr_port_members_set()` - `mesa_aggr_mode_get()` - `mesa_aggr_mode_set()` ``` -------------------------------- ### Egress Counter Management Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/l2/l2.adoc Functions for allocating, freeing, getting, and clearing egress counters. ```APIDOC ## Egress Counter Management ### Description Functions for allocating, freeing, getting, and clearing egress counters. ### Functions - `mesa_egress_cnt_alloc()` - `mesa_egress_cnt_free()` - `mesa_egress_cnt_get()` - `mesa_egress_cnt_clear()` ``` -------------------------------- ### Build 1G PHY Library Source: https://github.com/microchip-ung/mesa/blob/master/phy_demo_appl/README.txt Use this command to build a library for the 1G PHY. ```makefile make -f Makefile_1g ``` -------------------------------- ### Define and Link init Executable Source: https://github.com/microchip-ung/mesa/blob/master/mesa/demo/CMakeLists.txt Compiles initramfs/main.c into an executable named 'init' and links it as a static library. ```cmake add_executable(init initramfs/main.c) target_link_libraries(init PUBLIC "-static") ``` -------------------------------- ### Ingress Counter Management Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/l2/l2.adoc Functions for allocating, freeing, getting, and clearing ingress counters. ```APIDOC ## Ingress Counter Management ### Description Functions for allocating, freeing, getting, and clearing ingress counters. ### Functions - `mesa_ingress_cnt_alloc()` - `mesa_ingress_cnt_free()` - `mesa_ingress_cnt_get()` - `mesa_ingress_cnt_clear()` ``` -------------------------------- ### Driver and Definition Lists Source: https://github.com/microchip-ung/mesa/blob/master/mepa/CMakeLists.txt Initializes lists to store driver names and preprocessor definitions. ```cmake set(mepa_drvs) set(mepa_defs) ``` -------------------------------- ### Timestamp FIFO Get Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/timestamp.adoc Retrieves up to 8 timestamp entries from the TSFIFO in a single call. ```APIDOC ## mepa_ts_fifo_get() ### Description Retrieves up to 8 timestamp entries from the TX TSFIFO in a single API call. This API does not require a callback function and can be used to read multiple entries at once. ### Method Bulk read operation ### Response * **timestamp_entries** (array) - An array containing up to 8 timestamp entries, each with seconds, nanoseconds, and signature. * **Success**: Returns an array of timestamp entries. * **Failure**: Indicates an error retrieving entries from the FIFO. ``` -------------------------------- ### Copy Binary Image to TFTP Folder Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Copies a pre-built MESA demo binary image to the TFTP server's boot directory for loading onto the reference board. ```bash cp bin/mipsel/mesa/demo/mipsel_vsc7514.mfi /var/lib/tftpboot/ ``` -------------------------------- ### Get Egress Global Statistics Source: https://github.com/microchip-ung/mesa/blob/master/mepa/intel/GPY_API_v2.7.1.1/doc/macsec_test_commands.txt Retrieves global statistics counters for egress MACsec. ```shell gpy2xx_msec_get_egr_global_stats ``` -------------------------------- ### List Available Build Targets Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Use the `./cmake .. -LAH` command to list all available build targets. Combine with `grep` to filter for specific targets like bootable images. ```bash $ ./cmake .. -LAH | grep IMG | grep 7514 IMG_mipsel_vsc7514_pcb120_mfi:BOOL=OFF IMG_mipsel_vsc7514_pcb123_mfi:BOOL=OFF ``` -------------------------------- ### Get Ingress Global Statistics Source: https://github.com/microchip-ung/mesa/blob/master/mepa/intel/GPY_API_v2.7.1.1/doc/macsec_test_commands.txt Retrieves global statistics counters for ingress MACsec. ```shell gpy2xx_msec_get_ing_global_stats ``` -------------------------------- ### Get Egress Debug Statistics Source: https://github.com/microchip-ung/mesa/blob/master/mepa/intel/GPY_API_v2.7.1.1/doc/macsec_test_commands.txt Retrieves debug statistics for egress MACsec operations. ```shell gpy2xx_msec_get_egr_debug_stats ``` -------------------------------- ### Boot mfi firmware image Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Boot a loaded 'mfi' firmware image using the 'bootmfi' command. This is the default image type for MIPS-based targets in WebStaX. ```bash ocelot # bootmfi ${loadaddr} MD5 signature validated Uncompressing Kernel Image ... OK Loading Ramdisk to 9f8db000, end 9fdb9000 ... OK linux_env_set setting memsize=512 linux_env_set setting flash_start=0x00000000 linux_env_set setting flash_size=0x0 Starting syslogd: OK Starting klogd: OK read-only file system detected...done Starting network: OK Starting ntpd: OK No persistent location to store SSH host keys. New keys will be generated at each boot. Are you sure this is what you want to do? Starting dropbear sshd: OK Welcome to SMBStaX vcoreiii login: ``` -------------------------------- ### Cold Restart Configuration Example Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/warm-restart-phy.adoc Configures the PHY for a cold restart, updating both the PHY instance and hardware registers simultaneously. This is used during initialization or application restart. ```c mepa_restart_t restart; mepa_warmstart_conf_get(dev, &restart); restart = MEPA_RESTART_COLD; mepa_warmstart_conf_set(dev, restart); mepa_warmstart_conf_end(dev); ``` -------------------------------- ### Get Ingress Debug Statistics Source: https://github.com/microchip-ung/mesa/blob/master/mepa/intel/GPY_API_v2.7.1.1/doc/macsec_test_commands.txt Retrieves debug statistics for ingress MACsec operations. ```shell gpy2xx_msec_get_ing_debug_stats ``` -------------------------------- ### Configure PHY Instance for Warmstart Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/warm-restart-phy.adoc Sets the PHY configuration for a warmstart. This prevents direct write-through to hardware registers until the entire PHY instance is populated. Use the base port number for the PHY. ```c mepa_warmstart_conf_set(dev, WARMSTART); ``` -------------------------------- ### Get MACsec Common Counters Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/macsec.adoc Retrieves statistics for packets passing through both the Controlled and Uncontrolled ports. ```c mepa_macsec_common_counters_get(); ``` -------------------------------- ### Download and flash UBIFS image to NAND Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/getting-started.adoc Execute the 'nand_dlup' command to download and flash the UBIFS image to the NAND partition. This process involves TFTP transfer, NAND erasing, and writing the image to the 'rootfs' volume. ```bash run nand_dlup ``` ```text env set nand_image somepath/new.ubifs run nand_dlup ... TFTP from server 10.10.137.100; our IP address is 10.10.137.22 Filename 'somepath/new.ubifs'. Load address: 0x740000000 Loading: ################################################################# ################################################################# ################################################################# ... ################################################################# ################################################################# ################################################################# ########################################### 2.6 MiB/s done Bytes transferred = 27172864 (19ea000 hex) SF: Detected mx66l1g45g with page size 256 Bytes, erase size 4 KiB, total 128 MiB Erasing 0x00000000 ... 0x03ffffff (512 eraseblock(s)) ubi0: default fastmap pool size: 25 ubi0: default fastmap WL pool size: 12 ubi0: attaching mtd5 ubi0: scanning is finished ubi0: empty MTD device detected ubi0: attached mtd5 (name "Boot0", size 64 MiB) ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096 ubi0: good PEBs: 512, bad PEBs: 0, corrupted PEBs: 0 ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128 ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 0 ubi0: available PEBs: 466, total reserved PEBs: 46, PEBs reserved for bad PEB handling: 40 No size specified -> Using max size (59170816) Creating dynamic volume rootfs of size 59170816 27172864 bytes written to volume rootfs ``` -------------------------------- ### Get MACsec SecY Counters Source: https://github.com/microchip-ung/mesa/blob/master/mepa/docs/macsec.adoc Retrieves statistics for a specific SecY within a physical port. ```c mepa_macsec_secy_counters_get(); ``` -------------------------------- ### Build MESA Sources Source: https://github.com/microchip-ung/mesa/blob/master/mesa/docs/old/articles/ug1070-SW_MESA_Introduction.adoc Command to build the MESA sources using make. Ensure you are in the correct directory. ```console $ make -j 10 # Build the sources ```