Commit graph

83124 commits

Author SHA1 Message Date
Bryan Brattlof
0820e117c3 doc: ti: reorganize existing ti docs
Texas Instruments produces quite a lot of SoCs based upon a common
architecture 'generation'. (eg: OMAP, K3) TI's existing documentation
layout makes noticing this generation jump rather difficult.

To make navigation easier, split the existing documentation into
individual SoC families so we may begin grouping them according to their
generational (eg: OMAP, K3) families.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-12-29 10:51:50 +01:00
Tom Rini
adcee0791f Merge https://source.denx.de/u-boot/custodians/u-boot-pmic
- power: regulator: Add support for NPCM8xx
2022-12-26 21:00:20 -05:00
Jim Liu
dbedf4a56b power: regulator: Add support for NPCM8xx
Add support for setting nuvoton BMC NPCM845 voltage supply.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2022-12-26 15:44:00 +09:00
Tom Rini
e1befc8512 OP-TEE autodiscovery
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmOlZoUACgkQgS8AYozs
 +qIqDA//QLRmx5+Rq8+MkXar6Xpt6nP877+onIxJLeZ4RaNY1I9EIv2hjHcR5NpB
 Wj4K4wP7EQobHTfMDD2owEJ5jOPjmMgYrd8j+7g8q+G7160JTYV6FDxYa3V6b55/
 qifW8T6eTyeaNwKEZyLb7+aNHJ/ULx51RQ8AlTM+ttv2iiYeB7+DegqdF3Df6hjT
 8uFHOPX0+ln+8UUKHCm0NKxUsply4qGlJiuK99Pq1xnGTxyZ1G1+qqXvuFazGOZm
 wHm1Ha08hep6Ye2azjBof8FdA7cjM//7SSUgOctEf1agloxblmt26XfDsxn0U3Oa
 5AbGLrPnL5KJjv/ij5TeaAGdOYPhsgsKJj3vwbbdoARLOb3x91rt7e/ZtThrKcF5
 Ygj0+vpnRzLzgfqqSg90OfWW4NBFNPyXl6qG1ykQrKtnVMDrBofFIcqemwpn9moe
 4Ybx/28Vj1vXLpdt9JDR2vVrmJuPookrUBkTcMMRrrB2zBDF6hGx5wmit8pYZV+R
 CfhyzEzq4WrHXijxmNN56GtnpYVp8GQGaDJy1Fo4BZ8f5h85zvUyfplYyeVsejru
 T3HvvEjRgBjZvEzDh3zj6MI37SYQX4vT5FESBhv+Yab7tl2kp1DLKlVtM9UyvJpt
 RuDt6FOMkFXwLO1JjmAfgn2u4L7TdEdThCceY+G8ElAP4OgpWiA=
 =1O+t
 -----END PGP SIGNATURE-----

Merge tag 'tpm-23122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm

OP-TEE autodiscovery
2022-12-23 07:46:41 -05:00
Tom Rini
24a0a00f07 Merge branch '2022-12-22-assorted-important-fixes'
- Split up the aarch64 Azure CI job more, to avoid time limits, nuvoton
  network fix, SPL_OPTEE_IMAGE dependency fix, some fixes to the IPv6
  code, PowerPC build flag fixes, silence pylibfdt version warning.
2022-12-23 07:44:30 -05:00
Etienne Carriere
fe8a4ed011 tee: optee: discover services dependent on tee-supplicant
Makes OP-TEE to enumerate also services depending on tee-supplicant
support in U-Boot. This change allows OP-TEE services like fTPM TA
to be discovered and get a TPM device registered in U-Boot.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-23 10:26:15 +02:00
Etienne Carriere
476a3d58df tee: optee: don't fail probe because of optee-rng
Fixes optee-rng driver bind sequence in optee driver to print a warning
message but not report an error status when a optee-rng service driver
fails to be bound as the optee driver itself is still fully functional.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-23 10:26:11 +02:00
Marek Vasut
440098c42e pylibfdt: Fix version normalization warning
Fix the following version normalization warning:
"
/usr/lib/python3/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '2023.01' to '2023.1'
"

