LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: lee.jones@linaro.org, kernel@stlinux.com,
computersforpeace@gmail.com, linux-mtd@lists.infradead.org,
Christophe Kerello <christophe.kerello@st.com>
Subject: [PATCH v2 RESEND 10/11] mtd: st_spi_fsm: Provide mask to obtain correct boot device pins
Date: Thu, 4 Dec 2014 10:21:51 +0000 [thread overview]
Message-ID: <1417688512-7644-11-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1417688512-7644-1-git-send-email-lee.jones@linaro.org>
From: Christophe Kerello <christophe.kerello@st.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@st.com>
Signed-off-by: Lee Jones <lee.jones@linaro.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 18f6f0b..f992f00 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -2123,6 +2123,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;
@@ -2147,10 +2148,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.9.1
next prev parent reply other threads:[~2014-12-04 10:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-04 10:21 [PATCH v2 RESEND 00/11] mtd: st_spi_fsm: Align with ST's internal development Lee Jones
2014-12-04 10:21 ` [PATCH v2 RESEND 01/11] mtd: st_spi_fsm: Extend fsm_clear_fifo to handle unwanted bytes Lee Jones
2014-12-04 10:21 ` [PATCH v2 RESEND 02/11] mtd: st_spi_fsm: Obtain and use EMI clock if provided Lee Jones
2014-12-08 13:52 ` [STLinux Kernel] " Peter Griffin
2014-12-08 13:57 ` Peter Griffin
2014-12-04 10:21 ` [PATCH v2 RESEND 03/11] mtd: st_spi_fsm: Fix [-Wsign-compare] build warning Lee Jones
2014-12-04 10:21 ` [PATCH v2 RESEND 04/11] mtd: st_spi_fsm: Add support for Micron N25Q512A Lee Jones
2014-12-04 10:21 ` [PATCH v2 RESEND 05/11] mtd: st_spi_fsm: Add support for N25Q512 and N25Q00A devices Lee Jones
2014-12-04 10:21 ` [PATCH v2 RESEND 06/11] mtd: st_spi_fsm: Update the JEDEC probe to handle extended READIDs Lee Jones
2014-12-04 10:21 ` [PATCH v2 RESEND 07/11] mtd: st_spi_fsm: Update Spansion device entries Lee Jones
2014-12-04 10:21 ` [PATCH v2 RESEND 08/11] mtd: st_spi_fsm: Improve busy wait handling Lee Jones
2014-12-04 10:21 ` [PATCH v2 RESEND 09/11] mtd: st_spi_fsm: Provide documentation for boot device mask property Lee Jones
2014-12-04 10:21 ` Lee Jones [this message]
2014-12-08 14:43 ` [STLinux Kernel] [PATCH v2 RESEND 10/11] mtd: st_spi_fsm: Provide mask to obtain correct boot device pins Peter Griffin
2014-12-04 10:21 ` [PATCH v2 RESEND 11/11] mtd: st_spi_fsm: General tidy-up Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1417688512-7644-11-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=christophe.kerello@st.com \
--cc=computersforpeace@gmail.com \
--cc=kernel@stlinux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--subject='Re: [PATCH v2 RESEND 10/11] mtd: st_spi_fsm: Provide mask to obtain correct boot device pins' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).