mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] net/e1000: indicate at boot time if flash is in secure mode
Date: Wed, 6 Dec 2017 15:56:22 +0100	[thread overview]
Message-ID: <20171206145622.2ntqo6kjsbgavlwv@pengutronix.de> (raw)
In-Reply-To: <20171201111017.29098-1-u.kleine-koenig@pengutronix.de>

On Fri, Dec 01, 2017 at 12:10:17PM +0100, Uwe Kleine-König wrote:
> If the flash is in secure mode it is not possible to modify its
> contents. So log that useful information at probe time.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/net/e1000/e1000.h  |  1 +
>  drivers/net/e1000/eeprom.c | 10 +++++++---
>  2 files changed, 8 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
> index 50d49118f5e4..1558b3c7f5c7 100644
> --- a/drivers/net/e1000/e1000.h
> +++ b/drivers/net/e1000/e1000.h
> @@ -2101,6 +2101,7 @@ struct e1000_eeprom_info {
>  							after IMS clear */
>  
>  #define E1000_FLA			0x1201C
> +#define E1000_FLA_LOCKED		(1 << 6)
>  #define E1000_FLA_FL_SIZE_SHIFT		17
>  #define E1000_FLA_FL_SIZE_MASK		(0b111 << E1000_FLA_FL_SIZE_SHIFT) /* EEprom Size */
>  
> diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
> index 6251c6cecc94..51e0f28c7d44 100644
> --- a/drivers/net/e1000/eeprom.c
> +++ b/drivers/net/e1000/eeprom.c
> @@ -1584,10 +1584,14 @@ int e1000_register_eeprom(struct e1000_hw *hw)
>  
>  		if (eecd & E1000_EECD_AUTO_RD) {
>  			if (eecd & E1000_EECD_EE_PRES) {
> -				if (eecd & E1000_EECD_FLASH_IN_USE)
> -					dev_info(hw->dev, "Hardware programmed from flash\n");
> -				else
> +				if (eecd & E1000_EECD_FLASH_IN_USE) {
> +					uint32_t fla = e1000_read_reg(hw, E1000_FLA);
> +					dev_info(hw->dev,
> +						 "Hardware programmed from flash (%ssecure)\n",
> +						 fla & E1000_FLA_LOCKED ? "" : "un");
> +				} else {
>  					dev_info(hw->dev, "Hardware programmed from iNVM\n");
> +				}
>  			} else {
>  				dev_warn(hw->dev, "Shadow RAM invalid\n");
>  			}
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2017-12-06 14:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 11:10 Uwe Kleine-König
2017-12-06 14:56 ` Sascha Hauer [this message]

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=20171206145622.2ntqo6kjsbgavlwv@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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