+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2016 Toradex, Inc.
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
[33] = "Colibri iMX7 Dual 512MB",
[34] = "Apalis TK1 2GB",
[35] = "Apalis iMX6 Dual 1GB IT",
+ [36] = "Colibri iMX6ULL 256MB",
+ [37] = "Apalis iMX8 QuadMax 4GB Wi-Fi / Bluetooth",
+ [38] = "Colibri iMX8X",
+ [39] = "Colibri iMX7 Dual 1GB (eMMC)",
+ [40] = "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth IT",
+ [41] = "Colibri iMX7 Dual 512MB EPDC",
+ [42] = "Apalis TK1 4GB",
};
#ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC
ret = -EIO;
goto out;
}
- /* Flush cache after read */
- flush_cache((ulong)(unsigned char *)config_block, 512);
} else {
/* Just writing one 512 byte block */
if (blk_dwrite(mmc_get_blk_desc(mmc), blk_start, 1,
static int read_tdx_cfg_block_from_nand(unsigned char *config_block)
{
size_t size = TDX_CFG_BLOCK_MAX_SIZE;
+ struct mtd_info *mtd = get_nand_dev_by_index(0);
+
+ if (!mtd)
+ return -ENODEV;
/* Read production parameter config block from NAND page */
- return nand_read_skip_bad(get_nand_dev_by_index(0),
- CONFIG_TDX_CFG_BLOCK_OFFSET,
+ return nand_read_skip_bad(mtd, CONFIG_TDX_CFG_BLOCK_OFFSET,
&size, NULL, TDX_CFG_BLOCK_MAX_SIZE,
config_block);
}