Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Output log at UART6 (set at 115,200 bps by x-boot).

  2. Support SP7350 power manager

    • Detect wake-up key

    • MainPower down and up control for main-domain, CA55, NPU, video codec power down/up control

    • Support DDR retention

    • Support PMIC control

  3. Support communication with CA55 via virtual l/O serial port

  4. Support CmBacktrace to tracks and debug ARM Cortex-M4

  5. Support Arduino hardware interface, such as SPI, I2C, UART, timer, GPIO.

  6. Support CUnit test of SPI, I2C, UART, timer, GPIO driver

...

By default, FreeRTOS of SP7350 platform is configured to run 6 tasks. In table below, we outline each task along with its location of source files and functionality.

TasksFolders or files

Files (under FreeRTOS project directory)

Descriptions

powerdown

/application/power_manager/power_down.c

power-down control

powerup

/application/power_manager/power_up.c

power-up control

wakeupkey

/application/power_manager/wakeup_key.c

Detect wake-up key

virtIOrw

/application/VirtIOSerial/vios_rw.cpp

virtual IO read/write

tmr Svc

/system/freertos/timers.c

FreeRTOS system Timer task

Idle

/system/freertos/tasks.c

FreeRTOS system Idle task

The source files of FreeRTOS are located within the "firmware/arduino_core_sunplus/" directory under the project's top directory.

Linux remote processor framework

The Linux Remote Processor Framework is a framework that allows for managing (power on, load firmware, power off) and communicating with remote processors on Linux systems. This framework is typically used in embedded or multiprocessor systems where one processor (usually the main processor) is responsible for managing and controlling the other remote processors. In addition, this framework also adds rpmsg, virtio devices for remote processors that supports this kind of communication. This way, platform-specific remoteproc drivers driver only need needs to provide a few low-level handlers, and then all rpmsg drivers will then just work. For example:CM4 boot via CA55 cmd

  1. Load firmware of CM4 via Linux shell command:

Code Block
echo firmware > /sys/class/remoteproc/remoteproc/firmware

where ‘firmware’ is the firmware file (binary) of CM4 stored at “/lib/firmware/".

  1. Start CM4 via Linux shell command:

Code Block
 echo start > /sys/class/remoteproc/remoteproc0/state
  1. Stop CM4

...

  1. via

...

  1. Linux shell command:

Code Block
echo stop > /sys/class/remoteproc/remoteproc0/state

Linux remoteproc driver

The Remoteproc remoteproc driver base on remote processor framework to implements bases on Remote Processor Framework to implement firmware loading and booting, resource allocation and management, communication support, and other functions.

Enable Enabling remoteproc driver in Linux kernel need needs to enable the configuration of (kernel feature:

CONFIG_REMOTEPROC=y and

CONFIG_SUNPLUS_REMOTEPROC=y)

in default configuration file.

Device-tree nodes for remoteproc driver

...

vring0 and vring1 represent the two virtual rings of a Virtio device, typically one for sending data and the other for receiving data. These two rings pass data and control information through a set of descriptors. vbuffer represents the Virtio device's buffer, which is used to store data.

The remoteproc-related dts configuration is notes are as follows:

Code Block
	vdev0buffer: vdev0buffer@5be00000 {
		compatible = "shared-dma-pool";
		reg = <0x0 0x5be00000 0x0 0x100000>;
		no-map;
	};
	vdev0vring0: vdev0vring0@5bf00000 {
		compatible = "shared-dma-pool";
		reg = <0x0 0x5bf00000 0x0 0x10000>;
		no-map;
	};
	vdev0vring1: vdev0vring1@5bf10000 {
		compatible = "shared-dma-pool";
		reg = <0x0 0x5bf10000 0x0 0x10000>;
		no-map;
	};

RPMSG and virtual IO

The RPMsg framework (Remote Processor Messaging Framework) is an implementation of remote processor messaging. It allows communication between different processors, including communication between the main processor and remote processors, and it is a VirtIO-based message bus that allows Linux kernel drivers to communicate with remote processors in the system.

Enable Enabling RPMSG and VirtIO in kernel need needs to enable the configuration of (kernel feature:

CONFIG_RPMSG=y and

CONFIG_RPMSG_VIRTIO=y)RPMSG:After

in default configuration file.

  • RPMSG: After CM4 is running, a device node /dev/ttyRPMSGx is generated on the kernel side, and the kernel side communicates with CM4 via /dev/ttyRPMSGx.

...

  • VirtIO: Virtio is a standard for high-performance virtual appliances in virtualized environments, CM4 write/read VirtioSerial to transfer data to /dev/ttyRPMSGX

Build image

Use “make firmware" in the root directory to compile the Freertos code,The FreeRTOS code, The output file after compilation is put in bin/firmware, . You need to copy this file it to / linux/rootfs/initramfs/disk/lib/firmware under rootfsin project directory.

This project includes several code environments, including FREERTOSFreeRTOS+Arduino (default), Arduino, and CunitCUnit, and the different code environments are determined by the configuration of the Makefile.

  • FREERTOSFreeRTOS+Arduino: The default compiled image is based on the Freertos FreeRTOS environment, Implemented It implements power management function for suspend /and resume processprocesses.

  • Arduino: set Set FREERTOS ?=0 in Makefile will compile the code environment with only arduinoArduino, not FREERTOSFreeRTOS. the The entry function of the program is in ‘application/application/arduino_main.cppCunit:set cpp’.

  • CUnit: Set CUNIT ?=1 in Makefile. Compiled code contains only Cunit test code. include spi/i2c/uart/timer/gpio test unitsCUnit test code, including SPI, I2C, UART, timer, and GPIO test units.

Supported drivers for SP7350 platform

...