Using suggestion from Richard Jones:
https://github.com/pypa/setuptools/issues/308#issuecomment-405817468

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-22 15:39:13 -05:00
Jim Liu
dd5f07eb6b net: nuvoton: fix build broken for use phy_get_interface_by_name
The original patch is use phy_get_interface_by_name to set interface.
The new patch is use dev_read_phy_mode to replace it.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-12-22 15:39:13 -05:00
Pali Rohár
1db706edcd powerpc/mpc85xx: Disable AltiVec and VSX instructions
All vector instructions on powerpc mpc85xx must not be used because U-Boot
does not enable them. Usage cause random crashes. SPE vector instructions
are already disabled by compiler flags, so disable also AltiVec and VSX
vector instructions.

Linux kernel disables AltiVec and VSX instructions too.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-12-22 15:39:13 -05:00
Pali Rohár
138b6061a1 powerpc/mpc85xx: Improve disabling of SPE instructions
Specifying -mspe=no also disables usage of SPE instructions. It is
documented in "[PATCH,rs6000] make -mno-spe work as expected" email:
http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html

So replace -mspe=yes by -mspe=no, so make it clear that u-boot has to be
compiled without SPE instructions.

Linux kernel contains following Makefile code to achieve it:

    # No SPE instruction when building kernel
    # (We use all available options to help semi-broken compilers)
    KBUILD_CFLAGS += $(call cc-option,-mno-spe)
    KBUILD_CFLAGS += $(call cc-option,-mspe=no)

Do same for U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-12-22 15:39:13 -05:00
Pali Rohár
c0d0569cf6 powerpc/mpc85xx: Pass correct cpu compiler flags
When gcc's default cpu (selected by --with-cpu= during gcc's configure
phase) does not match target U-Boot board cpu then U-Boot binary does not
have to be compiled correctly. Lot of distributions sets gcc's default cpu
to generic powerpc variant which works fine.

U-Boot already pass -Wa,-me500 flag to gcc which instructs GNU AS to accept
e500 specific instructions when processing assembler source files (.S).

This affects also assembly files generated by gcc from C source files. And
because gcc for generic powerpc cpu puts '.machine ppc' at the beginning of
the generated assembly file, it basically overwrites -me500 flag by which
was GNU AS invoked (from U-boot build system).

It started to be an issue since binutils 2.38 which does not keep enabled
extra functional units selected by previous cpu. Hence issuing directive
'.machine ppc' (generated by gcc for generic powerpc) after '.machine e500'
(specifying at command line) disables usage of e500 specific instructions.

