mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
mtd: spinand: Enable HWP_EN for skyhigh devices
HWP_EN must be enabled first before block unlock region is set. Change-Id: I6b107d97de48bb2644da865f353d2adace95224e Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
@@ -1118,6 +1118,13 @@ static int spinand_reinit(struct mtd_info *mtd)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* HWP_EN must be enabled first before block unlock region is set */
|
||||
if (spinand->id.data[0] == 0x01) {
|
||||
ret = spinand_lock_block(spinand, HWP_EN);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
/* feature register */
|
||||
#define REG_BLOCK_LOCK 0xa0
|
||||
#define BL_ALL_UNLOCKED 0x00
|
||||
#define HWP_EN 0x02 /* Skyhigh feature, Hardware write protection */
|
||||
|
||||
/* configuration register */
|
||||
#define REG_CFG 0xb0
|
||||
|
||||
Reference in New Issue
Block a user