Commit graph

81593 commits

Author SHA1 Message Date
Pali Rohár
05159cc6b6 Nokia RX-51: Fix documentation how to enable UBI support
Disable UBI fastmap support which is not supported by original Maemo 5
kernel and explicitly set UBI BEB limit to 10%, which is the value used by
original Maemo 5 kernel. U-Boot default value is 20%.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-15 16:11:27 -04:00
Pali Rohár
7506965885 Nokia RX-51: Call bootm in test script only when image is valid
When reading of image fails then do not call bootm. This prevents false
positive test result in case something bootable is present in memory.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-15 16:11:25 -04:00
Pali Rohár
fd986d6021 Nokia RX-51: Change UBIFS volume size to 1870 LEBs in test script
Original Nokia UBIFS system image has 1870 LEBs, so set UBIFS volume size
in test script to the same value. Number of 1870 LEBs corresponds to 230MiB
(LEB size * num of LEBs = 126KiB * 1870 = 230MiB).

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-15 16:11:06 -04:00
Pali Rohár
e1da01d7b1 Nokia RX-51: Set default SYS_LOAD_ADDR to 0x80008000
At address 0x80000100 are stored initial atags passed to U-Boot by NOLO.
So do not overwrite them when using $loadaddr variable which value is set
from CONFIG_SYS_LOAD_ADDR option.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-15 16:11:02 -04:00
Pali Rohár
5c9bf1d655 Nokia RX-51: Do not clear unknown memory in lowlevel_init.S
If kernel image in uImage or zImage format is not detected by
lowlevel_init.S code then do not clear memory location where image was
expected. If image is not detected then this memory region is unknown.
So do not unconditionally clear it.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-15 16:11:01 -04:00
Pali Rohár
0b6924cc0f Nokia RX-51: Remove label copy_kernel_start from lowlevel_init.S
Label copy_kernel_start is now unused. Remove it.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-15 16:10:59 -04:00
Jayesh Choudhary
29e1044741 configs: Add configs for j721s2 High Security EVM
Add j721s2 High Security EVM defconfig.

These configs are same as for the non-secure part, except for:
        CONFIG_TI_SECURE_DEVICE option set to 'y'
        CONFIG_FIT_IMAGE_POST_PROCESS option set to 'y'
        CONFIG_SPL_FIT_IMAGE_POST_PROCESS option set to 'y'
        CONFIG_BOOTCOMMAND uses FIT images for booting

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
2022-09-15 16:07:45 -04:00
Andrew Davis
360c7f46f3 configs: Add configs for J7200 High Security EVM
Add J7200 High Security EVM defconfig.

These defconfigs are the same as for the non-secure part, except for:
    CONFIG_TI_SECURE_DEVICE option set to 'y'
    CONFIG_BOOTCOMMAND uses FIT images for booting

Signed-off-by: Andrew Davis <afd@ti.com>
[j-choudhary@ti.com: add few configs from GP variant which were missing]
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
2022-09-15 16:07:26 -04:00
Bernhard Messerklinger
c79c0b4692 brppt1: Update environment to support new boot concept
* Drop legacy /boot/PPTImage.md5 check
* Update device tree naming
* Update t30args#0 root cmd line property to support latest kernel
  versions (root=/dev/mmcblk0p2 for linux < 4 and
  root=/dev/mmcblk1p2 for linux >= 4)
* Add custom bootloader version string
* Destroy invalid dtb at ${dtbaddr} and configuration script at
  ${cfgaddr} to ensure proper boot in warm restart case.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2022-09-15 14:22:08 -04:00
Bernhard Messerklinger
0daeadbbd2 include: configs: brppt1: Fix commit 0ea4fc4dcf
Commit 0ea4fc4dcf ("board/BuR: invalidate ${dtbaddr} before cfgscr")
destroys the boot targets b_t30lgcy#0 and b_t30lgcy#1. The reason behind
this is, that b_t30lgcy#0 and b_t30lgcy#1 both load the for booting
needed device trees from mmc and the cfgscr script patches those. Because
of this, cfgscr is not allowed to destroy the previously loaded device
tree otherwise cfgscr will fail.
This patch moves the device trees invalidation on warm restart to the
PREBOOT cmd to fix that issue.

