Pierre-Louis Bossart | e149ca2 | 2020-05-01 09:58:50 -0500 | [diff] [blame] | 1 | /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 2 | /* |
| 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
| 4 | * redistributing this file, you may do so under either license. |
| 5 | * |
| 6 | * Copyright(c) 2018 Intel Corporation. All rights reserved. |
| 7 | * |
| 8 | * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> |
| 9 | */ |
| 10 | |
| 11 | #ifndef __SOUND_SOC_SOF_PRIV_H |
| 12 | #define __SOUND_SOC_SOF_PRIV_H |
| 13 | |
| 14 | #include <linux/device.h> |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 15 | #include <sound/hdaudio.h> |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 16 | #include <sound/sof.h> |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 17 | #include <sound/sof/info.h> |
| 18 | #include <sound/sof/pm.h> |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 19 | #include <sound/sof/trace.h> |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 20 | #include <uapi/sound/sof/fw.h> |
Fred Oh | e984f3ef | 2020-11-27 18:40:18 +0200 | [diff] [blame] | 21 | #include <sound/sof/ext_manifest.h> |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 22 | |
| 23 | /* debug flags */ |
Pierre-Louis Bossart | 2ab4c50 | 2019-09-27 15:05:28 -0500 | [diff] [blame] | 24 | #define SOF_DBG_ENABLE_TRACE BIT(0) |
Ranjani Sridharan | fbfa22e | 2020-12-11 12:07:42 +0200 | [diff] [blame] | 25 | #define SOF_DBG_RETAIN_CTX BIT(1) /* prevent DSP D3 on FW exception */ |
Ranjani Sridharan | c0e7969 | 2021-09-27 15:05:17 +0300 | [diff] [blame] | 26 | #define SOF_DBG_VERIFY_TPLG BIT(2) /* verify topology during load */ |
Pierre-Louis Bossart | ea6bfbb | 2021-10-04 16:27:28 -0500 | [diff] [blame] | 27 | #define SOF_DBG_DYNAMIC_PIPELINES_OVERRIDE BIT(3) /* 0: use topology token |
| 28 | * 1: override topology |
| 29 | */ |
| 30 | #define SOF_DBG_DYNAMIC_PIPELINES_ENABLE BIT(4) /* 0: use static pipelines |
| 31 | * 1: use dynamic pipelines |
| 32 | */ |
Pierre-Louis Bossart | 1539c8c | 2021-10-06 14:06:27 +0300 | [diff] [blame] | 33 | #define SOF_DBG_DISABLE_MULTICORE BIT(5) /* schedule all pipelines/widgets |
| 34 | * on primary core |
| 35 | */ |
Peter Ujfalusi | 9ff9085 | 2021-10-06 14:06:30 +0300 | [diff] [blame] | 36 | #define SOF_DBG_PRINT_ALL_DUMPS BIT(6) /* Print all ipc and dsp dumps */ |
Ranjani Sridharan | fbfa22e | 2020-12-11 12:07:42 +0200 | [diff] [blame] | 37 | |
| 38 | #define SOF_DBG_DUMP_REGS BIT(0) |
| 39 | #define SOF_DBG_DUMP_MBOX BIT(1) |
| 40 | #define SOF_DBG_DUMP_TEXT BIT(2) |
| 41 | #define SOF_DBG_DUMP_PCI BIT(3) |
Peter Ujfalusi | 2301333 | 2021-10-06 14:06:36 +0300 | [diff] [blame] | 42 | #define SOF_DBG_DUMP_OPTIONAL BIT(4) /* only dump if SOF_DBG_PRINT_ALL_DUMPS is set */ |
Pierre-Louis Bossart | 2ab4c50 | 2019-09-27 15:05:28 -0500 | [diff] [blame] | 43 | |
| 44 | /* global debug state set by SOF_DBG_ flags */ |
| 45 | extern int sof_core_debug; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 46 | |
| 47 | /* max BARs mmaped devices can use */ |
| 48 | #define SND_SOF_BARS 8 |
| 49 | |
| 50 | /* time in ms for runtime suspend delay */ |
| 51 | #define SND_SOF_SUSPEND_DELAY_MS 2000 |
| 52 | |
| 53 | /* DMA buffer size for trace */ |
| 54 | #define DMA_BUF_SIZE_FOR_TRACE (PAGE_SIZE * 16) |
| 55 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 56 | #define SOF_IPC_DSP_REPLY 0 |
| 57 | #define SOF_IPC_HOST_REPLY 1 |
| 58 | |
| 59 | /* convenience constructor for DAI driver streams */ |
| 60 | #define SOF_DAI_STREAM(sname, scmin, scmax, srates, sfmt) \ |
| 61 | {.stream_name = sname, .channels_min = scmin, .channels_max = scmax, \ |
| 62 | .rates = srates, .formats = sfmt} |
| 63 | |
| 64 | #define SOF_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \ |
| 65 | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_FLOAT) |
| 66 | |
Ranjani Sridharan | 091c12e | 2019-06-03 11:18:20 -0500 | [diff] [blame] | 67 | #define ENABLE_DEBUGFS_CACHEBUF \ |
| 68 | (IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_DEBUGFS_CACHE) || \ |
| 69 | IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST)) |
| 70 | |
Guennadi Liakhovetski | 0dcdf84 | 2020-09-02 17:07:54 +0300 | [diff] [blame] | 71 | /* So far the primary core on all DSPs has ID 0 */ |
| 72 | #define SOF_DSP_PRIMARY_CORE 0 |
| 73 | |
Ranjani Sridharan | 700d167 | 2020-01-29 16:07:21 -0600 | [diff] [blame] | 74 | /* DSP power state */ |
| 75 | enum sof_dsp_power_states { |
| 76 | SOF_DSP_PM_D0, |
| 77 | SOF_DSP_PM_D1, |
| 78 | SOF_DSP_PM_D2, |
| 79 | SOF_DSP_PM_D3_HOT, |
| 80 | SOF_DSP_PM_D3, |
| 81 | SOF_DSP_PM_D3_COLD, |
| 82 | }; |
| 83 | |
Ranjani Sridharan | 61e285c | 2020-01-29 16:07:22 -0600 | [diff] [blame] | 84 | struct sof_dsp_power_state { |
| 85 | u32 state; |
| 86 | u32 substate; /* platform-specific */ |
Keyon Jie | 4c19030 | 2019-10-25 17:40:57 -0500 | [diff] [blame] | 87 | }; |
| 88 | |
Ranjani Sridharan | 043ae13 | 2020-01-29 16:07:20 -0600 | [diff] [blame] | 89 | /* System suspend target state */ |
| 90 | enum sof_system_suspend_state { |
| 91 | SOF_SUSPEND_NONE = 0, |
| 92 | SOF_SUSPEND_S0IX, |
| 93 | SOF_SUSPEND_S3, |
| 94 | }; |
| 95 | |
Peter Ujfalusi | 07e833b | 2021-09-15 15:21:12 +0300 | [diff] [blame] | 96 | enum sof_dfsentry_type { |
| 97 | SOF_DFSENTRY_TYPE_IOMEM = 0, |
| 98 | SOF_DFSENTRY_TYPE_BUF, |
| 99 | }; |
| 100 | |
| 101 | enum sof_debugfs_access_type { |
| 102 | SOF_DEBUGFS_ACCESS_ALWAYS = 0, |
| 103 | SOF_DEBUGFS_ACCESS_D0_ONLY, |
| 104 | }; |
| 105 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 106 | struct snd_sof_dev; |
| 107 | struct snd_sof_ipc_msg; |
| 108 | struct snd_sof_ipc; |
| 109 | struct snd_sof_debugfs_map; |
| 110 | struct snd_soc_tplg_ops; |
| 111 | struct snd_soc_component; |
| 112 | struct snd_sof_pdata; |
| 113 | |
| 114 | /* |
| 115 | * SOF DSP HW abstraction operations. |
| 116 | * Used to abstract DSP HW architecture and any IO busses between host CPU |
| 117 | * and DSP device(s). |
| 118 | */ |
| 119 | struct snd_sof_dsp_ops { |
| 120 | |
Keyon Jie | 7edb305 | 2021-01-13 17:26:14 +0200 | [diff] [blame] | 121 | /* probe/remove/shutdown */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 122 | int (*probe)(struct snd_sof_dev *sof_dev); /* mandatory */ |
| 123 | int (*remove)(struct snd_sof_dev *sof_dev); /* optional */ |
Keyon Jie | 7edb305 | 2021-01-13 17:26:14 +0200 | [diff] [blame] | 124 | int (*shutdown)(struct snd_sof_dev *sof_dev); /* optional */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 125 | |
| 126 | /* DSP core boot / reset */ |
| 127 | int (*run)(struct snd_sof_dev *sof_dev); /* mandatory */ |
Fred Oh | a70eb70 | 2020-11-27 18:40:21 +0200 | [diff] [blame] | 128 | int (*stall)(struct snd_sof_dev *sof_dev, unsigned int core_mask); /* optional */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 129 | int (*reset)(struct snd_sof_dev *sof_dev); /* optional */ |
| 130 | int (*core_power_up)(struct snd_sof_dev *sof_dev, |
| 131 | unsigned int core_mask); /* optional */ |
| 132 | int (*core_power_down)(struct snd_sof_dev *sof_dev, |
| 133 | unsigned int core_mask); /* optional */ |
| 134 | |
| 135 | /* |
| 136 | * Register IO: only used by respective drivers themselves, |
| 137 | * TODO: consider removing these operations and calling respective |
| 138 | * implementations directly |
| 139 | */ |
| 140 | void (*write)(struct snd_sof_dev *sof_dev, void __iomem *addr, |
| 141 | u32 value); /* optional */ |
| 142 | u32 (*read)(struct snd_sof_dev *sof_dev, |
| 143 | void __iomem *addr); /* optional */ |
| 144 | void (*write64)(struct snd_sof_dev *sof_dev, void __iomem *addr, |
| 145 | u64 value); /* optional */ |
| 146 | u64 (*read64)(struct snd_sof_dev *sof_dev, |
| 147 | void __iomem *addr); /* optional */ |
| 148 | |
| 149 | /* memcpy IO */ |
Peter Ujfalusi | 4624bb2 | 2021-09-15 15:21:11 +0300 | [diff] [blame] | 150 | int (*block_read)(struct snd_sof_dev *sof_dev, |
| 151 | enum snd_sof_fw_blk_type type, u32 offset, |
| 152 | void *dest, size_t size); /* mandatory */ |
| 153 | int (*block_write)(struct snd_sof_dev *sof_dev, |
| 154 | enum snd_sof_fw_blk_type type, u32 offset, |
| 155 | void *src, size_t size); /* mandatory */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 156 | |
Daniel Baluta | f71f59d | 2021-10-04 18:21:44 +0300 | [diff] [blame] | 157 | /* Mailbox IO */ |
| 158 | void (*mailbox_read)(struct snd_sof_dev *sof_dev, |
| 159 | u32 offset, void *dest, |
| 160 | size_t size); /* optional */ |
| 161 | void (*mailbox_write)(struct snd_sof_dev *sof_dev, |
| 162 | u32 offset, void *src, |
| 163 | size_t size); /* optional */ |
| 164 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 165 | /* doorbell */ |
| 166 | irqreturn_t (*irq_handler)(int irq, void *context); /* optional */ |
| 167 | irqreturn_t (*irq_thread)(int irq, void *context); /* optional */ |
| 168 | |
| 169 | /* ipc */ |
| 170 | int (*send_msg)(struct snd_sof_dev *sof_dev, |
| 171 | struct snd_sof_ipc_msg *msg); /* mandatory */ |
| 172 | |
| 173 | /* FW loading */ |
| 174 | int (*load_firmware)(struct snd_sof_dev *sof_dev); /* mandatory */ |
| 175 | int (*load_module)(struct snd_sof_dev *sof_dev, |
| 176 | struct snd_sof_mod_hdr *hdr); /* optional */ |
| 177 | /* |
| 178 | * FW ready checks for ABI compatibility and creates |
| 179 | * memory windows at first boot |
| 180 | */ |
Ranjani Sridharan | 8692d49 | 2019-09-27 15:05:32 -0500 | [diff] [blame] | 181 | int (*fw_ready)(struct snd_sof_dev *sdev, u32 msg_id); /* mandatory */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 182 | |
| 183 | /* connect pcm substream to a host stream */ |
| 184 | int (*pcm_open)(struct snd_sof_dev *sdev, |
| 185 | struct snd_pcm_substream *substream); /* optional */ |
| 186 | /* disconnect pcm substream to a host stream */ |
| 187 | int (*pcm_close)(struct snd_sof_dev *sdev, |
| 188 | struct snd_pcm_substream *substream); /* optional */ |
| 189 | |
| 190 | /* host stream hw params */ |
| 191 | int (*pcm_hw_params)(struct snd_sof_dev *sdev, |
| 192 | struct snd_pcm_substream *substream, |
| 193 | struct snd_pcm_hw_params *params, |
| 194 | struct sof_ipc_stream_params *ipc_params); /* optional */ |
| 195 | |
Ranjani Sridharan | 93146bc | 2019-06-12 12:23:39 -0500 | [diff] [blame] | 196 | /* host stream hw_free */ |
| 197 | int (*pcm_hw_free)(struct snd_sof_dev *sdev, |
| 198 | struct snd_pcm_substream *substream); /* optional */ |
| 199 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 200 | /* host stream trigger */ |
| 201 | int (*pcm_trigger)(struct snd_sof_dev *sdev, |
| 202 | struct snd_pcm_substream *substream, |
| 203 | int cmd); /* optional */ |
| 204 | |
| 205 | /* host stream pointer */ |
| 206 | snd_pcm_uframes_t (*pcm_pointer)(struct snd_sof_dev *sdev, |
| 207 | struct snd_pcm_substream *substream); /* optional */ |
| 208 | |
Cezary Rojewski | e145e9a | 2020-02-18 15:39:20 +0100 | [diff] [blame] | 209 | #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES) |
| 210 | /* Except for probe_pointer, all probe ops are mandatory */ |
| 211 | int (*probe_assign)(struct snd_sof_dev *sdev, |
| 212 | struct snd_compr_stream *cstream, |
| 213 | struct snd_soc_dai *dai); /* mandatory */ |
| 214 | int (*probe_free)(struct snd_sof_dev *sdev, |
| 215 | struct snd_compr_stream *cstream, |
| 216 | struct snd_soc_dai *dai); /* mandatory */ |
| 217 | int (*probe_set_params)(struct snd_sof_dev *sdev, |
| 218 | struct snd_compr_stream *cstream, |
| 219 | struct snd_compr_params *params, |
| 220 | struct snd_soc_dai *dai); /* mandatory */ |
| 221 | int (*probe_trigger)(struct snd_sof_dev *sdev, |
| 222 | struct snd_compr_stream *cstream, int cmd, |
| 223 | struct snd_soc_dai *dai); /* mandatory */ |
| 224 | int (*probe_pointer)(struct snd_sof_dev *sdev, |
| 225 | struct snd_compr_stream *cstream, |
| 226 | struct snd_compr_tstamp *tstamp, |
| 227 | struct snd_soc_dai *dai); /* optional */ |
| 228 | #endif |
| 229 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 230 | /* host read DSP stream data */ |
Guennadi Liakhovetski | 6a0ba07 | 2021-09-28 13:35:16 +0300 | [diff] [blame] | 231 | int (*ipc_msg_data)(struct snd_sof_dev *sdev, |
| 232 | struct snd_pcm_substream *substream, |
| 233 | void *p, size_t sz); /* mandatory */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 234 | |
| 235 | /* host configure DSP HW parameters */ |
| 236 | int (*ipc_pcm_params)(struct snd_sof_dev *sdev, |
| 237 | struct snd_pcm_substream *substream, |
| 238 | const struct sof_ipc_pcm_params_reply *reply); /* mandatory */ |
| 239 | |
| 240 | /* pre/post firmware run */ |
| 241 | int (*pre_fw_run)(struct snd_sof_dev *sof_dev); /* optional */ |
| 242 | int (*post_fw_run)(struct snd_sof_dev *sof_dev); /* optional */ |
| 243 | |
Fred Oh | e984f3ef | 2020-11-27 18:40:18 +0200 | [diff] [blame] | 244 | /* parse platform specific extended manifest, optional */ |
| 245 | int (*parse_platform_ext_manifest)(struct snd_sof_dev *sof_dev, |
| 246 | const struct sof_ext_man_elem_header *hdr); |
| 247 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 248 | /* DSP PM */ |
Ranjani Sridharan | 61e285c | 2020-01-29 16:07:22 -0600 | [diff] [blame] | 249 | int (*suspend)(struct snd_sof_dev *sof_dev, |
| 250 | u32 target_state); /* optional */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 251 | int (*resume)(struct snd_sof_dev *sof_dev); /* optional */ |
Fred Oh | 1c38c92 | 2019-07-22 09:13:50 -0500 | [diff] [blame] | 252 | int (*runtime_suspend)(struct snd_sof_dev *sof_dev); /* optional */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 253 | int (*runtime_resume)(struct snd_sof_dev *sof_dev); /* optional */ |
Kai Vehmanen | 62fde97 | 2019-07-02 16:24:27 +0300 | [diff] [blame] | 254 | int (*runtime_idle)(struct snd_sof_dev *sof_dev); /* optional */ |
Ranjani Sridharan | 7077a07 | 2019-06-12 12:23:38 -0500 | [diff] [blame] | 255 | int (*set_hw_params_upon_resume)(struct snd_sof_dev *sdev); /* optional */ |
Keyon Jie | e8f112d | 2019-10-25 17:40:59 -0500 | [diff] [blame] | 256 | int (*set_power_state)(struct snd_sof_dev *sdev, |
Ranjani Sridharan | 61e285c | 2020-01-29 16:07:22 -0600 | [diff] [blame] | 257 | const struct sof_dsp_power_state *target_state); /* optional */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 258 | |
| 259 | /* DSP clocking */ |
| 260 | int (*set_clk)(struct snd_sof_dev *sof_dev, u32 freq); /* optional */ |
| 261 | |
| 262 | /* debug */ |
| 263 | const struct snd_sof_debugfs_map *debug_map; /* optional */ |
| 264 | int debug_map_count; /* optional */ |
| 265 | void (*dbg_dump)(struct snd_sof_dev *sof_dev, |
| 266 | u32 flags); /* optional */ |
Pan Xiuli | 5e4a27f | 2019-04-30 18:09:32 -0500 | [diff] [blame] | 267 | void (*ipc_dump)(struct snd_sof_dev *sof_dev); /* optional */ |
Peter Ujfalusi | 07e833b | 2021-09-15 15:21:12 +0300 | [diff] [blame] | 268 | int (*debugfs_add_region_item)(struct snd_sof_dev *sdev, |
| 269 | enum snd_sof_fw_blk_type blk_type, u32 offset, |
| 270 | size_t size, const char *name, |
| 271 | enum sof_debugfs_access_type access_type); /* optional */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 272 | |
| 273 | /* host DMA trace initialization */ |
| 274 | int (*trace_init)(struct snd_sof_dev *sdev, |
| 275 | u32 *stream_tag); /* optional */ |
| 276 | int (*trace_release)(struct snd_sof_dev *sdev); /* optional */ |
| 277 | int (*trace_trigger)(struct snd_sof_dev *sdev, |
| 278 | int cmd); /* optional */ |
| 279 | |
Daniel Baluta | ce8234a | 2019-07-22 09:13:47 -0500 | [diff] [blame] | 280 | /* misc */ |
| 281 | int (*get_bar_index)(struct snd_sof_dev *sdev, |
| 282 | u32 type); /* optional */ |
Daniel Baluta | bb9c93f | 2019-08-07 10:01:59 -0500 | [diff] [blame] | 283 | int (*get_mailbox_offset)(struct snd_sof_dev *sdev);/* mandatory for common loader code */ |
Daniel Baluta | e17422c | 2019-08-07 10:02:00 -0500 | [diff] [blame] | 284 | int (*get_window_offset)(struct snd_sof_dev *sdev, |
| 285 | u32 id);/* mandatory for common loader code */ |
Daniel Baluta | bb9c93f | 2019-08-07 10:01:59 -0500 | [diff] [blame] | 286 | |
Daniel Baluta | 285880a | 2019-12-04 15:15:53 -0600 | [diff] [blame] | 287 | /* machine driver ops */ |
| 288 | int (*machine_register)(struct snd_sof_dev *sdev, |
| 289 | void *pdata); /* optional */ |
| 290 | void (*machine_unregister)(struct snd_sof_dev *sdev, |
| 291 | void *pdata); /* optional */ |
| 292 | void (*machine_select)(struct snd_sof_dev *sdev); /* optional */ |
| 293 | void (*set_mach_params)(const struct snd_soc_acpi_mach *mach, |
Pierre-Louis Bossart | 17e9d6b | 2021-04-09 15:01:18 -0700 | [diff] [blame] | 294 | struct snd_sof_dev *sdev); /* optional */ |
Daniel Baluta | 285880a | 2019-12-04 15:15:53 -0600 | [diff] [blame] | 295 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 296 | /* DAI ops */ |
| 297 | struct snd_soc_dai_driver *drv; |
| 298 | int num_drv; |
Pierre-Louis Bossart | 27e322f | 2019-10-24 16:03:17 -0500 | [diff] [blame] | 299 | |
| 300 | /* ALSA HW info flags, will be stored in snd_pcm_runtime.hw.info */ |
| 301 | u32 hw_info; |
Pierre-Louis Bossart | 0f501c7 | 2019-12-17 14:22:30 -0600 | [diff] [blame] | 302 | |
Peter Ujfalusi | 0ed66cb | 2021-09-16 16:03:08 +0300 | [diff] [blame] | 303 | const struct dsp_arch_ops *dsp_arch_ops; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 304 | }; |
| 305 | |
| 306 | /* DSP architecture specific callbacks for oops and stack dumps */ |
Peter Ujfalusi | 0ed66cb | 2021-09-16 16:03:08 +0300 | [diff] [blame] | 307 | struct dsp_arch_ops { |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 308 | void (*dsp_oops)(struct snd_sof_dev *sdev, void *oops); |
| 309 | void (*dsp_stack)(struct snd_sof_dev *sdev, void *oops, |
| 310 | u32 *stack, u32 stack_words); |
| 311 | }; |
| 312 | |
Peter Ujfalusi | 0ed66cb | 2021-09-16 16:03:08 +0300 | [diff] [blame] | 313 | #define sof_dsp_arch_ops(sdev) ((sdev)->pdata->desc->ops->dsp_arch_ops) |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 314 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 315 | /* FS entry for debug files that can expose DSP memories, registers */ |
| 316 | struct snd_sof_dfsentry { |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 317 | size_t size; |
Karol Trzcinski | 5b10b62 | 2020-11-24 20:00:17 +0200 | [diff] [blame] | 318 | size_t buf_data_size; /* length of buffered data for file read operation */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 319 | enum sof_dfsentry_type type; |
| 320 | /* |
| 321 | * access_type specifies if the |
| 322 | * memory -> DSP resource (memory, register etc) is always accessible |
| 323 | * or if it is accessible only when the DSP is in D0. |
| 324 | */ |
| 325 | enum sof_debugfs_access_type access_type; |
Ranjani Sridharan | 091c12e | 2019-06-03 11:18:20 -0500 | [diff] [blame] | 326 | #if ENABLE_DEBUGFS_CACHEBUF |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 327 | char *cache_buf; /* buffer to cache the contents of debugfs memory */ |
| 328 | #endif |
| 329 | struct snd_sof_dev *sdev; |
| 330 | struct list_head list; /* list in sdev dfsentry list */ |
| 331 | union { |
| 332 | void __iomem *io_mem; |
| 333 | void *buf; |
| 334 | }; |
| 335 | }; |
| 336 | |
| 337 | /* Debug mapping for any DSP memory or registers that can used for debug */ |
| 338 | struct snd_sof_debugfs_map { |
| 339 | const char *name; |
| 340 | u32 bar; |
| 341 | u32 offset; |
| 342 | u32 size; |
| 343 | /* |
| 344 | * access_type specifies if the memory is always accessible |
| 345 | * or if it is accessible only when the DSP is in D0. |
| 346 | */ |
| 347 | enum sof_debugfs_access_type access_type; |
| 348 | }; |
| 349 | |
| 350 | /* mailbox descriptor, used for host <-> DSP IPC */ |
| 351 | struct snd_sof_mailbox { |
| 352 | u32 offset; |
| 353 | size_t size; |
| 354 | }; |
| 355 | |
| 356 | /* IPC message descriptor for host <-> DSP IO */ |
| 357 | struct snd_sof_ipc_msg { |
| 358 | /* message data */ |
| 359 | u32 header; |
| 360 | void *msg_data; |
| 361 | void *reply_data; |
| 362 | size_t msg_size; |
| 363 | size_t reply_size; |
| 364 | int reply_error; |
| 365 | |
| 366 | wait_queue_head_t waitq; |
| 367 | bool ipc_complete; |
| 368 | }; |
| 369 | |
Ranjani Sridharan | 6ca5cec | 2019-12-17 18:26:09 -0600 | [diff] [blame] | 370 | enum snd_sof_fw_state { |
| 371 | SOF_FW_BOOT_NOT_STARTED = 0, |
| 372 | SOF_FW_BOOT_PREPARE, |
| 373 | SOF_FW_BOOT_IN_PROGRESS, |
| 374 | SOF_FW_BOOT_FAILED, |
| 375 | SOF_FW_BOOT_READY_FAILED, /* firmware booted but fw_ready op failed */ |
| 376 | SOF_FW_BOOT_COMPLETE, |
| 377 | }; |
| 378 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 379 | /* |
| 380 | * SOF Device Level. |
| 381 | */ |
| 382 | struct snd_sof_dev { |
| 383 | struct device *dev; |
| 384 | spinlock_t ipc_lock; /* lock for IPC users */ |
| 385 | spinlock_t hw_lock; /* lock for HW IO access */ |
| 386 | |
| 387 | /* |
| 388 | * ASoC components. plat_drv fields are set dynamically so |
| 389 | * can't use const |
| 390 | */ |
| 391 | struct snd_soc_component_driver plat_drv; |
| 392 | |
Ranjani Sridharan | 61e285c | 2020-01-29 16:07:22 -0600 | [diff] [blame] | 393 | /* current DSP power state */ |
| 394 | struct sof_dsp_power_state dsp_power_state; |
Keyon Jie | 8b66d7c | 2021-01-05 17:56:40 +0200 | [diff] [blame] | 395 | /* mutex to protect the dsp_power_state access */ |
| 396 | struct mutex power_state_access; |
Ranjani Sridharan | 043ae13 | 2020-01-29 16:07:20 -0600 | [diff] [blame] | 397 | |
| 398 | /* Intended power target of system suspend */ |
| 399 | enum sof_system_suspend_state system_suspend_target; |
Keyon Jie | 4c19030 | 2019-10-25 17:40:57 -0500 | [diff] [blame] | 400 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 401 | /* DSP firmware boot */ |
| 402 | wait_queue_head_t boot_wait; |
Ranjani Sridharan | 6ca5cec | 2019-12-17 18:26:09 -0600 | [diff] [blame] | 403 | enum snd_sof_fw_state fw_state; |
Guennadi Liakhovetski | f738d81 | 2020-08-24 15:09:06 -0500 | [diff] [blame] | 404 | bool first_boot; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 405 | |
| 406 | /* work queue in case the probe is implemented in two steps */ |
| 407 | struct work_struct probe_work; |
Kai Vehmanen | 271d937 | 2021-02-10 12:52:37 +0200 | [diff] [blame] | 408 | bool probe_completed; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 409 | |
| 410 | /* DSP HW differentiation */ |
| 411 | struct snd_sof_pdata *pdata; |
| 412 | |
| 413 | /* IPC */ |
| 414 | struct snd_sof_ipc *ipc; |
| 415 | struct snd_sof_mailbox dsp_box; /* DSP initiated IPC */ |
| 416 | struct snd_sof_mailbox host_box; /* Host initiated IPC */ |
| 417 | struct snd_sof_mailbox stream_box; /* Stream position update */ |
Iulian Olaru | e17b738 | 2020-08-25 16:58:54 -0700 | [diff] [blame] | 418 | struct snd_sof_mailbox debug_box; /* Debug info updates */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 419 | struct snd_sof_ipc_msg *msg; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 420 | int ipc_irq; |
| 421 | u32 next_comp_id; /* monotonic - reset during S3 */ |
| 422 | |
| 423 | /* memory bases for mmaped DSPs - set by dsp_init() */ |
| 424 | void __iomem *bar[SND_SOF_BARS]; /* DSP base address */ |
| 425 | int mmio_bar; |
| 426 | int mailbox_bar; |
| 427 | size_t dsp_oops_offset; |
| 428 | |
| 429 | /* debug */ |
| 430 | struct dentry *debugfs_root; |
| 431 | struct list_head dfsentry_list; |
Peter Ujfalusi | 9ff9085 | 2021-10-06 14:06:30 +0300 | [diff] [blame] | 432 | bool dbg_dump_printed; |
| 433 | bool ipc_dump_printed; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 434 | |
| 435 | /* firmware loader */ |
| 436 | struct snd_dma_buffer dmab; |
| 437 | struct snd_dma_buffer dmab_bdl; |
| 438 | struct sof_ipc_fw_ready fw_ready; |
| 439 | struct sof_ipc_fw_version fw_version; |
Karol Trzcinski | 5928395 | 2019-12-17 18:26:11 -0600 | [diff] [blame] | 440 | struct sof_ipc_cc_version *cc_version; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 441 | |
| 442 | /* topology */ |
| 443 | struct snd_soc_tplg_ops *tplg_ops; |
| 444 | struct list_head pcm_list; |
| 445 | struct list_head kcontrol_list; |
| 446 | struct list_head widget_list; |
| 447 | struct list_head dai_list; |
| 448 | struct list_head route_list; |
| 449 | struct snd_soc_component *component; |
| 450 | u32 enabled_cores_mask; /* keep track of enabled cores */ |
| 451 | |
| 452 | /* FW configuration */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 453 | struct sof_ipc_window *info_window; |
| 454 | |
| 455 | /* IPC timeouts in ms */ |
| 456 | int ipc_timeout; |
| 457 | int boot_timeout; |
| 458 | |
Cezary Rojewski | e145e9a | 2020-02-18 15:39:20 +0100 | [diff] [blame] | 459 | #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES) |
| 460 | unsigned int extractor_stream_tag; |
| 461 | #endif |
| 462 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 463 | /* DMA for Trace */ |
| 464 | struct snd_dma_buffer dmatb; |
| 465 | struct snd_dma_buffer dmatp; |
| 466 | int dma_trace_pages; |
| 467 | wait_queue_head_t trace_sleep; |
| 468 | u32 host_offset; |
Guennadi Liakhovetski | f738d81 | 2020-08-24 15:09:06 -0500 | [diff] [blame] | 469 | bool dtrace_is_supported; /* set with Kconfig or module parameter */ |
| 470 | bool dtrace_is_enabled; |
| 471 | bool dtrace_error; |
| 472 | bool dtrace_draining; |
Kai Vehmanen | ec9025e | 2019-05-24 14:23:06 -0500 | [diff] [blame] | 473 | |
Guennadi Liakhovetski | 672ff5e | 2019-07-22 09:13:57 -0500 | [diff] [blame] | 474 | bool msi_enabled; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 475 | |
| 476 | void *private; /* core does not touch this */ |
| 477 | }; |
| 478 | |
| 479 | /* |
| 480 | * Device Level. |
| 481 | */ |
| 482 | |
| 483 | int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data); |
| 484 | int snd_sof_device_remove(struct device *dev); |
Keyon Jie | 7edb305 | 2021-01-13 17:26:14 +0200 | [diff] [blame] | 485 | int snd_sof_device_shutdown(struct device *dev); |
Kai Vehmanen | 271d937 | 2021-02-10 12:52:37 +0200 | [diff] [blame] | 486 | bool snd_sof_device_probe_completed(struct device *dev); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 487 | |
| 488 | int snd_sof_runtime_suspend(struct device *dev); |
| 489 | int snd_sof_runtime_resume(struct device *dev); |
Kai Vehmanen | 62fde97 | 2019-07-02 16:24:27 +0300 | [diff] [blame] | 490 | int snd_sof_runtime_idle(struct device *dev); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 491 | int snd_sof_resume(struct device *dev); |
| 492 | int snd_sof_suspend(struct device *dev); |
Marcin Rajwa | 3541aef | 2020-05-15 16:59:52 +0300 | [diff] [blame] | 493 | int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev); |
Keyon Jie | 0b50b3b | 2019-10-25 17:41:17 -0500 | [diff] [blame] | 494 | int snd_sof_prepare(struct device *dev); |
| 495 | void snd_sof_complete(struct device *dev); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 496 | |
| 497 | void snd_sof_new_platform_drv(struct snd_sof_dev *sdev); |
| 498 | |
Ranjani Sridharan | 3e62579 | 2019-12-04 15:15:48 -0600 | [diff] [blame] | 499 | int snd_sof_create_page_table(struct device *dev, |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 500 | struct snd_dma_buffer *dmab, |
| 501 | unsigned char *page_table, size_t size); |
| 502 | |
| 503 | /* |
| 504 | * Firmware loading. |
| 505 | */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 506 | int snd_sof_load_firmware_raw(struct snd_sof_dev *sdev); |
| 507 | int snd_sof_load_firmware_memcpy(struct snd_sof_dev *sdev); |
| 508 | int snd_sof_run_firmware(struct snd_sof_dev *sdev); |
| 509 | int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev, |
| 510 | struct snd_sof_mod_hdr *module); |
| 511 | void snd_sof_fw_unload(struct snd_sof_dev *sdev); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 512 | |
| 513 | /* |
| 514 | * IPC low level APIs. |
| 515 | */ |
| 516 | struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev); |
| 517 | void snd_sof_ipc_free(struct snd_sof_dev *sdev); |
Ranjani Sridharan | d7a1ed2 | 2020-05-26 15:36:37 -0500 | [diff] [blame] | 518 | void snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 519 | void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev); |
| 520 | int snd_sof_ipc_stream_pcm_params(struct snd_sof_dev *sdev, |
| 521 | struct sof_ipc_pcm_params *params); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 522 | int snd_sof_ipc_valid(struct snd_sof_dev *sdev); |
| 523 | int sof_ipc_tx_message(struct snd_sof_ipc *ipc, u32 header, |
| 524 | void *msg_data, size_t msg_bytes, void *reply_data, |
| 525 | size_t reply_bytes); |
Ranjani Sridharan | 63e51fd3 | 2020-01-29 16:07:25 -0600 | [diff] [blame] | 526 | int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, u32 header, |
| 527 | void *msg_data, size_t msg_bytes, |
| 528 | void *reply_data, size_t reply_bytes); |
Rander Wang | febf5da | 2021-10-08 12:38:36 +0300 | [diff] [blame] | 529 | int sof_ipc_init_msg_memory(struct snd_sof_dev *sdev); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 530 | |
| 531 | /* |
| 532 | * Trace/debug |
| 533 | */ |
| 534 | int snd_sof_init_trace(struct snd_sof_dev *sdev); |
| 535 | void snd_sof_release_trace(struct snd_sof_dev *sdev); |
| 536 | void snd_sof_free_trace(struct snd_sof_dev *sdev); |
| 537 | int snd_sof_dbg_init(struct snd_sof_dev *sdev); |
| 538 | void snd_sof_free_debug(struct snd_sof_dev *sdev); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 539 | int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev, |
| 540 | void *base, size_t size, |
Ranjani Sridharan | 5c9714f | 2019-06-03 11:18:18 -0500 | [diff] [blame] | 541 | const char *name, mode_t mode); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 542 | int snd_sof_trace_update_pos(struct snd_sof_dev *sdev, |
| 543 | struct sof_ipc_dma_trace_posn *posn); |
| 544 | void snd_sof_trace_notify_for_error(struct snd_sof_dev *sdev); |
| 545 | void snd_sof_get_status(struct snd_sof_dev *sdev, u32 panic_code, |
| 546 | u32 tracep_code, void *oops, |
| 547 | struct sof_ipc_panic_info *panic_info, |
| 548 | void *stack, size_t stack_words); |
| 549 | int snd_sof_init_trace_ipc(struct snd_sof_dev *sdev); |
Liam Girdwood | 9a06508 | 2019-09-27 15:05:29 -0500 | [diff] [blame] | 550 | void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev); |
Karol Trzcinski | 5b10b62 | 2020-11-24 20:00:17 +0200 | [diff] [blame] | 551 | int snd_sof_dbg_memory_info_init(struct snd_sof_dev *sdev); |
Peter Ujfalusi | 07e833b | 2021-09-15 15:21:12 +0300 | [diff] [blame] | 552 | int snd_sof_debugfs_add_region_item_iomem(struct snd_sof_dev *sdev, |
| 553 | enum snd_sof_fw_blk_type blk_type, u32 offset, size_t size, |
| 554 | const char *name, enum sof_debugfs_access_type access_type); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 555 | |
| 556 | /* |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 557 | * DSP Architectures. |
| 558 | */ |
| 559 | static inline void sof_stack(struct snd_sof_dev *sdev, void *oops, u32 *stack, |
| 560 | u32 stack_words) |
| 561 | { |
Peter Ujfalusi | 0ed66cb | 2021-09-16 16:03:08 +0300 | [diff] [blame] | 562 | sof_dsp_arch_ops(sdev)->dsp_stack(sdev, oops, stack, stack_words); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 563 | } |
| 564 | |
| 565 | static inline void sof_oops(struct snd_sof_dev *sdev, void *oops) |
| 566 | { |
Peter Ujfalusi | 0ed66cb | 2021-09-16 16:03:08 +0300 | [diff] [blame] | 567 | if (sof_dsp_arch_ops(sdev)->dsp_oops) |
| 568 | sof_dsp_arch_ops(sdev)->dsp_oops(sdev, oops); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 569 | } |
| 570 | |
Peter Ujfalusi | 0ed66cb | 2021-09-16 16:03:08 +0300 | [diff] [blame] | 571 | extern const struct dsp_arch_ops sof_xtensa_arch_ops; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 572 | |
| 573 | /* |
Peter Ujfalusi | 58a5c9a | 2021-10-06 14:06:40 +0300 | [diff] [blame] | 574 | * Firmware state tracking |
| 575 | */ |
| 576 | static inline void sof_set_fw_state(struct snd_sof_dev *sdev, |
| 577 | enum snd_sof_fw_state new_state) |
| 578 | { |
| 579 | if (sdev->fw_state == new_state) |
| 580 | return; |
| 581 | |
| 582 | dev_dbg(sdev->dev, "fw_state change: %d -> %d\n", sdev->fw_state, new_state); |
| 583 | sdev->fw_state = new_state; |
| 584 | } |
| 585 | |
| 586 | /* |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 587 | * Utilities |
| 588 | */ |
| 589 | void sof_io_write(struct snd_sof_dev *sdev, void __iomem *addr, u32 value); |
| 590 | void sof_io_write64(struct snd_sof_dev *sdev, void __iomem *addr, u64 value); |
| 591 | u32 sof_io_read(struct snd_sof_dev *sdev, void __iomem *addr); |
| 592 | u64 sof_io_read64(struct snd_sof_dev *sdev, void __iomem *addr); |
| 593 | void sof_mailbox_write(struct snd_sof_dev *sdev, u32 offset, |
| 594 | void *message, size_t bytes); |
| 595 | void sof_mailbox_read(struct snd_sof_dev *sdev, u32 offset, |
| 596 | void *message, size_t bytes); |
Peter Ujfalusi | 4624bb2 | 2021-09-15 15:21:11 +0300 | [diff] [blame] | 597 | int sof_block_write(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_type, |
| 598 | u32 offset, void *src, size_t size); |
| 599 | int sof_block_read(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_type, |
| 600 | u32 offset, void *dest, size_t size); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 601 | |
Daniel Baluta | 83ee7ab | 2019-08-07 10:02:01 -0500 | [diff] [blame] | 602 | int sof_fw_ready(struct snd_sof_dev *sdev, u32 msg_id); |
| 603 | |
Bud Liviu-Alexandru | 97e22cb | 2021-10-04 18:21:45 +0300 | [diff] [blame] | 604 | int sof_ipc_msg_data(struct snd_sof_dev *sdev, |
| 605 | struct snd_pcm_substream *substream, |
| 606 | void *p, size_t sz); |
| 607 | int sof_ipc_pcm_params(struct snd_sof_dev *sdev, |
Guennadi Liakhovetski | 6a0ba07 | 2021-09-28 13:35:16 +0300 | [diff] [blame] | 608 | struct snd_pcm_substream *substream, |
Bud Liviu-Alexandru | 97e22cb | 2021-10-04 18:21:45 +0300 | [diff] [blame] | 609 | const struct sof_ipc_pcm_params_reply *reply); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 610 | |
Bud Liviu-Alexandru | 97e22cb | 2021-10-04 18:21:45 +0300 | [diff] [blame] | 611 | int sof_stream_pcm_open(struct snd_sof_dev *sdev, |
| 612 | struct snd_pcm_substream *substream); |
| 613 | int sof_stream_pcm_close(struct snd_sof_dev *sdev, |
| 614 | struct snd_pcm_substream *substream); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 615 | |
Daniel Baluta | 285880a | 2019-12-04 15:15:53 -0600 | [diff] [blame] | 616 | int sof_machine_check(struct snd_sof_dev *sdev); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 617 | #endif |