Files
luban-lite-t3e-pro/bsp/artinchip/drv/spinand/spinand_parts.h

46 lines
984 B
C
Raw Normal View History

2023-08-30 16:21:18 +08:00
/*
2024-09-03 11:16:08 +08:00
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
2023-08-30 16:21:18 +08:00
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __SPI_NAND_PARTS_H__
#define __SPI_NAND_PARTS_H__
#define MAX_MTD_NAME 32
2024-01-27 08:47:24 +08:00
#define MAX_NAND_NAME 32
struct nftl_volume {
char name[MAX_NAND_NAME];
int vol_type;
int size;
struct nftl_volume *next;
};
struct nftl_mtd {
char name[MAX_NAND_NAME];
struct nftl_mtd *next;
struct nftl_volume *vols;
};
enum part_attr {
PART_ATTR_MTD = 0,
PART_ATTR_NFTL,
};
2023-08-30 16:21:18 +08:00
struct mtd_partition {
2024-01-27 08:47:24 +08:00
char name[MAX_MTD_NAME];
uint32_t start;
uint32_t size;
struct mtd_partition *next;
enum part_attr attr;
2023-08-30 16:21:18 +08:00
};
2024-09-03 11:16:08 +08:00
struct mtd_partition *mtd_parts_parse(char *parts, uint32_t spi_bus);
2023-08-30 16:21:18 +08:00
void mtd_parts_free(struct mtd_partition *head);
2024-01-27 08:47:24 +08:00
struct nftl_mtd *build_nftl_list(char *nftlvols);
void free_nftl_list(struct nftl_mtd *nftl);
uint8_t partition_nftl_is_exist(char *mtd_name, struct nftl_mtd *nftl_list);
2023-08-30 16:21:18 +08:00
#endif /* __SPI_NAND_PARTS_H__ */