Jaehoon Chung [Tue, 22 Dec 2020 10:32:21 +0000 (11:32 +0100)]
dfu: add 'SKIP' entity
Define a new 'SKIP' type for the DFU entities. The flashed data for that
entity is simply ignored without returning any error values.
This allows to have one flashing procedure and images for the different
board types or variants, where each board uses only the images relevant
to it and skips the rest. This is especially usefull for the THOR
protocol, which usually transfers more than one file in a single session.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
[mszyprow: rephrased commit message and docs for easier reading, changed
subject to "dfu: add 'SKIP' entity"]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Marek Szyprowski [Tue, 22 Dec 2020 10:32:20 +0000 (11:32 +0100)]
dfu: mmc: use the default MMC device if entity specifies it as -1
Use the default MMC device set in the command line if entity specifies it
as -1. This allows to use the same dfu_alt_info string for different MMC
devices (like embedded eMMC and external SD card if data layout is the
same on both devices).
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Marek Szyprowski [Thu, 17 Dec 2020 10:47:11 +0000 (11:47 +0100)]
cmd: usb_mass_storage: show device interface name
Show the interface name (i.e. 'mmc') in the information string to ease
user checking which device is exported via USB Mass Storage protocol.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Andy Shevchenko [Thu, 3 Dec 2020 15:32:05 +0000 (17:32 +0200)]
f_fastboot: Avoid use-after-free in the global pointer variable
In case of usb_add_function() failure the error path has an issue,
i.e the global pointer variable is assigned to garbage
Fix the above mentioned issue by assigning pointer to NULL.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Andy Shevchenko [Thu, 3 Dec 2020 15:32:04 +0000 (17:32 +0200)]
f_rockusb: Avoid use-after-free in the global pointer variable
In case of usb_add_function() failure the error path has two issues:
- the potentially allocated structure isn't getting freed
- the global pointer variable is assigned to garbage
Fix the above mentioned issues by freeing memory and assigning NULL.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Andy Shevchenko [Thu, 3 Dec 2020 15:32:03 +0000 (17:32 +0200)]
f_rockusb: Use NULL instead of 0 for pointers
get_rkusb() mistakenly uses integers without cast.
Convert them to proper type.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Eugeniu Rosca [Fri, 23 Oct 2020 08:52:23 +0000 (11:52 +0300)]
cmd: bcb: Add support for processing const string literals in bcb_set()
On request/suggestion from Simon Glass back in May 22 2019 [1], the
'strsep' mechanism implemented in bcb_set() was set to work directly
with user-provided argv strings, to avoid duplicating memory and for
the sake of simpler implementation.
However, since we recently exposed bcb_write_reboot_reason() API to be
called by U-Boot fastboot, the idea is to be able to pass const string
literals to this new BCB API, carrying the reboot reason.
Since 'strsep' (just like its older/superseded sibling 'strtok')
modifies the input string passed as parameter, BCB command in its
current state would attempt to perform in-place modifications in a
readonly string, which might lead to unexpected results.
Fix the above with the cost of one dynamic memory allocation ('strdup').
This will also ensure no compiler warnings when passing string literals
to bcb_write_reboot_reason().
[1] http://u-boot.10912.n7.nabble.com/PATCH-v2-0-2-Add-bcb-command-to-read-modify-write-Android-BCB-td369934i20.html#a370456
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Eugeniu Rosca [Fri, 23 Oct 2020 08:52:22 +0000 (11:52 +0300)]
cmd: bcb: Expose 'bcb_write_reboot_reason' to external callers
Fastboot is evolving and beginning with commit [1], the
upstream implementation expects bootloaders to offer support for:
- reboot-recovery
- reboot-fastboot
The most natural way to achieve the above is through a set of
pre-defined "reboot reason" strings, written into / read from
the BCB "command" field, e.g.:
- bootonce-bootloader [2]
- boot-fastboot [3]
- boot-recovery [4]
Expose the first 'bcb' API meant to be called by e.g. fastboot stack,
to allow updating the BCB reboot reason via the BCB 'command' field.
[1] https://android.googlesource.com/platform/system/core/+/
dea91b4b5354af2
("Add fastbootd.")
[2] https://android.googlesource.com/platform/bootable/recovery/+/
cba7fa88d8b9
("Add 'reboot bootloader' to bootloader_message.")
[3] https://android.googlesource.com/platform/bootable/recovery/+/
eee4e260f9f6
("recovery: Add "boot-fastboot" command to BCB.")
[4] https://android.googlesource.com/platform/system/core/+/
5e98b633a748695f
("init: Write the reason in BCB on "reboot recovery"")
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
[lukma - added missing #include <linux/errno.h> to avoid build breaks]
Eugeniu Rosca [Fri, 23 Oct 2020 08:52:21 +0000 (11:52 +0300)]
cmd: bcb: Extract '__bcb_store' from 'do_bcb_store' for internal needs
Enriching the functionality of U-Boot 'bcb' may assume using the
existing sub-commands as building blocks for the next ones.
A clean way to achive the above is to expose a number of static
routines, each mapped to an existing user command (e.g. load/set/store),
with a user/caller-friendly prototype (i.e. do not force the caller
to wrap an integer into a string).
This third patch makes '__bcb_store' available for internal needs.
No functional change intended.
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Eugeniu Rosca [Fri, 23 Oct 2020 08:52:20 +0000 (11:52 +0300)]
cmd: bcb: Extract '__bcb_set' from 'do_bcb_set' for internal needs
Enriching the functionality of U-Boot 'bcb' may assume using the
existing sub-commands as building blocks for the next ones.
A clean way to achive the above is to expose a number of static
routines, each mapped to an existing user command (e.g. load/set/store),
with a user/caller-friendly prototype (i.e. do not force the caller
to wrap an integer into a string).
This second patch makes '__bcb_set' available for internal needs.
No functional change intended.
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Eugeniu Rosca [Fri, 23 Oct 2020 08:52:19 +0000 (11:52 +0300)]
cmd: bcb: Extract '__bcb_load' from 'do_bcb_load' for internal needs
Enriching the functionality of U-Boot 'bcb' may assume using the
existing sub-commands as building blocks for the next ones.
A clean way to achive the above is to expose a number of static
routines, each mapped to an existing user command (e.g. load/set/store),
with a user/caller-friendly prototype (i.e. do not force the caller
to wrap an integer into a string).
This first patch makes '__bcb_load' available for internal needs.
No functional change, except for a tiny update in error handling.
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Seung-Woo Kim [Fri, 16 Oct 2020 07:29:02 +0000 (16:29 +0900)]
gadget: f_thor: fix wrong file size cast
Casting 32bit int value directly into 64bit unsigned type causes
wrong value for file size equal or larger than 2GB. Fix the wrong
file size by casting uint32_t first.
Fixes: commit
1fe9ae76b113 ("gadget: f_thor: update to support more than 4GB file as thor 5.0")
Reported-by: Junghoon Kim <jhoon20.kim@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Guillermo Rodriguez [Wed, 2 Sep 2020 11:06:06 +0000 (13:06 +0200)]
dfu: Fix handling of UBI partitions in MTD backend
For UBI partitions ("partubi" in dfu_alt_info), dfu_fill_entity_mtd sets
the mtd.ubi flag; however other functions incorrectly check for nand.ubi
instead. Fix this by checking for the correct flag.
Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Tom Rini [Fri, 29 Jan 2021 18:56:04 +0000 (13:56 -0500)]
configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 29 Jan 2021 18:50:06 +0000 (13:50 -0500)]
Merge branch '2021-01-29-assorted-fixes'
- Assorted test fixes
- Assorted minor FAT fixes
- Assorted Kconfig dependency fixes
- MediaTek, vexpress_aemv8a improvements
- Other assorted minor fixes
Heinrich Schuchardt [Tue, 19 Jan 2021 19:44:45 +0000 (19:44 +0000)]
cmd: add more implementation IDs to sbi command
Additional SBI implementation IDs have been added to the upcoming
next version of the SBI specification.
https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Sun, 17 Jan 2021 23:17:34 +0000 (00:17 +0100)]
test: inconsistent string tests
Excluding ut str in test/cmd_ut.c but compiling test/str_ut.c results in
failure of the Python test invoking the C unit tests as observed on
sipeed_riscv_smode_defconfig:
FAILED test/py/tests/test_ut.py::test_ut[ut_str_upper]
Allow to compile test/str_ut.c on all boards.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Heinrich Schuchardt [Sun, 17 Jan 2021 23:17:33 +0000 (00:17 +0100)]
test: inconsistent bootm tests
Excluding ut bootm in test/cmd_ut.c but compiling test/bootm.c results in
failure of the Python test invoking the C unit tests as observed on
sipeed_riscv_smode_defconfig:
FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_nop]
FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_nospace]
FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_silent]
FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_silent_var]
FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_subst]
FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_subst_both]
FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_subst_var]
Only compile test/bootm.c on the sandbox.
Fixes:
f158ba15ee0f ("bootm: Add tests for fixup_silent_linux()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Patrick Delaunay [Mon, 4 Jan 2021 13:41:31 +0000 (14:41 +0100)]
env: sf: cosmetic: remove unnecessary space
Remove the unnecessary space before the 2 "done:" labels
in env_sf_save().
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tom Rini [Thu, 28 Jan 2021 19:39:56 +0000 (14:39 -0500)]
test: Update test_fs to not use deprecated pytest.yield_fixture()
As noted in comments, yield_fixture has been deprecated for longer than
our minimum required version of pytest. Newer versions of pytest cause
this to be a louder warning, and as the migration is trivial, perform it
now.
Signed-off-by: Tom Rini <trini@konsulko.com>
Heinrich Schuchardt [Thu, 28 Jan 2021 11:46:11 +0000 (12:46 +0100)]
test: correct entry point to pytest
With Pytest 6.0.2 'make tests' fails:
sandbox: Traceback (most recent call last):
File "./test/py/test.py", line 20, in <module>
sys.exit(load_entry_point('pytest', 'console_scripts', 'pytest')(args))
TypeError: console_main() takes 0 positional arguments but 1 was given
The definition of console_scripts has changed as follows:
Pytest 4.6.1:
[options.entry_points]
console_scripts =
pytest=pytest:main
py.test=pytest:main
Pytest 6.0.2:
[options.entry_points]
console_scripts =
pytest=pytest:console_main
py.test=pytest:console_main
The new function console_main() has a comment:
"This function is not meant for programmable use; use `main()`"
Hence let's call pytest.main() directly.
Move args processing into the __main__ paragraph.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Tested-by: Tom Rini <trini@konsulko.com>
Heinrich Schuchardt [Wed, 27 Jan 2021 11:09:46 +0000 (12:09 +0100)]
test: pr_cont_test.o depends on CONFIG_LOG=y
Compiling wandboard_defconfig with CONFIG_UT_LOG=y leads to a build error:
test/log/pr_cont_test.c: In function ‘log_test_pr_cont’:
test/log/pr_cont_test.c:28:14: error:
‘gd_t’ {aka ‘volatile struct global_data’} has no member named ‘log_fmt’
log_fmt = gd->log_fmt;
We do not want to let CONFIG_UT_LOG depend on CONFIG_LOG=y because we have
tests for logging functions called with CONFIG_LOG=n.
Fix the build dependency.
Reported-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Matthias Brugger [Wed, 27 Jan 2021 09:42:30 +0000 (10:42 +0100)]
fs: btrfs: Select SHA256 in Kconfig
Since commit
565a4147d17a ("fs: btrfs: Add more checksum algorithms")
btrfs uses the sha256 checksum algorithm. But Kconfig lacks to select
it. This leads to compilation errors:
fs/built-in.o: In function `hash_sha256':
fs/btrfs/crypto/hash.c:25: undefined reference to `sha256_starts'
fs/btrfs/crypto/hash.c:26: undefined reference to `sha256_update'
fs/btrfs/crypto/hash.c:27: undefined reference to `sha256_finish'
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Heinrich Schuchardt [Mon, 25 Jan 2021 23:14:14 +0000 (00:14 +0100)]
fs: fat: remove superfluous assignments
Do not assign a value to a variable if it is not used.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Mon, 25 Jan 2021 23:04:19 +0000 (00:04 +0100)]
fs: fat: avoid out of bounds access warning
When copying short name plus extension refer to the encapsulating structure
and not to the short name element.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Mon, 25 Jan 2021 11:17:57 +0000 (12:17 +0100)]
avb: AVB_VERIFY depends on MMC
AVB Verified Boot uses functions related to MMC.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Stanislav Pinchuk [Wed, 20 Jan 2021 18:54:53 +0000 (21:54 +0300)]
vexpress_aemv8a: allow overriding BOOTCOMMAND
Re-send because of line-wraps.
This patch fixes the behaviour of the menuconfig's BOOTCOMMAND
setting. Which is just ignored without that patch on
vexpress_aemv8a platform.
Signed-off-by: Stanislav.Pinchuk@kaspersky.com
SkyLake.Huang [Wed, 20 Jan 2021 07:31:34 +0000 (15:31 +0800)]
arm: dts: enable MTK SPI NOR controller driver
1. Enable MTK SPI NOR controller driver on mt7622 & mt7629.
2. Enable quad mode for read and single mode for write.
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
SkyLake.Huang [Wed, 20 Jan 2021 07:31:33 +0000 (15:31 +0800)]
spi: mtk_snor: add support for MTK SPI NOR controller
This patch adds support for MTK SPI NOR controller, which you
can see on mt7622 & mt7629.
1. This controller is designed only for SPI NOR. We can't adjust
its bus clock dynamically. Set clock in dts instead.
2. This controller only supports 1-1-1 write mode.
3. Remove mtk_snor_match_read() since upper SPI-MEM layer already
handles command.
4. sf read/write/update commands are tested with this driver.
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
Tom Rini [Tue, 19 Jan 2021 19:40:10 +0000 (14:40 -0500)]
test: test_ofplatdata: Mark as sandbox specific
This test checks for output specific to the sandbox device tree, mark it
as sandbox specific.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Thu, 28 Jan 2021 16:37:58 +0000 (11:37 -0500)]
Merge branch '2021-01-27-assorted-fixes-and-improvements'
- A wide variety of fixes throughout the tree.
Marek Szyprowski [Fri, 22 Jan 2021 11:27:31 +0000 (12:27 +0100)]
cmd: misc: Fix return value for the sleep command
If sleeping has been interrupted, return CMD_RET_FAILURE instead of -1
(CMD_RET_USAGE).
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Ying-Chun Liu (PaulLiu) [Fri, 15 Jan 2021 05:53:03 +0000 (13:53 +0800)]
doc: device-tree-bindings: rtc: Abracon AB x80x i2c rtc
Document the bindings for abracon,abx80x and related compatibles.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Ying-Chun Liu (PaulLiu) [Fri, 15 Jan 2021 05:53:02 +0000 (13:53 +0800)]
rtc: add rtc-abx80x, a driver for the Abracon AB x80x i2c rtc
This is a basic driver for the ultra-low-power Abracon AB x80x series
of RTC chips. It supports in particular, the supersets AB0805 and AB1805.
It allows reading and writing the time, and enables the supercapacitor or
battery charger.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Yuezhang.Mo@sony.com [Fri, 15 Jan 2021 03:11:49 +0000 (03:11 +0000)]
autoboot: fix illegal memory access when stop key and delay key are empty
If both stop key and delay key are empty, the length of these
keys is 0. The subtraction operation will cause the u_int type
variable to overflow, will cause illegal memory access in key
input loop.
This commit fixes this bug by using int type instead of u_init.
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Simon Glass [Thu, 14 Jan 2021 03:29:57 +0000 (20:29 -0700)]
binman: Allow reading entries from a subnode
Some images may have multiple copies of the same thing, e.g. two versions
of the read/write U-Boots. It is necessary to read data from one or other
of these under selection of the verified-boot logic. Add a function to
select the subnode to use.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:56 +0000 (20:29 -0700)]
binman: Move selection of the binman node into a function
Move this logic out of the main init function so it is available for
other purpose.
Use a different error when multiple-images is in use but no subnode is
available. This makes it easier to determine what is wrong.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:55 +0000 (20:29 -0700)]
crc32: Exclude crc32 from TPL
Unfortunately the toolchain often brings in the crc32 table even if the
function is not actually used. For now, exclude it from the TPL build,
which is very sensitive to size.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:54 +0000 (20:29 -0700)]
mmc: pci_mmc: Set the removable flag
Set this flag so that it is available to those looking at the device. For
non-removable devices there is no need to check for insertion/removable
since the media can never change.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Simon Glass [Thu, 14 Jan 2021 03:29:52 +0000 (20:29 -0700)]
mmc: pci_mmc: Only generate ACPI code for the SD card
At present if an eMMC part is in the system, the ACPI table generated
will include information about that, as well as the SD card. We only need
to include the SD card, since it has a card-detect GPIO. Use a different
compatible string for each option, and add code only for the SD card.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Simon Glass [Thu, 14 Jan 2021 03:29:51 +0000 (20:29 -0700)]
uuid: Add a comment for UUID_STR_LEN
This macro is the length of the string but excludes the terminator. Users
must add 1 when declaring a large-enough string. Add a comment to make
this clear.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:50 +0000 (20:29 -0700)]
display_options: Use USE_TINY_PRINTF for SPL check
At present this code uses a simple printf() format if running in SPL. But
SPL can use the full printf. Use USE_TINY_PRINTF instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:49 +0000 (20:29 -0700)]
fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
This setting may be different in SPL and TPL. Update the code to check
the correct setting.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:48 +0000 (20:29 -0700)]
fdtdec: Update the missing-devicetree message
This includes information about sandbox which is not relevant for most
boards. Drop it.
Also add the address to help figure out the problem.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:47 +0000 (20:29 -0700)]
net: Use CONFIG_IS_ENABLED() in eth_dev_get_mac_address()
This function may be used in SPL where devicetree is not available.
Use the correct macro so that the function does not try to read it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:46 +0000 (20:29 -0700)]
video: Allow syncing the entire framebuffer to the copy
In some cases so much of the framebuffer is updated that it is not worth
copying the changes piece by piece to the copy framebuffer. Add a function
to copy the whole thing.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:44 +0000 (20:29 -0700)]
bloblist: Add missing tag names
Add tag names for recently added types.
Fixes:
d2cb7a22da0 (x86: Allow putting some tables in the bloblist)
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:43 +0000 (20:29 -0700)]
bloblist: Support relocating to a larger space
Typically in TPL/SPL the bloblist is quite small. But U-Boot proper may
want to add a lot more to it, such as ACPI tables.
Add a way to expand the bloblist by relocating it in U-Boot proper, along
with the other relocation activities.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 14 Jan 2021 03:29:42 +0000 (20:29 -0700)]
spl: Add functions for next and previous phase
It is useful to be able to figure out which phase we are loading next and
which phase we came from. Add some functions to handle this as well as
returning the name of a phase. This allows messages like "Booting to x"
where x is the next phase.
At present, TPL says 'Jumping to U-Boot' at the end, when in fact it is
jumping to SPL. This is confusing, so use the new functions to correct
this.
Tests for this will come with an upcoming minor SPL test refactor.
Signed-off-by: Simon Glass <sjg@chromium.org>
Philippe Reynes [Tue, 12 Jan 2021 18:18:54 +0000 (19:18 +0100)]
lib: rsa: rsa-verify: don't look for keys in the FIT image
In the function rsa_verify_hash, if the "main" key doesn't
work, u-boot try others keys. But it searches those keys
in the FIT image instead of the u-boot device tree.
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Stefan Roese [Tue, 12 Jan 2021 11:03:43 +0000 (12:03 +0100)]
pci: Remove CONFIG_PCI_ENUM_ONLY as it's not used (any more)
This patch completely removes CONFIG_PCI_ENUM_ONLY from the PCI code as
it is not configured for any board (any more). With this removal, some
PCI related files get cleaned up a bit.
Additional, dm_pciauto_setup_device() is now static, as it's not
referenced from any code outside of this C file.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Mon, 11 Jan 2021 14:46:58 +0000 (08:46 -0600)]
common: fit-sig: Fix error message in fit_config_verify_sig()
In fit_config_verify_sig(), when no 'signature*' subnode exists in
the configuration node, the fdt_for_each_subnode() loop is a no-op.
Therefore, no error flags are set, and 'err_,sg' is not populated
with an error string. This is incorrect behavior.
Populate err_msg to indicate that no 'signature' is found, before
entering the loop. The first call to fit_image_verify_sig() will
override clear err_msg, or set it to a more specific message.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Volodymyr Babchuk [Tue, 5 Jan 2021 20:03:11 +0000 (20:03 +0000)]
smccc: fix sign bit expansion
Signed ARM_SMCCC_FAST_CALL value is shifted to 31'st bit. Then, it is expanded
to 64 bit value, which results in 1s in higher 32 bits.
This causes corrupted values in 64-bit SMC IDs and issues in buggy handlers of
32-bit calls.
We need to make ARM_SMCCC_FAST_CALL unsigned long, so it would work properly
on 32 bit architectures.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Philippe Reynes [Fri, 11 Dec 2020 18:56:47 +0000 (19:56 +0100)]
bootcount: allow to use this feature on TPL
This commit add an option TPL_BOOTCOUNT_LIMIT to
use bootcount on TPL.
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Pali Rohár [Wed, 4 Nov 2020 14:33:44 +0000 (15:33 +0100)]
Makefile: Do not call useless command 'true'
Macro 'cmd_objcopy_uboot' currently does not work with passed empty command
expanded from 'cmd_static_rela' and therefore dummy command 'true' is set
in 'cmd_static_rela' to workaround this issue.
Eliminate it now by fixing 'cmd_objcopy_uboot' macro to work also with
empty 'cmd_static_rela' macro and remove useless invocation of command
'true'.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini [Wed, 27 Jan 2021 16:39:31 +0000 (11:39 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
- Espressobin: Disable slot when emmc is not present (Pali)
- DS414; config header cleanup (Phil)
- PCI: auto-config enhancement (Phil)
- pci_mvebu: Also map IO region (Phil)
- serial: a3720: Implement pending method for output direction (Pali)
- turris_mox: Enable a few commands (Marek)
- helios4 & ClearFog changes (Dennis)
- Plus some minor misc changes
Tom Rini [Wed, 27 Jan 2021 16:32:23 +0000 (11:32 -0500)]
Merge tag 'doc-2021-04-rc1-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for documentation tag doc-2021-04-rc1-3
Update the build system for the HTML documentation to allow using
Sphinx 3.
Man-page for exception command.
Tom Rini [Wed, 27 Jan 2021 16:30:31 +0000 (11:30 -0500)]
Merge branch '2021-01-27-assorted-net-updates'
- e1000 fixes for MIPS
- netconsole and ping fix
- cortina_ni driver
- micrel PHY fix
- Add fdtoverlays keyword to extlinux file parsing
Neil Armstrong [Wed, 20 Jan 2021 08:54:53 +0000 (09:54 +0100)]
cmd: pxe: add support for FDT overlays
This adds support for specifying FDT overlays in an extlinux/pxelinux
configuration file.
Without this, there is no simple way to apply overlays when the kernel
and fdt is loaded by the pxe command.
This change adds the 'fdtoverlays' keyword for a label, supporting multiple
overlay files to be applied on top of the fdt specified in the 'fdt' or
'devicetree' keyword.
Example:
label linux
kernel /Image
fdt /soc-board.dtb
fdtoverlays /soc-board-function.dtbo
append console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait
This code makes usage of a new variable called fdtoverlay_addr_r used to load
the overlay files without overwritting anything important.
Cc: Tom Rini <trini@konsulko.com>
Cc: Andre Heider <a.heider@gmail.com>
Cc: Jernej Škrabec <jernej.skrabec@siol.net>
Cc: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Jernej Škrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Škrabec <jernej.skrabec@siol.net>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Marek Vasut [Sat, 16 Jan 2021 23:16:16 +0000 (00:16 +0100)]
net: phy: micrel: Try default PHY ofnode first
The phydev structure has a PHY OF node pointer in it, use that OF node
first when looking up PHY OF node properties, since that is likely the
correct PHY OF node pointer. If the pointer is not valid, which is the
case e.g. on legacy DTs, fall back to parsing MAC ethernet-phy subnode.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Alex Nemirovsky [Thu, 14 Jan 2021 21:34:13 +0000 (13:34 -0800)]
board: presidio-asic: Add CAxxxx Ethernet support
Add CAxxxx Ethernet support for the Cortina Access
Presidio Engineering Board
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
CC: Tom Rini <trini@konsulko.com>
Abbie Chang [Thu, 14 Jan 2021 21:34:12 +0000 (13:34 -0800)]
net: phy: ca_phy: Add driver for CAxxxx SoCs
Add phy driver support for MACs embedded inside Cortina Access SoCs
Signed-off-by: Abbie Chang <abbie.chang@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
CC: Joe Hershberger <joe.hershberger@ni.com>
CC: Tom Rini <trini@konsulko.com>
CC: Aaron Tseng <aaron.tseng@cortina-access.com>
Moved out PHY specific code out of Cortina NI Ethernet driver
and into a Cortina Access PHY interface driver
Aaron Tseng [Thu, 14 Jan 2021 21:34:11 +0000 (13:34 -0800)]
net: cortina_ni: Add eth support for Cortina Access CAxxxx SoCs
Add Cortina Access Ethernet device driver for CAxxxx SoCs.
This driver supports both legacy and DM_ETH network models.
Signed-off-by: Aaron Tseng <aaron.tseng@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Signed-off-by: Abbie Chang <abbie.chang@cortina-access.com>
CC: Joe Hershberger <joe.hershberger@ni.com>
CC: Abbie Chang <abbie.chang@Cortina-Access.com>
CC: Tom Rini <trini@konsulko.com>
Yang Liu [Mon, 21 Dec 2020 03:44:39 +0000 (14:44 +1100)]
net: fix ping in netconsole
Should not init eth device when doing ping in netconsole.
Signed-off-by: Yang Liu <yliu@cybertec.com.au>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Stefan Roese [Mon, 16 Nov 2020 17:02:30 +0000 (18:02 +0100)]
net: e1000: Add missing address translations
Add some missing address translations from virtual address in local DRAM
to physical address, which is needed for the DMA transactions to work
correctly.
This issue was detected while testing the e1000 driver on the MIPS
Octeon III platform, which needs address translation.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Stefan Roese [Mon, 16 Nov 2020 17:02:29 +0000 (18:02 +0100)]
net: e1000: Use virt_to_phys() instead of pci_virt_to_mem()
Using (dm_)pci_virt_to_mem() is incorrect to translate the virtual
address in local DRAM to a physical address. The correct macro here
is virt_to_phys() so switch to using this macro.
As virt_to_bus() is now not used any more, this patch also removes
both definitions (DM and non-DM).
This issue was detected while testing the e1000 driver on the MIPS
Octeon III platform, which needs address translation.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Stefan Roese [Mon, 16 Nov 2020 17:02:28 +0000 (18:02 +0100)]
net: e1000: Remove unused bus_to_phys() macro
bus_to_phys() is defined but not referenced at all. This patch removes
it completely.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Marek Behún [Tue, 19 Jan 2021 14:49:26 +0000 (15:49 +0100)]
arm: mvebu: turris_mox: enable setexpr command in defconfig
Enable setexpr command in defconfig for Turris MOX. We have found that
this is sometimes useful in U-Boot scripts and there is enough space in
NOR memory on MOX.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Tue, 19 Jan 2021 14:49:25 +0000 (15:49 +0100)]
arm: mvebu: turris_mox: enable wdt command in defconfig
Enable wdt command in defconfig for Turris MOX. This is useful when
doing debugging.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Mon, 18 Jan 2021 11:09:33 +0000 (12:09 +0100)]
arm64: a37xx: pci: Fix printing debug messages
Value pcie->dev in function pcie_advk_probe() is not initialized yet
so use dev as argument for dev_dbg()/dev_warn().
Function pcie_advk_wait_pio() itself prints error message on failure
so do not print duplicate error message in caller.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Thu, 14 Jan 2021 14:46:35 +0000 (15:46 +0100)]
serial: a3720: Implement pending method for output direction
To check if some output characters are waiting either in Transmitter
Holding Register or Transmitter Shift Register we need to look at
TX_EMPTY bit of UART Status Register.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Heinrich Schuchardt [Tue, 26 Jan 2021 11:59:09 +0000 (12:59 +0100)]
doc: exception command
Create man-page for exception command.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Thu, 31 Dec 2020 22:16:46 +0000 (23:16 +0100)]
doc: update Kernel documentation build system
Update the documentation build system according to Linux v5.11-rc1.
Deactive the automarkup.py extension module which on Gitlab CI is
incompatible with Unicode.
With this patch we can build the HTML documentation using either of
Sphinx 2 and Sphinx 3.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Mon, 25 Jan 2021 21:06:25 +0000 (22:06 +0100)]
.gitlab-ci: install doc/sphinx/requirements.txt
Install all requirements according to doc/sphinx/requirements.txt in the
virtual environment used for testing 'make htmldocs'.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Mon, 25 Jan 2021 20:06:57 +0000 (21:06 +0100)]
doc: fix doc/develop/logging.rst
Sphinx 3 builds fail due to doc/develop/logging.rst producing duplicate
labels.
Include logging.h only once in the API section and use cross-references for
the enums log_level_t and log_category_t.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Mon, 25 Jan 2021 19:11:54 +0000 (20:11 +0100)]
doc: board: fix Microchip MPFS Icicle Kit doc
Two sibling headings (here eMMC) cannot have the same title.
Warning, treated as error:
doc/board/microchip/mpfs_icicle.rst:423:duplicate label
board/microchip/mpfs_icicle:emmc, other instance in
doc/board/microchip/mpfs_icicle.rst
make[1]: *** [doc/Makefile:69: htmldocs] Error 2
* Correct the heading levels.
* Add missing empty lines after headings.
Fixes:
9e550e18305f ("doc: board: Add Microchip MPFS Icicle Kit doc")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Phil Sutter [Sun, 3 Jan 2021 22:06:46 +0000 (23:06 +0100)]
pci: pci_mvebu: Define an IO region as well
Configure an IO region and window for PNP identical to how MEM region is
set up. Linux does this only if the DT defines a pcie-io-aperture
property for the SOC, but since all supported boards do this should not
be needed.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
Phil Sutter [Sun, 3 Jan 2021 22:06:45 +0000 (23:06 +0100)]
pci: Make auto-config code a little more robust
On my DS414, some PCI devices return odd values when probing BAR sizes.
An obvious case is all-ones response, the Linux driver
(drivers/pci/probe.c) catches those explicitly and a comment explains
that either bit 0 or bit 1 must be clear (depending on MEM or IO type).
Other BARs return e.g. 0xfff0000f or 0xfff00004 and thus manage to break
size calculation due to the "middle" zeroes. Mitigate that copying more
or less what Linux does and do a "find least bit set".
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Phil Sutter [Sun, 3 Jan 2021 22:06:44 +0000 (23:06 +0100)]
arm: mvebu: ds414: Config header mini-review
A few minor changes:
* Get rid of leftover comments, other commits removed the defines they
referred to.
* CONFIG_SYS_NETA_INTERFACE_TYPE is not used anymore since commit
e3b9c98a23ca9 ("net: mvneta: Convert to driver model").
* Drop CONFIG_USB_MAX_CONTROLLER_COUNT: it is per-HCI type, so XHCI and
EHCI could still both work be used.
* Unconditionally define CONFIG_EHCI_IS_TDI: it has no effect on XHCI so
that conditional doesn't make any sense.
* Define a larger PHY_ANEG_TIMEOUT: In my test bed, the NIC is directly
connected to some RTL8111 and the default 8s timeout was often too
short.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Mon, 21 Dec 2020 10:09:10 +0000 (11:09 +0100)]
arm: mvebu: Espressobin: Disable slot when emmc is not present
This change extends previous commit
061c6d1b238a ("arm: mvebu: Espressobin:
Detect presence of emmc at runtime") and when emmc is not present then emmc
is removed from U-Boot DM and corresponding slot is disabled. Therefore on
Espressobin board without soldered emmc, state of emmc hw should be same as
if emmc was disabled in DTS.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Dennis Gilmore [Wed, 9 Dec 2020 03:07:38 +0000 (21:07 -0600)]
ARM: mvebu: ClearFog make sure that SATA and UART images are buildable
SATA and UART ClearFog imaages are not buildable as ENV_SECT_SIZE is not defined
set values for both possible targets
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
Dennis Gilmore [Wed, 9 Dec 2020 03:07:37 +0000 (21:07 -0600)]
ARM: mvebu: helios4 dts changes to enable SPI
Move all aliases defintions into the main dts file
Add u-boot definiton to i2c0 based on clearfog
set spi1 status to okay
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
Dennis Gilmore [Wed, 9 Dec 2020 03:07:36 +0000 (21:07 -0600)]
ARM: mvebu: helios4 adjust env sizes to enable SPI to work
mirror the clearfog setup to enable SPI to work
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
Harm Berntsen [Sun, 29 Nov 2020 10:08:02 +0000 (10:08 +0000)]
gpio: Add support for DM GPIO for Kirkwood
The Armada driver also works on Nedap's custom Kirkwood board with a
Marvell 88F6180 CPU. The original commit of that driver,
commit
704d9a645e17 ("gpio: Add DM GPIO driver for Marvell MVEBU"),
also mentions that this driver would be suitable for Kirkwood. This
does not completely replace the Kirkwood specific driver as there
are still boards depending on that driver.
Signed-off-by: Harm Berntsen <harm.berntsen@nedap.com>
CC: Stefan Roese <sr@denx.de>,
Reviewed-by: Stefan Roese <sr@denx.de>
Dennis Gilmore [Fri, 11 Sep 2020 16:56:59 +0000 (11:56 -0500)]
ARM: Distro boot: document the need for fdtfile variable to be set
When testing builds provided in https://github.com/openwrt/openwrt/pull/3360
I discovered that fdtfile was not set and as a result the firmware was not
functional. So I am documenting what is needed.
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
Cc: Atish Patra <atish.patra@wdc.com>
Cc: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Vagrant Cascadian <vagrant@debian.org>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Karsten Merker <merker@debian.org>
Tom Rini [Tue, 26 Jan 2021 00:46:02 +0000 (19:46 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
- New Allwinner H616 SoC support (sans Ethernet & USB)
- H6 DT update
- Tanix TX6 TV box support
- OrangePi 3 support
- OrangePi Zero2 (H616) support
Jernej Skrabec [Mon, 11 Jan 2021 20:11:53 +0000 (21:11 +0100)]
sunxi: Add support for OrangePi Zero2
OrangePi Zero2 is SBC based on Allwinner H616 with 1 GiB of RAM, SD card
support, gigabit ethernet, micro HDMI, WIFI, Bluetooth and 1 USB 2.0
port. It also has two GPIO headers which allows further peripherals to
be used.
The devicetree file is taken from v3 of the OrangePi Zero2 Linux
submission [1], which it's not yet merged.
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2021-January/632084.html
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:52 +0000 (21:11 +0100)]
clk: sunxi: Add support for H616 clocks
This commit introduces DM H616 clock driver.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:51 +0000 (21:11 +0100)]
sunxi: gpio: introduce compatible for H616
H616 pinctrl is no different configuration wise than others, so just add
compatible for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:50 +0000 (21:11 +0100)]
arm: sunxi: add initial H616 DTSI and headers
This commit introduces H616 DTSI file and dt-bindings headers needed for
device tree files.
Files are taken from v3 Linux H616 support submission[1], as the
H616 .dtsi file is not merged upstream yet.
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2021-January/632082.html
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:48 +0000 (21:11 +0100)]
sunxi: Add H616 FEL support
H616 uses different address for reset. Add it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:46 +0000 (21:11 +0100)]
sunxi: Add support for H616 SoC
H616 is very similar to H6 so most of the infrastructure can be reused.
However, two big differences are that it doesn't have functional SRAM A2
which is usually used for TF-A and it doesn't have ARISC co-processor.
It also needs bigger SPL size - 48 KiB.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Mon, 11 Jan 2021 20:11:44 +0000 (21:11 +0100)]
mmc: sunxi: Refactor mod clock register offset
So far the only difference between the various Allwinner MMC controller
we are concerned about is the mod clock register offset.
This is actually not directly related to the MMC controller IP, but an
integration choice, dependent on the SoC this appears in.
To avoid becoming trapped with some compatible fallback strings, let's
remove the whole struct sunxi_mmc_variant, and replace this with a SoC
based choice, which we can derive from the CONFIG_MACH_SUNx_y symbols.
This will later simplify H616 support.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:43 +0000 (21:11 +0100)]
sunxi: Add H616 DRAM support
Allwinner H616 supports many types of DRAM. Most notably it supports
LPDDR4. However, all commercially available boards at this time use
only DDR3, so this commit adds only DDR3 support.
Controller and MBUS are very similar to H6 but PHY is completely
unknown.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:42 +0000 (21:11 +0100)]
sunxi: add support for R_I2C on H616
This port is needed for communication with PMIC. SPL uses it to set DRAM
voltage on H616 boards.
Reviewed-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:41 +0000 (21:11 +0100)]
sunxi: add support for H616 uart0
This port is used for debug terminal on all known H616 boards.
Reviewed-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:40 +0000 (21:11 +0100)]
sunxi: introduce support for H616 clocks
H616 has mostly the same clocks as H6 with some small differences. Just
reuse H6 clocks for H616 and handle differences with macros.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Mon, 11 Jan 2021 20:11:39 +0000 (21:11 +0100)]
sunxi: support loading with SPL > 32KB
H616 supports and needs bigger SPL than 32 KiB, mostly due to big DRAM
driver and need for PMIC configuration, which pulls several drivers which
are not needed otherwise.
spl_mmc_get_uboot_raw_sector() will now compare pre-configured size with
that, reported in SPL header. If size in header is bigger, it will use
that value instead.
In the process of function rework, also add missing function argument.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:38 +0000 (21:11 +0100)]
sunxi: Add support for I2C on H6 like SoCs
I2C support, especially R_I2C port, will be needed in future. Upcoming
support for H616 will need R_I2C to adjust DRAM voltage.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Jernej Skrabec [Mon, 11 Jan 2021 20:11:37 +0000 (21:11 +0100)]
sunxi: prcm: Add memory map for H6 like SoCs
There was no need to have prcm definitions for H6 and similar SoCs till
now. However, support R_I2C will be needed soon in SPL.
Move old definitions to prcm_sun6i.h and add new ones in prcm_sun50i.h.
One of those files will be selected in common prcm.h based on defined
macros.
This commit doesn't do any functional change.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>