forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.h
....@@ -1,10 +1,8 @@
1
-/*
2
- * aQuantia Corporation Network Driver
3
- * Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved
1
+/* SPDX-License-Identifier: GPL-2.0-only */
2
+/* Atlantic Network Driver
43 *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
4
+ * Copyright (C) 2014-2019 aQuantia Corporation
5
+ * Copyright (C) 2019-2020 Marvell International Ltd.
86 */
97
108 /* File aq_hw_utils.h: Declaration of helper functions used across hardware
....@@ -14,6 +12,8 @@
1412 #ifndef AQ_HW_UTILS_H
1513 #define AQ_HW_UTILS_H
1614
15
+#include <linux/iopoll.h>
16
+
1717 #include "aq_common.h"
1818
1919 #ifndef HIDWORD
....@@ -22,18 +22,6 @@
2222 #endif
2323
2424 #define AQ_HW_SLEEP(_US_) mdelay(_US_)
25
-
26
-#define AQ_HW_WAIT_FOR(_B_, _US_, _N_) \
27
-do { \
28
- unsigned int AQ_HW_WAIT_FOR_i; \
29
- for (AQ_HW_WAIT_FOR_i = _N_; (!(_B_)) && (AQ_HW_WAIT_FOR_i);\
30
- --AQ_HW_WAIT_FOR_i) {\
31
- udelay(_US_); \
32
- } \
33
- if (!AQ_HW_WAIT_FOR_i) {\
34
- err = -ETIME; \
35
- } \
36
-} while (0)
3725
3826 #define aq_pr_err(...) pr_err(AQ_CFG_DRV_NAME ": " __VA_ARGS__)
3927 #define aq_pr_trace(...) pr_info(AQ_CFG_DRV_NAME ": " __VA_ARGS__)
....@@ -45,6 +33,10 @@
4533 u32 aq_hw_read_reg_bit(struct aq_hw_s *aq_hw, u32 addr, u32 msk, u32 shift);
4634 u32 aq_hw_read_reg(struct aq_hw_s *hw, u32 reg);
4735 void aq_hw_write_reg(struct aq_hw_s *hw, u32 reg, u32 value);
36
+u64 aq_hw_read_reg64(struct aq_hw_s *hw, u32 reg);
37
+void aq_hw_write_reg64(struct aq_hw_s *hw, u32 reg, u64 value);
4838 int aq_hw_err_from_flags(struct aq_hw_s *hw);
39
+int aq_hw_num_tcs(struct aq_hw_s *hw);
40
+int aq_hw_q_per_tc(struct aq_hw_s *hw);
4941
5042 #endif /* AQ_HW_UTILS_H */