Commit graph

2262 commits

Author SHA1 Message Date
Heinrich Schuchardt
ef5ccaae64 cmd/exception: test RISC-V 16 bit aligned instruction
A 16 bit aligned instruction should generated an exception if the C
extension is not available.

Provide an 'extension ialign16' command for testing exception handling.

For testing build qemu-riscv64_defconfig with CONFIG_RISCV_ISA_C=n
and run with

    qemu-system-riscv64 -M virt -bios u-boot -nographic -cpu rv64,c=false

    => exception ialign16
    Unhandled exception: Instruction address misaligned
    EPC: 0000000087719138 RA: 0000000087719218 TVAL: 000000008771913e
    EPC: 0000000080020138 RA: 0000000080020218 reloc adjusted

    Code: 0113 0101 8067 0000 0113 ff01 3423 0011 (006f 0060)

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-10-04 17:59:43 +08:00
Heinrich Schuchardt
f2e4b9d3c2 cmd/exception: support RISC-V compressed instruction
Eliminating the C extension on application processors is under
discussion.

Support emitting a compressed instruction. This will lead to an
illegal instruction exception if the C extension is not implemented.

For testing build qemu-riscv64_defconfig with CONFIG_RISCV_ISA_C=n
and run with

    qemu-system-riscv64 -M virt -bios u-boot -nographic -cpu rv64,c=false

    => exception compressed
    Unhandled exception: Illegal instruction
    EPC: 0000000087731708 RA: 000000008773fe44 TVAL: 0000000000004501
    EPC: 000000008001b708 RA: 0000000080029e44 reloc adjusted

    Code: 0b93 0000 0493 0000 0993 0000 f06f ccdf (4501)

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-10-04 17:59:40 +08:00
Tom Rini
ac897385bb Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-02 10:55:44 -04:00
Roger Knecht
c3b27a826f cmd: xxd: move xxd into shell commands
Move xxd into shell command section.

Signed-off-by: Roger Knecht <rknecht@pm.me>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-09-30 15:24:44 -04:00
Tom Rini
90c81f407d buildman file-keeping and build-progress improvements
dm tree enhancement
 adjust meaning of bootph-pre-ram/sram
 -----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAmUPQXURHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreY1TAf+LeDzKKMhJmyo5ImQWlKPdFt9UGlWqthL
 PBngUWV7GdQ5Kn+dLmKmySAmnQC4XNid565nJt8okmMfpHYUBhOnrnJmrXTZdDPJ
 lYrpEAR7fTyTTTwjSVFcIXJ56bIT07AUX6jQATh383+Plm0U15tRBMguNsrTy1wL
 EmJBVdeT0BZkpSkJyqAIkVuwjOYP+KSuVCectL5LRIpKtjOA+HmMGmELUirjuL00
 uN2h/uucuSGFnjCmKW4l9sYrxxYgd/zN2Y8SOJwBebKyHxSgyvNdbjZxeG5o3gSS
 ruUSEx4DHYVIRHeDBAnwB4wLdCOqfC2dy0ACReTg0Li+iSQN9qYtEg==
 =Sl3P
 -----END PGP SIGNATURE-----

Merge tag 'dm-next-23sep23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

buildman file-keeping and build-progress improvements
dm tree enhancement
adjust meaning of bootph-pre-ram/sram
2023-09-24 12:43:00 -04:00
Simon Glass
1e94b46f73 common: Drop linux/printk.h from common header
This old patch was marked as deferred. Bring it back to life, to continue
towards the removal of common.h

Move this out of the common header and include it only where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-24 09:54:57 -04:00
AKASHI Takahiro
36e45f69c4 cmd: dm: allow for selecting uclass and device
The output from "dm tree" or "dm uclass" is a bit annoying
if the number of devices available on the system is huge.
(This is especially true on sandbox when I debug some DM code.)

With this patch, we can specify the uclass name or the device
name that we are interested in in order to limit the output.

For instance,

=> dm uclass usb
uclass 121: usb
0     usb@1 @ 0bcff8b0, seq 1

uclass 124: usb

=> dm tree usb:usb@1
 Class     Index  Probed  Driver                Name
-----------------------------------------------------------
 usb           0  [   ]   usb_sandbox           usb@1
 usb_hub       0  [   ]   usb_hub               `-- hub
 usb_emul      0  [   ]   usb_sandbox_hub           `-- hub-emul
 usb_emul      1  [   ]   usb_sandbox_flash             |-- flash-stick@0
 usb_emul      2  [   ]   usb_sandbox_flash             |-- flash-stick@1
 usb_emul      3  [   ]   usb_sandbox_flash             |-- flash-stick@2
 usb_emul      4  [   ]   usb_sandbox_keyb              `-- keyb@3

If you want forward-matching against a uclass or udevice name,
you can specify "-e" option.

=> dm uclass -e usb
uclass 15: usb_emul
0     hub-emul @ 0bcffb00, seq 0
1     flash-stick@0 @ 0bcffc30, seq 1
2     flash-stick@1 @ 0bcffdc0, seq 2
3     flash-stick@2 @ 0bcfff50, seq 3
4     keyb@3 @ 0bd000e0, seq 4

uclass 64: usb_mass_storage

uclass 121: usb
0     usb@1 @ 0bcff8b0, seq 1

uclass 122: usb_dev_generic

uclass 123: usb_hub
0     hub @ 0bcff9b0, seq 0

uclass 124: usb

=> dm tree -e usb
 Class     Index  Probed  Driver                Name
-----------------------------------------------------------
 usb           0  [   ]   usb_sandbox           usb@1
 usb_hub       0  [   ]   usb_hub               `-- hub
 usb_emul      0  [   ]   usb_sandbox_hub           `-- hub-emul
 usb_emul      1  [   ]   usb_sandbox_flash             |-- flash-stick@0
 usb_emul      2  [   ]   usb_sandbox_flash             |-- flash-stick@1
 usb_emul      3  [   ]   usb_sandbox_flash             |-- flash-stick@2
 usb_emul      4  [   ]   usb_sandbox_keyb              `-- keyb@3

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-09-23 12:31:25 -06:00
Venkatesh Yadav Abbarapu
1290262292 cmd: sf: Fix the flash_is_unlocked api size parameter
When flash erase is called with size parameter, code is checking
if sectors are locked or not. But for checking, the whole device
length minus offset is used instead of actual size which should
be erased. That's why when only some sectors are locked it is
not possible to erase unlocked sectors.

The length is calculated as "length = max_chipsize - offset",
flash_is_unlocked() api is getting updated with length which is
incorrect. Fix this flash_is_unlocked() api by passing the size
parameter.

ZynqMP> sf erase 0 100000
len=0x8000000 which is flash size
size=0x100000

We need to update the size in the flash_is_unlocked() api and not
the length.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230920025450.6281-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-09-21 13:20:12 +02:00
Venkatesh Yadav Abbarapu
16794d3008 cmd: thordown: Add proper dependency for CMD_THOR_DOWNLOAD
When CONFIG_CMD_USB and CONFIG_USB are disabled some compilation errors are seen as below.

cmd/thordown.o: in function `usb_gadget_initialize':
include/linux/usb/gadget.h:981: undefined reference to `board_usb_init'
cmd/thordown.o: in function `do_thor_down':
cmd/thordown.c:68: undefined reference to `g_dnl_unregister'
cmd/thordown.o: in function `usb_gadget_release':
include/linux/usb/gadget.h:986: undefined reference to `board_usb_cleanup'
cmd/thordown.o: in function `do_thor_down':
cmd/thordown.c:41: undefined reference to `g_dnl_register'
cmd/thordown.c:48: undefined reference to `thor_init'
cmd/thordown.c:56: undefined reference to `thor_handle'
gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld.bfd: line 4:  8485
Segmentation fault      (core dumped) $CC --sysroot=$LIBC
--no-warn-rwx-segment "$@"
Makefile:1779: recipe for target 'u-boot' failed
make: *** [u-boot] Error 139
make: *** Deleting file 'u-boot'

