summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* net: phy: dp83867: move static initialization to .probe()Grygorii Strashko2019-12-091-12/+17
| | | | | | | Move static, one-time initialization to .probe() callback. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* net: phy: ti: rename ti.c to dp83867.cGrygorii Strashko2019-12-092-1/+1
| | | | | | | | The driver ti.c is actually driver for TI DP83867x PHYs, so rename it accordingly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* net: tftp: Fix tftp store address check in store_block()Bin Meng2019-12-091-1/+6
| | | | | | | | | | | | | | | | | | During testing of qemu-riscv32 with a 2GiB memory configuration, tftp always fails with a error message: Load address: 0x84000000 Loading: # TFTP error: trying to overwrite reserved memory... It turns out the result of 'tftp_load_addr + tftp_load_size' just overflows (0x100000000) and the test logic in store_block() fails. Fix this by adjusting the end address to ULONG_MAX when overflow is detected. Fixes: a156c47e39ad ("tftp: prevent overwriting reserved memory") Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* net: avoid address-of-packed-member errorHeinrich Schuchardt2019-12-091-13/+7
| | | | | | | | | | | | | | | | | | | | sandbox_defconfig does not compile using GCC 9.2.1: net/net.c: In function ‘net_process_received_packet’: net/net.c:1288:23: error: taking address of packed member of ‘struct ip_udp_hdr’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 1288 | sumptr = (ushort *)&(ip->udp_src); | ^~~~~~~~~~~~~~ Avoid the error by using a u8 pointer instead of an u16 pointer and in-lining ntohs(). Simplify the checksumming of the last message byte. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* net/phy: Fix phy_connect() for phy addr 0Priyanka Jain2019-12-091-1/+1
| | | | | | | | | | Fix 'mask' calculation in phy_connect() for phy addr '0'. 'mask' is getting set to '0xffffffff' for phy addr '0' in phy_connect() whereas expected value is '0'. Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com> Reported-by: tetsu-aoki via github Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* net: nfs: Only link in NFS code outside of SPL buildsTom Rini2019-12-091-2/+2
| | | | | | | | | While we have networking use cases within SPL we do not support loading files via NFS at this point in time. Disable calling nfs_start() so that the NFS related code can be garbage collected at link time. Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* lib: Always build support for formatting MAC and IP addressJoe Hershberger2019-12-091-4/+0
| | | | | | | Even if not communicating over the network in U-Boot, code may be manipulating and storing IP or MAC addresses to pass to Linux, etc. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: Improve documentation for string_to_ip()Joe Hershberger2019-12-091-3/+4
| | | | Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: Always build the string_to_enetaddr() helperJoe Hershberger2019-12-0912-37/+39
| | | | | | | | | | | | Part of the env cleanup moved this out of the environment code and into the net code. However, this helper is sometimes needed even when the net stack isn't included. Move the helper to lib/net_utils.c like it's similarly-purposed string_to_ip(). Also rename the moved function to similar naming. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Ondrej Jirman <megous@megous.com>
* Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86Tom Rini2019-12-081-7/+3
|\ | | | | | | - 16-bit start up codes clean up
| * x86: simplify ljmp to 32-bit codeMasahiro Yamada2019-12-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | You can directly specify the label as the operand for ljmp. This commit saves 4-byte code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: fixed the gas warning] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
| * x86: use data32 directive instead of macro for operand-size prefixMasahiro Yamada2019-12-081-5/+3
|/ | | | | | | | | | | This file defines 'a32' and 'o32' macros to avoid magic numbers of operand/address-size prefixing. GAS supports 'data32' and 'addr32' for that purpose. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* Merge branch '2019-12-06-master-imports'Tom Rini2019-12-0652-1598/+8643
|\ | | | | | | | | | | | | | | | | - Allow for the sysboot command, which is used to parse extlinux.conf files to be used without PXE support. There is no functional change here aside from fixing distro boot in a few cases where we actually lacked the ability to parse the extlinux.conf file - Add the x509/pkcs7 parsers from Linux, a pre-requisite to EFI Secure Boot support.
| * Makefile: Ensure tools directory exists in output prior to useTom Rini2019-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | With the change to make tools/version.h a file we need to make sure that the output directory exists first otherwise we will get a build failure. Reported-by: Peter Robinson <pbrobinson@gmail.com> Tested-by: Peter Robinson <pbrobinson@gmail.com> Fixes: 4d90f6cd9813 ("tools: Avoid creating symbolic links for tools/version.h") Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * test: add asn1 unit testAKASHI Takahiro2019-12-063-1/+410
| | | | | | | | | | | | | | This test will exercise asn1 compiler as well as asn1 decoder functions via various parsers. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * lib: crypto: add pkcs7 message parserAKASHI Takahiro2019-12-067-3/+962
| | | | | | | | | | | | | | | | | | | | Imported from linux kernel v5.3: pkcs7.asn1 without changes pkcs7.h with changes marked as __UBOOT__ pkcs7_parser.h without changes pkcs7_parser.c with changes marked as __UBOOT__ Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * lib: crypto: add x509 parserAKASHI Takahiro2019-12-069-0/+1172
| | | | | | | | | | | | | | | | | | | | | | Imported from linux kernel v5.3: x509.asn1 without changes x509_akid.asn1 without changes x509_parser.h without changes x509_cert_parser.c with changes marked as __UBOOT__ x509_public_key.c with changes marked as __UBOOT__ Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * lib: crypto: add rsa public key parserAKASHI Takahiro2019-12-065-0/+281
| | | | | | | | | | | | | | | | | | Imported from linux kernel v5.3: rsapubkey.asn1 without changes rsa.h without changes rsa_helper.c with changes marked as __UBOOT__ Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * lib: crypto: add public key utilityAKASHI Takahiro2019-12-066-0/+1251
| | | | | | | | | | | | | | | | | | | | Imported from linux kernel v5.3: asymmetric-type.h with changes marked as __UBOOT__ asymmetric_type.c with changes marked as __UBOOT__ public_key.h with changes marked as __UBOOT__ public_key.c with changes marked as __UBOOT__ Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * lib: add oid registry utilityAKASHI Takahiro2019-12-065-0/+520
| | | | | | | | | | | | | | | | | | Imported from linux kernel v5.3: build_OID_registry without changes oid_registry.h without changes oid_registry.c with changes marked as __UBOOT__ Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * doc: add README for asn1 compiler and decoderAKASHI Takahiro2019-12-061-0/+40
| | | | | | | | | | | | | | This document gives a brief description about ASN1 compiler as well as ASN1 decoder. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * lib: add asn1 decoderAKASHI Takahiro2019-12-063-0/+533
| | | | | | | | | | | | | | Imported from linux kernel v5.3: lib/asn1_decoder.c with changes marked as __UBOOT__ Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * Makefile: add build script for asn1 parsersAKASHI Takahiro2019-12-062-1/+4
| | | | | | | | | | | | This rule will be used to build x509 and pkcs7 parsers. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * cmd: add asn1_compilerAKASHI Takahiro2019-12-067-2/+1793
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Imported from linux kernel v5.3: asn1.h without changes asn1_ber_bytecode.h without changes asn1_decoder.h without changes asn1_compiler.c without changes This host command will be used to create a ASN1 parser, for example, for pkcs7 messages or x509 certificates. More specifically, it will generate *byte code* which will be interpreted by asn1 decoder library. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * linux/time.h: include vsprintf.hAKASHI Takahiro2019-12-061-0/+1
| | | | | | | | | | | | | | Without this commit, time.h possibly causes a build error as asctime_r() uses sprintf(). Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * include: kernel.h: include printk.hAKASHI Takahiro2019-12-061-1/+1
| | | | | | | | | | | | | | | | Adding "printk.h" will help improve portability from linux kernel code (in my case, lib/asn1_decoder.c and others) where printf and pr_* variant functions are used. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * lib: add mktime64() for linux compatibilityAKASHI Takahiro2019-12-062-0/+30
| | | | | | | | | | | | | | This function will be used in lib/crypto/x509_cert_parser.c, which will also be imported from linux code in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * rtc: move date.c from drivers/rtc/ to lib/AKASHI Takahiro2019-12-066-4/+9
| | | | | | | | | | | | | | | | In the next commit, rtc_mktime(), for compatibility with linux, will be implemented using rtc_mktime(), which is no longer drivers/rtc specific. So move this file under lib/. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * rtc.h: add struct udevice declarationAKASHI Takahiro2019-12-061-0/+2
| | | | | | | | | | | | Without this change, including rtc.h solely will cause a build error. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * linux_compat: move kmemdup() from ubifs.c to linux_compat.cAKASHI Takahiro2019-12-062-18/+20
| | | | | | | | | | | | | | | | | | | | linux_compat.c is the best place for kmemdup(), which is currenly used only in ubifs.c, but will also be used when other kernel files (in my case, lib/crypto/x509_cert_parser.c and pkcs7_parser.c) will be imported. So just move it. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * cmd: pxe: Fix checkpatch WARNING/CHECKPatrice Chotard2019-12-061-7/+6
| | | | | | | | | | | | Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
| * cmd: sysboot: Fix checkpatch WARNING/CHECKPatrice Chotard2019-12-061-13/+12
| | | | | | | | | | | | Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
| * cmd: pxe_utils: Fix checkpatch WARNING/CHECKPatrice Chotard2019-12-061-47/+46
| | | | | | | | | | | | Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
| * cmd: sysboot: Create a sysboot command dedicated filePatrice Chotard2019-12-065-132/+143
| | | | | | | | | | | | | | | | Extract all sysboot command related code from pxe.c to new sysboot.c Update Kconfig to insure that DISTRO_DEFAULT select new CMD_SYSBOOT command. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
| * cmd: Prepare sysboot command independencePatrice Chotard2019-12-064-1417/+1444
| | | | | | | | | | | | | | | | As sysboot and pxe commands are sharing piece of code, migrate this common code into a new file pxe_utils.c to prepare sysboot command code extraction from pxe.c Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
| * cmd: Migrate from_env() from pxe.c to nvedit.cPatrice Chotard2019-12-063-17/+27
|/ | | | | | Migrate from_env() from pxe.c to nvedit.c as it's not pxe specific. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* Merge tag 'u-boot-rockchip-20191206' of ↵WIP/06Dec2019Tom Rini2019-12-0624-45/+973
|\ | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip - rockchip pwm driver update to support all the SoCs - RK3308 GMAC and pinctrl support - More UART interface support on PX30 and pmugrf reg fix - Fixup on misc for eth_addr/serial# - Other updates on variant SoCs
| * rockchip: allow loading larger kernelsBen Wolsieffer2019-12-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent versions of the Linux kernel with many options enabled have grown large enough to overwrite the beginning of the initrd. For example, the kernel I use on my Rock64 and RockPro64 is 34.1 MiB, while only 31.5 MiB are available between kernel_addr_r and ramdisk_addr_r. This patch moves ramdisk_addr_r up by 32 MiB on the RK3328 and RK3399, allowing for much larger kernels. Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * rockchip: rk3328: rock64: enable CONFIG_MISC_INIT_RBen Wolsieffer2019-12-061-0/+1
| | | | | | | | | | | | | | This enables reading of the cpuid and a static MAC address. Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * pinctrl: rockchip: Add pinctrl support for rk3308David Wu2019-12-064-1/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | An iomux register contains 8 pins, each of which is represented by 2 bits, but the register offset is 0x8. For example, GRF_GPIO0A_IOMUX offset is 0x0, but GRF_GPIO0B_IOMUX offset is 0x8, the offset 0x4 is reserved. So add a type IOMUX_8WIDTH_2BIT to calculate offset. Signed-off-by: David Wu <david.wu@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * arm: rockchip: rk3308: Initialize the iomux configurationDavid Wu2019-12-061-0/+37
| | | | | | | | | | | | | | | | When we want to use plus pinctrl feature, we need to enable them at spl. Signed-off-by: David Wu <david.wu@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * pwm: rk_pwm: Make PWM driver to support all Rockchip SocsDavid Wu2019-12-062-25/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PWM driver can be used to support pwm functions for on all Rockchip Socs. The previous chips than RK3288 did not support polarity, and register layout was different from the RK3288 PWM. The RK3288 keep the current functions. RK3328 and the chips after it, which can support hardware lock, configure duty, period and polarity at next same period, to prevent the intermediate temporary state. Signed-off-by: David Wu <david.wu@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * dts: rk3308: Enable ethernet function supported for Firefly ROC_RK3308_CCDavid Wu2019-12-061-0/+9
| | | | | | | | | | | | | | | | The Firefly ROC_RK3308_CC use ref_clock of input mode, and rmii pins of m1 group. Signed-off-by: David Wu <david.wu@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * arm: dts: Add mac node for rk3308 at dtsi levelDavid Wu2019-12-061-0/+22
| | | | | | | | | | | | | | | | The rk3308 only support RMII mode, and if it is output clock mode, better to use ref_clk pin with drive strength 12ma. Signed-off-by: David Wu <david.wu@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * net: gmac_rockchip: Add support for rk3308David Wu2019-12-061-0/+65
| | | | | | | | | | | | | | | | Add the glue code to allow the rk3308 variant of the Rockchip gmac to provide network functionality. Signed-off-by: David Wu <david.wu@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * rockchip: config: add support for firefly-px30 boardKever Yang2019-12-062-0/+114
| | | | | | | | | | | | | | | | | | This is a core board named Core-PX30-JD4 with a mainboard from Firefly, name it as firefly-px30 for now. This board can re-use the dts of PX30, the only difference is the UART IO, the firefly use UART2 M1 while evb use UART2 M0. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
| * rockchip: misc: protect serial# from getting overwrittenHeiko Stuebner2019-12-051-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | serial# is one of the vendor properties and thus protected from being overwritten if already set. If env_set is called anyway this result in some nasty warnings, so check for presence before trying that. In the same direction check for the presence of cpuid# and compare it to the actual hardware and emit a warning if they don't match. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * rockchip: misc: don't fail if eth_addr already setHeiko Stuebner2019-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | rockchip_setup_macaddr() runs from an initcall, so returning an error code will make that initcall fail thus breaking the boot process. And if an ethernet address is already set this is definitly not a cause for that, so just return success in that case. Fixes: 04825384999f ("rockchip: rk3399: derive ethaddr from cpuid"); Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * rockchip: px30: Add support for using UART3 as debug UARTPaul Kocialkowski2019-12-052-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some generic PX30 SoMs found in the wild use UART3 as their debug output instead of UART2 (used for MMC) and UART5. Make it possible to use UART3 as early debug output, with the associated clock and pinmux configuration. Two sets of output pins are supported (M0/M1). Future users should also note that the pinmux default in the dts is to use the M1 pins while the Kconfig option takes M0 as a default. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
| * rockchip: px30: Rename CONFIG_DEBUG_UART2_CHANNEL to CONFIG_DEBUG_UART_CHANNELPaul Kocialkowski2019-12-052-5/+5
| | | | | | | | | | | | | | | | | | | | UART3 also has two sets of pins that can be selected. Rename the config option to a common name, to allow it to be used for both UART2 and UART3. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>