]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - packages/ti/ipc/remoteproc/rsc_table_vayu_dsp.h
Remoteproc: DRA7xx: Adjust entries to fix carveout allocation failures
[ipc/ipcdev.git] / packages / ti / ipc / remoteproc / rsc_table_vayu_dsp.h
index b1a061309cbffd2a8112d5de1f6ab96466f9681f..770b4c52d3767c20f0ace108463f61f639707afd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2014, Texas Instruments Incorporated
+ * Copyright (c) 2012-2019, Texas Instruments Incorporated
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -65,9 +65,6 @@
 #define L3_PERIPHERAL_DMM       0x4E000000
 #define DSP_PERIPHERAL_DMM      0x4E000000
 
-#define L3_PERIPHERAL_ISS       0x52000000
-#define DSP_PERIPHERAL_ISS      0x52000000
-
 #define L3_TILER_MODE_0_1       0x60000000
 #define DSP_TILER_MODE_0_1      0x60000000
 
 #define DSP_TILER_MODE_3        0x78000000
 
 #define DSP_MEM_TEXT            0x95000000
-/* Co-locate alongside TILER region for easier flushing */
-#define DSP_MEM_IOBUFS          0x80000000
 #define DSP_MEM_DATA            0x95100000
-#define DSP_MEM_HEAP            0x95200000
+#define DSP_MEM_HEAP0           0x95200000
+#define DSP_MEM_HEAP1           0x95300000
 
 #define DSP_MEM_IPC_DATA        0x9F000000
 #define DSP_MEM_IPC_VRING       0xA0000000
 #define DSP_MEM_VRING_BUFS0     0xA0040000
 #define DSP_MEM_VRING_BUFS1     0xA0080000
 
+/*
+ * NOTE:
+ * To avoid issues with allocation failures with Linux carveout regions, need
+ * to use the RSC_CARVEOUT entries with power of 2 page order sizes and aligned
+ * on the same page order.
+ * The size and the alignment order of entries in the resource table plays a
+ * part in avoiding gaps in allocation
+ */
 #define DSP_MEM_IPC_VRING_SIZE  SZ_1M
 #define DSP_MEM_IPC_DATA_SIZE   SZ_1M
 #define DSP_MEM_TEXT_SIZE       SZ_1M
 #define DSP_MEM_DATA_SIZE       SZ_1M
-#define DSP_MEM_HEAP_SIZE       (SZ_1M * 3)
-#define DSP_MEM_IOBUFS_SIZE     (SZ_1M * 90)
+#define DSP_MEM_HEAP0_SIZE      (SZ_1M * 2)
+#define DSP_MEM_HEAP1_SIZE      (SZ_1M * 1)
 
 /*
- * Assign fixed RAM addresses to facilitate a fixed MMU table.
+ * The following values need to match Linux side device tree reserved
+ * memory region start address for specific processor core.
+ * The addresses are used to create mmu entry for IPC vrings and buffers
  */
-/* See CMA BASE addresses in Linux side: arch/arm/mach-omap2/remoteproc.c */
 #if defined (VAYU_DSP_1)
 #define PHYS_MEM_IPC_VRING      0x99000000
 #elif defined (VAYU_DSP_2)
 #define PHYS_MEM_IPC_VRING      0x9F000000
 #endif
 
-/* Need to be identical to that of IPU */
-#define PHYS_MEM_IOBUFS         0xBA300000
-
 /*
  * Sizes of the virtqueues (expressed in number of buffers supported,
  * and must be power of 2)
 /* flip up bits whose indices represent features we support */
 #define RPMSG_DSP_C0_FEATURES         1
 
