Commit graph

77862 commits

Author SHA1 Message Date
Som.Qin
a5811ee9da starfive: apply VisionFive board changes
The VisionFive dts is base on Starlight dts, and the difference of
rst gpio, eeprom and gmac should be applied.

Signed-off-by: Som.Qin <som.qin@starfivetech.com>
2022-02-15 17:48:26 +08:00
Wei Fu
d434b5243d starfive: add ID_EEPROM supoort for visionfive V1
This patch add ID_EEPROM (mac command) support for visionfive V1.

Signed-off-by: Wei Fu <wefu@redhat.com>
2022-02-15 17:48:26 +08:00
Jianlong Huang
8bd2d61d93 configs: starfive: update jh7100.h for importing u74_uEnv.txt for testing
Signed-off-by: Jianlong Huang <jianlong.huang@starfivetech.com>
2022-02-15 17:48:25 +08:00
Yanhong Wang
2a7a9c34bd drivers/net/phy/marvell: setup LED config for JH7100 EVB 2022-02-15 17:48:25 +08:00
SW Multimedia
dd19b77c45 starfive: GPIO pin init
This patch should be removed, once we can do GPIO pin init
in secondboot or ddrinit

Include:
starfive: Add init GPIO for ALSA audio framework
starfive: remove useless gpio operation

Signed-off-by: sw.multimedia <sw.multimedia@starfivetech.com>
Signed-off-by: michael.yan <michael.yan@starfivetech.com>
Signed-off-by: andy.hu <andy.hu@starfivetech.com>
2022-02-15 17:48:25 +08:00
Bo Li
f51ecad0d1 starfive: Modify designware driver for JH7100
This patch is using internal RAM to improve performance
(avoid flushing L2 cache): Modify designware driver by:
1, Modify gtxclk configuration by phydev->speed
2, Add Preseted mem support for mac descrtables and buffs
3, disable DMA memory range check when building for JH7100
2022-02-15 17:48:25 +08:00
Tekkaman Ninja
0b5dbb97f1 [TEMP]jh7100: remove "depends on DM_ETH || !NET" in EFI_LOADER
This patch reverses some part of change in:
        commit eac6e0b797
        Author: Simon Glass <sjg@chromium.org>
        Date:   Fri Sep 24 18:30:17 2021 -0600
        efi_loader: Drop code that doesn't work with driver model
        ...
Since JH7100 ETH driver haven't supported DM yet.
2022-02-15 17:48:25 +08:00
SW Multimedia
73009927d3 starfive(multimedia): Add pwmdac pinctl and keep 0,2,3,45 gpio for i2s to dts 2022-02-15 17:48:25 +08:00
SW Multimedia
473071c093 starfive(multimedia): apply starfive v4l2 pinctl to dts
Signed-off-by: SW Multimedia <sw.multimedia@starfivetech.com>
2022-02-15 17:48:25 +08:00
SW Multimedia
5d5ed576bd starfive: apply the pinctl to dts 2022-02-15 17:48:25 +08:00
Andy Hu
99efb19539 starfive: Add v4l2 video sensor device and DRM framework in dts
Signed-off-by: SW Multimedia <sw.multimedia@starfivetech.com>
Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
Signed-off-by: David Li <david.li@starfivetech.com>
Signed-off-by: Keith Zhao <keith.zhao@starfivetech.com>
Signed-off-by: Curry Zhang <curry.zhang@starfivetech.com>
2022-02-15 17:48:25 +08:00
SW Multimedia
e92f77ff23 starfive: dtsi fix for dma2p 2022-02-15 17:48:25 +08:00
SW Multimedia
5ab85f9d11 starfive: Add more audio codecs support in dts 2022-02-15 17:48:25 +08:00
SW Multimedia
615976b480 starfive: add clock info in dts for audio 2022-02-15 17:48:25 +08:00
SW Multimedia
6ca4c6e60b starfive: add i2c dev info in dts for audio 2022-02-15 17:48:25 +08:00
Jianlong.Huang
036f72e637 starfive: add JH7100 VisionFive V1 Support.
Signed-off-by: Jianlong.Huang <jianlong.huang@starfivetech.com>
2022-02-15 17:48:25 +08:00
Wei Fu
1356a825d9 starfive: fix dts(linux)
1, ccache
2, mmc
    This patch adds the necessary info for mmc driver:
    bus-width = <4>;
    max-frequency = <?0000000>;

