On the STb7100 platform, Linux provides support for launching ST231 applications on each of the two slave CPUs.
This release of the ST231 toolset does not provide hardware initialization, so this function must be performed by the ST40 side. This means that the only model allowed is "boot from Linux". If a Multicore/Mux board is wired on the STb7100, the problem can be bypassed by connecting one ST Micro Connect to the ST40 side and one or two to the ST231 side. The ST40 will perform the hardware setup and then the ST231 will start the application.
The ST231 applications are executable ELF files stored on the target Linux file system. On the STb7100 platform the boot system is closely connected with reset. By default the ST40 boots first. The boot sequences of the two ST231s are then under the control of the ST40.
For each ST231 CPU two registers are required to control the boot sequence. In the default boot mode, the boot requests from each CPU are filtered and halted. The ST40 boots from EMI and goes through a procedure like the following for each ST231.
The starting address of the ST231 application is stored into the boot control configuration register of the ST231 CPU.
The least significant bit of that register is set to 1 to enable the start sequence.
The least significant bit of the ST231 reset configuration register is then set to 1 to force that slave processor to reload the new boot address.
This bit is then cleared to trigger the start sequence of the ST231 CPU.
On the Linux side, the utility stslave (release 2.0 or later is required) is used to load a specific ST231 ELF file and to launch it. stslave uses the STMicroelectronics coprocessor driver to manage the load/start/stop sequence of the application.
For the STb7100 platform we have choosen to provide (together with the classic stslave boot mode) a new boot mode based on the Linux firmware subsystem interface. This new method integrates the ST coprocessor support better with kernel 2.6 and treats the coprocessor as a device which requires a firmware upload to work.
At the end of this chapter you'll find an example of how to boot the ST231 application using this new scenario.
ST200 toolchain release 4.1 or later must be installed.
The Linux kernel must be configured with STMicroelectronics coprocessor support: the standard one is enabled by default, the firmware coprocessor support must be enabled (following the "Device Drivers" / "STM specific devices" path).
The hotplug package fully installed in the target FS (firmware coprocessor only).
The stslave utility must be installed.
The switches configuration must be left as the default.
The ST40 must be able to boot from ROM or DCU (an ST Micro Connect can be plugged in).
To become familiar with STb7100 multi boot the ST231 MailBox example can be downloaded. Install and run this and it will perform a counter increment on the MailBox register, which is located at 0xb9211004 for the first ST231 CPU (DeltaPhi) and 0xb9211008 for the second (Audio). To verify that the CPUs have started, these registers can be read with the gdb command x/1xw <address>.
The examples below are based on the following memory layout:
The pre-built MailBox application may be used, or it can be rebuilt from the source code by changing to the test directory and entering:
host% make CPU=<val> where <val> will be 0 to build the application for the Video (DeltaPhi) ST231, or 1 to build it for the Audio ST231. To run the application on the target do the following steps.
Copy the executable ELF file onto the target file system mounted by Linux.
Build the Linux kernel.
Boot the Linux kernel (from ST Micro Connect or Flash), making sure that the command line defines the correct RAM layout. In the example of Figure 15: an example of RAM layout on STb7100 platforms it would be:
... mem=64m coprocessor_mem=16m@0x06000000,16m@0x07000000 ...When the boot is complete, and the shell prompt has appeared, check for the following devices (on the latest Linux releases they should already exist):
target# mknod /dev/st231 c 63 0 target# mknod /dev/st231-0 c 63 0 target# mknod /dev/st231-1 c 63 1
Launch the ST231 applications using the standard stslave support:
target# stslave -t stb7100.0 -R sample200-0.elf target# stslave -t stb7100.1 -R sample200-1.elf
target# stslave -t stb7100.0 -Z target# stslave -t stb7100.1 -Z
The next step is to launch the ST231 applications using the firmware stslave support. Open the /etc/stslave.conf file and add the absolute firmware elf file path you would like to boot.
On the target, enter:
target# cat /dev/st231-XFor example, if you want to execute the standard example distributed (sample200-0.elf) you have to type:
target# cat /dev/st231-0 (to say device 0 and firmware 0)After this step, the st231 application will boot on STb7100 platform.