Skip to contentSkip to conversation

Production State Awareness support in host side

PATCH In review Avi Shchislowski 3 participants 15 messages Nov 17, 2014 – Dec 3, 2014 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Production State Awareness support in host side

Adding support for PSA (Production State Awareness)
feature for all eMMC devices with revision >=5.0
In this patch the eMMC driver will check if device was completed
its Production State mode, and will switch it to Normal (field) mode. Switching to normal mode signal the device to complete its work in production mode and start working in regular performance mode.

drivers/mmc/core/mmc.c +33 -0
index 02ad792..2d59722 100644
@@ -605,6 +605,20 @@ static int mmc_read_ext_csd(struct mmc_card *card)
 				mmc_hostname(card->host));
 			err = 0;
 		}
+	/* eMMC v5.0 or later */
+	if (card->ext_csd.rev > 6) {
+		card->ext_csd.psa =
+			ext_csd[EXT_CSD_PSA];
+		if (ext_csd[EXT_CSD_PSA_TIMEOUT] > 0) {
+			card->ext_csd.psa_timeout =
+				100 *
+				(1 << ext_csd[EXT_CSD_PSA_TIMEOUT]);
+		} else {
+			card->ext_csd.psa_timeout = 0;
+			pr_warn("%s: EXT_CSD PSA Timeout is zero\n",
+					mmc_hostname(card->host));
+		}
+	}
 
 		return err;
 	}
@@ -1330,6 +1344,25 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	if (card->csd.dsr_imp && host->dsr_req)
 		mmc_set_dsr(host);
 
+    /*
+     * eMMC v5.0 or later
+     * and Production State Awareness state is EXT_CSD_PSA_POST_SOLDERING_WRITES
+     * The host should set the device to NORMAL mode
+     */
+	if ((card->ext_csd.rev > 6)
+		&& (card->ext_csd.psa == EXT_CSD_PSA_POST_SOLDERING_WRITES)) {
+		unsigned int timeout;
+		/*Zero value in PSA Timeout – PSA is not defined*/
+		if (card->ext_csd.psa_timeout != 0) {
+			timeout = DIV_ROUND_UP(card->ext_csd.psa_timeout, 1000);
+			card->ext_csd.psa = EXT_CSD_PSA_NORMAL;
+			err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+				EXT_CSD_PSA, card->ext_csd.psa, timeout);
+			if (err && err != -EBADMSG)
+				goto free_card;
+		}
+	}
+
 	/*
 	 * Select card, as all following commands rely on that.
 	 */
