mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-22 16:23:29 +07:00
3e13676862
The DMA (NHI) port of a switch provides access to the NVM of the host controller (and devices starting from Intel Alpine Ridge). The NVM contains also more complete DROM for the root switch including vendor and device identification strings. This will look for the DMA port capability for each switch and if found populates sw->dma_port. We then teach tb_drom_read() to read the DROM information from NVM if available for the root switch. The DMA port capability also supports upgrading the NVM for both host controller and devices which will be added in subsequent patches. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet <michael.jamet@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andreas Noever <andreas.noever@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
/*
|
|
* Thunderbolt DMA configuration based mailbox support
|
|
*
|
|
* Copyright (C) 2017, Intel Corporation
|
|
* Authors: Michael Jamet <michael.jamet@intel.com>
|
|
* Mika Westerberg <mika.westerberg@linux.intel.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#ifndef DMA_PORT_H_
|
|
#define DMA_PORT_H_
|
|
|
|
#include "tb.h"
|
|
|
|
struct tb_switch;
|
|
struct tb_dma_port;
|
|
|
|
#define DMA_PORT_CSS_ADDRESS 0x3fffff
|
|
#define DMA_PORT_CSS_MAX_SIZE SZ_128
|
|
|
|
struct tb_dma_port *dma_port_alloc(struct tb_switch *sw);
|
|
void dma_port_free(struct tb_dma_port *dma);
|
|
int dma_port_flash_read(struct tb_dma_port *dma, unsigned int address,
|
|
void *buf, size_t size);
|
|
int dma_port_flash_update_auth(struct tb_dma_port *dma);
|
|
int dma_port_flash_update_auth_status(struct tb_dma_port *dma, u32 *status);
|
|
int dma_port_flash_write(struct tb_dma_port *dma, unsigned int address,
|
|
const void *buf, size_t size);
|
|
int dma_port_power_cycle(struct tb_dma_port *dma);
|
|
|
|
#endif
|