mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
Instead of creating ad-hoc new register definitions with altered register addresses to mimic the VF's access to these registers, prepare new MMIO instance per required VF, with shifted internal location of the register map. This will allow to use unmodified register definitions in all calls to xe_mmio() functions. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patch.msgid.link/20251024205826.4652-1-michal.wajdeczko@intel.com
50 lines
1.6 KiB
C
50 lines
1.6 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2021-2023 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_MMIO_H_
|
|
#define _XE_MMIO_H_
|
|
|
|
#include "xe_gt_types.h"
|
|
|
|
struct xe_device;
|
|
struct xe_reg;
|
|
|
|
int xe_mmio_probe_early(struct xe_device *xe);
|
|
int xe_mmio_probe_tiles(struct xe_device *xe);
|
|
|
|
void xe_mmio_init(struct xe_mmio *mmio, struct xe_tile *tile, void __iomem *ptr, u32 size);
|
|
|
|
u8 xe_mmio_read8(struct xe_mmio *mmio, struct xe_reg reg);
|
|
u16 xe_mmio_read16(struct xe_mmio *mmio, struct xe_reg reg);
|
|
void xe_mmio_write32(struct xe_mmio *mmio, struct xe_reg reg, u32 val);
|
|
u32 xe_mmio_read32(struct xe_mmio *mmio, struct xe_reg reg);
|
|
u32 xe_mmio_rmw32(struct xe_mmio *mmio, struct xe_reg reg, u32 clr, u32 set);
|
|
int xe_mmio_write32_and_verify(struct xe_mmio *mmio, struct xe_reg reg, u32 val, u32 mask, u32 eval);
|
|
bool xe_mmio_in_range(const struct xe_mmio *mmio, const struct xe_mmio_range *range, struct xe_reg reg);
|
|
|
|
u64 xe_mmio_read64_2x32(struct xe_mmio *mmio, struct xe_reg reg);
|
|
int xe_mmio_wait32(struct xe_mmio *mmio, struct xe_reg reg, u32 mask, u32 val,
|
|
u32 timeout_us, u32 *out_val, bool atomic);
|
|
int xe_mmio_wait32_not(struct xe_mmio *mmio, struct xe_reg reg, u32 mask,
|
|
u32 val, u32 timeout_us, u32 *out_val, bool atomic);
|
|
|
|
static inline u32 xe_mmio_adjusted_addr(const struct xe_mmio *mmio, u32 addr)
|
|
{
|
|
if (addr < mmio->adj_limit)
|
|
addr += mmio->adj_offset;
|
|
return addr;
|
|
}
|
|
|
|
static inline struct xe_mmio *xe_root_tile_mmio(struct xe_device *xe)
|
|
{
|
|
return &xe->tiles[0].mmio;
|
|
}
|
|
|
|
#ifdef CONFIG_PCI_IOV
|
|
void xe_mmio_init_vf_view(struct xe_mmio *mmio, const struct xe_mmio *base, unsigned int vfid);
|
|
#endif
|
|
|
|
#endif
|