Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (C) 2019-2020 Linaro Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #ifndef _IPA_DATA_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #define _IPA_DATA_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "ipa_version.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include "ipa_endpoint.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include "ipa_mem.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * DOC: IPA/GSI Configuration Data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  * Boot-time configuration data is used to define the configuration of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  * IPA and GSI resources to use for a given platform.  This data is supplied
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * via the Device Tree match table, associated with a particular compatible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * string.  The data defines information about resources, endpoints, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * Resources are data structures used internally by the IPA hardware.  The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * configuration data defines the number (or limits of the number) of various
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * types of these resources.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * Endpoint configuration data defines properties of both IPA endpoints and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  * GSI channels.  A channel is a GSI construct, and represents a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * communication path between the IPA and a particular execution environment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * (EE), such as the AP or Modem.  Each EE has a set of channels associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * with it, and each channel has an ID unique for that EE.  For the most part
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * the only GSI channels of concern to this driver belong to the AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * An endpoint is an IPA construct representing a single channel anywhere
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  * in the system.  An IPA endpoint ID maps directly to an (EE, channel_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  * pair.  Generally, this driver is concerned with only endpoints associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  * with the AP, however this will change when support for routing (etc.) is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  * added.  IPA endpoint and GSI channel configuration data are defined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  * together, establishing the endpoint_id->(EE, channel_id) mapping.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * Endpoint configuration data consists of three parts:  properties that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * are common to IPA and GSI (EE ID, channel ID, endpoint ID, and direction);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * properties associated with the GSI channel; and properties associated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  * the IPA endpoint.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) /* The maximum value returned by ipa_resource_group_count() */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #define IPA_RESOURCE_GROUP_COUNT	4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) /** enum ipa_resource_type_src - source resource types */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  * struct gsi_channel_data - GSI channel configuration data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  * @tre_count:		number of TREs in the channel ring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)  * @event_count:	number of slots in the associated event ring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)  * @tlv_count:		number of entries in channel's TLV FIFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)  * A GSI channel is a unidirectional means of transferring data to or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)  * from (and through) the IPA.  A GSI channel has a ring buffer made
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)  * up of "transfer elements" (TREs) that specify individual data transfers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)  * or IPA immediate commands.  TREs are filled by the AP, and control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  * is passed to IPA hardware by writing the last written element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  * into a doorbell register.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)  * When data transfer commands have completed the GSI generates an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)  * event (a structure of data) and optionally signals the AP with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)  * an interrupt.  Event structures are implemented by another ring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)  * buffer, directed toward the AP from the IPA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)  * The input to a GSI channel is a FIFO of type/length/value (TLV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)  * elements, and the size of this FIFO limits the number of TREs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)  * that can be included in a single transaction.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) struct gsi_channel_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	u16 tre_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	u16 event_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	u8 tlv_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  * struct ipa_endpoint_tx_data - configuration data for TX endpoints
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)  * @status_endpoint:	endpoint to which status elements are sent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)  * The @status_endpoint is only valid if the endpoint's @status_enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)  * flag is set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) struct ipa_endpoint_tx_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	enum ipa_endpoint_name status_endpoint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)  * struct ipa_endpoint_rx_data - configuration data for RX endpoints
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)  * @pad_align:	power-of-2 boundary to which packet payload is aligned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  * @aggr_close_eof: whether aggregation closes on end-of-frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  * With each packet it transfers, the IPA hardware can perform certain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  * transformations of its packet data.  One of these is adding pad bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  * to the end of the packet data so the result ends on a power-of-2 boundary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  * It is also able to aggregate multiple packets into a single receive buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  * Aggregation is "open" while a buffer is being filled, and "closes" when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  * certain criteria are met.  One of those criteria is the sender indicating
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)  * a "frame" consisting of several transfers has ended.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) struct ipa_endpoint_rx_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	u32 pad_align;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	bool aggr_close_eof;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)  * struct ipa_endpoint_config_data - IPA endpoint hardware configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)  * @checksum:		whether checksum offload is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)  * @qmap:		whether endpoint uses QMAP protocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)  * @aggregation:	whether endpoint supports aggregation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)  * @status_enable:	whether endpoint uses status elements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  * @dma_mode:		whether endpoint operates in DMA mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  * @dma_endpoint:	peer endpoint, if operating in DMA mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  * @tx:			TX-specific endpoint information (see above)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  * @rx:			RX-specific endpoint information (see above)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) struct ipa_endpoint_config_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	bool checksum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	bool qmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	bool aggregation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	bool status_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	bool dma_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	enum ipa_endpoint_name dma_endpoint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		struct ipa_endpoint_tx_data tx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		struct ipa_endpoint_rx_data rx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)  * struct ipa_endpoint_data - IPA endpoint configuration data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)  * @filter_support:	whether endpoint supports filtering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  * @seq_type:		hardware sequencer type used for endpoint
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)  * @config:		hardware configuration (see above)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)  * Not all endpoints support the IPA filtering capability.  A filter table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)  * defines the filters to apply for those endpoints that support it.  The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)  * AP is responsible for initializing this table, and it must include entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  * for non-AP endpoints.  For this reason we define *all* endpoints used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)  * in the system, and indicate whether they support filtering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * The remaining endpoint configuration data applies only to AP endpoints.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  * The IPA hardware is implemented by sequencers, and the AP must program
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  * the type(s) of these sequencers at initialization time.  The remaining
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  * endpoint configuration data is defined above.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) struct ipa_endpoint_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	bool filter_support;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	/* The next two are specified only for AP endpoints */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	enum ipa_seq_type seq_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	struct ipa_endpoint_config_data config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)  * struct ipa_gsi_endpoint_data - GSI channel/IPA endpoint data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  * ee:		GSI execution environment ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  * channel_id:	GSI channel ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  * endpoint_id:	IPA endpoint ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  * toward_ipa:	direction of data transfer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)  * gsi:		GSI channel configuration data (see above)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)  * ipa:		IPA endpoint configuration data (see above)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) struct ipa_gsi_endpoint_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	u8 ee_id;		/* enum gsi_ee_id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	u8 channel_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	u8 endpoint_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	bool toward_ipa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	struct gsi_channel_data channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	struct ipa_endpoint_data endpoint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) /** enum ipa_resource_type_src - source resource types */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) enum ipa_resource_type_src {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_BUFF,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	IPA_RESOURCE_TYPE_SRC_HPS_DMARS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) /** enum ipa_resource_type_dst - destination resource types */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) enum ipa_resource_type_dst {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	IPA_RESOURCE_TYPE_DST_DATA_SECTORS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	IPA_RESOURCE_TYPE_DST_DPS_DMARS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)  * struct ipa_resource_limits - minimum and maximum resource counts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)  * @min:	minimum number of resources of a given type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)  * @max:	maximum number of resources of a given type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) struct ipa_resource_limits {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	u32 min;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	u32 max;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)  * struct ipa_resource_src - source endpoint group resource usage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)  * @type:	source group resource type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)  * @limits:	array of limits to use for each resource group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) struct ipa_resource_src {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	enum ipa_resource_type_src type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	struct ipa_resource_limits limits[IPA_RESOURCE_GROUP_COUNT];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)  * struct ipa_resource_dst - destination endpoint group resource usage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)  * @type:	destination group resource type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)  * @limits:	array of limits to use for each resource group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) struct ipa_resource_dst {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	enum ipa_resource_type_dst type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	struct ipa_resource_limits limits[IPA_RESOURCE_GROUP_COUNT];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)  * struct ipa_resource_data - IPA resource configuration data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)  * @resource_src_count:	number of entries in the resource_src array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)  * @resource_src:	source endpoint group resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)  * @resource_dst_count:	number of entries in the resource_dst array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)  * @resource_dst:	destination endpoint group resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)  * In order to manage quality of service between endpoints, certain resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)  * required for operation are allocated to groups of endpoints.  Generally
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)  * this information is invisible to the AP, but the AP is responsible for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)  * programming it at initialization time, so we specify it here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) struct ipa_resource_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	u32 resource_src_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	const struct ipa_resource_src *resource_src;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	u32 resource_dst_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	const struct ipa_resource_dst *resource_dst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)  * struct ipa_mem - description of IPA memory regions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)  * @local_count:	number of regions defined in the local[] array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)  * @local:		array of IPA-local memory region descriptors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)  * @imem_addr:		physical address of IPA region within IMEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)  * @imem_size:		size in bytes of IPA IMEM region
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)  * @smem_id:		item identifier for IPA region within SMEM memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)  * @imem_size:		size in bytes of the IPA SMEM region
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) struct ipa_mem_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	u32 local_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	const struct ipa_mem *local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	u32 imem_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	u32 imem_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	u32 smem_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	u32 smem_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)  * struct ipa_data - combined IPA/GSI configuration data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)  * @version:		IPA hardware version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)  * @endpoint_count:	number of entries in endpoint_data array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)  * @endpoint_data:	IPA endpoint/GSI channel data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)  * @resource_data:	IPA resource configuration data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)  * @mem_count:		number of entries in mem_data array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)  * @mem_data:		IPA-local shared memory region data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) struct ipa_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	enum ipa_version version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	u32 endpoint_count;	/* # entries in endpoint_data[] */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 	const struct ipa_gsi_endpoint_data *endpoint_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	const struct ipa_resource_data *resource_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	const struct ipa_mem_data *mem_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) extern const struct ipa_data ipa_data_sdm845;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) extern const struct ipa_data ipa_data_sc7180;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) #endif /* _IPA_DATA_H_ */