Not use remoteproc_plat in Zynq7 BM apps helpers
authorWendy Liang <jliang@xilinx.com>
Fri, 23 Sep 2016 22:35:53 +0000 (15:35 -0700)
committerWendy Liang <jliang@xilinx.com>
Fri, 14 Oct 2016 00:06:08 +0000 (17:06 -0700)
As remoteproc_plat has been removed, update the Zynq7 baremetal apps
helper functions not to use those APIs.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
apps/machine/zynq7/platform_info.c
apps/machine/zynq7/platform_info.h [deleted file]
apps/system/generic/machine/zynq7/CMakeLists.txt
apps/system/generic/machine/zynq7/helper.c
apps/system/generic/machine/zynq7/sys_init.c [deleted file]

index dbb22da1589e5a894d4f5a5042069a97f9831ced..1f18246e9f684a45a660e9d02532369d24268299 100644 (file)
  **************************************************************************/
 
 #include "openamp/hil.h"
-#include "openamp/remoteproc_plat.h"
 #include "metal/atomic.h"
-#include "platform_info.h"
 
-#define REMOTE_CPU_ID                     0
-
-/* Reference implementation that show cases platform_get_cpu_info and 
- platform_get_for_firmware API implementation for Bare metal environment */
+#define IPI0_VECT_ID            15
+#define IPI1_VECT_ID            14
+#define APU_CPU_ID              0
+#define RPMSG_CHAN_NAME         "rpmsg-openamp-demo-channel"
 
 extern struct hil_platform_ops zynq_a9_proc_ops;
 
-
-struct rproc_info_plat_local proc_table = {
-       {
-               /* CPU ID of master */
-               REMOTE_CPU_ID,
-
-               /* HIL platform ops table. */
-               &zynq_a9_proc_ops,
-       },
-       /* vring0 ipi device and vring descriptors memory device */
-       {
-               PLAT_RSC_VRING,
-               "generic",
-               "ipi0",
-               NULL,
-               "generic",
-               "vrings",
-       },
-       /* vring1 ipi device and vring descriptors memory device */
-       {
-               PLAT_RSC_VRING,
-               "generic",
-               "ipi1",
-               NULL,
-               "generic",
-               "vrings",
-       },
-       /* Shared memory device */
-       {
-               PLAT_RSC_SHM,
-               "shm",
-               0,  /* UNDEFINED */
-       },
-       /* Shared memory device */
-       {
-               PLAT_RSC_RPMSG_CHANNEL,
-               "rpmsg-openamp-demo-channel",
-       },
-       PLAT_RSC_LAST,
-};
-
 const struct firmware_info fw_table[] =
 {
        {"unknown",
@@ -100,4 +57,19 @@ const struct firmware_info fw_table[] =
         0}
 };
 
-int fw_table_size = sizeof(fw_table)/sizeof(struct firmware_info);
+const int fw_table_size = sizeof(fw_table)/sizeof(struct firmware_info);
+
+struct hil_proc *platform_create_proc(int proc_index)
+{
+       (void) proc_index;
+       struct hil_proc *proc;
+       proc = hil_create_proc(&zynq_a9_proc_ops, APU_CPU_ID, NULL);
+       if (!proc)
+               return NULL;
+
+       hil_set_ipi(proc, 0, IPI0_VECT_ID, NULL);
+       hil_set_ipi(proc, 1, IPI1_VECT_ID, NULL);
+
+       hil_set_rpmsg_channel(proc, 0, RPMSG_CHAN_NAME);
+       return proc;
+}
diff --git a/apps/machine/zynq7/platform_info.h b/apps/machine/zynq7/platform_info.h
deleted file mode 100644 (file)
index 2903d2a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2016 Xilinx, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- * 3. Neither the name of Mentor Graphics Corporation nor the names of its
- *    contributors may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* This file populates resource table for BM remote
- * for use by the Linux Master */
-
-#include "openamp/hil.h"
-#include "openamp/remoteproc_plat.h"
-
-/* remoteproc platform data structure */
-struct rproc_info_plat_local {
-       struct proc_info_hdr proc_hdr; /**< hil proc header */
-       struct plat_vring vring0; /**< vring0 data */
-       struct plat_vring vring1; /**< vring1 data */
-       struct plat_shm shm; /**< shared memory data */
-       struct plat_rpmsg_chnl rpmsg_chnl; /**< RPMSG channel data */
-       unsigned int last_type;
-};
index 5445398e750a77333e4024c068ceeb0da069582d..830abf145daaa3e187ba3a28aa2394760a7d4887 100644 (file)
@@ -1,5 +1,4 @@
 collect (APP_COMMON_SOURCES helper.c)
-collect (APP_COMMON_SOURCES sys_init.c)
 
 if (WITH_REMOTEPROC_MASTER)
   set (_linker_script "${CMAKE_CURRENT_SOURCE_DIR}/linker_master.ld")
