aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Rini2023-01-09 11:30:08 -0500
committerTom Rini2023-01-09 11:30:08 -0500
commitcebdfc22da6eb81793b616e855bc4d6d89c1c7a6 (patch)
tree44eaafcbe4866712d361304882e7d56ca0ef1682 /lib
parent62e2ad1ceafbfdf2c44d3dc1b6efc81e768a96b9 (diff)
parentfe33066d246462551f385f204690a11018336ac8 (diff)
Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig3
-rw-r--r--lib/rsa/rsa-verify.c20
-rw-r--r--lib/time.c14
3 files changed, 17 insertions, 20 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index 3c5a4ab3861..def36f275ce 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -15,6 +15,9 @@ config SYS_NUM_ADDR_MAP
help
Sets the number of entries in the virtual-physical mapping table.
+config SYS_TIMER_COUNTS_DOWN
+ bool "System timer counts down rathe than up"
+
config PHYSMEM
bool "Access to physical memory region (> 4G)"
help
diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c
index 9605c376390..2f3b3440391 100644
--- a/lib/rsa/rsa-verify.c
+++ b/lib/rsa/rsa-verify.c
@@ -23,18 +23,6 @@
#include <u-boot/rsa-mod-exp.h>
#include <u-boot/rsa.h>
-#ifndef __UBOOT__
-/*
- * NOTE:
- * Since host tools, like mkimage, make use of openssl library for
- * RSA encryption, rsa_verify_with_pkey()/rsa_gen_key_prop() are
- * of no use and should not be compiled in.
- * So just turn off CONFIG_RSA_VERIFY_WITH_PKEY.
- */
-
-#undef CONFIG_RSA_VERIFY_WITH_PKEY
-#endif
-
/* Default public exponent for backward compatibility */
#define RSA_DEFAULT_PUBEXP 65537
@@ -506,7 +494,13 @@ int rsa_verify_hash(struct image_sign_info *info,
{
int ret = -EACCES;
- if (CONFIG_IS_ENABLED(RSA_VERIFY_WITH_PKEY) && !info->fdt_blob) {
+ /*
+ * Since host tools, like mkimage, make use of openssl library for
+ * RSA encryption, rsa_verify_with_pkey()/rsa_gen_key_prop() are
+ * of no use and should not be compiled in.
+ */
+ if (!tools_build() && CONFIG_IS_ENABLED(RSA_VERIFY_WITH_PKEY) &&
+ !info->fdt_blob) {
/* don't rely on fdt properties */
ret = rsa_verify_with_pkey(info, hash, sig, sig_len);
if (ret)
diff --git a/lib/time.c b/lib/time.c
index f3aaf472d10..82350260eac 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -25,21 +25,21 @@
DECLARE_GLOBAL_DATA_PTR;
-#ifdef CONFIG_SYS_TIMER_RATE
+#ifdef CFG_SYS_TIMER_RATE
/* Returns tick rate in ticks per second */
ulong notrace get_tbclk(void)
{
- return CONFIG_SYS_TIMER_RATE;
+ return CFG_SYS_TIMER_RATE;
}
#endif
-#ifdef CONFIG_SYS_TIMER_COUNTER
+#ifdef CFG_SYS_TIMER_COUNTER
unsigned long notrace timer_read_counter(void)
{
#ifdef CONFIG_SYS_TIMER_COUNTS_DOWN
- return ~readl(CONFIG_SYS_TIMER_COUNTER);
+ return ~readl(CFG_SYS_TIMER_COUNTER);
#else
- return readl(CONFIG_SYS_TIMER_COUNTER);
+ return readl(CFG_SYS_TIMER_COUNTER);
#endif
}
@@ -47,8 +47,8 @@ ulong timer_get_boot_us(void)
{
ulong count = timer_read_counter();
-#ifdef CONFIG_SYS_TIMER_RATE
- const ulong timer_rate = CONFIG_SYS_TIMER_RATE;
+#ifdef CFG_SYS_TIMER_RATE
+ const ulong timer_rate = CFG_SYS_TIMER_RATE;
if (timer_rate == 1000000)
return count;