blob: 1fff513e5d48b88cac7f2614ebc07095ac076454 [file] [log] [blame]
Sridhar Parasurambf391322015-01-23 09:29:07 -08001/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2
3Redistribution and use in source and binary forms, with or without
4modification, are permitted provided that the following conditions are
5met:
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
16THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26IF 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===========================================================================*/
51const 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
66const uint32 xport_rpm_config_num = ARRAY_LENGTH(xport_rpm_config);
67const char* xport_rpm_msg_ram = (char*)XPORT_RPM_MSG_RAM_BASE;
68const uint32* xport_rpm_msg_ram_toc = (uint32*)(XPORT_RPM_MSG_RAM_BASE + XPORT_RPM_MSG_RAM_SIZE - XPORT_RPM_MSG_TOC_SIZE);
69
70/*===========================================================================
71FUNCTION 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/*=========================================================================*/
84const 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}