ipa.h (c87866ede44ad7da6b296d732221dc34ce1b154d) ipa.h (7aa0e8b8bd5b252c94900b19f2af8b7ec8a4e11d)
1/* SPDX-License-Identifier: GPL-2.0 */
2
3/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2018-2020 Linaro Ltd.
5 */
6#ifndef _IPA_H_
7#define _IPA_H_
8

--- 9 unchanged lines hidden (view full) ---

18#include "ipa_endpoint.h"
19#include "ipa_interrupt.h"
20
21struct clk;
22struct icc_path;
23struct net_device;
24struct platform_device;
25
1/* SPDX-License-Identifier: GPL-2.0 */
2
3/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2018-2020 Linaro Ltd.
5 */
6#ifndef _IPA_H_
7#define _IPA_H_
8

--- 9 unchanged lines hidden (view full) ---

18#include "ipa_endpoint.h"
19#include "ipa_interrupt.h"
20
21struct clk;
22struct icc_path;
23struct net_device;
24struct platform_device;
25
26struct ipa_clock;
26struct ipa_power;
27struct ipa_smp2p;
28struct ipa_interrupt;
29
30/**
27struct ipa_smp2p;
28struct ipa_interrupt;
29
30/**
31 * enum ipa_flag - IPA state flags
32 * @IPA_FLAG_RESUMED: Whether resume from suspend has been signaled
33 * @IPA_FLAG_COUNT: Number of defined IPA flags
34 */
35enum ipa_flag {
36 IPA_FLAG_RESUMED,
37 IPA_FLAG_COUNT, /* Last; not a flag */
38};
39
40/**
41 * struct ipa - IPA information
42 * @gsi: Embedded GSI structure
31 * struct ipa - IPA information
32 * @gsi: Embedded GSI structure
43 * @flags: Boolean state flags
44 * @version: IPA hardware version
45 * @pdev: Platform device
46 * @completion: Used to signal pipeline clear transfer complete
47 * @nb: Notifier block used for remoteproc SSR
48 * @notifier: Remoteproc SSR notifier
49 * @smp2p: SMP2P information
33 * @version: IPA hardware version
34 * @pdev: Platform device
35 * @completion: Used to signal pipeline clear transfer complete
36 * @nb: Notifier block used for remoteproc SSR
37 * @notifier: Remoteproc SSR notifier
38 * @smp2p: SMP2P information
50 * @clock: IPA clocking information
39 * @power: IPA power information
51 * @table_addr: DMA address of filter/route table content
52 * @table_virt: Virtual address of filter/route table content
53 * @interrupt: IPA Interrupt information
40 * @table_addr: DMA address of filter/route table content
41 * @table_virt: Virtual address of filter/route table content
42 * @interrupt: IPA Interrupt information
43 * @uc_powered: true if power is active by proxy for microcontroller
54 * @uc_loaded: true after microcontroller has reported it's ready
55 * @reg_addr: DMA address used for IPA register access
56 * @reg_virt: Virtual address used for IPA register access
57 * @mem_addr: DMA address of IPA-local memory space
58 * @mem_virt: Virtual address of IPA-local memory space
59 * @mem_offset: Offset from @mem_virt used for access to IPA memory
60 * @mem_size: Total size (bytes) of memory at @mem_virt
61 * @mem_count: Number of entries in the mem array

--- 15 unchanged lines hidden (view full) ---

77 * @name_map: Mapping of IPA endpoint name to IPA endpoint
78 * @setup_complete: Flag indicating whether setup stage has completed
79 * @modem_state: State of modem (stopped, running)
80 * @modem_netdev: Network device structure used for modem
81 * @qmi: QMI information
82 */
83struct ipa {
84 struct gsi gsi;
44 * @uc_loaded: true after microcontroller has reported it's ready
45 * @reg_addr: DMA address used for IPA register access
46 * @reg_virt: Virtual address used for IPA register access
47 * @mem_addr: DMA address of IPA-local memory space
48 * @mem_virt: Virtual address of IPA-local memory space
49 * @mem_offset: Offset from @mem_virt used for access to IPA memory
50 * @mem_size: Total size (bytes) of memory at @mem_virt
51 * @mem_count: Number of entries in the mem array

--- 15 unchanged lines hidden (view full) ---

67 * @name_map: Mapping of IPA endpoint name to IPA endpoint
68 * @setup_complete: Flag indicating whether setup stage has completed
69 * @modem_state: State of modem (stopped, running)
70 * @modem_netdev: Network device structure used for modem
71 * @qmi: QMI information
72 */
73struct ipa {
74 struct gsi gsi;
85 DECLARE_BITMAP(flags, IPA_FLAG_COUNT);
86 enum ipa_version version;
87 struct platform_device *pdev;
88 struct completion completion;
89 struct notifier_block nb;
90 void *notifier;
91 struct ipa_smp2p *smp2p;
75 enum ipa_version version;
76 struct platform_device *pdev;
77 struct completion completion;
78 struct notifier_block nb;
79 void *notifier;
80 struct ipa_smp2p *smp2p;
92 struct ipa_clock *clock;
81 struct ipa_power *power;
93
94 dma_addr_t table_addr;
95 __le64 *table_virt;
96
97 struct ipa_interrupt *interrupt;
82
83 dma_addr_t table_addr;
84 __le64 *table_virt;
85
86 struct ipa_interrupt *interrupt;
87 bool uc_powered;
98 bool uc_loaded;
99
100 dma_addr_t reg_addr;
101 void __iomem *reg_virt;
102
103 dma_addr_t mem_addr;
104 void *mem_virt;
105 u32 mem_offset;

--- 33 unchanged lines hidden (view full) ---

139 * ipa_setup() - Perform IPA setup
140 * @ipa: IPA pointer
141 *
142 * IPA initialization is broken into stages: init; config; and setup.
143 * (These have inverses exit, deconfig, and teardown.)
144 *
145 * Activities performed at the init stage can be done without requiring
146 * any access to IPA hardware. Activities performed at the config stage
88 bool uc_loaded;
89
90 dma_addr_t reg_addr;
91 void __iomem *reg_virt;
92
93 dma_addr_t mem_addr;
94 void *mem_virt;
95 u32 mem_offset;

--- 33 unchanged lines hidden (view full) ---

129 * ipa_setup() - Perform IPA setup
130 * @ipa: IPA pointer
131 *
132 * IPA initialization is broken into stages: init; config; and setup.
133 * (These have inverses exit, deconfig, and teardown.)
134 *
135 * Activities performed at the init stage can be done without requiring
136 * any access to IPA hardware. Activities performed at the config stage
147 * require the IPA clock to be running, because they involve access
148 * to IPA registers. The setup stage is performed only after the GSI
149 * hardware is ready (more on this below). The setup stage allows
150 * the AP to perform more complex initialization by issuing "immediate
151 * commands" using a special interface to the IPA.
137 * require IPA power, because they involve access to IPA registers.
138 * The setup stage is performed only after the GSI hardware is ready
139 * (more on this below). The setup stage allows the AP to perform
140 * more complex initialization by issuing "immediate commands" using
141 * a special interface to the IPA.
152 *
153 * This function, @ipa_setup(), starts the setup stage.
154 *
155 * In order for the GSI hardware to be functional it needs firmware to be
156 * loaded (in addition to some other low-level initialization). This early
157 * GSI initialization can be done either by Trust Zone on the AP or by the
158 * modem.
159 *

--- 12 unchanged lines hidden ---
142 *
143 * This function, @ipa_setup(), starts the setup stage.
144 *
145 * In order for the GSI hardware to be functional it needs firmware to be
146 * loaded (in addition to some other low-level initialization). This early
147 * GSI initialization can be done either by Trust Zone on the AP or by the
148 * modem.
149 *

--- 12 unchanged lines hidden ---