blob: b5fd26c5274291a09430d6066100839fdd0c9560 [file] [log] [blame]
Feng Chenee8403d2024-01-03 14:13:40 +08001/*
2 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
3 * @Date: 2024-01-03 10:39:59
4 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
5 * @LastEditTime: 2024-01-03 10:55:31
6 * @FilePath: \v2023\include\amlogic\aml_mtd.h
7 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8 */
Bo Lv72d0e902023-01-02 14:27:34 +00009/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
10/*
11 * Copyright (c) 2019 Amlogic, Inc. All rights reserved.
12 */
13
14#ifndef __AMLMTD_H_
15#define __AMLMTD_H_
Bo Lv72d0e902023-01-02 14:27:34 +000016
Bo Lv72d0e902023-01-02 14:27:34 +000017#define BOOT_LOADER "bootloader"
18#define BOOT_BL2 "bl2"
19#define BOOT_SPL "spl"
20#define BOOT_BL2E "bl2e"
21#define BOOT_BL2X "bl2x"
22#define BOOT_DDRFIP "ddrfip"
23#define BOOT_DEVFIP "devfip"
24#define BOOT_TPL "tpl"
25#define BOOT_FIP "fip"
26#define MAX_MTD_CNT 2
27
zhikui.cui3b92f382024-08-20 05:56:50 +000028struct mtd_info;
29struct mtd_partition;
Feng Chenee8403d2024-01-03 14:13:40 +080030extern struct mtd_partition *get_aml_mtd_partition(void);
31extern int get_aml_partition_count(void);
zhikui.cui1b35b7f2024-08-12 06:01:40 +000032extern struct part_info *get_aml_mtdpart_by_index(struct mtd_info *master,
33 int idx);
Feng Chenee8403d2024-01-03 14:13:40 +080034
zhikui.cui3b92f382024-08-20 05:56:50 +000035int mtd_add_normal_partitions(struct mtd_info *mtd,
36 const struct mtd_partition *parts,
37 int nbparts, int normal_offset);
38int mtd_add_partitions(struct mtd_info *mtd,
39 const struct mtd_partition *parts,
40 int nbparts);
41int mtd_add_boot_partitions(struct mtd_info *mtd,
42 struct mtd_partition *parts,
43 int nparts);
44int mtd_get_boot_parts_num(void);
45int mtd_get_boot_partition(struct mtd_info *mtd,
46 struct mtd_partition *parts,
47 uint8_t index,
48 uint8_t cnt);
49uint64_t mtd_get_normal_part_offset(struct mtd_info *mtd);
Bo Lv72d0e902023-01-02 14:27:34 +000050#endif/* __AMLMTD_H_ */