<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/nvmem/u-boot-env.c, branch linux-7.1.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-09-11T14:05:15+00:00</updated>
<entry>
<title>nvmem: layouts: add U-Boot env layout</title>
<updated>2024-09-11T14:05:15+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2024-09-02T14:29:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f15811286aff4664bf275a7ede64e1b8858151b'/>
<id>urn:sha1:5f15811286aff4664bf275a7ede64e1b8858151b</id>
<content type='text'>
U-Boot environment variables are stored in a specific format. Actual
data can be placed in various storage sources (MTD, UBI volume, EEPROM,
NVRAM, etc.).

Move all generic (NVMEM device independent) code from NVMEM device
driver to an NVMEM layout driver. Then add a simple NVMEM layout code on
top of it.

This allows using NVMEM layout for parsing U-Boot env data stored in any
kind of NVMEM device.

The old NVMEM glue driver stays in place for handling bindings in the
MTD context. To avoid code duplication it uses exported layout parsing
function. Please note that handling MTD &amp; NVMEM layout bindings may be
refactored in the future.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20240902142952.71639-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: u-boot-env: error if NVMEM device is too small</title>
<updated>2024-09-03T10:20:38+00:00</updated>
<author>
<name>John Thomson</name>
<email>git@johnthomson.fastmail.com.au</email>
</author>
<published>2024-09-02T14:25:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8679e8b4a1ebdb40c4429e49368d29353e07b601'/>
<id>urn:sha1:8679e8b4a1ebdb40c4429e49368d29353e07b601</id>
<content type='text'>
Verify data size before trying to parse it to avoid reading out of
buffer. This could happen in case of problems at MTD level or invalid DT
bindings.

Signed-off-by: John Thomson &lt;git@johnthomson.fastmail.com.au&gt;
Cc: stable &lt;stable@kernel.org&gt;
Fixes: d5542923f200 ("nvmem: add driver handling U-Boot environment variables")
[rmilecki: simplify commit description &amp; rebase]
Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20240902142510.71096-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: add missing MODULE_DESCRIPTION() macros</title>
<updated>2024-07-05T07:55:04+00:00</updated>
<author>
<name>Jeff Johnson</name>
<email>quic_jjohnson@quicinc.com</email>
</author>
<published>2024-07-05T07:48:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c553bad4c5fc5ae44bd2fcaa73e1d6bedfb1c35c'/>
<id>urn:sha1:c553bad4c5fc5ae44bd2fcaa73e1d6bedfb1c35c</id>
<content type='text'>
make allmodconfig &amp;&amp; make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvmem/nvmem-apple-efuses.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvmem/nvmem_brcm_nvram.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvmem/nvmem_u-boot-env.o

Add the missing invocations of the MODULE_DESCRIPTION() macro.

Signed-off-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20240705074852.423202-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: u-boot-env: improve coding style</title>
<updated>2024-01-04T16:01:13+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2023-12-21T17:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6bafe07c930676d6430be471310958070816a595'/>
<id>urn:sha1:6bafe07c930676d6430be471310958070816a595</id>
<content type='text'>
1. Prefer kzalloc() over kcalloc()
   See memory-allocation.rst which says: "to be on the safe side it's
   best to use routines that set memory to zero, like kzalloc()"
2. Drop dev_err() for u_boot_env_add_cells() fail
   It can fail only on -ENOMEM. We don't want to print error then.
3. Add extra "crc32_addr" variable
   It makes code reading header's crc32 easier to understand / review.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/r/20231221173421.13737-5-zajec5@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: u-boot-env: use nvmem device helpers</title>
<updated>2024-01-04T16:01:13+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2023-12-21T17:34:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a832556d23c5a11115f300011a5874d6107a0d62'/>
<id>urn:sha1:a832556d23c5a11115f300011a5874d6107a0d62</id>
<content type='text'>
Use nvmem_dev_size() and nvmem_device_read() to make this driver less
mtd dependent.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/r/20231221173421.13737-4-zajec5@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: u-boot-env: use nvmem_add_one_cell() nvmem subsystem helper</title>
<updated>2024-01-04T16:01:13+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2023-12-21T17:34:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7c8979b42b1a9c5604f431ba804928e55919263c'/>
<id>urn:sha1:7c8979b42b1a9c5604f431ba804928e55919263c</id>
<content type='text'>
Simplify adding NVMEM cells.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/r/20231221173421.13737-3-zajec5@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: u-boot-env:: Replace zero-length array with DECLARE_FLEX_ARRAY() helper</title>
<updated>2023-08-23T14:34:02+00:00</updated>
<author>
<name>Atul Raut</name>
<email>rauji.raut@gmail.com</email>
</author>
<published>2023-08-23T13:27:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1006ebe9f1b5dad6b9e8b34ca9b982cc8c16ccee'/>
<id>urn:sha1:1006ebe9f1b5dad6b9e8b34ca9b982cc8c16ccee</id>
<content type='text'>
We are moving toward replacing zero-length arrays with C99 flexible-array
members since they are deprecated. Therefore, the new DECLARE_FLEX_ARRAY()
helper macro should be used to replace the zero-length array declaration.

This fixes warnings such as:
./drivers/nvmem/u-boot-env.c:50:9-13: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)

Signed-off-by: Atul Raut &lt;rauji.raut@gmail.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20230823132744.350618-19-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: Explicitly include correct DT includes</title>
<updated>2023-08-23T14:34:01+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-08-23T13:27:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9bf75da0e2613d64c3d5e965d49fb80820d367cf'/>
<id>urn:sha1:9bf75da0e2613d64c3d5e965d49fb80820d367cf</id>
<content type='text'>
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20230823132744.350618-14-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: u-boot-env: post-process "ethaddr" env variable</title>
<updated>2023-04-05T17:41:13+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2023-04-04T17:21:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c49f1a8af6bcf6d18576bca898f8083ca4b129e1'/>
<id>urn:sha1:c49f1a8af6bcf6d18576bca898f8083ca4b129e1</id>
<content type='text'>
U-Boot environment variables are stored in ASCII format so "ethaddr"
requires parsing into binary to make it work with Ethernet interfaces.

This includes support for indexes to support #nvmem-cell-cells = &lt;1&gt;.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20230404172148.82422-36-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: u-boot-env: add Broadcom format support</title>
<updated>2022-11-23T18:44:52+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2022-11-18T06:39:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ada84d07af6097b2addd18262668ce6cb9e15206'/>
<id>urn:sha1:ada84d07af6097b2addd18262668ce6cb9e15206</id>
<content type='text'>
Broadcom uses U-Boot for a lot of their bcmbca familiy chipsets. They
decided to store U-Boot environment data inside U-Boot partition and to
use a custom header (with "uEnv" magic and env data length).

Add support for Broadcom's specific binding and their custom format.

Ref: 6b0584c19d87 ("dt-bindings: nvmem: u-boot,env: add Broadcom's variant binding")
Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20221118063932.6418-9-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
