aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-11-28Merge tag 'dm-pull-28nov21' of ↵WIP/28Nov2021Tom Rini32-69/+670
https://source.denx.de/u-boot/custodians/u-boot-dm into next SPI flash documentation and tidy-ups Various driver model enhancements Fix up some missing unit tests with pytest
2021-11-28test/py: Raise a ValueError if a command failsSimon Glass1-1/+1
At present an Exception is raised if a command fails. This is a very broad class and makes it difficult for callers to catch the error without also catching other things, like programming bugs. Change it to ValueError to make this easier. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28test/py: Relax the naming rules for unit testsSimon Glass1-1/+1
At present the collection function used by pytest is quite strict on the naming of the functions it detects. In particular it requires the name of the test to be repeated in the function name. This is not enforced anywhere else, but instead the tests are silently omitted from the pytest run. This affects a few dozen tests. The rule does not seem to have any particular purpose. Relax it, so that all tests that use the UNIT_TEST() macro will run, regardless of the name of the test function. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28sandbox: Enable HEXDUMP for sandbox_flattreeSimon Glass1-0/+1
At present the hexdump tests are disabled in sandbox_flattree. This is good, because they do not pass. Enable the required Kconfig so that they will, when enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28dm: core: Add a way to count the devices in a uclassSimon Glass2-0/+20
Add a function that returns the number of devices in a uclass. This can be helpful in sizing an array that needs to hold a list of them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28dm: core: Allow finding children / uclasses by partial nameSimon Glass4-5/+38
In some cases it is useful to search just by a partial name, such as when looking for a sibling device that has a common name substring. Add helper functions to handle these requirements. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28dm: core: Add a way to obtain a string listSimon Glass5-0/+100
At present we support reading a string list a string at a time. Apart from being inefficient, this makes it impossible to separate reading of the devicetree into the of_to_plat() method where it belongs, since any code which needs access to the string must read it from the devicetree. Add a function which returns the string property as an array of pointers to the strings, which is easily used by clients. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28dm: core: Fix up string-function documentationSimon Glass2-3/+4
The details for of_property_read_string_helper() and ofnode_read_string_index() are a little inaccurate. Fix up the comments to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28dm: core: Fix handling of uclass pre_unbind methodSimon Glass3-6/+25
This method is currently called after the platform data has been freed. But the pre_unbind() method may wish to access this, e.g. to free some data structures stored there. Split the unbinding of devices into two pieces, as is done with removal. This corrects the problem. Also tidy a code-style issue in device_remove() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28dm: core: Add tests for stringlist functionsSimon Glass2-0/+77
These functions currently lack tests so add some. The error handling differs betwee livetree and flattree at present, so only check the error codes with livetree. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28common: Allow a smaller console-recording pre-relocSimon Glass2-1/+13
Before relocation there is generally not as much available memory and not that much console output. At present the console-output buffer is the same side before and after relocation. Add a separate Kconfig option to remove this limitation. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28disk: part_dos: Fix a NULL pointer errorSimon Glass1-4/+6
When ext is NULL we cannot dereference it. Update the code flow to avoid this, so that layout_mbr_partitions() can be used with partition tables that do not include an extended partition. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28mbr: Correct verification checkSimon Glass1-4/+4
At present this command considers the partitions to be identical if the start and size are smaller than expected. It should check that they are the same. Fix this and tidy up the code style a little. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-28mmc: Allow for children other than the block deviceSimon Glass1-2/+2
At present the MMC uclass assumes that the only child it can have is a block device. Update this so we can add a bootmethod too. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28sandbox: mmc: Support a backing fileSimon Glass2-9/+69
Provide a way for sandbox MMC to present data from a backing file. This allows a filesystem to be created on the host and easily served via an emulated mmc device. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28sandbox: Support unmapping a fileSimon Glass2-0/+19
Add the opposite of mapping, so that we can unmap and avoid running out of address space. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28test/py: Allow passing input to a programSimon Glass2-5/+8
When running a program on the host, allow input to be passed in as stdin. This is needed for running sfdisk, for example. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-28binman: Fix extract command for using non-absolute image pathsJan Kiszka1-0/+1
Otherwise the updated image will end up in the temporary folder that is purged after completion. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-28sf: doc: Add documentation for the 'sf' commandSimon Glass2-0/+246
This command is fairly complicated so documentation is useful. Unfortunately I an not sure how the MTD side of things works and cannot find information about that. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-28sf: Tidy up code to avoid #ifdefSimon Glass1-17/+13
Update this code to use IS_ENABLED() instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2021-11-28sf: Use const for the stage nameSimon Glass1-1/+1
This is not updated at runtime so should be marked const. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-28command: Use a constant pointer for the helpSimon Glass1-1/+1
This text should never change during execution, so it makes sense to use a const char * so that it can be declared as const in the code. Update struct cmd_tbl with a const char * pointer for 'help'. We cannot make usage const because of the bmode command, used on mx53ppd for example. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-28env: Avoid using GNU features in awkSimon Glass1-9/+20
GNU has a very useful third argument to match() but this is not supported in the POSIX awk. Update the code to cope, so that the script is POSIX-compliant. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Mark Kettenis <mark.kettenis@xs4all.nl>
2021-11-23Merge branch '2021-11-23-scmi-and-tee-updates' into nextTom Rini14-44/+399
- A set of SCMI and TEE related updates
2021-11-23firmware: scmi: Add OP-TEE transportWIP/2021-11-23-scmi-and-tee-updatesEtienne Carriere3-2/+323
This change implements an SCMI transport for agent interfacing the OP-TEE SCMI service. OP-TEE provides an SCMI PTA (Pseudo-TA) for non-secure world to send SCMI messages over an identified channel. The driver implemented here uses a SMT shared memory for passing messages between client and server. The implementation opens and releases channel resources for each passed SCMI message so that resources allocated (sessions) or registered (shared memory areas) in OP-TEE firmware are released for example before relocation as the driver will likely allocate/register them back when probed after relocation. The integration of the driver using dedicated config switch CONFIG_SCMI_AGENT_OPTEE is designed on the model posted to the U-Boot ML by Patrick Delaunay [1]. Link: [1] https://lore.kernel.org/all/20211028191222.v3.4.Ib2e58ee67f4d023823d8b5404332dc4d7e847277@changeid/ Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-11-23dt-bindings: arm: scmi: OP-TEE as transport channel for SCMI messagesEtienne Carriere1-6/+9
Introduce compatible "linaro,scmi-optee" for SCMI transport channel based on an OP-TEE service invocation. Define "linaro,optee-channel-id" property to identify the OP-TEE SCMI channel used by the protocol(s). OP-TEE SCMI transport can either use shared memory or a static shared memory buffer identified by the DT. These bindings were posted to the Linux kernel DT bindings mailing list and acked by maintainer [1]. Link: [1] https://lore.kernel.org/linux-arm-kernel/20211029102118.GG6526@e120937-lin/T/ Cc: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2021-11-23tee: optee: define TEE error code TEE_ERROR_SHORT_BUFFEREtienne Carriere1-0/+1
Adds TEE_ERROR_SHORT_BUFFER as TEE error code. This error code is commonly used by TEEs to inform caller that the buffer(s) it provided is too small for the desired operation. Cc: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2021-11-23tee: optee: remove unused duplicated login Id macrosEtienne Carriere1-11/+1
Remove unused OPTEE_MSG_LOGIN_* ID macros as suitable TEE_LOGIN_* ID macros are already defined tee.h. Cc: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2021-11-23tee: define session login identifiersEtienne Carriere1-2/+21
Define identifiers for clnt_login field in struct tee_open_session_arg based in GlobalPlatform Device TEE IDs and on the REE_KERNEL identifier extension from OP-TEE OS. Cc: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
2021-11-23firmware: scmi: smccc transport: simplify probe sequenceEtienne Carriere1-4/+2
Minor simplification in scmi_smccc_probe() exit sequence. Cc: Simon Glass <sjg@chromium.org> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-11-23firmware: scmi: smccc transport: use plat data, not priv dataEtienne Carriere1-5/+5
Change SCMI smccc transport drivers to use platform data rather than private data for channel reference since it only stores platform data retrieved from the DT. Consequently the probe handler is replaced with a of_to_plat handler. Cc: Simon Glass <sjg@chromium.org> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-11-23firmware: scmi: mailbox transport: use plat data, not priv dataEtienne Carriere1-5/+5
Change SCMI mailbox transport drivers to use platform data rather than private data for channel reference since it only stores platform data retrieved from the DT. Consequently the probe handler is replaced with a of_to_plat handler. Cc: Simon Glass <sjg@chromium.org> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-11-23firmware: scmi: mailbox transport: fix probe failure implementationEtienne Carriere1-5/+1
Correct scmi mailbox probe function that can't free the scmi channel instance since its auto-allocated by the device model framework. Cc: Simon Glass <sjg@chromium.org> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-11-23firmware: scmi: fix description of an API functionEtienne Carriere1-2/+2
Correct inline comment describing API function devm_scmi_process_msg(). Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-11-23stm32mp15: deactivate CONFIG_SCMI_AGENT_MAILBOXPatrick Delaunay2-0/+2
Deactivate the SCMI agent mailbox which is not used on STM32MP15 platforms. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2021-11-23firmware: scmi: add configs to select the supported agentsPatrick Delaunay2-2/+18
Add two configs CONFIG_SCMI_AGENT_MAILBOX and CONFIG_SCMI_AGENT_SMCCC to select the supported agents as all the agents are not supported. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2021-11-23power: regulator: scmi: define LOG_CATEGORYPatrick Delaunay1-0/+3
Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-11-23clk: scmi: define LOG_CATEGORYPatrick Delaunay1-0/+3
Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2021-11-23reset: scmi: define LOG_CATEGORYPatrick Delaunay1-0/+3
Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2021-11-23Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-net ↵WIP/23Nov2021Tom Rini22-52/+3854
into next - Various DSA additions - bootp: fix for VCI string - tsec: support for promiscuous mode - add Aspeed MDIO driver
2021-11-23net: phy: realtek: Add tx/rx delay config for 8211eSamuel Holland3-37/+43
Some boards need to change the tx/rx delay config in order for gigabit Ethernet to work. In Linux commit bbc4d71d6354 ("net: phy: realtek: fix rtl8211e rx/tx delay config"), Realtek documented the bits for overriding the delays from the hardware straps. Copy the logic from linux, so the delay config is set from the PHY's interface type (the phy-mode property in the device tree). This removes the need for a one-off workaround for the Pine A64+ board. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23drivers: net: add Aspeed MDIO driverDylan Hung3-0/+136
Add a driver for the MDIO interface for Aspeed AST2600 SOC. The driver only supports clause 22 for now. Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Ryan Chen <ryan_chen@aspeedtech.com>
2021-11-23net: tsec: Make redundant_init() staticBin Meng1-1/+1
redundant_init() is only called in the tsec driver. Make it static. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23net: fec_mxc: Declare 'promisc' as boolBin Meng1-1/+1
priv->promisc is used as the parameter of the set_promisc() call which accepts a bool type instead of char. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23net: dsa: Use true instead of 1 in the set_promisc() callBin Meng1-1/+1
set_promisc() call accepts the parameter of a bool type. Make it clear by using true instead of 1. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23cmd: pxe_utils: Check fdtcontroladdr in label_bootPeter Hoyes2-2/+8
If using OF_CONTROL, fdtcontroladdr is set to the fdt used to configure U-Boot. When using PXE, if no fdt is defined in the menu file, and there is no fdt at fdt_addr, add fall back on fdtcontroladdr too. We are developing board support for the Armv8r64 FVP using config_distro_bootcmd. We are also using OF_BOARD and would like the PXE boot option to default to the fdt provided by board_fdt_blob_setup. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23net: bootp: Correct VCI string transmissionWalter Stoll1-1/+1
The VCI string sent during bootp of U-Boot-SPL is corrupt. This is because the byte counter is not adjusted within the bootp_extended() function when the VCI string is added. We fix this. Signed-off-by: Walter Stoll <walter.stoll@duagon.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-23configs: ls1021a-tsn: enable the generation of random Ethernet MAC addressesVladimir Oltean2-0/+2
Don't fail when booting a board with an empty EEPROM for MAC addresses. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-11-23configs: ls1021a-tsn: enable sja1105 switch driverVladimir Oltean2-0/+4
The sja1105 is a 5-port switch that uses a DM_DSA driver. Its 5th (CPU) port is connected internally to the eth2 port of the LS1021A SoC. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-11-23arm: dts: ls1021a-tsn: add sja1105 and eth2 bindingsVladimir Oltean1-0/+103
The eth aliases are for correct probing order, so that each Ethernet port will get a predictable MAC address from the environment. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>