[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1395851969-13520-15-git-send-email-lee.jones@linaro.org>
Date: Wed, 26 Mar 2014 16:39:28 +0000
From: Lee Jones <lee.jones@...aro.org>
To: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: lee.jones@...aro.org, kernel@...inux.com,
computersforpeace@...il.com, linux-mtd@...ts.infradead.org,
angus.clark@...com, Christophe Kerello <christophe.kerello@...com>
Subject: [PATCH 14/15] mtd: st_spi_fsm: Provide mask to obtain correct boot device pins
From: Christophe Kerello <christophe.kerello@...com>
This patch adds a mask to be able to get the right boot device selection.
For example:
for STiH415, value = SYSTEM_STATUS398[4:0]
for STiH416, value = SYSTEM_STATUS2598[4:0]
for STiH407, value = SYSTEM_STATUS5561[6:2]
Signed-off-by: Christophe Kerello <christophe.kerello@...com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
drivers/mtd/devices/st_spi_fsm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index 9e00173..3ab27c8 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -2159,6 +2159,7 @@ static void stfsm_fetch_platform_configs(struct platform_device *pdev)
struct regmap *regmap;
uint32_t boot_device_reg;
uint32_t boot_device_spi;
+ uint32_t boot_device_msk;
uint32_t boot_device; /* Value we read from *boot_device_reg */
int ret;
@@ -2183,10 +2184,17 @@ static void stfsm_fetch_platform_configs(struct platform_device *pdev)
if (ret)
goto boot_device_fail;
+ /* Mask to apply on boot_device_reg */
+ ret = of_property_read_u32(np, "st,boot-device-msk", &boot_device_msk);
+ if (ret)
+ goto boot_device_fail;
+
ret = regmap_read(regmap, boot_device_reg, &boot_device);
if (ret)
goto boot_device_fail;
+ boot_device &= boot_device_msk;
+
if (boot_device != boot_device_spi)
fsm->booted_from_spi = false;
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists