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
6 Comment unused function since macronix_nand_block_protection_support
7 cause booting problems.
9 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
11 drivers/mtd/nand/raw/nand_macronix.c | 132 +++++++++++++--------------
12 1 file changed, 66 insertions(+), 66 deletions(-)
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);
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.
26 -static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len)
28 - u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
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,
35 - nand_deselect_target(chip);
37 - pr_err("%s all blocks failed\n", __func__);
42 -static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len)
44 - u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
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,
51 - nand_deselect_target(chip);
53 - pr_err("%s all blocks failed\n", __func__);
58 -static void macronix_nand_block_protection_support(struct nand_chip *chip)
60 - u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
63 - bitmap_set(chip->parameters.get_feature_list,
64 - ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
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,
70 - nand_deselect_target(chip);
71 - if (ret || feature[0] != MXIC_BLOCK_PROTECTION_ALL_LOCK) {
73 - pr_err("Block protection check failed\n");
75 - bitmap_clear(chip->parameters.get_feature_list,
76 - ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
80 - bitmap_set(chip->parameters.set_feature_list,
81 - ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
83 - chip->ops.lock_area = mxic_nand_lock;
84 - chip->ops.unlock_area = mxic_nand_unlock;
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.
92 +// static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len)
94 +// u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
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,
101 +// nand_deselect_target(chip);
103 +// pr_err("%s all blocks failed\n", __func__);
108 +// static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len)
110 +// u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
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,
117 +// nand_deselect_target(chip);
119 +// pr_err("%s all blocks failed\n", __func__);
124 +// static void macronix_nand_block_protection_support(struct nand_chip *chip)
126 +// u8 feature[ONFI_SUBFEATURE_PARAM_LEN];
129 +// bitmap_set(chip->parameters.get_feature_list,
130 +// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
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,
136 +// nand_deselect_target(chip);
137 +// if (ret || feature[0] != MXIC_BLOCK_PROTECTION_ALL_LOCK) {
139 +// pr_err("Block protection check failed\n");
141 +// bitmap_clear(chip->parameters.get_feature_list,
142 +// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
146 +// bitmap_set(chip->parameters.set_feature_list,
147 +// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1);
149 +// chip->ops.lock_area = mxic_nand_lock;
150 +// chip->ops.unlock_area = mxic_nand_unlock;
153 static int nand_power_down_op(struct nand_chip *chip)