From 1c9f8f6412de4447c4f6fadeac1919c89de005f7 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Fri, 21 Jun 2019 15:32:51 +0200 Subject: ext4: fix calculating inode blkcount for non-512 blocksize filesystems The block count entry in the EXT4 filesystem disk structures uses standard 512-bytes units for most of the typical files. The only exception are HUGE files, which use the filesystem block size, but those are not supported by uboot's EXT4 implementation anyway. This patch fixes the EXT4 code to use proper unit count for inode block count. This fixes errors reported by fsck.ext4 on disks with non-standard (i.e. 4KiB, in case of new flash drives) PHYSICAL block size after using 'ext4write' uboot's command. Signed-off-by: Marek Szyprowski Reviewed-by: Lukasz Majewski --- include/ext_common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/ext_common.h b/include/ext_common.h index 17c92f1750b..1c10c504748 100644 --- a/include/ext_common.h +++ b/include/ext_common.h @@ -21,6 +21,7 @@ #define __EXT_COMMON__ #include #define SECTOR_SIZE 0x200 +#define LOG2_SECTOR_SIZE 9 /* Magic value used to identify an ext2 filesystem. */ #define EXT2_MAGIC 0xEF53 -- cgit v1.2.3 From cd121bdb6df3fe8dfe45ff1e34f46f86b8f060c0 Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Sat, 29 Jun 2019 11:36:19 +0200 Subject: env: register erase command this patch adds basic changes for adding a erase-subcommand to env with this command the environment stored on non-volatile storage written by saveenv can be cleared. Signed-off-by: Frank Wunderlich squashed fixes - start message with "Erasing" - mark erase-function as optional - env: separate eraseenv from saveenv Suggested-by: Simon Goldschmidt Reviewed-by: Simon Goldschmidt --- include/environment.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/environment.h b/include/environment.h index cd966761416..de67cf4f0ea 100644 --- a/include/environment.h +++ b/include/environment.h @@ -200,6 +200,7 @@ enum env_operation { ENVOP_INIT, /* we want to call the init function */ ENVOP_LOAD, /* we want to call the load function */ ENVOP_SAVE, /* we want to call the save function */ + ENVOP_ERASE, /* we want to call the erase function */ }; struct env_driver { @@ -225,6 +226,15 @@ struct env_driver { */ int (*save)(void); + /** + * erase() - Erase the environment on storage + * + * This method is optional and required for 'eraseenv' to work. + * + * @return 0 if OK, -ve on error + */ + int (*erase)(void); + /** * init() - Set up the initial pre-relocation environment * @@ -303,6 +313,13 @@ int env_load(void); */ int env_save(void); +/** + * env_erase() - Erase the environment on storage + * + * @return 0 if OK, -ve on error + */ +int env_erase(void); + /** * env_fix_drivers() - Updates envdriver as per relocation */ -- cgit v1.2.3 From 70a64a070e79b657dcb4903299ccad0f5fff8267 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Wed, 3 Jul 2019 10:44:40 +0900 Subject: arm: qemu: fix failure in flash initialization if booting from TF-A If U-Boot is loaded and started from TF-A (you need to change SYS_TEXT_BASE to 0x60000000), it will hang up at flash initialization. If secure mode is off (default, or -machine virt,secure=off) at qemu, it will provide dtb with two flash memory banks: flash@0 { bank-width = <0x4>; reg = <0x0 0x0 0x0 0x4000000 0x0 0x4000000 0x0 0x4000000>; compatible = "cfi-flash"; }; If secure mode is on, on the other hand, qemu provides dtb with 1 bank: flash@0 { bank-width = <0x4>; reg = <0x0 0x4000000 0x0 0x4000000>; compatible = "cfi-flash"; }; As a result, flash_init()/flash_get_size() will eventually fail. With this patch applied, relevant CONFIG values are modified. Signed-off-by: AKASHI Takahiro Tested-by: Heinrich Schuchardt --- include/configs/qemu-arm.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h index 65fdb1e9298..35e3c5ad7a8 100644 --- a/include/configs/qemu-arm.h +++ b/include/configs/qemu-arm.h @@ -46,8 +46,13 @@ #define CONFIG_SYS_CBSIZE 512 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE +#ifdef CONFIG_TFABOOT +#define CONFIG_SYS_FLASH_BASE 0x4000000 +#define CONFIG_SYS_MAX_FLASH_BANKS 1 +#else #define CONFIG_SYS_FLASH_BASE 0x0 #define CONFIG_SYS_MAX_FLASH_BANKS 2 +#endif #define CONFIG_SYS_MAX_FLASH_SECT 256 /* Sector: 256K, Bank: 64M */ #endif /* __CONFIG_H */ -- cgit v1.2.3 From f752e5783b7300671a13587e864468f6742576c3 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 10 Jul 2019 10:03:13 +0200 Subject: power-domain.h: Fix typo %s/ot/to/ Signed-off-by: Anatolij Gustschin --- include/power-domain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/power-domain.h b/include/power-domain.h index 00996057b0d..07370709fe0 100644 --- a/include/power-domain.h +++ b/include/power-domain.h @@ -151,7 +151,7 @@ static inline int power_domain_on(struct power_domain *power_domain) #endif /** - * power_domain_off - Disable power ot a power domain. + * power_domain_off - Disable power to a power domain. * * @power_domain: A power domain struct that was previously successfully * requested by power_domain_get(). -- cgit v1.2.3