]> git.baikalelectronics.ru Git - uboot.git/log
uboot.git
20 months agoarch: arm: dst: fsl-ls2080a.dts: tag serial nodes with bootph-all
Ioana Ciornei [Tue, 28 Feb 2023 16:32:11 +0000 (18:32 +0200)]
arch: arm: dst: fsl-ls2080a.dts: tag serial nodes with bootph-all

Tag the serial nodes with bootph-all in order to have these nodes and
the drivers available before relocation.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoarch: arm: dst: fsl-ls2080a.dts: sync serial nodes with Linux
Ioana Ciornei [Tue, 28 Feb 2023 16:32:10 +0000 (18:32 +0200)]
arch: arm: dst: fsl-ls2080a.dts: sync serial nodes with Linux

Sync the serial nodes of the LS208XA RDB/QDS boards with their
representation in Linux. We also imported the clockgen and sysclk nodes
which are dependencies.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoarch: arm: dst: fsl-ls2080a.dtsi: move the serial nodes under soc
Ioana Ciornei [Tue, 28 Feb 2023 16:32:09 +0000 (18:32 +0200)]
arch: arm: dst: fsl-ls2080a.dtsi: move the serial nodes under soc

Move the serial nodes under the soc node. No changes are made to the
nodes, just their location is changed.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoarch: arm: dst: fsl-ls2080a.dtsi: add an 'soc' node
Ioana Ciornei [Tue, 28 Feb 2023 16:32:08 +0000 (18:32 +0200)]
arch: arm: dst: fsl-ls2080a.dtsi: add an 'soc' node

The u-boot dts for these boards do not have an soc node, unlike its
Linux counterpart. This patch just adds the soc node as seen in Linux,
the next patches will move some nodes under it.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoarm: dts: ls1088a-rdb: replace 'xgmii' with '10gbase-r'
Ioana Ciornei [Wed, 22 Feb 2023 14:17:40 +0000 (16:17 +0200)]
arm: dts: ls1088a-rdb: replace 'xgmii' with '10gbase-r'

When the first device tree description was added for the ethernet nodes,
the 2 10G ports on the LS1088ARDB were wrongly described as 'xgmii'.

Fix this by replacing the two last occurrences of 'xgmii' in the device
trees of the Layerscape DPAA2 devices.

Fixes: 9de2fdd7d65a ("arm: dts: ls1088ardb: add DPMAC and PHY nodes")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoboard: freescale: ls1088a: remove code under !CONFIG_DM_ETH
Ioana Ciornei [Wed, 15 Feb 2023 15:31:19 +0000 (17:31 +0200)]
board: freescale: ls1088a: remove code under !CONFIG_DM_ETH

Now that DM_ETH is enabled by default, there is no point in keeping the
non-DM_ETH code which initialized the ethernet interfaces.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoboard: freescale: ls2080aqds: remove code under !CONFIG_DM_ETH
Ioana Ciornei [Wed, 15 Feb 2023 15:31:18 +0000 (17:31 +0200)]
board: freescale: ls2080aqds: remove code under !CONFIG_DM_ETH

Now that DM_ETH is enabled by default, there is no point in keeping the
non-DM_ETH code which initialized the ethernet interfaces.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoboard: freescale: ls2080rdb: remove code under !CONFIG_DM_ETH
Ioana Ciornei [Wed, 15 Feb 2023 15:31:17 +0000 (17:31 +0200)]
board: freescale: ls2080rdb: remove code under !CONFIG_DM_ETH

Now that DM_ETH is enabled by default, there is no point in keeping the
non-DM_ETH code which initialized the ethernet interfaces.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoboard: freescale: lx2160a: remove code under !CONFIG_DM_ETH
Ioana Ciornei [Wed, 15 Feb 2023 15:31:16 +0000 (17:31 +0200)]
board: freescale: lx2160a: remove code under !CONFIG_DM_ETH

Now that DM_ETH is enabled by default, there is no point in keeping the
non-DM_ETH code which initialized the ethernet interfaces.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoboard: freescale: lx2160a: remove hardcoded ethernet initialization
Ioana Ciornei [Wed, 15 Feb 2023 15:31:15 +0000 (17:31 +0200)]
board: freescale: lx2160a: remove hardcoded ethernet initialization

The LX2160ARDB board has support for DM_ETH probed devices, which means
that we do not need to manually create an MDIO controller, register it,
create PHYs on it etc.

In order to cleanup the board file a bit, just remove this code entirely.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
20 months agoMerge tag 'dm-next-9mar23' of https://source.denx.de/u-boot/custodians/u-boot-dm...
Tom Rini [Thu, 9 Mar 2023 16:22:50 +0000 (11:22 -0500)]
Merge tag 'dm-next-9mar23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

binman x509, separate tools dir and other improvements
patman parallel patch generation
fdt fixes and tests
PyPi support for U-Boot tools
buildman reproducible builds

