6afc1c07f7da700eee338c800f5a21e4d2038a6b
[openwrt/openwrt.git] /
1 From 7eb5f0a192efbe1fa94490881858ed45c5373233 Mon Sep 17 00:00:00 2001
2 From: Camelia Groza <camelia.groza@nxp.com>
3 Date: Mon, 2 Apr 2018 18:19:27 +0300
4 Subject: [PATCH] sdk_fman: on P-series platforms, the OH ports start at offset
5 1
6
7 Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
8 ---
9 .../ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c | 12 ++++++++++--
10 1 file changed, 10 insertions(+), 2 deletions(-)
11
12 --- a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c
13 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c
14 @@ -307,9 +307,17 @@ static t_LnxWrpFmPortDev *ReadFmPortDevT
15 of_device_is_compatible(port_node, "fsl,fman-v2-port-oh") ||
16 of_device_is_compatible(port_node, "fsl,fman-v3-port-oh")) {
17 #ifndef CONFIG_FMAN_ARM
18 - /* On PPC, OH ports start from cell-index 0x2 */
19 +#ifdef CONFIG_FMAN_P3040_P4080_P5020
20 + /* On PPC FMan v2, OH ports start from cell-index 0x1 */
21 + tmp_prop -= 0x1;
22 +#else
23 + /* On PPC FMan v3 (Low and High), OH ports start from
24 + * cell-index 0x2
25 + */
26 tmp_prop -= 0x2;
27 -#endif
28 +#endif // CONFIG_FMAN_P3040_P4080_P5020
29 +#endif // CONFIG_FMAN_ARM
30 +
31 if (unlikely(tmp_prop >= FM_MAX_NUM_OF_OH_PORTS)) {
32 REPORT_ERROR(MAJOR, E_INVALID_VALUE,
33 ("of_get_property(%s, cell-index) failed",