cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

pci.h (1943B)


      1/* SPDX-License-Identifier: MIT */
      2#ifndef __NVKM_PCI_H__
      3#define __NVKM_PCI_H__
      4#include <core/subdev.h>
      5
      6enum nvkm_pcie_speed {
      7	NVKM_PCIE_SPEED_2_5,
      8	NVKM_PCIE_SPEED_5_0,
      9	NVKM_PCIE_SPEED_8_0,
     10};
     11
     12struct nvkm_pci {
     13	const struct nvkm_pci_func *func;
     14	struct nvkm_subdev subdev;
     15	struct pci_dev *pdev;
     16	int irq;
     17
     18	struct {
     19		struct agp_bridge_data *bridge;
     20		u32 mode;
     21		u64 base;
     22		u64 size;
     23		int mtrr;
     24		bool cma;
     25		bool acquired;
     26	} agp;
     27
     28	struct {
     29		enum nvkm_pcie_speed speed;
     30		u8 width;
     31	} pcie;
     32
     33	bool msi;
     34};
     35
     36u32 nvkm_pci_rd32(struct nvkm_pci *, u16 addr);
     37void nvkm_pci_wr08(struct nvkm_pci *, u16 addr, u8 data);
     38void nvkm_pci_wr32(struct nvkm_pci *, u16 addr, u32 data);
     39u32 nvkm_pci_mask(struct nvkm_pci *, u16 addr, u32 mask, u32 value);
     40void nvkm_pci_rom_shadow(struct nvkm_pci *, bool shadow);
     41
     42int nv04_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     43int nv40_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     44int nv46_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     45int nv4c_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     46int g84_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     47int g92_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     48int g94_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     49int gf100_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     50int gf106_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     51int gk104_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     52int gp100_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **);
     53
     54/* pcie functions */
     55int nvkm_pcie_set_link(struct nvkm_pci *, enum nvkm_pcie_speed, u8 width);
     56#endif