From d0d0e776cf433ede6711e2c7d5bdf5866381b555 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 20 Apr 2023 20:03:43 +0200 Subject: tools: fix TestFdtUtil() Variable old_outdir cannot be used before assignment. The assignment must occur before the try block. tools/dtoc/test_fdt.py:796:26: E0601: Using variable 'old_outdir' before assignment (used-before-assignment) Add missing space in assignment. Fixes: a004f29464d1 ("binman: Tidy up _SetupDtb() to use its own temporary file") Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- tools/dtoc/test_fdt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index 32fa69cbb01..4fe8d12c403 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -784,8 +784,8 @@ class TestFdtUtil(unittest.TestCase): def test_ensure_compiled_tmpdir(self): """Test providing a temporary directory""" + old_outdir = tools.outdir try: - old_outdir = tools.outdir tools.outdir= None tmpdir = tempfile.mkdtemp(prefix='test_fdt.') dtb = fdt_util.EnsureCompiled(find_dtb_file('dtoc_test_simple.dts'), @@ -793,7 +793,7 @@ class TestFdtUtil(unittest.TestCase): self.assertEqual(tmpdir, os.path.dirname(dtb)) shutil.rmtree(tmpdir) finally: - tools.outdir= old_outdir + tools.outdir = old_outdir def test_get_phandle_name_offset(self): val = fdt_util.GetPhandleNameOffset(self.node, 'missing') -- cgit v1.3.1 From f8816a8a9189250e4513d5cd15d1db657f9549a1 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 2 May 2023 04:59:18 +0200 Subject: dm: core: fix introduce uclass_get_device_by_of_path Correct the function documentation. Fixes: ca031c082700 ("dm: core: introduce uclass_get_device_by_of_path()") Reported-by: Tom Rini Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- include/dm/uclass.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 5c5fb9acac0..456eef7f2f3 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -274,7 +274,7 @@ int uclass_get_device_by_ofnode(enum uclass_id id, ofnode node, * The device is probed to activate it ready for use. * * @id: ID to look up - * @node: Device tree path to search for (if no such path then -ENODEV is returned) + * @path: Device tree path to search for (if no such path then -ENODEV is returned) * @devp: Returns pointer to device (there is only one for each node) * Return: 0 if OK, -ve on error */ -- cgit v1.3.1 From 962424a873be580551800efcf1ce5178945b9eec Mon Sep 17 00:00:00 2001 From: Alexander Shirokov Date: Thu, 27 Apr 2023 12:12:07 +0200 Subject: doc: mmc: drop 0x prefixes in read/write examples The patch drops 0x prefixes because all numbers are interpreted as HEX by default. Also, it fixes the mismatch between input arguments and output at 'mmc write' example. Now it's 256 (0x100) blocks. Signed-off-by: Alexander Shirokov Reviewed-by: Heinrich Schuchardt --- doc/usage/cmd/mmc.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/usage/cmd/mmc.rst b/doc/usage/cmd/mmc.rst index 55e3f9cf98c..71a0303109c 100644 --- a/doc/usage/cmd/mmc.rst +++ b/doc/usage/cmd/mmc.rst @@ -213,10 +213,10 @@ The 'mmc info' command displays device's capabilities: The raw data can be read/written via 'mmc read/write' command: :: - => mmc read 0x40000000 0x5000 0x100 + => mmc read 40000000 5000 100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 40000000 5000 100 MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK The partition list can be shown via 'mmc part' command: -- cgit v1.3.1 From d53b2cfe0805cd84de16f4e2da396b75b409a8ab Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Wed, 12 Apr 2023 22:05:31 +0300 Subject: docs: fix wrong proftool usage Guide shows incorrect usage of proftool, which is confusing. If proftool is used w/o '-o' argument it complains like following $ ./sandbox/tools/proftool -m sandbox/System.map -t trace dump-ftrace > trace.dat Must provide trace data, System.map file and output file Usage: proftool [-cmtv] s/>/-o/ fixes it and proftool outputs decoded data to trace.dat Signed-off-by: Pavel Skripkin Reviewed-by: Simon Glass --- doc/develop/trace.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/develop/trace.rst b/doc/develop/trace.rst index 8425d843e9c..9bbe1345d2d 100644 --- a/doc/develop/trace.rst +++ b/doc/develop/trace.rst @@ -100,7 +100,7 @@ Then run proftool to convert the trace information to ftrace format .. code-block:: console - $ ./sandbox/tools/proftool -m sandbox/System.map -t trace dump-ftrace >trace.dat + $ ./sandbox/tools/proftool -m sandbox/System.map -t trace dump-ftrace -o trace.dat Finally run kernelshark to display it (note it only works with `.dat` files!): -- cgit v1.3.1 From e942fabe8a61c4d86b1a4091387790138d3d4fa7 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 27 Apr 2023 11:56:58 +0200 Subject: doc: Indicate required OpenSBI release for VisionFive 2 Support for the VisionFive 2 board is not contained in the most recent OpenSBI release (v1.2). Signed-off-by: Heinrich Schuchardt Reviewed-by: Leo Yu-Chi Liang --- doc/board/starfive/visionfive2.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/board/starfive/visionfive2.rst b/doc/board/starfive/visionfive2.rst index 22d2a31ff59..dc9eb368c6e 100644 --- a/doc/board/starfive/visionfive2.rst +++ b/doc/board/starfive/visionfive2.rst @@ -51,6 +51,8 @@ cloned and built for JH7110 as below: cd opensbi make PLATFORM=generic FW_TEXT_START=0x40000000 FW_OPTIONS=0 +The VisionFive 2 support for OpenSBI was introduced after the v1.2 release. + More detailed description of steps required to build FW_DYNAMIC firmware is beyond the scope of this document. Please refer OpenSBI documenation. (Note: OpenSBI git repo is at https://github.com/riscv/opensbi.git) -- cgit v1.3.1 From eb59b9e88b1b0e04fa33f5944944f5090a763ac1 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 1 May 2023 14:20:48 +0200 Subject: doc: fix StarFive VisionFive v2 documentation The number of the partition that U-Boot SPL loads the main U-Boot from is defined as 2 by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=0x2. The partition type GUID is not used currently. Reword the description of the boot process to make it clearer. Fixes: 5ecf9b0b8a75 ("board: starfive: add StarFive VisionFive v2 board support") Signed-off-by: Heinrich Schuchardt --- doc/board/starfive/visionfive2.rst | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/board/starfive/visionfive2.rst b/doc/board/starfive/visionfive2.rst index dc9eb368c6e..4d43ac9729c 100644 --- a/doc/board/starfive/visionfive2.rst +++ b/doc/board/starfive/visionfive2.rst @@ -81,14 +81,19 @@ This will generate u-boot-spl.bin.normal.out file. Flashing ~~~~~~~~ -SPL loads the U-Boot SPL (u-boot-spl.bin.normal.out) from a partition with GUID type -2E54B353-1271-4842-806F-E436D6AF6985 +The device firmware loads U-Boot SPL (u-boot-spl.bin.normal.out) from the +partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985. You are free +to choose any partition number. -U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition with GUID -type BC13C2FF-59E6-4262-A352-B275FD6F7172 +With the default configuration U-Boot SPL loads the U-Boot FIT image +(u-boot.itb) from partition 2 (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=0x2). +When formatting it is recommended to use GUID +BC13C2FF-59E6-4262-A352-B275FD6F7172 for this partition. -FIT image (u-boot.itb) is a combination of fw_dynamic.bin, u-boot-nodtb.bin and -device tree blob (jh7110-starfive-visionfive-2-v1.3b.dtb/jh7110-starfive-visionfive-2-v1.2a.dtb) +The FIT image (u-boot.itb) is a combination of OpenSBI's fw_dynamic.bin, +u-boot-nodtb.bin and the device tree blob +(jh7110-starfive-visionfive-2-v1.3b.dtb or +jh7110-starfive-visionfive-2-v1.2a.dtb). Format the SD card (make sure the disk has GPT, otherwise use gdisk to switch) @@ -119,7 +124,9 @@ Program the SD card Booting ~~~~~~~ -Change DIP switches MSEL[1:0] are set to 10, select the boot mode to SD. +The board provides the DIP switches MSEL[1:0] to select the boot device. +To select booting from SD-card set the DIP switches MSEL[1:0] to 10. + Once you plugin the sdcard and power up, you should see the U-Boot prompt. Sample boot log from StarFive VisionFive2 board -- cgit v1.3.1 From d1474f5aa0a9c9ed0e06b3a16d0936160ab2f13c Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 1 May 2023 14:47:52 +0200 Subject: doc: correct HiFive Unmatched boot description Main U-Boot is loaded by sector number, not by partition GUID type. Fixes: 70415e1e528d ("board: sifive: add HiFive Unmatched board support") Signed-off-by: Heinrich Schuchardt --- doc/board/sifive/unmatched.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/board/sifive/unmatched.rst b/doc/board/sifive/unmatched.rst index a99442277b6..de2aab59bb1 100644 --- a/doc/board/sifive/unmatched.rst +++ b/doc/board/sifive/unmatched.rst @@ -56,8 +56,10 @@ Flashing ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID type 5B193300-FC78-40CD-8002-E86C45580B47 -U-Boot SPL expects u-boot.itb from a partition with GUID -type 2E54B353-1271-4842-806F-E436D6AF6985 +With the default configuration U-Boot SPL expects u-boot.itb starting at sector +2082 (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x822). It is recommended to use a +partition with type GUID 2E54B353-1271-4842-806F-E436D6AF6985 for storing +main U-Boot. u-boot.itb is a combination of fw_dynamic.bin, u-boot-nodtb.bin and device tree blob (hifive-unmatched-a00.dtb) -- cgit v1.3.1 From bd730aa05baf1a6c5e61dc1f2e38b48f48a06b05 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 3 May 2023 07:08:05 +0200 Subject: test: fix pydoc issues for EFI tests Fix issues reported by pydocstyle. Signed-off-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas --- test/py/tests/test_efi_bootmgr/conftest.py | 6 ++---- test/py/tests/test_efi_capsule/capsule_defs.py | 2 ++ test/py/tests/test_efi_capsule/conftest.py | 11 ++++++----- test/py/tests/test_efi_secboot/conftest.py | 6 ++++-- test/py/tests/test_efi_secboot/defs.py | 2 ++ 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/test/py/tests/test_efi_bootmgr/conftest.py b/test/py/tests/test_efi_bootmgr/conftest.py index a0a754afbe1..eabafa54298 100644 --- a/test/py/tests/test_efi_bootmgr/conftest.py +++ b/test/py/tests/test_efi_bootmgr/conftest.py @@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ -"""Fixture for UEFI bootmanager test -""" +"""Fixture for UEFI bootmanager test.""" import os import shutil @@ -10,8 +9,7 @@ import pytest @pytest.fixture(scope='session') def efi_bootmgr_data(u_boot_config): - """Set up a file system to be used in UEFI bootmanager - tests + """Set up a file system to be used in UEFI bootmanager tests. Args: u_boot_config -- U-boot configuration. diff --git a/test/py/tests/test_efi_capsule/capsule_defs.py b/test/py/tests/test_efi_capsule/capsule_defs.py index 59b40f11bd1..3cc695e29b5 100644 --- a/test/py/tests/test_efi_capsule/capsule_defs.py +++ b/test/py/tests/test_efi_capsule/capsule_defs.py @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0+ +"""Directoreis used for authentication and capsule tests.""" + # Directories CAPSULE_DATA_DIR = '/EFI/CapsuleTestData' CAPSULE_INSTALL_DIR = '/EFI/UpdateCapsule' diff --git a/test/py/tests/test_efi_capsule/conftest.py b/test/py/tests/test_efi_capsule/conftest.py index 0e5137de60d..a337e629362 100644 --- a/test/py/tests/test_efi_capsule/conftest.py +++ b/test/py/tests/test_efi_capsule/conftest.py @@ -2,8 +2,7 @@ # Copyright (c) 2020, Linaro Limited # Author: AKASHI Takahiro -"""Fixture for UEFI capsule test -""" +"""Fixture for UEFI capsule test.""" from subprocess import call, check_call, CalledProcessError import pytest @@ -11,13 +10,15 @@ from capsule_defs import CAPSULE_DATA_DIR, CAPSULE_INSTALL_DIR, EFITOOLS_PATH @pytest.fixture(scope='session') def efi_capsule_data(request, u_boot_config): - """Set up a file system to be used in UEFI capsule and authentication test - and return a ath to disk image to be used for testing + """Set up a file system and return path to image. + + The function sets up a file system to be used in UEFI capsule and + authentication test and returns a path to disk image to be used + for testing. request -- Pytest request object. u_boot_config -- U-boot configuration. """ - mnt_point = u_boot_config.persistent_data_dir + '/test_efi_capsule' data_dir = mnt_point + CAPSULE_DATA_DIR install_dir = mnt_point + CAPSULE_INSTALL_DIR diff --git a/test/py/tests/test_efi_secboot/conftest.py b/test/py/tests/test_efi_secboot/conftest.py index 65cde7a2f23..30ff7029438 100644 --- a/test/py/tests/test_efi_secboot/conftest.py +++ b/test/py/tests/test_efi_secboot/conftest.py @@ -2,7 +2,7 @@ # Copyright (c) 2019, Linaro Limited # Author: AKASHI Takahiro -""" Fixture for UEFI secure boot test """ +"""Fixture for UEFI secure boot test.""" from subprocess import call, check_call, CalledProcessError import pytest @@ -132,7 +132,9 @@ def efi_boot_env(request, u_boot_config): @pytest.fixture(scope='session') def efi_boot_env_intca(request, u_boot_config): - """Set up a file system to be used in UEFI secure boot test + """Set up file system for secure boot test. + + Set up a file system to be used in UEFI secure boot test of intermediate certificates. Args: diff --git a/test/py/tests/test_efi_secboot/defs.py b/test/py/tests/test_efi_secboot/defs.py index b7a2a118511..6a2317e295b 100644 --- a/test/py/tests/test_efi_secboot/defs.py +++ b/test/py/tests/test_efi_secboot/defs.py @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0+ +"""Constants used for secure boot test.""" + # Owner guid GUID = '11111111-2222-3333-4444-123456789abc' -- cgit v1.3.1 From feff3e6c3823acd0262bfdf96486a8dc3800b209 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 28 Apr 2023 08:52:41 +0200 Subject: doc: man-page for cp Add a man-page for the cp command. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- doc/usage/cmd/cp.rst | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 84 insertions(+) create mode 100644 doc/usage/cmd/cp.rst diff --git a/doc/usage/cmd/cp.rst b/doc/usage/cmd/cp.rst new file mode 100644 index 00000000000..12a24e19fee --- /dev/null +++ b/doc/usage/cmd/cp.rst @@ -0,0 +1,83 @@ +.. SPDX-License-Identifier: GPL-2.0+: + +cp command +========== + +Synopsis +-------- + +:: + + cp source target count + cp.b source target count + cp.w source target count + cp.l source target count + cp.q source target count + +Description +----------- + +The cp command is used to copy *count* chunks of memory from the *source* +address to the *target* address. If the *target* address points to NOR flash, +the flash is programmed. + +The number bytes in one chunk is defined by the suffix defaulting to 4 bytes: + +====== ========== +suffix chunk size +====== ========== +.b 1 byte +.w 2 bytes +.l 4 bytes +.q 8 bytes + 4 bytes +====== ========== + +source + source address, hexadecimal + +target + target address, hexadecimal + +count + number of words to be copied, hexadecimal + +Examples +-------- + +The example device has a NOR flash where the lower part of the flash is +protected. We first copy to RAM, then to unprotected flash. Last we try to +write to protectd flash. + +:: + + => mtd list + List of MTD devices: + * nor0 + - device: flash@0 + - parent: root_driver + - driver: cfi_flash + - path: /flash@0 + - type: NOR flash + - block size: 0x20000 bytes + - min I/O: 0x1 bytes + - 0x000000000000-0x000002000000 : "nor0" + => cp.b 4020000 5000000 200000 + => cp.b 4020000 1e00000 20000 + Copy to Flash... done + => cp.b 4020000 0 20000 + Copy to Flash... Can't write to protected Flash sectors + => + +Configuration +------------- + +The cp command is available if CONFIG_CMD_MEMORY=y. Support for 64 bit words +(cp.q) depends on CONFIG_MEM_SUPPORT_64BIT_DATA=y. Copying to flash depends on +CONFIG_MTD_NOR_FLASH=y. + +Return value +------------ + +The return value $? is set to 0 (true) if the command was successfully, +1 (false) otherwise. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index cdf710919a2..0fde130a548 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -41,6 +41,7 @@ Shell commands cmd/cmp cmd/coninfo cmd/conitrace + cmd/cp cmd/cyclic cmd/dm cmd/ebtupdate -- cgit v1.3.1 From 27a03f03b214dbb988c5b40ce49743442544578a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 20 Apr 2023 11:38:16 +1200 Subject: efi: Rename the base efi self-test This function uses the same base name as all the others in this file, so it is not easy to run just that one test. Add a _base suffix so that it can be run on its own. Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- test/py/tests/test_efi_selftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py index e92d63cde6e..43f24245582 100644 --- a/test/py/tests/test_efi_selftest.py +++ b/test/py/tests/test_efi_selftest.py @@ -7,7 +7,7 @@ import pytest @pytest.mark.buildconfigspec('cmd_bootefi_selftest') -def test_efi_selftest(u_boot_console): +def test_efi_selftest_base(u_boot_console): """Run UEFI unit tests u_boot_console -- U-Boot console -- cgit v1.3.1 From 8a6414d1e410ab65780a4c5eb99e79e5b9bc21c1 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 2 May 2023 05:04:11 +0200 Subject: CI: treat documentation warnings as errors We do not want to merge documentation that produces Sphinx warnings. scripts/kernel-doc uses environment variable KDOC_WERROR to determine if warnings should be treated as errors. Reported-by: Tom Rini Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- .azure-pipelines.yml | 2 +- .gitlab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 76ffdeebd66..3c1846a5bc3 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -89,7 +89,7 @@ stages: virtualenv -p /usr/bin/python3 /tmp/venvhtml . /tmp/venvhtml/bin/activate pip install -r doc/sphinx/requirements.txt - make htmldocs + make htmldocs KDOC_WERROR=1 make infodocs - job: todo diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b193fee98f8..e6c6ab3586e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -171,7 +171,7 @@ docs: - virtualenv -p /usr/bin/python3 /tmp/venvhtml - . /tmp/venvhtml/bin/activate - pip install -r doc/sphinx/requirements.txt - - make htmldocs + - make htmldocs KDOC_WERROR=1 - make infodocs # some statistics about the code base -- cgit v1.3.1