39 lines
1.4 KiB
C
39 lines
1.4 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/**
|
|
* Copyright (c) 2024-2025 CALCULET Technologies Ltd. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _CALCULET_FOPS_H_
|
|
#define _CALCULET_FOPS_H_
|
|
|
|
#include <linux/fs.h>
|
|
#include <linux/interrupt.h>
|
|
|
|
// 定义offset映射规则
|
|
#define MMAP_BAR2_OFFSET 0x10000000
|
|
#define MMAP_BAR4_OFFSET 0x20000000
|
|
#define MMAP_DMA_OFFSET 0x30000000
|
|
|
|
/* 为了兼容性,保留原有的一些常量定义 */
|
|
#define RESET_COMPLETION_TIMEOUT_MS 5000 // 减少到5秒
|
|
#define MAX_RESET_RETRY 100 // 增加重试次数但减少单次延时
|
|
#define RETRY_DELAY_US 1000 // 减少到1ms
|
|
|
|
// calculet ioc info bar4
|
|
#define CALCULET_PRODUCT_NAME_REG 0x0000
|
|
#define CALCULET_SERIAL_NUMBER_REG 0x4800
|
|
#define CALCULET_PRODUCT_NUMBER_REG 0x002C
|
|
#define CALCULET_FIRMWARE_VERSION_REG 0x0020
|
|
|
|
#define CALCULET_TOTAL_MEMORY_REG 0x004C
|
|
#define CALCULET_MEMORY_BANDWIDTH_REG 0x0054
|
|
#define CALCULET_DDR_FREQUENCY_REG 0x005C
|
|
#define CALCULET_MAX_POWER_LIMIT_REG 0x0060
|
|
#define CALCULET_TEMP_LIMIT_REG 0x0064
|
|
|
|
int calculet_pcie_fops_open(struct inode* inode, struct file* filp);
|
|
int calculet_pcie_fops_release(struct inode* inode, struct file* filp);
|
|
long calculet_pcie_fops_unlockedioctl(struct file* filp, unsigned int cmd, unsigned long arg);
|
|
int calculet_pcie_fops_mmap(struct file* filp, struct vm_area_struct *vma);
|
|
|
|
#endif /* _CALCULET_FOPS_H_ */ |