RDA支持的FLASH型号列表“drv_spi_flash_table.h”
常用型号:
KH/MX 3206E KH/MX 3236F
华邦4M:W25Q32
关于写保护:
例如博雅FLASH BY25Q32BS 4M 写保护区域 62/63th。
配置文件如上图:
1、蓝色箭头“2”代表要写两个状态寄存器。
3、红色箭头表示,第一个状态寄存器的值。
3、粉色箭头表示,第二个状态寄存器的值。
SPEC 定义的状态寄存器如下:
SPEC:写保护配置如下:
RR8501.BIN结构
RR8501不同的MODEL经过压缩和加密
code.tmp.bin未经过加密,分析code.tmp.bin
UE打开
20 00 00 10 00 00 00 00 00 D0 07 00 F0 7B 01 00
BootSize = 0x07D000
SHARE DATA读写
tv_SaveFlashSetting()
mergedir/code.tmp.bin 压缩未加密文件的FLASH文件
mergedir/sfs/nvm.bin shareData数据文件,未加密、未压缩
数据克隆:DATA/ALL
APP_Clone_Backup_SystemData_To_USBBackup(CV_FM_DATA)
APP_Clone_Backup_FlashData_To_USBBackup(DataType_t DataType) //BACKUP_ROMBIN_DATA
中间件的读写: Cmd_FlashWrite(UINT32 destAddr, UINT32 srcAddr, UINT32 size)
中间件模块读写: Cmd_FlashModuleUpdate(INT8 * moduleName, INT8 * updateData, UINT32 updateSize)
通过ID寻找地址: Cmd_GetAddrAndSizeByFlashID(UINT8 flashID, UINT32 *pFlashAddr, UINT32 *pFlashSize)
shareData的读写:tv_SaveFlashSetting()
读写FLASH: spi_write_flash
更新POWER键:update_option_ir_power_key
SFS底层调用:spi_dmawrite(__u32 dest,__u32 src,__u32 size)
信号量的操作:VD_SEM_TAKE/VD_SEM_GIVE
设备读:Cmd_NVMRead(UINT8 eNvmID, UINT8 u8Compress, UINT32 u32Count, UINT8 *pu8Buffer)
设备写:Cmd_NVMWrite(UINT8 eNvmID, UINT8 u8Compress, UINT32 u32Count, UINT8 *pu8Buffer)
组件装载:AL_Setting_Reload(AL_SETTING_HANDLE handle, al_uint8 user_pref_id) //user_pref_id=0xff 装载整个设备到cache
读取默认值到cache:AL_Setting_ReadDefault(AL_SETTING_HANDLE handle,al_uint8 user_pref_id, const al_void *data)
读写内存:AL_Setting_Read()/AL_Setting_Write()
写FLASH:AL_Setting_Store()
AL_Setting_Store(APP_Data_UserSetting_Handle(), 0xFF, 0, sizeof(APP_SETTING_Storage_t)); //将cache所有数据写到FLASH
drv_spi_flashalloc_external.h
#define SPI_CODEFLASH_BASEADDR 0xBC000000
#define SPI_DATAFLASH_BASEADDR 0xBF000000#define SPI_ADCDATA_FLASHID (0x01) //12k
#define SPI_KMFSHARE_FLASHID (0x02) //1k#define SPI_CIDATA_FLASHADDR (0x03) //need to remove#define SPI_RRTTABLE_FLASHADDR (0x04) //need to remove#define SPI_BOOTSHARE_FLASHID (0x05) //customer used #define SPI_NVMDATA_FLASHID (0x10)设备枚举
typedef enum
{ ENVMPurposeIDDatabaseDVBT, ENVMPurposeIDDatabaseDVBC, ENVMPurposeIDDatabaseDVBS, ENVMPurposeIDDatabaseSBTVD, ENVMPurposeIDDatabaseATV, ENVMPurposeIDSysSetting, ENVMPurposeIDSysSettingVariational, ENVMPurposeIDCVFMBackup,} ENVMPurposeID_t;组件枚举:
enum
{ SYS_SET_ID_VERSION,SYS_SET_ID_PICTURE,SYS_SET_ID_SOUND,SYS_SET_ID_CHANNEL,SYS_SET_ID_FEATURE,SYS_SET_ID_SETUP,SYS_SET_ID_MULTIMEDIA,SYS_SET_ID_TVINFO,SYS_SET_ID_USERINFO,SYS_SET_ID_SYSINFO,SYS_SET_ID_FACTUSER,SYS_SET_ID_FACTHOTEL,SYS_SET_ID_IRMAPTABLE,SYS_SET_ID_VARIATIONAL,MAX_BLOCKS_NUM};typedef enum
{
FM_ClearLock = 0,FM_DataBaseEx,FM_DataBaseIm,FM_PrevPage = 14,FM_HotelSetting_1_Max,} fm_HotelSetting_1_Param_t;enum FlashIndex
{ KMF_BROMSHAREDATA_FLASHINDEX =0, KMF_GAMMATABLE_FLASHINDEX, KMF_ADCCOLOR_FLASHINDEX, KMF_PICCOLORTMP_FLASHINDEX, KMF_PQDEFAULT_FLASHINDEX, KMF_MULTITABLE_FLASHINDEX, KMF_FLASHINDEXEND};app_clone_data.c
有壓 BootROM
有壓 Kernel沒壓 OUIMAINinfo有壓 Custable有壓 DefPanel有壓 GammaTable有壓 VIPTable有壓 CLUPTable沒壓 IR501沒壓 KeyPad有壓 Logo沒壓 EDID沒壓 HDCPKey沒壓 CIKey
IIC API: