Merge pull request #5473 from marcuschangarm/rtl8195am_ota

Reorganize defines for firmware updates on Realtek RTL8195AM
pull/5458/merge
Jimmy Brisson 2017-11-13 10:59:28 -06:00 committed by GitHub
commit f0912554d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 19 deletions

View File

@ -19,28 +19,11 @@
#include "mbed_wait_api.h"
#include "rtl8195a.h"
#include "ota_api.h"
#include "flash_ext.h"
#define FLASH_TOP 0x200000
#define FLASH_SECTOR_SIZE 0x1000
#define FLASH_SECTOR_MASK ~(FLASH_SECTOR_SIZE - 1)
#define OTA_REGION1 0x0b000
#define OTA_REGION2 0xc0000
#define TAG_OFS 0xc
#define VER_OFS 0x10
#define TAG_DOWNLOAD 0x81950001
#define TAG_VERIFIED 0x81950003
static flash_t flash_obj;
typedef struct imginfo_s {
uint32_t base;
uint32_t tag;
uint64_t ver;
} imginfo_t;
void OTA_GetImageInfo(imginfo_t *info)
{
uint32_t ver_hi, ver_lo;

View File

@ -1,10 +1,30 @@
#ifndef MBED_OTA_API_H
#define MBED_OTA_API_H
#define FLASH_TOP 0x200000
#define FLASH_SECTOR_SIZE 0x1000
#define FLASH_SECTOR_MASK ~(FLASH_SECTOR_SIZE - 1)
#define OTA_REGION1 0x0b000
#define OTA_REGION2 0xc0000
#define TAG_OFS 0xc
#define VER_OFS 0x10
#define TAG_DOWNLOAD 0x81950001
#define TAG_VERIFIED 0x81950003
typedef struct imginfo_s {
uint32_t base;
uint32_t tag;
uint64_t ver;
} imginfo_t;
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
extern void OTA_GetImageInfo(imginfo_t *info);
extern uint32_t OTA_GetBase(void);
extern uint32_t OTA_UpdateImage(uint32_t offset, uint32_t len, uint8_t *data);
extern uint32_t OTA_ReadImage(uint32_t offset, uint32_t len, uint8_t *data);
extern uint32_t OTA_MarkUpdateDone(void);