include/linux/mmc/card.h +2 -0
index 4d69c00..09ac3b0 100644
@@ -60,9 +60,11 @@ struct mmc_ext_csd {
 	u8			packed_event_en;
 	unsigned int		part_time;		/* Units: ms */
 	unsigned int		sa_timeout;		/* Units: 100ns */
+	unsigned int		psa_timeout;		/* Units: 100us */
 	unsigned int		generic_cmd6_time;	/* Units: 10ms */
 	unsigned int            power_off_longtime;     /* Units: ms */
 	u8			power_off_notification;	/* state */
+	u8			psa; /* production state awareness */
 	unsigned int		hs_max_dtr;
 	unsigned int		hs200_max_dtr;
 #define MMC_HIGH_26_MAX_DTR	26000000
include/linux/mmc/mmc.h +11 -0
index 49ad7a9..eb170ff 100644
@@ -285,6 +285,9 @@ struct _mmc_csd {
 #define EXT_CSD_EXP_EVENTS_STATUS	54	/* RO, 2 bytes */
 #define EXT_CSD_EXP_EVENTS_CTRL		56	/* R/W, 2 bytes */
 #define EXT_CSD_DATA_SECTOR_SIZE	61	/* R */
+#define EXT_CSD_QRDY_SUPPORT		96	/* RO */
+#define EXT_CSD_CMDQ_QRDY_FUNCTION	97	/* R/W */
+#define EXT_CSD_PSA			133	/* R/W/E */
 #define EXT_CSD_GP_SIZE_MULT		143	/* R/W */
 #define EXT_CSD_PARTITION_SETTING_COMPLETED 155	/* R/W */
 #define EXT_CSD_PARTITION_ATTRIBUTE	156	/* R/W */
@@ -315,6 +318,7 @@ struct _mmc_csd {
 #define EXT_CSD_PWR_CL_26_360		203	/* RO */
 #define EXT_CSD_SEC_CNT			212	/* RO, 4 bytes */
 #define EXT_CSD_S_A_TIMEOUT		217	/* RO */
+#define EXT_CSD_PSA_TIMEOUT		218	/* RO */
 #define EXT_CSD_REL_WR_SEC_C		222	/* RO */
 #define EXT_CSD_HC_WP_GRP_SIZE		221	/* RO */
 #define EXT_CSD_ERASE_TIMEOUT_MULT	223	/* RO */
@@ -433,6 +437,13 @@ struct _mmc_csd {
 #define EXT_CSD_BKOPS_LEVEL_2		0x2
 
 /*
+ * PRODUCTION STATE AWARENESS fields
+ */
+
+#define EXT_CSD_PSA_NORMAL				0x00
+#define EXT_CSD_PSA_POST_SOLDERING_WRITES	0x02
+
+/*
  * MMC_SWITCH access modes
  */
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 6 lines · Avi Shchislowski

Adding support for PSA (Production State Awareness)
feature for all eMMC devices with revision >=5.0
In this patch the eMMC driver will check if device was completed
its Production State mode, and will switch it to Normal (field) mode. Switching to normal mode signal the device to complete its work in production mode and start working in regular performance mode.

Please add some detail to what this patch does. Additionally why it's needed.

Also, make sure to use proper prefix in the commit header.

Quoted 11 lines
drivers/mmc/core/mmc.c +0 -0
index 02ad792..2d59722 100644
@@ -605,6 +605,20 @@ static int mmc_read_ext_csd(struct mmc_card *card)
                                mmc_hostname(card->host));
                        err = 0;
                }

drivers/mmc/core/mmc.c static int mmc_read_ext_csd(struct mmc_card *card) · line 617

Quoted 10 lines
drivers/mmc/core/mmc.c +10 -0
+       /* eMMC v5.0 or later */
+       if (card->ext_csd.rev > 6) {
+               card->ext_csd.psa =
+                       ext_csd[EXT_CSD_PSA];
+               if (ext_csd[EXT_CSD_PSA_TIMEOUT] > 0) {
+                       card->ext_csd.psa_timeout =
+                               100 *
+                               (1 << ext_csd[EXT_CSD_PSA_TIMEOUT]);
+               } else {
+                       card->ext_csd.psa_timeout = 0;

This assignment isn't needed. It's 0 as default.

drivers/mmc/core/mmc.c static int mmc_read_ext_csd(struct mmc_card *card) · line 619

Quoted 2 lines
drivers/mmc/core/mmc.c +2 -0
+                       pr_warn("%s: EXT_CSD PSA Timeout is zero\n",
+                                       mmc_hostname(card->host));

Shouldn't we treat this as an error?

Quoted 10 lines
drivers/mmc/core/mmc.c +3 -0
+               }
+       }
 
                return err;
        }
@@ -1330,6 +1344,25 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
        if (card->csd.dsr_imp && host->dsr_req)
                mmc_set_dsr(host);
 
+    /*

drivers/mmc/core/mmc.c static int mmc_init_card(struct mmc_host *host, u32 ocr, · line 1357

Quoted 10 lines
drivers/mmc/core/mmc.c +10 -0
+     * eMMC v5.0 or later
+     * and Production State Awareness state is EXT_CSD_PSA_POST_SOLDERING_WRITES
+     * The host should set the device to NORMAL mode
+     */
+       if ((card->ext_csd.rev > 6)
+               && (card->ext_csd.psa == EXT_CSD_PSA_POST_SOLDERING_WRITES)) {
+               unsigned int timeout;
+               /*Zero value in PSA Timeout – PSA is not defined*/
+               if (card->ext_csd.psa_timeout != 0) {
+                       timeout = DIV_ROUND_UP(card->ext_csd.psa_timeout, 1000);

Can you give an example of a typical value for the timeout?

drivers/mmc/core/mmc.c static int mmc_init_card(struct mmc_host *host, u32 ocr, · line 1363

Quoted 6 lines
drivers/mmc/core/mmc.c +6 -0
+                       card->ext_csd.psa = EXT_CSD_PSA_NORMAL;
+                       err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+                               EXT_CSD_PSA, card->ext_csd.psa, timeout);
+                       if (err && err != -EBADMSG)
+                               goto free_card;
+               }

So if there is no timeout specified what happens then?

Quoted 26 lines
drivers/mmc/core/mmc.c +2 -0
+       }
+
        /*
         * Select card, as all following commands rely on that.
         */
include/linux/mmc/card.h +2 -0
index 4d69c00..09ac3b0 100644
@@ -60,9 +60,11 @@ struct mmc_ext_csd {
        u8                      packed_event_en;
        unsigned int            part_time;              /* Units: ms */
        unsigned int            sa_timeout;             /* Units: 100ns */
+       unsigned int            psa_timeout;            /* Units: 100us */
        unsigned int            generic_cmd6_time;      /* Units: 10ms */
        unsigned int            power_off_longtime;     /* Units: ms */
        u8                      power_off_notification; /* state */
+       u8                      psa; /* production state awareness */
        unsigned int            hs_max_dtr;
        unsigned int            hs200_max_dtr;
 #define MMC_HIGH_26_MAX_DTR    26000000
include/linux/mmc/mmc.h +0 -0
index 49ad7a9..eb170ff 100644

include/linux/mmc/mmc.h struct _mmc_csd { · line 289

Quoted 5 lines
include/linux/mmc/mmc.h +2 -0
@@ -285,6 +285,9 @@ struct _mmc_csd {
 #define EXT_CSD_EXP_EVENTS_STATUS      54      /* RO, 2 bytes */
 #define EXT_CSD_EXP_EVENTS_CTRL                56      /* R/W, 2 bytes */
 #define EXT_CSD_DATA_SECTOR_SIZE       61      /* R */
+#define EXT_CSD_QRDY_SUPPORT           96      /* RO */
+#define EXT_CSD_CMDQ_QRDY_FUNCTION     97      /* R/W */

What's these?

Quoted 27 lines
include/linux/mmc/mmc.h +9 -1
+#define EXT_CSD_PSA                    133     /* R/W/E */
 #define EXT_CSD_GP_SIZE_MULT           143     /* R/W */
 #define EXT_CSD_PARTITION_SETTING_COMPLETED 155        /* R/W */
 #define EXT_CSD_PARTITION_ATTRIBUTE    156     /* R/W */
@@ -315,6 +318,7 @@ struct _mmc_csd {
 #define EXT_CSD_PWR_CL_26_360          203     /* RO */
 #define EXT_CSD_SEC_CNT                        212     /* RO, 4 bytes */
 #define EXT_CSD_S_A_TIMEOUT            217     /* RO */
+#define EXT_CSD_PSA_TIMEOUT            218     /* RO */
 #define EXT_CSD_REL_WR_SEC_C           222     /* RO */
 #define EXT_CSD_HC_WP_GRP_SIZE         221     /* RO */
 #define EXT_CSD_ERASE_TIMEOUT_MULT     223     /* RO */
@@ -433,6 +437,13 @@ struct _mmc_csd {
 #define EXT_CSD_BKOPS_LEVEL_2          0x2
 
 /*
+ * PRODUCTION STATE AWARENESS fields
+ */
+
+#define EXT_CSD_PSA_NORMAL                             0x00
+#define EXT_CSD_PSA_POST_SOLDERING_WRITES      0x02
+
+/*
  * MMC_SWITCH access modes
  */
 
--
Quoted 2 lines

1.7.9.5

Kind regards
Uffe

#2 lore raw

Hi Ulf,

Quoted 9 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 17, 2014 3:34 PM
To: Avi Shchislowski
Cc: linux-mmc; Chris Ball; Alex Lemberg
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

On 17 November 2014 13:52, Avi Shchislowski <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines

Adding support for PSA (Production State Awareness) feature for all eMMC devices with revision >=5.0 In this patch the eMMC driver will check if device was completed its Production State mode, and will switch it to Normal (field) mode.
Switching to normal mode signal the device to complete its work in production mode and start working in regular performance mode.

Please add some detail to what this patch does. Additionally why it's needed.

In this patch driver should recognize if eMMC device (Rev >=5.0) was not switched to Normal (0x00) PSA mode by storage vendor or Programmer house.
For this, we are checking if device was leaved in PRE_SOLDERING_POST_WRITES (0x02) state - represents a state in which the device is in production and the host (usually programmer) completed to load the content to the device.
The host (usually programmer) sets the device to this state after content was loaded and just before soldering.
After soldering the device to real host (not programmer), the device should be switched to Normal (0x00) mode.
The Normal (0x00) mode of PSA register represents a state in which the device is running in the field and uses “regular” operations.
Leaving device in PRE_SOLDERING_POST_WRITES (0x02) might not allow to host write content to the device.

More details about PSA feature can be found in eMMC 5.0 spec (Jedec:
JESD84-B50.pdf)
http://www.jedec.org/standards-documents/technology-focus-areas/flash-memory-ssds-ufs-emmc/e-mmc

Please let us know if more details required.

Quoted 2 lines

Also, make sure to use proper prefix in the commit header.

Sure, we will submit the patch again with correct prefix...

Thanks,
Alex

Quoted 133 lines

drivers/mmc/core/mmc.c static int mmc_read_ext_csd(struct mmc_card

Quoted 9 lines
drivers/mmc/core/mmc.c index renamed from drivers/mmc/core/mmc.c +0 -0

02ad792..2d59722 100644

drivers/mmc/core/mmc.c +0 -0
@@ -605,6 +605,20 @@ static int mmc_read_ext_csd(struct mmc_card

*card)

drivers/mmc/core/mmc.c static int mmc_read_ext_csd(struct mmc_card *card) · line 617

Quoted 13 lines
drivers/mmc/core/mmc.c +10 -0
                                mmc_hostname(card->host));
                        err = 0;
                }
+       /* eMMC v5.0 or later */
+       if (card->ext_csd.rev > 6) {
+               card->ext_csd.psa =
+                       ext_csd[EXT_CSD_PSA];
+               if (ext_csd[EXT_CSD_PSA_TIMEOUT] > 0) {
+                       card->ext_csd.psa_timeout =
+                               100 *
+                               (1 << ext_csd[EXT_CSD_PSA_TIMEOUT]);
+               } else {
+                       card->ext_csd.psa_timeout = 0;

This assignment isn't needed. It's 0 as default.

drivers/mmc/core/mmc.c static int mmc_read_ext_csd(struct mmc_card *card) · line 619

Quoted 2 lines
drivers/mmc/core/mmc.c +2 -0
+                       pr_warn("%s: EXT_CSD PSA Timeout is zero\n",
+                                       mmc_hostname(card->host));

Shouldn't we treat this as an error?

drivers/mmc/core/mmc.c static int mmc_init_card(struct mmc_host *host,

Quoted 6 lines
drivers/mmc/core/mmc.c +2 -0
+               }
+       }
 
                return err;
        }
@@ -1330,6 +1344,25 @@ static int mmc_init_card(struct mmc_host *host,

u32 ocr,

drivers/mmc/core/mmc.c static int mmc_init_card(struct mmc_host *host, u32 ocr,

Quoted 6 lines
drivers/mmc/core/mmc.c +3 -0
        if (card->csd.dsr_imp && host->dsr_req)
                mmc_set_dsr(host);
 
+    /*
+     * eMMC v5.0 or later
+     * and Production State Awareness state is

EXT_CSD_PSA_POST_SOLDERING_WRITES

drivers/mmc/core/mmc.c static int mmc_init_card(struct mmc_host *host, u32 ocr,

Quoted 4 lines
drivers/mmc/core/mmc.c +4 -0
+     * The host should set the device to NORMAL mode
+     */
+       if ((card->ext_csd.rev > 6)
+               && (card->ext_csd.psa ==

EXT_CSD_PSA_POST_SOLDERING_WRITES)) {

drivers/mmc/core/mmc.c static int mmc_init_card(struct mmc_host *host, u32 ocr,

Quoted 5 lines
drivers/mmc/core/mmc.c +5 -0
+               unsigned int timeout;
+               /*Zero value in PSA Timeout – PSA is not defined*/
+               if (card->ext_csd.psa_timeout != 0) {
+                       timeout =
+ DIV_ROUND_UP(card->ext_csd.psa_timeout, 1000);

Can you give an example of a typical value for the timeout?

drivers/mmc/core/mmc.c static int mmc_init_card(struct mmc_host *host, u32 ocr, · line 1363

Quoted 6 lines
drivers/mmc/core/mmc.c +6 -0
+                       card->ext_csd.psa = EXT_CSD_PSA_NORMAL;
+                       err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+                               EXT_CSD_PSA, card->ext_csd.psa, timeout);
+                       if (err && err != -EBADMSG)
+                               goto free_card;
+               }

So if there is no timeout specified what happens then?

Quoted 26 lines
drivers/mmc/core/mmc.c +2 -0
+       }
+
        /*
         * Select card, as all following commands rely on that.
         */
include/linux/mmc/card.h index renamed from include/linux/mmc/card.h +0 -0

4d69c00..09ac3b0 100644

include/linux/mmc/card.h +2 -0
@@ -60,9 +60,11 @@ struct mmc_ext_csd {
        u8                      packed_event_en;
        unsigned int            part_time;              /* Units: ms */
        unsigned int            sa_timeout;             /* Units: 100ns */
+       unsigned int            psa_timeout;            /* Units: 100us */
        unsigned int            generic_cmd6_time;      /* Units: 10ms */
        unsigned int            power_off_longtime;     /* Units: ms */
        u8                      power_off_notification; /* state */
+       u8                      psa; /* production state awareness */
        unsigned int            hs_max_dtr;
        unsigned int            hs200_max_dtr;
 #define MMC_HIGH_26_MAX_DTR    26000000
include/linux/mmc/mmc.h index renamed from include/linux/mmc/mmc.h +0 -0

49ad7a9..eb170ff 100644

include/linux/mmc/mmc.h struct _mmc_csd { · line 289

Quoted 5 lines
include/linux/mmc/mmc.h +2 -0
@@ -285,6 +285,9 @@ struct _mmc_csd {
 #define EXT_CSD_EXP_EVENTS_STATUS      54      /* RO, 2 bytes */
 #define EXT_CSD_EXP_EVENTS_CTRL                56      /* R/W, 2 bytes */
 #define EXT_CSD_DATA_SECTOR_SIZE       61      /* R */
+#define EXT_CSD_QRDY_SUPPORT           96      /* RO */
+#define EXT_CSD_CMDQ_QRDY_FUNCTION     97      /* R/W */

What's these?

Quoted 27 lines
include/linux/mmc/mmc.h +9 -1
+#define EXT_CSD_PSA                    133     /* R/W/E */
 #define EXT_CSD_GP_SIZE_MULT           143     /* R/W */
 #define EXT_CSD_PARTITION_SETTING_COMPLETED 155        /* R/W */
 #define EXT_CSD_PARTITION_ATTRIBUTE    156     /* R/W */
@@ -315,6 +318,7 @@ struct _mmc_csd {
 #define EXT_CSD_PWR_CL_26_360          203     /* RO */
 #define EXT_CSD_SEC_CNT                        212     /* RO, 4 bytes */
 #define EXT_CSD_S_A_TIMEOUT            217     /* RO */
+#define EXT_CSD_PSA_TIMEOUT            218     /* RO */
 #define EXT_CSD_REL_WR_SEC_C           222     /* RO */
 #define EXT_CSD_HC_WP_GRP_SIZE         221     /* RO */
 #define EXT_CSD_ERASE_TIMEOUT_MULT     223     /* RO */
@@ -433,6 +437,13 @@ struct _mmc_csd {
 #define EXT_CSD_BKOPS_LEVEL_2          0x2
 
 /*
+ * PRODUCTION STATE AWARENESS fields
+ */
+
+#define EXT_CSD_PSA_NORMAL                             0x00
+#define EXT_CSD_PSA_POST_SOLDERING_WRITES      0x02
+
+/*
  * MMC_SWITCH access modes
  */
 
--
Quoted 2 lines

1.7.9.5

Kind regards
Uffe

#3 lore raw
Quoted 34 lines · Alex Lemberg

Hi Ulf,

Quoted 9 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 17, 2014 3:34 PM
To: Avi Shchislowski
Cc: linux-mmc; Chris Ball; Alex Lemberg
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

On 17 November 2014 13:52, Avi Shchislowski <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines

Adding support for PSA (Production State Awareness) feature for all eMMC devices with revision >=5.0 In this patch the eMMC driver will check if device was completed its Production State mode, and will switch it to Normal (field) mode.
Switching to normal mode signal the device to complete its work in production mode and start working in regular performance mode.

Please add some detail to what this patch does. Additionally why it's needed.

In this patch driver should recognize if eMMC device (Rev >=5.0) was not switched to Normal (0x00) PSA mode by storage vendor or Programmer house.
For this, we are checking if device was leaved in PRE_SOLDERING_POST_WRITES (0x02) state - represents a state in which the device is in production and the host (usually programmer) completed to load the content to the device.
The host (usually programmer) sets the device to this state after content was loaded and just before soldering.
After soldering the device to real host (not programmer), the device should be switched to Normal (0x00) mode.
The Normal (0x00) mode of PSA register represents a state in which the device is running in the field and uses “regular” operations.
Leaving device in PRE_SOLDERING_POST_WRITES (0x02) might not allow to host write content to the device.

Quoted 5 lines

More details about PSA feature can be found in eMMC 5.0 spec (Jedec:
JESD84-B50.pdf)
http://www.jedec.org/standards-documents/technology-focus-areas/flash-memory-ssds-ufs-emmc/e-mmc

Please let us know if more details required.

Okay, that was far better.

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the production, right!?

Kind regards
Uffe

#4 lore raw
Quoted 56 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Wednesday, November 19, 2014 11:59 AM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 20 lines · Alex Lemberg

Hi Ulf,

Quoted 18 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 17, 2014 3:34 PM
To: Avi Shchislowski
Cc: linux-mmc; Chris Ball; Alex Lemberg
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 6 lines · Avi Shchislowski

Adding support for PSA (Production State Awareness) feature for all eMMC devices with revision >=5.0 In this patch the eMMC driver will check if device was completed its Production State mode, and will switch it to Normal (field) mode.
Switching to normal mode signal the device to complete its work in production mode and start working in regular performance mode.

Quoted 4 lines
Quoted 1 line

Please add some detail to what this patch does. Additionally why it's needed.

In this patch driver should recognize if eMMC device (Rev >=5.0) was not switched to Normal (0x00) PSA mode by storage vendor or Programmer

house.

Quoted 3 lines

For this, we are checking if device was leaved in PRE_SOLDERING_POST_WRITES (0x02) state - represents a state in which the device is in production and the host (usually programmer) completed to

load the content to the device.

Quoted 9 lines

The host (usually programmer) sets the device to this state after content was loaded and just before soldering.
After soldering the device to real host (not programmer), the device should be switched to Normal (0x00) mode.
The Normal (0x00) mode of PSA register represents a state in which the device is running in the field and uses “regular” operations. Leaving device in PRE_SOLDERING_POST_WRITES (0x02) might not allow to host write content to the device.

Quoted 6 lines

More details about PSA feature can be found in eMMC 5.0 spec (Jedec:
JESD84-B50.pdf)
http://www.jedec.org/standards-documents/technology-focus-areas/flash-
memory-ssds-ufs-emmc/e-mmc

Please let us know if more details required.

Quoted 8 lines

Okay, that was far better.

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the production, right!?

According to eMMC spec, the switch to NORMAL should be done after device soldering to final host (not programmer). Please refer to "Figure 32 — Recommended Soldering procedure" in eMMC5.0 specification document.
Also, since we are dealing with only "field" host here, we are not touching/switching any other modes of PSA, but only Normal (field). This code should run only once - in the beginning of device life cycle.

Best regards,
Alex

Quoted 3 lines

Kind regards
Uffe

#5 lore raw
Quoted 61 lines · Alex Lemberg
Quoted 61 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Wednesday, November 19, 2014 11:59 AM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 20 lines · Alex Lemberg

Hi Ulf,

Quoted 18 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 17, 2014 3:34 PM
To: Avi Shchislowski
Cc: linux-mmc; Chris Ball; Alex Lemberg
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 6 lines · Avi Shchislowski

Adding support for PSA (Production State Awareness) feature for all eMMC devices with revision >=5.0 In this patch the eMMC driver will check if device was completed its Production State mode, and will switch it to Normal (field) mode.
Switching to normal mode signal the device to complete its work in production mode and start working in regular performance mode.

Quoted 4 lines
Quoted 1 line

Please add some detail to what this patch does. Additionally why it's needed.

In this patch driver should recognize if eMMC device (Rev >=5.0) was not switched to Normal (0x00) PSA mode by storage vendor or Programmer

house.

Quoted 3 lines

For this, we are checking if device was leaved in PRE_SOLDERING_POST_WRITES (0x02) state - represents a state in which the device is in production and the host (usually programmer) completed to

load the content to the device.

Quoted 9 lines

The host (usually programmer) sets the device to this state after content was loaded and just before soldering.
After soldering the device to real host (not programmer), the device should be switched to Normal (0x00) mode.
The Normal (0x00) mode of PSA register represents a state in which the device is running in the field and uses “regular” operations. Leaving device in PRE_SOLDERING_POST_WRITES (0x02) might not allow to host write content to the device.

Quoted 6 lines

More details about PSA feature can be found in eMMC 5.0 spec (Jedec:
JESD84-B50.pdf)
http://www.jedec.org/standards-documents/technology-focus-areas/flash-
memory-ssds-ufs-emmc/e-mmc

Please let us know if more details required.

Okay, that was far better.

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Quoted 8 lines
Quoted 3 lines

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the production, right!?

According to eMMC spec, the switch to NORMAL should be done after device soldering to final host (not programmer). Please refer to "Figure 32 — Recommended Soldering procedure" in eMMC5.0 specification document.
Also, since we are dealing with only "field" host here, we are not touching/switching any other modes of PSA, but only Normal (field). This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

What does other people think?

Kind regards
Uffe

#6 lore raw
Quoted 87 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Friday, November 21, 2014 3:16 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 25 lines · Alex Lemberg
Quoted 25 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Wednesday, November 19, 2014 11:59 AM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 13 lines · Alex Lemberg

Hi Ulf,

Quoted 11 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 17, 2014 3:34 PM
To: Avi Shchislowski
Cc: linux-mmc; Chris Ball; Alex Lemberg
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

On 17 November 2014 13:52, Avi Shchislowski
<[email protected]>
wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

Adding support for PSA (Production State Awareness) feature for all eMMC devices with revision >=5.0 In this patch the eMMC driver will check if device was completed its Production State mode, and will switch it to Normal (field) mode. Switching to normal mode signal the device to complete its work in production mode and start working in regular performance mode.

Please add some detail to what this patch does. Additionally why it's

needed.

Quoted 27 lines
Quoted 27 lines
Quoted 4 lines

In this patch driver should recognize if eMMC device (Rev >=5.0) was not switched to Normal (0x00) PSA mode by storage vendor or Programmer

house.

Quoted 4 lines

For this, we are checking if device was leaved in PRE_SOLDERING_POST_WRITES (0x02) state - represents a state in which the device is in production and the host (usually programmer) completed to

load the content to the device.

Quoted 16 lines

The host (usually programmer) sets the device to this state after content was loaded and just before soldering.
After soldering the device to real host (not programmer), the device should be switched to Normal (0x00) mode.
The Normal (0x00) mode of PSA register represents a state in which the device is running in the field and uses “regular” operations. Leaving device in PRE_SOLDERING_POST_WRITES (0x02) might not allow to host write content to the device.

More details about PSA feature can be found in eMMC 5.0 spec (Jedec:
JESD84-B50.pdf)
http://www.jedec.org/standards-documents/technology-focus-areas/fla
sh-
memory-ssds-ufs-emmc/e-mmc

Please let us know if more details required.

Quoted 8 lines
Quoted 8 lines

Okay, that was far better.

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

production, right!?

Quoted 2 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 1 line

Please refer to "Figure 32 — Recommended Soldering procedure" in

eMMC5.0 specification document.

Quoted 1 line

Also, since we are dealing with only "field" host here, we are not

Quoted 9 lines

touching/switching any other modes of PSA, but only Normal (field).

Quoted 1 line

This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process.
Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external programmer.
BTW, I have resubmitted the patch again, now with correct subject prefix, and some additional fixes.

Quoted 4 lines

What does other people think?

Kind regards
Uffe

#7 lore raw

[...]

Quoted 24 lines
Quoted 14 lines
Quoted 7 lines
Quoted 7 lines

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

production, right!?

Quoted 2 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 1 line

Please refer to "Figure 32 — Recommended Soldering procedure" in

eMMC5.0 specification document.

Quoted 1 line

Also, since we are dealing with only "field" host here, we are not

Quoted 9 lines

touching/switching any other modes of PSA, but only Normal (field).

Quoted 1 line

This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Quoted 5 lines

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process.
Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external programmer.

So, if flash data will be corrupted due to for example high temperatures during soldering, how will that be detected when using the "manual mode"?

If that's the job for the platform software I fail to understand why the PRE_SOLDERING_POST_WRITES state needs to exists at all!?

Kind regards
Uffe

#8 lore raw
Quoted 42 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 24, 2014 2:24 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

[...]

Quoted 26 lines
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

production, right!?

Quoted 3 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 1 line

Please refer to "Figure 32 — Recommended Soldering procedure" in

eMMC5.0 specification document.

Quoted 1 line

Also, since we are dealing with only "field" host here, we are not

Quoted 9 lines

touching/switching any other modes of PSA, but only Normal (field).

Quoted 1 line

This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Quoted 5 lines

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process. Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external

Quoted 7 lines

programmer.

So, if flash data will be corrupted due to for example high temperatures during soldering, how will that be detected when using the "manual mode"?

If that's the job for the platform software I fail to understand why the PRE_SOLDERING_POST_WRITES state needs to exists at all!?

The flow of "Manual Mode" is:

[skipping few common steps]
...
Host (Programmer) sets PRODUCTION_STATE_AWARENESS
to 0x1 (PRE_SOLDERING_WRITES)

Host (Programmer) perform pre-soldering data loading and/or device configuration

Host (Programmer) sets PRODUCTION_STATE_AWARENESS
To 0x2 (PRE_SOLDERING_POST_WRITES).
No writes past this point

Device Soldering

Host (field) sets PRODUCTION_STATE_AWARENESS
to 0x0 (NORMAL)
...

Hope this will answer...

Quoted 3 lines

Kind regards
Uffe

#9 lore raw
Quoted 44 lines · Alex Lemberg
Quoted 44 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 24, 2014 2:24 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

[...]

Quoted 26 lines
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

production, right!?

Quoted 3 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 1 line

Please refer to "Figure 32 — Recommended Soldering procedure" in

eMMC5.0 specification document.

Quoted 1 line

Also, since we are dealing with only "field" host here, we are not

Quoted 9 lines

touching/switching any other modes of PSA, but only Normal (field).

Quoted 1 line

This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Quoted 5 lines

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process. Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external

programmer.

Quoted 7 lines
Quoted 5 lines

So, if flash data will be corrupted due to for example high temperatures during soldering, how will that be detected when using the "manual mode"?

If that's the job for the platform software I fail to understand why the PRE_SOLDERING_POST_WRITES state needs to exists at all!?

The flow of "Manual Mode" is:

Thanks for clarifying.

Quoted 6 lines

[skipping few common steps]
...
Host (Programmer) sets PRODUCTION_STATE_AWARENESS
to 0x1 (PRE_SOLDERING_WRITES)

Quoted 6 lines

Host (Programmer) perform pre-soldering data loading and/or device configuration

Host (Programmer) sets PRODUCTION_STATE_AWARENESS
To 0x2 (PRE_SOLDERING_POST_WRITES).
No writes past this point

To repeat my question:

_Unless_ there are no validation of the device soldering performed by the "programmer tool" past this point, why couldn't the host set PRODUCTION_STATE_AWARENESS to 0x0 (NORMAL) at this point instead?

Quoted 9 lines

Device Soldering

Host (field) sets PRODUCTION_STATE_AWARENESS
to 0x0 (NORMAL)
...

Hope this will answer...

Kind regards
Uffe

#10 lore raw
Quoted 81 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Tuesday, November 25, 2014 12:57 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 44 lines · Alex Lemberg
Quoted 44 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 24, 2014 2:24 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

[...]

Quoted 32 lines
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

production, right!?

Quoted 3 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 1 line

Please refer to "Figure 32 — Recommended Soldering procedure" in

eMMC5.0 specification document.

Quoted 2 lines

Also, since we are dealing with only "field" host here, we are not

Quoted 9 lines

touching/switching any other modes of PSA, but only Normal (field).

Quoted 1 line

This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process. Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external

Quoted 4 lines
Quoted 4 lines

programmer.

So, if flash data will be corrupted due to for example high temperatures during soldering, how will that be detected when using the

"manual mode"?

Quoted 5 lines
Quoted 3 lines

If that's the job for the platform software I fail to understand why the PRE_SOLDERING_POST_WRITES state needs to exists at all!?

The flow of "Manual Mode" is:

Thanks for clarifying.

Quoted 6 lines

[skipping few common steps]
...
Host (Programmer) sets PRODUCTION_STATE_AWARENESS to 0x1 (PRE_SOLDERING_WRITES)

Quoted 6 lines

Host (Programmer) perform pre-soldering data loading and/or device configuration

Host (Programmer) sets PRODUCTION_STATE_AWARENESS To 0x2 (PRE_SOLDERING_POST_WRITES).
No writes past this point

Quoted 6 lines

To repeat my question:

_Unless_ there are no validation of the device soldering performed by the "programmer tool" past this point, why couldn't the host set PRODUCTION_STATE_AWARENESS to 0x0 (NORMAL) at this point instead?

If programmer set to NORMAL at this point, the programmed data can be corrupted during the soldering process.
eMMC device will protect programmed data during the soldering process in PRE_SOLDERING_POST_WRITES (0x2) mode.
BTW, when I am saying "Host (Programmer)" - I intend external programming machine.

Quoted 10 lines
Quoted 7 lines

Device Soldering

Host (field) sets PRODUCTION_STATE_AWARENESS to 0x0 (NORMAL) ...

Hope this will answer...

Kind regards
Uffe

#11 lore raw
Quoted 88 lines · Alex Lemberg
Quoted 81 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Tuesday, November 25, 2014 12:57 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 44 lines · Alex Lemberg
Quoted 44 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 24, 2014 2:24 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

[...]

Quoted 32 lines
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

production, right!?

Quoted 3 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 1 line

Please refer to "Figure 32 — Recommended Soldering procedure" in

eMMC5.0 specification document.

Quoted 2 lines

Also, since we are dealing with only "field" host here, we are not

Quoted 9 lines

touching/switching any other modes of PSA, but only Normal (field).

Quoted 1 line

This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process. Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external

Quoted 4 lines
Quoted 4 lines

programmer.

So, if flash data will be corrupted due to for example high temperatures during soldering, how will that be detected when using the

"manual mode"?

Quoted 5 lines
Quoted 3 lines

If that's the job for the platform software I fail to understand why the PRE_SOLDERING_POST_WRITES state needs to exists at all!?

The flow of "Manual Mode" is:

Thanks for clarifying.

Quoted 6 lines

[skipping few common steps]
...
Host (Programmer) sets PRODUCTION_STATE_AWARENESS to 0x1 (PRE_SOLDERING_WRITES)

Quoted 6 lines

Host (Programmer) perform pre-soldering data loading and/or device configuration

Host (Programmer) sets PRODUCTION_STATE_AWARENESS To 0x2 (PRE_SOLDERING_POST_WRITES).
No writes past this point

Quoted 6 lines

To repeat my question:

_Unless_ there are no validation of the device soldering performed by the "programmer tool" past this point, why couldn't the host set PRODUCTION_STATE_AWARENESS to 0x0 (NORMAL) at this point instead?

Quoted 4 lines

If programmer set to NORMAL at this point, the programmed data can be corrupted during the soldering process.
eMMC device will protect programmed data during the soldering process in PRE_SOLDERING_POST_WRITES (0x2) mode.

Exactly how will that be done?

During the soldering process the eMMC card isn't powered. So how could it protect itself better, just because the state is PRE_SOLDERING_POST_WRITES?

Kind regards
Uffe

#12 lore raw

Hi Ulf,

Quoted 106 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Tuesday, December 02, 2014 11:31 AM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 11 lines · Alex Lemberg
Quoted 11 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Tuesday, November 25, 2014 12:57 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

On 25 November 2014 at 10:17, Alex Lemberg

<[email protected]>

Quoted 80 lines
Quoted 73 lines
Quoted 45 lines · wrote:
Quoted 45 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 24, 2014 2:24 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

[...]

Quoted 33 lines
Quoted 18 lines
Quoted 8 lines
Quoted 8 lines

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

production, right!?

Quoted 3 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 2 lines

Please refer to "Figure 32 — Recommended Soldering procedure" in

eMMC5.0 specification document.

Quoted 2 lines

Also, since we are dealing with only "field" host here, we are not

Quoted 9 lines

touching/switching any other modes of PSA, but only Normal (field).

Quoted 1 line

This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process. Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external

Quoted 5 lines
Quoted 5 lines

programmer.

So, if flash data will be corrupted due to for example high temperatures during soldering, how will that be detected when using the

"manual mode"?

Quoted 5 lines
Quoted 3 lines

If that's the job for the platform software I fail to understand why the PRE_SOLDERING_POST_WRITES state needs to exists at all!?

The flow of "Manual Mode" is:

Thanks for clarifying.

Quoted 6 lines

[skipping few common steps]
...
Host (Programmer) sets PRODUCTION_STATE_AWARENESS to 0x1 (PRE_SOLDERING_WRITES)

Quoted 6 lines

Host (Programmer) perform pre-soldering data loading and/or device configuration

Host (Programmer) sets PRODUCTION_STATE_AWARENESS To 0x2 (PRE_SOLDERING_POST_WRITES).
No writes past this point

Quoted 6 lines

To repeat my question:

_Unless_ there are no validation of the device soldering performed by the "programmer tool" past this point, why couldn't the host set PRODUCTION_STATE_AWARENESS to 0x0 (NORMAL) at this point instead?

Quoted 4 lines

If programmer set to NORMAL at this point, the programmed data can be corrupted during the soldering process.
eMMC device will protect programmed data during the soldering process in PRE_SOLDERING_POST_WRITES (0x2) mode.

Quoted 4 lines

Exactly how will that be done?

During the soldering process the eMMC card isn't powered. So how could it protect itself better, just because the state is PRE_SOLDERING_POST_WRITES?

The device will use "special" internal operations for saving content prior to device soldering, and will switch to "regular" after the soldering and getting "NORMAL" mode.

Quoted 3 lines

Kind regards
Uffe

#13 lore raw
Quoted 108 lines · Alex Lemberg

Hi Ulf,

Quoted 106 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Tuesday, December 02, 2014 11:31 AM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 11 lines · Alex Lemberg
Quoted 11 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Tuesday, November 25, 2014 12:57 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

On 25 November 2014 at 10:17, Alex Lemberg

<[email protected]>

Quoted 84 lines
Quoted 73 lines
Quoted 45 lines · wrote:
Quoted 45 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 24, 2014 2:24 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

[...]

Quoted 33 lines
Quoted 18 lines
Quoted 8 lines
Quoted 8 lines

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

production, right!?

Quoted 3 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 2 lines

Please refer to "Figure 32 — Recommended Soldering procedure" in

eMMC5.0 specification document.

Quoted 2 lines

Also, since we are dealing with only "field" host here, we are not

Quoted 9 lines

touching/switching any other modes of PSA, but only Normal (field).

Quoted 1 line

This code should run only once - in the beginning of device life cycle.

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process. Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external

Quoted 5 lines
Quoted 5 lines

programmer.

So, if flash data will be corrupted due to for example high temperatures during soldering, how will that be detected when using the

"manual mode"?

Quoted 5 lines
Quoted 3 lines

If that's the job for the platform software I fail to understand why the PRE_SOLDERING_POST_WRITES state needs to exists at all!?

The flow of "Manual Mode" is:

Thanks for clarifying.

Quoted 6 lines

[skipping few common steps]
...
Host (Programmer) sets PRODUCTION_STATE_AWARENESS to 0x1 (PRE_SOLDERING_WRITES)

Quoted 6 lines

Host (Programmer) perform pre-soldering data loading and/or device configuration

Host (Programmer) sets PRODUCTION_STATE_AWARENESS To 0x2 (PRE_SOLDERING_POST_WRITES).
No writes past this point

Quoted 6 lines

To repeat my question:

_Unless_ there are no validation of the device soldering performed by the "programmer tool" past this point, why couldn't the host set PRODUCTION_STATE_AWARENESS to 0x0 (NORMAL) at this point instead?

If programmer set to NORMAL at this point, the programmed data can be corrupted during the soldering process.
eMMC device will protect programmed data during the soldering process in PRE_SOLDERING_POST_WRITES (0x2) mode.

Quoted 7 lines
Quoted 4 lines

Exactly how will that be done?

During the soldering process the eMMC card isn't powered. So how could it protect itself better, just because the state is PRE_SOLDERING_POST_WRITES?

The device will use "special" internal operations for saving content prior to device soldering, and will switch to "regular" after the soldering and getting "NORMAL" mode.

Huh, this is a seriously hard question to get some answer to. I still don't get it.

Are you saying the card are able to protect itself during the soldering phase? I assume soldiering is done without powering the card, thus I find it hard to understand that your statement can be true.

Anyway, to convenience me, you need to give at least one example of what these protective operations could be during soldering.

Kind regards
Uffe

#14 lore raw
Quoted 138 lines

-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Ulf Hansson
Sent: Wednesday, December 03, 2014 2:29 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

Quoted 11 lines · Alex Lemberg

Hi Ulf,

Quoted 9 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Tuesday, December 02, 2014 11:31 AM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

On 25 November 2014 at 15:55, Alex Lemberg

<[email protected]>

Quoted 34 lines
Quoted 34 lines
Quoted 11 lines · wrote:
Quoted 11 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Tuesday, November 25, 2014 12:57 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

On 25 November 2014 at 10:17, Alex Lemberg

<[email protected]>

Quoted 21 lines
Quoted 21 lines
Quoted 20 lines · wrote:
Quoted 20 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, November 24, 2014 2:24 PM
To: Alex Lemberg
Cc: linux-mmc; Chris Ball; Avi Shchislowski
Subject: Re: [PATCH 1/1] Production State Awareness support in host side

[...]

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

I am not so sure we should finalize the production phase while initializing the eMMC card like this.

Certainly we should check the PSA state, but I think we should return an error if we think the device hasn’t completed production. It should be the responsibility for the "programming tools" to finalize the

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

production, right!?

Quoted 3 lines

According to eMMC spec, the switch to NORMAL should be done after device

soldering to final host (not programmer).

Quoted 1 line

Please refer to "Figure 32 — Recommended Soldering

procedure"

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

in

eMMC5.0 specification document.

Quoted 2 lines

Also, since we are dealing with only "field" host here, we are not

touching/switching any other modes of PSA, but only Normal

(field).

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

This code should run only once - in the beginning of device life

cycle.

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 8 lines
Quoted 7 lines

I get your point, but I am not so sure.

To me, I wouldn't trust that the platform binaries has been successfully programmed to the device, unless the programmer tool takes care of switching the device to "normal".

Quoted 6 lines

Thanks Ulf!
Also, please note - PSA PRE_SOLDERING_POST_WRITES mode intent to save device pre-loaded content during the soldering process. Flash data can be corrupted due to soldering procedure high temperature. So switching to Normal cannot be done by external

programmer.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

So, if flash data will be corrupted due to for example high temperatures during soldering, how will that be detected when using the

"manual mode"?

Quoted 3 lines
Quoted 3 lines

If that's the job for the platform software I fail to understand why the PRE_SOLDERING_POST_WRITES state needs to

exists at all!?

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 2 lines

The flow of "Manual Mode" is:

Thanks for clarifying.

Quoted 12 lines

[skipping few common steps]
...
Host (Programmer) sets PRODUCTION_STATE_AWARENESS to 0x1 (PRE_SOLDERING_WRITES)

Host (Programmer) perform pre-soldering data loading and/or device configuration

Host (Programmer) sets PRODUCTION_STATE_AWARENESS To 0x2 (PRE_SOLDERING_POST_WRITES).
No writes past this point

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

To repeat my question:

_Unless_ there are no validation of the device soldering performed by the "programmer tool" past this point, why couldn't the host set PRODUCTION_STATE_AWARENESS to 0x0 (NORMAL) at this point

instead?

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 1 line

If programmer set to NORMAL at this point, the programmed data can be corrupted during the soldering process.
eMMC device will protect programmed data during the soldering process in PRE_SOLDERING_POST_WRITES (0x2) mode.

Exactly how will that be done?

During the soldering process the eMMC card isn't powered. So how could it protect itself better, just because the state is

PRE_SOLDERING_POST_WRITES?

Quoted 3 lines

The device will use "special" internal operations for saving content prior to device soldering, and will switch to "regular" after the soldering and

getting "NORMAL" mode.

Quoted 9 lines

Huh, this is a seriously hard question to get some answer to. I still don't get it.

Are you saying the card are able to protect itself during the soldering phase? I assume soldiering is done without powering the card, thus I find it hard to understand that your statement can be true.

Anyway, to convenience me, you need to give at least one example of what these protective operations could be during soldering.

Please let me try to clarify.
The risk in soldering is that data which was loaded into the flash would be corrupted due to the heat of soldering the device to the host.
To mitigate the risk the production tools (programmer) and host platform specify to the device its current state.
Basically there are 2 types of states:
pre-soldering state and post-soldering state (“Normal”).

When the device controller identifies that it is in pre-soldering state it would use “special” flash programming manner in order to write to the flash. This “special” flash programming makes the data, which was previously written, immune to the risky soldering procedure and the data will not be corrupted at soldering.
(However, “special” flash programming comes with a cost, which depends on the vendor proprietary solution).
As you can see, the data protection is done while programming the data using the “special” method before the soldering and not during soldering.

To reduce the cost to minimum, and allow proper operation of the storage device, the device should NOT use the “special” flash programming when it does not have to. To make sure that the device stops the “special” flash programming and resumes regular flash programming the device must know that it is in post-soldering state. This indication comes from the host when it sets PRODUCTION_STATE_AWARENESS back to NORMAL state.
Therefore, the host platform needs to send this indication to the device AFTER device soldering to the platform.

I hope that this clarifies the procedure and the need for sending the post-soldering indication to the device by the host platform.

Quoted 6 lines

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html