X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=disk%2Fpart_iso.c;h=e733227f5996b8ef83ccb4a1fa5ac1f7b02a8699;hb=13f451bf5625e222e881779e69d92a2002e41dfc;hp=9f5c50c73faba4cf2c51bd030f70401914a78092;hpb=a2adb173ec1551ce8a2081085d20d82162f7900d;p=oweals%2Fu-boot.git diff --git a/disk/part_iso.c b/disk/part_iso.c index 9f5c50c73f..e733227f59 100644 --- a/disk/part_iso.c +++ b/disk/part_iso.c @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2001 * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch. - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -10,7 +9,7 @@ #include #include "part_iso.h" -#ifdef HAVE_BLOCK_DEVICE +#ifdef CONFIG_HAVE_BLOCK_DEVICE /* #define ISO_PART_DEBUG */ @@ -24,7 +23,7 @@ #undef CHECK_FOR_POWERPC_PLATTFORM #define CD_SECTSIZE 2048 -static unsigned char tmpbuf[CD_SECTSIZE]; +static unsigned char tmpbuf[CD_SECTSIZE] __aligned(ARCH_DMA_MINALIGN); unsigned long iso_dread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, void *buffer) @@ -137,30 +136,7 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num, entry_num=1; offset=0x20; strcpy((char *)info->type, "U-Boot"); - switch(dev_desc->if_type) { - case IF_TYPE_IDE: - case IF_TYPE_SATA: - case IF_TYPE_ATAPI: - sprintf ((char *)info->name, "hd%c%d", - 'a' + dev_desc->devnum, part_num); - break; - case IF_TYPE_SCSI: - sprintf ((char *)info->name, "sd%c%d", - 'a' + dev_desc->devnum, part_num); - break; - case IF_TYPE_USB: - sprintf ((char *)info->name, "usbd%c%d", - 'a' + dev_desc->devnum, part_num); - break; - case IF_TYPE_DOC: - sprintf ((char *)info->name, "docd%c%d", - 'a' + dev_desc->devnum, part_num); - break; - default: - sprintf ((char *)info->name, "xx%c%d", - 'a' + dev_desc->devnum, part_num); - break; - } + part_set_generic_name(dev_desc, part_num, (char *)info->name); /* the bootcatalog (including validation Entry) is limited to 2048Bytes * (63 boot entries + validation entry) */ while(offset<2048) { @@ -225,7 +201,7 @@ found: static int part_get_info_iso(struct blk_desc *dev_desc, int part_num, disk_partition_t *info) { - return part_get_info_iso_verb(dev_desc, part_num, info, 1); + return part_get_info_iso_verb(dev_desc, part_num, info, 0); } static void part_print_iso(struct blk_desc *dev_desc) @@ -233,13 +209,13 @@ static void part_print_iso(struct blk_desc *dev_desc) disk_partition_t info; int i; - if (part_get_info_iso_verb(dev_desc, 0, &info, 0) == -1) { + if (part_get_info_iso_verb(dev_desc, 1, &info, 0) == -1) { printf("** No boot partition found on device %d **\n", dev_desc->devnum); return; } printf("Part Start Sect x Size Type\n"); - i=0; + i=1; do { printf(" %2d " LBAFU " " LBAFU " %6ld %.32s\n", i, info.start, info.size, info.blksz, info.type); @@ -251,12 +227,13 @@ static int part_test_iso(struct blk_desc *dev_desc) { disk_partition_t info; - return part_get_info_iso_verb(dev_desc, 1, &info, 1); + return part_get_info_iso_verb(dev_desc, 1, &info, 0); } U_BOOT_PART_TYPE(iso) = { .name = "ISO", .part_type = PART_TYPE_ISO, + .max_entries = ISO_ENTRY_NUMBERS, .get_info = part_get_info_iso, .print = part_print_iso, .test = part_test_iso,