mirror of
https://github.com/smaeul/u-boot.git
synced 2025-11-01 12:38:22 +00:00
Pull request for efi-2023-10-rc3
Documentation: * Correct description of board_get_usable_ram_top * Add partition API to HTML documentation * Describe lmb_is_reserved * doc/sphinx/requirements.txt: Bump certifi up UEFI: * Fix efi_add_known_memory * Make distro_efi_boot() static Other: * Correct return type board_get_usable_ram_top -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmTbqCcACgkQxIHbvCwF GsSLBw/9FysiJXRu2xzT/jX8a6vzpx4Z3xf+6CVF8Ndn771Ii1AI492e3hkJnbPq ifS9DOUFVh9vjRgeJqXVAjplZuHPxTqXH5PScQF6axuupzqgkOhCHeV3Hyu2FLAX MevX44V9pVFIZRrzaSVAGJTtshLnHua3YoAF12lPjwjA/G11+SP761coINueqjL9 +98cpVDWzv4z0mJUsg9Tn0+cNsBAbObk365JboSGaZ9hc4fU5cgM2/iGrEjdcO8+ bOKMiW/iUDLhBe3u0zRRqD4zK4HRNP491goXHWxer0+uQVDuzKyhgg2Vqa+9J1pv Ej40BxVhU8LUdmd0E6DLWrtYW/YTvXtznhM32JEzRjoJfI4KFlO7tIweJVKFfhmu Vo2pK790irQfLopmyJZjNMau+bThZ+xMeZkJfajEQAls88t/d6x5yJNMjX547rda YW0cV1XkoQ42WXTJZpZCLgH5H47bLG+1Bg9hKT/fRZLCG0PROXrA5Nr0i3Qtbq7b e0ELBXQdz3kdb8s4ISk2lustM4JI5dJT2jwqLYNSI5k25Bx/9dedubIOfJb/FPcH Frr3s/ThA8ww6eSyudL61riU2kSqFbggHZTNVHIdh5RVS9LVWjGtKOYlD6xAtIvE uX0n9XabNT4HwxdlLyelz1vWSMo15N5zoHP0q/DqXK5fe+WmwOs= =UkDs -----END PGP SIGNATURE----- Merge tag 'efi-2023-10-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2023-10-rc3 Documentation: * Correct description of board_get_usable_ram_top * Add partition API to HTML documentation * Describe lmb_is_reserved * doc/sphinx/requirements.txt: Bump certifi up UEFI: * Fix efi_add_known_memory * Make distro_efi_boot() static Other: * Correct return type board_get_usable_ram_top
This commit is contained in:
commit
9b54b0e37b
@ -333,7 +333,7 @@ phys_size_t get_effective_memsize(void)
|
||||
}
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
ulong top_addr;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
*/
|
||||
#define USABLE_RAM_SIZE 0x80000000ULL
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
unsigned long top = CFG_SYS_SDRAM_BASE + min(gd->ram_size, USABLE_RAM_SIZE);
|
||||
|
||||
|
||||
@ -216,7 +216,7 @@ int dram_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
unsigned long top = CFG_SYS_SDRAM_BASE + SDRAM_MAX_SIZE;
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ int dram_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
phys_size_t size;
|
||||
phys_addr_t reg;
|
||||
|
||||
@ -64,7 +64,7 @@ static struct mm_region sunxi_mem_map[] = {
|
||||
};
|
||||
struct mm_region *mem_map = sunxi_mem_map;
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
/* Some devices (like the EMAC) have a 32-bit DMA limit. */
|
||||
if (gd->ram_top > (1ULL << 32))
|
||||
|
||||
@ -403,7 +403,7 @@ int dram_init_banksize(void)
|
||||
* This function is called before dram_init_banksize(), so we can't simply
|
||||
* return gd->bd->bi_dram[1].start + gd->bd->bi_dram[1].size.
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
ulong ram_top;
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ void board_init_f(ulong dummy)
|
||||
}
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return CFG_SYS_SDRAM_BASE + (256 * 1024 * 1024);
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ phys_size_t get_effective_memsize(void)
|
||||
return UBOOT_RAM_SIZE_MAX;
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_RAM_OCTEON)) {
|
||||
/* Map a maximum of 256MiB - return not size but address */
|
||||
|
||||
@ -21,7 +21,7 @@ int dram_init_banksize(void)
|
||||
return fdtdec_setup_memory_banksize();
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
/*
|
||||
* Ensure that we run from first 4GB so that all
|
||||
|
||||
@ -20,7 +20,7 @@ int dram_init_banksize(void)
|
||||
return fdtdec_setup_memory_banksize();
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
#ifdef CONFIG_64BIT
|
||||
/*
|
||||
|
||||
@ -21,7 +21,7 @@ int dram_init_banksize(void)
|
||||
return fdtdec_setup_memory_banksize();
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
/*
|
||||
* Ensure that we run from first 4GB so that all
|
||||
|
||||
@ -21,7 +21,7 @@ int dram_init_banksize(void)
|
||||
return fdtdec_setup_memory_banksize();
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
/*
|
||||
* Ensure that we run from first 4GB so that all
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include <asm/arch/pei_data.h>
|
||||
#include <asm/arch/pm.h>
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return mrc_common_board_get_usable_ram_top(total_size);
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ unsigned int install_e820_map(unsigned int max_entries,
|
||||
* address, and how far U-Boot is moved by relocation are set in the global
|
||||
* data structure.
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
uintptr_t dest_addr = 0;
|
||||
int i;
|
||||
|
||||
@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
* the relocation address, and how far U-Boot is moved by relocation are
|
||||
* set in the global data structure.
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
struct efi_mem_desc *desc, *end;
|
||||
struct efi_entry_memmap *map;
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return (ulong)efi_get_ram_base() + gd->ram_size;
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
#define CMOS_OFFSET_MRC_SEED_S3 156
|
||||
#define CMOS_OFFSET_MRC_SEED_CHK 160
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return mrc_common_board_get_usable_ram_top(total_size);
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ int dram_init_banksize(void)
|
||||
* the relocation address, and how far U-Boot is moved by relocation are
|
||||
* set in the global data structure.
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return qemu_get_low_memory_size();
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ int dram_init_banksize(void)
|
||||
* the relocation address, and how far U-Boot is moved by relocation are
|
||||
* set in the global data structure.
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return gd->ram_size;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ static struct sbl_memory_map_info *get_memory_map_info(void)
|
||||
* @total_size: The memory size that u-boot occupies
|
||||
* Return: : The top available memory address lower than 4GB
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
struct sbl_memory_map_info *data;
|
||||
int i;
|
||||
|
||||
@ -204,7 +204,7 @@ unsigned int install_e820_map(unsigned int max_entries,
|
||||
* address, and how far U-Boot is moved by relocation are set in the global
|
||||
* data structure.
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
struct sfi_table_simple *sb;
|
||||
struct sfi_mem_entry *mentry;
|
||||
|
||||
@ -77,7 +77,7 @@ int x86_cleanup_before_linux(void);
|
||||
void x86_enable_caches(void);
|
||||
void x86_disable_caches(void);
|
||||
int x86_init_cache(void);
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size);
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size);
|
||||
int default_print_cpuinfo(void);
|
||||
|
||||
/* Set up a UART which can be used with printch(), printhex8(), etc. */
|
||||
|
||||
@ -34,7 +34,7 @@ int dram_init(void)
|
||||
* the relocation address, and how far U-Boot is moved by relocation are
|
||||
* set in the global data structure.
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return fsp_get_usable_lowmem_top(gd->arch.hob_list);
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ int dram_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
if (!ll_boot_init())
|
||||
return gd->ram_size;
|
||||
|
||||
@ -183,7 +183,7 @@ int dram_init_banksize(void)
|
||||
}
|
||||
|
||||
/* Limit RAM used by U-Boot to the DDR first bank End region */
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return BCM_NS3_MEM_END;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ int dram_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static u32 mx53_dram_size[2];
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
/*
|
||||
* WARNING: We must override get_effective_memsize() function here
|
||||
|
||||
@ -334,7 +334,7 @@ static void set_fdt_addr(void)
|
||||
/*
|
||||
* Prevent relocation from stomping on a firmware provided FDT blob.
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
if ((gd->ram_top - fw_dtb_pointer) > SZ_64M)
|
||||
return gd->ram_top;
|
||||
|
||||
@ -59,7 +59,7 @@ int dram_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
#ifdef CONFIG_PHYS_64BIT
|
||||
/* Limit RAM used by U-Boot to the DDR low region */
|
||||
|
||||
@ -55,7 +55,7 @@ int dram_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
#ifdef CONFIG_PHYS_64BIT
|
||||
/* Limit RAM used by U-Boot to the DDR low region */
|
||||
|
||||
@ -43,7 +43,7 @@ int dram_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
#ifdef CONFIG_PHYS_64BIT
|
||||
/* Limit RAM used by U-Boot to the DDR low region */
|
||||
|
||||
@ -37,7 +37,7 @@ int dram_init(void)
|
||||
/*
|
||||
* Avoid relocated U-Boot clash with Linux reserved-memory on 512 MB SoM
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
return 0x9C000000;
|
||||
}
|
||||
|
||||
@ -627,7 +627,7 @@ int embedded_dtb_select(void)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_LMB)
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
phys_size_t size;
|
||||
phys_addr_t reg;
|
||||
|
||||
@ -409,7 +409,7 @@ static int distro_efi_read_bootflow(struct udevice *dev, struct bootflow *bflow)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int distro_efi_boot(struct udevice *dev, struct bootflow *bflow)
|
||||
static int distro_efi_boot(struct udevice *dev, struct bootflow *bflow)
|
||||
{
|
||||
ulong kernel, fdt;
|
||||
char cmd[50];
|
||||
|
||||
@ -330,7 +330,7 @@ __weak int mach_cpu_init(void)
|
||||
}
|
||||
|
||||
/* Get the top of usable RAM */
|
||||
__weak phys_size_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
__weak phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
#if defined(CFG_SYS_SDRAM_BASE) && CFG_SYS_SDRAM_BASE > 0
|
||||
/*
|
||||
|
||||
@ -15,6 +15,7 @@ U-Boot API documentation
|
||||
lmb
|
||||
logging
|
||||
nvmem
|
||||
part
|
||||
pinctrl
|
||||
rng
|
||||
sandbox
|
||||
|
||||
6
doc/api/part.rst
Normal file
6
doc/api/part.rst
Normal file
@ -0,0 +1,6 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
Partition API
|
||||
=============
|
||||
|
||||
.. kernel-doc:: include/part.h
|
||||
@ -1,6 +1,6 @@
|
||||
alabaster==0.7.12
|
||||
Babel==2.9.1
|
||||
certifi==2023.5.7
|
||||
certifi==2023.07.22
|
||||
charset-normalizer==2.0.12
|
||||
docutils==0.16
|
||||
idna==3.3
|
||||
|
||||
@ -296,15 +296,20 @@ int checkboard(void);
|
||||
int show_board_info(void);
|
||||
|
||||
/**
|
||||
* Get the uppermost pointer that is valid to access
|
||||
* board_get_usable_ram_top() - get uppermost address for U-Boot relocation
|
||||
*
|
||||
* Some systems may not map all of their address space. This function allows
|
||||
* boards to indicate what their highest support pointer value is for DRAM
|
||||
* access.
|
||||
* Some systems have reserved memory areas in high memory. By implementing this
|
||||
* function boards can indicate the highest address value to be used when
|
||||
* relocating U-Boot. The returned address is exclusive (i.e. 1 byte above the
|
||||
* last usable address).
|
||||
*
|
||||
* @param total_size Size of U-Boot (unused?)
|
||||
* Due to overflow on systems with 32bit phys_addr_t a value 0 is used instead
|
||||
* of 4GiB.
|
||||
*
|
||||
* @total_size: monitor length in bytes (size of U-Boot code)
|
||||
* Return: uppermost address for U-Boot relocation
|
||||
*/
|
||||
phys_size_t board_get_usable_ram_top(phys_size_t total_size);
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size);
|
||||
|
||||
int board_early_init_f(void);
|
||||
|
||||
|
||||
@ -116,16 +116,31 @@ phys_addr_t __lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align,
|
||||
phys_addr_t max_addr);
|
||||
phys_addr_t lmb_alloc_addr(struct lmb *lmb, phys_addr_t base, phys_size_t size);
|
||||
phys_size_t lmb_get_free_size(struct lmb *lmb, phys_addr_t addr);
|
||||
int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr);
|
||||
|
||||
/**
|
||||
* lmb_is_reserved_flags - test if tha address is in reserved region with a bitfield flag
|
||||
* lmb_is_reserved() - test if address is in reserved region
|
||||
*
|
||||
* The function checks if a reserved region comprising @addr exists.
|
||||
*
|
||||
* @lmb: the logical memory block struct
|
||||
* @addr: address to be tested
|
||||
* @flags: flags bitfied to be tested
|
||||
* Return: if not reserved or reserved without the requested flag else 1
|
||||
* Return: 1 if reservation exists, 0 otherwise
|
||||
*/
|
||||
int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr);
|
||||
|
||||
/**
|
||||
* lmb_is_reserved_flags() - test if address is in reserved region with flag bits set
|
||||
*
|
||||
* The function checks if a reserved region comprising @addr exists which has
|
||||
* all flag bits set which are set in @flags.
|
||||
*
|
||||
* @lmb: the logical memory block struct
|
||||
* @addr: address to be tested
|
||||
* @flags: bitmap with bits to be tested
|
||||
* Return: 1 if matching reservation exists, 0 otherwise
|
||||
*/
|
||||
int lmb_is_reserved_flags(struct lmb *lmb, phys_addr_t addr, int flags);
|
||||
|
||||
long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size);
|
||||
|
||||
void lmb_dump_all(struct lmb *lmb);
|
||||
|
||||
210
include/part.h
210
include/part.h
@ -98,8 +98,8 @@ struct disk_part {
|
||||
* @ifname: Interface name (e.g. "ide", "scsi")
|
||||
* @dev: Device number (0 for first device on that interface, 1 for
|
||||
* second, etc.
|
||||
* Return: pointer to the block device, or NULL if not available, or an
|
||||
* error occurred.
|
||||
* Return:
|
||||
* pointer to the block device, or NULL if not available, or an error occurred.
|
||||
*/
|
||||
struct blk_desc *blk_get_dev(const char *ifname, int dev);
|
||||
|
||||
@ -128,6 +128,10 @@ int part_get_info(struct blk_desc *dev_desc, int part,
|
||||
/**
|
||||
* part_get_info_whole_disk() - get partition info for the special case of
|
||||
* a partition occupying the entire disk.
|
||||
*
|
||||
* @dev_desc: block device descriptor
|
||||
* @info: returned partition information
|
||||
* Return: 0 on success
|
||||
*/
|
||||
int part_get_info_whole_disk(struct blk_desc *dev_desc,
|
||||
struct disk_partition *info);
|
||||
@ -170,15 +174,18 @@ int blk_get_device_by_str(const char *ifname, const char *dev_str,
|
||||
* This calls blk_get_device_by_str() to look up a device. It also looks up
|
||||
* a partition and returns information about it.
|
||||
*
|
||||
* @dev_part_str is in the format:
|
||||
* <dev>.<hw_part>:<part> where <dev> is the device number,
|
||||
* <hw_part> is the optional hardware partition number and
|
||||
* <part> is the partition number
|
||||
* @dev_part_str is in the format <dev>.<hw_part>:<part> where
|
||||
*
|
||||
* If ifname is "hostfs" then this function returns the sandbox host block
|
||||
* * <dev> is the device number,
|
||||
*
|
||||
* * <hw_part> is the optional hardware partition number and
|
||||
*
|
||||
* * <part> is the partition number.
|
||||
*
|
||||
* If @ifname is "hostfs", then this function returns the sandbox host block
|
||||
* device.
|
||||
*
|
||||
* If ifname is ubi, then this function returns 0, with @info set to a
|
||||
* If @ifname is "ubi", then this function returns 0, with @info set to a
|
||||
* special UBI device.
|
||||
*
|
||||
* If @dev_part_str is NULL or empty or "-", then this function looks up
|
||||
@ -187,13 +194,13 @@ int blk_get_device_by_str(const char *ifname, const char *dev_str,
|
||||
* If the partition string is empty then the first partition is used. If the
|
||||
* partition string is "auto" then the first bootable partition is used.
|
||||
*
|
||||
* @ifname: Interface name (e.g. "ide", "scsi")
|
||||
* @ifname: Interface name (e.g. "ide", "scsi")
|
||||
* @dev_part_str: Device and partition string
|
||||
* @dev_desc: Returns a pointer to the block device on success
|
||||
* @info: Returns partition information
|
||||
* @dev_desc: Returns a pointer to the block device on success
|
||||
* @info: Returns partition information
|
||||
* @allow_whole_dev: true to allow the user to select partition 0
|
||||
* (which means the whole device), false to require a valid
|
||||
* partition number >= 1
|
||||
* (which means the whole device), false to require a valid
|
||||
* partition number >= 1
|
||||
* Return: partition number, or -1 on error
|
||||
*
|
||||
*/
|
||||
@ -205,18 +212,20 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
|
||||
* part_get_info_by_name() - Search for a partition by name
|
||||
* among all available registered partitions
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param gpt_name - the specified table entry name
|
||||
* @param info - returns the disk partition info
|
||||
* @dev_desc: block device descriptor
|
||||
* @name: the specified table entry name
|
||||
* @info: returns the disk partition info
|
||||
*
|
||||
* Return: - the partition number on match (starting on 1), -1 on no match,
|
||||
* Return: the partition number on match (starting on 1), -1 on no match,
|
||||
* otherwise error
|
||||
*/
|
||||
int part_get_info_by_name(struct blk_desc *dev_desc,
|
||||
const char *name, struct disk_partition *info);
|
||||
|
||||
/**
|
||||
* Get partition info from dev number + part name, or dev number + part number.
|
||||
* part_get_info_by_dev_and_name_or_num() - Get partition info from dev number
|
||||
* and part name, or dev number and
|
||||
* part number.
|
||||
*
|
||||
* Parse a device number and partition description (either name or number)
|
||||
* in the form of device number plus partition name separated by a "#"
|
||||
@ -225,14 +234,14 @@ int part_get_info_by_name(struct blk_desc *dev_desc,
|
||||
* partition descriptions for a given interface. If the partition is found, sets
|
||||
* dev_desc and part_info accordingly with the information of the partition.
|
||||
*
|
||||
* @param[in] dev_iface Device interface
|
||||
* @param[in] dev_part_str Input partition description, like "0#misc" or "0:1"
|
||||
* @param[out] dev_desc Place to store the device description pointer
|
||||
* @param[out] part_info Place to store the partition information
|
||||
* @param[in] allow_whole_dev true to allow the user to select partition 0
|
||||
* (which means the whole device), false to require a valid
|
||||
* partition number >= 1
|
||||
* Return: the partition number on success, or negative errno on error
|
||||
* @dev_iface: Device interface
|
||||
* @dev_part_str: Input partition description, like "0#misc" or "0:1"
|
||||
* @dev_desc: Place to store the device description pointer
|
||||
* @part_info: Place to store the partition information
|
||||
* @allow_whole_dev: true to allow the user to select partition 0
|
||||
* (which means the whole device), false to require a valid
|
||||
* partition number >= 1
|
||||
* Return: the partition number on success, or negative errno on error
|
||||
*/
|
||||
int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
|
||||
const char *dev_part_str,
|
||||
@ -322,7 +331,7 @@ int part_create_block_devices(struct udevice *blk_dev);
|
||||
* @start: Start block number to read in the partition (0=first)
|
||||
* @blkcnt: Number of blocks to read
|
||||
* @buffer: Destination buffer for data read
|
||||
* Returns: number of blocks read, or -ve error number (see the
|
||||
* Return: number of blocks read, or -ve error number (see the
|
||||
* IS_ERR_VALUE() macro
|
||||
*/
|
||||
ulong disk_blk_read(struct udevice *dev, lbaint_t start, lbaint_t blkcnt,
|
||||
@ -335,7 +344,7 @@ ulong disk_blk_read(struct udevice *dev, lbaint_t start, lbaint_t blkcnt,
|
||||
* @start: Start block number to write in the partition (0=first)
|
||||
* @blkcnt: Number of blocks to write
|
||||
* @buffer: Source buffer for data to write
|
||||
* Returns: number of blocks written, or -ve error number (see the
|
||||
* Return: number of blocks written, or -ve error number (see the
|
||||
* IS_ERR_VALUE() macro
|
||||
*/
|
||||
ulong disk_blk_write(struct udevice *dev, lbaint_t start, lbaint_t blkcnt,
|
||||
@ -347,7 +356,7 @@ ulong disk_blk_write(struct udevice *dev, lbaint_t start, lbaint_t blkcnt,
|
||||
* @dev: Device to (partially) erase (UCLASS_PARTITION)
|
||||
* @start: Start block number to erase in the partition (0=first)
|
||||
* @blkcnt: Number of blocks to erase
|
||||
* Returns: number of blocks erased, or -ve error number (see the
|
||||
* Return: number of blocks erased, or -ve error number (see the
|
||||
* IS_ERR_VALUE() macro
|
||||
*/
|
||||
ulong disk_blk_erase(struct udevice *dev, lbaint_t start, lbaint_t blkcnt);
|
||||
@ -369,35 +378,40 @@ ulong disk_blk_erase(struct udevice *dev, lbaint_t start, lbaint_t blkcnt);
|
||||
#define part_get_info_ptr(x) x
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* struct part_driver - partition driver
|
||||
*/
|
||||
struct part_driver {
|
||||
/** @name: partition name */
|
||||
const char *name;
|
||||
/** @part_type: (MBR) partition type */
|
||||
int part_type;
|
||||
const int max_entries; /* maximum number of entries to search */
|
||||
|
||||
/** @max_entries: maximum number of partition table entries */
|
||||
const int max_entries;
|
||||
/**
|
||||
* get_info() - Get information about a partition
|
||||
* @get_info: Get information about a partition
|
||||
*
|
||||
* @dev_desc: Block device descriptor
|
||||
* @part: Partition number (1 = first)
|
||||
* @info: Returns partition information
|
||||
* @get_info.dev_desc: Block device descriptor
|
||||
* @get_info.part: Partition number (1 = first)
|
||||
* @get_info.info: Returns partition information
|
||||
*/
|
||||
int (*get_info)(struct blk_desc *dev_desc, int part,
|
||||
struct disk_partition *info);
|
||||
|
||||
/**
|
||||
* print() - Print partition information
|
||||
* @print: Print partition information
|
||||
*
|
||||
* @dev_desc: Block device descriptor
|
||||
* @print.dev_desc: Block device descriptor
|
||||
*/
|
||||
void (*print)(struct blk_desc *dev_desc);
|
||||
|
||||
/**
|
||||
* test() - Test if a device contains this partition type
|
||||
* @test: Test if a device contains this partition type
|
||||
*
|
||||
* @dev_desc: Block device descriptor
|
||||
* @return 0 if the block device appears to contain this partition
|
||||
* type, -ve if not
|
||||
* @test.dev_desc: Block device descriptor
|
||||
* @test.Return:
|
||||
* 0 if the block device appears to contain this partition type,
|
||||
* -ve if not
|
||||
*/
|
||||
int (*test)(struct blk_desc *dev_desc);
|
||||
};
|
||||
@ -413,52 +427,52 @@ struct part_driver {
|
||||
/**
|
||||
* write_gpt_table() - Write the GUID Partition Table to disk
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param gpt_h - pointer to GPT header representation
|
||||
* @param gpt_e - pointer to GPT partition table entries
|
||||
* @dev_desc: block device descriptor
|
||||
* @gpt_h: pointer to GPT header representation
|
||||
* @gpt_e: pointer to GPT partition table entries
|
||||
*
|
||||
* Return: - zero on success, otherwise error
|
||||
* Return: zero on success, otherwise error
|
||||
*/
|
||||
int write_gpt_table(struct blk_desc *dev_desc,
|
||||
gpt_header *gpt_h, gpt_entry *gpt_e);
|
||||
|
||||
/**
|
||||
* gpt_fill_pte(): Fill the GPT partition table entry
|
||||
* gpt_fill_pte() - Fill the GPT partition table entry
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param gpt_h - GPT header representation
|
||||
* @param gpt_e - GPT partition table entries
|
||||
* @param partitions - list of partitions
|
||||
* @param parts - number of partitions
|
||||
* @dev_desc: block device descriptor
|
||||
* @gpt_h: GPT header representation
|
||||
* @gpt_e: GPT partition table entries
|
||||
* @partitions: list of partitions
|
||||
* @parts: number of partitions
|
||||
*
|
||||
* Return: zero on success
|
||||
* Return: zero on success
|
||||
*/
|
||||
int gpt_fill_pte(struct blk_desc *dev_desc,
|
||||
gpt_header *gpt_h, gpt_entry *gpt_e,
|
||||
struct disk_partition *partitions, int parts);
|
||||
|
||||
/**
|
||||
* gpt_fill_header(): Fill the GPT header
|
||||
* gpt_fill_header() - Fill the GPT header
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param gpt_h - GPT header representation
|
||||
* @param str_guid - disk guid string representation
|
||||
* @param parts_count - number of partitions
|
||||
* @dev_desc: block device descriptor
|
||||
* @gpt_h: GPT header representation
|
||||
* @str_guid: disk guid string representation
|
||||
* @parts_count: number of partitions
|
||||
*
|
||||
* Return: - error on str_guid conversion error
|
||||
* Return: error on str_guid conversion error
|
||||
*/
|
||||
int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
|
||||
char *str_guid, int parts_count);
|
||||
|
||||
/**
|
||||
* gpt_restore(): Restore GPT partition table
|
||||
* gpt_restore() - Restore GPT partition table
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param str_disk_guid - disk GUID
|
||||
* @param partitions - list of partitions
|
||||
* @param parts - number of partitions
|
||||
* @dev_desc: block device descriptor
|
||||
* @str_disk_guid: disk GUID
|
||||
* @partitions: list of partitions
|
||||
* @parts_count: number of partitions
|
||||
*
|
||||
* Return: zero on success
|
||||
* Return: 0 on success
|
||||
*/
|
||||
int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
|
||||
struct disk_partition *partitions, const int parts_count);
|
||||
@ -466,34 +480,34 @@ int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
|
||||
/**
|
||||
* is_valid_gpt_buf() - Ensure that the Primary GPT information is valid
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param buf - buffer which contains the MBR and Primary GPT info
|
||||
* @dev_desc: block device descriptor
|
||||
* @buf: buffer which contains the MBR and Primary GPT info
|
||||
*
|
||||
* Return: - '0' on success, otherwise error
|
||||
* Return: 0 on success, otherwise error
|
||||
*/
|
||||
int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf);
|
||||
|
||||
/**
|
||||
* write_mbr_and_gpt_partitions() - write MBR, Primary GPT and Backup GPT
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param buf - buffer which contains the MBR and Primary GPT info
|
||||
* @dev_desc: block device descriptor
|
||||
* @buf: buffer which contains the MBR and Primary GPT info
|
||||
*
|
||||
* Return: - '0' on success, otherwise error
|
||||
* Return: 0 on success, otherwise error
|
||||
*/
|
||||
int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf);
|
||||
|
||||
/**
|
||||
* gpt_verify_headers() - Function to read and CRC32 check of the GPT's header
|
||||
* gpt_verify_headers() - Read and check CRC32 of the GPT's header
|
||||
* and partition table entries (PTE)
|
||||
*
|
||||
* As a side effect if sets gpt_head and gpt_pte so they point to GPT data.
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param gpt_head - pointer to GPT header data read from medium
|
||||
* @param gpt_pte - pointer to GPT partition table enties read from medium
|
||||
* @dev_desc: block device descriptor
|
||||
* @gpt_head: pointer to GPT header data read from medium
|
||||
* @gpt_pte: pointer to GPT partition table enties read from medium
|
||||
*
|
||||
* Return: - '0' on success, otherwise error
|
||||
* Return: 0 on success, otherwise error
|
||||
*/
|
||||
int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
|
||||
gpt_entry **gpt_pte);
|
||||
@ -502,9 +516,9 @@ int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
|
||||
* gpt_repair_headers() - Function to repair the GPT's header
|
||||
* and partition table entries (PTE)
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @dev_desc: block device descriptor
|
||||
*
|
||||
* Return: - '0' on success, otherwise error
|
||||
* Return: 0 on success, otherwise error
|
||||
*/
|
||||
int gpt_repair_headers(struct blk_desc *dev_desc);
|
||||
|
||||
@ -516,13 +530,13 @@ int gpt_repair_headers(struct blk_desc *dev_desc);
|
||||
* provided in '$partitions' environment variable. Specificially, name, start
|
||||
* and size of the partition is checked.
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param partitions - partition data read from '$partitions' env variable
|
||||
* @param parts - number of partitions read from '$partitions' env variable
|
||||
* @param gpt_head - pointer to GPT header data read from medium
|
||||
* @param gpt_pte - pointer to GPT partition table enties read from medium
|
||||
* @dev_desc: block device descriptor
|
||||
* @partitions: partition data read from '$partitions' env variable
|
||||
* @parts: number of partitions read from '$partitions' env variable
|
||||
* @gpt_head: pointer to GPT header data read from medium
|
||||
* @gpt_pte: pointer to GPT partition table enties read from medium
|
||||
*
|
||||
* Return: - '0' on success, otherwise error
|
||||
* Return: 0 on success, otherwise error
|
||||
*/
|
||||
int gpt_verify_partitions(struct blk_desc *dev_desc,
|
||||
struct disk_partition *partitions, int parts,
|
||||
@ -530,15 +544,15 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
|
||||
|
||||
|
||||
/**
|
||||
* get_disk_guid() - Function to read the GUID string from a device's GPT
|
||||
* get_disk_guid() - Read the GUID string from a device's GPT
|
||||
*
|
||||
* This function reads the GUID string from a block device whose descriptor
|
||||
* is provided.
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param guid - pre-allocated string in which to return the GUID
|
||||
* @dev_desc: block device descriptor
|
||||
* @guid: pre-allocated string in which to return the GUID
|
||||
*
|
||||
* Return: - '0' on success, otherwise error
|
||||
* Return: 0 on success, otherwise error
|
||||
*/
|
||||
int get_disk_guid(struct blk_desc *dev_desc, char *guid);
|
||||
|
||||
@ -548,19 +562,19 @@ int get_disk_guid(struct blk_desc *dev_desc, char *guid);
|
||||
/**
|
||||
* is_valid_dos_buf() - Ensure that a DOS MBR image is valid
|
||||
*
|
||||
* @param buf - buffer which contains the MBR
|
||||
* @buf: buffer which contains the MBR
|
||||
*
|
||||
* Return: - '0' on success, otherwise error
|
||||
* Return: 0 on success, otherwise error
|
||||
*/
|
||||
int is_valid_dos_buf(void *buf);
|
||||
|
||||
/**
|
||||
* write_mbr_sector() - write DOS MBR
|
||||
*
|
||||
* @param dev_desc - block device descriptor
|
||||
* @param buf - buffer which contains the MBR
|
||||
* @dev_desc: block device descriptor
|
||||
* @buf: buffer which contains the MBR
|
||||
*
|
||||
* Return: - '0' on success, otherwise error
|
||||
* Return: 0 on success, otherwise error
|
||||
*/
|
||||
int write_mbr_sector(struct blk_desc *dev_desc, void *buf);
|
||||
|
||||
@ -575,7 +589,7 @@ int layout_mbr_partitions(struct disk_partition *p, int count,
|
||||
/**
|
||||
* part_driver_get_count() - get partition driver count
|
||||
*
|
||||
* Return: - number of partition drivers
|
||||
* Return: number of partition drivers
|
||||
*/
|
||||
static inline int part_driver_get_count(void)
|
||||
{
|
||||
@ -585,7 +599,7 @@ static inline int part_driver_get_count(void)
|
||||
/**
|
||||
* part_driver_get_first() - get first partition driver
|
||||
*
|
||||
* Return: - pointer to first partition driver on success, otherwise NULL
|
||||
* Return: pointer to first partition driver on success, otherwise NULL
|
||||
*/
|
||||
static inline struct part_driver *part_driver_get_first(void)
|
||||
{
|
||||
@ -595,9 +609,9 @@ static inline struct part_driver *part_driver_get_first(void)
|
||||
/**
|
||||
* part_get_type_by_name() - Get partition type by name
|
||||
*
|
||||
* @name: Name of partition type to look up (not case-sensitive)
|
||||
* Returns: Corresponding partition type (PART_TYPE_...) or PART_TYPE_UNKNOWN if
|
||||
* not known
|
||||
* @name: Name of partition type to look up (not case-sensitive)
|
||||
* Return:
|
||||
* Corresponding partition type (PART\_TYPE\_...) or PART\_TYPE\_UNKNOWN
|
||||
*/
|
||||
int part_get_type_by_name(const char *name);
|
||||
|
||||
|
||||
@ -877,7 +877,7 @@ efi_status_t efi_add_conventional_memory_map(u64 ram_start, u64 ram_end,
|
||||
*/
|
||||
__weak void efi_add_known_memory(void)
|
||||
{
|
||||
u64 ram_top = board_get_usable_ram_top(0) & ~EFI_PAGE_MASK;
|
||||
u64 ram_top = gd->ram_top & ~EFI_PAGE_MASK;
|
||||
int i;
|
||||
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user