new file mode 100644
@@ -0,0 +1,79 @@
+/* SPDX-License-Identifier: MIT */
+/* Copyright(c) 2019-2021, Celeno Communications Ltd. */
+
+#ifndef CL_FEM_COMMON_H
+#define CL_FEM_COMMON_H
+
+#define FEM_LUTS_PER_REGISTER 2
+#define FEM_LUT_AMOUNT_PER_MAC 6
+#define FEM_REGISTERS_AMOUNT (FEM_LUT_AMOUNT_PER_MAC / FEM_LUTS_PER_REGISTER)
+
+/* Also needed for iw (e2p.c) in utils, so needed to be separated from the other definitions. */
+enum fem_wiring_id {
+ /* TCV0 - 6 FEMs 3 wires, TCV1 - 6 FEMs 2 wires */
+ FEM_WIRING_0_TCV0_6_TCV1_6 = 0,
+ /* TCV0 - 6 FEMs 2 wires, TCV1 - 6 FEMs 2 wires */
+ FEM_WIRING_1_TCV0_6_TCV1_6 = 1,
+ /* TCV0 - 6 FEMs 2 wires, TCV1 - 6 FEMs 3 wires */
+ FEM_WIRING_2_TCV0_6_TCV1_6 = 2,
+ /* TCV0 - 2 FEMs 3 wires, Elastic - 4 FEMs 3 wires, TCV1 - 2 FEMs 2 wires */
+ FEM_WIRING_3_TCV0_2_ELASTIC_4_TCV1_2 = 3,
+ /* TCV0 - 2 FEMs 2 wires, Elastic - 4 FEMs 3 wires, TCV1 - 2 FEMs 2 wires */
+ FEM_WIRING_4_TCV0_2_ELASTIC_4_TCV1_2 = 4,
+ /* TCV0 - 2 FEMs 3 wires, Elastic - 4 FEMs 3 wires, TCV1 - 2 FEMs 3 wires */
+ FEM_WIRING_5_TCV0_2_ELASTIC_4_TCV1_2 = 5,
+ /* TCV0 - 2 FEMs 2 wires, Elastic - 4 FEMs 3 wires, TCV1 - 2 FEMs 3 wires */
+ FEM_WIRING_6_TCV0_2_ELASTIC_4_TCV1_2 = 6,
+ /* TCV0 - 4 FEMs 3 wires, TCV1 - 4 FEMs 2 wires */
+ FEM_WIRING_7_TCV0_4_TCV1_4 = 7,
+ /* TCV0 - 4 FEMs 3 wires, TCV1 - 4 FEMs 3 wires */
+ FEM_WIRING_8_TCV0_4_TCV1_4 = 8,
+ /* TCV0 - 4 FEMs 2 wires, TCV1 - 4 FEMs 2 wires */
+ FEM_WIRING_9_TCV0_4_TCV1_4 = 9,
+ /* TCV0 - 4 FEMs 3 wires, TCV1 - 4 FEMs 3 wires */
+ FEM_WIRING_10_TCV0_4_TCV1_4 = 10,
+ /* TCV0 - 4 FEMs 3 wires, TCV1 - 4 LNAs (RX only) */
+ FEM_WIRING_11_TCV0_4_TCV1_4_RX_ONLY = 11,
+ /* TCV0 - 4 FEMs 2 wires, TCV1 - 4 LNAs (RX only) */
+ FEM_WIRING_12_TCV0_4_TCV1_4_RX_ONLY = 12,
+ /* TCV0 - 6 FEMs 3 wires, TCV1 - 6 FEMs 2 wires (not active), 2 LNAs 1 wire (not active) */
+ FEM_WIRING_13_SENSING_4RX_2TX = 13,
+ /* TCV0 - 6 FEMs 3 wires (4 active), TCV1 - 6 FEMs 2 wires (not active), 2 LNAs 1 wire */
+ FEM_WIRING_14_SENSING_4TX_2RX = 14,
+ /* TCV0 - 4 FEMs 3 wires, TCV1 - 4 FEMs (RX only) */
+ FEM_WIRING_15_CHAMELEON_4TX_4RX = 15,
+ /* TCV0 - 2 FEMs 3 wires, TCV1 - 2 FEMs 2 wires (CL8040) */
+ FEM_WIRING_16_TCV0_2_TCV1_2 = 16,
+ /* TCV0 - 4 FEMs 2 wires, TCV1 - 0 FEMs (CL8046) */
+ FEM_WIRING_17_TCV0_4_TCV1_0 = 17,
+ /* TCV0 - 4 FEMs 3 wires, TCV1 - 4 FEMs 3 wires */
+ FEM_WIRING_18_TCV0_4_TCV1_4 = 18,
+ /* TCV0 - 2 FEMs 3 wires, TCV1 - 2 FEMs 3 wires (EVB swapped) */
+ FEM_WIRING_19_TCV0_2_TCV1_2_SWAPPED = 19,
+ /* TCV0 - 4 FEMs 3 wires, TCV1 - 2 FEMs 2 wires (CL8060 4+2) */
+ FEM_WIRING_20_TCV0_4_TCV1_2 = 20,
+ /* TCV0 - 4 FEMs 3 wires, TCV1 - 2 LNAs (RX only) (CL8066 4+2) */
+ FEM_WIRING_21_TCV0_4_TCV1_2 = 21,
+
+ FEM_WIRING_MAX,
+ FEM_WIRING_DEFAULT = 255
+};
+
+enum fem_type {
+ FEM_TYPE_TCV0 = 0,
+ FEM_TYPE_TCV1 = 1,
+ FEM_TYPE_ELASTIC = 2,
+ FEM_TYPE_SENSING = 3,
+
+ FEM_TYPE_MAX,
+};
+
+#define FEM_LUT_EMPTY 0x0
+
+#define FEM_TYPE_STR(type) \
+ ((type == FEM_TYPE_TCV0) ? "TCV0" : \
+ ((type == FEM_TYPE_TCV1) ? "TCV1" : \
+ ((type == FEM_TYPE_ELASTIC) ? "ELASTIC" : \
+ ((type == FEM_TYPE_SENSING) ? "SENSING" : "ERROR"))))
+
+#endif /* CL_FEM_COMMON_H */