void platform_cleanup(void *platform) { struct remoteproc *rproc = platform; if (rproc) remoteproc_remove(rproc); cleanup_system(); }
static struct remoteproc * platform_create_proc(int proc_index, int rsc_index) { void *rsc_table; int rsc_size; int ret; metal_phys_addr_t pa; (void) proc_index; rsc_table = get_resource_table(rsc_index, &rsc_size); /* Register IPI device */ (void)metal_register_generic_device(&scugic_device); /* Initialize remoteproc instance */ if (!remoteproc_init(&rproc_inst, &zynq_a9_proc_ops, &rproc_priv)) return NULL; /* * Mmap shared memories * Or shall we constraint that they will be set as carved out * in the resource table? */ /* mmap resource table */ pa = (metal_phys_addr_t)rsc_table; (void *)remoteproc_mmap(&rproc_inst, &pa, NULL, rsc_size, NORM_NONCACHE | STRONG_ORDERED, &rproc_inst.rsc_io); /* mmap shared memory */ pa = SHARED_MEM_PA; (void *)remoteproc_mmap(&rproc_inst, &pa, NULL, SHARED_MEM_SIZE, NORM_NONCACHE | STRONG_ORDERED, NULL); /* parse resource table to remoteproc */ ret = remoteproc_set_rsc_table(&rproc_inst, rsc_table, rsc_size); if (ret) { xil_printf("Failed to intialize remoteproc\r\n"); remoteproc_remove(&rproc_inst); return NULL; } xil_printf("Initialize remoteproc successfully.\r\n"); return &rproc_inst; }
static struct remoteproc * platform_create_proc(int proc_index, int rsc_index) { void *rsc_table; int rsc_size; int ret; metal_phys_addr_t pa; (void)proc_index; (void)rsc_index; rsc_size = RSC_MEM_SIZE; /* Initialize remoteproc instance */ if (!remoteproc_init(&rproc_inst, &zynqmp_linux_r5_proc_ops, &rproc_priv)) return NULL; printf("Successfully initialized remoteproc\r\n"); /* Mmap resource table */ pa = RSC_MEM_PA; printf("Calling mmap resource table.\r\n"); rsc_table = remoteproc_mmap(&rproc_inst, &pa, NULL, rsc_size, 0, NULL); if (!rsc_table) { fprintf(stderr, "ERROR: Failed to mmap resource table.\r\n"); return NULL; } printf("Successfully mmap resource table.\r\n"); /* parse resource table to remoteproc */ ret = remoteproc_set_rsc_table(&rproc_inst, rsc_table, rsc_size); if (ret) { printf("Failed to intialize remoteproc\r\n"); remoteproc_remove(&rproc_inst); return NULL; } printf("Successfully set resource table to remoteproc.\r\n"); return &rproc_inst; }