linux/drivers/mtd/parsers/qcomsmempart.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Qualcomm SMEM NAND flash partition parser
 *
 * Copyright (C) 2020, Linaro Ltd.
 */

#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/slab.h>
#include <linux/soc/qcom/smem.h>

#define SMEM_AARM_PARTITION_TABLE
#define SMEM_APPS

#define SMEM_FLASH_PART_MAGIC1
#define SMEM_FLASH_PART_MAGIC2
#define SMEM_FLASH_PTABLE_V3
#define SMEM_FLASH_PTABLE_V4
#define SMEM_FLASH_PTABLE_MAX_PARTS_V3
#define SMEM_FLASH_PTABLE_MAX_PARTS_V4
#define SMEM_FLASH_PTABLE_HDR_LEN
#define SMEM_FLASH_PTABLE_NAME_SIZE

/**
 * struct smem_flash_pentry - SMEM Flash partition entry
 * @name: Name of the partition
 * @offset: Offset in blocks
 * @length: Length of the partition in blocks
 * @attr: Flags for this partition
 */
struct smem_flash_pentry {} __packed __aligned();

/**
 * struct smem_flash_ptable - SMEM Flash partition table
 * @magic1: Partition table Magic 1
 * @magic2: Partition table Magic 2
 * @version: Partition table version
 * @numparts: Number of partitions in this ptable
 * @pentry: Flash partition entries belonging to this ptable
 */
struct smem_flash_ptable {} __packed __aligned();

static int parse_qcomsmem_part(struct mtd_info *mtd,
			       const struct mtd_partition **pparts,
			       struct mtd_part_parser_data *data)
{}

static void parse_qcomsmem_cleanup(const struct mtd_partition *pparts,
				   int nr_parts)
{}

static const struct of_device_id qcomsmem_of_match_table[] =;
MODULE_DEVICE_TABLE(of, qcomsmem_of_match_table);

static struct mtd_part_parser mtd_parser_qcomsmem =;
module_mtd_part_parser();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();