summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
Diffstat (limited to 'disk')
-rw-r--r--disk/Kconfig10
-rw-r--r--disk/Makefile18
-rw-r--r--disk/part.c2
-rw-r--r--disk/part_dos.c2
-rw-r--r--disk/part_efi.c11
5 files changed, 32 insertions, 11 deletions
diff --git a/disk/Kconfig b/disk/Kconfig
index ffa835eb354..b0bd02539ee 100644
--- a/disk/Kconfig
+++ b/disk/Kconfig
@@ -49,6 +49,16 @@ config SPL_MAC_PARTITION
default y if MAC_PARTITION
select SPL_PARTITIONS
+config TEGRA_PARTITION
+ bool "Enable Nvidia Tegra partition table"
+ select PARTITIONS
+ select EFI_PARTITION
+ help
+ Say Y here if you would like to use U-Boot on a device that
+ is using the Nvidia Tegra partition table and cannot alter it.
+
+ If unsure, say N.
+
config DOS_PARTITION
bool "Enable MS Dos partition table"
default y if BOOT_DEFAULTS
diff --git a/disk/Makefile b/disk/Makefile
index 45588cf66e4..2248a659f8b 100644
--- a/disk/Makefile
+++ b/disk/Makefile
@@ -5,16 +5,16 @@
#ccflags-y += -DET_DEBUG -DDEBUG
-obj-$(CONFIG_$(SPL_TPL_)PARTITIONS) += part.o
-ifdef CONFIG_$(SPL_TPL_)BLK
-obj-$(CONFIG_$(SPL_TPL_)PARTITIONS) += disk-uclass.o
+obj-$(CONFIG_$(PHASE_)PARTITIONS) += part.o
+ifdef CONFIG_$(PHASE_)BLK
+obj-$(CONFIG_$(PHASE_)PARTITIONS) += disk-uclass.o
endif
# Must have BLK or SPL_LEGACY_BLOCK to support partitions
-ifneq ($(CONFIG_$(SPL_TPL_)BLK),$(CONFIG_SPL_LEGACY_BLOCK),)
-obj-$(CONFIG_$(SPL_TPL_)MAC_PARTITION) += part_mac.o
-obj-$(CONFIG_$(SPL_TPL_)DOS_PARTITION) += part_dos.o
-obj-$(CONFIG_$(SPL_TPL_)ISO_PARTITION) += part_iso.o
-obj-$(CONFIG_$(SPL_TPL_)AMIGA_PARTITION) += part_amiga.o
-obj-$(CONFIG_$(SPL_TPL_)EFI_PARTITION) += part_efi.o
+ifneq ($(CONFIG_$(PHASE_)BLK),$(CONFIG_SPL_LEGACY_BLOCK),)
+obj-$(CONFIG_$(PHASE_)MAC_PARTITION) += part_mac.o
+obj-$(CONFIG_$(PHASE_)DOS_PARTITION) += part_dos.o
+obj-$(CONFIG_$(PHASE_)ISO_PARTITION) += part_iso.o
+obj-$(CONFIG_$(PHASE_)AMIGA_PARTITION) += part_amiga.o
+obj-$(CONFIG_$(PHASE_)EFI_PARTITION) += part_efi.o
endif
diff --git a/disk/part.c b/disk/part.c
index 706d77b3194..303178161c0 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -482,7 +482,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
}
#endif
-#if IS_ENABLED(CONFIG_CMD_UBIFS) && !IS_ENABLED(CONFIG_SPL_BUILD)
+#if IS_ENABLED(CONFIG_CMD_UBIFS) && !IS_ENABLED(CONFIG_XPL_BUILD)
/*
* Special-case ubi, ubi goes through a mtd, rather than through
* a regular block device.
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 09af2aeeb99..96f748702fd 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -100,7 +100,7 @@ static int test_block_type(unsigned char *buffer)
static int part_test_dos(struct blk_desc *desc)
{
-#ifndef CONFIG_SPL_BUILD
+#ifndef CONFIG_XPL_BUILD
ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr,
DIV_ROUND_UP(desc->blksz, sizeof(legacy_mbr)));
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 580821a6ee9..7f04c6ecd69 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -318,6 +318,17 @@ static int part_test_efi(struct blk_desc *desc)
/* Read legacy MBR from block 0 and validate it */
if ((blk_dread(desc, 0, 1, (ulong *)legacymbr) != 1)
|| (is_pmbr_valid(legacymbr) != 1)) {
+ /*
+ * TegraPT is compatible with EFI part, but it
+ * cannot pass the Protective MBR check. Skip it
+ * if CONFIG_TEGRA_PARTITION is enabled and the
+ * device in question is eMMC.
+ */
+ if (IS_ENABLED(CONFIG_TEGRA_PARTITION))
+ if (!is_pmbr_valid(legacymbr) &&
+ desc->uclass_id == UCLASS_MMC &&
+ !desc->devnum)
+ return 0;
return -1;
}
return 0;