20 months agobinman: Support generation of x509 certificates
Simon Glass [Fri, 3 Mar 2023 00:02:45 +0000 (17:02 -0700)]
binman: Support generation of x509 certificates

And a new entry type which supports generation of x509 certificates.
This uses a new 'openssl' btool with just one operation so far.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Support updating section contents
Simon Glass [Fri, 3 Mar 2023 00:02:44 +0000 (17:02 -0700)]
binman: Support updating section contents

Implement this feature since it is useful for updating FITs within an
image.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Handle missing bintools correctly in fit
Simon Glass [Fri, 3 Mar 2023 00:02:43 +0000 (17:02 -0700)]
binman: Handle missing bintools correctly in fit

At present these are handled as if they are allowed to be missing, but
this is only true if the -M flag is provided. Fix this and add a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Allow preserving the output dir when replacing
Simon Glass [Fri, 3 Mar 2023 00:02:42 +0000 (17:02 -0700)]
binman: Allow preserving the output dir when replacing

Add these flags for the 'replace' subcommand too, to aid debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
44 2023 -0700

20 months agobuildman: Correct CROSS_COMPILE output for sandbox
Simon Glass [Thu, 2 Mar 2023 13:11:44 +0000 (06:11 -0700)]
buildman: Correct CROSS_COMPILE output for sandbox

At present, 'buildman -A sandbox' adds the path containing the
toolchain at present. We can assume that this is in the path and
we don't want to set CROSS_COMPILE=/bin/ so change this to align
with what MakeEnvironment() does.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agopatman: Check patches in parallel
Simon Glass [Wed, 8 Mar 2023 18:52:55 +0000 (10:52 -0800)]
patman: Check patches in parallel

For large series this can take a while. Run checkpatch in parallel to
try to reduce the time. The checkpatch information is still reported in
sequential order, so a very slow patch at the start can still slow
things down. But overall this gives good results.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
20 months agopatman: Run get_maintainer.pl in parallel
Simon Glass [Wed, 8 Mar 2023 18:52:54 +0000 (10:52 -0800)]
patman: Run get_maintainer.pl in parallel

This script can take ages on some series. Try to limit the time by
using threads. If a few stubborn patches remain, show progress so the
user has some idea what is going on.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
20 months agopatman: Refactor MakeCcFile() into two functions
Simon Glass [Wed, 8 Mar 2023 18:52:53 +0000 (10:52 -0800)]
patman: Refactor MakeCcFile() into two functions

This function is quite long. Moving the handling of a commit into a
separate function. This will make it easier to do the work in parallel.

Update function comments while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
20 months agopatman: Drop an incorrect comment about git am
Simon Glass [Wed, 8 Mar 2023 18:52:52 +0000 (10:52 -0800)]
patman: Drop an incorrect comment about git am

Patman does not do this anymore, as of this commit:

   7428dc14b0f ("patman: Remove the -a option")

Drop the comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
20 months agotest: cmd: fdt: Add list of remaining missing tests
Marek Vasut [Thu, 2 Mar 2023 03:08:45 +0000 (04:08 +0100)]
test: cmd: fdt: Add list of remaining missing tests

