diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2022-10-25 08:28:00 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-11-01 19:28:11 +0100 |
commit | 92a66cbf6b30eda5719fbdfb24cd15fb341bba32 (patch) | |
tree | ff36e55eb5c2c86ea4eccffe3f376958d61aa5c5 /drivers/spi | |
parent | spi: mediatek: Fix package division error (diff) | |
download | linux-92a66cbf6b30eda5719fbdfb24cd15fb341bba32.tar.xz linux-92a66cbf6b30eda5719fbdfb24cd15fb341bba32.zip |
spi: intel: Use correct mask for flash and protected regions
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: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20221025062800.22357-1-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-intel.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-intel.c b/drivers/spi/spi-intel.c index 605acb1bf4b0..3ac73691fbb5 100644 --- a/drivers/spi/spi-intel.c +++ b/drivers/spi/spi-intel.c @@ -52,17 +52,17 @@ #define FRACC 0x50 #define FREG(n) (0x54 + ((n) * 4)) -#define FREG_BASE_MASK 0x3fff +#define FREG_BASE_MASK GENMASK(14, 0) #define FREG_LIMIT_SHIFT 16 -#define FREG_LIMIT_MASK (0x03fff << FREG_LIMIT_SHIFT) +#define FREG_LIMIT_MASK GENMASK(30, 16) /* Offset is from @ispi->pregs */ #define PR(n) ((n) * 4) #define PR_WPE BIT(31) #define PR_LIMIT_SHIFT 16 -#define PR_LIMIT_MASK (0x3fff << PR_LIMIT_SHIFT) +#define PR_LIMIT_MASK GENMASK(30, 16) #define PR_RPE BIT(15) -#define PR_BASE_MASK 0x3fff +#define PR_BASE_MASK GENMASK(14, 0) /* Offsets are from @ispi->sregs */ #define SSFSTS_CTL 0x00 |