1 /* 2 * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: (GPL-2.0+ OR MIT) 5 */ 6 7 #include <common.h> 8 #include <command.h> 9 #include <dm.h> 10 #include <rksfc.h> 11 12 static int rksfc_curr_dev; 13 static int do_rksfc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 14 { 15 int ret; 16 17 if (argc == 2) { 18 if (strncmp(argv[1], "scan", 4) == 0) { 19 ret = rksfc_scan_namespace(); 20 if (ret) 21 return CMD_RET_FAILURE; 22 23 return ret; 24 } 25 } 26 27 return blk_common_cmd(argc, argv, IF_TYPE_RKSFC, &rksfc_curr_dev); 28 } 29 30 U_BOOT_CMD( 31 rksfc, 8, 1, do_rksfc, 32 "rockchip sfc sub-system", 33 "scan - scan Sfc devices\n" 34 "rksfc info - show all available Sfc devices\n" 35 "rksfc device [dev] - show or set current Sfc device\n" 36 "rksfc part [dev] - print partition table of one or all Sfc devices\n" 37 "rksfc read addr blk# cnt - read `cnt' blocks starting at block\n" 38 " `blk#' to memory address `addr'\n" 39 "rksfc write addr blk# cnt - write `cnt' blocks starting at block\n" 40 " `blk#' from memory address `addr'" 41 ); 42