Add dependency of USB_GADGET_DOWNLOAD for CONFIG_CMD_THOR_DOWNLOAD to fix the errors.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Link: https://lore.kernel.org/r/20230904031528.11817-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-09-21 13:20:11 +02:00
Marek Vasut
5b8c9d1b58 thordown: Use plain udevice for UDC controller interaction
Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-09-15 23:38:02 +02:00
Marek Vasut
6b84acc978 sdp: Use plain udevice for UDC controller interaction
Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
2023-09-15 23:38:02 +02:00
Marek Vasut
f032260c7c cmd: ums: Use plain udevice for UDC controller interaction
Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on khadas vim3
Signed-off-by: Marek Vasut <marex@denx.de>
2023-09-15 23:38:02 +02:00
Marek Vasut
76dd459487 cmd: thordown: Reorder variable declaration
Move the variable declaration around to improve code readability.
No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-09-15 23:38:02 +02:00
Marek Vasut
37fb7cb7f8 cmd: sdp: Reorder variable declaration
Move the variable declaration around to improve code readability.
No functional change.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
2023-09-15 23:38:02 +02:00
Marek Vasut
0669a929b8 cmd: rockusb: Use plain udevice for UDC controller interaction
Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-09-15 23:38:01 +02:00
Marek Vasut
bac356c308 cmd: fastboot: Use plain udevice for UDC controller interaction
Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on khadas vim3
Signed-off-by: Marek Vasut <marex@denx.de>
2023-09-15 23:38:01 +02:00
Marek Vasut
0d67e25bd2 cmd: pxe: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Marek Vasut
d1e5797988 cmd: onenand: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Marek Vasut
a28cc807fa cmd: nvedit: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Marek Vasut
05f84bd2ac cmd: i2c: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Marek Vasut
8658370a92 cmd: date: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Marek Vasut
4fa6511e8c blkcache: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Marek Vasut
446d664303 boot: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Heinrich Schuchardt
f5e4b056c4 cmd: gpt: fix gpt read
To partition a block device the partition type GUIDs are needed but
'gpt read' does not provide these. Add the missing parts.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-09-11 16:34:19 -04:00
Heinrich Schuchardt
69f4d37302 cmd: gpt: fix calc_parts_list_len()
* Avoid incrementing by moving comma into strlen("uuid_disk=,") and
  considering NUL byte.
* Appending a UUID only adds UUID_STR_LEN bytes.
  Don't count the terminating NUL.
* The length of the hexadecimal representation of lba_int is
  2 * sizeof(lba_int).
* We don't use a 'MiB' postfix but a '0x' prefix.
* The uuid field is only needed if configured.

Fixes: 2fcaa413b3 ("gpt: harden set_gpt_info() against non NULL-terminated strings")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-09-11 16:31:25 -04:00
Heinrich Schuchardt
396f315520 cmd: gpt: use UUID accessor more consistently
disk_partition_uuid() and disk_partition_set_uuid() were introduced to let
us avoid the usage of #ifdef when dealing with the field uuid of
struct disk_partition.

