mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
4549e789c1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have multiple licenses (in these cases, dual license) declared in the SPDX-License-Identifier tag. In this case we change from listing "LICENSE-A LICENSE-B" or "LICENSE-A or LICENSE-B" or "(LICENSE-A OR LICENSE-B)" to "LICENSE-A OR LICENSE-B" as per the Linux Kernel style document. Note that parenthesis are allowed so when they were used before we continue to use them. Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com>
89 lines
2.7 KiB
C
89 lines
2.7 KiB
C
/* SPDX-License-Identifier: GPL 2.0+ OR BSD-3-Clause */
|
|
/*
|
|
* Copyright (c) Thomas Gleixner <tglx@linutronix.de>
|
|
*/
|
|
#ifndef __UBOOT_UBISPL_H
|
|
#define __UBOOT_UBISPL_H
|
|
|
|
/*
|
|
* The following CONFIG options are relevant for UBISPL
|
|
*
|
|
* #define CONFIG_SPL_UBI_MAX_VOL_LEBS 256
|
|
*
|
|
* Defines the maximum number of logical erase blocks per loadable
|
|
* (static) volume to size the ubispl internal arrays.
|
|
*
|
|
* #define CONFIG_SPL_UBI_MAX_PEB_SIZE (256*1024)
|
|
*
|
|
* Defines the maximum physical erase block size to size the fastmap
|
|
* buffer for ubispl.
|
|
*
|
|
* #define CONFIG_SPL_UBI_MAX_PEBS 4096
|
|
*
|
|
* Define the maximum number of physical erase blocks to size the
|
|
* ubispl internal arrays.
|
|
*
|
|
* #define CONFIG_SPL_UBI_VOL_IDS 8
|
|
*
|
|
* Defines the maximum number of volumes in which UBISPL is
|
|
* interested. Limits the amount of memory for the scan data and
|
|
* speeds up the scan process as we simply ignore stuff which we dont
|
|
* want to load from the SPL anyway. So the volumes which can be
|
|
* loaded in the above example are ids 0 - 7
|
|
*/
|
|
|
|
/*
|
|
* The struct definition is in drivers/mtd/ubispl/ubispl.h. It does
|
|
* not fit into the BSS due to the large buffer requirement of the
|
|
* upstream fastmap code. So the caller of ubispl_load_volumes needs
|
|
* to hand in a pointer to a free memory area where ubispl will place
|
|
* its data. The area is not required to be initialized.
|
|
*/
|
|
struct ubi_scan_info;
|
|
|
|
typedef int (*ubispl_read_flash)(int pnum, int offset, int len, void *dst);
|
|
|
|
/**
|
|
* struct ubispl_info - description structure for fast ubi scan
|
|
* @ubi: Pointer to memory space for ubi scan info structure
|
|
* @peb_size: Physical erase block size
|
|
* @vid_offset: Offset of the VID header
|
|
* @leb_start: Start of the logical erase block, i.e. offset of data
|
|
* @peb_count: Number of physical erase blocks in the UBI FLASH area
|
|
* aka MTD partition.
|
|
* @peb_offset: Offset of PEB0 in the UBI FLASH area (aka MTD partition)
|
|
* to the real start of the FLASH in erase blocks.
|
|
* @fastmap: Enable fastmap attachment
|
|
* @read: Read function to access the flash
|
|
*/
|
|
struct ubispl_info {
|
|
struct ubi_scan_info *ubi;
|
|
u32 peb_size;
|
|
u32 vid_offset;
|
|
u32 leb_start;
|
|
u32 peb_count;
|
|
u32 peb_offset;
|
|
int fastmap;
|
|
ubispl_read_flash read;
|
|
};
|
|
|
|
/**
|
|
* struct ubispl_load - structure to describe a volume to load
|
|
* @vol_id: Volume id
|
|
* @load_addr: Load address of the volume
|
|
*/
|
|
struct ubispl_load {
|
|
int vol_id;
|
|
void *load_addr;
|
|
};
|
|
|
|
/**
|
|
* ubispl_load_volumes - Scan flash and load volumes
|
|
* @info: Pointer to the ubi scan info structure
|
|
* @lovls: Pointer to array of volumes to load
|
|
* @nrvols: Array size of @lovls
|
|
*/
|
|
int ubispl_load_volumes(struct ubispl_info *info,
|
|
struct ubispl_load *lvols, int nrvols);
|
|
|
|
#endif
|