platform/kernel/u-boot-spacemit.git
2 years agobootstd: Provide a bootmeth method to obtain state info
Simon Glass [Sat, 30 Jul 2022 21:52:19 +0000 (15:52 -0600)]
bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Detect empty bootmeth ordering
Simon Glass [Sat, 30 Jul 2022 21:52:18 +0000 (15:52 -0600)]
bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Fix comment in bootmeth test
Simon Glass [Sat, 30 Jul 2022 21:52:17 +0000 (15:52 -0600)]
bootstd: Fix comment in bootmeth test

Correct the comment at the top of this file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Drop delays in the tests
Simon Glass [Sat, 30 Jul 2022 21:52:16 +0000 (15:52 -0600)]
bootstd: Drop delays in the tests

Some tests go as far as booting a distribution. In this case a menu is
presented to the user, with a two-second timeout. This adds a total of
12 seconds to the test runs at present.

Avoid this by inserting a response using the console-recording feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Support sandbox with read interface
Simon Glass [Sat, 30 Jul 2022 21:52:15 +0000 (15:52 -0600)]
dm: core: Support sandbox with read interface

Update the 'read' command to work correctly with sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Add support for writing u32 with ofnode
Simon Glass [Sat, 30 Jul 2022 21:52:14 +0000 (15:52 -0600)]
dm: core: Add support for writing u32 with ofnode

Add a new function to write an integer to an ofnode (live tree or
flat tree).

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Allow writing to a flat tree with ofnode
Simon Glass [Sat, 30 Jul 2022 21:52:13 +0000 (15:52 -0600)]
dm: core: Allow writing to a flat tree with ofnode

In generally it is not permitted to implement an ofnode function only for
flat tree or live tree. Both must be supported. Also the code for
live tree access should be in of_access.c rather than ofnode.c which is
really just for holding the API-conversion code.

Update ofnode_write_prop() accordingly and fix the test so it can work
with flat tree too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Prepare for updating the device tree with ofnode
Simon Glass [Sat, 30 Jul 2022 21:52:12 +0000 (15:52 -0600)]
dm: core: Prepare for updating the device tree with ofnode

Add some documentation and a new flag so that we can safely enabled using
the ofnode interface to write to the device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Tidy up ofnode-writing test
Simon Glass [Sat, 30 Jul 2022 21:52:11 +0000 (15:52 -0600)]
dm: core: Tidy up ofnode-writing test

Update this test to use the livetree flag so that special check can be
avoided. Also drop a few blank lines.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Swap parameters of ofnode_write_prop()
Simon Glass [Sat, 30 Jul 2022 21:52:10 +0000 (15:52 -0600)]
dm: core: Swap parameters of ofnode_write_prop()

It is normal for the length to come after the value in libfdt. Follow this
same convention with ofnode.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Move ofnode-writing test to ofnode
Simon Glass [Sat, 30 Jul 2022 21:52:09 +0000 (15:52 -0600)]
dm: core: Move ofnode-writing test to ofnode

This fits better in the ofnode tests, so move it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Introduce support for multiple trees
Simon Glass [Sat, 30 Jul 2022 21:52:08 +0000 (15:52 -0600)]
dm: core: Introduce support for multiple trees

At present ofnode only works with a single device tree, for the most part.
This is the control FDT used by U-Boot.

When booting an OS we may obtain a different device tree and want to
modify it. Add some initial support for this into the ofnode API.

Note that we don't permit aliases in this other device tree, since the
of_access implementation maintains a list of aliases collected at
start-up. Also, we don't need aliases to do fixups in the other FDT. So
make sure that flat tree and live tree processing are consistent in this
area.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Add a note about how livetree updates work
Simon Glass [Sat, 30 Jul 2022 21:52:07 +0000 (15:52 -0600)]
dm: core: Add a note about how livetree updates work

The unflattening algorithm results in a single block of memory being
allocated for the whole tree. When writing new properties, these are
allocated new memory outside that block. When the block is freed, the
allocated properties remain.

Document how this works and the potential memory leak, as well as
mentioning that updating the livetree is actually supported now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Split out the declaration of ofnode
Simon Glass [Sat, 30 Jul 2022 21:52:06 +0000 (15:52 -0600)]
dm: core: Split out the declaration of ofnode

This is used by a lot of files, but ofnode.h needs to include a lot of
header files. This can create dependency cycles, particularly with
global_data.h which must include various declarations.

Split the core delcarations into a separate file to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Rename structs and functions to avoid VBE
Simon Glass [Sat, 30 Jul 2022 21:52:05 +0000 (15:52 -0600)]
video: Rename structs and functions to avoid VBE

Rename these to VESA, itself an abbreviation, to avoid a conflict with
Verified Boot for Embedded.

Rename this to avoid referencing VBE.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Renname vbe.h to vesa.h
Simon Glass [Sat, 30 Jul 2022 21:52:04 +0000 (15:52 -0600)]
video: Renname vbe.h to vesa.h

We want to use VBE to mean Verfiied Boot for Embedded in U-Boot. Rename
the existing VBE (Vesa BIOS extensions) to allow this.

Verified Boot for Embedded is documented doc/develop/vbe.rst

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovbe: Add some documentation
Simon Glass [Sat, 30 Jul 2022 21:52:03 +0000 (15:52 -0600)]
vbe: Add some documentation