index 7a3e22a94a8fb558f27f492d31825a9021d81bb0..690ea5df5261e80d7f4529b69af3162ea26f90d3 100755 (executable)
@@ -44,7 +44,6 @@
 XScuGic InterruptController;
 
 extern void metal_irq_isr(unsigned int irq);
-extern int platform_register_metal_device(void);
 
 int zynq_a9_gic_initialize()
 {
@@ -95,7 +94,6 @@ void init_system()
 
        metal_init(&metal_param);
        zynq_a9_gic_initialize();
-       platform_register_metal_device();
 }
 
 void cleanup_system()
diff --git a/apps/system/generic/machine/zynq7/sys_init.c b/apps/system/generic/machine/zynq7/sys_init.c
deleted file mode 100644 (file)
index 3459a7c..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-
-/*
- * Copyright (c) 2014, Mentor Graphics Corporation
- * All rights reserved.
- *
- * Copyright (c) 2015 Xilinx, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- * 3. Neither the name of the <ORGANIZATION> nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include <string.h>
-#include "xparameters.h"
-#include "xil_exception.h"
-#include "xscugic.h"
-#include "metal/sys.h"
-#include "metal/device.h"
-#include "metal/io.h"
-#include "metal/shmem.h"
-
-/** Device base address */
-#define SCUGIC_PERIPH_BASE      0xF8F00000
-#define SCUGIC_DIST_BASE        (SCUGIC_PERIPH_BASE + 0x00001000)
-#define UNDEFINE_BASE_ADDR      0x0
-
-#define UNDEFINE_MEM_SIZE       0xFFFFFFFF
-
-/** IPI IRQ ID */
-#define IPI0_IRQ_VECT_ID         15
-#define IPI1_IRQ_VECT_ID         14
-
-#define IPI0_DEV_NAME           "ipi0"
-#define IPI1_DEV_NAME           "ipi1"
-#define VRING_DEV_NAME          "vrings"
-#define SHM_NAME                "shm"
-
-const metal_phys_addr_t undefine_mem_addr = UNDEFINE_BASE_ADDR;
-const metal_phys_addr_t ipi_base_addr = SCUGIC_DIST_BASE;
-
-struct metal_device metal_dev_table[] = {
-       {
-               /* IPI0 device */
-               IPI0_DEV_NAME,
-               NULL,
-               1,
-               {
-                       {
-                               (void *)SCUGIC_DIST_BASE,
-                               &ipi_base_addr,
-                               0x1000,
-                               (sizeof(metal_phys_addr_t) << 3),
-                               (unsigned long)(-1),
-                               METAL_UNCACHED,
-                               {NULL},
-                       }
-               },
-               {NULL},
-               1,
-               (void *)IPI0_IRQ_VECT_ID,
-
-       },
-       {
-               /* IPI device */
-               IPI1_DEV_NAME,
-               NULL,
-               1,
-               {
-                       {
-                               (void *)SCUGIC_DIST_BASE,
-                               &ipi_base_addr,
-                               0x1000,
-                               (sizeof(metal_phys_addr_t) << 3),
-                               (unsigned long)(-1),
-                               METAL_UNCACHED,
-                               {NULL},
-                       }
-               },
-               {NULL},
-               1,
-               (void *)IPI1_IRQ_VECT_ID,
-
-       },
-       {
-               /* Shared memory management device */
-               VRING_DEV_NAME,
-               NULL,
-               1,
-               {
-                       {
-                               (void *)UNDEFINE_BASE_ADDR,
-                               &undefine_mem_addr,
-                               UNDEFINE_MEM_SIZE,
-                               (sizeof(metal_phys_addr_t) << 3),
-                               (unsigned long)(-1),
-                               METAL_UNCACHED | METAL_SHARED_MEM,
-                               {NULL},
-                       }
-               },
-               {NULL},
-               0,
-               NULL,
-
-       },
-};
-
-struct metal_generic_shmem shm = {
-       SHM_NAME,
-       {
-               (void *)UNDEFINE_BASE_ADDR,
-               &undefine_mem_addr,
-               UNDEFINE_MEM_SIZE,
-               (sizeof(metal_phys_addr_t) << 3),
-               (unsigned long)(-1),
-               0,
-               {NULL},
-       },
-       {NULL, NULL},
-};
-
-/**
- * This funciton is to install baremeta/RTOS libmetal devices.
- */
-extern char RPROC_DEBUG[];
-int platform_register_metal_device(void)
-{
-       int i;
-       int ret;
-       struct metal_device *dev;
-
-       /* Register device */
-       metal_bus_register(&metal_generic_bus);
-       for (i = 0;
-            i < (int)(sizeof(metal_dev_table)/sizeof(struct metal_device));
-            i++) {
-               dev = &metal_dev_table[i];
-               ret = metal_register_generic_device(dev);
-               if (ret)
-                       return ret;
-       }
-
-       /* Register shared memory */
-       metal_shmem_register_generic(&shm);
-
-       return 0;
-}
-