Wiki

This version is outdated by a newer approved version.DiffThis version (06 Aug 2018 08:56) was approved by Michael Hennerich.The Previously approved version (26 Jul 2018 12:23) is available.Diff

This is an old revision of the document!


PlutoSDR/M2k boot magic explained

Custom u-boot environment variables

There are a set of custom u-boot environmental variables used during boot, which either are set dynamically by custom u-boot commands, or are imported from an additional protected u-boot environment or are part of the regular SPI u-boot environment but are used to control the runtime behavior.

Hardware Revision Handling

The PlutoSDR or M2k firmware (FIT image) supports multiple HW revisions. It’s being done reading a voltage divider which is unique for a given HW revision using the on chip XADC. This voltage is then mapped into 10 possible values which are then set in the fit_config environmental variable. Values are in the form of config@%d where %d is in the range from 0..9. This variable is then being used to load the corresponding FIT config which is right now only a dedicated device tree, however when necessary can be extended to also load a different bitfile.

The adi_hwref command will set fit_config and for Pulto Rev.A it will additionally set the PlutoRevA variable.

variable comment
fit_config config@ number
PlutoRevA set only for Rev.A

Device tree patching

During factory calibration the onboard TCXO reference frequency is measured and the actual reference clock frequency is stored in an additional protected SPI environment which is imported during boot. Later on this value is used to patch the device tree property clock-frequency in the /clocks/clock@0 path. This step can be skipped by the user when setting the ad936x_skip_ext_refclk variable. This allows for custom reference clock frequency set in the regular device tree.

variable device tree destination Comment
ad936x_ext_refclk /clocks/clock@0 clock-frequency Skip this by setting the ad936x_skip_ext_refclk variable
model /model Model string
attr_name /amba/spi@e0006000/ad9361-phy@0 ${attr_name} ${attr_val}
attr_val /amba/spi@e0006000/ad9361-phy@0 ${attr_name} ${attr_val}

Set during DFU update

The DFU altsetting of the DFU interface is stored in the dfu_alt_num variable and the transfers size is stored in the filesize variable.

variable comment
dfu_alt_num altsetting of the DFU interface in progress
filesize filesize of the transferred firmware image

Miscellaneous

variable comment
uboot-version u-boot version string set by the envversion command
university/tools/pluto/devs/booting.1533538602.txt.gz · Last modified: 06 Aug 2018 08:56 by Michael Hennerich