Fixes: 0ea4fc4dcf ("board/BuR: invalidate ${dtbaddr} before cfgscr")
Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2022-09-15 14:22:08 -04:00
Bernhard Messerklinger
febd82c45e brppt1: Cleanup device tree
* Remove unnecessary device tree nodes which are not needed in
  U-Boot directly.
* Move all U-Boot specific device tree properties to u-boot dtsi.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2022-09-15 14:22:08 -04:00
Bernhard Messerklinger
b0a18f1f9f brppt1: Fix SPL boot stage
Commit 6337d53fdf ("arm: dts: sync am33xx with Linux 5.9-rc7") syncs
the am335x device tree with the latest linux kernel am335x device tree.
That causes problems with device tree in SPL stage.
To fix the issues CONFIG_SPL_OF_TRANSLATE must be set to handle the
synced bus addresses correctly.
A custom U-Boot device tree is also needed since the SPL build removes
bus properties from bus nodes which are not explicitly marked with the
u-boot,dm-spl or u-boot,dm-pre-reloc flag. Therefore all parent buses of
the in the SPL needed devices must be marked with u-boot,dm-pre-reloc.
Also since there is no driver for "ti,sysc" compatible property in SPL
the buses marked with this compatible string must also be marked with
compatible = "simple-bus" to make the underlying devices visible in
SPL. Otherwise the matching device drivers aren't found and the uclass
drivers are dropped.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2022-09-15 14:22:08 -04:00
Bernhard Messerklinger
6dfc1f4c51 brppt1: Remove unused board variants
The SPI and NAND board variants never went into production.
Drop those board variants.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2022-09-15 14:22:08 -04:00
Tom Rini
d9e85eeeba Merge branch '2022-09-15-general-improvements' into next
- Add uncompressed kernel image support to falcon mode, TEE
  improvements, make xyz-modem timeout configurable, gpio updates and
  other assorted improvements.
2022-09-15 09:59:47 -04:00
Heinrich Schuchardt
0cd933bb4b lib: rsa: fix padding_pss_verify
Check the that the hash length is shorter than the message length. This
avoids:

    ./tools/../lib/rsa/rsa-verify.c:275:11: warning:
    ‘*db’ may be used uninitialized [-Wmaybe-uninitialized]
      275 |         db[0] &= 0xff >> leftmost_bits;

Fixes: 061daa0b61 ("rsa: add support of padding pss")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-15 09:57:11 -04:00
Sean Anderson
069f0d7506 cli: Reduce size of readline buffers in SPL
Normally, readline is not used int SPL. However, it may be useful to
enable the Freescale DDR interactive mode in SPL, while U-Boot is still
executing from SRAM. The default settings for readline result in a large
buffer being allocated. Reduce the size of the maximum input line, and
the number of lines of scrollback when building for SPL.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-15 09:55:30 -04:00
Patrice Chotard
f6f681642f gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function
This allows to test if a pin's label if displayed using gpio_get_status()
when this pin is configured in alternate function.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-15 09:55:30 -04:00
Patrice Chotard
2c38f7c318 pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name
Populate uc_priv->name[] with pinmux node's name in order to indicate
the pinmuxing's name in case GPIO is configured in alternate.

