Skip to content

Commit f091255

Browse files
Merge pull request #5473 from marcuschangarm/rtl8195am_ota
Reorganize defines for firmware updates on Realtek RTL8195AM
2 parents 4185c1a + a072995 commit f091255

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

targets/TARGET_Realtek/TARGET_AMEBA/ota_api.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,11 @@
1919
#include "mbed_wait_api.h"
2020

2121
#include "rtl8195a.h"
22+
#include "ota_api.h"
2223
#include "flash_ext.h"
2324

24-
#define FLASH_TOP 0x200000
25-
#define FLASH_SECTOR_SIZE 0x1000
26-
#define FLASH_SECTOR_MASK ~(FLASH_SECTOR_SIZE - 1)
27-
#define OTA_REGION1 0x0b000
28-
#define OTA_REGION2 0xc0000
29-
#define TAG_OFS 0xc
30-
#define VER_OFS 0x10
31-
32-
#define TAG_DOWNLOAD 0x81950001
33-
#define TAG_VERIFIED 0x81950003
34-
3525
static flash_t flash_obj;
3626

37-
typedef struct imginfo_s {
38-
uint32_t base;
39-
uint32_t tag;
40-
uint64_t ver;
41-
} imginfo_t;
42-
43-
4427
void OTA_GetImageInfo(imginfo_t *info)
4528
{
4629
uint32_t ver_hi, ver_lo;

targets/TARGET_Realtek/TARGET_AMEBA/ota_api.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
#ifndef MBED_OTA_API_H
22
#define MBED_OTA_API_H
33

4+
#define FLASH_TOP 0x200000
5+
#define FLASH_SECTOR_SIZE 0x1000
6+
#define FLASH_SECTOR_MASK ~(FLASH_SECTOR_SIZE - 1)
7+
#define OTA_REGION1 0x0b000
8+
#define OTA_REGION2 0xc0000
9+
#define TAG_OFS 0xc
10+
#define VER_OFS 0x10
11+
12+
#define TAG_DOWNLOAD 0x81950001
13+
#define TAG_VERIFIED 0x81950003
14+
15+
typedef struct imginfo_s {
16+
uint32_t base;
17+
uint32_t tag;
18+
uint64_t ver;
19+
} imginfo_t;
20+
421
#ifdef __cplusplus
5-
extern "C" {
22+
extern "C" {
623
#endif
724

25+
extern void OTA_GetImageInfo(imginfo_t *info);
26+
extern uint32_t OTA_GetBase(void);
27+
828
extern uint32_t OTA_UpdateImage(uint32_t offset, uint32_t len, uint8_t *data);
929
extern uint32_t OTA_ReadImage(uint32_t offset, uint32_t len, uint8_t *data);
1030
extern uint32_t OTA_MarkUpdateDone(void);

0 commit comments

Comments
 (0)