Re: [PATCH] ARM: dts: imx8mq-kontron-pitx-imx8m: Remove off-on-delay-us property

2022-10-24 Thread Peng Fan




On 10/24/2022 7:25 PM, Heiko Thiery wrote:

U-Boot is not able to store the environment variables in the SD card.

Remove the off-on-delay-us property to fix the regression.


off-on-delay-us here would cause store env failure?
Would you please share more info?

Thanks,
Peng.



Signed-off-by: Heiko Thiery 
---
The same change is done in the linux dts file.

  arch/arm/dts/imx8mq-kontron-pitx-imx8m.dts | 1 -
  1 file changed, 1 deletion(-)

diff --git a/arch/arm/dts/imx8mq-kontron-pitx-imx8m.dts 
b/arch/arm/dts/imx8mq-kontron-pitx-imx8m.dts
index a91c136797..21442e04a6 100644
--- a/arch/arm/dts/imx8mq-kontron-pitx-imx8m.dts
+++ b/arch/arm/dts/imx8mq-kontron-pitx-imx8m.dts
@@ -51,7 +51,6 @@
regulator-min-microvolt = <330>;
regulator-max-microvolt = <330>;
gpio = < 19 GPIO_ACTIVE_HIGH>;
-   off-on-delay-us = <2>;
enable-active-high;
};
  };


Re: [PATCH v3 1/2] x86: fsp: Depend on DM_RTC

2022-10-24 Thread Stefan Roese

On 24.10.22 18:49, Bin Meng wrote:

On Mon, Oct 24, 2022 at 11:42 PM Sean Anderson  wrote:


FSP support requires DM_RTC for rtc_write32. Select it.

Fixes: ba65808e7d0 ("x86: fsp: Save stack address to CMOS for next S3 boot")
Signed-off-by: Sean Anderson 
---
This seems like it would never have worked. Does fsp_save_s3_stack even


This was working before. Did you test it on x86 that now it is broken?

+Stefan


I don't have access to this FSP x86 target any more, so can't test
anything any more.

Thanks,
Stefan


get called in SPL? Maybe it should be converted to use dm_rtc_write
instead.

Changes in v3:
- New

  arch/x86/Kconfig | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7cbfd6c9720..ed8216d9ad0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -362,6 +362,8 @@ config HAVE_FSP
 depends on !EFI
 select USE_HOB
 select HAS_ROM
+   select DM_RTC
+   select SPL_DM_RTC
 help
   Select this option to add an Firmware Support Package binary to
   the resulting U-Boot image. It is a binary blob which U-Boot uses
--


Regards,
Bin


Viele Grüße,
Stefan Roese

--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: s...@denx.de


Re: question about uboot mt7620 RAM_VERSION

2022-10-24 Thread Stefan Roese

Hi Kang-sen,

On 24.10.22 19:58, Kang-sen Lu wrote:
I am wondering if you have read my reply on 10/18. It is very strange to 
find that unless I had uboot to do a saveenv, the RAM_VERSION uboot.bin 
would not run properly in DRAM.


Frankly, I don't really understand this message. It's not clear to
me, what you are doing and what is working and what is failing.

I thought you were trying to boot the current mainline U-Boot RAM
version u-boot.bin. If yes, which build target did you use? What
does it show on the serial console?

Thanks,
Stefan


Thanks.

Kang-sen

On Tue, Oct 18, 2022 at 10:05 AM Kang-sen Lu > wrote:


Hi, Stefan:

Thanks for your reply.

The uboot in the zbtlink mt7620 router has the signatures follows:

U-Boot 1.1.3 (Nov  9 2016 - 15:34:50)

SoC:MediaTek MT7620
DRAM:  Memory Testing..131072K OK. is 128 MB
relocate_code Pointer at: 87fb
enable ephy clock...done. rf reg 29 = 5
SSC disabled.
spi_wait_nsec: 29
spi device id: ef 40 18 0 0 (4018)
Flash: W25Q128BV

I would like to share my strange experience about RAM version uboot
for mt7620. By pure luck, I found that when I tried to load a newly
built uboot with startup menu option 8, unless I change the
filename, say, from uboot.bin to uboot1.bin, the newly loaded uboot
would not startup properly in RAM.

I don't have the knowledge to find out why this variable "modifies"
to be none-zero is so important to the execution of uboot in RAM.
Maybe some expert in this group can easily figure that out.

Thanks.

Kang-sen

On Tue, Oct 18, 2022 at 7:53 AM Stefan Roese mailto:s...@denx.de>> wrote:

Hi Kang-sen,

(added Weijie Gao to Cc)

On 17.10.22 14:11, Kang-sen Lu wrote:
 >   I am building uboot.bin for mt7620 router.
 >
 > I used start menu option 8, a hidden one choice, to load
uboot.bin through
 > tftp.
 >
 > The tftp transfer is OK. But when the new uboot starts, it hang.

So which mainline U-Boot build target did you use? Don't you see
any output on the serial console at all?

 > I am wondering if the RAM_VERSION for mt7620 still works.

In mainline U-Boot this is usually handled this way. The SPL U-Boot
version is responsible for the low-level HW init, like DRAM/DDR init
etc. It's hard to impossible to chainload this SPL part from a
running U-Boot version.

The "RAM_VERSION" is usually the main U-Boot proper image
"u-boot.bin".
So in general you are using the correct file here. Even though I
have
not idea, if the build target is correct for your "mt7620 router".

Thanks,
Stefan



Viele Grüße,
Stefan Roese

--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: s...@denx.de


[PATCH] imx: spl: Add weak reset_cpu()

2022-10-24 Thread Jun Nie
Add weak reset_cpu() to reduce redundant code. And it ease the new platforms
that only need a empty function to pass build without below compiling failure.

arch/arm/lib/reset.o: In function `do_reset':
/git/u-boot/arch/arm/lib/reset.c:42: undefined reference to `reset_cpu'
make[1]: *** [scripts/Makefile.spl:526: spl/u-boot-spl] Error 1
make: *** [Makefile:2087: spl/u-boot-spl] Error 2

Signed-off-by: Jun Nie 
---
 arch/arm/mach-imx/spl.c   | 4 
 board/ronetix/imx7-cm/spl.c   | 4 
 board/technexion/pico-imx6ul/spl.c| 4 
 board/technexion/pico-imx7d/spl.c | 4 
 board/toradex/apalis_imx6/apalis_imx6.c   | 4 
 board/toradex/colibri_imx6/colibri_imx6.c | 4 
 6 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index ef00969a5e..6abbdb8909 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -388,3 +388,7 @@ void *spl_load_simple_fit_fix_load(const void *fit)
 
return (void *)new;
 }
+
+__weak void reset_cpu(void)
+{
+}
diff --git a/board/ronetix/imx7-cm/spl.c b/board/ronetix/imx7-cm/spl.c
index d36f734e49..864e95b187 100644
--- a/board/ronetix/imx7-cm/spl.c
+++ b/board/ronetix/imx7-cm/spl.c
@@ -115,10 +115,6 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 
-void reset_cpu(void)
-{
-}
-
 #define USDHC_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
PAD_CTL_HYS | PAD_CTL_PUE | \
PAD_CTL_PUS_PU47KOHM)
diff --git a/board/technexion/pico-imx6ul/spl.c 
b/board/technexion/pico-imx6ul/spl.c
index 251f5a1b7d..df01b5f8b5 100644
--- a/board/technexion/pico-imx6ul/spl.c
+++ b/board/technexion/pico-imx6ul/spl.c
@@ -147,10 +147,6 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 
-void reset_cpu(void)
-{
-}
-
 #define USDHC_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE |\
PAD_CTL_PUS_22K_UP  | PAD_CTL_SPEED_LOW |   \
PAD_CTL_DSE_80ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
diff --git a/board/technexion/pico-imx7d/spl.c 
b/board/technexion/pico-imx7d/spl.c
index df5f058577..75d6aa8445 100644
--- a/board/technexion/pico-imx7d/spl.c
+++ b/board/technexion/pico-imx7d/spl.c
@@ -127,10 +127,6 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 
-void reset_cpu(void)
-{
-}
-
 #define USDHC_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU47KOHM)
 
