Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. /*
  2. * Copyright (c) 2012-2014, Texas Instruments Incorporated
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *
  9. * * Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. *
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. *
  16. * * Neither the name of Texas Instruments Incorporated nor the names of
  17. * its contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  22. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  23. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  24. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  27. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  30. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32.  
  33. /*
  34. * ======== rsc_table_am335x_pru.h ========
  35. *
  36. * Define the resource table entries for all PRU cores. This will be
  37. * incorporated into corresponding base images, and used by the remoteproc
  38. * on the host-side to allocated/reserve resources.
  39. *
  40. */
  41.  
  42. #ifndef _RSC_TABLE_AM335X_PRU_H_
  43. #define _RSC_TABLE_AM335X_PRU_H_
  44.  
  45. #include <stddef.h>
  46. #include <rsc_types.h>
  47. #include "pru_virtio_ids.h"
  48.  
  49. /* PRU Memory Map */
  50. #define PRU_GLOBAL_BASE 0x4A300000
  51.  
  52. /* PRU Global Offsets */
  53. #define PRU0_DRAM (PRU_GLOBAL_BASE)
  54. #define PRU1_DRAM (PRU_GLOBAL_BASE + 0x00002000)
  55.  
  56. #define PRU_SHARED_DRAM (PRU_GLOBAL_BASE + 0x00010000)
  57.  
  58. #define PRU_INTC (PRU_GLOBAL_BASE + 0x00020000)
  59.  
  60. #define PRU0_CTRL (PRU_GLOBAL_BASE + 0x00022000)
  61. #define PRU1_CTRL (PRU_GLOBAL_BASE + 0x00024000)
  62.  
  63. #define PRU0_DEBUG (PRU_GLOBAL_BASE + 0x00022400)
  64. #define PRU1_DEBUG (PRU_GLOBAL_BASE + 0x00024400)
  65.  
  66. #define PRU_CFG (PRU_GLOBAL_BASE + 0x00026000)
  67.  
  68. #define PRU_UART0 (PRU_GLOBAL_BASE + 0x00028000)
  69.  
  70. #define PRU_IEP (PRU_GLOBAL_BASE + 0x0002E000)
  71.  
  72. #define PRU_ECAP0 (PRU_GLOBAL_BASE + 0x00030000)
  73.  
  74. #define PRU0_IRAM (PRU_GLOBAL_BASE + 0x00034000)
  75. #define PRU1_IRAM (PRU_GLOBAL_BASE + 0x00038000)
  76.  
  77. /* PRU Local Offsets */
  78. #define PRU_IRAM (0x00000000)
  79. #define PRU_DRAM (0x00000000)
  80. #define PRU_L_SHARED_DRAM (0x00002000)
  81.  
  82. /* Sizes */
  83. #define PRU0_IRAM_SIZE (SZ_8K)
  84. #define PRU1_IRAM_SIZE (SZ_8K)
  85.  
  86. #define PRU0_DRAM_SIZE (SZ_8K)
  87. #define PRU1_DRAM_SIZE (SZ_8K)
  88.  
  89. #define PRU_SHARED_DRAM_SIZE (SZ_8K + SZ_4K)
  90.  
  91. /*
  92. * Sizes of the virtqueues (expressed in number of buffers supported,
  93. * and must be power of 2)
  94. */
  95. #define PRU_RPMSG_VQ0_SIZE 2
  96. #define PRU_RPMSG_VQ1_SIZE 2
  97.  
  98. /* flip up bits whose indices represent features we support */
  99. #define RPMSG_PRU_C0_FEATURES 1
  100.  
  101. /* Definition for unused interrupts */
  102. #define HOST_UNUSED 255
  103.  
  104. /* Mapping sysevts to a channel. Each pair contains a sysevt, channel */
  105. struct ch_map pru_intc_map[] = {};
  106.  
  107. struct my_resource_table {
  108. struct resource_table base;
  109.  
  110. uint32_t offset[1]; /* Should match 'num' in actual definition */
  111.  
  112. /* intc definition */
  113. struct fw_rsc_custom pru_ints;
  114. };
  115.  
  116. #pragma DATA_SECTION(am335x_pru_remoteproc_ResourceTable, ".resource_table")
  117. #pragma RETAIN(am335x_pru_remoteproc_ResourceTable)
  118. struct my_resource_table am335x_pru_remoteproc_ResourceTable = {
  119. 1, /* we're the first version that implements this */
  120. 0, /* number of entries in the table */
  121. 0, 0, /* reserved, must be zero */
  122. };
  123.  
  124. #endif /* _RSC_TABLE_AM335X_PRU_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement