oweals/u-boot.git
5 years agoefi_loader: provide description of file_open()
Heinrich Schuchardt [Wed, 12 Sep 2018 17:00:02 +0000 (19:00 +0200)]
efi_loader: provide description of file_open()

Replace urban slang by proper description.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: check parameters of efi_file_open()
Heinrich Schuchardt [Wed, 12 Sep 2018 16:43:58 +0000 (18:43 +0200)]
efi_loader: check parameters of efi_file_open()

Check the parameters of efi_file_open().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: unset CONFIG_EFI_UNICODE_CAPITALIZATION
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:14 +0000 (22:38 +0200)]
efi_loader: unset CONFIG_EFI_UNICODE_CAPITALIZATION

Unset CONFIG_EFI_UNICODE_CAPITALIZATION on boards with tough size
restrictions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_selftest: test key notification functions
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:13 +0000 (22:38 +0200)]
efi_selftest: test key notification functions

Use a key notification function to leave the
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL test.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: implement key notify functions
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:12 +0000 (22:38 +0200)]
efi_loader: implement key notify functions

Implement registering and unregistreing key notify functions in the
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: test EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:11 +0000 (22:38 +0200)]
test/py: test EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL

Add a unit test for the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_selftest: test EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:10 +0000 (22:38 +0200)]
efi_selftest: test EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL

Provide a unit test for the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: support modifiers for F1 - F4
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:09 +0000 (22:38 +0200)]
efi_loader: support modifiers for F1 - F4

Support modifiers for F1 - F4.
Add support for letters with ALT key.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:08 +0000 (22:38 +0200)]
efi_loader: EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL

This patch implements the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.

The implementation of notification functions is postponed to a later
patch.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: rework test_efi_selftest_text_input()
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:07 +0000 (22:38 +0200)]
test/py: rework test_efi_selftest_text_input()

Use more precise regular expressions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_selftest: use WaitForKey to test text input
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:06 +0000 (22:38 +0200)]
efi_selftest: use WaitForKey to test text input

We should test the WaitForKey event.
Testing for EFI_NOT_READY can be done after resetting the console.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: rework event handling for console
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:05 +0000 (22:38 +0200)]
efi_loader: rework event handling for console

Preread the next key in the console timer event.

The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL requires to trigger registered key
notification functions based on the prefetched key.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_selftest: refactor text input test
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:04 +0000 (22:38 +0200)]
efi_selftest: refactor text input test

Move reusable utility functions to efi_selftest_util.c.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: Unicode w/ EFI_SIMPLE_TEXT_INPUT_PROTOCOL
Heinrich Schuchardt [Tue, 11 Sep 2018 20:38:03 +0000 (22:38 +0200)]
test/py: Unicode w/ EFI_SIMPLE_TEXT_INPUT_PROTOCOL

Test that the Euro sign is correctly retrieved from the console via the
EFI_SIMPLE_TEXT_INPUT_PROTOCOL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: support Unicode text input
Heinrich Schuchardt [Tue, 11 Sep 2018 22:05:32 +0000 (00:05 +0200)]
efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: fs: add fstest/unlink test
Akashi, Takahiro [Tue, 11 Sep 2018 07:06:03 +0000 (16:06 +0900)]
test/py: fs: add fstest/unlink test

In this commit, test cases for unlink interfaces are added as part of
"test_fs" test suite.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: fs: add fstest/mkdir test
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:21 +0000 (15:59 +0900)]
test/py: fs: add fstest/mkdir test

In this commit, test cases for mkdir interfaces are added as part of
"test_fs" test suite.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: fs: add extended write operation test
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:20 +0000 (15:59 +0900)]
test/py: fs: add extended write operation test

In this commit and the following, test scripts for new filesystem
functionalities introduced by my patch set, "fs: fat: extend FAT write
operations," are provided.

In particular, this patch adds test cases for sub-directory write
and write with non-zero offset.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: convert fs-test.sh to pytest
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:19 +0000 (15:59 +0900)]
test/py: convert fs-test.sh to pytest