For example, for STM32 SoC's based platform, "gpio status" command
output :

  before
    Bank GPIOZ:
      GPIOZ0: unused : 0 [ ]
      GPIOZ1: unused : 0 [ ]
      GPIOZ2: unused : 0 [ ]
      GPIOZ3: unused : 0 [ ]
      GPIOZ4: func
      GPIOZ5: func
      GPIOZ6: unused : 0 [ ]
      GPIOZ7: unused : 0 [ ]
      GPIOZ8: unknown
      GPIOZ9: unknown
      GPIOZ10: unknown
      GPIOZ11: unknown
      GPIOZ12: unknown
      GPIOZ13: unknown
      GPIOZ14: unknown
      GPIOZ15: unknown

  After
    Bank GPIOZ:
      GPIOZ0: unused : 0 [ ]
      GPIOZ1: unused : 0 [ ]
      GPIOZ2: unused : 0 [ ]
      GPIOZ3: unused : 0 [ ]
      GPIOZ4: func i2c4-0
      GPIOZ5: func i2c4-0
      GPIOZ6: unused : 0 [ ]
      GPIOZ7: unused : 0 [ ]
      GPIOZ8: unknown
      GPIOZ9: unknown
      GPIOZ10: unknown
      GPIOZ11: unknown
      GPIOZ12: unknown
      GPIOZ13: unknown
      GPIOZ14: unknown
      GPIOZ15: unknown

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-15 09:55:30 -04:00
Patrice Chotard
a32920897a gpio: Fix pin's status display for pin with GPIOF_UNUSED function
Even pin with GPIOF_UNUSED function can have a label.
The criteria to add or not a space character is linked to label not to
the used/unused status.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-15 09:55:30 -04:00
Patrice Chotard
d7124f0ba4 gpio: Allow to print pin's label even for pin with GPIOF_FUNC function
Currently, if pin's function is GPIOF_FUNC, only "func" if displayed
without any other information. It would be interesting, if information is
available, to indicate which pinmuxing's name is used.

For example, for STM32 SoC's based platform, "gpio status" command
output :

   before
    Bank GPIOZ:
      GPIOZ0: unused : 0 [ ]
      GPIOZ1: unused : 0 [ ]
      GPIOZ2: unused : 0 [ ]
      GPIOZ3: unused : 0 [ ]
      GPIOZ4: func
      GPIOZ5: func
      GPIOZ6: unused : 0 [ ]
      GPIOZ7: unused : 0 [ ]
      GPIOZ8: unknown
      GPIOZ9: unknown
      GPIOZ10: unknown
      GPIOZ11: unknown
      GPIOZ12: unknown
      GPIOZ13: unknown
      GPIOZ14: unknown
      GPIOZ15: unknown

   After
    Bank GPIOZ:
      GPIOZ0: unused : 0 [ ]
      GPIOZ1: unused : 0 [ ]
      GPIOZ2: unused : 0 [ ]
      GPIOZ3: unused : 0 [ ]
      GPIOZ4: func i2c4-0
      GPIOZ5: func i2c4-0
      GPIOZ6: unused : 0 [ ]
      GPIOZ7: unused : 0 [ ]
      GPIOZ8: unknown
      GPIOZ9: unknown
      GPIOZ10: unknown
      GPIOZ11: unknown
      GPIOZ12: unknown
      GPIOZ13: unknown
      GPIOZ14: unknown
      GPIOZ15: unknown

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-15 09:55:30 -04:00
Xiang W
04dd7c8e56 virtio: pci: fix bug of virtio_pci_map_capability
The bar of the structure virtio_pci_cap is the index, and each base
address occupies 4 bytes, so it needs to be multiplied by 4.

This patch fixes a bug reported by Felix Yan
https://lists.denx.de/pipermail/u-boot/2022-August/492779.html

Signed-off-by: Xiang W <wxjstz@126.com>
Tested-by: Felix Yan <felixonmars@archlinux.org>
2022-09-15 09:55:30 -04:00
Alexander Sowarka
4ca8d95ce1 nvme: Fix multipage prp-list
The nvme driver falsely assumed that the last entry on a page
of the prp-list always points to the next page of the prp-list.
This potentially can lead to the illegal creation of pages on
the prp-list with only a single entry. This change now ensures
that splitting the prp-list into multiple pages, behaves now as
required by the NVME-Spec.

Related to this, also the size of the memory allocation is adjusted
accordingly.