And compiling arch/powerpc/cpu/mpc85xx/tlb.c code throws following
assembler errors:

    {standard input}: Assembler messages:
    {standard input}:127: Error: unrecognized opcode: `tlbre'
    {standard input}:418: Error: unrecognized opcode: `tlbre'
    {standard input}:821: Error: unrecognized opcode: `msync'
    {standard input}:821: Error: unrecognized opcode: `tlbwe'
    {standard input}:884: Error: unrecognized opcode: `tlbsx'

This issue was already hit by Debian people and is reported in bug tracker:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003490

Calling gcc with -mcpu=8540 flag fixes this issue because -mcpu=8540 tells
gcc to compile code for e500 core/cpu (overwriting gcc's default cpu) and
does not put '.machine ppc' directive into assembly anymore.

Also if gcc is invoked with -mcpu=8540 then it pass -me500 flag to GNU AS.
So it is unnecessary to manually specify -Wa,-me500 flag because it is
implicitly added.

Fix this issue properly by specifying correct -mcpu compiler flag for all
supported powerpc cores in U-Boot mpc85xx platform, which are: e500v1,
e500v2, e500mc, e5500 and e6500. For specifying e500v1 and e500v2 cores,
gcc has unintuitive -mcpu=8540 and -mcpu=8548 flag names, for other cores
-mcpu matches core name.

The only difference between gcc's -mcpu=8540 and -mcpu=8548 flags is
support for double precision floating point SPE instructions. As U-Boot
does not use floating point, it is fine to use -mcpu=8540 for both e500v1
and e500v2 cores. Moreover gcc 9 completely removed e500 floating point
support, so since gcc 9 -mcpu=8548 is just alias to -mcpu=8540.

Note that U-Boot's CONFIG_E500 option is set also for other cpus, not only
for e500v1 and e500v2. So do not check for CONFIG_E500 and rather set e500
as last fallback value when no other mpc85xx cpu matches.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-12-22 15:39:13 -05:00
Heinrich Schuchardt
56e3b14703 net: don't memcpy to NULL
In ndisc_receive() 7 bytes are copied from a buffer of size 6 to NULL.

net_nd_packet_mac is a pointer. If it is NULL, we should set it to the
address of the buffer with the MAC address.

Addresses-Coverity-ID: 430974 ("Out-of-bounds access")
Fixes: c6610e1d90 ("net: ipv6: Add Neighbor Discovery Protocol (NDP)")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
2022-12-22 15:39:13 -05:00
Viacheslav Mitrofanov
0d6d5a4aa6 net: ipv6: Add missing break into IPv6 protocol handler
IPv6 protocol handler is not terminated with a break statment.
It can lead to running unexpected code.

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2022-12-22 15:39:13 -05:00
Jagan Teki
f365971229 spl: Kconfig: Fix SPL_OPTEE_IMAGE dependency
fdt_addr will build as part of SPL_LOAD_FIT or SPL_LOAD_FIT_FULL
which is indeed required to build optee image support in SPL.

common/spl/spl.c: In function ‘jump_to_image_optee’:
common/spl/spl.c:220:46: error: ‘struct spl_image_info’ has no member named ‘fdt_addr’
  220 |         spl_optee_entry(NULL, NULL, spl_image->fdt_addr,

Fix the dependency support.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
2022-12-22 15:39:13 -05:00
Tom Rini
dcb0cc0169 CI: Reduce aarch64 catchall job matches
The aarch64 catch-all job is getting close to the hard time limit in
Azure for the free tier. Move i.MX9 boards to the i.MX8 job and move
amlogic entirely to its own job. This brings us down from 85 boards to
51 boards and so should be safe for a while.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-22 15:39:13 -05:00
Tom Rini
1154e965d0 Pull request for efi-2023-01-rc5
UEFI:
 
 * Improve parameter checking in efi_get_next_variable_name_mem()
 * Fix a bugs in management of security database via the eficonfig command
 
 Other:
 
 * Allow sound command to play multiple sounds
 -----BEGIN PGP SIGNATURE-----
 
 iQJWBAABCABAFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmOh4MsiHGhlaW5yaWNo
 LnNjaHVjaGFyZHRAY2Fub25pY2FsLmNvbQAKCRCE7i+CcTdTS6WLEADGtNSMvG+x
 qNBH+2jZc8PnslzXY3FfugSpk29FOFKj4SHwt3p/Du1VPhw1KHWl5gOYTTw/GizI
 t7yfHavyttzUuHoCa2uKUTYN6RDTCHUgzpyGaXCuh89ls1xilzq3YxVcQ9RYeKM1
 lmNIC9rGmTxsWui5VgczkrBzsp8gBj2hs0C+nqJIP+JPGQT1XlA5KXmECsZn8+fi
 GRvGuuflSDzszHOdRClzrtWNt6kLTpNu8D6UormIrTGrHSdDBwO9QFXOyt9qOnA+
 /aboHSd5Oc5BApatTUtRwGoxm0Jm7hujA1EhX6wDsILE/+zMXjmsXS/mbRegYFXY
 Xzu/Wif4ARexECMe0zxHPHf+VA8QYi9QmELzic8Xen5WzHSRBVQd8BtLK/1ItYDT
 LrgPtoyY5eWd3gcjlhgimPPUEqsK45aYXftsv7NcH8K64Yj7UolJL1fcJm8tMkHt
 0ziiO4ZKZjJkJc4c4XUkWQadCnjqDciJkWfAp922PjoV2jBbf7EtNaynUnsiM/R8
 C4oZ7bD1m5gVFLvDsJ9OBy6qHdwRJTn/ETG5H8BlIJ60I9ZZxT4VoUqit+1HQjLx
 zvH98T8OM/N6d/+Q1fJvKg1QIQQxKHnExYBUBn/WxbeWupVe6K77C7TRE7HTz0tO
 A+VslTXg5i2XB1SfFrvvF7EpUtX/kqMOMQ==
 =d09r
 -----END PGP SIGNATURE-----

Merge tag 'efi-2023-01-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc5

UEFI:

* Improve parameter checking in efi_get_next_variable_name_mem()
* Fix a bugs in management of security database via the eficonfig command

Other:

* Allow sound command to play multiple sounds
2022-12-20 12:50:48 -05:00
Tom Rini
566bc672a7 fTPM privileged login
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmOhZqUACgkQgS8AYozs
 +qLoRg/+P/g+JiaJuxPTK37xR+qt+5zqBZhTwXTh72J7HO87zvjmIf5zSh6XSHFz
 c8GVNMfu9US+SwXcnivuuOWY8uJ01Nv9zGV+HkQ6o6XUsFfJRS847IiTle7PaNCF
 U5l2KX1k+RGRg2N8RHRFE5m3PU+F8ohz468kL2IMnvQCiAI30q4zYlwUTHURlM/Y
 XyH4qzs5WEDS223M1WJHy36e1FdJjpPa2GPcxZb4SZugcPXpI8Ptlf6H1iLolYmQ
 M3YpgtXxzmof95YLct9kaQX/722WCnwokB7P1H2Y7gblhkWdjytjmdexvQdt9UFk
 0tTMJZK/+P0teTOeylNhxSgMOvt4FaFRtGzGMd+8X2KuxzsGpdcVWjAKU+JVWE/g
 rL3k9G/GKYTnFQNX6YRM8nqo3kmnJHzo4lc+nDLKyc1M9m7zVPu6Nl8BebED3VMu
 N1CR2lG69VZUQfqA78NtCHNsjiHQbKiuLfzh1lfRLSEHcUE2yqmjFR0Dgw2sOjlM
 Um4ao+7Yef43DFub58Q9W5W51Kpwlg3ltGHpif3a2jCJfoAdnXoVKCN+I6/YvBUf
 8Mlwhtt0Zl8kMe321R6KPlYQRt0/b8lIr/IBWEvU0QD9rNuzOjN7WjN2qvBX6sS6
 1uh1+aYCyiiGsW9htLZRHZ0kxuntlx6QLQarHC5f5x3PbW/JnaE=
 =bvqT
 -----END PGP SIGNATURE-----

Merge tag 'tpm-20122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm

fTPM privileged login
2022-12-20 12:50:24 -05:00
Masahisa Kojima
ad50ca5019 eficonfig: EFI_VARIABLE_APPEND_WRITE is not set for null key
The signed null key with authenticated header is used to clear
the PK, KEK, db and dbx. When CONFIG_EFI_MM_COMM_TEE is enabled
(StMM and OP-TEE based RPMB storage is used as the EFI variable
storage), clearing KEK, db and dbx by enrolling a signed null
key does not work as expected if EFI_VARIABLE_APPEND_WRITE
attritube is set.

This commit checks the selected file is null key, then
EFI_VARIABLE_APPEND_WRITE attibute will not be used for the null key.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-12-20 16:06:48 +01:00
Heinrich Schuchardt
9ba35e64fa efi_selftest: conformance test for GetNextVariableName
Test that GetNextVariableName() checks the parameters.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-20 16:06:48 +01:00
Heinrich Schuchardt
70a4ac693d efi_loader: fix efi_get_next_variable_name_mem()
The VariableNameSize parameter is in bytes but u16_strnlen() counts u16.

Fix the parameter check for null termination.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-20 16:06:48 +01:00
Masahisa Kojima
645502743a eficonfig: avoid SetVariable between GetNextVariableName calls
The current code calls efi_set_variable_int() to delete the
invalid boot option between calls to efi_get_next_variable_name_int(),
it may produce unpredictable results.

This commit moves removal of the invalid boot option outside
of the efi_get_next_variable_name_int() calls.
EFI_NOT_FOUND returned from efi_get_next_variable_name_int()
indicates we retrieved all EFI variables, it should be treated
as EFI_SUCEESS.

To address the checkpatch warning of too many leading tabs,
combine two if statement into one.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-20 16:06:48 +01:00
Masahisa Kojima
ce3270849b eficonfig: carve out efi_get_next_variable_name_int calls
To retrieve the EFI variable name by efi_get_next_variable_name_int(),
the sequence of alloc -> efi_get_next_variable_name_int ->
realloc -> efi_get_next_variable_name_int is required.
In current code, this sequence repeatedly appears in
the several functions. It should be curved out a common function.

This commit also fixes the missing free() of var_name16
in eficonfig_delete_invalid_boot_option().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-20 16:06:48 +01:00
Heinrich Schuchardt
f823e32388 test: add unit test for u16_strnlen()
Add the missing unit test. It can be executed with:

    ut unicode u16_strnlen

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-20 16:06:48 +01:00
Heinrich Schuchardt
f9178e19a1 doc: correct heading level in printenv man-page
The 'Configuration' heading should be on level 2, not on level 1.

Fixes: eaa268589e ("doc: man-page for the printenv command")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-12-20 16:06:48 +01:00
Heinrich Schuchardt
ea58b9a404 cmd: allow sound command to play multiple sounds
Currently the sound command accepts only one value each for duration and
frequency. Allowing more duration and frequency arguments enables playing a
tune.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-20 16:06:48 +01:00
Etienne Carriere
33ba80303e tpm2: ftpm: open session with privileged ree login
Opens the fTPM session with TEE_LOGIN_REE_KERNEL as fTPM may restrict
access to that login when Linux based OS is running as applications are
expected to got through the Linux TPMv2 driver.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-20 09:37:36 +02:00
Tom Rini
2243922edc Prepare v2023.01-rc4
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-19 08:45:26 -05:00
Tom Rini
daa531cc5c Merge tag 'u-boot-rockchip-20221219' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
- Only call binman when TPL available;
- rk3128 DTS fix;
- Fix GPT table corruption for rk3399 puma ;
- Fix i2c for rk3399 Pinebookpro;
- Enable UEFI capsule update for RockPi4;
2022-12-19 08:33:24 -05:00
Sughosh Ganu
bdd3a47e02 rockpi4: capsule: Enable UEFI capsule update on RockPi4 boards
Enable the UEFI capsule update functionality on the RockPi4B and
RockPi4C boards. Support is being enabled for updating the idbloader
and u-boot firmware images residing on GPT partitioned uSD card
storage device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Sughosh Ganu
e86c789ca3 rockpi4: board: Add firmware image information for capsule updates
Add information that will be needed for enabling the UEFI capsule
update feature on the RockPi4 boards. With the feature enabled, it
would be possible to update the idbloader and u-boot.itb images on the
RockPi4B and RockPi4C variants.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Sughosh Ganu
bea9267d7e rockchip: capsule: Add functions for supporting capsule updates
Add functions needed to support the UEFI capsule update feature on
rockchip boards. Currently, the feature is being enabled on the
RockPi4 boards with firmware images residing on GPT partitioned
storage media.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
John Keeping
b5194c2258 phy: rockchip: handle clock without enable function
If a clock doesn't supply the enable hook, clk_enable() will return
-ENOSYS.  In this case the clock is always enabled so there is no error
and the phy initialisation should continue.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Michal Suchanek
216928c772 rockchip: Pinebook Pro: Do not initialize i2c before relocation
The i2c locks up when initialized before relocation, and it stays broken
in Linux as well breaking the ability to boot Linux.

The i2c bus and pmic was not actually used in pre-reloc before
commit ad607512f5 ("power: pmic: rk8xx: Support sysreset shutdown method")

The cause is not known.

This is board-specific, other boards that do not add the option to
include the i2c bus in pre-reloc DT are not affected.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Quentin Schulz
c74f6e748b rockchip: puma: fix GPT table corruption when saving U-Boot environment
The GPT table is taking the first 34 sectors, which amounts to 0x4400
bytes. Saving the environment below this address in storage will corrupt
the GPT table.

While technically the table ends at 0x4400, some tools (e.g. bmaptool)
are rounding everything to the logical block size (0x1000), so it is
safer to make it point to 0x5000 so that the environment could still
persist when flashing a sparse image with bmaptool or similar tools.

Obviously, the default 0x4000 environment size does not work anymore, so
let's set it to 0x3000 so it does fill the gap between the GPT table
(rounded to 0x1000) and the start of the idbloader.img.

Fixes: 56f580d3eb ("rockchip: dts: rk3399-puma: put environment (in MMC/SD configurations) before SPL")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
FUKAUMI Naoki
75a364eb05 arm: dts: rockchip: enable ums/rockusb command for ROCK Pi 4
this patch add USB mass storage function and Rockusb function for
Radxa ROCK Pi 4 series.

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Manoj Sai
22e443c76d configs:rockchip:roc-rk3399-pc:Enable more configs
This patch enables the following:

1) use preboot configuration to enable usb devices.

2) Enable USB configs so keyboards and other USB devices work,
   update the number of ports of the usb root hub.

   - with this addition the updated USB device Tree:

	1  Hub (12 Mb/s, 0mA)
	U-Boot Root Hub
	1  Hub (12 Mb/s, 0mA)
	|   U-Boot Root Hub
	|
	+-2  Hub (12 Mb/s, 100mA)
	USB 2.0 Hub [MTT]

	1  Hub (5 Gb/s, 0mA)
	U-Boot XHCI Host Controller

3) enable crypto RNG support.

4) Change SPI speed and frequency:
    - increase the maximum SPI slave device speed,
      SPI flash max frequency for the environment from 10Mhz to 30MHz.

    - performance stats for speed update from 10MHz to 30MHz:

    	with 10Mhz speed update:
    	 => sf update 0x300000 0x800000 0x400000
    	    4194304 bytes written, 0 bytes skipped in 36.819s, speed 119837 B/s

        with 30Mhz speed update:
    	 => sf update 0x300000 0x800000 0x400000
    	    4194304 bytes written, 0 bytes skipped in 20.319s, speed 220752 B/s

Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Signed-off-by: Da Xue <da.xue@libretech.co>
Signed-off-by: dsx724 <da@lessconfused.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Johan Jonker
58eb6675da arm: dts: rockchip: rk3128: fix clocks, compatible and phys
Fix rk3128 clocks, compatible and phys, so that they match the bindings.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2022-12-19 10:56:12 +08:00
Johan Jonker
565d77b4c0 arm: dts: rockchip: rk3128: fix DT node names
The rk3128 DT node names should be generic.
Rename them to the pattern defined in the DT bindings.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2022-12-19 10:56:12 +08:00
Johan Jonker
b919d43af5 arm: dts: rockchip: move all rk3128 u-boot specific properties in separate dtsi files
Move all rk3128 u-boot specific properties in separate dtsi files.
Sort emmc node.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Johan Jonker
c643468849 arm: dts: rockchip: rk3128: bulk convert gpios to their constant counterparts
Bulk convert rk3128 DT gpios to their constant counterparts.

sed -i -f script.sed rk3128.dtsi
sed -i -f script.sed rk3128-evb.dts

================================

/rockchip,pins *=/bcheck
b # to end of script
:append-next-line
N
:check
/^[^;]*$/bappend-next-line
s/<RK_GPIO\([0-9]\) /<\1 /g
s/<\([^ ][^ ]*  *\)0 /<\1RK_PA0 /g
s/<\([^ ][^ ]*  *\)1 /<\1RK_PA1 /g
s/<\([^ ][^ ]*  *\)2 /<\1RK_PA2 /g
s/<\([^ ][^ ]*  *\)3 /<\1RK_PA3 /g
s/<\([^ ][^ ]*  *\)4 /<\1RK_PA4 /g
s/<\([^ ][^ ]*  *\)5 /<\1RK_PA5 /g
s/<\([^ ][^ ]*  *\)6 /<\1RK_PA6 /g
s/<\([^ ][^ ]*  *\)7 /<\1RK_PA7 /g
s/<\([^ ][^ ]*  *\)8 /<\1RK_PB0 /g
s/<\([^ ][^ ]*  *\)9 /<\1RK_PB1 /g
s/<\([^ ][^ ]*  *\)10 /<\1RK_PB2 /g
s/<\([^ ][^ ]*  *\)11 /<\1RK_PB3 /g
s/<\([^ ][^ ]*  *\)12 /<\1RK_PB4 /g
s/<\([^ ][^ ]*  *\)13 /<\1RK_PB5 /g
s/<\([^ ][^ ]*  *\)14 /<\1RK_PB6 /g
s/<\([^ ][^ ]*  *\)15 /<\1RK_PB7 /g
s/<\([^ ][^ ]*  *\)16 /<\1RK_PC0 /g
s/<\([^ ][^ ]*  *\)17 /<\1RK_PC1 /g
s/<\([^ ][^ ]*  *\)18 /<\1RK_PC2 /g
s/<\([^ ][^ ]*  *\)19 /<\1RK_PC3 /g
s/<\([^ ][^ ]*  *\)20 /<\1RK_PC4 /g
s/<\([^ ][^ ]*  *\)21 /<\1RK_PC5 /g
s/<\([^ ][^ ]*  *\)22 /<\1RK_PC6 /g
s/<\([^ ][^ ]*  *\)23 /<\1RK_PC7 /g
s/<\([^ ][^ ]*  *\)24 /<\1RK_PD0 /g
s/<\([^ ][^ ]*  *\)25 /<\1RK_PD1 /g
s/<\([^ ][^ ]*  *\)26 /<\1RK_PD2 /g
s/<\([^ ][^ ]*  *\)27 /<\1RK_PD3 /g
s/<\([^ ][^ ]*  *\)28 /<\1RK_PD4 /g
s/<\([^ ][^ ]*  *\)29 /<\1RK_PD5 /g
s/<\([^ ][^ ]*  *\)30 /<\1RK_PD6 /g
s/<\([^ ][^ ]*  *\)31 /<\1RK_PD7 /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)0 /<\1RK_FUNC_GPIO /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)RK_FUNC_\([1-9]\) /<\1\2 /g

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Johan Jonker
4d89330b8a rockchip: rk3128-cru: sync the clock dt-binding header from Linux
In order to update the DT for rk3128
sync the clock dt-binding header.
This is the state as of v6.0 in Linux.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
FUKAUMI Naoki
96d926cac3 rockchip: enable fdt overlays for ROCK Pi 4 series
add CONFIG_OF_LIBFDT_OVERLAY=y to support fdt overlays.

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-12-19 10:56:12 +08:00
Kever Yang
f5315dd629 rockchip: Only call binman when TPL available
Rockchip platform use TPL to do the DRAM initialize for all the SoCs,
if TPL is not available, means no available DRAM init program, and the
u-boot-rockchip.bin is not functionable.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I2299f1eddce5aa7d5fb1a3fb4d8aeaa995b397fa
2022-12-19 10:55:58 +08:00
Tom Rini
93685d0dcb Makefile: With BINMAN_ALLOW_MISSING=1 don't error on missing
When the user builds with BINMAN_ALLOW_MISSING=1 they're explicitly
setting the flag to allow for additional binaries to be missing and so
have acknowledged the output might not work. In this case we want to
default to not passing a non-zero exit code.

Cc: Simon Glass <sjg@chromium.org>
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-18 20:50:40 -05:00
Tom Rini
255cebbfa3 Pull request for efi-2023-01-rc4
Documentation:
 
 * Fix htmldoc build dependency
 
 UEFI:
 
 * Adjust EBBR version for compatibility table
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmOd384ACgkQxIHbvCwF
 GsQ6zw/+OQlDLlPACDYA/ecSROHv3vuBLPpzwoQP1e2OEyB0IrfHUAmEmYw5Uss7
 ItwwxIQ/wXj41gNBlyk7Xb8llvvKkFUawtcHMf35kNEF3K/6X8WvSs0dGcutMaF/
 C0ptuZYFmKyJZRludEDoWYZHHI9d/MuIDstGyvmTcajKsdWMPPKrOU0hHBfxgRII
 z++iJFq8w0182fBdd84WvZuoM8JP6Ob9TnlBQG7MPK4eSC42GdoqSV6P6AXFj0I9
 BWS+aFCSCwK33QgFe+xRh56BSxh9QF7k80vtBdmwU/NvjeMNuW9rNIHbnIJig12O
 ldk+MecxJn/HCgShgrx92q+rT9hWi0BcCheozkqqCBah32bTum/qiq/KsE8lEflp
 k9KH9NcvSFE2mufglQNBgM1/9bAs8AT0S9bhJk/ivwdz+VahvQDKN+7u0tlca0P1
 DJv22qE9qTEL62dTe1EO14i5QYkok3fPrLXX4joqB7VvoNX0zYaEX6BBSDTzXw9b
 8A3SnMKg9DfZ513vSe1wn3KIbZgnPmx0tfh2QnBs2iquARn1aRuRJff/X9SFfKFc
 oBIbN34IogzadIcPTtiSk1WhirzVx5Lupgf/xSJ5cQmPGc9kzP5BPUX15IZXOvlY
 ia7TP3Q6EjpVepiB267gmTV8DyUkA/5zZ7a4doMJHD7GrCY3BNg=
 =LS6d
 -----END PGP SIGNATURE-----

Merge tag 'efi-2023-01-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc4

Documentation:

* Fix htmldoc build dependency

UEFI:

* Adjust EBBR version for compatibility table
2022-12-18 08:10:09 -05:00
Tom Rini
55e374f508 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
This cleans up each board's defconfig, and fixes the serial console on
some Olimex board. Also we lose another legacy config variable.
The rest are minor cleanups, that actually shouldn't change anything
in the build.

Passed the gitlab CI, plus briefly tested on Pine64-LTS, LicheePi Nano,
and BananaPi M1.
2022-12-18 08:08:55 -05:00
Heinrich Schuchardt
5b5f6e0d61 doc: update Sphinx requirements for certifi
Upgrade to version 2022.12.7.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-12-17 15:25:52 +00:00
Vincent Stehlé
63db1561f1 efi: adjust ebbr to v2.1 in conformance profile
The EFI Conformance Profile Table entry for EBBR appears in v2.1.0 of the
EBBR specification[1]. Update naming accordingly.

While at it, update the EBBR version referenced in the documentation.

[1]: https://github.com/ARM-software/ebbr/releases/tag/v2.1.0

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-12-17 13:37:33 +00:00
Maxim Cournoyer
e7d962bc3c doc: fix typos
Fix a few typos spot during a first read of the contribution process.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-12-17 13:37:33 +00:00