Commit b310cf20 authored by Mahesh Rao's avatar Mahesh Rao Committed by Anas Nashif
Browse files

samples: sip_svc: Sample application using sip_svc service.



Sample application to retrieve voltage from SDM in
INTEL AGILEX SOC FPGA

Signed-off-by: default avatarMahesh Rao <mahesh.rao@intel.com>
parent d3010aae
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
# Copyright (c) 2023 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(sip_svc_get_sdm_volatge)

target_sources(app PRIVATE src/main.c)
+57 −0
Original line number Diff line number Diff line
.. _sip_svc_sample:

SiP SVC sample
##############

Overview
********

This sample demonstrates the usage of SiP SVC subsystem.This sample
performs a voltage value query from Secure Device Manager in Intel Agilex
SoC FPGA.

Caveats
*******

* SiP SVC subsystem relies on the firmware running in EL3 layer to be in compatible
  with protocol defined inside the SiP SVC subsystem used by the project.
* The sample application relies on the Trusted Firmware ARM firmware in
  intel Agilex SoC FPGA query the voltage levels in Secure Device Manager.

Building and Running
********************
For building the application:

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/sip_svc
   :board: intel_socfpga_agilex_socdk
   :goals: build

For running the application the Zephyr image can be loaded in DDR memory
at address 0x00100000 and ATF BL31 at 0x00001000 from SD Card or QSPI Flash
in ATF BL2.

Sample Output
*************
.. code-block:: console

  *** Booting Zephyr OS build zephyr-v3.3.0-2963-gb5ba49ae300e ***
  Got response of transaction id 0x00 and voltage is 0.846878v
  Got response of transaction id 0x01 and voltage is 0.858170v
  Got response of transaction id 0x02 and voltage is 0.860168v
  Got response of transaction id 0x03 and voltage is 0.846832v
  Got response of transaction id 0x04 and voltage is 0.858337v
  Got response of transaction id 0x05 and voltage is 0.871704v
  Got response of transaction id 0x06 and voltage is 0.859421v
  Got response of transaction id 0x07 and voltage is 0.857254v
  Got response of transaction id 0x08 and voltage is 0.858429v
  Got response of transaction id 0x09 and voltage is 0.859879v
  Got response of transaction id 0x0a and voltage is 0.845139v
  Got response of transaction id 0x0b and voltage is 0.858459v
  Got response of transaction id 0x0c and voltage is 0.859283v
  Got response of transaction id 0x0d and voltage is 0.846207v
  Got response of transaction id 0x0e and voltage is 0.855850v
  Got response of transaction id 0x0f and voltage is 0.859283v
  Got response of transaction id 0x00 and voltage is 0.846832v
  Got response of transaction id 0x01 and voltage is 0.856049v
  Got response of transaction id 0x02 and voltage is 0.859879v
+11 −0
Original line number Diff line number Diff line
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * Copyright (C) 2023, Intel Corporation
 *
 */

&sip_smc {
	status = "okay";
	zephyr,num-clients = <1>;
};
+10 −0
Original line number Diff line number Diff line
# Copyright (c) 2023, Intel Corporation.
# SPDX-License-Identifier: Apache-2.0

# SiP SVC Service
CONFIG_ARM_SIP_SVC_DRIVER=y
CONFIG_ARM_SIP_SVC_SUBSYS=y
CONFIG_ARM_SIP_SVC_SUBSYS_SINGLY_OPEN=y

# Misc
CONFIG_HEAP_MEM_POOL_SIZE=8192
+18 −0
Original line number Diff line number Diff line
sample:
  name: SIP SVC sample
common:
  filter: CONFIG_ARM_SIP_SVC_HAS_INTEL_SDM_MAILBOX_FIFO
  integration_platforms:
    - intel_socfpga_agilex_socdk
tests:
  sample.subsys.sip_svc:
    tags: subsys
    harness: console
    harness_config:
      type: one_line
      ordered: true
      regex:
        - "Got response of transaction id 0x[0-9a-f][0-9a-f] and voltage is [0-9].[0-9]+v"
      filter: CONFIG_ARM_SIP_SVC_HAS_INTEL_SDM_MAILBOX_FIFO
    integration_platforms:
      - intel_socfpga_agilex_socdk
Loading