From 6135e4f7b0be992947166719d3011a560231ba22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 29 May 2023 16:16:58 +0200 Subject: [PATCH] [boards] Update flash layouts, add W302 chip --- boards/_base/beken-7231n-tuya.json | 3 +++ boards/_base/beken-7231n.json | 1 - boards/_base/beken-7231t-tuya.json | 3 +++ boards/_base/beken-7231u.json | 1 - boards/_base/realtek-ambz-2mb-468k.json | 5 ++-- boards/_base/realtek-ambz-2mb-788k.json | 5 ++-- boards/_base/realtek-ambz-4mb-980k.json | 3 +-- boards/_base/realtek-ambz-tuya.json | 5 ++++ boards/_base/realtek-ambz.json | 9 +++---- boards/_base/realtek-ambz2-2mb-992k.json | 3 +-- boards/_base/realtek-ambz2-tuya.json | 5 ++++ boards/wr2.json | 1 + boards/wr2e.json | 1 + boards/wr2l.json | 1 + boards/wr2le.json | 1 + boards/wr3.json | 1 + boards/wr3e.json | 1 + boards/wr3l.json | 1 + boards/wr3le.json | 1 + boards/wr3n.json | 1 + cores/common/base/lt_types.h | 1 + docs/boards_tuya_all.json | 30 +++++++++++++++++++++++- 22 files changed, 64 insertions(+), 19 deletions(-) create mode 100644 boards/_base/realtek-ambz-tuya.json create mode 100644 boards/_base/realtek-ambz2-tuya.json diff --git a/boards/_base/beken-7231n-tuya.json b/boards/_base/beken-7231n-tuya.json index 733fe04..3c6e620 100644 --- a/boards/_base/beken-7231n-tuya.json +++ b/boards/_base/beken-7231n-tuya.json @@ -2,5 +2,8 @@ "build": { "bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03", "bkboot_version": "1.0.1-bk7231n" + }, + "flash": { + "tuya": "0x1ED000+0x13000" } } diff --git a/boards/_base/beken-7231n.json b/boards/_base/beken-7231n.json index 308a3ba..3946756 100644 --- a/boards/_base/beken-7231n.json +++ b/boards/_base/beken-7231n.json @@ -12,7 +12,6 @@ "download": "0x12A000+0xA6000", "calibration": "0x1D0000+0x1000", "net": "0x1D1000+0x1000", - "tlv": "0x1D2000+0x1000", "kvs": "0x1D3000+0x8000", "userdata": "0x1DB000+0x25000" }, diff --git a/boards/_base/beken-7231t-tuya.json b/boards/_base/beken-7231t-tuya.json index 5a36572..5049f2f 100644 --- a/boards/_base/beken-7231t-tuya.json +++ b/boards/_base/beken-7231t-tuya.json @@ -2,5 +2,8 @@ "build": { "bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03", "bkboot_version": "1.0.5-bk7231s" + }, + "flash": { + "tuya": "0x1ED000+0x13000" } } diff --git a/boards/_base/beken-7231u.json b/boards/_base/beken-7231u.json index 7516035..219111b 100644 --- a/boards/_base/beken-7231u.json +++ b/boards/_base/beken-7231u.json @@ -12,7 +12,6 @@ "download": "0x132000+0xA6000", "kvs": "0x1D8000+0x8000", "calibration": "0x1E0000+0x1000", - "tlv": "0x1E1000+0x1000", "net": "0x1E2000+0x1000", "userdata": "0x1E3000+0x1D000" }, diff --git a/boards/_base/realtek-ambz-2mb-468k.json b/boards/_base/realtek-ambz-2mb-468k.json index 6b8346c..2e016b2 100644 --- a/boards/_base/realtek-ambz-2mb-468k.json +++ b/boards/_base/realtek-ambz-2mb-468k.json @@ -5,9 +5,8 @@ "flash": { "ota1": "0x00B000+0x75000", "ota2": "0x080000+0x75000", - "kvs": "0xF5000+0x6000", - "userdata": "0xFB000+0x104000", - "rdp": "0x1FF000+0x1000" + "kvs": "0x0F5000+0x8000", + "userdata": "0x0FD000+0x102000" }, "upload": { "flash_size": 2097152, diff --git a/boards/_base/realtek-ambz-2mb-788k.json b/boards/_base/realtek-ambz-2mb-788k.json index 7df3e6e..9cf5546 100644 --- a/boards/_base/realtek-ambz-2mb-788k.json +++ b/boards/_base/realtek-ambz-2mb-788k.json @@ -5,9 +5,8 @@ "flash": { "ota1": "0x00B000+0xC5000", "ota2": "0x0D0000+0xC5000", - "kvs": "0x195000+0x6000", - "userdata": "0x19B000+0x64000", - "rdp": "0x1FF000+0x1000" + "kvs": "0x195000+0x8000", + "userdata": "0x19D000+0x62000" }, "upload": { "flash_size": 2097152, diff --git a/boards/_base/realtek-ambz-4mb-980k.json b/boards/_base/realtek-ambz-4mb-980k.json index 5f5fd0e..e90cf7f 100644 --- a/boards/_base/realtek-ambz-4mb-980k.json +++ b/boards/_base/realtek-ambz-4mb-980k.json @@ -6,8 +6,7 @@ "ota1": "0x00B000+0xF5000", "ota2": "0x100000+0xF5000", "kvs": "0x1F5000+0x8000", - "userdata": "0x1FD000+0x202000", - "rdp": "0x3FF000+0x1000" + "userdata": "0x1FD000+0x202000" }, "upload": { "flash_size": 4194304, diff --git a/boards/_base/realtek-ambz-tuya.json b/boards/_base/realtek-ambz-tuya.json new file mode 100644 index 0000000..629b69c --- /dev/null +++ b/boards/_base/realtek-ambz-tuya.json @@ -0,0 +1,5 @@ +{ + "flash": { + "tuya": "0x1EB000+0x15000" + } +} diff --git a/boards/_base/realtek-ambz.json b/boards/_base/realtek-ambz.json index 8fbbdae..21dc7f6 100644 --- a/boards/_base/realtek-ambz.json +++ b/boards/_base/realtek-ambz.json @@ -10,7 +10,8 @@ "boot_xip": "0x000000+0x4000", "boot_ram": "0x004000+0x4000", "system": "0x009000+0x1000", - "calibration": "0x00A000+0x1000" + "calibration": "0x00A000+0x1000", + "rdp": "0x1FF000+0x1000" }, "connectivity": [ "wifi" @@ -47,10 +48,6 @@ "General info": "../../docs/platform/realtek-amb/README.md", "Flashing guide": "../../docs/platform/realtek-ambz/flashing.md", "Debugging": "../../docs/platform/realtek-ambz/debugging.md" - }, - "extra": [ - "RDP is most likely not used in Tuya firmwares, as the System Data partition contains an incorrect offset 0xFF000 for RDP, which is in the middle of OTA2 image.", - "Additionally, Tuya firmware uses an encrypted KV or file storage, which resides at the end of flash memory. This seems to overlap system RDP area." - ] + } } } diff --git a/boards/_base/realtek-ambz2-2mb-992k.json b/boards/_base/realtek-ambz2-2mb-992k.json index ce06c54..58fb342 100644 --- a/boards/_base/realtek-ambz2-2mb-992k.json +++ b/boards/_base/realtek-ambz2-2mb-992k.json @@ -2,8 +2,7 @@ "flash": { "ota1": "0x00C000+0xF8000", "ota2": "0x104000+0xF8000", - "kvs": "0x1FC000+0x2000", - "userdata": "0x1FE000+0x2000" + "kvs": "0x1FC000+0x4000" }, "upload": { "flash_size": 2097152, diff --git a/boards/_base/realtek-ambz2-tuya.json b/boards/_base/realtek-ambz2-tuya.json new file mode 100644 index 0000000..1ad51a5 --- /dev/null +++ b/boards/_base/realtek-ambz2-tuya.json @@ -0,0 +1,5 @@ +{ + "flash": { + "tuya": "0x1D5000+0x10000" + } +} diff --git a/boards/wr2.json b/boards/wr2.json index c6619ae..4a1e7e4 100644 --- a/boards/wr2.json +++ b/boards/wr2.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "ic/rtl8710bn", "pcb/wr2-base", diff --git a/boards/wr2e.json b/boards/wr2e.json index 87bbe47..d53af88 100644 --- a/boards/wr2e.json +++ b/boards/wr2e.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "ic/rtl8710bn", "pcb/wr2-base", diff --git a/boards/wr2l.json b/boards/wr2l.json index 83343d3..4225f7b 100644 --- a/boards/wr2l.json +++ b/boards/wr2l.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "realtek-ambz-bx", "ic/rtl8710bn", diff --git a/boards/wr2le.json b/boards/wr2le.json index d620d69..c60d6eb 100644 --- a/boards/wr2le.json +++ b/boards/wr2le.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "realtek-ambz-bx", "ic/rtl8710bn", diff --git a/boards/wr3.json b/boards/wr3.json index 4f68710..b364406 100644 --- a/boards/wr3.json +++ b/boards/wr3.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "ic/rtl8710bn", "pcb/wr3-base", diff --git a/boards/wr3e.json b/boards/wr3e.json index 84a0417..8533468 100644 --- a/boards/wr3e.json +++ b/boards/wr3e.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "ic/rtl8710bn", "pcb/wr3-base", diff --git a/boards/wr3l.json b/boards/wr3l.json index fb815f5..0bda55d 100644 --- a/boards/wr3l.json +++ b/boards/wr3l.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "realtek-ambz-bx", "ic/rtl8710bn", diff --git a/boards/wr3le.json b/boards/wr3le.json index 44cff15..a06a6ed 100644 --- a/boards/wr3le.json +++ b/boards/wr3le.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "realtek-ambz-bx", "ic/rtl8710bn", diff --git a/boards/wr3n.json b/boards/wr3n.json index ae35e26..0a5c404 100644 --- a/boards/wr3n.json +++ b/boards/wr3n.json @@ -1,6 +1,7 @@ { "_base": [ "realtek-ambz", + "realtek-ambz-tuya", "realtek-ambz-2mb-788k", "ic/rtl8710bn", "pcb/wr3-base", diff --git a/cores/common/base/lt_types.h b/cores/common/base/lt_types.h index c7aae14..ef27c29 100644 --- a/cores/common/base/lt_types.h +++ b/cores/common/base/lt_types.h @@ -40,6 +40,7 @@ typedef enum { RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC), // CHIPID_8711BG / QFN68 MX1290 = RTL8710BN, MX1290V2 = RTL8710BX, + W302 = RTL8710BN, // Realtek AmebaZ2 (chip_id << 2 | flash_mode) RTL8720CM = CPU_MODEL(F_RTL8720C, 0xEC), // 0xFB << 2 | 0 RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED), // 0xFB << 2 | 1 diff --git a/docs/boards_tuya_all.json b/docs/boards_tuya_all.json index 2832f16..290f6d0 100644 --- a/docs/boards_tuya_all.json +++ b/docs/boards_tuya_all.json @@ -441,6 +441,34 @@ "datasheet_id": "Kc5x1p35fs5zf" } }, + "t2": { + "t2-u": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 21, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "T2-U-module-datasheet", + "datasheet_id": "Kce1tncb80ldq" + } + }, + "t1": { + "t1-2s": { + "mcu": "t1a", + "flash": 1048576, + "ram": 294912, + "pins_total": 11, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "T1-2S-module-datasheet", + "datasheet_id": "Kcl2d5xjy1rly" + } + }, "axy": { "axy2s": { "mcu": "ecr6600", @@ -493,7 +521,7 @@ }, "wt": { "wt3": { - "mcu": "t2", + "mcu": "bk7231n", "flash": 2097152, "ram": 262144, "pins_total": 16,