summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-11-23net: dsa: Use true instead of 1 in the set_promisc() callBin Meng
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 Hoyes
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 Stoll
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 Oltean
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 Oltean
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 Oltean
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>
2021-11-23net: dsa: sja1105: add support for SGMIIVladimir Oltean
The list of ports which support SGMII depending on switch generation is available here: https://www.kernel.org/doc/html/latest/networking/dsa/sja1105.html#port-compatibility-matrix SGMII can either be used to connect to an external PHY or to the host port. In the first case, the use of in-band autoneg is expected, in the last, in-band autoneg is expected to be turned off (fixed-link). So the driver supports both cases. SGMII support means configuring the PCS and PMA. The PCS is a Synopsys Designware XPCS, in Linux this has a separate driver but here it is embedded within the sja1105 driver. If needed it can be taken out later, although we would need a UCLASS_PCS for it, which we don't have atm. Nonetheless, I did go all the way to export an internal MDIO bus for PCS access, because it is nice to be able to debug the PCS through commands such as: => mdio read ethernet-switch@1-pcs 4 1f.0 Reading from bus ethernet-switch@1-pcs PHY at address 4: 31.0 - 0x1140 The internal MDIO bus is not registered with DM because there is no udevice on it, as mentioned. But the XPCS code can still be ripped out, as needed. I did not add support for 2500base-x because I do not expect this interface type to be used as a boot source for anybody, it would just add unnecessary bloat. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23net: dsa: add driver for NXP SJA1105 L2 switchVladimir Oltean
The SJA1105 driver is largely reused from Linux. Its programming model is that it is blank out of reset, and it waits for a static configuration stream over SPI, which contains all runtime parameters (it has no notion of "default values"). Keeping a binary array for the configuration stream would have meant that aspects such as the CPU port and the MAC speeds could have not been configured easily, and would have been static and board-dependent. Live-patching the binary array means recalculating the static config table CRCs, which is not a fun process. So we create an abstraction over the static config tables, using the packing API, same as in Linux. The tables are kept as C structures, and the binary configuration stream is constructed on-the-go, with CRC and all. All static config tables instantiated in this driver are mandatory. The hardware reference manual can be found at: https://www.nxp.com/docs/en/user-guide/UM10944.pdf For tagging, a simplified version of tag_8021q from Linux is used. The VLAN EtherType is the same (0xdadb) but since we don't want switching in U-Boot, there is no reason to have a TX VLAN and an RX VLAN for each port. We just need the RX VLANs to act as the unique pvid of each front-panel port, to decode the switch port number. The RX VLAN is used for both RX and TX. The device tree bindings are the same as in Linux. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23net: dsa: felix: configure the in-band autoneg property based on OF node infoVladimir Oltean
Instead of trying to guess which operating modes need in-band negotiation to be active and which ones don't, parse the available information from the device tree. That will be correct in the cases we can already guess, and more. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23net: introduce a helper to determine whether to use in-band autonegVladimir Oltean
Certain serial SERDES protocols like 1000base-x, 2500base-x, SGMII, USXGMII can operate either in a mode where the PHY (be it on-board or inside an SFP module) passes the link parameters (speed, duplex, pause) to the MAC through in-band through control words standardized by IEEE 802.3 clause 37, or in a mode where the MAC must configure (force) its link parameters based on information obtained out-of-band (MDIO reads, guesswork etc). In Linux, the OF node property named "managed" is parsed by the phylink framework, and the convention is that if a driver uses phylink, then the presence of this property means that in-band autoneg should be enabled, otherwise it shouldn't. To be compatible with the OF node bindings of drivers that use phylink in Linux, introduce parsing support for this property in U-Boot too. 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> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23net: dsa: allow drivers to get the port OF nodeVladimir Oltean
In the current DSA switch driver API, only the udevice of the switch (belonging to UCLASS_DSA) is exposed, as well as an "int port" argument. So drivers do not have access to the udevice of individual ports (belonging to UCLASS_ETH), one of the reasons being that not all ports have an associated UCLASS_ETH udevice. However, all DSA ports have an OF node, and in some cases the driver needs a handle to it, for all ports including the CPU port. Example: the following Linux per-port device tree property: managed = "in-band-status"; states whether a port should operate with clause 37 in-band autoneg enabled or not. This patch exposes a function which can be called by individual drivers as needed. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23include: import if_vlan.h from LinuxVladimir Oltean
This is needed for the VLAN header structure. 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-23net: tsec: add support for promiscuous modeVladimir Oltean
The Freescale TSEC can be a DSA master, and the ports of the attached DSA switch can have different MAC addresses compared to the TSEC. Nonetheless, the TSEC must receive the packets on behalf of those switch ports. Therefore, implement the promiscuous mode method to allow DSA to set this. Note that the init_registers() function called from eth_ops :: start overwrites this setting. There is no reason why the RCTRL register should be zero-initialized, so just stop clearing it so that the setting we applied in eth_ops :: set_promisc sticks. 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> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-23net: phy: mscc: add support for VSC8502 in dual RGMII modeVladimir Oltean
The VSC8502 is a Microchip (formerly Microsemi, formerly Vitesse) dual port, gigabit Ethernet copper PHY which supports the MII, GMII and RGMII MAC-side interfaces. Of these, I could only test RGMII, and my board needed RGMII delays to be applied by software, so I am able to confirm that this patch handles that properly. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-18Revert "nvme: Enable FUA"Tom Rini
Unaddressed review comments. This reverts commit b6bfb8971dd039a60e1cff1895ab9be8be0915b3. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-11-18Revert "nvme: Fix error in nvme_setup_prps"Tom Rini
Dependent commit has unaddressed review comments. This reverts commit c4eef59faab6ae4ecb1beae6d4391b0889bc3ff3. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-11-18Merge branch '2021-11-17-assorted-driver-platform-updates' into nextTom Rini
- NVMe updates - TI AM64x related USB updates - Update PCIe CAM support macros, add PCI CAM support as well - AST2600, Apple (ARM64) pinctrl drivers - ARM-specific DEBUG uart inconsistencies fixed - MediaTek MMC improvement - aspeed: Support secure boot chain with FIT image verification
2021-11-17configs: am64x_evm_*_defconfig: Add configs to enable serdes for USB 3.0 supportAswath Govindraju
Add configs to enable serdes for USB 3.0 support. Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-11-17arm: dts: am642-sk: Add and Enable USB SuperSpeed Host Port in SPLKishon Vijay Abraham I
Add and Enable USB SuperSpeed Host Port in SPL. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-11-17usb: cdns3: cdns3-ti: Add compatible for AM64 SoCAswath Govindraju
Add new compatible for AM64 SoC. Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-11-17phy: cadence: phy-cadence-torrent: Change the name of subnode searchedAswath Govindraju
Search for "phy" in the subnode names, to syncup with kernel. Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-11-17nvme: Fix error in nvme_setup_prpsJon Lin
Consulting to "NVM Express® Base Specification, revision 2.0". If more PRP List pages are required, then the last entry of the PRP List contains the Page Base Address of the next PRP List page. The next PRP List page shall be memory page aligned. Signed-off-by: Jon Lin <jon.lin@rock-chips.com> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-11-17nvme: Enable FUAJon Lin
Most NVME devcies maintain data in internal cache for an uncertain times, and u-boot has no method to force NVME to flush cache. So this patch adds FUA to avoid data loss caused by power off after data programming. Signed-off-by: Jon Lin <jon.lin@rock-chips.com> Reviewed-by: Stefan Agner <stefan@agner.ch>
2021-11-17RFC: arm: pci: Add PCI cam support to PCI-E ecam driverAlistair Delva
When booting U-Boot in crosvm, the virtual machine emulates a PCI cam device, not the PCI-E 'ecam' device normally seen on e.g. QEMU. This PCI device can be supported with only trivial changes to the ecam driver. Instead of adding a completely new driver which is identical besides the initialization step, add support for the PCI version to the existing driver. Signed-off-by: Alistair Delva <adelva@google.com> Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Cc: Ram Muthiah <rammuthiah@google.com>
2021-11-17configs: ast2600: Boot kernel FIT in DRAMChia-Wei Wang
AST2600 leverages the FIT hash/signature verification to fulfill secure boot trust chain. To improve the performance and save SW code size for those crypto operations, the two HW crypto engine, HACE and ACRY, are enabled. However, both of the engines can only access to data stored in DRAM space. Therefore, we need to move the FIT image into DRAM before the booting. This patch update the CONFIG_BOOTCOMMAND to execute the pre-defined ENV variable which consists of FIT image copy to memory and booting. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2021-11-17configs: aspeed: Make EXTRA_ENV_SETTINGS board specificChia-Wei Wang
Move CONFIG_EXTRA_ENV_SETTINGS to board-specific configuration headers. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2021-11-17configs: ast2600-evb: Enable SPL FIT supportChia-Wei Wang
Enable SPL FIT image load and verification support. The HW accelerated SHA is also available with the newly added support of the HACE HW hash engine. The SPL thumb build is also enabled to keep the binary less than 64KB to fit into the Aspeed secure boot design. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Joel Stanley <joel@jms.id.au>
2021-11-17ast2600: spl: Locate load buffer in DRAM spaceChia-Wei Wang
Return CONFIG_SYS_LOAD_ADDR pointing to DRAM space for spl_get_load_buffer() to allow generic SPL image loading code (e.g. FIT and Ymodem) to store data in DRAM. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Joel Stanley <joel@jms.id.au>
2021-11-17ARM: dts: ast2600: Add ACRY to device treeChia-Wei Wang
Add ACRY DTS node and enable it for AST2600 EVB. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Joel Stanley <joel@jms.id.au>
2021-11-17crypto: aspeed: Add AST2600 ACRY supportChia-Wei Wang
ACRY is designed to accelerate ECC/RSA digital signature generation and verification. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2021-11-17clk: ast2600: Add RSACLK control for ACRYChia-Wei Wang
Add RSACLK enable for ACRY, the HW RSA/ECC crypto engine of ASPEED AST2600 SoCs. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2021-11-17ARM: dts: ast2600: Add HACE to device treeJoel Stanley
Add HACE DTS node and enable it for AST2600 EVB. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2021-11-17crypto: aspeed: Add AST2600 HACE supportJohnny Huang
Hash and Crypto Engine (HACE) is designed to accelerate the throughput of hash data digest, and symmetric-key encryption. Signed-off-by: Johnny Huang <johnny_huang@aspeedtech.com> Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-17clk: ast2600: Add YCLK control for HACEJoel Stanley
Add YCLK enable for HACE, the HW hash engine of ASPEED AST2600 SoCs. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2021-11-17aspeed: ast2600: Enlarge SRAM sizeChia-Wei Wang
The AST2600 SRAM has been extended to 88KB since A1 chip revision. This patch updates the SRAM size to offer more space for early stack/heap use. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Joel Stanley <joel@jms.id.au>
2021-11-17image: fit: Fix parameter name for hash algorithmChia-Wei Wang
Fix inconsistent function parameter name of the hash algorithm. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Fixes: 92055e138f2 ("image: Drop if/elseif hash selection in calculate_hash()") Reviewed-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-17mmc: mtk-sd: implement waiting for DAT0 line stateJulien Masson
With the recent changes on mmc driver, we saw that the boot is ~5 secs longer compared to v2021.07 on mediatek platforms. This regression is seen during mmc_init and caused by the following patch [1]. Indeed since we did not support poll dat0, we fulfilled the condition of [1] and a delay of 500 ms was added for every __mmc_switch call. By adding the support of wait_dat0(), we now don't need to mdelay during mmc_init anymore. [1]: https://patchwork.ozlabs.org/project/uboot/patch/1629192034-64056-1-git-send-email-ye.li@nxp.com/ Signed-off-by: Julien Masson <jmasson@baylibre.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-11-17rk3399: Don't enable the debug UART if there is no driverSimon Glass
Some boards do not enable SPL_SERIAL so cannot use the debug UART. Add this condition to the code and drop use of the preprocessor while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
2021-11-17arm: qemu: Enable the debug UARTSimon Glass
Enable this to permit early debugging. Due to the way qmeu works, the input clock can be zero and things still work. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-17arm: Init the debug UARTSimon Glass
At present we don't init the debug UART in the generic ARM code, but instead leave it to individual machines to handle. This is not the way it is supposed to work. Add the required init to the crt files. This ensures that the UART is available as early as possible and that the announcement appears when it should, if enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-17arm: Fix some inconsistent debug-UART CONFIG optionsSimon Glass
A few boards enable CONFIG_DEBUG_UART_BOARD_INIT but do not define the required init function. Fix this by disabling the debug UART. With snow the debug UART is enabled but the driver CONFIG is not. Fix this too. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-17pci: Add standard PCIe ECAM macrosPali Rohár
Lot of PCIe controllers are using ECAM addressing. So add common ECAM macros into U-Boot's pci.h header file which can be suitable for most PCI controller drivers. Replace custom ECAM address macros in every PCI controller driver by new ECAM macros from U-Boot's pci.h header file. Similar macros are defined also in Linux kernel. There is a small difference between Linux and these new U-Boot macros. U-Boot's PCIE_ECAM_OFFSET() takes device and function numbers in separate arguments. Linux's PCIE_ECAM_OFFSET() takes device and function numbers encoded in one argument. The reason is that U-Boot's PCI_DEVFN() macro is different than Linux's PCI_SLOT() macro. So having device and function numbers in separate arguments makes code more straightforward. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-11-17pinctrl: Add Apple pinctrl driverMark Kettenis
This driver supports both pin muxing and GPIO support for the pin control logic found on Apple SoCs. Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2021-11-17aspeed: AST2600 Pinctrl DriverRyan Chen
This driver uses Pinctrl framework and is compatible with the Linux driver for AST2600. Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com> Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
2021-11-16Merge branch '2021-11-16-env-rework' into nextTom Rini
To quote Simon: One barrier to completing the 7-year-long Kconfig migration is that the default environment is implemented using ad-hoc CONFIG options. At present U-Boot environment variables, and thus scripts, are defined by CONFIG_EXTRA_ENV_SETTINGS. It is not really feasible to move the environment to Kconfig as it is hundreds of lines of text in some cases. Even considering the current situation, it is painful to add large amounts of text to the config-header file and dealing with quoting and newlines is harder than it should be. It would be better if we could just type the script into a text file and have it included by U-Boot. This is already supported by the CONFIG_USE_DEFAULT_ENV_FILE feature. But that does not support use of CONFIG options or comments, so is best suited for use by other build systems wanting to define the U-Boot environment. Add a feature that brings in a .env file associated with the board config, if present. To use it, create a file board/<vendor>/<board>.env or use CONFIG_ENV_SOURCE_FILE to set a filename. The environment variables should be of the form "var=value". Values can extend to multiple lines. This series converts the existing environment documentation to rST and updates it to explain how to use this.
2021-11-16bootm: Tidy up use of autostart env varSimon Glass
This has different semantics in different places. Go with the bootm method and put it in a common function so that the behaviour is consistent in U-Boot. Update the docs. To be clear, this changes the way that 'bootelf' and standalone boot work. Before, if autostart was set to "fred" or "YES", for example, they would consider that a "yes". This may change behaviour for some boards, but the only in-tree boards which mention autostart use "no" to disable it, which will still work. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Wolfgang Denk <wd@denx.de>
2021-11-16sandbox: Update the test MAC/IP addressesSimon Glass
These conflict with real-word addresses. Use locally administered MAC addresses and a suitable IPv4 address from 192.0.2.0/24 (TEST-NET-1). Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Alexander Dahl <ada@thorsis.com>
2021-11-16doc: Improve environment documentation furtherSimon Glass
Make various other updates suggested during review of the rST conversion. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-16doc: Improve environment documentationSimon Glass
Make various updates suggested during review of the rST conversion. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Suggested-by: Wolfgang Denk <wd@denx.de>
2021-11-16doc: Mention CONFIG_DEFAULT_ENV_FILESimon Glass
Add mention of this option since it does a similar thing to the text environment. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Marek Behún <marek.behun@nic.cz>