public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Shawn Guo <shawn.guo@linaro.org>,
	Dong Aisheng <b29396@freescale.com>,
	Peter Griffin <peter.griffin@linaro.org>,
	"tgih.jun@samsung.com" <tgih.jun@samsung.com>,
	h80.chung@samsung.com, Chris Ball <chris@printf.net>,
	Kumar Gala <galak@codeaurora.org>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Mark Rutland <mark.rutland@arm.com>,
	Pawel Moll <pawel.moll@arm.com>, Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: Enable boot partition access from DT
Date: Wed, 03 Sep 2014 12:02:58 +0300	[thread overview]
Message-ID: <5406D942.4080405@intel.com> (raw)
In-Reply-To: <CAPDyKFrwCzQJvbpbue4T=HWLmbq5sZOP3RXwiupKvXe71uboUw@mail.gmail.com>

On 09/03/2014 11:30 AM, Ulf Hansson wrote:
> On 2 September 2014 17:49, Jean-Michel Hautbois
> <jean-michel.hautbois@vodalys.com> wrote:
>> This property is useful when we don't want to access boot partitions on eMMC
>>
>> Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
>> ---
>>  Documentation/devicetree/bindings/mmc/mmc.txt | 1 +
>>  drivers/mmc/host/sdhci-esdhc-imx.c            | 8 ++++++++
>>  include/linux/platform_data/mmc-esdhc-imx.h   | 1 +
>>  3 files changed, 10 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
>> index 431716e..59cc854 100644
>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
>> @@ -40,6 +40,7 @@ Optional properties:
>>  - mmc-hs200-1_2v: eMMC HS200 mode(1.2V I/O) is supported
>>  - mmc-hs400-1_8v: eMMC HS400 mode(1.8V I/O) is supported
>>  - mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
>> +- no-boot-part : when preset, tells to access boot partitions
>>
>>  *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
>>  polarity properties, we have to fix the meaning of the "normal" and "inverted"
>> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
>> index ccec0e3..439e663 100644
>> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
>> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
>> @@ -942,6 +942,11 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
>>         if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
>>                 boarddata->delay_line = 0;
>>
>> +       if (of_find_property(np, "no-boot-part", NULL))
>> +               boarddata->access_boot_part = false;
>> +       else
>> +               boarddata->access_boot_part = true;
>> +
>>         return 0;
>>  }
>>  #else
>> @@ -1119,6 +1124,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>>                 host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
>>         }
>>
>> +       if (!boarddata->access_boot_part)
>> +               host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC;
>> +
> 
> Hmm, I don't think MMC_CAP2_BOOTPART_NOACC should have a DT binding.
> Does it describe the hardware in some form?
> 
> Actually I would like to question why MMC_CAP2_BOOTPART_NOACC exists
> at all. If there are cards that don't supports the BOOT area,
> shouldn't we have a card quirk for it instead of a host cap? Maybe
> Adrian Hunter, how originally wrote the patch for adding
> MMC_CAP2_BOOTPART_NOACC, could help me understand the reasons behind
> it!?

It was added because platform firmware was able to prevent access to the
boot partitions (for security I think), so attempts to access them would
fail messily.  It was not related to any specific card.

  reply	other threads:[~2014-09-03  9:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 15:49 [PATCH] mmc: sdhci-esdhc-imx: Enable boot partition access from DT Jean-Michel Hautbois
2014-09-03  2:59 ` Dong Aisheng
2014-09-03  8:30 ` Ulf Hansson
2014-09-03  9:02   ` Adrian Hunter [this message]
2014-09-03  9:09     ` Ulf Hansson
2014-09-03 13:08       ` Jean-Michel Hautbois
2014-09-04  0:59         ` Hsin-Hsiang Tseng

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=5406D942.4080405@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=b29396@freescale.com \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=h80.chung@samsung.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jean-michel.hautbois@vodalys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=peter.griffin@linaro.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=tgih.jun@samsung.com \
    --cc=ulf.hansson@linaro.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox