2019-10-15 12:54:40 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/**
|
2023-05-17 07:17:16 +00:00
|
|
|
* ufs.c - UFS specific U-Boot commands
|
2019-10-15 12:54:40 +00:00
|
|
|
*
|
2023-11-01 20:56:03 +00:00
|
|
|
* Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com
|
2019-10-15 12:54:40 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
|
|
|
#include <ufs.h>
|
|
|
|
|
2020-05-10 17:40:03 +00:00
|
|
|
static int do_ufs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2019-10-15 12:54:40 +00:00
|
|
|
{
|
|
|
|
int dev, ret;
|
|
|
|
|
|
|
|
if (argc >= 2) {
|
|
|
|
if (!strcmp(argv[1], "init")) {
|
|
|
|
if (argc == 3) {
|
2021-07-24 15:03:30 +00:00
|
|
|
dev = dectoul(argv[2], NULL);
|
2019-10-15 12:54:40 +00:00
|
|
|
ret = ufs_probe_dev(dev);
|
|
|
|
if (ret)
|
|
|
|
return CMD_RET_FAILURE;
|
|
|
|
} else {
|
|
|
|
ufs_probe();
|
|
|
|
}
|
|
|
|
|
|
|
|
return CMD_RET_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return CMD_RET_USAGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
U_BOOT_CMD(ufs, 3, 1, do_ufs,
|
|
|
|
"UFS sub system",
|
|
|
|
"init [dev] - init UFS subsystem\n"
|
|
|
|
);
|