代码拉取完成,页面将自动刷新
同步操作将从 LicheePiNano/sunxi-tools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* drivers/block/sun4i_nand/nfd/mbr.h
*
* (C) Copyright 2007-2012
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef __MBR_H__
#define __MBR_H__
#include "types.h"
#define MBR_MAGIC "softw411"
#define MBR_VERSION 0x200
#define nand_part nand_part_a20
#define checkmbrs checkmbrs_a20
#define MAX_PART_COUNT 120 //max part count
#define MBR_COPY_NUM 4 //mbr backup count
#define MBR_START_ADDRESS 0x0 //mbr start address
#define MBR_SIZE 1024*16 //mbr size
#define MBR_RESERVED (MBR_SIZE - 32 - (MAX_PART_COUNT * 128)) //mbr reserved space
// extern struct __NandDriverGlobal_t NandDriverInfo;
// extern struct __NandStorageInfo_t NandStorageInfo;
#define DiskSize (SECTOR_CNT_OF_SINGLE_PAGE * PAGE_CNT_OF_PHY_BLK * BLOCK_CNT_OF_DIE * \
DIE_CNT_OF_CHIP * NandStorageInfo.ChipCnt / 1024 * DATA_BLK_CNT_OF_ZONE)
struct nand_disk{
unsigned long size;
unsigned long offset;
unsigned char type;
};
/* part info */
typedef struct nand_tag_PARTITION{
unsigned int addrhi; //起始地址, 以扇区为单位
unsigned int addrlo; //
unsigned int lenhi; //长度
unsigned int lenlo; //
unsigned char classname[16]; //次设备名
unsigned char name[16]; //主设备名
unsigned int user_type; //用户类型
unsigned int keydata; //关键数据,要求量产不丢失
unsigned int ro; //读写属性
unsigned char res[68]; //保留数据,匹配分区信息128字节
}__attribute__ ((packed))PARTITION;
/* mbr info */
typedef struct nand_tag_MBR{
unsigned int crc32; // crc 1k - 4
unsigned int version; // 版本信息, 0x00000100
unsigned char magic[8]; //"softw411"
unsigned int copy; //分数
unsigned int index; //第几个MBR备份
unsigned int PartCount; //分区个数
unsigned int stamp[1]; //对齐
PARTITION array[MAX_PART_COUNT]; //
unsigned char res[MBR_RESERVED];
}__attribute__ ((packed)) MBR;
int mbr2disks(struct nand_disk* disk_array);
#endif //__MBR_H__
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。