Add a few links to documents about Verified Boot for Embedded (VBE).
These will be expanded as development proceeds.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Fri, 12 Aug 2022 02:20:01 +0000 (22:20 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

2 years agoMerge tag 'dm-pull-9aug22-take2' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Thu, 11 Aug 2022 12:47:20 +0000 (08:47 -0400)]
Merge tag 'dm-pull-9aug22-take2' of https://source.denx.de/u-boot/custodians/u-boot-dm

dtoc fixes with pylint, tests

2 years agospl: opensbi: convert scratch options to config
Nikita Shubin [Mon, 8 Aug 2022 10:28:52 +0000 (13:28 +0300)]
spl: opensbi: convert scratch options to config

Convert hardcoded "opensbi_info.options" to config provided value, this
allows changing options passed to OpenSBI.

SPL_OPENSBI_SCRATCH_OPTIONS is defaulted to SBI_SCRATCH_NO_BOOT_PRINTS.

Link: https://github.com/riscv-software-src/opensbi/blob/master/docs/firmware/fw_dynamic.md
Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agospl: opensbi: fix typo
Nikita Shubin [Mon, 8 Aug 2022 10:24:25 +0000 (13:24 +0300)]
spl: opensbi: fix typo

s/obensbi_info/opensbi_info/

Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agoriscv: ae350: Fix XIP config boot failure
Leo Yu-Chi Liang [Wed, 1 Jun 2022 02:01:49 +0000 (10:01 +0800)]
riscv: ae350: Fix XIP config boot failure

The booting flow is SPL -> OpenSBI -> U-Boot.
The boot hart may change after OpenSBI and may not always be hart0,
so wrap the related branch instruction with M-MODE.

Current DTB setup for XIP is not valid.
There is no chance for CONFIG_SYS_FDT_BASE, the DTB address used
in XIP mode, to be returned. Fix this.

Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
Signed-off-by: Rick Chen <rick@andestech.com>
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agoriscv: cpu: set gp before board_init_f_init_reserve
Nikita Shubin [Fri, 20 May 2022 11:41:17 +0000 (14:41 +0300)]
riscv: cpu: set gp before board_init_f_init_reserve

Restore global pointer before board_init_f_init_reserve call,
as "a0" can be set in harts_early_init call and we end up with
invalid global pointer.

Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agoMerge branch '2022-08-10-assorted-updates'
Tom Rini [Wed, 10 Aug 2022 21:49:20 +0000 (17:49 -0400)]
Merge branch '2022-08-10-assorted-updates'

- An assortment of bugfixes and minor updates

2 years agoboot: allow bootmeth-distro without CONFIG_NET
John Keeping [Thu, 28 Jul 2022 10:19:15 +0000 (11:19 +0100)]
boot: allow bootmeth-distro without CONFIG_NET

Remove the dependency on CMD_PXE from BOOTMETH_DISTRO by introducing a
new hidden kconfig symbol to control whether pxe_utils is compiled,
allowing bootstd's distro method to be compiled without needing
networking support enabled.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Correct build errors when CMD_BOOTM is not enabled:
Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMAINTAINERS: Update e-mail address
Joao Marcos Costa [Sun, 24 Jul 2022 15:13:34 +0000 (17:13 +0200)]
MAINTAINERS: Update e-mail address

Replace former professional address by my personal e-mail.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
2 years agolz4: Fix compile warning comparison of distinct pointer types
Pali Rohár [Wed, 27 Jul 2022 15:24:23 +0000 (17:24 +0200)]
lz4: Fix compile warning comparison of distinct pointer types

In file included from include/linux/bitops.h:22,
                 from include/log.h:15,
                 from include/linux/printk.h:4,
                 from include/common.h:20,
                 from lib/lz4_wrapper.c:6:
lib/lz4_wrapper.c: In function ‘ulz4fn’:
include/linux/kernel.h:184:17: warning: comparison of distinct pointer types lacks a cast
  (void) (&_min1 == &_min2);  \
                 ^~
lib/lz4_wrapper.c:104:18: note: in expansion of macro ‘min’
    size_t size = min((ptrdiff_t)block_size, end - out);
                  ^~~

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoscripts/config: pick config script from kernel scripts
Milan P. Stanić [Wed, 27 Jul 2022 17:09:20 +0000 (19:09 +0200)]
scripts/config: pick config script from kernel scripts

pulled from kernel tag v5.18

2 years agoMakefile: avoid false positive -Wmaybe-uninitialized
Heinrich Schuchardt [Sun, 31 Jul 2022 08:06:13 +0000 (10:06 +0200)]
Makefile: avoid false positive -Wmaybe-uninitialized

When compiling with -Og gcc reports false positive -Wmaybe-uninitialized as
reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394.

Silence these warnings when building with CONFIG_CC_OPTIMIZE_FOR_DEBUG.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocommon: Drop display_options.h from common header
Simon Glass [Sun, 31 Jul 2022 18:28:48 +0000 (12:28 -0600)]
common: Drop display_options.h from common header

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

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopower: regulator: Remove i2c header from gpio regulator
Michal Simek [Mon, 1 Aug 2022 12:19:06 +0000 (14:19 +0200)]
power: regulator: Remove i2c header from gpio regulator

