Support for block device NVMEM providers#943
Conversation
|
Upstream branch: 979c294 |
|
Upstream branch: 979c294 |
77d3c02 to
93827a3
Compare
a7bb5c5 to
5e41a3b
Compare
|
Upstream branch: acb7500 |
93827a3 to
cfdc2ec
Compare
5e41a3b to
c3a084b
Compare
|
Upstream branch: 9716c08 |
cfdc2ec to
b2efd59
Compare
|
Upstream branch: 9716c08 |
b2efd59 to
b3fae02
Compare
|
Upstream branch: 9716c08 |
b3fae02 to
b086fb1
Compare
c3a084b to
5f78e5d
Compare
|
Upstream branch: 2a2974b |
b086fb1 to
c542250
Compare
5f78e5d to
e48f9db
Compare
|
Upstream branch: 062871f |
c542250 to
415a7e2
Compare
Child nodes of a fixed-partitions node are not necessarily partition entries, for example an nvmem-layout node has no reg property. The current code passes a NULL reg pointer and uninitialized len to the length check, which can result in a kernel panic or silent failure to register any partitions. Fix validate_of_partition() to return a skip indicator when no reg property is present. Guard add_of_partition() with a reg property check for the same reason. Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Add support for an nvmem-layout subnode under an eMMC hardware partition. This allows the partition to be exposed as an NVMEM provider and its internal layout to be described. For example, an eMMC boot partition can be used to store device-specific information such as a WiFi MAC address. Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Document the NVMEM cells supported by the ath10k driver, the mac-address, pre-calibration data, and calibration data. Since such data may also originate from chipset OTP or be supplied via other device tree structures. All of these cells are optional and can be provided independently, in any combination. Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Add support for an NVMEM cell provider for "local-bd-address", allowing the Bluetooth stack to retrieve controller's BD address from non-volatile storage such as an EEPROM or an eMMC partition. Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
On embedded devices using an eMMC it is common that one or more partitions on the eMMC are used to store MAC addresses and Wi-Fi calibration EEPROM data. Allow referencing the partition in device tree for the kernel and Wi-Fi drivers accessing it via the NVMEM layer. For now, NVMEM is only registered for the whole disk block device, as the OF node is currently only associated to it. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Co-developed-by: Loic Poulain <loic.poulain@oss.qualcomm.com> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Factor out the common NVMEM EUI-48 retrieval logic from of_get_mac_address_nvmem() into a new of_get_nvmem_eui48() helper that accepts the NVMEM cell name as a parameter. This allows other subsystems (e.g. Bluetooth) to reuse the same lookup-validate-copy pattern with a different cell name, without duplicating code. of_get_mac_address_nvmem() is updated to call of_get_nvmem_eui48() with "mac-address", preserving its existing behavior. Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Some devices store the Bluetooth BD address in non-volatile memory, which can be accessed through the NVMEM framework. Similar to Ethernet or WiFi MAC addresses, add support for reading the BD address from a 'local-bd-address' NVMEM cell. As with the device-tree provided BD address, add a quirk to indicate whether a device or platform should attempt to read the address from NVMEM when no valid in-chip address is present. Also add a quirk to indicate if the address is stored in big-endian byte order. Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
When the controller BD address is invalid (zero or default), set the NVMEM quirks to allow retrieving the address from a 'local-bd-address' NVMEM cell. The BD address is often stored alongside the WiFi MAC address in big-endian format, so also set the big-endian quirk. Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
|
Upstream branch: 062871f |
…dresses On Arduino Uno-Q, the eMMC boot1 partition is factory provisioned with device-specific information such as the WiFi MAC address and the Bluetooth BD address. This partition can serve as an alternative to additional non-volatile memory, such as a dedicated EEPROM. The eMMC boot partitions are typically good candidates, as they are relatively small, read-only by default (and can be enforced as hardware read-only), and are not affected by board reflashing procedures, which generally target the eMMC user or GP partitions. Describe the corresponding nvmem-layout for the WiFi and Bluetooth addresses, and point the WiFi and Bluetooth nodes to the appropriate NVMEM cells to retrieve them. Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
415a7e2 to
48d53e9
Compare
Pull request for series with
subject: Support for block device NVMEM providers
version: 3
url: https://patchwork.kernel.org/project/linux-block/list/?series=1107763