dma_port.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. #ifndef DMA_PORT_H_
  13. #define DMA_PORT_H_
  14. #include "tb.h"
  15. struct tb_switch;
  16. struct tb_dma_port;
  17. #define DMA_PORT_CSS_ADDRESS 0x3fffff
  18. #define DMA_PORT_CSS_MAX_SIZE SZ_128
  19. struct tb_dma_port *dma_port_alloc(struct tb_switch *sw);
  20. void dma_port_free(struct tb_dma_port *dma);
  21. int dma_port_flash_read(struct tb_dma_port *dma, unsigned int address,
  22. void *buf, size_t size);
  23. int dma_port_flash_update_auth(struct tb_dma_port *dma);
  24. int dma_port_flash_update_auth_status(struct tb_dma_port *dma, u32 *status);
  25. int dma_port_flash_write(struct tb_dma_port *dma, unsigned int address,
  26. const void *buf, size_t size);
  27. int dma_port_power_cycle(struct tb_dma_port *dma);
  28. #endif