base-files: sysupgrade: fix streaming backup archives to stdout
[openwrt/staging/mans0n.git] / target / linux / bcm63xx / patches-5.15 / 111-drivers-mtd-nand-macronix-comment-unused-function.patch
1 From 00cf359b486a3d14c29014e9d57d92ab81972866 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Tue, 9 May 2023 14:03:08 +0200
4 Subject: [PATCH] drivers: mtd: nand: macronix: comment unused function
5
6 Comment unused function since macronix_nand_block_protection_support
7 cause booting problems.
8
9 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
10 ---
11 drivers/mtd/nand/raw/nand_macronix.c | 132 +++++++++++++--------------
12 1 file changed, 66 insertions(+), 66 deletions(-)
13
14 --- a/drivers/mtd/nand/raw/nand_macronix.c
15 +++ b/drivers/mtd/nand/raw/nand_macronix.c
16 @@ -179,72 +179,72 @@ static void macronix_nand_fix_broken_get
17 ONFI_FEATURE_ADDR_TIMING_MODE, 1);
18 }
19
20 -/*
21 - * Macronix NAND supports Block Protection by Protectoin(PT) pin;
22 - * active high at power-on which protects the entire chip even the #WP is
23 - * disabled. Lock/unlock protection area can be partition according to
24 - * protection bits, i.e. upper 1/2 locked, upper 1/4 locked and so on.
25 - */
26 -static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len)
27 -{
28 - u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
29 - int ret;
30 -
31 - feature[0] = MXIC_BLOCK_PROTECTION_ALL_LOCK;
32 - nand_select_target(chip, 0);
33 - ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION,
34 - feature);
35 - nand_deselect_target(chip);
36 - if (ret)
37 - pr_err("%s all blocks failed\n", __func__);
38 -
39 - return ret;
40 -}
41 -
42 -static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len)
43 -{
44 - u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
45 - int ret;
46 -
47 - feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK;
48 - nand_select_target(chip, 0);
49 - ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION,
50 - feature);
51 - nand_deselect_target(chip);
52 - if (ret)
53 - pr_err("%s all blocks failed\n", __func__);
54 -
55 - return ret;
56 -}
57 -
58 -static void macronix_nand_block_protection_support(struct nand_chip *chip)
59 -{
60 - u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
61 - int ret;
62 -
63 - bitmap_set(chip->parameters.get_feature_list,
64 - ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
65 -
66 - feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK;
67 - nand_select_target(chip, 0);
68 - ret = nand_get_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION,
69 - feature);
70 - nand_deselect_target(chip);
71 - if (ret || feature[0] != MXIC_BLOCK_PROTECTION_ALL_LOCK) {
72 - if (ret)
73 - pr_err("Block protection check failed\n");
74 -
75 - bitmap_clear(chip->parameters.get_feature_list,
76 - ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
77 - return;
78 - }
79 -
80 - bitmap_set(chip->parameters.set_feature_list,
81 - ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
82 -
83 - chip->ops.lock_area = mxic_nand_lock;
84 - chip->ops.unlock_area = mxic_nand_unlock;
85 -}
86 +// /*
87 +// * Macronix NAND supports Block Protection by Protectoin(PT) pin;
88 +// * active high at power-on which protects the entire chip even the #WP is
89 +// * disabled. Lock/unlock protection area can be partition according to
90 +// * protection bits, i.e. upper 1/2 locked, upper 1/4 locked and so on.
91 +// */
92 +// static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len)
93 +// {
94 +// u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
95 +// int ret;
96 +
97 +// feature[0] = MXIC_BLOCK_PROTECTION_ALL_LOCK;
98 +// nand_select_target(chip, 0);
99 +// ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION,
100 +// feature);
101 +// nand_deselect_target(chip);
102 +// if (ret)
103 +// pr_err("%s all blocks failed\n", __func__);
104 +
105 +// return ret;
106 +// }
107 +
108 +// static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len)
109 +// {
110 +// u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
111 +// int ret;
112 +
113 +// feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK;
114 +// nand_select_target(chip, 0);
115 +// ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION,
116 +// feature);
117 +// nand_deselect_target(chip);
118 +// if (ret)
119 +// pr_err("%s all blocks failed\n", __func__);
120 +
121 +// return ret;
122 +// }
123 +
124 +// static void macronix_nand_block_protection_support(struct nand_chip *chip)
125 +// {
126 +// u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
127 +// int ret;
128 +
129 +// bitmap_set(chip->parameters.get_feature_list,
130 +// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
131 +
132 +// feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK;
133 +// nand_select_target(chip, 0);
134 +// ret = nand_get_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION,
135 +// feature);
136 +// nand_deselect_target(chip);
137 +// if (ret || feature[0] != MXIC_BLOCK_PROTECTION_ALL_LOCK) {
138 +// if (ret)
139 +// pr_err("Block protection check failed\n");
140 +
141 +// bitmap_clear(chip->parameters.get_feature_list,
142 +// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
143 +// return;
144 +// }
145 +
146 +// bitmap_set(chip->parameters.set_feature_list,
147 +// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
148 +
149 +// chip->ops.lock_area = mxic_nand_lock;
150 +// chip->ops.unlock_area = mxic_nand_unlock;
151 +// }
152
153 static int nand_power_down_op(struct nand_chip *chip)
154 {