In this commit, the same set of test cases as in test/fs/fs-test.sh
is provided using pytest framework.
Actually, fs-test.sh provides three variants:"sb" (sb command), "nonfs"
(fatxx and etc.) and "fs" (hostfs), and this patch currently supports
only "nonfs" variant; So it is not a replacement of fs-test.sh for now.

Simple usage:
  $ py.test test/py/tests/test_fs [<other options>]

You may also specify filesystem types to be tested:
  $ py.test test/py/tests/test_fs --fs-type fat32 [<other options>]

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs-test: update the test result as of v2018.09
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:18 +0000 (15:59 +0900)]
fs-test: update the test result as of v2018.09

As far as this patch series has been applied, all the tests should
pass. So update the test result summary.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs-test: fix false positive error at Test Case 12
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:17 +0000 (15:59 +0900)]
fs-test: fix false positive error at Test Case 12

The error message to be matched is wrong. Fix it.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: implement a file delete
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:16 +0000 (15:59 +0900)]
efi_loader: implement a file delete

'Delete' will be implemented here by calling fs_unlink() which relies on
underlying file system's implementation.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agocmd: fat: add fatrm command
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:15 +0000 (15:59 +0900)]
cmd: fat: add fatrm command

In this patch, a new command, fatrm, is added so as to delete a file
or directory.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: support unlink
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:14 +0000 (15:59 +0900)]
fs: fat: support unlink

In this patch, unlink support is added to FAT file system.
A directory can be deleted only if it is empty.

In this implementation, only a directory entry for a short file name
will be removed. So entries for a long file name can and should be
reclaimed with fsck.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: add unlink interface
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:13 +0000 (15:59 +0900)]
fs: add unlink interface

"unlink" interface is added to file operations.
This is a preparatory change as unlink support for FAT file system
will be added in next patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: file: support creating a directory
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:12 +0000 (15:59 +0900)]
efi_loader: file: support creating a directory

In efi world, there is no obvious "mkdir" interface, instead, Open()
with EFI_FILE_MODE_CREATE in mode parameter and EFI_FILE_DIRECTORY
in attributes parameter creates a directory.

In this patch, efi_file_open() is extended so as to accept such
a combination of parameters and call u-boot's mkdir interface for
expected action.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agocmd: fat: add fatmkdir command
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:11 +0000 (15:59 +0900)]
cmd: fat: add fatmkdir command

In this patch, a new command, fatmkdir, is added.

Please note that, as there is no notion of "current directory" on u-boot,
a directory name specified must contains an absolute directory path as
a parent directory. Otherwise, "/" (root directory) is assumed.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: support mkdir
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:10 +0000 (15:59 +0900)]
fs: fat: support mkdir

In this patch, mkdir support is added to FAT file system.
A newly created directory contains only "." and ".." entries.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: remember the starting cluster number of directory
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:09 +0000 (15:59 +0900)]
fs: fat: remember the starting cluster number of directory

The starting cluster number of directory is needed to initialize ".."
(parent directory) entry when creating a new directory.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: add mkdir interface
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:08 +0000 (15:59 +0900)]
fs: add mkdir interface

"mkdir" interface is added to file operations.
This is a preparatory change as mkdir support for FAT file system
will be added in next patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agocmd: fat: add offset parameter to fatwrite
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:07 +0000 (15:59 +0900)]
cmd: fat: add offset parameter to fatwrite

In this patch, fatwrite command is extended so as to accept an additional
parameter of file offset.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: support write with non-zero offset
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:06 +0000 (15:59 +0900)]
fs: fat: support write with non-zero offset

In this patch, all the necessary code for allowing for a file offset
at write is implemented. What plays a major roll here is get_set_cluster(),
which, in contrast to its counterpart, set_cluster(), only operates on
already-allocated clusters, overwriting with data.

So, with a file offset specified, set_contents() seeks and writes data
with set_get_cluster() until the end of a file, and, once it reaches
there, continues writing with set_cluster() for the rest.

Please note that a file will be trimmed as a result of write operation if
write ends before reaching file's end. This is an intended behavior
in order to maintain compatibility with the current interface.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: refactor write interface for a file offset
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:05 +0000 (15:59 +0900)]
fs: fat: refactor write interface for a file offset

