Convert CONFIG_SYS_SPL_MALLOC_SIZE et al to Kconfig
[platform/kernel/u-boot.git] / cmd / remoteproc.c
index 9702cf0..ca3b436 100644 (file)
@@ -32,7 +32,11 @@ static int print_remoteproc_list(void)
                struct dm_rproc_uclass_pdata *uc_pdata;
                const struct dm_rproc_ops *ops = rproc_get_ops(dev);
 
-               uc_pdata = dev_get_uclass_platdata(dev);
+               uc_pdata = dev_get_uclass_plat(dev);
+
+               /* Do not print if rproc is not probed */
+               if (!(dev_get_flags(dev) & DM_FLAG_ACTIVATED))
+                       continue;
 
                switch (uc_pdata->mem_type) {
                case RPROC_INTERNAL_MEMORY_MAPPED:
@@ -43,7 +47,7 @@ static int print_remoteproc_list(void)
                        break;
                }
                printf("%d - Name:'%s' type:'%s' supports: %s%s%s%s%s%s\n",
-                      dev->seq,
+                      dev_seq(dev),
                       uc_pdata->name,
                       type,
                       ops->load ? "load " : "",
@@ -65,7 +69,7 @@ static int print_remoteproc_list(void)
  *
  * Return: 0 if no error, else returns appropriate error value.
  */
-static int do_rproc_init(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_rproc_init(struct cmd_tbl *cmdtp, int flag, int argc,
                         char *const argv[])
 {
        int id;
@@ -80,7 +84,7 @@ static int do_rproc_init(cmd_tbl_t *cmdtp, int flag, int argc,
                        return 0;
                printf("Few Remote Processors failed to be initialized\n");
        } else if (argc == 2) {
-               id = (int)simple_strtoul(argv[1], NULL, 10);
+               id = (int)dectoul(argv[1], NULL);
                if (!rproc_dev_init(id))
                        return 0;
                printf("Remote Processor %d failed to be initialized\n", id);
@@ -98,14 +102,9 @@ static int do_rproc_init(cmd_tbl_t *cmdtp, int flag, int argc,
  *
  * Return: 0 if no error, else returns appropriate error value.
  */
-static int do_remoteproc_list(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_remoteproc_list(struct cmd_tbl *cmdtp, int flag, int argc,
                              char *const argv[])
 {
-       if (!rproc_is_initialized()) {
-               printf("\t Remote Processors is not initialized\n");
-               return CMD_RET_USAGE;
-       }
-
        if (print_remoteproc_list())
                return CMD_RET_FAILURE;
 
@@ -121,7 +120,7 @@ static int do_remoteproc_list(cmd_tbl_t *cmdtp, int flag, int argc,
  *
  * Return: 0 if no error, else returns appropriate error value.
  */
-static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_remoteproc_load(struct cmd_tbl *cmdtp, int flag, int argc,
                              char *const argv[])
 {
        ulong addr, size;
@@ -130,10 +129,10 @@ static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
        if (argc != 4)
                return CMD_RET_USAGE;
 
-       id = (int)simple_strtoul(argv[1], NULL, 10);
-       addr = simple_strtoul(argv[2], NULL, 16);
+       id = (int)dectoul(argv[1], NULL);
+       addr = hextoul(argv[2], NULL);
 
-       size = simple_strtoul(argv[3], NULL, 16);
+       size = hextoul(argv[3], NULL);
 
        if (!size) {
                printf("\t Expect some size??\n");
@@ -160,7 +159,7 @@ static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
  *
  * Return: 0 if no error, else returns appropriate error value.
  */
-static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_remoteproc_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
                                 char *const argv[])
 {
        int id, ret = CMD_RET_USAGE;
@@ -168,7 +167,7 @@ static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
        if (argc != 2)
                return CMD_RET_USAGE;
 
-       id = (int)simple_strtoul(argv[1], NULL, 10);
+       id = (int)dectoul(argv[1], NULL);
 
        if (!strcmp(argv[0], "start")) {
                ret = rproc_start(id);
@@ -202,7 +201,7 @@ static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
        return ret ? CMD_RET_FAILURE : 0;
 }
 
-static cmd_tbl_t cmd_remoteproc_sub[] = {
+static struct cmd_tbl cmd_remoteproc_sub[] = {
        U_BOOT_CMD_MKENT(init, 1, 1, do_rproc_init,
                         "Enumerate and initialize the remote processor(s)",
                         "id - ID of the remote processor\n"
@@ -243,10 +242,10 @@ static cmd_tbl_t cmd_remoteproc_sub[] = {
  *
  * Return: 0 if no error, else returns appropriate error value.
  */
-static int do_remoteproc(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_remoteproc(struct cmd_tbl *cmdtp, int flag, int argc,
                         char *const argv[])
 {
-       cmd_tbl_t *c = NULL;
+       struct cmd_tbl *c = NULL;
 
        /* Strip off leading 'rproc' command argument */
        argc--;