#define EXT_CSD_HS_CTRL_REL (1 << 0) /* host controlled WR_REL_SET */
+#define EXT_CSD_BOOT_WP_B_SEC_WP_SEL (0x80) /* enable partition selector */
+#define EXT_CSD_BOOT_WP_B_PWR_WP_SEC_SEL (0x02) /* partition selector to protect */
+#define EXT_CSD_BOOT_WP_B_PWR_WP_EN (0x01) /* power-on write-protect */
+
#define EXT_CSD_WR_DATA_REL_USR (1 << 0) /* user data area WR_REL */
#define EXT_CSD_WR_DATA_REL_GP(x) (1 << ((x)+1)) /* GP part (x+1) WR_REL */
/**
* mmc_bind() - Set up a new MMC device ready for probing
*
- * A child block device is bound with the IF_TYPE_MMC interface type. This
+ * A child block device is bound with the UCLASS_MMC interface type. This
* allows the device to be used with CONFIG_BLK
*
* @dev: MMC device to set up
*/
int mmc_boot_wp(struct mmc *mmc);
+/**
+ * mmc_boot_wp_single_partition() - set write protection to a boot partition.
+ *
+ * This function sets a single boot partition to protect and leave the
+ * other partition writable.
+ *
+ * @param mmc the mmc device.
+ * @param partition 0 - first boot partition, 1 - second boot partition.
+ * @return 0 for success
+ */
+int mmc_boot_wp_single_partition(struct mmc *mmc, int partition);
+
static inline enum dma_data_direction mmc_get_dma_dir(struct mmc_data *data)
{
return data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE;