Merge branch '2021-07-28-assorted-fixes'
- Assorted bugfixes
This commit is contained in:
commit
15f7e0dc01
2
Makefile
2
Makefile
@ -1735,7 +1735,7 @@ u-boot-keep-syms-lto_c := $(patsubst %.o,%.c,$(u-boot-keep-syms-lto))
|
||||
|
||||
quiet_cmd_keep_syms_lto = KSL $@
|
||||
cmd_keep_syms_lto = \
|
||||
NM=$(NM) $(srctree)/scripts/gen_ll_addressable_symbols.sh $^ >$@
|
||||
$(srctree)/scripts/gen_ll_addressable_symbols.sh $(NM) $^ > $@
|
||||
|
||||
quiet_cmd_keep_syms_lto_cc = KSLCC $@
|
||||
cmd_keep_syms_lto_cc = \
|
||||
|
@ -719,6 +719,11 @@ int icache_status(void)
|
||||
return (get_sctlr() & CR_I) != 0;
|
||||
}
|
||||
|
||||
int mmu_status(void)
|
||||
{
|
||||
return (get_sctlr() & CR_M) != 0;
|
||||
}
|
||||
|
||||
void invalidate_icache_all(void)
|
||||
{
|
||||
__asm_invalidate_icache_all();
|
||||
@ -740,6 +745,11 @@ int icache_status(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mmu_status(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void invalidate_icache_all(void)
|
||||
{
|
||||
}
|
||||
|
@ -338,6 +338,7 @@ extern void __readwrite_bug(const char *fn);
|
||||
|
||||
/* Optimized copy functions to read from/write to IO sapce */
|
||||
#ifdef CONFIG_ARM64
|
||||
#include <cpu_func.h>
|
||||
/*
|
||||
* Copy data from IO memory space to "real" memory space.
|
||||
*/
|
||||
@ -351,11 +352,13 @@ void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t count)
|
||||
count--;
|
||||
}
|
||||
|
||||
while (count >= 8) {
|
||||
*(u64 *)to = __raw_readq(from);
|
||||
from += 8;
|
||||
to += 8;
|
||||
count -= 8;
|
||||
if (mmu_status()) {
|
||||
while (count >= 8) {
|
||||
*(u64 *)to = __raw_readq(from);
|
||||
from += 8;
|
||||
to += 8;
|
||||
count -= 8;
|
||||
}
|
||||
}
|
||||
|
||||
while (count) {
|
||||
@ -379,11 +382,13 @@ void __memcpy_toio(volatile void __iomem *to, const void *from, size_t count)
|
||||
count--;
|
||||
}
|
||||
|
||||
while (count >= 8) {
|
||||
__raw_writeq(*(u64 *)from, to);
|
||||
from += 8;
|
||||
to += 8;
|
||||
count -= 8;
|
||||
if (mmu_status()) {
|
||||
while (count >= 8) {
|
||||
__raw_writeq(*(u64 *)from, to);
|
||||
from += 8;
|
||||
to += 8;
|
||||
count -= 8;
|
||||
}
|
||||
}
|
||||
|
||||
while (count) {
|
||||
|
@ -48,7 +48,7 @@ int mtk_soc_early_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
psci_system_reset();
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ void detail_board_ddr_info(void)
|
||||
/*
|
||||
* Board specific reset that is system reset.
|
||||
*/
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ int board_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
unsigned long midr, cputype;
|
||||
|
||||
|
@ -24,7 +24,7 @@ int board_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
writel(RST_CA53_CODE, RST_CA53RESCNT);
|
||||
}
|
||||
|
@ -43,11 +43,7 @@ Note that standalone/API support is not available at present.
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
Here are some packages that are worth installing if you are doing sandbox or
|
||||
tools development in U-Boot:
|
||||
|
||||
python3-pytest lzma lzma-alone lz4 python3 python3-virtualenv
|
||||
libssl1.0-dev
|
||||
Install the dependencies noted in :doc:`../build/gcc`.
|
||||
|
||||
|
||||
Basic Operation
|
||||
|
6
doc/build/gcc.rst
vendored
6
doc/build/gcc.rst
vendored
@ -26,8 +26,10 @@ Depending on the build targets further packages maybe needed
|
||||
sudo apt-get install bc bison build-essential coccinelle \
|
||||
device-tree-compiler dfu-util efitools flex gdisk liblz4-tool \
|
||||
libguestfs-tools libncurses-dev libpython3-dev libsdl2-dev libssl-dev \
|
||||
lzma-alone openssl python3 python3-coverage python3-pyelftools \
|
||||
python3-pytest python3-sphinxcontrib.apidoc python3-sphinx-rtd-theme swig
|
||||
lz4 lzma lzma-alone openssl python3 python3-coverage \
|
||||
python3-pycryptodome python3-pyelftools python3-pytest \
|
||||
python3-sphinxcontrib.apidoc python3-sphinx-rtd-theme python3-virtualenv \
|
||||
swig
|
||||
|
||||
SUSE based
|
||||
~~~~~~~~~~
|
||||
|
@ -533,8 +533,8 @@ Generic engine key ids:
|
||||
or
|
||||
"<key-name-hint>"
|
||||
|
||||
As mkimage does not at this time support prompting for passwords HSM may need
|
||||
key preloading wrapper to be used when invoking mkimage.
|
||||
In order to set the pin in the HSM, an environment variable "MKIMAGE_SIGN_PIN"
|
||||
can be specified.
|
||||
|
||||
The following examples use the Nitrokey Pro using pkcs11 engine. Instructions
|
||||
for other devices may vary.
|
||||
|
@ -302,7 +302,6 @@ static int sandbox_swap_case_write_io(struct udevice *dev, unsigned int addr,
|
||||
}
|
||||
|
||||
static int pci_ea_bar2_magic = PCI_EA_BAR2_MAGIC;
|
||||
static int pci_ea_bar4_magic = PCI_EA_BAR4_MAGIC;
|
||||
|
||||
static int sandbox_swap_case_map_physmem(struct udevice *dev,
|
||||
phys_addr_t addr, unsigned long *lenp, void **ptrp)
|
||||
@ -332,12 +331,22 @@ static int sandbox_swap_case_map_physmem(struct udevice *dev,
|
||||
*ptrp = &pci_ea_bar2_magic;
|
||||
*lenp = PCI_CAP_EA_SIZE_LO;
|
||||
break;
|
||||
#ifdef CONFIG_HOST_64BIT
|
||||
/*
|
||||
* This cannot be work on a 32-bit machine since *lenp is ulong
|
||||
* which is 32-bits, but it needs to have a 64-bit value
|
||||
* assigned
|
||||
*/
|
||||
case (phys_addr_t)((PCI_CAP_EA_BASE_HI4 << 32) |
|
||||
PCI_CAP_EA_BASE_LO4):
|
||||
PCI_CAP_EA_BASE_LO4): {
|
||||
static int pci_ea_bar4_magic = PCI_EA_BAR4_MAGIC;
|
||||
|
||||
*ptrp = &pci_ea_bar4_magic;
|
||||
*lenp = (PCI_CAP_EA_SIZE_HI << 32) |
|
||||
PCI_CAP_EA_SIZE_LO;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
return -ENOENT;
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ int dcache_status(void);
|
||||
void dcache_enable(void);
|
||||
void dcache_disable(void);
|
||||
void mmu_disable(void);
|
||||
int mmu_status(void);
|
||||
|
||||
/* arch/$(ARCH)/lib/cache.c */
|
||||
void enable_caches(void);
|
||||
|
@ -338,6 +338,7 @@ static int rsa_init(void)
|
||||
|
||||
static int rsa_engine_init(const char *engine_id, ENGINE **pe)
|
||||
{
|
||||
const char *key_pass;
|
||||
ENGINE *e;
|
||||
int ret;
|
||||
|
||||
@ -362,10 +363,20 @@ static int rsa_engine_init(const char *engine_id, ENGINE **pe)
|
||||
goto err_set_rsa;
|
||||
}
|
||||
|
||||
key_pass = getenv("MKIMAGE_SIGN_PIN");
|
||||
if (key_pass) {
|
||||
if (!ENGINE_ctrl_cmd_string(e, "PIN", key_pass, 0)) {
|
||||
fprintf(stderr, "Couldn't set PIN\n");
|
||||
ret = -1;
|
||||
goto err_set_pin;
|
||||
}
|
||||
}
|
||||
|
||||
*pe = e;
|
||||
|
||||
return 0;
|
||||
|
||||
err_set_pin:
|
||||
err_set_rsa:
|
||||
ENGINE_finish(e);
|
||||
err_engine_init:
|
||||
@ -473,7 +484,7 @@ static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo,
|
||||
#endif
|
||||
EVP_MD_CTX_destroy(context);
|
||||
|
||||
debug("Got signature: %d bytes, expected %zu\n", *sig_size, size);
|
||||
debug("Got signature: %zu bytes, expected %d\n", size, EVP_PKEY_size(pkey));
|
||||
*sigp = sig;
|
||||
*sig_size = size;
|
||||
|
||||
|
@ -556,7 +556,7 @@ int rsa_verify(struct image_sign_info *info,
|
||||
*/
|
||||
if (info->checksum->checksum_len >
|
||||
info->crypto->key_len) {
|
||||
debug("%s: invlaid checksum-algorithm %s for %s\n",
|
||||
debug("%s: invalid checksum-algorithm %s for %s\n",
|
||||
__func__, info->checksum->name, info->crypto->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -459,7 +459,7 @@ u-boot-spl-keep-syms-lto_c := \
|
||||
|
||||
quiet_cmd_keep_syms_lto = KSL $@
|
||||
cmd_keep_syms_lto = \
|
||||
NM=$(NM) $(srctree)/scripts/gen_ll_addressable_symbols.sh $^ >$@
|
||||
$(srctree)/scripts/gen_ll_addressable_symbols.sh $(NM) $^ > $@
|
||||
|
||||
quiet_cmd_keep_syms_lto_cc = KSLCC $@
|
||||
cmd_keep_syms_lto_cc = \
|
||||
|
@ -5,8 +5,11 @@
|
||||
# Generate __ADDRESSABLE(symbol) for every linker list entry symbol, so that LTO
|
||||
# does not optimize these symbols away
|
||||
|
||||
# The expected parameter of this script is the command requested to have
|
||||
# the U-Boot symbols to parse, for example: $(NM) $(u-boot-main)
|
||||
|
||||
set -e
|
||||
|
||||
echo '#include <common.h>'
|
||||
$NM "$@" 2>/dev/null | grep -oe '_u_boot_list_2_[a-zA-Z0-9_]*_2_[a-zA-Z0-9_]*' | \
|
||||
$@ 2>/dev/null | grep -oe '_u_boot_list_2_[a-zA-Z0-9_]*_2_[a-zA-Z0-9_]*' | \
|
||||
sort -u | sed -e 's/^\(.*\)/extern char \1[];\n__ADDRESSABLE(\1);/'
|
||||
|
@ -146,7 +146,7 @@ def get_mksquashfs_version():
|
||||
out = subprocess.run(['mksquashfs -version'], shell=True, check=True,
|
||||
capture_output=True, text=True)
|
||||
# 'out' is: mksquashfs version X (yyyy/mm/dd) ...
|
||||
return float(out.stdout.split()[2])
|
||||
return float(out.stdout.split()[2].split('-')[0])
|
||||
|
||||
def check_mksquashfs_version():
|
||||
""" Checks if mksquashfs meets the required version. """
|
||||
|
Loading…
Reference in New Issue
Block a user