3, uart0(console)
4, SPI Nor Flash
5, Switch dtb to linux dts
2022-02-15 17:48:25 +08:00
Emil Renner Berthing
724d2a288a starfive: Porting jh7100-beaglev-starlight.dts from linux
https://github.com/starfive-tech/linux
2022-02-15 17:48:25 +08:00
Micheal Zhu
6d3fbb8c00 starfive: Add JH7100 support
This patch adds StarFive JH7100 main support, including Starlight and EVB
support, ported from StarFive HiFive_U-Boot REPO.

    The original authors are
    Bo Li <bo.li@starfivetech.com>
    JieQin Chen <Jessica.Chen@starfivetech.com>
    Huan Feng <huan.feng@starfivetech.com>
    Jack Zhu <jack.zhu@starfivetech.com>
    Jianlong Huang <jianlong.huang@starfivetech.com>
    Ke Zhu <ke.zhu@starfivetech.com>
    Micheal Zhu <michael.zhu@starfivetech.com>
    Samin Guo <samin.guo@starfivetech.com>
    Yanhong Wang <yanhong.wang@starfivetech.com>
    Yiming Li <yiming.li@starfivetech.com>

Note:
    1, disable BTRFS(will trigger a link error with *some* RV64 GCC)
    But RV64 GCC on Fedora works well with enabling BTRFS.

    BTRFS will select ZSTD which will trigger a link error with
    *some* RV64 GCC:
    ---
    riscv64-unknown-linux-gnu-ld.bfd: /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/libgcc.a(_clzsi2.o): can't link double-float modules with soft-float modules
    riscv64-unknown-linux-gnu-ld.bfd: failed to merge target specific data of file /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/libgcc.a(_clzsi2.o)
    riscv64-unknown-linux-gnu-ld.bfd: /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/libgcc.a(_clz.o): can't link double-float modules with soft-float modules
    riscv64-unknown-linux-gnu-ld.bfd: failed to merge target specific data of file /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/libgcc.a(_clz.o)
    make: *** [Makefile:1787: u-boot] Error 1
    ---

    2, enable OF_SEPARATE:
    This is required so that openSBI can add itself to /reserved-memory, and
    let EFI know about it.

    By Andreas Schwab <schwab@suse.de>

    3, Set default fdtfile name

    By Andreas Schwab <schwab@suse.de>
2022-02-15 17:48:25 +08:00
Wei Fu
4954df51e4 starfive: Add JH7100 MMC driver support
This driver modified from snps_dw_mmc.c

Signed-off-by: Wei Fu <wefu@redhat.com>
2022-02-15 17:48:24 +08:00
Wei Fu
d39e78ba61 starfive: add JH71x0 serial driver
This driver ported from NS16550 Serial Port driver, It is a simplified
version of drivers/serial/ns16550.c
We may can merge it to ns16550 later.

Signed-off-by: Wei Fu <wefu@redhat.com>
2022-02-15 17:48:24 +08:00
Yanhong Wang
c71bf24ac3 starfive: add OTP driver for jh7100
Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
2022-02-15 17:48:24 +08:00
Wei Fu
b3f2cfad94 sifive: make WayEnable can be configured by menuconfig
Signed-off-by:Wei Fu <wefu@redhat.com>
2022-02-15 17:48:24 +08:00
Wei Fu
954644d8f5 sifive_cache: add flush_range func in sifive cache driver
Signed-off-by: Wei Fu <wefu@redhat.com>
2022-02-15 17:48:24 +08:00
Wei Fu
28db513a7d cache: add flush_range interface in cache_ops struct
Signed-off-by: Wei Fu <wefu@redhat.com>
2022-02-15 17:48:24 +08:00
Wei Fu
ae8609677b riscv: add reset_misc function (__weak)
Signed-off-by: Wei Fu <wefu@redhat.com>
2022-02-15 17:48:24 +08:00
Jianlong.Huang
803349d956 cmd/eeprom: fix data type issue for parse_numeric_param
This patch fixs parse_numeric_param issue on some platfrom which has
different sizes of int and long, like riscv64.

On riscv64, int is 4 bytes, but long is 8 bytes.

on this situation:
ulong addr = parse_numeric_param(argv[index]);

if argv[index] is "0x80000000", this "ulong addr" will be
0xffffffff80000000.

Signed-off-by: Jianlong.Huang <jianlong.huang@starfivetech.com>
Co-developed-by: Wei Fu <wefu@redhat.com>
Signed-off-by: Wei Fu <wefu@redhat.com>
2022-02-15 17:48:24 +08:00
Walker Chen
4793fbc0f0 net/phy: add YuTai Corp Ethernet PHYs(YT8511/YT8521) driver
This pathch adds YuTai Corp Ethernet PHYs(YT8511/YT8521) support.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
2022-02-15 17:48:24 +08:00
Tom Rini
ab8903a24d configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-02-14 22:21:29 +00:00
Tom Rini
8a4ef8786f Prepare v2022.04-rc2
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-02-14 17:03:08 -05:00
Tom Rini
139e049732 Merge branch '2022-02-14-assorted-fixes'
- Fix for pstore already being in the DT, "setlocalversion" script
  bugfix and pdu001 platform bugfix
