blob: 7deadd97ce311a6fa92c6a87e3521c6a4095a0b3 [file] [log] [blame]
Mika Westerbergfd3b3392018-10-01 12:31:21 +03001/* SPDX-License-Identifier: GPL-2.0 */
Mika Westerberg3e136762017-06-06 15:25:14 +03002/*
3 * Thunderbolt DMA configuration based mailbox support
4 *
5 * Copyright (C) 2017, Intel Corporation
6 * Authors: Michael Jamet <michael.jamet@intel.com>
7 * Mika Westerberg <mika.westerberg@linux.intel.com>
Mika Westerberg3e136762017-06-06 15:25:14 +03008 */
9
10#ifndef DMA_PORT_H_
11#define DMA_PORT_H_
12
13#include "tb.h"
14
15struct tb_switch;
16struct tb_dma_port;
17
18#define DMA_PORT_CSS_ADDRESS 0x3fffff
19#define DMA_PORT_CSS_MAX_SIZE SZ_128
20
21struct tb_dma_port *dma_port_alloc(struct tb_switch *sw);
22void dma_port_free(struct tb_dma_port *dma);
23int dma_port_flash_read(struct tb_dma_port *dma, unsigned int address,
24 void *buf, size_t size);
25int dma_port_flash_update_auth(struct tb_dma_port *dma);
26int dma_port_flash_update_auth_status(struct tb_dma_port *dma, u32 *status);
27int dma_port_flash_write(struct tb_dma_port *dma, unsigned int address,
28 const void *buf, size_t size);
29int dma_port_power_cycle(struct tb_dma_port *dma);
30
31#endif