]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
4 years agoconfigs: sandbox: Enable random number generator(rng) device
Sughosh Ganu [Sat, 28 Dec 2019 18:28:32 +0000 (23:58 +0530)]
configs: sandbox: Enable random number generator(rng) device

Enable support for random number generator on sandbox configs. This is
aimed primarily at adding unit test support for rng uclass.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agosandbox: rng: Add a random number generator(rng) driver
Sughosh Ganu [Sat, 28 Dec 2019 18:28:31 +0000 (23:58 +0530)]
sandbox: rng: Add a random number generator(rng) driver

Add a sandbox driver for random number generation. Mostly aimed at
providing a unit test for rng uclass.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: stm32mp15: Enable random number generator(rng) device
Sughosh Ganu [Sat, 28 Dec 2019 18:28:30 +0000 (23:58 +0530)]
configs: stm32mp15: Enable random number generator(rng) device

Enable support for the rng device on the stm32mp15 configs.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: rng: Add a driver for random number generator(rng) device
Sughosh Ganu [Sat, 28 Dec 2019 18:28:29 +0000 (23:58 +0530)]
stm32mp1: rng: Add a driver for random number generator(rng) device

Add a driver for the rng device found on stm32mp1 platforms. The
driver provides a routine for reading the random number seed from the
hardware device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Remove a superfluous blank line
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoclk: stm32mp1: Add a clock entry for RNG1 device
Sughosh Ganu [Sat, 28 Dec 2019 18:28:28 +0000 (23:58 +0530)]
clk: stm32mp1: Add a clock entry for RNG1 device

Add an entry for allowing clock enablement for the random number
generator peripheral, RNG1.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agodm: rng: Add random number generator(rng) uclass
Sughosh Ganu [Sat, 28 Dec 2019 18:28:27 +0000 (23:58 +0530)]
dm: rng: Add random number generator(rng) uclass

Add a uclass for reading a random number seed from a random number
generator device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agotest/py: Create a test for launching UEFI binaries from FIT images
Cristian Ciocaltea [Mon, 30 Dec 2019 01:34:27 +0000 (03:34 +0200)]
test/py: Create a test for launching UEFI binaries from FIT images

This test verifies the implementation of the 'bootm' extension that
handles UEFI binaries inside FIT images (enabled via CONFIG_BOOTM_EFI).

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodoc: uefi.rst: Document launching UEFI binaries from FIT images
Cristian Ciocaltea [Tue, 24 Dec 2019 16:05:41 +0000 (18:05 +0200)]
doc: uefi.rst: Document launching UEFI binaries from FIT images

This patch adds a new section "Launching a UEFI binary from a FIT image"
documenting the usage of the CONFIG_BOOTM_EFI extension to bootm command
that offers a verified boot alternative for UEFI binaries such as GRUB2.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodoc: Add sample uefi.its image description file
Cristian Ciocaltea [Tue, 24 Dec 2019 16:05:40 +0000 (18:05 +0200)]
doc: Add sample uefi.its image description file

This patch adds an example FIT image description file demonstrating
the usage of bootm command to securely launch UEFI binaries.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agobootm: Add a bootm command for type IH_OS_EFI
Cristian Ciocaltea [Tue, 24 Dec 2019 16:05:39 +0000 (18:05 +0200)]
bootm: Add a bootm command for type IH_OS_EFI

Add support for booting EFI binaries contained in FIT images.
A typical usage scenario is chain-loading GRUB2 in a verified
boot environment.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoimage: Add IH_OS_EFI for EFI chain-load boot
Cristian Ciocaltea [Tue, 24 Dec 2019 16:05:38 +0000 (18:05 +0200)]
image: Add IH_OS_EFI for EFI chain-load boot

Add a new OS type to be used for chain-loading an EFI compatible
firmware or boot loader like GRUB2, possibly in a verified boot
scenario.

Bellow is sample ITS file that generates a FIT image supporting
secure boot. Please note the presence of 'os = "efi";' line, which
identifies the currently introduced OS type:

/ {
    #address-cells = <1>;

    images {
        efi-grub {
            description = "GRUB EFI";
            data = /incbin/("bootarm.efi");
            type = "kernel_noload";
            arch = "arm";
            os = "efi";
            compression = "none";
            load = <0x0>;
            entry = <0x0>;
            hash-1 {
                algo = "sha256";
            };
        };
    };

    configurations {
        default = "config-grub";
        config-grub {
            kernel = "efi-grub";
            signature-1 {
                algo = "sha256,rsa2048";
                sign-images = "kernel";
            };
        };
    };
};

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: efidebug: capitalize UEFI
Heinrich Schuchardt [Tue, 7 Jan 2020 06:48:15 +0000 (07:48 +0100)]
cmd: efidebug: capitalize UEFI

%s/uefi/UEFI/g

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: efidebug: new sub-command tables
Heinrich Schuchardt [Tue, 7 Jan 2020 04:57:47 +0000 (05:57 +0100)]
cmd: efidebug: new sub-command tables

Provide sub-command for efidebug to list configuration tables.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: efidebug: simplify get_guid_text()
Heinrich Schuchardt [Tue, 7 Jan 2020 05:02:33 +0000 (06:02 +0100)]
cmd: efidebug: simplify get_guid_text()

When we hit a matching GUID we can directly return the text. There is no
need for a check after the loop.

efi_guid_t is defined as 8 byte aligned but GUIDs in packed structures do
not follow this alignment. Do not require the argument of get_guid_text()
to be correctly aligned.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: define all known warning status codes
Heinrich Schuchardt [Fri, 3 Jan 2020 21:47:19 +0000 (22:47 +0100)]
efi_loader: define all known warning status codes

Of all warning status codes up to now only EFI_WARN_DELETE_FAILURE is
defined.

The patch adds the missing definitions for later usage.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: free load options after execution
Heinrich Schuchardt [Fri, 3 Jan 2020 21:53:42 +0000 (22:53 +0100)]
efi_loader: free load options after execution