2022-02-14 14:18:45 -05:00
Felix Brack
9f0deae6d5 arm: pdu001: Fix dt to work with the current am33xx dtsi files
The changes introduced with commit 6337d53fdf ("arm: dts: sync am33xx
with Linux 5.9-rc7") prevent the PDU001 from operating correctly.
This patch fixes the configuration of the pin multiplexer and uart3.

Signed-off-by: Felix Brack <fb@ltec.ch>
2022-02-14 13:04:39 -05:00
Nikita Maslov
609177140b scripts: setlocalversion: remove quotes around localversion from config
After replacing of include/config/auto.conf sourcing with
extraction of CONFIG_LOCALVERSION, resulting version string
contains quotes around localversion part which are always
present in auto.conf (even if localversion is empty).

This patch fixes this script to remove quotes.

Signed-off-by: Nikita Maslov <wkernelteam@gmail.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-02-14 13:04:39 -05:00
Detlev Casanova
ac52cba63f pstore: Support already existing reserved-memory node
The pstore command tries to create a reserved-memory node but fails if
it is already present with:

    Add 'reserved-memory' node failed: FDT_ERR_EXISTS

This patch creates the node only if it does not exist and adapts the reg
values sizes depending on already present #address-cells and #size-cells
values.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
2022-02-14 13:03:49 -05:00
Tom Rini
162c22bfbc Pull request for efi-2022-04-rc2-4
Documentation:
 
 * mkeficapsule man-page
 
 UEFI changes:
 
 * add support for signing images to mkeficapsule
 * add support for user define capsule GUID
 * adjust unit tests for capsules
 * fix UEFI image signature validation in case of multiple signatures
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmIGtKEACgkQxIHbvCwF
 GsSWlg//Vr61dpbpPVuczl18OtojpUzMg8bwqc4tJQRQrOGMGjmPqrGZJCm1pmMH
 Q5ZD4QCAdycbRqAqcpdX9FXHmD5R0HvGmhlC9TnXxo4nKaOcphMMC3PFjBQZlhPJ
 KPc7jjoIcycz+fRqbd4CGRFXNGJAecK++4uM6v6WCNF3Dq16r0ws1aUTG7YPlaJF
 JNo3/4eEQpRsplNXpJsqVPQhbfLuaiCOJc8VUWYNylRdhBC7Dx8yI7m1FHOSBbKb
 Pk4tbysEhowcSc2Duc9muxkaVAkSy/mIHj1I8Z2VzpzH8zXcaiHMjROqMGOE+vwx
 raDzJI0ZcEV/MEbm/QLCALlCKqN3d1NRmZLAvXPYN4+ioA8lzPAEnqEywXRPY/Yk
 KnkDWaF1KEKzDaY52oqkh2LkasY9wzluvb1sm+oW9bh/kn4wKLr0Z1oSl92/vvci
 S/ztLqxhqlXpWx0NzOFnNvUUkEl0VN6IM/+Bsg5AoO7mdWe7MC3iSPOU1Ge5wRU9
 R9BLaTrr61/+soc2jrJL5PQr3Rqtyo1qLpIusMFT88jeFp0b8AIUL2AUlJsAUXYg
 a2NV7qGUsZN/Ur488N1t7DixTkjGdStHKRk06bSTPrOpfA2oembdA2/H/HECoJMP
 JzdwMeZM0qcxFGTbC7c3yO3cTVVYPyIDGh1YEBYjCzfL6AuR2uU=
 =AAdJ
 -----END PGP SIGNATURE-----

Merge tag 'efi-2022-04-rc2-4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc2-4

Documentation:

* mkeficapsule man-page

UEFI changes:

* add support for signing images to mkeficapsule
* add support for user define capsule GUID
* adjust unit tests for capsules
* fix UEFI image signature validation in case of multiple signatures
2022-02-11 15:11:52 -05:00
Ilias Apalodimas
72b509b701 test/py: efi_secboot: adjust secure boot tests to code changes
The previous patch is changing U-Boot's behavior wrt certificate based
binary authentication.  Specifically an image who's digest of a
certificate is found in dbx is now rejected.  Fix the test accordingly
and add another one testing signatures in reverse order

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-02-11 20:07:55 +01:00
Ilias Apalodimas
54cebe8a3a efi_loader: fix dual signed image certification
The EFI spec allows for images to carry multiple signatures. Currently
we don't adhere to the verification process for such images.

The spec says:
"Multiple signatures are allowed to exist in the binary's certificate
table (as per PE/COFF Section "Attribute Certificate Table"). Only one
hash or signature is required to be present in db in order to pass
validation, so long as neither the SHA-256 hash of the binary nor any
present signature is reflected in dbx."

With our current implementation signing the image with two certificates
and inserting both of them in db and one of them dbx doesn't always reject
the image.  The rejection depends on the order that the image was signed
and the order the certificates are read (and checked) in db.

While at it move the sha256 hash verification outside the signature
checking loop, since it only needs to run once per image and get simplify
the logic for authenticating an unsigned imahe using sha256 hashes.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
e012550cd7 test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE
Before the capsule authentication is supported, this test script works
correctly, but with the feature enabled, most tests will fail due to
unsigned capsules.
So check the results depending on CAPSULE_AUTHENTICATE or not.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
e9b74979b4 test/py: efi_capsule: add a test for "--guid" option
This test scenario tests a new feature of mkeficapsule, "--guid" option,
which allows us to specify FMP driver's guid explicitly at the command
line.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
460c94a2c7 test/py: efi_capsule: align with the syntax change of mkeficapsule
Since the syntax of mkeficapsule was changed in the previous commit,
we need to modify command line arguments in a pytest script.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
d9612f4426 tools: mkeficapsule: allow for specifying GUID explicitly
The existing options, "--fit" and "--raw," are only used to put a proper
GUID in a capsule header, where GUID identifies a particular FMP (Firmware
Management Protocol) driver which then would handle the firmware binary in
a capsule. In fact, mkeficapsule does the exact same job in creating
a capsule file whatever the firmware binary type is.

To prepare for the future extension, the command syntax will be a bit
modified to allow users to specify arbitrary GUID for their own FMP driver.
OLD:
   [--fit <image> | --raw <image>] <capsule file>
NEW:
   [--fit | --raw | --guid <guid-string>] <image> <capsule file>

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
bad58cb308 test/py: efi_capsule: add image authentication test
Add a couple of test cases against capsule image authentication
for capsule-on-disk, where only a signed capsule file with the verified
signature will be applied to the system.

Due to the difficulty of embedding a public key (esl file) in U-Boot
binary during pytest setup time, all the keys/certificates are pre-created.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
a62eb06f7c doc: update UEFI document for usage of mkeficapsule
Now we can use mkeficapsule command instead of EDK-II's script
to create a signed capsule file. So update the instruction for
capsule authentication.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
118a0ecd6d tools: mkeficapsule: add man page
Add a man page for mkeficapsule command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
16abff246b tools: mkeficapsule: add firmware image signing
With this enhancement, mkeficapsule will be able to sign a capsule
file when it is created. A signature added will be used later
in the verification at FMP's SetImage() call.

To do that, we need specify additional command parameters:
  -monotonic-cout <count> : monotonic count
  -private-key <private key file> : private key file
  -certificate <certificate file> : certificate file
Only when all of those parameters are given, a signature will be added
to a capsule file.

Users are expected to maintain and increment the monotonic count at
every time of the update for each firmware image.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
9af16cc8f1 tools: build mkeficapsule with tools-only_defconfig
Add CONFIG_TOOLS_MKEFICAPSULE. Then we want to always build mkeficapsule
if tools-only_defconfig is used.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-02-11 20:07:55 +01:00
AKASHI Takahiro
9ebfc6ba5b CI: enforce packages upgrade for Msys2 on Windows
We need to install libgnutls-devel package to build the host tool,
mkeficapsule, and as of now, there seems to be a depencency conflict
in the current msys2 installer;

   :: installing libp11-kit (0.24.1-1) breaks dependency \
	'libp11-kit=0.23.22' required by p11-kit

To resolve this conflict, however, the initial "pacman -Syyuu" in
'tools_only_windows' job is not enough. Another "pacman -Su" will
enforce all the out-of-date packages being upgraded.
(Probably the first "-Syyuu" can be changed to "-Syu".)

See the installation steps in
  https://www.msys2.org/

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-02-11 20:07:55 +01:00
Tom Rini
dd1c255cbc Merge branch '2022-02-11-assorted-updates-and-fixes'
A partial list:
- fw_env updates, a new testcase for mkimage -o ..., nop-phy reset-gpios
  support, DFU updates, kaslr-seed support in extlinux.conf, modern
  "partitions" support in mtd device tree
2022-02-11 12:02:31 -05:00
Heinrich Schuchardt
73cde90c8b test: test field truncation in snprint()
The output size for snprint() should not only be respected for whole fields
but also with fields. Add more tests.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-02-11 11:29:23 -05:00
Adam Ford
3970c82a60 phy: nop-phy: Enable reset-gpios support
Some usb-nop-xceiv devices use a gpio take them out
of reset.  Add a reset function to put them into that
state.  This is similar to how Linux handles the
usb-nop-xceiv driver.

Signed-off-by: Adam Ford <aford173@gmail.com>
2022-02-11 11:29:23 -05:00