i2c is not used that's why header is not needed.

Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agocmd: inconsistent return type of command_process()
Heinrich Schuchardt [Mon, 1 Aug 2022 13:17:49 +0000 (15:17 +0200)]
cmd: inconsistent return type of command_process()

The declarations in the header and in the implementation must match.

Reported-by: Sergei Antonov <saproj@gmail.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotest: Add some tests for kconfig.h
Simon Glass [Mon, 1 Aug 2022 13:57:59 +0000 (07:57 -0600)]
test: Add some tests for kconfig.h

The macros in this file are a little confusing and we currently have no
tests to check that they work as expected.

Add some tests which check the macros in C code. Add a few tests which
check that the build errors are generated correctly too, using buildman's
-a option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agolmb: Fix LMB_MEMORY_REGIONS flag usage
Patrice Chotard [Tue, 2 Aug 2022 08:21:35 +0000 (10:21 +0200)]
lmb: Fix LMB_MEMORY_REGIONS flag usage

This patch is fixing a broken boot observed on stm32mp157c-dk2 board.

IS_ENABLED macro should be used to check if a compilation flag is set
to "y" or "m".
LMB_MEMORY_REGIONS is set to a numerical value, IS_ENABLED macro is not
suitable in this case.

Fixes: 7c1860fce4e3 ("lmb: Fix lmb property's defination under struct lmb")
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoMakefile: Correct the rule removing old of-platdata files
Simon Glass [Wed, 3 Aug 2022 18:08:29 +0000 (12:08 -0600)]
Makefile: Correct the rule removing old of-platdata files

This makes use of makefile variables that don't exist anymore. Fix it and
also remove the object files in that directory.

Also add FORCE as a dependency as required by the if_changed macro.

Fixes 354d2324635 ("Makefile: Remove old of-platdata files before regenerating")
Reported-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agommc: Do not send status of send_status is false
Marek Vasut [Thu, 14 Jul 2022 23:58:24 +0000 (01:58 +0200)]
mmc: Do not send status of send_status is false

Commit 44645f87de5 ("mmc: Fix mmc_switch excessive timeout") introduced
a side effect where CMD13 SEND_STATUS is issued in case mmc_wait_dat0()
does not return -ENOSYS and $send_status is not set. This happens on all
hardware which does implement .mmc_wait_dat0 callback, e.g. i.MX8M .

This leads to lengthy timeout before booting OS in case of eMMC in one
of the HS200/HS400 modes, since the card cannot respond to CMD13 while
downgrading from HS200/HS400 to regular HS mode.

Fix this by adding the missing conditional.

Fixes: 44645f87de5 ("mmc: Fix mmc_switch excessive timeout")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Kirill Kapranov <kirill.kapranov@compulab.co.il>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Ye Li <ye.li@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agodtoc: Correct remaining pylint problems in test_fdt
Simon Glass [Sun, 31 Jul 2022 02:57:10 +0000 (20:57 -0600)]
dtoc: Correct remaining pylint problems in test_fdt

Fix various camel-case and other naming problems. Update the pylint base
file to avoid regressions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotest_fdt: Convert to use argparse
Simon Glass [Sun, 31 Jul 2022 02:57:09 +0000 (20:57 -0600)]
test_fdt: Convert to use argparse

Drop the deprecated OptionParser.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodtoc: Move main program into its own function
Simon Glass [Sun, 31 Jul 2022 02:57:08 +0000 (20:57 -0600)]
dtoc: Move main program into its own function

Use a function for the main program so everything there doesn't look like
a global variable to pylint.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodtoc: Fix fdt test coverage
Simon Glass [Sun, 31 Jul 2022 02:57:07 +0000 (20:57 -0600)]
dtoc: Fix fdt test coverage

Fix a bug that the --processes option was ignored, thus resulting in no
test coverage information being generated.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 42ae363ddd9 ("dtoc: Update fdt tests to use test_util")

2 years agodtoc: Tidy up fdt_tests RunTests()
Simon Glass [Sun, 31 Jul 2022 02:57:06 +0000 (20:57 -0600)]
dtoc: Tidy up fdt_tests RunTests()

Pass the options args in rather than using the global variables. Use snake
case, fix up comments and use a ternary operator to make pylint happy.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodtoc: Tidy up fdt_tests RunTestCoverage() args
Simon Glass [Sun, 31 Jul 2022 02:57:05 +0000 (20:57 -0600)]
dtoc: Tidy up fdt_tests RunTestCoverage() args

Pass the options args in rather than using the global various. Use snake
case and fix up comments to make pylint happy.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 9 Aug 2022 12:16:14 +0000 (08:16 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mvebu/turris_omina: Misc fixes and improvements (Pali & Marek)
- mvebu: spl: Always fallback to BootROM boot method (Pali)
- mvebu: Cleanup u-boot,dm-pre-reloc code (Pali)
- gpio: Remove mvgpio driver (Chris)
- SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO (Chris)
- misc: atsha204a: Don't check for error when waking up the device (Pali)

2 years agoMerge tag 'u-boot-amlogic-20220809' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 9 Aug 2022 12:14:09 +0000 (08:14 -0400)]
Merge tag 'u-boot-amlogic-20220809' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- fixup error on efuse commands return
- add documentation on boot flow

2 years agomisc: atsha204a: Don't check for error when waking up the device
Pali Rohár [Thu, 4 Aug 2022 11:03:44 +0000 (13:03 +0200)]
misc: atsha204a: Don't check for error when waking up the device