When be launch a binary via bootefi the bootargs environment variable is
used to set the load options in the loaded image protocol.

Free memory allocated for load options when the UEFI binary exits.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: Add guidcpy function
Sughosh Ganu [Sat, 28 Dec 2019 18:31:04 +0000 (00:01 +0530)]
efi_loader: Add guidcpy function

Add guidcpy function to copy the source guid to the destination
guid. Use this function instead of memcpy for copying to the
destination guid.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Use void * instead of efi_guid_t * for arguments to allow copying unaligned
GUIDs. The GUIDs of configuration tables are __packed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: __cyg_profile_func_enter/_exit
Heinrich Schuchardt [Wed, 1 Jan 2020 12:19:12 +0000 (13:19 +0100)]
efi_loader: __cyg_profile_func_enter/_exit

U-Boot can be compiled with function tracing enabled.

When compiling with FTRACE __cyg_profile_func_enter() is called when a
function is entered and __cyg_profile_func_exit() when the function is
left.

To avoid a crash we have to define these function for the free-standing
UEFI binaries.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agopart: efi: comment for GPT_HEADER_SIGNATURE_UBOOT
Heinrich Schuchardt [Tue, 24 Dec 2019 07:11:01 +0000 (08:11 +0100)]
part: efi: comment for GPT_HEADER_SIGNATURE_UBOOT

Add a comment indicating that the value of GPT_HEADER_SIGNATURE_UBOOT
equals the ASCII string 'EFI PART'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: clear screen should move cursor to home
Heinrich Schuchardt [Sun, 22 Dec 2019 07:15:55 +0000 (07:15 +0000)]
efi_loader: clear screen should move cursor to home

On a VT100 terminal <ESC>[2J should be enough to both clear the whole
screen and set the cursor to position (1, 1). But the Linux console does
not behave like this. So send an extra <ESC>[H. For reference see the
console_codes(4) man page.

Add a function description.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agotest/py: describe env__efi_loader_helloworld_file
Heinrich Schuchardt [Thu, 19 Dec 2019 12:39:30 +0000 (13:39 +0100)]
test/py: describe env__efi_loader_helloworld_file

Describe the components of environment variable
env__efi_loader_helloworld_file.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: git ignore helloworld_efi.S
Heinrich Schuchardt [Mon, 16 Dec 2019 11:05:58 +0000 (12:05 +0100)]
efi_loader: git ignore helloworld_efi.S

Add *.S to .gitignore.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_selftest: Update .gitignore
Sughosh Ganu [Mon, 16 Dec 2019 06:31:32 +0000 (12:01 +0530)]
efi_selftest: Update .gitignore

Add the following file to .gitignore
 efi_miniapp_file_image_exception.h

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Use efi_miniapp_*.h instead of file enumeration.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: export efi_install_fdt()
Heinrich Schuchardt [Sun, 8 Dec 2019 00:07:01 +0000 (01:07 +0100)]
efi_loader: export efi_install_fdt()

Use a pointer to addressable memory instead of a "physical" address in the
virtual address space of the sandbox to efi_install_fdt().

Export the efi_install_fdt() function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: carve out efi_run_image()
Heinrich Schuchardt [Sat, 7 Dec 2019 19:51:06 +0000 (20:51 +0100)]
efi_loader: carve out efi_run_image()

Provide public function efi_run_imager() which can be used to run an UEFI
image from memory.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: use hardware device tree by default
Heinrich Schuchardt [Wed, 4 Dec 2019 11:31:12 +0000 (12:31 +0100)]
efi_loader: use hardware device tree by default

If the bootefi command is called without passing the address of a device
tree, the internal device tree is used. For devices with a hardware device
tree it is preferable to used the hardware device tree in this case.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: pass address to efi_install_fdt()
Heinrich Schuchardt [Thu, 28 Nov 2019 05:46:09 +0000 (06:46 +0100)]
efi_loader: pass address to efi_install_fdt()

As part of moving the parsing of command line arguments to do_bootefi()
call efi_install_fdt() with the address of the device tree instead of a
string.

If the address is EFI_FDT_USE_INTERNAL (= 0), the internal device tree
is used.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: adjust file system info
Heinrich Schuchardt [Sun, 8 Dec 2019 09:02:37 +0000 (10:02 +0100)]
efi_loader: adjust file system info

When the GetInfo() method of the EFI_FILE_PROTOCOL is called to retrieve
the file system info we claim that the volume is read only and has no free
space. This leads to failures in programs that check this information
before writing to the volume like SCT's InstallSct.efi.

Currently there is no function to determine these parameters in U-Boot. So
let's return optimistic values:

Return that the volume is writable.

Return the volume size as free space.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: imply USB_KEYBOARD_FN_KEYS
Heinrich Schuchardt [Wed, 4 Dec 2019 21:58:58 +0000 (22:58 +0100)]
efi_loader: imply USB_KEYBOARD_FN_KEYS

UEFI applications like GRUB and SCT assume that function keys are enabled
on the keyboard.

Let EFI_LOADER imply USB_KEYBOARD_FN_KEYS.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoinclude: pe.h: add signature-related definitions
AKASHI Takahiro [Tue, 26 Nov 2019 00:51:05 +0000 (09:51 +0900)]
include: pe.h: add signature-related definitions

The index (IMAGE_DIRECTORY_ENTRY_SECURITY) in a table points to
a region containing authentication information (image's signature)
in PE format.

WIN_CERTIFICATE structure defines an embedded signature format.

Those definitions will be used in my UEFI secure boot patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoconfigs: qemu: enable FIT images on qemu_arm(64)_defconfig
Heinrich Schuchardt [Sun, 29 Dec 2019 11:06:29 +0000 (12:06 +0100)]
configs: qemu: enable FIT images on qemu_arm(64)_defconfig

For testing UEFI FIT images we need FIT image support on QEMU.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agotest/py: Fix broken 'notbuildconfigspec' marker
Cristian Ciocaltea [Tue, 24 Dec 2019 15:19:12 +0000 (17:19 +0200)]
test/py: Fix broken 'notbuildconfigspec' marker

Consider the following test sample:

@pytest.mark.buildconfigspec('fit')
@pytest.mark.notbuildconfigspec('generate_acpi_table')
def test_sample(u_boot_console):

Whatever the argument of the 'notbuildconfigspec' is,
the test ends up being skipped with the message:

('/uboot/test/py/conftest.py', 463,
 'Skipped: .config feature "fit" enabled')

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMerge branch 'next'
Tom Rini [Mon, 6 Jan 2020 22:07:49 +0000 (17:07 -0500)]
Merge branch 'next'

Bring in the following merges:

commit 8fbbec12f7d2c18f8883f3371cfca74a98b5dd87
Merge: 87f69f467a83 63618e71e89b
Author: Tom Rini <trini@konsulko.com>
Date:   Fri Jan 3 09:48:47 2020 -0500

    Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next

    - updates and fixes on ls1028a, lx2, ls1046a, MC-DPSPARSER support

commit 87f69f467a8335b171c71bf217d2625d515acd7c
Merge: c0912f9bbfb2 4466b9970319
Author: Tom Rini <trini@konsulko.com>
Date:   Tue Dec 24 08:18:19 2019 -0500

    Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx into next

    - Enable DM driver on ppc/km boards
    - Enable DM_USB for some of NXP powerpc platforms: P5040, T4240, T208x,
      T104x, P4080, P2041, P2020, P1020, P3041
    - Some updates in mpc85xx-ddr driver, km boards

commit c0912f9bbfb26dd03d189953678691b799d35b6e
Merge: 533c9f5714bd a1d6dc3f8407
Author: Tom Rini <trini@konsulko.com>
Date:   Wed Dec 18 07:20:19 2019 -0500

    Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-x86 into next

    - Various x86 common codes updated for TPL/SPL
    - I2C designware driver updated for PCI
    - ICH SPI driver updated to support Apollo Lake
    - Add Intel FSP2 base support
    - Intel Apollo Lake platform specific drivers support
    - Add a new board Google Chromebook Coral

commit 533c9f5714bdba79dc6f2629284d4c1a08a611d1
Merge: 553cb0688782 033e18b47bd0
Author: Tom Rini <trini@konsulko.com>
Date:   Tue Dec 17 07:53:08 2019 -0500

    Merge tag '20191217-for-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c into next

    i2c: for next
    - misc: i2c_eeprom:
      Add partition support and add ability to query size
      of eeprom device and partitions
    - i2c common:
      add support for offset overflow in to address and add
      sandbox tests for it.

commit 553cb06887825314e74a9bdac337467c77d1db88
Merge: f39abbbc531e b4f98b3b16ec
Author: Tom Rini <trini@konsulko.com>
Date:   Thu Dec 12 08:18:59 2019 -0500

    Merge tag 'dm-next-13dec19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm into next

    buildman improvements including toolchain environment feature
    sandbox unicode support in serial

4 years agoPrepare v2020.01
Tom Rini [Mon, 6 Jan 2020 20:56:31 +0000 (15:56 -0500)]
Prepare v2020.01

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoRevert "mmc: davinci: drop struct davinci_mmc_plat"
Tom Rini [Fri, 3 Jan 2020 17:00:04 +0000 (12:00 -0500)]
Revert "mmc: davinci: drop struct davinci_mmc_plat"

Adam Ford reports that this change breaks booting on da850-evm and
Bartosz Golaszewski agrees that with the impending release we should
revert the change for now.  With that noted:

This reverts commit 21a4d80a710c79053ac1deaa65ff9b69e6c031d4.

Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Tested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next
Tom Rini [Fri, 3 Jan 2020 14:48:47 +0000 (09:48 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next

- updates and fixes on ls1028a, lx2, ls1046a, MC-DPSPARSER support

4 years agoMerge branch '2020-01-03-master-imports'
Tom Rini [Fri, 3 Jan 2020 14:47:22 +0000 (09:47 -0500)]
Merge branch '2020-01-03-master-imports'

- Fixes for host tools with musl C library
- Two fixes for TI K3 platforms

4 years agoarm: mach-k3: Enable WA for R5F deadlock
Lokesh Vutla [Tue, 31 Dec 2019 10:19:55 +0000 (15:49 +0530)]
arm: mach-k3: Enable WA for R5F deadlock

On K3 devices there are 2 conditions where R5F can deadlock:
1.When software is performing series of store operations to
  cacheable write back/write allocate memory region and later
  on software execute barrier operation (DSB or DMB). R5F may
  hang at the barrier instruction.
2.When software is performing a mix of load and store operations
  within a tight loop and store operations are all writing to
  cacheable write back/write allocates memory regions, R5F may
  hang at one of the load instruction.

To avoid the above two conditions disable linefill optimization
inside Cortex R5F which will make R5F to only issue up to 2 cache
line fills at any point of time.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agoarm: dts: k3-j721e: ddr: Update to 0.2 version of DDR config tool
Lokesh Vutla [Tue, 31 Dec 2019 10:18:48 +0000 (15:48 +0530)]
arm: dts: k3-j721e: ddr: Update to 0.2 version of DDR config tool

Update the ddr settings to use the DDR reg config tool rev 0.2.0.
This reduces the aging count(in DDRSS_CTL_274_DATA reg) to 15 in-order
to avoid DSS underflow errors.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Kevin Scholz <k-scholz@ti.com>
4 years agoinclude/u-boot/crc.h: pull 'uint' definition on musl targets
Sergei Trofimovich [Mon, 30 Dec 2019 15:53:42 +0000 (15:53 +0000)]
include/u-boot/crc.h: pull 'uint' definition on musl targets

The build failure was originally reported on arm64-musl
target at https://bugs.gentoo.org/703132. Here is the amd64-musl
variant:

```
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-only_defconfig -j$(nproc)
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-all            -j$(nproc)
...
include/u-boot/crc.h:37:44: error: unknown type name 'uint'; did you mean 'int'?
   37 | void crc16_ccitt_wd_buf(const uint8_t *in, uint len,
      |                                            ^~~~
      |                                            int
```

Note: 'uint' is not defined there.

On glibc 'uint' comes from <sys/types.h> and happens to work on most .c files.

The change imports 'uint' declaration from '<compiler.h>'.

Bug: https://bugs.gentoo.org/703132
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agoinclude: fix 'ulong' definition on musl targets
Sergei Trofimovich [Mon, 30 Dec 2019 15:53:41 +0000 (15:53 +0000)]
include: fix 'ulong' definition on musl targets

The build failure was originally reported on arm64-musl
target at https://bugs.gentoo.org/703132. Here is the amd64-musl
variant:

```
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-only_defconfig -j$(nproc)
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-all            -j$(nproc)
...
In file included from tools/env/../../env/flags.c:7,
                 from tools/env/env_flags.c:1:
include/env.h:159:1: error: unknown type name 'ulong'; did you mean 'long'?
  159 | ulong env_get_ulong(const char *name, int base, ulong default_val);
      | ^~~~~
      | long
```

Note: 'ulong' is not defined there.

On glibc 'ulong' comes from <sys/types.h>:

```c
/* Old compatibility names for C types.  */
typedef unsigned long int ulong;
```

On musl it comes from <sys/types.h> as well but from under different guards:

```c
typedef unsigned long u_long, ulong;
```

The change inlines 'ulong' define similar to 'uint' define.

Bug: https://bugs.gentoo.org/703132
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
4 years agoMerge tag 'fixes-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot-video
Tom Rini [Thu, 2 Jan 2020 23:12:05 +0000 (18:12 -0500)]
Merge tag 'fixes-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot-video

- fix missing graphics output on some x86 boards
- avoid using #ifdef in video code
- add .gitignore for video font *.S files

4 years agovideo: add wrappers for ttf type files to .gitignore
Dario Binacchi [Tue, 31 Dec 2019 17:09:14 +0000 (18:09 +0100)]
video: add wrappers for ttf type files to .gitignore

The scripts/Makefile.lib generates an assembler file (*.S) to wrap the
font data for each file of type ttf defined in Kconfig.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
4 years agoMerge tag 'u-boot-rockchip-20191231' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 2 Jan 2020 15:28:26 +0000 (10:28 -0500)]
Merge tag 'u-boot-rockchip-20191231' of https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip

- Fix latest mainline kernel for rk3308
- Update rk3288-evb config to suport OP-TEE
- Fix for firefly-px30 DEBUG_UART channel and make it standalone
- Script make_fit_atf add python3 support
- Fix rk3328 timer with correct COUNTER_FREQUENCY
- Fix rk3328 ATF support with enable spl-fifo-mode

4 years agoMerge branch '2020-01-02-master-imports'
Tom Rini [Thu, 2 Jan 2020 15:27:47 +0000 (10:27 -0500)]
Merge branch '2020-01-02-master-imports'

- Assorted test.py fixes
- Other minor changes

4 years agotest: Fix the boardspec for the SPL handoff test
Simon Glass [Fri, 27 Dec 2019 14:46:30 +0000 (07:46 -0700)]
test: Fix the boardspec for the SPL handoff test

This test currently does not run because it specifies the sandbox board
instead of sandbox_spl. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agomailmap: Update mail address for Igor Opaniuk
Igor Opaniuk [Tue, 17 Dec 2019 12:48:54 +0000 (14:48 +0200)]
mailmap: Update mail address for Igor Opaniuk

My address at Linaro doesn't exist anymore, so people
keep getting mail delivery error responses. Map this address
to the actual one.

Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agotest_env: don't strip() printenv results
Stephen Warren [Wed, 18 Dec 2019 18:37:21 +0000 (11:37 -0700)]
test_env: don't strip() printenv results

get_env() was originally written to strip() the output of printenv to
isolate the test from any whitespace changes in printenv's output.
However, this throws away any whitespace in the variable value, which can
cause issues when test code expects to see that whitespace. In fact,
printenv never adds any whitespace at all, so there's no need to strip.

The strip causes a practical problem for test_env_echo_exists() if
state_test_env.get_existent_var() happens to choose a U-Boot variable that
contains trailing whitespace. This is true for variable boot_targets.

With Python 2, get_existent_var() never returned boot_targets so this
issue never caused a practical problem.

With Python 3, get_existent_var does sometimes return boot_targets, no
doubt due to Python 3's different dict hash key order implementation,
about 0.5-2% of the time, so this test appears intermittent. With the
strip removed, this intermittency is solved, since the test passes for all
possible U-Boot variables.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
4 years agoarch/arm/Kconfig: typo/grammar/punctuation fixes
Robert P. J. Day [Wed, 25 Dec 2019 11:34:07 +0000 (06:34 -0500)]
arch/arm/Kconfig: typo/grammar/punctuation fixes

Various (mostly minor) spelling, grammar and punctuation tweaks for
arch/arm/Kconfig.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
4 years ago.gitignore: ignore files generated by asn1 compiler
Dario Binacchi [Sun, 29 Dec 2019 12:47:32 +0000 (13:47 +0100)]
.gitignore: ignore files generated by asn1 compiler

As described in doc/README.asn1 document the tools/asn1_compiler is used
to "generate bytecode as a C file (*.asn1.[ch]) from *.asn1 file".

Signed-off-by: Dario Binacchi <dariobin@libero.it>
4 years agotools: .gitignore: add asn1_compiler
Dario Binacchi [Sun, 29 Dec 2019 12:44:18 +0000 (13:44 +0100)]
tools: .gitignore: add asn1_compiler

Add the tool to the ignore list to prevent being marked as unversioned.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agovideo: Avoid using #ifdef in video-uclass.c
Simon Glass [Sat, 21 Dec 2019 01:10:37 +0000 (18:10 -0700)]
video: Avoid using #ifdef in video-uclass.c

This code does not really need to use #ifdef. We can use if() instead and
gain build coverage without impacting code size.

Change the #ifdefs to use IS_ENABLED(), etc., instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agovideo: Avoid using #ifdef in vidconsole-uclass.c
Simon Glass [Sat, 21 Dec 2019 01:10:36 +0000 (18:10 -0700)]
video: Avoid using #ifdef in vidconsole-uclass.c

This code does not really need to use #ifdef. We can use if() instead and
gain build coverage without impacting code size.

Change the #ifdefs to use CONFIG_IS_ENABLED() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agovideo: Avoid using #ifdef in console_rotate.c
Simon Glass [Sat, 21 Dec 2019 01:10:35 +0000 (18:10 -0700)]
video: Avoid using #ifdef in console_rotate.c

This code does not really need to use #ifdef. We can use if() instead and
gain build coverage without impacting code size.

Change the #ifdefs to use IS_ENABLED() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agovideo: Avoid using #ifdef in video blitting code
Simon Glass [Sat, 21 Dec 2019 01:10:34 +0000 (18:10 -0700)]
video: Avoid using #ifdef in video blitting code

This code does not really need to use #ifdef. We can use if() instead and
gain build coverage without impacting code size.

Change the #ifdefs to use IS_ENABLED() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agovideo: x86: Enable 32-bit graphics by default
Simon Glass [Sat, 21 Dec 2019 01:10:33 +0000 (18:10 -0700)]
video: x86: Enable 32-bit graphics by default

Most x86 boards that use video make use of 32bpp graphics. Enable this by
default. This fixes missing graphics output on some x86 boards.

Also remove the unnecessary 'default n' while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopci: layerscape: Manage PCIe EP compatible string via Kconfig
Pankaj Bansal [Sat, 30 Nov 2019 13:14:10 +0000 (13:14 +0000)]
pci: layerscape: Manage PCIe EP compatible string via Kconfig

The ep node device tree name is governed by these bindings:
https://github.com/torvalds/linux/blob/master/Documentation/
devicetree/bindings/pci/layerscape-pci.txt#L24

As per above the ep compatible node contains platform name.
Therefore, define the ep node compatible as CONFIG to find the
pcie ep node in device tree during device tree fixup.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopci: layerscape: move PCIE related CONFIG to PCI Kconfig
Pankaj Bansal [Sat, 30 Nov 2019 13:14:00 +0000 (13:14 +0000)]
pci: layerscape: move PCIE related CONFIG to PCI Kconfig

move the PCIE related config from arch Kconfig to PCI Kconfig.
As the PCI_LAYERSCAPE driver is being used in platform other than
fsl-layerscape platforms like ls102xa.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
5 years agorockchip: evb-rk3328: Enable support ATF in SPL
Kever Yang [Tue, 31 Dec 2019 08:02:59 +0000 (16:02 +0800)]
rockchip: evb-rk3328: Enable support ATF in SPL

Enable the ATF in SPL and adjust the SPL STACK/HEAD at the same time to
support ATF entry at 0x40000.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: rk3328: enable spl-fifo-mode for emmc and sdmmc
Kever Yang [Tue, 31 Dec 2019 07:57:55 +0000 (15:57 +0800)]
rockchip: rk3328: enable spl-fifo-mode for emmc and sdmmc

Since mmc to sram can't do dma, add patch to prevent aborts transfering
TF-A parts.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: rk3328: add COUNTER_FREQUENCY definition
Kever Yang [Tue, 31 Dec 2019 07:17:56 +0000 (15:17 +0800)]
rockchip: rk3328: add COUNTER_FREQUENCY definition

The arch timer needs COUNTER_FREQUENCY to get correct counter, add it to
make the timer works correct.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agoMerge tag 'u-boot-imx-20191228' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Sat, 28 Dec 2019 13:07:16 +0000 (08:07 -0500)]
Merge tag 'u-boot-imx-20191228' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2020.01
-----------------
- Fixes for Nitrogen6x
- Fix corruption for mx51evk
- colibri i.MX6: fix broken ESDHC conversion
- mx6sxsabresd: fix broken mmcdev
- imx6q_logic: cleanup boot sequence
- update ATF for imx8mq_evk
- pfuze: fix pmic_get()

Travis CI: https://travis-ci.org/sbabic/u-boot-imx/builds/630007464

5 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Fri, 27 Dec 2019 21:46:38 +0000 (16:46 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi

- Orange Pi Zero Plus 2 support
- sunxi psci, prcm fixes

5 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-spi
Tom Rini [Fri, 27 Dec 2019 21:46:15 +0000 (16:46 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spi

- rk spi transfer limit fix
- Gigadevice, gd25q128 support
- spi-nor-core warnings

5 years agoomap3_beagle: Change NAND ECC scheme back to OMAP_ECC_HAM1_CODE_HW
Patrik Dahlström [Sat, 21 Dec 2019 16:18:22 +0000 (17:18 +0100)]
omap3_beagle: Change NAND ECC scheme back to OMAP_ECC_HAM1_CODE_HW

The omap3_beagle NAND ECC scheme was changed in 4b37928d357 for unknown
reasons, leading to uncorrectible ecc errors. This commit changes it
back to what it was before.

Signed-off-by: Patrik Dahlström <risca@dalakolonin.se>
5 years agortc: rx8010js: add compatible string
Robert Beckett [Tue, 29 Oct 2019 19:07:03 +0000 (19:07 +0000)]
rtc: rx8010js: add compatible string

Add compatible string used by Linux.
Allows for simpler syncing of device trees.

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
5 years agortc: s35392a: add compatible strings
Robert Beckett [Mon, 28 Oct 2019 19:10:10 +0000 (19:10 +0000)]
rtc: s35392a: add compatible strings

Add compatible strings used by Linux.
Allows for simpler syncing of device trees.

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
5 years agortc: rx8010sj: fix DM initialization
Robert Beckett [Mon, 28 Oct 2019 18:49:15 +0000 (18:49 +0000)]
rtc: rx8010sj: fix DM initialization

pass the udevice by reference instead of double ref

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
5 years agoARM: imx6q_logic: Cleanup boot sequence check
Adam Ford [Sun, 3 Nov 2019 13:58:40 +0000 (07:58 -0600)]
ARM: imx6q_logic: Cleanup boot sequence check

The board_boot_order() function currenly assumes that the boot source
is MMC/eMMC, but this isn't true for the NAND devices.

This patch cleans up board_boot_order() to check for NAND, SD, ESD,
MMC or EMMC.  Anything beyond these are not supported, so it will
default back to the serial downloader if any of those devices are not
available.

Fixes: 9fb50c68daa6 ("ARM: imx6q_logic: Fix MMC2 booting")
Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoARM: i.MX6: TARGET_NITROGEN6X: add 'select MX6QDL'
Troy Kisky [Mon, 4 Nov 2019 02:20:05 +0000 (18:20 -0800)]
ARM: i.MX6: TARGET_NITROGEN6X: add 'select MX6QDL'

This fixes commit <91435cd40d30> "ARM: i.MX6: exclude the ARM errata
 from i.MX6 UP system"

for nitrogen6x. The above commit removed the errata for the board
since MX6Q/MXDL/MX6S is selected via CONFIG_SYS_EXTRA_OPTIONS

This restores the errata configs.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agonitrogen6x: prepare for CONFIG_MX6QDL
Troy Kisky [Mon, 4 Nov 2019 02:20:04 +0000 (18:20 -0800)]
nitrogen6x: prepare for CONFIG_MX6QDL

The next patch adds CONFIG_MX6QDL so that
errata will be enabled again.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
5 years agospi: rk: Limit transfers to (64K - 1) bytes
Jagan Teki [Sat, 21 Dec 2019 07:54:30 +0000 (13:24 +0530)]
spi: rk: Limit transfers to (64K - 1) bytes

The Rockchip SPI controller's length register only supports 16-bits,
yielding a maximum length of 64KiB (the CTRLR1 register holds "length -
1"). Trying to transfer more than that (e.g., with a large SPI flash
read) will cause the driver to hang.

Now, it seems that while theoretically we should be able to program
CTRLR1 with 0xffff, and get a 64KiB transfer, but that also seems to
cause the core to choke, so stick with a maximum of 64K - 1 bytes --
i.e., 0xffff.

Note, that the size is further divided into 'minus 1' while writing
into CTRLR1.

This change fixed two different read issues,

1. sf read failure when with > 0x10000

2. Boot from SPI flash failed during spi_flash_read call in
   common/spl/spl_spi.c

Observed and Tested in
- Rockpro64 with Gigadevice flash
- ROC-RK3399-PC with Winbond flash

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agomtd: spi-nor-core: Fix static checker warnings
Vignesh Raghavendra [Sat, 9 Nov 2019 06:34:13 +0000 (12:04 +0530)]
mtd: spi-nor-core: Fix static checker warnings

Static checker warns 'ret' variable may be used uninitialized in
spi_nor_erase() and spi_nor_write() in case of zero length requests.
Fix these warnings by checking for zero length requests and returning
early.

Reported-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
5 years agotools/imximage: share DCD information via Kconfig
Jorge Ramirez-Ortiz [Wed, 11 Dec 2019 09:42:36 +0000 (10:42 +0100)]
tools/imximage: share DCD information via Kconfig

IMX based platforms can have the DCD table located on different
addresses due to differences in their memory maps (ie iMX7ULP).

This information is required by the user to sign the images for secure
boot so continue making it accessible via mkimage.

Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>
5 years agoimx8mq_evk: Update the required ATF branch
Fabio Estevam [Wed, 11 Dec 2019 13:49:30 +0000 (10:49 -0300)]
imx8mq_evk: Update the required ATF branch

Following the README instructions leads to a non-booting
U-Boot:

U-Boot SPL 2020.01-rc3-00070-g9a0cbae22a (Nov 25 2019 - 13:08:24 -0300)
PMIC:  PFUZE100 ID=0x10
DDRINFO: start DRAM init
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from MMC2

(It hangs here)

Use the "imx_4.19.35_1.0.0" ATF branch instead, which
fixes such problem and allow the boot to complete again.

Suggested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8m_evk: Remove unneeded earlycon string
Fabio Estevam [Wed, 11 Dec 2019 17:31:03 +0000 (14:31 -0300)]
imx8m_evk: Remove unneeded earlycon string

Passing earlycon string in the command line may be
useful during bring up, but not after such phase.

Remove the earlycon string to align with the other i.MX SoCs
command lines.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agoimx8m: ddr_init: Move ddr_init() messages to debug level
Fabio Estevam [Wed, 11 Dec 2019 20:37:09 +0000 (17:37 -0300)]
imx8m: ddr_init: Move ddr_init() messages to debug level

Currently inside ddr_init() there is a mix of printf() and debug()
level messages.

Since this type of information is useful for debug purposes,
convert all of them to debug level for consistency.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agomx51evk: Fix U-Boot corruption after saving the environment
Fabio Estevam [Thu, 19 Dec 2019 16:52:39 +0000 (13:52 -0300)]
mx51evk: Fix U-Boot corruption after saving the environment

U-Boot binary has grown in such a way that it goes beyond the reserved
area for the environment variables.

Running "saveenv" followed by a "reset" causes U-Boot to hang because
of this overlap.

Fix this problem by increasing the CONFIG_ENV_OFFSET size.

Also, in order to prevent this same problem to happen in the future,
use CONFIG_BOARD_SIZE_LIMIT, which will detect the overlap in build-time.

CONFIG_BOARD_SIZE_LIMIT does not accept math expressions, so declare
CONFIG_ENV_OFFSET with its direct value instead.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agomx6sxsabresd: Adjust the mmcdev after DM conversion
Fabio Estevam [Thu, 19 Dec 2019 17:59:42 +0000 (14:59 -0300)]
mx6sxsabresd: Adjust the mmcdev after DM conversion

After the DM conversion the boot SD card is now device 3.

Adjust it so that we can boot the kernel again.

While at it avoid a hardcoded mmc dev inside the finduuid script.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agopfuze: Fix the pmic_get() parameter in the DM case
Fabio Estevam [Thu, 19 Dec 2019 17:59:41 +0000 (14:59 -0300)]
pfuze: Fix the pmic_get() parameter in the DM case

Currently the following hang is observed when booting a imx6sx-sdb
board:

U-Boot 2020.01-rc5-00004-g643366bcd5 (Dec 19 2019 - 14:56:23 -0300)

CPU:   Freescale i.MX6SX rev1.0 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 32C
Reset cause: POR
Model: Freescale i.MX6 SoloX SDB RevB Board
Board: MX6SX SABRE SDB revA
DRAM:  1 GiB
initcall sequence bffd8514 failed at call 87804cc0 (err=-19)
### ERROR ### Please RESET the board ###

When pmic_get() is used with DM the first parameter must be
the complete node name plus the unit address.

Fix the pmic_get() parameter to fix the boot regression.

Tested on a imx6sx-sdb and imx6q-sabresd boards.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
5 years agocolibri_imx6: fix broken fsl_esdhc_imx conversion
Igor Opaniuk [Fri, 6 Dec 2019 16:24:16 +0000 (18:24 +0200)]
colibri_imx6: fix broken fsl_esdhc_imx conversion

Not all CONFIG_FSL_ESDHC defines were properly replaced with
CONFIG_FSL_ESDHC_IMX, which broke U-boot proper booting on
Colibri iMX6 SoMs.

U-boot is stuck after this message:
Commercial temperature grade DDR3 timings, 64bit bus width.
Trying to boot from MMC1

Fixes: e37ac717d7("Convert to use fsl_esdhc_imx for i.MX platforms")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
5 years agorockchip: mkimage: fix wrong range of rc4 encoding for boot image
Jeffy Chen [Thu, 5 Dec 2019 10:58:29 +0000 (18:58 +0800)]
rockchip: mkimage: fix wrong range of rc4 encoding for boot image

The rc4 encoding should cover spl header as well, and the file_size
contains spl header too.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agodoc: rockchip: document packing second level loader with mkimage
Jeffy Chen [Thu, 5 Dec 2019 10:58:28 +0000 (18:58 +0800)]
doc: rockchip: document packing second level loader with mkimage

Add documentation about packing optional second level boot-loader with
mkimage tool.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: mkimage: support packing optional second level boot-loader
Jeffy Chen [Fri, 27 Dec 2019 03:24:41 +0000 (11:24 +0800)]
rockchip: mkimage: support packing optional second level boot-loader

Support packing optional second level boot-loader:

$ ./tools/mkimage -n rk3399 -T rksd -d \
  rk3399_ddr_800MHz_v1.24.bin:rk3399_miniloader_v1.19.bin out -v
Adding Image rk3399_ddr_800MHz_v1.24.bin
Size 116492(pad to 116736)
Adding Image rk3399_miniloader_v1.19.bin
Size 88060(pad to 88064)
Image Type:   Rockchip RK33 (SD/MMC) boot image
Init Data Size: 116736 bytes
Boot Data Size: 88064 bytes

Mainly parse init file and boot file from datafile option, copy them to
the image with 2KB alignment.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agodoc: rockchip: Fix reference the wrong defconfig name of ROC-CC-RK3308
Andy Yan [Thu, 26 Dec 2019 07:20:34 +0000 (15:20 +0800)]
doc: rockchip: Fix reference the wrong defconfig name of ROC-CC-RK3308

The defconfig file for ROC-CC-RK3308 is roc-cc-rk3308_defconfig.

Fixes: 7f08bfb74f04 ("doc: rockchip: Add documentation for rk3308 based
boards")

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: rk3308: allow loading larger kernel Image
Andy Yan [Thu, 26 Dec 2019 07:20:04 +0000 (15:20 +0800)]
rockchip: rk3308: allow loading larger kernel Image

When compile the curren mainline linux kernel(Linux 5.5-rc3)
with defconfig, the final Image is 29M, it's much
larger than Linux 5.4.

On the current u-boot side on rk3308, the gap between
kernel and fdt is 25M, the fdt will overwrite kernel
Image, so move ftd to a higher memory to give 34M
gab for them.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: add description for TPL_ROCKCHIP_COMMON_BOARD
Thomas Hebb [Sat, 21 Dec 2019 02:05:22 +0000 (18:05 -0800)]
rockchip: add description for TPL_ROCKCHIP_COMMON_BOARD

SPL_ROCKCHIP_COMMON_BOARD, an almost identical option, has a title but
this one doesn't for some reason. Add a description to make the menu
easier to read.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: px30-firefly add standalone dts
Kever Yang [Fri, 13 Dec 2019 09:41:17 +0000 (17:41 +0800)]
rockchip: px30-firefly add standalone dts

Firefly Core-PX30-JD4 use UART2M1 while PX30 evb using UART2M0, the U-Boot
proper will use the dts setting to do the IOMUX init, and a separate dts
is needed for px30-firefly.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: firefly-px30: Fix the MACRO for CONFIG_DEBUG_UART2_CHANNEL
Kever Yang [Fri, 13 Dec 2019 02:48:51 +0000 (10:48 +0800)]
rockchip: firefly-px30: Fix the MACRO for CONFIG_DEBUG_UART2_CHANNEL

The Macro has update without update the defconfig, update the defconfig
to make Mcaro correct.

Fixes: ec4fafdf1f ("rockchip: px30: Rename CONFIG_DEBUG_UART2_CHANNEL to...")
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: make_fit_atf: explicitly use python3
Jack Mitchell [Tue, 10 Dec 2019 13:07:21 +0000 (13:07 +0000)]
rockchip: make_fit_atf: explicitly use python3

On a distribution with no python2 installed and no
python->python3 symlink the script will fail to execute.
Specify python3 explicitly as it's already a requirement
to build u-boot.

Signed-off-by: Jack Mitchell <ml@embed.me.uk>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agoMerge branch '2019-12-26-ti-imports'
Tom Rini [Thu, 26 Dec 2019 14:07:08 +0000 (09:07 -0500)]
Merge branch '2019-12-26-ti-imports'

- Update maintainer on omapl138_lcdk
- Match TRM sequence & settings in the TI pipe3 PHY

5 years agoboard: davinci: Update OMAPL138_LCDK maintainer
Lokesh Vutla [Fri, 20 Dec 2019 06:05:20 +0000 (11:35 +0530)]
board: davinci: Update OMAPL138_LCDK maintainer

As per the email discussion[0], add myself as a maintainer to
OMAPL138_LCDK and drop Peter's entry.

[0] http://u-boot.10912.n7.nabble.com/OMAP-L138-LCDK-giving-up-maintainership-td394211.html

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agophy: ti-pipe3: Fix SATA & USB PHY power up sequence
Roger Quadros [Wed, 6 Nov 2019 14:21:18 +0000 (16:21 +0200)]
phy: ti-pipe3: Fix SATA & USB PHY power up sequence

As per "Table 26-7. SATA PHY Subsystem Low-Level Programming Sequence"
in TRM [1] we need to turn on SATA_PHY_TX before SATA_PHY_RX.

[1] DRA75x, DRA74x TRM - http://www.ti.com/lit/ug/sprui30f/sprui30f.pdf

Signed-off-by: Roger Quadros <rogerq@ti.com>
5 years agophy: ti-pipe3: improve DPLL stability for SATA & USB
Roger Quadros [Wed, 6 Nov 2019 14:21:17 +0000 (16:21 +0200)]
phy: ti-pipe3: improve DPLL stability for SATA & USB

For increased DPLL stability use the settings recommended in
the TRM [1] for PHY_RX registers for SATA and USB.

For SATA we need to use spread spectrum settings even
though we don't have spread spectrum enabled. The
suggested non-spread spectrum settings don't work.

[1] DRA75x, DRA74x TRM - http://www.ti.com/lit/ug/sprui30f/sprui30f.pdf

Signed-off-by: Roger Quadros <rogerq@ti.com>
5 years agophy: ti-pipe3: Introduce mode property in driver data
Roger Quadros [Wed, 6 Nov 2019 14:21:16 +0000 (16:21 +0200)]
phy: ti-pipe3: Introduce mode property in driver data

Introduce a mode property in the driver data so that
we don't have to keep using "of_device_is_compatible()"
throughtout the driver.

No functional change.

Signed-off-by: Roger Quadros <rogerq@ti.com>
5 years agophy: ti-pipe3: Use TRM recommended settings for SATA DPLL
Roger Quadros [Wed, 6 Nov 2019 14:21:15 +0000 (16:21 +0200)]
phy: ti-pipe3: Use TRM recommended settings for SATA DPLL

The AM572x Technical Reference Manual, SPRUHZ6H,
Revised November 2016 [1], shows recommended settings for the
SATA DPLL in Table 26-8. DPLL CLKDCOLDO Recommended Settings.

Use those settings in the driver. The TRM does not show
a value for 20MHz SYS_CLK so we use something close to the
26MHz setting.

[1] - http://www.ti.com/lit/ug/spruhz6h/spruhz6h.pdf

Signed-off-by: Roger Quadros <rogerq@ti.com>
5 years agorockchip: rk3288-evb: update config to support OPTEE
Kever Yang [Thu, 5 Dec 2019 10:11:55 +0000 (18:11 +0800)]
rockchip: rk3288-evb: update config to support OPTEE

Upstream kernel and rockchip kernel has default enable PSCI which needs
OPTEE in trust word, enable OPTEE support for evb by default and SPL_FIT
option to pack OPTEE with U-Boot proper.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: rk3288-evb: update CONFIG_NR_DRAM_BANKS to 2
Kever Yang [Thu, 5 Dec 2019 10:11:54 +0000 (18:11 +0800)]
rockchip: rk3288-evb: update CONFIG_NR_DRAM_BANKS to 2

The OPTEE will use the ram start at 0x8400000 which make the DRAM be two
banks.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: rk3288-evb: update SPL_STACK/MALLOC_LEN config with rk3399
Kever Yang [Thu, 5 Dec 2019 10:11:53 +0000 (18:11 +0800)]
rockchip: rk3288-evb: update SPL_STACK/MALLOC_LEN config with rk3399

Update the SPL_STACK_R_MALLOC_SIMPLE_LEN which also including space for
STACK and the size may not enough when loding FIT image in SPL.

If the size is not enough, you can see log like this when loding FIT:

U-Boot TPL 2020.01-rc3-00082-g4b19b89ca4-dirty (Dec 05 2019 - 11:52:53)
Trying to boot from BOOTROM
Returning to boot ROM...
U-Boot SPL 2020.01-rc3-00082-g4b19b89ca4-dirty (Dec 05 2019 - 11:52:53 +0800)
Trying to boot from MMC2

And if enable the DEBUG for everyting in SPL, the log will hang at dwmmc
sending CMD16 for 'uboot' loadables binary because this step need a
large stack cost(about 0x2d00).

External data: dst=8400000, offset=72638, size=b3580
Image OS is Trusted Execution Environment
board_fit_config_name_match: rk3288-evb
Selecting config 'rk3288-evb'loadables: 'uboot'
blk_find_device: if_type=6, devnum=1: dwmmc@ff0c0000.blk, 6, 0
blk_find_device: if_type=6, devnum=1: dwmmc@ff0f0000.blk, 6, 1
Sending CMD16

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: fit_spl_optee: get text and optee base from build
Kever Yang [Thu, 5 Dec 2019 10:11:52 +0000 (18:11 +0800)]
rockchip: fit_spl_optee: get text and optee base from build

Instead of hardcode the base address, we can get them from the build
output, eg. get the SYS_TEXT_BASE from .config and get optee base from
DRAM_BASE.
We can use this script for SoCs with DRAM base not from 0x60000000(rk3229
and many other 32bit Rockchip SoCs), eg. rk3288 DRAM base is 0.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>