Simon Glass [Sun, 16 Jul 2023 03:38:46 +0000 (21:38 -0600)]
bdinfo: Show the RAM top and approximate stack pointer
These are useful pieces of information when debugging. The RAM top shows
where U-Boot started allocating memory from, before it relocated. The
stack pointer can be checked to ensure it is in the correct region.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Nikhil M Jain <n-jain1@ti.com>
Simon Glass [Sun, 16 Jul 2023 03:38:45 +0000 (21:38 -0600)]
acpi: Add a comment to set the acpi tables
Sometimes a previous bootloader has written ACPI tables. It is useful to
be able to find and list these. Add an 'acpi set' command to set the
address for these tables.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Sun, 16 Jul 2023 03:38:44 +0000 (21:38 -0600)]
x86: Show an error when a BIOS exception occurs
Rather than silently hanging, show an error first. This can happen when
there is something wrong with the video BIOS.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Sun, 16 Jul 2023 03:38:43 +0000 (21:38 -0600)]
x86: Correct get_sp() implementation for 64-bit
Use an assembler implementation as is done for i386, so that the results
are equivalent for i386 and x86_64.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Sun, 16 Jul 2023 03:38:42 +0000 (21:38 -0600)]
x86: Show the CPU physical address size with bdinfo
This is useful information so show it with the bdinfo command.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Sun, 16 Jul 2023 03:38:41 +0000 (21:38 -0600)]
x86: Add a comment for board_init_f_r_trampoline()
Add a comment for this function in the header.
Change the function (and the one after) to use __noreturn to keep
checkpatch happy.
Add docs to board_init_f_r() while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Sun, 16 Jul 2023 03:38:40 +0000 (21:38 -0600)]
x86: Tidy up EFI code in interrupt_init()
The ll_boot_init() check handles the EFI case so we don't need the rest
of the code. Drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Sun, 16 Jul 2023 03:38:39 +0000 (21:38 -0600)]
bios_emulator: Drop VIDEO_IO_OFFSET
This is always zero in the source tree, so drop it.
While we are here, add a comment to _X86EMU_env since the symbol is
actually defined twice, which can cause confusion when building.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Sun, 16 Jul 2023 03:38:38 +0000 (21:38 -0600)]
bios_emulator: Add Kconfig and adjust Makefile for SPL
The Kconfig for this is currently inside a particular board. Move it into
the correct place and allow use in SPL, so that video can be used there
if needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Sun, 16 Jul 2023 03:38:37 +0000 (21:38 -0600)]
x86: mtrr: Add documentation
Add documention for the x86 'mtrr' command.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Simon Glass [Sun, 16 Jul 2023 03:38:36 +0000 (21:38 -0600)]
x86: Allow listing MTRRs in SPL
Move MTRR-listing code into a common file so it can be used from SPL.
Update the 'mtrr' command to call it.
Use this in SPL just before adjusting the MTRRs, so we can see the state
set up by the board. Only show it when debug is enabled.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:47 +0000 (09:04 -0600)]
x86: coral: Adjust various config options
Add ms so it is easier to search for tables in memory.
Expand the command-line and print buffers so that we can deal with the
very long ChromeOS command lines. (typically 700 characters).
Enable BOOTSTD_FULL to get the full set of standard-boot options.
Replace the existing manual script with 'bootflow scan', since it can
find and boot the OS.
Finally, expand the malloc() space so we can read large kernels into a
bootflow.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:46 +0000 (09:04 -0600)]
x86: coreboot: Adjust various config options
Drop IDE and add NVME since this is more common now.
Add ms so it is easier to search for tables in memory.
Expand the command-line and print buffers so that we can deal with the
very long ChromeOS command lines. (typically 700 characters).
Enable BOOTSTD_FULL to get the full set up standard-boot options.
Finally, expand the malloc() space so we can read large kernels into a
bootflow.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:45 +0000 (09:04 -0600)]
bootstd: Add a simple bootmeth for ChromiumOS
It is possible to boot x86-based ChromeOS machines by parsing a table and
locating the kernel and command line. Add a bootmeth for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:44 +0000 (09:04 -0600)]
x86: zimage: Export the function to obtain the cmdline
Allow reading the command line from a zimage, so that it can be recorded
in the bootflow.
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 12 Jul 2023 15:04:43 +0000 (09:04 -0600)]
x86: Add a function to boot a zimage
Add a direct interface to booting a zimage, so that bootstd can call it
without going through the command-line interface.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:42 +0000 (09:04 -0600)]
bootstd: Support automatically setting Linux parameters
Some Linux parameters can be set automatically by U-Boot, if it knows the
device being used. For example, since U-Boot knows the serial console
being used, it can add parameters for earlycon and console.
Add support for this.
Note that this is an experimental feature and we will see how useful it
turns out to be. It is very handy for ChromeOS, since otherwise it is very
difficult to manually determine the UART address or port number,
particularly in a script.
Provide an example of how this is used with ChromeOS.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:41 +0000 (09:04 -0600)]
x86: qemu: Switch to standard boot
Drop use of the distro boot script and use standard boot instead.
Moving to a text-based environment would be desirable also, but requires
additional work.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:40 +0000 (09:04 -0600)]
x86: qemu: Create a little more room for U-Boot
We want to enable some of the more interesting bootstd features. Move SPL
up to create some room for the larger U-Boot binary. Also disable
microcode since this is not needed
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:39 +0000 (09:04 -0600)]
bootstd: Add support for updating elements of the cmdline
Add a bootflow command to update the command line more easily. This allows
changing a particular parameter rather than editing a very long strings.
It is also easier to handle with scripting.
The new 'bootflow cmdline' command allows getting and setting single
parameters.
Fix up the example output while we are here, since there are a few new
items.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:38 +0000 (09:04 -0600)]
bootstd: Add a function to update a command line
The Linux command line consists of a number of words with optional values.
At present U-Boot allows this to be changed using the bootargs environment
variable.
But this is quite painful, since the command line can be very long.
Add a function which can adjust a single field in the command line, so
that it is easier to make changes before booting.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:37 +0000 (09:04 -0600)]
bdinfo: Show information about the serial port
It is useful to see the detailed setting of the serial port, e.g. to
allow setting up earlycon or console for Linux. Add this output to the
'bdinfo' command.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: squashed in
20230716033929.253357-2-sjg@chromium.org]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:36 +0000 (09:04 -0600)]
bootstd: Allow storing x86 setup information
On x86 boards Linux uses a block of binary data to provide information
about the command line, memory map, etc. Provide a way to store this in
the bootflow so it can be passed on to the OS.
No attempt is made to generalise the code, since other archs don't need
this information. The field is present always, though, to avoid needing
accessors or #ifdefs when building code on other archs.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:35 +0000 (09:04 -0600)]
bootstd: Use the bootargs env var for changing the cmdline
The "bootargs" environment variable is used to set the command-line
arguments to pass to the OS. Use this same mechanism with bootstd as well.
When the variable is updated, it is written to the current bootflow. When
the current bootflow is updated, the environment variable is updated too.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:34 +0000 (09:04 -0600)]
bootstd: Allow storing the OS command line in the bootflow
Some operating systems have a command line which can be adjusted before
booting. Store this in the bootflow so it can be controlled within
U-Boot.
Fix up the example output while we are here, since there are a few new
items.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:33 +0000 (09:04 -0600)]
bootstd: Correct baudrate typo
This is a copy error. Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:32 +0000 (09:04 -0600)]
bootstd: Use bootdev instead of bootdevice
It seems better to call this a 'bootdev' since this is name used in the
documentation. The older 'Bootdevice' name is no-longer used and may cause
confusion with the 'bootdevice' environment variable.
Update throughout to use bootdev.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:31 +0000 (09:04 -0600)]
bootstd: Correct the name of the QEMU bootmeth
This does not relate to sandbox. Correct the name.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Wed, 12 Jul 2023 15:04:30 +0000 (09:04 -0600)]
test: Skip flat-tree tests if devicetree is not used
Many tests don't actually use the devicetree at all so there is no point
in running the tests both with livetree and flat tree. Check for this and
skip the flat tree test in that case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tom Rini [Fri, 14 Jul 2023 19:21:48 +0000 (15:21 -0400)]
Merge branch '2023-07-14-assorted-general-updates'
- A number of assorted general fixes and code updates
Christophe Leroy [Wed, 5 Jul 2023 14:51:37 +0000 (16:51 +0200)]
powerpc: Fix flush_cache() speed regression
Flushing kernel image after decompression was taking 113 milliseconds
with U-boot 2022.10. With U-boot 2023.01 and 2023.04, flushing
the same amount of memory takes approx 1.5 seconds. With
U-boot 2023.07-rc6, it takes 6.5 seconds.
powerpc flush_cache() function used to call WATCHDOG_RESET() after
flushing every cacheline. At that time WATCHDOG_RESET() was light
so the operation was almost seamless.
But commit
29caf9305b6 ("cyclic: Use schedule() instead of
WATCHDOG_RESET()") replaced WATCHDOG_RESET() by schedule() and that
started to hurt with U-boot 2022.10.
And in U-boot 2023.07-rc6 that's even worse after
commit
26e8ebcd7cb ("watchdog: mpc8xxx: Make it generic").
In the meantime commit
729c1fe656 ("powerpc: introduce
CONFIG_CACHE_FLUSH_WATCHDOG_THRESHOLD") gives us the opportinity to
only call schedule() every given chunk of data instead of every
cacheline. As explained in that commit there is no point in pinging
the watchdog after every cacheline flush, so lets define a sensible
default chunk size of 4k which matches to size of a page on most
powerpc platforms.
With that new default threshold, the culprit flushing performed after
kernel image decompression now takes 85 milliseconds on a powerpc 8xx.
Fixes:
29caf9305b6 ("cyclic: Use schedule() instead of WATCHDOG_RESET()")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Christophe Leroy [Wed, 5 Jul 2023 08:34:26 +0000 (10:34 +0200)]
lzma: Fix decompression speed regression
Uncompressing a 1.7Mbytes FIT image on U-boot 2023.04 takes
approx 7s on a powerpc 8xx.
The same on U-boot 2023.07-rc6 takes approx 28s unless watchdog
is disabled.
During that decompression, LzmaDec_DecodeReal() calls schedule
1.6 million times, that is every 4µs in average.
In the past it used to be a call to WATCHDOG_RESET() which was
just calling hw_watchdog_reset().
But the combination of commit
29caf9305b6 ("cyclic: Use schedule()
instead of WATCHDOG_RESET()") and commit
26e8ebcd7cb ("watchdog:
mpc8xxx: Make it generic") results in an heavier processing.
However, there is absolutely no point in calling schedule() that
often.
By moving and keeping only one call to schedule() in the main
loop the number of calls is reduced to 1.2 million which is still
too much. So add logic to only call schedule every 1024 times.
That leads to a call to schedule approx every 6ms which is still
far enough to entertain the watchdog which has a 1s timeout on
powerpc 8xx.
powerpc 8xx being one of the slowest targets we have today in
U-boot, and most other watchdogs having a timeout of one minutes
instead of one second like the 8xx, this fix should not have
negative impact on other targets.
Fixes:
29caf9305b6 ("cyclic: Use schedule() instead of WATCHDOG_RESET()")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
Bhupesh Sharma [Sun, 2 Jul 2023 19:09:12 +0000 (00:39 +0530)]
ufs: Use 'TASK_TAG' to construct the ucd_req_ptr->header.dword_0
Instead of using the hard-coded value of 0x1f, use 'TASK_TAG'
macro instead to construct the ucd_req_ptr->header.dword_0
This is in sync with what the Linux UFS driver does, i.e.
set the byte0 equal to TASK_TAG (see [1]).
Setting it to a fixed value of 0x1f is wrong as we define
TASK_TAG as 0 inside u-boot ufs framework. So, instead we
should use the macro value directly.
[1]. https://github.com/torvalds/linux/blob/master/drivers/ufs/core/ufshcd.c#L2705
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Philippe Reynes [Thu, 29 Jun 2023 09:25:23 +0000 (11:25 +0200)]
drivers: led: bcm6753: do not use null label to find the top
This driver considers that a node with an empty label is the top.
But the led class has changed, if a label is not provided for a led,
the label is filed with the node name. So we update this driver
to use a wrapper to manage the top led node.
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Kunihiko Hayashi [Tue, 20 Jun 2023 10:50:48 +0000 (19:50 +0900)]
board_f: Relocate fdt even if GD_FLG_SKIP_RELOC is set
In case of OF_SEPARATE (!OF_EMBED), the devicetree blob is placed
after _end, and fdt_find_separate() always returns _end. There is
a .bss section after _end and the section is cleared before relocation.
When GD_FLG_SKIP_RELOC is set, relocation is skipped, so the blob is
still in .bss section, but will be cleared. As a result, the devicetree
become invalid.
To avoid this issue, should relocate it regardless of GD_FLG_SKIP_RELOC
in reloc_fdt().
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Oleksandr Suvorov [Thu, 15 Jun 2023 14:54:34 +0000 (17:54 +0300)]
lib/zlib: Fix a bug when getting a gzip header extra field
This fixes CVE-2022-37434 [1] and bases on 2 commits from Mark
Adler's zlib master repo - the original fix of CVE bug [2] and
the fix for the fix [3].
[1]
https://github.com/advisories/GHSA-cfmr-vrgj-vqwv
[2]
https://github.com/madler/zlib/commit/
eff308af425b67093bab25f80f1ae950166bece1
[3]
https://github.com/madler/zlib/commit/
1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d
Fixes:
e89516f031d ("zlib: split up to match original source tree")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Andreas Dannenberg [Wed, 14 Jun 2023 22:28:53 +0000 (17:28 -0500)]
net: ti: am65-cpsw-nuss: Use dedicated port mode control registers
The different CPSW sub-system Ethernet ports have different PHY mode
control registers. In order to allow the modes to get configured
independently only the register for the port in question must be
accessed, otherwise we would just be re-configuring the mode for port 1,
while leaving all others at their power-on defaults. Fix this issue by
adding a port-number based offset to the mode control base register
address based on the fact that the control registers for the different
ports are spaced exactly 0x4 bytes apart.
Fixes:
9d0dca1199d1 ("net: ethernet: ti: Introduce am654 gigabit eth switch subsystem driver")
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Peter Robinson [Wed, 14 Jun 2023 14:41:10 +0000 (15:41 +0100)]
disable NFS support by default
While NFS is widely used in data centres, and private
networks it's quite a nuanced usecase for device firmware.
A lot of devices already disable it.
Various network protocols should really be opt in, not opt
out, because they add extra size and are potential attack
vectors from a security PoV. In the NFS case it doesn't
really make sense for a lot of devices like tables, SBCs etc.
It's also something we don't really want for SystemReady-IR
due to security concerns.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Emmanuel Di Fede [Wed, 14 Jun 2023 10:05:28 +0000 (12:05 +0200)]
env: mmc: statically set the environment partition name
The new opt-out setting, CONFIG_ENV_MMC_PARTITION, statically sets
the MMC environment partition name. Prior to this patch, the only way
to declare this partition name was by creating a
'u-boot,mmc-env-partition' parameter in the device-tree's /config node.
This setting provides additional flexibility, particularly in cases
where accessing the device-tree is not straightforward (e.g. QEMU).
If undeclared, the device-tree's setting will be used.
Signed-off-by: Emmanuel Di Fede <emmanuel.difede@cysec.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
AKASHI Takahiro [Tue, 13 Jun 2023 01:30:45 +0000 (10:30 +0900)]
firmware: scmi: return a right errno for SCMI status code
scmi_to_linux_errno() is set to return an appropriate errno
which corresponds to a given SCMI status code.
But the current implementation always returns the same value.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Sergei Antonov [Mon, 12 Jun 2023 19:59:10 +0000 (22:59 +0300)]
hash: fix a memory leak
memalign() returns a pointer which is to be freed by free(). To call
unmap_sysmem() is incorrect, furthermore it was called in a wrong scope.
Also add a check for allocation error.
Fixes:
d7af2baa49c6 ("crypto/fsl: Fix HW accelerated hash commands")
Cc: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
AKASHI Takahiro [Mon, 12 Jun 2023 01:14:49 +0000 (10:14 +0900)]
clk: scmi: claim the dependency on CONFIG_CLK
Without CONFIG_CLK, the build fails with the following message:
LD u-boot
aarch64-none-linux-gnu-ld.bfd: drivers/firmware/scmi/scmi_agent-uclass.o: \
in function `scmi_bind_protocols':
.../drivers/firmware/scmi/scmi_agent-uclass.c:79: undefined reference to \
`_u_boot_list_2_driver_2_scmi_clock'
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Jim Liu [Tue, 4 Jul 2023 08:00:14 +0000 (16:00 +0800)]
arch: arm: npcm8xx: add cpu version and 4G ram support
Add npcm8xx A2 cpu version check
and add 4G RAM support
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 4 Jul 2023 08:00:13 +0000 (16:00 +0800)]
misc: npcm_host_intf: change initialization sequence
configuration should be done before release host wait
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 4 Jul 2023 08:00:12 +0000 (16:00 +0800)]
pinctrl: nuvoton: fix reset reason error for poweron
In non tip mode, BMC first power on with PORST+CORST.
the gpio status will error.
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 4 Jul 2023 08:00:11 +0000 (16:00 +0800)]
board: nuvoton: arbel: change uboot load address
use new memory layout and change uboot load address.
open tpm, tee and more config feature
No need to reserve top memory because the reserved space
is moved to the bottom area of memory.
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 13 Jun 2023 07:45:56 +0000 (15:45 +0800)]
misc: nuvoton: fix type error
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 13 Jun 2023 07:45:55 +0000 (15:45 +0800)]
ARM: dts: npcm8xx: fix dts node error
The SHA and OTP should under the ahb node
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 13 Jun 2023 07:45:54 +0000 (15:45 +0800)]
board: nuvoton: add env setting for boot to linux
add console and mem env to boot to linux kernel
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 13 Jun 2023 07:45:53 +0000 (15:45 +0800)]
ARM: config: Enable config to decompress the FIT image
Enable FIT and SHA config to decompress the kernel image
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Tom Rini [Fri, 14 Jul 2023 17:27:53 +0000 (13:27 -0400)]
Merge branch '2023-07-14-nuvoton-platform-updates'
- A number of updates for the nuvoton family of platforms
Tom Rini [Fri, 14 Jul 2023 17:26:42 +0000 (13:26 -0400)]
Merge branch '2023-07-14-expo-initial-config-editor'
To quote the author:
This series provides a means to edit board configuration in U-Boot in a
graphical manner. It supports multiple menu items and allows moving
between them and selecting items. The configuration is defined in a data
format so that code is not needed in most cases. This allows the board
configuration to be provided in the devicetree.
This is still at an early stage, since it only supports menus. Numeric
values are not supported. Most importantly it does not yet support
loading or saving the configuration selected by the user.
To try it out you can use something like:
./tools/expo.py -e test/boot/files/expo_layout.dts \
-l test/boot/files/expo_layout.dts -o cedit.dtb
./u-boot -Tl -c "cedit load hostfs - cedit.dtb; cedit run"
Use the arrow keys to move between menus, enter to open a menu, escape
to exit.
Various minor fixes and improvements are provided in this series:
- Update STB TrueType library to latest
- Support clearing part of the video display
- Support multiple livetrees loaded at runtime
- Support loading and allocating a file
- Support proper measuring of text in expo
- Support simple themes for expo
Simon Glass [Thu, 1 Jun 2023 16:23:04 +0000 (10:23 -0600)]
video: Update stb_truetype
This was brought in in 2016 and a number of changes have been made since
then. There does not seem to be much change in functionality, but it is
a good idea to update from time to time.
Bring in the latest version:
5736b15 ("re-add perlin noise again")
Add a few necessary functions, with dummies in some cases. Update the tests
as there are subtle changes in rendering, perhaps not for the better.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:23:03 +0000 (10:23 -0600)]
expo: Add tests for the configuration editor
Add some simple tests and a helpful script to make the configuration
editor easier to set up.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:23:02 +0000 (10:23 -0600)]
expo: Add a configuration editor
Add a new 'cedit' command which allows editing configuration using an
expo. The configuration items appear as menus on the display.
This is extremely basic, only supporting menus and not providing any way
to load or save the configuration.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:23:01 +0000 (10:23 -0600)]
expo: Support building an expo from a description file
The only way to create an expo at present is by calling the functions to
create each object. It is useful to have more data-driven approach, where
the objects can be specified in a suitable file format and created from
that. This makes testing easier as well.
Add support for describing an expo in a devicetree node. This allows more
complex tests to be set up, as well as providing an easier format for
users. It also provides a better basis for the upcoming configuration
editor.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:23:00 +0000 (10:23 -0600)]
expo: Add spacing around menus and items
It looks better if menus have a bit of an inset, rather than be drawn hard
up against the background. Also, menu items look better if they have a bit
of spacing between them.
Add theme options for these and implement the required changes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:59 +0000 (10:22 -0600)]
expo: Implement the keypress logic for popup menus
In 'popup' mode, the expo allows moving around the objects in a scene.
When 'enter' is pressed on a menu, it opens and the user can move around
the items in the menu.
Implement this using keypress handles and actions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:58 +0000 (10:22 -0600)]
expo: Draw the current opened menu on top
When a menu is opened, it must be displayed over all other objects in
the scene, so that all its items are visible.
Handle this by drawing the menu object a second time, after all other
objects have been drawn. Draw all of the objects which are dependent
on the menu object.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:57 +0000 (10:22 -0600)]
expo: Draw popup menus in both opened and closed states
When a popup menu is closed it shows only the selected item. When it is
open it shows a background and all items, with a highlight that can be
moved between the items.
Add the drawing logic for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:56 +0000 (10:22 -0600)]
expo: Rename EXPOACT_POINT to EXPOACT_POINT_ITEM
At present we only support a single menu, so all that can be pointed to
is the current menu item. Rename this action so that we can also add
an action for pointing to an object. This will allow cycling through
the objects in a scene.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:55 +0000 (10:22 -0600)]
expo: Support drawing of popup menus
At present only a single menu is supported. All items are shown and a
pointer object points to the current item.
Add support for multiple menus, one of which is highlighted, indicated
by the highlight_id property in the scene.
The highlighted menu item has a SCENEOF_POINT flag, indicating that it
is currently pointed to.
The popup menu is normally closed, in which case it shows only the
current menu item. When it is opened, it shows all items, allowing the
user to select one.
Rather than requiring the menu item to have a description, require it to
have a label. Use the label (only) for the popup menu.
With this, most of the drawing and layout logic is complete.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:54 +0000 (10:22 -0600)]
expo: Move menu-item selection into a function
The current implementation supports a 'pointer' object which points to
the currently highlighted menu item. We want to support highlighting the
label of the menu item instead, e.g. with inverse video. In this case we
will need to 'unhighlight' the old item and highlight the new one.
As a first step, move the pointer logic into a function. This fixes a
bug where the item is hidden when it should not be.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:53 +0000 (10:22 -0600)]
expo: Support simple themes
It is a pain to manually set the fonts of all objects to be consistent.
Some spacing settings are also better set globally than by manually
positioning each object.
Add a 'theme' to the expo, to hold this information. For now it includes
only the font size.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:52 +0000 (10:22 -0600)]
expo: Set up the width and height of objects
Provide a way to set the full dimensions of objects, i.e. including the
width and height.
For menus, calculate the bounding box of all objects in the menu. Set all
labels to be the same size, so that highlighting works correct, once
implemented.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:51 +0000 (10:22 -0600)]
expo: Calculate text bounding-box correctly
Rather than estimating, measure the text accurately, using the new
vidconsole feature. This allows accurate placement of objects.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:50 +0000 (10:22 -0600)]
expo: Use flags for objects
We currently have just a 'hide' property for each object. In preparation
for adding more properties, convert the struct to use a flags value,
instead of individual booleans. This is more extensible.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:49 +0000 (10:22 -0600)]
expo: Add width and height to objects
At present objects only have a position so it is not possible to determine
the amount of space they take up on the display.
Add width and height properties, using a struct to keep all the dimensions
together.
For now this is not used. Future work will set up these new properties.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:48 +0000 (10:22 -0600)]
video: Use enum with video_index_to_colour()
Use the provided enum with this function, so it is clearer what should be
passed to it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:47 +0000 (10:22 -0600)]
expo: Allow setting the start of the dynamic-ID range
Provide a way to set this value so that it is easy to separate the
statically allocated IDs (generated by the caller) from those
generated dynamically by expo itself.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:46 +0000 (10:22 -0600)]
console: Allow measuring the bounding box of text
For laying out text accurately it is necessary to know the width and
height of the text. Add a measure() method to the console API, so this
can be supported.
Add an implementation for truetype and a base implementation for the
normal console.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:45 +0000 (10:22 -0600)]
video: Allow temporary colour changes
It is sometimes necessary to highlight some text in a different colour.
Add an easy way to do this and then restore the original console colours.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:44 +0000 (10:22 -0600)]
video: Correct docs for video_index_to_colour()
This uses the private data of the video uclass, not the console uclass
(its child). Update the comment to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes:
a032e4b55ea ("video: Move console colours to the video uclass")
Simon Glass [Thu, 1 Jun 2023 16:22:43 +0000 (10:22 -0600)]
bootstd: Add a separate log category for expo
This feature is different enough from bootstd that it probably deserves
its own log category. It cannot use a uclass since it is not a device.
Add a new category.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:42 +0000 (10:22 -0600)]
fdt: Allow more general use of livetree
At present livetree can only be used for the control FDT. It is useful
to be able to use the ofnode API for other FDTs, e.g. those used by
the upcoming configuration editor.
We already have most of the support present, and tests can be marked with
the UT_TESTF_OTHER_FDT flag to use another FDT as a special case. But
with this change, the functionality becomes more generally available.
Plumb in the require support.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:41 +0000 (10:22 -0600)]
fdt: Clarify the fdt pre-relocation warning
Reword this so it is easier to understand.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:40 +0000 (10:22 -0600)]
fdt: Align the start of the livetree
Ensure that the block of memory used by live tree is aligned according to
the default for structures. This ensures that the root node appears at
the start of the block, so it can be used with free(), rather than being
4 bytes later in some cases.
This corrects a rather obscure bug in unflatten_device_tree().
Fixes:
8b50d526ea5 ("dm: Add a function to create a 'live' device tree")
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:39 +0000 (10:22 -0600)]
cat: Update command to use fs_load_alloc()
Use this new function since it implements the required functionality and
reduces duplicated code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:38 +0000 (10:22 -0600)]
fs: Create functions to load and allocate a file
This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.
Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:37 +0000 (10:22 -0600)]
expo: Rename exp_set_text_mode()
Rename this function to match its peers, using the full "expo' prefix.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:36 +0000 (10:22 -0600)]
console: Correct truetype spacing error
The putc_xy() method is supposed to return the amount of space used. The
existing implementation erroneously adds the previous sub-pixel position
to the returned value. This spaces out the characters very slightly more
than it should. It is seldom noticeable but it does make accurate
measurement of the text impossible.
Fix this minor but long-standing bug.
Fixes:
a29b012037c ("video: Add a console driver that uses TrueType fonts")
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:35 +0000 (10:22 -0600)]
expo: Avoid automatically arranging the scene
This should ideally be done once after all scene changes have been made.
Require an explicit call when everything is ready.
Always arrange after a key it sent, just for convenience.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:34 +0000 (10:22 -0600)]
expo: Store the console in the expo
Rather than finding this each time, keep a pointer to it. This simplifies
the code a little.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:33 +0000 (10:22 -0600)]
video: Provide a way to clear part of the console
This is useful when the background colour must be written before text
is updated, to avoid strange display artifacts.
Add a function for this, using the existing code from the truetype
console.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:32 +0000 (10:22 -0600)]
video: Drop #ifdefs from console_truetype
Use if() instead to reduce the number of build paths.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:31 +0000 (10:22 -0600)]
dm: core: Avoid registering an inaccessible tree
At present there are various restrictions on the use of livetree:
- It is only available once the tree is unflattened, i.e. after relocation
- It is designed to be used with the control FDT
- It can (in principle) be used with other FDTs, but only if they are
unflattened first; this is not supported
Add a few checks to make sure that any tree that is created is actually
valid. Otherwise it can be confusing when nodes and properties cannot
actually be accessed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:30 +0000 (10:22 -0600)]
gpio: Avoid using an invalid ofnode
Devices do not necessarily have nodes attached to them, since they can be
created from platdata. In SPL a devicetree may in fact not exist at all.
Check the node before using it. This avoids failure when OF_CHECKS is
enabled.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes:
5fc7cf8c8e2 ("gpio: add gpio-hog support")
Reviewed-by: Heiko Schocher <hs@denx.de>
Simon Glass [Thu, 1 Jun 2023 16:22:29 +0000 (10:22 -0600)]
test: Restore test behaviour on failure
A recent change makes test continue to run after failure. This results in
a lot of useless output and may lead to a segfault. Fix this by adding
back the 'return' statement.
Fixes:
fa847bb409d ("test: Wrap assert macros in ({ ... }) and fix")
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:28 +0000 (10:22 -0600)]
sandbox: Fix quiting when the LCD window is closed
With recent changes to how sandbox handles reset, closing the window
currently just restarts sandbox.
Use the correct sysreset type to tell it to shut down.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:27 +0000 (10:22 -0600)]
expo: Convert to using a string ID for the scene title
This is easier to deal with if it uses the existing string handling,
since we will be able to use translations, etc. in the future.
Update it to use an ID instead of a string.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:26 +0000 (10:22 -0600)]
expo: Correct some header-file comments
The use of Returns instead of @return still confuses me. Fix some problems
that have crept in.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 1 Jun 2023 16:22:25 +0000 (10:22 -0600)]
binman: Correct coverage gap in control
Add a pragma to deal with the code-coverage gap which drops binman down to
90% coverage.
Fixes:
de65b122a25 (tools: Fall back to importlib_resources on Python 3.6)
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 12 Jul 2023 02:46:30 +0000 (20:46 -0600)]
bdinfo: Correct use of assertions
This test was written for the incorrect use of assertions. Update it to
build with the previous approach, where tests fail at the first
assertion.
All assertion functions return 0 on success and non-zero on failure.
They can be nested into functions simply by declaring a function that
returns an int and using ut_assertok() to call it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Jim Liu [Tue, 4 Jul 2023 08:00:14 +0000 (16:00 +0800)]
arch: arm: npcm8xx: add cpu version and 4G ram support
Add npcm8xx A2 cpu version check
and add 4G RAM support
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 4 Jul 2023 08:00:13 +0000 (16:00 +0800)]
misc: npcm_host_intf: change initialization sequence
configuration should be done before release host wait
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 4 Jul 2023 08:00:12 +0000 (16:00 +0800)]
pinctrl: nuvoton: fix reset reason error for poweron
In non tip mode, BMC first power on with PORST+CORST.
the gpio status will error.
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 4 Jul 2023 08:00:11 +0000 (16:00 +0800)]
board: nuvoton: arbel: change uboot load address
use new memory layout and change uboot load address.
open tpm, tee and more config feature
No need to reserve top memory because the reserved space
is moved to the bottom area of memory.
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 13 Jun 2023 07:45:56 +0000 (15:45 +0800)]
misc: nuvoton: fix type error
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 13 Jun 2023 07:45:55 +0000 (15:45 +0800)]
ARM: dts: npcm8xx: fix dts node error
The SHA and OTP should under the ahb node
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Jim Liu [Tue, 13 Jun 2023 07:45:54 +0000 (15:45 +0800)]
board: nuvoton: add env setting for boot to linux
add console and mem env to boot to linux kernel
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>