The device ignores any levels or transitions on the SCL pin when the device
is idle, asleep or during waking up.

Linux kernel driver for atsha204a (atmel-sha204a.ko) also ignores return
value from i2c wakeup send command, see:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/crypto/atmel-i2c.c?h=v5.19#n174

And also userspace Turris libatsha204 library ignores return value from
wakeup send command, see:
https://gitlab.nic.cz/turris/libatsha204/-/blob/v29.2/src/libatsha204/layer_ni2c.c#L75-76

U-Boot driver should do same thing.

Fixes waking up ATSHA204 on Turris 1.x boards.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Marek Behún <kabel@kernel.org>
2 years agopci: pci_mvebu: Add support for reset-gpios
Pali Rohár [Fri, 5 Aug 2022 14:03:41 +0000 (16:03 +0200)]
pci: pci_mvebu: Add support for reset-gpios

Release PERST# signal via GPIO when "reset-gpios" is defined in device tree.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm64: a37xx: pinctrl: Improve description for pinmux command
Pali Rohár [Thu, 4 Aug 2022 10:41:56 +0000 (12:41 +0200)]
arm64: a37xx: pinctrl: Improve description for pinmux command

In more cases group name consist of function name followed by function
number. So if function name is just prefix of group name, show group name.

So in 'pinmux status -a' command output would be visible also extended
function number, which is useful for debugging.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm64: a37xx: pinctrl: Remove unused macro PIN_GRP()
Pali Rohár [Thu, 4 Aug 2022 10:41:55 +0000 (12:41 +0200)]
arm64: a37xx: pinctrl: Remove unused macro PIN_GRP()

Macro PIN_GRP() is not used, remove it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm64: a37xx: pinctrl: Fix definitions for MPP pins 20-22
Pali Rohár [Thu, 4 Aug 2022 10:41:54 +0000 (12:41 +0200)]
arm64: a37xx: pinctrl: Fix definitions for MPP pins 20-22

All 3 MPP pins (20, 21 and 22) can be configured individually and also can
be configured to GPIO functions. Fix definitions for these MPP pins in
existing pin groups. After this change GPIO function can be enabled just
for one of these 3 pins.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agogpio: Remove mvgpio driver
Chris Packham [Wed, 3 Aug 2022 23:43:57 +0000 (11:43 +1200)]
gpio: Remove mvgpio driver