Add list of missing tests for the 'fdt' command, currently
the missing sandbox tests are only 'fdt boardsetup' and
'fdt checksign' .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt bootcpu
Marek Vasut [Thu, 2 Mar 2023 03:08:40 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt bootcpu

Add 'fdt bootcpu' test which works as follows:
- Create basic FDT, map it to sysmem
- Print the FDT bootcpu
- Set the FDT bootcpu and read the value back using 'fdt header get'
- Perform the previous step twice to validate bootcpu overwrite

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt rm
Marek Vasut [Thu, 2 Mar 2023 03:08:38 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt rm

Add 'fdt rm' test which works as follows:
- Create fuller FDT, map it to sysmem
- Selectively delete nodes or properties by both path and aliases
- Verify created nodes or properties using fdt print command

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt mknode
Marek Vasut [Thu, 2 Mar 2023 03:08:37 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt mknode

Add 'fdt mknode' test which works as follows:
- Create fuller FDT, map it to sysmem
- Create node either in / or subnode
- Attempt to create node over existing node, which fails
- Attempt to create subnodes in non-existing nodes or aliases
- Verify created nodes using fdt list command

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt set
Marek Vasut [Thu, 2 Mar 2023 03:08:36 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt set

Add 'fdt set' test which works as follows:
- Create fuller FDT, map it to sysmem
- Set either existing property to overwrite it, or new property
- Test setting both single properties as well as string and integer arrays
- Test setting to non-existent nodes and aliases
- Verify set values using 'fdt get value'

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt get size
Marek Vasut [Thu, 2 Mar 2023 03:08:35 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt get size

Add 'fdt get size' test which works as follows:
- Create fuller FDT, map it to sysmem
- Get size of various properties
- Get node count of available nodes
- Test non-existent nodes and properties

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt get addr
Marek Vasut [Thu, 2 Mar 2023 03:08:34 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt get addr

Add 'fdt get addr' test which works as follows:
- Create fuller FDT, map it to sysmem
- Get address of various properties
- Compare addresses calculated by UT and fdt command

This test is special in that it has to go through gruesome remapping scheme
where the test calculates:
- pointer offsets of the generated FDT root and the property being tested
- map_sysmem() result of environment variable "fdtaddr" and the one set
  by the test matching address of property being tested
- difference between the later and the former, to obtain offset of the
  DT property from start of DT
The offsets must match in both the UT and the tested U-Boot, if they do
not, the test fails.

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt get name
Marek Vasut [Thu, 2 Mar 2023 03:08:33 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt get name

Add 'fdt get name' test which works as follows:
- Create fuller FDT, map it to sysmem
- Get name of / node 0, 1 and /clk-test node 0
- Compare output and validate the node name
- Get name of / node 2 and /clk-test node 1
- Compare output and validate the node is not present
- Get name of / node -1 and /clk-test node -1
- Compare output and validate the node name equals node 0 name
- Check nonexistent node, verify the command errors out

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt resize
Marek Vasut [Thu, 2 Mar 2023 03:08:31 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt resize

Add 'fdt resize' test which works as follows:
- Create simple FDT with extra size 0, map it to sysmem
- 'resize' the FDT by 0x2000 bytes
- Verify the new space has been added to the FDT

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test fdt move
Marek Vasut [Thu, 2 Mar 2023 03:08:30 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt move

Add 'fdt move' test which works as follows:
- Create simple FDT, map it to sysmem
- 'move' the FDT into new zeroed out sysmem location
- Verify newly active FDT is in the new location
- Compare both locations

The test case can be triggered using:
"
./u-boot -Dc 'ut fdt'
"
To dump the full output from commands used during test, add '-v' flag.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test both string and integer arrays in 'fdt get value'
Marek Vasut [Thu, 2 Mar 2023 03:08:29 +0000 (04:08 +0100)]
test: cmd: fdt: Test both string and integer arrays in 'fdt get value'

The 'fdt get value' subcommand now supports extraction of integer value
from integer arrays, add test for it, including a test for special case
unindexed integer array read, which is handled as hash and treated as a
long string instead of integer.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Test alias resolution in 'fdt get value'
Marek Vasut [Thu, 2 Mar 2023 03:08:28 +0000 (04:08 +0100)]
test: cmd: fdt: Test alias resolution in 'fdt get value'

The 'fdt' command help contains the following note:
"
Dereference aliases by omitting the leading '/', e.g. fdt print ethernet0.
"
Add test for it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Generate fuller DT internally and switch fdt get value to it
Marek Vasut [Thu, 2 Mar 2023 03:08:27 +0000 (04:08 +0100)]
test: cmd: fdt: Generate fuller DT internally and switch fdt get value to it

Implement function to generate internal test DT fragment and switch
the 'fdt get value' test to this instead of depending on the sandbox
DT. Rename clk-test node to test-node node. This FDT fragment will be
reused by other tests. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Rename fdt_test_get() to fdt_test_get_value()
Marek Vasut [Thu, 2 Mar 2023 03:08:26 +0000 (04:08 +0100)]
test: cmd: fdt: Rename fdt_test_get() to fdt_test_get_value()

The 'fdt get' command has a 'get value' subcommand, rename the fdt_test_get()
to fdt_test_get_value() to avoid confusion about what it is testing. There is
currently no get 'get name', 'get addr', 'get size' subcommand test.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: cmd: fdt: Rename fdt_test_resize() to fdt_test_addr_resize()
Marek Vasut [Thu, 2 Mar 2023 03:08:25 +0000 (04:08 +0100)]
test: cmd: fdt: Rename fdt_test_resize() to fdt_test_addr_resize()

The 'fdt' command has a 'resize' subcommand, rename the fdt_test_resize()
to fdt_test_addr_resize() to avoid confusion about what it is testing.
There is currently no resize test.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: Add ut_assert_nextline_empty() empty line helper
Marek Vasut [Thu, 2 Mar 2023 03:08:24 +0000 (04:08 +0100)]
test: Add ut_assert_nextline_empty() empty line helper

Add helper macro to test for empty lines, which is an inobvious
wrapper around ut_assert_nextline("%s", "") .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Add support for integer arrays in fdt get value with index
Marek Vasut [Thu, 2 Mar 2023 03:08:23 +0000 (04:08 +0100)]
cmd: fdt: Add support for integer arrays in fdt get value with index

Currently any integer array value is set as long up-to-40 character
hexadecimal string into environment variable when extracted from an
FDT using 'fdt get value path prop index', because the support for
handling integer arrays is not implemented, and fdt_value_env_set()
code falls back into the hash handling behavior instead.

Implement this support simply by checking whether user supplied any
index. If index is set and the property length is multiple of four,
then this is an integer array, and the code would extract value at
specified index.

There is a subtle change where default index is set to -1 instead of 0.
This is OK, since the only place which checks for index to be less or
equal zero is the string array handling code in fdt_value_env_set() and
that code would work perfectly well with index -1 too.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Map address returned from fdt get addr to sysmem
Marek Vasut [Thu, 2 Mar 2023 03:08:22 +0000 (04:08 +0100)]
cmd: fdt: Map address returned from fdt get addr to sysmem

The address returned from 'fdt get addr' command must be mapped
into sysmem, as this is a working FDT. Access to this address
without mapping it would lead to crash e.g. in sandbox.

The following command triggers the crash:
"
./u-boot -Dc 'fdt addr $fdtcontroladdr ; fdt get addr var / compatible ; md $var'
"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Handle 64bit pointers in fdt get addr
Marek Vasut [Thu, 2 Mar 2023 03:08:21 +0000 (04:08 +0100)]
cmd: fdt: Handle 64bit pointers in fdt get addr

The command assumed 32bit pointers so far, with 64bit pointer the
command would overwrite a piece of stack. Fix it by extending the
array size to cater for 64bit pointer, and use snprintf() to avoid
writing past the end of the array ever again.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Align checksign parameter names in help text
Marek Vasut [Thu, 2 Mar 2023 03:08:20 +0000 (04:08 +0100)]
cmd: fdt: Align checksign parameter names in help text

The help text references 'addr' as an optional key start address,
but the explanation references the same as 'start', make sure they
both read as 'addr'. Also update the abbreviated 'addr' in the
explanation to 'address'.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Check argc before accessing argv in fdt memory
Marek Vasut [Thu, 2 Mar 2023 03:08:19 +0000 (04:08 +0100)]
cmd: fdt: Check argc before accessing argv in fdt memory

On case 'fdt memory' is invoked without parameters, argv[2]/argv[3]
is not valid and this command would SEGFAULT in sandbox environment.
Add missing argc test to avoid the crash and rather print usage help
message.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Check argc before accessing argv in fdt bootcpu
Marek Vasut [Thu, 2 Mar 2023 03:08:18 +0000 (04:08 +0100)]
cmd: fdt: Check argc before accessing argv in fdt bootcpu

On case 'fdt bootcpu' is invoked without parameters, argv[2] is not
valid and this command would SEGFAULT in sandbox environment. Add
missing argc test to avoid the crash and rather print usage help
message.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Fix fdt rsvmem behavior on non-existent index and error message space
Marek Vasut [Thu, 2 Mar 2023 03:08:17 +0000 (04:08 +0100)]
cmd: fdt: Fix fdt rsvmem behavior on non-existent index and error message space

In case 'fdt rsvmem delete index' is passed a non-existent index, one
which does not exist in 'fdt rsvmem print', then the following command
triggers a print of help message for 'fdt' command instead of erroring
out:
=> fdt rsvmem delete 1234
This is because the subcommand errornously returns 'err' instead of
CMD_RET_FAILURE, fix it. Furthermore, align the number of spaces past
fdt_del_mem_rsv() and fdt_add_mem_rsv() in error message with the rest
of the code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Fix fdt rm behavior on non-existent property and error message space
Marek Vasut [Thu, 2 Mar 2023 03:08:16 +0000 (04:08 +0100)]
cmd: fdt: Fix fdt rm behavior on non-existent property and error message space

In case an FDT contains a node '/test-node@1234' , with no property
called 'noprop' in that node, the following command triggers a print
of help message for 'fdt' command instead of erroring out:
=> fdt rm /test-node@1234 noprop
This is because the subcommand errornously returns 'err' instead of
CMD_RET_FAILURE, fix it. Furthermore, align the number of spaces past
fdt_delprop() in error message with the rest of the code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Fix handling of empty properties for fdt get addr and fdt get size
Marek Vasut [Thu, 2 Mar 2023 03:08:15 +0000 (04:08 +0100)]
cmd: fdt: Fix handling of empty properties for fdt get addr and fdt get size

It is perfectly valid to request an address or size of FDT property
without value, the only special case if requesting of the value of
FDT property without value. Invert the test such, that properties
without value still set the variable from 'fdt get addr/size' to
address of the property or size of the property, where the later
is 0.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: fdt: Import is_printable_string() from DTC to fix u32 misprint
Marek Vasut [Thu, 2 Mar 2023 03:08:14 +0000 (04:08 +0100)]
cmd: fdt: Import is_printable_string() from DTC to fix u32 misprint

Import is_printable_string() implementation from DTC 1.7.0 as of
DTC commit 039a994 ("Bump version to v1.7.0") . This fixes a print
of u32 property which so far used to be printed as string by U-Boot
fdt print command.

We might see the case where the parsed property value, in this case
it is a 32-bit integer, identified as a printable string or a null byte
(concatenated strings) because of its last character happens to be:
  0x00 (null character), 0xB (vertical tab character) or
  0x10 (line feed character)
In this situation, if the string is identified as printable string,
it will be displayed as character instead of hex value

When the isprint() condition is true, there are two possibilities:
  1) The character is ASCII character (except the first 32)
  2) The character is extended ASCII character

For example,
NG property in device tree:
    clock-frequency = <16640000>;
by default, would be displayed as
    clock-frequency = "", "ýè";
and with this patch applied, would be displayed as
    clock-frequency = <0x00fde800>;

Full investigation was done by Nam and Hai, patch reworked by Marek
to use common code from DTC.

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Nam Nguyen <nam.nguyen.yh@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agoCI: Add a check for building tools for PyPi
Simon Glass [Fri, 24 Feb 2023 01:18:24 +0000 (18:18 -0700)]
CI: Add a check for building tools for PyPi

Add a simple check that the PyPi packages can be built.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agodoc: Add notes on how to install patman and binman
Simon Glass [Fri, 24 Feb 2023 01:18:23 +0000 (18:18 -0700)]
doc: Add notes on how to install patman and binman

These can be installed with 'pip' now. Add the details for those who are
interested.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agotest: Add concurrencytest to the requirements
Simon Glass [Fri, 24 Feb 2023 01:18:22 +0000 (18:18 -0700)]
test: Add concurrencytest to the requirements

This allows tests to run in parallel and speeds up some tests markedly,
particularly with binman. Add it to the requirements.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Add support for building a binmanu PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:21 +0000 (18:18 -0700)]
binman: Add support for building a binmanu PyPi package

Create the necessary files to build this new package.

It is not actually clear whether this is useful, since buildman has no
purpose outside U-Boot.

Move the main program into a function so that it can easily be called by
the PyPi-created script.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Use importlib to find the help
Simon Glass [Fri, 24 Feb 2023 01:18:20 +0000 (18:18 -0700)]
binman: Use importlib to find the help

Use this function so that the help can be found even when binman is
running from a package.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Hide the 'test' command unless test code is available
Simon Glass [Fri, 24 Feb 2023 01:18:19 +0000 (18:18 -0700)]
binman: Hide the 'test' command unless test code is available

It doesn't make much sense to expose tests when dtoc is running
outside of the U-Boot git checkout. Hide the option in this case.

Fix a long line while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Move the main code into a function
Simon Glass [Fri, 24 Feb 2023 01:18:18 +0000 (18:18 -0700)]
binman: Move the main code into a function

Put this code into a function so it is easy for it be run when packaged.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agodtoc: Add support for building a dtoc PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:17 +0000 (18:18 -0700)]
dtoc: Add support for building a dtoc PyPi package

Create the necessary files to build this new package.

This is needed for binman.

Move the main program into a function so that it can easily be called by
the PyPi-created script.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agodtoc: Use pathlib to find the test directory
Simon Glass [Fri, 24 Feb 2023 01:18:16 +0000 (18:18 -0700)]
dtoc: Use pathlib to find the test directory

Update this so that the directory being used is declared at the top of
the file. Use pathlib as it seems to be more modern.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agodtoc: Move the main code into a function
Simon Glass [Fri, 24 Feb 2023 01:18:15 +0000 (18:18 -0700)]
dtoc: Move the main code into a function

Put this code into a function so it is easy for it be run when packaged.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agodtoc: Hide the test options unless test code is available
Simon Glass [Fri, 24 Feb 2023 01:18:14 +0000 (18:18 -0700)]
dtoc: Hide the test options unless test code is available

It doesn't make much sense to expose tests when dtoc is running
outside of the U-Boot git checkout. Hide the option in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Add support for building a buildman PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:13 +0000 (18:18 -0700)]
buildman: Add support for building a buildman PyPi package

Create the necessary files to build this new package.

It is not actually clear whether this is useful, since buildman has no
purpose outside U-Boot. It is included for completeness, since adding
this later would be more trouble.

Move the main program into a function so that it can easily be called by
the PyPi-created script.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Use importlib to find the help
Simon Glass [Fri, 24 Feb 2023 01:18:12 +0000 (18:18 -0700)]
buildman: Use importlib to find the help

Use this function so that the help can be found even when buildman is
running from a package.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Fix use of a type as a variable
Simon Glass [Fri, 24 Feb 2023 01:18:11 +0000 (18:18 -0700)]
buildman: Fix use of a type as a variable

Using 'str' as a variable makes it impossible to use it as a type in the
same function. Fix this by using a different name.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Hide the test options unless test code is available
Simon Glass [Fri, 24 Feb 2023 01:18:10 +0000 (18:18 -0700)]
buildman: Hide the test options unless test code is available

It doesn't make much sense to expose tests when buildman is running
outside of the U-Boot git checkout. Hide the option in this case

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Move the main code into a function
Simon Glass [Fri, 24 Feb 2023 01:18:09 +0000 (18:18 -0700)]
buildman: Move the main code into a function

Put this code into a function so it is easy for it be run when packaged.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agopatman: Add support for building a patman PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:08 +0000 (18:18 -0700)]
patman: Add support for building a patman PyPi package

Create the necessary files to build this new package.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agopatman: Avoid importing test_checkpatch before it is needed
Simon Glass [Fri, 24 Feb 2023 01:18:07 +0000 (18:18 -0700)]
patman: Avoid importing test_checkpatch before it is needed

Tests are not packaged with patman so this file will not be accessible
when installing with pip. Move the import later in the file, when we
know the file is present.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agopatman: Add support for building a u_boot_tools PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:06 +0000 (18:18 -0700)]
patman: Add support for building a u_boot_tools PyPi package

Create the necessary files to build this new package.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agoscript: Add a script to build a PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:05 +0000 (18:18 -0700)]
script: Add a script to build a PyPi package

Create a script which can package a tool for use with PyPi and the 'pip'
tool. This involves quite a few steps so is best automated. Future work
will enable use of this for some of the tools in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agopatman: Move library functions into a library directory
Simon Glass [Fri, 24 Feb 2023 01:18:04 +0000 (18:18 -0700)]
patman: Move library functions into a library directory

The patman directory has a number of modules which are used by other tools
in U-Boot. This makes it hard to package the tools using pypi since the
common files must be copied along with the tool that uses them.

To address this, move these files into a new u_boot_pylib library. This
can be packaged separately and listed as a dependency of each tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agoRemove concurrencytest
Simon Glass [Fri, 24 Feb 2023 01:18:03 +0000 (18:18 -0700)]
Remove concurrencytest

While our version is better, it is tricky to use it when we are trying
to package things with pip. Drop it.

Somewhat reduced functionality is provided by the upstream version[1],
along with a rather annoying message each time it is used[2] [3].

[1] pip install concurrencytest
[2] https://github.com/cgoldberg/concurrencytest/issues/12
[3] https://github.com/cgoldberg/concurrencytest/pull/14

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agoRevert "patman: test_util: Print test stdout/stderr within test summaries"
Simon Glass [Fri, 24 Feb 2023 01:18:02 +0000 (18:18 -0700)]
Revert "patman: test_util: Print test stdout/stderr within test summaries"

Unfortunately this adds a new feature to concurrencytest and it has not
made it upstream to the project[1].

Drop it for now so we can use the upstream module. Once it is applied we
can bring this functionality back.

[1] https://github.com/cgoldberg/concurrencytest

This reverts commit 5506276051f4f576b25549c74bd22c3a4d340612.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Avoid unwanted output in testFitFirmwareLoadables()
Simon Glass [Fri, 24 Feb 2023 01:18:01 +0000 (18:18 -0700)]
binman: Avoid unwanted output in testFitFirmwareLoadables()

This prints a message about the missing tee-os generated by the test. This
is confusing, so suppress it.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobootstd: Replicate the dtb-filename quirks of distroboot
Simon Glass [Wed, 22 Feb 2023 19:17:04 +0000 (12:17 -0700)]
bootstd: Replicate the dtb-filename quirks of distroboot

For EFI, the distro boot scripts search in three different directories
for the .dtb file. The SOC-based filename fallback is supported only for
32-bit ARM.

Adjust the code to mirror this behaviour.

Also some boards can use a prior-stage FDT if one is not found in the
normal way. Support this and show a message in that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Mark Kettenis <kettenis@openbsd.org>
20 months agobootflow: Rename bootflow_flags_t
Simon Glass [Wed, 22 Feb 2023 19:17:03 +0000 (12:17 -0700)]
bootflow: Rename bootflow_flags_t

These flags actually relate to the iterator, not the bootflow struct
itself. Rename them.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Make the tooldir configurable
Simon Glass [Wed, 22 Feb 2023 19:14:49 +0000 (12:14 -0700)]
binman: Make the tooldir configurable

Add a command-line argument for setting the tooldir, so that the default
can be overridden. Add this directory to the toolpath automatically.
Create the directory if it does not already exist.

Put the default in the argument parser instead of the class, so that it
is more obvious.

Update a few tests that expect the utility name to be provided without
any path (e.g. 'futility'), so they can accept a path, e.g.
/path/to/futility

Update the documentation and add a few tests.

Improve the help for --toolpath while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Use a private directory for bintools
Simon Glass [Wed, 22 Feb 2023 19:14:48 +0000 (12:14 -0700)]
binman: Use a private directory for bintools

At present binman writes tools into the ~/bin directory. This is
convenient but some may be concerned about downloading unverified
binaries and running them. Place then in a special ~/.binman-tools
directory instead.

Mention this in the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
20 months agobinman: Move the tools directory into the Bintool class
Simon Glass [Wed, 22 Feb 2023 19:14:47 +0000 (12:14 -0700)]
binman: Move the tools directory into the Bintool class

We want to be able to change this directory. Use a class member to hold
the value, since changing a constant is not good.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Update bintools documentation
Simon Glass [Wed, 22 Feb 2023 19:14:46 +0000 (12:14 -0700)]
binman: Update bintools documentation

This was not regenerated with recent changes. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Correct an 'aot' typo
Simon Glass [Wed, 22 Feb 2023 19:14:45 +0000 (12:14 -0700)]
binman: Correct an 'aot' typo

Fix this typo.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Add a flag for reproducible builds
Simon Glass [Tue, 21 Feb 2023 19:40:29 +0000 (12:40 -0700)]
buildman: Add a flag for reproducible builds

This is quite a useful thing to use when building since it avoids small
size changes between commits. Add a -r flag for it.

Also undefine CONFIG_LOCALVERSION_AUTO since this appends the git hash
to the version string, causing every build to be slightly different.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Support disabling LTO
Simon Glass [Tue, 21 Feb 2023 19:40:28 +0000 (12:40 -0700)]
buildman: Support disabling LTO

This cuts down build performance considerably and is not always needed,
when checking for build errors, etc.

Add a flag to disable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Write out the build command used
Simon Glass [Tue, 21 Feb 2023 19:40:27 +0000 (12:40 -0700)]
buildman: Write out the build command used

It is sometimes useful to see the exact 'make' command used by buildman
for a commit. Add an output file for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobuildman: Add a note about the out-env file
Simon Glass [Tue, 21 Feb 2023 19:40:26 +0000 (12:40 -0700)]
buildman: Add a note about the out-env file

This file holds the environment used when doing a build. Add a note
about it.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Use correct argument name in docstrings
Jonas Karlman [Sun, 19 Feb 2023 22:02:04 +0000 (22:02 +0000)]
binman: Use correct argument name in docstrings

Use correct argument name in docstrings.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Fix spelling of nodes in code comments
Jonas Karlman [Sun, 19 Feb 2023 22:02:03 +0000 (22:02 +0000)]
binman: Fix spelling of nodes in code comments

Replace notes with nodes in code comments and docstrings.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Remove redundant SetAllowFakeBlob from blob-ext entry
Jonas Karlman [Sun, 19 Feb 2023 22:02:03 +0000 (22:02 +0000)]
binman: Remove redundant SetAllowFakeBlob from blob-ext entry

Entry_blob_ext contains an implementation of SetAllowFakeBlob that is
identical to the one in the base Entry class, remove it.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Support marking FMAP areas as preserved
Simon Glass [Mon, 13 Feb 2023 00:11:15 +0000 (17:11 -0700)]
binman: Support marking FMAP areas as preserved

Add an entry flag called 'preserve' to indicate that an entry should be
preserved by firmware updates. Propagate this to FMAP too.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agobinman: Avoid requiring a home directory on startup
Simon Glass [Fri, 10 Feb 2023 20:59:46 +0000 (13:59 -0700)]
binman: Avoid requiring a home directory on startup

This is needed to download tools, but we may not need to do this. At
present binman fails to start if HOME is not set.

Use the current directory as a default to avoid this.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agoMerge tag 'next-20230307' of https://source.denx.de/u-boot/custodians/u-boot-video...
Tom Rini [Tue, 7 Mar 2023 17:54:01 +0000 (12:54 -0500)]
Merge tag 'next-20230307' of https://source.denx.de/u-boot/custodians/u-boot-video into next

 - video console refactoring and optimization
 - support for fonts wider than 1 byte
 - use named header for 8x16 font data
 - support multiple fonts configuration
 - move get_font_size() to truetype driver ops
 - support font size configuration at runtime
 - add 16x32 Terminus font from linux
 - add 12x22 Sun font from linux
 - add 12x22 console simple font test

20 months agoMerge branch '2023-03-06-assorted-platform-updates' into next
Tom Rini [Tue, 7 Mar 2023 15:42:22 +0000 (10:42 -0500)]
Merge branch '2023-03-06-assorted-platform-updates' into next

- semihosting updates for arm and riscv, assorted arm64 core updates,
  assorted ast2600 updates, remove some more unused code, some TI K3
  defconfig and DTS updates, uniphier DTS updates, mpc83xx Kconfig
  cleanup, re-add fttmr010 driver with an update to use DM.

20 months agovideo console: add 12x22 console simple font test
Dzmitry Sankouski [Tue, 7 Mar 2023 10:21:20 +0000 (13:21 +0300)]
video console: add 12x22 console simple font test

Tests fonts wider than a byte.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agovideo console: sandbox: add 12x22 font defconfigs
Dzmitry Sankouski [Tue, 7 Mar 2023 10:21:19 +0000 (13:21 +0300)]
video console: sandbox: add 12x22 font defconfigs

Add 12x22 font in order to write a test for it.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agovideo console: add 16x32 Terminus font from linux
Dzmitry Sankouski [Mon, 27 Feb 2023 17:37:08 +0000 (20:37 +0300)]
video console: add 16x32 Terminus font from linux

Modern mobile phones typically have high pixel density.
Bootmenu is hardly readable on those with 8x16 font.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agovideo console: add 12x22 Sun font from linux
Dzmitry Sankouski [Mon, 27 Feb 2023 17:37:07 +0000 (20:37 +0300)]
video console: add 12x22 Sun font from linux

Modern mobile phones typically have high pixel density.
Bootmenu is hardly readable on those with 8x16 font.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agovideo console: allow font size configuration at runtime
Dzmitry Sankouski [Tue, 7 Mar 2023 10:21:16 +0000 (13:21 +0300)]
video console: allow font size configuration at runtime

Allow font size configuration at runtime for console_simple.c
driver. This needed for unit testing different fonts.

Configuring is done by `font` command, also used for font
selection in true type console.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agovideo console: move vidconsole_get_font_size() logic to driver ops
Dzmitry Sankouski [Tue, 7 Mar 2023 10:21:15 +0000 (13:21 +0300)]
video console: move vidconsole_get_font_size() logic to driver ops

Since multiple vidconsole drivers exists, vidconsole_get_font_size()
implementation cannot longer live in vidconsole_uclass.c file.

Move current vidconsole_get_font_size logic to truetype driver ops.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agovideo console: implement multiple fonts configuration
Dzmitry Sankouski [Tue, 7 Mar 2023 10:21:14 +0000 (13:21 +0300)]
video console: implement multiple fonts configuration

This needed for unit testing different fonts.

Configured fonts are placed in an array of fonts.
First font is selected by default upon console probe.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[agust: fixed build error when bmp logo disabled]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
20 months agovideo console: move 8x16 font data in named header
Dzmitry Sankouski [Tue, 7 Mar 2023 10:21:13 +0000 (13:21 +0300)]
video console: move 8x16 font data in named header

Consistent font data header names needed to add new
fonts.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agovideo console: add support for fonts wider than 1 byte
Dzmitry Sankouski [Tue, 7 Mar 2023 10:21:12 +0000 (13:21 +0300)]
video console: add support for fonts wider than 1 byte

Devices with high ppi may benefit from wider fonts.

Current width implementation is limited by 1 byte, i.e. 8 bits.
New version iterates VIDEO_FONT_BYTE_WIDTH times, to process all
width bytes, thus allowing fonts wider than 1 byte.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agovideo console: refactoring and optimization
Dzmitry Sankouski [Tue, 7 Mar 2023 10:21:11 +0000 (13:21 +0300)]
video console: refactoring and optimization

- move common code to vidconsole_internal.h and console_core.c
- unite probe functions
- get rid of code duplications in switch across bpp values
- extract common pixel fill logic in two functions one per
horizontal and vertical filling
- rearrange statements in put_xy* methods in unified way
- replace types - uint*_t to u*

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agoriscv: semihosting: replace inline assembly with assembly file
Andre Przywara [Tue, 7 Feb 2023 15:21:05 +0000 (15:21 +0000)]
riscv: semihosting: replace inline assembly with assembly file

So far we used inline assembly to inject the actual instruction that
triggers the semihosting service. While this sounds elegant, as it's
really only about a few instructions, it has some serious downsides:
- We need some barriers in place to force the compiler to issue writes
  to a data structure before issuing the trap instruction.
- We need to convince the compiler to actually fill the structures that
  we use pointers to.
- We need a memory clobber to avoid the compiler caching the data in
  those structures, when semihosting writes data back.
- We need register arguments to make sure the function ID and the
  pointer land in the right registers.

This is all doable, but fragile and somewhat cumbersome. Since we now
have a separate function in an extra file anyway, we can do away with
all the magic and just write that in an actual assembler.
This is much more readable and robust.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
20 months agoarm: semihosting: replace inline assembly with assembly file
Andre Przywara [Tue, 7 Feb 2023 15:21:04 +0000 (15:21 +0000)]
arm: semihosting: replace inline assembly with assembly file

So far we used inline assembly to inject the actual instruction that
triggers the semihosting service. While this sounds elegant, as it's
really only about one instruction, it has some serious downsides:
- We need some barriers in place to force the compiler to issue writes
  to a data structure before issuing the trap instruction.
- We need to convince the compiler to actually fill the structures that
  we use pointers to.
- We need a memory clobber to avoid the compiler caching the data in
  those structures, when semihosting writes data back.
- We need register arguments to make sure the function ID and the
  pointer land in the right registers.

This is all doable, but fragile and somewhat cumbersome. Since we now
have a separate function in an extra file anyway, we can do away with
all the magic and just write that in an actual assembly file.
This is much more readable and robust.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>