Skip to content

Reorganize defines for firmware updates on Realtek RTL8195AM #5473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions targets/TARGET_Realtek/TARGET_AMEBA/ota_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 21 additions & 1 deletion targets/TARGET_Realtek/TARGET_AMEBA/ota_api.h
Original file line number Diff line number Diff line change
@@ -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);
Expand Down