Signed-off-by: Alexander Sowarka <alexander.sowarka@aerq.com>
2022-09-15 09:55:30 -04:00
Pali Rohár
9895bda2ed doc: cmd: loady: Document new configuration
Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-15 09:55:30 -04:00
Pali Rohár
1b3e68203c xyz-modem: Allow to configure initial timeout for loadx and loady
Now when loadx and loady commands could be aborted / cancelled by CTRL+C,
allow to configure timeout for initial x/y-modem packet via env variable
$loadxy_timeout and by default use value from new compile-time config
option CONFIG_CMD_LOADXY_TIMEOUT. Value is in seconds and zero value means
infinite timeout. Default value is 90s which is the value used before this
change for loadx command.

Other load commands loadb and loads already waits infinitely. Same behavior
for loadx and loady commands can be achieved by setting $loadxy_timeout or
CONFIG_CMD_LOADXY_TIMEOUT to 0.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-15 09:55:30 -04:00
Sean Anderson
56ce22c0cd post: memory: Fix format strings
This fixes numerous cases of format strings not matching their
arguments. Also keep the format strings on one line for easier grepping.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-15 09:55:30 -04:00
Etienne Carriere
57fb86a97d drivers: rng: optee_rng: register to CONFIG_OPTEE_SERVICE_DISCOVERY
Changes optee_rng driver to register itself has a OP-TEE service so
that a device is bound for the driver when OP-TEE enumerates the
PTA RNG service.

Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-14 15:23:03 -04:00
Etienne Carriere
94ccfb78a4 drivers: tee: optee: discover OP-TEE services
This change defines resources for OP-TEE service drivers to register
themselves for being bound to when OP-TEE firmware reports the related
service is supported. OP-TEE services are discovered during optee
driver probe sequence which mandates optee driver is always probe once
bound.

Discovery of optee services and binding to related U-Boot drivers is
embedded upon configuration switch CONFIG_OPTEE_SERVICE_DISCOVERY.

Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-14 15:23:03 -04:00
Etienne Carriere
fd0d7a6c88 drivers: tee: optee: remove unused probe local variable
Removes local variable child in optee_probe() that is not used.

Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2022-09-14 15:23:03 -04:00
Stefan Herbrechtsmeier
77253c50ab spl: fit: Allocate buffers aligned to cache line size
Allocate memory for buffers at a cache-line boundary to avoid
misaligned buffer address for subsequent reads. This avoids an
additional sector-based memory copy in the fat file system driver:

FAT: Misaligned buffer address (...)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2022-09-14 15:23:03 -04:00
Stefan Herbrechtsmeier
c0facda197 misc: usb251xb: Support 8/16 bit device tree values
The device tree binding [1] specify the vendor-id, product-id, device-id
and language-id as 16 bit values and the linux driver reads the boost-up
value as 8 bit value.

[1] https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/usb251xb.txt

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2022-09-14 15:23:03 -04:00
Stefan Herbrechtsmeier
b471bdc47b dm: core: Add functions to read 8/16-bit integers
Add functions to read 8/16-bit integers like the existing functions for
32/64-bit to simplify read of 8/16-bit integers from device tree
properties.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-14 15:23:03 -04:00
Nathan Barrett-Morrison
7a0d88076b Add in the ability to load and boot an uncompressed kernel image during the Falcon Mode boot sequence.
This is required for architectures which do not support compressed kernel images (i.e. ARM64).  This is only used while not booting via FIT image.

Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2022-09-14 15:23:03 -04:00
Tom Rini
1520af3f84 Pull request for efi next
UEFI:
 
 Implement a command eficonfig to maintain Load Options and boot order via
 menus.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmMh/kQACgkQxIHbvCwF
 GsSYVhAAlhyCiAQudBJtrOyAA0HDPMio/Fx9F3YV1Laay//6+xHhEh5H94fMr7jP
 BHOrpE+IDKQTiQ8X3FpJpm3FzgQBzu0s4gQ+8fCKwkXCkaPTtWhs3s5SdHN0TWmv
 qGlNbuPdoU+4i7PeBWw87EvOCzh4+snn+l3t+npMxUlZJInGy+6xj0irnSEXTvXV
 lpDRw2UDq3/smAS8tAcR+zriTH5o1Lx+0qPIO9Hw8BSDHOcvZD+S9d6cd6j+M+Wz
 rWk1Bshol6anIZWS5Gnx14ddKF8SQcSiPsDXg2Uj2DvFg7lWepKxAbDJD5CVF9R9
 aEu6THCurc+769A/IHAS9M0EDNnWoUGFSxe0JuEHdYVuGj30RRfzSaciKkNxsxUZ
 UGvDnQ+zdRoj6bTVi4Zf8SeZUTm/04lWMoIF05uhZFDiwxidbMowoNsk9FeKria/
 4vXybfj/IhRwbiAhOUqyDjGuoLj8iVeOAyzin4FnDvBwdshIkSsB+4y1sX1aQv02
 HQbP6WXkiYoYNkw5i9E9ZChioxkzMrn2za3GxWhkTBMJArDw6xSuHMdQsgwWWoqU
 fCKjwe+D96lHq5cKt3DmGTvGxQtx9ckSJGK5r+US5y1udzotjOKc1jqMkMvS3Jyg
 ureTj0wvLYSx+/UirVAZ4IDviDMBVEar79VS2xi+SYBMLeQPy3I=
 =P89S
 -----END PGP SIGNATURE-----