The current write implementation is quite simple: remove existing clusters
and then allocating new ones and filling them with data. This, inevitably,
enforces always writing from the beginning of a file.

As the first step to lift this restriction, fat_file_write() and
set_contents() are modified to accept an additional parameter, file offset
and further re-factored so that, in the next patch, all the necessary code
will be put into set_contents().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: support write with sub-directory path
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:04 +0000 (15:59 +0900)]
fs: fat: support write with sub-directory path

In this patch, write implementation is overhauled and rewritten by
making full use of directory iterator. The obvious bonus is that we are
now able to write to a file with a directory path, like /A/B/C/FILE.

Please note that, as there is no notion of "current directory" on u-boot,
a file name specified must contain an absolute directory path. Otherwise,
"/" (root directory) is assumed.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: write returns error code instead of -1
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:03 +0000 (15:59 +0900)]
fs: fat: write returns error code instead of -1

It would be good that FAT write function return error code instead of
just returning -1 as fat_read_file() does.
This patch attempts to address this issue although it is 'best effort
(or estimate)' for now.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: check and normalize file name
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:02 +0000 (15:59 +0900)]
fs: fat: check and normalize file name

FAT file system's long file name support is a bit complicated and has some
restrictions on its naming. We should be careful about it especially for
write as it may easily end up with wrong file system.

normalize_longname() check for the rules and normalize a file name
if necessary. Please note, however, that this function is yet to be
extended to fully comply with the standard.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoRevert "fs: fat: cannot write to subdirectories"
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:01 +0000 (15:59 +0900)]
Revert "fs: fat: cannot write to subdirectories"

This reverts commit 0dc1bfb7302d220a48364263d5632d6d572b069b.
The succeeding patch series will supersede it.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: assure iterator's ->dent belongs to ->clust
AKASHI Takahiro [Tue, 11 Sep 2018 06:59:00 +0000 (15:59 +0900)]
fs: fat: assure iterator's ->dent belongs to ->clust

In my attempt to re-work write operation, it was revealed that iterator's
"clust" does not always point to a cluster to which a current directory
entry ("dent") belongs.
This patch assures that it is always true by adding "next_clust" which is
used solely for dereferencing a cluster chain.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: handle "." and ".." of root dir correctly with fat_itr_resolve()
AKASHI Takahiro [Tue, 11 Sep 2018 06:58:59 +0000 (15:58 +0900)]
fs: fat: handle "." and ".." of root dir correctly with fat_itr_resolve()

FAT's root directory does not have "." nor ".."
So care must be taken when scanning root directory with fat_itr_resolve().
Without this patch, any file path starting with "." or ".." will not be
resolved at all.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agofs: fat: extend get_fs_info() for write use
AKASHI Takahiro [Tue, 11 Sep 2018 06:58:58 +0000 (15:58 +0900)]
fs: fat: extend get_fs_info() for write use

get_fs_info() was introduced in major re-work of read operation by Rob.
We want to reuse this function in write operation by extending it with
additional members in fsdata structure.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: typos in efi_console.c
Heinrich Schuchardt [Sat, 8 Sep 2018 17:57:24 +0000 (19:57 +0200)]
efi_loader: typos in efi_console.c

Fix a few typos.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: SPDX-License-Identifier for efi.h
Heinrich Schuchardt [Sat, 8 Sep 2018 08:57:59 +0000 (10:57 +0200)]
efi_loader: SPDX-License-Identifier for efi.h

Add the missing SPDX-License-Identifier based on Linux kernel commit
b24413180f56 ("License cleanup: add SPDX GPL-2.0 license identifier to
files with no license").

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: SPDX-License-Identifier for efi_api.h
Heinrich Schuchardt [Sat, 8 Sep 2018 08:50:40 +0000 (10:50 +0200)]
efi_loader: SPDX-License-Identifier for efi_api.h

Add the missing SPDX-License-Identifier based on Linux kernel commit
b24413180f56 ("License cleanup: add SPDX GPL-2.0 license identifier to
files with no license").

Correct formatting errors.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: struct efi_simple_text_input_protocol
Heinrich Schuchardt [Sat, 8 Sep 2018 08:20:10 +0000 (10:20 +0200)]
efi_loader: struct efi_simple_text_input_protocol

%s/efi_simple_input_interface/efi_simple_text_input_protocol/

We should be consistent in the naming of the EFI protocol interface
structures. The protocol is called EFI_SIMPLE_TEXT_INPUT_PROTOCOL.

%s/ExtendedVerification/extended_verification/

Use consistent naming of function parameters. Do not use CamelCase.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: typo occured
Heinrich Schuchardt [Thu, 6 Sep 2018 18:29:50 +0000 (20:29 +0200)]
test/py: typo occured

%s/occured/occurred/

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest/py: test EFI_SIMPLE_TEXT_INPUT_PROTOCOL
Heinrich Schuchardt [Thu, 6 Sep 2018 18:19:31 +0000 (20:19 +0200)]
test/py: test EFI_SIMPLE_TEXT_INPUT_PROTOCOL

Execute the EFI selftest for the EFI_SIMPLE_TEXT_INPUT_PROTOCOL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_selftest: EFI_UNICODE_COLLATION_PROTOCOL
Heinrich Schuchardt [Tue, 4 Sep 2018 17:34:59 +0000 (19:34 +0200)]
efi_selftest: EFI_UNICODE_COLLATION_PROTOCOL

Provide a unit test for the EFI_UNICODE_COLLATION_PROTOCOL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: EFI_UNICODE_COLLATION_PROTOCOL
Heinrich Schuchardt [Tue, 4 Sep 2018 17:34:58 +0000 (19:34 +0200)]
efi_loader: EFI_UNICODE_COLLATION_PROTOCOL

The patch implements the EFI_UNICODE_COLLATION_PROTOCOL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest: tests for utf_to_lower() utf_to_upper().
Heinrich Schuchardt [Tue, 4 Sep 2018 17:34:57 +0000 (19:34 +0200)]
test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agolib: charset: upper/lower case conversion
Heinrich Schuchardt [Tue, 4 Sep 2018 17:34:56 +0000 (19:34 +0200)]
lib: charset: upper/lower case conversion

Provide functions for upper and lower case conversion.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: capitalization table
Heinrich Schuchardt [Tue, 4 Sep 2018 17:34:55 +0000 (19:34 +0200)]
efi_loader: capitalization table

This patch provides a define to initialize a table that maps lower to
capital letters for Unicode code point 0x0000 - 0xffff.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: Add console handle references to in/out/err
Alexander Graf [Tue, 4 Sep 2018 12:59:11 +0000 (14:59 +0200)]
efi_loader: Add console handle references to in/out/err

We register the console in/out protocol on the loaded image handle, but
never tell anyone about it in the systab.

Because of this Shell.efi can not find the input protocol. So let's add
a proper reference.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: use correct documentation style
Heinrich Schuchardt [Mon, 3 Sep 2018 03:00:43 +0000 (05:00 +0200)]
efi_loader: use correct documentation style

We have moved generating html documentation with Sphinx.

%s/Return Value/Return/g

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: description efi_update_capsule()
Heinrich Schuchardt [Mon, 3 Sep 2018 18:59:25 +0000 (20:59 +0200)]
efi_loader: description efi_update_capsule()

Correct the description of efi_update_capsule().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: fix typos in efi_runtime.c
Heinrich Schuchardt [Mon, 3 Sep 2018 17:29:41 +0000 (19:29 +0200)]
efi_loader: fix typos in efi_runtime.c

Fix multiple typos

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: fix typos in efi_boottime.c
Heinrich Schuchardt [Mon, 3 Sep 2018 17:12:24 +0000 (19:12 +0200)]
efi_loader: fix typos in efi_boottime.c

Fix numerous typos.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoRevert "Revert "efi_loader: efi_allocate_pages is too restrictive""
Stephen Warren [Thu, 30 Aug 2018 21:43:45 +0000 (15:43 -0600)]
Revert "Revert "efi_loader: efi_allocate_pages is too restrictive""

This reverts commit ccfc78b820e5e431c5bd73b072e7536a972e1710.

Now that the underlying issue is fixed, we can revert the revert and hence
restore the original EFI code.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoARM: tegra: reserve unmapped RAM so EFI doesn't use it
Stephen Warren [Thu, 30 Aug 2018 21:43:44 +0000 (15:43 -0600)]
ARM: tegra: reserve unmapped RAM so EFI doesn't use it

Tegra U-Boot ensures that board_get_usable_ram_top() never returns a value
over 4GB, since some peripherals can't access such addresses. However, on
systems with more than 2GB of RAM, RAM bank 1 does describe this extra
RAM, so that Linux (or whatever OS) can use it, subject to DMA
limitations. Since board_get_usable_ram_top() points at the top of RAM
bank 0, the memory locations describes by RAM bank 1 are not mapped by
U-Boot's MMU configuration, and so cannot be used for anything.

For some completely inexplicable reason, U-Boot's EFI support ignores the
value returned by board_get_usable_ram_top(), and EFI memory allocation
routines will return values above U-Boot's RAM top. This causes U-Boot to
crash when it accesses that RAM, since it isn't mapped by the MMU. One
use-case where this happens is TFTP download of a file on Jetson TX1
(p2371-2180).

This change explicitly tells the EFI code that this extra RAM should not
be used, thus avoiding the crash.

A previous attempt to make EFI honor board_get_usable_ram_top() was
rejected. So, this patch will need to be replicated for any board that
implements board_get_usable_ram_top().

Fixes: aa909462d018 ("efi_loader: efi_allocate_pages is too restrictive")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: simplify ifdefs
Stephen Warren [Thu, 30 Aug 2018 21:43:43 +0000 (15:43 -0600)]
efi_loader: simplify ifdefs

Use CONFIG_IS_ENABLED(EFI_LOADER) to avoid explicitly checking CONFIG_SPL
too. This simplifies the conditional.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agolib: charset: remove obsolete functions
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:34 +0000 (21:31 +0200)]
lib: charset: remove obsolete functions

Remove functions:
- utf8_to_utf16()
- utf16_strcpy()
- utf16_strdup()

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: buffer size for load options
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:33 +0000 (21:31 +0200)]
efi_loader: buffer size for load options

The number of bytes in an utf-8 string is an upper limit for the number of
words in the equivalent utf-16 string. In so far the inumbant coding works
correctly. For non-ASCII characters the utf-16 string is shorter. With the
patch only the necessary buffer size is allocated for the load options.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: don't use unlimited stack as buffer
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:32 +0000 (21:31 +0200)]
efi_loader: don't use unlimited stack as buffer

The length of a string printed to the console by the
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL is not limited by the UEFI spec.
Hence should not allocate a buffer for it on the stack.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: remove limit on variable length
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:31 +0000 (21:31 +0200)]
efi_loader: remove limit on variable length

The EFI spec does not provide a length limit for variables.

Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest: test printing Unicode
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:30 +0000 (21:31 +0200)]
test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agolib: vsprintf: correct printing of Unicode strings
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:29 +0000 (21:31 +0200)]
lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest: unit tests for Unicode functions
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:28 +0000 (21:31 +0200)]
test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agolib: charset: utility functions for Unicode
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:27 +0000 (21:31 +0200)]
lib: charset: utility functions for Unicode

utf8_get() - get next UTF-8 code point from buffer
utf8_put() - write UTF-8 code point to buffer
utf8_utf16_strnlen() - length of a utf-8 string after conversion to utf-16
utf8_utf16_strncpy() - copy a utf-8 string to utf-16
utf16_get() - get next UTF-16 code point from buffer
utf16_put() - write UTF-16 code point to buffer
utf16_strnlen() - number of codes points in a utf-16 string
utf16_utf8_strnlen() - length of a utf-16 string after conversion to utf-8
utf16_utf8_strncpy() - copy a utf-16 string to utf-8

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: rename utf16_strlen, utf16_strnlen
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:26 +0000 (21:31 +0200)]
efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agolib: build charset.o only if needed
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:25 +0000 (21:31 +0200)]
lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agotest: print_ut.c use #if CONFIG_IS_ENABLED(EFI_LOADER)
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:24 +0000 (21:31 +0200)]
test: print_ut.c use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agovsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)
Heinrich Schuchardt [Fri, 31 Aug 2018 19:31:23 +0000 (21:31 +0200)]
vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: Pass address to fs_read()
Alexander Graf [Wed, 8 Aug 2018 09:54:32 +0000 (03:54 -0600)]
efi_loader: Pass address to fs_read()