The last user of this driver was removed in commit dee08b1999e2 ("arm:
Remove gplugd board"). Remove the unused driver.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Pali Rohár <pali@kernel.org>
2 years agoARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO
Chris Packham [Thu, 4 Aug 2022 09:06:28 +0000 (21:06 +1200)]
ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO

DM_GPIO was already enabled so the MVEBU_GPIO was already available.
Disable KIRKWOOD_GPIO as it was unnecessary.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR
Chris Packham [Thu, 4 Aug 2022 09:06:27 +0000 (21:06 +1200)]
ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR

When booting a fresh board having a random Ethernet address enables
using the network device to program the board.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO
Chris Packham [Thu, 4 Aug 2022 09:06:26 +0000 (21:06 +1200)]
ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO

DM_GPIO was already enabled so the MVEBU_GPIO was already available.
Having updated the board code to use the DM_GPIO APIs the KIRKWOOD_GPIO
driver became unnecessary. Disable it for SBx81LIFKW.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoARM: kirkwood: SBx81LIFKW: enable CMD_GPIO
Chris Packham [Thu, 4 Aug 2022 09:06:25 +0000 (21:06 +1200)]
ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO

For debugging it is convenient to query/access GPIOs from the command
line.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoARM: kirkwood: SBx81LIFKW: update for DM_GPIO
Chris Packham [Thu, 4 Aug 2022 09:06:24 +0000 (21:06 +1200)]
ARM: kirkwood: SBx81LIFKW: update for DM_GPIO

Update mv88e61xx_hw_reset() to use the DM_GPIO API to toggle the reset
line for the linkstreet switch.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers
Chris Packham [Thu, 4 Aug 2022 09:06:23 +0000 (21:06 +1200)]
ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers

Replace code that accessed the GPIO registers directly with code that
makes use of the LED_GPIO driver.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: armada-38x-controlcenterdc.dts: Move u-boot, dm-pre-reloc to -u-boot...
Pali Rohár [Wed, 3 Aug 2022 11:00:53 +0000 (13:00 +0200)]
arm: mvebu: armada-38x-controlcenterdc.dts: Move u-boot, dm-pre-reloc to -u-boot.dtsi

Move U-Boot specific device tree property u-boot,dm-pre-reloc into U-Boot
specific device tree include file armada-38x-controlcenterdc-u-boot.dtsi.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: armada-xp-theadorable.dts: Move u-boot, dm-pre-reloc to -u-boot.dtsi
Pali Rohár [Wed, 3 Aug 2022 11:00:52 +0000 (13:00 +0200)]
arm: mvebu: armada-xp-theadorable.dts: Move u-boot, dm-pre-reloc to -u-boot.dtsi

Move U-Boot specific device tree property u-boot,dm-pre-reloc into U-Boot
specific device tree include file armada-xp-theadorable-u-boot.dtsi.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: Remove redundant u-boot, dm-pre-reloc from all 32-bit Armada SoCs
Pali Rohár [Wed, 3 Aug 2022 11:00:51 +0000 (13:00 +0200)]
arm: mvebu: Remove redundant u-boot, dm-pre-reloc from all 32-bit Armada SoCs

Replace it by including of mvebu-u-boot.dtsi file. When board does not use
-u-boot.dtsi then mvebu-u-boot.dtsi is included automatically by makefile
scripts/Makefile.lib.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: Introduce mvebu-u-boot.dtsi for 32-bit Armada SoCs
Pali Rohár [Wed, 3 Aug 2022 11:00:50 +0000 (13:00 +0200)]
arm: mvebu: Introduce mvebu-u-boot.dtsi for 32-bit Armada SoCs

Set u-boot,dm-pre-reloc for /soc/, /soc/internal-regs/ and &uart0 nodes as
it is required on every 32-bit Armada SoCs. And set also u-boot,dm-pre-reloc
for &spi0 when going to boot from SPI because otherwise SPL SPI drivers do
not load.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: dts: Build only arch-compatible dts files
Pali Rohár [Fri, 5 Aug 2022 11:37:25 +0000 (13:37 +0200)]
arm: mvebu: dts: Build only arch-compatible dts files

64-bit Armada DTS files are not build correctly during compilation of
32-bit Armada boards and vice versa. So fix makefile build system to
compile only those dts files which are compatible for the current build
(64-bit Armada DTS files only for 64-bit builds and 32-bit Armada DTS files
only for 32-bit builds).

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: turris_omnia: Add Winbond SPI flash support
Marek Behún [Wed, 3 Aug 2022 08:53:12 +0000 (10:53 +0200)]
arm: mvebu: turris_omnia: Add Winbond SPI flash support

Some new Omnia boards will come with Winbond SPI flash. Add to
defconfig.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: spl: Always fallback to BootROM boot method
Pali Rohár [Tue, 2 Aug 2022 09:55:19 +0000 (11:55 +0200)]
arm: mvebu: spl: Always fallback to BootROM boot method

BootROM boot method should always work so always add it as fallback method
to spl_boot_list. In case U-Boot SPI driver fails it is better to try using
BootROM than hanging as by default only one boot method is specified.

Signed-off-by: Pali Rohár <pali@kernel.org>
Tested-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: turris_omnia: Remove hardcoded spi-nor device tree path
Pali Rohár [Mon, 1 Aug 2022 21:58:42 +0000 (23:58 +0200)]
arm: mvebu: turris_omnia: Remove hardcoded spi-nor device tree path

Linux kernel DTS files renamed spi-nor@0 node to flash@0 which effectively
broke U-Boot to boot new Linux kernel versions correctly.

So remove hardcoded spi-nor device tree path from Turris Omnia board code
and replace it by searching for mtd node by compatible string.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agogpio: turris_omnia_mcu: Fix usage of CMD_EXT_CONTROL
Pali Rohár [Mon, 1 Aug 2022 10:11:13 +0000 (12:11 +0200)]
gpio: turris_omnia_mcu: Fix usage of CMD_EXT_CONTROL

CMD_GENERAL_CONTROL takes two 8-bit arguments but CMD_EXT_CONTROL takes
two 16-bit arguments. Fix this issue and change CMD_EXT_CONTROL arguments
to 16-bit.

Fixes: 5e4d24ccc115 ("gpio: Add Turris Omnia MCU driver")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
Pali Rohár [Mon, 1 Aug 2022 10:02:20 +0000 (12:02 +0200)]
arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions

Sometimes fixup_mtd_partitions() prints during booting kernel error
"Failed fixing SPI NOR partitions!" because it does not have enough space
for creating all paritions nodes. So increase fdt size.

Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Marek Behún <kabel@kernel.org>
2 years agoarm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do...
Pali Rohár [Mon, 1 Aug 2022 10:02:19 +0000 (12:02 +0200)]
arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist

All partitions are created by fixup_mtd_partitions() function, so they do
not have to exist just for their removal need.

Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Marek Behún <kabel@kernel.org>
2 years agoarm: mvebu: turris_omnia: Add support for design with SW reset signals
Pali Rohár [Fri, 29 Jul 2022 11:29:07 +0000 (13:29 +0200)]
arm: mvebu: turris_omnia: Add support for design with SW reset signals

New Turris Omnia HW board revision requires that software controls
peripheral reset signals, namely PERST# signals on mPCIe slots, ethernet
phy reset and lan switch reset. Those pins are connected to MCU controlled
by MCU i2c API as GPIOs. On new HW board revision those pins stay in reset
after board reset and software has to release these peripherals from reset
manually. MCU announce this requirement by FEAT_PERIPH_MCU bit in
CMD_GET_FEATURES command.

On older HW board revisions when FEAT_PERIPH_MCU is not announced, all
those reset signals are automatically released after board finish reset.

Detect FEAT_PERIPH_MCU bit in board_fix_fdt() and ft_board_setup()
functions and insert into device tree blob pcie "reset-gpios" and eth phy
"phy-reset-gpios" properties with corresponding MCU gpio definitions.
PCIe and eth PHY drivers then automatically release resets during device
initialization. Both U-Boot and Linux kernel drivers support those device
tree reset properties.

Initialization of lan switch on new HW board revision is more complicated.
Switch strapping pins are shared with switch RGMII pins. And strapping pins
must be in specific configuration after releasing switch reset. Due to pin
sharing, it is first required to switch A385 side of switch pins into GPIO
mode, set strapping configuration, release switch from reset and after that
switch A385 pins back to RGMII mode.

Because this complicated setup is not supported by switch DSA drivers and
cannot be expressed easily in device tree, implement it manually in SPL
function spl_board_init(). So in proper U-Boot and OS/kernel would be lan
switch initialized and be in same configuration like it was on old HW board
revisions (where reset sequence did those steps at hardware level).

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Marek Behún <kabel@kernel.org>
2 years agoarm: mvebu: turris_omnia: Show MCU type in show_board_info()
Pali Rohár [Fri, 29 Jul 2022 11:29:06 +0000 (13:29 +0200)]
arm: mvebu: turris_omnia: Show MCU type in show_board_info()

Different Turris Omnia HW board revisions contains different MCU.
Show type in show_board_info() to easily identify which MCU is populated.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Marek Behún <kabel@kernel.org>
2 years agoPrepare v2022.10-rc2
Tom Rini [Tue, 9 Aug 2022 00:35:53 +0000 (20:35 -0400)]
Prepare v2022.10-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-08-08-networking-updates'
Tom Rini [Mon, 8 Aug 2022 19:04:56 +0000 (15:04 -0400)]
Merge branch '2022-08-08-networking-updates'

After checking with Ramon, take a number of reviewed network patches.
This includes:

- A number of dwc_eth_qos updates, mpc8xx_fec DM migration, NPCM7xx EMAC
  driver.
- Other assorted minor updates

2 years agonet: dwc_eth_qos: Add eqos_get_enetaddr callback for stm32
Patrice Chotard [Tue, 2 Aug 2022 08:55:26 +0000 (10:55 +0200)]
net: dwc_eth_qos: Add eqos_get_enetaddr callback for stm32

Add .eqos_get_enetaddr callback defined as eqos_null_ops() to avoid
illegal access.

Fixes: a624251461bf ("net: dwc_eth_qos: introduce eqos hook eqos_get_enetaddr")

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dwc_eth_qos: Add eqos_get_enetaddr callback for tegra186
Patrice Chotard [Tue, 2 Aug 2022 08:55:25 +0000 (10:55 +0200)]
net: dwc_eth_qos: Add eqos_get_enetaddr callback for tegra186

Add .eqos_get_enetaddr callback defined as eqos_null_ops() to avoid
illegal access.

Fixes: a624251461bf ("net: dwc_eth_qos: introduce eqos hook eqos_get_enetaddr")

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoARM: dts: uniphier: Change phy-mode to RGMII-ID to enable delay pins
Kunihiko Hayashi [Wed, 13 Jul 2022 01:59:45 +0000 (10:59 +0900)]
ARM: dts: uniphier: Change phy-mode to RGMII-ID to enable delay pins

UniPhier LD20, PXs2 and PXs3 boards have ethernet phy that has RX/TX delays
of RGMII interface using pull-ups on the RXDLY and TXDLY pins.

So should set the phy-mode to "rgmii-id" to show that RX/TX delays are
enabled.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: ave: Add capability of rgmii-id mode
Kunihiko Hayashi [Wed, 13 Jul 2022 01:59:44 +0000 (10:59 +0900)]
net: ave: Add capability of rgmii-id mode

This allows you to specify the type of rgmii-id that will enable phy
internal delay in ethernet phy-mode.

This adds all RGMII cases to all of get_pinmode() except LD11, because LD11
SoC doesn't support RGMII due to the constraint of the hardware. When RGMII
phy mode is specified in the devicetree for LD11, the driver will abort
with an error.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: phy: possible NULL dereference in fixed_phy_create()
Heinrich Schuchardt [Mon, 11 Jul 2022 17:40:13 +0000 (19:40 +0200)]
net: phy: possible NULL dereference in fixed_phy_create()

We check if phydev is NULL. Only but if it is non-NULL we set one
component of phydev. But even if it is NULL we set another. We should not
dereference NULL in either case.

Fixes: e24b58f5ed4f ("net: phy: don't require PHY interface mode during PHY creation")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Marek Behún <kabel@kernel.org>
2 years agonet: dwc_eth_qos: cosmetic: reorder include files
Patrick Delaunay [Thu, 30 Jun 2022 09:09:41 +0000 (11:09 +0200)]
net: dwc_eth_qos: cosmetic: reorder include files

Reorder include files in the U-Boot expected order.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: phy: Remove inline definitions from convinience functions
Ramon Fried [Sun, 5 Jun 2022 00:44:15 +0000 (03:44 +0300)]
net: phy: Remove inline definitions from convinience functions

The convinience functions are not that small and they caused
bloated text segments because of their usage.
There was no need to inline them in the first place, as
they're not part of a fastpath.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2 years agonet: ftgmac100: use bus name in mdio error messages
Zev Weiss [Tue, 17 May 2022 22:16:39 +0000 (15:16 -0700)]
net: ftgmac100: use bus name in mdio error messages

Previously we'd been using a device name retrieved via
ftgmac100_data->phydev, but the mdio read/write functions may be
called before that member is initialized in ftgmac100_phy_init(),
leading to a NULL pointer dereference while printing the error message
issued if the mdio access fails.  We can instead use bus->name, which
is already available at that point.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Fixes: 538e75d3fc54 ("net: ftgmac100: add MDIO bus and phylib support")
Reviewed-by: Cédric Le Goater <clg@kaod.org>
2 years agonet: nuvoton : Add NPCM7xx EMAC driver
Jim Liu [Tue, 17 May 2022 08:28:11 +0000 (16:28 +0800)]
net: nuvoton : Add NPCM7xx EMAC driver

NPCM750 provides identical ethernet MAC controllers for WAN/LAN applications.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: mpc8xx_fec: Migrate to DM_ETH
Christophe Leroy [Thu, 12 May 2022 13:48:51 +0000 (15:48 +0200)]
net: mpc8xx_fec: Migrate to DM_ETH

Migrate mpc8xx_fec driver to DM_ETH.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dwc_eth_qos: remove use of DWC_NET_PHYADDR
Rasmus Villemoes [Thu, 12 May 2022 07:33:07 +0000 (09:33 +0200)]
net: dwc_eth_qos: remove use of DWC_NET_PHYADDR

Only two boards in the tree set the macro DWC_NET_PHYADDR. Both have
CONFIG_DM_ETH_PHY=y, so should set the phy address in DT if necessary.

The imx8mp_evk does set the correct address in device tree.

The other board seems to be a copy-paste-adapt from an old
version of the imx8mp_evk config header, given the "#ifdef
CONFIG_DWC_ETH_QOS" block that has been removed from imx8mp_evk header
in commit 127fb454955. Its device tree doesn't even enable (i.e., set
'status = "okay"') the &eqos node. But the other ethernet device,
&fec, does get enabled, and does have a phy sitting at address 4 (and
it also has a corresponding legacy #define CONFIG_FEC_MXC_PHYADDR
4). So I believe it should be completely safe to remove it from there
as well.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Re-apply to top of tree, update imx93_evk.h]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: dwc_eth_qos: lift parsing of max-speed DT property to common code
Rasmus Villemoes [Wed, 11 May 2022 14:58:41 +0000 (16:58 +0200)]
net: dwc_eth_qos: lift parsing of max-speed DT property to common code

