57 PRINT_ERR(
"Malloc g_cmdLine space error!\n");
61#ifdef LOSCFG_STORAGE_EMMC
63 if (emmcDisk == NULL) {
64 PRINT_ERR(
"Get EMMC disk failed!\n");
69 COMMAND_LINE_SIZE / EMMC_SEC_SIZE, TRUE);
75#ifdef LOSCFG_STORAGE_SPINOR
78 PRINT_ERR(
"Get spinor mtd failed!\n");
82 ret = mtd->
read(mtd, COMMAND_LINE_ADDR, COMMAND_LINE_SIZE,
g_cmdLine);
83 if (ret == COMMAND_LINE_SIZE) {
88#ifdef LOSCFG_STORAGE_SPINAND
91 PRINT_ERR(
"Get nand mtd failed!\n");
95 ret = mtd->
read(mtd, COMMAND_LINE_ADDR, COMMAND_LINE_SIZE,
g_cmdLine);
96 if (ret == COMMAND_LINE_SIZE) {
101#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
102 struct MtdDev *mtd = GetCfiMtdDev();
104 PRINT_ERR(
"Get CFI mtd failed!\n");
108 ret = mtd->
read(mtd, CFIFLASH_BOOTARGS_ADDR, COMMAND_LINE_SIZE,
g_cmdLine);
109 if (ret == COMMAND_LINE_SIZE) {
114 PRINT_ERR(
"Read cmdline error!\n");
los_disk * los_get_mmcdisk_bytype(UINT8 type)
INT32 los_disk_read(INT32 drvID, VOID *buf, UINT64 sector, UINT32 count, BOOL useRead)
Read data from disk driver.
void * malloc(size_t size)
动态分配内存块大小
void * GetMtd(const char *type)
UINT32 eraseSize
4K, 跟PAGE_CACHE_SIZE对应
int(* read)(struct MtdDev *mtd, UINT64 start, UINT64 len, const char *buf)
读操作