mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/chunkeey.git] / target / linux / layerscape / patches-5.4 / 701-net-0058-sdk_fman-probe-OH-ports-on-PPC.patch
1 From 11a68a2d48fee4524163c5ce36477bafb6515a98 Mon Sep 17 00:00:00 2001
2 From: Camelia Groza <camelia.groza@nxp.com>
3 Date: Mon, 26 Mar 2018 10:48:19 +0300
4 Subject: [PATCH] sdk_fman: probe OH ports on PPC
5
6 Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
7 ---
8 .../ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c | 12 +++++++++++-
9 1 file changed, 11 insertions(+), 1 deletion(-)
10
11 --- a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c
12 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c
13 @@ -303,7 +303,13 @@ static t_LnxWrpFmPortDev *ReadFmPortDevT
14 tmp_prop = be32_to_cpu(*uint32_prop);
15 if (WARN_ON(lenp != sizeof(uint32_t)))
16 return NULL;
17 - if (of_device_is_compatible(port_node, "fsl,fman-port-oh")) {
18 + if (of_device_is_compatible(port_node, "fsl,fman-port-oh") ||
19 + of_device_is_compatible(port_node, "fsl,fman-v2-port-oh") ||
20 + of_device_is_compatible(port_node, "fsl,fman-v3-port-oh")) {
21 +#ifndef CONFIG_FMAN_ARM
22 + /* On PPC, OH ports start from cell-index 0x2 */
23 + tmp_prop -= 0x2;
24 +#endif
25 if (unlikely(tmp_prop >= FM_MAX_NUM_OF_OH_PORTS)) {
26 REPORT_ERROR(MAJOR, E_INVALID_VALUE,
27 ("of_get_property(%s, cell-index) failed",
28 @@ -1433,6 +1439,10 @@ static const struct of_device_id fm_port
29 {
30 .compatible = "fsl,fman-port-oh"},
31 {
32 + .compatible = "fsl,fman-v2-port-oh"},
33 + {
34 + .compatible = "fsl,fman-v3-port-oh"},
35 + {
36 .compatible = "fsl,fman-port-1g-rx"},
37 {
38 .compatible = "fsl,fman-port-10g-rx"},