I have an iMX8MP with a ti,dp83867 phy in front of the eqos
interface. The phy is Gbit capable - however, the C and D differential
pairs are not physically routed to the RJ45 connector. So I need to
prevent the phy from advertising 1000Mbps.

The necessary code is almost already there in the form of a
phy_set_supported() call in eqos_start(), but the max-speed DT
property is currently only parsed in
eqos_probe_resources_stm32(). Lift that parsing to eqos_probe().

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dwc_eth_qos: fix double resource leak in eqos_remove()
Rasmus Villemoes [Wed, 11 May 2022 14:12:50 +0000 (16:12 +0200)]
net: dwc_eth_qos: fix double resource leak in eqos_remove()

Not only does eqos_remove() fail to free the buffers that have been
allocated by eqos_probe_resources_core(), it repeats those allocations
and thus drops twice as much memory on the floor.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Correctly handle empty FIFO
Marek Vasut [Mon, 25 Apr 2022 18:28:05 +0000 (20:28 +0200)]
net: dm9000: Correctly handle empty FIFO

Assign packet pointer only in case the MAC reports anything in the FIFO.
In case the MAC indicates empty FIFO, return 0 to pass that information
to the network stack.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: phy: marvell: Add support for 88E1240 PHY
Stefan Roese [Thu, 31 Mar 2022 09:43:07 +0000 (11:43 +0200)]
net: phy: marvell: Add support for 88E1240 PHY

