Mika Westerberg | 3e13676 | 2017-06-06 15:25:14 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Thunderbolt DMA configuration based mailbox support |
| 3 | * |
| 4 | * Copyright (C) 2017, Intel Corporation |
| 5 | * Authors: Michael Jamet <michael.jamet@intel.com> |
| 6 | * Mika Westerberg <mika.westerberg@linux.intel.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #ifndef DMA_PORT_H_ |
| 14 | #define DMA_PORT_H_ |
| 15 | |
| 16 | #include "tb.h" |
| 17 | |
| 18 | struct tb_switch; |
| 19 | struct tb_dma_port; |
| 20 | |
| 21 | #define DMA_PORT_CSS_ADDRESS 0x3fffff |
| 22 | #define DMA_PORT_CSS_MAX_SIZE SZ_128 |
| 23 | |
| 24 | struct tb_dma_port *dma_port_alloc(struct tb_switch *sw); |
| 25 | void dma_port_free(struct tb_dma_port *dma); |
| 26 | int dma_port_flash_read(struct tb_dma_port *dma, unsigned int address, |
| 27 | void *buf, size_t size); |
| 28 | int dma_port_flash_update_auth(struct tb_dma_port *dma); |
| 29 | int dma_port_flash_update_auth_status(struct tb_dma_port *dma, u32 *status); |
| 30 | int dma_port_flash_write(struct tb_dma_port *dma, unsigned int address, |
| 31 | const void *buf, size_t size); |
| 32 | int dma_port_power_cycle(struct tb_dma_port *dma); |
| 33 | |
| 34 | #endif |