+#define NUM_RSC_ENTRIES 17
+
 struct my_resource_table {
     struct resource_table base;
 
-    UInt32 offset[18];  /* Should match 'num' in actual definition */
+    UInt32 offset[NUM_RSC_ENTRIES];  /* Should match 'num' in actual definition */
 
     /* rpmsg vdev entry */
     struct fw_rsc_vdev rpmsg_vdev;
     struct fw_rsc_vdev_vring rpmsg_vring0;
     struct fw_rsc_vdev_vring rpmsg_vring1;
 
+    /* ipcdata carveout entry */
+    struct fw_rsc_carveout ipcdata_cout;
+
     /* text carveout entry */
     struct fw_rsc_carveout text_cout;
 
@@ -137,10 +144,10 @@ struct my_resource_table {
     struct fw_rsc_carveout data_cout;
 
     /* heap carveout entry */
-    struct fw_rsc_carveout heap_cout;
+    struct fw_rsc_carveout heap0_cout;
 
-    /* ipcdata carveout entry */
-    struct fw_rsc_carveout ipcdata_cout;
+    /* heap carveout entry */
+    struct fw_rsc_carveout heap1_cout;
 
     /* trace entry */
     struct fw_rsc_trace trace;
@@ -174,12 +181,6 @@ struct my_resource_table {
 
     /* devmem entry */
     struct fw_rsc_devmem devmem9;
-
-    /* devmem entry */
-    struct fw_rsc_devmem devmem10;
-
-    /* devmem entry */
-    struct fw_rsc_devmem devmem11;
 };
 
 #define TRACEBUFADDR (UInt32)&ti_trace_SysMin_Module_State_0_outbuf__A
@@ -189,15 +190,16 @@ struct my_resource_table {
 
 struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
     1,      /* we're the first version that implements this */
-    18,     /* number of entries in the table */
+    NUM_RSC_ENTRIES,     /* number of entries in the table */
     0, 0,   /* reserved, must be zero */
     /* offsets to entries */
     {
         offsetof(struct my_resource_table, rpmsg_vdev),
+        offsetof(struct my_resource_table, ipcdata_cout),
         offsetof(struct my_resource_table, text_cout),
         offsetof(struct my_resource_table, data_cout),
-        offsetof(struct my_resource_table, heap_cout),
-        offsetof(struct my_resource_table, ipcdata_cout),
+        offsetof(struct my_resource_table, heap0_cout),
+        offsetof(struct my_resource_table, heap1_cout),
         offsetof(struct my_resource_table, trace),
         offsetof(struct my_resource_table, devmem0),
         offsetof(struct my_resource_table, devmem1),
@@ -209,8 +211,6 @@ struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
         offsetof(struct my_resource_table, devmem7),
         offsetof(struct my_resource_table, devmem8),
         offsetof(struct my_resource_table, devmem9),
-        offsetof(struct my_resource_table, devmem10),
-        offsetof(struct my_resource_table, devmem11),
     },
 
     /* rpmsg vdev entry */
@@ -223,6 +223,12 @@ struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
     { DSP_MEM_RPMSG_VRING0, 4096, DSP_RPMSG_VQ0_SIZE, 1, 0 },
     { DSP_MEM_RPMSG_VRING1, 4096, DSP_RPMSG_VQ1_SIZE, 2, 0 },
 
+    {
+        TYPE_CARVEOUT,
+        DSP_MEM_IPC_DATA, 0,
+        DSP_MEM_IPC_DATA_SIZE, 0, 0, "DSP_MEM_IPC_DATA",
+    },
+
     {
         TYPE_CARVEOUT,
         DSP_MEM_TEXT, 0,
@@ -237,14 +243,14 @@ struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
 
     {
         TYPE_CARVEOUT,
-        DSP_MEM_HEAP, 0,
-        DSP_MEM_HEAP_SIZE, 0, 0, "DSP_MEM_HEAP",
+        DSP_MEM_HEAP0, 0,
+        DSP_MEM_HEAP0_SIZE, 0, 0, "DSP_MEM_HEAP0",
     },
 
     {
         TYPE_CARVEOUT,
-        DSP_MEM_IPC_DATA, 0,
-        DSP_MEM_IPC_DATA_SIZE, 0, 0, "DSP_MEM_IPC_DATA",
+        DSP_MEM_HEAP1, 0,
+        DSP_MEM_HEAP1_SIZE, 0, 0, "DSP_MEM_HEAP1",
     },
 
     {
@@ -257,12 +263,6 @@ struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
         DSP_MEM_IPC_VRING_SIZE, 0, 0, "DSP_MEM_IPC_VRING",
     },
 
-    {
-        TYPE_DEVMEM,
-        DSP_MEM_IOBUFS, PHYS_MEM_IOBUFS,
-        DSP_MEM_IOBUFS_SIZE, 0, 0, "DSP_MEM_IOBUFS",
-    },
-
     {
         TYPE_DEVMEM,
         DSP_TILER_MODE_0_1, L3_TILER_MODE_0_1,
@@ -316,12 +316,6 @@ struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
         DSP_PERIPHERAL_DMM, L3_PERIPHERAL_DMM,
         SZ_1M, 0, 0, "DSP_PERIPHERAL_DMM",
     },
-
-    {
-        TYPE_DEVMEM,
-        DSP_PERIPHERAL_ISS, L3_PERIPHERAL_ISS,
-        SZ_256K, 0, 0, "DSP_PERIPHERAL_ISS",
-    },
 };
 
 #endif /* _RSC_TABLE_VAYU_DSP_H_ */