In allocate_disk_part() commit c5f1d005f5 ("part: Add accessors for
struct disk_partition uuid") missed to use the setter.

print_gpt_info() and create_gpt_partitions_list() are further functions
where we should use the getter.

Fixes: c5f1d005f5 ("part: Add accessors for struct disk_partition uuid")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-09-11 16:29:43 -04:00
Joshua Watt
7cc1d87d7e cmd: gpt: Add command to swap partition order
Adds a command called "gpt transpose" which will swap the order two
partition table entries in the GPT partition table (but leaves them
pointing to the same locations on disk).

This can be useful for swapping bootloaders in systems that use an A/B
partitioning scheme where the bootrom is hard coded to look for the
bootloader in a specific index in the GPT partition table.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-09-11 16:27:49 -04:00
Joshua Watt
648140f77a cmd: gpt: Preserve bootable flag
Sets the bootable flag when constructing the partition string from the
current partition configuration. This ensures that when the partitions
are written back (for example, when renaming a partition), the flag is
preserved.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-09-11 16:27:49 -04:00
Joshua Watt
368beaf7bb cmd: gpt: Preserve type GUID if enabled
If CONFIG_PARTITION_TYPE_GUID is enabled, the type GUID will be
preserved when writing out the partition string. It was already
respected when writing out partitions; this ensures that if you capture
the current partition layout and write it back (such as when renaming),
the type GUIDs are preserved.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-09-11 16:27:49 -04:00
Joshua Watt
a1e793add5 cmd: gpt: Add command to set bootable flags
Adds a command that can be used to modify the GPT partition table to
indicate which partitions should have the bootable flag set

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-09-11 16:24:46 -04:00
Joshua Watt
b1433affd9 cmd: gpt: Add gpt_partition_bootable variable
Adds an additional variable called gpt_partition_bootable that indicates
if the given partition is bootable or not.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-09-11 16:24:46 -04:00
Ilias Apalodimas
edce82c822 tpm: Fix autostart for TPM1.2 devices
On commit e663b2ff4ba2("tpm: Add 'tpm autostart' shell command") an
autostart function was added for both TPM1.2 and 2.0 devices.  Instead
of correctly wiring the autostart command for TPM1.2 devices that patch
mistakenly added it on 'tpm init'

Fixes: commit e663b2ff4ba2("tpm: Add 'tpm autostart' shell command")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-09-09 06:12:47 +02:00
Tom Rini
ddec4cae62 Prepare v2023.10-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmT17FsACgkQFHw5/5Y0
 tywn0gwAlRs5NZ4ierzvDiLQEvYgV6E+lLccwyf8mMfJVHicrrW/ckxqJGS2mrLz
 IoA0pO1oF/HFfR/0pgx9Pb2kuIK1tkCeVNYW6t9EDbEJzrbfdvykBcSB4wgKYpgB
 ZgCga0jsPNM951Y3a3TElNEet4pVTZrDLu0E2UR6zNzr5hpKnfoQTZRfBI1MyCq4
 w4/Eo2wAnnaV1lcobg9LzM6uyDnETxWyTI7DIJYSqkEgT0WcF6zrdW55MaXtrPo5
 RZ4q5MTJQwqnTV5awsmgEt8PSC+XQcPHMPrVCwoOZAdru+5zO3AWpbqq1q6K+y9U
 FEsaJ6HGn5BdITgmIK/lb8oTekfOkDPFF3WuFp5bZ6L0A63ANu/MMWHELyyt5+0z
 TlnU94PVxiLnPMzZtfBPWRQ3jIU5qltJaoW0pKwsoa7P8iUd1WZgYyN+G9WPgwFr
 XUemGRNkgnWfRoxcKGbaYDSB0Llp6m/zqPlGfhlt0ZKXc6igLu3/egRh7/8zLR0i
 y9uBKG45
 =s9vZ
 -----END PGP SIGNATURE-----

Merge tag 'v2023.10-rc4' into next

Prepare v2023.10-rc4
2023-09-04 10:51:58 -04:00
Joshua Watt
1fa11cdcfe cmd: gpt: Remove confusing help text
This help text appears to be a fragment of the text shown when
CONFIG_CMD_GPT_RENAME is enabled, but is confusing so remove it.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-09-02 09:43:49 +02:00
Łukasz Stelmach
36b900e8bd setexpr: Silence some diagnostic messages
Neither successful match nor lack thereof should be considered an
extraordinary situation. Thus, neither require printing a message.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-30 17:56:21 -04:00
Heinrich Schuchardt
eeef584015 cmd: let gpt_partition_entry be hexadecimal
In commands like 'ls mmc 0:f' the partition number is hexadecimal.

In command 'gpt setenv' variable gpt_partition_entry needs to be set
to a hexadecimal value to allow its use as a parameter in a
subsequent command.

Fixes: 57f8cf1b9aea ("cmd: fix gpt enumerate")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-27 08:21:08 +02:00
Heinrich Schuchardt
41cd23b7be cmd: fix gpt enumerate
Do not assume that partitions are numbered continuously starting at 1.

Only a single partition table type can exist on a block device. If we found
a GPT partition table, we must not re-enumerate with the MBR partition
driver which would find the protective partition.

Fixes: 12fc1f3bb2 ("cmd: gpt: add eMMC and GPT support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-27 08:21:07 +02:00
Heinrich Schuchardt
018346770b cmd: fix gpt setenv
Do not assume that partitions are continuously numbered starting at 1.

Having a partition table with a single partition 63 is valid.

Fixes: 12fc1f3bb2 ("cmd: gpt: add eMMC and GPT support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-27 08:21:07 +02:00
Simon Glass
c3867e2e98 bootflow: Show an empty filename when there is none
At present 'bootflow list' shows <NULL> for the filename when it is not
present. Show an empty string instead, since that is more user-friendly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
c5f1d005f5 part: Add accessors for struct disk_partition uuid
This field is only present when a CONFIG is set. To avoid annoying #ifdefs
in the source code, add accessors. Update all code to use it.

Note that the accessor is optional. It can be omitted if it is known that
the option is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
cfc402db39 expo: cedit: Support reading settings from CMOS RAM
Add a command to read edit settings from CMOS RAM, using the cedit
definition to indicate which registers and bits are used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
eb6c71b562 expo: cedit: Support writing settings to CMOS RAM
Add a command to write cedit settings to CMOS RAM so that it can be
preserved across a reboot. This uses a simple bit-encoding, where each
field has a 'bit position' and a 'bit length' in the schema.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
bcf2b7202e expo: cedit: Support reading settings from environment vars
Add a command to read cedit settings from environment variables so that
they can be restored as part of the environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
fc9c0e0771 expo: cedit: Support writing settings to environment vars
Add a command to write cedit settings to environment variables so that
they can be stored with 'saveenv'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
472317cb12 expo: cedit: Support reading settings from a file
Add a command to read cedit settings from a devicetree file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
2dee81fe5f expo: cedit: Support writing settings to a file
Support writing settings from an expo into a file in FDT format. It
consists of a single node with a two properties for each sceneitem,
one with tag ID chosen by the user and another for its text value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
2045ca5c1f expo: Move cedit theme under bootstd
This is related to standard boot, so put it under the same node. This may
simplify schema upstreaming later.

Mention themes in the documentation while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
040b04685e expo: Split out cedit into its own header
Before adding more functions to this interface, create a new header for
the configuration editor.

Fix up the expo header guard while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Heinrich Schuchardt
175e4b01be cmd: setexpr: fix printf_str()
If vsnprintf() returns a negative number, (i >= remaining) will
possibly be true:

'i' is of type signed int and 'remaining' is of the unsigned type size_t.
The C language will convert i to an unsigned type before the comparison.

This can result in the wrong error type being indicated.

Checking for negative i should be done first.

Fixes: f4f8d8bb1a ("cmd: setexpr: add format string handling")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-23 08:02:59 +02:00
Tom Rini
7e6e40c572 Prepare v2023.10-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmTjxwsACgkQFHw5/5Y0
 tyz4TAwAtVgllQGPVNIVDaEBdG93htm1DoZPc4EMZ4L5rf0nT0yJPeOhRCGygYY+
 zYL1ueleBZtpJhYOuHGetSns0B/M5Wx7gu1eGHNGrMNHH7zCV5Ynjjee2IaqKgbU
 tdSSc8XQpJ3PJY6rhJ6qZ7pO/EcUlQEdqplEUGFmA4JObx43j1+bmqyGTJA57vEw
 rrr+tyUVlr+Wv4lqlX/YJWzAB6IoSMUStv34M2lmiZvZoTYHezvIqBK33GrQ4Cwl
 hQ8nP7ymBXdA5GoMFBpfaBCA7aX3esx4yYN3JIRNRjNmnITJHYs0G8oIh8R5iNnJ
 psroU7GRPu3MmXfOnHlRfA/v0mo8xQGc2RQHyZUGXuApTI8+SFK/4WJPBny/IYse
 ggcVCHoI57dx1+j4+JHYhh61bMR1JUwARs4/UU4dKT3MRZM8Gb99OvbXO3+switZ
 R0YHSnDP///MTC7/MzbOPWzsJiTn9gkZd8nFVTXoncrVI8F3OtCc89G4HBruBSj7
 ptfylxqH
 =VlzD
 -----END PGP SIGNATURE-----

Merge tag 'v2023.10-rc3' into next

Prepare v2023.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-21 17:32:17 -04:00