layerscape: add ls1088ardb device support
[openwrt/staging/lynxis/omap.git] / target / linux / layerscape / patches-4.4 / 7170-staging-fsl-mc-don-t-use-object-versions-to-make-bin.patch
1 From 9382e1723e4de9832407f7e65bd4812b31e5a51d Mon Sep 17 00:00:00 2001
2 From: Itai Katz <itai.katz@nxp.com>
3 Date: Mon, 11 Apr 2016 11:55:40 -0500
4 Subject: [PATCH 170/226] staging: fsl-mc: don't use object versions to make
5 binding decisions
6
7 Up until now if the object version expected by a driver (in the API header
8 file) did not match the actual object version in the MC hardware the bus
9 driver refused to bind the object to the driver or printed out WARN_ON
10 dumps.
11
12 This patch removes those checks, and the responsibility of object version
13 checking should now be done in the object drivers themselves. If the actual
14 version discovered is not supported, the driver's probe function should fail.
15 Drivers should use version checks to support new features and provide
16 backwards compatibility if at all possible.
17
18 This patch also removes the checks that caused bus driver probing to fail
19 if the overall MC version discovered did not match the firmware version
20 from the API header...this was too strict. The overall MC version is
21 informational like a release number, and continues to be printed in the
22 boot log.
23
24 Signed-off-by: Itai Katz <itai.katz@nxp.com>
25 (Stuart: reworded commit log)
26 Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
27 Acked-by: German Rivera <german.rivera@nxp.com>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 ---
30 drivers/staging/fsl-mc/bus/dprc-driver.c | 4 +--
31 drivers/staging/fsl-mc/bus/mc-allocator.c | 6 -----
32 drivers/staging/fsl-mc/bus/mc-bus.c | 38 +----------------------------
33 3 files changed, 2 insertions(+), 46 deletions(-)
34
35 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c
36 +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
37 @@ -780,9 +780,7 @@ static int dprc_remove(struct fsl_mc_dev
38 static const struct fsl_mc_device_match_id match_id_table[] = {
39 {
40 .vendor = FSL_MC_VENDOR_FREESCALE,
41 - .obj_type = "dprc",
42 - .ver_major = DPRC_VER_MAJOR,
43 - .ver_minor = DPRC_VER_MINOR},
44 + .obj_type = "dprc"},
45 {.vendor = 0x0},
46 };
47
48 --- a/drivers/staging/fsl-mc/bus/mc-allocator.c
49 +++ b/drivers/staging/fsl-mc/bus/mc-allocator.c
50 @@ -709,20 +709,14 @@ static const struct fsl_mc_device_match_
51 {
52 .vendor = FSL_MC_VENDOR_FREESCALE,
53 .obj_type = "dpbp",
54 - .ver_major = DPBP_VER_MAJOR,
55 - .ver_minor = DPBP_VER_MINOR
56 },
57 {
58 .vendor = FSL_MC_VENDOR_FREESCALE,
59 .obj_type = "dpmcp",
60 - .ver_major = DPMCP_VER_MAJOR,
61 - .ver_minor = DPMCP_VER_MINOR
62 },
63 {
64 .vendor = FSL_MC_VENDOR_FREESCALE,
65 .obj_type = "dpcon",
66 - .ver_major = DPCON_VER_MAJOR,
67 - .ver_minor = DPCON_VER_MINOR
68 },
69 {.vendor = 0x0},
70 };
71 --- a/drivers/staging/fsl-mc/bus/mc-bus.c
72 +++ b/drivers/staging/fsl-mc/bus/mc-bus.c
73 @@ -40,8 +40,6 @@ static int fsl_mc_bus_match(struct devic
74 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
75 struct fsl_mc_driver *mc_drv = to_fsl_mc_driver(drv);
76 bool found = false;
77 - bool major_version_mismatch = false;
78 - bool minor_version_mismatch = false;
79
80 if (WARN_ON(!fsl_mc_bus_exists()))
81 goto out;
82 @@ -64,32 +62,12 @@ static int fsl_mc_bus_match(struct devic
83 for (id = mc_drv->match_id_table; id->vendor != 0x0; id++) {
84 if (id->vendor == mc_dev->obj_desc.vendor &&
85 strcmp(id->obj_type, mc_dev->obj_desc.type) == 0) {
86 - if (id->ver_major == mc_dev->obj_desc.ver_major) {
87 - found = true;
88 - if (id->ver_minor != mc_dev->obj_desc.ver_minor)
89 - minor_version_mismatch = true;
90 - } else {
91 - major_version_mismatch = true;
92 - }
93 + found = true;
94
95 break;
96 }
97 }
98
99 - if (major_version_mismatch) {
100 - dev_warn(dev,
101 - "Major version mismatch: driver version %u.%u, MC object version %u.%u\n",
102 - id->ver_major, id->ver_minor,
103 - mc_dev->obj_desc.ver_major,
104 - mc_dev->obj_desc.ver_minor);
105 - } else if (minor_version_mismatch) {
106 - dev_warn(dev,
107 - "Minor version mismatch: driver version %u.%u, MC object version %u.%u\n",
108 - id->ver_major, id->ver_minor,
109 - mc_dev->obj_desc.ver_major,
110 - mc_dev->obj_desc.ver_minor);
111 - }
112 -
113 out:
114 dev_dbg(dev, "%smatched\n", found ? "" : "not ");
115 return found;
116 @@ -722,20 +700,6 @@ static int fsl_mc_bus_probe(struct platf
117 "Freescale Management Complex Firmware version: %u.%u.%u\n",
118 mc_version.major, mc_version.minor, mc_version.revision);
119
120 - if (mc_version.major < MC_VER_MAJOR) {
121 - dev_err(&pdev->dev,
122 - "ERROR: MC firmware version not supported by driver (driver version: %u.%u)\n",
123 - MC_VER_MAJOR, MC_VER_MINOR);
124 - error = -ENOTSUPP;
125 - goto error_cleanup_mc_io;
126 - }
127 -
128 - if (mc_version.major > MC_VER_MAJOR) {
129 - dev_warn(&pdev->dev,
130 - "WARNING: driver may not support newer MC firmware features (driver version: %u.%u)\n",
131 - MC_VER_MAJOR, MC_VER_MINOR);
132 - }
133 -
134 error = get_mc_addr_translation_ranges(&pdev->dev,
135 &mc->translation_ranges,
136 &mc->num_translation_ranges);