diff --git a/board/toradex/apalis_imx6/apalis_imx6.c 
b/board/toradex/apalis_imx6/apalis_imx6.c
index 8d2642f25d..b59d7cceea 100644
--- a/board/toradex/apalis_imx6/apalis_imx6.c
+++ b/board/toradex/apalis_imx6/apalis_imx6.c
@@ -1056,10 +1056,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-void reset_cpu(void)
-{
-}
-
 #endif /* CONFIG_SPL_BUILD */
 
 static struct mxc_serial_plat mxc_serial_plat = {
diff --git a/board/toradex/colibri_imx6/colibri_imx6.c 
b/board/toradex/colibri_imx6/colibri_imx6.c
index ab2ab587ff..261e46bc35 100644
--- a/board/toradex/colibri_imx6/colibri_imx6.c
+++ b/board/toradex/colibri_imx6/colibri_imx6.c
@@ -1116,10 +1116,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-void reset_cpu(void)
-{
-}
-
 #endif /* CONFIG_SPL_BUILD */
 
 static struct mxc_serial_plat mxc_serial_plat = {
-- 
2.25.1



[PATCH v5 5/5] eficonfig: add "Show/Delete Signature Database" menu entry

2022-10-24 Thread Masahisa Kojima
This commit adds the menu-driven interface to show and delete the
signature database.

EFI Signature Lists can contain the multiple signature
entries, this menu can delete the indivisual entry.

If the PK is enrolled and UEFI Secure Boot is in User Mode or
Deployed Mode,  user can not delete the existing signature lists
since the signature lists must be signed by KEK or PK but signing
information is not stored in the signature database.

To delete PK, user needs to enroll the new key with an empty
value and this new key must be signed with the old PK.

Signed-off-by: Masahisa Kojima 
---
No change since v2

Changes in v2:
- integrate show and delete signature database menu
- add confirmation message before delete
- add function comment

 cmd/eficonfig_sbkey.c | 394 ++
 1 file changed, 394 insertions(+)

diff --git a/cmd/eficonfig_sbkey.c b/cmd/eficonfig_sbkey.c
index 32a39eb7ba..44307ec12b 100644
--- a/cmd/eficonfig_sbkey.c
+++ b/cmd/eficonfig_sbkey.c
@@ -17,6 +17,14 @@
 #include 
 #include 
 
+struct eficonfig_sig_data {
+   struct efi_signature_list *esl;
+   struct efi_signature_data *esd;
+   struct list_head list;
+   struct eficonfig_sig_data **selected;
+   u16 *varname;
+};
+
 enum efi_sbkey_signature_type {
SIG_TYPE_X509 = 0,
SIG_TYPE_HASH,
@@ -46,6 +54,32 @@ static const struct eficonfig_sigtype_to_str 
sigtype_to_str[] = {
 /* {EFI_CERT_SHA512_GUID,  "SHA512",   SIG_TYPE_HASH}, 
*/
 };
 
+/**
+ * eficonfig_console_wait_enter() - wait ENTER key press
+ *
+ * Return: 1 if ENTER key is pressed, 0 if user selects to quit
+ */
+static int eficonfig_console_wait_enter(void)
+{
+   int esc = 0;
+   enum bootmenu_key key = KEY_NONE;
+
+   puts(ANSI_CURSOR_HIDE);
+
+   while (1) {
+   bootmenu_loop(NULL, , );
+
+   switch (key) {
+   case KEY_SELECT:
+   return 1;
+   case KEY_QUIT:
+   return 0;
+   default:
+   break;
+   }
+   }
+}
+
 /**
  * is_secureboot_enabled() - check UEFI Secure Boot is enabled
  *
@@ -270,8 +304,368 @@ out:
return ret;
 }
 
+/**
+ * delete_selected_signature_data() - delete the signature data from signature 
list
+ *
+ * @db:pointer to the signature database
+ * @db_size:   pointer to the signature database size
+ * @target:pointer to the signature data to be deleted
+ * Return: status code
+ */
+static void delete_selected_signature_data(void *db, efi_uintn_t *db_size,
+  struct eficonfig_sig_data *target)
+{
+   u32 remain;
+   u8 *dest, *start, *end;
+   efi_uintn_t total_size, esd_size, size;
+   struct efi_signature_list *esl;
+   struct efi_signature_data *esd;
+
+   esl = db;
+   total_size = *db_size;
+   size = *db_size;
+   end = (u8 *)db + *db_size;
+   while (total_size > 0) {
+   esd = (struct efi_signature_data *)((u8 *)esl +
+ sizeof(struct efi_signature_list) + 
esl->signature_header_size);
+   esd_size = esl->signature_list_size - sizeof(struct 
efi_signature_list) -
+  esl->signature_header_size;
+   for (; esd_size > 0; esd_size -= esl->signature_size) {
+   if (esl == target->esl && esd == target->esd) {
+   remain = esl->signature_list_size -
+(sizeof(struct efi_signature_list) -
+esl->signature_header_size) -
+esl->signature_size;
+   if (remain > 0) {
+   /* only delete the single signature 
data */
+   esl->signature_list_size -= 
esl->signature_size;
+   size -= esl->signature_size;
+   dest = (u8 *)esd;
+   start = (u8 *)esd + esl->signature_size;
+   } else {
+   /* delete entire signature list */
+   dest = (u8 *)esl;
+   start = (u8 *)esl + 
esl->signature_list_size;
+   size -= esl->signature_list_size;
+   }
+   memmove(dest, start, (end - start));
+   goto out;
+   }
+   esd = (struct efi_signature_data *)((u8 *)esd + 
esl->signature_size);
+   }
+   total_size -= esl->signature_list_size;
+   esl = (struct efi_signature_list *)((u8 *)esl + 
esl->signature_list_size);
+   }
+out:
+   *db_size = size;
+}

[PATCH v5 4/5] eficonfig: add UEFI Secure Boot Key enrollment interface

2022-10-24 Thread Masahisa Kojima
This commit adds the menu-driven UEFI Secure Boot Key
enrollment interface. User can enroll the PK, KEK, db
and dbx by selecting EFI Signature Lists file.
After the PK is enrolled, UEFI Secure Boot is enabled and
EFI Signature Lists file must be signed by KEK or PK.

Signed-off-by: Masahisa Kojima 
---
No change since v4

Changes in v4:
- add CONFIG_EFI_MM_COMM_TEE dependency
- fix error handling

Changes in v3:
- fix error handling

Changes in v2:
- allow to enroll .esl file
- fix typos
- add function comments

 cmd/Makefile  |   5 +
 cmd/eficonfig.c   |   3 +
 cmd/eficonfig_sbkey.c | 357 ++
 include/efi_config.h  |   5 +
 4 files changed, 370 insertions(+)
 create mode 100644 cmd/eficonfig_sbkey.c

diff --git a/cmd/Makefile b/cmd/Makefile
index c95e09d058..e43ef22e98 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -66,6 +66,11 @@ obj-$(CONFIG_CMD_EEPROM) += eeprom.o
 obj-$(CONFIG_EFI) += efi.o
 obj-$(CONFIG_CMD_EFIDEBUG) += efidebug.o
 obj-$(CONFIG_CMD_EFICONFIG) += eficonfig.o
+ifdef CONFIG_CMD_EFICONFIG
+ifdef CONFIG_EFI_MM_COMM_TEE
+obj-$(CONFIG_EFI_SECURE_BOOT) += eficonfig_sbkey.o
+endif
+endif
 obj-$(CONFIG_CMD_ELF) += elf.o
 obj-$(CONFIG_CMD_EROFS) += erofs.o
 obj-$(CONFIG_HUSH_PARSER) += exit.o
diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index c765b795d0..0b643a046c 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -2447,6 +2447,9 @@ static const struct eficonfig_item 
maintenance_menu_items[] = {
{"Edit Boot Option", eficonfig_process_edit_boot_option},
{"Change Boot Order", eficonfig_process_change_boot_order},
{"Delete Boot Option", eficonfig_process_delete_boot_option},
+#if (CONFIG_IS_ENABLED(EFI_SECURE_BOOT) && CONFIG_IS_ENABLED(EFI_MM_COMM_TEE))
+   {"Secure Boot Configuration", eficonfig_process_secure_boot_config},
+#endif
{"Quit", eficonfig_process_quit},
 };
 
diff --git a/cmd/eficonfig_sbkey.c b/cmd/eficonfig_sbkey.c
new file mode 100644
index 00..32a39eb7ba
--- /dev/null
+++ b/cmd/eficonfig_sbkey.c
@@ -0,0 +1,357 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  Menu-driven UEFI Secure Boot Key Maintenance
+ *
+ *  Copyright (c) 2022 Masahisa Kojima, Linaro Limited
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+enum efi_sbkey_signature_type {
+   SIG_TYPE_X509 = 0,
+   SIG_TYPE_HASH,
+   SIG_TYPE_CRL,
+   SIG_TYPE_RSA2048,
+};
+
+struct eficonfig_sigtype_to_str {
+   efi_guid_t sig_type;
+   char *str;
+   enum efi_sbkey_signature_type type;
+};
+
+static const struct eficonfig_sigtype_to_str sigtype_to_str[] = {
+   {EFI_CERT_X509_GUID,"X509", SIG_TYPE_X509},
+   {EFI_CERT_SHA256_GUID,  "SHA256",   SIG_TYPE_HASH},
+   {EFI_CERT_X509_SHA256_GUID, "X509_SHA256 CRL",  SIG_TYPE_CRL},
+   {EFI_CERT_X509_SHA384_GUID, "X509_SHA384 CRL",  SIG_TYPE_CRL},
+   {EFI_CERT_X509_SHA512_GUID, "X509_SHA512 CRL",  SIG_TYPE_CRL},
+   /* U-Boot does not support the following signature types */
+/* {EFI_CERT_RSA2048_GUID, "RSA2048",  
SIG_TYPE_RSA2048}, */
+/* {EFI_CERT_RSA2048_SHA256_GUID,  "RSA2048_SHA256",   
SIG_TYPE_RSA2048}, */
+/* {EFI_CERT_SHA1_GUID,"SHA1", SIG_TYPE_HASH}, 
*/
+/* {EFI_CERT_RSA2048_SHA_GUID, "RSA2048_SHA",  
SIG_TYPE_RSA2048 }, */
+/* {EFI_CERT_SHA224_GUID,  "SHA224",   SIG_TYPE_HASH}, 
*/
+/* {EFI_CERT_SHA384_GUID,  "SHA384",   SIG_TYPE_HASH}, 
*/
+/* {EFI_CERT_SHA512_GUID,  "SHA512",   SIG_TYPE_HASH}, 
*/
+};
+
+/**
+ * is_secureboot_enabled() - check UEFI Secure Boot is enabled
+ *
+ * Return: true when UEFI Secure Boot is enabled, false otherwise
+ */
+static bool is_secureboot_enabled(void)
+{
+   efi_status_t ret;
+   u8 secure_boot;
+   efi_uintn_t size;
+
+   size = sizeof(secure_boot);
+   ret = efi_get_variable_int(u"SecureBoot", _global_variable_guid,
+  NULL, , _boot, NULL);
+
+   return secure_boot == 1;
+}
+
+/**
+ * create_time_based_payload() - create payload for time based authenticate 
variable
+ *
+ * @db:pointer to the original signature database
+ * @new_db:pointer to the authenticated variable payload
+ * @size:  pointer to payload size
+ * Return: status code
+ */
+static efi_status_t create_time_based_payload(void *db, void **new_db, 
efi_uintn_t *size)
+{
+   efi_status_t ret;
+   struct efi_time time;
+   efi_uintn_t total_size;
+   struct efi_variable_authentication_2 *auth;
+
+   *new_db = NULL;
+
+   /*
+* SetVariable() call with 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
+* attribute requires EFI_VARIABLE_AUTHENTICATED_2 descriptor, prepare 
it
+* 

[PATCH v5 3/5] eficonfig: refactor change boot order implementation

2022-10-24 Thread Masahisa Kojima
This commit refactors change boot order implementation
to use 'eficonfig_entry' structure.

Signed-off-by: Masahisa Kojima 
---
Changes in v5:
- remove direct access mode

newly created in v4

 cmd/eficonfig.c | 129 +---
 1 file changed, 67 insertions(+), 62 deletions(-)

diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index 0cb0770ac3..c765b795d0 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -93,20 +93,14 @@ struct eficonfig_boot_selection_data {
 };
 
 /**
- * struct eficonfig_boot_order - structure to be used to update BootOrder 
variable
+ * struct eficonfig_boot_order_data - structure to be used to update BootOrder 
variable
  *
- * @num:   index in the menu entry
- * @description:   pointer to the description string
  * @boot_index:boot option index
  * @active:flag to include the boot option into BootOrder variable
- * @list:  list structure
  */
-struct eficonfig_boot_order {
-   u32 num;
-   u16 *description;
+struct eficonfig_boot_order_data {
u32 boot_index;
bool active;
-   struct list_head list;
 };
 
 /**
@@ -1814,7 +1808,7 @@ static void eficonfig_display_change_boot_order(struct 
efimenu *efi_menu)
 {
bool reverse;
struct list_head *pos, *n;
-   struct eficonfig_boot_order *entry;
+   struct eficonfig_entry *entry;
 
printf(ANSI_CLEAR_CONSOLE ANSI_CURSOR_POSITION
   "\n  ** Change Boot Order **\n"
@@ -1830,7 +1824,7 @@ static void eficonfig_display_change_boot_order(struct 
efimenu *efi_menu)
 
/* draw boot option list */
list_for_each_safe(pos, n, _menu->list) {
-   entry = list_entry(pos, struct eficonfig_boot_order, list);
+   entry = list_entry(pos, struct eficonfig_entry, list);
reverse = (entry->num == efi_menu->active);
 
printf(ANSI_CURSOR_POSITION, entry->num + 4, 7);
@@ -1839,13 +1833,13 @@ static void eficonfig_display_change_boot_order(struct 
efimenu *efi_menu)
puts(ANSI_COLOR_REVERSE);
 
if (entry->num < efi_menu->count - 2) {
-   if (entry->active)
+   if (((struct eficonfig_boot_order_data 
*)entry->data)->active)
printf("[*]  ");
else
printf("[ ]  ");
}
 
-   printf("%ls", entry->description);
+   printf("%s", entry->title);
 
if (reverse)
puts(ANSI_COLOR_RESET);
@@ -1862,9 +1856,8 @@ static efi_status_t 
eficonfig_choice_change_boot_order(struct efimenu *efi_menu)
 {
int esc = 0;
struct list_head *pos, *n;
-   struct eficonfig_boot_order *tmp;
enum bootmenu_key key = KEY_NONE;
-   struct eficonfig_boot_order *entry;
+   struct eficonfig_entry *entry, *tmp;
 
while (1) {
bootmenu_loop(NULL, , );
@@ -1873,11 +1866,11 @@ static efi_status_t 
eficonfig_choice_change_boot_order(struct efimenu *efi_menu)
case KEY_PLUS:
if (efi_menu->active > 0) {
list_for_each_safe(pos, n, _menu->list) {
-   entry = list_entry(pos, struct 
eficonfig_boot_order, list);
+   entry = list_entry(pos, struct 
eficonfig_entry, list);
if (entry->num == efi_menu->active)
break;
}
-   tmp = list_entry(pos->prev, struct 
eficonfig_boot_order, list);
+   tmp = list_entry(pos->prev, struct 
eficonfig_entry, list);
entry->num--;
tmp->num++;
list_del(>list);
@@ -1891,11 +1884,11 @@ static efi_status_t 
eficonfig_choice_change_boot_order(struct efimenu *efi_menu)
case KEY_MINUS:
if (efi_menu->active < efi_menu->count - 3) {
list_for_each_safe(pos, n, _menu->list) {
-   entry = list_entry(pos, struct 
eficonfig_boot_order, list);
+   entry = list_entry(pos, struct 
eficonfig_entry, list);
if (entry->num == efi_menu->active)
break;
}
-   tmp = list_entry(pos->next, struct 
eficonfig_boot_order, list);
+   tmp = list_entry(pos->next, struct 
eficonfig_entry, list);
entry->num++;
tmp->num--;
list_del(>list);
@@ -1921,9 +1914,11 @@ static efi_status_t 

[PATCH v5 0/5] eficonfig: add UEFI Secure Boot key maintenance interface

2022-10-24 Thread Masahisa Kojima
This series adds the UEFI Secure Boot key maintenance interface
to the eficonfig command.
User can enroll and delete the PK, KEK, db and dbx.

Source code can be cloned with:
$ git clone https://git.linaro.org/people/masahisa.kojima/u-boot.git -b 
kojima/eficonfig_sbkey_v5

[Major Changes]
- remove shortcut key implemenation, this work will continue
  as a separate series

Masahisa Kojima (5):
  eficonfig: refactor eficonfig_select_file_handler()
  eficonfig: expose append entry function
  eficonfig: refactor change boot order implementation
  eficonfig: add UEFI Secure Boot Key enrollment interface
  eficonfig: add "Show/Delete Signature Database" menu entry

 cmd/Makefile  |   5 +
 cmd/eficonfig.c   | 177 +++--
 cmd/eficonfig_sbkey.c | 751 ++
 include/efi_config.h  |  10 +
 .../py/tests/test_eficonfig/test_eficonfig.py |   1 +
 5 files changed, 859 insertions(+), 85 deletions(-)
 create mode 100644 cmd/eficonfig_sbkey.c

-- 
2.17.1



[PATCH v5 2/5] eficonfig: expose append entry function

2022-10-24 Thread Masahisa Kojima
This commit exposes the eficonfig menu entry append function.

Signed-off-by: Masahisa Kojima 
---
No change since v2

newly created in v2

 cmd/eficonfig.c  | 32 +---
 include/efi_config.h |  5 +
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index f6a99bd01a..0cb0770ac3 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -263,7 +263,7 @@ efi_status_t eficonfig_process_quit(void *data)
 }
 
 /**
- * append_entry() - append menu item
+ * eficonfig_append_menu_entry() - append menu item
  *
  * @efi_menu:  pointer to the efimenu structure
  * @title: pointer to the entry title
@@ -271,8 +271,9 @@ efi_status_t eficonfig_process_quit(void *data)
  * @data:  pointer to the data to be passed to each entry callback
  * Return: status code
  */
-static efi_status_t append_entry(struct efimenu *efi_menu,
-char *title, eficonfig_entry_func func, void 
*data)
+efi_status_t eficonfig_append_menu_entry(struct efimenu *efi_menu,
+char *title, eficonfig_entry_func func,
+void *data)
 {
struct eficonfig_entry *entry;
 
@@ -295,12 +296,12 @@ static efi_status_t append_entry(struct efimenu *efi_menu,
 }
 
 /**
- * append_quit_entry() - append quit entry
+ * eficonfig_append_quit_entry() - append quit entry
  *
  * @efi_menu:  pointer to the efimenu structure
  * Return: status code
  */
-static efi_status_t append_quit_entry(struct efimenu *efi_menu)
+efi_status_t eficonfig_append_quit_entry(struct efimenu *efi_menu)
 {
char *title;
efi_status_t ret;
@@ -309,7 +310,7 @@ static efi_status_t append_quit_entry(struct efimenu 
*efi_menu)
if (!title)
return EFI_OUT_OF_RESOURCES;
 
-   ret = append_entry(efi_menu, title, eficonfig_process_quit, NULL);
+   ret = eficonfig_append_menu_entry(efi_menu, title, 
eficonfig_process_quit, NULL);
if (ret != EFI_SUCCESS)
free(title);
 
@@ -341,7 +342,7 @@ void *eficonfig_create_fixed_menu(const struct 
eficonfig_item *items, int count)
if (!title)
goto out;
 
-   ret = append_entry(efi_menu, title, iter->func, iter->data);
+   ret = eficonfig_append_menu_entry(efi_menu, title, iter->func, 
iter->data);
if (ret != EFI_SUCCESS) {
free(title);
goto out;
@@ -634,14 +635,15 @@ static efi_status_t eficonfig_select_volume(struct 
eficonfig_select_file_info *f
info->v = v;
info->dp = device_path;
info->file_info = file_info;
-   ret = append_entry(efi_menu, devname, 
eficonfig_volume_selected, info);
+   ret = eficonfig_append_menu_entry(efi_menu, devname, 
eficonfig_volume_selected,
+ info);
if (ret != EFI_SUCCESS) {
free(info);
goto out;
}
}
 
-   ret = append_quit_entry(efi_menu);
+   ret = eficonfig_append_quit_entry(efi_menu);
if (ret != EFI_SUCCESS)
goto out;
 
@@ -745,8 +747,8 @@ eficonfig_create_file_entry(struct efimenu *efi_menu, u32 
count,
  (int (*)(const void *, const void *))sort_file);
 
for (i = 0; i < entry_num; i++) {
-   ret = append_entry(efi_menu, tmp_infos[i]->file_name,
-  eficonfig_file_selected, tmp_infos[i]);
+   ret = eficonfig_append_menu_entry(efi_menu, 
tmp_infos[i]->file_name,
+ eficonfig_file_selected, 
tmp_infos[i]);
if (ret != EFI_SUCCESS)
goto out;
}
@@ -815,7 +817,7 @@ static efi_status_t eficonfig_select_file(struct 
eficonfig_select_file_info *fil
if (ret != EFI_SUCCESS)
goto err;
 
-   ret = append_quit_entry(efi_menu);
+   ret = eficonfig_append_quit_entry(efi_menu);
if (ret != EFI_SUCCESS)
goto err;
 
@@ -1218,7 +1220,7 @@ static efi_status_t create_boot_option_entry(struct 
efimenu *efi_menu, char *tit
utf16_utf8_strcpy(, val);
}
 
-   return append_entry(efi_menu, buf, func, data);
+   return eficonfig_append_menu_entry(efi_menu, buf, func, data);
 }
 
 /**
@@ -1677,7 +1679,7 @@ static efi_status_t 
eficonfig_add_boot_selection_entry(struct efimenu *efi_menu,
utf16_utf8_strcpy(, lo.label);
info->boot_index = boot_index;
info->selected = selected;
-   ret = append_entry(efi_menu, buf, eficonfig_process_boot_selected, 
info);
+   ret = eficonfig_append_menu_entry(efi_menu, buf, 
eficonfig_process_boot_selected, info);
if (ret != EFI_SUCCESS) {

[PATCH v5 1/5] eficonfig: refactor eficonfig_select_file_handler()

2022-10-24 Thread Masahisa Kojima
eficonfig_select_file_handler() is commonly used to select the
file. eficonfig_display_select_file_option() intends to add the
additional menu mainly to clear the selected file information.
eficonfig_display_select_file_option() is not necessary for the
file selection process, so it should be outside of
eficonfig_select_file_handler().

Signed-off-by: Masahisa Kojima 
---
No change since v2

newly created in v2

 cmd/eficonfig.c| 13 +
 test/py/tests/test_eficonfig/test_eficonfig.py |  1 +
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index 2595dd9563..f6a99bd01a 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -968,7 +968,7 @@ efi_status_t eficonfig_process_clear_file_selection(void 
*data)
 }
 
 static struct eficonfig_item select_file_menu_items[] = {
-   {"Select File", eficonfig_process_select_file},
+   {"Select File", eficonfig_select_file_handler},
{"Clear", eficonfig_process_clear_file_selection},
{"Quit", eficonfig_process_quit},
 };
@@ -980,12 +980,13 @@ static struct eficonfig_item select_file_menu_items[] = {
  * @file_info: pointer to the file information structure
  * Return: status code
  */
-efi_status_t eficonfig_display_select_file_option(struct 
eficonfig_select_file_info *file_info)
+efi_status_t eficonfig_display_select_file_option(void *data)
 {
efi_status_t ret;
struct efimenu *efi_menu;
 
-   select_file_menu_items[1].data = file_info;
+   select_file_menu_items[0].data = data;
+   select_file_menu_items[1].data = data;
efi_menu = eficonfig_create_fixed_menu(select_file_menu_items,
   
ARRAY_SIZE(select_file_menu_items));
if (!efi_menu)
@@ -1016,10 +1017,6 @@ efi_status_t eficonfig_select_file_handler(void *data)
struct eficonfig_select_file_info *tmp = NULL;
struct eficonfig_select_file_info *file_info = data;
 
-   ret = eficonfig_display_select_file_option(file_info);
-   if (ret != EFI_SUCCESS)
-   return ret;
-
tmp = calloc(1, sizeof(struct eficonfig_select_file_info));
if (!tmp)
return EFI_OUT_OF_RESOURCES;
@@ -1284,7 +1281,7 @@ static efi_status_t prepare_file_selection_entry(struct 
efimenu *efi_menu, char
utf8_utf16_strcpy(, devname);
u16_strlcat(file_name, file_info->current_path, len);
ret = create_boot_option_entry(efi_menu, title, file_name,
-  eficonfig_select_file_handler, 
file_info);
+  eficonfig_display_select_file_option, 
file_info);
 out:
free(devname);
free(file_name);
diff --git a/test/py/tests/test_eficonfig/test_eficonfig.py 
b/test/py/tests/test_eficonfig/test_eficonfig.py
index 99606d9c4b..102bfd7541 100644
--- a/test/py/tests/test_eficonfig/test_eficonfig.py
+++ b/test/py/tests/test_eficonfig/test_eficonfig.py
@@ -349,6 +349,7 @@ def test_efi_eficonfig(u_boot_console, efi_eficonfig_data):
 press_up_down_enter_and_wait(0, 1, True, 'Quit')
 press_up_down_enter_and_wait(0, 0, True, 'No block device found!')
 press_escape_key(False)
+press_escape_key(False)
 check_current_is_maintenance_menu()
 # Return to U-Boot console
 press_escape_key(True)
-- 
2.17.1



Re: [PATCH v4 3/7] eficonfig: add direct menu entry access mode

2022-10-24 Thread Masahisa Kojima
Hi Heinrich,

On Mon, 24 Oct 2022 at 15:34, Masahisa Kojima
 wrote:
>
> Hi Heinrich,
>
> On Mon, 24 Oct 2022 at 14:40, Heinrich Schuchardt  wrote:
> >
> > On 10/24/22 06:48, Masahisa Kojima wrote:
> > > This commit adds the direct menu entry access mode.
> > > User can select the menu entry by '&' key followed by
> > > the menu title name.
> > >
> > > User input is read in UTF-16, then UTF-16 string is converted
> > > into UTF-8 internally because string comparison relies on strncasecmp().
> > > There is no equivalent string comparison function for UTF-16.
> > >
> > > Signed-off-by: Masahisa Kojima 
> > > ---
> > > Newly added in v4
> > >
> > >   cmd/eficonfig.c  | 120 ++-
> > >   common/menu.c|   3 ++
> > >   include/efi_config.h |   3 ++
> > >   include/menu.h   |   1 +
> > >   4 files changed, 126 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
> > > index 0cb0770ac3..56d9268f9f 100644
> > > --- a/cmd/eficonfig.c
> > > +++ b/cmd/eficonfig.c
> > > @@ -22,6 +22,7 @@
> > >
> > >   static struct efi_simple_text_input_protocol *cin;
> > >
> > > +#define EFICONFIG_ACCESSOR_STR_MAX 16
> > >   #define EFICONFIG_DESCRIPTION_MAX 32
> > >   #define EFICONFIG_OPTIONAL_DATA_MAX 64
> > >
> > > @@ -155,7 +156,28 @@ static void eficonfig_print_entry(void *data)
> > >   if (reverse)
> > >   puts(ANSI_COLOR_REVERSE);
> > >
> > > - printf("%s", entry->title);
> > > + if (reverse && entry->efi_menu->direct_access_mode) {
> > > + size_t len = u16_strlen(entry->efi_menu->accessor_str);
> > > + char *accessor_str, *p;
> > > +
> > > + accessor_str = calloc(1, 
> > > utf16_utf8_strlen(entry->efi_menu->accessor_str) + 1);
> > > + if (!accessor_str) {
> > > + printf("%s", entry->title);
> > > + return;
> > > + }
> > > + p = accessor_str;
> > > + utf16_utf8_strncpy(, entry->efi_menu->accessor_str, 
> > > EFICONFIG_ACCESSOR_STR_MAX);
> > > + len = strlen(accessor_str);
> > > + if (!strncasecmp(accessor_str, entry->title, len)) {
> > > + printf("%.*s" ANSI_COLOR_RESET "%s", (int)len, 
> > > entry->title,
> > > +>title[len]);
> > > + } else {
> > > + printf("%s", entry->title);
> > > + }
> > > + free(accessor_str);
> > > + } else {
> > > + printf("%s", entry->title);
> > > + }
> > >
> > >   if (reverse)
> > >   puts(ANSI_COLOR_RESET);
> > > @@ -182,6 +204,83 @@ static void eficonfig_display_statusline(struct menu 
> > > *m)
> > >  entry->efi_menu->count + 6, 1, entry->efi_menu->count + 7, 
> > > 1);
> > >   }
> > >
> > > +/**
> > > + * eficonfig_handle_direct_accessor() - handle direct access user input
> > > + *
> > > + * @efi_menu:pointer to the efimenu structure
> > > + * Return:   key string to identify the selected entry
> > > + */
> > > +static char *eficonfig_handle_direct_accessor(struct efimenu *efi_menu)
> > > +{
> > > + efi_status_t ret;
> > > + char *accessor_str, *p;
> > > + struct efi_input_key key;
> > > + struct list_head *pos, *n;
> > > + struct eficonfig_entry *entry;
> > > + static int len;
> > > +
> > > + /* Read user input */
> > > + do {
> > > + ret = EFI_CALL(cin->read_key_stroke(cin, ));
> > > + mdelay(10);
> > > + } while (ret == EFI_NOT_READY);
> > > +
> > > + /* If user presses Ctrl+C or ESC, exit direct access mode */
> > > + if (key.unicode_char == 0x3 || key.scan_code == 23)
> > > + goto out;
> > > +
> > > + /* If user presses ENTER, exit direct access mode and return the 
> > > active entry */
> > > + if (key.unicode_char == u'\r') {
> > > + list_for_each_safe(pos, n, _menu->list) {
> > > + entry = list_entry(pos, struct eficonfig_entry, 
> > > list);
> > > + if (entry->num == efi_menu->active) {
> > > + efi_menu->direct_access_mode = false;
> > > + memset(efi_menu->accessor_str, 0,
> > > +EFICONFIG_ACCESSOR_STR_MAX * 
> > > sizeof(u16));
> > > + return entry->key;
> > > + }
> > > + }
> > > +
> > > + /* no matching entry */
> > > + goto out;
> > > + }
> > > +
> > > + /* Ignore other control code and efi scan code */
> > > + if (key.unicode_char < 0x20 || key.scan_code != 0)
> > > + return NULL;
> > > +
> > > + len = u16_strlen(efi_menu->accessor_str);
> > > + if (len < EFICONFIG_ACCESSOR_STR_MAX - 1)
> > > + efi_menu->accessor_str[len] = key.unicode_char;
> > > +
> > > + accessor_str = calloc(1, 

[PATCH 2/2] mach-snapdragon/mach-ipq40xx: fix, merge and refactoring

2022-10-24 Thread Andrey Volkov
ipq40xx/snapdragon: Merge two, more than 90% overlapping Qualcomm's Snapdrgon 
based arches, into one: "mach-snapdragon".

Signed-off-by: Andrey VOLKOV 
---
 arch/arm/Kconfig  |   19 ---
 arch/arm/Makefile |    1
 arch/arm/mach-ipq40xx/Kconfig |   15 --
 arch/arm/mach-ipq40xx/Makefile    |    9 -
 arch/arm/mach-ipq40xx/clock-ipq4019.c |   88 -
 arch/arm/mach-ipq40xx/include/mach/gpio.h |   10 --
 arch/arm/mach-ipq40xx/pinctrl-ipq4019.c   |   54 
 arch/arm/mach-ipq40xx/pinctrl-snapdragon.c    |  166 -
 arch/arm/mach-ipq40xx/pinctrl-snapdragon.h    |   30 -
 arch/arm/mach-snapdragon/Kconfig  |   47 ++-
 arch/arm/mach-snapdragon/Makefile |    5 +
 arch/arm/mach-snapdragon/clock-ipq4019.c  |   88 +
 arch/arm/mach-snapdragon/pinctrl-ipq4019.c    |   54 
 arch/arm/mach-snapdragon/pinctrl-snapdragon.c |   36 +++--
 arch/arm/mach-snapdragon/pinctrl-snapdragon.h |    1
 drivers/phy/qcom/Kconfig  |    2
 drivers/reset/Kconfig |    2
 drivers/reset/reset-qcom.c    |    2
 drivers/smem/Kconfig  |    2
 drivers/spi/Kconfig   |    2
 20 files changed, 220 insertions(+), 413 deletions(-)
 delete mode 100644 arch/arm/mach-ipq40xx/Kconfig
 delete mode 100644 arch/arm/mach-ipq40xx/Makefile
 delete mode 100644 arch/arm/mach-ipq40xx/clock-ipq4019.c
 delete mode 100644 arch/arm/mach-ipq40xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ipq40xx/pinctrl-ipq4019.c
 delete mode 100644 arch/arm/mach-ipq40xx/pinctrl-snapdragon.c
 delete mode 100644 arch/arm/mach-ipq40xx/pinctrl-snapdragon.h
 create mode 100644 arch/arm/mach-snapdragon/clock-ipq4019.c
 create mode 100644 arch/arm/mach-snapdragon/pinctrl-ipq4019.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a25b7f6d99..a495dfe813 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -803,21 +803,6 @@ config ARCH_INTEGRATOR
 select PL01X_SERIAL
 imply CMD_DM
 
-config ARCH_IPQ40XX
-    bool "Qualcomm IPQ40xx SoCs"
-    select CPU_V7A
-    select DM
-    select DM_GPIO
-    select DM_SERIAL
-    select DM_RESET
-    select GPIO_EXTRA_HEADER
-    select MSM_SMEM
-    select PINCTRL
-    select CLK
-    select SMEM
-    select OF_CONTROL
-    imply CMD_DM
-
 config ARCH_KEYSTONE
 bool "TI Keystone"
 select CMD_POWEROFF
@@ -1098,6 +1083,7 @@ config ARCH_RMOBILE
 
 config ARCH_SNAPDRAGON
 bool "Qualcomm Snapdragon SoCs"
+    select CLK
 select DM
 select DM_GPIO
 select DM_SERIAL
@@ -1105,6 +1091,7 @@ config ARCH_SNAPDRAGON
 select MSM_SMEM
 select OF_CONTROL
 select OF_SEPARATE
+    select PINCTRL
 select SMEM
 select SPMI
 imply CMD_DM
@@ -2225,8 +2212,6 @@ source "arch/arm/mach-highbank/Kconfig"
 
 source "arch/arm/mach-integrator/Kconfig"
 
-source "arch/arm/mach-ipq40xx/Kconfig"
-
 source "arch/arm/mach-k3/Kconfig"
 
 source "arch/arm/mach-keystone/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ac602aed9c..ceee6a02d0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -61,7 +61,6 @@ machine-$(CONFIG_ARCH_DAVINCI)        += davinci
 machine-$(CONFIG_ARCH_EXYNOS)        += exynos
 machine-$(CONFIG_ARCH_GXP)        += hpe
 machine-$(CONFIG_ARCH_HIGHBANK)        += highbank
-machine-$(CONFIG_ARCH_IPQ40XX)        += ipq40xx
 machine-$(CONFIG_ARCH_K3)        += k3
 machine-$(CONFIG_ARCH_KEYSTONE)        += keystone
 machine-$(CONFIG_ARCH_KIRKWOOD)        += kirkwood
diff --git a/arch/arm/mach-ipq40xx/Kconfig b/arch/arm/mach-ipq40xx/Kconfig
deleted file mode 100644
index 4eef80e935..00
--- a/arch/arm/mach-ipq40xx/Kconfig
+++ /dev/null
@@ -1,15 +0,0 @@
-if ARCH_IPQ40XX
-
-config SYS_SOC
-    default "ipq40xx"
-
-config SYS_MALLOC_F_LEN
-    default 0x2000
-
-config SYS_TEXT_BASE
-    default 0x8730
-
-config NR_DRAM_BANKS
-    default 1
-
-endif
diff --git a/arch/arm/mach-ipq40xx/Makefile b/arch/arm/mach-ipq40xx/Makefile
deleted file mode 100644
index 08a65b8854..00
--- a/arch/arm/mach-ipq40xx/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (c) 2019 Sartura Ltd.
-#
-# Author: Robert Marko 
-
-obj-y += clock-ipq4019.o
-obj-y += pinctrl-snapdragon.o
-obj-y += pinctrl-ipq4019.o
diff --git a/arch/arm/mach-ipq40xx/clock-ipq4019.c 
b/arch/arm/mach-ipq40xx/clock-ipq4019.c
deleted file mode 100644
index c1d5c4ecdd..00
--- a/arch/arm/mach-ipq40xx/clock-ipq4019.c
+++ /dev/null
@@ -1,88 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Clock drivers for Qualcomm IPQ40xx
- *
- * Copyright (c) 2020 Sartura Ltd.
- *
- * Author: Robert Marko 
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-struct msm_clk_priv {
-    phys_addr_t base;
-};
-
-ulong msm_set_rate(struct clk *clk, ulong rate)
-{
-    switch 

[PATCH 1/2] mach-snapdragon/mach-ipq40xx: fix, merge and refactoring

2022-10-24 Thread Andrey Volkov
SoC: qcom: Add missing Qualcomm's SOCs definitions to the arch KConfig

From: Andrey VOLKOV 

Add APQ8016/APQ8096/QCS40X decls to the KConfig, convert SDM845 declaration to 
the hidden one (selected by target),
and update mach-snapdragon/Makefile accordingly.

Also move 'CONFIG_ARM64' choice to the new declarations, since 'Snapdragon' 
contains Cortex A7A members too.

Signed-off-by: Andrey VOLKOV 
---
 arch/arm/Kconfig  |    1 -
 arch/arm/mach-snapdragon/Kconfig  |   23 +--
 arch/arm/mach-snapdragon/Makefile |   31 ++---
 arch/arm/mach-snapdragon/pinctrl-snapdragon.c |    2 +-
 drivers/reset/reset-qcom.c    |    2 +-
 5 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2e83394052..a25b7f6d99 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1098,7 +1098,6 @@ config ARCH_RMOBILE
 
 config ARCH_SNAPDRAGON
 bool "Qualcomm Snapdragon SoCs"
-    select ARM64
 select DM
 select DM_GPIO
 select DM_SERIAL
diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
index 092706..83dd2c07a1 100644
--- a/arch/arm/mach-snapdragon/Kconfig
+++ b/arch/arm/mach-snapdragon/Kconfig
@@ -9,10 +9,27 @@ config SYS_MALLOC_F_LEN
 config SPL_SYS_MALLOC_F_LEN
 default 0x2000
 
+config APQ8016
+    bool
+    select ARM64
+    default n
+
+config APQ8096
+    bool
+    select ARM64
+    default n
+
 config SDM845
-    bool "Qualcomm Snapdragon 845 SoC"
+    bool
+    select ARM64
+    select LINUX_KERNEL_IMAGE_HEADER
 default n
+
+config QCS40X
+    bool
+    select ARM64
 select LINUX_KERNEL_IMAGE_HEADER
+    default n
 
 config LNX_KRNL_IMG_TEXT_OFFSET_BASE
 default 0x8000
@@ -23,6 +40,7 @@ choice
 config TARGET_DRAGONBOARD410C
 bool "96Boards Dragonboard 410C"
 select BOARD_LATE_INIT
+    select APQ8016
 select ENABLE_ARM_SOC_BOOT0_HOOK
 help
   Support for 96Boards Dragonboard 410C. This board complies with
@@ -37,6 +55,7 @@ config TARGET_DRAGONBOARD410C
 
 config TARGET_DRAGONBOARD820C
 bool "96Boards Dragonboard 820C"
+    select APQ8096
 help
   Support for 96Boards Dragonboard 820C. This board complies with
   96Board Open Platform Specifications. Features:
@@ -71,7 +90,7 @@ config TARGET_STARQLTECHN
 
 config TARGET_QCS404EVB
 bool "Qualcomm Technologies, Inc. QCS404 EVB"
-    select LINUX_KERNEL_IMAGE_HEADER
+    select QCS40X
 help
   Support for Qualcomm Technologies, Inc. QCS404 evaluation board.
   Features:
diff --git a/arch/arm/mach-snapdragon/Makefile 
b/arch/arm/mach-snapdragon/Makefile
index cbaaf23f6b..00997196ab 100644
--- a/arch/arm/mach-snapdragon/Makefile
+++ b/arch/arm/mach-snapdragon/Makefile
@@ -2,20 +2,23 @@
 #
 # (C) Copyright 2015 Mateusz Kulikowski 
 
+obj-y += clock-snapdragon.o
+obj-y += pinctrl-snapdragon.o
+
 obj-$(CONFIG_SDM845) += clock-sdm845.o
 obj-$(CONFIG_SDM845) += sysmap-sdm845.o
 obj-$(CONFIG_SDM845) += init_sdm845.o
-obj-$(CONFIG_TARGET_DRAGONBOARD820C) += clock-apq8096.o
-obj-$(CONFIG_TARGET_DRAGONBOARD820C) += sysmap-apq8096.o
-obj-$(CONFIG_TARGET_DRAGONBOARD410C) += clock-apq8016.o
-obj-$(CONFIG_TARGET_DRAGONBOARD410C) += sysmap-apq8016.o
-obj-y += misc.o
-obj-y += clock-snapdragon.o
-obj-y += dram.o
-obj-y += pinctrl-snapdragon.o
-obj-y += pinctrl-apq8016.o
-obj-y += pinctrl-apq8096.o
-obj-y += pinctrl-qcs404.o
-obj-y += pinctrl-sdm845.o
-obj-$(CONFIG_TARGET_QCS404EVB) += clock-qcs404.o
-obj-$(CONFIG_TARGET_QCS404EVB) += sysmap-qcs404.o
+obj-$(CONFIG_SDM845) += pinctrl-sdm845.o
+
+obj-$(CONFIG_APQ8096) += clock-apq8096.o
+obj-$(CONFIG_APQ8096) += sysmap-apq8096.o
+obj-$(CONFIG_APQ8096) += pinctrl-apq8096.o
+
+obj-$(CONFIG_APQ8016) += clock-apq8016.o
+obj-$(CONFIG_APQ8016) += sysmap-apq8016.o
+obj-$(CONFIG_APQ8016) += pinctrl-apq8016.o
+obj-$(CONFIG_APQ8016) += misc.o dram.o
+
+obj-$(CONFIG_QCS40X) += clock-qcs404.o
+obj-$(CONFIG_QCS40X) += sysmap-qcs404.o
+obj-$(CONFIG_QCS40X) += pinctrl-qcs404.o
diff --git a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c 
b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c
index ab884ab6bf..4ed4ab4d4c 100644
--- a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c
+++ b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c
@@ -149,7 +149,7 @@ static const struct udevice_id msm_pinctrl_ids[] = {
 { }
 };
 
-U_BOOT_DRIVER(pinctrl_snapdraon) = {
+U_BOOT_DRIVER(pinctrl_snapdragon) = {
 .name        = "pinctrl_msm",
 .id        = UCLASS_PINCTRL,
 .of_match    = msm_pinctrl_ids,
diff --git a/drivers/reset/reset-qcom.c b/drivers/reset/reset-qcom.c
index 94315e76d5..2c61d6a6dc 100644
--- a/drivers/reset/reset-qcom.c
+++ b/drivers/reset/reset-qcom.c
@@ -102,7 +102,7 @@ static const struct qcom_reset_map gcc_qcom_resets[] = {
 };
 #endif
 
-#ifdef CONFIG_TARGET_QCS404EVB
+#ifdef CONFIG_QCS40X
 #include 
 static const struct qcom_reset_map gcc_qcom_resets[] = {
 [GCC_GENI_IR_BCR] = { 

[PATCH 0/2] mach-snapdragon/mach-ipq40xx: fix, merge and refactoring

2022-10-24 Thread Andrey Volkov
Hello,

At the present timeI'm working with 2 Qualcomm's Snapdragon SOCs: msm8916 and 
msm9207
both of them are mostly the same, except application CPU: former is ARMv8 based 
and latter is ARMv7A
(same as IPQ4019), so keep 2 archs for almost same (from IPs point of view) 
things is a real headache for me.

In this regard, I decided to merge and refactor the above archs, and you can 
find the result of it in the following two patches:

  * the first patch is just added some missing SOCs definitions to KConfig and 
minor bug fixing
    (like missing PINCTL, CLK etc dependencies),
  * the second one is a real merge.

--
Regards
Andrey VOLKOV



Re: [PATCH 1/3] imx: imx8mm_beacon: Eliminate a few extras to free up SPL space

2022-10-24 Thread Peng Fan




On 10/25/2022 4:47 AM, Tim Harvey wrote:

On Mon, Oct 24, 2022 at 1:26 PM Adam Ford  wrote:


On Mon, Oct 24, 2022 at 2:57 PM Tim Harvey  wrote:


On Sat, Oct 22, 2022 at 7:28 AM Adam Ford  wrote:


There are a few functions which are not essential for use in
SPL, but they take up enough space to make other preferred
features not fit.  Remove the extras.

Signed-off-by: Adam Ford 

diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c
index a93cc93878..b0e9d918da 100644
--- a/board/beacon/imx8mm/spl.c
+++ b/board/beacon/imx8mm/spl.c
@@ -44,11 +44,6 @@ static void spl_dram_init(void)
 ddr_init(_timing);
  }

-void spl_board_init(void)
-{
-   debug("Normal Boot\n");
-}
-
  #ifdef CONFIG_SPL_LOAD_FIT
  int board_fit_config_name_match(const char *name)
  {
diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
index e37ce01c19..f6a1012d8a 100644
--- a/configs/imx8mm_beacon_defconfig
+++ b/configs/imx8mm_beacon_defconfig
@@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-beacon-kit.dtb"
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
  CONFIG_SPL_BSS_START_ADDR=0x91
  CONFIG_SPL_BSS_MAX_SIZE=0x2000
-CONFIG_SPL_BOARD_INIT=y
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
  CONFIG_SPL_STACK=0x92
  CONFIG_SYS_SPL_MALLOC=y
@@ -88,12 +87,9 @@ CONFIG_DM_PCA953X=y
  CONFIG_DM_I2C=y
  CONFIG_SUPPORT_EMMC_BOOT=y
  CONFIG_MMC_IO_VOLTAGE=y
-CONFIG_SPL_MMC_IO_VOLTAGE=y
  CONFIG_MMC_UHS_SUPPORT=y
-CONFIG_SPL_MMC_UHS_SUPPORT=y
  CONFIG_MMC_HS400_ES_SUPPORT=y
  CONFIG_MMC_HS400_SUPPORT=y
-CONFIG_SPL_MMC_HS400_SUPPORT=y
  CONFIG_FSL_USDHC=y
  CONFIG_MTD=y
  CONFIG_DM_MTD=y
@@ -113,14 +109,12 @@ CONFIG_PINCTRL_IMX8M=y
  CONFIG_POWER_DOMAIN=y
  CONFIG_IMX8M_POWER_DOMAIN=y
  CONFIG_DM_PMIC=y
+# CONFIG_SPL_PMIC_CHILDREN is not set
  CONFIG_DM_PMIC_BD71837=y
  CONFIG_SPL_DM_PMIC_BD71837=y
  CONFIG_DM_REGULATOR=y
-CONFIG_SPL_DM_REGULATOR=y
  CONFIG_DM_REGULATOR_BD71837=y
-CONFIG_SPL_DM_REGULATOR_BD71837=y
  CONFIG_DM_REGULATOR_FIXED=y
-CONFIG_SPL_DM_REGULATOR_FIXED=y
  CONFIG_DM_REGULATOR_GPIO=y
  CONFIG_DM_SERIAL=y
  CONFIG_MXC_UART=y
--
2.34.1



Adam,

I'm looking at your patches as I'm also trying to strip down the
imx8mm-venice SPL so that I can fit DM USB support. It seems that
all/most of the imx8m boards have a spl_board_init() which calls
arch_misc_init(). I'm curious why your not calling that function?


As of right now, we're not using the CAAM which is initialized in
arch_misc_init.  If/When we do, we'll likely have to pull that in.



ok - makes sense.



Another config that I've found to save a lot of space for imx8m
without any negative impact I can see is CONFIG_SPL_MMC_TINY=y


I experimented a bit with that too, but I hadn't fully tested
switching between booting between MMC1 and MMC2, so I wasn't quite
ready to enable it, but I'll spend some more time with it to see how
much more space I can shave off SPL.
Getting rid of the PMIC children in SPL helped me quite a bit.


I see. It appears to save about 2K and Fabio's imx8mm clk reduction
series that made it in saves another 800 bytes or so.

Regardless I'm still oversize for imx8mm-venice by 2K bytes and
looking for things to prune. My issue is that I have 4 DRAM configs to
support which suck up 3K each I believe.


Why has so many DRAM configs? Use one image to support multiple boards?

Regards,
Peng.



Tim


Re: [PATCH V2 3/4] configs: imx8mn_beacon: Enable SPL_DM_PMIC_BD71837

2022-10-24 Thread Peng Fan




On 10/22/2022 9:43 PM, Adam Ford wrote:

To properly operate the Nano with LPDDR4 at 1.6GHz, the
voltage needs to be adjusted before DDR is initialized.
Enable the PMIC in SPL to do this.

Signed-off-by: Adam Ford 


Better enable defconfig in the end, otherwise:
Reviewed-by: Peng Fan 



diff --git a/configs/imx8mn_beacon_2g_defconfig 
b/configs/imx8mn_beacon_2g_defconfig
index 5708ba5c69..4931f836f0 100644
--- a/configs/imx8mn_beacon_2g_defconfig
+++ b/configs/imx8mn_beacon_2g_defconfig
@@ -120,6 +120,7 @@ CONFIG_PINCTRL_IMX8M=y
  CONFIG_DM_PMIC=y
  # CONFIG_SPL_PMIC_CHILDREN is not set
  CONFIG_DM_PMIC_BD71837=y
+CONFIG_SPL_DM_PMIC_BD71837=y
  CONFIG_DM_REGULATOR=y
  CONFIG_DM_REGULATOR_BD71837=y
  CONFIG_DM_REGULATOR_FIXED=y
diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig
index 0793db0bd6..ae29da 100644
--- a/configs/imx8mn_beacon_defconfig
+++ b/configs/imx8mn_beacon_defconfig
@@ -124,6 +124,7 @@ CONFIG_PINCTRL_IMX8M=y
  CONFIG_DM_PMIC=y
  # CONFIG_SPL_PMIC_CHILDREN is not set
  CONFIG_DM_PMIC_BD71837=y
+CONFIG_SPL_DM_PMIC_BD71837=y
  CONFIG_DM_REGULATOR=y
  CONFIG_DM_REGULATOR_BD71837=y
  CONFIG_DM_REGULATOR_FIXED=y
diff --git a/configs/imx8mn_beacon_fspi_defconfig 
b/configs/imx8mn_beacon_fspi_defconfig
index 6da2182eb3..94d069cbfa 100644
--- a/configs/imx8mn_beacon_fspi_defconfig
+++ b/configs/imx8mn_beacon_fspi_defconfig
@@ -125,6 +125,7 @@ CONFIG_PINCTRL_IMX8M=y
  CONFIG_DM_PMIC=y
  # CONFIG_SPL_PMIC_CHILDREN is not set
  CONFIG_DM_PMIC_BD71837=y
+CONFIG_SPL_DM_PMIC_BD71837=y
  CONFIG_DM_REGULATOR=y
  CONFIG_DM_REGULATOR_BD71837=y
  CONFIG_DM_REGULATOR_FIXED=y


Re: [PATCH V2 4/4] imx: imx8mn-beacon: Fix out of spec voltage

2022-10-24 Thread Peng Fan




On 10/22/2022 9:43 PM, Adam Ford wrote:

The DDR is configured for LPDDR4 running at 1.6GHz which requires
the voltage on the PMIC to rise a bit before initializing LPDDR4
or it will be running out of spec.

Signed-off-by: Adam Ford 


I think patch 4 better be moved before patch 3. Otherwise:
Reviewed-by: Peng Fan 



diff --git a/board/beacon/imx8mn/spl.c b/board/beacon/imx8mn/spl.c
index 029f71bc99..9acd916180 100644
--- a/board/beacon/imx8mn/spl.c
+++ b/board/beacon/imx8mn/spl.c
@@ -74,6 +74,38 @@ static iomux_v3_cfg_t const pwm_pads[] = {
IMX8MN_PAD_GPIO1_IO01__PWM1_OUT | MUX_PAD_CTRL(PWM1_PAD_CTRL),
  };
  
+static int power_init_board(void)

+{
+   struct udevice *dev;
+   int ret;
+
+   ret = pmic_get("pmic@4b", );
+   if (ret == -ENODEV) {
+   puts("No pmic\n");
+   return 0;
+   }
+
+   if (ret != 0)
+   return ret;
+
+   /* decrease RESET key long push time from the default 10s to 10ms */
+   pmic_reg_write(dev, BD718XX_PWRONCONFIG1, 0x0);
+
+   /* unlock the PMIC regs */
+   pmic_reg_write(dev, BD718XX_REGLOCK, 0x1);
+
+   /* increase VDD_SOC to typical value 0.85v before first DRAM access */
+   pmic_reg_write(dev, BD718XX_BUCK1_VOLT_RUN, 0x0f);
+
+   /* increase VDD_DRAM to 0.975v for 3Ghz DDR */
+   pmic_reg_write(dev, BD718XX_1ST_NODVS_BUCK_VOLT, 0x83);
+
+   /* lock the PMIC regs */
+   pmic_reg_write(dev, BD718XX_REGLOCK, 0x11);
+
+   return 0;
+}
+
  int board_early_init_f(void)
  {
/* Claiming pwm pins prevents LCD flicker during startup*/
@@ -107,6 +139,9 @@ void board_init_f(ulong dummy)
  
  	enable_tzc380();
  
+	/* LPDDR4 at 1.6GHz requires a voltage adjustment on the PMIC */

+   power_init_board();
+
/* DDR initialization */
spl_dram_init();
  


Re: [PATCH V2 1/4] configs: imx8mn_beacon: Re-align memory to standard imx8mn settings

2022-10-24 Thread Peng Fan




On 10/22/2022 9:43 PM, Adam Ford wrote:

The imx8mn_beacon board does not use the same memory map as the reference
design from NXP or other imx8mn boards.  As such, memory is more limited
in SPL.

Moving SPL_BSS_START_ADDR and SPL_STACK to default locations increases
the amount of available meory for the SPL stack.  Doing this allows
the board to no longer define CONFIG_MALLOC_F_ADDR.

Since SYS_LOAD_ADDR also does not align with other boards, move it too.

Signed-off-by: Adam Ford 


Reviewed-by: Peng Fan 

---
V2:
Rebase on u-boot-imx

Depends on:
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fproject%2Fuboot%2Flist%2F%3Fseries%3D324057data=05%7C01%7Cpeng.fan%40nxp.com%7C593fc12438854d817dc408dab4337960%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638020430413763306%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=E%2F%2Fo5bmg6731UeEvNZ%2FiiWxZRG9%2BdypC7vo8Z6c%2B4Tc%3Dreserved=0
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fproject%2Fuboot%2Flist%2F%3Fseries%3D312020data=05%7C01%7Cpeng.fan%40nxp.com%7C593fc12438854d817dc408dab4337960%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638020430413763306%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=5g7Q7zw1o5QwjICog5urqD6yIb13j%2BtZt9PFcS1sFVw%3Dreserved=0

diff --git a/configs/imx8mn_beacon_2g_defconfig 
b/configs/imx8mn_beacon_2g_defconfig
index 613945a9ec..5708ba5c69 100644
--- a/configs/imx8mn_beacon_2g_defconfig
+++ b/configs/imx8mn_beacon_2g_defconfig
@@ -16,10 +16,9 @@ CONFIG_IMX8MN_BEACON_2GB_LPDDR=y
  CONFIG_SYS_PROMPT="u-boot=> "
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_DRIVERS_MISC=y
-CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
  CONFIG_SPL=y
  CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
-CONFIG_SYS_LOAD_ADDR=0x4048
+CONFIG_SYS_LOAD_ADDR=0x4200
  CONFIG_SYS_MEMTEST_START=0x4000
  CONFIG_SYS_MEMTEST_END=0x4400
  CONFIG_LTO=y
@@ -35,12 +34,12 @@ CONFIG_DEFAULT_FDT_FILE="imx8mn-beacon-kit.dtb"
  CONFIG_ARCH_MISC_INIT=y
  CONFIG_SPL_MAX_SIZE=0x25000
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x95e000
+CONFIG_SPL_BSS_START_ADDR=0x95
  CONFIG_SPL_BSS_MAX_SIZE=0x2000
  CONFIG_SPL_BOARD_INIT=y
  CONFIG_SPL_BOOTROM_SUPPORT=y
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
-CONFIG_SPL_STACK=0x187ff0
+CONFIG_SPL_STACK=0x98
  CONFIG_SYS_SPL_MALLOC=y
  CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y
  CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x4220
diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig
index cc1583524b..0793db0bd6 100644
--- a/configs/imx8mn_beacon_defconfig
+++ b/configs/imx8mn_beacon_defconfig
@@ -15,10 +15,9 @@ CONFIG_TARGET_IMX8MN_BEACON=y
  CONFIG_SYS_PROMPT="u-boot=> "
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_DRIVERS_MISC=y
-CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
  CONFIG_SPL=y
  CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
-CONFIG_SYS_LOAD_ADDR=0x4048
+CONFIG_SYS_LOAD_ADDR=0x4200
  CONFIG_SYS_MEMTEST_START=0x4000
  CONFIG_SYS_MEMTEST_END=0x4400
  CONFIG_LTO=y
@@ -34,12 +33,12 @@ CONFIG_DEFAULT_FDT_FILE="imx8mn-beacon-kit.dtb"
  CONFIG_ARCH_MISC_INIT=y
  CONFIG_SPL_MAX_SIZE=0x25000
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x95e000
+CONFIG_SPL_BSS_START_ADDR=0x95
  CONFIG_SPL_BSS_MAX_SIZE=0x2000
  CONFIG_SPL_BOARD_INIT=y
  CONFIG_SPL_BOOTROM_SUPPORT=y
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
-CONFIG_SPL_STACK=0x187ff0
+CONFIG_SPL_STACK=0x98
  CONFIG_SYS_SPL_MALLOC=y
  CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y
  CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x4220
diff --git a/configs/imx8mn_beacon_fspi_defconfig 
b/configs/imx8mn_beacon_fspi_defconfig
index ecaefd8930..6da2182eb3 100644
--- a/configs/imx8mn_beacon_fspi_defconfig
+++ b/configs/imx8mn_beacon_fspi_defconfig
@@ -14,10 +14,9 @@ CONFIG_SPL_TEXT_BASE=0x912000
  CONFIG_TARGET_IMX8MN_BEACON=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_DRIVERS_MISC=y
-CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
  CONFIG_SPL=y
  CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
-CONFIG_SYS_LOAD_ADDR=0x4048
+CONFIG_SYS_LOAD_ADDR=0x4200
  CONFIG_SYS_MEMTEST_START=0x4000
  CONFIG_SYS_MEMTEST_END=0x4400
  CONFIG_LTO=y
@@ -33,12 +32,12 @@ CONFIG_DEFAULT_FDT_FILE="imx8mn-beacon-kit.dtb"
  CONFIG_ARCH_MISC_INIT=y
  CONFIG_SPL_MAX_SIZE=0x25000
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x95e000
+CONFIG_SPL_BSS_START_ADDR=0x95
  CONFIG_SPL_BSS_MAX_SIZE=0x2000
  CONFIG_SPL_BOARD_INIT=y
  CONFIG_SPL_BOOTROM_SUPPORT=y
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
-CONFIG_SPL_STACK=0x187ff0
+CONFIG_SPL_STACK=0x98
  CONFIG_SYS_SPL_MALLOC=y
  CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y
  CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x4220
diff --git a/include/configs/imx8mn_beacon.h b/include/configs/imx8mn_beacon.h
index 6faecbde77..930b11b75e 100644
--- a/include/configs/imx8mn_beacon.h
+++ b/include/configs/imx8mn_beacon.h
@@ 

[GIT PULL] please pull fsl-qoriq-2022-10-18

2022-10-24 Thread Peng Fan
Hi Tom,

Please pull fsl-qoriq-2022-10-18

CI: https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/pipelines/13836
--
Layerscape update
 - support sysreset,
 - de-select FSL_IFC when booting from SD
 - disable unused parts of ICID tables
 - reduce ns_dev size for csu
 - enable dma snooping for ls104x
 - nand driver fixups for ls1043ardb rev 7.0 boards.
--

Thanks,
Peng.

The following changes since commit e2ff1d0fa777b11ad6b26432cb7613ab433b15d6:

  Merge tag 'efi-2023-01-rc1-3' of 
https://source.denx.de/u-boot/custodians/u-boot-efi (2022-10-16 20:23:47 -0400)

are available in the Git repository at:

  https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq.git 
tags/fsl-qoriq-2022-10-18

for you to fetch changes up to c4f0de3eecd951cd5480cdbc9d96c63a4432a521:

  arm: fsl: csu: Reduce size of ns_dev (2022-10-18 09:32:53 +0800)


Sean Anderson (5):
  arm64: ls104x: Enable eDMA snooping
  arm64: layerscape: Support SYSRESET
  arm: layerscape: Don't select FSL_IFC when booting from SD card
  arm: layerscape: Disable unused parts of ICID tables
  arm: fsl: csu: Reduce size of ns_dev

Wei Lu (1):
  ls1043ardb: nand driver fixups for revision v7.0 boards

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig  |  4 ++--
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|  2 ++
 arch/arm/cpu/armv8/fsl-layerscape/icid.c   |  2 ++
 arch/arm/cpu/armv8/fsl-layerscape/soc.c|  2 +-
 arch/arm/include/asm/arch-fsl-layerscape/fsl_icid.h| 16 ++--
 arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h |  1 +
 board/freescale/ls1043ardb/cpld.c  |  4 
 board/freescale/ls1043ardb/cpld.h  |  1 +
 board/freescale/ls1043ardb/ls1043ardb.c| 46 
+-
 include/fsl_csu.h  |  4 ++--
 10 files changed, 74 insertions(+), 8 deletions(-)


[GIT PULL] Please pull u-boot-mmc master

2022-10-24 Thread Jaehoon Chung
Dear Tom,


Please pull u-boot-mmc master into u-boot master branch.
If there is any problem, let me know, plz.

Best Regards,
Jaehoon Chung

CI: https://source.denx.de/u-boot/custodians/u-boot-mmc/-/pipelines/13923


The following changes since commit 7723828c97bc107d2fba976fc50403ac8747f1bc:

  Merge branch '2022-10-21-enforce-some-DM-migrations' (2022-10-21 15:32:45 
-0400)

are available in the Git repository at:

  g...@source.denx.de:u-boot/custodians/u-boot-mmc.git master

for you to fetch changes up to 337af54a36c6409b7eeb49619c796178b3c22372:

  mmc: Fix static checker warnings (2022-10-24 18:02:54 +0900)


John Keeping (1):
  mmc: dwmmc: only clear handled interrupts

Kunihiko Hayashi (2):
  mmc: sdhci: Add new quirks for SUPPORT_SINGLE
  mmc: f_sdh30: Add support for F_SDH30_E51

Sergei Antonov (1):
  mmc: ftsdc010: make command timeout 250 ms as in the comment

Venkatesh Yadav Abbarapu (1):
  mmc: Fix static checker warnings

Yann Gautier (3):
  mmc: stm32_sdmmc2: add dual data rate support
  mmc: stm32_sdmmc2: protect against unsupported modes
  mmc: stm32_sdmmc2: manage vqmmc

 drivers/mmc/Kconfig|  4 ++--
 drivers/mmc/dw_mmc.c   |  3 ++-
 drivers/mmc/f_sdh30.c  | 66 
--
 drivers/mmc/ftsdc010_mci.c |  2 +-
 drivers/mmc/mmc.c  |  6 --
 drivers/mmc/sdhci.c|  8 +---
 drivers/mmc/stm32_sdmmc2.c | 20 +++-
 include/sdhci.h|  1 +
 8 files changed, 98 insertions(+), 12 deletions(-)


Re: [PATCH] mmc: Fix static checker warnings

2022-10-24 Thread Jaehoon Chung
On 9/29/22 13:52, Venkatesh Yadav Abbarapu wrote:
> Correct pointer dereferencing check to be more consistent.
> 
> Eliminate the below smatch warning:
> drivers/mmc/mmc.c:3118 mmc_init_device()
> warn: variable dereferenced before check 'm' (see line 3116)
> 
> Signed-off-by: Venkatesh Yadav Abbarapu 
> Reviewed-by: Michal Simek 
> Reviewed-by: Jaehoon Chung 

Applied to u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung


> ---
> 
>  drivers/mmc/mmc.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 0b7c0be8cb..210703ea46 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -3113,10 +3113,12 @@ int mmc_init_device(int num)
>   }
>  
>   m = mmc_get_mmc_dev(dev);
> - m->user_speed_mode = MMC_MODES_END; /* Initialising user set speed mode 
> */
> -
>   if (!m)
>   return 0;
> +
> + /* Initialising user set speed mode */
> + m->user_speed_mode = MMC_MODES_END;
> +
>   if (m->preinit)
>   mmc_start_init(m);
>  



Re: [PATCH] mmc: dwmmc: only clear handled interrupts

2022-10-24 Thread Jaehoon Chung
On 9/16/22 02:56, John Keeping wrote:
> Unconditionally clearing DTO when RXDR is set leads to spurious timeouts
> in FIFO mode transfers if events occur in the following order:
> 
>   mask = dwmci_readl(host, DWMCI_RINTSTS);
> 
>   // Hardware asserts DWMCI_INTMSK_DTO here
> 
>   dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_DTO);
> 
>   if (mask & DWMCI_INTMSK_DTO) {
>   // Unreachable as DTO is cleared without being handled!
>   return 0;
>   }
> 
> Only clear interrupts that we have seen and are handling so that DTO is
> not missed.
> 
> Signed-off-by: John Keeping 
> Tested-by: Jerome Forissier  (Rock PI 4B)
> Tested-by: Quentin Schulz  
> Reviewed-by: Jaehoon Chung 

Applied to u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung


> ---
>  drivers/mmc/dw_mmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 4232c5eb8c..5085a3b491 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -168,7 +168,8 @@ static int dwmci_data_transfer(struct dwmci_host *host, 
> struct mmc_data *data)
>   if (data->flags == MMC_DATA_READ &&
>   (mask & (DWMCI_INTMSK_RXDR | DWMCI_INTMSK_DTO))) {
>   dwmci_writel(host, DWMCI_RINTSTS,
> -  DWMCI_INTMSK_RXDR | 
> DWMCI_INTMSK_DTO);
> +  mask & (DWMCI_INTMSK_RXDR |
> +  DWMCI_INTMSK_DTO));
>   while (size) {
>   ret = dwmci_fifo_ready(host,
>   DWMCI_FIFO_EMPTY,



Re: [PATCH 1/3] mmc: stm32_sdmmc2: add dual data rate support

2022-10-24 Thread Jaehoon Chung
On 9/13/22 20:23, Yann Gautier wrote:
> To support dual data rate with STM32 sdmmc2 driver, the dedicated bit
> (DDR - BIT(18)) needs to be set in the CLKRC register. Clock bypass
> (no divider) is not allowed in this case. This is required for the
> eMMC DDR modes.
> 
> Signed-off-by: Yann Gautier 
> Reviewed-by: Jaehoon Chung 

Applied to u-boot-mmc. Thanks! (with [PATCH 2/3] and [PATCH 3/3])

Best Regards,
Jaehoon Chung


> ---
> 
>  drivers/mmc/stm32_sdmmc2.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c
> index bfce8a2e4a..3cfa5a66f1 100644
> --- a/drivers/mmc/stm32_sdmmc2.c
> +++ b/drivers/mmc/stm32_sdmmc2.c
> @@ -598,13 +598,16 @@ static int stm32_sdmmc2_set_ios(struct udevice *dev)
>* clk_div > 0 and NEGEDGE = 1 => command and data generated on
>* SDMMCCLK falling edge
>*/
> - if (desired && ((sys_clock > desired) ||
> + if (desired && (sys_clock > desired || mmc->ddr_mode ||
>   IS_RISING_EDGE(plat->clk_reg_msk))) {
>   clk = DIV_ROUND_UP(sys_clock, 2 * desired);
>   if (clk > SDMMC_CLKCR_CLKDIV_MAX)
>   clk = SDMMC_CLKCR_CLKDIV_MAX;
>   }
>  
> + if (mmc->ddr_mode)
> + clk |= SDMMC_CLKCR_DDR;
> +
>   if (mmc->bus_width == 4)
>   clk |= SDMMC_CLKCR_WIDBUS_4;
>   if (mmc->bus_width == 8)



Re: [PATCH v2 2/2] mmc: f_sdh30: Add support for F_SDH30_E51

2022-10-24 Thread Jaehoon Chung
On 9/9/22 16:23, Kunihiko Hayashi wrote:
> Add Socionext F_SDH30_E51 IP support. The features of this IP includes
> CMD/DAT line delay and force card insertion mode for non-removable cards.
> And the IP needs to add some quirks.
> 
> Signed-off-by: Kunihiko Hayashi 

Applied to u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung


> ---
>  drivers/mmc/Kconfig   |  4 +--
>  drivers/mmc/f_sdh30.c | 66 +--
>  2 files changed, 66 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index 0dcec8adcee8..c30f20cba5f2 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -577,12 +577,12 @@ config MMC_SDHCI_IPROC
> If unsure, say N.
>  
>  config MMC_SDHCI_F_SDH30
> - bool "SDHCI support for Fujitsu Semiconductor F_SDH30"
> + bool "SDHCI support for Fujitsu Semiconductor/Socionext F_SDH30"
>   depends on BLK && DM_MMC
>   depends on MMC_SDHCI
>   help
> This selects the Secure Digital Host Controller Interface (SDHCI)
> -   Needed by some Fujitsu SoC for MMC / SD / SDIO support.
> +   Needed by some Fujitsu/Socionext SoC for MMC / SD / SDIO support.
> If you have a controller with this interface, say Y or M here.
> If unsure, say N.
>  
> diff --git a/drivers/mmc/f_sdh30.c b/drivers/mmc/f_sdh30.c
> index 3a85d9e348ab..3d587a464d50 100644
> --- a/drivers/mmc/f_sdh30.c
> +++ b/drivers/mmc/f_sdh30.c
> @@ -11,13 +11,48 @@
>  #include 
>  #include 
>  
> +#define F_SDH30_ESD_CONTROL  0x124
> +#define F_SDH30_CMD_DAT_DELAYBIT(9)
> +
> +#define F_SDH30_TEST 0x158
> +#define F_SDH30_FORCE_CARD_INSERTBIT(6)
> +
> +struct f_sdh30_data {
> + void (*init)(struct udevice *dev);
> + u32 quirks;
> +};
> +
>  struct f_sdh30_plat {
>   struct mmc_config cfg;
>   struct mmc mmc;
> +
> + bool enable_cmd_dat_delay;
> + const struct f_sdh30_data *data;
>  };
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> +static void f_sdh30_e51_init(struct udevice *dev)
> +{
> + struct f_sdh30_plat *plat = dev_get_plat(dev);
> + struct sdhci_host *host = dev_get_priv(dev);
> + u32 val;
> +
> + val = sdhci_readl(host, F_SDH30_ESD_CONTROL);
> + if (plat->enable_cmd_dat_delay)
> + val |= F_SDH30_CMD_DAT_DELAY;
> + else
> + val &= ~F_SDH30_CMD_DAT_DELAY;
> + sdhci_writel(host, val, F_SDH30_ESD_CONTROL);
> +
> + val = sdhci_readl(host, F_SDH30_TEST);
> + if (plat->cfg.host_caps & MMC_CAP_NONREMOVABLE)
> + val |= F_SDH30_FORCE_CARD_INSERT;
> + else
> + val &= ~F_SDH30_FORCE_CARD_INSERT;
> + sdhci_writel(host, val, F_SDH30_TEST);
> +}
> +
>  static int f_sdh30_sdhci_probe(struct udevice *dev)
>  {
>   struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
> @@ -25,6 +60,8 @@ static int f_sdh30_sdhci_probe(struct udevice *dev)
>   struct sdhci_host *host = dev_get_priv(dev);
>   int ret;
>  
> + plat->data = (const struct f_sdh30_data *)dev_get_driver_data(dev);
> +
>   ret = mmc_of_parse(dev, >cfg);
>   if (ret)
>   return ret;
> @@ -33,6 +70,9 @@ static int f_sdh30_sdhci_probe(struct udevice *dev)
>   host->mmc->dev = dev;
>   host->mmc->priv = host;
>  
> + if (plat->data && plat->data->quirks)
> + host->quirks = plat->data->quirks;
> +
>   ret = sdhci_setup_cfg(>cfg, host, 2, 40);
>   if (ret)
>   return ret;
> @@ -41,18 +81,29 @@ static int f_sdh30_sdhci_probe(struct udevice *dev)
>  
>   mmc_set_clock(host->mmc, host->mmc->cfg->f_min, MMC_CLK_ENABLE);
>  
> - return sdhci_probe(dev);
> + ret = sdhci_probe(dev);
> + if (ret)
> + return ret;
> +
> + if (plat->data && plat->data->init)
> + plat->data->init(dev);
> +
> + return 0;
>  }
>  
>  static int f_sdh30_of_to_plat(struct udevice *dev)
>  {
>   struct sdhci_host *host = dev_get_priv(dev);
> + struct f_sdh30_plat *plat = dev_get_plat(dev);
>  
>   host->name = strdup(dev->name);
>   host->ioaddr = dev_read_addr_ptr(dev);
>   host->bus_width = dev_read_u32_default(dev, "bus-width", 4);
>   host->index = dev_read_u32_default(dev, "index", 0);
>  
> + plat->enable_cmd_dat_delay =
> + dev_read_bool(dev, "socionext,enable-cmd-dat-delay");
> +
>   return 0;
>  }
>  
> @@ -63,8 +114,19 @@ static int f_sdh30_bind(struct udevice *dev)
>   return sdhci_bind(dev, >mmc, >cfg);
>  }
>  
> +static const struct f_sdh30_data f_sdh30_e51_data = {
> + .init = f_sdh30_e51_init,
> + .quirks = SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_SUPPORT_SINGLE,
> +};
> +
>  static const struct udevice_id f_sdh30_mmc_ids[] = {
> - { .compatible = "fujitsu,mb86s70-sdhci-3.0" },
> + {
> + .compatible = "fujitsu,mb86s70-sdhci-3.0",
> + },
> + {
> + .compatible = "socionext,f-sdh30-e51-mmc",
> + 

Re: [PATCH v2 1/2] mmc: sdhci: Add new quirks for SUPPORT_SINGLE

2022-10-24 Thread Jaehoon Chung
On 9/9/22 16:23, Kunihiko Hayashi wrote:
> This patch defines a quirk to disable the block count
> for single block transactions.
> 
> This is similar to Linux kernel commit d3fc5d71ac4d
> ("mmc: sdhci: add a quirk for single block transactions").
> 
> Signed-off-by: Kunihiko Hayashi 
> Reviewed-by: Jaehoon Chung 

Applied to u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung


> ---
>  drivers/mmc/sdhci.c | 8 +---
>  include/sdhci.h | 1 +
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index bf989a594f7e..a80ad8329a38 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -211,7 +211,7 @@ static int sdhci_send_command(struct mmc *mmc, struct 
> mmc_cmd *cmd,
>   unsigned int stat = 0;
>   int ret = 0;
>   int trans_bytes = 0, is_aligned = 1;
> - u32 mask, flags, mode;
> + u32 mask, flags, mode = 0;
>   unsigned int time = 0;
>   int mmc_dev = mmc_get_blk_desc(mmc)->devnum;
>   ulong start = get_timer(0);
> @@ -273,10 +273,12 @@ static int sdhci_send_command(struct mmc *mmc, struct 
> mmc_cmd *cmd,
>   /* Set Transfer mode regarding to data flag */
>   if (data) {
>   sdhci_writeb(host, 0xe, SDHCI_TIMEOUT_CONTROL);
> - mode = SDHCI_TRNS_BLK_CNT_EN;
> +
> + if (!(host->quirks & SDHCI_QUIRK_SUPPORT_SINGLE))
> + mode = SDHCI_TRNS_BLK_CNT_EN;
>   trans_bytes = data->blocks * data->blocksize;
>   if (data->blocks > 1)
> - mode |= SDHCI_TRNS_MULTI;
> + mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_BLK_CNT_EN;
>  
>   if (data->flags == MMC_DATA_READ)
>   mode |= SDHCI_TRNS_READ;
> diff --git a/include/sdhci.h b/include/sdhci.h
> index 88f1917480b6..24b4599b857d 100644
> --- a/include/sdhci.h
> +++ b/include/sdhci.h
> @@ -247,6 +247,7 @@
>  #define SDHCI_QUIRK_WAIT_SEND_CMD(1 << 6)
>  #define SDHCI_QUIRK_USE_WIDE8(1 << 8)
>  #define SDHCI_QUIRK_NO_1_8_V (1 << 9)
> +#define SDHCI_QUIRK_SUPPORT_SINGLE   (1 << 10)
>  
>  /* to make gcc happy */
>  struct sdhci_host;



Re: [PATCH] mmc: ftsdc010: make command timeout 250 ms as in the comment

2022-10-24 Thread Jaehoon Chung
On 9/2/22 16:40, Sergei Antonov wrote:
> Get rid of discrepancy beween comment /* 250 ms */ and code
> which shifts by 4 thus dividing by 16.
> So change code to shift by 2 and make the timeout value 250 ms.
> 
> Signed-off-by: Sergei Antonov 
> Reviewed-by: Rick Chen 
> Reviewed-by: Jaehoon Chung 

Applied to u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/ftsdc010_mci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/ftsdc010_mci.c b/drivers/mmc/ftsdc010_mci.c
> index 570d54cf9d8f..cabb747fbbdb 100644
> --- a/drivers/mmc/ftsdc010_mci.c
> +++ b/drivers/mmc/ftsdc010_mci.c
> @@ -30,7 +30,7 @@
>  #include 
>  #include 
>  
> -#define CFG_CMD_TIMEOUT (CONFIG_SYS_HZ >> 4) /* 250 ms */
> +#define CFG_CMD_TIMEOUT (CONFIG_SYS_HZ >> 2) /* 250 ms */
>  #define CFG_RST_TIMEOUT CONFIG_SYS_HZ /* 1 sec reset timeout */
>  
>  #if CONFIG_IS_ENABLED(OF_PLATDATA)



Re: [PATCH V2 1/4] configs: imx8mn_beacon: Re-align memory to standard imx8mn settings

2022-10-24 Thread Tim Harvey
On Sat, Oct 22, 2022 at 6:44 AM Adam Ford  wrote:
>
> The imx8mn_beacon board does not use the same memory map as the reference
> design from NXP or other imx8mn boards.  As such, memory is more limited
> in SPL.
>
> Moving SPL_BSS_START_ADDR and SPL_STACK to default locations increases
> the amount of available meory for the SPL stack.  Doing this allows
> the board to no longer define CONFIG_MALLOC_F_ADDR.
>
> Since SYS_LOAD_ADDR also does not align with other boards, move it too.
>
> Signed-off-by: Adam Ford 
> ---
> V2:
> Rebase on u-boot-imx
>
> Depends on:
> https://patchwork.ozlabs.org/project/uboot/list/?series=324057
> https://patchwork.ozlabs.org/project/uboot/list/?series=312020
>
> diff --git a/configs/imx8mn_beacon_2g_defconfig 
> b/configs/imx8mn_beacon_2g_defconfig
> index 613945a9ec..5708ba5c69 100644
> --- a/configs/imx8mn_beacon_2g_defconfig
> +++ b/configs/imx8mn_beacon_2g_defconfig
> @@ -16,10 +16,9 @@ CONFIG_IMX8MN_BEACON_2GB_LPDDR=y
>  CONFIG_SYS_PROMPT="u-boot=> "
>  CONFIG_SPL_SERIAL=y
>  CONFIG_SPL_DRIVERS_MISC=y
> -CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
>  CONFIG_SPL=y
>  CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
> -CONFIG_SYS_LOAD_ADDR=0x4048
> +CONFIG_SYS_LOAD_ADDR=0x4200
>  CONFIG_SYS_MEMTEST_START=0x4000
>  CONFIG_SYS_MEMTEST_END=0x4400
>  CONFIG_LTO=y
> @@ -35,12 +34,12 @@ CONFIG_DEFAULT_FDT_FILE="imx8mn-beacon-kit.dtb"
>  CONFIG_ARCH_MISC_INIT=y
>  CONFIG_SPL_MAX_SIZE=0x25000
>  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> -CONFIG_SPL_BSS_START_ADDR=0x95e000
> +CONFIG_SPL_BSS_START_ADDR=0x95
>  CONFIG_SPL_BSS_MAX_SIZE=0x2000
>  CONFIG_SPL_BOARD_INIT=y
>  CONFIG_SPL_BOOTROM_SUPPORT=y
>  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
> -CONFIG_SPL_STACK=0x187ff0
> +CONFIG_SPL_STACK=0x98
>  CONFIG_SYS_SPL_MALLOC=y
>  CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y
>  CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x4220
> diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig
> index cc1583524b..0793db0bd6 100644
> --- a/configs/imx8mn_beacon_defconfig
> +++ b/configs/imx8mn_beacon_defconfig
> @@ -15,10 +15,9 @@ CONFIG_TARGET_IMX8MN_BEACON=y
>  CONFIG_SYS_PROMPT="u-boot=> "
>  CONFIG_SPL_SERIAL=y
>  CONFIG_SPL_DRIVERS_MISC=y
> -CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
>  CONFIG_SPL=y
>  CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
> -CONFIG_SYS_LOAD_ADDR=0x4048
> +CONFIG_SYS_LOAD_ADDR=0x4200
>  CONFIG_SYS_MEMTEST_START=0x4000
>  CONFIG_SYS_MEMTEST_END=0x4400
>  CONFIG_LTO=y
> @@ -34,12 +33,12 @@ CONFIG_DEFAULT_FDT_FILE="imx8mn-beacon-kit.dtb"
>  CONFIG_ARCH_MISC_INIT=y
>  CONFIG_SPL_MAX_SIZE=0x25000
>  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> -CONFIG_SPL_BSS_START_ADDR=0x95e000
> +CONFIG_SPL_BSS_START_ADDR=0x95
>  CONFIG_SPL_BSS_MAX_SIZE=0x2000
>  CONFIG_SPL_BOARD_INIT=y
>  CONFIG_SPL_BOOTROM_SUPPORT=y
>  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
> -CONFIG_SPL_STACK=0x187ff0
> +CONFIG_SPL_STACK=0x98
>  CONFIG_SYS_SPL_MALLOC=y
>  CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y
>  CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x4220
> diff --git a/configs/imx8mn_beacon_fspi_defconfig 
> b/configs/imx8mn_beacon_fspi_defconfig
> index ecaefd8930..6da2182eb3 100644
> --- a/configs/imx8mn_beacon_fspi_defconfig
> +++ b/configs/imx8mn_beacon_fspi_defconfig
> @@ -14,10 +14,9 @@ CONFIG_SPL_TEXT_BASE=0x912000
>  CONFIG_TARGET_IMX8MN_BEACON=y
>  CONFIG_SPL_SERIAL=y
>  CONFIG_SPL_DRIVERS_MISC=y
> -CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
>  CONFIG_SPL=y
>  CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
> -CONFIG_SYS_LOAD_ADDR=0x4048
> +CONFIG_SYS_LOAD_ADDR=0x4200
>  CONFIG_SYS_MEMTEST_START=0x4000
>  CONFIG_SYS_MEMTEST_END=0x4400
>  CONFIG_LTO=y
> @@ -33,12 +32,12 @@ CONFIG_DEFAULT_FDT_FILE="imx8mn-beacon-kit.dtb"
>  CONFIG_ARCH_MISC_INIT=y
>  CONFIG_SPL_MAX_SIZE=0x25000
>  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> -CONFIG_SPL_BSS_START_ADDR=0x95e000
> +CONFIG_SPL_BSS_START_ADDR=0x95
>  CONFIG_SPL_BSS_MAX_SIZE=0x2000
>  CONFIG_SPL_BOARD_INIT=y
>  CONFIG_SPL_BOOTROM_SUPPORT=y
>  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
> -CONFIG_SPL_STACK=0x187ff0
> +CONFIG_SPL_STACK=0x98
>  CONFIG_SYS_SPL_MALLOC=y
>  CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y
>  CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x4220
> diff --git a/include/configs/imx8mn_beacon.h b/include/configs/imx8mn_beacon.h
> index 6faecbde77..930b11b75e 100644
> --- a/include/configs/imx8mn_beacon.h
> +++ b/include/configs/imx8mn_beacon.h
> @@ -13,14 +13,6 @@
>  #define CONFIG_SYS_UBOOT_BASE  \
> (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
>
> -#ifdef CONFIG_SPL_BUILD
> -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
> -#define CONFIG_MALLOC_F_ADDR   0x184000
> -
> -/* For RAW image gives a error info not panic */
> -
> -#endif /* CONFIG_SPL_BUILD */
> -
>  /* Initial environment variables */
>  #define CONFIG_EXTRA_ENV_SETTINGS  \
> "script=boot.scr\0" \
> --
> 2.34.1
>

Adam,

Have you evaluated getting rid of CONFIG_MALLOC_F_ADDR from the
various imx8mm 

Re: [PATCH 1/3] imx: imx8mm_beacon: Eliminate a few extras to free up SPL space

2022-10-24 Thread Tim Harvey
On Mon, Oct 24, 2022 at 1:52 PM Adam Ford  wrote:
>
> On Mon, Oct 24, 2022 at 3:47 PM Tim Harvey  wrote:
> >
> > On Mon, Oct 24, 2022 at 1:26 PM Adam Ford  wrote:
> > >
> > > On Mon, Oct 24, 2022 at 2:57 PM Tim Harvey  wrote:
> > > >
> > > > On Sat, Oct 22, 2022 at 7:28 AM Adam Ford  wrote:
> > > > >
> > > > > There are a few functions which are not essential for use in
> > > > > SPL, but they take up enough space to make other preferred
> > > > > features not fit.  Remove the extras.
> > > > >
> > > > > Signed-off-by: Adam Ford 
> > > > >
> > > > > diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c
> > > > > index a93cc93878..b0e9d918da 100644
> > > > > --- a/board/beacon/imx8mm/spl.c
> > > > > +++ b/board/beacon/imx8mm/spl.c
> > > > > @@ -44,11 +44,6 @@ static void spl_dram_init(void)
> > > > > ddr_init(_timing);
> > > > >  }
> > > > >
> > > > > -void spl_board_init(void)
> > > > > -{
> > > > > -   debug("Normal Boot\n");
> > > > > -}
> > > > > -
> > > > >  #ifdef CONFIG_SPL_LOAD_FIT
> > > > >  int board_fit_config_name_match(const char *name)
> > > > >  {
> > > > > diff --git a/configs/imx8mm_beacon_defconfig 
> > > > > b/configs/imx8mm_beacon_defconfig
> > > > > index e37ce01c19..f6a1012d8a 100644
> > > > > --- a/configs/imx8mm_beacon_defconfig
> > > > > +++ b/configs/imx8mm_beacon_defconfig
> > > > > @@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-beacon-kit.dtb"
> > > > >  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> > > > >  CONFIG_SPL_BSS_START_ADDR=0x91
> > > > >  CONFIG_SPL_BSS_MAX_SIZE=0x2000
> > > > > -CONFIG_SPL_BOARD_INIT=y
> > > > >  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
> > > > >  CONFIG_SPL_STACK=0x92
> > > > >  CONFIG_SYS_SPL_MALLOC=y
> > > > > @@ -88,12 +87,9 @@ CONFIG_DM_PCA953X=y
> > > > >  CONFIG_DM_I2C=y
> > > > >  CONFIG_SUPPORT_EMMC_BOOT=y
> > > > >  CONFIG_MMC_IO_VOLTAGE=y
> > > > > -CONFIG_SPL_MMC_IO_VOLTAGE=y
> > > > >  CONFIG_MMC_UHS_SUPPORT=y
> > > > > -CONFIG_SPL_MMC_UHS_SUPPORT=y
> > > > >  CONFIG_MMC_HS400_ES_SUPPORT=y
> > > > >  CONFIG_MMC_HS400_SUPPORT=y
> > > > > -CONFIG_SPL_MMC_HS400_SUPPORT=y
> > > > >  CONFIG_FSL_USDHC=y
> > > > >  CONFIG_MTD=y
> > > > >  CONFIG_DM_MTD=y
> > > > > @@ -113,14 +109,12 @@ CONFIG_PINCTRL_IMX8M=y
> > > > >  CONFIG_POWER_DOMAIN=y
> > > > >  CONFIG_IMX8M_POWER_DOMAIN=y
> > > > >  CONFIG_DM_PMIC=y
> > > > > +# CONFIG_SPL_PMIC_CHILDREN is not set
> > > > >  CONFIG_DM_PMIC_BD71837=y
> > > > >  CONFIG_SPL_DM_PMIC_BD71837=y
> > > > >  CONFIG_DM_REGULATOR=y
> > > > > -CONFIG_SPL_DM_REGULATOR=y
> > > > >  CONFIG_DM_REGULATOR_BD71837=y
> > > > > -CONFIG_SPL_DM_REGULATOR_BD71837=y
> > > > >  CONFIG_DM_REGULATOR_FIXED=y
> > > > > -CONFIG_SPL_DM_REGULATOR_FIXED=y
> > > > >  CONFIG_DM_REGULATOR_GPIO=y
> > > > >  CONFIG_DM_SERIAL=y
> > > > >  CONFIG_MXC_UART=y
> > > > > --
> > > > > 2.34.1
> > > > >
> > > >
> > > > Adam,
> > > >
> > > > I'm looking at your patches as I'm also trying to strip down the
> > > > imx8mm-venice SPL so that I can fit DM USB support. It seems that
> > > > all/most of the imx8m boards have a spl_board_init() which calls
> > > > arch_misc_init(). I'm curious why your not calling that function?
> > >
> > > As of right now, we're not using the CAAM which is initialized in
> > > arch_misc_init.  If/When we do, we'll likely have to pull that in.
> > >
> >
> > ok - makes sense.
> >
> > > >
> > > > Another config that I've found to save a lot of space for imx8m
> > > > without any negative impact I can see is CONFIG_SPL_MMC_TINY=y
> > >
> > > I experimented a bit with that too, but I hadn't fully tested
> > > switching between booting between MMC1 and MMC2, so I wasn't quite
> > > ready to enable it, but I'll spend some more time with it to see how
> > > much more space I can shave off SPL.
> > > Getting rid of the PMIC children in SPL helped me quite a bit.
> >
> > I see. It appears to save about 2K and Fabio's imx8mm clk reduction
> > series that made it in saves another 800 bytes or so.
> >
> > Regardless I'm still oversize for imx8mm-venice by 2K bytes and
> > looking for things to prune. My issue is that I have 4 DRAM configs to
> > support which suck up 3K each I believe.
>
> Can you split the DRAM configs into different _defconfig files so only
> the DRAM config you want is built-in?
>

Yes that would work but I hate adding multiple firmware images. I
already have issues with users selecting the wrong firmware between
imx8mm/n/p as it is.

I'm thinking I should be able to move dram configs to binman blobs
like was recently done with the ddr4 training blobs.

Tim


Re: [PATCH 1/3] imx: imx8mm_beacon: Eliminate a few extras to free up SPL space

2022-10-24 Thread Adam Ford
On Mon, Oct 24, 2022 at 3:47 PM Tim Harvey  wrote:
>
> On Mon, Oct 24, 2022 at 1:26 PM Adam Ford  wrote:
> >
> > On Mon, Oct 24, 2022 at 2:57 PM Tim Harvey  wrote:
> > >
> > > On Sat, Oct 22, 2022 at 7:28 AM Adam Ford  wrote:
> > > >
> > > > There are a few functions which are not essential for use in
> > > > SPL, but they take up enough space to make other preferred
> > > > features not fit.  Remove the extras.
> > > >
> > > > Signed-off-by: Adam Ford 
> > > >
> > > > diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c
> > > > index a93cc93878..b0e9d918da 100644
> > > > --- a/board/beacon/imx8mm/spl.c
> > > > +++ b/board/beacon/imx8mm/spl.c
> > > > @@ -44,11 +44,6 @@ static void spl_dram_init(void)
> > > > ddr_init(_timing);
> > > >  }
> > > >
> > > > -void spl_board_init(void)
> > > > -{
> > > > -   debug("Normal Boot\n");
> > > > -}
> > > > -
> > > >  #ifdef CONFIG_SPL_LOAD_FIT
> > > >  int board_fit_config_name_match(const char *name)
> > > >  {
> > > > diff --git a/configs/imx8mm_beacon_defconfig 
> > > > b/configs/imx8mm_beacon_defconfig
> > > > index e37ce01c19..f6a1012d8a 100644
> > > > --- a/configs/imx8mm_beacon_defconfig
> > > > +++ b/configs/imx8mm_beacon_defconfig
> > > > @@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-beacon-kit.dtb"
> > > >  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> > > >  CONFIG_SPL_BSS_START_ADDR=0x91
> > > >  CONFIG_SPL_BSS_MAX_SIZE=0x2000
> > > > -CONFIG_SPL_BOARD_INIT=y
> > > >  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
> > > >  CONFIG_SPL_STACK=0x92
> > > >  CONFIG_SYS_SPL_MALLOC=y
> > > > @@ -88,12 +87,9 @@ CONFIG_DM_PCA953X=y
> > > >  CONFIG_DM_I2C=y
> > > >  CONFIG_SUPPORT_EMMC_BOOT=y
> > > >  CONFIG_MMC_IO_VOLTAGE=y
> > > > -CONFIG_SPL_MMC_IO_VOLTAGE=y
> > > >  CONFIG_MMC_UHS_SUPPORT=y
> > > > -CONFIG_SPL_MMC_UHS_SUPPORT=y
> > > >  CONFIG_MMC_HS400_ES_SUPPORT=y
> > > >  CONFIG_MMC_HS400_SUPPORT=y
> > > > -CONFIG_SPL_MMC_HS400_SUPPORT=y
> > > >  CONFIG_FSL_USDHC=y
> > > >  CONFIG_MTD=y
> > > >  CONFIG_DM_MTD=y
> > > > @@ -113,14 +109,12 @@ CONFIG_PINCTRL_IMX8M=y
> > > >  CONFIG_POWER_DOMAIN=y
> > > >  CONFIG_IMX8M_POWER_DOMAIN=y
> > > >  CONFIG_DM_PMIC=y
> > > > +# CONFIG_SPL_PMIC_CHILDREN is not set
> > > >  CONFIG_DM_PMIC_BD71837=y
> > > >  CONFIG_SPL_DM_PMIC_BD71837=y
> > > >  CONFIG_DM_REGULATOR=y
> > > > -CONFIG_SPL_DM_REGULATOR=y
> > > >  CONFIG_DM_REGULATOR_BD71837=y
> > > > -CONFIG_SPL_DM_REGULATOR_BD71837=y
> > > >  CONFIG_DM_REGULATOR_FIXED=y
> > > > -CONFIG_SPL_DM_REGULATOR_FIXED=y
> > > >  CONFIG_DM_REGULATOR_GPIO=y
> > > >  CONFIG_DM_SERIAL=y
> > > >  CONFIG_MXC_UART=y
> > > > --
> > > > 2.34.1
> > > >
> > >
> > > Adam,
> > >
> > > I'm looking at your patches as I'm also trying to strip down the
> > > imx8mm-venice SPL so that I can fit DM USB support. It seems that
> > > all/most of the imx8m boards have a spl_board_init() which calls
> > > arch_misc_init(). I'm curious why your not calling that function?
> >
> > As of right now, we're not using the CAAM which is initialized in
> > arch_misc_init.  If/When we do, we'll likely have to pull that in.
> >
>
> ok - makes sense.
>
> > >
> > > Another config that I've found to save a lot of space for imx8m
> > > without any negative impact I can see is CONFIG_SPL_MMC_TINY=y
> >
> > I experimented a bit with that too, but I hadn't fully tested
> > switching between booting between MMC1 and MMC2, so I wasn't quite
> > ready to enable it, but I'll spend some more time with it to see how
> > much more space I can shave off SPL.
> > Getting rid of the PMIC children in SPL helped me quite a bit.
>
> I see. It appears to save about 2K and Fabio's imx8mm clk reduction
> series that made it in saves another 800 bytes or so.
>
> Regardless I'm still oversize for imx8mm-venice by 2K bytes and
> looking for things to prune. My issue is that I have 4 DRAM configs to
> support which suck up 3K each I believe.

Can you split the DRAM configs into different _defconfig files so only
the DRAM config you want is built-in?

adam
>
> Tim


Re: [PATCH v3 11/19] imx: kontron-sl-mx8mm: Remove 100mt DDR setpoint

2022-10-24 Thread Tim Harvey
On Mon, Oct 24, 2022 at 4:54 AM Frieder Schrempf
 wrote:
>
> Hi Tim,
>
> On 21.10.22 21:24, Tim Harvey wrote:
> > On Wed, Aug 24, 2022 at 7:01 AM Frieder Schrempf  wrote:
> >>
> >> From: Frieder Schrempf 
> >>
> >> The new stable configuration is missing the 100mt setpoint, remove
> >> it before updating the config to make sure the changes are separated
> >> cleanly.
> >>
> >> Signed-off-by: Frieder Schrempf 
> >> Reviewed-by: Fabio Estevam 
> >> ---
> >
> > Frieder,
> >
> > I just noticed this patch and was curious what it was about.
> >
> > What do you mean by 'the new stable configuration is missing the 100mt
> > setpoint'? Does this refer to something NXP has changed in their DDR
> > config tools?
>
> At some point we started using 4GB LPDDR4 chips from Nanya on our SoMs
> while before we only had Micron chips. For some unknown reason (NXP
> couldn't explain it either), the only configuration that works for all
> used chips (Micron and Nanya) is only stable if the lowest of the three
> frequency setpoints is removed.
>
> Unfortunately I have no idea how this behavior could be explained.
>

Frieder,

Ok - thanks for the explanation. I'm looking for ways to reduce the
SPL impact of DRAM configs as I have 4 of them for imx8mm-venice that
are keeping me from adding SDP support due to SPL size.

I wonder if binman and linker labels could be used to load dram configs.

Best Regards,

Tim


Re: [PATCH] efi_loader: Let networking support depend on NETDEVICES

2022-10-24 Thread Heinrich Schuchardt

On 10/15/22 08:31, Heinrich Schuchardt wrote:

On 10/14/22 18:10, Jan Kiszka wrote:

From: Jan Kiszka 

CONFIG_NET does not imply that there are actually network devices
available, only CONFIG_NETDEVICES does. Changing to this dependenc

CONFIG_NETDEVICES=y does not imply that any network driver is selected
it is just a tighter prerequisite than CONFIG_NET.


obsoletes the check in Kconfig because NETDEVICES means DM_ETH.

Suggested-by: Tom Rini 
Signed-off-by: Jan Kiszka 


Thanks for the patch.

It is good to get rid of the dependency for CONFIG_EFI_LOADER.

Reviewed-by: Heinrich Schuchardt 


For LicheePi_Zero_defconfig this patch results in:

arm-linux-gnueabi-ld.bfd: net/bootp.o: in function `dhcp_handler':
net/bootp.c:1080: undefined reference to `efi_net_set_dhcp_ack'

I guess we should add:

diff --git a/net/bootp.c b/net/bootp.c
index b260d5d09e..6c01e38153 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -1077,7 +1077,9 @@ static void dhcp_handler(uchar *pkt, unsigned
dest, struct in_addr sip,
strlen(CONFIG_SYS_BOOTFILE_PREFIX)) == 0) {
 #endif /* CONFIG_SYS_BOOTFILE_PREFIX */
dhcp_packet_process_options(bp);
-   efi_net_set_dhcp_ack(pkt, len);
+   if (CONFIG_IS_ENABLED(EFI_LOADER) &&
+   CONFIG_IS_ENABLED(NET_DEVICES))
+   efi_net_set_dhcp_ack(pkt, len);

As this was already incorrect before your patch:

Fixes: 0efe1bcf5c2c ("efi_loader: Add network access support")

Best regards

Heinrich


Re: [PATCH 1/3] imx: imx8mm_beacon: Eliminate a few extras to free up SPL space

2022-10-24 Thread Tim Harvey
On Mon, Oct 24, 2022 at 1:26 PM Adam Ford  wrote:
>
> On Mon, Oct 24, 2022 at 2:57 PM Tim Harvey  wrote:
> >
> > On Sat, Oct 22, 2022 at 7:28 AM Adam Ford  wrote:
> > >
> > > There are a few functions which are not essential for use in
> > > SPL, but they take up enough space to make other preferred
> > > features not fit.  Remove the extras.
> > >
> > > Signed-off-by: Adam Ford 
> > >
> > > diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c
> > > index a93cc93878..b0e9d918da 100644
> > > --- a/board/beacon/imx8mm/spl.c
> > > +++ b/board/beacon/imx8mm/spl.c
> > > @@ -44,11 +44,6 @@ static void spl_dram_init(void)
> > > ddr_init(_timing);
> > >  }
> > >
> > > -void spl_board_init(void)
> > > -{
> > > -   debug("Normal Boot\n");
> > > -}
> > > -
> > >  #ifdef CONFIG_SPL_LOAD_FIT
> > >  int board_fit_config_name_match(const char *name)
> > >  {
> > > diff --git a/configs/imx8mm_beacon_defconfig 
> > > b/configs/imx8mm_beacon_defconfig
> > > index e37ce01c19..f6a1012d8a 100644
> > > --- a/configs/imx8mm_beacon_defconfig
> > > +++ b/configs/imx8mm_beacon_defconfig
> > > @@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-beacon-kit.dtb"
> > >  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> > >  CONFIG_SPL_BSS_START_ADDR=0x91
> > >  CONFIG_SPL_BSS_MAX_SIZE=0x2000
> > > -CONFIG_SPL_BOARD_INIT=y
> > >  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
> > >  CONFIG_SPL_STACK=0x92
> > >  CONFIG_SYS_SPL_MALLOC=y
> > > @@ -88,12 +87,9 @@ CONFIG_DM_PCA953X=y
> > >  CONFIG_DM_I2C=y
> > >  CONFIG_SUPPORT_EMMC_BOOT=y
> > >  CONFIG_MMC_IO_VOLTAGE=y
> > > -CONFIG_SPL_MMC_IO_VOLTAGE=y
> > >  CONFIG_MMC_UHS_SUPPORT=y
> > > -CONFIG_SPL_MMC_UHS_SUPPORT=y
> > >  CONFIG_MMC_HS400_ES_SUPPORT=y
> > >  CONFIG_MMC_HS400_SUPPORT=y
> > > -CONFIG_SPL_MMC_HS400_SUPPORT=y
> > >  CONFIG_FSL_USDHC=y
> > >  CONFIG_MTD=y
> > >  CONFIG_DM_MTD=y
> > > @@ -113,14 +109,12 @@ CONFIG_PINCTRL_IMX8M=y
> > >  CONFIG_POWER_DOMAIN=y
> > >  CONFIG_IMX8M_POWER_DOMAIN=y
> > >  CONFIG_DM_PMIC=y
> > > +# CONFIG_SPL_PMIC_CHILDREN is not set
> > >  CONFIG_DM_PMIC_BD71837=y
> > >  CONFIG_SPL_DM_PMIC_BD71837=y
> > >  CONFIG_DM_REGULATOR=y
> > > -CONFIG_SPL_DM_REGULATOR=y
> > >  CONFIG_DM_REGULATOR_BD71837=y
> > > -CONFIG_SPL_DM_REGULATOR_BD71837=y
> > >  CONFIG_DM_REGULATOR_FIXED=y
> > > -CONFIG_SPL_DM_REGULATOR_FIXED=y
> > >  CONFIG_DM_REGULATOR_GPIO=y
> > >  CONFIG_DM_SERIAL=y
> > >  CONFIG_MXC_UART=y
> > > --
> > > 2.34.1
> > >
> >
> > Adam,
> >
> > I'm looking at your patches as I'm also trying to strip down the
> > imx8mm-venice SPL so that I can fit DM USB support. It seems that
> > all/most of the imx8m boards have a spl_board_init() which calls
> > arch_misc_init(). I'm curious why your not calling that function?
>
> As of right now, we're not using the CAAM which is initialized in
> arch_misc_init.  If/When we do, we'll likely have to pull that in.
>

ok - makes sense.

> >
> > Another config that I've found to save a lot of space for imx8m
> > without any negative impact I can see is CONFIG_SPL_MMC_TINY=y
>
> I experimented a bit with that too, but I hadn't fully tested
> switching between booting between MMC1 and MMC2, so I wasn't quite
> ready to enable it, but I'll spend some more time with it to see how
> much more space I can shave off SPL.
> Getting rid of the PMIC children in SPL helped me quite a bit.

I see. It appears to save about 2K and Fabio's imx8mm clk reduction
series that made it in saves another 800 bytes or so.

Regardless I'm still oversize for imx8mm-venice by 2K bytes and
looking for things to prune. My issue is that I have 4 DRAM configs to
support which suck up 3K each I believe.

Tim


Re: [PATCH 1/3] imx: imx8mm_beacon: Eliminate a few extras to free up SPL space

2022-10-24 Thread Adam Ford
On Mon, Oct 24, 2022 at 2:57 PM Tim Harvey  wrote:
>
> On Sat, Oct 22, 2022 at 7:28 AM Adam Ford  wrote:
> >
> > There are a few functions which are not essential for use in
> > SPL, but they take up enough space to make other preferred
> > features not fit.  Remove the extras.
> >
> > Signed-off-by: Adam Ford 
> >
> > diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c
> > index a93cc93878..b0e9d918da 100644
> > --- a/board/beacon/imx8mm/spl.c
> > +++ b/board/beacon/imx8mm/spl.c
> > @@ -44,11 +44,6 @@ static void spl_dram_init(void)
> > ddr_init(_timing);
> >  }
> >
> > -void spl_board_init(void)
> > -{
> > -   debug("Normal Boot\n");
> > -}
> > -
> >  #ifdef CONFIG_SPL_LOAD_FIT
> >  int board_fit_config_name_match(const char *name)
> >  {
> > diff --git a/configs/imx8mm_beacon_defconfig 
> > b/configs/imx8mm_beacon_defconfig
> > index e37ce01c19..f6a1012d8a 100644
> > --- a/configs/imx8mm_beacon_defconfig
> > +++ b/configs/imx8mm_beacon_defconfig
> > @@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-beacon-kit.dtb"
> >  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> >  CONFIG_SPL_BSS_START_ADDR=0x91
> >  CONFIG_SPL_BSS_MAX_SIZE=0x2000
> > -CONFIG_SPL_BOARD_INIT=y
> >  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
> >  CONFIG_SPL_STACK=0x92
> >  CONFIG_SYS_SPL_MALLOC=y
> > @@ -88,12 +87,9 @@ CONFIG_DM_PCA953X=y
> >  CONFIG_DM_I2C=y
> >  CONFIG_SUPPORT_EMMC_BOOT=y
> >  CONFIG_MMC_IO_VOLTAGE=y
> > -CONFIG_SPL_MMC_IO_VOLTAGE=y
> >  CONFIG_MMC_UHS_SUPPORT=y
> > -CONFIG_SPL_MMC_UHS_SUPPORT=y
> >  CONFIG_MMC_HS400_ES_SUPPORT=y
> >  CONFIG_MMC_HS400_SUPPORT=y
> > -CONFIG_SPL_MMC_HS400_SUPPORT=y
> >  CONFIG_FSL_USDHC=y
> >  CONFIG_MTD=y
> >  CONFIG_DM_MTD=y
> > @@ -113,14 +109,12 @@ CONFIG_PINCTRL_IMX8M=y
> >  CONFIG_POWER_DOMAIN=y
> >  CONFIG_IMX8M_POWER_DOMAIN=y
> >  CONFIG_DM_PMIC=y
> > +# CONFIG_SPL_PMIC_CHILDREN is not set
> >  CONFIG_DM_PMIC_BD71837=y
> >  CONFIG_SPL_DM_PMIC_BD71837=y
> >  CONFIG_DM_REGULATOR=y
> > -CONFIG_SPL_DM_REGULATOR=y
> >  CONFIG_DM_REGULATOR_BD71837=y
> > -CONFIG_SPL_DM_REGULATOR_BD71837=y
> >  CONFIG_DM_REGULATOR_FIXED=y
> > -CONFIG_SPL_DM_REGULATOR_FIXED=y
> >  CONFIG_DM_REGULATOR_GPIO=y
> >  CONFIG_DM_SERIAL=y
> >  CONFIG_MXC_UART=y
> > --
> > 2.34.1
> >
>
> Adam,
>
> I'm looking at your patches as I'm also trying to strip down the
> imx8mm-venice SPL so that I can fit DM USB support. It seems that
> all/most of the imx8m boards have a spl_board_init() which calls
> arch_misc_init(). I'm curious why your not calling that function?

As of right now, we're not using the CAAM which is initialized in
arch_misc_init.  If/When we do, we'll likely have to pull that in.

>
> Another config that I've found to save a lot of space for imx8m
> without any negative impact I can see is CONFIG_SPL_MMC_TINY=y

I experimented a bit with that too, but I hadn't fully tested
switching between booting between MMC1 and MMC2, so I wasn't quite
ready to enable it, but I'll spend some more time with it to see how
much more space I can shave off SPL.
Getting rid of the PMIC children in SPL helped me quite a bit.

thanks!

adam

>
> Best Regards,
>
> Tim


Re: [PATCH v3 0/8] arm: dts: imx: sync device trees with upstream linux kernel part 1

2022-10-24 Thread Tim Harvey
On Sat, Oct 22, 2022 at 2:48 PM Marcel Ziswiler  wrote:
>
> From: Marcel Ziswiler 
>
>
> This series synchronises them imx device trees with the upstream Linux
> kernel (v6.0-rc1). I split it into two parts. This is part 1.
>
> It also fixes a few issues as discussed during/after the pre-mature
> application of my first series [1].
>
> I am not touching kontron-sl-mx6ul as Frieder already took care of those
> [2].
>
> Feedback welcome. Thanks!
>
> [1] 
> https://patchwork.ozlabs.org/project/uboot/cover/20220721132748.1052244-1-mar...@ziswiler.com/
> [2] 
> https://patchwork.ozlabs.org/project/uboot/cover/20220823142917.306176-1-frie...@fris.de/
>
> Changes in v3:
> - Incorporate feedback from Jesse.
>
> Changes in v2:
> - imxrt1050: Re-added DDR timings aka semc node as pointed out by Fabio. 
> Thanks!
> - imx8ulp: Re-added s400_mu device tree node.
>
> Marcel Ziswiler (8):
>   vf610: synchronise device tree with linux
>   imxrt1020: fix lpuart issue in common u-boot device tree
>   imxrt1050: synchronise device tree with linux
>   imx8ulp: synchronise device tree with linux
>   imx8mq: synchronise device tree with linux
>   imx8mp: synchronise device tree with linux
>   imx8mn: synchronise device tree with linux
>   imx8mm: synchronise device tree with linux
>

Marcel and Stefano,

It looks like the imx8mp/imx8mn/imx8mm patches in this series need a
rebase. Were we hoping to get this into this release?

I'm also wondering if you are doing a refresh if you could take it
from 6.0 release dts or 6.1-rc2? I've got a few patches I haven't
submitted yet that touch dts waiting for this series to land as they
will collide.

Best Regards,

Tim


Re: [PATCH 1/3] imx: imx8mm_beacon: Eliminate a few extras to free up SPL space

2022-10-24 Thread Tim Harvey
On Sat, Oct 22, 2022 at 7:28 AM Adam Ford  wrote:
>
> There are a few functions which are not essential for use in
> SPL, but they take up enough space to make other preferred
> features not fit.  Remove the extras.
>
> Signed-off-by: Adam Ford 
>
> diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c
> index a93cc93878..b0e9d918da 100644
> --- a/board/beacon/imx8mm/spl.c
> +++ b/board/beacon/imx8mm/spl.c
> @@ -44,11 +44,6 @@ static void spl_dram_init(void)
> ddr_init(_timing);
>  }
>
> -void spl_board_init(void)
> -{
> -   debug("Normal Boot\n");
> -}
> -
>  #ifdef CONFIG_SPL_LOAD_FIT
>  int board_fit_config_name_match(const char *name)
>  {
> diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
> index e37ce01c19..f6a1012d8a 100644
> --- a/configs/imx8mm_beacon_defconfig
> +++ b/configs/imx8mm_beacon_defconfig
> @@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-beacon-kit.dtb"
>  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>  CONFIG_SPL_BSS_START_ADDR=0x91
>  CONFIG_SPL_BSS_MAX_SIZE=0x2000
> -CONFIG_SPL_BOARD_INIT=y
>  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
>  CONFIG_SPL_STACK=0x92
>  CONFIG_SYS_SPL_MALLOC=y
> @@ -88,12 +87,9 @@ CONFIG_DM_PCA953X=y
>  CONFIG_DM_I2C=y
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_MMC_IO_VOLTAGE=y
> -CONFIG_SPL_MMC_IO_VOLTAGE=y
>  CONFIG_MMC_UHS_SUPPORT=y
> -CONFIG_SPL_MMC_UHS_SUPPORT=y
>  CONFIG_MMC_HS400_ES_SUPPORT=y
>  CONFIG_MMC_HS400_SUPPORT=y
> -CONFIG_SPL_MMC_HS400_SUPPORT=y
>  CONFIG_FSL_USDHC=y
>  CONFIG_MTD=y
>  CONFIG_DM_MTD=y
> @@ -113,14 +109,12 @@ CONFIG_PINCTRL_IMX8M=y
>  CONFIG_POWER_DOMAIN=y
>  CONFIG_IMX8M_POWER_DOMAIN=y
>  CONFIG_DM_PMIC=y
> +# CONFIG_SPL_PMIC_CHILDREN is not set
>  CONFIG_DM_PMIC_BD71837=y
>  CONFIG_SPL_DM_PMIC_BD71837=y
>  CONFIG_DM_REGULATOR=y
> -CONFIG_SPL_DM_REGULATOR=y
>  CONFIG_DM_REGULATOR_BD71837=y
> -CONFIG_SPL_DM_REGULATOR_BD71837=y
>  CONFIG_DM_REGULATOR_FIXED=y
> -CONFIG_SPL_DM_REGULATOR_FIXED=y
>  CONFIG_DM_REGULATOR_GPIO=y
>  CONFIG_DM_SERIAL=y
>  CONFIG_MXC_UART=y
> --
> 2.34.1
>

Adam,

I'm looking at your patches as I'm also trying to strip down the
imx8mm-venice SPL so that I can fit DM USB support. It seems that
all/most of the imx8m boards have a spl_board_init() which calls
arch_misc_init(). I'm curious why your not calling that function?

Another config that I've found to save a lot of space for imx8m
without any negative impact I can see is CONFIG_SPL_MMC_TINY=y

Best Regards,

Tim


Re: [PATCH v3 1/2] x86: fsp: Depend on DM_RTC

2022-10-24 Thread Sean Anderson
On 10/24/22 12:49, Bin Meng wrote:
> On Mon, Oct 24, 2022 at 11:42 PM Sean Anderson  wrote:
>>
>> FSP support requires DM_RTC for rtc_write32. Select it.
>>
>> Fixes: ba65808e7d0 ("x86: fsp: Save stack address to CMOS for next S3 boot")
>> Signed-off-by: Sean Anderson 
>> ---
>> This seems like it would never have worked. Does fsp_save_s3_stack even
> 
> This was working before. Did you test it on x86 that now it is broken?

Well, if it never got called in SPL it would never have failed.

Here is the error I was getting with the next patch applied:

../arch/x86/lib/fsp/fsp_common.c: In function ‘fsp_save_s3_stack’:
../arch/x86/lib/fsp/fsp_common.c:79:20: warning: passing argument 1 of 
‘rtc_write32’ makes integer from pointer without a cast [-Wint-conversion]
   79 |  ret = rtc_write32(dev, CMOS_FSP_STACK_ADDR, gd->start_addr_sp);
  |^~~
  ||
  |struct udevice *
In file included from ../arch/x86/lib/fsp/fsp_common.c:12:
../include/rtc.h:288:22: note: expected ‘int’ but argument is of type ‘struct 
udevice *’
  288 | void rtc_write32(int reg, u32 value);
  |  ^~~
../arch/x86/lib/fsp/fsp_common.c:79:8: error: too many arguments to function 
‘rtc_write32’
   79 |  ret = rtc_write32(dev, CMOS_FSP_STACK_ADDR, gd->start_addr_sp);
  |^~~
In file included from ../arch/x86/lib/fsp/fsp_common.c:12:
../include/rtc.h:288:6: note: declared here
  288 | void rtc_write32(int reg, u32 value);
  |  ^~~
../arch/x86/lib/fsp/fsp_common.c:79:6: error: void value not ignored as it 
ought to be
   79 |  ret = rtc_write32(dev, CMOS_FSP_STACK_ADDR, gd->start_addr_sp);
  |  ^
make[4]: *** [../scripts/Makefile.build:257: spl/arch/x86/lib/fsp/fsp_common.o] 
Error 1
make[3]: *** [../scripts/Makefile.build:398: spl/arch/x86/lib/fsp] Error 2
make[2]: *** [../scripts/Makefile.spl:531: spl/arch/x86/lib] Error 2

You can see that the file is using the dm version of rtc_write32, but
SPL_DM_RTC is not enabled. This was not caught before because the dm
version of rtc_write32 was always declared when DM_RTC was enabled, even
if SPL_DM_RTC was disabled. But of course, if you pass a pointer to non-dm
rtc_write32, it will break.

So maybe the best solution here is to add a third patch converting FSP to
use dm_rtc_write, and then remove the selects. That way we can just get an
error if DM_RTC is disabled, instead of potentially writing to random registers.

--Sean

> +Stefan
> 
>> get called in SPL? Maybe it should be converted to use dm_rtc_write
>> instead.
>>
>> Changes in v3:
>> - New
>>
>>  arch/x86/Kconfig | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
>> index 7cbfd6c9720..ed8216d9ad0 100644
>> --- a/arch/x86/Kconfig
>> +++ b/arch/x86/Kconfig
>> @@ -362,6 +362,8 @@ config HAVE_FSP
>> depends on !EFI
>> select USE_HOB
>> select HAS_ROM
>> +   select DM_RTC
>> +   select SPL_DM_RTC
>> help
>>   Select this option to add an Firmware Support Package binary to
>>   the resulting U-Boot image. It is a binary blob which U-Boot uses
>> --
> 
> Regards,
> Bin



Re: [PATCH v3 1/2] x86: fsp: Depend on DM_RTC

2022-10-24 Thread Bin Meng
On Mon, Oct 24, 2022 at 11:42 PM Sean Anderson  wrote:
>
> FSP support requires DM_RTC for rtc_write32. Select it.
>
> Fixes: ba65808e7d0 ("x86: fsp: Save stack address to CMOS for next S3 boot")
> Signed-off-by: Sean Anderson 
> ---
> This seems like it would never have worked. Does fsp_save_s3_stack even

This was working before. Did you test it on x86 that now it is broken?

+Stefan

> get called in SPL? Maybe it should be converted to use dm_rtc_write
> instead.
>
> Changes in v3:
> - New
>
>  arch/x86/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 7cbfd6c9720..ed8216d9ad0 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -362,6 +362,8 @@ config HAVE_FSP
> depends on !EFI
> select USE_HOB
> select HAS_ROM
> +   select DM_RTC
> +   select SPL_DM_RTC
> help
>   Select this option to add an Firmware Support Package binary to
>   the resulting U-Boot image. It is a binary blob which U-Boot uses
> --

Regards,
Bin


Re: [PATCH v2 15/16] tbs2910: revert prepare to synchronise device trees with linux

2022-10-24 Thread Marcel Ziswiler
@Sören: Thanks!

@Stefano: Somehow I missed the applied-to email for this one.

On Mon, 2022-10-24 at 11:02 +0200, Sören Moch wrote:
> On 22.10.22 23:59, Marcel Ziswiler wrote:
> > From: Marcel Ziswiler 
> > 
> > Now with all synchonised revert
> > "tbs2910: prepare to synchronise device trees with linux".
> > 
> > This reverts commit 50b229523bbc5511e1bace34df779f84950bf872.
> > 
> > Signed-off-by: Marcel Ziswiler 
> Acked-by: Soeren Moch 
> > ---
> > 
> > (no changes since v1)
> > 
> >   arch/arm/dts/imx6q-tbs2910-u-boot.dtsi | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/dts/imx6q-tbs2910-u-boot.dtsi 
> > b/arch/arm/dts/imx6q-tbs2910-u-boot.dtsi
> > index d48719e7d5..65ab052ac2 100644
> > --- a/arch/arm/dts/imx6q-tbs2910-u-boot.dtsi
> > +++ b/arch/arm/dts/imx6q-tbs2910-u-boot.dtsi
> > @@ -1,6 +1,6 @@
> >   // SPDX-License-Identifier: GPL-2.0+
> > 
> > -&{/soc/bus@200} { /* AIPS1 */
> > + {
> > u-boot,dm-pre-reloc;
> >   };
> > 
> > @@ -8,7 +8,7 @@
> > u-boot,dm-pre-reloc;
> >   };
> > 
> > -&{/soc} {
> > + {
> > u-boot,dm-pre-reloc;
> >   };


[PATCH v3 0/2] rtc: Add fallbacks for dm functions

2022-10-24 Thread Sean Anderson
This adds some fallbacks for DM RTC consumers, so they don't have to
ifdef out their RTC code.

There's some funkiness going on with FSP on x86, but I don't know what
the correct behavior is. See patch 1 for details.

Changes in v3:
- Select SPL_DM_RTC for HAVE_FSP. Before this series, even if just
  DM_RTC was selected, the DM RTC functions would be forward-declared.
  This probably would result in funky things at runtime.

Changes in v2:
- Include linux/errno.h for ENOSYS. This is needed for some mips boards
  when CONFIG_BLK is enabled for whatever reason.

Sean Anderson (2):
  x86: fsp: Depend on DM_RTC
  rtc: Add fallbacks for dm functions

 arch/x86/Kconfig |  2 ++
 include/rtc.h| 32 +---
 2 files changed, 31 insertions(+), 3 deletions(-)

-- 
2.35.1.1320.gc452695387.dirty



[PATCH v3 2/2] rtc: Add fallbacks for dm functions

2022-10-24 Thread Sean Anderson
This adds fallbacks for the various dm_rtc_* functions. This allows
common code to use these functions without ifdefs.

Fixes: c8ce7ba87d1 ("misc: Add support for nvmem cells")
Reviewed-by: Simon Glass 
Signed-off-by: Sean Anderson 
---

(no changes since v2)

Changes in v2:
- Include linux/errno.h for ENOSYS. This is needed for some mips boards
  when CONFIG_BLK is enabled for whatever reason.

 include/rtc.h | 32 +---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/include/rtc.h b/include/rtc.h
index 10104e3bf5a..b6fdbb60dc2 100644
--- a/include/rtc.h
+++ b/include/rtc.h
@@ -15,13 +15,12 @@
 
 #include 
 #include 
+#include 
 
 typedef int64_t time64_t;
-
-#ifdef CONFIG_DM_RTC
-
 struct udevice;
 
+#if CONFIG_IS_ENABLED(DM_RTC)
 struct rtc_ops {
/**
 * get() - get the current time
@@ -222,6 +221,33 @@ int rtc_enable_32khz_output(int busnum, int chip_addr);
 #endif
 
 #else
+static inline int dm_rtc_get(struct udevice *dev, struct rtc_time *time)
+{
+   return -ENOSYS;
+}
+
+static inline int dm_rtc_set(struct udevice *dev, struct rtc_time *time)
+{
+   return -ENOSYS;
+}
+
+static inline int dm_rtc_reset(struct udevice *dev)
+{
+   return -ENOSYS;
+}
+
+static inline int dm_rtc_read(struct udevice *dev, unsigned int reg, u8 *buf,
+ unsigned int len)
+{
+   return -ENOSYS;
+}
+
+static inline int dm_rtc_write(struct udevice *dev, unsigned int reg,
+  const u8 *buf, unsigned int len)
+{
+   return -ENOSYS;
+}
+
 int rtc_get (struct rtc_time *);
 int rtc_set (struct rtc_time *);
 void rtc_reset (void);
-- 
2.35.1.1320.gc452695387.dirty



[PATCH v3 1/2] x86: fsp: Depend on DM_RTC

2022-10-24 Thread Sean Anderson
FSP support requires DM_RTC for rtc_write32. Select it.

Fixes: ba65808e7d0 ("x86: fsp: Save stack address to CMOS for next S3 boot")
Signed-off-by: Sean Anderson 
---
This seems like it would never have worked. Does fsp_save_s3_stack even
get called in SPL? Maybe it should be converted to use dm_rtc_write
instead.

Changes in v3:
- New

 arch/x86/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7cbfd6c9720..ed8216d9ad0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -362,6 +362,8 @@ config HAVE_FSP
depends on !EFI
select USE_HOB
select HAS_ROM
+   select DM_RTC
+   select SPL_DM_RTC
help
  Select this option to add an Firmware Support Package binary to
  the resulting U-Boot image. It is a binary blob which U-Boot uses
-- 
2.35.1.1320.gc452695387.dirty



Re: [PATCH v3 7/8] imx8mn: synchronise device tree with linux

2022-10-24 Thread Adam Ford
On Sat, Oct 22, 2022 at 4:44 PM Marcel Ziswiler  wrote:
>
> From: Marcel Ziswiler 
>
> Synchronise device tree with linux v6.0-rc1.
>
> Signed-off-by: Marcel Ziswiler 
> ---

This might collide with [1]. Since the series I pushed unifies the 8mn
devices with common -u-boot.dtsi file.  It shows it's awaiting
upstream.

adam

[1] - 
https://patchwork.ozlabs.org/project/uboot/list/?series=324057=%2A=both


>
> (no changes since v1)
>
>  arch/arm/dts/imx8mn-beacon-baseboard.dtsi |  4 +-
>  arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi|  2 +-
>  .../dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi  |  2 +-
>  arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi  |  2 +-
>  arch/arm/dts/imx8mn-evk.dtsi  | 45 ++-
>  .../dts/imx8mn-var-som-symphony-u-boot.dtsi   |  2 +-
>  arch/arm/dts/imx8mn-var-som-symphony.dts  |  6 +--
>  arch/arm/dts/imx8mn-venice-gw7902.dts |  8 ++--
>  arch/arm/dts/imx8mn-venice-u-boot.dtsi|  2 +-
>  arch/arm/dts/imx8mn.dtsi  | 13 +++---
>  include/dt-bindings/interconnect/imx8mn.h | 41 +
>  11 files changed, 106 insertions(+), 21 deletions(-)
>  create mode 100644 include/dt-bindings/interconnect/imx8mn.h
>
> diff --git a/arch/arm/dts/imx8mn-beacon-baseboard.dtsi 
> b/arch/arm/dts/imx8mn-beacon-baseboard.dtsi
> index 02f37dcda7..9e82069c94 100644
> --- a/arch/arm/dts/imx8mn-beacon-baseboard.dtsi
> +++ b/arch/arm/dts/imx8mn-beacon-baseboard.dtsi
> @@ -146,7 +146,7 @@
>  };
>
>   {
> -   fsl,asrc-rate  = <48000>;
> +   fsl,asrc-rate = <48000>;
> status = "okay";
>  };
>
> @@ -182,7 +182,7 @@
>   {
> vbus-supply = <_usb_otg_vbus>;
> disable-over-current;
> -   dr_mode="otg";
> +   dr_mode = "otg";
> status = "okay";
>  };
>
> diff --git a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
> index 0efa6862eb..5e6018c25b 100644
> --- a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
> @@ -15,7 +15,7 @@
> };
>  };
>
> -&{/soc@0} {
> + {
> u-boot,dm-pre-reloc;
> u-boot,dm-spl;
>  };
> diff --git a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi 
> b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
> index c4ae7ca4f3..8312b64bcc 100644
> --- a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
> +++ b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
> @@ -16,7 +16,7 @@
> };
>  };
>
> -&{/soc@0} {
> + {
> u-boot,dm-pre-reloc;
> u-boot,dm-spl;
>  };
> diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> index 3a9ba8b8c9..88b4e8dc50 100644
> --- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> @@ -21,7 +21,7 @@
> };
>  };
>
> -&{/soc@0} {
> + {
> u-boot,dm-pre-reloc;
> u-boot,dm-spl;
>  };
> diff --git a/arch/arm/dts/imx8mn-evk.dtsi b/arch/arm/dts/imx8mn-evk.dtsi
> index d1f6cccfa0..261c365400 100644
> --- a/arch/arm/dts/imx8mn-evk.dtsi
> +++ b/arch/arm/dts/imx8mn-evk.dtsi
> @@ -47,6 +47,11 @@
> linux,autosuspend-period = <125>;
> };
>
> +   audio_codec_bt_sco: audio-codec-bt-sco {
> +   compatible = "linux,bt-sco";
> +   #sound-dai-cells = <1>;
> +   };
> +
> wm8524: audio-codec {
> #sound-dai-cells = <0>;
> compatible = "wlf,wm8524";
> @@ -57,6 +62,25 @@
> clock-names = "mclk";
> };
>
> +   sound-bt-sco {
> +   compatible = "simple-audio-card";
> +   simple-audio-card,name = "bt-sco-audio";
> +   simple-audio-card,format = "dsp_a";
> +   simple-audio-card,bitclock-inversion;
> +   simple-audio-card,frame-master = <>;
> +   simple-audio-card,bitclock-master = <>;
> +
> +   btcpu: simple-audio-card,cpu {
> +   sound-dai = <>;
> +   dai-tdm-slot-num = <2>;
> +   dai-tdm-slot-width = <16>;
> +   };
> +
> +   simple-audio-card,codec {
> +   sound-dai = <_codec_bt_sco 1>;
> +   };
> +   };
> +
> sound-wm8524 {
> compatible = "fsl,imx-audio-wm8524";
> model = "wm8524-audio";
> @@ -78,7 +102,7 @@
>  };
>
>   {
> -   fsl,asrc-rate  = <48000>;
> +   fsl,asrc-rate = <48000>;
> status = "okay";
>  };
>
> @@ -183,6 +207,16 @@
> };
>  };
>
> + {
> +   #sound-dai-cells = <0>;
> +   pinctrl-names = "default";
> +   pinctrl-0 = <_sai2>;
> +   assigned-clocks = < IMX8MN_CLK_SAI2>;
> +   assigned-clock-parents = < IMX8MN_AUDIO_PLL1_OUT>;
> +   assigned-clock-rates = <24576000>;
> +   status = "okay";
> +};
> +
>   {
> pinctrl-names = "default";
> pinctrl-0 = <_sai3>;
> @@ -354,6 +388,15 @@
> >;
> 

Re: [PATCH v6 01/10] arm64: smccc: add support for SMCCCv1.2 x0-x17 registers

2022-10-24 Thread Jens Wiklander
On Thu, Oct 13, 2022 at 11:38:48AM +0100, Abdellatif El Khlifi wrote:
> add support for x0-x17 registers used by the SMC calls
> 
> In SMCCC v1.2 [1] arguments are passed in registers x1-x17.
> Results are returned in x0-x17.
> 
> This work is inspired from the following kernel commit:
> 
> arm64: smccc: Add support for SMCCCv1.2 extended input/output registers
> 
> [1]: 
> https://documentation-service.arm.com/static/5f8edaeff86e16515cdbe4c6?token=
> 
> Signed-off-by: Abdellatif El Khlifi 
> Cc: Tom Rini 
> Cc: Simon Glass 
> Cc: Ilias Apalodimas 
> Cc: Jens Wiklander 
> 
> ---
> 
> Changelog:
> ===
> 
> v4:
> 
> * rename the commit title and improve description
>   new commit title: the current
> 
> v3:
> 
> * port x0-x17 registers support from linux kernel as defined by SMCCCv1.2
>   commit title:
>   arm64: smccc: add Xn registers support used by SMC calls
> 
> arch/arm/cpu/armv8/smccc-call.S | 53 +
>  arch/arm/lib/asm-offsets.c  | 14 +
>  include/linux/arm-smccc.h   | 43 ++
>  3 files changed, 110 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv8/smccc-call.S b/arch/arm/cpu/armv8/smccc-call.S
> index dc92b28777..ec6f299bc9 100644
> --- a/arch/arm/cpu/armv8/smccc-call.S
> +++ b/arch/arm/cpu/armv8/smccc-call.S
> @@ -1,6 +1,8 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
>  /*
>   * Copyright (c) 2015, Linaro Limited
> + * (C) Copyright 2022 ARM Limited
> + * Abdellatif El Khlifi 
>   */
>  #include 
>  #include 
> @@ -45,3 +47,54 @@ ENDPROC(__arm_smccc_smc)
>  ENTRY(__arm_smccc_hvc)
>   SMCCC   hvc
>  ENDPROC(__arm_smccc_hvc)
> +
> +#ifdef CONFIG_ARM64
> +
> + .macro SMCCC_1_2 instr
> + /* Save `res` and free a GPR that won't be clobbered */
> + stp x1, x19, [sp, #-16]!
> +
> + /* Ensure `args` won't be clobbered while loading regs in next step */
> + mov x19, x0
> +
> + /* Load the registers x0 - x17 from the struct arm_smccc_1_2_regs */
> + ldp x0, x1, [x19, #ARM_SMCCC_1_2_REGS_X0_OFFS]
> + ldp x2, x3, [x19, #ARM_SMCCC_1_2_REGS_X2_OFFS]
> + ldp x4, x5, [x19, #ARM_SMCCC_1_2_REGS_X4_OFFS]
> + ldp x6, x7, [x19, #ARM_SMCCC_1_2_REGS_X6_OFFS]
> + ldp x8, x9, [x19, #ARM_SMCCC_1_2_REGS_X8_OFFS]
> + ldp x10, x11, [x19, #ARM_SMCCC_1_2_REGS_X10_OFFS]
> + ldp x12, x13, [x19, #ARM_SMCCC_1_2_REGS_X12_OFFS]
> + ldp x14, x15, [x19, #ARM_SMCCC_1_2_REGS_X14_OFFS]
> + ldp x16, x17, [x19, #ARM_SMCCC_1_2_REGS_X16_OFFS]
> +
> + \instr #0
> +
> + /* Load the `res` from the stack */
> + ldr x19, [sp]
> +
> + /* Store the registers x0 - x17 into the result structure */
> + stp x0, x1, [x19, #ARM_SMCCC_1_2_REGS_X0_OFFS]
> + stp x2, x3, [x19, #ARM_SMCCC_1_2_REGS_X2_OFFS]
> + stp x4, x5, [x19, #ARM_SMCCC_1_2_REGS_X4_OFFS]
> + stp x6, x7, [x19, #ARM_SMCCC_1_2_REGS_X6_OFFS]
> + stp x8, x9, [x19, #ARM_SMCCC_1_2_REGS_X8_OFFS]
> + stp x10, x11, [x19, #ARM_SMCCC_1_2_REGS_X10_OFFS]
> + stp x12, x13, [x19, #ARM_SMCCC_1_2_REGS_X12_OFFS]
> + stp x14, x15, [x19, #ARM_SMCCC_1_2_REGS_X14_OFFS]
> + stp x16, x17, [x19, #ARM_SMCCC_1_2_REGS_X16_OFFS]
> +
> + /* Restore original x19 */
> + ldp xzr, x19, [sp], #16
> + ret
> + .endm
> +
> +/*
> + * void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args,
> + * struct arm_smccc_1_2_regs *res);
> + */
> +ENTRY(arm_smccc_1_2_smc)
> + SMCCC_1_2 smc
> +ENDPROC(arm_smccc_1_2_smc)
> +
> +#endif
> diff --git a/arch/arm/lib/asm-offsets.c b/arch/arm/lib/asm-offsets.c
> index 22fd541f9a..1bc2d90faa 100644
> --- a/arch/arm/lib/asm-offsets.c
> +++ b/arch/arm/lib/asm-offsets.c
> @@ -9,6 +9,9 @@
>   * generate asm statements containing #defines,
>   * compile this file to assembler, and then extract the
>   * #defines from the assembly-language output.
> + *
> + * (C) Copyright 2022 ARM Limited
> + * Abdellatif El Khlifi 
>   */
>  
>  #include 
> @@ -117,6 +120,17 @@ int main(void)
>   DEFINE(ARM_SMCCC_RES_X2_OFFS, offsetof(struct arm_smccc_res, a2));
>   DEFINE(ARM_SMCCC_QUIRK_ID_OFFS, offsetof(struct arm_smccc_quirk, id));
>   DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS, offsetof(struct arm_smccc_quirk, 
> state));
> + #ifdef CONFIG_ARM64
> + DEFINE(ARM_SMCCC_1_2_REGS_X0_OFFS,  offsetof(struct 
> arm_smccc_1_2_regs, a0));
> + DEFINE(ARM_SMCCC_1_2_REGS_X2_OFFS,  offsetof(struct 
> arm_smccc_1_2_regs, a2));
> + DEFINE(ARM_SMCCC_1_2_REGS_X4_OFFS,  offsetof(struct 
> arm_smccc_1_2_regs, a4));
> + DEFINE(ARM_SMCCC_1_2_REGS_X6_OFFS,  offsetof(struct 
> arm_smccc_1_2_regs, a6));
> + DEFINE(ARM_SMCCC_1_2_REGS_X8_OFFS,  offsetof(struct 
> arm_smccc_1_2_regs, a8));
> + DEFINE(ARM_SMCCC_1_2_REGS_X10_OFFS, offsetof(struct 
> arm_smccc_1_2_regs, a10));
> + 

[PATCH V2 1/7] arm: dts: imx8mn-u-boot: Create common imx8mn-u-boot.dtsi

2022-10-24 Thread sbabic
> Multiple boards create duplicate entries in their respective
> -u-boot.dtsi files which all basically do the same thing.
> To consolidate these and make it easier to make improvements
> going forward, consolidate them all into one place.
> This file creates a flash.bin image using binman, and supports
> LPDDR4, DDR4 and DDR3.  Since individual boards use different
> peripherals and different UART ports, those entries were kept
> in their respective board files, but the spba1 node was addded
> which contains all UART1-3 to help facilitate SPL_DM_SERIAL.
> Individual users will still need to include their respective
> UART and pinctrl nodes for those UARTS.
> This consolidated file also supports generating a flash.bin file
> which can boot from flexSPI if CONFIG_FSPI_CONF_HEADER is
> enabled.
> Signed-off-by: Adam Ford 
> Reviewed-by: Fabio Estevam 
> diff --git a/arch/arm/dts/imx8mn-u-boot.dtsi b/arch/arm/dts/imx8mn-u-boot.dtsi
> new file mode 100644
> index 00..327d4070fc
> --- /dev/null
> +++ b/arch/arm/dts/imx8mn-u-boot.dtsi
> @@ -0,0 +1,248 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2022 Logic PD, Inc dba Beacon EmbeddedWorks
> + */
> +
> +/ {
> + binman: binman {
> + multiple-images;
> + };
> +
> + firmware {
> + optee {
> + compatible = "linaro,optee-tz";
> + method = "smc";
> + };
> + };
> +
> + wdt-reboot {
> + compatible = "wdt-reboot";
> + wdt = <>;
> + u-boot,dm-spl;
> + };
> +};
> +
> +&{/soc@0} {
> + u-boot,dm-pre-reloc;
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
> + /delete-property/ assigned-clocks;
> + /delete-property/ assigned-clock-parents;
> + /delete-property/ assigned-clock-rates;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> +_24m {
> + u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> +  u-boot-spl-ddr {
> + filename = "u-boot-spl-ddr.bin";
> + pad-byte = <0xff>;
> + align-size = <4>;
> + align = <4>;
> +
> + u-boot-spl {
> + align-end = <4>;
> + filename = "u-boot-spl.bin";
> + };
> +
> + ddr-1d-imem-fw {
> +#ifdef CONFIG_IMX8M_LPDDR4
> + filename = "lpddr4_pmu_train_1d_imem.bin";
> +#elif CONFIG_IMX8M_DDR4
> + filename = "ddr4_imem_1d.bin";
> +#else
> + filename = "ddr3_imem_1d.bin";
> +#endif
> + type = "blob-ext";
> + align-end = <4>;
> + };
> +
> + ddr-1d-dmem-fw {
> +#ifdef CONFIG_IMX8M_LPDDR4
> + filename = "lpddr4_pmu_train_1d_dmem.bin";
> +#elif CONFIG_IMX8M_DDR4
> + filename = "ddr4_dmem_1d.bin";
> +#else
> + filename = "ddr3_dmem_1d.bin";
> +#endif
> + type = "blob-ext";
> + align-end = <4>;
> + };
> +
> + ddr-2d-imem-fw {
> +#ifdef CONFIG_IMX8M_LPDDR4
> + filename = "lpddr4_pmu_train_2d_imem.bin";
> +#elif CONFIG_IMX8M_DDR4
> + filename = "ddr4_imem_2d.bin";
> +#endif
> + type = "blob-ext";
> + align-end = <4>;
> + };
> +
> + ddr-2d-dmem-fw {
> +#ifdef CONFIG_IMX8M_LPDDR4
> + filename = "lpddr4_pmu_train_2d_dmem.bin";
> +#elif CONFIG_IMX8M_DDR4
> + filename = "ddr4_dmem_2d.bin";
> +#endif
> + type = "blob-ext";
> + align-end = <4>;
> + };
> + };
> +
> + spl {
> + filename = "spl.bin";
> +
> + mkimage {
> + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
> 0x912000";
> +
> + blob {
> + filename = "u-boot-spl-ddr.bin";
> + };
> + };
> + };
> +
> + itb {
> + filename = "u-boot.itb";
> +
> + fit {
> + description = "Configuration to load ATF before U-Boot";
> + fit,external-offset = ;
> + fit,fdt-list = "of-list";
> + #address-cells = <1>;
> +
> + images {
> + uboot {
> + arch = "arm64";
> + compression = "none";
> + description = "U-Boot (64-bit)";
> + load = ;
> + 

Pull request: u-boot-imx u-boot-imx-20220919

2022-10-24 Thread Stefano Babic

Hi Tom,

please pull from u-boot-imx, thanks !

The following changes since commit 3724ddf157aab3bd009c1da234b9a1af1621b544:

  Merge branch '2022-10-18-TI-platform-updates' (2022-10-18 18:13:39 -0400)

are available in the Git repository at:

  https://gitlab.denx.de/u-boot/custodians/u-boot-imx.git 
tags/u-boot-imx-20221024


for you to fetch changes up to 0f5caf351c18b212b856f68a8b9d8ea150cc9fa1:

  configs: verdin-imx8mp: enable caam (2022-10-24 13:43:21 +0200)


u-boot-imx-20221024
---

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/13916

- for 2022.01
- rework Kontron boards (mx6 and mx8)
- fixes for Toradex
- fixes (SPI, CAAM, )
- sync DT with Linux
- fixes for Gateworks GW7903 and GW7904 PMIC
- Engicam i.Core MX8M Plus EDIMM2.2


Adam Ford (7):
  arm: dts: imx8mn-u-boot: Create common imx8mn-u-boot.dtsi
  arm: dts: imx8mn-beacon-kit: Consolidate with imx8mn-u-boot
  arm: dts: imx8mn-bsh-smm-s2: Consolidate with imx8mn-u-boot
  arm: dts: imx8mn-ddr4-evk: Consolidate with imx8mn-u-boot
  arm: dts: imx8mn-evk: Consolidate with imx8mn-u-boot
  arm: dts: imx8mn-var-som-symphony: Consolidate with imx8mn-u-boot
  arm: dts: imx8mn-venice: Consolidate with imx8mn-u-boot

Andrejs Cainikovs (3):
  arm: dts: verdin-imx8mp: enable caam in SPL
  verdin-imx8mp: spl: initialize caam
  configs: verdin-imx8mp: enable caam

Ariel D'Alessandro (1):
  nitrogen6x: Remove extra quotes in fdtfile

Fabio Estevam (8):
  imx8mm_evk: Add an entry for USB boot
  imx8mm_evk: Add Serial Download Protocol support
  clk-imx8mm: Only build PWM clocks in non-SPL code
  clk-imx8mm: Move CLK_ENET_AXI to the non-SPL section
  clk-imx8mm: Only build ecspi clocks when CONFIG_DM_SPI=y
  clk-imx8mm: Only build QSPI clocks when CONFIG_NXP_FSPI=y
  imx8mn-ddr4-evk-u-boot: Fix broken boot
  imx8mn-venice-u-boot: Fix broken boot

Francesco Dolcini (2):
  ARM: imx8mp: verdin-imx8mp: Add memory size detection
  configs: colibri-imx7: Enable bootd command

Frieder Schrempf (25):
  Makefile: Make flash.bin target available for all platforms
  imx: imx6ul: kontron-sl-mx6ul: Enable migrated Kconfig options
  imx: imx6ul: kontron-sl-mx6ul: Fix CONFIG_ENV_SPI_BUS
  imx: imx6ul: kontron-sl-mx6ul: Select correct boot and env device
  imx: imx6ul: kontron-sl-mx6ul: Migrate to use CONFIG_EXTRA_ENV_TEXT
  imx: imx6ul: kontron-sl-mx6ul: Sync devicetrees
  imx: kontron-sl-mx8mm: Remove LVDS board type and devicetrees
  imx: kontron-sl-mx8mm: Add support for loading from SPI NOR in SPL
  imx: kontron-sl-mx8mm: Remove custom board_boot_order() workaround
  imx: kontron-sl-mx8mm: Increase CONFIG_SYS_CBSIZE to 2K
  imx: kontron-sl-mx8mm: Enable MTD command
  imx: kontron-sl-mx8mm: Add redundant environment and SPI NOR 
partitions

  imx: kontron-sl-mx8mm: Enable environment in MMC
  imx: kontron-sl-mx8mm: Migrate to use CONFIG_EXTRA_ENV_TEXT
  imx: kontron-sl-mx8mm: Enable bootaux command
  imx: kontron-sl-mx8mm: lpddr4_timing.c: Add spaces for proper 
alignment

  imx: kontron-sl-mx8mm: Remove 100mt DDR setpoint
  imx: kontron-sl-mx8mm: Use new LPDDR4 config parameters
  imx: kontron-sl-mx8mm: Prepare for other i.MX8MM SoM types
  imx: kontron-sl-mx8mm: Adjust devicetree names, compatibles and 
model strings
  imx: kontron-sl-mx8mm: Use the VSELECT signal to switch SD card 
IO voltage
  imx: kontron-sl-mx8mm: Use voltage rail names from schematic for 
PMIC regulator-names

  imx: kontron-sl-mx8mm: Simplify code in spl.c
  imx: kontron-sl-mx8mm: Add support for Kontron Electronics SoM SL 
i.MX8MM OSM-S
  imx: kontron-sl-mx8mm: Prepare for I2C display detection in 
environment script


Manoj Sai (3):
  arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus SoM
  arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit
  board: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit

Marcel Ziswiler (20):
  verdin-imx8mm: verdin-imx8mp: drop obsolete net/phy configs
  apalis/colibri_imx6/-imx6ull/_imx7: update env memory layout
  verdin-imx8mm: verdin-imx8mp: update env memory layout (again)
  verdin-imx8mm: various config additions and improvements
  verdin-imx8mp: various config additions and improvements
  imx7ulp: synchronise device tree with linux
  imx7d: synchronise device tree with linux
  imx6ul: synchronise device tree with linux
  imx6ull: synchronise device tree with linux
  imx6ulz: synchronise device tree with linux
  imx6sx: synchronise device tree with linux
  imx6sll: synchronise device tree with linux
  imx6sl: synchronise device tree with linux
  imx6qp: synchronise device tree with linux
  imx6qdl: synchronise device

[PATCH v2 07/16] imx6sll: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v1 3/3] configs: verdin-imx8mp: enable caam

2022-10-24 Thread sbabic
> This change enables Cryptographic Accelerator and Assurance Module.
> Signed-off-by: Andrejs Cainikovs 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 09/16] imx6qp: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 03/16] imx6ul: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH V2 7/7] arm: dts: imx8mn-venice: Consolidate with imx8mn-u-boot

2022-10-24 Thread sbabic
> Now that a unified imx8mn-u-boot is available, remove duplicated
> code for generating flash.bin and other common imx8mn peripherals.
> Signed-off-by: Adam Ford 
> diff --git a/arch/arm/dts/imx8mn-venice-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
> index 42e4d935cf..aea48f2d79 100644
> --- a/arch/arm/dts/imx8mn-venice-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
> @@ -3,60 +3,7 @@
>   * Copyright 2022 Gateworks Corporation
>   */
>  
> -/ {
> - binman: binman {
> - multiple-images;
> - };
> -
> - wdt-reboot {
> - compatible = "wdt-reboot";
> - wdt = <>;
> - u-boot,dm-spl;
> - };
> -};
> -
> -&{/soc@0} {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> - /delete-property/ assigned-clocks;
> - /delete-property/ assigned-clock-parents;
> - /delete-property/ assigned-clock-rates;
> -};
> -
> -_24m {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> -};
> -
> - {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> +#include "imx8mn-u-boot.dtsi"
>  
>   {
>   u-boot,dm-spl;
> @@ -114,147 +61,6 @@
>   u-boot,dm-spl;
>  };
>  
> - {
> - u-boot,dm-spl;
> -};
> -
>  _wdog {
>   u-boot,dm-spl;
>  };
> -
> - {
> - u-boot-spl-ddr {
> - align = <4>;
> - align-size = <4>;
> - filename = "u-boot-spl-ddr.bin";
> - pad-byte = <0xff>;
> -
> - u-boot-spl {
> - align-end = <4>;
> - filename = "u-boot-spl.bin";
> - };
> -
> - ddr-1d-imem-fw {
> - filename = "lpddr4_pmu_train_1d_imem.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> -
> - ddr-1d-dmem-fw {
> - filename = "lpddr4_pmu_train_1d_dmem.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> -
> - ddr-2d-imem-fw {
> - filename = "lpddr4_pmu_train_2d_imem.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> -
> - ddr-2d-dmem-fw {
> - filename = "lpddr4_pmu_train_2d_dmem.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> - };
> -
> - spl {
> - filename = "spl.bin";
> -
> - mkimage {
> - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
> 0x912000";
> -
> - blob {
> - filename = "u-boot-spl-ddr.bin";
> - };
> - };
> - };
> -
> - itb {
> - filename = "u-boot.itb";
> -
> - fit {
> - description = "Configuration to load ATF before U-Boot";
> - fit,external-offset = ;
> - fit,fdt-list = "of-list";
> - #address-cells = <1>;
> -
> - images {
> - uboot {
> - arch = "arm64";
> - compression = "none";
> - description = "U-Boot (64-bit)";
> - load = ;
> - type = "standalone";
> -
> - uboot_blob {
> - filename = "u-boot-nodtb.bin";
> - type = "blob-ext";
> - };
> - };
> -
> - atf {
> - arch = "arm64";
> - compression = "none";
> - description = "ARM Trusted Firmware";
> - entry = <0x96>;
> - load = <0x96>;
> - type = "firmware";
> -
> - atf_blob {
> - filename = "bl31.bin";
> - type = "blob-ext";
> - };
> - };
> -
> - binman_fip: fip {
> - arch = "arm64";
> - compression = "none";
> - description = "Trusted Firmware FIP";
> - load = <0x4031>;
> -

[PATCH v2 3/3] board: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit

2022-10-24 Thread sbabic
> i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus from Engicam.
> i.Core MX8M Plus needs to mount on top of this Evaluation board for
> creating complete i.Core MX8M Plus EDIMM2.2 Starter Kit.
> Add support for it.
> Signed-off-by: Jagan Teki 
> Signed-off-by: Manoj Sai 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 04/16] imx6ull: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 12/16] imx51: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 05/16] imx6ulz: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH V2 2/7] arm: dts: imx8mn-beacon-kit: Consolidate with imx8mn-u-boot

2022-10-24 Thread sbabic
> Now that a unified imx8mn-u-boot is available, remove duplicated
> code for generating flash.bin and other common imx8mn peripherals.
> Signed-off-by: Adam Ford 
> diff --git a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
> index 0efa6862eb..3180d57239 100644
> --- a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
> @@ -1,24 +1,9 @@
>  // SPDX-License-Identifier: GPL-2.0+
>  /*
> - * Copyright 2020 Compass Electronics Group, LLC
> + * Copyright 2022 Logic PD, Inc. dba Beacon EmbeddedWorks
>   */
>  
> -/ {
> - binman: binman {
> - multiple-images;
> - };
> -
> - wdt-reboot {
> - compatible = "wdt-reboot";
> - wdt = <>;
> - u-boot,dm-spl;
> - };
> -};
> -
> -&{/soc@0} {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> +#include "imx8mn-u-boot.dtsi"
>  
>  &{/soc@0/bus@3080/i2c@30a2/pmic@4b} {
>   u-boot,dm-spl;
> @@ -28,27 +13,6 @@
>   u-boot,dm-spl;
>  };
>  
> - {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> - /delete-property/ assigned-clocks;
> - /delete-property/ assigned-clock-parents;
> - /delete-property/ assigned-clock-rates;
> -};
> -
>   {
>   u-boot,dm-spl;
>  };
> @@ -61,15 +25,6 @@
>   u-boot,dm-spl;
>  };
>  
> - {
> - u-boot,dm-spl;
> -};
> -
> -_24m {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> -};
> -
>  _0 {
>   compatible = "ti,tca6416";
>  };
> @@ -106,10 +61,6 @@
>   u-boot,off-on-delay-us = <2>;
>  };
>  
> - {
> - u-boot,dm-spl;
> -};
> -
>   {
>   u-boot,dm-spl;
>  };
> @@ -132,133 +83,6 @@
>   mmc-hs400-enhanced-strobe;
>  };
>  
> - {
> - u-boot,dm-spl;
> -};
> -
>  _wdog {
>   u-boot,dm-spl;
>  };
> -
> - {
> -  u-boot-spl-ddr {
> - filename = "u-boot-spl-ddr.bin";
> - pad-byte = <0xff>;
> - align-size = <4>;
> - align = <4>;
> -
> - u-boot-spl {
> - align-end = <4>;
> - };
> -
> - ddr-1d-imem-fw {
> - filename = "lpddr4_pmu_train_1d_imem.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-1d-dmem-fw {
> - filename = "lpddr4_pmu_train_1d_dmem.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-2d-imem-fw {
> - filename = "lpddr4_pmu_train_2d_imem.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-2d-dmem-fw {
> - filename = "lpddr4_pmu_train_2d_dmem.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> - };
> -
> -
> - spl {
> - filename = "spl.bin";
> -
> - mkimage {
> - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
> 0x912000";
> -
> - blob {
> - filename = "u-boot-spl-ddr.bin";
> - };
> - };
> - };
> -
> - itb {
> - filename = "u-boot.itb";
> -
> - fit {
> - description = "Configuration to load ATF before U-Boot";
> - #address-cells = <1>;
> - fit,external-offset = ;
> -
> - images {
> - uboot {
> - description = "U-Boot (64-bit)";
> - type = "standalone";
> - arch = "arm64";
> - compression = "none";
> - load = ;
> -
> - uboot_blob: blob-ext {
> - filename = "u-boot-nodtb.bin";
> - };
> - };
> -
> - atf {
> - description = "ARM Trusted Firmware";
> - type = "firmware";
> - arch = "arm64";
> - compression = "none";
> - load = <0x96>;
> - entry = <0x96>;
> -
> - atf_blob: blob-ext {
> - filename = "bl31.bin";
> - };
> - };
> -
> - fdt {
> - description = 

[PATCH V2 3/7] arm: dts: imx8mn-bsh-smm-s2: Consolidate with imx8mn-u-boot

2022-10-24 Thread sbabic
> Now that a unified imx8mn-u-boot is available, remove duplicated
> code for generating flash.bin and other common imx8mn peripherals.
> Signed-off-by: Adam Ford 
> diff --git a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi 
> b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
> index c4ae7ca4f3..3967e0bd15 100644
> --- a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
> +++ b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
> @@ -4,22 +4,7 @@
>   * Copyright 2021 BSH Hausgeraete GmbH
>   */
>  
> -/ {
> - binman: binman {
> - multiple-images;
> - };
> -
> - wdt-reboot {
> - compatible = "wdt-reboot";
> - wdt = <>;
> - u-boot,dm-spl;
> - };
> -};
> -
> -&{/soc@0} {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> +#include "imx8mn-u-boot.dtsi"
>  
>  &{/soc@0/bus@3080/i2c@30a2/pmic@4b} {
>   u-boot,dm-spl;
> @@ -29,27 +14,6 @@
>   u-boot,dm-spl;
>  };
>  
> - {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> - /delete-property/ assigned-clocks;
> - /delete-property/ assigned-clock-parents;
> - /delete-property/ assigned-clock-rates;
> -};
> -
>   {
>   u-boot,dm-spl;
>  };
> @@ -66,15 +30,6 @@
>   u-boot,dm-spl;
>  };
>  
> - {
> - u-boot,dm-spl;
> -};
> -
> -_24m {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> -
>  _i2c1 {
>   u-boot,dm-spl;
>  };
> @@ -98,128 +53,3 @@
>   {
>   u-boot,dm-spl;
>  };
> -
> - {
> - u-boot-spl-ddr {
> - align = <4>;
> - align-size = <4>;
> - filename = "u-boot-spl-ddr.bin";
> - pad-byte = <0xff>;
> -
> - u-boot-spl {
> - align-end = <4>;
> - filename = "u-boot-spl.bin";
> - };
> -
> - ddr-1d-imem-fw {
> - filename = "ddr3_imem_1d.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> -
> - ddr-1d-dmem-fw {
> - filename = "ddr3_dmem_1d.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> - };
> -
> - spl {
> - filename = "spl.bin";
> -
> - mkimage {
> - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
> 0x912000";
> -
> - blob {
> - filename = "u-boot-spl-ddr.bin";
> - };
> - };
> - };
> -
> - itb {
> - filename = "u-boot.itb";
> -
> - fit {
> - description = "Configuration to load ATF before U-Boot";
> - fit,external-offset = ;
> - fit,fdt-list = "of-list";
> - #address-cells = <1>;
> -
> - images {
> - uboot {
> - arch = "arm64";
> - compression = "none";
> - description = "U-Boot (64-bit)";
> - load = ;
> - type = "standalone";
> -
> - uboot_blob {
> - filename = "u-boot-nodtb.bin";
> - type = "blob-ext";
> - };
> - };
> -
> - atf {
> - arch = "arm64";
> - compression = "none";
> - description = "ARM Trusted Firmware";
> - entry = <0x96>;
> - load = <0x96>;
> - type = "firmware";
> -
> - atf_blob {
> - filename = "bl31.bin";
> - type = "atf-bl31";
> - };
> - };
> -
> - binman_fip: fip {
> - arch = "arm64";
> - compression = "none";
> - description = "Trusted Firmware FIP";
> - load = <0x4031>;
> - type = "firmware";
> - };
> -
> - @fdt-SEQ {
> - compression = "none";
> - description = "NAME";
> - type = "flat_dt";
> -
> -  

[PATCH v1 2/3] verdin-imx8mp: spl: initialize caam

2022-10-24 Thread sbabic
> This change initializes Cryptographic Accelerator and Assurance Module.
> Signed-off-by: Andrejs Cainikovs 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 1/3] arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus SoM

2022-10-24 Thread sbabic
> i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus
> from Engicam.
> General features:
> - NXP i.MX8M Plus
> - Up to 4GB LDDR4
> - 8 eMMC
> - Gigabit Ethernet
> - USB 3.0, 2.0 Host/OTG
> - PCIe 3.0 interface
> - I2S
> - LVDS
> - rest of i.MX8M Plus features
> i.Core MX8M Plus needs to mount on top of Engicam baseboards
> for creating complete platform solutions.
> Add support for it.
> Sync the i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus
> from Engicam devicetree file from linux-next tree.
> commit  (arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus SoM)
> Signed-off-by: Manoj Sai 
> Signed-off-by: Jagan Teki 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 01/16] imx7ulp: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v1 1/3] arm: dts: verdin-imx8mp: enable caam in SPL

2022-10-24 Thread sbabic
> CAAM is initialized in SPL, so relevant device tree nodes needs to be
> updated.
> Signed-off-by: Andrejs Cainikovs 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH V2 5/7] arm: dts: imx8mn-evk: Consolidate with imx8mn-u-boot

2022-10-24 Thread sbabic
> Now that a unified imx8mn-u-boot is available, remove duplicated
> code for generating flash.bin and other common imx8mn peripherals.
> Signed-off-by: Adam Ford 
> diff --git a/arch/arm/dts/imx8mn-evk-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
> index c4b83d3f7e..6c6c949f43 100644
> --- a/arch/arm/dts/imx8mn-evk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
> @@ -24,111 +24,3 @@
>  _pmic {
>   u-boot,dm-spl;
>  };
> -
> - {
> -  u-boot-spl-ddr {
> - filename = "u-boot-spl-ddr.bin";
> - pad-byte = <0xff>;
> - align-size = <4>;
> - align = <4>;
> -
> - u-boot-spl {
> - align-end = <4>;
> - };
> -
> - ddr-1d-imem-fw {
> - filename = "lpddr4_pmu_train_1d_imem.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-1d-dmem-fw {
> - filename = "lpddr4_pmu_train_1d_dmem.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-2d-imem-fw {
> - filename = "lpddr4_pmu_train_2d_imem.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-2d-dmem-fw {
> - filename = "lpddr4_pmu_train_2d_dmem.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> - };
> -
> -
> - spl {
> - filename = "spl.bin";
> -
> - mkimage {
> - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
> 0x912000";
> -
> - blob {
> - filename = "u-boot-spl-ddr.bin";
> - };
> - };
> - };
> -
> - itb {
> - filename = "u-boot.itb";
> -
> - fit {
> - description = "Configuration to load ATF before U-Boot";
> - #address-cells = <1>;
> - fit,external-offset = ;
> -
> - images {
> - uboot {
> - description = "U-Boot (64-bit)";
> - type = "standalone";
> - arch = "arm64";
> - compression = "none";
> - load = ;
> -
> - uboot_blob: blob-ext {
> - filename = "u-boot-nodtb.bin";
> - };
> - };
> -
> - atf {
> - description = "ARM Trusted Firmware";
> - type = "firmware";
> - arch = "arm64";
> - compression = "none";
> - load = <0x96>;
> - entry = <0x96>;
> -
> - atf_blob: blob-ext {
> - filename = "bl31.bin";
> - };
> - };
> -
> - fdt {
> - description = "NAME";
> - type = "flat_dt";
> - compression = "none";
> -
> - uboot_fdt_blob: blob-ext {
> - filename = "u-boot.dtb";
> - };
> - };
> - };
> -
> - configurations {
> - default = "conf";
> -
> - conf {
> - description = "NAME";
> - firmware = "uboot";
> - loadables = "atf";
> - fdt = "fdt";
> - };
> - };
> - };
> - };
> -};
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 3/3] verdin-imx8mp: various config additions and improvements

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> - enable bootcount command
> - enable CRC32 and MD5
> - enable time commands
> - enable GPIO LED support
> - enable further eMMC HS400 functionality
> - enable fixed PHY and MDIO driver model
> - enable USB host functionality
> - enable thermal management unit driver
> - enable hexdump
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 08/16] imx6sl: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 16/16] imx28: avoid num_cs and spi_max_frequency build errors

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Avoid the following build errors after the device tree sync:
> drivers/spi/mxs_spi.c: In function ‘mxs_spi_probe’:
> drivers/spi/mxs_spi.c:327:25: error: ‘struct dtd_fsl_imx23_spi’ has no
>  member named ‘spi_max_frequency’
>   327 |  priv->max_freq = dtplat->spi_max_frequency;
>   | ^~
> drivers/spi/mxs_spi.c:328:23: error: ‘struct dtd_fsl_imx23_spi’ has no
>  member named ‘num_cs’
>   328 |  plat->num_cs = dtplat->num_cs;
>   |   ^~
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 10/16] imx6qdl: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 02/16] imx7d: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 13/16] imx28: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] board: gateworks: venice: add imx8mm-gw7904 support

2022-10-24 Thread sbabic
> The GW7904 is based on the i.MX 8M Mini SoC featuring:
>  - LPDDR4 DRAM
>  - eMMC FLASH
>  - microSD connector with UHS support
>  - LIS2DE12 3-axis accelerometer
>  - Gateworks System Controller
>  - IMX8M FEC
>  - 2x RS232 off-board connectors
>  - PMIC
>  - 10x bi-color LED's
>  - 1x miniPCIe socket with PCIe and USB2.0
>  - 802.3at Class 4 PoE
>  - 10-30VDC input via barrel-jack
> Signed-off-by: Tim Harvey 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 06/16] imx6sx: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3] board: gateworks: venice: add GW7903 PMIC

2022-10-24 Thread sbabic
> The GW7903 has a BD71847 PMIC on I2C1. Adjust the model compare strings
> to add it.
> Signed-off-by: Tim Harvey 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Jaehoon Chung 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 11/16] imx53: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 2/3] verdin-imx8mm: various config additions and improvements

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> - enable bootcount command
> - integrate bootcount using SNVS_LP general purpose register LPGPR0
> - enable link-time optimisation
> - explicitly set a boot delay of one second
> - enable CRC32 and MD5
> - enable command for low-level access to data in a partition
> - enable time commands
> - enable PMIC commands
> - improve ETHPRIME configuration
> - enable eMMC HS400 functionality
> - enable fixed PHY and MDIO driver model
> - remove stale PFUZE100 PMIC driver
> - enable thermal management unit driver
> - enable more USB host functionality
> - enable hexdump
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH V2 4/7] arm: dts: imx8mn-ddr4-evk: Consolidate with imx8mn-u-boot

2022-10-24 Thread sbabic
> Now that a unified imx8mn-u-boot is available, remove duplicated
> code for generating flash.bin and other common imx8mn peripherals.
> Signed-off-by: Adam Ford 
> diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> index 3fdb20cb35..54f3ebe88b 100644
> --- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> @@ -3,66 +3,7 @@
>   * Copyright 2019, 2021 NXP
>   */
>  
> -/ {
> - binman: binman {
> - multiple-images;
> - };
> -
> - wdt-reboot {
> - compatible = "wdt-reboot";
> - wdt = <>;
> - u-boot,dm-spl;
> - };
> - firmware {
> - optee {
> - compatible = "linaro,optee-tz";
> - method = "smc";
> - };
> - };
> -};
> -
> -&{/soc@0} {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> - /delete-property/ assigned-clocks;
> - /delete-property/ assigned-clock-parents;
> - /delete-property/ assigned-clock-rates;
> -};
> -
> -_24m {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> -};
> -
> - {
> - u-boot,dm-spl;
> - u-boot,dm-pre-reloc;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> +#include "imx8mn-u-boot.dtsi"
>  
>  _reg_usdhc2_vmmc {
>   u-boot,dm-spl;
> @@ -147,130 +88,3 @@
>   mmc-hs400-1_8v;
>   mmc-hs400-enhanced-strobe;
>  };
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> -  u-boot-spl-ddr {
> - filename = "u-boot-spl-ddr.bin";
> - pad-byte = <0xff>;
> - align-size = <4>;
> - align = <4>;
> -
> - u-boot-spl {
> - align-end = <4>;
> - };
> -
> - ddr-1d-imem-fw {
> - filename = "ddr4_imem_1d_201810.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-1d-dmem-fw {
> - filename = "ddr4_dmem_1d_201810.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-2d-imem-fw {
> - filename = "ddr4_imem_2d_201810.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> -
> - ddr-2d-dmem-fw {
> - filename = "ddr4_dmem_2d_201810.bin";
> - type = "blob-ext";
> - align-end = <4>;
> - };
> - };
> -
> -
> - spl {
> - filename = "spl.bin";
> -
> - mkimage {
> - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
> 0x912000";
> -
> - blob {
> - filename = "u-boot-spl-ddr.bin";
> - };
> - };
> - };
> -
> - itb {
> - filename = "u-boot.itb";
> -
> - fit {
> - description = "Configuration to load ATF before U-Boot";
> - #address-cells = <1>;
> - fit,external-offset = ;
> -
> - images {
> - uboot {
> - description = "U-Boot (64-bit)";
> - type = "standalone";
> - arch = "arm64";
> - compression = "none";
> - load = ;
> -
> - uboot_blob: blob-ext {
> - filename = "u-boot-nodtb.bin";
> - };
> - };
> -
> - atf {
> - description = "ARM Trusted Firmware";
> - type = "firmware";
> - arch = "arm64";
> - compression = "none";
> - load = <0x96>;
> - entry = <0x96>;
> -
> - atf_blob: blob-ext {
> - filename = "bl31.bin";
> - };
> - };
> -
> - fdt {
> - description = "NAME";
> - type = "flat_dt";
> - compression = "none";
> -
> - uboot_fdt_blob: blob-ext {
> - filename = "u-boot.dtb";
> -  

[PATCH V2 6/7] arm: dts: imx8mn-var-som-symphony: Consolidate with imx8mn-u-boot

2022-10-24 Thread sbabic
> Now that a unified imx8mn-u-boot is available, remove duplicated
> code for generating flash.bin and other common imx8mn peripherals.
> Signed-off-by: Adam Ford 
> diff --git a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
> index ed1ab10ded..a20683155c 100644
> --- a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
> @@ -3,22 +3,7 @@
>   * Copyright 2021 Collabora Ltd.
>   */
>  
> -/ {
> - binman: binman {
> - multiple-images;
> - };
> -
> - wdt-reboot {
> - compatible = "wdt-reboot";
> - wdt = <>;
> - u-boot,dm-spl;
> - };
> -};
> -
> -&{/soc@0} {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> +#include "imx8mn-u-boot.dtsi"
>  
>  &{/soc@0/bus@3080/i2c@30a2/pmic@4b} {
>   u-boot,dm-spl;
> @@ -28,27 +13,6 @@
>   u-boot,dm-spl;
>  };
>  
> - {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> - /delete-property/ assigned-clocks;
> - /delete-property/ assigned-clock-parents;
> - /delete-property/ assigned-clock-rates;
> -};
> -
>   {
>   u-boot,dm-spl;
>  };
> @@ -65,15 +29,6 @@
>   u-boot,dm-spl;
>  };
>  
> - {
> - u-boot,dm-spl;
> -};
> -
> -_24m {
> - u-boot,dm-pre-reloc;
> - u-boot,dm-spl;
> -};
> -
>  _i2c1 {
>   u-boot,dm-spl;
>  };
> @@ -113,144 +68,3 @@
>   {
>   u-boot,dm-spl;
>  };
> -
> - {
> - u-boot,dm-spl;
> -};
> -
> - {
> - u-boot-spl-ddr {
> - align = <4>;
> - align-size = <4>;
> - filename = "u-boot-spl-ddr.bin";
> - pad-byte = <0xff>;
> -
> - u-boot-spl {
> - align-end = <4>;
> - filename = "u-boot-spl.bin";
> - };
> -
> - ddr-1d-imem-fw {
> - filename = "ddr4_imem_1d.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> -
> - ddr-1d-dmem-fw {
> - filename = "ddr4_dmem_1d.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> -
> - ddr-2d-imem-fw {
> - filename = "ddr4_imem_2d.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> -
> - ddr-2d-dmem-fw {
> - filename = "ddr4_dmem_2d.bin";
> - align-end = <4>;
> - type = "blob-ext";
> - };
> - };
> -
> - spl {
> - filename = "spl.bin";
> -
> - mkimage {
> - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
> 0x912000";
> -
> - blob {
> - filename = "u-boot-spl-ddr.bin";
> - };
> - };
> - };
> -
> - itb {
> - filename = "u-boot.itb";
> -
> - fit {
> - description = "Configuration to load ATF before U-Boot";
> - fit,external-offset = ;
> - fit,fdt-list = "of-list";
> - #address-cells = <1>;
> -
> - images {
> - uboot {
> - arch = "arm64";
> - compression = "none";
> - description = "U-Boot (64-bit)";
> - load = ;
> - type = "standalone";
> -
> - uboot_blob {
> - filename = "u-boot-nodtb.bin";
> - type = "blob-ext";
> - };
> - };
> -
> - atf {
> - arch = "arm64";
> - compression = "none";
> - description = "ARM Trusted Firmware";
> - entry = <0x96>;
> - load = <0x96>;
> - type = "firmware";
> -
> - atf_blob {
> - filename = "bl31.bin";
> - type = "atf-bl31";
> - };
> - };
> -
> - binman_fip: fip {
> - arch = "arm64";
> - compression = "none";
> - description = "Trusted 

[PATCH v3 1/3] verdin-imx8mm: verdin-imx8mp: update env memory layout (again)

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Update the distro config env memory layout for the Verdin iMX8M Mini and
> Verdin iMX8M Plus again:
> - loadaddr=0x4820 allows for 128MB area for uncompressing (ie FIT
>   images, kernel_comp_addr_r, kernel_comp_size)
> - fdt_addr_r = loadaddr + 128MB - allows for 128MB kernel
> - scriptaddr = fdt_addr_r + 512KB - allows for 512KB fdt
> - ramdisk_addr_r = scriptaddr + 512KB - allows for 512KB script
> Memory layout taken from commit fd5c7173ade4
> ("imx8m{m,n}_venice: update env memory layout").
> Note that for our regular BSP Layers and Reference Images for Yocto
> Project an updated distro boot script is required (see
> meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-distro-boot).
> Note that this corrects a pre-maturely applied version 2 of the same
> patch set.
> Fixes: bbe0089d29e ("verdin-imx8mm: verdin-imx8mp: update env memory layout")
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 14/16] imx23: synchronise device tree with linux

2022-10-24 Thread sbabic
> From: Marcel Ziswiler 
> Synchronise device tree with linux v6.0-rc1.
> Signed-off-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v1] configs: colibri-imx7: Enable bootd command

2022-10-24 Thread sbabic
> Enable boot/bootd command in toradex colibri-imx7 defconfig,
> it's just convenient to have it in and every other toradex board
> already includes it.
> Signed-off-by: Francesco Dolcini 
> Acked-by: Marcel Ziswiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] imx8m: fix reading of DDR4 MR registers [again]

2022-10-24 Thread sbabic
> Commit 290ffe5788 (imx8m: fix reading of DDR4 MR registers) lifted a
> private definition of lpddr4_mr_read() from imx8mm-cl-iot-gate board
> code to drivers/ddr/imx/imx8m/ddrphy_utils.c, because that version
> actually seems to work in practice.
> However, commit 99c7cc58e1 (ddr: imx: Add i.MX9 DDR controller driver)
> reintroduced the broken version in drivers/ddr/imx/imx8m/ddr_init.c,
> copied most of the rest of ddrphy_utils.c to
> drivers/ddr/imx/phy/ddrphy_utils.c, and stopped building
> drivers/ddr/imx/imx8m/ddrphy_utils.c [and that file was then finally
> completely removed with 7e9bd84883 (imx8m: ddrphy_utils: Remove unused
> file)].
> I assume this must have broken the imx8mm-cl-iot-gate board, at least
> those that have not had their eeprom programmed with the proper
> information. It certainly did break our out-of-tree board which always
> reads back the ID register and uses that for a sanity check.
> So apply the fix from 290ffe5788 once again.
> Fixes: 99c7cc58e1 (ddr: imx: Add i.MX9 DDR controller driver)
> Signed-off-by: Rasmus Villemoes 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 2/3] arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit

2022-10-24 Thread sbabic
> Genaral features:
> - LCD 7" C.Touch
> - microSD slot
> - Ethernet 1Gb
> - Wifi/BT
> - 2x LVDS Full HD interfaces
> - 3x USB 2.0
> - 1x USB 3.0
> - HDMI Out
> - Plus PCIe
> - MIPI CSI
> - 2x CAN
> - Audio Out
> i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus from Engicam.
> i.Core MX8M Plus needs to mount on top of this Evaluation board for
> creating complete i.Core MX8M Plus EDIMM2.2 Starter Kit.
> Add support for it.
> Sync the i.Core MX8M Plus is an EDIMM SoM based on NXP
> devicetree file from linux-next tree.
> commit  (arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus 
> EDIMM2.2 Starter Kit)
> Signed-off-by: Manoj Sai 
> Signed-off-by: Jagan Teki 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


Re: [PATCH v6 09/10] arm_ffa: efi: introduce FF-A MM communication

2022-10-24 Thread Ilias Apalodimas
Hi Abdellatif,

[...]

>  
>  #include 
> @@ -15,6 +17,36 @@
>  #include 
>  #include 
>  
> +#if (IS_ENABLED(CONFIG_ARM_FFA_TRANSPORT))
> +
> +#include 
> +#include 
> +#include 
> +
> +#ifndef FFA_SHARED_MM_BUFFER_SIZE
> +#warning "FFA_SHARED_MM_BUFFER_SIZE must be defined in 
> include/configs/.h"
> +#define FFA_SHARED_MM_BUFFER_SIZE 0
> +#endif
> +
> +#ifndef FFA_SHARED_MM_BUFFER_OFFSET
> +#warning "FFA_SHARED_MM_BUFFER_OFFSET must be defined in 
> include/configs/.h"
> +#define FFA_SHARED_MM_BUFFER_OFFSET 0
> +#endif
> +
> +#ifndef FFA_SHARED_MM_BUFFER_ADDR
> +#warning "FFA_SHARED_MM_BUFFER_ADDR must be defined in 
> include/configs/.h"
> +#define FFA_SHARED_MM_BUFFER_ADDR 0
> +#endif

Is the device going to work with these defaults? I am assuming not, so
isn't better to treat this as compile time errors?

> +
> +/* MM return codes */
> +#define MM_SUCCESS (0)
> +
> +const char *mm_sp_svc_uuid = MM_SP_UUID;

static ?

> +
> +static u16 mm_sp_id;
> +
> +#endif
> +
>  extern struct efi_var_file __efi_runtime_data *efi_var_buf;
>  static efi_uintn_t max_buffer_size;  /* comm + var + func + data */
>  static efi_uintn_t max_payload_size; /* func + data */
> @@ -24,6 +56,7 @@ struct mm_connection {
>   u32 session;
>  };
>  
> +#if (IS_ENABLED(CONFIG_OPTEE))
>  /**
>   * get_connection() - Retrieve OP-TEE session for a specific UUID.
>   *
> @@ -143,13 +176,224 @@ static efi_status_t optee_mm_communicate(void 
> *comm_buf, ulong dsize)
>  
>   return ret;
>  }
> +#endif
> +
> +#if (IS_ENABLED(CONFIG_ARM_FFA_TRANSPORT))
> +
> +/**
> + * ffa_notify_mm_sp() - Announce there is data in the shared buffer
> + *
> + * Notifies the MM partition in the trusted world that
> + * data is available in the shared buffer.
> + * This is a blocking call during which trusted world has exclusive access
> + * to the MM shared buffer.
> + *
> + * Return:
> + *
> + * 0 on success
> + */
> +static int ffa_notify_mm_sp(void)
> +{
> + struct ffa_send_direct_data msg = {0};
> + int ret;
> + int sp_event_ret = -1;
> +
> + if (!ffa_bus_ops_get())
> + return -EINVAL;
> +
> + msg.data0 = FFA_SHARED_MM_BUFFER_OFFSET; /* x3 */
> +
> + ret = ffa_bus_ops_get()->sync_send_receive(mm_sp_id, );
> + if (ret != 0)
> + return ret;
> +
> + sp_event_ret = msg.data0; /* x3 */
> +
> + if (sp_event_ret == MM_SUCCESS)
> + return 0;
> +
> + /*
> +  * Failure to notify the MM SP
> +  */
> +
> + return -EACCES;
> +}
>  
>  /**
> - * mm_communicate() - Adjust the cmonnucation buffer to StandAlonneMM and 
> send
> + * ffa_discover_mm_sp_id() - Query the MM partition ID
> + *
> + * Use the FF-A driver to get the MM partition ID.
> + * If multiple partitions are found, use the first one.
> + * This is a boot time function.
> + *
> + * Return:
> + *
> + * 0 on success
> + */
> +static int ffa_discover_mm_sp_id(void)
> +{
> + u32 count = 0, size = 0;
> + int ret;
> + struct ffa_partition_info *parts_info;
> +
> + if (!ffa_bus_ops_get())
> + return -EINVAL;
> +
> + /*
> +  * get from the driver the count of the SPs matching the UUID
> +  */
> + ret = ffa_bus_ops_get()->partition_info_get(mm_sp_svc_uuid, , 
> NULL);
> + if (ret != 0) {
> + log_err("EFI: Failure in querying partitions count (error code: 
> %d)\n", ret);
> + return ret;
> + }
> +
> + if (!count) {
> + log_info("EFI: No MM partition found\n");
> + return ret;
> + }
> +
> + /*
> +  * pre-allocate a buffer to be filled by the driver
> +  * with  ffa_partition_info structs
> +  */
> +
> + log_info("EFI: Pre-allocating %d partition(s) info structures\n", 
> count);
> +
> + parts_info = calloc(count, sizeof(struct ffa_partition_info));
> + if (!parts_info)
> + return -EINVAL;

-ENOMEM here is more accurate

> +
> + size = count * sizeof(struct ffa_partition_info);
> +
> + /*
> +  * ask the driver to fill the
> +  * buffer with the SPs info
> +  */
> + ret = ffa_bus_ops_get()->partition_info_get(mm_sp_svc_uuid, , 
> parts_info);
> + if (ret != 0) {
> + log_err("EFI: Failure in querying partition(s) info (error 
> code: %d)\n", ret);
> + free(parts_info);
> + return ret;
> + }
> +
> + /*
> +  * MM SPs found , use the first one
> +  */
> +
> + mm_sp_id = parts_info[0].id;
> +
> + log_info("EFI: MM partition ID 0x%x\n", mm_sp_id);
> +
> + free(parts_info);
> +
> + return 0;
> +}
> +
> +/**
> + * ffa_mm_communicate() - Exchange EFI services data with  the MM partition 
> using FF-A
> + * @comm_buf:locally allocated communication buffer used for 
> rx/tx
> + * @dsize:   communication buffer size
> + *
> + * Issues a door bell event to notify the MM partition (SP) running in OP-TEE
> + * that there is data to read from the shared 

Re: [PATCH v2] blk: fix a couple of trivial documentation typos

2022-10-24 Thread Tom Rini
On Mon, Oct 17, 2022 at 09:35:04AM +0200, Mattijs Korpershoek wrote:

> In some cases, the param variable is wrong, and in other cases we have
> undocumented arguments.
> 
> Fix the docs.
> 
> Signed-off-by: Mattijs Korpershoek 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 2/2] board/km: drop CONFIG_KM_ROOTFSSIZE

2022-10-24 Thread Tom Rini
On Mon, Oct 17, 2022 at 11:45:21AM +0200, Holger Brunck wrote:

> This unused nowadays and can be dropped.
> 
> Signed-off-by: Holger Brunck 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2] test: Fix typo in test name

2022-10-24 Thread Tom Rini
On Sat, Oct 15, 2022 at 11:30:37AM +0200, Michal Suchanek wrote:

> For other sandbox tests the printed test name corresponds to the
> configuration except for this one.
> 
> Signed-off-by: Michal Suchanek 
> Reviewed-by: Simon Glass 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2] cmd: bcb: select user(0) hwpart in __bcb_load()

2022-10-24 Thread Tom Rini
On Thu, Oct 13, 2022 at 02:25:59PM +0200, Mattijs Korpershoek wrote:

> For some blk operations, it's possible that a different hw partition
> gets selected via blk_dselect_hwpart().
> In that case, only the region of the device covered by that partition
> is accessible.
> 
> This breaks "bcb load" which attempts to read the gpt and assumes it's
> on the user(0) hw partition:
> 
> => bcb load 2 misc
> GUID Partition Table Header signature is wrong: 0xDE7B17AD07D9E5D6 != 
> 0x5452415020494645
> find_valid_gpt: *** ERROR: Invalid GPT ***
> GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
> find_valid_gpt: *** ERROR: Invalid Backup GPT ***
> Error: mmc 2:misc read failed (-2)
> 
> Add a fail-safe in __bcb_load() to ensure we will always read from the
> user(0) hwpartition.
> 
> This fixes the following fastboot sequence:
> 
> $ fastboot erase mmc2boot1# switch to hwpart1
> $ fastboot reboot bootloader  # switch to hwpart0, then reads GPT
> 
> Signed-off-by: Mattijs Korpershoek 
> Reviewed-by: Sean Anderson 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] board: gateworks: gw_ventana: fix building with GCC 12.2

2022-10-24 Thread Tom Rini
On Wed, Oct 12, 2022 at 06:59:27PM +0200, Heinrich Schuchardt wrote:

> Building with GCC 12.2 results in an error
> 
> board/gateworks/gw_ventana/gw_ventana.c:636:68: error: the comparison
> will always evaluate as 'true' for the address of 'pwm_padmux' will
> never be NULL [-Werror=address]
>   636 | } else if (hwconfig_subarg_cmp(arg, "mode", 
> "pwm") &&
>   |   
>  ^~
> 
> Remove the superfluous check.
> 
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-By: Tim Harvey 
> Reviewed-by: Fabio Estevam 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 2/2] common: board_f: Print information for all sysresets

2022-10-24 Thread Tom Rini
On Mon, Oct 10, 2022 at 08:29:40PM +0200, Michal Suchanek wrote:

> Boards can have multiple sysresets, iterate all when printing sysreset
> info.
> 
> Fixes: 23471aed5c ("board_f: Add reset status printing")
> Signed-off-by: Michal Suchanek 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 1/2] sandbox: Initialize sysreset before relocation

2022-10-24 Thread Tom Rini
On Mon, Oct 10, 2022 at 08:29:39PM +0200, Michal Suchanek wrote:

> Without this the early sysreset code cannot be tested.
> 
> Signed-off-by: Michal Suchanek 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 3/3] qemu: Try to automatically boot from the QEMU firmware device (qfw)

2022-10-24 Thread Tom Rini
On Mon, Oct 10, 2022 at 06:01:22PM +0100, Andre Przywara wrote:

> At the moment the QEMU boot sequence tries various (storage) devices
> when trying to find a payload to boot.
> To simplify starting a specific kernel and initrd, there is also the qfw
> command, which can use the files specified on the QEMU command line, via
> the -kernel and -initrd options.
> Add this command to the list of boot options to try. Since users
> specifying those options on the command line probably explicitly want
> to run them, let's place the new command first. Without those options,
> the qfw command will just gracefully fail, and we continue with the
> existing order.
> 
> This allows auto-booting of specific kernels in QEMU, for instance in CI
> systems.
> 
> Signed-off-by: Andre Przywara 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 2/3] qfw: return failure when no kernel could be loaded

2022-10-24 Thread Tom Rini
On Mon, Oct 10, 2022 at 06:01:21PM +0100, Andre Przywara wrote:

> When we try to load a kernel via the QEMU firmware device, we currently
> "return -1;" if no kernel was specified on the QEMU command line. This
> leads to the usage output, which is confusing (since nothing on the
> command line was really wrong), but also somewhat hides the actual error
> message.
> 
> Return CMD_RET_FAILURE (1), as it's a proper error, and make the message
> more clear that this is not only a "warning".
> 
> This helps to call this command in boot scripts, and to gracefully
> continue if this doesn't work.
> 
> Signed-off-by: Andre Przywara 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/3] qfw: store loaded file size in environment variable

2022-10-24 Thread Tom Rini
On Mon, Oct 10, 2022 at 06:01:20PM +0100, Andre Przywara wrote:

> At the moment the QEMU firmware command just prints the size of the
> loaded binaries on the console.
> To go with all the other load methods, and many boot scripts'
> expectations, also store the size of the file loaded last in the
> environment variable "filesize".
> We first put the kernel size in there, but overwrite this with the
> initrd size, should we have one, because this is probably the more
> prominent user of $filesize (in the booti or bootz command).
> 
> Signed-off-by: Andre Przywara 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2] gpio: adp5585: add gpio driver for ADP5585 I/O Expander Controller

2022-10-24 Thread Tom Rini
On Sun, Oct 09, 2022 at 11:19:22AM +0800, Alice Guo (OSS) wrote:

> From: Alice Guo 
> 
> Add gpio driver for ADP5585 I/O Expander Controller. The ADP5585 is a 10
> input/output port expander and can be used to increase the number of
> I/Os available to a processor.
> 
> Signed-off-by: Alice Guo 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v4 4/4] config/aspeed: Enable NC-SI support

2022-10-24 Thread Tom Rini
On Mon, Aug 08, 2022 at 09:46:06PM +0930, Joel Stanley wrote:

> Aspeed BMCs are commonly used with NC-SI. A system indicates the driver
> should configure the link over NC-SI using the device tree.
> 
> Add it to the defconfig so we get compile coverage of the driver, even
> if the EVBs do not normally use it.
> 
> Signed-off-by: Joel Stanley 
> Reviewed-by: Ramon Fried 
> Reviewed-by: Cédric Le Goater 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v4 3/4] net/ftgmac100: Add NC-SI mode support

2022-10-24 Thread Tom Rini
On Mon, Aug 08, 2022 at 09:46:05PM +0930, Joel Stanley wrote:

> From: Samuel Mendoza-Jonas 
> 
> Update the ftgmac100 driver to support NC-SI instead of an mdio phy
> where available. This is a common setup for Aspeed AST2x00 platforms.
> 
> NC-SI mode is determined from the device-tree if either phy-mode sets it
> or the use-ncsi property exists. If set then normal mdio setup is
> skipped in favour of the NC-SI phy.
> 
> Signed-off-by: Samuel Mendoza-Jonas 
> Signed-off-by: Joel Stanley 
> Reviewed-by: Cédric Le Goater 
> Reviewed-by: Ramon Fried 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v3] imx: imx8qm: cgtqmx8: switch to binman

2022-10-24 Thread Stefano Babic

On 24.10.22 13:59, Oliver Graute wrote:

On 24/10/22, Stefano Babic wrote:

On 24.10.22 13:37, Fabio Estevam wrote:

Hi Stefano and Oliver,

On Tue, May 3, 2022 at 7:49 AM Oliver Graute
 wrote:


Switch to use binman to pack images

Signed-off-by: Oliver Graute 
Reviewed-by: Fabio Estevam 
Reviewed-by: Simon Glass 
---
Changes for v3
   -added Reviewed-by
   -rebased on master

   arch/arm/dts/imx8qm-cgtqmx8.dts | 1 +
   arch/arm/mach-imx/imx8/Kconfig  | 1 +
   board/congatec/cgtqmx8/imximage.cfg | 4 ++--
   configs/cgtqmx8_defconfig   | 2 +-
   doc/board/congatec/cgtqmx8.rst  | 3 +--
   5 files changed, 6 insertions(+), 5 deletions(-)


Just realized that v3 does not include imx8qm-u-boot.dtsi and this breaks CI.



Right - as well as V4, this is what I tried to merge and breaks. I have drop
it.


The previous v2 did include it:
https://patchwork.ozlabs.org/project/uboot/patch/20220221090139.10066-1-oliver.gra...@kococonnector.com/


Thanks for noting this - Oliver, can you check and repost a V5, then ?


The arch/arm/dts/imx8qm-u-boot.dtsi  is applied on the binman Patch for
"PATCH v3 imx: imx8qm-rom7720: switch to binman"

So if you first apply the patches for the imx8qm-rom7720 Board it should work.



Ok, thanks for tipp - I apply both and will test again

Stefano




https://patchwork.ozlabs.org/project/uboot/patch/20221007130945.12493-1-oliver.gra...@kococonnector.com/

Best regards,

Oliver


--
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=



Re: [PATCH v4 2/4] cmd: Add ncsi command

2022-10-24 Thread Tom Rini
On Mon, Aug 08, 2022 at 09:46:04PM +0930, Joel Stanley wrote:

> From: Samuel Mendoza-Jonas 
> 
> Adds an "ncsi" command to manually start NC-SI configuration.
> 
> Signed-off-by: Samuel Mendoza-Jonas 
> Signed-off-by: Joel Stanley 
> Reviewed-by: Cédric Le Goater 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v4 1/4] net: NC-SI setup and handling

2022-10-24 Thread Tom Rini
On Mon, Aug 08, 2022 at 09:46:03PM +0930, Joel Stanley wrote:

> From: Samuel Mendoza-Jonas 
> 
> Add the handling of NC-SI ethernet frames, and add a check at the start
> of net_loop() to configure NC-SI before starting other network commands.
> 
> Signed-off-by: Samuel Mendoza-Jonas 
> Signed-off-by: Joel Stanley 
> Reviewed-by: Cédric Le Goater 
> Reviewed-by: Ramon Fried 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/2] config_whitelist: remove CONFIG_KM_UPDATE_UBOOT

2022-10-24 Thread Tom Rini
On Mon, Oct 17, 2022 at 11:43:59AM +0200, Holger Brunck wrote:

> This option is already gone.
> 
> Signed-off-by: Holger Brunck 

For changes that only touch scripts/config_whitelist.txt we don't need
a patch, I re-generate the file from time to time. This has been
deferred as I finally re-generated the file again.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v6 10/10] arm_ffa: efi: corstone1000: enable MM communication

2022-10-24 Thread Ilias Apalodimas
On Thu, Oct 13, 2022 at 11:38:57AM +0100, Abdellatif El Khlifi wrote:
> turn on EFI MM communication
> 
> On corstone1000 platform MM communication between u-boot
> and the secure world (Optee) is done using the FF-A bus.
> 
> Signed-off-by: Abdellatif El Khlifi 
> Cc: Tom Rini 
> Cc: Simon Glass 
> Cc: Ilias Apalodimas 
> Cc: Jens Wiklander 
> 
> ---
> 
> Changelog:
> ===
> 
> v6:
> 
> * corstone-1000: enable optee driver
> * corstone-1000: remove CONFIG_ARM_FFA_EFI_RUNTIME_MODE from the defconfig
> 
> v4:
> 
> * corstone-1000: turn on EFI MM communication
> 
>  configs/corstone1000_defconfig | 4 
>  include/configs/corstone1000.h | 9 +
>  2 files changed, 13 insertions(+)
> 
> diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
> index ed2e0fe70a..4c9ed9fb71 100644
> --- a/configs/corstone1000_defconfig
> +++ b/configs/corstone1000_defconfig
> @@ -52,3 +52,7 @@ CONFIG_DM_SERIAL=y
>  CONFIG_USB=y
>  CONFIG_USB_ISP1760=y
>  CONFIG_ERRNO_STR=y
> +CONFIG_EFI_MM_COMM_TEE=y
> +CONFIG_TEE=y
> +CONFIG_OPTEE=y
> +CONFIG_ARM_FFA_TRANSPORT=y
> diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
> index 8e0230c135..997d0bebaf 100644
> --- a/include/configs/corstone1000.h
> +++ b/include/configs/corstone1000.h
> @@ -14,6 +14,15 @@
>  
>  #include 
>  
> +#define FFA_SHARED_MM_BUFFER_SIZESZ_4K /* 4 KB */
> +
> +/*
> + * shared buffer physical address used for communication between
> + * u-boot and the MM SP
> + */
> +#define FFA_SHARED_MM_BUFFER_ADDR(0x023F8000)
> +#define FFA_SHARED_MM_BUFFER_OFFSET  (0)

The rest of the declarations on this file don't have () so please remove
them.  Also is FFA_SHARED_MM_BUFFER_ADDR used anywhere that would justify UL
in the suffix?

Thanks
/Ilias
> +
>  #define V2M_BASE 0x8000
>  
>  #define CONFIG_PL011_CLOCK   5000
> -- 
> 2.17.1
> 


Re: [PATCH v6 07/10] arm_ffa: introduce Sandbox test cases for UCLASS_FFA

2022-10-24 Thread Ilias Apalodimas
Hi Abdellatif
On Thu, Oct 13, 2022 at 11:38:54AM +0100, Abdellatif El Khlifi wrote:
> Add functional test cases for the FF-A core driver
> 
> These tests rely on the FF-A Sandbox driver which helps in
>  inspecting the FF-A core driver.

This looks ok from me, but I'd prefer Simon having a quick look, since I am
not an expert when it comes to sandbox and testing 

Thanks
/Ilias
> 
> Signed-off-by: Abdellatif El Khlifi 
> Cc: Tom Rini 
> Cc: Simon Glass 
> Cc: Ilias Apalodimas 
> Cc: Jens Wiklander 
> 
> ---
> 
> Changelog:
> ===
> 
> v4: align sandbox tests with the new FF-A driver interfaces
>  and new way of error handling
> 
> v1: introduce sandbox tests
> 
>  MAINTAINERS  |   1 +
>  test/dm/Makefile |   2 +
>  test/dm/ffa.c| 394 +++
>  3 files changed, 397 insertions(+)
>  create mode 100644 test/dm/ffa.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 598ae76e16..bf198f4ce1 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -256,6 +256,7 @@ F:doc/arch/arm64.ffa.rst
>  F:   drivers/firmware/arm-ffa/
>  F:   include/arm_ffa.h
>  F:   include/sandbox_arm_ffa.h
> +F:   test/dm/ffa.c
>  
>  ARM FREESCALE IMX
>  M:   Stefano Babic 
> diff --git a/test/dm/Makefile b/test/dm/Makefile
> index 5178daa7cf..e5bc4b4bd6 100644
> --- a/test/dm/Makefile
> +++ b/test/dm/Makefile
> @@ -1,6 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0+
>  #
>  # Copyright (c) 2013 Google, Inc
> +# (C) Copyright 2022 ARM Limited
>  
>  obj-$(CONFIG_UT_DM) += test-dm.o
>  
> @@ -81,6 +82,7 @@ obj-$(CONFIG_POWER_DOMAIN) += power-domain.o
>  obj-$(CONFIG_ACPI_PMC) += pmc.o
>  obj-$(CONFIG_DM_PMIC) += pmic.o
>  obj-$(CONFIG_DM_PWM) += pwm.o
> +obj-$(CONFIG_SANDBOX_FFA) += ffa.o
>  obj-$(CONFIG_QFW) += qfw.o
>  obj-$(CONFIG_RAM) += ram.o
>  obj-y += regmap.o
> diff --git a/test/dm/ffa.c b/test/dm/ffa.c
> new file mode 100644
> index 00..052d5fc3f4
> --- /dev/null
> +++ b/test/dm/ffa.c
> @@ -0,0 +1,394 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Functional tests for UCLASS_FFA  class
> + *
> + * (C) Copyright 2022 ARM Limited
> + * Abdellatif El Khlifi 
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "../../drivers/firmware/arm-ffa/sandbox_arm_ffa_prv.h"
> +#include 
> +#include 
> +#include 
> +
> +/* Macros */
> +
> +#define LOG_MSG_SZ (100)
> +#define LOG_CMD_SZ (LOG_MSG_SZ * 2)
> +
> +/* Functional tests for the UCLASS_FFA */
> +
> +static int dm_test_ffa_log(struct unit_test_state *uts, char *msg)
> +{
> + char cmd[LOG_CMD_SZ] = {0};
> +
> + console_record_reset();
> +
> + snprintf(cmd, LOG_CMD_SZ, "echo \"%s\"", msg);
> + run_command(cmd, 0);
> +
> + ut_assert_console_end();
> +
> + return CMD_RET_SUCCESS;
> +}
> +
> +static int check_fwk_version(struct ffa_prvdata *prvdata, struct 
> sandbox_ffa_prvdata *sdx_prvdata,
> +  struct unit_test_state *uts)
> +{
> + if (prvdata->fwk_version != sdx_prvdata->fwk_version) {
> + char msg[LOG_MSG_SZ] = {0};
> +
> + snprintf(msg, LOG_MSG_SZ,
> +  "[%s]: Error: framework version: core = 0x%x , sandbox 
>  = 0x%x", __func__,
> +  prvdata->fwk_version,
> + sdx_prvdata->fwk_version);
> +
> + dm_test_ffa_log(uts, msg);
> + return CMD_RET_FAILURE;
> + }
> + return CMD_RET_SUCCESS;
> +}
> +
> +static int check_endpoint_id(struct ffa_prvdata *prvdata, struct 
> unit_test_state *uts)
> +{
> + if (prvdata->id) {
> + char msg[LOG_MSG_SZ] = {0};
> +
> + snprintf(msg, LOG_MSG_SZ,
> +  "[%s]: Error: endpoint id: core = 0x%x", __func__, 
> prvdata->id);
> + dm_test_ffa_log(uts, msg);
> + return CMD_RET_FAILURE;
> + }
> + return CMD_RET_SUCCESS;
> +}
> +
> +static int check_core_dev(struct ffa_prvdata *prvdata, struct 
> unit_test_state *uts)
> +{
> + if (!prvdata->dev) {
> + char msg[LOG_MSG_SZ] = {0};
> +
> + snprintf(msg, LOG_MSG_SZ, "[%s]: Error: core device NULL", 
> __func__);
> + dm_test_ffa_log(uts, msg);
> + return CMD_RET_FAILURE;
> + }
> + return CMD_RET_SUCCESS;
> +}
> +
> +static int check_sandbox_dev(struct sandbox_ffa_prvdata *sdx_prvdata, struct 
> unit_test_state *uts)
> +{
> + if (!sdx_prvdata->dev) {
> + char msg[LOG_MSG_SZ] = {0};
> +
> + snprintf(msg, LOG_MSG_SZ, "[%s]: Error: sandbox device NULL", 
> __func__);
> + dm_test_ffa_log(uts, msg);
> + return CMD_RET_FAILURE;
> + }
> + return CMD_RET_SUCCESS;
> +}
> +
> +static int check_rxtxbuf(struct ffa_prvdata *prvdata, struct unit_test_state 
> *uts)
> +{
> + if (!prvdata->pair.rxbuf && prvdata->pair.txbuf) {
> + char msg[LOG_MSG_SZ] = {0};
> +
> + snprintf(msg, LOG_MSG_SZ, "[%s]: Error: rxbuf = 0x%llx txbuf = 
> 0x%llx", __func__,
> 

Re: [PATCH v6 04/10] arm_ffa: efi: unmap RX/TX buffers

2022-10-24 Thread Ilias Apalodimas
On Thu, Oct 13, 2022 at 11:38:51AM +0100, Abdellatif El Khlifi wrote:
> unmap RX/TX buffers at ExitBootServices()
> 
> Unmapping the RX/TX buffers created by u-boot is needed before EFI
> runtime.
> 
> At EFI runtime the linux kernel takes care of allocating its own RX/TX
> buffers and registering them with the secure world.
> 
> Secure world should be using the RX/TX buffers created by the kernel.
> So, RX/TX buffers created by u-boot must be unmapped.
> 
> Signed-off-by: Abdellatif El Khlifi 
> Cc: Tom Rini 
> Cc: Simon Glass 
> Cc: Ilias Apalodimas 
> Cc: Jens Wiklander 
> ---
>  lib/efi_loader/efi_boottime.c | 15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index a56021559b..2054b33568 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -3,6 +3,9 @@
>   * EFI application boot time services
>   *
>   * Copyright (c) 2016 Alexander Graf
> + *
> + * (C) Copyright 2022 ARM Limited
> + * Abdellatif El Khlifi 
>   */
>  
>  #include 
> @@ -23,6 +26,10 @@
>  #include 
>  #include 
>  
> +#if CONFIG_IS_ENABLED(ARM_FFA_TRANSPORT)
> +#include 
> +#endif
> +
>  DECLARE_GLOBAL_DATA_PTR;
>  
>  /* Task priority level */
> @@ -2178,6 +2185,14 @@ static efi_status_t EFIAPI 
> efi_exit_boot_services(efi_handle_t image_handle,
>   dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL);
>   }
>  
> +#if CONFIG_IS_ENABLED(ARM_FFA_TRANSPORT)
> + /* unmap FF-A RX/TX buffers */
> + if (ffa_bus_ops_get()->rxtx_unmap())
> + debug("[efi_boottime][ERROR]: can not unmap FF-A RX/TX 
> buffers\n");

Just do log_err() here and get rid of the else

> + else
> + debug("[efi_boottime][INFO]: FF-A RX/TX buffers 
> unmapped\n");
> +#endif
> +
>   /* Patch out unsupported runtime function */
>   efi_runtime_detach();
>  
> -- 
> 2.17.1
> 

Thanks
/Ilias


  1   2   >