Skip to content

Commit eaa4023

Browse files
westerigregkh
authored andcommitted
spi: intel: Use correct mask for flash and protected regions
commit 92a66cb upstream. The flash and protected region mask is actually 0x7fff (30:16 and 14:0) and not 0x3fff so fix this accordingly. While there use GENMASK() instead. Cc: [email protected] Signed-off-by: Mika Westerberg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ac79001 commit eaa4023

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/spi/spi-intel.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
#define FRACC 0x50
5353

5454
#define FREG(n) (0x54 + ((n) * 4))
55-
#define FREG_BASE_MASK 0x3fff
55+
#define FREG_BASE_MASK GENMASK(14, 0)
5656
#define FREG_LIMIT_SHIFT 16
57-
#define FREG_LIMIT_MASK (0x03fff << FREG_LIMIT_SHIFT)
57+
#define FREG_LIMIT_MASK GENMASK(30, 16)
5858

5959
/* Offset is from @ispi->pregs */
6060
#define PR(n) ((n) * 4)
6161
#define PR_WPE BIT(31)
6262
#define PR_LIMIT_SHIFT 16
63-
#define PR_LIMIT_MASK (0x3fff << PR_LIMIT_SHIFT)
63+
#define PR_LIMIT_MASK GENMASK(30, 16)
6464
#define PR_RPE BIT(15)
65-
#define PR_BASE_MASK 0x3fff
65+
#define PR_BASE_MASK GENMASK(14, 0)
6666

6767
/* Offsets are from @ispi->sregs */
6868
#define SSFSTS_CTL 0x00

0 commit comments

Comments
 (0)