Merge tag 'efi-next-2022-09-14' of https://source.denx.de/u-boot/custodians/u-boot-efi into next

Pull request for efi next

UEFI:

Implement a command eficonfig to maintain Load Options and boot order via
menus.
2022-09-14 12:31:44 -04:00
Tom Rini
6541726ee9 Merge branch '2022-09-14-refactor-ramdisk-code-again' into next
To quote the author:
The previous attempt at this[1] broke a board and was reverted in [2].
This series adopts a slightly different approach, splitting the changes
into many commits.

[1] f33a2c1bd0 ("image: Remove #ifdefs from select_ramdisk()")
[2] 621158d106 ("Revert "image: Remove #ifdefs from select_ramdisk()"")
2022-09-14 11:50:21 -04:00
Simon Glass
9c2e9128f3 image: Drop some other #ifdefs in image-board.c
Remove all but a few that are difficult, relying on legacy CONFIG options
or optional global_data fields.

Drop the duplicate function name in the comment for boot_get_cmdline().

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-14 09:03:07 -04:00
Simon Glass
20f5d83fb1 image: Correct indentation in select_ramdisk()
Finish off the refactoring by correcting the indent levels. Note that this
does not include any functional changes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-14 09:03:07 -04:00
Simon Glass
ca78883fdc image: Drop remaining FIT #ifdef
Drop the last one of these, by using a done_select variable to control
whether to fall back to using 'select' as a hex value.

Note that the indentation is not adjusted, to make this easier to review.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-14 09:03:07 -04:00
Simon Glass
1a68c039c5 image: Drop another #ifdef for FIT
Drop the prenultimate one of these from select_ramdisk().

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-14 09:03:06 -04:00
Simon Glass
f7659f69f7 image: Drop one #ifdef for FIT
Drop the #ifdef from near the end of select_ramdisk(). Move some variables
to the top of the function to make this work.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-14 09:03:06 -04:00
Simon Glass
0f81af4897 image: Drop #ifdefs for LEGACY_IMAGE_FORMAT
Use if() instead of the #ifdef in select_ramdisk().

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-14 09:03:06 -04:00
Simon Glass
4f2d94129d image: Track when ramdisk processing is completed
The current switch default is tricky since it relies on #ifdefs to work.
Use a bool instead.

Also fix the comment on @select, since it has a dual purpose.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-14 09:03:06 -04:00
Simon Glass
1ce8e10f3b image: Fix up ANDROID_BOOT_IMAGE ramdisk code
Convert this to an if(), fix the cast from an address to a pointer and
make sure that any error is returned correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-14 09:03:06 -04:00
Tom Rini
a822b9234b Merge branch '2022-09-13-add-support-for-cyclic-function-execution' into next
To quote the author:
This patchset adds the basic infrastructure to periodically execute
code, e.g. all 100ms. Examples for such functions might be LED blinking
etc. The functions that are hooked into this cyclic list should be
small timewise as otherwise the execution of the other code that relies
on a high frequent polling (e.g. UART rx char ready check) might be
delayed too much. This patch also adds the Kconfig option
CONFIG_CYCLIC_MAX_CPU_TIME_US, which configures the max allowed time
for such a cyclic function. If it's execution time exceeds this time,
this cyclic function will get removed from the cyclic list.

How is this cyclic functionality executed?
This patchset integrates the main function responsible for calling all
registered cyclic functions cyclic_run() into the common WATCHDOG_RESET
macro. This guarantees that cyclic_run() is executed very often, which
is necessary for the cyclic functions to get scheduled and executed at
their configured periods.

This cyclic infrastructure will be used by a board specific function on
the NIC23 MIPS Octeon board, which needs to check periodically, if a
PCIe FLR has occurred.

Ideas how to continue:
One idea is to rename WATCHDOG_RESET to something like SCHEDULE and
move the watchdog_reset call into this cyclic infrastructure as well.
Or to perhaps move the shell UART RX ready polling to a cyclic
function.

It's also possible to extend the "cyclic" command, to support the
creation of periodically executed shell commands (for testing etc).
2022-09-14 08:57:39 -04:00
Masahisa Kojima
da4fb707ca test: unit test for eficonfig
Provide a unit test for the eficonfig command.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-09-14 08:43:32 +02:00
Masahisa Kojima
1b2c589eb7 doc:eficonfig: add documentation for eficonfig command
Add documentation for eficonfig command.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-09-14 08:43:32 +02:00
Masahisa Kojima
f076c994bf doc:bootmenu: add description for UEFI boot support
The bootmenu enumerates the UEFI boot options
for boot device selection.
This commit adds the description how the UEFI boot work
in bootmenu. This commit also adds "Synopsis", "Description"
and "Configuration" sections to follow the U-Boot command
documentation format.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-09-14 08:43:32 +02:00
Masahisa Kojima
e5948ee301 eficonfig: add "Change Boot Order" menu entry
This commit adds the menu entry to update UEFI BootOrder variable.
User moves the entry with UP/DOWN key, changes the order
with PLUS/MINUS key, press SPACE to activate or deactivate
the entry, then finalizes the order by ENTER key.
If the entry is activated, the boot index is added into the
BootOrder variable in the order of the list.

The U-Boot menu framework is well designed for static menu,
this commit implements the own menu display and key handling
for dynamically change the order of menu entry.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-09-14 08:43:32 +02:00
Masahisa Kojima
b5135a1e5b eficonfig: scan media device in eficonfig startup
In eficonfig startup, scan media devices and update
the UEFI boot option.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-09-14 08:43:32 +02:00
Masahisa Kojima
c416f1c0bc bootmenu: add removable media entries
UEFI specification requires booting from removal media using
a architecture-specific default image name such as BOOTAA64.EFI.
This commit adds the removable media entries into bootmenu,
so that user can select the removable media and boot with
default image.

The bootmenu automatically enumerates the possible bootable
media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL,
add it as new UEFI boot option(BOOT####) and update BootOrder
variable. This automatically generated UEFI boot option
has the dedicated guid in the optional_data to distinguish it from
the UEFI boot option user adds manually. This optional_data is
removed when the efi bootmgr loads the selected UEFI boot option.

This commit also provides the BOOT#### variable maintenance feature.
Depending on the system hardware setup, some devices
may not exist at a later system boot, so bootmenu checks the
available device in each bootmenu invocation and automatically
removes the BOOT#### variable corrensponding to the non-existent
media device.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-09-14 08:43:32 +02:00
Masahisa Kojima
bb8498aad6 eficonfig: add "Delete Boot Option" menu entry
This commit adds the menu entry to delete the UEFI boot option.
User moves the entry with UP/DOWN key, changes, then presses
ENTER key to delete the selected boot option.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-09-14 08:43:32 +02:00