This patch adds basic support for the Marvell 88E1240 PHY.

This will be used by the upcoming ethernet support addition for the
Marvell MIPS Octeon EBB7304 platform.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agonet: phy: marvell: Support reg config via "marvell, reg-init" DT property
Stefan Roese [Thu, 31 Mar 2022 09:43:06 +0000 (11:43 +0200)]
net: phy: marvell: Support reg config via "marvell, reg-init" DT property

This patch adds support for the "marvell,reg-init" DT property, which
is used to describe board specific Marvell PHY register configurations
in the board dts file. This DT property is supported in the Linux Kernel
since a longer time. Adding it to U-Boot now, enables the boards which
describe the register settings in their DT files here as well.

I've included calling this marvell_of_reg_init() to all foo_config()
functions in this patch as well. If CONFIG_DM_ETH is not set, there is
no ofnode, or no "marvell,reg-init" property, the PHY initialization is
unchanged.

The function marvell_of_reg_init() is a port of the Linux version.
Please note that I explicitly did not add error checking and handling
to the U-Boot version, as this is basically not done for phy_read/write
in this Marvell PHY code.

This will be used by the upcoming ethernet support on the MIPS
Octeon EBB 7304 board.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agonet: bootp: Make root path (option 17) length configurable
Andre Kalb [Fri, 28 Jan 2022 08:40:32 +0000 (09:40 +0100)]
net: bootp: Make root path (option 17) length configurable

to adjust the root path length.
Eg to 256 from Linux Kernel

Signed-off-by: Andre Kalb <andre.kalb@sma.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Guard extern so that !CONFIG_NET platforms will build]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoARM: meson: fixup error on efuse commands return
Jerome Brunet [Thu, 4 Aug 2022 14:41:38 +0000 (16:41 +0200)]
ARM: meson: fixup error on efuse commands return

