GithubHelp home page GithubHelp logo

xypron / polarfire-hart-software-services Goto Github PK

View Code? Open in Web Editor NEW

This project forked from polarfire-soc/hart-software-services

0.0 2.0 0.0 15.23 MB

PolarFire SoC hart software services

License: Other

Makefile 1.87% C 93.79% C++ 2.78% Assembly 0.88% Python 0.67% Batchfile 0.01% Shell 0.01%

polarfire-hart-software-services's Introduction

Hart Software Services

This is the Hart Software Services (HSS) code.

On PolarFire SoC, this is comprised of two portions:

  • A superloop monitor running on the E51 minion processor, which receives requests from the individual U54 application processors to perform certain services on their behalf;

  • A Machine-Mode software interrupt trap handler, which allows the E51 to send messages to the U54s, and request them to perform certain functions for it related to rebooting a U54.

The HSS performs boot and system monitoring functions for PolarFire SoC.

The HSS is compressed (DEFLATE) and stored in eNVM. On power-up, a small decompressor decompressor wrapper inflates the HSS from eNVM flash to L2-Scratchpad memory and starts the HSS.

Contributions

Pull requests to this repository must include a per-commit sign-off made by a contributor stating that they agree to the terms published at https://developercertificate.org/ for that particular contribution.

Source

Source code is found under the hart-software-services folder.

hart-software-services
├── application (main function, crt startup, init function)
├── baremetal
│   ├── drivers (local modules)
│   └── polarfire-soc-bare-metal-library (subtree)
├── boards
│   ├── mpfs-icicle-kit-es (Icicle Kit)
│   ├── mpfs (Aloe Vera platform)
│   └── lc-mpfs (Low-cost Aloe Vera platform)
├── envm-wrapper (helper routines to inflate the HSS to L2-Scratchpad)
├── include
├── init (system initialization)
├── modules
│   ├── compression
│   ├── crypto
│   ├── debug (helper routines for function profiling)
│   ├── misc (miscellaneous routines)
│   └── ssmb (secure software message bus)
│        └── ipi
├── services (software service state machines)
│   ├── beu
│   ├── boot
│   ├── crypto
│   ├── ddr
│   ├── goto
│   ├── ipi_poll
│   ├── mmc
│   ├── opensbi
│   ├── powermode
│   ├── qspi
│   ├── scrub
│   ├── sgdma
│   ├── spi
│   ├── tinycli
│   ├── uart
│   ├── usbdmsc
│   │    └── flash_drive
│   ├── wdog
│   └── ymodem
└── thirdparty
    ├── Kconfiglib (a Kconfig implementation in Python)
    ├── libecc (library for elliptic curves based cryptography (ECC))
    ├── miniz (fast lossless compression library)
    └── opensbi (RISC-V OpenSBI)

Building

The build is configured using the Kconfig system of selecting build options.

The Hart Software Services includes the Kconfig parsing infrastructure directly as a third-party tool invoked by the build system.

Both Linux and Windows are supported by Kconfiglib.

The HSS currently support PolarFire SoC-based icicle kit (mpfs-icicle-kit-es) as a board build target.

Building on Linux

The HSS relies on SoftConsole v2021.3 or later to build on Linux. It also needs tkinter installed for the KConfiglib guiconfig tool. To install this on Ubuntu/Debian:

$ sudo apt install python3-tk

For building on Linux from the command line you must configure the path appropriately. For example:

$ export PATH=$PATH:$HOME/Microchip/SoftConsole-v2021.3/python/bin:$HOME/Microchip/SoftConsole-v2021.3/riscv-unknown-elf-gcc/bin

You can enter an interactive Kconfiglib configuration selection by running make BOARD=mpfs-icicle-kit-es config. This will generate a .config file (which is used to configure the Make build system) and a config.h header file (which is used to configure the source code):

$ make BOARD=mpfs-icicle-kit-es config

Alternatively, copy the default config for your board. For example:

$ cp boards/mpfs-icicle-kit-es/def_config .config

or just use the defconfig target to do the copy:

$ make BOARD=mpfs-icicle-kit-es defconfig 

Once configured, to build, run make:

$ make BOARD=mpfs-icicle-kit-es

In the Default subdirectory, the standard build will create hss-envm.elf and various binary formats (hss-envm.hex and hss-envm.bin). Also generated are output-envm.map, which is a mapfile for the build, and hss-envm.sym, which is a list of symbols. (The name Default is required by SoftConsole for programming purposes.)

A variety of alternative build options can be seen by running make help:

$ make help

Verbose builds (which show each individual command) are possible by adding V=1 to the end of the make command. For example:

$ make V=1

Building on Windows

The HSS relies only on SoftConsole v2021.3 or later to build on Windows.

For more detailed build instructions, particular with regards to using SoftConsole on Windows, see https://github.com/polarfire-soc/polarfire-soc-documentation/blob/master/software-development/polarfire-soc-software-tool-flow.md#build-the-hss.

For building on Windows from the command line one must configure the path appropriately. For example:

C:\> path %SystemRoot%;%SystemRoot%;C:\Microchip\SoftConsole-v2021.3\build_tools\bin;C:\Microchip\SoftConsole-v2021.3\python;C:\Microchip\SoftConsole-v2021.3\riscv-unknown-elf-gcc\bin

Debug

The modules/debug/ subdirectory contains code to enable a number of debug features, including:

  • Logging all state machine transitions to the serial console (MMUART0);
  • Periodic logging of super loop timings to the serial console;
  • Logging of IPI statistics to the serial console;
  • Logging all IPI messages for MSC traces;
  • Function profiling.

Function Profiling

Function profiling allows capturing of the time spent in each C function (through the use of __cyg_profile_func_enter and __cyg_profile_func_exit. This information can be logged to the serial console through calling the dump_profile() function at an appropriate time, depending on what is being debugged.

NOTE: by default, this function is not called, even with profiling enabled.

polarfire-hart-software-services's People

Contributors

griffini avatar cyril-jean avatar hughbreslin avatar lbmeng avatar lhanlyu avatar vfalanis avatar truhlikfredy avatar kraj avatar mallynch avatar ak-at-aries avatar avpatel avatar archshift avatar xypron avatar grandwolf avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.