mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/chunkeey.git] / target / linux / layerscape / patches-5.4 / 701-net-0319-staging-fsl_ppfe-eth-use-generic-soc_device-infra-in.patch
1 From 3f64975a822c9144c7134d3cebadd4d8b88fead5 Mon Sep 17 00:00:00 2001
2 From: Calvin Johnson <calvin.johnson@nxp.com>
3 Date: Wed, 27 Mar 2019 19:31:35 +0530
4 Subject: [PATCH] staging: fsl_ppfe/eth: use generic soc_device infra instead
5 of fsl_guts_get_svr()
6
7 Commit ("soc: fsl: guts: make fsl_guts_get_svr() static") has
8 made fsl_guts_get_svr() static and hence use generic soc_device
9 infrastructure to check SoC revision.
10
11 Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
12 ---
13 drivers/staging/fsl_ppfe/pfe_eth.c | 12 ++++++++++--
14 1 file changed, 10 insertions(+), 2 deletions(-)
15
16 --- a/drivers/staging/fsl_ppfe/pfe_eth.c
17 +++ b/drivers/staging/fsl_ppfe/pfe_eth.c
18 @@ -35,7 +35,7 @@
19 #include <linux/delay.h>
20 #include <linux/regmap.h>
21 #include <linux/i2c.h>
22 -#include <linux/fsl/guts.h>
23 +#include <linux/sys_soc.h>
24
25 #if defined(CONFIG_NF_CONNTRACK_MARK)
26 #include <net/netfilter/nf_conntrack.h>
27 @@ -104,6 +104,14 @@ unsigned int gemac_regs[] = {
28 0x01B0, /* Frame Truncation Length */
29 };
30
31 +const struct soc_device_attribute ls1012a_rev1_soc_attr[] = {
32 + { .family = "QorIQ LS1012A",
33 + .soc_id = "svr:0x87040010",
34 + .revision = "1.0",
35 + .data = NULL },
36 + { },
37 +};
38 +
39 /********************************************************************/
40 /* SYSFS INTERFACE */
41 /********************************************************************/
42 @@ -2497,7 +2505,7 @@ int pfe_eth_init(struct pfe *pfe)
43 }
44 }
45
46 - if (fsl_guts_get_svr() == LS1012A_REV_1_0)
47 + if (soc_device_match(ls1012a_rev1_soc_attr))
48 pfe_errata_a010897 = true;
49 else
50 pfe_errata_a010897 = false;