/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ /* Copyright (c) 2015-2022 Graphcore Ltd. */ /* * Ipu device driver. * * Description: PCI device handling. */ #ifndef _pci_h_ #define _pci_h_ #include "ipu_driver.h" int ipu_pci_init(void); void ipu_pci_exit(void); void start_tile_clk_speed_thread(struct device *dev); void stop_tile_clk_speed_thread(struct device *dev); void restore_board_info(struct ipu_device *ipu_dev); u32 read_hsp_marks(struct ipu_device *ipu_dev); extern unsigned long memmap_size[]; extern unsigned long memmap_start[]; /* minimum allocation 16K bytes allows upto 256G contiguous memory */ #define GENALLOC_ORDER_MINIMUM (14) #define GENALLOC_SIZE_MINIMUM BIT(GENALLOC_ORDER_MINIMUM) #define MAX_CMEM_NODES (16) // Max C600 IPUS supported on a single PCIE host #define MAX_IPUS_PCIE_C600 (16) int contiguous_mem_alloc(u64 size, u64 *virt, u64 *phys, int node); int contiguous_mem_free(u64 size, u64 virt, int node); int get_cmem_node(struct ipu_device *ipu_dev); int ipu_icu_process_event(struct ipu_device *ipu_dev, struct mailbox_msg *event); void send_signal(struct ipu_device *dev, int sig_num, struct pid *user_pid, int user_device_id); #define ARCH_MAP(offset) \ (ipu_dev->arch_map->offset) extern struct ipu_hexopt_constant ipu_hexopt_constants[]; #endif