storm: add WiFi calibration blobs to the device tree

This patch finds WiFi calibration data in CBMEM, verifies its sanity
and places the calibration blobs in the kernel device tree at the
appropriate locations, mapping VPD key names into device tree paths.

Calibration data in the CBMEM comes from the VPD and could be in one
of two formats, binary or base64. The key for the WiFi calibration
entries in the VPD is

wifi_calibration<if_number> or wifi_base64_calibration<if_number>

depending on the calibration data storage format. CBMEM WiFi
calibration data table uses key names directly from the VPD.

The device tree path of the calibration blobs is as follows:

/soc/pci@<pci_base>/pcie@0/ath10k@0,0/qcom,ath10k-calibration-data<base64_suffix>

where <pci_base> is determined by the interface number (the last
character of the VPD key) and base64_suffix is '-base64', it is added
to the path in case calibration data is stored in the VPD in base64
format.

The standard whirlwind device tree comes with node stubs for binary
format calibration data for three interfaces. These stubs are supposed
to be filled by firmware. If calibration data format for a certain
interface is base64, the firmware is supposed to create a new device
tree node next to the stub. The kernel driver will figure out which of
the two to use.

CQ-DEPEND=CL:225506
BRANCH=storm
BUG=chrome-os-partner:32611
TEST=created three entries in the VPD with one of the keys indicating
     base 64 format, and others - binary format. Booted the new
     firmware of Whirlwind, observed proper device tree entries
     populated.

Change-Id: I028863283c79738117aa72aabcb83debf0ffb022
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225517
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
4 files changed