aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-03-16Azure / GitLab / Travis: Add Kconfig unit tests to a jobTom Rini3-6/+9
The Kconfig language provides a unit test that can be run. As these require pytest to be installed and run very quickly, bundle them in to an existing CI job. Signed-off-by: Tom Rini <trini@konsulko.com>
2020-03-16mach-davinci: Hard-code the default SPL_LDSCRIPT pathTom Rini1-1/+1
As there is only one linker script to use in this case, rather than use the BOARDDIR variable hard-code the path. Cc: Lokesh Vutla <lokeshvutla@ti.com> Suggested-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16edminiv2: Move CONFIG_SPL_LDSCRIPT to defconfigTom Rini2-3/+1
As there is only one machine under mach-orion5x, having a Kconfig entry for SPL_LDSCRIPT is not helpful, move this to the defconfig file. Suggested-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16mx31pdk: Move CONFIG_SPL_LDSCRIPT to defconfigTom Rini2-3/+1
As there is only one mx31pdk config file and with upcoming updates to the Kconfig parsing logic, rather than have an entry in board/freescale/mx31pdk/Kconfig, move this single setting to the defconfig file. Cc: Magnus Lilja <lilja.magnus@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Magnus Lilja <lilja.magnus@gmail.com>
2020-03-16Kconfig: Remove redundant variable setsTom Rini3-9/+0
In a few places we have Kconfig entries that set SPL_LDSCRIPT to what is the default value anyways. Drop these. Cc: Michal Simek <monstr@monstr.eu> Cc: Rick Chen <rick@andestech.com> Cc: Philippe Reynes <tremyfr@yahoo.fr> Cc: Eric Jarrige <eric.jarrige@armadeus.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> (for Microblaze) Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16spl: Kconfig: Escape '$(ARCH)' in LDSCRIPT entriesTom Rini1-2/+2
The default SPL / TPL linker script is in the $(ARCH) directory. The way we use this today works but isn't ideal. With an update to Kconfig to re-sync with the Linux Kernel, we need to escape the '$' here so that it will end up being evaluated by make. Cc: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16kbuild: remove unused dtc-version.sh scriptMasahiro Yamada2-22/+0
This is U-Boot own code, and no longer used since commit 36dd5f1b8abc ("dtc: Switch to building and using our own dtc unless provided"). Prior to that commit, U-Boot relied on an external dtc, so this script was used to check the dtc version. Now U-Boot bundles our own dtc in script/dtc/dtc like Linux kernel. Users are still allowed to pass DTC= option from the command line, but they are supposed to choose correct version of dtc in this case. So, we do not check the dtc version any more. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16spl.h: make <spl.h> self-containedMasahiro Yamada1-0/+4
The static inline function spl_phase needs <asm/global_data.h>. Some functions take pointers to struct blk_desc or image_header. Add forward declarations. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-16debug_uart.h: make <debug_uart.h> self-containedMasahiro Yamada1-10/+10
'uint' is not a primitive type. You need to include <linux/types.h> or otherwise change it to (unsigned int). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2020-03-16asm-generic/u-boot.h: make <asm-generic/u-boot.h> self-containedMasahiro Yamada1-0/+2
This header uses 'phys_addr_t' and 'ulong'. Include the definitions. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> [trini: Move include to below __ASSEMBLY__ test] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-03-16global_data.h: make <asm-generic/global_data.h> self-containedMasahiro Yamada1-1/+1
The compiler never knows what 'bd_t' is without including <asm/u-boot.h>. By changing it to (struct bd_info), the compiler learns it is struct. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16scripts/Makefile.lib: Re-add -Wno-simple_bus_reg to DTC_FLAGSTom Rini1-0/+1
This exists in Linux Kernel with commit 70523a3ce5ff so put it in the list of DTC_FLAGS that mirror Linux as we will catch up there. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16scripts/Makefile.lib: Restore PCI related warnings to DTC_FLAGSTom Rini1-0/+4
While we are working on correcting usage related to the pci_bridge and pci_device_bus_num warnings, disable these flags for now. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16kbuild: Re-sync DTC flag logic with v4.17Tom Rini2-21/+16
The way that we have been handling additional DTC warning flags hasn't matched the way the Linux Kernel does. Resync this logic with v4.17. Signed-off-by: Tom Rini <trini@konsulko.com>
2020-03-16kbuild: fixdep: Resync this with v4.17Tom Rini1-201/+150
The previous kbuild resync of e91610da7c8a ("kconfig: re-sync with Linux 4.17-rc4") accidentally did not sync the fixdep program. This commit brings fixdep in line with the rest of that previous resync. This includes all of the following Linux kernel commits: fbfa9be9904e kbuild: move include/config/ksym/* to include/ksym/* 5b8ad96d1a44 fixdep: remove some false CONFIG_ matches 14a596a7e6fd fixdep: remove stale references to uml-config.h ab9ce9feed36 fixdep: use existing helper to check modular CONFIG options 87b95a81357d fixdep: refactor parse_dep_file() 5d1ef76f5a22 fixdep: move global variables to local variables of main() ccfe78873c22 fixdep: remove unneeded memcpy() in parse_dep_file() 4003fd80cba9 fixdep: factor out common code for reading files 01b5cbe7012f fixdep: use malloc() and read() to load dep_file to buffer 41f92cffba19 fixdep: remove unnecessary <arpa/inet.h> inclusion 7c2ec43a2154 fixdep: exit with error code in error branches of do_config_file() 4e433fc4d1a9 fixdep: trivial: typo fix and correction dee81e988674 fixdep: faster CONFIG_ search c1a95fda2a40 kbuild: add fine grained build dependencies for exported symbols d8329e35cc08 fixdep: accept extra dependencies on stdin 4c835b57b8de fixdep: constify strrcmp arguments Of note is that when applying dee81e988674 above our logic in that area required some careful consideration to continue to apply. [Fold in bugfix to allow us to include 638e69cf2230 from upstream] Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> [Merge everything to U-Boot, rework dee81e988674] Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-16fixdep: fix U-Boot own code to handle only valid symbol charactersMasahiro Yamada1-1/+1
Currently, fixdep skips parsing include/linux/kconfig.h, but if it parsed it, it would translate the following code in kconfig.h config_enabled(CONFIG_VAL(option##_MODULE) into: $(wildcard include/config/option##/module.h) When Kbuild includes .*.cmd, it would emit the following error: *** unterminated call to function 'wildcard': missing ')'. Stop. This issue prevents us from importing the upstream Linux commit 638e69cf2230 ("fixdep: do not ignore kconfig.h"). Fix this by handling only alphanumerical characters and underscores. This makes sense because they match to the valid character sets in Kconfig symbols. As a side-note, you can reproduce this issue only on GNU Make <= 4.2.1 For GNU Make <= 4.2.1, the '#' always means the start of a comment. Hence, GNU Make thinks the closing ')' is missing. The following commit in GNU Make changed how it handles '#' in function invocations. So, this does not happen for GNU Make 4.3 | commit c6966b323811c37acedff05b576b907b06aea5f4 | Author: Paul Smith <psmith@gnu.org> | Date: Thu Dec 22 18:47:26 2016 -0500 | | [SV 20513] Un-escaped # are not comments in function invocations Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reported-by: Tom Rini <trini@konsulko.com>
2020-03-12Merge branch '2020-03-12-rsa-improvements' into nextTom Rini20-436/+1558
(Description from AKASHI Takahiro) extend rsa_verify() for UEFI secure boot: The current rsa_verify() requires five parameters for a RSA public key for efficiency while RSA, in theory, requires only two. In addition, those parameters are expected to come from FIT image. So this function won't fit very well when we want to use it for the purpose of implementing UEFI secure boot, in particular, image authentication as well as variable authentication, where the essential two parameters are set to be retrieved from one of X509 certificates in signature database. So, in this patch, additional three parameters will be calculated on the fly when rsa_verify() is called without fdt which should contain parameters above. This calculation heavily relies on "big-number (or multi-precision) library." Therefore some routines from BearSSL under MIT license are imported in this implementation.
2020-03-12test: enable RSA library test on sandboxAKASHI Takahiro4-0/+4
We want to always run RSA library test on sandbox build in Travis CI. Just adding CONFIG_RSA_VERIFY_WITH_PKEY would be good enough for this purpose. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-03-12test: add rsa_verify() unit testAKASHI Takahiro3-0/+217
In this patch, a very simple test is added to verify that rsa_verify() using rsa_verify_with_pkey() work correctly. To keep the code simple, all the test data, either public key and verified binary data, are embedded in the source. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-03-12lib: rsa: add rsa_verify_with_pkey()AKASHI Takahiro1-1/+64
This function, and hence rsa_verify(), will perform RSA verification with two essential parameters for a RSA public key in contract of rsa_verify_with_keynode(), which requires additional three parameters stored in FIT image. It will be used in implementing UEFI secure boot, i.e. image authentication and variable authentication. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-12lib: rsa: generate additional parameters for public keyAKASHI Takahiro4-0/+752
In the current implementation of FIT_SIGNATURE, five parameters for a RSA public key are required while only two of them are essential. (See rsa-mod-exp.h and uImage.FIT/signature.txt) This is a result of considering relatively limited computer power and resources on embedded systems, while such a assumption may not be quite practical for other use cases. In this patch, added is a function, rsa_gen_key_prop(), which will generate additional parameters for other uses, in particular UEFI secure boot, on the fly. Note: the current code uses some "big number" routines from BearSSL for the calculation. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-03-12include: image.h: add key info to image_sign_infoAKASHI Takahiro1-0/+7
For FIT verification, all the properties of a public key come from "control fdt" pointed to by fdt_blob. In UEFI secure boot, on the other hand, a public key is located and retrieved from dedicated signature database stored as UEFI variables. Added two fields may hold values of a public key if fdt_blob is NULL, and will be used in rsa_verify_with_pkey() to verify a signature in UEFI sub-system. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-12rsa: add CONFIG_RSA_VERIFY_WITH_PKEY configAKASHI Takahiro1-0/+14
In the next couple of commits, under new CONFIG_RSA_VERIFY_WITH_PKEY, rsa_verify() will be extended to be able to perform RSA decryption without additional RSA key properties from FIT image, i.e. rr and n0inv. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-12lib: rsa: decouple rsa from FIT image verificationAKASHI Takahiro11-438/+501
Introduce new configuration, CONFIG_RSA_VERIFY which will decouple building RSA functions from FIT verification and allow for adding a RSA-based signature verification for other file formats, in particular PE file for UEFI secure boot. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-12image.h: isolate android_image_* functions from toolingEugeniu Rosca1-0/+2
On Feb. 16, 2020, Tom reported [1] build failure of U-Boot in-tree tooling after applying https://patchwork.ozlabs.org/cover/1229663/ ("[v6,0/7] rsa: extend rsa_verify() for UEFI secure boot"). Later on, Heinrich stressed the urgency of the issue in https://patchwork.ozlabs.org/patch/1250858/#2379069: >>>>>>>>> We should finalize the topic as it stops EFI patches from being merged >>>>>>>>> On the surface, the problem is caused by U-Boot commits [2-3], which employed 'u32' in 'include/image.h', while historically U-Boot tooling stayed agnostic on the {u,s}{8,16,32} types. Thanks to Tom, Yamada-san and Heinrich, the following solutions have been put head-to-head ('+' pros, '-' cons): A. Use an equivalent fixed-size type, i.e. s/u32/uint32_t/ in both android function prototypes (image.h) and definitions (c file): + quick and low-line-count - creates a 'soup' of fixed-sized types in the Android C file - will confuse contributors - is going against Linux kernel best practices [4] B. Guard Android functions by '!defined(USE_HOSTCC)' in image.h: + quick and low-line-count + reflects the reality (no android function is used by tooling) + zero impact on other subsystems - ifdeffery may look annoying (pre-existing problem of image.h) C. Make {u8,u16,u32} available in U-Boot tooling: + quick and low-line-count + [Yamada-san][5]: * forbidding u32 for tools is questionable to me * Linux kernel and Barebox use {u8,u16,u32} for the tools space - breaks U-Boot tradition? - has larger impact than [A] and [B] - adds type complexity/inconsistency in the tooling space D. [Yamada-san] Refactor the headers to minimize the code shared between U-Boot space and tooling space: + probably the long-term solution - high effort - can be seen/done as an incremental update on top of [B] Looking at the above, [B] looks like the natural way to go forward. [1] https://patchwork.ozlabs.org/patch/1238245/#2363052 [2] commit 7f2531502c74c0 ("image: android: Add routine to get dtbo params") [3] commit c3bfad825a71ea ("image: android: Add functions for handling dtb field") [4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e6176fa4728fb6d ("checkpatch: add --strict warning for c99 fixed size typedefs : int<size>_t") [5] https://patchwork.ozlabs.org/patch/1238245/#2363340 Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Sam Protsenko <joe.skb7@gmail.com> Cc: Lokesh Vutla <lokeshvutla@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: AKASHI Takahiro <takahiro.akashi@linaro.org> Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Tested-by: Heinrich Schuchardt <xpyron.glpk@gmx.de>
2020-03-10Merge tag 'mmc-2020-3-9' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmcTom Rini29-84/+531
- DM support for CAxxxx SoCs - eMMC board for presidio-asic - Add defer probe for mmc sdhci - TI SoCs mmc misc update
2020-03-10arm: mediatek: remove unused binman configSam Shih2-1/+1
The binman-option BINMAN_FDT is introduced by this commit: commit 3c10dc95bdd0 ("binman: Add a library to access binman entries") BINMAN_FDT being selected when BINMAN=y that resulting in mt7623 and mt7622 are unable to boot. The root cause of this issue is commit: commit cbd2fba1eca1 ("arm: MediaTek: add basic support for MT7629 boards") select BINMAN=y in all mediatek SoCs, and others mediatek SoCs not expect to use BINMAN_FDT. This patch remove BINMAN=y option when ARCH_MEDIATEK=y and move this to the specify SoCs part config. Signed-off-by: Sam Shih <sam.shih@mediatek.com> Tested-by: Frank Wunderlich <frank-w@public-files.de>
2020-03-10power-domain: fix hang in endless loop on i.MX8Anatolij Gustschin1-0/+11
Currently when booting the kernel on i.MX8 U-Boot hangs in an endless loop when switching off dma, connectivity or lsio power domains during device removal. It hapens first when removing gpio0 (gpio@5d080000) device, here its power domain device 'lsio_gpio0' is obtained for switching off power. Since the obtained 'lsio_gpio0' device is removed afterwards, its power domain is also switched off and here the parent power domain device 'lsio_power_domain' is optained for switching off the power. Thereafter, when the obtained 'lsio_power_domain' is removed, device_remove() removes its first child 'lsio_gpio0'. During this child removal the 'lsio_power_domain' device is obtained again for switching and when removing it later, the same child removal is repeated, so we are stuck in an endless loop. Below is a snippet from dm tree on i.MX8QXP for better illustration of the DM devices relationship: Class Index Probed Driver Name ----------------------------------------------------------- root 0 [ + ] root_driver root_driver ... simple_bus 0 [ + ] generic_simple_bus |-- imx8qx-pm power_doma 0 [ + ] imx8_power_domain | |-- lsio_power_domain power_doma 1 [ + ] imx8_power_domain | | |-- lsio_gpio0 power_doma 2 [ + ] imx8_power_domain | | |-- lsio_gpio1 Do not remove a power domain device if it is a parent of the currently controlled device. Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal") Signed-off-by: Anatolij Gustschin <agust@denx.de> Reported-by: Oliver Graute <oliver.graute@gmail.com> Reported-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Tested-by: Fabio Estevam <festevam@gmail.com>
2020-03-10Merge tag 'u-boot-imx-20200310' of ↵Tom Rini46-1208/+606
https://gitlab.denx.de/u-boot/custodians/u-boot-imx Fixes for 2020.04 ----------------- - DM : mx6sabresd - mx6ul_14x14_evk: fix video - mx8qxp; fix console for booting - sync DTS with kernel (imx6sx) - drop obsolete woodburn (mx35) Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/660550811
2020-03-10Merge tag 'u-boot-atmel-fixes-2020.04-a' of ↵Tom Rini2-1/+4
https://gitlab.denx.de/u-boot/custodians/u-boot-atmel First set of u-boot-atmel fixes for 2020.04 cycle: - Includes two small configuration fixes that will solve the SPL booting on sama5d3_xplained board.
2020-03-10Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-netTom Rini19-330/+1764
2020-03-10mx6slevk: Convert to DM_ETHPedro Jardim3-38/+3
This fixes the following warning: ===================== WARNING ====================== This board does not use CONFIG_DM_ETH (Driver Model for Ethernet drivers). Please update the board to use CONFIG_DM_ETH before the v2020.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/migration.rst for more info. ==================================================== Signed-off-by: Pedro Jardim <jardim.c.pedro@gmail.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2020-03-10mx6sabreauto: Convert to DM_ETHPedro Jardim3-50/+5
This fixes the following warning: ===================== WARNING ====================== This board does not use CONFIG_DM_ETH (Driver Model for Ethernet drivers). Please update the board to use CONFIG_DM_ETH before the v2020.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/migration.rst for more info. ==================================================== Signed-off-by: Pedro Jardim <jardim.c.pedro@gmail.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2020-03-10mx7dsabresd: Boot in non secure by defaultFabio Estevam2-2/+0
Booting a mainline kernel in secure mode on i.MX7D causes only one CPU to be brought up. Change it to booting in non secure mode by default, which allows the two CPUs to be brought up. It does have a side effect of not probing the CAAM driver. If CAAM driver is needed then a secure world OS such as OPTEE needs to be used. Signed-off-by: Fabio Estevam <festevam@gmail.com>
2020-03-10imx: imx8qm: enable relocation of fdt and initrdOliver Graute1-2/+1
Set CONFIG_SYS_BOOTMAPSZ to the amount of memory available which is needed to relocate the kernel, device tree and initrd. Remove 'fdt_high' and 'initrd_high' environment variables from default environment which prevents relocation of FDT and initrd. Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Ye Li <ye.li@nxp.com> Cc: uboot-imx <uboot-imx@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-03-10arm: dts: imx8mq-evk: add phy-reset-gpios for fec1Alifer Moraes2-18/+2
Instead of resetting the ethernet phy through functions in imx8mq_evk.c, let the driver reset the phy via dts description adding a reset duration of 10 ms following atheros 8031's datasheet recommendation. Signed-off-by: Alifer Moraes <alifer.wsdm@gmail.com>
2020-03-10mx6sabresd: Convert ethernet to driver modelAlifer Moraes3-45/+5
Convert imx6sabresd ethernet to driver model to fix the following warning: ===================== WARNING ====================== This board does not use CONFIG_DM_ETH (Driver Model for Ethernet drivers). Please update the board to use CONFIG_DM_ETH before the v2020.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/migration.rst for more info. ==================================================== Signed-off-by: Alifer Moraes <alifer.wsdm@gmail.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2020-03-10board: sama5d3_xplained: Fix uboot size when loaded from NAND by SPLFabien Lehoussel1-1/+3
Uboot size is incorrect. Uboot SPL use CONFIG_SYS_MONITOR_LEN to read uboot from NAND : 0x80000 With sama5d3_xplained_nandflash_defconfig : u-boot.bin size is ~800Ko 0xC0000 So I increased size to 1MB : 0x100000 Signed-off-by: Fabien Lehoussel <fabien.lehoussel@medianesysteme.com>
2020-03-10board: sama5d3_xplained: Fix SPL DTB read from NANDFabien Lehoussel1-0/+1
SPL boot cannot find dtb if CONFIG_SPL_SEPARATE_BSS is disabled : CONFIG_SPL_SEPARATE_BSS=n RomBOOT <debug_uart> Missing DTB ### ERROR ### Please RESET the board ### RomBOOT CONFIG_SPL_SEPARATE_BSS=y RomBOOT <debug_uart> U-Boot SPL 2019.04-linux4sam_6.2-icp-dirty (Feb 24 2020 - 15:34:35 +0100) Trying to boot from NAND <debug_uart> Signed-off-by: Fabien Lehoussel <fabien.lehoussel@medianesysteme.com>
2020-03-09net: phy: marvell: Unify 88E151x series phy_driverClemens Gruber1-55/+10
The PHY models of the Marvell 88E151x series are not reliably distinguishable by their uid / PHY identifiers. The 88E1510, 88E1512, 88E1514 and 88E1518 all have the same OUI and model number and bits 3:0 in the PHY Identifier 2 (Page 0, Reg 3) are described as HW revision number, but both 88E1510 and 88E1518 PHYs were observed with the same HW rev number (1). Before commit 83cfbeb0df9f ("net: phy: Fix mask so that we can identify Marvell 88E1518"), the 88E151x were detected because the HW revision bits were masked from the uid. After that change, 88E1510/12/18 were all detected as 88E1518 and the 88E1510 specific code was no longer run. I modified the mask to again ignore all four HW revision bits, removed the 88E1510 specific code (board-specific LED/INTn setup), which was not called since late 2016 anyway and renamed the config function and phy_driver struct to the better fitting 88e151x. The uid and mask bits 3:0 are now again the same as in the Linux kernel. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
2020-03-09net: tftp: use correct printf codesHeinrich Schuchardt1-1/+1
When printing unsigned numbers use %u. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-03-09net: phy: dp83867: Add SGMII mode type switchingMichal Simek1-0/+12
This patch adds ability to switch beetween two PHY SGMII modes. Some hardware, for example, FPGA IP designs may use 6-wire mode which enables differential SGMII clock to MAC. Patch description, dt flags have been done in mainline Linux by commit a2111c460c0c ("net: phy: dp83867: Add documentation for SGMII mode type") and by commit 507ddd5c0d47 ("net: phy: dp83867: Add SGMII mode type switching") Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-03-09dt-bindings: net: dp83867: Remove binding doc from U-Boot treeMichal Simek1-35/+0
U-Boot is having DT which doesn't cover all options currently supported by driver. DT binding is aligned with Linux kernel version available here. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ti,dp83867.txt Based on my talk with Grygorii Strashko better will be to remove it. Also Linux kernel bindings are being converted to yaml that's another reason to do it only at one place. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
2020-03-09net: phy: add XFI, USXGMII types to is_10g_interface() helperAlex Marginean1-2/+7
The helper is used to reset PHYs on connect and it determines the clause to use (C22/C45) based on interface type. This fixes 'PHY reset timed out' warnings in console for USXGMII/XFI PHYs. Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-03-09net: phy: Fix overlong PHY timeoutAndre Przywara1-1/+1
Commit 27c3f70f3b50 ("net: phy: Increase link up delay in genphy_update_link()") increased the per-iteration waiting time from 1ms to 50ms, without adjusting the timeout counter. This lead to the timeout increasing from the typical 4 seconds to over three minutes. Adjust the timeout counter evaluation by that factor of 50 to bring the timeout back to the intended value. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Fixes: net: phy: Increase link up delay in genphy_update_link() ("27c3f70f3b50") Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Matthias Brugger <mbrugger@suse.com> Tested-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-03-09doc: net: Rewrite network driver documentationAndre Przywara3-215/+322
doc/README.drivers.eth seems like a good source for understanding U-Boot's network subsystem, but is only talking about legacy network drivers. This is particularly sad as proper documentation would help in porting drivers over to the driver model. Rewrite the document to describe network drivers in the new driver model world. Most driver callbacks/methods are almost identical in their semantic, but recv() differs in some important details. Also keep some parts of the original text at the end, to help understanding old drivers. Add some hints on how to port drivers over. This also uses the opportunity to reformat the document in reST, on the way moving it into doc/driver-model and adding it into the structure there. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-03-09drivers: net: phy: aquantia: make it less verboseAlex Marginean1-12/+12
The driver now unconditionally prints some information that's not universally useful. Replace printf with debug. Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-03-09drivers: net: phy: aquantia: drop XGMII as a valid system interface protoAlex Marginean1-8/+9
Use either USXGMII or XFI in aquantia_set_proto and drop XGMII as a valid protocol configuration. The PHY doesn't support it, it's just used as an alias for one of the other two protocols. Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com> Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-03-09env: Update env_addr for mmc environment driverPankit Garg1-0/+5
Make sure the gd struct is up-to-date. Signed-off-by: Pankit Garg <pankit.garg@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-03-09phy: Include NC-SI in phy setupSamuel Mendoza-Jonas3-0/+23
Add NC-SI to the usual phy handling. This makes two notable changes: - Somewhat similar to a fixed phy, phy_connect() will create an NC-SI phy if CONFIG_PHY_NCSI is defined. - An early return is added to phy_read() and phy_write() to handle a case like the NC-SI phy which does not define a bus. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Acked-by: Joe Hershberger <joe.hershberger@ni.com>