Sridhar Parasuram | bf39132 | 2015-01-23 09:29:07 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2015, The Linux Foundation. All rights reserved. |
| 2 | |
| 3 | Redistribution and use in source and binary forms, with or without |
| 4 | modification, are permitted provided that the following conditions are |
| 5 | met: |
| 6 | * Redistributions of source code must retain the above copyright |
| 7 | notice, this list of conditions and the following disclaimer. |
| 8 | * Redistributions in binary form must reproduce the above |
| 9 | copyright notice, this list of conditions and the following |
| 10 | disclaimer in the documentation and/or other materials provided |
| 11 | with the distribution. |
| 12 | * Neither the name of The Linux Foundation nor the names of its |
| 13 | contributors may be used to endorse or promote products derived |
| 14 | from this software without specific prior written permission. |
| 15 | |
| 16 | THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 17 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 20 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 23 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 25 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 26 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | |
| 30 | /*=========================================================================== |
| 31 | INCLUDE FILES |
| 32 | ===========================================================================*/ |
| 33 | #include "xport_rpm_config.h" |
| 34 | #include "smem_type.h" |
| 35 | #include "glink_os_utils.h" |
| 36 | #include <platform/iomap.h> |
| 37 | |
| 38 | /*=========================================================================== |
| 39 | MACRO DEFINITIONS |
| 40 | ===========================================================================*/ |
| 41 | |
| 42 | #define XPORT_RPM_MSG_RAM_BASE RPM_SS_MSG_RAM_START_ADDRESS_BASE_PHYS |
| 43 | #define XPORT_RPM_MSG_RAM_SIZE RPM_SS_MSG_RAM_START_ADDRESS_BASE_SIZE |
| 44 | |
| 45 | /** Size of Glink RPM transport ToC in MSG RAM */ |
| 46 | #define XPORT_RPM_MSG_TOC_SIZE 0x100 |
| 47 | |
| 48 | /*=========================================================================== |
| 49 | DATA DECLARATIONS |
| 50 | ===========================================================================*/ |
| 51 | const xport_rpm_config_type xport_rpm_config[] = |
| 52 | { |
| 53 | /* LK->Rpm */ |
| 54 | { |
| 55 | "rpm", /* Remote host name */ |
| 56 | XPORT_RPM_AP2R_ID, /* Tx FIFO ID in RPM ToC */ |
| 57 | XPORT_RPM_R2AP_ID, /* Rx FIFO ID in RPM ToC */ |
| 58 | { /* Outgoing interrupt */ |
| 59 | 8, //DALIPCINT_PROC_RPM, |
| 60 | 0, //DALIPCINT_GP_0 |
| 61 | }, |
| 62 | 200 /* Incoming interrupt */ |
| 63 | } |
| 64 | }; |
| 65 | |
| 66 | const uint32 xport_rpm_config_num = ARRAY_LENGTH(xport_rpm_config); |
| 67 | const char* xport_rpm_msg_ram = (char*)XPORT_RPM_MSG_RAM_BASE; |
| 68 | const uint32* xport_rpm_msg_ram_toc = (uint32*)(XPORT_RPM_MSG_RAM_BASE + XPORT_RPM_MSG_RAM_SIZE - XPORT_RPM_MSG_TOC_SIZE); |
| 69 | |
| 70 | /*=========================================================================== |
| 71 | FUNCTION xport_rpm_get_config |
| 72 | ===========================================================================*/ |
| 73 | /** |
| 74 | |
| 75 | Provides a pointer to transport config strucutre. |
| 76 | |
| 77 | @param[in] ind Index of the config |
| 78 | |
| 79 | @return Pointer to transport config strucutre. |
| 80 | |
| 81 | @sideeffects None. |
| 82 | */ |
| 83 | /*=========================================================================*/ |
| 84 | const xport_rpm_config_type* xport_rpm_get_config(uint32 ind) |
| 85 | { |
| 86 | if (ind >= xport_rpm_config_num) |
| 87 | { |
| 88 | return NULL; |
| 89 | } |
| 90 | |
| 91 | return &xport_rpm_config[ind]; |
| 92 | } |