/* * Copyright (c) 2013-2014, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* * This file was originally distributed by Qualcomm Atheros, Inc. * under proprietary terms before Copyright ownership was assigned * to the Linux Foundation. */ #ifndef __CEPCI_H__ #define __CEPCI_H__ /* * Support for Copy Engine over PCI. * Structures shared between Host software and Target firmware. */ /* * Total number of PCIe MSI interrupts requested for all interrupt sources. * PCIe standard forces this to be a power of 2. * Some Host OS's limit MSI requests that can be granted to 8 * so for now we abide by this limit and avoid requesting more * than that. */ #define MSI_NUM_REQUEST_LOG2 3 #define MSI_NUM_REQUEST (1<hi_interconnect_state points * here (and all members are 32-bit quantities in order to * facilitate Host access). In particular, Host software is * required to initialize pipe_cfg_addr and svc_to_pipe_map. */ struct pcie_state_s { uint32_t pipe_cfg_addr; /* Pipe configuration Target address */ /* NB: CE_pipe_config[CE_COUNT] */ uint32_t svc_to_pipe_map; /* Service to pipe map Target address */ /* NB: service_to_pipe[PIPE_TO_CE_MAP_CN] */ uint32_t MSI_requested; /* number of MSI interrupts requested */ uint32_t MSI_granted; /* number of MSI interrupts granted */ uint32_t MSI_addr; /* Message Signalled Interrupt address */ uint32_t MSI_data; /* Base data */ uint32_t MSI_fw_intr_data; /* Data for firmware interrupt; MSI data for other interrupts are in various SoC registers */ uint32_t power_mgmt_method; /* PCIE_PWR_METHOD_* */ uint32_t config_flags; /* PCIE_CONFIG_FLAG_* */ }; /* * PCIE_CONFIG_FLAG definitions */ #if defined(AR900B) #define CE_PKTLOG_PIPE 8 /* used by both host and target side */ #endif #define PCIE_CONFIG_FLAG_ENABLE_L1 0x0000001 #define PCIE_CONFIG_FLAG_CLK_GATING_L1 0x0000001 #define PCIE_CONFIG_FLAG_CLK_SWITCH_WAIT 0x0000002 #define PCIE_CONFIG_FLAG_AXI_CLK_GATE 0x0000004 #define PCIE_CONFIG_FLAG_CLK_REQ_L1 0x0000008 #define PIPE_TO_CE_MAP_CNT 32 /* simple implementation constant */ /* * Configuration information for a Copy Engine pipe. * Passed from Host to Target during startup (one per CE). */ struct CE_pipe_config { uint32_t pipenum; uint32_t pipedir; uint32_t nentries; uint32_t nbytes_max; uint32_t flags; uint32_t reserved; }; #endif /* __CEPCI_H__ */