The fs_read() function wants to get an address rather than the
pointer to a buffer.

So let's convert the passed buffer from pointer back a the address
to make efi_loader on sandbox happier.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi: sandbox: Tidy up copy_fdt() to work with sandbox
Simon Glass [Wed, 8 Aug 2018 09:54:30 +0000 (03:54 -0600)]
efi: sandbox: Tidy up copy_fdt() to work with sandbox

At present this function takes a pointer as its argument, then passes this
to efi_allocate_pages(), which actually takes an address. It uses casts,
which are not supported on sandbox.

Also the function calculates the FDT size rounded up to the neared EFI
page size, then its caller recalculates the size and adds a bit more to
it.

This function is much better written as something that works with
addresses only, and returns both the address and the size of the relocated
FDT.

Also, copy_fdt() returns NULL on error, but really should propagate the
error from efi_allocate_pages(). To do this it needs to return an
efi_status_t, not a void *.

Update the code in this way, so that it is easier to follow, and also
supports sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi: Relocate FDT to 127MB instead of 128MB
Simon Glass [Wed, 8 Aug 2018 09:54:29 +0000 (03:54 -0600)]
efi: Relocate FDT to 127MB instead of 128MB

Sandbox only has 128MB of memory so we cannot relocate the device tree up
to start at 128MB. Use 127MB instead, which should be safe.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_selftest: test for loaded image protocol
Heinrich Schuchardt [Sun, 26 Aug 2018 13:31:53 +0000 (15:31 +0200)]
efi_selftest: test for loaded image protocol

Verify that the loaded image protocol is installed on the image handle.
Verify that the loaded image protocol points to the system table.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_loader: pass system table in loaded image protocol
Heinrich Schuchardt [Sun, 26 Aug 2018 13:31:52 +0000 (15:31 +0200)]
efi_loader: pass system table in loaded image protocol

The system table must be passed as a pointer in the loaded image
protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoefi_selftest: memory leak testing manage protocols
Heinrich Schuchardt [Sun, 26 Aug 2018 12:58:16 +0000 (14:58 +0200)]
efi_selftest: memory leak testing manage protocols