All `sm efuseread/efusewrite` commands exit with an error, even if the fuse
have actually been dealt with correctly.

This is because the smc call return the size it actually processed but this
result is checked against 0.

Return failure in do_efuse_read/write if the return value of
meson_sm_read/write_efuse() is not the requested size.

Fixes: 52195ba5f579 ("ARM: amlogic: add sm efuse write support and cmd for read/write efuse")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220804144138.33809-1-jbrunet@baylibre.com
2 years agoMerge branch '2022-08-05-buildman-integrate-boardscfg'
Tom Rini [Fri, 5 Aug 2022 17:22:44 +0000 (13:22 -0400)]
Merge branch '2022-08-05-buildman-integrate-boardscfg'

To quote Simon:
This series drops the need for the genboardscfg.py script, so that the
boards.cfg file is produced (and consumed) entirely within buildman. The
file is not entirely removed since it does have some uses and we need some
sort of cache for the information. The genboardscfg.py script is
effectively incorporated in buildman.

It also improves operation from an IDE with a new -I option and fixes up
some of the pylint warnings in buildman.

Finally, this series also fixes a bug which allows use to drop support for
CONFIG_SYS_EXTRA_OPTIONS which is long-standing desire. It also fixes a
minor bug that causes 'Invalid line' spam when checking for function bloat
with the -B option.

2 years agobuildman: Drop a TODO that is done
Simon Glass [Tue, 12 Jul 2022 01:04:13 +0000 (19:04 -0600)]
buildman: Drop a TODO that is done

Buildman now uses worktrees when available, instead of doing a full clone.
This was done in this commit:

   76de29fc4f buildman: Use git worktrees instead of git clones when possible

Drop the TODO.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobuildman: Drop a Python 2.7 comment
Simon Glass [Tue, 12 Jul 2022 01:04:12 +0000 (19:04 -0600)]
buildman: Drop a Python 2.7 comment

This is well out of date, but it is still reasonable to use a list. Drop
the comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobuildman: Allow lines without a symbol
Simon Glass [Tue, 12 Jul 2022 01:04:11 +0000 (19:04 -0600)]
buildman: Allow lines without a symbol

The 'nm' tool can produce lines without a symbol, for example:

   00000004 t

Silently skip these and anything else without three fields. Drop the
warning since there is nothing the user can do about it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
2 years agoDrop genboardscfg.py
Simon Glass [Tue, 12 Jul 2022 01:04:10 +0000 (19:04 -0600)]
Drop genboardscfg.py

Now that buildman can generate this with the -R option, drop the script.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
2 years agogitlab/azure: Use buildman instead of genboardscfg
Simon Glass [Tue, 12 Jul 2022 01:04:09 +0000 (19:04 -0600)]
gitlab/azure: Use buildman instead of genboardscfg

Use the equivalent buildman functionality to check maintainer info.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agobuildman: Return an error if there are maintainer warnings
Simon Glass [Tue, 12 Jul 2022 01:04:08 +0000 (19:04 -0600)]
buildman: Return an error if there are maintainer warnings

Detect warnings about missing maintain info and return result code 2 in
that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoRevert "Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support""
Simon Glass [Tue, 12 Jul 2022 01:04:07 +0000 (19:04 -0600)]
Revert "Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support""

This is not needed now that CONFIG_SYS_TARGET_NAME is correctly determined
when scanning Kconfig.

This reverts commit 25b8acee2ea11a9edc100c42a61f5d6187eb6167.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agobuildman: Replace the Options column with config name
Simon Glass [Tue, 12 Jul 2022 01:04:06 +0000 (19:04 -0600)]
buildman: Replace the Options column with config name

This appears in boards.cfg but we want to remove it. Drop support for
generating it and reading it. Detect an old boards.cfg file that has
this field and regenerate it, to avoid problems.

Instead, add the config name in that place. This fixes a subtle bug in
the generation code, since it uses 'target' for the config name and then
overwrites the value in scan() by setting params['target'] to the name
of the defconfig. The defconfig name is not the same as the
SYS_CONFIG_NAME variable.

With this change, we still have the config name and it can be searched
by buildman, e.g. with:

   buildman -nv sun5i

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
2 years agobuildman: Tidy up pylint problems in boards module
Simon Glass [Tue, 12 Jul 2022 01:04:05 +0000 (19:04 -0600)]
buildman: Tidy up pylint problems in boards module

Fix all the pylint warnings. Also tidy up the comments so that they show
type information, as required.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobuildman: Incorporate the genboardscfg.py tool
Simon Glass [Tue, 12 Jul 2022 01:04:04 +0000 (19:04 -0600)]
buildman: Incorporate the genboardscfg.py tool

Bring this tool into buildman, so we don't have to run it separately. The
board.cfg file is still produced as part of the build, to save time when
doing another build in the same working directory. If it is out of date
with respect to the Kconfig, it is updated.

Time to regenerate on a recent single-thread machine is 4.6s (1.3s on a
32-thread machine), so we do need some sort of cache if we want buildman
to be useful on incremental builds. We could use Python's pickle format
but:

- it seems useful to allow boards.cfg to be regenerated, at least for a
  while, in case other tools use it
- it is possible to grep the file easily, e.g. to find boards which use
  a particular SoC (similar to 'buildman -nv <soc>'

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>