1*fd3b339cSMika Westerberg /* SPDX-License-Identifier: GPL-2.0 */ 23e136768SMika Westerberg /* 33e136768SMika Westerberg * Thunderbolt DMA configuration based mailbox support 43e136768SMika Westerberg * 53e136768SMika Westerberg * Copyright (C) 2017, Intel Corporation 63e136768SMika Westerberg * Authors: Michael Jamet <michael.jamet@intel.com> 73e136768SMika Westerberg * Mika Westerberg <mika.westerberg@linux.intel.com> 83e136768SMika Westerberg */ 93e136768SMika Westerberg 103e136768SMika Westerberg #ifndef DMA_PORT_H_ 113e136768SMika Westerberg #define DMA_PORT_H_ 123e136768SMika Westerberg 133e136768SMika Westerberg #include "tb.h" 143e136768SMika Westerberg 153e136768SMika Westerberg struct tb_switch; 163e136768SMika Westerberg struct tb_dma_port; 173e136768SMika Westerberg 183e136768SMika Westerberg #define DMA_PORT_CSS_ADDRESS 0x3fffff 193e136768SMika Westerberg #define DMA_PORT_CSS_MAX_SIZE SZ_128 203e136768SMika Westerberg 213e136768SMika Westerberg struct tb_dma_port *dma_port_alloc(struct tb_switch *sw); 223e136768SMika Westerberg void dma_port_free(struct tb_dma_port *dma); 233e136768SMika Westerberg int dma_port_flash_read(struct tb_dma_port *dma, unsigned int address, 243e136768SMika Westerberg void *buf, size_t size); 253e136768SMika Westerberg int dma_port_flash_update_auth(struct tb_dma_port *dma); 263e136768SMika Westerberg int dma_port_flash_update_auth_status(struct tb_dma_port *dma, u32 *status); 273e136768SMika Westerberg int dma_port_flash_write(struct tb_dma_port *dma, unsigned int address, 283e136768SMika Westerberg const void *buf, size_t size); 293e136768SMika Westerberg int dma_port_power_cycle(struct tb_dma_port *dma); 303e136768SMika Westerberg 313e136768SMika Westerberg #endif 32