Remove memory leak in efi_selftest_manageprotocols.c.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-mips
Tom Rini [Sun, 23 Sep 2018 19:14:12 +0000 (15:14 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-mips

5 years agomips: mt7628a.dtsi: Add SPI clock-frequency property
Stefan Roese [Thu, 16 Aug 2018 13:27:33 +0000 (15:27 +0200)]
mips: mt7628a.dtsi: Add SPI clock-frequency property

This patch adds the clock-frequency property to the SPI controller
DT node. It will be used by the SPI driver to calculate the baud rate.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agomips: mt76xx: Add sysreset support
Stefan Roese [Thu, 16 Aug 2018 13:27:32 +0000 (15:27 +0200)]
mips: mt76xx: Add sysreset support

This patch adds the necessary sysreset DT node and enables the required
drivers via Kconfig.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agomips: Add Gardena Smart-Gateway board support
Stefan Roese [Thu, 16 Aug 2018 13:27:31 +0000 (15:27 +0200)]
mips: Add Gardena Smart-Gateway board support

The Gardena Smart-Gateway boards have a MT7688 SoC with 128 MiB of RAM
and 8 MiB of flash (SPI NOR) and additional 128MiB SPI NAND storage.

This patch also includes 2 targets. One is the target that can be
programmed into the SPI NOR flash and a 2nd target "xxx-ram" is
added to support loading and booting via an already running U-Boot
version. This allows easy development and testing without the
need to flash the image each time.

Signed-off-by: Stefan Roese <sr@denx.de>
[fixed and regenerated defconfig files]
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agomips: Add LinkIt Smart 7688 support
Stefan Roese [Thu, 16 Aug 2018 13:27:30 +0000 (15:27 +0200)]
mips: Add LinkIt Smart 7688 support

The LinkIt Smart 7688 modules have a MT7688 SoC with 128 MiB of RAM
and 32 MiB of flash (SPI NOR).

This patch also includes 2 targets. One is the target that can be
programmed into the SPI NOR flash and a 2nd target "xxx-ram" is
added to support loading and booting via an already running U-Boot
version. This allows easy development and testing without the
need to flash the image each time.

Signed-off-by: Stefan Roese <sr@denx.de>
[fixed and regenerated defconfig files]
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agomips: Add basic MediaTek MT7620/88 support
Stefan Roese [Wed, 5 Sep 2018 13:12:35 +0000 (15:12 +0200)]
mips: Add basic MediaTek MT7620/88 support

This patch adds basic support for the MediaTek MT7620/88 SoCs. Parts of
the code is copied from the MediaTek GitHub repository:

https://github.com/MediaTek-Labs/linkit-smart-uboot.git

The mt7628a.dtsi file is imported from Linux v4.17.

Support for the LinkIt Smart 7688 module and the Gardena Smart Gateway
both based on the MT7688 will be added in further patches.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agomips: Add arch/mips/include/asm/atomic.h
Stefan Roese [Thu, 16 Aug 2018 13:27:29 +0000 (15:27 +0200)]
mips: Add arch/mips/include/asm/atomic.h

This is needed for the UBIFS support. The file is a copy of
arch/xtensa/include/asm/atomic.h

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: cache: remove config option CONFIG_SYS_MIPS_CACHE_MODE
Daniel Schwierzeck [Fri, 7 Sep 2018 17:02:06 +0000 (19:02 +0200)]
MIPS: cache: remove config option CONFIG_SYS_MIPS_CACHE_MODE

Caches should be configured to mode CONF_CM_CACHABLE_NONCOHERENT
(or CONF_CM_CACHABLE_COW when a CM is available). There is no
need to make this configurable.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: cache: make index base address configurable
Daniel Schwierzeck [Fri, 7 Sep 2018 17:02:05 +0000 (19:02 +0200)]
MIPS: cache: make index base address configurable

The index base address used for the cache initialisation is currently
hard-coded to CKSEG0. Make this value configurable if a MIPS system
needs to have a different address (e.g. in SRAM or ScratchPad RAM).

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: cache: optimise changing of k0 CCA mode
Daniel Schwierzeck [Fri, 7 Sep 2018 17:02:04 +0000 (19:02 +0200)]
MIPS: cache: optimise changing of k0 CCA mode

Changing the Cache Coherency Algorithm (CCA) for kernel mode
requires executing from KSEG1. Thus do a jump from KSEG0 to KSEG1
before changing the CCA mode. Jump back to KSEG0 afterwards.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: cache: reimplement dcache_[status, enable, disable]
Daniel Schwierzeck [Fri, 7 Sep 2018 17:02:03 +0000 (19:02 +0200)]
MIPS: cache: reimplement dcache_[status, enable, disable]

Those functions are not needed during cache init and can be
implemented in C. Only support the safe disabling of caches when
this is required for booting an OS. Reenabling caches is much
harder to implement if an optional coherency manager must be
supported. As there is no real use-case anyway, dcache_enable
is implemented with an error message.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: start.S: make boot config at offset 0x10 configurable
Daniel Schwierzeck [Fri, 7 Sep 2018 17:18:44 +0000 (19:18 +0200)]
MIPS: start.S: make boot config at offset 0x10 configurable

Some MIPS systems store some board-specific boot configuration
in the U-Boot binary at offset 0x10. This is used by Malta boards
and by Lantiq/Intel SoC's when booting from parallel NOR flash.

Convert the hard-coded values to Kconfig options to remove such
board-specific stuff out of the generic start.S code. This also
deprecates the config option CONFIG_SYS_XWAY_EBU_BOOTCFG.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agobcm968380gerg: enable pinctrl
Philippe Reynes [Mon, 13 Aug 2018 12:23:09 +0000 (14:23 +0200)]
bcm968380gerg: enable pinctrl

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
5 years agodt: bcm6838: add pinctrl
Philippe Reynes [Mon, 13 Aug 2018 12:23:08 +0000 (14:23 +0200)]
dt: bcm6838: add pinctrl

Add pinctrl node and related syscon node for broadcom bcm6838 SoC.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
5 years agopinctrl: bcm6838: add pinctrl support
Philippe Reynes [Mon, 13 Aug 2018 12:23:07 +0000 (14:23 +0200)]
pinctrl: bcm6838: add pinctrl support

Add pinctrl support for broadcom bcm6838 SoC.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
5 years agoMerge git://git.denx.de/u-boot-imx
Tom Rini [Thu, 20 Sep 2018 00:35:27 +0000 (20:35 -0400)]
Merge git://git.denx.de/u-boot-imx

- changes in pico-* boards
- fix imx6ull pinmux

5 years agoMerge git://git.denx.de/u-boot-marvell
Tom Rini [Thu, 20 Sep 2018 00:35:05 +0000 (20:35 -0400)]
Merge git://git.denx.de/u-boot-marvell

- Multiples updates to the turris boards / platform
- Changes / enhancements to the Marvell PHY drivers, mainly
  to support the turris platform
- Many fixes and enhancements to the pxa3xx NAND driver
- Fixes for the UART boot mode in kwboot
- Misc minor changes to other 32bit and 64bit boards

5 years agoarm: mvebu: clearfog: enable eMMC boot partitions support
Baruch Siach [Thu, 13 Sep 2018 09:41:50 +0000 (12:41 +0300)]
arm: mvebu: clearfog: enable eMMC boot partitions support

The Clearfog SOM can optionally have eMMC installed. Enable support for
eMMC boot partitions by default.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agophy: marvell: add SATA comphy RX/TX polarity invert support
Rabeeh Khoury [Thu, 6 Sep 2018 09:37:48 +0000 (12:37 +0300)]
phy: marvell: add SATA comphy RX/TX polarity invert support

This patch adds support to Armada 7k/8k comphy RX/TX lane swap. The
'phy-invert' DT property defines the inverted signals.

Signed-off-by: Rabeeh Khoury <rabeeh@solid-run.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agofix: cmd: mvebu: Exclude mvebu commands from SPL builds
Konstantin Porotchkin [Wed, 29 Aug 2018 13:34:54 +0000 (16:34 +0300)]
fix: cmd: mvebu: Exclude mvebu commands from SPL builds

Exclude mvebu commands from SPL builds

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agofix: mvebu: Add SPI parameters for environment setup
Konstantin Porotchkin [Wed, 29 Aug 2018 13:34:53 +0000 (16:34 +0300)]
fix: mvebu: Add SPI parameters for environment setup

Add definitions for CONFIG_ENV_SPI_BUS and CONFIG_ENV_SPI_CS
to Armada-388-GP board configuration

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agofix: env: Fix the SPI flash device setup for DM mode
Konstantin Porotchkin [Wed, 29 Aug 2018 13:34:52 +0000 (16:34 +0300)]
fix: env: Fix the SPI flash device setup for DM mode

For some reason the spi_flash_probe_bus_cs() is called
inside the setup_flash_device() with zero values in place
of configurated SPI flash mode and maximum flash speed.
This code causes HALT error during startup environment
relocation on some platforms - namely Armada-38x-GP board.
Fix the function call by replacing zeros with the appropriate
values - CONFIG_ENV_SPI_MAX_HZ and CONFIG_ENV_SPI_MODE.

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agofix: nand: pxa3xx: Add WA for eliminating flash ready timeout
David Sniatkiwicz [Wed, 29 Aug 2018 08:56:18 +0000 (11:56 +0300)]
fix: nand: pxa3xx: Add WA for eliminating flash ready timeout

add delay before processing the status flags in pxa3xx_nand_irq().

Signed-off-by: David Sniatkiwicz <davidsn@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
c: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Stefan Roese <sr@denx.de>