From dafd97ff70eaf191285fb1e4580c84b6e63c1e2b Mon Sep 17 00:00:00 2001 From: mingming lee Date: Thu, 16 Jan 2020 16:11:39 +0800 Subject: configs: mt8518: set global variables for fastboot set common fastboot variables for mt8518 Signed-off-by: mingming lee --- include/configs/mt8518.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/mt8518.h b/include/configs/mt8518.h index 514722be990..276fbc285f8 100644 --- a/include/configs/mt8518.h +++ b/include/configs/mt8518.h @@ -11,7 +11,6 @@ #include -/* Machine ID */ #define CONFIG_SYS_NONCACHED_MEMORY SZ_1M #define CONFIG_CPU_ARMV8 @@ -54,10 +53,15 @@ #define ENV_BOOT_CMD \ "mtk_boot=run boot_rd_img;bootm;\0" +#define ENV_FASTBOOT \ + "serial#=1234567890ABCDEF\0" \ + "board=mt8518\0" + #define CONFIG_EXTRA_ENV_SETTINGS \ "fdt_high=0x6c000000\0" \ ENV_DEVICE_SETTINGS \ ENV_BOOT_READ_IMAGE \ + ENV_FASTBOOT \ ENV_BOOT_CMD \ "bootcmd=run mtk_boot;\0" \ -- cgit v1.3.1 From 1526bcce0f7285087621e16e6720636d01839da8 Mon Sep 17 00:00:00 2001 From: Angelo Durgehello Date: Tue, 21 Jan 2020 10:37:27 +0100 Subject: common: add blkcache init On m68k, block_cache list is relocated, but next and prev list pointers are not adjusted to the relocated struct list_head address, so the first iteration over the block_cache list hangs. This patch initializes the block_cache list after relocation. Signed-off-by: Angelo Durgehello Reviewed-by: Eric Nelson --- common/board_r.c | 3 +++ drivers/block/blkcache.c | 9 ++++++++- include/blk.h | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/common/board_r.c b/common/board_r.c index 8a0c1114e77..4f56c19fcc9 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -864,6 +864,9 @@ static init_fnc_t init_sequence_r[] = { #endif #if defined(CONFIG_PRAM) initr_mem, +#endif +#ifdef CONFIG_BLOCK_CACHE + blkcache_init, #endif run_main_loop, }; diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c index 1fa64989d3f..f603aa129d4 100644 --- a/drivers/block/blkcache.c +++ b/drivers/block/blkcache.c @@ -21,13 +21,20 @@ struct block_cache_node { char *cache; }; -static LIST_HEAD(block_cache); +static struct list_head block_cache; static struct block_cache_stats _stats = { .max_blocks_per_entry = 8, .max_entries = 32 }; +int blkcache_init(void) +{ + INIT_LIST_HEAD(&block_cache); + + return 0; +} + static struct block_cache_node *cache_find(int iftype, int devnum, lbaint_t start, lbaint_t blkcnt, unsigned long blksz) diff --git a/include/blk.h b/include/blk.h index d0c033aece0..65db69f5d9e 100644 --- a/include/blk.h +++ b/include/blk.h @@ -113,6 +113,12 @@ struct blk_desc { (PAD_SIZE(size, blk_desc->blksz)) #if CONFIG_IS_ENABLED(BLOCK_CACHE) + +/** + * blkcache_init() - initialize the block cache list pointers + */ +int blkcache_init(void); + /** * blkcache_read() - attempt to read a set of blocks from cache * -- cgit v1.3.1 From 50fe8df2c2cb863e0ab7d4c1240f2216ba184922 Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Wed, 22 Jan 2020 16:59:55 -0700 Subject: common: blk: fix comment about blkcache_read return value The blkcache_read() routine returns 1 (true) to indicate that a block was found in the cache and returned, or 0 if not. Signed-off-by: Eric Nelson --- include/blk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/blk.h b/include/blk.h index 65db69f5d9e..6f541bb2bae 100644 --- a/include/blk.h +++ b/include/blk.h @@ -129,7 +129,7 @@ int blkcache_init(void); * @param blksz - size in bytes of each block * @param buf - buffer to contain cached data * - * @return - '1' if block returned from cache, '0' otherwise. + * @return - 1 if block returned from cache, 0 otherwise. */ int blkcache_read(int iftype, int dev, lbaint_t start, lbaint_t blkcnt, -- cgit v1.3.1 From 683b7c2a170a71bded99bb9e7dfd26372427ca1c Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Fri, 24 Jan 2020 13:45:56 +0100 Subject: mtd: add prototypes for weak function This patch adds a prototype for the weak function board_mtdparts_default(). It solves one warning when compiling with W=1 on stm32mp1 board: board/st/stm32mp1/stm32mp1.c: warning: no previous prototype for 'board_mtdparts_default' [-Wmissing-prototypes] void board_mtdparts_default(const char **mtdids, const char **mtdparts) ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Patrick Delaunay --- include/mtd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/mtd.h b/include/mtd.h index 65fcd3c700b..b0f8693386e 100644 --- a/include/mtd.h +++ b/include/mtd.h @@ -11,4 +11,6 @@ int mtd_probe(struct udevice *dev); int mtd_probe_devices(void); +void board_mtdparts_default(const char **mtdids, const char **mtdparts); + #endif /* _MTD_H_ */ -- cgit v1.3.1