]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/commitdiff
remoteproc: Remove getting CPU Id from firmware
authorWendy Liang <jliang@xilinx.com>
Wed, 29 Jun 2016 21:21:28 +0000 (14:21 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:44 +0000 (22:01 -0700)
The CPU ID is the ID defined in the remoteproc data table
in the application, the user application should know
what what data should be used to do the remoteproc initialization.
It is not necessary to have CPU ID in the firmware.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/remoteproc/remoteproc.c

index 792c10a78a835aae28935851e2f0ad998fb4d706..f3ebe8fb1c3b9c171218abcb1d9036448fbfdafd 100644 (file)
@@ -183,7 +183,7 @@ int remoteproc_init(char *fw_name, void *pdata,
        struct remote_proc *rproc;
        struct resource_table *rsc_table;
        unsigned int fw_addr, fw_size, rsc_size;
-       int status, cpu_id;
+       int status;
 
        if (!fw_name) {
                return RPROC_ERR_PARAM;
@@ -192,35 +192,29 @@ int remoteproc_init(char *fw_name, void *pdata,
        rproc = env_allocate_memory(sizeof(struct remote_proc));
        if (rproc) {
                memset((void *)rproc, 0x00, sizeof(struct remote_proc));
-               /* Get CPU ID for the given firmware name */
-               cpu_id = hil_get_cpuforfw(fw_name);
-               if (cpu_id >= 0) {
-                       /* Create proc instance */
-                       rproc->proc = hil_create_proc(pdata, cpu_id);
-                       if (rproc->proc) {
-                               /* Retrieve firmware attributes */
-                               status =
-                                   hil_get_firmware(fw_name, &fw_addr,
-                                                    &fw_size);
-                               if (!status) {
-                                       /* Initialize ELF loader - currently only ELF format is supported */
-                                       rproc->loader =
-                                           remoteproc_loader_init(ELF_LOADER);
-                                       if (rproc->loader) {
-                                               /* Attach the given firmware with the ELF parser/loader */
-                                               status =
-                                                   remoteproc_loader_attach_firmware
-                                                   (rproc->loader,
-                                                    (void *)fw_addr);
-                                       } else {
-                                               status = RPROC_ERR_LOADER;
-                                       }
+               /* Create proc instance */
+               rproc->proc = hil_create_proc(pdata, HIL_RSVD_CPU_ID);
+               if (rproc->proc) {
+                       /* Retrieve firmware attributes */
+                       status =
+                           hil_get_firmware(fw_name, &fw_addr,
+                                            &fw_size);
+                       if (!status) {
+                               /* Initialize ELF loader - currently only ELF format is supported */
+                               rproc->loader =
+                                   remoteproc_loader_init(ELF_LOADER);
+                               if (rproc->loader) {
+                                       /* Attach the given firmware with the ELF parser/loader */
+                                       status =
+                                           remoteproc_loader_attach_firmware
+                                           (rproc->loader,
+                                            (void *)fw_addr);
+                               } else {
+                                       status = RPROC_ERR_LOADER;
                                }
-                       } else {
-                               status = RPROC_ERR_NO_MEM;
                        }
                } else {
-                       status = RPROC_ERR_INVLD_FW;
+                       status = RPROC_ERR_NO_MEM;
                }
        } else {
                status = RPROC_ERR_NO_MEM;