Friday 27 May 2016

how to load firmware using the PIL ?

Modem, dsp, and sensors peripherals require their
firmware to be loaded into memory before they can be properly
taken out of reset.

Drivers are expected to call pil_get() when they wish to load a
peripheral. This will initiate multiple firmware_request()s for
the metadata and image blobs for a peripheral. Once the image has
been loaded into memory, it is validated and brought out of reset
via the peripheral reset driver.

When drivers have completed using the peripheral they are
expected to call pil_put(). This decrements a reference count on
the peripheral and shuts down the device if it is no longer in
use.

This driver also exposes a debugfs interface. The top level
directory 'pil' contains a set of files (one file for each pil
device). Writing 'get' to a file will call pil_get() with the
device name. Writing 'put' to a file will call pil_put() with the
device. Reading the file will return the reference count for
the device.

The layout looks like this:

    - pil
    |- dsps
    |- q6
    |- modem
   
Peripheral image loading (PIL)

The PIL (Peripheral Image Loader) driver loads peripheral images into memory
and interfaces with the Peripheral Authentication Service (PAS) to
authenticate and reset peripherals embedded in the SoC.

The PAS could either be running under secure mode in the application
processor (secure boot support) or be running as a non-secure kernel driver
(non-secure boot support).

The PIL driver also does housekeeping to handle cases where more than one
client driver is using the same peripheral.

arch/arm/mach-msm/peripheral-loader.c             
arch/arm/mach-msm/peripheral-loader.h             
arch/arm/mach-msm/peripheral-reset.c

Modem

arch/arm/mach-msm/modem-8660.c

call pil_force_boot("modem");

ADSP
arch/arm/mach-msm/qdsp6v2/adsp-loader.c
adsp_loader_do()
subsystem_get("adsp");

No comments:

Post a Comment