diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 060c4e594..673a04a5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,8 +160,9 @@ jobs: python3 tests/vendor/freedom-metal/run.py --sdk "$RUNNER_TEMP/freedom-e-sdk" --metal "$RUNNER_TEMP/freedom-metal" --embsim build/${{ matrix.preset }}/bin/embsim esp-idf: - # its own job: ESP-IDF and its RISC-V toolchain take a while to fetch, - # and each example is built with idf.py as a user builds it + # its own job: ESP-IDF and its RISC-V and Xtensa toolchains take a while + # to fetch, and each example is built with idf.py as a user builds it + # (the ESP32-C3-DevKitM-1's, and the ESP32-DevKitC's esp32_* ones) name: ESP-IDF's examples on the ESP32-C3-DevKitM-1 runs-on: ubuntu-24.04 steps: @@ -174,7 +175,7 @@ jobs: run: | cmake --preset ci-gcc cmake --build --preset ci-gcc - - name: ESP-IDF v5.4 and its tools for the ESP32-C3 + - name: ESP-IDF v5.4 and its tools for the ESP32-C3 and the ESP32 run: | # an origin remote: ESP-IDF's submodules are relative to it (../../espressif/...) git init -q "$RUNNER_TEMP/esp-idf" @@ -182,7 +183,7 @@ jobs: git -C "$RUNNER_TEMP/esp-idf" fetch -q --depth 1 origin 67c1de1eebe095d554d281952fde63c16ee2dca0 # v5.4 git -C "$RUNNER_TEMP/esp-idf" checkout -q FETCH_HEAD git -C "$RUNNER_TEMP/esp-idf" submodule update -q --init --depth 1 --recursive - "$RUNNER_TEMP/esp-idf/install.sh" esp32c3 + "$RUNNER_TEMP/esp-idf/install.sh" esp32c3,esp32 - name: Run the examples run: | . "$RUNNER_TEMP/esp-idf/export.sh" >/dev/null diff --git a/CHANGELOG.md b/CHANGELOG.md index 1094af9ac..c51c9a1ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,41 @@ versions follow semantic versioning. There is no release yet. ## Unreleased +### ESP32 in the machine framework: ESP-IDF boots on the ESP32-DevKitC V4 + +- Added the ESP32's two Xtensa LX6 cores as a framework core + (`core/mcu/xtensa/lx6.c`, `lx6fp.c`, backend `xtensa`): the configuration + Espressif's core-isa.h gives, windowed registers with their overflow and + underflow, loops, XEA2 exceptions, 32 interrupts at their levels, the + CCOMPARE timers, MAC16, booleans, the FPU, region protection and the debug + option; the APP_CPU held until DPORT releases it, with its own view of the + ROM's data pointers. +- Added `espressif/esp32`: the memory map, the ROM image made from + Espressif's ROM ELF (`esprom.py` now places sections that outrun their + copy-table entry; the image equals QEMU's esp32-v3-rom.bin), the register + file from esp32.svd, and models for DPORT (APP_CPU, caches and flash MMU, + interrupt matrix), RTC_CNTL, eFuse, APB_CTRL clocks, GPIO/IO_MUX with + strapping, UART0-2, TIMG0/1, SPI0/1 with the GT25Q32A flash, SHA, LEDC, + I2C0/1 (master and slave, 16 commands, APB_CLK timing; DPORT's + PERIP_RST_EN resets them), the RMT's eight channels, the SAR ADCs + through SENS, the two DACs through RTC_IO, the internal analog I2C, RNG and the AHB view. +- Added the `emblink/esp32_devkitc` board (ESP32-DevKitC V4, WROOM-32E) with + its power path, LED, Boot and EN buttons, headers and fixtures. +- Espressif's ROM, ESP-IDF v5.4's bootloader and hello_world run unmodified + through `esp_restart` (`tests/vendor/esp-idf`: `esp32_hello_world` 9/9, + `esp32_blink` 6/6, `esp32_ledc_basic` 2/2, `esp32_i2c_eeprom` 3/3 on a + 24LC256, `esp32_gptimer` 17/17, `esp32_uart_echo` 6/6 on UART2, + `esp32_real_time_stats` 10/10 across both cores, + `esp32_blink_strip` 7/7 on a WS2812B through the RMT, + `esp32_adc_oneshot_read` 6/6 with the eFuse Vref's calibration, + `esp32_dac_oneshot` 4/4 (the DACs read back by ADC2); an ADC reads a + pin's own DAC on a net with no analog part (the runtime's pin_volts); + Arduino-ESP32's AnalogReadSerial, ReadAnalogVoltage, DigitalReadSerial, + GetChipID and RepeatTimer for "ESP32 Dev Module" in + `tests/vendor/arduino-esp32` (`ESP32_*`); DBREAKC's MASK now marks the + address bits compared, as ESP-IDF's stack-end watchpoint has it; the UARTs keep + MEM_RX_STATUS's addresses, from which ESP-IDF counts the bytes waiting); `test_lx6` checks the core with programs from Espressif's assembler. + ### Original ESP32 digital per-pin hold - Added the SDK-mapped digital hold register and per-pad capture masks. diff --git a/catalog/boards/esp32_devkitc/board.json b/catalog/boards/esp32_devkitc/board.json new file mode 100644 index 000000000..8f7c7d7b7 --- /dev/null +++ b/catalog/boards/esp32_devkitc/board.json @@ -0,0 +1,562 @@ +{ + "schema_version": 1, + "kind": "board", + "id": "emblink/esp32_devkitc", + "version": "1.0.0", + "name": "ESP32-DevKitC V4", + "description": "Espressif's ESP32-DevKitC V4 with an ESP32-WROOM-32E module (the ESP32-D0WD-V3 with its 40 MHz crystal and 4 MB of flash), the AMS1117-3.3 regulator making 3.3 V from the micro-USB's 5 V through a BAT760 Schottky, the red power LED, the Boot button on GPIO0, the EN button on CHIP_PU with its RC, and two 19-pin headers. The CP2102N's USB-to-UART bridge on UART0 (GPIO1/GPIO3) is the session's serial console, and a serial port on the host (embsim serve --serial). The firmware is a flash image (bin), as idf.py and esptool write it.", + "keywords": [ + "esp32", + "devkitc", + "esp32-devkitc-v4", + "esp32-wroom-32e", + "xtensa", + "espressif", + "cp2102n" + ], + "revision": "V4", + "mcu": { + "ref": "espressif/esp32", + "package": "wroom32e", + "instance": "U1" + }, + "oscillators": { + "hse": { + "hz": 40000000, + "source": "external_crystal" + } + }, + "components": [ + { + "id": "D2", + "component": "emblink/diode_schottky", + "params": { + "part": "generic" + }, + "doc": "BAT760-7: the USB's VBUS to the board's 5 V (EXT_5V), so 5 V fed at the header does not reach the host (the generic Schottky's model)" + }, + { + "id": "U2", + "component": "emblink/regulator", + "params": { + "part": "AMS1117-3.3" + }, + "doc": "AMS1117-3.3: 3.3 V from 5 V for the module and the bridge" + }, + { + "id": "C21", + "component": "emblink/capacitor", + "params": { + "capacitance": "22u" + }, + "doc": "U2's input capacitor, 22 uF/10 V" + }, + { + "id": "C22", + "component": "emblink/capacitor", + "params": { + "capacitance": "100n" + }, + "doc": "U2's input decoupling, 0.1 uF/50 V" + }, + { + "id": "C1", + "component": "emblink/capacitor", + "params": { + "capacitance": "22u" + }, + "doc": "U2's output capacitor, 22 uF/10 V" + }, + { + "id": "C3", + "component": "emblink/capacitor", + "params": { + "capacitance": "22u" + }, + "doc": "The 3.3 V rail's bulk capacitor at the module, 22 uF/10 V" + }, + { + "id": "R2", + "component": "emblink/resistor", + "params": { + "resistance": "2k" + }, + "doc": "D1's resistor" + }, + { + "id": "D1", + "component": "emblink/led", + "params": { + "color": "red" + }, + "doc": "The power-on LED" + }, + { + "id": "R11", + "component": "emblink/resistor", + "params": { + "resistance": "10k" + }, + "doc": "EN's pull-up to 3.3 V" + }, + { + "id": "C9", + "component": "emblink/capacitor", + "params": { + "capacitance": "100n" + }, + "doc": "EN's 0.1 uF: with R11 it delays the chip's start after power-up (the RC the datasheet asks for)" + }, + { + "id": "SW2", + "component": "emblink/push_button", + "doc": "EN: joins EN to ground (reset)" + }, + { + "id": "SW1", + "component": "emblink/push_button", + "doc": "Boot: joins GPIO0 to ground; held through a reset, the ROM waits for a download" + }, + { + "id": "J2", + "component": "emblink/header", + "params": { + "pins": 19 + }, + "doc": "The left header (CON19X1_2P54)" + }, + { + "id": "J3", + "component": "emblink/header", + "params": { + "pins": 19 + }, + "doc": "The right header (CON19X1_2P54)" + } + ], + "nets": { + "VBUS": [ + "D2.A" + ], + "5V": [ + "D2.K", + "U2.IN", + "C21.1", + "C22.1", + "J2.19" + ], + "3V3": [ + "U2.OUT", + "C1.1", + "C3.1", + "U1.VDD3P3", + "R2.1", + "R11.1", + "J2.1" + ], + "GND": [ + "U2.GND", + "C21.2", + "C22.2", + "C1.2", + "C3.2", + "D1.K", + "C9.2", + "SW2.2", + "SW1.2", + "U1.GND", + "J2.14", + "J3.1", + "J3.7" + ], + "D1_A": [ + "R2.2", + "D1.A" + ], + "EN": [ + "U1.CHIP_EN", + "R11.2", + "C9.1", + "SW2.1", + "J2.2" + ], + "GPIO36": [ + "U1.GPIO36", + "J2.3" + ], + "GPIO39": [ + "U1.GPIO39", + "J2.4" + ], + "GPIO34": [ + "U1.GPIO34", + "J2.5" + ], + "GPIO35": [ + "U1.GPIO35", + "J2.6" + ], + "GPIO32": [ + "U1.GPIO32", + "J2.7" + ], + "GPIO33": [ + "U1.GPIO33", + "J2.8" + ], + "GPIO25": [ + "U1.GPIO25", + "J2.9" + ], + "GPIO26": [ + "U1.GPIO26", + "J2.10" + ], + "GPIO27": [ + "U1.GPIO27", + "J2.11" + ], + "GPIO14": [ + "U1.GPIO14", + "J2.12" + ], + "GPIO12": [ + "U1.GPIO12", + "J2.13" + ], + "GPIO13": [ + "U1.GPIO13", + "J2.15" + ], + "GPIO23": [ + "U1.GPIO23", + "J3.2" + ], + "GPIO22": [ + "U1.GPIO22", + "J3.3" + ], + "GPIO1": [ + "U1.GPIO1", + "J3.4" + ], + "GPIO3": [ + "U1.GPIO3", + "J3.5" + ], + "GPIO21": [ + "U1.GPIO21", + "J3.6" + ], + "GPIO19": [ + "U1.GPIO19", + "J3.8" + ], + "GPIO18": [ + "U1.GPIO18", + "J3.9" + ], + "GPIO5": [ + "U1.GPIO5", + "J3.10" + ], + "GPIO17": [ + "U1.GPIO17", + "J3.11" + ], + "GPIO16": [ + "U1.GPIO16", + "J3.12" + ], + "GPIO4": [ + "U1.GPIO4", + "J3.13" + ], + "GPIO0": [ + "U1.GPIO0", + "J3.14", + "SW1.1" + ], + "GPIO2": [ + "U1.GPIO2", + "J3.15" + ], + "GPIO15": [ + "U1.GPIO15", + "J3.16" + ] + }, + "ports": { + "VBUS": { + "net": "VBUS", + "doc": "The micro-USB connector's VBUS: where a USB host's 5 V comes in" + }, + "3V3": { + "net": "3V3", + "connector": "J2", + "pin": 1 + }, + "EN": { + "net": "EN", + "connector": "J2", + "pin": 2, + "doc": "CHIP_PU: low holds the chip off and in reset" + }, + "VP": { + "net": "GPIO36", + "connector": "J2", + "pin": 3 + }, + "VN": { + "net": "GPIO39", + "connector": "J2", + "pin": 4 + }, + "IO34": { + "net": "GPIO34", + "connector": "J2", + "pin": 5 + }, + "IO35": { + "net": "GPIO35", + "connector": "J2", + "pin": 6 + }, + "IO32": { + "net": "GPIO32", + "connector": "J2", + "pin": 7 + }, + "IO33": { + "net": "GPIO33", + "connector": "J2", + "pin": 8 + }, + "IO25": { + "net": "GPIO25", + "connector": "J2", + "pin": 9 + }, + "IO26": { + "net": "GPIO26", + "connector": "J2", + "pin": 10 + }, + "IO27": { + "net": "GPIO27", + "connector": "J2", + "pin": 11 + }, + "IO14": { + "net": "GPIO14", + "connector": "J2", + "pin": 12 + }, + "IO12": { + "net": "GPIO12", + "connector": "J2", + "pin": 13 + }, + "GND": { + "net": "GND", + "connector": "J2", + "pin": 14 + }, + "IO13": { + "net": "GPIO13", + "connector": "J2", + "pin": 15 + }, + "5V": { + "net": "5V", + "connector": "J2", + "pin": 19 + }, + "GND1": { + "net": "GND", + "connector": "J3", + "pin": 1 + }, + "IO23": { + "net": "GPIO23", + "connector": "J3", + "pin": 2 + }, + "IO22": { + "net": "GPIO22", + "connector": "J3", + "pin": 3 + }, + "TX": { + "net": "GPIO1", + "connector": "J3", + "pin": 4, + "doc": "GPIO1, U0TXD: also the bridge's RXD" + }, + "RX": { + "net": "GPIO3", + "connector": "J3", + "pin": 5, + "doc": "GPIO3, U0RXD: also the bridge's TXD" + }, + "IO21": { + "net": "GPIO21", + "connector": "J3", + "pin": 6 + }, + "GND2": { + "net": "GND", + "connector": "J3", + "pin": 7 + }, + "IO19": { + "net": "GPIO19", + "connector": "J3", + "pin": 8 + }, + "IO18": { + "net": "GPIO18", + "connector": "J3", + "pin": 9 + }, + "IO5": { + "net": "GPIO5", + "connector": "J3", + "pin": 10 + }, + "IO17": { + "net": "GPIO17", + "connector": "J3", + "pin": 11 + }, + "IO16": { + "net": "GPIO16", + "connector": "J3", + "pin": 12 + }, + "IO4": { + "net": "GPIO4", + "connector": "J3", + "pin": 13 + }, + "IO0": { + "net": "GPIO0", + "connector": "J3", + "pin": 14, + "doc": "GPIO0, a strapping pin: the Boot button" + }, + "IO2": { + "net": "GPIO2", + "connector": "J3", + "pin": 15 + }, + "IO15": { + "net": "GPIO15", + "connector": "J3", + "pin": 16 + } + }, + "leds": [ + { + "name": "power", + "component": "D1", + "color": "red" + } + ], + "buttons": [ + { + "name": "boot", + "component": "SW1", + "gpio": "GPIO0", + "active": "low" + }, + { + "name": "reset", + "component": "SW2", + "signal": "CHIP_EN", + "active": "low" + } + ], + "console": { + "peripheral": "UART0", + "tx": "GPIO1", + "rx": "GPIO3", + "baud": 115200, + "bridge": { + "part": "CP2102N-A02-GQFN28", + "usb": { + "vid": "0x10C4", + "pid": "0xEA60", + "product": "CP2102N USB to UART Bridge Controller" + } + } + }, + "toolchains": { + "gcc-xtensa": { + "cpu": "esp32", + "flags": [ + "-mlongcalls" + ] + } + }, + "fidelity": { + "functional": { + "claims": "Nets, ports, the power LED and the two buttons as parts; the ESP32 runs its firmware from the flash image (see its description): Espressif's own ROM, the second-stage bootloader and the app, as on the board. EN pulls CHIP_PU low and the chip starts again with rst:0x1 (POWERON_RESET); Boot held through it makes the ROM wait for a download. The CP2102N's port is the session's console on UART0 (GPIO1/GPIO3) and a serial port on the host.", + "omissions": [ + "the CP2102N itself: its USB enumeration, its modem lines and so the auto-program circuit (Q1, Q2 and R21, R22 that let esptool's DTR and RTS drive EN and GPIO0): pressing Boot and EN does what they do", + "the ESD diodes on the USB lines (LESD5D5.0CT1G) and the USB connector", + "the flash pins GPIO6-11 on the headers (D0-D3, CMD, CLK): the module keeps them for its flash and the ports leave them out", + "the artwork and the bench model" + ], + "validation": [] + }, + "electrical": { + "claims": "The power path from the schematic: VBUS through the Schottky to 5 V, the AMS1117-3.3 to 3.3 V, the LED, the EN RC.", + "omissions": [], + "validation": [] + } + }, + "provenance": { + "author": "EmbSIM", + "license": "Apache-2.0", + "sources": [ + { + "title": "ESP32-DevKitC V4 schematic (Espressif)", + "rev": "V4, 2020-02-25", + "url": "https://dl.espressif.com/dl/schematics/esp32_devkitc_v4_sch.pdf" + }, + { + "title": "ESP32-DevKitC V4 user guide (Espressif esp-dev-kits)", + "url": "https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32/esp32-devkitc/user_guide.html" + }, + { + "title": "ESP32-WROOM-32E & ESP32-WROOM-32UE datasheet (Espressif)", + "rev": "v1.7" + } + ], + "notes": "Nets and parts read from the schematic's text and the user guide's header table." + }, + "tests": [ + "tests/*.json" + ], + "i18n": { + "fr": { + "source": "6536a91c8d63", + "description": "L'ESP32-DevKitC V4 d'Espressif avec un module ESP32-WROOM-32E (l'ESP32-D0WD-V3 avec son quartz de 40 MHz et 4 Mo de flash), le régulateur AMS1117-3.3 qui fait 3,3 V à partir des 5 V du micro-USB à travers une Schottky BAT760, la LED rouge d'alimentation, le bouton Boot sur GPIO0, le bouton EN sur CHIP_PU avec son RC, et deux connecteurs de 19 broches. Le pont USB-UART CP2102N sur UART0 (GPIO1/GPIO3) est la console série de la session, et un port série sur l'hôte (embsim serve --serial). Le firmware est une image de flash (bin), telle qu'idf.py et esptool l'écrivent.", + "fidelity": { + "functional": { + "claims": "Les nets, les ports, la LED d'alimentation et les deux boutons comme composants ; l'ESP32 exécute son firmware depuis l'image de flash (voir sa description) : la ROM d'Espressif, le bootloader de second niveau et l'application, comme sur la carte. EN tire CHIP_PU à l'état bas et la puce redémarre avec rst:0x1 (POWERON_RESET) ; Boot maintenu pendant ce temps fait attendre la ROM en mode téléchargement. Le port du CP2102N est la console de la session sur UART0 (GPIO1/GPIO3) et un port série sur l'hôte.", + "omissions": [ + "le CP2102N lui-même : son énumération USB, ses lignes modem et donc le circuit de programmation automatique (Q1, Q2 et R21, R22 qui laissent les DTR et RTS d'esptool piloter EN et GPIO0) : appuyer sur Boot et EN fait ce qu'ils font", + "les diodes ESD des lignes USB (LESD5D5.0CT1G) et le connecteur USB", + "les broches de flash GPIO6-11 sur les connecteurs (D0-D3, CMD, CLK) : le module les garde pour sa flash et les ports les omettent", + "le dessin de la carte et le modèle du banc" + ] + }, + "electrical": { + "claims": "Le chemin d'alimentation du schéma : VBUS à travers la Schottky vers 5 V, l'AMS1117-3.3 vers 3,3 V, la LED, le RC de EN." + } + } + } + } +} diff --git a/catalog/boards/esp32_devkitc/tests/boot-button.json b/catalog/boards/esp32_devkitc/tests/boot-button.json new file mode 100644 index 000000000..d65737702 --- /dev/null +++ b/catalog/boards/esp32_devkitc/tests/boot-button.json @@ -0,0 +1,69 @@ +{ + "schema_version": 1, + "kind": "component_test", + "name": "boot-button", + "description": "Boot (SW1) joins GPIO0 to ground while held.", + "policy": "electrical", + "until": "60ms", + "circuit": { + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc" + } + ], + "components": [ + { + "id": "HOST", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5.0 + } + }, + { + "id": "CABLE", + "component": "emblink/resistor", + "params": { + "resistance": 0.25 + } + }, + { + "id": "G", + "component": "emblink/gnd" + } + ], + "nets": { + "HOSTV": [ + "HOST.+", + "CABLE.1" + ], + "VBUS": [ + "CABLE.2", + "B1.VBUS" + ], + "GND": [ + "HOST.-", + "G.GND", + "B1.GND1" + ], + "IO0": [ + "B1.IO0" + ] + } + }, + "inputs": [ + { + "at": "40ms", + "target": "B1.SW1", + "input": "pressed", + "value": true + } + ], + "expect": { + "net:IO0": { + "at": "55ms", + "max_v": 0.05 + } + } +} \ No newline at end of file diff --git a/catalog/boards/esp32_devkitc/tests/reset-button.json b/catalog/boards/esp32_devkitc/tests/reset-button.json new file mode 100644 index 000000000..c24f45f48 --- /dev/null +++ b/catalog/boards/esp32_devkitc/tests/reset-button.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "kind": "component_test", + "name": "reset-button", + "description": "EN (SW2) holds CHIP_PU low while pressed; C9 brings it back up through R11 once released.", + "policy": "electrical", + "until": "90ms", + "circuit": { + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc" + } + ], + "components": [ + { + "id": "HOST", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5.0 + } + }, + { + "id": "CABLE", + "component": "emblink/resistor", + "params": { + "resistance": 0.25 + } + }, + { + "id": "G", + "component": "emblink/gnd" + } + ], + "nets": { + "HOSTV": [ + "HOST.+", + "CABLE.1" + ], + "VBUS": [ + "CABLE.2", + "B1.VBUS" + ], + "GND": [ + "HOST.-", + "G.GND", + "B1.GND1" + ], + "EN": [ + "B1.EN" + ] + } + }, + "inputs": [ + { + "at": "60ms", + "target": "B1.SW2", + "input": "pressed", + "value": true + }, + { + "at": "70ms", + "target": "B1.SW2", + "input": "pressed", + "value": false + } + ], + "expect": { + "net:EN": { + "between": [ + "62ms", + "70ms" + ], + "max_v": 0.05 + } + } +} \ No newline at end of file diff --git a/catalog/boards/esp32_devkitc/tests/usb-powered.json b/catalog/boards/esp32_devkitc/tests/usb-powered.json new file mode 100644 index 000000000..f7aab7201 --- /dev/null +++ b/catalog/boards/esp32_devkitc/tests/usb-powered.json @@ -0,0 +1,82 @@ +{ + "schema_version": 1, + "kind": "component_test", + "name": "usb-powered", + "description": "Plugged into a computer's USB port through a 0.25 ohm cable: D2 passes VBUS to 5V less its Schottky drop, U2 (AMS1117-3.3) makes 3V3, D1 glows (about 0.6 mA through R2's 2 k) and R11 holds EN high.", + "policy": "electrical", + "until": "60ms", + "circuit": { + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc" + } + ], + "components": [ + { + "id": "HOST", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5.0 + } + }, + { + "id": "CABLE", + "component": "emblink/resistor", + "params": { + "resistance": 0.25 + } + }, + { + "id": "G", + "component": "emblink/gnd" + } + ], + "nets": { + "HOSTV": [ + "HOST.+", + "CABLE.1" + ], + "VBUS": [ + "CABLE.2", + "B1.VBUS" + ], + "GND": [ + "HOST.-", + "G.GND", + "B1.GND1" + ], + "V5": [ + "B1.5V" + ], + "V33": [ + "B1.3V3" + ], + "EN": [ + "B1.EN" + ] + } + }, + "expect": { + "net:V5": { + "at": "50ms", + "min_v": 4.5, + "max_v": 4.95 + }, + "net:V33": { + "at": "50ms", + "min_v": 3.25, + "max_v": 3.35 + }, + "net:EN": { + "at": "50ms", + "min_v": 3.2, + "max_v": 3.35 + }, + "output:B1.D1.luminance": { + "at": "50ms", + "min": 0.01 + } + } +} \ No newline at end of file diff --git a/catalog/mcus/espressif/esp32/LICENSES/Apache-2.0.txt b/catalog/mcus/espressif/esp32/LICENSES/Apache-2.0.txt new file mode 100644 index 000000000..439f2cf82 --- /dev/null +++ b/catalog/mcus/espressif/esp32/LICENSES/Apache-2.0.txt @@ -0,0 +1,13 @@ +Copyright (c) 2026 Microchip Technology Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/catalog/mcus/espressif/esp32/mcu.json b/catalog/mcus/espressif/esp32/mcu.json new file mode 100644 index 000000000..d8e4d37bf --- /dev/null +++ b/catalog/mcus/espressif/esp32/mcu.json @@ -0,0 +1,450 @@ +{ + "schema_version": 1, + "kind": "mcu", + "id": "espressif/esp32", + "version": "0.1.0", + "name": "ESP32", + "description": "Espressif ESP32 (ESP32-D0WD-V3, chip revision v3.1): two Xtensa LX6 cores at up to 240 MHz, 520 KiB of SRAM, 448 KiB of ROM, 16 KiB of RTC memory, external SPI flash behind the cores' caches, Wi-Fi and Bluetooth; the ESP32-DevKitC's MCU. Espressif's ROM, ESP-IDF's second-stage bootloader and ESP-IDF applications run on both cores; the radios are not yet modelled.", + "keywords": [ + "xtensa", + "lx6", + "espressif", + "esp32", + "esp32-d0wd-v3", + "dual-core" + ], + "vendor": "espressif", + "family": "esp32", + "core": { + "backend": "xtensa", + "model": "esp32-lx6", + "cores": 2, + "timing_tier": "estimated", + "fpu": true, + "mpu": false, + "endian": "little", + "reset_pc": "0x40000400" + }, + "memory": [ + { + "name": "rom", + "base": "0x40000000", + "size": "448K", + "kind": "rom", + "file": "rom.bin", + "doc": "Internal ROM0 (384 KiB) and ROM1 (64 KiB) on the instruction bus (TRM v5 table 3.3-1, ESP-IDF's SOC_IROM_MASK_HIGH 0x40070000): the boot ROM of chip revision v3, its image made by tools/importers/esprom.py (--base 0x40000000 --size 0x70000 --data-table 0x4000D4EC:0x4000D4F8, the Bluetooth controller's entry; --data-table 0x4000D4F8:0x4000D5C8, the ROM's copy table of its RAM variables' initial values) from Espressif's esp32_rev300_rom.elf (espressif/esp-rom-elfs 20241011, Apache-2.0: LICENSES/Apache-2.0.txt; the ROM's code is Copyright (c) 2015-2022 Espressif Systems (Shanghai) Co. Ltd.). It equals byte for byte the image Espressif's QEMU loads (esp32-v3-rom.bin, sha256 9115bbcd...258b) over its 455,722 bytes; the rest reads zeros", + "sha256": "ee235a76e8e5afd5bed9d674587e001d8cde459a659edef9072cbc867fd31313" + }, + { + "name": "rom1_data", + "base": "0x3FF90000", + "size": "64K", + "kind": "alias", + "target": "0x40060000", + "doc": "Internal ROM1 on the data bus" + }, + { + "name": "sram0", + "base": "0x40070000", + "size": "192K", + "kind": "ram", + "doc": "Internal SRAM0 on the instruction bus: its first 64 KiB the cores' flash caches once they are enabled, the rest IRAM" + }, + { + "name": "sram2", + "base": "0x3FFAE000", + "size": "200K", + "kind": "ram", + "doc": "Internal SRAM2 on the data bus (DRAM)" + }, + { + "name": "sram1", + "base": "0x3FFE0000", + "size": "128K", + "kind": "ram", + "main": true, + "doc": "Internal SRAM1 on the data bus (DRAM), where the ROM keeps its data and stacks" + }, + { + "name": "rtc_fast", + "base": "0x3FF80000", + "size": "8K", + "kind": "ram", + "doc": "RTC FAST memory on the data bus, kept in deep sleep" + }, + { + "name": "rtc_fast_ibus", + "base": "0x400C0000", + "size": "8K", + "kind": "alias", + "target": "0x3FF80000", + "doc": "RTC FAST memory on the instruction bus" + }, + { + "name": "rtc_slow", + "base": "0x50000000", + "size": "8K", + "kind": "ram", + "doc": "RTC SLOW memory, kept in deep sleep, the ULP coprocessor's" + }, + { + "name": "flash", + "base": "0x0", + "size": "4M", + "kind": "external", + "erased": "0xFFFFFFFF", + "doc": "The module's 4 MB SPI flash, reached through SPI0 and SPI1 and read in place through the caches" + }, + { + "name": "flash_drom", + "base": "0x3F400000", + "size": "4M", + "kind": "window", + "doc": "The data bus's window on the flash (DROM0, TRM table 3.3-3): 64 pages of 64 KB that MMU entries 0-63 map" + }, + { + "name": "flash_irom", + "base": "0x400D0000", + "size": "0x330000", + "kind": "window", + "doc": "The instruction bus's window on the flash (IROM0 from the first whole page after RTC FAST memory to 0x403FFFFF): MMU entries 77-127" + } + ], + "clocks": { + "sources": [ + { + "name": "xtal", + "hz": 40000000, + "doc": "The module's 40 MHz crystal (XTL_CLK); the CPU runs from it out of reset" + }, + { + "name": "rc_fast", + "hz": 8000000, + "doc": "The internal 8 MHz RC oscillator (RC_FAST_CLK, 8MD256 its /256)" + }, + { + "name": "rc_slow", + "hz": 150000, + "doc": "The internal 150 kHz RC oscillator (RTC_SLOW_CLK's default)" + }, + { + "name": "pll", + "hz": 320000000, + "doc": "PLL_CLK, 320 MHz (or 480 MHz) from the crystal" + } + ], + "reset_core_hz": 40000000, + "max_core_hz": 240000000 + }, + "register_file": { + "format": "embsim", + "file": "registers.json", + "vendored": true, + "license": "Apache-2.0 (converted from Espressif's esp32.svd, Copyright 2024 Espressif Systems (Shanghai) PTE LTD; LICENSES/Apache-2.0.txt)" + }, + "peripherals": [ + { + "match": "DPORT", + "model": "esp32-dport", + "order": 0 + }, + { + "match": "RTC_CNTL", + "model": "esp32-rtc", + "order": 1 + }, + { + "match": "APB_CTRL", + "model": "esp32-apbctrl", + "order": 1 + }, + { + "match": "EFUSE", + "model": "esp32-efuse" + }, + { + "match": "UART?", + "model": "esp32-uart" + }, + { + "match": "IO_MUX", + "model": "esp32-iomux", + "order": 0 + }, + { + "match": "GPIO", + "model": "esp32-gpio", + "order": 1 + }, + { + "match": "SPI0", + "model": "esp32-spi" + }, + { + "match": "SPI1", + "model": "esp32-spi" + }, + { + "match": "TIMG?", + "model": "esp32-timg" + }, + { + "match": "SHA", + "model": "esp32-sha" + }, + { + "match": "LEDC", + "model": "esp32-ledc" + }, + { + "match": "I2C?", + "model": "esp32-i2c" + }, + { + "match": "RMT", + "model": "esp32-rmt" + }, + { + "match": "SENS", + "model": "esp32-sens" + }, + { + "match": "RTC_IO", + "model": "esp32-rtcio" + } + ], + "io": { + "family": "cmos_3v3", + "ports": [ + { + "name": "GPIO", + "pins": 40, + "mask": "0xFFFFFFFFFF" + } + ], + "electrical": { + "vdd": 3.3, + "voh": 2.64, + "vol": 0.33, + "rout": 20, + "vih": 2.475, + "vil": 0.825, + "hysteresis": 0.1, + "rpull": 45000, + "leak_a": 5e-08, + "ioh_max": 0.04, + "iol_max": 0.028 + } + }, + "supply": { + "doc": "ESP32 Series Datasheet v5.3, table 4-2 (power consumption by power modes): Modem-sleep of the dual-core chips, 20-31 mA at 80 MHz, 27-44 mA at 160 MHz, 30-68 mA at 240 MHz, taken as the low end with the CPUs waiting and the high end running (the datasheet gives the range by load, not the split); power off with CHIP_PU low 1 uA. The radios' currents of table 5-4 (802.11b 1 Mbps at +19.5 dBm 240 mA, 802.11g 54 Mbps at +16 dBm 190 mA, 802.11n MCS7 at +14 dBm 180 mA, receiving 95-100 mA) for when they are modelled.", + "run_a": [ + [ + 80000000, + 0.031 + ], + [ + 160000000, + 0.044 + ], + [ + 240000000, + 0.068 + ] + ], + "idle_a": [ + [ + 80000000, + 0.02 + ], + [ + 160000000, + 0.027 + ], + [ + 240000000, + 0.03 + ] + ], + "held_a": 1e-06, + "radio": { + "rx_a": 0.1, + "tx_dsss_a": 0.24, + "tx_ofdm_a": 0.19, + "tx_ht_a": 0.18 + } + }, + "console": { + "default": "UART0" + }, + "fidelity": { + "functional": { + "claims": "The two Xtensa LX6 cores (mcu/xtensa/lx6.c, lx6fp.c) as Espressif's core-isa.h configures them: the core and density instructions, the windowed registers (64, the overflow check of every instruction, CALL4/8/12, ENTRY, RETW and its underflow, MOVSP, ROTW, L32E/S32E), zero-overhead loops, MUL16/MULL/MULUH/MULSH, QUOS/QUOU/REMS/REMU, NSA, MIN/MAX, SEXT, CLAMPS, booleans, S32C1I with SCOMPARE1, THREADPTR, MISC0-3, PRID (0xCDCD, 0xABAB), the MAC16 package, the single-precision FPU (IEEE rounding modes and flags; the division and square root sequences libgcc runs give correctly rounded results), XEA2 exceptions with relocatable vectors, 32 interrupts at core-isa.h's levels and types (level, edge, software, the CCOMPARE0-2 timers against CCOUNT, NMI), RSIL, WAITI, RFI, the debug option's BREAK, IBREAK, DBREAK and ICOUNT, region protection (eight 512 MB regions, 15 no access), unaligned loads and stores, and the instruction bus's 32-bit-only data accesses. Both cores share the machine, the APP_CPU held in reset until DPORT releases it and seeing the ROM with its pointers into the PRO_CPU's ROM data moved to its own, as Espressif's own APP_CPU ROM image has them. The boot: Espressif's ROM (esp32_rev300_rom.elf, chip revision v3) from the reset vector, its banner, the strapping pins (GPIO_STRAP: SPI_FAST_FLASH_BOOT, or the download mode with GPIO0 low), the reset causes (RTC_CNTL), the eFuse glitch check, the flash read through SPI1, ESP-IDF's second-stage bootloader and its image check on the SHA accelerator, the caches' flash MMU, and the application on both cores. The models: DPORT (the APP_CPU's reset, clock and stall, CPU_PER_CONF, the caches' flush and state, the flash MMU tables, the interrupt matrix's 69 sources, the cross-CPU interrupts), RTC_CNTL (reset causes, the RTC timer, the RTC watchdog with its flash-boot protection, the software resets and stalls, the store registers, SOC_CLK_SEL), APB_CTRL (the CPU and APB clocks from XTAL, PLL or RC_FAST), the eFuse controller with the chip's factory bits (ESP32-D0WD-V3 v3.1, a MAC with its CRC, or the board settings'), GPIO and IO_MUX (40 pads, the matrix, pulls, open drain, interrupts on each CPU, the strapping latch), UART0-2 (FIFOs, frames at the baud rate, interrupts, MEM_RX_STATUS's addresses that ESP-IDF counts the bytes waiting from), TIMG0/1 (T0, T1, the LAC timer, the MWDT with its flash-boot protection, the RTC_SLOW_CLK calibration), SPI0/SPI1 with the module's Giantec GT25Q32A flash (C4 60 16, the ID the owner's board reports), the SHA accelerator (SHA-1, -256, -384, -512), LEDC (eight high-speed and eight low-speed PWM channels on eight timers, fading, on the matrix's ledc_hs/ls_sig_out), I2C0 and I2C1 (master and slave on the open-drain lines through the matrix, the 16 commands with RSTART, WRITE, READ, STOP and END, the bus timing in APB_CLK cycles, ACK checks, arbitration, the SCL timeout, the 32-byte FIFOs through DATA and its AHB view, 7- and 10-bit slave addresses; ESP-IDF's i2c_eeprom runs on a 24LC256), the RMT (eight channels sending or receiving through the matrix, 64-word blocks of the 512-word RAM, end markers, continuous mode, wrap, TX_LIM's threshold, the carrier, the receiver's idle threshold and filter, the RAM through CHnDATA; ESP-IDF's led_strip lights a WS2812B), the SAR ADCs as SENS's RTC controller drives them (one conversion at a time on ADC1's eight and ADC2's ten pads, the attenuations, 9 to 12 bits, the converter's inverted output and DATA_INV, the conversion's time; the transfer the line ESP-IDF's Vref calibration fits for the chip, its eFuse Vref), the two DACs on GPIO25 and GPIO26 (RTC_IO's PAD_DAC1/2: powered and the RTC IO MUX's, VDD3P3_RTC x code / 255 on the pad, which ADC2 reads back), PERIP_RST_EN's resets of I2C0, I2C1 and LEDC, the internal analog I2C master, the random number generator and the peripherals' AHB view. The evidence: test_lx6.c's programs assembled by Espressif's assembler (integer, shifts, multiply and divide, loops, branches, memory with S32C1I, windowed recursion through the ROM's own window vectors, SYSCALL, the CCOMPARE timer interrupt, FPU, MAC16) and the APP_CPU's ROM data kept apart; ESP-IDF v5.4's hello_world, blink, ledc_basic, i2c_eeprom, gptimer, uart_echo, real_time_stats, blink with its LED strip, adc oneshot_read and dac_oneshot built unmodified for the esp32 target on the ESP32-DevKitC V4, from the ROM's banner to esp_restart; Arduino-ESP32 3.2.0's sketches for \"ESP32 Dev Module\" (AnalogReadSerial, ReadAnalogVoltage, DigitalReadSerial, GetChipID, RepeatTimer, with FreeRTOS's stack-end watchpoints on); the ROM image equals Espressif QEMU's esp32-v3-rom.bin byte for byte, and the APP_CPU's view of it QEMU's esp32-v3-rom-app.bin.", + "omissions": [ + "Wi-Fi, Bluetooth and the RF front end (WIFI_MAC, BB, NRX, FE: their registers keep what is written)", + "the double-precision accelerator's instructions (F64ADDC, F64ITER and the others: their encodings are public, not what they do; a program that runs one stops with a diagnostic), though its registers are kept", + "PSRAM (DRAM1), the boot remap, the APB/AHB access permissions, the caches' lock regions and timing (the mapped pages are read whole), the MMU's access-error interrupts", + "RMT: the memory's power-down (MEM_PD), STATUS's STATE and the APB-side error bits, the carrier on an idle output", + "the SAR ADCs: the nonlinearity above about 2450 mV at 11 dB and a chip's spread from the fitted line, noise, the ULP's and the digital controller's (DMA, I2S) conversions, the Hall sensor, ADC2's arbitration with Wi-Fi, the RTC IO MUX's routing of a pad to the ADC (not checked)", + "the DACs: the cosine-wave generator and the DMA path (I2S0), the output's impedance (a stiff source: the datasheet gives none) and its offset and nonlinearity", + "I2C: the non-FIFO mode (NONFIFO_EN, RX_REC_FULL, TX_SEND_EMPTY), SAMPLE_SCL_LEVEL, the input filters (only their share of the SCL high time), 10-bit addressing's R/W check", + "the peripherals without a model yet: I2S0/1, SPI2/3 (HSPI, VSPI), MCPWM, PCNT, TWAI, SDMMC, EMAC, the touch sensor, the RTC IO MUX's other pads and the ULP coprocessor, the AES and RSA accelerators, flash encryption", + "sleep modes (light and deep sleep, the power domains), brown-out", + "the eFuse 3/4 coding scheme's check, BLOCK0's per-field write protection" + ], + "validation": [ + "repo:tests/unit/test_lx6.c", + "repo:tests/vendor/esp-idf/run.py", + "repo:tests/vendor/esp-idf/examples/esp32_hello_world/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_blink/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_ledc_basic/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_i2c_eeprom/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_gptimer/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_uart_echo/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_real_time_stats/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_blink_strip/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_adc_oneshot_read/scenario.json", + "repo:tests/vendor/esp-idf/examples/esp32_dac_oneshot/scenario.json", + "repo:tests/vendor/arduino-esp32/run.py" + ] + }, + "timed": { + "claims": "Instruction timing estimated: one cycle, a taken branch, jump, call or return three, MULL two, a division twelve, an exception's entry three; CCOUNT counts those cycles. The clocks follow the registers: CPU_CLK from XTAL (40 MHz out of reset), the PLL's 80, 160 or 240 MHz, or RC_FAST; APB_CLK; RTC_SLOW_CLK at the RC oscillator's nominal 150 kHz.", + "omissions": [ + "the LX6 pipeline's interlocks and the loop buffer's timing", + "cache misses and flash latency (the SPI transfers' bus time is counted on SPI1, the flash's own program and erase times too)", + "the RC oscillators' error and drift" + ], + "validation": [] + }, + "electrical": { + "claims": "GPIO pin-model defaults at 3.3 V from the datasheet's DC characteristics: VIH 0.75 VDD, VIL 0.25 VDD, VOH 0.8 VDD, VOL 0.1 VDD, 45 kOhm pulls; GPIO34-39 inputs only. The supply current (ADR-036, datasheet v5.3's power modes): the cores running and waiting at their clock, and held off.", + "omissions": [ + "the pads' drive strengths' effect", + "each peripheral's own current (the datasheet gives the modes, not the parts)" + ], + "validation": [] + } + }, + "provenance": { + "author": "EmbSIM", + "license": "Apache-2.0", + "sources": [ + { + "title": "ESP32 Technical Reference Manual", + "rev": "v5" + }, + { + "title": "ESP32 Series Datasheet", + "rev": "v4" + }, + { + "title": "Espressif esp32.svd (espressif/svd)", + "rev": "be20aa1" + }, + { + "title": "Espressif esp-rom-elfs, esp32_rev300_rom.elf (sha256 920b70635440517866aab2230964a570d2cf2b676658d93c52fbac108c1cca31)", + "rev": "20241011" + }, + { + "title": "Espressif ESP-IDF, components/xtensa/esp32/include/xtensa/config/core-isa.h and esp32.rom.ld", + "rev": "v5.4" + }, + { + "title": "Cadence Xtensa Instruction Set Architecture Reference Manual" + }, + { + "title": "Giantec GT25Q32A-U datasheet (the module's flash)", + "rev": "V2.5" + } + ], + "notes": "The register description is converted from Espressif's Apache-2.0 SVD; the boot ROM's image from Espressif's Apache-2.0 ROM ELF; the instruction encodings checked against Espressif's assembler." + }, + "signals": [ + "GPIO0", + "GPIO1", + "GPIO2", + "GPIO3", + "GPIO4", + "GPIO5", + "GPIO6", + "GPIO7", + "GPIO8", + "GPIO9", + "GPIO10", + "GPIO11", + "GPIO12", + "GPIO13", + "GPIO14", + "GPIO15", + "GPIO16", + "GPIO17", + "GPIO18", + "GPIO19", + "GPIO21", + "GPIO22", + "GPIO23", + "GPIO25", + "GPIO26", + "GPIO27", + "GPIO32", + "GPIO33", + "GPIO34", + "GPIO35", + "GPIO36", + "GPIO37", + "GPIO38", + "GPIO39", + "CHIP_EN", + "GND", + "LNA_IN", + "VDD3P3", + "VDD3P3_CPU", + "VDD3P3_RTC", + "VDDA", + "VDD_SDIO", + "XTAL_N", + "XTAL_P" + ], + "packages": { + "wroom32e": "wroom32e.json" + }, + "i18n": { + "fr": { + "source": "97aa22899d11", + "description": "Espressif ESP32 (ESP32-D0WD-V3, révision de puce v3.1) : deux cœurs Xtensa LX6 jusqu'à 240 MHz, 520 Kio de SRAM, 448 Kio de ROM, 16 Kio de mémoire RTC, une flash SPI externe derrière les caches des cœurs, Wi-Fi et Bluetooth ; le MCU de l'ESP32-DevKitC. La ROM d'Espressif, le bootloader de second niveau d'ESP-IDF et les applications ESP-IDF tournent sur les deux cœurs ; les radios ne sont pas encore modélisées.", + "fidelity": { + "functional": { + "claims": "Les deux cœurs Xtensa LX6 (mcu/xtensa/lx6.c, lx6fp.c) tels que les configure le core-isa.h d'Espressif : les instructions de base et de densité, les registres fenêtrés (64, le contrôle de débordement de chaque instruction, CALL4/8/12, ENTRY, RETW et son sous-débordement, MOVSP, ROTW, L32E/S32E), les boucles sans surcoût, MUL16/MULL/MULUH/MULSH, QUOS/QUOU/REMS/REMU, NSA, MIN/MAX, SEXT, CLAMPS, les booléens, S32C1I avec SCOMPARE1, THREADPTR, MISC0-3, PRID (0xCDCD, 0xABAB), le paquet MAC16, la FPU simple précision (modes d'arrondi et drapeaux IEEE ; les séquences de division et de racine carrée qu'exécute libgcc donnent des résultats correctement arrondis), les exceptions XEA2 avec vecteurs relocalisables, 32 interruptions aux niveaux et types de core-isa.h (niveau, front, logicielles, les temporisateurs CCOMPARE0-2 contre CCOUNT, NMI), RSIL, WAITI, RFI, BREAK, IBREAK, DBREAK et ICOUNT de l'option de débogage, la protection par régions (huit régions de 512 Mo, 15 sans accès), les chargements et écritures non alignés, et les accès de données en 32 bits seulement du bus d'instructions. Les deux cœurs partagent la machine, l'APP_CPU maintenu en reset jusqu'à ce que DPORT le libère et voyant la ROM avec ses pointeurs vers les données ROM du PRO_CPU déplacés vers les siennes, comme dans l'image ROM APP_CPU d'Espressif. Le démarrage : la ROM d'Espressif (esp32_rev300_rom.elf, révision v3) depuis le vecteur de reset, sa bannière, les broches de configuration (GPIO_STRAP : SPI_FAST_FLASH_BOOT, ou le mode téléchargement avec GPIO0 bas), les causes de reset (RTC_CNTL), le contrôle anti-glitch de l'eFuse, la lecture de la flash par SPI1, le bootloader de second niveau d'ESP-IDF et sa vérification d'image sur l'accélérateur SHA, la MMU flash des caches, et l'application sur les deux cœurs. Les modèles : DPORT (reset, horloge et blocage de l'APP_CPU, CPU_PER_CONF, vidage et état des caches, tables de la MMU flash, les 69 sources de la matrice d'interruptions, les interruptions inter-CPU), RTC_CNTL (causes de reset, le temporisateur RTC, le chien de garde RTC avec sa protection au démarrage sur flash, les resets et blocages logiciels, les registres de stockage, SOC_CLK_SEL), APB_CTRL (les horloges CPU et APB depuis XTAL, PLL ou RC_FAST), le contrôleur eFuse avec les bits d'usine de la puce (ESP32-D0WD-V3 v3.1, une MAC avec son CRC, ou celle des réglages de la carte), GPIO et IO_MUX (40 plots, la matrice, tirages, drain ouvert, interruptions sur chaque CPU, le verrou de configuration), UART0-2 (FIFO, trames au débit, interruptions, les adresses de MEM_RX_STATUS d'après lesquelles ESP-IDF compte les octets en attente), TIMG0/1 (T0, T1, le temporisateur LAC, le MWDT avec sa protection au démarrage sur flash, la calibration de RTC_SLOW_CLK), SPI0/SPI1 avec la flash Giantec GT25Q32A du module (C4 60 16, l'identifiant que rapporte la carte du propriétaire), l'accélérateur SHA (SHA-1, -256, -384, -512), LEDC (huit canaux MLI rapides et huit lents sur huit temporisateurs, le fondu, sur ledc_hs/ls_sig_out de la matrice), I2C0 et I2C1 (maître et esclave sur les lignes à drain ouvert à travers la matrice, les 16 commandes avec RSTART, WRITE, READ, STOP et END, le timing du bus en cycles d'APB_CLK, les contrôles d'ACK, l'arbitrage, le délai d'attente sur SCL, les FIFO de 32 octets par DATA et sa vue AHB, les adresses esclaves sur 7 et 10 bits ; l'exemple i2c_eeprom d'ESP-IDF fonctionne avec une 24LC256), le RMT (huit canaux qui émettent ou reçoivent à travers la matrice, des blocs de 64 mots de la RAM de 512 mots, les marqueurs de fin, le mode continu, le rebouclage, le seuil de TX_LIM, la porteuse, le seuil d'inactivité et le filtre du récepteur, la RAM par CHnDATA ; le led_strip d'ESP-IDF allume une WS2812B), les ADC SAR tels que les pilote le contrôleur RTC de SENS (une conversion à la fois sur les huit plots de l'ADC1 et les dix de l'ADC2, les atténuations, 9 à 12 bits, la sortie inversée du convertisseur et DATA_INV, la durée de la conversion ; la caractéristique est la droite que la calibration Vref d'ESP-IDF ajuste pour la puce, avec son Vref d'eFuse), les deux DAC sur GPIO25 et GPIO26 (PAD_DAC1/2 de RTC_IO : alimentés et confiés à l'IO MUX RTC, VDD3P3_RTC x code / 255 sur le plot, que l'ADC2 relit), les resets de PERIP_RST_EN pour I2C0, I2C1 et LEDC, le maître I2C analogique interne, le générateur de nombres aléatoires et la vue AHB des périphériques. Les preuves : les programmes de test_lx6.c assemblés par l'assembleur d'Espressif (entiers, décalages, multiplication et division, boucles, branchements, mémoire avec S32C1I, récursion fenêtrée à travers les vecteurs de fenêtre de la ROM, SYSCALL, l'interruption du temporisateur CCOMPARE, FPU, MAC16) et les données ROM de l'APP_CPU tenues à part ; hello_world, blink, ledc_basic, i2c_eeprom, gptimer, uart_echo, real_time_stats, blink avec son ruban de LED, adc oneshot_read et dac_oneshot d'ESP-IDF v5.4 compilés sans modification pour la cible esp32 sur l'ESP32-DevKitC V4, de la bannière de la ROM jusqu'à esp_restart ; les croquis d'Arduino-ESP32 3.2.0 pour « ESP32 Dev Module » (AnalogReadSerial, ReadAnalogVoltage, DigitalReadSerial, GetChipID, RepeatTimer, avec les points d'arrêt de fin de pile de FreeRTOS actifs) ; l'image ROM est identique octet pour octet à l'esp32-v3-rom.bin du QEMU d'Espressif, et la vue qu'en a l'APP_CPU à son esp32-v3-rom-app.bin.", + "omissions": [ + "le Wi-Fi, le Bluetooth et l'étage RF (WIFI_MAC, BB, NRX, FE : leurs registres gardent ce qui y est écrit)", + "les instructions de l'accélérateur double précision (F64ADDC, F64ITER et les autres : leurs encodages sont publics, pas ce qu'elles font ; un programme qui en exécute une s'arrête avec un diagnostic), bien que ses registres soient conservés", + "la PSRAM (DRAM1), le remappage de démarrage, les permissions d'accès APB/AHB, les régions verrouillées et le timing des caches (les pages mappées sont lues entières), les interruptions d'erreur d'accès de la MMU", + "RMT : la mise hors tension de la mémoire (MEM_PD), le champ STATE de STATUS et les bits d'erreur côté APB, la porteuse sur une sortie inactive", + "les ADC SAR : la non-linéarité au-delà d'environ 2450 mV à 11 dB et l'écart d'une puce à la droite ajustée, le bruit, les conversions de l'ULP et du contrôleur numérique (DMA, I2S), le capteur à effet Hall, l'arbitrage de l'ADC2 avec le Wi-Fi, le routage d'un plot vers l'ADC par l'IO MUX RTC (non vérifié)", + "les DAC : le générateur d'onde cosinus et la voie DMA (I2S0), l'impédance de sortie (une source idéale : la fiche technique n'en donne pas), leur décalage et leur non-linéarité", + "I2C : le mode hors FIFO (NONFIFO_EN, RX_REC_FULL, TX_SEND_EMPTY), SAMPLE_SCL_LEVEL, les filtres d'entrée (seulement leur part du temps haut de SCL), le contrôle R/W de l'adressage sur 10 bits", + "les périphériques sans modèle pour l'instant : I2S0/1, SPI2/3 (HSPI, VSPI), MCPWM, PCNT, TWAI, SDMMC, EMAC, le capteur tactile, les autres plots de l'IO MUX RTC et le coprocesseur ULP, les accélérateurs AES et RSA, le chiffrement de la flash", + "les modes de veille (veille légère et profonde, les domaines d'alimentation), la détection de baisse de tension", + "le contrôle du schéma de codage 3/4 de l'eFuse, la protection en écriture par champ du BLOCK0" + ] + }, + "timed": { + "claims": "Timing des instructions estimé : un cycle, trois pour un branchement pris, un saut, un appel ou un retour, deux pour MULL, douze pour une division, trois pour l'entrée d'une exception ; CCOUNT compte ces cycles. Les horloges suivent les registres : CPU_CLK depuis XTAL (40 MHz en sortie de reset), les 80, 160 ou 240 MHz de la PLL, ou RC_FAST ; APB_CLK ; RTC_SLOW_CLK aux 150 kHz nominaux de l'oscillateur RC.", + "omissions": [ + "les verrouillages du pipeline LX6 et le timing du tampon de boucle", + "les défauts de cache et la latence de la flash (le temps de bus des transferts SPI est compté sur SPI1, ainsi que les temps de programmation et d'effacement de la flash)", + "l'erreur et la dérive des oscillateurs RC" + ] + }, + "electrical": { + "claims": "Valeurs par défaut du modèle de broche GPIO à 3,3 V d'après les caractéristiques DC de la fiche technique : VIH 0,75 VDD, VIL 0,25 VDD, VOH 0,8 VDD, VOL 0,1 VDD, tirages de 45 kOhm ; GPIO34-39 en entrée seulement. Le courant d'alimentation (ADR-036, modes d'alimentation de la fiche technique v5.3) : les cœurs actifs et en attente à leur horloge, et maintenus éteints.", + "omissions": [ + "l'effet de la force de sortie des plots", + "le courant propre de chaque périphérique (la fiche technique donne les modes, pas les parties)" + ] + } + } + } + } +} diff --git a/catalog/mcus/espressif/esp32/registers.json b/catalog/mcus/espressif/esp32/registers.json new file mode 100644 index 000000000..b6a5b7d95 --- /dev/null +++ b/catalog/mcus/espressif/esp32/registers.json @@ -0,0 +1,56558 @@ +{ + "schema_version": 1, + "kind": "registers", + "id": "espressif/esp32/registers", + "version": "1.0.0", + "device": "ESP32", + "source": "converted from esp32.svd by tools/importers/svd2regs.py; peripherals left out: RNG (the random number generator's one register (RNG_DATA, TRM 26), which the SVD puts at the AHB address 0x60035144; the chip's model answers at 0x3FF75144 and its AHB alias (misc.c)); memories added: RMT.RAM at 0x800, 512 words (the channels' RAM, eight blocks of 64 words (TRM 15.2.2, RMTMEM at 0x3FF56800)); fields corrected from the reference manual: DPORT.WIFI_CLK_EN.WIFI_CLK_EN:0:32; fields reserved by the reference manual taken out: GPIO.CPUSDIO_INT1.PIN_PAD_DRIVER, GPIO.CPUSDIO_INT1.PIN_INT_TYPE, GPIO.CPUSDIO_INT1.PIN_WAKEUP_ENABLE, GPIO.CPUSDIO_INT1.PIN_CONFIG, GPIO.CPUSDIO_INT1.PIN_INT_ENA, SENS.SAR_MEAS_WAIT2.FORCE_XPD_SAR_SW; overlapping fields taken out: DPORT.PRO_DCACHE_DBUG0 (PRO_CACHE_MMU_IA), DPORT.PRO_DCACHE_DBUG3 (PRO_CPU_DISABLED_CACHE_IA), DPORT.APP_DCACHE_DBUG0 (APP_CACHE_MMU_IA), DPORT.APP_DCACHE_DBUG3 (APP_CPU_DISABLED_CACHE_IA), DPORT.PRO_CPU_RECORD_PDEBUGINST (RECORD_PRO_PDEBUGINST), DPORT.PRO_CPU_RECORD_PDEBUGSTATUS (RECORD_PRO_PDEBUGSTATUS, RECORD_PDEBUGSTATUS_INSNTYPE), DPORT.PRO_CPU_RECORD_PDEBUGDATA (RECORD_PRO_PDEBUGDATA, RECORD_PDEBUGDATA_EXCVEC, RECORD_PDEBUGDATA_INSNTYPE_SR, RECORD_PDEBUGDATA_INSNTYPE_RER, RECORD_PDEBUGDATA_INSNTYPE_WER, RECORD_PDEBUGDATA_INSNTYPE_ER, RECORD_PDEBUGDATA_STALL_IPIF, RECORD_PDEBUGDATA_INSNTYPE_RSR, RECORD_PDEBUGDATA_INSNTYPE_WSR, RECORD_PDEBUGDATA_INSNTYPE_XSR, RECORD_PDEBUGDATA_STALL_BPIFETCH, RECORD_PDEBUGDATA_EXCCAUSE, RECORD_PDEBUGDATA_STALL_BANKCONFL), DPORT.PRO_CPU_RECORD_PDEBUGLS0STAT (RECORD_PRO_PDEBUGLS0STAT), DPORT.CACHE_IA_INT_EN (CACHE_IA_INT_EN), UART0.MEM_RX_STATUS (MEM_RX_STATUS), RTC_CNTL.LOW_POWER_ST (LOW_POWER_DIAG0), RTC_CNTL.BROWN_OUT (RTC_MEM_CRC_ADDR, RTC_MEM_CRC_LEN, RTC_MEM_CRC_FINISH), RMT.CH0STATUS (STATUS), RMT.CH1STATUS (STATUS), RMT.CH2STATUS (STATUS), RMT.CH3STATUS (STATUS), RMT.CH4STATUS (STATUS), RMT.CH5STATUS (STATUS), RMT.CH6STATUS (STATUS), RMT.CH7STATUS (STATUS), PCNT.U0_STATUS (CORE_STATUS_U0), PCNT.U1_STATUS (CORE_STATUS_U0), PCNT.U2_STATUS (CORE_STATUS_U0), PCNT.U3_STATUS (CORE_STATUS_U0), PCNT.U4_STATUS (CORE_STATUS_U0), PCNT.U5_STATUS (CORE_STATUS_U0), PCNT.U6_STATUS (CORE_STATUS_U0), PCNT.U7_STATUS (CORE_STATUS_U0)", + "interrupts": { + "WIFI_MAC": 0, + "WIFI_NMI": 1, + "WIFI_BB": 2, + "BT_MAC": 3, + "BT_BB": 4, + "BT_BB_NMI": 5, + "RWBT": 6, + "RWBLE": 7, + "RWBT_NMI": 8, + "RWBLE_NMI": 9, + "UHCI0": 12, + "UHCI1": 13, + "TG0_T0_LEVEL": 14, + "TG0_T1_LEVEL": 15, + "TG0_WDT_LEVEL": 16, + "TG0_LACT_LEVEL": 17, + "TG1_T0_LEVEL": 18, + "TG1_T1_LEVEL": 19, + "TG1_WDT_LEVEL": 20, + "TG1_LACT_LEVEL": 21, + "GPIO": 22, + "GPIO_NMI": 23, + "FROM_CPU_INTR0": 24, + "FROM_CPU_INTR1": 25, + "FROM_CPU_INTR2": 26, + "FROM_CPU_INTR3": 27, + "SPI0": 28, + "SPI1": 29, + "SPI2": 30, + "SPI3": 31, + "I2S0": 32, + "I2S1": 33, + "UART0": 34, + "UART1": 35, + "UART2": 36, + "SDIO_HOST": 37, + "ETH_MAC": 38, + "MCPWM0": 39, + "MCPWM1": 40, + "MCPWM2": 41, + "MCPWM3": 42, + "LEDC": 43, + "EFUSE": 44, + "TWAI0": 45, + "RTC_CORE": 46, + "RMT": 47, + "PCNT": 48, + "I2C_EXT0": 49, + "I2C_EXT1": 50, + "RSA": 51, + "SPI1_DMA": 52, + "SPI2_DMA": 53, + "SPI3_DMA": 54, + "WDT": 55, + "TIMER1": 56, + "TIMER2": 57, + "TG0_T0_EDGE": 58, + "TG0_T1_EDGE": 59, + "TG0_WDT_EDGE": 60, + "TG0_LACT_EDGE": 61, + "TG1_T0_EDGE": 62, + "TG1_T1_EDGE": 63, + "TG1_WDT_EDGE": 64, + "TG1_LACT_EDGE": 65, + "MMU_IA": 66, + "MPU_IA": 67, + "CACHE_IA": 68 + }, + "peripherals": [ + { + "name": "DPORT", + "base": "0x3FF00000", + "interrupts": [ + "WIFI_MAC", + "WIFI_NMI", + "WIFI_BB", + "BT_MAC", + "BT_BB", + "BT_BB_NMI", + "RWBT", + "RWBLE", + "RWBT_NMI", + "RWBLE_NMI", + "FROM_CPU_INTR0", + "FROM_CPU_INTR1", + "FROM_CPU_INTR2", + "FROM_CPU_INTR3", + "SDIO_HOST", + "ETH_MAC", + "WDT", + "MMU_IA", + "MPU_IA", + "CACHE_IA" + ], + "registers": [ + { + "name": "PRO_BOOT_REMAP_CTRL", + "offset": "0x00", + "fields": [ + [ + "PRO_BOOT_REMAP", + 0, + 1 + ] + ] + }, + { + "name": "APP_BOOT_REMAP_CTRL", + "offset": "0x04", + "fields": [ + [ + "APP_BOOT_REMAP", + 0, + 1 + ] + ] + }, + { + "name": "ACCESS_CHECK", + "offset": "0x08", + "fields": [ + [ + "PRO", + 0, + 1, + "r" + ], + [ + "APP", + 8, + 1, + "r" + ] + ] + }, + { + "name": "PRO_DPORT_APB_MASK0", + "offset": "0x0C", + "fields": [ + [ + "PRODPORT_APB_MASK0", + 0, + 32 + ] + ] + }, + { + "name": "PRO_DPORT_APB_MASK1", + "offset": "0x10", + "fields": [ + [ + "PRODPORT_APB_MASK1", + 0, + 32 + ] + ] + }, + { + "name": "APP_DPORT_APB_MASK0", + "offset": "0x14", + "fields": [ + [ + "APPDPORT_APB_MASK0", + 0, + 32 + ] + ] + }, + { + "name": "APP_DPORT_APB_MASK1", + "offset": "0x18", + "fields": [ + [ + "APPDPORT_APB_MASK1", + 0, + 32 + ] + ] + }, + { + "name": "PERI_CLK_EN", + "offset": "0x1C", + "fields": [ + [ + "PERI_CLK_EN", + 0, + 32 + ] + ] + }, + { + "name": "PERI_RST_EN", + "offset": "0x20", + "fields": [ + [ + "PERI_RST_EN", + 0, + 32 + ] + ] + }, + { + "name": "WIFI_BB_CFG", + "offset": "0x24", + "fields": [ + [ + "WIFI_BB_CFG", + 0, + 32 + ] + ] + }, + { + "name": "WIFI_BB_CFG_2", + "offset": "0x28", + "fields": [ + [ + "WIFI_BB_CFG_2", + 0, + 32 + ] + ] + }, + { + "name": "APPCPU_CTRL_A", + "offset": "0x2C", + "reset": "0x00000001", + "fields": [ + [ + "APPCPU_RESETTING", + 0, + 1 + ] + ] + }, + { + "name": "APPCPU_CTRL_B", + "offset": "0x30", + "fields": [ + [ + "APPCPU_CLKGATE_EN", + 0, + 1 + ] + ] + }, + { + "name": "APPCPU_CTRL_C", + "offset": "0x34", + "fields": [ + [ + "APPCPU_RUNSTALL", + 0, + 1 + ] + ] + }, + { + "name": "APPCPU_CTRL_D", + "offset": "0x38", + "fields": [ + [ + "APPCPU_BOOT_ADDR", + 0, + 32 + ] + ] + }, + { + "name": "CPU_PER_CONF", + "offset": "0x3C", + "fields": [ + [ + "CPUPERIOD_SEL", + 0, + 2 + ], + [ + "LOWSPEED_CLK_SEL", + 2, + 1 + ], + [ + "FAST_CLK_RTC_SEL", + 3, + 1 + ] + ] + }, + { + "name": "PRO_CACHE_CTRL", + "offset": "0x40", + "reset": "0x00000010", + "fields": [ + [ + "PRO_CACHE_MODE", + 2, + 1 + ], + [ + "PRO_CACHE_ENABLE", + 3, + 1 + ], + [ + "PRO_CACHE_FLUSH_ENA", + 4, + 1 + ], + [ + "PRO_CACHE_FLUSH_DONE", + 5, + 1, + "r" + ], + [ + "PRO_CACHE_LOCK_0_EN", + 6, + 1 + ], + [ + "PRO_CACHE_LOCK_1_EN", + 7, + 1 + ], + [ + "PRO_CACHE_LOCK_2_EN", + 8, + 1 + ], + [ + "PRO_CACHE_LOCK_3_EN", + 9, + 1 + ], + [ + "PRO_SINGLE_IRAM_ENA", + 10, + 1 + ], + [ + "PRO_DRAM_SPLIT", + 11, + 1 + ], + [ + "PRO_AHB_SPI_REQ", + 12, + 1, + "r" + ], + [ + "PRO_SLAVE_REQ", + 13, + 1, + "r" + ], + [ + "AHB_SPI_REQ", + 14, + 1, + "r" + ], + [ + "SLAVE_REQ", + 15, + 1, + "r" + ], + [ + "PRO_DRAM_HL", + 16, + 1 + ] + ] + }, + { + "name": "PRO_CACHE_CTRL1", + "offset": "0x44", + "reset": "0x000008FF", + "fields": [ + [ + "PRO_CACHE_MASK_IRAM0", + 0, + 1 + ], + [ + "PRO_CACHE_MASK_IRAM1", + 1, + 1 + ], + [ + "PRO_CACHE_MASK_IROM0", + 2, + 1 + ], + [ + "PRO_CACHE_MASK_DRAM1", + 3, + 1 + ], + [ + "PRO_CACHE_MASK_DROM0", + 4, + 1 + ], + [ + "PRO_CACHE_MASK_OPSDRAM", + 5, + 1 + ], + [ + "PRO_CMMU_SRAM_PAGE_MODE", + 6, + 3 + ], + [ + "PRO_CMMU_FLASH_PAGE_MODE", + 9, + 2 + ], + [ + "PRO_CMMU_FORCE_ON", + 11, + 1 + ], + [ + "PRO_CMMU_PD", + 12, + 1 + ], + [ + "PRO_CACHE_MMU_IA_CLR", + 13, + 1 + ] + ] + }, + { + "name": "PRO_CACHE_LOCK_0_ADDR", + "offset": "0x48", + "fields": [ + [ + "PRE", + 0, + 14 + ], + [ + "MIN", + 14, + 4 + ], + [ + "MAX", + 18, + 4 + ] + ] + }, + { + "name": "PRO_CACHE_LOCK_1_ADDR", + "offset": "0x4C", + "fields": [ + [ + "PRE", + 0, + 14 + ], + [ + "MIN", + 14, + 4 + ], + [ + "MAX", + 18, + 4 + ] + ] + }, + { + "name": "PRO_CACHE_LOCK_2_ADDR", + "offset": "0x50", + "fields": [ + [ + "PRE", + 0, + 14 + ], + [ + "MIN", + 14, + 4 + ], + [ + "MAX", + 18, + 4 + ] + ] + }, + { + "name": "PRO_CACHE_LOCK_3_ADDR", + "offset": "0x54", + "fields": [ + [ + "PRE", + 0, + 14 + ], + [ + "MIN", + 14, + 4 + ], + [ + "MAX", + 18, + 4 + ] + ] + }, + { + "name": "APP_CACHE_CTRL", + "offset": "0x58", + "reset": "0x00000010", + "fields": [ + [ + "APP_CACHE_MODE", + 2, + 1 + ], + [ + "APP_CACHE_ENABLE", + 3, + 1 + ], + [ + "APP_CACHE_FLUSH_ENA", + 4, + 1 + ], + [ + "APP_CACHE_FLUSH_DONE", + 5, + 1, + "r" + ], + [ + "APP_CACHE_LOCK_0_EN", + 6, + 1 + ], + [ + "APP_CACHE_LOCK_1_EN", + 7, + 1 + ], + [ + "APP_CACHE_LOCK_2_EN", + 8, + 1 + ], + [ + "APP_CACHE_LOCK_3_EN", + 9, + 1 + ], + [ + "APP_SINGLE_IRAM_ENA", + 10, + 1 + ], + [ + "APP_DRAM_SPLIT", + 11, + 1 + ], + [ + "APP_AHB_SPI_REQ", + 12, + 1, + "r" + ], + [ + "APP_SLAVE_REQ", + 13, + 1, + "r" + ], + [ + "APP_DRAM_HL", + 14, + 1 + ] + ] + }, + { + "name": "APP_CACHE_CTRL1", + "offset": "0x5C", + "reset": "0x000008FF", + "fields": [ + [ + "APP_CACHE_MASK_IRAM0", + 0, + 1 + ], + [ + "APP_CACHE_MASK_IRAM1", + 1, + 1 + ], + [ + "APP_CACHE_MASK_IROM0", + 2, + 1 + ], + [ + "APP_CACHE_MASK_DRAM1", + 3, + 1 + ], + [ + "APP_CACHE_MASK_DROM0", + 4, + 1 + ], + [ + "APP_CACHE_MASK_OPSDRAM", + 5, + 1 + ], + [ + "APP_CMMU_SRAM_PAGE_MODE", + 6, + 3 + ], + [ + "APP_CMMU_FLASH_PAGE_MODE", + 9, + 2 + ], + [ + "APP_CMMU_FORCE_ON", + 11, + 1 + ], + [ + "APP_CMMU_PD", + 12, + 1 + ], + [ + "APP_CACHE_MMU_IA_CLR", + 13, + 1 + ] + ] + }, + { + "name": "APP_CACHE_LOCK_0_ADDR", + "offset": "0x60", + "fields": [ + [ + "PRE", + 0, + 14 + ], + [ + "MIN", + 14, + 4 + ], + [ + "MAX", + 18, + 4 + ] + ] + }, + { + "name": "APP_CACHE_LOCK_1_ADDR", + "offset": "0x64", + "fields": [ + [ + "PRE", + 0, + 14 + ], + [ + "MIN", + 14, + 4 + ], + [ + "MAX", + 18, + 4 + ] + ] + }, + { + "name": "APP_CACHE_LOCK_2_ADDR", + "offset": "0x68", + "fields": [ + [ + "PRE", + 0, + 14 + ], + [ + "MIN", + 14, + 4 + ], + [ + "MAX", + 18, + 4 + ] + ] + }, + { + "name": "APP_CACHE_LOCK_3_ADDR", + "offset": "0x6C", + "fields": [ + [ + "PRE", + 0, + 14 + ], + [ + "MIN", + 14, + 4 + ], + [ + "MAX", + 18, + 4 + ] + ] + }, + { + "name": "TRACEMEM_MUX_MODE", + "offset": "0x70", + "fields": [ + [ + "TRACEMEM_MUX_MODE", + 0, + 2 + ] + ] + }, + { + "name": "PRO_TRACEMEM_ENA", + "offset": "0x74", + "fields": [ + [ + "PRO_TRACEMEM_ENA", + 0, + 1 + ] + ] + }, + { + "name": "APP_TRACEMEM_ENA", + "offset": "0x78", + "fields": [ + [ + "APP_TRACEMEM_ENA", + 0, + 1 + ] + ] + }, + { + "name": "CACHE_MUX_MODE", + "offset": "0x7C", + "fields": [ + [ + "CACHE_MUX_MODE", + 0, + 2 + ] + ] + }, + { + "name": "IMMU_PAGE_MODE", + "offset": "0x80", + "fields": [ + [ + "INTERNAL_SRAM_IMMU_ENA", + 0, + 1 + ], + [ + "IMMU_PAGE_MODE", + 1, + 2 + ] + ] + }, + { + "name": "DMMU_PAGE_MODE", + "offset": "0x84", + "fields": [ + [ + "INTERNAL_SRAM_DMMU_ENA", + 0, + 1 + ], + [ + "DMMU_PAGE_MODE", + 1, + 2 + ] + ] + }, + { + "name": "ROM_MPU_ENA", + "offset": "0x88", + "fields": [ + [ + "SHARE_ROM_MPU_ENA", + 0, + 1 + ], + [ + "PRO_ROM_MPU_ENA", + 1, + 1 + ], + [ + "APP_ROM_MPU_ENA", + 2, + 1 + ] + ] + }, + { + "name": "MEM_PD_MASK", + "offset": "0x8C", + "reset": "0x00000001", + "fields": [ + [ + "LSLP_MEM_PD_MASK", + 0, + 1 + ] + ] + }, + { + "name": "ROM_PD_CTRL", + "offset": "0x90", + "fields": [ + [ + "PRO_ROM_PD", + 0, + 1 + ], + [ + "APP_ROM_PD", + 1, + 1 + ], + [ + "SHARE_ROM_PD", + 2, + 6 + ] + ] + }, + { + "name": "ROM_FO_CTRL", + "offset": "0x94", + "reset": "0x00000003", + "fields": [ + [ + "PRO_ROM_FO", + 0, + 1 + ], + [ + "APP_ROM_FO", + 1, + 1 + ], + [ + "SHARE_ROM_FO", + 2, + 6 + ] + ] + }, + { + "name": "SRAM_PD_CTRL_0", + "offset": "0x98", + "fields": [ + [ + "SRAM_PD_0", + 0, + 32 + ] + ] + }, + { + "name": "SRAM_PD_CTRL_1", + "offset": "0x9C", + "fields": [ + [ + "SRAM_PD_1", + 0, + 1 + ] + ] + }, + { + "name": "SRAM_FO_CTRL_0", + "offset": "0xA0", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "SRAM_FO_0", + 0, + 32 + ] + ] + }, + { + "name": "SRAM_FO_CTRL_1", + "offset": "0xA4", + "reset": "0x00000001", + "fields": [ + [ + "SRAM_FO_1", + 0, + 1 + ] + ] + }, + { + "name": "IRAM_DRAM_AHB_SEL", + "offset": "0xA8", + "fields": [ + [ + "MASK_PRO_IRAM", + 0, + 1 + ], + [ + "MASK_APP_IRAM", + 1, + 1 + ], + [ + "MASK_PRO_DRAM", + 2, + 1 + ], + [ + "MASK_APP_DRAM", + 3, + 1 + ], + [ + "MASK_AHB", + 4, + 1 + ], + [ + "MAC_DUMP_MODE", + 5, + 2 + ] + ] + }, + { + "name": "TAG_FO_CTRL", + "offset": "0xAC", + "reset": "0x00000101", + "fields": [ + [ + "PRO_CACHE_TAG_FORCE_ON", + 0, + 1 + ], + [ + "PRO_CACHE_TAG_PD", + 1, + 1 + ], + [ + "APP_CACHE_TAG_FORCE_ON", + 8, + 1 + ], + [ + "APP_CACHE_TAG_PD", + 9, + 1 + ] + ] + }, + { + "name": "AHB_LITE_MASK", + "offset": "0xB0", + "fields": [ + [ + "PRO", + 0, + 1 + ], + [ + "APP", + 4, + 1 + ], + [ + "SDIO", + 8, + 1 + ], + [ + "PRODPORT", + 9, + 1 + ], + [ + "APPDPORT", + 10, + 1 + ], + [ + "AHB_LITE_SDHOST_PID", + 11, + 3 + ] + ] + }, + { + "name": "AHB_MPU_TABLE_0", + "offset": "0xB4", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "AHB_ACCESS_GRANT_0", + 0, + 32 + ] + ] + }, + { + "name": "AHB_MPU_TABLE_1", + "offset": "0xB8", + "reset": "0x000001FF", + "fields": [ + [ + "AHB_ACCESS_GRANT_1", + 0, + 9 + ] + ] + }, + { + "name": "HOST_INF_SEL", + "offset": "0xBC", + "fields": [ + [ + "PERI_IO_SWAP", + 0, + 8 + ], + [ + "LINK_DEVICE_SEL", + 8, + 8 + ] + ] + }, + { + "name": "PERIP_CLK_EN", + "offset": "0xC0", + "reset": "0xF9C1E06F", + "fields": [ + [ + "TIMERS_CLK_EN", + 0, + 1 + ], + [ + "SPI01_CLK_EN", + 1, + 1 + ], + [ + "UART_CLK_EN", + 2, + 1 + ], + [ + "WDG_CLK_EN", + 3, + 1 + ], + [ + "I2S0_CLK_EN", + 4, + 1 + ], + [ + "UART1_CLK_EN", + 5, + 1 + ], + [ + "SPI2_CLK_EN", + 6, + 1 + ], + [ + "I2C0_EXT0_CLK_EN", + 7, + 1 + ], + [ + "UHCI0_CLK_EN", + 8, + 1 + ], + [ + "RMT_CLK_EN", + 9, + 1 + ], + [ + "PCNT_CLK_EN", + 10, + 1 + ], + [ + "LEDC_CLK_EN", + 11, + 1 + ], + [ + "UHCI1_CLK_EN", + 12, + 1 + ], + [ + "TIMERGROUP_CLK_EN", + 13, + 1 + ], + [ + "EFUSE_CLK_EN", + 14, + 1 + ], + [ + "TIMERGROUP1_CLK_EN", + 15, + 1 + ], + [ + "SPI3_CLK_EN", + 16, + 1 + ], + [ + "PWM0_CLK_EN", + 17, + 1 + ], + [ + "I2C_EXT1_CLK_EN", + 18, + 1 + ], + [ + "TWAI_CLK_EN", + 19, + 1 + ], + [ + "PWM1_CLK_EN", + 20, + 1 + ], + [ + "I2S1_CLK_EN", + 21, + 1 + ], + [ + "SPI_DMA_CLK_EN", + 22, + 1 + ], + [ + "UART2_CLK_EN", + 23, + 1 + ], + [ + "UART_MEM_CLK_EN", + 24, + 1 + ], + [ + "PWM2_CLK_EN", + 25, + 1 + ], + [ + "PWM3_CLK_EN", + 26, + 1 + ] + ] + }, + { + "name": "PERIP_RST_EN", + "offset": "0xC4", + "fields": [ + [ + "TIMERS_RST", + 0, + 1 + ], + [ + "SPI01_RST", + 1, + 1 + ], + [ + "UART_RST", + 2, + 1 + ], + [ + "WDG_RST", + 3, + 1 + ], + [ + "I2S0_RST", + 4, + 1 + ], + [ + "UART1_RST", + 5, + 1 + ], + [ + "SPI2_RST", + 6, + 1 + ], + [ + "I2C0_EXT0_RST", + 7, + 1 + ], + [ + "UHCI0_RST", + 8, + 1 + ], + [ + "RMT_RST", + 9, + 1 + ], + [ + "PCNT_RST", + 10, + 1 + ], + [ + "LEDC_RST", + 11, + 1 + ], + [ + "UHCI1_RST", + 12, + 1 + ], + [ + "TIMERGROUP_RST", + 13, + 1 + ], + [ + "EFUSE_RST", + 14, + 1 + ], + [ + "TIMERGROUP1_RST", + 15, + 1 + ], + [ + "SPI3_RST", + 16, + 1 + ], + [ + "PWM0_RST", + 17, + 1 + ], + [ + "I2C_EXT1_RST", + 18, + 1 + ], + [ + "TWAI_RST", + 19, + 1 + ], + [ + "PWM1_RST", + 20, + 1 + ], + [ + "I2S1_RST", + 21, + 1 + ], + [ + "SPI_DMA_RST", + 22, + 1 + ], + [ + "UART2_RST", + 23, + 1 + ], + [ + "UART_MEM_RST", + 24, + 1 + ], + [ + "PWM2_RST", + 25, + 1 + ], + [ + "PWM3_RST", + 26, + 1 + ] + ] + }, + { + "name": "SLAVE_SPI_CONFIG", + "offset": "0xC8", + "fields": [ + [ + "SLAVE_SPI_MASK_PRO", + 0, + 1 + ], + [ + "SLAVE_SPI_MASK_APP", + 4, + 1 + ], + [ + "SPI_ENCRYPT_ENABLE", + 8, + 1 + ], + [ + "SPI_DECRYPT_ENABLE", + 12, + 1 + ] + ] + }, + { + "name": "WIFI_CLK_EN", + "offset": "0xCC", + "reset": "0xFFFCE030", + "fields": [ + [ + "WIFI_CLK_EN", + 0, + 32 + ] + ] + }, + { + "name": "CORE_RST_EN", + "offset": "0xD0", + "fields": [ + [ + "CORE_RST", + 0, + 8 + ] + ] + }, + { + "name": "BT_LPCK_DIV_INT", + "offset": "0xD4", + "reset": "0x000000FF", + "fields": [ + [ + "BT_LPCK_DIV_NUM", + 0, + 12 + ], + [ + "BTEXTWAKEUP_REQ", + 12, + 1 + ] + ] + }, + { + "name": "BT_LPCK_DIV_FRAC", + "offset": "0xD8", + "reset": "0x02001001", + "fields": [ + [ + "BT_LPCK_DIV_B", + 0, + 12 + ], + [ + "BT_LPCK_DIV_A", + 12, + 12 + ], + [ + "LPCLK_SEL_RTC_SLOW", + 24, + 1 + ], + [ + "LPCLK_SEL_8M", + 25, + 1 + ], + [ + "LPCLK_SEL_XTAL", + 26, + 1 + ], + [ + "LPCLK_SEL_XTAL32K", + 27, + 1 + ] + ] + }, + { + "name": "CPU_INTR_FROM_CPU_0", + "offset": "0xDC", + "fields": [ + [ + "CPU_INTR_FROM_CPU_0", + 0, + 1 + ] + ] + }, + { + "name": "CPU_INTR_FROM_CPU_1", + "offset": "0xE0", + "fields": [ + [ + "CPU_INTR_FROM_CPU_1", + 0, + 1 + ] + ] + }, + { + "name": "CPU_INTR_FROM_CPU_2", + "offset": "0xE4", + "fields": [ + [ + "CPU_INTR_FROM_CPU_2", + 0, + 1 + ] + ] + }, + { + "name": "CPU_INTR_FROM_CPU_3", + "offset": "0xE8", + "fields": [ + [ + "CPU_INTR_FROM_CPU_3", + 0, + 1 + ] + ] + }, + { + "name": "PRO_INTR_STATUS_0", + "offset": "0xEC", + "fields": [ + [ + "PRO_INTR_STATUS_0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PRO_INTR_STATUS_1", + "offset": "0xF0", + "fields": [ + [ + "PRO_INTR_STATUS_1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PRO_INTR_STATUS_2", + "offset": "0xF4", + "fields": [ + [ + "PRO_INTR_STATUS_2", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_INTR_STATUS_0", + "offset": "0xF8", + "fields": [ + [ + "APP_INTR_STATUS_0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_INTR_STATUS_1", + "offset": "0xFC", + "fields": [ + [ + "APP_INTR_STATUS_1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_INTR_STATUS_2", + "offset": "0x100", + "fields": [ + [ + "APP_INTR_STATUS_2", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PRO_MAC_INTR_MAP", + "offset": "0x104", + "reset": "0x00000010", + "fields": [ + [ + "PRO_MAC_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_MAC_NMI_MAP", + "offset": "0x108", + "reset": "0x00000010", + "fields": [ + [ + "PRO_MAC_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_BB_INT_MAP", + "offset": "0x10C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_BB_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_BT_MAC_INT_MAP", + "offset": "0x110", + "reset": "0x00000010", + "fields": [ + [ + "PRO_BT_MAC_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_BT_BB_INT_MAP", + "offset": "0x114", + "reset": "0x00000010", + "fields": [ + [ + "PRO_BT_BB_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_BT_BB_NMI_MAP", + "offset": "0x118", + "reset": "0x00000010", + "fields": [ + [ + "PRO_BT_BB_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_RWBT_IRQ_MAP", + "offset": "0x11C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_RWBT_IRQ_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_RWBLE_IRQ_MAP", + "offset": "0x120", + "reset": "0x00000010", + "fields": [ + [ + "PRO_RWBLE_IRQ_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_RWBT_NMI_MAP", + "offset": "0x124", + "reset": "0x00000010", + "fields": [ + [ + "PRO_RWBT_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_RWBLE_NMI_MAP", + "offset": "0x128", + "reset": "0x00000010", + "fields": [ + [ + "PRO_RWBLE_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SLC0_INTR_MAP", + "offset": "0x12C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SLC0_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SLC1_INTR_MAP", + "offset": "0x130", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SLC1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_UHCI0_INTR_MAP", + "offset": "0x134", + "reset": "0x00000010", + "fields": [ + [ + "PRO_UHCI0_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_UHCI1_INTR_MAP", + "offset": "0x138", + "reset": "0x00000010", + "fields": [ + [ + "PRO_UHCI1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG_T0_LEVEL_INT_MAP", + "offset": "0x13C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG_T0_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG_T1_LEVEL_INT_MAP", + "offset": "0x140", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG_T1_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG_WDT_LEVEL_INT_MAP", + "offset": "0x144", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG_WDT_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG_LACT_LEVEL_INT_MAP", + "offset": "0x148", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG_LACT_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG1_T0_LEVEL_INT_MAP", + "offset": "0x14C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG1_T0_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG1_T1_LEVEL_INT_MAP", + "offset": "0x150", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG1_T1_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG1_WDT_LEVEL_INT_MAP", + "offset": "0x154", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG1_WDT_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG1_LACT_LEVEL_INT_MAP", + "offset": "0x158", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG1_LACT_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_GPIO_INTERRUPT_MAP", + "offset": "0x15C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_GPIO_INTERRUPT_PRO_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_GPIO_INTERRUPT_NMI_MAP", + "offset": "0x160", + "reset": "0x00000010", + "fields": [ + [ + "PRO_GPIO_INTERRUPT_PRO_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_CPU_INTR_FROM_CPU_0_MAP", + "offset": "0x164", + "reset": "0x00000010", + "fields": [ + [ + "PRO_CPU_INTR_FROM_CPU_0_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_CPU_INTR_FROM_CPU_1_MAP", + "offset": "0x168", + "reset": "0x00000010", + "fields": [ + [ + "PRO_CPU_INTR_FROM_CPU_1_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_CPU_INTR_FROM_CPU_2_MAP", + "offset": "0x16C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_CPU_INTR_FROM_CPU_2_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_CPU_INTR_FROM_CPU_3_MAP", + "offset": "0x170", + "reset": "0x00000010", + "fields": [ + [ + "PRO_CPU_INTR_FROM_CPU_3_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SPI_INTR_0_MAP", + "offset": "0x174", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SPI_INTR_0_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SPI_INTR_1_MAP", + "offset": "0x178", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SPI_INTR_1_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SPI_INTR_2_MAP", + "offset": "0x17C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SPI_INTR_2_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SPI_INTR_3_MAP", + "offset": "0x180", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SPI_INTR_3_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_I2S0_INT_MAP", + "offset": "0x184", + "reset": "0x00000010", + "fields": [ + [ + "PRO_I2S0_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_I2S1_INT_MAP", + "offset": "0x188", + "reset": "0x00000010", + "fields": [ + [ + "PRO_I2S1_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_UART_INTR_MAP", + "offset": "0x18C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_UART_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_UART1_INTR_MAP", + "offset": "0x190", + "reset": "0x00000010", + "fields": [ + [ + "PRO_UART1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_UART2_INTR_MAP", + "offset": "0x194", + "reset": "0x00000010", + "fields": [ + [ + "PRO_UART2_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SDIO_HOST_INTERRUPT_MAP", + "offset": "0x198", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SDIO_HOST_INTERRUPT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_EMAC_INT_MAP", + "offset": "0x19C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_EMAC_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_PWM0_INTR_MAP", + "offset": "0x1A0", + "reset": "0x00000010", + "fields": [ + [ + "PRO_PWM0_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_PWM1_INTR_MAP", + "offset": "0x1A4", + "reset": "0x00000010", + "fields": [ + [ + "PRO_PWM1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_PWM2_INTR_MAP", + "offset": "0x1A8", + "reset": "0x00000010", + "fields": [ + [ + "PRO_PWM2_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_PWM3_INTR_MAP", + "offset": "0x1AC", + "reset": "0x00000010", + "fields": [ + [ + "PRO_PWM3_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_LEDC_INT_MAP", + "offset": "0x1B0", + "reset": "0x00000010", + "fields": [ + [ + "PRO_LEDC_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_EFUSE_INT_MAP", + "offset": "0x1B4", + "reset": "0x00000010", + "fields": [ + [ + "PRO_EFUSE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_CAN_INT_MAP", + "offset": "0x1B8", + "reset": "0x00000010", + "fields": [ + [ + "PRO_CAN_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_RTC_CORE_INTR_MAP", + "offset": "0x1BC", + "reset": "0x00000010", + "fields": [ + [ + "PRO_RTC_CORE_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_RMT_INTR_MAP", + "offset": "0x1C0", + "reset": "0x00000010", + "fields": [ + [ + "PRO_RMT_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_PCNT_INTR_MAP", + "offset": "0x1C4", + "reset": "0x00000010", + "fields": [ + [ + "PRO_PCNT_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_I2C_EXT0_INTR_MAP", + "offset": "0x1C8", + "reset": "0x00000010", + "fields": [ + [ + "PRO_I2C_EXT0_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_I2C_EXT1_INTR_MAP", + "offset": "0x1CC", + "reset": "0x00000010", + "fields": [ + [ + "PRO_I2C_EXT1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_RSA_INTR_MAP", + "offset": "0x1D0", + "reset": "0x00000010", + "fields": [ + [ + "PRO_RSA_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SPI1_DMA_INT_MAP", + "offset": "0x1D4", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SPI1_DMA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SPI2_DMA_INT_MAP", + "offset": "0x1D8", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SPI2_DMA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_SPI3_DMA_INT_MAP", + "offset": "0x1DC", + "reset": "0x00000010", + "fields": [ + [ + "PRO_SPI3_DMA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_WDG_INT_MAP", + "offset": "0x1E0", + "reset": "0x00000010", + "fields": [ + [ + "PRO_WDG_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TIMER_INT1_MAP", + "offset": "0x1E4", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TIMER_INT1_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TIMER_INT2_MAP", + "offset": "0x1E8", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TIMER_INT2_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG_T0_EDGE_INT_MAP", + "offset": "0x1EC", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG_T0_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG_T1_EDGE_INT_MAP", + "offset": "0x1F0", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG_T1_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG_WDT_EDGE_INT_MAP", + "offset": "0x1F4", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG_WDT_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG_LACT_EDGE_INT_MAP", + "offset": "0x1F8", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG_LACT_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG1_T0_EDGE_INT_MAP", + "offset": "0x1FC", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG1_T0_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG1_T1_EDGE_INT_MAP", + "offset": "0x200", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG1_T1_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG1_WDT_EDGE_INT_MAP", + "offset": "0x204", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG1_WDT_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_TG1_LACT_EDGE_INT_MAP", + "offset": "0x208", + "reset": "0x00000010", + "fields": [ + [ + "PRO_TG1_LACT_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_MMU_IA_INT_MAP", + "offset": "0x20C", + "reset": "0x00000010", + "fields": [ + [ + "PRO_MMU_IA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_MPU_IA_INT_MAP", + "offset": "0x210", + "reset": "0x00000010", + "fields": [ + [ + "PRO_MPU_IA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "PRO_CACHE_IA_INT_MAP", + "offset": "0x214", + "reset": "0x00000010", + "fields": [ + [ + "PRO_CACHE_IA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_MAC_INTR_MAP", + "offset": "0x218", + "reset": "0x00000010", + "fields": [ + [ + "APP_MAC_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_MAC_NMI_MAP", + "offset": "0x21C", + "reset": "0x00000010", + "fields": [ + [ + "APP_MAC_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_BB_INT_MAP", + "offset": "0x220", + "reset": "0x00000010", + "fields": [ + [ + "APP_BB_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_BT_MAC_INT_MAP", + "offset": "0x224", + "reset": "0x00000010", + "fields": [ + [ + "APP_BT_MAC_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_BT_BB_INT_MAP", + "offset": "0x228", + "reset": "0x00000010", + "fields": [ + [ + "APP_BT_BB_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_BT_BB_NMI_MAP", + "offset": "0x22C", + "reset": "0x00000010", + "fields": [ + [ + "APP_BT_BB_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_RWBT_IRQ_MAP", + "offset": "0x230", + "reset": "0x00000010", + "fields": [ + [ + "APP_RWBT_IRQ_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_RWBLE_IRQ_MAP", + "offset": "0x234", + "reset": "0x00000010", + "fields": [ + [ + "APP_RWBLE_IRQ_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_RWBT_NMI_MAP", + "offset": "0x238", + "reset": "0x00000010", + "fields": [ + [ + "APP_RWBT_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_RWBLE_NMI_MAP", + "offset": "0x23C", + "reset": "0x00000010", + "fields": [ + [ + "APP_RWBLE_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SLC0_INTR_MAP", + "offset": "0x240", + "reset": "0x00000010", + "fields": [ + [ + "APP_SLC0_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SLC1_INTR_MAP", + "offset": "0x244", + "reset": "0x00000010", + "fields": [ + [ + "APP_SLC1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_UHCI0_INTR_MAP", + "offset": "0x248", + "reset": "0x00000010", + "fields": [ + [ + "APP_UHCI0_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_UHCI1_INTR_MAP", + "offset": "0x24C", + "reset": "0x00000010", + "fields": [ + [ + "APP_UHCI1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG_T0_LEVEL_INT_MAP", + "offset": "0x250", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG_T0_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG_T1_LEVEL_INT_MAP", + "offset": "0x254", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG_T1_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG_WDT_LEVEL_INT_MAP", + "offset": "0x258", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG_WDT_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG_LACT_LEVEL_INT_MAP", + "offset": "0x25C", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG_LACT_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG1_T0_LEVEL_INT_MAP", + "offset": "0x260", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG1_T0_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG1_T1_LEVEL_INT_MAP", + "offset": "0x264", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG1_T1_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG1_WDT_LEVEL_INT_MAP", + "offset": "0x268", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG1_WDT_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG1_LACT_LEVEL_INT_MAP", + "offset": "0x26C", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG1_LACT_LEVEL_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_GPIO_INTERRUPT_MAP", + "offset": "0x270", + "reset": "0x00000010", + "fields": [ + [ + "APP_GPIO_INTERRUPT_APP_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_GPIO_INTERRUPT_NMI_MAP", + "offset": "0x274", + "reset": "0x00000010", + "fields": [ + [ + "APP_GPIO_INTERRUPT_APP_NMI_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_CPU_INTR_FROM_CPU_0_MAP", + "offset": "0x278", + "reset": "0x00000010", + "fields": [ + [ + "APP_CPU_INTR_FROM_CPU_0_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_CPU_INTR_FROM_CPU_1_MAP", + "offset": "0x27C", + "reset": "0x00000010", + "fields": [ + [ + "APP_CPU_INTR_FROM_CPU_1_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_CPU_INTR_FROM_CPU_2_MAP", + "offset": "0x280", + "reset": "0x00000010", + "fields": [ + [ + "APP_CPU_INTR_FROM_CPU_2_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_CPU_INTR_FROM_CPU_3_MAP", + "offset": "0x284", + "reset": "0x00000010", + "fields": [ + [ + "APP_CPU_INTR_FROM_CPU_3_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SPI_INTR_0_MAP", + "offset": "0x288", + "reset": "0x00000010", + "fields": [ + [ + "APP_SPI_INTR_0_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SPI_INTR_1_MAP", + "offset": "0x28C", + "reset": "0x00000010", + "fields": [ + [ + "APP_SPI_INTR_1_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SPI_INTR_2_MAP", + "offset": "0x290", + "reset": "0x00000010", + "fields": [ + [ + "APP_SPI_INTR_2_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SPI_INTR_3_MAP", + "offset": "0x294", + "reset": "0x00000010", + "fields": [ + [ + "APP_SPI_INTR_3_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_I2S0_INT_MAP", + "offset": "0x298", + "reset": "0x00000010", + "fields": [ + [ + "APP_I2S0_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_I2S1_INT_MAP", + "offset": "0x29C", + "reset": "0x00000010", + "fields": [ + [ + "APP_I2S1_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_UART_INTR_MAP", + "offset": "0x2A0", + "reset": "0x00000010", + "fields": [ + [ + "APP_UART_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_UART1_INTR_MAP", + "offset": "0x2A4", + "reset": "0x00000010", + "fields": [ + [ + "APP_UART1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_UART2_INTR_MAP", + "offset": "0x2A8", + "reset": "0x00000010", + "fields": [ + [ + "APP_UART2_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SDIO_HOST_INTERRUPT_MAP", + "offset": "0x2AC", + "reset": "0x00000010", + "fields": [ + [ + "APP_SDIO_HOST_INTERRUPT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_EMAC_INT_MAP", + "offset": "0x2B0", + "reset": "0x00000010", + "fields": [ + [ + "APP_EMAC_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_PWM0_INTR_MAP", + "offset": "0x2B4", + "reset": "0x00000010", + "fields": [ + [ + "APP_PWM0_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_PWM1_INTR_MAP", + "offset": "0x2B8", + "reset": "0x00000010", + "fields": [ + [ + "APP_PWM1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_PWM2_INTR_MAP", + "offset": "0x2BC", + "reset": "0x00000010", + "fields": [ + [ + "APP_PWM2_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_PWM3_INTR_MAP", + "offset": "0x2C0", + "reset": "0x00000010", + "fields": [ + [ + "APP_PWM3_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_LEDC_INT_MAP", + "offset": "0x2C4", + "reset": "0x00000010", + "fields": [ + [ + "APP_LEDC_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_EFUSE_INT_MAP", + "offset": "0x2C8", + "reset": "0x00000010", + "fields": [ + [ + "APP_EFUSE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_CAN_INT_MAP", + "offset": "0x2CC", + "reset": "0x00000010", + "fields": [ + [ + "APP_CAN_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_RTC_CORE_INTR_MAP", + "offset": "0x2D0", + "reset": "0x00000010", + "fields": [ + [ + "APP_RTC_CORE_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_RMT_INTR_MAP", + "offset": "0x2D4", + "reset": "0x00000010", + "fields": [ + [ + "APP_RMT_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_PCNT_INTR_MAP", + "offset": "0x2D8", + "reset": "0x00000010", + "fields": [ + [ + "APP_PCNT_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_I2C_EXT0_INTR_MAP", + "offset": "0x2DC", + "reset": "0x00000010", + "fields": [ + [ + "APP_I2C_EXT0_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_I2C_EXT1_INTR_MAP", + "offset": "0x2E0", + "reset": "0x00000010", + "fields": [ + [ + "APP_I2C_EXT1_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_RSA_INTR_MAP", + "offset": "0x2E4", + "reset": "0x00000010", + "fields": [ + [ + "APP_RSA_INTR_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SPI1_DMA_INT_MAP", + "offset": "0x2E8", + "reset": "0x00000010", + "fields": [ + [ + "APP_SPI1_DMA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SPI2_DMA_INT_MAP", + "offset": "0x2EC", + "reset": "0x00000010", + "fields": [ + [ + "APP_SPI2_DMA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_SPI3_DMA_INT_MAP", + "offset": "0x2F0", + "reset": "0x00000010", + "fields": [ + [ + "APP_SPI3_DMA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_WDG_INT_MAP", + "offset": "0x2F4", + "reset": "0x00000010", + "fields": [ + [ + "APP_WDG_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TIMER_INT1_MAP", + "offset": "0x2F8", + "reset": "0x00000010", + "fields": [ + [ + "APP_TIMER_INT1_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TIMER_INT2_MAP", + "offset": "0x2FC", + "reset": "0x00000010", + "fields": [ + [ + "APP_TIMER_INT2_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG_T0_EDGE_INT_MAP", + "offset": "0x300", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG_T0_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG_T1_EDGE_INT_MAP", + "offset": "0x304", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG_T1_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG_WDT_EDGE_INT_MAP", + "offset": "0x308", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG_WDT_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG_LACT_EDGE_INT_MAP", + "offset": "0x30C", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG_LACT_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG1_T0_EDGE_INT_MAP", + "offset": "0x310", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG1_T0_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG1_T1_EDGE_INT_MAP", + "offset": "0x314", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG1_T1_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG1_WDT_EDGE_INT_MAP", + "offset": "0x318", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG1_WDT_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_TG1_LACT_EDGE_INT_MAP", + "offset": "0x31C", + "reset": "0x00000010", + "fields": [ + [ + "APP_TG1_LACT_EDGE_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_MMU_IA_INT_MAP", + "offset": "0x320", + "reset": "0x00000010", + "fields": [ + [ + "APP_MMU_IA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_MPU_IA_INT_MAP", + "offset": "0x324", + "reset": "0x00000010", + "fields": [ + [ + "APP_MPU_IA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "APP_CACHE_IA_INT_MAP", + "offset": "0x328", + "reset": "0x00000010", + "fields": [ + [ + "APP_CACHE_IA_INT_MAP", + 0, + 5 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_UART", + "offset": "0x32C", + "fields": [ + [ + "UART_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_SPI1", + "offset": "0x330", + "fields": [ + [ + "SPI1_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_SPI0", + "offset": "0x334", + "fields": [ + [ + "SPI0_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_GPIO", + "offset": "0x338", + "fields": [ + [ + "GPIO_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_FE2", + "offset": "0x33C", + "fields": [ + [ + "FE2_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_FE", + "offset": "0x340", + "fields": [ + [ + "FE_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_TIMER", + "offset": "0x344", + "fields": [ + [ + "TIMER_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_RTC", + "offset": "0x348", + "fields": [ + [ + "RTC_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_IO_MUX", + "offset": "0x34C", + "fields": [ + [ + "IOMUX_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_WDG", + "offset": "0x350", + "fields": [ + [ + "WDG_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_HINF", + "offset": "0x354", + "fields": [ + [ + "HINF_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_UHCI1", + "offset": "0x358", + "fields": [ + [ + "UHCI1_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_MISC", + "offset": "0x35C", + "fields": [ + [ + "MISC_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_I2C", + "offset": "0x360", + "fields": [ + [ + "I2C_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_I2S0", + "offset": "0x364", + "fields": [ + [ + "I2S0_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_UART1", + "offset": "0x368", + "fields": [ + [ + "UART1_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_BT", + "offset": "0x36C", + "fields": [ + [ + "BT_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_BT_BUFFER", + "offset": "0x370", + "fields": [ + [ + "BTBUFFER_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_I2C_EXT0", + "offset": "0x374", + "fields": [ + [ + "I2CEXT0_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_UHCI0", + "offset": "0x378", + "fields": [ + [ + "UHCI0_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_SLCHOST", + "offset": "0x37C", + "fields": [ + [ + "SLCHOST_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_RMT", + "offset": "0x380", + "fields": [ + [ + "RMT_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_PCNT", + "offset": "0x384", + "fields": [ + [ + "PCNT_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_SLC", + "offset": "0x388", + "fields": [ + [ + "SLC_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_LEDC", + "offset": "0x38C", + "fields": [ + [ + "LEDC_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_EFUSE", + "offset": "0x390", + "fields": [ + [ + "EFUSE_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_SPI_ENCRYPT", + "offset": "0x394", + "fields": [ + [ + "SPI_ENCRYPY_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_BB", + "offset": "0x398", + "fields": [ + [ + "BB_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_PWM0", + "offset": "0x39C", + "fields": [ + [ + "PWM0_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_TIMERGROUP", + "offset": "0x3A0", + "fields": [ + [ + "TIMERGROUP_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_TIMERGROUP1", + "offset": "0x3A4", + "fields": [ + [ + "TIMERGROUP1_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_SPI2", + "offset": "0x3A8", + "fields": [ + [ + "SPI2_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_SPI3", + "offset": "0x3AC", + "fields": [ + [ + "SPI3_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_APB_CTRL", + "offset": "0x3B0", + "fields": [ + [ + "APBCTRL_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_I2C_EXT1", + "offset": "0x3B4", + "fields": [ + [ + "I2CEXT1_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_SDIO_HOST", + "offset": "0x3B8", + "fields": [ + [ + "SDIOHOST_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_EMAC", + "offset": "0x3BC", + "fields": [ + [ + "EMAC_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_CAN", + "offset": "0x3C0", + "fields": [ + [ + "CAN_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_PWM1", + "offset": "0x3C4", + "fields": [ + [ + "PWM1_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_I2S1", + "offset": "0x3C8", + "fields": [ + [ + "I2S1_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_UART2", + "offset": "0x3CC", + "fields": [ + [ + "UART2_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_PWM2", + "offset": "0x3D0", + "fields": [ + [ + "PWM2_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_PWM3", + "offset": "0x3D4", + "fields": [ + [ + "PWM3_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_RWBT", + "offset": "0x3D8", + "fields": [ + [ + "RWBT_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_BTMAC", + "offset": "0x3DC", + "fields": [ + [ + "BTMAC_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_WIFIMAC", + "offset": "0x3E0", + "fields": [ + [ + "WIFIMAC_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "AHBLITE_MPU_TABLE_PWR", + "offset": "0x3E4", + "fields": [ + [ + "PWR_ACCESS_GRANT_CONFIG", + 0, + 6 + ] + ] + }, + { + "name": "MEM_ACCESS_DBUG0", + "offset": "0x3E8", + "fields": [ + [ + "PRO_ROM_MPU_AD", + 0, + 1, + "r" + ], + [ + "PRO_ROM_IA", + 1, + 1, + "r" + ], + [ + "APP_ROM_MPU_AD", + 2, + 1, + "r" + ], + [ + "APP_ROM_IA", + 3, + 1, + "r" + ], + [ + "SHARE_ROM_MPU_AD", + 4, + 2, + "r" + ], + [ + "SHARE_ROM_IA", + 6, + 4, + "r" + ], + [ + "INTERNAL_SRAM_MMU_AD", + 10, + 4, + "r" + ], + [ + "INTERNAL_SRAM_IA", + 14, + 12, + "r" + ], + [ + "INTERNAL_SRAM_MMU_MULTI_HIT", + 26, + 4, + "r" + ] + ] + }, + { + "name": "MEM_ACCESS_DBUG1", + "offset": "0x3EC", + "fields": [ + [ + "INTERNAL_SRAM_MMU_MISS", + 0, + 4, + "r" + ], + [ + "ARB_IA", + 4, + 2, + "r" + ], + [ + "PIDGEN_IA", + 6, + 2, + "r" + ], + [ + "AHB_ACCESS_DENY", + 8, + 1, + "r" + ], + [ + "AHBLITE_ACCESS_DENY", + 9, + 1, + "r" + ], + [ + "AHBLITE_IA", + 10, + 1, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG0", + "offset": "0x3F0", + "fields": [ + [ + "PRO_SLAVE_WDATA", + 0, + 1 + ], + [ + "PRO_CACHE_IA", + 1, + 6, + "r" + ], + [ + "PRO_CACHE_STATE", + 7, + 12, + "r" + ], + [ + "PRO_WR_BAK_TO_READ", + 19, + 1, + "r" + ], + [ + "PRO_TX_END", + 20, + 1, + "r" + ], + [ + "PRO_SLAVE_WR", + 21, + 1, + "r" + ], + [ + "PRO_SLAVE_WDATA_V", + 22, + 1, + "r" + ], + [ + "PRO_RX_END", + 23, + 1, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG1", + "offset": "0x3F4", + "fields": [ + [ + "PRO_CTAG_RAM_RDATA", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG2", + "offset": "0x3F8", + "fields": [ + [ + "PRO_CACHE_VADDR", + 0, + 27, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG3", + "offset": "0x3FC", + "fields": [ + [ + "PRO_MMU_RDATA", + 0, + 9, + "r" + ], + [ + "PRO_CPU_DISABLED_CACHE_IA_OPPOSITE", + 9, + 1 + ], + [ + "PRO_CPU_DISABLED_CACHE_IA_DRAM1", + 10, + 1 + ], + [ + "PRO_CPU_DISABLED_CACHE_IA_IROM0", + 11, + 1 + ], + [ + "PRO_CPU_DISABLED_CACHE_IA_IRAM1", + 12, + 1 + ], + [ + "PRO_CPU_DISABLED_CACHE_IA_IRAM0", + 13, + 1 + ], + [ + "PRO_CPU_DISABLED_CACHE_IA_DROM0", + 14, + 1 + ], + [ + "PRO_CACHE_IRAM0_PID_ERROR", + 15, + 1, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG4", + "offset": "0x400", + "fields": [ + [ + "PRO_DRAM1ADDR0_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG5", + "offset": "0x404", + "fields": [ + [ + "PRO_DROM0ADDR0_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG6", + "offset": "0x408", + "fields": [ + [ + "PRO_IRAM0ADDR_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG7", + "offset": "0x40C", + "fields": [ + [ + "PRO_IRAM1ADDR_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG8", + "offset": "0x410", + "fields": [ + [ + "PRO_IROM0ADDR_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "PRO_DCACHE_DBUG9", + "offset": "0x414", + "fields": [ + [ + "PRO_OPSDRAMADDR_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG0", + "offset": "0x418", + "fields": [ + [ + "APP_SLAVE_WDATA", + 0, + 1 + ], + [ + "APP_CACHE_IA", + 1, + 6, + "r" + ], + [ + "APP_CACHE_STATE", + 7, + 12, + "r" + ], + [ + "APP_WR_BAK_TO_READ", + 19, + 1, + "r" + ], + [ + "APP_TX_END", + 20, + 1, + "r" + ], + [ + "APP_SLAVE_WR", + 21, + 1, + "r" + ], + [ + "APP_SLAVE_WDATA_V", + 22, + 1, + "r" + ], + [ + "APP_RX_END", + 23, + 1, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG1", + "offset": "0x41C", + "fields": [ + [ + "APP_CTAG_RAM_RDATA", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG2", + "offset": "0x420", + "fields": [ + [ + "APP_CACHE_VADDR", + 0, + 27, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG3", + "offset": "0x424", + "fields": [ + [ + "APP_MMU_RDATA", + 0, + 9, + "r" + ], + [ + "APP_CPU_DISABLED_CACHE_IA_OPPOSITE", + 9, + 1 + ], + [ + "APP_CPU_DISABLED_CACHE_IA_DRAM1", + 10, + 1 + ], + [ + "APP_CPU_DISABLED_CACHE_IA_IROM0", + 11, + 1 + ], + [ + "APP_CPU_DISABLED_CACHE_IA_IRAM1", + 12, + 1 + ], + [ + "APP_CPU_DISABLED_CACHE_IA_IRAM0", + 13, + 1 + ], + [ + "APP_CPU_DISABLED_CACHE_IA_DROM0", + 14, + 1 + ], + [ + "APP_CACHE_IRAM0_PID_ERROR", + 15, + 1, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG4", + "offset": "0x428", + "fields": [ + [ + "APP_DRAM1ADDR0_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG5", + "offset": "0x42C", + "fields": [ + [ + "APP_DROM0ADDR0_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG6", + "offset": "0x430", + "fields": [ + [ + "APP_IRAM0ADDR_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG7", + "offset": "0x434", + "fields": [ + [ + "APP_IRAM1ADDR_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG8", + "offset": "0x438", + "fields": [ + [ + "APP_IROM0ADDR_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "APP_DCACHE_DBUG9", + "offset": "0x43C", + "fields": [ + [ + "APP_OPSDRAMADDR_IA", + 0, + 20, + "r" + ] + ] + }, + { + "name": "PRO_CPU_RECORD_CTRL", + "offset": "0x440", + "reset": "0x00000100", + "fields": [ + [ + "PRO_CPU_RECORD_ENABLE", + 0, + 1 + ], + [ + "PRO_CPU_RECORD_DISABLE", + 4, + 1 + ], + [ + "PRO_CPU_PDEBUG_ENABLE", + 8, + 1 + ] + ] + }, + { + "name": "PRO_CPU_RECORD_STATUS", + "offset": "0x444", + "fields": [ + [ + "PRO_CPU_RECORDING", + 0, + 1, + "r" + ] + ] + }, + { + "name": "PRO_CPU_RECORD_PID", + "offset": "0x448", + "fields": [ + [ + "RECORD_PRO_PID", + 0, + 3, + "r" + ] + ] + }, + { + "name": "PRO_CPU_RECORD_PDEBUGINST", + "offset": "0x44C", + "fields": [ + [ + "RECORD_PDEBUGINST_SZ", + 0, + 8 + ], + [ + "RECORD_PDEBUGINST_ISRC", + 12, + 3 + ], + [ + "RECORD_PDEBUGINST_LOOP_REP", + 20, + 1 + ], + [ + "RECORD_PDEBUGINST_LOOP", + 21, + 1 + ], + [ + "RECORD_PDEBUGINST_CINTL", + 24, + 4 + ] + ] + }, + { + "name": "PRO_CPU_RECORD_PDEBUGSTATUS", + "offset": "0x450", + "fields": [ + [ + "RECORD_PDEBUGSTATUS_BBCAUSE", + 0, + 6 + ] + ] + }, + { + "name": "PRO_CPU_RECORD_PDEBUGDATA", + "offset": "0x454", + "fields": [ + [ + "RECORD_PDEBUGDATA_DEP_OTHER", + 0, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_BUFF", + 1, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_BUFFCONFL", + 2, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_DCM", + 3, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_LSU", + 4, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_ICM", + 6, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_IRAMBUSY", + 7, + 1 + ], + [ + "RECORD_PDEBUGDATA_DEP_LSU", + 8, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_TIE", + 9, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_RUN", + 10, + 1 + ], + [ + "RECORD_PDEBUGDATA_DEP_STR", + 11, + 1 + ], + [ + "RECORD_PDEBUGDATA_DEP", + 12, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_L32R", + 13, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_LSPROC", + 14, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_BPLOAD", + 15, + 1 + ], + [ + "RECORD_PDEBUGDATA_DEP_MEMW", + 16, + 1 + ], + [ + "RECORD_PDEBUGDATA_DEP_HALT", + 17, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_ITERMUL", + 18, + 1 + ], + [ + "RECORD_PDEBUGDATA_STALL_ITERDIV", + 19, + 1 + ] + ] + }, + { + "name": "PRO_CPU_RECORD_PDEBUGPC", + "offset": "0x458", + "fields": [ + [ + "RECORD_PRO_PDEBUGPC", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PRO_CPU_RECORD_PDEBUGLS0STAT", + "offset": "0x45C", + "fields": [ + [ + "RECORD_PDEBUGLS0STAT_TYPE", + 0, + 4 + ], + [ + "RECORD_PDEBUGLS0STAT_SZ", + 4, + 4 + ], + [ + "RECORD_PDEBUGLS0STAT_DTLBM", + 8, + 1 + ], + [ + "RECORD_PDEBUGLS0STAT_DCM", + 9, + 1 + ], + [ + "RECORD_PDEBUGLS0STAT_DCH", + 10, + 1 + ], + [ + "RECORD_PDEBUGLS0STAT_UC", + 12, + 1 + ], + [ + "RECORD_PDEBUGLS0STAT_WB", + 13, + 1 + ], + [ + "RECORD_PDEBUGLS0STAT_COH", + 16, + 1 + ], + [ + "RECORD_PDEBUGLS0STAT_STCOH", + 17, + 2 + ], + [ + "RECORD_PDEBUGLS0STAT_TGT", + 20, + 4 + ] + ] + }, + { + "name": "PRO_CPU_RECORD_PDEBUGLS0ADDR", + "offset": "0x460", + "fields": [ + [ + "RECORD_PRO_PDEBUGLS0ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PRO_CPU_RECORD_PDEBUGLS0DATA", + "offset": "0x464", + "fields": [ + [ + "RECORD_PRO_PDEBUGLS0DATA", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_CTRL", + "offset": "0x468", + "reset": "0x00000100", + "fields": [ + [ + "APP_CPU_RECORD_ENABLE", + 0, + 1 + ], + [ + "APP_CPU_RECORD_DISABLE", + 4, + 1 + ], + [ + "APP_CPU_PDEBUG_ENABLE", + 8, + 1 + ] + ] + }, + { + "name": "APP_CPU_RECORD_STATUS", + "offset": "0x46C", + "fields": [ + [ + "APP_CPU_RECORDING", + 0, + 1, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_PID", + "offset": "0x470", + "fields": [ + [ + "RECORD_APP_PID", + 0, + 3, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_PDEBUGINST", + "offset": "0x474", + "fields": [ + [ + "RECORD_APP_PDEBUGINST", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_PDEBUGSTATUS", + "offset": "0x478", + "fields": [ + [ + "RECORD_APP_PDEBUGSTATUS", + 0, + 8, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_PDEBUGDATA", + "offset": "0x47C", + "fields": [ + [ + "RECORD_APP_PDEBUGDATA", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_PDEBUGPC", + "offset": "0x480", + "fields": [ + [ + "RECORD_APP_PDEBUGPC", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_PDEBUGLS0STAT", + "offset": "0x484", + "fields": [ + [ + "RECORD_APP_PDEBUGLS0STAT", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_PDEBUGLS0ADDR", + "offset": "0x488", + "fields": [ + [ + "RECORD_APP_PDEBUGLS0ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "APP_CPU_RECORD_PDEBUGLS0DATA", + "offset": "0x48C", + "fields": [ + [ + "RECORD_APP_PDEBUGLS0DATA", + 0, + 32, + "r" + ] + ] + }, + { + "name": "RSA_PD_CTRL", + "offset": "0x490", + "fields": [ + [ + "RSA_PD", + 0, + 1 + ] + ] + }, + { + "name": "ROM_MPU_TABLE0", + "offset": "0x494", + "reset": "0x00000001", + "fields": [ + [ + "ROM_MPU_TABLE0", + 0, + 2 + ] + ] + }, + { + "name": "ROM_MPU_TABLE1", + "offset": "0x498", + "reset": "0x00000001", + "fields": [ + [ + "ROM_MPU_TABLE1", + 0, + 2 + ] + ] + }, + { + "name": "ROM_MPU_TABLE2", + "offset": "0x49C", + "reset": "0x00000001", + "fields": [ + [ + "ROM_MPU_TABLE2", + 0, + 2 + ] + ] + }, + { + "name": "ROM_MPU_TABLE3", + "offset": "0x4A0", + "reset": "0x00000001", + "fields": [ + [ + "ROM_MPU_TABLE3", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE0", + "offset": "0x4A4", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE0", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE1", + "offset": "0x4A8", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE1", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE2", + "offset": "0x4AC", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE2", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE3", + "offset": "0x4B0", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE3", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE4", + "offset": "0x4B4", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE4", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE5", + "offset": "0x4B8", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE5", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE6", + "offset": "0x4BC", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE6", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE7", + "offset": "0x4C0", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE7", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE8", + "offset": "0x4C4", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE8", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE9", + "offset": "0x4C8", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE9", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE10", + "offset": "0x4CC", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE10", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE11", + "offset": "0x4D0", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE11", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE12", + "offset": "0x4D4", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE12", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE13", + "offset": "0x4D8", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE13", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE14", + "offset": "0x4DC", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE14", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE15", + "offset": "0x4E0", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE15", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE16", + "offset": "0x4E4", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE16", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE17", + "offset": "0x4E8", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE17", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE18", + "offset": "0x4EC", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE18", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE19", + "offset": "0x4F0", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE19", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE20", + "offset": "0x4F4", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE20", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE21", + "offset": "0x4F8", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE21", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE22", + "offset": "0x4FC", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE22", + 0, + 2 + ] + ] + }, + { + "name": "SHROM_MPU_TABLE23", + "offset": "0x500", + "reset": "0x00000001", + "fields": [ + [ + "SHROM_MPU_TABLE23", + 0, + 2 + ] + ] + }, + { + "name": "IMMU_TABLE0", + "offset": "0x504", + "fields": [ + [ + "IMMU_TABLE0", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE1", + "offset": "0x508", + "reset": "0x00000001", + "fields": [ + [ + "IMMU_TABLE1", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE2", + "offset": "0x50C", + "reset": "0x00000002", + "fields": [ + [ + "IMMU_TABLE2", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE3", + "offset": "0x510", + "reset": "0x00000003", + "fields": [ + [ + "IMMU_TABLE3", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE4", + "offset": "0x514", + "reset": "0x00000004", + "fields": [ + [ + "IMMU_TABLE4", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE5", + "offset": "0x518", + "reset": "0x00000005", + "fields": [ + [ + "IMMU_TABLE5", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE6", + "offset": "0x51C", + "reset": "0x00000006", + "fields": [ + [ + "IMMU_TABLE6", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE7", + "offset": "0x520", + "reset": "0x00000007", + "fields": [ + [ + "IMMU_TABLE7", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE8", + "offset": "0x524", + "reset": "0x00000008", + "fields": [ + [ + "IMMU_TABLE8", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE9", + "offset": "0x528", + "reset": "0x00000009", + "fields": [ + [ + "IMMU_TABLE9", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE10", + "offset": "0x52C", + "reset": "0x0000000A", + "fields": [ + [ + "IMMU_TABLE10", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE11", + "offset": "0x530", + "reset": "0x0000000B", + "fields": [ + [ + "IMMU_TABLE11", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE12", + "offset": "0x534", + "reset": "0x0000000C", + "fields": [ + [ + "IMMU_TABLE12", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE13", + "offset": "0x538", + "reset": "0x0000000D", + "fields": [ + [ + "IMMU_TABLE13", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE14", + "offset": "0x53C", + "reset": "0x0000000E", + "fields": [ + [ + "IMMU_TABLE14", + 0, + 7 + ] + ] + }, + { + "name": "IMMU_TABLE15", + "offset": "0x540", + "reset": "0x0000000F", + "fields": [ + [ + "IMMU_TABLE15", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE0", + "offset": "0x544", + "fields": [ + [ + "DMMU_TABLE0", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE1", + "offset": "0x548", + "reset": "0x00000001", + "fields": [ + [ + "DMMU_TABLE1", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE2", + "offset": "0x54C", + "reset": "0x00000002", + "fields": [ + [ + "DMMU_TABLE2", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE3", + "offset": "0x550", + "reset": "0x00000003", + "fields": [ + [ + "DMMU_TABLE3", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE4", + "offset": "0x554", + "reset": "0x00000004", + "fields": [ + [ + "DMMU_TABLE4", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE5", + "offset": "0x558", + "reset": "0x00000005", + "fields": [ + [ + "DMMU_TABLE5", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE6", + "offset": "0x55C", + "reset": "0x00000006", + "fields": [ + [ + "DMMU_TABLE6", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE7", + "offset": "0x560", + "reset": "0x00000007", + "fields": [ + [ + "DMMU_TABLE7", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE8", + "offset": "0x564", + "reset": "0x00000008", + "fields": [ + [ + "DMMU_TABLE8", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE9", + "offset": "0x568", + "reset": "0x00000009", + "fields": [ + [ + "DMMU_TABLE9", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE10", + "offset": "0x56C", + "reset": "0x0000000A", + "fields": [ + [ + "DMMU_TABLE10", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE11", + "offset": "0x570", + "reset": "0x0000000B", + "fields": [ + [ + "DMMU_TABLE11", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE12", + "offset": "0x574", + "reset": "0x0000000C", + "fields": [ + [ + "DMMU_TABLE12", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE13", + "offset": "0x578", + "reset": "0x0000000D", + "fields": [ + [ + "DMMU_TABLE13", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE14", + "offset": "0x57C", + "reset": "0x0000000E", + "fields": [ + [ + "DMMU_TABLE14", + 0, + 7 + ] + ] + }, + { + "name": "DMMU_TABLE15", + "offset": "0x580", + "reset": "0x0000000F", + "fields": [ + [ + "DMMU_TABLE15", + 0, + 7 + ] + ] + }, + { + "name": "PRO_INTRUSION_CTRL", + "offset": "0x584", + "reset": "0x00000001", + "fields": [ + [ + "PRO_INTRUSION_RECORD_RESET_N", + 0, + 1 + ] + ] + }, + { + "name": "PRO_INTRUSION_STATUS", + "offset": "0x588", + "fields": [ + [ + "PRO_INTRUSION_RECORD", + 0, + 4, + "r" + ] + ] + }, + { + "name": "APP_INTRUSION_CTRL", + "offset": "0x58C", + "reset": "0x00000001", + "fields": [ + [ + "APP_INTRUSION_RECORD_RESET_N", + 0, + 1 + ] + ] + }, + { + "name": "APP_INTRUSION_STATUS", + "offset": "0x590", + "fields": [ + [ + "APP_INTRUSION_RECORD", + 0, + 4, + "r" + ] + ] + }, + { + "name": "FRONT_END_MEM_PD", + "offset": "0x594", + "reset": "0x00000005", + "fields": [ + [ + "AGC_MEM_FORCE_PU", + 0, + 1 + ], + [ + "AGC_MEM_FORCE_PD", + 1, + 1 + ], + [ + "PBUS_MEM_FORCE_PU", + 2, + 1 + ], + [ + "PBUS_MEM_FORCE_PD", + 3, + 1 + ] + ] + }, + { + "name": "MMU_IA_INT_EN", + "offset": "0x598", + "fields": [ + [ + "MMU_IA_INT_EN", + 0, + 24 + ] + ] + }, + { + "name": "MPU_IA_INT_EN", + "offset": "0x59C", + "fields": [ + [ + "MPU_IA_INT_EN", + 0, + 17 + ] + ] + }, + { + "name": "CACHE_IA_INT_EN", + "offset": "0x5A0", + "fields": [ + [ + "CACHE_IA_INT_APP_DROM0", + 0, + 1 + ], + [ + "CACHE_IA_INT_APP_IRAM0", + 1, + 1 + ], + [ + "CACHE_IA_INT_APP_IRAM1", + 2, + 1 + ], + [ + "CACHE_IA_INT_APP_IROM0", + 3, + 1 + ], + [ + "CACHE_IA_INT_APP_DRAM1", + 4, + 1 + ], + [ + "CACHE_IA_INT_APP_OPPOSITE", + 5, + 1 + ], + [ + "CACHE_IA_INT_PRO_DROM0", + 14, + 1 + ], + [ + "CACHE_IA_INT_PRO_IRAM0", + 15, + 1 + ], + [ + "CACHE_IA_INT_PRO_IRAM1", + 16, + 1 + ], + [ + "CACHE_IA_INT_PRO_IROM0", + 17, + 1 + ], + [ + "CACHE_IA_INT_PRO_DRAM1", + 18, + 1 + ], + [ + "CACHE_IA_INT_PRO_OPPOSITE", + 19, + 1 + ] + ] + }, + { + "name": "SECURE_BOOT_CTRL", + "offset": "0x5A4", + "fields": [ + [ + "SW_BOOTLOADER_SEL", + 0, + 1 + ] + ] + }, + { + "name": "SPI_DMA_CHAN_SEL", + "offset": "0x5A8", + "fields": [ + [ + "SPI1_DMA_CHAN_SEL", + 0, + 2 + ], + [ + "SPI2_DMA_CHAN_SEL", + 2, + 2 + ], + [ + "SPI3_DMA_CHAN_SEL", + 4, + 2 + ] + ] + }, + { + "name": "PRO_VECBASE_CTRL", + "offset": "0x5AC", + "fields": [ + [ + "PRO_OUT_VECBASE_SEL", + 0, + 2 + ] + ] + }, + { + "name": "PRO_VECBASE_SET", + "offset": "0x5B0", + "fields": [ + [ + "PRO_OUT_VECBASE", + 0, + 22 + ] + ] + }, + { + "name": "APP_VECBASE_CTRL", + "offset": "0x5B4", + "fields": [ + [ + "APP_OUT_VECBASE_SEL", + 0, + 2 + ] + ] + }, + { + "name": "APP_VECBASE_SET", + "offset": "0x5B8", + "fields": [ + [ + "APP_OUT_VECBASE", + 0, + 22 + ] + ] + }, + { + "name": "DATE", + "offset": "0xFFC", + "reset": "0x01605190", + "fields": [ + [ + "DATE", + 0, + 28 + ] + ] + } + ] + }, + { + "name": "AES", + "base": "0x3FF01000", + "registers": [ + { + "name": "START", + "offset": "0x00", + "fields": [ + [ + "START", + 0, + 1, + "w" + ] + ] + }, + { + "name": "IDLE", + "offset": "0x04", + "fields": [ + [ + "IDLE", + 0, + 1, + "r" + ] + ] + }, + { + "name": "MODE", + "offset": "0x08", + "fields": [ + [ + "MODE", + 0, + 8 + ] + ] + }, + { + "name": "KEY0", + "offset": "0x10", + "fields": [ + [ + "KEY", + 0, + 8 + ] + ] + }, + { + "name": "KEY1", + "offset": "0x14", + "fields": [ + [ + "KEY", + 0, + 8 + ] + ] + }, + { + "name": "KEY2", + "offset": "0x18", + "fields": [ + [ + "KEY", + 0, + 8 + ] + ] + }, + { + "name": "KEY3", + "offset": "0x1C", + "fields": [ + [ + "KEY", + 0, + 8 + ] + ] + }, + { + "name": "KEY4", + "offset": "0x20", + "fields": [ + [ + "KEY", + 0, + 8 + ] + ] + }, + { + "name": "KEY5", + "offset": "0x24", + "fields": [ + [ + "KEY", + 0, + 8 + ] + ] + }, + { + "name": "KEY6", + "offset": "0x28", + "fields": [ + [ + "KEY", + 0, + 8 + ] + ] + }, + { + "name": "KEY7", + "offset": "0x2C", + "fields": [ + [ + "KEY", + 0, + 8 + ] + ] + }, + { + "name": "TEXT0", + "offset": "0x30", + "fields": [ + [ + "TEXT", + 0, + 8 + ] + ] + }, + { + "name": "TEXT1", + "offset": "0x34", + "fields": [ + [ + "TEXT", + 0, + 8 + ] + ] + }, + { + "name": "TEXT2", + "offset": "0x38", + "fields": [ + [ + "TEXT", + 0, + 8 + ] + ] + }, + { + "name": "TEXT3", + "offset": "0x3C", + "fields": [ + [ + "TEXT", + 0, + 8 + ] + ] + }, + { + "name": "ENDIAN", + "offset": "0x40", + "fields": [ + [ + "ENDIAN", + 0, + 2 + ] + ] + } + ] + }, + { + "name": "RSA", + "base": "0x3FF02000", + "interrupts": [ + "RSA" + ], + "registers": [ + { + "name": "M_PRIME", + "offset": "0x800", + "fields": [ + [ + "M_PRIME", + 0, + 8 + ] + ] + }, + { + "name": "MODEXP_MODE", + "offset": "0x804", + "fields": [ + [ + "MODEXP_MODE", + 0, + 3 + ] + ] + }, + { + "name": "MODEXP_START", + "offset": "0x808", + "fields": [ + [ + "MODEXP_START", + 0, + 1, + "w" + ] + ] + }, + { + "name": "MULT_MODE", + "offset": "0x80C", + "fields": [ + [ + "MULT_MODE", + 0, + 4 + ] + ] + }, + { + "name": "MULT_START", + "offset": "0x810", + "fields": [ + [ + "MULT_START", + 0, + 1, + "w" + ] + ] + }, + { + "name": "INTERRUPT", + "offset": "0x814", + "fields": [ + [ + "INTERRUPT", + 0, + 1 + ] + ] + }, + { + "name": "CLEAN", + "offset": "0x818", + "fields": [ + [ + "CLEAN", + 0, + 1, + "r" + ] + ] + }, + { + "name": "M_MEM0", + "offset": "0x00" + }, + { + "name": "M_MEM1", + "offset": "0x04" + }, + { + "name": "M_MEM2", + "offset": "0x08" + }, + { + "name": "M_MEM3", + "offset": "0x0C" + }, + { + "name": "M_MEM4", + "offset": "0x10" + }, + { + "name": "M_MEM5", + "offset": "0x14" + }, + { + "name": "M_MEM6", + "offset": "0x18" + }, + { + "name": "M_MEM7", + "offset": "0x1C" + }, + { + "name": "M_MEM8", + "offset": "0x20" + }, + { + "name": "M_MEM9", + "offset": "0x24" + }, + { + "name": "M_MEM10", + "offset": "0x28" + }, + { + "name": "M_MEM11", + "offset": "0x2C" + }, + { + "name": "M_MEM12", + "offset": "0x30" + }, + { + "name": "M_MEM13", + "offset": "0x34" + }, + { + "name": "M_MEM14", + "offset": "0x38" + }, + { + "name": "M_MEM15", + "offset": "0x3C" + }, + { + "name": "M_MEM16", + "offset": "0x40" + }, + { + "name": "M_MEM17", + "offset": "0x44" + }, + { + "name": "M_MEM18", + "offset": "0x48" + }, + { + "name": "M_MEM19", + "offset": "0x4C" + }, + { + "name": "M_MEM20", + "offset": "0x50" + }, + { + "name": "M_MEM21", + "offset": "0x54" + }, + { + "name": "M_MEM22", + "offset": "0x58" + }, + { + "name": "M_MEM23", + "offset": "0x5C" + }, + { + "name": "M_MEM24", + "offset": "0x60" + }, + { + "name": "M_MEM25", + "offset": "0x64" + }, + { + "name": "M_MEM26", + "offset": "0x68" + }, + { + "name": "M_MEM27", + "offset": "0x6C" + }, + { + "name": "M_MEM28", + "offset": "0x70" + }, + { + "name": "M_MEM29", + "offset": "0x74" + }, + { + "name": "M_MEM30", + "offset": "0x78" + }, + { + "name": "M_MEM31", + "offset": "0x7C" + }, + { + "name": "Z_MEM0", + "offset": "0x200" + }, + { + "name": "Z_MEM1", + "offset": "0x204" + }, + { + "name": "Z_MEM2", + "offset": "0x208" + }, + { + "name": "Z_MEM3", + "offset": "0x20C" + }, + { + "name": "Z_MEM4", + "offset": "0x210" + }, + { + "name": "Z_MEM5", + "offset": "0x214" + }, + { + "name": "Z_MEM6", + "offset": "0x218" + }, + { + "name": "Z_MEM7", + "offset": "0x21C" + }, + { + "name": "Z_MEM8", + "offset": "0x220" + }, + { + "name": "Z_MEM9", + "offset": "0x224" + }, + { + "name": "Z_MEM10", + "offset": "0x228" + }, + { + "name": "Z_MEM11", + "offset": "0x22C" + }, + { + "name": "Z_MEM12", + "offset": "0x230" + }, + { + "name": "Z_MEM13", + "offset": "0x234" + }, + { + "name": "Z_MEM14", + "offset": "0x238" + }, + { + "name": "Z_MEM15", + "offset": "0x23C" + }, + { + "name": "Z_MEM16", + "offset": "0x240" + }, + { + "name": "Z_MEM17", + "offset": "0x244" + }, + { + "name": "Z_MEM18", + "offset": "0x248" + }, + { + "name": "Z_MEM19", + "offset": "0x24C" + }, + { + "name": "Z_MEM20", + "offset": "0x250" + }, + { + "name": "Z_MEM21", + "offset": "0x254" + }, + { + "name": "Z_MEM22", + "offset": "0x258" + }, + { + "name": "Z_MEM23", + "offset": "0x25C" + }, + { + "name": "Z_MEM24", + "offset": "0x260" + }, + { + "name": "Z_MEM25", + "offset": "0x264" + }, + { + "name": "Z_MEM26", + "offset": "0x268" + }, + { + "name": "Z_MEM27", + "offset": "0x26C" + }, + { + "name": "Z_MEM28", + "offset": "0x270" + }, + { + "name": "Z_MEM29", + "offset": "0x274" + }, + { + "name": "Z_MEM30", + "offset": "0x278" + }, + { + "name": "Z_MEM31", + "offset": "0x27C" + }, + { + "name": "Y_MEM0", + "offset": "0x400" + }, + { + "name": "Y_MEM1", + "offset": "0x404" + }, + { + "name": "Y_MEM2", + "offset": "0x408" + }, + { + "name": "Y_MEM3", + "offset": "0x40C" + }, + { + "name": "Y_MEM4", + "offset": "0x410" + }, + { + "name": "Y_MEM5", + "offset": "0x414" + }, + { + "name": "Y_MEM6", + "offset": "0x418" + }, + { + "name": "Y_MEM7", + "offset": "0x41C" + }, + { + "name": "Y_MEM8", + "offset": "0x420" + }, + { + "name": "Y_MEM9", + "offset": "0x424" + }, + { + "name": "Y_MEM10", + "offset": "0x428" + }, + { + "name": "Y_MEM11", + "offset": "0x42C" + }, + { + "name": "Y_MEM12", + "offset": "0x430" + }, + { + "name": "Y_MEM13", + "offset": "0x434" + }, + { + "name": "Y_MEM14", + "offset": "0x438" + }, + { + "name": "Y_MEM15", + "offset": "0x43C" + }, + { + "name": "Y_MEM16", + "offset": "0x440" + }, + { + "name": "Y_MEM17", + "offset": "0x444" + }, + { + "name": "Y_MEM18", + "offset": "0x448" + }, + { + "name": "Y_MEM19", + "offset": "0x44C" + }, + { + "name": "Y_MEM20", + "offset": "0x450" + }, + { + "name": "Y_MEM21", + "offset": "0x454" + }, + { + "name": "Y_MEM22", + "offset": "0x458" + }, + { + "name": "Y_MEM23", + "offset": "0x45C" + }, + { + "name": "Y_MEM24", + "offset": "0x460" + }, + { + "name": "Y_MEM25", + "offset": "0x464" + }, + { + "name": "Y_MEM26", + "offset": "0x468" + }, + { + "name": "Y_MEM27", + "offset": "0x46C" + }, + { + "name": "Y_MEM28", + "offset": "0x470" + }, + { + "name": "Y_MEM29", + "offset": "0x474" + }, + { + "name": "Y_MEM30", + "offset": "0x478" + }, + { + "name": "Y_MEM31", + "offset": "0x47C" + }, + { + "name": "X_MEM0", + "offset": "0x600" + }, + { + "name": "X_MEM1", + "offset": "0x604" + }, + { + "name": "X_MEM2", + "offset": "0x608" + }, + { + "name": "X_MEM3", + "offset": "0x60C" + }, + { + "name": "X_MEM4", + "offset": "0x610" + }, + { + "name": "X_MEM5", + "offset": "0x614" + }, + { + "name": "X_MEM6", + "offset": "0x618" + }, + { + "name": "X_MEM7", + "offset": "0x61C" + }, + { + "name": "X_MEM8", + "offset": "0x620" + }, + { + "name": "X_MEM9", + "offset": "0x624" + }, + { + "name": "X_MEM10", + "offset": "0x628" + }, + { + "name": "X_MEM11", + "offset": "0x62C" + }, + { + "name": "X_MEM12", + "offset": "0x630" + }, + { + "name": "X_MEM13", + "offset": "0x634" + }, + { + "name": "X_MEM14", + "offset": "0x638" + }, + { + "name": "X_MEM15", + "offset": "0x63C" + }, + { + "name": "X_MEM16", + "offset": "0x640" + }, + { + "name": "X_MEM17", + "offset": "0x644" + }, + { + "name": "X_MEM18", + "offset": "0x648" + }, + { + "name": "X_MEM19", + "offset": "0x64C" + }, + { + "name": "X_MEM20", + "offset": "0x650" + }, + { + "name": "X_MEM21", + "offset": "0x654" + }, + { + "name": "X_MEM22", + "offset": "0x658" + }, + { + "name": "X_MEM23", + "offset": "0x65C" + }, + { + "name": "X_MEM24", + "offset": "0x660" + }, + { + "name": "X_MEM25", + "offset": "0x664" + }, + { + "name": "X_MEM26", + "offset": "0x668" + }, + { + "name": "X_MEM27", + "offset": "0x66C" + }, + { + "name": "X_MEM28", + "offset": "0x670" + }, + { + "name": "X_MEM29", + "offset": "0x674" + }, + { + "name": "X_MEM30", + "offset": "0x678" + }, + { + "name": "X_MEM31", + "offset": "0x67C" + } + ] + }, + { + "name": "SHA", + "base": "0x3FF03000", + "registers": [ + { + "name": "TEXT0", + "offset": "0x00", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT1", + "offset": "0x04", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT2", + "offset": "0x08", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT3", + "offset": "0x0C", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT4", + "offset": "0x10", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT5", + "offset": "0x14", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT6", + "offset": "0x18", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT7", + "offset": "0x1C", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT8", + "offset": "0x20", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT9", + "offset": "0x24", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT10", + "offset": "0x28", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT11", + "offset": "0x2C", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT12", + "offset": "0x30", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT13", + "offset": "0x34", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT14", + "offset": "0x38", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT15", + "offset": "0x3C", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT16", + "offset": "0x40", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT17", + "offset": "0x44", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT18", + "offset": "0x48", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT19", + "offset": "0x4C", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT20", + "offset": "0x50", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT21", + "offset": "0x54", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT22", + "offset": "0x58", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT23", + "offset": "0x5C", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT24", + "offset": "0x60", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT25", + "offset": "0x64", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT26", + "offset": "0x68", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT27", + "offset": "0x6C", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT28", + "offset": "0x70", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT29", + "offset": "0x74", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT30", + "offset": "0x78", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "TEXT31", + "offset": "0x7C", + "fields": [ + [ + "TEXT", + 0, + 32 + ] + ] + }, + { + "name": "SHA1_START", + "offset": "0x80", + "fields": [ + [ + "SHA1_START", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA1_CONTINUE", + "offset": "0x84", + "fields": [ + [ + "SHA1_CONTINUE", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA1_LOAD", + "offset": "0x88", + "fields": [ + [ + "SHA1_LOAD", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA1_BUSY", + "offset": "0x8C", + "fields": [ + [ + "SHA1_BUSY", + 0, + 1, + "r" + ] + ] + }, + { + "name": "SHA256_START", + "offset": "0x90", + "fields": [ + [ + "SHA256_START", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA256_LOAD", + "offset": "0x98", + "fields": [ + [ + "SHA256_LOAD", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA256_CONTINUE", + "offset": "0x94", + "fields": [ + [ + "SHA256_CONTINUE", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA256_BUSY", + "offset": "0x9C", + "fields": [ + [ + "SHA256_BUSY", + 0, + 1, + "r" + ] + ] + }, + { + "name": "SHA384_START", + "offset": "0xA0", + "fields": [ + [ + "SHA384_START", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA384_CONTINUE", + "offset": "0xA4", + "fields": [ + [ + "SHA384_CONTINUE", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA384_LOAD", + "offset": "0xA8", + "fields": [ + [ + "SHA384_LOAD", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA384_BUSY", + "offset": "0xAC", + "fields": [ + [ + "SHA384_BUSY", + 0, + 1, + "r" + ] + ] + }, + { + "name": "SHA512_START", + "offset": "0xB0", + "fields": [ + [ + "SHA512_START", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA512_CONTINUE", + "offset": "0xB4", + "fields": [ + [ + "SHA512_CONTINUE", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA512_LOAD", + "offset": "0xB8", + "fields": [ + [ + "SHA512_LOAD", + 0, + 1, + "w" + ] + ] + }, + { + "name": "SHA512_BUSY", + "offset": "0xBC", + "fields": [ + [ + "SHA512_BUSY", + 0, + 1, + "r" + ] + ] + } + ] + }, + { + "name": "UART0", + "base": "0x3FF40000", + "interrupts": [ + "UART0" + ], + "registers": [ + { + "name": "FIFO", + "offset": "0x00", + "fields": [ + [ + "RXFIFO_RD_BYTE", + 0, + 8 + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x04", + "fields": [ + [ + "RXFIFO_FULL_INT_RAW", + 0, + 1, + "r" + ], + [ + "TXFIFO_EMPTY_INT_RAW", + 1, + 1, + "r" + ], + [ + "PARITY_ERR_INT_RAW", + 2, + 1, + "r" + ], + [ + "FRM_ERR_INT_RAW", + 3, + 1, + "r" + ], + [ + "RXFIFO_OVF_INT_RAW", + 4, + 1, + "r" + ], + [ + "DSR_CHG_INT_RAW", + 5, + 1, + "r" + ], + [ + "CTS_CHG_INT_RAW", + 6, + 1, + "r" + ], + [ + "BRK_DET_INT_RAW", + 7, + 1, + "r" + ], + [ + "RXFIFO_TOUT_INT_RAW", + 8, + 1, + "r" + ], + [ + "SW_XON_INT_RAW", + 9, + 1, + "r" + ], + [ + "SW_XOFF_INT_RAW", + 10, + 1, + "r" + ], + [ + "GLITCH_DET_INT_RAW", + 11, + 1, + "r" + ], + [ + "TX_BRK_DONE_INT_RAW", + 12, + 1, + "r" + ], + [ + "TX_BRK_IDLE_DONE_INT_RAW", + 13, + 1, + "r" + ], + [ + "TX_DONE_INT_RAW", + 14, + 1, + "r" + ], + [ + "RS485_PARITY_ERR_INT_RAW", + 15, + 1, + "r" + ], + [ + "RS485_FRM_ERR_INT_RAW", + 16, + 1, + "r" + ], + [ + "RS485_CLASH_INT_RAW", + 17, + 1, + "r" + ], + [ + "AT_CMD_CHAR_DET_INT_RAW", + 18, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0x08", + "fields": [ + [ + "RXFIFO_FULL_INT_ST", + 0, + 1, + "r" + ], + [ + "TXFIFO_EMPTY_INT_ST", + 1, + 1, + "r" + ], + [ + "PARITY_ERR_INT_ST", + 2, + 1, + "r" + ], + [ + "FRM_ERR_INT_ST", + 3, + 1, + "r" + ], + [ + "RXFIFO_OVF_INT_ST", + 4, + 1, + "r" + ], + [ + "DSR_CHG_INT_ST", + 5, + 1, + "r" + ], + [ + "CTS_CHG_INT_ST", + 6, + 1, + "r" + ], + [ + "BRK_DET_INT_ST", + 7, + 1, + "r" + ], + [ + "RXFIFO_TOUT_INT_ST", + 8, + 1, + "r" + ], + [ + "SW_XON_INT_ST", + 9, + 1, + "r" + ], + [ + "SW_XOFF_INT_ST", + 10, + 1, + "r" + ], + [ + "GLITCH_DET_INT_ST", + 11, + 1, + "r" + ], + [ + "TX_BRK_DONE_INT_ST", + 12, + 1, + "r" + ], + [ + "TX_BRK_IDLE_DONE_INT_ST", + 13, + 1, + "r" + ], + [ + "TX_DONE_INT_ST", + 14, + 1, + "r" + ], + [ + "RS485_PARITY_ERR_INT_ST", + 15, + 1, + "r" + ], + [ + "RS485_FRM_ERR_INT_ST", + 16, + 1, + "r" + ], + [ + "RS485_CLASH_INT_ST", + 17, + 1, + "r" + ], + [ + "AT_CMD_CHAR_DET_INT_ST", + 18, + 1, + "r" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x0C", + "fields": [ + [ + "RXFIFO_FULL_INT_ENA", + 0, + 1 + ], + [ + "TXFIFO_EMPTY_INT_ENA", + 1, + 1 + ], + [ + "PARITY_ERR_INT_ENA", + 2, + 1 + ], + [ + "FRM_ERR_INT_ENA", + 3, + 1 + ], + [ + "RXFIFO_OVF_INT_ENA", + 4, + 1 + ], + [ + "DSR_CHG_INT_ENA", + 5, + 1 + ], + [ + "CTS_CHG_INT_ENA", + 6, + 1 + ], + [ + "BRK_DET_INT_ENA", + 7, + 1 + ], + [ + "RXFIFO_TOUT_INT_ENA", + 8, + 1 + ], + [ + "SW_XON_INT_ENA", + 9, + 1 + ], + [ + "SW_XOFF_INT_ENA", + 10, + 1 + ], + [ + "GLITCH_DET_INT_ENA", + 11, + 1 + ], + [ + "TX_BRK_DONE_INT_ENA", + 12, + 1 + ], + [ + "TX_BRK_IDLE_DONE_INT_ENA", + 13, + 1 + ], + [ + "TX_DONE_INT_ENA", + 14, + 1 + ], + [ + "RS485_PARITY_ERR_INT_ENA", + 15, + 1 + ], + [ + "RS485_FRM_ERR_INT_ENA", + 16, + 1 + ], + [ + "RS485_CLASH_INT_ENA", + 17, + 1 + ], + [ + "AT_CMD_CHAR_DET_INT_ENA", + 18, + 1 + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x10", + "fields": [ + [ + "RXFIFO_FULL_INT_CLR", + 0, + 1, + "w" + ], + [ + "TXFIFO_EMPTY_INT_CLR", + 1, + 1, + "w" + ], + [ + "PARITY_ERR_INT_CLR", + 2, + 1, + "w" + ], + [ + "FRM_ERR_INT_CLR", + 3, + 1, + "w" + ], + [ + "RXFIFO_OVF_INT_CLR", + 4, + 1, + "w" + ], + [ + "DSR_CHG_INT_CLR", + 5, + 1, + "w" + ], + [ + "CTS_CHG_INT_CLR", + 6, + 1, + "w" + ], + [ + "BRK_DET_INT_CLR", + 7, + 1, + "w" + ], + [ + "RXFIFO_TOUT_INT_CLR", + 8, + 1, + "w" + ], + [ + "SW_XON_INT_CLR", + 9, + 1, + "w" + ], + [ + "SW_XOFF_INT_CLR", + 10, + 1, + "w" + ], + [ + "GLITCH_DET_INT_CLR", + 11, + 1, + "w" + ], + [ + "TX_BRK_DONE_INT_CLR", + 12, + 1, + "w" + ], + [ + "TX_BRK_IDLE_DONE_INT_CLR", + 13, + 1, + "w" + ], + [ + "TX_DONE_INT_CLR", + 14, + 1, + "w" + ], + [ + "RS485_PARITY_ERR_INT_CLR", + 15, + 1, + "w" + ], + [ + "RS485_FRM_ERR_INT_CLR", + 16, + 1, + "w" + ], + [ + "RS485_CLASH_INT_CLR", + 17, + 1, + "w" + ], + [ + "AT_CMD_CHAR_DET_INT_CLR", + 18, + 1, + "w" + ] + ] + }, + { + "name": "CLKDIV", + "offset": "0x14", + "reset": "0x000002B6", + "fields": [ + [ + "CLKDIV", + 0, + 20 + ], + [ + "FRAG", + 20, + 4 + ] + ] + }, + { + "name": "AUTOBAUD", + "offset": "0x18", + "reset": "0x00001000", + "fields": [ + [ + "EN", + 0, + 1 + ], + [ + "GLITCH_FILT", + 8, + 8 + ] + ] + }, + { + "name": "STATUS", + "offset": "0x1C", + "fields": [ + [ + "RXFIFO_CNT", + 0, + 8, + "r" + ], + [ + "ST_URX_OUT", + 8, + 4, + "r" + ], + [ + "DSRN", + 13, + 1, + "r" + ], + [ + "CTSN", + 14, + 1, + "r" + ], + [ + "RXD", + 15, + 1, + "r" + ], + [ + "TXFIFO_CNT", + 16, + 8, + "r" + ], + [ + "ST_UTX_OUT", + 24, + 4, + "r" + ], + [ + "DTRN", + 29, + 1, + "r" + ], + [ + "RTSN", + 30, + 1, + "r" + ], + [ + "TXD", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CONF0", + "offset": "0x20", + "reset": "0x0800001C", + "fields": [ + [ + "PARITY", + 0, + 1 + ], + [ + "PARITY_EN", + 1, + 1 + ], + [ + "BIT_NUM", + 2, + 2 + ], + [ + "STOP_BIT_NUM", + 4, + 2 + ], + [ + "SW_RTS", + 6, + 1 + ], + [ + "SW_DTR", + 7, + 1 + ], + [ + "TXD_BRK", + 8, + 1 + ], + [ + "IRDA_DPLX", + 9, + 1 + ], + [ + "IRDA_TX_EN", + 10, + 1 + ], + [ + "IRDA_WCTL", + 11, + 1 + ], + [ + "IRDA_TX_INV", + 12, + 1 + ], + [ + "IRDA_RX_INV", + 13, + 1 + ], + [ + "LOOPBACK", + 14, + 1 + ], + [ + "TX_FLOW_EN", + 15, + 1 + ], + [ + "IRDA_EN", + 16, + 1 + ], + [ + "RXFIFO_RST", + 17, + 1 + ], + [ + "TXFIFO_RST", + 18, + 1 + ], + [ + "RXD_INV", + 19, + 1 + ], + [ + "CTS_INV", + 20, + 1 + ], + [ + "DSR_INV", + 21, + 1 + ], + [ + "TXD_INV", + 22, + 1 + ], + [ + "RTS_INV", + 23, + 1 + ], + [ + "DTR_INV", + 24, + 1 + ], + [ + "CLK_EN", + 25, + 1 + ], + [ + "ERR_WR_MASK", + 26, + 1 + ], + [ + "TICK_REF_ALWAYS_ON", + 27, + 1 + ] + ] + }, + { + "name": "CONF1", + "offset": "0x24", + "reset": "0x00006060", + "fields": [ + [ + "RXFIFO_FULL_THRHD", + 0, + 7 + ], + [ + "TXFIFO_EMPTY_THRHD", + 8, + 7 + ], + [ + "RX_FLOW_THRHD", + 16, + 7 + ], + [ + "RX_FLOW_EN", + 23, + 1 + ], + [ + "RX_TOUT_THRHD", + 24, + 7 + ], + [ + "RX_TOUT_EN", + 31, + 1 + ] + ] + }, + { + "name": "LOWPULSE", + "offset": "0x28", + "reset": "0x000FFFFF", + "fields": [ + [ + "MIN_CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "HIGHPULSE", + "offset": "0x2C", + "reset": "0x000FFFFF", + "fields": [ + [ + "MIN_CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "RXD_CNT", + "offset": "0x30", + "fields": [ + [ + "RXD_EDGE_CNT", + 0, + 10, + "r" + ] + ] + }, + { + "name": "FLOW_CONF", + "offset": "0x34", + "fields": [ + [ + "SW_FLOW_CON_EN", + 0, + 1 + ], + [ + "XONOFF_DEL", + 1, + 1 + ], + [ + "FORCE_XON", + 2, + 1 + ], + [ + "FORCE_XOFF", + 3, + 1 + ], + [ + "SEND_XON", + 4, + 1 + ], + [ + "SEND_XOFF", + 5, + 1 + ] + ] + }, + { + "name": "SLEEP_CONF", + "offset": "0x38", + "reset": "0x000000F0", + "fields": [ + [ + "ACTIVE_THRESHOLD", + 0, + 10 + ] + ] + }, + { + "name": "SWFC_CONF", + "offset": "0x3C", + "reset": "0x1311E000", + "fields": [ + [ + "XON_THRESHOLD", + 0, + 8 + ], + [ + "XOFF_THRESHOLD", + 8, + 8 + ], + [ + "XON_CHAR", + 16, + 8 + ], + [ + "XOFF_CHAR", + 24, + 8 + ] + ] + }, + { + "name": "IDLE_CONF", + "offset": "0x40", + "reset": "0x00A40100", + "fields": [ + [ + "RX_IDLE_THRHD", + 0, + 10 + ], + [ + "TX_IDLE_NUM", + 10, + 10 + ], + [ + "TX_BRK_NUM", + 20, + 8 + ] + ] + }, + { + "name": "RS485_CONF", + "offset": "0x44", + "fields": [ + [ + "RS485_EN", + 0, + 1 + ], + [ + "DL0_EN", + 1, + 1 + ], + [ + "DL1_EN", + 2, + 1 + ], + [ + "RS485TX_RX_EN", + 3, + 1 + ], + [ + "RS485RXBY_TX_EN", + 4, + 1 + ], + [ + "RS485_RX_DLY_NUM", + 5, + 1 + ], + [ + "RS485_TX_DLY_NUM", + 6, + 4 + ] + ] + }, + { + "name": "AT_CMD_PRECNT", + "offset": "0x48", + "reset": "0x00186A00", + "fields": [ + [ + "PRE_IDLE_NUM", + 0, + 24 + ] + ] + }, + { + "name": "AT_CMD_POSTCNT", + "offset": "0x4C", + "reset": "0x00186A00", + "fields": [ + [ + "POST_IDLE_NUM", + 0, + 24 + ] + ] + }, + { + "name": "AT_CMD_GAPTOUT", + "offset": "0x50", + "reset": "0x00001E00", + "fields": [ + [ + "RX_GAP_TOUT", + 0, + 24 + ] + ] + }, + { + "name": "AT_CMD_CHAR", + "offset": "0x54", + "reset": "0x0000032B", + "fields": [ + [ + "AT_CMD_CHAR", + 0, + 8 + ], + [ + "CHAR_NUM", + 8, + 8 + ] + ] + }, + { + "name": "MEM_CONF", + "offset": "0x58", + "reset": "0x00000088", + "fields": [ + [ + "MEM_PD", + 0, + 1 + ], + [ + "RX_SIZE", + 3, + 4 + ], + [ + "TX_SIZE", + 7, + 4 + ], + [ + "RX_FLOW_THRHD_H3", + 15, + 3 + ], + [ + "RX_TOUT_THRHD_H3", + 18, + 3 + ], + [ + "XON_THRESHOLD_H2", + 21, + 2 + ], + [ + "XOFF_THRESHOLD_H2", + 23, + 2 + ], + [ + "RX_MEM_FULL_THRHD", + 25, + 3 + ], + [ + "TX_MEM_EMPTY_THRHD", + 28, + 3 + ] + ] + }, + { + "name": "MEM_TX_STATUS", + "offset": "0x5C", + "fields": [ + [ + "MEM_TX_STATUS", + 0, + 24, + "r" + ] + ] + }, + { + "name": "MEM_RX_STATUS", + "offset": "0x60", + "fields": [ + [ + "MEM_RX_RD_ADDR", + 2, + 11, + "r" + ], + [ + "MEM_RX_WR_ADDR", + 13, + 11, + "r" + ] + ] + }, + { + "name": "MEM_CNT_STATUS", + "offset": "0x64", + "fields": [ + [ + "RX_MEM_CNT", + 0, + 3, + "r" + ], + [ + "TX_MEM_CNT", + 3, + 3, + "r" + ] + ] + }, + { + "name": "POSPULSE", + "offset": "0x68", + "reset": "0x000FFFFF", + "fields": [ + [ + "POSEDGE_MIN_CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "NEGPULSE", + "offset": "0x6C", + "reset": "0x000FFFFF", + "fields": [ + [ + "NEGEDGE_MIN_CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "DATE", + "offset": "0x78", + "reset": "0x15122500", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + }, + { + "name": "ID", + "offset": "0x7C", + "reset": "0x00000500", + "fields": [ + [ + "ID", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "SPI1", + "base": "0x3FF42000", + "interrupts": [ + "SPI1", + "SPI1_DMA" + ], + "derived_from": "SPI0" + }, + { + "name": "SPI0", + "base": "0x3FF43000", + "interrupts": [ + "SPI0" + ], + "registers": [ + { + "name": "CMD", + "offset": "0x00", + "fields": [ + [ + "FLASH_PER", + 16, + 1 + ], + [ + "FLASH_PES", + 17, + 1 + ], + [ + "USR", + 18, + 1 + ], + [ + "FLASH_HPM", + 19, + 1 + ], + [ + "FLASH_RES", + 20, + 1 + ], + [ + "FLASH_DP", + 21, + 1 + ], + [ + "FLASH_CE", + 22, + 1 + ], + [ + "FLASH_BE", + 23, + 1 + ], + [ + "FLASH_SE", + 24, + 1 + ], + [ + "FLASH_PP", + 25, + 1 + ], + [ + "FLASH_WRSR", + 26, + 1 + ], + [ + "FLASH_RDSR", + 27, + 1 + ], + [ + "FLASH_RDID", + 28, + 1 + ], + [ + "FLASH_WRDI", + 29, + 1 + ], + [ + "FLASH_WREN", + 30, + 1 + ], + [ + "FLASH_READ", + 31, + 1 + ] + ] + }, + { + "name": "ADDR", + "offset": "0x04" + }, + { + "name": "CTRL", + "offset": "0x08", + "reset": "0x0020A400", + "fields": [ + [ + "FCS_CRC_EN", + 10, + 1 + ], + [ + "TX_CRC_EN", + 11, + 1 + ], + [ + "WAIT_FLASH_IDLE_EN", + 12, + 1 + ], + [ + "FASTRD_MODE", + 13, + 1 + ], + [ + "FREAD_DUAL", + 14, + 1 + ], + [ + "RESANDRES", + 15, + 1 + ], + [ + "FREAD_QUAD", + 20, + 1 + ], + [ + "WP", + 21, + 1 + ], + [ + "WRSR_2B", + 22, + 1 + ], + [ + "FREAD_DIO", + 23, + 1 + ], + [ + "FREAD_QIO", + 24, + 1 + ], + [ + "RD_BIT_ORDER", + 25, + 1 + ], + [ + "WR_BIT_ORDER", + 26, + 1 + ] + ] + }, + { + "name": "CTRL1", + "offset": "0x0C", + "reset": "0x5FFF0000", + "fields": [ + [ + "CS_HOLD_DELAY_RES", + 16, + 12 + ], + [ + "CS_HOLD_DELAY", + 28, + 4 + ] + ] + }, + { + "name": "RD_STATUS", + "offset": "0x10", + "fields": [ + [ + "STATUS", + 0, + 16 + ], + [ + "WB_MODE", + 16, + 8 + ], + [ + "STATUS_EXT", + 24, + 8 + ] + ] + }, + { + "name": "CTRL2", + "offset": "0x14", + "reset": "0x00000011", + "fields": [ + [ + "SETUP_TIME", + 0, + 4 + ], + [ + "HOLD_TIME", + 4, + 4 + ], + [ + "CK_OUT_LOW_MODE", + 8, + 4 + ], + [ + "CK_OUT_HIGH_MODE", + 12, + 4 + ], + [ + "MISO_DELAY_MODE", + 16, + 2 + ], + [ + "MISO_DELAY_NUM", + 18, + 3 + ], + [ + "MOSI_DELAY_MODE", + 21, + 2 + ], + [ + "MOSI_DELAY_NUM", + 23, + 3 + ], + [ + "CS_DELAY_MODE", + 26, + 2 + ], + [ + "CS_DELAY_NUM", + 28, + 4 + ] + ] + }, + { + "name": "CLOCK", + "offset": "0x18", + "reset": "0x80003043", + "fields": [ + [ + "CLKCNT_L", + 0, + 6 + ], + [ + "CLKCNT_H", + 6, + 6 + ], + [ + "CLKCNT_N", + 12, + 6 + ], + [ + "CLKDIV_PRE", + 18, + 13 + ], + [ + "CLK_EQU_SYSCLK", + 31, + 1 + ] + ] + }, + { + "name": "USER", + "offset": "0x1C", + "reset": "0x80000040", + "fields": [ + [ + "DOUTDIN", + 0, + 1 + ], + [ + "CS_HOLD", + 4, + 1 + ], + [ + "CS_SETUP", + 5, + 1 + ], + [ + "CK_I_EDGE", + 6, + 1 + ], + [ + "CK_OUT_EDGE", + 7, + 1 + ], + [ + "RD_BYTE_ORDER", + 10, + 1 + ], + [ + "WR_BYTE_ORDER", + 11, + 1 + ], + [ + "FWRITE_DUAL", + 12, + 1 + ], + [ + "FWRITE_QUAD", + 13, + 1 + ], + [ + "FWRITE_DIO", + 14, + 1 + ], + [ + "FWRITE_QIO", + 15, + 1 + ], + [ + "SIO", + 16, + 1 + ], + [ + "USR_HOLD_POL", + 17, + 1 + ], + [ + "USR_DOUT_HOLD", + 18, + 1 + ], + [ + "USR_DIN_HOLD", + 19, + 1 + ], + [ + "USR_DUMMY_HOLD", + 20, + 1 + ], + [ + "USR_ADDR_HOLD", + 21, + 1 + ], + [ + "USR_CMD_HOLD", + 22, + 1 + ], + [ + "USR_PREP_HOLD", + 23, + 1 + ], + [ + "USR_MISO_HIGHPART", + 24, + 1 + ], + [ + "USR_MOSI_HIGHPART", + 25, + 1 + ], + [ + "USR_DUMMY_IDLE", + 26, + 1 + ], + [ + "USR_MOSI", + 27, + 1 + ], + [ + "USR_MISO", + 28, + 1 + ], + [ + "USR_DUMMY", + 29, + 1 + ], + [ + "USR_ADDR", + 30, + 1 + ], + [ + "USR_COMMAND", + 31, + 1 + ] + ] + }, + { + "name": "USER1", + "offset": "0x20", + "reset": "0x5C000007", + "fields": [ + [ + "USR_DUMMY_CYCLELEN", + 0, + 8 + ], + [ + "USR_ADDR_BITLEN", + 26, + 6, + "r" + ] + ] + }, + { + "name": "USER2", + "offset": "0x24", + "reset": "0x70000000", + "fields": [ + [ + "USR_COMMAND_VALUE", + 0, + 16 + ], + [ + "USR_COMMAND_BITLEN", + 28, + 4 + ] + ] + }, + { + "name": "MOSI_DLEN", + "offset": "0x28", + "fields": [ + [ + "USR_MOSI_DBITLEN", + 0, + 24 + ] + ] + }, + { + "name": "MISO_DLEN", + "offset": "0x2C", + "fields": [ + [ + "USR_MISO_DBITLEN", + 0, + 24 + ] + ] + }, + { + "name": "SLV_WR_STATUS", + "offset": "0x30", + "fields": [ + [ + "SLV_WR_ST", + 0, + 32 + ] + ] + }, + { + "name": "PIN", + "offset": "0x34", + "reset": "0x00000006", + "fields": [ + [ + "CS0_DIS", + 0, + 1 + ], + [ + "CS1_DIS", + 1, + 1 + ], + [ + "CS2_DIS", + 2, + 1 + ], + [ + "CK_DIS", + 5, + 1 + ], + [ + "MASTER_CS_POL", + 6, + 3 + ], + [ + "MASTER_CK_SEL", + 11, + 3 + ], + [ + "CK_IDLE_EDGE", + 29, + 1 + ], + [ + "CS_KEEP_ACTIVE", + 30, + 1 + ] + ] + }, + { + "name": "SLAVE", + "offset": "0x38", + "reset": "0x00000020", + "fields": [ + [ + "SLV_RD_BUF_DONE", + 0, + 1 + ], + [ + "SLV_WR_BUF_DONE", + 1, + 1 + ], + [ + "SLV_RD_STA_DONE", + 2, + 1 + ], + [ + "SLV_WR_STA_DONE", + 3, + 1 + ], + [ + "TRANS_DONE", + 4, + 1 + ], + [ + "INT_EN", + 5, + 5 + ], + [ + "CS_I_MODE", + 10, + 2 + ], + [ + "SLV_LAST_COMMAND", + 17, + 3, + "r" + ], + [ + "SLV_LAST_STATE", + 20, + 3, + "r" + ], + [ + "TRANS_CNT", + 23, + 4, + "r" + ], + [ + "SLV_CMD_DEFINE", + 27, + 1 + ], + [ + "SLV_WR_RD_STA_EN", + 28, + 1 + ], + [ + "SLV_WR_RD_BUF_EN", + 29, + 1 + ], + [ + "MODE", + 30, + 1 + ], + [ + "SYNC_RESET", + 31, + 1 + ] + ] + }, + { + "name": "SLAVE1", + "offset": "0x3C", + "reset": "0x02000000", + "fields": [ + [ + "SLV_RDBUF_DUMMY_EN", + 0, + 1 + ], + [ + "SLV_WRBUF_DUMMY_EN", + 1, + 1 + ], + [ + "SLV_RDSTA_DUMMY_EN", + 2, + 1 + ], + [ + "SLV_WRSTA_DUMMY_EN", + 3, + 1 + ], + [ + "SLV_WR_ADDR_BITLEN", + 4, + 6 + ], + [ + "SLV_RD_ADDR_BITLEN", + 10, + 6 + ], + [ + "SLV_STATUS_READBACK", + 25, + 1 + ], + [ + "SLV_STATUS_FAST_EN", + 26, + 1 + ], + [ + "SLV_STATUS_BITLEN", + 27, + 5 + ] + ] + }, + { + "name": "SLAVE2", + "offset": "0x40", + "fields": [ + [ + "SLV_RDSTA_DUMMY_CYCLELEN", + 0, + 8 + ], + [ + "SLV_WRSTA_DUMMY_CYCLELEN", + 8, + 8 + ], + [ + "SLV_RDBUF_DUMMY_CYCLELEN", + 16, + 8 + ], + [ + "SLV_WRBUF_DUMMY_CYCLELEN", + 24, + 8 + ] + ] + }, + { + "name": "SLAVE3", + "offset": "0x44", + "fields": [ + [ + "SLV_RDBUF_CMD_VALUE", + 0, + 8 + ], + [ + "SLV_WRBUF_CMD_VALUE", + 8, + 8 + ], + [ + "SLV_RDSTA_CMD_VALUE", + 16, + 8 + ], + [ + "SLV_WRSTA_CMD_VALUE", + 24, + 8 + ] + ] + }, + { + "name": "SLV_WRBUF_DLEN", + "offset": "0x48", + "fields": [ + [ + "SLV_WRBUF_DBITLEN", + 0, + 24 + ] + ] + }, + { + "name": "SLV_RDBUF_DLEN", + "offset": "0x4C", + "fields": [ + [ + "SLV_RDBUF_DBITLEN", + 0, + 24 + ] + ] + }, + { + "name": "CACHE_FCTRL", + "offset": "0x50", + "fields": [ + [ + "CACHE_REQ_EN", + 0, + 1 + ], + [ + "CACHE_USR_CMD_4BYTE", + 1, + 1 + ], + [ + "CACHE_FLASH_USR_CMD", + 2, + 1 + ], + [ + "CACHE_FLASH_PES_EN", + 3, + 1 + ] + ] + }, + { + "name": "CACHE_SCTRL", + "offset": "0x54", + "reset": "0x15C04830", + "fields": [ + [ + "USR_SRAM_DIO", + 1, + 1 + ], + [ + "USR_SRAM_QIO", + 2, + 1 + ], + [ + "USR_WR_SRAM_DUMMY", + 3, + 1 + ], + [ + "USR_RD_SRAM_DUMMY", + 4, + 1 + ], + [ + "CACHE_SRAM_USR_RCMD", + 5, + 1 + ], + [ + "SRAM_BYTES_LEN", + 6, + 8 + ], + [ + "SRAM_DUMMY_CYCLELEN", + 14, + 8 + ], + [ + "SRAM_ADDR_BITLEN", + 22, + 6 + ], + [ + "CACHE_SRAM_USR_WCMD", + 28, + 1 + ] + ] + }, + { + "name": "SRAM_CMD", + "offset": "0x58", + "fields": [ + [ + "SRAM_DIO", + 0, + 1 + ], + [ + "SRAM_QIO", + 1, + 1 + ], + [ + "SRAM_RSTIO", + 4, + 1 + ] + ] + }, + { + "name": "SRAM_DRD_CMD", + "offset": "0x5C", + "fields": [ + [ + "CACHE_SRAM_USR_RD_CMD_VALUE", + 0, + 16 + ], + [ + "CACHE_SRAM_USR_RD_CMD_BITLEN", + 28, + 4 + ] + ] + }, + { + "name": "SRAM_DWR_CMD", + "offset": "0x60", + "fields": [ + [ + "CACHE_SRAM_USR_WR_CMD_VALUE", + 0, + 16 + ], + [ + "CACHE_SRAM_USR_WR_CMD_BITLEN", + 28, + 4 + ] + ] + }, + { + "name": "SLV_RD_BIT", + "offset": "0x64", + "fields": [ + [ + "SLV_RDATA_BIT", + 0, + 24 + ] + ] + }, + { + "name": "W0", + "offset": "0x80", + "fields": [ + [ + "BUF0", + 0, + 32 + ] + ] + }, + { + "name": "W1", + "offset": "0x84", + "fields": [ + [ + "BUF1", + 0, + 32 + ] + ] + }, + { + "name": "W2", + "offset": "0x88", + "fields": [ + [ + "BUF2", + 0, + 32 + ] + ] + }, + { + "name": "W3", + "offset": "0x8C", + "fields": [ + [ + "BUF3", + 0, + 32 + ] + ] + }, + { + "name": "W4", + "offset": "0x90", + "fields": [ + [ + "BUF4", + 0, + 32 + ] + ] + }, + { + "name": "W5", + "offset": "0x94", + "fields": [ + [ + "BUF5", + 0, + 32 + ] + ] + }, + { + "name": "W6", + "offset": "0x98", + "fields": [ + [ + "BUF6", + 0, + 32 + ] + ] + }, + { + "name": "W7", + "offset": "0x9C", + "fields": [ + [ + "BUF7", + 0, + 32 + ] + ] + }, + { + "name": "W8", + "offset": "0xA0", + "fields": [ + [ + "BUF8", + 0, + 32 + ] + ] + }, + { + "name": "W9", + "offset": "0xA4", + "fields": [ + [ + "BUF9", + 0, + 32 + ] + ] + }, + { + "name": "W10", + "offset": "0xA8", + "fields": [ + [ + "BUF10", + 0, + 32 + ] + ] + }, + { + "name": "W11", + "offset": "0xAC", + "fields": [ + [ + "BUF11", + 0, + 32 + ] + ] + }, + { + "name": "W12", + "offset": "0xB0", + "fields": [ + [ + "BUF12", + 0, + 32 + ] + ] + }, + { + "name": "W13", + "offset": "0xB4", + "fields": [ + [ + "BUF13", + 0, + 32 + ] + ] + }, + { + "name": "W14", + "offset": "0xB8", + "fields": [ + [ + "BUF14", + 0, + 32 + ] + ] + }, + { + "name": "W15", + "offset": "0xBC", + "fields": [ + [ + "BUF15", + 0, + 32 + ] + ] + }, + { + "name": "TX_CRC", + "offset": "0xC0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "EXT0", + "offset": "0xF0", + "reset": "0x800A0050", + "fields": [ + [ + "T_PP_TIME", + 0, + 12 + ], + [ + "T_PP_SHIFT", + 16, + 4 + ], + [ + "T_PP_ENA", + 31, + 1 + ] + ] + }, + { + "name": "EXT1", + "offset": "0xF4", + "reset": "0x800F0000", + "fields": [ + [ + "T_ERASE_TIME", + 0, + 12 + ], + [ + "T_ERASE_SHIFT", + 16, + 4 + ], + [ + "T_ERASE_ENA", + 31, + 1 + ] + ] + }, + { + "name": "EXT2", + "offset": "0xF8", + "fields": [ + [ + "ST", + 0, + 3, + "r" + ] + ] + }, + { + "name": "EXT3", + "offset": "0xFC", + "fields": [ + [ + "INT_HOLD_ENA", + 0, + 2 + ] + ] + }, + { + "name": "DMA_CONF", + "offset": "0x100", + "reset": "0x00000200", + "fields": [ + [ + "IN_RST", + 2, + 1 + ], + [ + "OUT_RST", + 3, + 1 + ], + [ + "AHBM_FIFO_RST", + 4, + 1 + ], + [ + "AHBM_RST", + 5, + 1 + ], + [ + "IN_LOOP_TEST", + 6, + 1 + ], + [ + "OUT_LOOP_TEST", + 7, + 1 + ], + [ + "OUT_AUTO_WRBACK", + 8, + 1 + ], + [ + "OUT_EOF_MODE", + 9, + 1 + ], + [ + "OUTDSCR_BURST_EN", + 10, + 1 + ], + [ + "INDSCR_BURST_EN", + 11, + 1 + ], + [ + "OUT_DATA_BURST_EN", + 12, + 1 + ], + [ + "DMA_RX_STOP", + 14, + 1 + ], + [ + "DMA_TX_STOP", + 15, + 1 + ], + [ + "DMA_CONTINUE", + 16, + 1 + ] + ] + }, + { + "name": "DMA_OUT_LINK", + "offset": "0x104", + "fields": [ + [ + "OUTLINK_ADDR", + 0, + 20 + ], + [ + "OUTLINK_STOP", + 28, + 1 + ], + [ + "OUTLINK_START", + 29, + 1 + ], + [ + "OUTLINK_RESTART", + 30, + 1 + ] + ] + }, + { + "name": "DMA_IN_LINK", + "offset": "0x108", + "fields": [ + [ + "INLINK_ADDR", + 0, + 20 + ], + [ + "INLINK_AUTO_RET", + 20, + 1 + ], + [ + "INLINK_STOP", + 28, + 1 + ], + [ + "INLINK_START", + 29, + 1 + ], + [ + "INLINK_RESTART", + 30, + 1 + ] + ] + }, + { + "name": "DMA_STATUS", + "offset": "0x10C", + "fields": [ + [ + "DMA_RX_EN", + 0, + 1, + "r" + ], + [ + "DMA_TX_EN", + 1, + 1, + "r" + ] + ] + }, + { + "name": "DMA_INT_ENA", + "offset": "0x110", + "fields": [ + [ + "INLINK_DSCR_EMPTY_INT_ENA", + 0, + 1 + ], + [ + "OUTLINK_DSCR_ERROR_INT_ENA", + 1, + 1 + ], + [ + "INLINK_DSCR_ERROR_INT_ENA", + 2, + 1 + ], + [ + "IN_DONE_INT_ENA", + 3, + 1 + ], + [ + "IN_ERR_EOF_INT_ENA", + 4, + 1 + ], + [ + "IN_SUC_EOF_INT_ENA", + 5, + 1 + ], + [ + "OUT_DONE_INT_ENA", + 6, + 1 + ], + [ + "OUT_EOF_INT_ENA", + 7, + 1 + ], + [ + "OUT_TOTAL_EOF_INT_ENA", + 8, + 1 + ] + ] + }, + { + "name": "DMA_INT_RAW", + "offset": "0x114", + "fields": [ + [ + "INLINK_DSCR_EMPTY_INT_RAW", + 0, + 1, + "r" + ], + [ + "OUTLINK_DSCR_ERROR_INT_RAW", + 1, + 1, + "r" + ], + [ + "INLINK_DSCR_ERROR_INT_RAW", + 2, + 1, + "r" + ], + [ + "IN_DONE_INT_RAW", + 3, + 1, + "r" + ], + [ + "IN_ERR_EOF_INT_RAW", + 4, + 1, + "r" + ], + [ + "IN_SUC_EOF_INT_RAW", + 5, + 1, + "r" + ], + [ + "OUT_DONE_INT_RAW", + 6, + 1, + "r" + ], + [ + "OUT_EOF_INT_RAW", + 7, + 1, + "r" + ], + [ + "OUT_TOTAL_EOF_INT_RAW", + 8, + 1, + "r" + ] + ] + }, + { + "name": "DMA_INT_ST", + "offset": "0x118", + "fields": [ + [ + "INLINK_DSCR_EMPTY_INT_ST", + 0, + 1, + "r" + ], + [ + "OUTLINK_DSCR_ERROR_INT_ST", + 1, + 1, + "r" + ], + [ + "INLINK_DSCR_ERROR_INT_ST", + 2, + 1, + "r" + ], + [ + "IN_DONE_INT_ST", + 3, + 1, + "r" + ], + [ + "IN_ERR_EOF_INT_ST", + 4, + 1, + "r" + ], + [ + "IN_SUC_EOF_INT_ST", + 5, + 1, + "r" + ], + [ + "OUT_DONE_INT_ST", + 6, + 1, + "r" + ], + [ + "OUT_EOF_INT_ST", + 7, + 1, + "r" + ], + [ + "OUT_TOTAL_EOF_INT_ST", + 8, + 1, + "r" + ] + ] + }, + { + "name": "DMA_INT_CLR", + "offset": "0x11C", + "fields": [ + [ + "INLINK_DSCR_EMPTY_INT_CLR", + 0, + 1 + ], + [ + "OUTLINK_DSCR_ERROR_INT_CLR", + 1, + 1 + ], + [ + "INLINK_DSCR_ERROR_INT_CLR", + 2, + 1 + ], + [ + "IN_DONE_INT_CLR", + 3, + 1 + ], + [ + "IN_ERR_EOF_INT_CLR", + 4, + 1 + ], + [ + "IN_SUC_EOF_INT_CLR", + 5, + 1 + ], + [ + "OUT_DONE_INT_CLR", + 6, + 1 + ], + [ + "OUT_EOF_INT_CLR", + 7, + 1 + ], + [ + "OUT_TOTAL_EOF_INT_CLR", + 8, + 1 + ] + ] + }, + { + "name": "IN_ERR_EOF_DES_ADDR", + "offset": "0x120", + "fields": [ + [ + "DMA_IN_ERR_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "IN_SUC_EOF_DES_ADDR", + "offset": "0x124", + "fields": [ + [ + "DMA_IN_SUC_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "INLINK_DSCR", + "offset": "0x128", + "fields": [ + [ + "DMA_INLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "INLINK_DSCR_BF0", + "offset": "0x12C", + "fields": [ + [ + "DMA_INLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "INLINK_DSCR_BF1", + "offset": "0x130", + "fields": [ + [ + "DMA_INLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUT_EOF_BFR_DES_ADDR", + "offset": "0x134", + "fields": [ + [ + "DMA_OUT_EOF_BFR_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUT_EOF_DES_ADDR", + "offset": "0x138", + "fields": [ + [ + "DMA_OUT_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUTLINK_DSCR", + "offset": "0x13C", + "fields": [ + [ + "DMA_OUTLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUTLINK_DSCR_BF0", + "offset": "0x140", + "fields": [ + [ + "DMA_OUTLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUTLINK_DSCR_BF1", + "offset": "0x144", + "fields": [ + [ + "DMA_OUTLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_RSTATUS", + "offset": "0x148", + "fields": [ + [ + "DMA_OUT_STATUS", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_TSTATUS", + "offset": "0x14C", + "fields": [ + [ + "DMA_IN_STATUS", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DATE", + "offset": "0x3FC", + "reset": "0x01604270", + "fields": [ + [ + "DATE", + 0, + 28, + "r" + ] + ] + } + ] + }, + { + "name": "GPIO", + "base": "0x3FF44000", + "interrupts": [ + "GPIO", + "GPIO_NMI" + ], + "registers": [ + { + "name": "BT_SELECT", + "offset": "0x00", + "fields": [ + [ + "BT_SEL", + 0, + 32 + ] + ] + }, + { + "name": "OUT", + "offset": "0x04", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "OUT_W1TS", + "offset": "0x08", + "fields": [ + [ + "OUT_DATA_W1TS", + 0, + 32 + ] + ] + }, + { + "name": "OUT_W1TC", + "offset": "0x0C", + "fields": [ + [ + "OUT_DATA_W1TC", + 0, + 32 + ] + ] + }, + { + "name": "OUT1", + "offset": "0x10", + "fields": [ + [ + "DATA", + 0, + 8 + ] + ] + }, + { + "name": "OUT1_W1TS", + "offset": "0x14", + "fields": [ + [ + "OUT1_DATA_W1TS", + 0, + 8 + ] + ] + }, + { + "name": "OUT1_W1TC", + "offset": "0x18", + "fields": [ + [ + "OUT1_DATA_W1TC", + 0, + 8 + ] + ] + }, + { + "name": "SDIO_SELECT", + "offset": "0x1C", + "fields": [ + [ + "SDIO_SEL", + 0, + 8 + ] + ] + }, + { + "name": "ENABLE", + "offset": "0x20", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "ENABLE_W1TS", + "offset": "0x24", + "fields": [ + [ + "ENABLE_DATA_W1TS", + 0, + 32 + ] + ] + }, + { + "name": "ENABLE_W1TC", + "offset": "0x28", + "fields": [ + [ + "ENABLE_DATA_W1TC", + 0, + 32 + ] + ] + }, + { + "name": "ENABLE1", + "offset": "0x2C", + "fields": [ + [ + "DATA", + 0, + 8 + ] + ] + }, + { + "name": "ENABLE1_W1TS", + "offset": "0x30", + "fields": [ + [ + "ENABLE1_DATA_W1TS", + 0, + 8 + ] + ] + }, + { + "name": "ENABLE1_W1TC", + "offset": "0x34", + "fields": [ + [ + "ENABLE1_DATA_W1TC", + 0, + 8 + ] + ] + }, + { + "name": "STRAP", + "offset": "0x38", + "fields": [ + [ + "STRAPPING", + 0, + 16, + "r" + ] + ] + }, + { + "name": "IN", + "offset": "0x3C", + "fields": [ + [ + "DATA_NEXT", + 0, + 32 + ] + ] + }, + { + "name": "IN1", + "offset": "0x40", + "fields": [ + [ + "DATA_NEXT", + 0, + 8 + ] + ] + }, + { + "name": "STATUS", + "offset": "0x44", + "fields": [ + [ + "INT", + 0, + 32 + ] + ] + }, + { + "name": "STATUS_W1TS", + "offset": "0x48", + "fields": [ + [ + "STATUS_INT_W1TS", + 0, + 32 + ] + ] + }, + { + "name": "STATUS_W1TC", + "offset": "0x4C", + "fields": [ + [ + "STATUS_INT_W1TC", + 0, + 32 + ] + ] + }, + { + "name": "STATUS1", + "offset": "0x50", + "fields": [ + [ + "INT", + 0, + 8 + ] + ] + }, + { + "name": "STATUS1_W1TS", + "offset": "0x54", + "fields": [ + [ + "STATUS1_INT_W1TS", + 0, + 8 + ] + ] + }, + { + "name": "STATUS1_W1TC", + "offset": "0x58", + "fields": [ + [ + "STATUS1_INT_W1TC", + 0, + 8 + ] + ] + }, + { + "name": "ACPU_INT", + "offset": "0x60", + "fields": [ + [ + "APPCPU_INT", + 0, + 32, + "r" + ] + ] + }, + { + "name": "ACPU_NMI_INT", + "offset": "0x64", + "fields": [ + [ + "APPCPU_NMI_INT", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PCPU_INT", + "offset": "0x68", + "fields": [ + [ + "PROCPU_INT", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PCPU_NMI_INT", + "offset": "0x6C", + "fields": [ + [ + "PROCPU_NMI_INT", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CPUSDIO_INT", + "offset": "0x70", + "fields": [ + [ + "SDIO_INT", + 0, + 32, + "r" + ] + ] + }, + { + "name": "ACPU_INT1", + "offset": "0x74", + "fields": [ + [ + "APPCPU_INT_H", + 0, + 8, + "r" + ] + ] + }, + { + "name": "ACPU_NMI_INT1", + "offset": "0x78", + "fields": [ + [ + "APPCPU_NMI_INT_H", + 0, + 8, + "r" + ] + ] + }, + { + "name": "PCPU_INT1", + "offset": "0x7C", + "fields": [ + [ + "PROCPU_INT_H", + 0, + 8, + "r" + ] + ] + }, + { + "name": "PCPU_NMI_INT1", + "offset": "0x80", + "fields": [ + [ + "PROCPU_NMI_INT_H", + 0, + 8, + "r" + ] + ] + }, + { + "name": "CPUSDIO_INT1", + "offset": "0x84", + "fields": [ + [ + "SDIO_INT_H", + 0, + 8, + "r" + ] + ] + }, + { + "name": "PIN0", + "offset": "0x88", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN1", + "offset": "0x8C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN2", + "offset": "0x90", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN3", + "offset": "0x94", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN4", + "offset": "0x98", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN5", + "offset": "0x9C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN6", + "offset": "0xA0", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN7", + "offset": "0xA4", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN8", + "offset": "0xA8", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN9", + "offset": "0xAC", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN10", + "offset": "0xB0", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN11", + "offset": "0xB4", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN12", + "offset": "0xB8", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN13", + "offset": "0xBC", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN14", + "offset": "0xC0", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN15", + "offset": "0xC4", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN16", + "offset": "0xC8", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN17", + "offset": "0xCC", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN18", + "offset": "0xD0", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN19", + "offset": "0xD4", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN20", + "offset": "0xD8", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN21", + "offset": "0xDC", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN22", + "offset": "0xE0", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN23", + "offset": "0xE4", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN24", + "offset": "0xE8", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN25", + "offset": "0xEC", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN26", + "offset": "0xF0", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN27", + "offset": "0xF4", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN28", + "offset": "0xF8", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN29", + "offset": "0xFC", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN30", + "offset": "0x100", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN31", + "offset": "0x104", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN32", + "offset": "0x108", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN33", + "offset": "0x10C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN34", + "offset": "0x110", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN35", + "offset": "0x114", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN36", + "offset": "0x118", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN37", + "offset": "0x11C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN38", + "offset": "0x120", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "PIN39", + "offset": "0x124", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ], + [ + "CONFIG", + 11, + 2 + ], + [ + "INT_ENA", + 13, + 5 + ] + ] + }, + { + "name": "cali_conf", + "offset": "0x128", + "fields": [ + [ + "CALI_RTC_MAX", + 0, + 10 + ], + [ + "CALI_START", + 31, + 1 + ] + ] + }, + { + "name": "cali_data", + "offset": "0x12C", + "fields": [ + [ + "CALI_VALUE_SYNC2", + 0, + 20, + "r" + ], + [ + "CALI_RDY_REAL", + 30, + 1, + "r" + ], + [ + "CALI_RDY_SYNC2", + 31, + 1, + "r" + ] + ] + }, + { + "name": "FUNC0_IN_SEL_CFG", + "offset": "0x130", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC1_IN_SEL_CFG", + "offset": "0x134", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC2_IN_SEL_CFG", + "offset": "0x138", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC3_IN_SEL_CFG", + "offset": "0x13C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC4_IN_SEL_CFG", + "offset": "0x140", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC5_IN_SEL_CFG", + "offset": "0x144", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC6_IN_SEL_CFG", + "offset": "0x148", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC7_IN_SEL_CFG", + "offset": "0x14C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC8_IN_SEL_CFG", + "offset": "0x150", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC9_IN_SEL_CFG", + "offset": "0x154", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC10_IN_SEL_CFG", + "offset": "0x158", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC11_IN_SEL_CFG", + "offset": "0x15C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC12_IN_SEL_CFG", + "offset": "0x160", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC13_IN_SEL_CFG", + "offset": "0x164", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC14_IN_SEL_CFG", + "offset": "0x168", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC15_IN_SEL_CFG", + "offset": "0x16C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC16_IN_SEL_CFG", + "offset": "0x170", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC17_IN_SEL_CFG", + "offset": "0x174", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC18_IN_SEL_CFG", + "offset": "0x178", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC19_IN_SEL_CFG", + "offset": "0x17C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC20_IN_SEL_CFG", + "offset": "0x180", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC21_IN_SEL_CFG", + "offset": "0x184", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC22_IN_SEL_CFG", + "offset": "0x188", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC23_IN_SEL_CFG", + "offset": "0x18C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC24_IN_SEL_CFG", + "offset": "0x190", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC25_IN_SEL_CFG", + "offset": "0x194", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC26_IN_SEL_CFG", + "offset": "0x198", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC27_IN_SEL_CFG", + "offset": "0x19C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC28_IN_SEL_CFG", + "offset": "0x1A0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC29_IN_SEL_CFG", + "offset": "0x1A4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC30_IN_SEL_CFG", + "offset": "0x1A8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC31_IN_SEL_CFG", + "offset": "0x1AC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC32_IN_SEL_CFG", + "offset": "0x1B0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC33_IN_SEL_CFG", + "offset": "0x1B4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC34_IN_SEL_CFG", + "offset": "0x1B8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC35_IN_SEL_CFG", + "offset": "0x1BC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC36_IN_SEL_CFG", + "offset": "0x1C0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC37_IN_SEL_CFG", + "offset": "0x1C4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC38_IN_SEL_CFG", + "offset": "0x1C8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC39_IN_SEL_CFG", + "offset": "0x1CC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC40_IN_SEL_CFG", + "offset": "0x1D0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC41_IN_SEL_CFG", + "offset": "0x1D4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC42_IN_SEL_CFG", + "offset": "0x1D8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC43_IN_SEL_CFG", + "offset": "0x1DC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC44_IN_SEL_CFG", + "offset": "0x1E0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC45_IN_SEL_CFG", + "offset": "0x1E4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC46_IN_SEL_CFG", + "offset": "0x1E8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC47_IN_SEL_CFG", + "offset": "0x1EC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC48_IN_SEL_CFG", + "offset": "0x1F0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC49_IN_SEL_CFG", + "offset": "0x1F4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC50_IN_SEL_CFG", + "offset": "0x1F8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC51_IN_SEL_CFG", + "offset": "0x1FC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC52_IN_SEL_CFG", + "offset": "0x200", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC53_IN_SEL_CFG", + "offset": "0x204", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC54_IN_SEL_CFG", + "offset": "0x208", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC55_IN_SEL_CFG", + "offset": "0x20C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC56_IN_SEL_CFG", + "offset": "0x210", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC57_IN_SEL_CFG", + "offset": "0x214", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC58_IN_SEL_CFG", + "offset": "0x218", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC59_IN_SEL_CFG", + "offset": "0x21C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC60_IN_SEL_CFG", + "offset": "0x220", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC61_IN_SEL_CFG", + "offset": "0x224", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC62_IN_SEL_CFG", + "offset": "0x228", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC63_IN_SEL_CFG", + "offset": "0x22C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC64_IN_SEL_CFG", + "offset": "0x230", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC65_IN_SEL_CFG", + "offset": "0x234", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC66_IN_SEL_CFG", + "offset": "0x238", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC67_IN_SEL_CFG", + "offset": "0x23C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC68_IN_SEL_CFG", + "offset": "0x240", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC69_IN_SEL_CFG", + "offset": "0x244", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC70_IN_SEL_CFG", + "offset": "0x248", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC71_IN_SEL_CFG", + "offset": "0x24C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC72_IN_SEL_CFG", + "offset": "0x250", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC73_IN_SEL_CFG", + "offset": "0x254", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC74_IN_SEL_CFG", + "offset": "0x258", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC75_IN_SEL_CFG", + "offset": "0x25C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC76_IN_SEL_CFG", + "offset": "0x260", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC77_IN_SEL_CFG", + "offset": "0x264", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC78_IN_SEL_CFG", + "offset": "0x268", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC79_IN_SEL_CFG", + "offset": "0x26C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC80_IN_SEL_CFG", + "offset": "0x270", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC81_IN_SEL_CFG", + "offset": "0x274", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC82_IN_SEL_CFG", + "offset": "0x278", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC83_IN_SEL_CFG", + "offset": "0x27C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC84_IN_SEL_CFG", + "offset": "0x280", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC85_IN_SEL_CFG", + "offset": "0x284", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC86_IN_SEL_CFG", + "offset": "0x288", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC87_IN_SEL_CFG", + "offset": "0x28C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC88_IN_SEL_CFG", + "offset": "0x290", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC89_IN_SEL_CFG", + "offset": "0x294", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC90_IN_SEL_CFG", + "offset": "0x298", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC91_IN_SEL_CFG", + "offset": "0x29C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC92_IN_SEL_CFG", + "offset": "0x2A0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC93_IN_SEL_CFG", + "offset": "0x2A4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC94_IN_SEL_CFG", + "offset": "0x2A8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC95_IN_SEL_CFG", + "offset": "0x2AC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC96_IN_SEL_CFG", + "offset": "0x2B0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC97_IN_SEL_CFG", + "offset": "0x2B4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC98_IN_SEL_CFG", + "offset": "0x2B8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC99_IN_SEL_CFG", + "offset": "0x2BC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC100_IN_SEL_CFG", + "offset": "0x2C0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC101_IN_SEL_CFG", + "offset": "0x2C4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC102_IN_SEL_CFG", + "offset": "0x2C8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC103_IN_SEL_CFG", + "offset": "0x2CC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC104_IN_SEL_CFG", + "offset": "0x2D0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC105_IN_SEL_CFG", + "offset": "0x2D4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC106_IN_SEL_CFG", + "offset": "0x2D8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC107_IN_SEL_CFG", + "offset": "0x2DC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC108_IN_SEL_CFG", + "offset": "0x2E0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC109_IN_SEL_CFG", + "offset": "0x2E4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC110_IN_SEL_CFG", + "offset": "0x2E8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC111_IN_SEL_CFG", + "offset": "0x2EC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC112_IN_SEL_CFG", + "offset": "0x2F0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC113_IN_SEL_CFG", + "offset": "0x2F4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC114_IN_SEL_CFG", + "offset": "0x2F8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC115_IN_SEL_CFG", + "offset": "0x2FC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC116_IN_SEL_CFG", + "offset": "0x300", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC117_IN_SEL_CFG", + "offset": "0x304", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC118_IN_SEL_CFG", + "offset": "0x308", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC119_IN_SEL_CFG", + "offset": "0x30C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC120_IN_SEL_CFG", + "offset": "0x310", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC121_IN_SEL_CFG", + "offset": "0x314", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC122_IN_SEL_CFG", + "offset": "0x318", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC123_IN_SEL_CFG", + "offset": "0x31C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC124_IN_SEL_CFG", + "offset": "0x320", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC125_IN_SEL_CFG", + "offset": "0x324", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC126_IN_SEL_CFG", + "offset": "0x328", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC127_IN_SEL_CFG", + "offset": "0x32C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC128_IN_SEL_CFG", + "offset": "0x330", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC129_IN_SEL_CFG", + "offset": "0x334", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC130_IN_SEL_CFG", + "offset": "0x338", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC131_IN_SEL_CFG", + "offset": "0x33C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC132_IN_SEL_CFG", + "offset": "0x340", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC133_IN_SEL_CFG", + "offset": "0x344", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC134_IN_SEL_CFG", + "offset": "0x348", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC135_IN_SEL_CFG", + "offset": "0x34C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC136_IN_SEL_CFG", + "offset": "0x350", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC137_IN_SEL_CFG", + "offset": "0x354", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC138_IN_SEL_CFG", + "offset": "0x358", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC139_IN_SEL_CFG", + "offset": "0x35C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC140_IN_SEL_CFG", + "offset": "0x360", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC141_IN_SEL_CFG", + "offset": "0x364", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC142_IN_SEL_CFG", + "offset": "0x368", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC143_IN_SEL_CFG", + "offset": "0x36C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC144_IN_SEL_CFG", + "offset": "0x370", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC145_IN_SEL_CFG", + "offset": "0x374", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC146_IN_SEL_CFG", + "offset": "0x378", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC147_IN_SEL_CFG", + "offset": "0x37C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC148_IN_SEL_CFG", + "offset": "0x380", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC149_IN_SEL_CFG", + "offset": "0x384", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC150_IN_SEL_CFG", + "offset": "0x388", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC151_IN_SEL_CFG", + "offset": "0x38C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC152_IN_SEL_CFG", + "offset": "0x390", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC153_IN_SEL_CFG", + "offset": "0x394", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC154_IN_SEL_CFG", + "offset": "0x398", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC155_IN_SEL_CFG", + "offset": "0x39C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC156_IN_SEL_CFG", + "offset": "0x3A0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC157_IN_SEL_CFG", + "offset": "0x3A4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC158_IN_SEL_CFG", + "offset": "0x3A8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC159_IN_SEL_CFG", + "offset": "0x3AC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC160_IN_SEL_CFG", + "offset": "0x3B0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC161_IN_SEL_CFG", + "offset": "0x3B4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC162_IN_SEL_CFG", + "offset": "0x3B8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC163_IN_SEL_CFG", + "offset": "0x3BC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC164_IN_SEL_CFG", + "offset": "0x3C0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC165_IN_SEL_CFG", + "offset": "0x3C4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC166_IN_SEL_CFG", + "offset": "0x3C8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC167_IN_SEL_CFG", + "offset": "0x3CC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC168_IN_SEL_CFG", + "offset": "0x3D0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC169_IN_SEL_CFG", + "offset": "0x3D4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC170_IN_SEL_CFG", + "offset": "0x3D8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC171_IN_SEL_CFG", + "offset": "0x3DC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC172_IN_SEL_CFG", + "offset": "0x3E0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC173_IN_SEL_CFG", + "offset": "0x3E4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC174_IN_SEL_CFG", + "offset": "0x3E8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC175_IN_SEL_CFG", + "offset": "0x3EC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC176_IN_SEL_CFG", + "offset": "0x3F0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC177_IN_SEL_CFG", + "offset": "0x3F4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC178_IN_SEL_CFG", + "offset": "0x3F8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC179_IN_SEL_CFG", + "offset": "0x3FC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC180_IN_SEL_CFG", + "offset": "0x400", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC181_IN_SEL_CFG", + "offset": "0x404", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC182_IN_SEL_CFG", + "offset": "0x408", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC183_IN_SEL_CFG", + "offset": "0x40C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC184_IN_SEL_CFG", + "offset": "0x410", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC185_IN_SEL_CFG", + "offset": "0x414", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC186_IN_SEL_CFG", + "offset": "0x418", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC187_IN_SEL_CFG", + "offset": "0x41C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC188_IN_SEL_CFG", + "offset": "0x420", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC189_IN_SEL_CFG", + "offset": "0x424", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC190_IN_SEL_CFG", + "offset": "0x428", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC191_IN_SEL_CFG", + "offset": "0x42C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC192_IN_SEL_CFG", + "offset": "0x430", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC193_IN_SEL_CFG", + "offset": "0x434", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC194_IN_SEL_CFG", + "offset": "0x438", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC195_IN_SEL_CFG", + "offset": "0x43C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC196_IN_SEL_CFG", + "offset": "0x440", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC197_IN_SEL_CFG", + "offset": "0x444", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC198_IN_SEL_CFG", + "offset": "0x448", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC199_IN_SEL_CFG", + "offset": "0x44C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC200_IN_SEL_CFG", + "offset": "0x450", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC201_IN_SEL_CFG", + "offset": "0x454", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC202_IN_SEL_CFG", + "offset": "0x458", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC203_IN_SEL_CFG", + "offset": "0x45C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC204_IN_SEL_CFG", + "offset": "0x460", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC205_IN_SEL_CFG", + "offset": "0x464", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC206_IN_SEL_CFG", + "offset": "0x468", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC207_IN_SEL_CFG", + "offset": "0x46C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC208_IN_SEL_CFG", + "offset": "0x470", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC209_IN_SEL_CFG", + "offset": "0x474", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC210_IN_SEL_CFG", + "offset": "0x478", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC211_IN_SEL_CFG", + "offset": "0x47C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC212_IN_SEL_CFG", + "offset": "0x480", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC213_IN_SEL_CFG", + "offset": "0x484", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC214_IN_SEL_CFG", + "offset": "0x488", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC215_IN_SEL_CFG", + "offset": "0x48C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC216_IN_SEL_CFG", + "offset": "0x490", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC217_IN_SEL_CFG", + "offset": "0x494", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC218_IN_SEL_CFG", + "offset": "0x498", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC219_IN_SEL_CFG", + "offset": "0x49C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC220_IN_SEL_CFG", + "offset": "0x4A0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC221_IN_SEL_CFG", + "offset": "0x4A4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC222_IN_SEL_CFG", + "offset": "0x4A8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC223_IN_SEL_CFG", + "offset": "0x4AC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC224_IN_SEL_CFG", + "offset": "0x4B0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC225_IN_SEL_CFG", + "offset": "0x4B4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC226_IN_SEL_CFG", + "offset": "0x4B8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC227_IN_SEL_CFG", + "offset": "0x4BC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC228_IN_SEL_CFG", + "offset": "0x4C0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC229_IN_SEL_CFG", + "offset": "0x4C4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC230_IN_SEL_CFG", + "offset": "0x4C8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC231_IN_SEL_CFG", + "offset": "0x4CC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC232_IN_SEL_CFG", + "offset": "0x4D0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC233_IN_SEL_CFG", + "offset": "0x4D4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC234_IN_SEL_CFG", + "offset": "0x4D8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC235_IN_SEL_CFG", + "offset": "0x4DC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC236_IN_SEL_CFG", + "offset": "0x4E0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC237_IN_SEL_CFG", + "offset": "0x4E4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC238_IN_SEL_CFG", + "offset": "0x4E8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC239_IN_SEL_CFG", + "offset": "0x4EC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC240_IN_SEL_CFG", + "offset": "0x4F0", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC241_IN_SEL_CFG", + "offset": "0x4F4", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC242_IN_SEL_CFG", + "offset": "0x4F8", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC243_IN_SEL_CFG", + "offset": "0x4FC", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC244_IN_SEL_CFG", + "offset": "0x500", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC245_IN_SEL_CFG", + "offset": "0x504", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC246_IN_SEL_CFG", + "offset": "0x508", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC247_IN_SEL_CFG", + "offset": "0x50C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC248_IN_SEL_CFG", + "offset": "0x510", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC249_IN_SEL_CFG", + "offset": "0x514", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC250_IN_SEL_CFG", + "offset": "0x518", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC251_IN_SEL_CFG", + "offset": "0x51C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC252_IN_SEL_CFG", + "offset": "0x520", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC253_IN_SEL_CFG", + "offset": "0x524", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC254_IN_SEL_CFG", + "offset": "0x528", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC255_IN_SEL_CFG", + "offset": "0x52C", + "fields": [ + [ + "IN_SEL", + 0, + 6 + ], + [ + "IN_INV_SEL", + 6, + 1 + ], + [ + "SEL", + 7, + 1 + ] + ] + }, + { + "name": "FUNC0_OUT_SEL_CFG", + "offset": "0x530", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC1_OUT_SEL_CFG", + "offset": "0x534", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC2_OUT_SEL_CFG", + "offset": "0x538", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC3_OUT_SEL_CFG", + "offset": "0x53C", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC4_OUT_SEL_CFG", + "offset": "0x540", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC5_OUT_SEL_CFG", + "offset": "0x544", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC6_OUT_SEL_CFG", + "offset": "0x548", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC7_OUT_SEL_CFG", + "offset": "0x54C", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC8_OUT_SEL_CFG", + "offset": "0x550", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC9_OUT_SEL_CFG", + "offset": "0x554", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC10_OUT_SEL_CFG", + "offset": "0x558", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC11_OUT_SEL_CFG", + "offset": "0x55C", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC12_OUT_SEL_CFG", + "offset": "0x560", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC13_OUT_SEL_CFG", + "offset": "0x564", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC14_OUT_SEL_CFG", + "offset": "0x568", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC15_OUT_SEL_CFG", + "offset": "0x56C", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC16_OUT_SEL_CFG", + "offset": "0x570", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC17_OUT_SEL_CFG", + "offset": "0x574", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC18_OUT_SEL_CFG", + "offset": "0x578", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC19_OUT_SEL_CFG", + "offset": "0x57C", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC20_OUT_SEL_CFG", + "offset": "0x580", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC21_OUT_SEL_CFG", + "offset": "0x584", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC22_OUT_SEL_CFG", + "offset": "0x588", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC23_OUT_SEL_CFG", + "offset": "0x58C", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC24_OUT_SEL_CFG", + "offset": "0x590", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC25_OUT_SEL_CFG", + "offset": "0x594", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC26_OUT_SEL_CFG", + "offset": "0x598", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC27_OUT_SEL_CFG", + "offset": "0x59C", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC28_OUT_SEL_CFG", + "offset": "0x5A0", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC29_OUT_SEL_CFG", + "offset": "0x5A4", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC30_OUT_SEL_CFG", + "offset": "0x5A8", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC31_OUT_SEL_CFG", + "offset": "0x5AC", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC32_OUT_SEL_CFG", + "offset": "0x5B0", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC33_OUT_SEL_CFG", + "offset": "0x5B4", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC34_OUT_SEL_CFG", + "offset": "0x5B8", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC35_OUT_SEL_CFG", + "offset": "0x5BC", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC36_OUT_SEL_CFG", + "offset": "0x5C0", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC37_OUT_SEL_CFG", + "offset": "0x5C4", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC38_OUT_SEL_CFG", + "offset": "0x5C8", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + }, + { + "name": "FUNC39_OUT_SEL_CFG", + "offset": "0x5CC", + "fields": [ + [ + "OUT_SEL", + 0, + 9 + ], + [ + "INV_SEL", + 9, + 1 + ], + [ + "OEN_SEL", + 10, + 1 + ], + [ + "OEN_INV_SEL", + 11, + 1 + ] + ] + } + ] + }, + { + "name": "GPIO_SD", + "base": "0x3FF44F00", + "registers": [ + { + "name": "SIGMADELTA0", + "offset": "0x00", + "reset": "0x0000FF00", + "fields": [ + [ + "SD0_IN", + 0, + 8 + ], + [ + "SD0_PRESCALE", + 8, + 8 + ] + ] + }, + { + "name": "SIGMADELTA1", + "offset": "0x04", + "reset": "0x0000FF00", + "fields": [ + [ + "SD0_IN", + 0, + 8 + ], + [ + "SD0_PRESCALE", + 8, + 8 + ] + ] + }, + { + "name": "SIGMADELTA2", + "offset": "0x08", + "reset": "0x0000FF00", + "fields": [ + [ + "SD0_IN", + 0, + 8 + ], + [ + "SD0_PRESCALE", + 8, + 8 + ] + ] + }, + { + "name": "SIGMADELTA3", + "offset": "0x0C", + "reset": "0x0000FF00", + "fields": [ + [ + "SD0_IN", + 0, + 8 + ], + [ + "SD0_PRESCALE", + 8, + 8 + ] + ] + }, + { + "name": "SIGMADELTA4", + "offset": "0x10", + "reset": "0x0000FF00", + "fields": [ + [ + "SD0_IN", + 0, + 8 + ], + [ + "SD0_PRESCALE", + 8, + 8 + ] + ] + }, + { + "name": "SIGMADELTA5", + "offset": "0x14", + "reset": "0x0000FF00", + "fields": [ + [ + "SD0_IN", + 0, + 8 + ], + [ + "SD0_PRESCALE", + 8, + 8 + ] + ] + }, + { + "name": "SIGMADELTA6", + "offset": "0x18", + "reset": "0x0000FF00", + "fields": [ + [ + "SD0_IN", + 0, + 8 + ], + [ + "SD0_PRESCALE", + 8, + 8 + ] + ] + }, + { + "name": "SIGMADELTA7", + "offset": "0x1C", + "reset": "0x0000FF00", + "fields": [ + [ + "SD0_IN", + 0, + 8 + ], + [ + "SD0_PRESCALE", + 8, + 8 + ] + ] + }, + { + "name": "CG", + "offset": "0x20", + "fields": [ + [ + "SD_CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "MISC", + "offset": "0x24", + "fields": [ + [ + "SPI_SWAP", + 31, + 1 + ] + ] + }, + { + "name": "VERSION", + "offset": "0x28", + "reset": "0x01506190", + "fields": [ + [ + "SD_DATE", + 0, + 28 + ] + ] + } + ] + }, + { + "name": "FLASH_ENCRYPTION", + "base": "0x3FF46000", + "registers": [ + { + "name": "BUFFER_0", + "offset": "0x00", + "fields": [ + [ + "BUFFER", + 0, + 8, + "w" + ] + ] + }, + { + "name": "BUFFER_1", + "offset": "0x04", + "fields": [ + [ + "BUFFER", + 0, + 8, + "w" + ] + ] + }, + { + "name": "BUFFER_2", + "offset": "0x08", + "fields": [ + [ + "BUFFER", + 0, + 8, + "w" + ] + ] + }, + { + "name": "BUFFER_3", + "offset": "0x0C", + "fields": [ + [ + "BUFFER", + 0, + 8, + "w" + ] + ] + }, + { + "name": "BUFFER_4", + "offset": "0x10", + "fields": [ + [ + "BUFFER", + 0, + 8, + "w" + ] + ] + }, + { + "name": "BUFFER_5", + "offset": "0x14", + "fields": [ + [ + "BUFFER", + 0, + 8, + "w" + ] + ] + }, + { + "name": "BUFFER_6", + "offset": "0x18", + "fields": [ + [ + "BUFFER", + 0, + 8, + "w" + ] + ] + }, + { + "name": "BUFFER_7", + "offset": "0x1C", + "fields": [ + [ + "BUFFER", + 0, + 8, + "w" + ] + ] + }, + { + "name": "START", + "offset": "0x20", + "fields": [ + [ + "FLASH_START", + 0, + 8, + "w" + ] + ] + }, + { + "name": "ADDRESS", + "offset": "0x24", + "fields": [ + [ + "ADDRESS", + 0, + 8, + "w" + ] + ] + }, + { + "name": "DONE", + "offset": "0x28", + "fields": [ + [ + "FLASH_DONE", + 0, + 1, + "r" + ] + ] + } + ] + }, + { + "name": "FRC_TIMER", + "base": "0x3FF47000", + "registers": [ + { + "name": "TIMER_LOAD", + "offset": "0x00", + "fields": [ + [ + "VALUE", + 0, + 8 + ] + ] + }, + { + "name": "TIMER_COUNT", + "offset": "0x04", + "fields": [ + [ + "TIMER_COUNT", + 0, + 8 + ] + ] + }, + { + "name": "TIMER_CTRL", + "offset": "0x08", + "fields": [ + [ + "TIMER_PRESCALER", + 1, + 8 + ] + ] + }, + { + "name": "TIMER_INT", + "offset": "0x0C", + "fields": [ + [ + "CLR", + 0, + 1 + ] + ] + }, + { + "name": "TIMER_ALARM", + "offset": "0x10", + "fields": [ + [ + "TIMER_ALARM", + 0, + 8 + ] + ] + } + ] + }, + { + "name": "RTC_CNTL", + "base": "0x3FF48000", + "interrupts": [ + "RTC_CORE" + ], + "registers": [ + { + "name": "OPTIONS0", + "offset": "0x00", + "reset": "0x1C492000", + "fields": [ + [ + "SW_STALL_APPCPU_C0", + 0, + 2 + ], + [ + "SW_STALL_PROCPU_C0", + 2, + 2 + ], + [ + "SW_APPCPU_RST", + 4, + 1, + "w" + ], + [ + "SW_PROCPU_RST", + 5, + 1, + "w" + ], + [ + "BB_I2C_FORCE_PD", + 6, + 1 + ], + [ + "BB_I2C_FORCE_PU", + 7, + 1 + ], + [ + "BBPLL_I2C_FORCE_PD", + 8, + 1 + ], + [ + "BBPLL_I2C_FORCE_PU", + 9, + 1 + ], + [ + "BBPLL_FORCE_PD", + 10, + 1 + ], + [ + "BBPLL_FORCE_PU", + 11, + 1 + ], + [ + "XTL_FORCE_PD", + 12, + 1 + ], + [ + "XTL_FORCE_PU", + 13, + 1 + ], + [ + "BIAS_SLEEP_FOLW_8M", + 14, + 1 + ], + [ + "BIAS_FORCE_SLEEP", + 15, + 1 + ], + [ + "BIAS_FORCE_NOSLEEP", + 16, + 1 + ], + [ + "BIAS_I2C_FOLW_8M", + 17, + 1 + ], + [ + "BIAS_I2C_FORCE_PD", + 18, + 1 + ], + [ + "BIAS_I2C_FORCE_PU", + 19, + 1 + ], + [ + "BIAS_CORE_FOLW_8M", + 20, + 1 + ], + [ + "BIAS_CORE_FORCE_PD", + 21, + 1 + ], + [ + "BIAS_CORE_FORCE_PU", + 22, + 1 + ], + [ + "XTL_FORCE_ISO", + 23, + 1 + ], + [ + "PLL_FORCE_ISO", + 24, + 1 + ], + [ + "ANALOG_FORCE_ISO", + 25, + 1 + ], + [ + "XTL_FORCE_NOISO", + 26, + 1 + ], + [ + "PLL_FORCE_NOISO", + 27, + 1 + ], + [ + "ANALOG_FORCE_NOISO", + 28, + 1 + ], + [ + "DG_WRAP_FORCE_RST", + 29, + 1 + ], + [ + "DG_WRAP_FORCE_NORST", + 30, + 1 + ], + [ + "SW_SYS_RST", + 31, + 1, + "w" + ] + ] + }, + { + "name": "SLP_TIMER0", + "offset": "0x04", + "fields": [ + [ + "SLP_VAL_LO", + 0, + 32 + ] + ] + }, + { + "name": "SLP_TIMER1", + "offset": "0x08", + "fields": [ + [ + "SLP_VAL_HI", + 0, + 16 + ], + [ + "MAIN_TIMER_ALARM_EN", + 16, + 1 + ] + ] + }, + { + "name": "TIME_UPDATE", + "offset": "0x0C", + "fields": [ + [ + "TIME_VALID", + 30, + 1, + "r" + ], + [ + "TIME_UPDATE", + 31, + 1, + "w" + ] + ] + }, + { + "name": "TIME0", + "offset": "0x10", + "fields": [ + [ + "TIME_LO", + 0, + 32, + "r" + ] + ] + }, + { + "name": "TIME1", + "offset": "0x14", + "fields": [ + [ + "TIME_HI", + 0, + 16, + "r" + ] + ] + }, + { + "name": "STATE0", + "offset": "0x18", + "reset": "0x00300000", + "fields": [ + [ + "TOUCH_WAKEUP_FORCE_EN", + 20, + 1 + ], + [ + "ULP_CP_WAKEUP_FORCE_EN", + 21, + 1 + ], + [ + "APB2RTC_BRIDGE_SEL", + 22, + 1 + ], + [ + "TOUCH_SLP_TIMER_EN", + 23, + 1 + ], + [ + "ULP_CP_SLP_TIMER_EN", + 24, + 1 + ], + [ + "SDIO_ACTIVE_IND", + 28, + 1, + "r" + ], + [ + "SLP_WAKEUP", + 29, + 1 + ], + [ + "SLP_REJECT", + 30, + 1 + ], + [ + "SLEEP_EN", + 31, + 1 + ] + ] + }, + { + "name": "TIMER1", + "offset": "0x1C", + "reset": "0x28140403", + "fields": [ + [ + "CPU_STALL_EN", + 0, + 1 + ], + [ + "CPU_STALL_WAIT", + 1, + 5 + ], + [ + "CK8M_WAIT", + 6, + 8 + ], + [ + "XTL_BUF_WAIT", + 14, + 10 + ], + [ + "PLL_BUF_WAIT", + 24, + 8 + ] + ] + }, + { + "name": "TIMER2", + "offset": "0x20", + "reset": "0x01080000", + "fields": [ + [ + "ULPCP_TOUCH_START_WAIT", + 15, + 9 + ], + [ + "MIN_TIME_CK8M_OFF", + 24, + 8 + ] + ] + }, + { + "name": "TIMER3", + "offset": "0x24", + "reset": "0x14160A08", + "fields": [ + [ + "WIFI_WAIT_TIMER", + 0, + 9 + ], + [ + "WIFI_POWERUP_TIMER", + 9, + 7 + ], + [ + "ROM_RAM_WAIT_TIMER", + 16, + 9 + ], + [ + "ROM_RAM_POWERUP_TIMER", + 25, + 7 + ] + ] + }, + { + "name": "TIMER4", + "offset": "0x28", + "reset": "0x10200A08", + "fields": [ + [ + "WAIT_TIMER", + 0, + 9 + ], + [ + "POWERUP_TIMER", + 9, + 7 + ], + [ + "DG_WRAP_WAIT_TIMER", + 16, + 9 + ], + [ + "DG_WRAP_POWERUP_TIMER", + 25, + 7 + ] + ] + }, + { + "name": "TIMER5", + "offset": "0x2C", + "reset": "0x12148001", + "fields": [ + [ + "ULP_CP_SUBTIMER_PREDIV", + 0, + 8 + ], + [ + "MIN_SLP_VAL", + 8, + 8 + ], + [ + "RTCMEM_WAIT_TIMER", + 16, + 9 + ], + [ + "RTCMEM_POWERUP_TIMER", + 25, + 7 + ] + ] + }, + { + "name": "ANA_CONF", + "offset": "0x30", + "reset": "0x00800000", + "fields": [ + [ + "PLLA_FORCE_PD", + 23, + 1 + ], + [ + "PLLA_FORCE_PU", + 24, + 1 + ], + [ + "BBPLL_CAL_SLP_START", + 25, + 1 + ], + [ + "PVTMON_PU", + 26, + 1 + ], + [ + "TXRF_I2C_PU", + 27, + 1 + ], + [ + "RFRX_PBUS_PU", + 28, + 1 + ], + [ + "CKGEN_I2C_PU", + 30, + 1 + ], + [ + "PLL_I2C_PU", + 31, + 1 + ] + ] + }, + { + "name": "RESET_STATE", + "offset": "0x34", + "reset": "0x00003000", + "fields": [ + [ + "RESET_CAUSE_PROCPU", + 0, + 6, + "r" + ], + [ + "RESET_CAUSE_APPCPU", + 6, + 6, + "r" + ], + [ + "APPCPU_STAT_VECTOR_SEL", + 12, + 1 + ], + [ + "PROCPU_STAT_VECTOR_SEL", + 13, + 1 + ] + ] + }, + { + "name": "WAKEUP_STATE", + "offset": "0x38", + "reset": "0x00006000", + "fields": [ + [ + "WAKEUP_CAUSE", + 0, + 11, + "r" + ], + [ + "WAKEUP_ENA", + 11, + 11 + ], + [ + "GPIO_WAKEUP_FILTER", + 22, + 1 + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x3C", + "fields": [ + [ + "SLP_WAKEUP_INT_ENA", + 0, + 1 + ], + [ + "SLP_REJECT_INT_ENA", + 1, + 1 + ], + [ + "SDIO_IDLE_INT_ENA", + 2, + 1 + ], + [ + "WDT_INT_ENA", + 3, + 1 + ], + [ + "TIME_VALID_INT_ENA", + 4, + 1 + ], + [ + "ULP_CP_INT_ENA", + 5, + 1 + ], + [ + "TOUCH_INT_ENA", + 6, + 1 + ], + [ + "BROWN_OUT_INT_ENA", + 7, + 1 + ], + [ + "MAIN_TIMER_INT_ENA", + 8, + 1 + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x40", + "fields": [ + [ + "SLP_WAKEUP_INT_RAW", + 0, + 1, + "r" + ], + [ + "SLP_REJECT_INT_RAW", + 1, + 1, + "r" + ], + [ + "SDIO_IDLE_INT_RAW", + 2, + 1, + "r" + ], + [ + "WDT_INT_RAW", + 3, + 1, + "r" + ], + [ + "TIME_VALID_INT_RAW", + 4, + 1, + "r" + ], + [ + "ULP_CP_INT_RAW", + 5, + 1, + "r" + ], + [ + "TOUCH_INT_RAW", + 6, + 1, + "r" + ], + [ + "BROWN_OUT_INT_RAW", + 7, + 1, + "r" + ], + [ + "MAIN_TIMER_INT_RAW", + 8, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0x44", + "fields": [ + [ + "SLP_WAKEUP_INT_ST", + 0, + 1, + "r" + ], + [ + "SLP_REJECT_INT_ST", + 1, + 1, + "r" + ], + [ + "SDIO_IDLE_INT_ST", + 2, + 1, + "r" + ], + [ + "WDT_INT_ST", + 3, + 1, + "r" + ], + [ + "TIME_VALID_INT_ST", + 4, + 1, + "r" + ], + [ + "SAR_INT_ST", + 5, + 1, + "r" + ], + [ + "TOUCH_INT_ST", + 6, + 1, + "r" + ], + [ + "BROWN_OUT_INT_ST", + 7, + 1, + "r" + ], + [ + "MAIN_TIMER_INT_ST", + 8, + 1, + "r" + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x48", + "fields": [ + [ + "SLP_WAKEUP_INT_CLR", + 0, + 1, + "w" + ], + [ + "SLP_REJECT_INT_CLR", + 1, + 1, + "w" + ], + [ + "SDIO_IDLE_INT_CLR", + 2, + 1, + "w" + ], + [ + "WDT_INT_CLR", + 3, + 1, + "w" + ], + [ + "TIME_VALID_INT_CLR", + 4, + 1, + "w" + ], + [ + "SAR_INT_CLR", + 5, + 1, + "w" + ], + [ + "TOUCH_INT_CLR", + 6, + 1, + "w" + ], + [ + "BROWN_OUT_INT_CLR", + 7, + 1, + "w" + ], + [ + "MAIN_TIMER_INT_CLR", + 8, + 1, + "w" + ] + ] + }, + { + "name": "STORE0", + "offset": "0x4C", + "fields": [ + [ + "SCRATCH0", + 0, + 32 + ] + ] + }, + { + "name": "STORE1", + "offset": "0x50", + "fields": [ + [ + "SCRATCH1", + 0, + 32 + ] + ] + }, + { + "name": "STORE2", + "offset": "0x54", + "fields": [ + [ + "SCRATCH2", + 0, + 32 + ] + ] + }, + { + "name": "STORE3", + "offset": "0x58", + "fields": [ + [ + "SCRATCH3", + 0, + 32 + ] + ] + }, + { + "name": "EXT_XTL_CONF", + "offset": "0x5C", + "fields": [ + [ + "XTL_EXT_CTR_LV", + 30, + 1 + ], + [ + "XTL_EXT_CTR_EN", + 31, + 1 + ] + ] + }, + { + "name": "EXT_WAKEUP_CONF", + "offset": "0x60", + "fields": [ + [ + "EXT_WAKEUP0_LV", + 30, + 1 + ], + [ + "EXT_WAKEUP1_LV", + 31, + 1 + ] + ] + }, + { + "name": "SLP_REJECT_CONF", + "offset": "0x64", + "fields": [ + [ + "GPIO_REJECT_EN", + 24, + 1 + ], + [ + "SDIO_REJECT_EN", + 25, + 1 + ], + [ + "LIGHT_SLP_REJECT_EN", + 26, + 1 + ], + [ + "DEEP_SLP_REJECT_EN", + 27, + 1 + ], + [ + "REJECT_CAUSE", + 28, + 4, + "r" + ] + ] + }, + { + "name": "CPU_PERIOD_CONF", + "offset": "0x68", + "fields": [ + [ + "CPUSEL_CONF", + 29, + 1 + ], + [ + "CPUPERIOD_SEL", + 30, + 2 + ] + ] + }, + { + "name": "SDIO_ACT_CONF", + "offset": "0x6C", + "fields": [ + [ + "SDIO_ACT_DNUM", + 22, + 10 + ] + ] + }, + { + "name": "CLK_CONF", + "offset": "0x70", + "reset": "0x00002210", + "fields": [ + [ + "CK8M_DIV", + 4, + 2 + ], + [ + "ENB_CK8M", + 6, + 1 + ], + [ + "ENB_CK8M_DIV", + 7, + 1 + ], + [ + "DIG_XTAL32K_EN", + 8, + 1 + ], + [ + "DIG_CLK8M_D256_EN", + 9, + 1 + ], + [ + "DIG_CLK8M_EN", + 10, + 1 + ], + [ + "CK8M_DFREQ_FORCE", + 11, + 1 + ], + [ + "CK8M_DIV_SEL", + 12, + 3 + ], + [ + "XTAL_FORCE_NOGATING", + 15, + 1 + ], + [ + "CK8M_FORCE_NOGATING", + 16, + 1 + ], + [ + "CK8M_DFREQ", + 17, + 8 + ], + [ + "CK8M_FORCE_PD", + 25, + 1 + ], + [ + "CK8M_FORCE_PU", + 26, + 1 + ], + [ + "SOC_CLK_SEL", + 27, + 2 + ], + [ + "FAST_CLK_RTC_SEL", + 29, + 1 + ], + [ + "ANA_CLK_RTC_SEL", + 30, + 2 + ] + ] + }, + { + "name": "SDIO_CONF", + "offset": "0x74", + "reset": "0x02A00000", + "fields": [ + [ + "SDIO_PD_EN", + 21, + 1 + ], + [ + "SDIO_FORCE", + 22, + 1 + ], + [ + "SDIO_TIEH", + 23, + 1 + ], + [ + "REG1P8_READY", + 24, + 1, + "r" + ], + [ + "DREFL_SDIO", + 25, + 2 + ], + [ + "DREFM_SDIO", + 27, + 2 + ], + [ + "DREFH_SDIO", + 29, + 2 + ], + [ + "XPD_SDIO", + 31, + 1 + ] + ] + }, + { + "name": "BIAS_CONF", + "offset": "0x78", + "fields": [ + [ + "DBG_ATTEN", + 24, + 2 + ], + [ + "ENB_SCK_XTAL", + 26, + 1 + ], + [ + "INC_HEARTBEAT_REFRESH", + 27, + 1 + ], + [ + "DEC_HEARTBEAT_PERIOD", + 28, + 1 + ], + [ + "INC_HEARTBEAT_PERIOD", + 29, + 1 + ], + [ + "DEC_HEARTBEAT_WIDTH", + 30, + 1 + ], + [ + "RST_BIAS_I2C", + 31, + 1 + ] + ] + }, + { + "name": "REG", + "offset": "0x7C", + "reset": "0x29002400", + "fields": [ + [ + "SCK_DCAP_FORCE", + 7, + 1 + ], + [ + "DIG_DBIAS_SLP", + 8, + 3 + ], + [ + "DIG_DBIAS_WAK", + 11, + 3 + ], + [ + "SCK_DCAP", + 14, + 8 + ], + [ + "DBIAS_SLP", + 22, + 3 + ], + [ + "DBIAS_WAK", + 25, + 3 + ], + [ + "DBOOST_FORCE_PD", + 28, + 1 + ], + [ + "DBOOST_FORCE_PU", + 29, + 1 + ], + [ + "FORCE_PD", + 30, + 1 + ], + [ + "FORCE_PU", + 31, + 1 + ] + ] + }, + { + "name": "PWC", + "offset": "0x80", + "reset": "0x00012925", + "fields": [ + [ + "FASTMEM_FORCE_NOISO", + 0, + 1 + ], + [ + "FASTMEM_FORCE_ISO", + 1, + 1 + ], + [ + "SLOWMEM_FORCE_NOISO", + 2, + 1 + ], + [ + "SLOWMEM_FORCE_ISO", + 3, + 1 + ], + [ + "FORCE_ISO", + 4, + 1 + ], + [ + "FORCE_NOISO", + 5, + 1 + ], + [ + "FASTMEM_FOLW_CPU", + 6, + 1 + ], + [ + "FASTMEM_FORCE_LPD", + 7, + 1 + ], + [ + "FASTMEM_FORCE_LPU", + 8, + 1 + ], + [ + "SLOWMEM_FOLW_CPU", + 9, + 1 + ], + [ + "SLOWMEM_FORCE_LPD", + 10, + 1 + ], + [ + "SLOWMEM_FORCE_LPU", + 11, + 1 + ], + [ + "FASTMEM_FORCE_PD", + 12, + 1 + ], + [ + "FASTMEM_FORCE_PU", + 13, + 1 + ], + [ + "FASTMEM_PD_EN", + 14, + 1 + ], + [ + "SLOWMEM_FORCE_PD", + 15, + 1 + ], + [ + "SLOWMEM_FORCE_PU", + 16, + 1 + ], + [ + "SLOWMEM_PD_EN", + 17, + 1 + ], + [ + "FORCE_PD", + 18, + 1 + ], + [ + "FORCE_PU", + 19, + 1 + ], + [ + "PD_EN", + 20, + 1 + ] + ] + }, + { + "name": "DIG_PWC", + "offset": "0x84", + "reset": "0x00155550", + "fields": [ + [ + "LSLP_MEM_FORCE_PD", + 3, + 1 + ], + [ + "LSLP_MEM_FORCE_PU", + 4, + 1 + ], + [ + "ROM0_FORCE_PD", + 5, + 1 + ], + [ + "ROM0_FORCE_PU", + 6, + 1 + ], + [ + "INTER_RAM0_FORCE_PD", + 7, + 1 + ], + [ + "INTER_RAM0_FORCE_PU", + 8, + 1 + ], + [ + "INTER_RAM1_FORCE_PD", + 9, + 1 + ], + [ + "INTER_RAM1_FORCE_PU", + 10, + 1 + ], + [ + "INTER_RAM2_FORCE_PD", + 11, + 1 + ], + [ + "INTER_RAM2_FORCE_PU", + 12, + 1 + ], + [ + "INTER_RAM3_FORCE_PD", + 13, + 1 + ], + [ + "INTER_RAM3_FORCE_PU", + 14, + 1 + ], + [ + "INTER_RAM4_FORCE_PD", + 15, + 1 + ], + [ + "INTER_RAM4_FORCE_PU", + 16, + 1 + ], + [ + "WIFI_FORCE_PD", + 17, + 1 + ], + [ + "WIFI_FORCE_PU", + 18, + 1 + ], + [ + "DG_WRAP_FORCE_PD", + 19, + 1 + ], + [ + "DG_WRAP_FORCE_PU", + 20, + 1 + ], + [ + "ROM0_PD_EN", + 24, + 1 + ], + [ + "INTER_RAM0_PD_EN", + 25, + 1 + ], + [ + "INTER_RAM1_PD_EN", + 26, + 1 + ], + [ + "INTER_RAM2_PD_EN", + 27, + 1 + ], + [ + "INTER_RAM3_PD_EN", + 28, + 1 + ], + [ + "INTER_RAM4_PD_EN", + 29, + 1 + ], + [ + "WIFI_PD_EN", + 30, + 1 + ], + [ + "DG_WRAP_PD_EN", + 31, + 1 + ] + ] + }, + { + "name": "DIG_ISO", + "offset": "0x88", + "reset": "0xAAAA5000", + "fields": [ + [ + "FORCE_OFF", + 7, + 1 + ], + [ + "FORCE_ON", + 8, + 1 + ], + [ + "DG_PAD_AUTOHOLD", + 9, + 1, + "r" + ], + [ + "CLR_DG_PAD_AUTOHOLD", + 10, + 1, + "w" + ], + [ + "DG_PAD_AUTOHOLD_EN", + 11, + 1 + ], + [ + "DG_PAD_FORCE_NOISO", + 12, + 1 + ], + [ + "DG_PAD_FORCE_ISO", + 13, + 1 + ], + [ + "DG_PAD_FORCE_UNHOLD", + 14, + 1 + ], + [ + "DG_PAD_FORCE_HOLD", + 15, + 1 + ], + [ + "ROM0_FORCE_ISO", + 16, + 1 + ], + [ + "ROM0_FORCE_NOISO", + 17, + 1 + ], + [ + "INTER_RAM0_FORCE_ISO", + 18, + 1 + ], + [ + "INTER_RAM0_FORCE_NOISO", + 19, + 1 + ], + [ + "INTER_RAM1_FORCE_ISO", + 20, + 1 + ], + [ + "INTER_RAM1_FORCE_NOISO", + 21, + 1 + ], + [ + "INTER_RAM2_FORCE_ISO", + 22, + 1 + ], + [ + "INTER_RAM2_FORCE_NOISO", + 23, + 1 + ], + [ + "INTER_RAM3_FORCE_ISO", + 24, + 1 + ], + [ + "INTER_RAM3_FORCE_NOISO", + 25, + 1 + ], + [ + "INTER_RAM4_FORCE_ISO", + 26, + 1 + ], + [ + "INTER_RAM4_FORCE_NOISO", + 27, + 1 + ], + [ + "WIFI_FORCE_ISO", + 28, + 1 + ], + [ + "WIFI_FORCE_NOISO", + 29, + 1 + ], + [ + "DG_WRAP_FORCE_ISO", + 30, + 1 + ], + [ + "DG_WRAP_FORCE_NOISO", + 31, + 1 + ] + ] + }, + { + "name": "WDTCONFIG0", + "offset": "0x8C", + "reset": "0x00004C80", + "fields": [ + [ + "WDT_PAUSE_IN_SLP", + 7, + 1 + ], + [ + "WDT_APPCPU_RESET_EN", + 8, + 1 + ], + [ + "WDT_PROCPU_RESET_EN", + 9, + 1 + ], + [ + "WDT_FLASHBOOT_MOD_EN", + 10, + 1 + ], + [ + "WDT_SYS_RESET_LENGTH", + 11, + 3 + ], + [ + "WDT_CPU_RESET_LENGTH", + 14, + 3 + ], + [ + "WDT_LEVEL_INT_EN", + 17, + 1 + ], + [ + "WDT_EDGE_INT_EN", + 18, + 1 + ], + [ + "WDT_STG3", + 19, + 3 + ], + [ + "WDT_STG2", + 22, + 3 + ], + [ + "WDT_STG1", + 25, + 3 + ], + [ + "WDT_STG0", + 28, + 3 + ], + [ + "WDT_EN", + 31, + 1 + ] + ] + }, + { + "name": "WDTCONFIG1", + "offset": "0x90", + "reset": "0x0001F400", + "fields": [ + [ + "WDT_STG0_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "WDTCONFIG2", + "offset": "0x94", + "reset": "0x00013880", + "fields": [ + [ + "WDT_STG1_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "WDTCONFIG3", + "offset": "0x98", + "reset": "0x00000FFF", + "fields": [ + [ + "WDT_STG2_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "WDTCONFIG4", + "offset": "0x9C", + "reset": "0x00000FFF", + "fields": [ + [ + "WDT_STG3_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "WDTFEED", + "offset": "0xA0", + "fields": [ + [ + "WDT_FEED", + 31, + 1, + "w" + ] + ] + }, + { + "name": "WDTWPROTECT", + "offset": "0xA4", + "reset": "0x50D83AA1", + "fields": [ + [ + "WDT_WKEY", + 0, + 32 + ] + ] + }, + { + "name": "TEST_MUX", + "offset": "0xA8", + "fields": [ + [ + "ENT_RTC", + 29, + 1 + ], + [ + "DTEST_RTC", + 30, + 2 + ] + ] + }, + { + "name": "SW_CPU_STALL", + "offset": "0xAC", + "fields": [ + [ + "SW_STALL_APPCPU_C1", + 20, + 6 + ], + [ + "SW_STALL_PROCPU_C1", + 26, + 6 + ] + ] + }, + { + "name": "STORE4", + "offset": "0xB0", + "fields": [ + [ + "SCRATCH4", + 0, + 32 + ] + ] + }, + { + "name": "STORE5", + "offset": "0xB4", + "fields": [ + [ + "SCRATCH5", + 0, + 32 + ] + ] + }, + { + "name": "STORE6", + "offset": "0xB8", + "fields": [ + [ + "SCRATCH6", + 0, + 32 + ] + ] + }, + { + "name": "STORE7", + "offset": "0xBC", + "fields": [ + [ + "SCRATCH7", + 0, + 32 + ] + ] + }, + { + "name": "LOW_POWER_ST", + "offset": "0xC0", + "fields": [ + [ + "RDY_FOR_WAKEUP", + 19, + 1, + "r" + ] + ] + }, + { + "name": "DIAG1", + "offset": "0xC4", + "fields": [ + [ + "LOW_POWER_DIAG1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HOLD_FORCE", + "offset": "0xC8", + "fields": [ + [ + "ADC1_HOLD_FORCE", + 0, + 1 + ], + [ + "ADC2_HOLD_FORCE", + 1, + 1 + ], + [ + "PDAC1_HOLD_FORCE", + 2, + 1 + ], + [ + "PDAC2_HOLD_FORCE", + 3, + 1 + ], + [ + "SENSE1_HOLD_FORCE", + 4, + 1 + ], + [ + "SENSE2_HOLD_FORCE", + 5, + 1 + ], + [ + "SENSE3_HOLD_FORCE", + 6, + 1 + ], + [ + "SENSE4_HOLD_FORCE", + 7, + 1 + ], + [ + "TOUCH_PAD0_HOLD_FORCE", + 8, + 1 + ], + [ + "TOUCH_PAD1_HOLD_FORCE", + 9, + 1 + ], + [ + "TOUCH_PAD2_HOLD_FORCE", + 10, + 1 + ], + [ + "TOUCH_PAD3_HOLD_FORCE", + 11, + 1 + ], + [ + "TOUCH_PAD4_HOLD_FORCE", + 12, + 1 + ], + [ + "TOUCH_PAD5_HOLD_FORCE", + 13, + 1 + ], + [ + "TOUCH_PAD6_HOLD_FORCE", + 14, + 1 + ], + [ + "TOUCH_PAD7_HOLD_FORCE", + 15, + 1 + ], + [ + "X32P_HOLD_FORCE", + 16, + 1 + ], + [ + "X32N_HOLD_FORCE", + 17, + 1 + ] + ] + }, + { + "name": "EXT_WAKEUP1", + "offset": "0xCC", + "fields": [ + [ + "SEL", + 0, + 18 + ], + [ + "STATUS_CLR", + 18, + 1, + "w" + ] + ] + }, + { + "name": "EXT_WAKEUP1_STATUS", + "offset": "0xD0", + "fields": [ + [ + "EXT_WAKEUP1_STATUS", + 0, + 18, + "r" + ] + ] + }, + { + "name": "BROWN_OUT", + "offset": "0xD4", + "reset": "0x13FF0000", + "fields": [ + [ + "RTC_MEM_PID_CONF", + 0, + 8 + ], + [ + "RTC_MEM_CRC_START", + 8, + 1 + ], + [ + "CLOSE_FLASH_ENA", + 14, + 1 + ], + [ + "PD_RF_ENA", + 15, + 1 + ], + [ + "RST_WAIT", + 16, + 10 + ], + [ + "RST_ENA", + 26, + 1 + ], + [ + "DBROWN_OUT_THRES", + 27, + 3 + ], + [ + "ENA", + 30, + 1 + ], + [ + "DET", + 31, + 1, + "r" + ] + ] + }, + { + "name": "DATE", + "offset": "0x13C", + "reset": "0x01604280", + "fields": [ + [ + "CNTL_DATE", + 0, + 28 + ] + ] + } + ] + }, + { + "name": "RTC_IO", + "base": "0x3FF48400", + "registers": [ + { + "name": "OUT", + "offset": "0x00", + "fields": [ + [ + "DATA", + 14, + 18 + ] + ] + }, + { + "name": "OUT_W1TS", + "offset": "0x04", + "fields": [ + [ + "OUT_DATA_W1TS", + 14, + 18, + "w" + ] + ] + }, + { + "name": "OUT_W1TC", + "offset": "0x08", + "fields": [ + [ + "OUT_DATA_W1TC", + 14, + 18, + "w" + ] + ] + }, + { + "name": "ENABLE", + "offset": "0x0C", + "fields": [ + [ + "ENABLE", + 14, + 18 + ] + ] + }, + { + "name": "ENABLE_W1TS", + "offset": "0x10", + "fields": [ + [ + "ENABLE_W1TS", + 14, + 18, + "w" + ] + ] + }, + { + "name": "ENABLE_W1TC", + "offset": "0x14", + "fields": [ + [ + "ENABLE_W1TC", + 14, + 18, + "w" + ] + ] + }, + { + "name": "STATUS", + "offset": "0x18", + "fields": [ + [ + "INT", + 14, + 18 + ] + ] + }, + { + "name": "STATUS_W1TS", + "offset": "0x1C", + "fields": [ + [ + "STATUS_INT_W1TS", + 14, + 18, + "w" + ] + ] + }, + { + "name": "STATUS_W1TC", + "offset": "0x20", + "fields": [ + [ + "STATUS_INT_W1TC", + 14, + 18, + "w" + ] + ] + }, + { + "name": "IN", + "offset": "0x24", + "fields": [ + [ + "NEXT", + 14, + 18, + "r" + ] + ] + }, + { + "name": "PIN0", + "offset": "0x28", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN1", + "offset": "0x2C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN2", + "offset": "0x30", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN3", + "offset": "0x34", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN4", + "offset": "0x38", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN5", + "offset": "0x3C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN6", + "offset": "0x40", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN7", + "offset": "0x44", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN8", + "offset": "0x48", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN9", + "offset": "0x4C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN10", + "offset": "0x50", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN11", + "offset": "0x54", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN12", + "offset": "0x58", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN13", + "offset": "0x5C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN14", + "offset": "0x60", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN15", + "offset": "0x64", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN16", + "offset": "0x68", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "PIN17", + "offset": "0x6C", + "fields": [ + [ + "PAD_DRIVER", + 2, + 1 + ], + [ + "INT_TYPE", + 7, + 3 + ], + [ + "WAKEUP_ENABLE", + 10, + 1 + ] + ] + }, + { + "name": "RTC_DEBUG_SEL", + "offset": "0x70", + "fields": [ + [ + "DEBUG_SEL0", + 0, + 5 + ], + [ + "DEBUG_SEL1", + 5, + 5 + ], + [ + "DEBUG_SEL2", + 10, + 5 + ], + [ + "DEBUG_SEL3", + 15, + 5 + ], + [ + "DEBUG_SEL4", + 20, + 5 + ], + [ + "DEBUG_12M_NO_GATING", + 25, + 1 + ] + ] + }, + { + "name": "DIG_PAD_HOLD", + "offset": "0x74", + "fields": [ + [ + "DIG_PAD_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "HALL_SENS", + "offset": "0x78", + "fields": [ + [ + "HALL_PHASE", + 30, + 1 + ], + [ + "XPD_HALL", + 31, + 1 + ] + ] + }, + { + "name": "SENSOR_PADS", + "offset": "0x7C", + "fields": [ + [ + "SENSE4_FUN_IE", + 4, + 1 + ], + [ + "SENSE4_SLP_IE", + 5, + 1 + ], + [ + "SENSE4_SLP_SEL", + 6, + 1 + ], + [ + "SENSE4_FUN_SEL", + 7, + 2 + ], + [ + "SENSE3_FUN_IE", + 9, + 1 + ], + [ + "SENSE3_SLP_IE", + 10, + 1 + ], + [ + "SENSE3_SLP_SEL", + 11, + 1 + ], + [ + "SENSE3_FUN_SEL", + 12, + 2 + ], + [ + "SENSE2_FUN_IE", + 14, + 1 + ], + [ + "SENSE2_SLP_IE", + 15, + 1 + ], + [ + "SENSE2_SLP_SEL", + 16, + 1 + ], + [ + "SENSE2_FUN_SEL", + 17, + 2 + ], + [ + "SENSE1_FUN_IE", + 19, + 1 + ], + [ + "SENSE1_SLP_IE", + 20, + 1 + ], + [ + "SENSE1_SLP_SEL", + 21, + 1 + ], + [ + "SENSE1_FUN_SEL", + 22, + 2 + ], + [ + "SENSE4_MUX_SEL", + 24, + 1 + ], + [ + "SENSE3_MUX_SEL", + 25, + 1 + ], + [ + "SENSE2_MUX_SEL", + 26, + 1 + ], + [ + "SENSE1_MUX_SEL", + 27, + 1 + ], + [ + "SENSE4_HOLD", + 28, + 1 + ], + [ + "SENSE3_HOLD", + 29, + 1 + ], + [ + "SENSE2_HOLD", + 30, + 1 + ], + [ + "SENSE1_HOLD", + 31, + 1 + ] + ] + }, + { + "name": "ADC_PAD", + "offset": "0x80", + "fields": [ + [ + "ADC2_FUN_IE", + 18, + 1 + ], + [ + "ADC2_SLP_IE", + 19, + 1 + ], + [ + "ADC2_SLP_SEL", + 20, + 1 + ], + [ + "ADC2_FUN_SEL", + 21, + 2 + ], + [ + "ADC1_FUN_IE", + 23, + 1 + ], + [ + "ADC1_SLP_IE", + 24, + 1 + ], + [ + "ADC1_SLP_SEL", + 25, + 1 + ], + [ + "ADC1_FUN_SEL", + 26, + 2 + ], + [ + "ADC2_MUX_SEL", + 28, + 1 + ], + [ + "ADC1_MUX_SEL", + 29, + 1 + ], + [ + "ADC2_HOLD", + 30, + 1 + ], + [ + "ADC1_HOLD", + 31, + 1 + ] + ] + }, + { + "name": "PAD_DAC1", + "offset": "0x84", + "reset": "0x80000000", + "fields": [ + [ + "PDAC1_DAC_XPD_FORCE", + 10, + 1 + ], + [ + "PDAC1_FUN_IE", + 11, + 1 + ], + [ + "PDAC1_SLP_OE", + 12, + 1 + ], + [ + "PDAC1_SLP_IE", + 13, + 1 + ], + [ + "PDAC1_SLP_SEL", + 14, + 1 + ], + [ + "PDAC1_FUN_SEL", + 15, + 2 + ], + [ + "PDAC1_MUX_SEL", + 17, + 1 + ], + [ + "PDAC1_XPD_DAC", + 18, + 1 + ], + [ + "PDAC1_DAC", + 19, + 8 + ], + [ + "PDAC1_RUE", + 27, + 1 + ], + [ + "PDAC1_RDE", + 28, + 1 + ], + [ + "PDAC1_HOLD", + 29, + 1 + ], + [ + "PDAC1_DRV", + 30, + 2 + ] + ] + }, + { + "name": "PAD_DAC2", + "offset": "0x88", + "reset": "0x80000000", + "fields": [ + [ + "PDAC2_DAC_XPD_FORCE", + 10, + 1 + ], + [ + "PDAC2_FUN_IE", + 11, + 1 + ], + [ + "PDAC2_SLP_OE", + 12, + 1 + ], + [ + "PDAC2_SLP_IE", + 13, + 1 + ], + [ + "PDAC2_SLP_SEL", + 14, + 1 + ], + [ + "PDAC2_FUN_SEL", + 15, + 2 + ], + [ + "PDAC2_MUX_SEL", + 17, + 1 + ], + [ + "PDAC2_XPD_DAC", + 18, + 1 + ], + [ + "PDAC2_DAC", + 19, + 8 + ], + [ + "PDAC2_RUE", + 27, + 1 + ], + [ + "PDAC2_RDE", + 28, + 1 + ], + [ + "PDAC2_HOLD", + 29, + 1 + ], + [ + "PDAC2_DRV", + 30, + 2 + ] + ] + }, + { + "name": "XTAL_32K_PAD", + "offset": "0x8C", + "reset": "0x84100010", + "fields": [ + [ + "DBIAS_XTAL_32K", + 1, + 2 + ], + [ + "DRES_XTAL_32K", + 3, + 2 + ], + [ + "X32P_FUN_IE", + 5, + 1 + ], + [ + "X32P_SLP_OE", + 6, + 1 + ], + [ + "X32P_SLP_IE", + 7, + 1 + ], + [ + "X32P_SLP_SEL", + 8, + 1 + ], + [ + "X32P_FUN_SEL", + 9, + 2 + ], + [ + "X32N_FUN_IE", + 11, + 1 + ], + [ + "X32N_SLP_OE", + 12, + 1 + ], + [ + "X32N_SLP_IE", + 13, + 1 + ], + [ + "X32N_SLP_SEL", + 14, + 1 + ], + [ + "X32N_FUN_SEL", + 15, + 2 + ], + [ + "X32P_MUX_SEL", + 17, + 1 + ], + [ + "X32N_MUX_SEL", + 18, + 1 + ], + [ + "XPD_XTAL_32K", + 19, + 1 + ], + [ + "DAC_XTAL_32K", + 20, + 2 + ], + [ + "X32P_RUE", + 22, + 1 + ], + [ + "X32P_RDE", + 23, + 1 + ], + [ + "X32P_HOLD", + 24, + 1 + ], + [ + "X32P_DRV", + 25, + 2 + ], + [ + "X32N_RUE", + 27, + 1 + ], + [ + "X32N_RDE", + 28, + 1 + ], + [ + "X32N_HOLD", + 29, + 1 + ], + [ + "X32N_DRV", + 30, + 2 + ] + ] + }, + { + "name": "TOUCH_CFG", + "offset": "0x90", + "reset": "0x66000000", + "fields": [ + [ + "TOUCH_DCUR", + 23, + 2 + ], + [ + "TOUCH_DRANGE", + 25, + 2 + ], + [ + "TOUCH_DREFL", + 27, + 2 + ], + [ + "TOUCH_DREFH", + 29, + 2 + ], + [ + "TOUCH_XPD_BIAS", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD0", + "offset": "0x94", + "reset": "0x52000000", + "fields": [ + [ + "TO_GPIO", + 12, + 1 + ], + [ + "FUN_IE", + 13, + 1 + ], + [ + "SLP_OE", + 14, + 1 + ], + [ + "SLP_IE", + 15, + 1 + ], + [ + "SLP_SEL", + 16, + 1 + ], + [ + "FUN_SEL", + 17, + 2 + ], + [ + "MUX_SEL", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ], + [ + "RUE", + 27, + 1 + ], + [ + "RDE", + 28, + 1 + ], + [ + "DRV", + 29, + 2 + ], + [ + "HOLD", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD1", + "offset": "0x98", + "reset": "0x4A000000", + "fields": [ + [ + "TO_GPIO", + 12, + 1 + ], + [ + "FUN_IE", + 13, + 1 + ], + [ + "SLP_OE", + 14, + 1 + ], + [ + "SLP_IE", + 15, + 1 + ], + [ + "SLP_SEL", + 16, + 1 + ], + [ + "FUN_SEL", + 17, + 2 + ], + [ + "MUX_SEL", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ], + [ + "RUE", + 27, + 1 + ], + [ + "RDE", + 28, + 1 + ], + [ + "DRV", + 29, + 2 + ], + [ + "HOLD", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD2", + "offset": "0x9C", + "reset": "0x52000000", + "fields": [ + [ + "TO_GPIO", + 12, + 1 + ], + [ + "FUN_IE", + 13, + 1 + ], + [ + "SLP_OE", + 14, + 1 + ], + [ + "SLP_IE", + 15, + 1 + ], + [ + "SLP_SEL", + 16, + 1 + ], + [ + "FUN_SEL", + 17, + 2 + ], + [ + "MUX_SEL", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ], + [ + "RUE", + 27, + 1 + ], + [ + "RDE", + 28, + 1 + ], + [ + "DRV", + 29, + 2 + ], + [ + "HOLD", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD3", + "offset": "0xA0", + "reset": "0x4A000000", + "fields": [ + [ + "TO_GPIO", + 12, + 1 + ], + [ + "FUN_IE", + 13, + 1 + ], + [ + "SLP_OE", + 14, + 1 + ], + [ + "SLP_IE", + 15, + 1 + ], + [ + "SLP_SEL", + 16, + 1 + ], + [ + "FUN_SEL", + 17, + 2 + ], + [ + "MUX_SEL", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ], + [ + "RUE", + 27, + 1 + ], + [ + "RDE", + 28, + 1 + ], + [ + "DRV", + 29, + 2 + ], + [ + "HOLD", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD4", + "offset": "0xA4", + "reset": "0x52000000", + "fields": [ + [ + "TO_GPIO", + 12, + 1 + ], + [ + "FUN_IE", + 13, + 1 + ], + [ + "SLP_OE", + 14, + 1 + ], + [ + "SLP_IE", + 15, + 1 + ], + [ + "SLP_SEL", + 16, + 1 + ], + [ + "FUN_SEL", + 17, + 2 + ], + [ + "MUX_SEL", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ], + [ + "RUE", + 27, + 1 + ], + [ + "RDE", + 28, + 1 + ], + [ + "DRV", + 29, + 2 + ], + [ + "HOLD", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD5", + "offset": "0xA8", + "reset": "0x52000000", + "fields": [ + [ + "TO_GPIO", + 12, + 1 + ], + [ + "FUN_IE", + 13, + 1 + ], + [ + "SLP_OE", + 14, + 1 + ], + [ + "SLP_IE", + 15, + 1 + ], + [ + "SLP_SEL", + 16, + 1 + ], + [ + "FUN_SEL", + 17, + 2 + ], + [ + "MUX_SEL", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ], + [ + "RUE", + 27, + 1 + ], + [ + "RDE", + 28, + 1 + ], + [ + "DRV", + 29, + 2 + ], + [ + "HOLD", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD6", + "offset": "0xAC", + "reset": "0x4A000000", + "fields": [ + [ + "TO_GPIO", + 12, + 1 + ], + [ + "FUN_IE", + 13, + 1 + ], + [ + "SLP_OE", + 14, + 1 + ], + [ + "SLP_IE", + 15, + 1 + ], + [ + "SLP_SEL", + 16, + 1 + ], + [ + "FUN_SEL", + 17, + 2 + ], + [ + "MUX_SEL", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ], + [ + "RUE", + 27, + 1 + ], + [ + "RDE", + 28, + 1 + ], + [ + "DRV", + 29, + 2 + ], + [ + "HOLD", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD7", + "offset": "0xB0", + "reset": "0x42000000", + "fields": [ + [ + "TO_GPIO", + 12, + 1 + ], + [ + "FUN_IE", + 13, + 1 + ], + [ + "SLP_OE", + 14, + 1 + ], + [ + "SLP_IE", + 15, + 1 + ], + [ + "SLP_SEL", + 16, + 1 + ], + [ + "FUN_SEL", + 17, + 2 + ], + [ + "MUX_SEL", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ], + [ + "RUE", + 27, + 1 + ], + [ + "RDE", + 28, + 1 + ], + [ + "DRV", + 29, + 2 + ], + [ + "HOLD", + 31, + 1 + ] + ] + }, + { + "name": "TOUCH_PAD8", + "offset": "0xB4", + "reset": "0x02000000", + "fields": [ + [ + "TO_GPIO", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ] + ] + }, + { + "name": "TOUCH_PAD9", + "offset": "0xB8", + "reset": "0x02000000", + "fields": [ + [ + "TO_GPIO", + 19, + 1 + ], + [ + "XPD", + 20, + 1 + ], + [ + "TIE_OPT", + 21, + 1 + ], + [ + "START", + 22, + 1 + ], + [ + "DAC", + 23, + 3 + ] + ] + }, + { + "name": "EXT_WAKEUP0", + "offset": "0xBC", + "fields": [ + [ + "SEL", + 27, + 5 + ] + ] + }, + { + "name": "XTL_EXT_CTR", + "offset": "0xC0", + "fields": [ + [ + "SEL", + 27, + 5 + ] + ] + }, + { + "name": "SAR_I2C_IO", + "offset": "0xC4", + "fields": [ + [ + "SAR_DEBUG_BIT_SEL", + 23, + 5 + ], + [ + "SAR_I2C_SCL_SEL", + 28, + 2 + ], + [ + "SAR_I2C_SDA_SEL", + 30, + 2 + ] + ] + }, + { + "name": "DATE", + "offset": "0xC8", + "reset": "0x01603160", + "fields": [ + [ + "IO_DATE", + 0, + 28 + ] + ] + } + ] + }, + { + "name": "SENS", + "base": "0x3FF48800", + "registers": [ + { + "name": "SAR_READ_CTRL", + "offset": "0x00", + "reset": "0x00070902", + "fields": [ + [ + "SAR1_CLK_DIV", + 0, + 8 + ], + [ + "SAR1_SAMPLE_CYCLE", + 8, + 8 + ], + [ + "SAR1_SAMPLE_BIT", + 16, + 2 + ], + [ + "SAR1_CLK_GATED", + 18, + 1 + ], + [ + "SAR1_SAMPLE_NUM", + 19, + 8 + ], + [ + "SAR1_DIG_FORCE", + 27, + 1 + ], + [ + "SAR1_DATA_INV", + 28, + 1 + ] + ] + }, + { + "name": "SAR_READ_STATUS1", + "offset": "0x04", + "fields": [ + [ + "SAR1_READER_STATUS", + 0, + 32, + "r" + ] + ] + }, + { + "name": "SAR_MEAS_WAIT1", + "offset": "0x08", + "reset": "0x000A000A", + "fields": [ + [ + "SAR_AMP_WAIT1", + 0, + 16 + ], + [ + "SAR_AMP_WAIT2", + 16, + 16 + ] + ] + }, + { + "name": "SAR_MEAS_WAIT2", + "offset": "0x0C", + "reset": "0x0020000A", + "fields": [ + [ + "SAR_AMP_WAIT3", + 0, + 16 + ], + [ + "FORCE_XPD_AMP", + 16, + 2 + ], + [ + "FORCE_XPD_SAR", + 18, + 2 + ], + [ + "SAR2_RSTB_WAIT", + 20, + 8 + ] + ] + }, + { + "name": "SAR_MEAS_CTRL", + "offset": "0x10", + "reset": "0x0707338F", + "fields": [ + [ + "XPD_SAR_AMP_FSM", + 0, + 4 + ], + [ + "AMP_RST_FB_FSM", + 4, + 4 + ], + [ + "AMP_SHORT_REF_FSM", + 8, + 4 + ], + [ + "AMP_SHORT_REF_GND_FSM", + 12, + 4 + ], + [ + "XPD_SAR_FSM", + 16, + 4 + ], + [ + "SAR_RSTB_FSM", + 20, + 4 + ], + [ + "SAR2_XPD_WAIT", + 24, + 8 + ] + ] + }, + { + "name": "SAR_READ_STATUS2", + "offset": "0x14", + "fields": [ + [ + "SAR2_READER_STATUS", + 0, + 32, + "r" + ] + ] + }, + { + "name": "ULP_CP_SLEEP_CYC0", + "offset": "0x18", + "reset": "0x000000C8", + "fields": [ + [ + "SLEEP_CYCLES_S0", + 0, + 32 + ] + ] + }, + { + "name": "ULP_CP_SLEEP_CYC1", + "offset": "0x1C", + "reset": "0x00000064", + "fields": [ + [ + "SLEEP_CYCLES_S1", + 0, + 32 + ] + ] + }, + { + "name": "ULP_CP_SLEEP_CYC2", + "offset": "0x20", + "reset": "0x00000032", + "fields": [ + [ + "SLEEP_CYCLES_S2", + 0, + 32 + ] + ] + }, + { + "name": "ULP_CP_SLEEP_CYC3", + "offset": "0x24", + "reset": "0x00000028", + "fields": [ + [ + "SLEEP_CYCLES_S3", + 0, + 32 + ] + ] + }, + { + "name": "ULP_CP_SLEEP_CYC4", + "offset": "0x28", + "reset": "0x00000014", + "fields": [ + [ + "SLEEP_CYCLES_S4", + 0, + 32 + ] + ] + }, + { + "name": "SAR_START_FORCE", + "offset": "0x2C", + "reset": "0x0000000F", + "fields": [ + [ + "SAR1_BIT_WIDTH", + 0, + 2 + ], + [ + "SAR2_BIT_WIDTH", + 2, + 2 + ], + [ + "SAR2_EN_TEST", + 4, + 1 + ], + [ + "SAR2_PWDET_CCT", + 5, + 3 + ], + [ + "ULP_CP_FORCE_START_TOP", + 8, + 1 + ], + [ + "ULP_CP_START_TOP", + 9, + 1 + ], + [ + "SARCLK_EN", + 10, + 1 + ], + [ + "PC_INIT", + 11, + 11 + ], + [ + "SAR2_STOP", + 22, + 1 + ], + [ + "SAR1_STOP", + 23, + 1 + ], + [ + "SAR2_PWDET_EN", + 24, + 1 + ] + ] + }, + { + "name": "SAR_MEM_WR_CTRL", + "offset": "0x30", + "reset": "0x00100200", + "fields": [ + [ + "MEM_WR_ADDR_INIT", + 0, + 11 + ], + [ + "MEM_WR_ADDR_SIZE", + 11, + 11 + ], + [ + "RTC_MEM_WR_OFFST_CLR", + 22, + 1, + "w" + ] + ] + }, + { + "name": "SAR_ATTEN1", + "offset": "0x34", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "SAR1_ATTEN", + 0, + 32 + ] + ] + }, + { + "name": "SAR_ATTEN2", + "offset": "0x38", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "SAR2_ATTEN", + 0, + 32 + ] + ] + }, + { + "name": "SAR_SLAVE_ADDR1", + "offset": "0x3C", + "fields": [ + [ + "I2C_SLAVE_ADDR1", + 0, + 11 + ], + [ + "I2C_SLAVE_ADDR0", + 11, + 11 + ], + [ + "MEAS_STATUS", + 22, + 8, + "r" + ] + ] + }, + { + "name": "SAR_SLAVE_ADDR2", + "offset": "0x40", + "fields": [ + [ + "I2C_SLAVE_ADDR3", + 0, + 11 + ], + [ + "I2C_SLAVE_ADDR2", + 11, + 11 + ] + ] + }, + { + "name": "SAR_SLAVE_ADDR3", + "offset": "0x44", + "fields": [ + [ + "I2C_SLAVE_ADDR5", + 0, + 11 + ], + [ + "I2C_SLAVE_ADDR4", + 11, + 11 + ], + [ + "TSENS_OUT", + 22, + 8, + "r" + ], + [ + "TSENS_RDY_OUT", + 30, + 1, + "r" + ] + ] + }, + { + "name": "SAR_SLAVE_ADDR4", + "offset": "0x48", + "fields": [ + [ + "I2C_SLAVE_ADDR7", + 0, + 11 + ], + [ + "I2C_SLAVE_ADDR6", + 11, + 11 + ], + [ + "I2C_RDATA", + 22, + 8, + "r" + ], + [ + "I2C_DONE", + 30, + 1, + "r" + ] + ] + }, + { + "name": "SAR_TSENS_CTRL", + "offset": "0x4C", + "reset": "0x00066002", + "fields": [ + [ + "TSENS_XPD_WAIT", + 0, + 12 + ], + [ + "TSENS_XPD_FORCE", + 12, + 1 + ], + [ + "TSENS_CLK_INV", + 13, + 1 + ], + [ + "TSENS_CLK_GATED", + 14, + 1 + ], + [ + "TSENS_IN_INV", + 15, + 1 + ], + [ + "TSENS_CLK_DIV", + 16, + 8 + ], + [ + "TSENS_POWER_UP", + 24, + 1 + ], + [ + "TSENS_POWER_UP_FORCE", + 25, + 1 + ], + [ + "TSENS_DUMP_OUT", + 26, + 1 + ] + ] + }, + { + "name": "SAR_I2C_CTRL", + "offset": "0x50", + "fields": [ + [ + "SAR_I2C_CTRL", + 0, + 28 + ], + [ + "SAR_I2C_START", + 28, + 1 + ], + [ + "SAR_I2C_START_FORCE", + 29, + 1 + ] + ] + }, + { + "name": "SAR_MEAS_START1", + "offset": "0x54", + "fields": [ + [ + "MEAS1_DATA_SAR", + 0, + 16, + "r" + ], + [ + "MEAS1_DONE_SAR", + 16, + 1, + "r" + ], + [ + "MEAS1_START_SAR", + 17, + 1 + ], + [ + "MEAS1_START_FORCE", + 18, + 1 + ], + [ + "SAR1_EN_PAD", + 19, + 12 + ], + [ + "SAR1_EN_PAD_FORCE", + 31, + 1 + ] + ] + }, + { + "name": "SAR_TOUCH_CTRL1", + "offset": "0x58", + "reset": "0x02041000", + "fields": [ + [ + "TOUCH_MEAS_DELAY", + 0, + 16 + ], + [ + "TOUCH_XPD_WAIT", + 16, + 8 + ], + [ + "TOUCH_OUT_SEL", + 24, + 1 + ], + [ + "TOUCH_OUT_1EN", + 25, + 1 + ], + [ + "XPD_HALL_FORCE", + 26, + 1 + ], + [ + "HALL_PHASE_FORCE", + 27, + 1 + ] + ] + }, + { + "name": "SAR_TOUCH_THRES1", + "offset": "0x5C", + "fields": [ + [ + "TOUCH_OUT_TH1", + 0, + 16 + ], + [ + "TOUCH_OUT_TH0", + 16, + 16 + ] + ] + }, + { + "name": "SAR_TOUCH_THRES2", + "offset": "0x60", + "fields": [ + [ + "TOUCH_OUT_TH3", + 0, + 16 + ], + [ + "TOUCH_OUT_TH2", + 16, + 16 + ] + ] + }, + { + "name": "SAR_TOUCH_THRES3", + "offset": "0x64", + "fields": [ + [ + "TOUCH_OUT_TH5", + 0, + 16 + ], + [ + "TOUCH_OUT_TH4", + 16, + 16 + ] + ] + }, + { + "name": "SAR_TOUCH_THRES4", + "offset": "0x68", + "fields": [ + [ + "TOUCH_OUT_TH7", + 0, + 16 + ], + [ + "TOUCH_OUT_TH6", + 16, + 16 + ] + ] + }, + { + "name": "SAR_TOUCH_THRES5", + "offset": "0x6C", + "fields": [ + [ + "TOUCH_OUT_TH9", + 0, + 16 + ], + [ + "TOUCH_OUT_TH8", + 16, + 16 + ] + ] + }, + { + "name": "SAR_TOUCH_OUT1", + "offset": "0x70", + "fields": [ + [ + "TOUCH_MEAS_OUT1", + 0, + 16, + "r" + ], + [ + "TOUCH_MEAS_OUT0", + 16, + 16, + "r" + ] + ] + }, + { + "name": "SAR_TOUCH_OUT2", + "offset": "0x74", + "fields": [ + [ + "TOUCH_MEAS_OUT3", + 0, + 16, + "r" + ], + [ + "TOUCH_MEAS_OUT2", + 16, + 16, + "r" + ] + ] + }, + { + "name": "SAR_TOUCH_OUT3", + "offset": "0x78", + "fields": [ + [ + "TOUCH_MEAS_OUT5", + 0, + 16, + "r" + ], + [ + "TOUCH_MEAS_OUT4", + 16, + 16, + "r" + ] + ] + }, + { + "name": "SAR_TOUCH_OUT4", + "offset": "0x7C", + "fields": [ + [ + "TOUCH_MEAS_OUT7", + 0, + 16, + "r" + ], + [ + "TOUCH_MEAS_OUT6", + 16, + 16, + "r" + ] + ] + }, + { + "name": "SAR_TOUCH_OUT5", + "offset": "0x80", + "fields": [ + [ + "TOUCH_MEAS_OUT9", + 0, + 16, + "r" + ], + [ + "TOUCH_MEAS_OUT8", + 16, + 16, + "r" + ] + ] + }, + { + "name": "SAR_TOUCH_CTRL2", + "offset": "0x84", + "reset": "0x00400800", + "fields": [ + [ + "TOUCH_MEAS_EN", + 0, + 10, + "r" + ], + [ + "TOUCH_MEAS_DONE", + 10, + 1, + "r" + ], + [ + "TOUCH_START_FSM_EN", + 11, + 1 + ], + [ + "TOUCH_START_EN", + 12, + 1 + ], + [ + "TOUCH_START_FORCE", + 13, + 1 + ], + [ + "TOUCH_SLEEP_CYCLES", + 14, + 16 + ], + [ + "TOUCH_MEAS_EN_CLR", + 30, + 1, + "w" + ] + ] + }, + { + "name": "SAR_TOUCH_ENABLE", + "offset": "0x8C", + "reset": "0x3FFFFFFF", + "fields": [ + [ + "TOUCH_PAD_WORKEN", + 0, + 10 + ], + [ + "TOUCH_PAD_OUTEN2", + 10, + 10 + ], + [ + "TOUCH_PAD_OUTEN1", + 20, + 10 + ] + ] + }, + { + "name": "SAR_READ_CTRL2", + "offset": "0x90", + "reset": "0x00070902", + "fields": [ + [ + "SAR2_CLK_DIV", + 0, + 8 + ], + [ + "SAR2_SAMPLE_CYCLE", + 8, + 8 + ], + [ + "SAR2_SAMPLE_BIT", + 16, + 2 + ], + [ + "SAR2_CLK_GATED", + 18, + 1 + ], + [ + "SAR2_SAMPLE_NUM", + 19, + 8 + ], + [ + "SAR2_PWDET_FORCE", + 27, + 1 + ], + [ + "SAR2_DIG_FORCE", + 28, + 1 + ], + [ + "SAR2_DATA_INV", + 29, + 1 + ] + ] + }, + { + "name": "SAR_MEAS_START2", + "offset": "0x94", + "fields": [ + [ + "MEAS2_DATA_SAR", + 0, + 16, + "r" + ], + [ + "MEAS2_DONE_SAR", + 16, + 1, + "r" + ], + [ + "MEAS2_START_SAR", + 17, + 1 + ], + [ + "MEAS2_START_FORCE", + 18, + 1 + ], + [ + "SAR2_EN_PAD", + 19, + 12 + ], + [ + "SAR2_EN_PAD_FORCE", + 31, + 1 + ] + ] + }, + { + "name": "SAR_DAC_CTRL1", + "offset": "0x98", + "fields": [ + [ + "SW_FSTEP", + 0, + 16 + ], + [ + "SW_TONE_EN", + 16, + 1 + ], + [ + "DEBUG_BIT_SEL", + 17, + 5 + ], + [ + "DAC_DIG_FORCE", + 22, + 1 + ], + [ + "DAC_CLK_FORCE_LOW", + 23, + 1 + ], + [ + "DAC_CLK_FORCE_HIGH", + 24, + 1 + ], + [ + "DAC_CLK_INV", + 25, + 1 + ] + ] + }, + { + "name": "SAR_DAC_CTRL2", + "offset": "0x9C", + "reset": "0x03000000", + "fields": [ + [ + "DAC_DC1", + 0, + 8 + ], + [ + "DAC_DC2", + 8, + 8 + ], + [ + "DAC_SCALE1", + 16, + 2 + ], + [ + "DAC_SCALE2", + 18, + 2 + ], + [ + "DAC_INV1", + 20, + 2 + ], + [ + "DAC_INV2", + 22, + 2 + ], + [ + "DAC_CW_EN1", + 24, + 1 + ], + [ + "DAC_CW_EN2", + 25, + 1 + ] + ] + }, + { + "name": "SAR_MEAS_CTRL2", + "offset": "0xA0", + "reset": "0x00000003", + "fields": [ + [ + "SAR1_DAC_XPD_FSM", + 0, + 4 + ], + [ + "SAR1_DAC_XPD_FSM_IDLE", + 4, + 1 + ], + [ + "XPD_SAR_AMP_FSM_IDLE", + 5, + 1 + ], + [ + "AMP_RST_FB_FSM_IDLE", + 6, + 1 + ], + [ + "AMP_SHORT_REF_FSM_IDLE", + 7, + 1 + ], + [ + "AMP_SHORT_REF_GND_FSM_IDLE", + 8, + 1 + ], + [ + "XPD_SAR_FSM_IDLE", + 9, + 1 + ], + [ + "SAR_RSTB_FSM_IDLE", + 10, + 1 + ], + [ + "SAR2_RSTB_FORCE", + 11, + 2 + ], + [ + "AMP_RST_FB_FORCE", + 13, + 2 + ], + [ + "AMP_SHORT_REF_FORCE", + 15, + 2 + ], + [ + "AMP_SHORT_REF_GND_FORCE", + 17, + 2 + ] + ] + }, + { + "name": "SAR_NOUSE", + "offset": "0xF8", + "fields": [ + [ + "SAR_NOUSE", + 0, + 32 + ] + ] + }, + { + "name": "SARDATE", + "offset": "0xFC", + "reset": "0x01605180", + "fields": [ + [ + "SAR_DATE", + 0, + 28 + ] + ] + } + ] + }, + { + "name": "RTC_I2C", + "base": "0x3FF48C00", + "registers": [ + { + "name": "SCL_LOW_PERIOD", + "offset": "0x00", + "fields": [ + [ + "SCL_LOW_PERIOD", + 0, + 25 + ] + ] + }, + { + "name": "CTRL", + "offset": "0x04", + "fields": [ + [ + "SDA_FORCE_OUT", + 0, + 1 + ], + [ + "SCL_FORCE_OUT", + 1, + 1 + ], + [ + "MS_MODE", + 4, + 1 + ], + [ + "TRANS_START", + 5, + 1 + ], + [ + "TX_LSB_FIRST", + 6, + 1 + ], + [ + "RX_LSB_FIRST", + 7, + 1 + ] + ] + }, + { + "name": "DEBUG_STATUS", + "offset": "0x08", + "fields": [ + [ + "ACK_VAL", + 0, + 1 + ], + [ + "SLAVE_RW", + 1, + 1 + ], + [ + "TIMED_OUT", + 2, + 1 + ], + [ + "ARB_LOST", + 3, + 1 + ], + [ + "BUS_BUSY", + 4, + 1 + ], + [ + "SLAVE_ADDR_MATCH", + 5, + 1 + ], + [ + "BYTE_TRANS", + 6, + 1 + ], + [ + "MAIN_STATE", + 25, + 3 + ], + [ + "SCL_STATE", + 28, + 3 + ] + ] + }, + { + "name": "TIMEOUT", + "offset": "0x0C", + "fields": [ + [ + "TIMEOUT", + 0, + 20 + ] + ] + }, + { + "name": "SLAVE_ADDR", + "offset": "0x10", + "fields": [ + [ + "SLAVE_ADDR", + 0, + 15 + ], + [ + "_10BIT", + 31, + 1 + ] + ] + }, + { + "name": "DATA", + "offset": "0x1C" + }, + { + "name": "INT_RAW", + "offset": "0x20", + "fields": [ + [ + "SLAVE_TRANS_COMPLETE_INT_RAW", + 3, + 1 + ], + [ + "ARBITRATION_LOST_INT_RAW", + 4, + 1 + ], + [ + "MASTER_TRANS_COMPLETE_INT_RAW", + 5, + 1 + ], + [ + "TRANS_COMPLETE_INT_RAW", + 6, + 1 + ], + [ + "TIME_OUT_INT_RAW", + 7, + 1, + "r" + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x24", + "fields": [ + [ + "SLAVE_TRANS_COMPLETE_INT_CLR", + 4, + 1 + ], + [ + "ARBITRATION_LOST_INT_CLR", + 5, + 1 + ], + [ + "MASTER_TRANS_COMPLETE_INT_CLR", + 6, + 1 + ], + [ + "TRANS_COMPLETE_INT_CLR", + 7, + 1 + ], + [ + "TIME_OUT_INT_CLR", + 8, + 1, + "w" + ] + ] + }, + { + "name": "INT_EN", + "offset": "0x28" + }, + { + "name": "INT_ST", + "offset": "0x2C" + }, + { + "name": "SDA_DUTY", + "offset": "0x30", + "fields": [ + [ + "SDA_DUTY", + 0, + 20 + ] + ] + }, + { + "name": "SCL_HIGH_PERIOD", + "offset": "0x38", + "fields": [ + [ + "SCL_HIGH_PERIOD", + 0, + 20 + ] + ] + }, + { + "name": "SCL_START_PERIOD", + "offset": "0x40", + "fields": [ + [ + "SCL_START_PERIOD", + 0, + 20 + ] + ] + }, + { + "name": "SCL_STOP_PERIOD", + "offset": "0x44", + "fields": [ + [ + "SCL_STOP_PERIOD", + 0, + 20 + ] + ] + }, + { + "name": "CMD", + "offset": "0x48", + "fields": [ + [ + "VAL", + 0, + 14 + ], + [ + "DONE", + 31, + 1 + ] + ] + } + ] + }, + { + "name": "IO_MUX", + "base": "0x3FF49000", + "registers": [ + { + "name": "PIN_CTRL", + "offset": "0x00", + "fields": [ + [ + "CLK1", + 0, + 4 + ], + [ + "CLK2", + 4, + 4 + ], + [ + "CLK3", + 8, + 4 + ] + ] + }, + { + "name": "GPIO36", + "offset": "0x04", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO37", + "offset": "0x08", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO38", + "offset": "0x0C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO39", + "offset": "0x10", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO34", + "offset": "0x14", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO35", + "offset": "0x18", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO32", + "offset": "0x1C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO33", + "offset": "0x20", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO25", + "offset": "0x24", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO26", + "offset": "0x28", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO27", + "offset": "0x2C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO14", + "offset": "0x30", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO12", + "offset": "0x34", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO13", + "offset": "0x38", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO15", + "offset": "0x3C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO2", + "offset": "0x40", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO0", + "offset": "0x44", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO4", + "offset": "0x48", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO16", + "offset": "0x4C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO17", + "offset": "0x50", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO9", + "offset": "0x54", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO10", + "offset": "0x58", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO11", + "offset": "0x5C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO6", + "offset": "0x60", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO7", + "offset": "0x64", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO8", + "offset": "0x68", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO5", + "offset": "0x6C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO18", + "offset": "0x70", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO19", + "offset": "0x74", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO20", + "offset": "0x78", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO21", + "offset": "0x7C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO22", + "offset": "0x80", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO3", + "offset": "0x84", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO1", + "offset": "0x88", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO23", + "offset": "0x8C", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + }, + { + "name": "GPIO24", + "offset": "0x90", + "fields": [ + [ + "MCU_OE", + 0, + 1 + ], + [ + "SLP_SEL", + 1, + 1 + ], + [ + "MCU_WPD", + 2, + 1 + ], + [ + "MCU_WPU", + 3, + 1 + ], + [ + "MCU_IE", + 4, + 1 + ], + [ + "MCU_DRV", + 5, + 2 + ], + [ + "FUN_WPD", + 7, + 1 + ], + [ + "FUN_WPU", + 8, + 1 + ], + [ + "FUN_IE", + 9, + 1 + ], + [ + "FUN_DRV", + 10, + 2 + ], + [ + "MCU_SEL", + 12, + 3 + ] + ] + } + ] + }, + { + "name": "HINF", + "base": "0x3FF4B000", + "registers": [ + { + "name": "CFG_DATA0", + "offset": "0x00", + "reset": "0x22226666", + "fields": [ + [ + "USER_ID_FN1", + 0, + 16 + ], + [ + "DEVICE_ID_FN1", + 16, + 16 + ] + ] + }, + { + "name": "CFG_DATA1", + "offset": "0x04", + "reset": "0x01110011", + "fields": [ + [ + "SDIO_ENABLE", + 0, + 1 + ], + [ + "SDIO_IOREADY1", + 1, + 1 + ], + [ + "HIGHSPEED_ENABLE", + 2, + 1 + ], + [ + "HIGHSPEED_MODE", + 3, + 1, + "r" + ], + [ + "SDIO_CD_ENABLE", + 4, + 1 + ], + [ + "SDIO_IOREADY2", + 5, + 1 + ], + [ + "SDIO_INT_MASK", + 6, + 1 + ], + [ + "IOENABLE2", + 7, + 1, + "r" + ], + [ + "CD_DISABLE", + 8, + 1, + "r" + ], + [ + "FUNC1_EPS", + 9, + 1, + "r" + ], + [ + "EMP", + 10, + 1, + "r" + ], + [ + "IOENABLE1", + 11, + 1, + "r" + ], + [ + "SDIO20_CONF0", + 12, + 4 + ], + [ + "SDIO_VER", + 16, + 12 + ], + [ + "FUNC2_EPS", + 28, + 1, + "r" + ], + [ + "SDIO20_CONF1", + 29, + 3 + ] + ] + }, + { + "name": "CFG_DATA7", + "offset": "0x1C", + "reset": "0x00020000", + "fields": [ + [ + "PIN_STATE", + 0, + 8 + ], + [ + "CHIP_STATE", + 8, + 8 + ], + [ + "SDIO_RST", + 16, + 1 + ], + [ + "SDIO_IOREADY0", + 17, + 1 + ] + ] + }, + { + "name": "CIS_CONF0", + "offset": "0x20", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "CIS_CONF_W0", + 0, + 32 + ] + ] + }, + { + "name": "CIS_CONF1", + "offset": "0x24", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "CIS_CONF_W1", + 0, + 32 + ] + ] + }, + { + "name": "CIS_CONF2", + "offset": "0x28", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "CIS_CONF_W2", + 0, + 32 + ] + ] + }, + { + "name": "CIS_CONF3", + "offset": "0x2C", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "CIS_CONF_W3", + 0, + 32 + ] + ] + }, + { + "name": "CIS_CONF4", + "offset": "0x30", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "CIS_CONF_W4", + 0, + 32 + ] + ] + }, + { + "name": "CIS_CONF5", + "offset": "0x34", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "CIS_CONF_W5", + 0, + 32 + ] + ] + }, + { + "name": "CIS_CONF6", + "offset": "0x38", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "CIS_CONF_W6", + 0, + 32 + ] + ] + }, + { + "name": "CIS_CONF7", + "offset": "0x3C", + "reset": "0xFFFFFFFF", + "fields": [ + [ + "CIS_CONF_W7", + 0, + 32 + ] + ] + }, + { + "name": "CFG_DATA16", + "offset": "0x40", + "reset": "0x33336666", + "fields": [ + [ + "USER_ID_FN2", + 0, + 16 + ], + [ + "DEVICE_ID_FN2", + 16, + 16 + ] + ] + }, + { + "name": "DATE", + "offset": "0xFC", + "reset": "0x15030200", + "fields": [ + [ + "SDIO_DATE", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "UHCI1", + "base": "0x3FF4C000", + "interrupts": [ + "UHCI1" + ], + "derived_from": "UHCI0" + }, + { + "name": "I2S0", + "base": "0x3FF4F000", + "interrupts": [ + "I2S0" + ], + "registers": [ + { + "name": "CONF", + "offset": "0x08", + "reset": "0x00030300", + "fields": [ + [ + "TX_RESET", + 0, + 1 + ], + [ + "RX_RESET", + 1, + 1 + ], + [ + "TX_FIFO_RESET", + 2, + 1 + ], + [ + "RX_FIFO_RESET", + 3, + 1 + ], + [ + "TX_START", + 4, + 1 + ], + [ + "RX_START", + 5, + 1 + ], + [ + "TX_SLAVE_MOD", + 6, + 1 + ], + [ + "RX_SLAVE_MOD", + 7, + 1 + ], + [ + "TX_RIGHT_FIRST", + 8, + 1 + ], + [ + "RX_RIGHT_FIRST", + 9, + 1 + ], + [ + "TX_MSB_SHIFT", + 10, + 1 + ], + [ + "RX_MSB_SHIFT", + 11, + 1 + ], + [ + "TX_SHORT_SYNC", + 12, + 1 + ], + [ + "RX_SHORT_SYNC", + 13, + 1 + ], + [ + "TX_MONO", + 14, + 1 + ], + [ + "RX_MONO", + 15, + 1 + ], + [ + "TX_MSB_RIGHT", + 16, + 1 + ], + [ + "RX_MSB_RIGHT", + 17, + 1 + ], + [ + "SIG_LOOPBACK", + 18, + 1 + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x0C", + "fields": [ + [ + "RX_TAKE_DATA_INT_RAW", + 0, + 1, + "r" + ], + [ + "TX_PUT_DATA_INT_RAW", + 1, + 1, + "r" + ], + [ + "RX_WFULL_INT_RAW", + 2, + 1, + "r" + ], + [ + "RX_REMPTY_INT_RAW", + 3, + 1, + "r" + ], + [ + "TX_WFULL_INT_RAW", + 4, + 1, + "r" + ], + [ + "TX_REMPTY_INT_RAW", + 5, + 1, + "r" + ], + [ + "RX_HUNG_INT_RAW", + 6, + 1, + "r" + ], + [ + "TX_HUNG_INT_RAW", + 7, + 1, + "r" + ], + [ + "IN_DONE_INT_RAW", + 8, + 1, + "r" + ], + [ + "IN_SUC_EOF_INT_RAW", + 9, + 1, + "r" + ], + [ + "IN_ERR_EOF_INT_RAW", + 10, + 1, + "r" + ], + [ + "OUT_DONE_INT_RAW", + 11, + 1, + "r" + ], + [ + "OUT_EOF_INT_RAW", + 12, + 1, + "r" + ], + [ + "IN_DSCR_ERR_INT_RAW", + 13, + 1, + "r" + ], + [ + "OUT_DSCR_ERR_INT_RAW", + 14, + 1, + "r" + ], + [ + "IN_DSCR_EMPTY_INT_RAW", + 15, + 1, + "r" + ], + [ + "OUT_TOTAL_EOF_INT_RAW", + 16, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0x10", + "fields": [ + [ + "RX_TAKE_DATA_INT_ST", + 0, + 1, + "r" + ], + [ + "TX_PUT_DATA_INT_ST", + 1, + 1, + "r" + ], + [ + "RX_WFULL_INT_ST", + 2, + 1, + "r" + ], + [ + "RX_REMPTY_INT_ST", + 3, + 1, + "r" + ], + [ + "TX_WFULL_INT_ST", + 4, + 1, + "r" + ], + [ + "TX_REMPTY_INT_ST", + 5, + 1, + "r" + ], + [ + "RX_HUNG_INT_ST", + 6, + 1, + "r" + ], + [ + "TX_HUNG_INT_ST", + 7, + 1, + "r" + ], + [ + "IN_DONE_INT_ST", + 8, + 1, + "r" + ], + [ + "IN_SUC_EOF_INT_ST", + 9, + 1, + "r" + ], + [ + "IN_ERR_EOF_INT_ST", + 10, + 1, + "r" + ], + [ + "OUT_DONE_INT_ST", + 11, + 1, + "r" + ], + [ + "OUT_EOF_INT_ST", + 12, + 1, + "r" + ], + [ + "IN_DSCR_ERR_INT_ST", + 13, + 1, + "r" + ], + [ + "OUT_DSCR_ERR_INT_ST", + 14, + 1, + "r" + ], + [ + "IN_DSCR_EMPTY_INT_ST", + 15, + 1, + "r" + ], + [ + "OUT_TOTAL_EOF_INT_ST", + 16, + 1, + "r" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x14", + "fields": [ + [ + "RX_TAKE_DATA_INT_ENA", + 0, + 1 + ], + [ + "TX_PUT_DATA_INT_ENA", + 1, + 1 + ], + [ + "RX_WFULL_INT_ENA", + 2, + 1 + ], + [ + "RX_REMPTY_INT_ENA", + 3, + 1 + ], + [ + "TX_WFULL_INT_ENA", + 4, + 1 + ], + [ + "TX_REMPTY_INT_ENA", + 5, + 1 + ], + [ + "RX_HUNG_INT_ENA", + 6, + 1 + ], + [ + "TX_HUNG_INT_ENA", + 7, + 1 + ], + [ + "IN_DONE_INT_ENA", + 8, + 1 + ], + [ + "IN_SUC_EOF_INT_ENA", + 9, + 1 + ], + [ + "IN_ERR_EOF_INT_ENA", + 10, + 1 + ], + [ + "OUT_DONE_INT_ENA", + 11, + 1 + ], + [ + "OUT_EOF_INT_ENA", + 12, + 1 + ], + [ + "IN_DSCR_ERR_INT_ENA", + 13, + 1 + ], + [ + "OUT_DSCR_ERR_INT_ENA", + 14, + 1 + ], + [ + "IN_DSCR_EMPTY_INT_ENA", + 15, + 1 + ], + [ + "OUT_TOTAL_EOF_INT_ENA", + 16, + 1 + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x18", + "fields": [ + [ + "TAKE_DATA_INT_CLR", + 0, + 1, + "w" + ], + [ + "PUT_DATA_INT_CLR", + 1, + 1, + "w" + ], + [ + "RX_WFULL_INT_CLR", + 2, + 1, + "w" + ], + [ + "RX_REMPTY_INT_CLR", + 3, + 1, + "w" + ], + [ + "TX_WFULL_INT_CLR", + 4, + 1, + "w" + ], + [ + "TX_REMPTY_INT_CLR", + 5, + 1, + "w" + ], + [ + "RX_HUNG_INT_CLR", + 6, + 1, + "w" + ], + [ + "TX_HUNG_INT_CLR", + 7, + 1, + "w" + ], + [ + "IN_DONE_INT_CLR", + 8, + 1, + "w" + ], + [ + "IN_SUC_EOF_INT_CLR", + 9, + 1, + "w" + ], + [ + "IN_ERR_EOF_INT_CLR", + 10, + 1, + "w" + ], + [ + "OUT_DONE_INT_CLR", + 11, + 1, + "w" + ], + [ + "OUT_EOF_INT_CLR", + 12, + 1, + "w" + ], + [ + "IN_DSCR_ERR_INT_CLR", + 13, + 1, + "w" + ], + [ + "OUT_DSCR_ERR_INT_CLR", + 14, + 1, + "w" + ], + [ + "IN_DSCR_EMPTY_INT_CLR", + 15, + 1, + "w" + ], + [ + "OUT_TOTAL_EOF_INT_CLR", + 16, + 1, + "w" + ] + ] + }, + { + "name": "TIMING", + "offset": "0x1C", + "fields": [ + [ + "TX_BCK_IN_DELAY", + 0, + 2 + ], + [ + "TX_WS_IN_DELAY", + 2, + 2 + ], + [ + "RX_BCK_IN_DELAY", + 4, + 2 + ], + [ + "RX_WS_IN_DELAY", + 6, + 2 + ], + [ + "RX_SD_IN_DELAY", + 8, + 2 + ], + [ + "TX_BCK_OUT_DELAY", + 10, + 2 + ], + [ + "TX_WS_OUT_DELAY", + 12, + 2 + ], + [ + "TX_SD_OUT_DELAY", + 14, + 2 + ], + [ + "RX_WS_OUT_DELAY", + 16, + 2 + ], + [ + "RX_BCK_OUT_DELAY", + 18, + 2 + ], + [ + "TX_DSYNC_SW", + 20, + 1 + ], + [ + "RX_DSYNC_SW", + 21, + 1 + ], + [ + "DATA_ENABLE_DELAY", + 22, + 2 + ], + [ + "TX_BCK_IN_INV", + 24, + 1 + ] + ] + }, + { + "name": "FIFO_CONF", + "offset": "0x20", + "reset": "0x00001820", + "fields": [ + [ + "RX_DATA_NUM", + 0, + 6 + ], + [ + "TX_DATA_NUM", + 6, + 6 + ], + [ + "DSCR_EN", + 12, + 1 + ], + [ + "TX_FIFO_MOD", + 13, + 3 + ], + [ + "RX_FIFO_MOD", + 16, + 3 + ], + [ + "TX_FIFO_MOD_FORCE_EN", + 19, + 1 + ], + [ + "RX_FIFO_MOD_FORCE_EN", + 20, + 1 + ] + ] + }, + { + "name": "RXEOF_NUM", + "offset": "0x24", + "reset": "0x00000040", + "fields": [ + [ + "RX_EOF_NUM", + 0, + 32 + ] + ] + }, + { + "name": "CONF_SIGLE_DATA", + "offset": "0x28", + "fields": [ + [ + "SIGLE_DATA", + 0, + 32 + ] + ] + }, + { + "name": "CONF_CHAN", + "offset": "0x2C", + "fields": [ + [ + "TX_CHAN_MOD", + 0, + 3 + ], + [ + "RX_CHAN_MOD", + 3, + 2 + ] + ] + }, + { + "name": "OUT_LINK", + "offset": "0x30", + "fields": [ + [ + "OUTLINK_ADDR", + 0, + 20 + ], + [ + "OUTLINK_STOP", + 28, + 1 + ], + [ + "OUTLINK_START", + 29, + 1 + ], + [ + "OUTLINK_RESTART", + 30, + 1 + ], + [ + "OUTLINK_PARK", + 31, + 1, + "r" + ] + ] + }, + { + "name": "IN_LINK", + "offset": "0x34", + "fields": [ + [ + "INLINK_ADDR", + 0, + 20 + ], + [ + "INLINK_STOP", + 28, + 1 + ], + [ + "INLINK_START", + 29, + 1 + ], + [ + "INLINK_RESTART", + 30, + 1 + ], + [ + "INLINK_PARK", + 31, + 1, + "r" + ] + ] + }, + { + "name": "OUT_EOF_DES_ADDR", + "offset": "0x38", + "fields": [ + [ + "OUT_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "IN_EOF_DES_ADDR", + "offset": "0x3C", + "fields": [ + [ + "IN_SUC_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUT_EOF_BFR_DES_ADDR", + "offset": "0x40", + "fields": [ + [ + "OUT_EOF_BFR_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "AHB_TEST", + "offset": "0x44", + "fields": [ + [ + "AHB_TESTMODE", + 0, + 3 + ], + [ + "AHB_TESTADDR", + 4, + 2 + ] + ] + }, + { + "name": "INLINK_DSCR", + "offset": "0x48", + "fields": [ + [ + "INLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "INLINK_DSCR_BF0", + "offset": "0x4C", + "fields": [ + [ + "INLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "INLINK_DSCR_BF1", + "offset": "0x50", + "fields": [ + [ + "INLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUTLINK_DSCR", + "offset": "0x54", + "fields": [ + [ + "OUTLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUTLINK_DSCR_BF0", + "offset": "0x58", + "fields": [ + [ + "OUTLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "OUTLINK_DSCR_BF1", + "offset": "0x5C", + "fields": [ + [ + "OUTLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "LC_CONF", + "offset": "0x60", + "reset": "0x00000100", + "fields": [ + [ + "IN_RST", + 0, + 1 + ], + [ + "OUT_RST", + 1, + 1 + ], + [ + "AHBM_FIFO_RST", + 2, + 1 + ], + [ + "AHBM_RST", + 3, + 1 + ], + [ + "OUT_LOOP_TEST", + 4, + 1 + ], + [ + "IN_LOOP_TEST", + 5, + 1 + ], + [ + "OUT_AUTO_WRBACK", + 6, + 1 + ], + [ + "OUT_NO_RESTART_CLR", + 7, + 1 + ], + [ + "OUT_EOF_MODE", + 8, + 1 + ], + [ + "OUTDSCR_BURST_EN", + 9, + 1 + ], + [ + "INDSCR_BURST_EN", + 10, + 1 + ], + [ + "OUT_DATA_BURST_EN", + 11, + 1 + ], + [ + "CHECK_OWNER", + 12, + 1 + ], + [ + "MEM_TRANS_EN", + 13, + 1 + ] + ] + }, + { + "name": "OUTFIFO_PUSH", + "offset": "0x64", + "fields": [ + [ + "OUTFIFO_WDATA", + 0, + 9 + ], + [ + "OUTFIFO_PUSH", + 16, + 1 + ] + ] + }, + { + "name": "INFIFO_POP", + "offset": "0x68", + "fields": [ + [ + "INFIFO_RDATA", + 0, + 12, + "r" + ], + [ + "INFIFO_POP", + 16, + 1 + ] + ] + }, + { + "name": "LC_STATE0", + "offset": "0x6C", + "fields": [ + [ + "LC_STATE0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "LC_STATE1", + "offset": "0x70", + "fields": [ + [ + "LC_STATE1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "LC_HUNG_CONF", + "offset": "0x74", + "reset": "0x00000810", + "fields": [ + [ + "LC_FIFO_TIMEOUT", + 0, + 8 + ], + [ + "LC_FIFO_TIMEOUT_SHIFT", + 8, + 3 + ], + [ + "LC_FIFO_TIMEOUT_ENA", + 11, + 1 + ] + ] + }, + { + "name": "CVSD_CONF0", + "offset": "0x80", + "reset": "0x80007FFF", + "fields": [ + [ + "CVSD_Y_MAX", + 0, + 16 + ], + [ + "CVSD_Y_MIN", + 16, + 16 + ] + ] + }, + { + "name": "CVSD_CONF1", + "offset": "0x84", + "reset": "0x000A0500", + "fields": [ + [ + "CVSD_SIGMA_MAX", + 0, + 16 + ], + [ + "CVSD_SIGMA_MIN", + 16, + 16 + ] + ] + }, + { + "name": "CVSD_CONF2", + "offset": "0x88", + "reset": "0x000502A4", + "fields": [ + [ + "CVSD_K", + 0, + 3 + ], + [ + "CVSD_J", + 3, + 3 + ], + [ + "CVSD_BETA", + 6, + 10 + ], + [ + "CVSD_H", + 16, + 3 + ] + ] + }, + { + "name": "PLC_CONF0", + "offset": "0x8C", + "reset": "0x08A80339", + "fields": [ + [ + "GOOD_PACK_MAX", + 0, + 6 + ], + [ + "N_ERR_SEG", + 6, + 3 + ], + [ + "SHIFT_RATE", + 9, + 3 + ], + [ + "MAX_SLIDE_SAMPLE", + 12, + 8 + ], + [ + "PACK_LEN_8K", + 20, + 5 + ], + [ + "N_MIN_ERR", + 25, + 3 + ] + ] + }, + { + "name": "PLC_CONF1", + "offset": "0x90", + "reset": "0xA0178A05", + "fields": [ + [ + "BAD_CEF_ATTEN_PARA", + 0, + 8 + ], + [ + "BAD_CEF_ATTEN_PARA_SHIFT", + 8, + 4 + ], + [ + "BAD_OLA_WIN2_PARA_SHIFT", + 12, + 4 + ], + [ + "BAD_OLA_WIN2_PARA", + 16, + 8 + ], + [ + "SLIDE_WIN_LEN", + 24, + 8 + ] + ] + }, + { + "name": "PLC_CONF2", + "offset": "0x94", + "reset": "0x00000028", + "fields": [ + [ + "CVSD_SEG_MOD", + 0, + 2 + ], + [ + "MIN_PERIOD", + 2, + 5 + ] + ] + }, + { + "name": "ESCO_CONF0", + "offset": "0x98", + "fields": [ + [ + "ESCO_EN", + 0, + 1 + ], + [ + "ESCO_CHAN_MOD", + 1, + 1 + ], + [ + "ESCO_CVSD_DEC_PACK_ERR", + 2, + 1 + ], + [ + "ESCO_CVSD_PACK_LEN_8K", + 3, + 5 + ], + [ + "ESCO_CVSD_INF_EN", + 8, + 1 + ], + [ + "CVSD_DEC_START", + 9, + 1 + ], + [ + "CVSD_DEC_RESET", + 10, + 1 + ], + [ + "PLC_EN", + 11, + 1 + ], + [ + "PLC2DMA_EN", + 12, + 1 + ] + ] + }, + { + "name": "SCO_CONF0", + "offset": "0x9C", + "fields": [ + [ + "SCO_WITH_I2S_EN", + 0, + 1 + ], + [ + "SCO_NO_I2S_EN", + 1, + 1 + ], + [ + "CVSD_ENC_START", + 2, + 1 + ], + [ + "CVSD_ENC_RESET", + 3, + 1 + ] + ] + }, + { + "name": "CONF1", + "offset": "0xA0", + "reset": "0x00000089", + "fields": [ + [ + "TX_PCM_CONF", + 0, + 3 + ], + [ + "TX_PCM_BYPASS", + 3, + 1 + ], + [ + "RX_PCM_CONF", + 4, + 3 + ], + [ + "RX_PCM_BYPASS", + 7, + 1 + ], + [ + "TX_STOP_EN", + 8, + 1 + ], + [ + "TX_ZEROS_RM_EN", + 9, + 1 + ] + ] + }, + { + "name": "PD_CONF", + "offset": "0xA4", + "reset": "0x0000000A", + "fields": [ + [ + "FIFO_FORCE_PD", + 0, + 1 + ], + [ + "FIFO_FORCE_PU", + 1, + 1 + ], + [ + "PLC_MEM_FORCE_PD", + 2, + 1 + ], + [ + "PLC_MEM_FORCE_PU", + 3, + 1 + ] + ] + }, + { + "name": "CONF2", + "offset": "0xA8", + "fields": [ + [ + "CAMERA_EN", + 0, + 1 + ], + [ + "LCD_TX_WRX2_EN", + 1, + 1 + ], + [ + "LCD_TX_SDX2_EN", + 2, + 1 + ], + [ + "DATA_ENABLE_TEST_EN", + 3, + 1 + ], + [ + "DATA_ENABLE", + 4, + 1 + ], + [ + "LCD_EN", + 5, + 1 + ], + [ + "EXT_ADC_START_EN", + 6, + 1 + ], + [ + "INTER_VALID_EN", + 7, + 1 + ] + ] + }, + { + "name": "CLKM_CONF", + "offset": "0xAC", + "reset": "0x00000004", + "fields": [ + [ + "CLKM_DIV_NUM", + 0, + 8 + ], + [ + "CLKM_DIV_B", + 8, + 6 + ], + [ + "CLKM_DIV_A", + 14, + 6 + ], + [ + "CLK_EN", + 20, + 1 + ], + [ + "CLKA_ENA", + 21, + 1 + ] + ] + }, + { + "name": "SAMPLE_RATE_CONF", + "offset": "0xB0", + "reset": "0x00410186", + "fields": [ + [ + "TX_BCK_DIV_NUM", + 0, + 6 + ], + [ + "RX_BCK_DIV_NUM", + 6, + 6 + ], + [ + "TX_BITS_MOD", + 12, + 6 + ], + [ + "RX_BITS_MOD", + 18, + 6 + ] + ] + }, + { + "name": "PDM_CONF", + "offset": "0xB4", + "reset": "0x01550020", + "fields": [ + [ + "TX_PDM_EN", + 0, + 1 + ], + [ + "RX_PDM_EN", + 1, + 1 + ], + [ + "PCM2PDM_CONV_EN", + 2, + 1 + ], + [ + "PDM2PCM_CONV_EN", + 3, + 1 + ], + [ + "TX_PDM_SINC_OSR2", + 4, + 4 + ], + [ + "TX_PDM_PRESCALE", + 8, + 8 + ], + [ + "TX_PDM_HP_IN_SHIFT", + 16, + 2 + ], + [ + "TX_PDM_LP_IN_SHIFT", + 18, + 2 + ], + [ + "TX_PDM_SINC_IN_SHIFT", + 20, + 2 + ], + [ + "TX_PDM_SIGMADELTA_IN_SHIFT", + 22, + 2 + ], + [ + "RX_PDM_SINC_DSR_16_EN", + 24, + 1 + ], + [ + "TX_PDM_HP_BYPASS", + 25, + 1 + ] + ] + }, + { + "name": "PDM_FREQ_CONF", + "offset": "0xB8", + "reset": "0x000F01E0", + "fields": [ + [ + "TX_PDM_FS", + 0, + 10 + ], + [ + "TX_PDM_FP", + 10, + 10 + ] + ] + }, + { + "name": "STATE", + "offset": "0xBC", + "reset": "0x00000007", + "fields": [ + [ + "TX_IDLE", + 0, + 1, + "r" + ], + [ + "TX_FIFO_RESET_BACK", + 1, + 1, + "r" + ], + [ + "RX_FIFO_RESET_BACK", + 2, + 1, + "r" + ] + ] + }, + { + "name": "DATE", + "offset": "0xFC", + "reset": "0x01604201", + "fields": [ + [ + "I2SDATE", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "UART1", + "base": "0x3FF50000", + "interrupts": [ + "UART1" + ], + "derived_from": "UART0" + }, + { + "name": "I2C0", + "base": "0x3FF53000", + "interrupts": [ + "I2C_EXT0" + ], + "registers": [ + { + "name": "SCL_LOW_PERIOD", + "offset": "0x00", + "fields": [ + [ + "SCL_LOW_PERIOD", + 0, + 14 + ] + ] + }, + { + "name": "CTR", + "offset": "0x04", + "reset": "0x00000003", + "fields": [ + [ + "SDA_FORCE_OUT", + 0, + 1 + ], + [ + "SCL_FORCE_OUT", + 1, + 1 + ], + [ + "SAMPLE_SCL_LEVEL", + 2, + 1 + ], + [ + "MS_MODE", + 4, + 1 + ], + [ + "TRANS_START", + 5, + 1 + ], + [ + "TX_LSB_FIRST", + 6, + 1 + ], + [ + "RX_LSB_FIRST", + 7, + 1 + ], + [ + "CLK_EN", + 8, + 1 + ] + ] + }, + { + "name": "SR", + "offset": "0x08", + "fields": [ + [ + "ACK_REC", + 0, + 1, + "r" + ], + [ + "SLAVE_RW", + 1, + 1, + "r" + ], + [ + "TIME_OUT", + 2, + 1, + "r" + ], + [ + "ARB_LOST", + 3, + 1, + "r" + ], + [ + "BUS_BUSY", + 4, + 1, + "r" + ], + [ + "SLAVE_ADDRESSED", + 5, + 1, + "r" + ], + [ + "BYTE_TRANS", + 6, + 1, + "r" + ], + [ + "RXFIFO_CNT", + 8, + 6, + "r" + ], + [ + "TXFIFO_CNT", + 18, + 6, + "r" + ], + [ + "SCL_MAIN_STATE_LAST", + 24, + 3, + "r" + ], + [ + "SCL_STATE_LAST", + 28, + 3, + "r" + ] + ] + }, + { + "name": "TO", + "offset": "0x0C", + "fields": [ + [ + "TIME_OUT", + 0, + 20 + ] + ] + }, + { + "name": "SLAVE_ADDR", + "offset": "0x10", + "fields": [ + [ + "SLAVE_ADDR", + 0, + 15 + ], + [ + "ADDR_10BIT_EN", + 31, + 1 + ] + ] + }, + { + "name": "RXFIFO_ST", + "offset": "0x14", + "fields": [ + [ + "RXFIFO_START_ADDR", + 0, + 5, + "r" + ], + [ + "RXFIFO_END_ADDR", + 5, + 5, + "r" + ], + [ + "TXFIFO_START_ADDR", + 10, + 5, + "r" + ], + [ + "TXFIFO_END_ADDR", + 15, + 5, + "r" + ] + ] + }, + { + "name": "FIFO_CONF", + "offset": "0x18", + "reset": "0x0155408B", + "fields": [ + [ + "RXFIFO_FULL_THRHD", + 0, + 5 + ], + [ + "TXFIFO_EMPTY_THRHD", + 5, + 5 + ], + [ + "NONFIFO_EN", + 10, + 1 + ], + [ + "FIFO_ADDR_CFG_EN", + 11, + 1 + ], + [ + "RX_FIFO_RST", + 12, + 1 + ], + [ + "TX_FIFO_RST", + 13, + 1 + ], + [ + "NONFIFO_RX_THRES", + 14, + 6 + ], + [ + "NONFIFO_TX_THRES", + 20, + 6 + ] + ] + }, + { + "name": "DATA", + "offset": "0x1C", + "fields": [ + [ + "FIFO_RDATA", + 0, + 8, + "r" + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x20", + "fields": [ + [ + "RXFIFO_FULL_INT_RAW", + 0, + 1, + "r" + ], + [ + "TXFIFO_EMPTY_INT_RAW", + 1, + 1, + "r" + ], + [ + "RXFIFO_OVF_INT_RAW", + 2, + 1, + "r" + ], + [ + "END_DETECT_INT_RAW", + 3, + 1, + "r" + ], + [ + "SLAVE_TRAN_COMP_INT_RAW", + 4, + 1, + "r" + ], + [ + "ARBITRATION_LOST_INT_RAW", + 5, + 1, + "r" + ], + [ + "MASTER_TRAN_COMP_INT_RAW", + 6, + 1, + "r" + ], + [ + "TRANS_COMPLETE_INT_RAW", + 7, + 1, + "r" + ], + [ + "TIME_OUT_INT_RAW", + 8, + 1, + "r" + ], + [ + "TRANS_START_INT_RAW", + 9, + 1, + "r" + ], + [ + "ACK_ERR_INT_RAW", + 10, + 1, + "r" + ], + [ + "RX_REC_FULL_INT_RAW", + 11, + 1, + "r" + ], + [ + "TX_SEND_EMPTY_INT_RAW", + 12, + 1, + "r" + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x24", + "fields": [ + [ + "RXFIFO_FULL_INT_CLR", + 0, + 1, + "w" + ], + [ + "TXFIFO_EMPTY_INT_CLR", + 1, + 1, + "w" + ], + [ + "RXFIFO_OVF_INT_CLR", + 2, + 1, + "w" + ], + [ + "END_DETECT_INT_CLR", + 3, + 1, + "w" + ], + [ + "SLAVE_TRAN_COMP_INT_CLR", + 4, + 1, + "w" + ], + [ + "ARBITRATION_LOST_INT_CLR", + 5, + 1, + "w" + ], + [ + "MASTER_TRAN_COMP_INT_CLR", + 6, + 1, + "w" + ], + [ + "TRANS_COMPLETE_INT_CLR", + 7, + 1, + "w" + ], + [ + "TIME_OUT_INT_CLR", + 8, + 1, + "w" + ], + [ + "TRANS_START_INT_CLR", + 9, + 1, + "w" + ], + [ + "ACK_ERR_INT_CLR", + 10, + 1, + "w" + ], + [ + "RX_REC_FULL_INT_CLR", + 11, + 1, + "w" + ], + [ + "TX_SEND_EMPTY_INT_CLR", + 12, + 1, + "w" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x28", + "fields": [ + [ + "RXFIFO_FULL_INT_ENA", + 0, + 1 + ], + [ + "TXFIFO_EMPTY_INT_ENA", + 1, + 1 + ], + [ + "RXFIFO_OVF_INT_ENA", + 2, + 1 + ], + [ + "END_DETECT_INT_ENA", + 3, + 1 + ], + [ + "SLAVE_TRAN_COMP_INT_ENA", + 4, + 1 + ], + [ + "ARBITRATION_LOST_INT_ENA", + 5, + 1 + ], + [ + "MASTER_TRAN_COMP_INT_ENA", + 6, + 1 + ], + [ + "TRANS_COMPLETE_INT_ENA", + 7, + 1 + ], + [ + "TIME_OUT_INT_ENA", + 8, + 1 + ], + [ + "TRANS_START_INT_ENA", + 9, + 1 + ], + [ + "ACK_ERR_INT_ENA", + 10, + 1 + ], + [ + "RX_REC_FULL_INT_ENA", + 11, + 1 + ], + [ + "TX_SEND_EMPTY_INT_ENA", + 12, + 1 + ] + ] + }, + { + "name": "INT_STATUS", + "offset": "0x2C", + "fields": [ + [ + "RXFIFO_FULL_INT_ST", + 0, + 1, + "r" + ], + [ + "TXFIFO_EMPTY_INT_ST", + 1, + 1, + "r" + ], + [ + "RXFIFO_OVF_INT_ST", + 2, + 1, + "r" + ], + [ + "END_DETECT_INT_ST", + 3, + 1, + "r" + ], + [ + "SLAVE_TRAN_COMP_INT_ST", + 4, + 1, + "r" + ], + [ + "ARBITRATION_LOST_INT_ST", + 5, + 1, + "r" + ], + [ + "MASTER_TRAN_COMP_INT_ST", + 6, + 1, + "r" + ], + [ + "TRANS_COMPLETE_INT_ST", + 7, + 1, + "r" + ], + [ + "TIME_OUT_INT_ST", + 8, + 1, + "r" + ], + [ + "TRANS_START_INT_ST", + 9, + 1, + "r" + ], + [ + "ACK_ERR_INT_ST", + 10, + 1, + "r" + ], + [ + "RX_REC_FULL_INT_ST", + 11, + 1, + "r" + ], + [ + "TX_SEND_EMPTY_INT_ST", + 12, + 1, + "r" + ] + ] + }, + { + "name": "SDA_HOLD", + "offset": "0x30", + "fields": [ + [ + "TIME", + 0, + 10 + ] + ] + }, + { + "name": "SDA_SAMPLE", + "offset": "0x34", + "fields": [ + [ + "TIME", + 0, + 10 + ] + ] + }, + { + "name": "SCL_HIGH_PERIOD", + "offset": "0x38", + "fields": [ + [ + "SCL_HIGH_PERIOD", + 0, + 14 + ] + ] + }, + { + "name": "SCL_START_HOLD", + "offset": "0x40", + "reset": "0x00000008", + "fields": [ + [ + "TIME", + 0, + 10 + ] + ] + }, + { + "name": "SCL_RSTART_SETUP", + "offset": "0x44", + "reset": "0x00000008", + "fields": [ + [ + "TIME", + 0, + 10 + ] + ] + }, + { + "name": "SCL_STOP_HOLD", + "offset": "0x48", + "fields": [ + [ + "TIME", + 0, + 14 + ] + ] + }, + { + "name": "SCL_STOP_SETUP", + "offset": "0x4C", + "fields": [ + [ + "TIME", + 0, + 10 + ] + ] + }, + { + "name": "SCL_FILTER_CFG", + "offset": "0x50", + "reset": "0x00000008", + "fields": [ + [ + "SCL_FILTER_THRES", + 0, + 3 + ], + [ + "SCL_FILTER_EN", + 3, + 1 + ] + ] + }, + { + "name": "SDA_FILTER_CFG", + "offset": "0x54", + "reset": "0x00000008", + "fields": [ + [ + "SDA_FILTER_THRES", + 0, + 3 + ], + [ + "SDA_FILTER_EN", + 3, + 1 + ] + ] + }, + { + "name": "COMD0", + "offset": "0x58", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD1", + "offset": "0x5C", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD2", + "offset": "0x60", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD3", + "offset": "0x64", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD4", + "offset": "0x68", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD5", + "offset": "0x6C", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD6", + "offset": "0x70", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD7", + "offset": "0x74", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD8", + "offset": "0x78", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD9", + "offset": "0x7C", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD10", + "offset": "0x80", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD11", + "offset": "0x84", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD12", + "offset": "0x88", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD13", + "offset": "0x8C", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD14", + "offset": "0x90", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "COMD15", + "offset": "0x94", + "fields": [ + [ + "COMMAND", + 0, + 14 + ], + [ + "COMMAND_DONE", + 31, + 1 + ] + ] + }, + { + "name": "DATE", + "offset": "0xF8", + "reset": "0x16042000", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + }, + { + "name": "FIFO_START_ADDR", + "offset": "0x100" + } + ] + }, + { + "name": "UHCI0", + "base": "0x3FF54000", + "interrupts": [ + "UHCI0" + ], + "registers": [ + { + "name": "CONF0", + "offset": "0x00", + "reset": "0x00370100", + "fields": [ + [ + "IN_RST", + 0, + 1 + ], + [ + "OUT_RST", + 1, + 1 + ], + [ + "AHBM_FIFO_RST", + 2, + 1 + ], + [ + "AHBM_RST", + 3, + 1 + ], + [ + "IN_LOOP_TEST", + 4, + 1 + ], + [ + "OUT_LOOP_TEST", + 5, + 1 + ], + [ + "OUT_AUTO_WRBACK", + 6, + 1 + ], + [ + "OUT_NO_RESTART_CLR", + 7, + 1 + ], + [ + "OUT_EOF_MODE", + 8, + 1 + ], + [ + "UART0_CE", + 9, + 1 + ], + [ + "UART1_CE", + 10, + 1 + ], + [ + "UART2_CE", + 11, + 1 + ], + [ + "OUTDSCR_BURST_EN", + 12, + 1 + ], + [ + "INDSCR_BURST_EN", + 13, + 1 + ], + [ + "OUT_DATA_BURST_EN", + 14, + 1 + ], + [ + "MEM_TRANS_EN", + 15, + 1 + ], + [ + "SEPER_EN", + 16, + 1 + ], + [ + "HEAD_EN", + 17, + 1 + ], + [ + "CRC_REC_EN", + 18, + 1 + ], + [ + "UART_IDLE_EOF_EN", + 19, + 1 + ], + [ + "LEN_EOF_EN", + 20, + 1 + ], + [ + "ENCODE_CRC_EN", + 21, + 1 + ], + [ + "CLK_EN", + 22, + 1 + ], + [ + "UART_RX_BRK_EOF_EN", + 23, + 1 + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x04", + "fields": [ + [ + "RX_START_INT_RAW", + 0, + 1, + "r" + ], + [ + "TX_START_INT_RAW", + 1, + 1, + "r" + ], + [ + "RX_HUNG_INT_RAW", + 2, + 1, + "r" + ], + [ + "TX_HUNG_INT_RAW", + 3, + 1, + "r" + ], + [ + "IN_DONE_INT_RAW", + 4, + 1, + "r" + ], + [ + "IN_SUC_EOF_INT_RAW", + 5, + 1, + "r" + ], + [ + "IN_ERR_EOF_INT_RAW", + 6, + 1, + "r" + ], + [ + "OUT_DONE_INT_RAW", + 7, + 1, + "r" + ], + [ + "OUT_EOF_INT_RAW", + 8, + 1, + "r" + ], + [ + "IN_DSCR_ERR_INT_RAW", + 9, + 1, + "r" + ], + [ + "OUT_DSCR_ERR_INT_RAW", + 10, + 1, + "r" + ], + [ + "IN_DSCR_EMPTY_INT_RAW", + 11, + 1, + "r" + ], + [ + "OUTLINK_EOF_ERR_INT_RAW", + 12, + 1, + "r" + ], + [ + "OUT_TOTAL_EOF_INT_RAW", + 13, + 1, + "r" + ], + [ + "SEND_S_Q_INT_RAW", + 14, + 1, + "r" + ], + [ + "SEND_A_Q_INT_RAW", + 15, + 1, + "r" + ], + [ + "DMA_INFIFO_FULL_WM_INT_RAW", + 16, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0x08", + "fields": [ + [ + "RX_START_INT_ST", + 0, + 1, + "r" + ], + [ + "TX_START_INT_ST", + 1, + 1, + "r" + ], + [ + "RX_HUNG_INT_ST", + 2, + 1, + "r" + ], + [ + "TX_HUNG_INT_ST", + 3, + 1, + "r" + ], + [ + "IN_DONE_INT_ST", + 4, + 1, + "r" + ], + [ + "IN_SUC_EOF_INT_ST", + 5, + 1, + "r" + ], + [ + "IN_ERR_EOF_INT_ST", + 6, + 1, + "r" + ], + [ + "OUT_DONE_INT_ST", + 7, + 1, + "r" + ], + [ + "OUT_EOF_INT_ST", + 8, + 1, + "r" + ], + [ + "IN_DSCR_ERR_INT_ST", + 9, + 1, + "r" + ], + [ + "OUT_DSCR_ERR_INT_ST", + 10, + 1, + "r" + ], + [ + "IN_DSCR_EMPTY_INT_ST", + 11, + 1, + "r" + ], + [ + "OUTLINK_EOF_ERR_INT_ST", + 12, + 1, + "r" + ], + [ + "OUT_TOTAL_EOF_INT_ST", + 13, + 1, + "r" + ], + [ + "SEND_S_Q_INT_ST", + 14, + 1, + "r" + ], + [ + "SEND_A_Q_INT_ST", + 15, + 1, + "r" + ], + [ + "DMA_INFIFO_FULL_WM_INT_ST", + 16, + 1, + "r" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x0C", + "fields": [ + [ + "RX_START_INT_ENA", + 0, + 1 + ], + [ + "TX_START_INT_ENA", + 1, + 1 + ], + [ + "RX_HUNG_INT_ENA", + 2, + 1 + ], + [ + "TX_HUNG_INT_ENA", + 3, + 1 + ], + [ + "IN_DONE_INT_ENA", + 4, + 1 + ], + [ + "IN_SUC_EOF_INT_ENA", + 5, + 1 + ], + [ + "IN_ERR_EOF_INT_ENA", + 6, + 1 + ], + [ + "OUT_DONE_INT_ENA", + 7, + 1 + ], + [ + "OUT_EOF_INT_ENA", + 8, + 1 + ], + [ + "IN_DSCR_ERR_INT_ENA", + 9, + 1 + ], + [ + "OUT_DSCR_ERR_INT_ENA", + 10, + 1 + ], + [ + "IN_DSCR_EMPTY_INT_ENA", + 11, + 1 + ], + [ + "OUTLINK_EOF_ERR_INT_ENA", + 12, + 1 + ], + [ + "OUT_TOTAL_EOF_INT_ENA", + 13, + 1 + ], + [ + "SEND_S_Q_INT_ENA", + 14, + 1 + ], + [ + "SEND_A_Q_INT_ENA", + 15, + 1 + ], + [ + "DMA_INFIFO_FULL_WM_INT_ENA", + 16, + 1 + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x10", + "fields": [ + [ + "RX_START_INT_CLR", + 0, + 1, + "w" + ], + [ + "TX_START_INT_CLR", + 1, + 1, + "w" + ], + [ + "RX_HUNG_INT_CLR", + 2, + 1, + "w" + ], + [ + "TX_HUNG_INT_CLR", + 3, + 1, + "w" + ], + [ + "IN_DONE_INT_CLR", + 4, + 1, + "w" + ], + [ + "IN_SUC_EOF_INT_CLR", + 5, + 1, + "w" + ], + [ + "IN_ERR_EOF_INT_CLR", + 6, + 1, + "w" + ], + [ + "OUT_DONE_INT_CLR", + 7, + 1, + "w" + ], + [ + "OUT_EOF_INT_CLR", + 8, + 1, + "w" + ], + [ + "IN_DSCR_ERR_INT_CLR", + 9, + 1, + "w" + ], + [ + "OUT_DSCR_ERR_INT_CLR", + 10, + 1, + "w" + ], + [ + "IN_DSCR_EMPTY_INT_CLR", + 11, + 1, + "w" + ], + [ + "OUTLINK_EOF_ERR_INT_CLR", + 12, + 1, + "w" + ], + [ + "OUT_TOTAL_EOF_INT_CLR", + 13, + 1, + "w" + ], + [ + "SEND_S_Q_INT_CLR", + 14, + 1, + "w" + ], + [ + "SEND_A_Q_INT_CLR", + 15, + 1, + "w" + ], + [ + "DMA_INFIFO_FULL_WM_INT_CLR", + 16, + 1, + "w" + ] + ] + }, + { + "name": "DMA_OUT_STATUS", + "offset": "0x14", + "reset": "0x00000002", + "fields": [ + [ + "OUT_FULL", + 0, + 1, + "r" + ], + [ + "OUT_EMPTY", + 1, + 1, + "r" + ] + ] + }, + { + "name": "DMA_OUT_PUSH", + "offset": "0x18", + "fields": [ + [ + "OUTFIFO_WDATA", + 0, + 9 + ], + [ + "OUTFIFO_PUSH", + 16, + 1 + ] + ] + }, + { + "name": "DMA_IN_STATUS", + "offset": "0x1C", + "reset": "0x00000002", + "fields": [ + [ + "IN_FULL", + 0, + 1, + "r" + ], + [ + "IN_EMPTY", + 1, + 1, + "r" + ], + [ + "RX_ERR_CAUSE", + 4, + 3, + "r" + ] + ] + }, + { + "name": "DMA_IN_POP", + "offset": "0x20", + "fields": [ + [ + "INFIFO_RDATA", + 0, + 12, + "r" + ], + [ + "INFIFO_POP", + 16, + 1 + ] + ] + }, + { + "name": "DMA_OUT_LINK", + "offset": "0x24", + "fields": [ + [ + "OUTLINK_ADDR", + 0, + 20 + ], + [ + "OUTLINK_STOP", + 28, + 1 + ], + [ + "OUTLINK_START", + 29, + 1 + ], + [ + "OUTLINK_RESTART", + 30, + 1 + ], + [ + "OUTLINK_PARK", + 31, + 1, + "r" + ] + ] + }, + { + "name": "DMA_IN_LINK", + "offset": "0x28", + "reset": "0x00100000", + "fields": [ + [ + "INLINK_ADDR", + 0, + 20 + ], + [ + "INLINK_AUTO_RET", + 20, + 1 + ], + [ + "INLINK_STOP", + 28, + 1 + ], + [ + "INLINK_START", + 29, + 1 + ], + [ + "INLINK_RESTART", + 30, + 1 + ], + [ + "INLINK_PARK", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CONF1", + "offset": "0x2C", + "reset": "0x00000033", + "fields": [ + [ + "CHECK_SUM_EN", + 0, + 1 + ], + [ + "CHECK_SEQ_EN", + 1, + 1 + ], + [ + "CRC_DISABLE", + 2, + 1 + ], + [ + "SAVE_HEAD", + 3, + 1 + ], + [ + "TX_CHECK_SUM_RE", + 4, + 1 + ], + [ + "TX_ACK_NUM_RE", + 5, + 1 + ], + [ + "CHECK_OWNER", + 6, + 1 + ], + [ + "WAIT_SW_START", + 7, + 1 + ], + [ + "SW_START", + 8, + 1 + ], + [ + "DMA_INFIFO_FULL_THRS", + 9, + 12 + ] + ] + }, + { + "name": "STATE0", + "offset": "0x30", + "fields": [ + [ + "STATE0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "STATE1", + "offset": "0x34", + "fields": [ + [ + "STATE1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_OUT_EOF_DES_ADDR", + "offset": "0x38", + "fields": [ + [ + "OUT_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_IN_SUC_EOF_DES_ADDR", + "offset": "0x3C", + "fields": [ + [ + "IN_SUC_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_IN_ERR_EOF_DES_ADDR", + "offset": "0x40", + "fields": [ + [ + "IN_ERR_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_OUT_EOF_BFR_DES_ADDR", + "offset": "0x44", + "fields": [ + [ + "OUT_EOF_BFR_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "AHB_TEST", + "offset": "0x48", + "fields": [ + [ + "AHB_TESTMODE", + 0, + 3 + ], + [ + "AHB_TESTADDR", + 4, + 2 + ] + ] + }, + { + "name": "DMA_IN_DSCR", + "offset": "0x4C", + "fields": [ + [ + "INLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_IN_DSCR_BF0", + "offset": "0x50", + "fields": [ + [ + "INLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_IN_DSCR_BF1", + "offset": "0x54", + "fields": [ + [ + "INLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_OUT_DSCR", + "offset": "0x58", + "fields": [ + [ + "OUTLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_OUT_DSCR_BF0", + "offset": "0x5C", + "fields": [ + [ + "OUTLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMA_OUT_DSCR_BF1", + "offset": "0x60", + "fields": [ + [ + "OUTLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "ESCAPE_CONF", + "offset": "0x64", + "reset": "0x00000033", + "fields": [ + [ + "TX_C0_ESC_EN", + 0, + 1 + ], + [ + "TX_DB_ESC_EN", + 1, + 1 + ], + [ + "TX_11_ESC_EN", + 2, + 1 + ], + [ + "TX_13_ESC_EN", + 3, + 1 + ], + [ + "RX_C0_ESC_EN", + 4, + 1 + ], + [ + "RX_DB_ESC_EN", + 5, + 1 + ], + [ + "RX_11_ESC_EN", + 6, + 1 + ], + [ + "RX_13_ESC_EN", + 7, + 1 + ] + ] + }, + { + "name": "HUNG_CONF", + "offset": "0x68", + "reset": "0x00810810", + "fields": [ + [ + "TXFIFO_TIMEOUT", + 0, + 8 + ], + [ + "TXFIFO_TIMEOUT_SHIFT", + 8, + 3 + ], + [ + "TXFIFO_TIMEOUT_ENA", + 11, + 1 + ], + [ + "RXFIFO_TIMEOUT", + 12, + 8 + ], + [ + "RXFIFO_TIMEOUT_SHIFT", + 20, + 3 + ], + [ + "RXFIFO_TIMEOUT_ENA", + 23, + 1 + ] + ] + }, + { + "name": "ACK_NUM", + "offset": "0x6C" + }, + { + "name": "RX_HEAD", + "offset": "0x70", + "fields": [ + [ + "RX_HEAD", + 0, + 32, + "r" + ] + ] + }, + { + "name": "QUICK_SENT", + "offset": "0x74", + "fields": [ + [ + "SINGLE_SEND_NUM", + 0, + 3 + ], + [ + "SINGLE_SEND_EN", + 3, + 1 + ], + [ + "ALWAYS_SEND_NUM", + 4, + 3 + ], + [ + "ALWAYS_SEND_EN", + 7, + 1 + ] + ] + }, + { + "name": "Q0_WORD0", + "offset": "0x78", + "fields": [ + [ + "SEND_Q0_WORD0", + 0, + 32 + ] + ] + }, + { + "name": "Q0_WORD1", + "offset": "0x7C", + "fields": [ + [ + "SEND_Q0_WORD1", + 0, + 32 + ] + ] + }, + { + "name": "Q1_WORD0", + "offset": "0x80", + "fields": [ + [ + "SEND_Q1_WORD0", + 0, + 32 + ] + ] + }, + { + "name": "Q1_WORD1", + "offset": "0x84", + "fields": [ + [ + "SEND_Q1_WORD1", + 0, + 32 + ] + ] + }, + { + "name": "Q2_WORD0", + "offset": "0x88", + "fields": [ + [ + "SEND_Q2_WORD0", + 0, + 32 + ] + ] + }, + { + "name": "Q2_WORD1", + "offset": "0x8C", + "fields": [ + [ + "SEND_Q2_WORD1", + 0, + 32 + ] + ] + }, + { + "name": "Q3_WORD0", + "offset": "0x90", + "fields": [ + [ + "SEND_Q3_WORD0", + 0, + 32 + ] + ] + }, + { + "name": "Q3_WORD1", + "offset": "0x94", + "fields": [ + [ + "SEND_Q3_WORD1", + 0, + 32 + ] + ] + }, + { + "name": "Q4_WORD0", + "offset": "0x98", + "fields": [ + [ + "SEND_Q4_WORD0", + 0, + 32 + ] + ] + }, + { + "name": "Q4_WORD1", + "offset": "0x9C", + "fields": [ + [ + "SEND_Q4_WORD1", + 0, + 32 + ] + ] + }, + { + "name": "Q5_WORD0", + "offset": "0xA0", + "fields": [ + [ + "SEND_Q5_WORD0", + 0, + 32 + ] + ] + }, + { + "name": "Q5_WORD1", + "offset": "0xA4", + "fields": [ + [ + "SEND_Q5_WORD1", + 0, + 32 + ] + ] + }, + { + "name": "Q6_WORD0", + "offset": "0xA8", + "fields": [ + [ + "SEND_Q6_WORD0", + 0, + 32 + ] + ] + }, + { + "name": "Q6_WORD1", + "offset": "0xAC", + "fields": [ + [ + "SEND_Q6_WORD1", + 0, + 32 + ] + ] + }, + { + "name": "ESC_CONF0", + "offset": "0xB0", + "reset": "0x00DCDBC0", + "fields": [ + [ + "SEPER_CHAR", + 0, + 8 + ], + [ + "SEPER_ESC_CHAR0", + 8, + 8 + ], + [ + "SEPER_ESC_CHAR1", + 16, + 8 + ] + ] + }, + { + "name": "ESC_CONF1", + "offset": "0xB4", + "reset": "0x00DDDBDB", + "fields": [ + [ + "ESC_SEQ0", + 0, + 8 + ], + [ + "ESC_SEQ0_CHAR0", + 8, + 8 + ], + [ + "ESC_SEQ0_CHAR1", + 16, + 8 + ] + ] + }, + { + "name": "ESC_CONF2", + "offset": "0xB8", + "reset": "0x00DEDB11", + "fields": [ + [ + "ESC_SEQ1", + 0, + 8 + ], + [ + "ESC_SEQ1_CHAR0", + 8, + 8 + ], + [ + "ESC_SEQ1_CHAR1", + 16, + 8 + ] + ] + }, + { + "name": "ESC_CONF3", + "offset": "0xBC", + "reset": "0x00DFDB13", + "fields": [ + [ + "ESC_SEQ2", + 0, + 8 + ], + [ + "ESC_SEQ2_CHAR0", + 8, + 8 + ], + [ + "ESC_SEQ2_CHAR1", + 16, + 8 + ] + ] + }, + { + "name": "PKT_THRES", + "offset": "0xC0", + "reset": "0x00000080", + "fields": [ + [ + "PKT_THRS", + 0, + 13 + ] + ] + }, + { + "name": "DATE", + "offset": "0xFC", + "reset": "0x16041001", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "SLCHOST", + "base": "0x3FF55000", + "registers": [ + { + "name": "HOST_SLCHOST_FUNC2_0", + "offset": "0x10", + "fields": [ + [ + "HOST_SLC_FUNC2_INT", + 24, + 1 + ] + ] + }, + { + "name": "HOST_SLCHOST_FUNC2_1", + "offset": "0x14", + "fields": [ + [ + "HOST_SLC_FUNC2_INT_EN", + 0, + 1 + ] + ] + }, + { + "name": "HOST_SLCHOST_FUNC2_2", + "offset": "0x20", + "reset": "0x00000001", + "fields": [ + [ + "HOST_SLC_FUNC1_MDSTAT", + 0, + 1 + ] + ] + }, + { + "name": "HOST_SLCHOST_GPIO_STATUS0", + "offset": "0x34", + "fields": [ + [ + "HOST_GPIO_SDIO_INT0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_GPIO_STATUS1", + "offset": "0x38", + "fields": [ + [ + "HOST_GPIO_SDIO_INT1", + 0, + 8, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_GPIO_IN0", + "offset": "0x3C", + "fields": [ + [ + "HOST_GPIO_SDIO_IN0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_GPIO_IN1", + "offset": "0x40", + "fields": [ + [ + "HOST_GPIO_SDIO_IN1", + 0, + 8, + "r" + ] + ] + }, + { + "name": "HOST_SLC0HOST_TOKEN_RDATA", + "offset": "0x44", + "fields": [ + [ + "HOST_SLC0_TOKEN0", + 0, + 12, + "r" + ], + [ + "HOST_SLC0_RX_PF_VALID", + 12, + 1, + "r" + ], + [ + "HOST_HOSTSLC0_TOKEN1", + 16, + 12, + "r" + ], + [ + "HOST_SLC0_RX_PF_EOF", + 28, + 4, + "r" + ] + ] + }, + { + "name": "HOST_SLC0_HOST_PF", + "offset": "0x48", + "fields": [ + [ + "HOST_SLC0_PF_DATA", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HOST_SLC1_HOST_PF", + "offset": "0x4C", + "fields": [ + [ + "HOST_SLC1_PF_DATA", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HOST_SLC0HOST_INT_RAW", + "offset": "0x50", + "fields": [ + [ + "HOST_SLC0_TOHOST_BIT0_INT_RAW", + 0, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT1_INT_RAW", + 1, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT2_INT_RAW", + 2, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT3_INT_RAW", + 3, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT4_INT_RAW", + 4, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT5_INT_RAW", + 5, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT6_INT_RAW", + 6, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT7_INT_RAW", + 7, + 1, + "r" + ], + [ + "HOST_SLC0_TOKEN0_1TO0_INT_RAW", + 8, + 1, + "r" + ], + [ + "HOST_SLC0_TOKEN1_1TO0_INT_RAW", + 9, + 1, + "r" + ], + [ + "HOST_SLC0_TOKEN0_0TO1_INT_RAW", + 10, + 1, + "r" + ], + [ + "HOST_SLC0_TOKEN1_0TO1_INT_RAW", + 11, + 1, + "r" + ], + [ + "HOST_SLC0HOST_RX_SOF_INT_RAW", + 12, + 1, + "r" + ], + [ + "HOST_SLC0HOST_RX_EOF_INT_RAW", + 13, + 1, + "r" + ], + [ + "HOST_SLC0HOST_RX_START_INT_RAW", + 14, + 1, + "r" + ], + [ + "HOST_SLC0HOST_TX_START_INT_RAW", + 15, + 1, + "r" + ], + [ + "HOST_SLC0_RX_UDF_INT_RAW", + 16, + 1, + "r" + ], + [ + "HOST_SLC0_TX_OVF_INT_RAW", + 17, + 1, + "r" + ], + [ + "HOST_SLC0_RX_PF_VALID_INT_RAW", + 18, + 1, + "r" + ], + [ + "HOST_SLC0_EXT_BIT0_INT_RAW", + 19, + 1, + "r" + ], + [ + "HOST_SLC0_EXT_BIT1_INT_RAW", + 20, + 1, + "r" + ], + [ + "HOST_SLC0_EXT_BIT2_INT_RAW", + 21, + 1, + "r" + ], + [ + "HOST_SLC0_EXT_BIT3_INT_RAW", + 22, + 1, + "r" + ], + [ + "HOST_SLC0_RX_NEW_PACKET_INT_RAW", + 23, + 1, + "r" + ], + [ + "HOST_SLC0_HOST_RD_RETRY_INT_RAW", + 24, + 1, + "r" + ], + [ + "HOST_GPIO_SDIO_INT_RAW", + 25, + 1, + "r" + ] + ] + }, + { + "name": "HOST_SLC1HOST_INT_RAW", + "offset": "0x54", + "fields": [ + [ + "HOST_SLC1_TOHOST_BIT0_INT_RAW", + 0, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT1_INT_RAW", + 1, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT2_INT_RAW", + 2, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT3_INT_RAW", + 3, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT4_INT_RAW", + 4, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT5_INT_RAW", + 5, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT6_INT_RAW", + 6, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT7_INT_RAW", + 7, + 1, + "r" + ], + [ + "HOST_SLC1_TOKEN0_1TO0_INT_RAW", + 8, + 1, + "r" + ], + [ + "HOST_SLC1_TOKEN1_1TO0_INT_RAW", + 9, + 1, + "r" + ], + [ + "HOST_SLC1_TOKEN0_0TO1_INT_RAW", + 10, + 1, + "r" + ], + [ + "HOST_SLC1_TOKEN1_0TO1_INT_RAW", + 11, + 1, + "r" + ], + [ + "HOST_SLC1HOST_RX_SOF_INT_RAW", + 12, + 1, + "r" + ], + [ + "HOST_SLC1HOST_RX_EOF_INT_RAW", + 13, + 1, + "r" + ], + [ + "HOST_SLC1HOST_RX_START_INT_RAW", + 14, + 1, + "r" + ], + [ + "HOST_SLC1HOST_TX_START_INT_RAW", + 15, + 1, + "r" + ], + [ + "HOST_SLC1_RX_UDF_INT_RAW", + 16, + 1, + "r" + ], + [ + "HOST_SLC1_TX_OVF_INT_RAW", + 17, + 1, + "r" + ], + [ + "HOST_SLC1_RX_PF_VALID_INT_RAW", + 18, + 1, + "r" + ], + [ + "HOST_SLC1_EXT_BIT0_INT_RAW", + 19, + 1, + "r" + ], + [ + "HOST_SLC1_EXT_BIT1_INT_RAW", + 20, + 1, + "r" + ], + [ + "HOST_SLC1_EXT_BIT2_INT_RAW", + 21, + 1, + "r" + ], + [ + "HOST_SLC1_EXT_BIT3_INT_RAW", + 22, + 1, + "r" + ], + [ + "HOST_SLC1_WIFI_RX_NEW_PACKET_INT_RAW", + 23, + 1, + "r" + ], + [ + "HOST_SLC1_HOST_RD_RETRY_INT_RAW", + 24, + 1, + "r" + ], + [ + "HOST_SLC1_BT_RX_NEW_PACKET_INT_RAW", + 25, + 1, + "r" + ] + ] + }, + { + "name": "HOST_SLC0HOST_INT_ST", + "offset": "0x58", + "fields": [ + [ + "HOST_SLC0_TOHOST_BIT0_INT_ST", + 0, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT1_INT_ST", + 1, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT2_INT_ST", + 2, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT3_INT_ST", + 3, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT4_INT_ST", + 4, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT5_INT_ST", + 5, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT6_INT_ST", + 6, + 1, + "r" + ], + [ + "HOST_SLC0_TOHOST_BIT7_INT_ST", + 7, + 1, + "r" + ], + [ + "HOST_SLC0_TOKEN0_1TO0_INT_ST", + 8, + 1, + "r" + ], + [ + "HOST_SLC0_TOKEN1_1TO0_INT_ST", + 9, + 1, + "r" + ], + [ + "HOST_SLC0_TOKEN0_0TO1_INT_ST", + 10, + 1, + "r" + ], + [ + "HOST_SLC0_TOKEN1_0TO1_INT_ST", + 11, + 1, + "r" + ], + [ + "HOST_SLC0HOST_RX_SOF_INT_ST", + 12, + 1, + "r" + ], + [ + "HOST_SLC0HOST_RX_EOF_INT_ST", + 13, + 1, + "r" + ], + [ + "HOST_SLC0HOST_RX_START_INT_ST", + 14, + 1, + "r" + ], + [ + "HOST_SLC0HOST_TX_START_INT_ST", + 15, + 1, + "r" + ], + [ + "HOST_SLC0_RX_UDF_INT_ST", + 16, + 1, + "r" + ], + [ + "HOST_SLC0_TX_OVF_INT_ST", + 17, + 1, + "r" + ], + [ + "HOST_SLC0_RX_PF_VALID_INT_ST", + 18, + 1, + "r" + ], + [ + "HOST_SLC0_EXT_BIT0_INT_ST", + 19, + 1, + "r" + ], + [ + "HOST_SLC0_EXT_BIT1_INT_ST", + 20, + 1, + "r" + ], + [ + "HOST_SLC0_EXT_BIT2_INT_ST", + 21, + 1, + "r" + ], + [ + "HOST_SLC0_EXT_BIT3_INT_ST", + 22, + 1, + "r" + ], + [ + "HOST_SLC0_RX_NEW_PACKET_INT_ST", + 23, + 1, + "r" + ], + [ + "HOST_SLC0_HOST_RD_RETRY_INT_ST", + 24, + 1, + "r" + ], + [ + "HOST_GPIO_SDIO_INT_ST", + 25, + 1, + "r" + ] + ] + }, + { + "name": "HOST_SLC1HOST_INT_ST", + "offset": "0x5C", + "fields": [ + [ + "HOST_SLC1_TOHOST_BIT0_INT_ST", + 0, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT1_INT_ST", + 1, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT2_INT_ST", + 2, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT3_INT_ST", + 3, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT4_INT_ST", + 4, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT5_INT_ST", + 5, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT6_INT_ST", + 6, + 1, + "r" + ], + [ + "HOST_SLC1_TOHOST_BIT7_INT_ST", + 7, + 1, + "r" + ], + [ + "HOST_SLC1_TOKEN0_1TO0_INT_ST", + 8, + 1, + "r" + ], + [ + "HOST_SLC1_TOKEN1_1TO0_INT_ST", + 9, + 1, + "r" + ], + [ + "HOST_SLC1_TOKEN0_0TO1_INT_ST", + 10, + 1, + "r" + ], + [ + "HOST_SLC1_TOKEN1_0TO1_INT_ST", + 11, + 1, + "r" + ], + [ + "HOST_SLC1HOST_RX_SOF_INT_ST", + 12, + 1, + "r" + ], + [ + "HOST_SLC1HOST_RX_EOF_INT_ST", + 13, + 1, + "r" + ], + [ + "HOST_SLC1HOST_RX_START_INT_ST", + 14, + 1, + "r" + ], + [ + "HOST_SLC1HOST_TX_START_INT_ST", + 15, + 1, + "r" + ], + [ + "HOST_SLC1_RX_UDF_INT_ST", + 16, + 1, + "r" + ], + [ + "HOST_SLC1_TX_OVF_INT_ST", + 17, + 1, + "r" + ], + [ + "HOST_SLC1_RX_PF_VALID_INT_ST", + 18, + 1, + "r" + ], + [ + "HOST_SLC1_EXT_BIT0_INT_ST", + 19, + 1, + "r" + ], + [ + "HOST_SLC1_EXT_BIT1_INT_ST", + 20, + 1, + "r" + ], + [ + "HOST_SLC1_EXT_BIT2_INT_ST", + 21, + 1, + "r" + ], + [ + "HOST_SLC1_EXT_BIT3_INT_ST", + 22, + 1, + "r" + ], + [ + "HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ST", + 23, + 1, + "r" + ], + [ + "HOST_SLC1_HOST_RD_RETRY_INT_ST", + 24, + 1, + "r" + ], + [ + "HOST_SLC1_BT_RX_NEW_PACKET_INT_ST", + 25, + 1, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_PKT_LEN", + "offset": "0x60", + "fields": [ + [ + "HOST_HOSTSLC0_LEN", + 0, + 20, + "r" + ], + [ + "HOST_HOSTSLC0_LEN_CHECK", + 20, + 12, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_STATE_W0", + "offset": "0x64", + "fields": [ + [ + "HOST_SLCHOST_STATE0", + 0, + 8, + "r" + ], + [ + "HOST_SLCHOST_STATE1", + 8, + 8, + "r" + ], + [ + "HOST_SLCHOST_STATE2", + 16, + 8, + "r" + ], + [ + "HOST_SLCHOST_STATE3", + 24, + 8, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_STATE_W1", + "offset": "0x68", + "fields": [ + [ + "HOST_SLCHOST_STATE4", + 0, + 8, + "r" + ], + [ + "HOST_SLCHOST_STATE5", + 8, + 8, + "r" + ], + [ + "HOST_SLCHOST_STATE6", + 16, + 8, + "r" + ], + [ + "HOST_SLCHOST_STATE7", + 24, + 8, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W0", + "offset": "0x6C", + "fields": [ + [ + "HOST_SLCHOST_CONF0", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF1", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF2", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF3", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W1", + "offset": "0x70", + "fields": [ + [ + "HOST_SLCHOST_CONF4", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF5", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF6", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF7", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W2", + "offset": "0x74", + "fields": [ + [ + "HOST_SLCHOST_CONF8", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF9", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF10", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF11", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W3", + "offset": "0x78", + "reset": "0x000000C0", + "fields": [ + [ + "HOST_SLCHOST_CONF12", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF13", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF14", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF15", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W4", + "offset": "0x7C", + "reset": "0x000001FF", + "fields": [ + [ + "HOST_SLCHOST_CONF16", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF17", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF18", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF19", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W5", + "offset": "0x80", + "fields": [ + [ + "HOST_SLCHOST_CONF20", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF21", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF22", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF23", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_WIN_CMD", + "offset": "0x84" + }, + { + "name": "HOST_SLCHOST_CONF_W6", + "offset": "0x88", + "fields": [ + [ + "HOST_SLCHOST_CONF24", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF25", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF26", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF27", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W7", + "offset": "0x8C", + "fields": [ + [ + "HOST_SLCHOST_CONF28", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF29", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF30", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF31", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_PKT_LEN0", + "offset": "0x90", + "fields": [ + [ + "HOST_HOSTSLC0_LEN0", + 0, + 20, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_PKT_LEN1", + "offset": "0x94", + "fields": [ + [ + "HOST_HOSTSLC0_LEN1", + 0, + 20, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_PKT_LEN2", + "offset": "0x98", + "fields": [ + [ + "HOST_HOSTSLC0_LEN2", + 0, + 20, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W8", + "offset": "0x9C", + "fields": [ + [ + "HOST_SLCHOST_CONF32", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF33", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF34", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF35", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W9", + "offset": "0xA0", + "fields": [ + [ + "HOST_SLCHOST_CONF36", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF37", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF38", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF39", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W10", + "offset": "0xA4", + "fields": [ + [ + "HOST_SLCHOST_CONF40", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF41", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF42", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF43", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W11", + "offset": "0xA8", + "fields": [ + [ + "HOST_SLCHOST_CONF44", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF45", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF46", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF47", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W12", + "offset": "0xAC", + "fields": [ + [ + "HOST_SLCHOST_CONF48", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF49", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF50", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF51", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W13", + "offset": "0xB0", + "fields": [ + [ + "HOST_SLCHOST_CONF52", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF53", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF54", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF55", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W14", + "offset": "0xB4", + "fields": [ + [ + "HOST_SLCHOST_CONF56", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF57", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF58", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF59", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF_W15", + "offset": "0xB8", + "fields": [ + [ + "HOST_SLCHOST_CONF60", + 0, + 8 + ], + [ + "HOST_SLCHOST_CONF61", + 8, + 8 + ], + [ + "HOST_SLCHOST_CONF62", + 16, + 8 + ], + [ + "HOST_SLCHOST_CONF63", + 24, + 8 + ] + ] + }, + { + "name": "HOST_SLCHOST_CHECK_SUM0", + "offset": "0xBC", + "fields": [ + [ + "HOST_SLCHOST_CHECK_SUM0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_CHECK_SUM1", + "offset": "0xC0", + "fields": [ + [ + "HOST_SLCHOST_CHECK_SUM1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HOST_SLC1HOST_TOKEN_RDATA", + "offset": "0xC4", + "fields": [ + [ + "HOST_SLC1_TOKEN0", + 0, + 12, + "r" + ], + [ + "HOST_SLC1_RX_PF_VALID", + 12, + 1, + "r" + ], + [ + "HOST_HOSTSLC1_TOKEN1", + 16, + 12, + "r" + ], + [ + "HOST_SLC1_RX_PF_EOF", + 28, + 4, + "r" + ] + ] + }, + { + "name": "HOST_SLC0HOST_TOKEN_WDATA", + "offset": "0xC8", + "fields": [ + [ + "HOST_SLC0HOST_TOKEN0_WD", + 0, + 12 + ], + [ + "HOST_SLC0HOST_TOKEN1_WD", + 16, + 12 + ] + ] + }, + { + "name": "HOST_SLC1HOST_TOKEN_WDATA", + "offset": "0xCC", + "fields": [ + [ + "HOST_SLC1HOST_TOKEN0_WD", + 0, + 12 + ], + [ + "HOST_SLC1HOST_TOKEN1_WD", + 16, + 12 + ] + ] + }, + { + "name": "HOST_SLCHOST_TOKEN_CON", + "offset": "0xD0", + "fields": [ + [ + "HOST_SLC0HOST_TOKEN0_DEC", + 0, + 1, + "w" + ], + [ + "HOST_SLC0HOST_TOKEN1_DEC", + 1, + 1, + "w" + ], + [ + "HOST_SLC0HOST_TOKEN0_WR", + 2, + 1, + "w" + ], + [ + "HOST_SLC0HOST_TOKEN1_WR", + 3, + 1, + "w" + ], + [ + "HOST_SLC1HOST_TOKEN0_DEC", + 4, + 1, + "w" + ], + [ + "HOST_SLC1HOST_TOKEN1_DEC", + 5, + 1, + "w" + ], + [ + "HOST_SLC1HOST_TOKEN0_WR", + 6, + 1, + "w" + ], + [ + "HOST_SLC1HOST_TOKEN1_WR", + 7, + 1, + "w" + ], + [ + "HOST_SLC0HOST_LEN_WR", + 8, + 1, + "w" + ] + ] + }, + { + "name": "HOST_SLC0HOST_INT_CLR", + "offset": "0xD4", + "fields": [ + [ + "HOST_SLC0_TOHOST_BIT0_INT_CLR", + 0, + 1, + "w" + ], + [ + "HOST_SLC0_TOHOST_BIT1_INT_CLR", + 1, + 1, + "w" + ], + [ + "HOST_SLC0_TOHOST_BIT2_INT_CLR", + 2, + 1, + "w" + ], + [ + "HOST_SLC0_TOHOST_BIT3_INT_CLR", + 3, + 1, + "w" + ], + [ + "HOST_SLC0_TOHOST_BIT4_INT_CLR", + 4, + 1, + "w" + ], + [ + "HOST_SLC0_TOHOST_BIT5_INT_CLR", + 5, + 1, + "w" + ], + [ + "HOST_SLC0_TOHOST_BIT6_INT_CLR", + 6, + 1, + "w" + ], + [ + "HOST_SLC0_TOHOST_BIT7_INT_CLR", + 7, + 1, + "w" + ], + [ + "HOST_SLC0_TOKEN0_1TO0_INT_CLR", + 8, + 1, + "w" + ], + [ + "HOST_SLC0_TOKEN1_1TO0_INT_CLR", + 9, + 1, + "w" + ], + [ + "HOST_SLC0_TOKEN0_0TO1_INT_CLR", + 10, + 1, + "w" + ], + [ + "HOST_SLC0_TOKEN1_0TO1_INT_CLR", + 11, + 1, + "w" + ], + [ + "HOST_SLC0HOST_RX_SOF_INT_CLR", + 12, + 1, + "w" + ], + [ + "HOST_SLC0HOST_RX_EOF_INT_CLR", + 13, + 1, + "w" + ], + [ + "HOST_SLC0HOST_RX_START_INT_CLR", + 14, + 1, + "w" + ], + [ + "HOST_SLC0HOST_TX_START_INT_CLR", + 15, + 1, + "w" + ], + [ + "HOST_SLC0_RX_UDF_INT_CLR", + 16, + 1, + "w" + ], + [ + "HOST_SLC0_TX_OVF_INT_CLR", + 17, + 1, + "w" + ], + [ + "HOST_SLC0_RX_PF_VALID_INT_CLR", + 18, + 1, + "w" + ], + [ + "HOST_SLC0_EXT_BIT0_INT_CLR", + 19, + 1, + "w" + ], + [ + "HOST_SLC0_EXT_BIT1_INT_CLR", + 20, + 1, + "w" + ], + [ + "HOST_SLC0_EXT_BIT2_INT_CLR", + 21, + 1, + "w" + ], + [ + "HOST_SLC0_EXT_BIT3_INT_CLR", + 22, + 1, + "w" + ], + [ + "HOST_SLC0_RX_NEW_PACKET_INT_CLR", + 23, + 1, + "w" + ], + [ + "HOST_SLC0_HOST_RD_RETRY_INT_CLR", + 24, + 1, + "w" + ], + [ + "HOST_GPIO_SDIO_INT_CLR", + 25, + 1, + "w" + ] + ] + }, + { + "name": "HOST_SLC1HOST_INT_CLR", + "offset": "0xD8", + "fields": [ + [ + "HOST_SLC1_TOHOST_BIT0_INT_CLR", + 0, + 1, + "w" + ], + [ + "HOST_SLC1_TOHOST_BIT1_INT_CLR", + 1, + 1, + "w" + ], + [ + "HOST_SLC1_TOHOST_BIT2_INT_CLR", + 2, + 1, + "w" + ], + [ + "HOST_SLC1_TOHOST_BIT3_INT_CLR", + 3, + 1, + "w" + ], + [ + "HOST_SLC1_TOHOST_BIT4_INT_CLR", + 4, + 1, + "w" + ], + [ + "HOST_SLC1_TOHOST_BIT5_INT_CLR", + 5, + 1, + "w" + ], + [ + "HOST_SLC1_TOHOST_BIT6_INT_CLR", + 6, + 1, + "w" + ], + [ + "HOST_SLC1_TOHOST_BIT7_INT_CLR", + 7, + 1, + "w" + ], + [ + "HOST_SLC1_TOKEN0_1TO0_INT_CLR", + 8, + 1, + "w" + ], + [ + "HOST_SLC1_TOKEN1_1TO0_INT_CLR", + 9, + 1, + "w" + ], + [ + "HOST_SLC1_TOKEN0_0TO1_INT_CLR", + 10, + 1, + "w" + ], + [ + "HOST_SLC1_TOKEN1_0TO1_INT_CLR", + 11, + 1, + "w" + ], + [ + "HOST_SLC1HOST_RX_SOF_INT_CLR", + 12, + 1, + "w" + ], + [ + "HOST_SLC1HOST_RX_EOF_INT_CLR", + 13, + 1, + "w" + ], + [ + "HOST_SLC1HOST_RX_START_INT_CLR", + 14, + 1, + "w" + ], + [ + "HOST_SLC1HOST_TX_START_INT_CLR", + 15, + 1, + "w" + ], + [ + "HOST_SLC1_RX_UDF_INT_CLR", + 16, + 1, + "w" + ], + [ + "HOST_SLC1_TX_OVF_INT_CLR", + 17, + 1, + "w" + ], + [ + "HOST_SLC1_RX_PF_VALID_INT_CLR", + 18, + 1, + "w" + ], + [ + "HOST_SLC1_EXT_BIT0_INT_CLR", + 19, + 1, + "w" + ], + [ + "HOST_SLC1_EXT_BIT1_INT_CLR", + 20, + 1, + "w" + ], + [ + "HOST_SLC1_EXT_BIT2_INT_CLR", + 21, + 1, + "w" + ], + [ + "HOST_SLC1_EXT_BIT3_INT_CLR", + 22, + 1, + "w" + ], + [ + "HOST_SLC1_WIFI_RX_NEW_PACKET_INT_CLR", + 23, + 1, + "w" + ], + [ + "HOST_SLC1_HOST_RD_RETRY_INT_CLR", + 24, + 1, + "w" + ], + [ + "HOST_SLC1_BT_RX_NEW_PACKET_INT_CLR", + 25, + 1, + "w" + ] + ] + }, + { + "name": "HOST_SLC0HOST_FUNC1_INT_ENA", + "offset": "0xDC", + "fields": [ + [ + "HOST_FN1_SLC0_TOHOST_BIT0_INT_ENA", + 0, + 1 + ], + [ + "HOST_FN1_SLC0_TOHOST_BIT1_INT_ENA", + 1, + 1 + ], + [ + "HOST_FN1_SLC0_TOHOST_BIT2_INT_ENA", + 2, + 1 + ], + [ + "HOST_FN1_SLC0_TOHOST_BIT3_INT_ENA", + 3, + 1 + ], + [ + "HOST_FN1_SLC0_TOHOST_BIT4_INT_ENA", + 4, + 1 + ], + [ + "HOST_FN1_SLC0_TOHOST_BIT5_INT_ENA", + 5, + 1 + ], + [ + "HOST_FN1_SLC0_TOHOST_BIT6_INT_ENA", + 6, + 1 + ], + [ + "HOST_FN1_SLC0_TOHOST_BIT7_INT_ENA", + 7, + 1 + ], + [ + "HOST_FN1_SLC0_TOKEN0_1TO0_INT_ENA", + 8, + 1 + ], + [ + "HOST_FN1_SLC0_TOKEN1_1TO0_INT_ENA", + 9, + 1 + ], + [ + "HOST_FN1_SLC0_TOKEN0_0TO1_INT_ENA", + 10, + 1 + ], + [ + "HOST_FN1_SLC0_TOKEN1_0TO1_INT_ENA", + 11, + 1 + ], + [ + "HOST_FN1_SLC0HOST_RX_SOF_INT_ENA", + 12, + 1 + ], + [ + "HOST_FN1_SLC0HOST_RX_EOF_INT_ENA", + 13, + 1 + ], + [ + "HOST_FN1_SLC0HOST_RX_START_INT_ENA", + 14, + 1 + ], + [ + "HOST_FN1_SLC0HOST_TX_START_INT_ENA", + 15, + 1 + ], + [ + "HOST_FN1_SLC0_RX_UDF_INT_ENA", + 16, + 1 + ], + [ + "HOST_FN1_SLC0_TX_OVF_INT_ENA", + 17, + 1 + ], + [ + "HOST_FN1_SLC0_RX_PF_VALID_INT_ENA", + 18, + 1 + ], + [ + "HOST_FN1_SLC0_EXT_BIT0_INT_ENA", + 19, + 1 + ], + [ + "HOST_FN1_SLC0_EXT_BIT1_INT_ENA", + 20, + 1 + ], + [ + "HOST_FN1_SLC0_EXT_BIT2_INT_ENA", + 21, + 1 + ], + [ + "HOST_FN1_SLC0_EXT_BIT3_INT_ENA", + 22, + 1 + ], + [ + "HOST_FN1_SLC0_RX_NEW_PACKET_INT_ENA", + 23, + 1 + ], + [ + "HOST_FN1_SLC0_HOST_RD_RETRY_INT_ENA", + 24, + 1 + ], + [ + "HOST_FN1_GPIO_SDIO_INT_ENA", + 25, + 1 + ] + ] + }, + { + "name": "HOST_SLC1HOST_FUNC1_INT_ENA", + "offset": "0xE0", + "fields": [ + [ + "HOST_FN1_SLC1_TOHOST_BIT0_INT_ENA", + 0, + 1 + ], + [ + "HOST_FN1_SLC1_TOHOST_BIT1_INT_ENA", + 1, + 1 + ], + [ + "HOST_FN1_SLC1_TOHOST_BIT2_INT_ENA", + 2, + 1 + ], + [ + "HOST_FN1_SLC1_TOHOST_BIT3_INT_ENA", + 3, + 1 + ], + [ + "HOST_FN1_SLC1_TOHOST_BIT4_INT_ENA", + 4, + 1 + ], + [ + "HOST_FN1_SLC1_TOHOST_BIT5_INT_ENA", + 5, + 1 + ], + [ + "HOST_FN1_SLC1_TOHOST_BIT6_INT_ENA", + 6, + 1 + ], + [ + "HOST_FN1_SLC1_TOHOST_BIT7_INT_ENA", + 7, + 1 + ], + [ + "HOST_FN1_SLC1_TOKEN0_1TO0_INT_ENA", + 8, + 1 + ], + [ + "HOST_FN1_SLC1_TOKEN1_1TO0_INT_ENA", + 9, + 1 + ], + [ + "HOST_FN1_SLC1_TOKEN0_0TO1_INT_ENA", + 10, + 1 + ], + [ + "HOST_FN1_SLC1_TOKEN1_0TO1_INT_ENA", + 11, + 1 + ], + [ + "HOST_FN1_SLC1HOST_RX_SOF_INT_ENA", + 12, + 1 + ], + [ + "HOST_FN1_SLC1HOST_RX_EOF_INT_ENA", + 13, + 1 + ], + [ + "HOST_FN1_SLC1HOST_RX_START_INT_ENA", + 14, + 1 + ], + [ + "HOST_FN1_SLC1HOST_TX_START_INT_ENA", + 15, + 1 + ], + [ + "HOST_FN1_SLC1_RX_UDF_INT_ENA", + 16, + 1 + ], + [ + "HOST_FN1_SLC1_TX_OVF_INT_ENA", + 17, + 1 + ], + [ + "HOST_FN1_SLC1_RX_PF_VALID_INT_ENA", + 18, + 1 + ], + [ + "HOST_FN1_SLC1_EXT_BIT0_INT_ENA", + 19, + 1 + ], + [ + "HOST_FN1_SLC1_EXT_BIT1_INT_ENA", + 20, + 1 + ], + [ + "HOST_FN1_SLC1_EXT_BIT2_INT_ENA", + 21, + 1 + ], + [ + "HOST_FN1_SLC1_EXT_BIT3_INT_ENA", + 22, + 1 + ], + [ + "HOST_FN1_SLC1_WIFI_RX_NEW_PACKET_INT_ENA", + 23, + 1 + ], + [ + "HOST_FN1_SLC1_HOST_RD_RETRY_INT_ENA", + 24, + 1 + ], + [ + "HOST_FN1_SLC1_BT_RX_NEW_PACKET_INT_ENA", + 25, + 1 + ] + ] + }, + { + "name": "HOST_SLC0HOST_FUNC2_INT_ENA", + "offset": "0xE4", + "fields": [ + [ + "HOST_FN2_SLC0_TOHOST_BIT0_INT_ENA", + 0, + 1 + ], + [ + "HOST_FN2_SLC0_TOHOST_BIT1_INT_ENA", + 1, + 1 + ], + [ + "HOST_FN2_SLC0_TOHOST_BIT2_INT_ENA", + 2, + 1 + ], + [ + "HOST_FN2_SLC0_TOHOST_BIT3_INT_ENA", + 3, + 1 + ], + [ + "HOST_FN2_SLC0_TOHOST_BIT4_INT_ENA", + 4, + 1 + ], + [ + "HOST_FN2_SLC0_TOHOST_BIT5_INT_ENA", + 5, + 1 + ], + [ + "HOST_FN2_SLC0_TOHOST_BIT6_INT_ENA", + 6, + 1 + ], + [ + "HOST_FN2_SLC0_TOHOST_BIT7_INT_ENA", + 7, + 1 + ], + [ + "HOST_FN2_SLC0_TOKEN0_1TO0_INT_ENA", + 8, + 1 + ], + [ + "HOST_FN2_SLC0_TOKEN1_1TO0_INT_ENA", + 9, + 1 + ], + [ + "HOST_FN2_SLC0_TOKEN0_0TO1_INT_ENA", + 10, + 1 + ], + [ + "HOST_FN2_SLC0_TOKEN1_0TO1_INT_ENA", + 11, + 1 + ], + [ + "HOST_FN2_SLC0HOST_RX_SOF_INT_ENA", + 12, + 1 + ], + [ + "HOST_FN2_SLC0HOST_RX_EOF_INT_ENA", + 13, + 1 + ], + [ + "HOST_FN2_SLC0HOST_RX_START_INT_ENA", + 14, + 1 + ], + [ + "HOST_FN2_SLC0HOST_TX_START_INT_ENA", + 15, + 1 + ], + [ + "HOST_FN2_SLC0_RX_UDF_INT_ENA", + 16, + 1 + ], + [ + "HOST_FN2_SLC0_TX_OVF_INT_ENA", + 17, + 1 + ], + [ + "HOST_FN2_SLC0_RX_PF_VALID_INT_ENA", + 18, + 1 + ], + [ + "HOST_FN2_SLC0_EXT_BIT0_INT_ENA", + 19, + 1 + ], + [ + "HOST_FN2_SLC0_EXT_BIT1_INT_ENA", + 20, + 1 + ], + [ + "HOST_FN2_SLC0_EXT_BIT2_INT_ENA", + 21, + 1 + ], + [ + "HOST_FN2_SLC0_EXT_BIT3_INT_ENA", + 22, + 1 + ], + [ + "HOST_FN2_SLC0_RX_NEW_PACKET_INT_ENA", + 23, + 1 + ], + [ + "HOST_FN2_SLC0_HOST_RD_RETRY_INT_ENA", + 24, + 1 + ], + [ + "HOST_FN2_GPIO_SDIO_INT_ENA", + 25, + 1 + ] + ] + }, + { + "name": "HOST_SLC1HOST_FUNC2_INT_ENA", + "offset": "0xE8", + "fields": [ + [ + "HOST_FN2_SLC1_TOHOST_BIT0_INT_ENA", + 0, + 1 + ], + [ + "HOST_FN2_SLC1_TOHOST_BIT1_INT_ENA", + 1, + 1 + ], + [ + "HOST_FN2_SLC1_TOHOST_BIT2_INT_ENA", + 2, + 1 + ], + [ + "HOST_FN2_SLC1_TOHOST_BIT3_INT_ENA", + 3, + 1 + ], + [ + "HOST_FN2_SLC1_TOHOST_BIT4_INT_ENA", + 4, + 1 + ], + [ + "HOST_FN2_SLC1_TOHOST_BIT5_INT_ENA", + 5, + 1 + ], + [ + "HOST_FN2_SLC1_TOHOST_BIT6_INT_ENA", + 6, + 1 + ], + [ + "HOST_FN2_SLC1_TOHOST_BIT7_INT_ENA", + 7, + 1 + ], + [ + "HOST_FN2_SLC1_TOKEN0_1TO0_INT_ENA", + 8, + 1 + ], + [ + "HOST_FN2_SLC1_TOKEN1_1TO0_INT_ENA", + 9, + 1 + ], + [ + "HOST_FN2_SLC1_TOKEN0_0TO1_INT_ENA", + 10, + 1 + ], + [ + "HOST_FN2_SLC1_TOKEN1_0TO1_INT_ENA", + 11, + 1 + ], + [ + "HOST_FN2_SLC1HOST_RX_SOF_INT_ENA", + 12, + 1 + ], + [ + "HOST_FN2_SLC1HOST_RX_EOF_INT_ENA", + 13, + 1 + ], + [ + "HOST_FN2_SLC1HOST_RX_START_INT_ENA", + 14, + 1 + ], + [ + "HOST_FN2_SLC1HOST_TX_START_INT_ENA", + 15, + 1 + ], + [ + "HOST_FN2_SLC1_RX_UDF_INT_ENA", + 16, + 1 + ], + [ + "HOST_FN2_SLC1_TX_OVF_INT_ENA", + 17, + 1 + ], + [ + "HOST_FN2_SLC1_RX_PF_VALID_INT_ENA", + 18, + 1 + ], + [ + "HOST_FN2_SLC1_EXT_BIT0_INT_ENA", + 19, + 1 + ], + [ + "HOST_FN2_SLC1_EXT_BIT1_INT_ENA", + 20, + 1 + ], + [ + "HOST_FN2_SLC1_EXT_BIT2_INT_ENA", + 21, + 1 + ], + [ + "HOST_FN2_SLC1_EXT_BIT3_INT_ENA", + 22, + 1 + ], + [ + "HOST_FN2_SLC1_WIFI_RX_NEW_PACKET_INT_ENA", + 23, + 1 + ], + [ + "HOST_FN2_SLC1_HOST_RD_RETRY_INT_ENA", + 24, + 1 + ], + [ + "HOST_FN2_SLC1_BT_RX_NEW_PACKET_INT_ENA", + 25, + 1 + ] + ] + }, + { + "name": "HOST_SLC0HOST_INT_ENA", + "offset": "0xEC", + "fields": [ + [ + "HOST_SLC0_TOHOST_BIT0_INT_ENA", + 0, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT1_INT_ENA", + 1, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT2_INT_ENA", + 2, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT3_INT_ENA", + 3, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT4_INT_ENA", + 4, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT5_INT_ENA", + 5, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT6_INT_ENA", + 6, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT7_INT_ENA", + 7, + 1 + ], + [ + "HOST_SLC0_TOKEN0_1TO0_INT_ENA", + 8, + 1 + ], + [ + "HOST_SLC0_TOKEN1_1TO0_INT_ENA", + 9, + 1 + ], + [ + "HOST_SLC0_TOKEN0_0TO1_INT_ENA", + 10, + 1 + ], + [ + "HOST_SLC0_TOKEN1_0TO1_INT_ENA", + 11, + 1 + ], + [ + "HOST_SLC0HOST_RX_SOF_INT_ENA", + 12, + 1 + ], + [ + "HOST_SLC0HOST_RX_EOF_INT_ENA", + 13, + 1 + ], + [ + "HOST_SLC0HOST_RX_START_INT_ENA", + 14, + 1 + ], + [ + "HOST_SLC0HOST_TX_START_INT_ENA", + 15, + 1 + ], + [ + "HOST_SLC0_RX_UDF_INT_ENA", + 16, + 1 + ], + [ + "HOST_SLC0_TX_OVF_INT_ENA", + 17, + 1 + ], + [ + "HOST_SLC0_RX_PF_VALID_INT_ENA", + 18, + 1 + ], + [ + "HOST_SLC0_EXT_BIT0_INT_ENA", + 19, + 1 + ], + [ + "HOST_SLC0_EXT_BIT1_INT_ENA", + 20, + 1 + ], + [ + "HOST_SLC0_EXT_BIT2_INT_ENA", + 21, + 1 + ], + [ + "HOST_SLC0_EXT_BIT3_INT_ENA", + 22, + 1 + ], + [ + "HOST_SLC0_RX_NEW_PACKET_INT_ENA", + 23, + 1 + ], + [ + "HOST_SLC0_HOST_RD_RETRY_INT_ENA", + 24, + 1 + ], + [ + "HOST_GPIO_SDIO_INT_ENA", + 25, + 1 + ] + ] + }, + { + "name": "HOST_SLC1HOST_INT_ENA", + "offset": "0xF0", + "fields": [ + [ + "HOST_SLC1_TOHOST_BIT0_INT_ENA", + 0, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT1_INT_ENA", + 1, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT2_INT_ENA", + 2, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT3_INT_ENA", + 3, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT4_INT_ENA", + 4, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT5_INT_ENA", + 5, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT6_INT_ENA", + 6, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT7_INT_ENA", + 7, + 1 + ], + [ + "HOST_SLC1_TOKEN0_1TO0_INT_ENA", + 8, + 1 + ], + [ + "HOST_SLC1_TOKEN1_1TO0_INT_ENA", + 9, + 1 + ], + [ + "HOST_SLC1_TOKEN0_0TO1_INT_ENA", + 10, + 1 + ], + [ + "HOST_SLC1_TOKEN1_0TO1_INT_ENA", + 11, + 1 + ], + [ + "HOST_SLC1HOST_RX_SOF_INT_ENA", + 12, + 1 + ], + [ + "HOST_SLC1HOST_RX_EOF_INT_ENA", + 13, + 1 + ], + [ + "HOST_SLC1HOST_RX_START_INT_ENA", + 14, + 1 + ], + [ + "HOST_SLC1HOST_TX_START_INT_ENA", + 15, + 1 + ], + [ + "HOST_SLC1_RX_UDF_INT_ENA", + 16, + 1 + ], + [ + "HOST_SLC1_TX_OVF_INT_ENA", + 17, + 1 + ], + [ + "HOST_SLC1_RX_PF_VALID_INT_ENA", + 18, + 1 + ], + [ + "HOST_SLC1_EXT_BIT0_INT_ENA", + 19, + 1 + ], + [ + "HOST_SLC1_EXT_BIT1_INT_ENA", + 20, + 1 + ], + [ + "HOST_SLC1_EXT_BIT2_INT_ENA", + 21, + 1 + ], + [ + "HOST_SLC1_EXT_BIT3_INT_ENA", + 22, + 1 + ], + [ + "HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA", + 23, + 1 + ], + [ + "HOST_SLC1_HOST_RD_RETRY_INT_ENA", + 24, + 1 + ], + [ + "HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA", + 25, + 1 + ] + ] + }, + { + "name": "HOST_SLC0HOST_RX_INFOR", + "offset": "0xF4", + "fields": [ + [ + "HOST_SLC0HOST_RX_INFOR", + 0, + 20 + ] + ] + }, + { + "name": "HOST_SLC1HOST_RX_INFOR", + "offset": "0xF8", + "fields": [ + [ + "HOST_SLC1HOST_RX_INFOR", + 0, + 20 + ] + ] + }, + { + "name": "HOST_SLC0HOST_LEN_WD", + "offset": "0xFC", + "fields": [ + [ + "HOST_SLC0HOST_LEN_WD", + 0, + 32 + ] + ] + }, + { + "name": "HOST_SLC_APBWIN_WDATA", + "offset": "0x100", + "fields": [ + [ + "HOST_SLC_APBWIN_WDATA", + 0, + 32 + ] + ] + }, + { + "name": "HOST_SLC_APBWIN_CONF", + "offset": "0x104", + "fields": [ + [ + "HOST_SLC_APBWIN_ADDR", + 0, + 28 + ], + [ + "HOST_SLC_APBWIN_WR", + 28, + 1 + ], + [ + "HOST_SLC_APBWIN_START", + 29, + 1 + ] + ] + }, + { + "name": "HOST_SLC_APBWIN_RDATA", + "offset": "0x108", + "fields": [ + [ + "HOST_SLC_APBWIN_RDATA", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HOST_SLCHOST_RDCLR0", + "offset": "0x10C", + "reset": "0x0003C044", + "fields": [ + [ + "HOST_SLCHOST_SLC0_BIT7_CLRADDR", + 0, + 9 + ], + [ + "HOST_SLCHOST_SLC0_BIT6_CLRADDR", + 9, + 9 + ] + ] + }, + { + "name": "HOST_SLCHOST_RDCLR1", + "offset": "0x110", + "reset": "0x0003C1E0", + "fields": [ + [ + "HOST_SLCHOST_SLC1_BIT7_CLRADDR", + 0, + 9 + ], + [ + "HOST_SLCHOST_SLC1_BIT6_CLRADDR", + 9, + 9 + ] + ] + }, + { + "name": "HOST_SLC0HOST_INT_ENA1", + "offset": "0x114", + "fields": [ + [ + "HOST_SLC0_TOHOST_BIT0_INT_ENA1", + 0, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT1_INT_ENA1", + 1, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT2_INT_ENA1", + 2, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT3_INT_ENA1", + 3, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT4_INT_ENA1", + 4, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT5_INT_ENA1", + 5, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT6_INT_ENA1", + 6, + 1 + ], + [ + "HOST_SLC0_TOHOST_BIT7_INT_ENA1", + 7, + 1 + ], + [ + "HOST_SLC0_TOKEN0_1TO0_INT_ENA1", + 8, + 1 + ], + [ + "HOST_SLC0_TOKEN1_1TO0_INT_ENA1", + 9, + 1 + ], + [ + "HOST_SLC0_TOKEN0_0TO1_INT_ENA1", + 10, + 1 + ], + [ + "HOST_SLC0_TOKEN1_0TO1_INT_ENA1", + 11, + 1 + ], + [ + "HOST_SLC0HOST_RX_SOF_INT_ENA1", + 12, + 1 + ], + [ + "HOST_SLC0HOST_RX_EOF_INT_ENA1", + 13, + 1 + ], + [ + "HOST_SLC0HOST_RX_START_INT_ENA1", + 14, + 1 + ], + [ + "HOST_SLC0HOST_TX_START_INT_ENA1", + 15, + 1 + ], + [ + "HOST_SLC0_RX_UDF_INT_ENA1", + 16, + 1 + ], + [ + "HOST_SLC0_TX_OVF_INT_ENA1", + 17, + 1 + ], + [ + "HOST_SLC0_RX_PF_VALID_INT_ENA1", + 18, + 1 + ], + [ + "HOST_SLC0_EXT_BIT0_INT_ENA1", + 19, + 1 + ], + [ + "HOST_SLC0_EXT_BIT1_INT_ENA1", + 20, + 1 + ], + [ + "HOST_SLC0_EXT_BIT2_INT_ENA1", + 21, + 1 + ], + [ + "HOST_SLC0_EXT_BIT3_INT_ENA1", + 22, + 1 + ], + [ + "HOST_SLC0_RX_NEW_PACKET_INT_ENA1", + 23, + 1 + ], + [ + "HOST_SLC0_HOST_RD_RETRY_INT_ENA1", + 24, + 1 + ], + [ + "HOST_GPIO_SDIO_INT_ENA1", + 25, + 1 + ] + ] + }, + { + "name": "HOST_SLC1HOST_INT_ENA1", + "offset": "0x118", + "fields": [ + [ + "HOST_SLC1_TOHOST_BIT0_INT_ENA1", + 0, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT1_INT_ENA1", + 1, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT2_INT_ENA1", + 2, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT3_INT_ENA1", + 3, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT4_INT_ENA1", + 4, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT5_INT_ENA1", + 5, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT6_INT_ENA1", + 6, + 1 + ], + [ + "HOST_SLC1_TOHOST_BIT7_INT_ENA1", + 7, + 1 + ], + [ + "HOST_SLC1_TOKEN0_1TO0_INT_ENA1", + 8, + 1 + ], + [ + "HOST_SLC1_TOKEN1_1TO0_INT_ENA1", + 9, + 1 + ], + [ + "HOST_SLC1_TOKEN0_0TO1_INT_ENA1", + 10, + 1 + ], + [ + "HOST_SLC1_TOKEN1_0TO1_INT_ENA1", + 11, + 1 + ], + [ + "HOST_SLC1HOST_RX_SOF_INT_ENA1", + 12, + 1 + ], + [ + "HOST_SLC1HOST_RX_EOF_INT_ENA1", + 13, + 1 + ], + [ + "HOST_SLC1HOST_RX_START_INT_ENA1", + 14, + 1 + ], + [ + "HOST_SLC1HOST_TX_START_INT_ENA1", + 15, + 1 + ], + [ + "HOST_SLC1_RX_UDF_INT_ENA1", + 16, + 1 + ], + [ + "HOST_SLC1_TX_OVF_INT_ENA1", + 17, + 1 + ], + [ + "HOST_SLC1_RX_PF_VALID_INT_ENA1", + 18, + 1 + ], + [ + "HOST_SLC1_EXT_BIT0_INT_ENA1", + 19, + 1 + ], + [ + "HOST_SLC1_EXT_BIT1_INT_ENA1", + 20, + 1 + ], + [ + "HOST_SLC1_EXT_BIT2_INT_ENA1", + 21, + 1 + ], + [ + "HOST_SLC1_EXT_BIT3_INT_ENA1", + 22, + 1 + ], + [ + "HOST_SLC1_WIFI_RX_NEW_PACKET_INT_ENA1", + 23, + 1 + ], + [ + "HOST_SLC1_HOST_RD_RETRY_INT_ENA1", + 24, + 1 + ], + [ + "HOST_SLC1_BT_RX_NEW_PACKET_INT_ENA1", + 25, + 1 + ] + ] + }, + { + "name": "HOST_SLCHOSTDATE", + "offset": "0x178", + "reset": "0x16022500", + "fields": [ + [ + "HOST_SLCHOST_DATE", + 0, + 32 + ] + ] + }, + { + "name": "HOST_SLCHOSTID", + "offset": "0x17C", + "reset": "0x00000600", + "fields": [ + [ + "HOST_SLCHOST_ID", + 0, + 32 + ] + ] + }, + { + "name": "HOST_SLCHOST_CONF", + "offset": "0x1F0", + "fields": [ + [ + "HOST_FRC_SDIO11", + 0, + 5 + ], + [ + "HOST_FRC_SDIO20", + 5, + 5 + ], + [ + "HOST_FRC_NEG_SAMP", + 10, + 5 + ], + [ + "HOST_FRC_POS_SAMP", + 15, + 5 + ], + [ + "HOST_FRC_QUICK_IN", + 20, + 5 + ], + [ + "HOST_SDIO20_INT_DELAY", + 25, + 1 + ], + [ + "HOST_SDIO_PAD_PULLUP", + 26, + 1 + ], + [ + "HOST_HSPEED_CON_EN", + 27, + 1 + ] + ] + }, + { + "name": "HOST_SLCHOST_INF_ST", + "offset": "0x1F4", + "fields": [ + [ + "HOST_SDIO20_MODE", + 0, + 5, + "r" + ], + [ + "HOST_SDIO_NEG_SAMP", + 5, + 5, + "r" + ], + [ + "HOST_SDIO_QUICK_IN", + 10, + 5, + "r" + ] + ] + } + ] + }, + { + "name": "RMT", + "base": "0x3FF56000", + "interrupts": [ + "RMT" + ], + "registers": [ + { + "name": "CH0DATA", + "offset": "0x00" + }, + { + "name": "CH1DATA", + "offset": "0x04" + }, + { + "name": "CH2DATA", + "offset": "0x08" + }, + { + "name": "CH3DATA", + "offset": "0x0C" + }, + { + "name": "CH4DATA", + "offset": "0x10" + }, + { + "name": "CH5DATA", + "offset": "0x14" + }, + { + "name": "CH6DATA", + "offset": "0x18" + }, + { + "name": "CH7DATA", + "offset": "0x1C" + }, + { + "name": "CH0CONF0", + "offset": "0x20", + "reset": "0x31100002", + "fields": [ + [ + "DIV_CNT", + 0, + 8 + ], + [ + "IDLE_THRES", + 8, + 16 + ], + [ + "MEM_SIZE", + 24, + 4 + ], + [ + "CARRIER_EN", + 28, + 1 + ], + [ + "CARRIER_OUT_LV", + 29, + 1 + ], + [ + "MEM_PD", + 30, + 1 + ], + [ + "CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "CH0CONF1", + "offset": "0x24", + "reset": "0x00000F20", + "fields": [ + [ + "TX_START", + 0, + 1 + ], + [ + "RX_EN", + 1, + 1 + ], + [ + "MEM_WR_RST", + 2, + 1 + ], + [ + "MEM_RD_RST", + 3, + 1 + ], + [ + "APB_MEM_RST", + 4, + 1 + ], + [ + "MEM_OWNER", + 5, + 1 + ], + [ + "TX_CONTI_MODE", + 6, + 1 + ], + [ + "RX_FILTER_EN", + 7, + 1 + ], + [ + "RX_FILTER_THRES", + 8, + 8 + ], + [ + "REF_CNT_RST", + 16, + 1 + ], + [ + "REF_ALWAYS_ON", + 17, + 1 + ], + [ + "IDLE_OUT_LV", + 18, + 1 + ], + [ + "IDLE_OUT_EN", + 19, + 1 + ] + ] + }, + { + "name": "CH1CONF0", + "offset": "0x28", + "reset": "0x31100002", + "fields": [ + [ + "DIV_CNT", + 0, + 8 + ], + [ + "IDLE_THRES", + 8, + 16 + ], + [ + "MEM_SIZE", + 24, + 4 + ], + [ + "CARRIER_EN", + 28, + 1 + ], + [ + "CARRIER_OUT_LV", + 29, + 1 + ], + [ + "MEM_PD", + 30, + 1 + ], + [ + "CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "CH1CONF1", + "offset": "0x2C", + "reset": "0x00000F20", + "fields": [ + [ + "TX_START", + 0, + 1 + ], + [ + "RX_EN", + 1, + 1 + ], + [ + "MEM_WR_RST", + 2, + 1 + ], + [ + "MEM_RD_RST", + 3, + 1 + ], + [ + "APB_MEM_RST", + 4, + 1 + ], + [ + "MEM_OWNER", + 5, + 1 + ], + [ + "TX_CONTI_MODE", + 6, + 1 + ], + [ + "RX_FILTER_EN", + 7, + 1 + ], + [ + "RX_FILTER_THRES", + 8, + 8 + ], + [ + "REF_CNT_RST", + 16, + 1 + ], + [ + "REF_ALWAYS_ON", + 17, + 1 + ], + [ + "IDLE_OUT_LV", + 18, + 1 + ], + [ + "IDLE_OUT_EN", + 19, + 1 + ] + ] + }, + { + "name": "CH2CONF0", + "offset": "0x30", + "reset": "0x31100002", + "fields": [ + [ + "DIV_CNT", + 0, + 8 + ], + [ + "IDLE_THRES", + 8, + 16 + ], + [ + "MEM_SIZE", + 24, + 4 + ], + [ + "CARRIER_EN", + 28, + 1 + ], + [ + "CARRIER_OUT_LV", + 29, + 1 + ], + [ + "MEM_PD", + 30, + 1 + ], + [ + "CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "CH2CONF1", + "offset": "0x34", + "reset": "0x00000F20", + "fields": [ + [ + "TX_START", + 0, + 1 + ], + [ + "RX_EN", + 1, + 1 + ], + [ + "MEM_WR_RST", + 2, + 1 + ], + [ + "MEM_RD_RST", + 3, + 1 + ], + [ + "APB_MEM_RST", + 4, + 1 + ], + [ + "MEM_OWNER", + 5, + 1 + ], + [ + "TX_CONTI_MODE", + 6, + 1 + ], + [ + "RX_FILTER_EN", + 7, + 1 + ], + [ + "RX_FILTER_THRES", + 8, + 8 + ], + [ + "REF_CNT_RST", + 16, + 1 + ], + [ + "REF_ALWAYS_ON", + 17, + 1 + ], + [ + "IDLE_OUT_LV", + 18, + 1 + ], + [ + "IDLE_OUT_EN", + 19, + 1 + ] + ] + }, + { + "name": "CH3CONF0", + "offset": "0x38", + "reset": "0x31100002", + "fields": [ + [ + "DIV_CNT", + 0, + 8 + ], + [ + "IDLE_THRES", + 8, + 16 + ], + [ + "MEM_SIZE", + 24, + 4 + ], + [ + "CARRIER_EN", + 28, + 1 + ], + [ + "CARRIER_OUT_LV", + 29, + 1 + ], + [ + "MEM_PD", + 30, + 1 + ], + [ + "CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "CH3CONF1", + "offset": "0x3C", + "reset": "0x00000F20", + "fields": [ + [ + "TX_START", + 0, + 1 + ], + [ + "RX_EN", + 1, + 1 + ], + [ + "MEM_WR_RST", + 2, + 1 + ], + [ + "MEM_RD_RST", + 3, + 1 + ], + [ + "APB_MEM_RST", + 4, + 1 + ], + [ + "MEM_OWNER", + 5, + 1 + ], + [ + "TX_CONTI_MODE", + 6, + 1 + ], + [ + "RX_FILTER_EN", + 7, + 1 + ], + [ + "RX_FILTER_THRES", + 8, + 8 + ], + [ + "REF_CNT_RST", + 16, + 1 + ], + [ + "REF_ALWAYS_ON", + 17, + 1 + ], + [ + "IDLE_OUT_LV", + 18, + 1 + ], + [ + "IDLE_OUT_EN", + 19, + 1 + ] + ] + }, + { + "name": "CH4CONF0", + "offset": "0x40", + "reset": "0x31100002", + "fields": [ + [ + "DIV_CNT", + 0, + 8 + ], + [ + "IDLE_THRES", + 8, + 16 + ], + [ + "MEM_SIZE", + 24, + 4 + ], + [ + "CARRIER_EN", + 28, + 1 + ], + [ + "CARRIER_OUT_LV", + 29, + 1 + ], + [ + "MEM_PD", + 30, + 1 + ], + [ + "CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "CH4CONF1", + "offset": "0x44", + "reset": "0x00000F20", + "fields": [ + [ + "TX_START", + 0, + 1 + ], + [ + "RX_EN", + 1, + 1 + ], + [ + "MEM_WR_RST", + 2, + 1 + ], + [ + "MEM_RD_RST", + 3, + 1 + ], + [ + "APB_MEM_RST", + 4, + 1 + ], + [ + "MEM_OWNER", + 5, + 1 + ], + [ + "TX_CONTI_MODE", + 6, + 1 + ], + [ + "RX_FILTER_EN", + 7, + 1 + ], + [ + "RX_FILTER_THRES", + 8, + 8 + ], + [ + "REF_CNT_RST", + 16, + 1 + ], + [ + "REF_ALWAYS_ON", + 17, + 1 + ], + [ + "IDLE_OUT_LV", + 18, + 1 + ], + [ + "IDLE_OUT_EN", + 19, + 1 + ] + ] + }, + { + "name": "CH5CONF0", + "offset": "0x48", + "reset": "0x31100002", + "fields": [ + [ + "DIV_CNT", + 0, + 8 + ], + [ + "IDLE_THRES", + 8, + 16 + ], + [ + "MEM_SIZE", + 24, + 4 + ], + [ + "CARRIER_EN", + 28, + 1 + ], + [ + "CARRIER_OUT_LV", + 29, + 1 + ], + [ + "MEM_PD", + 30, + 1 + ], + [ + "CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "CH5CONF1", + "offset": "0x4C", + "reset": "0x00000F20", + "fields": [ + [ + "TX_START", + 0, + 1 + ], + [ + "RX_EN", + 1, + 1 + ], + [ + "MEM_WR_RST", + 2, + 1 + ], + [ + "MEM_RD_RST", + 3, + 1 + ], + [ + "APB_MEM_RST", + 4, + 1 + ], + [ + "MEM_OWNER", + 5, + 1 + ], + [ + "TX_CONTI_MODE", + 6, + 1 + ], + [ + "RX_FILTER_EN", + 7, + 1 + ], + [ + "RX_FILTER_THRES", + 8, + 8 + ], + [ + "REF_CNT_RST", + 16, + 1 + ], + [ + "REF_ALWAYS_ON", + 17, + 1 + ], + [ + "IDLE_OUT_LV", + 18, + 1 + ], + [ + "IDLE_OUT_EN", + 19, + 1 + ] + ] + }, + { + "name": "CH6CONF0", + "offset": "0x50", + "reset": "0x31100002", + "fields": [ + [ + "DIV_CNT", + 0, + 8 + ], + [ + "IDLE_THRES", + 8, + 16 + ], + [ + "MEM_SIZE", + 24, + 4 + ], + [ + "CARRIER_EN", + 28, + 1 + ], + [ + "CARRIER_OUT_LV", + 29, + 1 + ], + [ + "MEM_PD", + 30, + 1 + ], + [ + "CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "CH6CONF1", + "offset": "0x54", + "reset": "0x00000F20", + "fields": [ + [ + "TX_START", + 0, + 1 + ], + [ + "RX_EN", + 1, + 1 + ], + [ + "MEM_WR_RST", + 2, + 1 + ], + [ + "MEM_RD_RST", + 3, + 1 + ], + [ + "APB_MEM_RST", + 4, + 1 + ], + [ + "MEM_OWNER", + 5, + 1 + ], + [ + "TX_CONTI_MODE", + 6, + 1 + ], + [ + "RX_FILTER_EN", + 7, + 1 + ], + [ + "RX_FILTER_THRES", + 8, + 8 + ], + [ + "REF_CNT_RST", + 16, + 1 + ], + [ + "REF_ALWAYS_ON", + 17, + 1 + ], + [ + "IDLE_OUT_LV", + 18, + 1 + ], + [ + "IDLE_OUT_EN", + 19, + 1 + ] + ] + }, + { + "name": "CH7CONF0", + "offset": "0x58", + "reset": "0x31100002", + "fields": [ + [ + "DIV_CNT", + 0, + 8 + ], + [ + "IDLE_THRES", + 8, + 16 + ], + [ + "MEM_SIZE", + 24, + 4 + ], + [ + "CARRIER_EN", + 28, + 1 + ], + [ + "CARRIER_OUT_LV", + 29, + 1 + ], + [ + "MEM_PD", + 30, + 1 + ], + [ + "CLK_EN", + 31, + 1 + ] + ] + }, + { + "name": "CH7CONF1", + "offset": "0x5C", + "reset": "0x00000F20", + "fields": [ + [ + "TX_START", + 0, + 1 + ], + [ + "RX_EN", + 1, + 1 + ], + [ + "MEM_WR_RST", + 2, + 1 + ], + [ + "MEM_RD_RST", + 3, + 1 + ], + [ + "APB_MEM_RST", + 4, + 1 + ], + [ + "MEM_OWNER", + 5, + 1 + ], + [ + "TX_CONTI_MODE", + 6, + 1 + ], + [ + "RX_FILTER_EN", + 7, + 1 + ], + [ + "RX_FILTER_THRES", + 8, + 8 + ], + [ + "REF_CNT_RST", + 16, + 1 + ], + [ + "REF_ALWAYS_ON", + 17, + 1 + ], + [ + "IDLE_OUT_LV", + 18, + 1 + ], + [ + "IDLE_OUT_EN", + 19, + 1 + ] + ] + }, + { + "name": "CH0STATUS", + "offset": "0x60", + "fields": [ + [ + "MEM_WADDR_EX", + 0, + 10, + "r" + ], + [ + "MEM_RADDR_EX", + 12, + 10, + "r" + ], + [ + "STATE", + 24, + 3, + "r" + ], + [ + "MEM_OWNER_ERR", + 27, + 1, + "r" + ], + [ + "MEM_FULL", + 28, + 1, + "r" + ], + [ + "MEM_EMPTY", + 29, + 1, + "r" + ], + [ + "APB_MEM_WR_ERR", + 30, + 1, + "r" + ], + [ + "APB_MEM_RD_ERR", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CH1STATUS", + "offset": "0x64", + "fields": [ + [ + "MEM_WADDR_EX", + 0, + 10, + "r" + ], + [ + "MEM_RADDR_EX", + 12, + 10, + "r" + ], + [ + "STATE", + 24, + 3, + "r" + ], + [ + "MEM_OWNER_ERR", + 27, + 1, + "r" + ], + [ + "MEM_FULL", + 28, + 1, + "r" + ], + [ + "MEM_EMPTY", + 29, + 1, + "r" + ], + [ + "APB_MEM_WR_ERR", + 30, + 1, + "r" + ], + [ + "APB_MEM_RD_ERR", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CH2STATUS", + "offset": "0x68", + "fields": [ + [ + "MEM_WADDR_EX", + 0, + 10, + "r" + ], + [ + "MEM_RADDR_EX", + 12, + 10, + "r" + ], + [ + "STATE", + 24, + 3, + "r" + ], + [ + "MEM_OWNER_ERR", + 27, + 1, + "r" + ], + [ + "MEM_FULL", + 28, + 1, + "r" + ], + [ + "MEM_EMPTY", + 29, + 1, + "r" + ], + [ + "APB_MEM_WR_ERR", + 30, + 1, + "r" + ], + [ + "APB_MEM_RD_ERR", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CH3STATUS", + "offset": "0x6C", + "fields": [ + [ + "MEM_WADDR_EX", + 0, + 10, + "r" + ], + [ + "MEM_RADDR_EX", + 12, + 10, + "r" + ], + [ + "STATE", + 24, + 3, + "r" + ], + [ + "MEM_OWNER_ERR", + 27, + 1, + "r" + ], + [ + "MEM_FULL", + 28, + 1, + "r" + ], + [ + "MEM_EMPTY", + 29, + 1, + "r" + ], + [ + "APB_MEM_WR_ERR", + 30, + 1, + "r" + ], + [ + "APB_MEM_RD_ERR", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CH4STATUS", + "offset": "0x70", + "fields": [ + [ + "MEM_WADDR_EX", + 0, + 10, + "r" + ], + [ + "MEM_RADDR_EX", + 12, + 10, + "r" + ], + [ + "STATE", + 24, + 3, + "r" + ], + [ + "MEM_OWNER_ERR", + 27, + 1, + "r" + ], + [ + "MEM_FULL", + 28, + 1, + "r" + ], + [ + "MEM_EMPTY", + 29, + 1, + "r" + ], + [ + "APB_MEM_WR_ERR", + 30, + 1, + "r" + ], + [ + "APB_MEM_RD_ERR", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CH5STATUS", + "offset": "0x74", + "fields": [ + [ + "MEM_WADDR_EX", + 0, + 10, + "r" + ], + [ + "MEM_RADDR_EX", + 12, + 10, + "r" + ], + [ + "STATE", + 24, + 3, + "r" + ], + [ + "MEM_OWNER_ERR", + 27, + 1, + "r" + ], + [ + "MEM_FULL", + 28, + 1, + "r" + ], + [ + "MEM_EMPTY", + 29, + 1, + "r" + ], + [ + "APB_MEM_WR_ERR", + 30, + 1, + "r" + ], + [ + "APB_MEM_RD_ERR", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CH6STATUS", + "offset": "0x78", + "fields": [ + [ + "MEM_WADDR_EX", + 0, + 10, + "r" + ], + [ + "MEM_RADDR_EX", + 12, + 10, + "r" + ], + [ + "STATE", + 24, + 3, + "r" + ], + [ + "MEM_OWNER_ERR", + 27, + 1, + "r" + ], + [ + "MEM_FULL", + 28, + 1, + "r" + ], + [ + "MEM_EMPTY", + 29, + 1, + "r" + ], + [ + "APB_MEM_WR_ERR", + 30, + 1, + "r" + ], + [ + "APB_MEM_RD_ERR", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CH7STATUS", + "offset": "0x7C", + "fields": [ + [ + "MEM_WADDR_EX", + 0, + 10, + "r" + ], + [ + "MEM_RADDR_EX", + 12, + 10, + "r" + ], + [ + "STATE", + 24, + 3, + "r" + ], + [ + "MEM_OWNER_ERR", + 27, + 1, + "r" + ], + [ + "MEM_FULL", + 28, + 1, + "r" + ], + [ + "MEM_EMPTY", + 29, + 1, + "r" + ], + [ + "APB_MEM_WR_ERR", + 30, + 1, + "r" + ], + [ + "APB_MEM_RD_ERR", + 31, + 1, + "r" + ] + ] + }, + { + "name": "CH0ADDR", + "offset": "0x80", + "fields": [ + [ + "APB_MEM_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CH1ADDR", + "offset": "0x84", + "fields": [ + [ + "APB_MEM_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CH2ADDR", + "offset": "0x88", + "fields": [ + [ + "APB_MEM_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CH3ADDR", + "offset": "0x8C", + "fields": [ + [ + "APB_MEM_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CH4ADDR", + "offset": "0x90", + "fields": [ + [ + "APB_MEM_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CH5ADDR", + "offset": "0x94", + "fields": [ + [ + "APB_MEM_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CH6ADDR", + "offset": "0x98", + "fields": [ + [ + "APB_MEM_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CH7ADDR", + "offset": "0x9C", + "fields": [ + [ + "APB_MEM_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0xA0", + "fields": [ + [ + "CH0_TX_END", + 0, + 1, + "r" + ], + [ + "CH1_TX_END", + 3, + 1, + "r" + ], + [ + "CH2_TX_END", + 6, + 1, + "r" + ], + [ + "CH3_TX_END", + 9, + 1, + "r" + ], + [ + "CH4_TX_END", + 12, + 1, + "r" + ], + [ + "CH5_TX_END", + 15, + 1, + "r" + ], + [ + "CH6_TX_END", + 18, + 1, + "r" + ], + [ + "CH7_TX_END", + 21, + 1, + "r" + ], + [ + "CH0_RX_END", + 1, + 1, + "r" + ], + [ + "CH1_RX_END", + 4, + 1, + "r" + ], + [ + "CH2_RX_END", + 7, + 1, + "r" + ], + [ + "CH3_RX_END", + 10, + 1, + "r" + ], + [ + "CH4_RX_END", + 13, + 1, + "r" + ], + [ + "CH5_RX_END", + 16, + 1, + "r" + ], + [ + "CH6_RX_END", + 19, + 1, + "r" + ], + [ + "CH7_RX_END", + 22, + 1, + "r" + ], + [ + "CH0_ERR", + 2, + 1, + "r" + ], + [ + "CH1_ERR", + 5, + 1, + "r" + ], + [ + "CH2_ERR", + 8, + 1, + "r" + ], + [ + "CH3_ERR", + 11, + 1, + "r" + ], + [ + "CH4_ERR", + 14, + 1, + "r" + ], + [ + "CH5_ERR", + 17, + 1, + "r" + ], + [ + "CH6_ERR", + 20, + 1, + "r" + ], + [ + "CH7_ERR", + 23, + 1, + "r" + ], + [ + "CH0_TX_THR_EVENT", + 24, + 1, + "r" + ], + [ + "CH1_TX_THR_EVENT", + 25, + 1, + "r" + ], + [ + "CH2_TX_THR_EVENT", + 26, + 1, + "r" + ], + [ + "CH3_TX_THR_EVENT", + 27, + 1, + "r" + ], + [ + "CH4_TX_THR_EVENT", + 28, + 1, + "r" + ], + [ + "CH5_TX_THR_EVENT", + 29, + 1, + "r" + ], + [ + "CH6_TX_THR_EVENT", + 30, + 1, + "r" + ], + [ + "CH7_TX_THR_EVENT", + 31, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0xA4", + "fields": [ + [ + "CH0_TX_END", + 0, + 1, + "r" + ], + [ + "CH1_TX_END", + 3, + 1, + "r" + ], + [ + "CH2_TX_END", + 6, + 1, + "r" + ], + [ + "CH3_TX_END", + 9, + 1, + "r" + ], + [ + "CH4_TX_END", + 12, + 1, + "r" + ], + [ + "CH5_TX_END", + 15, + 1, + "r" + ], + [ + "CH6_TX_END", + 18, + 1, + "r" + ], + [ + "CH7_TX_END", + 21, + 1, + "r" + ], + [ + "CH0_RX_END", + 1, + 1, + "r" + ], + [ + "CH1_RX_END", + 4, + 1, + "r" + ], + [ + "CH2_RX_END", + 7, + 1, + "r" + ], + [ + "CH3_RX_END", + 10, + 1, + "r" + ], + [ + "CH4_RX_END", + 13, + 1, + "r" + ], + [ + "CH5_RX_END", + 16, + 1, + "r" + ], + [ + "CH6_RX_END", + 19, + 1, + "r" + ], + [ + "CH7_RX_END", + 22, + 1, + "r" + ], + [ + "CH0_ERR", + 2, + 1, + "r" + ], + [ + "CH1_ERR", + 5, + 1, + "r" + ], + [ + "CH2_ERR", + 8, + 1, + "r" + ], + [ + "CH3_ERR", + 11, + 1, + "r" + ], + [ + "CH4_ERR", + 14, + 1, + "r" + ], + [ + "CH5_ERR", + 17, + 1, + "r" + ], + [ + "CH6_ERR", + 20, + 1, + "r" + ], + [ + "CH7_ERR", + 23, + 1, + "r" + ], + [ + "CH0_TX_THR_EVENT", + 24, + 1, + "r" + ], + [ + "CH1_TX_THR_EVENT", + 25, + 1, + "r" + ], + [ + "CH2_TX_THR_EVENT", + 26, + 1, + "r" + ], + [ + "CH3_TX_THR_EVENT", + 27, + 1, + "r" + ], + [ + "CH4_TX_THR_EVENT", + 28, + 1, + "r" + ], + [ + "CH5_TX_THR_EVENT", + 29, + 1, + "r" + ], + [ + "CH6_TX_THR_EVENT", + 30, + 1, + "r" + ], + [ + "CH7_TX_THR_EVENT", + 31, + 1, + "r" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0xA8", + "fields": [ + [ + "CH0_TX_END", + 0, + 1 + ], + [ + "CH1_TX_END", + 3, + 1 + ], + [ + "CH2_TX_END", + 6, + 1 + ], + [ + "CH3_TX_END", + 9, + 1 + ], + [ + "CH4_TX_END", + 12, + 1 + ], + [ + "CH5_TX_END", + 15, + 1 + ], + [ + "CH6_TX_END", + 18, + 1 + ], + [ + "CH7_TX_END", + 21, + 1 + ], + [ + "CH0_RX_END", + 1, + 1 + ], + [ + "CH1_RX_END", + 4, + 1 + ], + [ + "CH2_RX_END", + 7, + 1 + ], + [ + "CH3_RX_END", + 10, + 1 + ], + [ + "CH4_RX_END", + 13, + 1 + ], + [ + "CH5_RX_END", + 16, + 1 + ], + [ + "CH6_RX_END", + 19, + 1 + ], + [ + "CH7_RX_END", + 22, + 1 + ], + [ + "CH0_ERR", + 2, + 1 + ], + [ + "CH1_ERR", + 5, + 1 + ], + [ + "CH2_ERR", + 8, + 1 + ], + [ + "CH3_ERR", + 11, + 1 + ], + [ + "CH4_ERR", + 14, + 1 + ], + [ + "CH5_ERR", + 17, + 1 + ], + [ + "CH6_ERR", + 20, + 1 + ], + [ + "CH7_ERR", + 23, + 1 + ], + [ + "CH0_TX_THR_EVENT", + 24, + 1 + ], + [ + "CH1_TX_THR_EVENT", + 25, + 1 + ], + [ + "CH2_TX_THR_EVENT", + 26, + 1 + ], + [ + "CH3_TX_THR_EVENT", + 27, + 1 + ], + [ + "CH4_TX_THR_EVENT", + 28, + 1 + ], + [ + "CH5_TX_THR_EVENT", + 29, + 1 + ], + [ + "CH6_TX_THR_EVENT", + 30, + 1 + ], + [ + "CH7_TX_THR_EVENT", + 31, + 1 + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0xAC", + "fields": [ + [ + "CH0_TX_END", + 0, + 1, + "w" + ], + [ + "CH1_TX_END", + 3, + 1, + "w" + ], + [ + "CH2_TX_END", + 6, + 1, + "w" + ], + [ + "CH3_TX_END", + 9, + 1, + "w" + ], + [ + "CH4_TX_END", + 12, + 1, + "w" + ], + [ + "CH5_TX_END", + 15, + 1, + "w" + ], + [ + "CH6_TX_END", + 18, + 1, + "w" + ], + [ + "CH7_TX_END", + 21, + 1, + "w" + ], + [ + "CH0_RX_END", + 1, + 1, + "w" + ], + [ + "CH1_RX_END", + 4, + 1, + "w" + ], + [ + "CH2_RX_END", + 7, + 1, + "w" + ], + [ + "CH3_RX_END", + 10, + 1, + "w" + ], + [ + "CH4_RX_END", + 13, + 1, + "w" + ], + [ + "CH5_RX_END", + 16, + 1, + "w" + ], + [ + "CH6_RX_END", + 19, + 1, + "w" + ], + [ + "CH7_RX_END", + 22, + 1, + "w" + ], + [ + "CH0_ERR", + 2, + 1, + "w" + ], + [ + "CH1_ERR", + 5, + 1, + "w" + ], + [ + "CH2_ERR", + 8, + 1, + "w" + ], + [ + "CH3_ERR", + 11, + 1, + "w" + ], + [ + "CH4_ERR", + 14, + 1, + "w" + ], + [ + "CH5_ERR", + 17, + 1, + "w" + ], + [ + "CH6_ERR", + 20, + 1, + "w" + ], + [ + "CH7_ERR", + 23, + 1, + "w" + ], + [ + "CH0_TX_THR_EVENT", + 24, + 1, + "w" + ], + [ + "CH1_TX_THR_EVENT", + 25, + 1, + "w" + ], + [ + "CH2_TX_THR_EVENT", + 26, + 1, + "w" + ], + [ + "CH3_TX_THR_EVENT", + 27, + 1, + "w" + ], + [ + "CH4_TX_THR_EVENT", + 28, + 1, + "w" + ], + [ + "CH5_TX_THR_EVENT", + 29, + 1, + "w" + ], + [ + "CH6_TX_THR_EVENT", + 30, + 1, + "w" + ], + [ + "CH7_TX_THR_EVENT", + 31, + 1, + "w" + ] + ] + }, + { + "name": "CH0CARRIER_DUTY", + "offset": "0xB0", + "reset": "0x00400040", + "fields": [ + [ + "CARRIER_LOW", + 0, + 16 + ], + [ + "CARRIER_HIGH", + 16, + 16 + ] + ] + }, + { + "name": "CH1CARRIER_DUTY", + "offset": "0xB4", + "reset": "0x00400040", + "fields": [ + [ + "CARRIER_LOW", + 0, + 16 + ], + [ + "CARRIER_HIGH", + 16, + 16 + ] + ] + }, + { + "name": "CH2CARRIER_DUTY", + "offset": "0xB8", + "reset": "0x00400040", + "fields": [ + [ + "CARRIER_LOW", + 0, + 16 + ], + [ + "CARRIER_HIGH", + 16, + 16 + ] + ] + }, + { + "name": "CH3CARRIER_DUTY", + "offset": "0xBC", + "reset": "0x00400040", + "fields": [ + [ + "CARRIER_LOW", + 0, + 16 + ], + [ + "CARRIER_HIGH", + 16, + 16 + ] + ] + }, + { + "name": "CH4CARRIER_DUTY", + "offset": "0xC0", + "reset": "0x00400040", + "fields": [ + [ + "CARRIER_LOW", + 0, + 16 + ], + [ + "CARRIER_HIGH", + 16, + 16 + ] + ] + }, + { + "name": "CH5CARRIER_DUTY", + "offset": "0xC4", + "reset": "0x00400040", + "fields": [ + [ + "CARRIER_LOW", + 0, + 16 + ], + [ + "CARRIER_HIGH", + 16, + 16 + ] + ] + }, + { + "name": "CH6CARRIER_DUTY", + "offset": "0xC8", + "reset": "0x00400040", + "fields": [ + [ + "CARRIER_LOW", + 0, + 16 + ], + [ + "CARRIER_HIGH", + 16, + 16 + ] + ] + }, + { + "name": "CH7CARRIER_DUTY", + "offset": "0xCC", + "reset": "0x00400040", + "fields": [ + [ + "CARRIER_LOW", + 0, + 16 + ], + [ + "CARRIER_HIGH", + 16, + 16 + ] + ] + }, + { + "name": "CH0_TX_LIM", + "offset": "0xD0", + "reset": "0x00000080", + "fields": [ + [ + "TX_LIM", + 0, + 9 + ] + ] + }, + { + "name": "CH1_TX_LIM", + "offset": "0xD4", + "reset": "0x00000080", + "fields": [ + [ + "TX_LIM", + 0, + 9 + ] + ] + }, + { + "name": "CH2_TX_LIM", + "offset": "0xD8", + "reset": "0x00000080", + "fields": [ + [ + "TX_LIM", + 0, + 9 + ] + ] + }, + { + "name": "CH3_TX_LIM", + "offset": "0xDC", + "reset": "0x00000080", + "fields": [ + [ + "TX_LIM", + 0, + 9 + ] + ] + }, + { + "name": "CH4_TX_LIM", + "offset": "0xE0", + "reset": "0x00000080", + "fields": [ + [ + "TX_LIM", + 0, + 9 + ] + ] + }, + { + "name": "CH5_TX_LIM", + "offset": "0xE4", + "reset": "0x00000080", + "fields": [ + [ + "TX_LIM", + 0, + 9 + ] + ] + }, + { + "name": "CH6_TX_LIM", + "offset": "0xE8", + "reset": "0x00000080", + "fields": [ + [ + "TX_LIM", + 0, + 9 + ] + ] + }, + { + "name": "CH7_TX_LIM", + "offset": "0xEC", + "reset": "0x00000080", + "fields": [ + [ + "TX_LIM", + 0, + 9 + ] + ] + }, + { + "name": "APB_CONF", + "offset": "0xF0", + "fields": [ + [ + "APB_FIFO_MASK", + 0, + 1 + ], + [ + "MEM_TX_WRAP_EN", + 1, + 1 + ] + ] + }, + { + "name": "DATE", + "offset": "0xFC", + "reset": "0x16022600", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + }, + { + "name": "RAM0", + "offset": "0x800", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM1", + "offset": "0x804", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM2", + "offset": "0x808", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM3", + "offset": "0x80C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM4", + "offset": "0x810", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM5", + "offset": "0x814", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM6", + "offset": "0x818", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM7", + "offset": "0x81C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM8", + "offset": "0x820", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM9", + "offset": "0x824", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM10", + "offset": "0x828", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM11", + "offset": "0x82C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM12", + "offset": "0x830", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM13", + "offset": "0x834", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM14", + "offset": "0x838", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM15", + "offset": "0x83C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM16", + "offset": "0x840", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM17", + "offset": "0x844", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM18", + "offset": "0x848", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM19", + "offset": "0x84C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM20", + "offset": "0x850", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM21", + "offset": "0x854", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM22", + "offset": "0x858", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM23", + "offset": "0x85C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM24", + "offset": "0x860", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM25", + "offset": "0x864", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM26", + "offset": "0x868", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM27", + "offset": "0x86C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM28", + "offset": "0x870", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM29", + "offset": "0x874", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM30", + "offset": "0x878", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM31", + "offset": "0x87C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM32", + "offset": "0x880", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM33", + "offset": "0x884", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM34", + "offset": "0x888", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM35", + "offset": "0x88C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM36", + "offset": "0x890", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM37", + "offset": "0x894", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM38", + "offset": "0x898", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM39", + "offset": "0x89C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM40", + "offset": "0x8A0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM41", + "offset": "0x8A4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM42", + "offset": "0x8A8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM43", + "offset": "0x8AC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM44", + "offset": "0x8B0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM45", + "offset": "0x8B4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM46", + "offset": "0x8B8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM47", + "offset": "0x8BC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM48", + "offset": "0x8C0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM49", + "offset": "0x8C4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM50", + "offset": "0x8C8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM51", + "offset": "0x8CC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM52", + "offset": "0x8D0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM53", + "offset": "0x8D4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM54", + "offset": "0x8D8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM55", + "offset": "0x8DC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM56", + "offset": "0x8E0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM57", + "offset": "0x8E4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM58", + "offset": "0x8E8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM59", + "offset": "0x8EC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM60", + "offset": "0x8F0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM61", + "offset": "0x8F4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM62", + "offset": "0x8F8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM63", + "offset": "0x8FC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM64", + "offset": "0x900", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM65", + "offset": "0x904", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM66", + "offset": "0x908", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM67", + "offset": "0x90C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM68", + "offset": "0x910", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM69", + "offset": "0x914", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM70", + "offset": "0x918", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM71", + "offset": "0x91C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM72", + "offset": "0x920", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM73", + "offset": "0x924", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM74", + "offset": "0x928", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM75", + "offset": "0x92C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM76", + "offset": "0x930", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM77", + "offset": "0x934", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM78", + "offset": "0x938", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM79", + "offset": "0x93C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM80", + "offset": "0x940", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM81", + "offset": "0x944", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM82", + "offset": "0x948", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM83", + "offset": "0x94C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM84", + "offset": "0x950", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM85", + "offset": "0x954", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM86", + "offset": "0x958", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM87", + "offset": "0x95C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM88", + "offset": "0x960", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM89", + "offset": "0x964", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM90", + "offset": "0x968", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM91", + "offset": "0x96C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM92", + "offset": "0x970", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM93", + "offset": "0x974", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM94", + "offset": "0x978", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM95", + "offset": "0x97C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM96", + "offset": "0x980", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM97", + "offset": "0x984", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM98", + "offset": "0x988", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM99", + "offset": "0x98C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM100", + "offset": "0x990", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM101", + "offset": "0x994", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM102", + "offset": "0x998", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM103", + "offset": "0x99C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM104", + "offset": "0x9A0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM105", + "offset": "0x9A4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM106", + "offset": "0x9A8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM107", + "offset": "0x9AC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM108", + "offset": "0x9B0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM109", + "offset": "0x9B4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM110", + "offset": "0x9B8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM111", + "offset": "0x9BC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM112", + "offset": "0x9C0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM113", + "offset": "0x9C4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM114", + "offset": "0x9C8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM115", + "offset": "0x9CC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM116", + "offset": "0x9D0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM117", + "offset": "0x9D4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM118", + "offset": "0x9D8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM119", + "offset": "0x9DC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM120", + "offset": "0x9E0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM121", + "offset": "0x9E4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM122", + "offset": "0x9E8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM123", + "offset": "0x9EC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM124", + "offset": "0x9F0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM125", + "offset": "0x9F4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM126", + "offset": "0x9F8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM127", + "offset": "0x9FC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM128", + "offset": "0xA00", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM129", + "offset": "0xA04", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM130", + "offset": "0xA08", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM131", + "offset": "0xA0C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM132", + "offset": "0xA10", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM133", + "offset": "0xA14", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM134", + "offset": "0xA18", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM135", + "offset": "0xA1C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM136", + "offset": "0xA20", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM137", + "offset": "0xA24", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM138", + "offset": "0xA28", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM139", + "offset": "0xA2C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM140", + "offset": "0xA30", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM141", + "offset": "0xA34", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM142", + "offset": "0xA38", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM143", + "offset": "0xA3C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM144", + "offset": "0xA40", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM145", + "offset": "0xA44", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM146", + "offset": "0xA48", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM147", + "offset": "0xA4C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM148", + "offset": "0xA50", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM149", + "offset": "0xA54", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM150", + "offset": "0xA58", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM151", + "offset": "0xA5C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM152", + "offset": "0xA60", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM153", + "offset": "0xA64", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM154", + "offset": "0xA68", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM155", + "offset": "0xA6C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM156", + "offset": "0xA70", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM157", + "offset": "0xA74", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM158", + "offset": "0xA78", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM159", + "offset": "0xA7C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM160", + "offset": "0xA80", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM161", + "offset": "0xA84", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM162", + "offset": "0xA88", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM163", + "offset": "0xA8C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM164", + "offset": "0xA90", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM165", + "offset": "0xA94", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM166", + "offset": "0xA98", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM167", + "offset": "0xA9C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM168", + "offset": "0xAA0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM169", + "offset": "0xAA4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM170", + "offset": "0xAA8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM171", + "offset": "0xAAC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM172", + "offset": "0xAB0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM173", + "offset": "0xAB4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM174", + "offset": "0xAB8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM175", + "offset": "0xABC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM176", + "offset": "0xAC0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM177", + "offset": "0xAC4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM178", + "offset": "0xAC8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM179", + "offset": "0xACC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM180", + "offset": "0xAD0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM181", + "offset": "0xAD4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM182", + "offset": "0xAD8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM183", + "offset": "0xADC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM184", + "offset": "0xAE0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM185", + "offset": "0xAE4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM186", + "offset": "0xAE8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM187", + "offset": "0xAEC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM188", + "offset": "0xAF0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM189", + "offset": "0xAF4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM190", + "offset": "0xAF8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM191", + "offset": "0xAFC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM192", + "offset": "0xB00", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM193", + "offset": "0xB04", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM194", + "offset": "0xB08", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM195", + "offset": "0xB0C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM196", + "offset": "0xB10", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM197", + "offset": "0xB14", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM198", + "offset": "0xB18", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM199", + "offset": "0xB1C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM200", + "offset": "0xB20", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM201", + "offset": "0xB24", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM202", + "offset": "0xB28", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM203", + "offset": "0xB2C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM204", + "offset": "0xB30", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM205", + "offset": "0xB34", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM206", + "offset": "0xB38", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM207", + "offset": "0xB3C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM208", + "offset": "0xB40", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM209", + "offset": "0xB44", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM210", + "offset": "0xB48", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM211", + "offset": "0xB4C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM212", + "offset": "0xB50", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM213", + "offset": "0xB54", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM214", + "offset": "0xB58", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM215", + "offset": "0xB5C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM216", + "offset": "0xB60", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM217", + "offset": "0xB64", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM218", + "offset": "0xB68", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM219", + "offset": "0xB6C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM220", + "offset": "0xB70", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM221", + "offset": "0xB74", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM222", + "offset": "0xB78", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM223", + "offset": "0xB7C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM224", + "offset": "0xB80", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM225", + "offset": "0xB84", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM226", + "offset": "0xB88", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM227", + "offset": "0xB8C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM228", + "offset": "0xB90", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM229", + "offset": "0xB94", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM230", + "offset": "0xB98", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM231", + "offset": "0xB9C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM232", + "offset": "0xBA0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM233", + "offset": "0xBA4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM234", + "offset": "0xBA8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM235", + "offset": "0xBAC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM236", + "offset": "0xBB0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM237", + "offset": "0xBB4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM238", + "offset": "0xBB8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM239", + "offset": "0xBBC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM240", + "offset": "0xBC0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM241", + "offset": "0xBC4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM242", + "offset": "0xBC8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM243", + "offset": "0xBCC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM244", + "offset": "0xBD0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM245", + "offset": "0xBD4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM246", + "offset": "0xBD8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM247", + "offset": "0xBDC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM248", + "offset": "0xBE0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM249", + "offset": "0xBE4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM250", + "offset": "0xBE8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM251", + "offset": "0xBEC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM252", + "offset": "0xBF0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM253", + "offset": "0xBF4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM254", + "offset": "0xBF8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM255", + "offset": "0xBFC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM256", + "offset": "0xC00", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM257", + "offset": "0xC04", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM258", + "offset": "0xC08", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM259", + "offset": "0xC0C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM260", + "offset": "0xC10", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM261", + "offset": "0xC14", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM262", + "offset": "0xC18", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM263", + "offset": "0xC1C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM264", + "offset": "0xC20", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM265", + "offset": "0xC24", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM266", + "offset": "0xC28", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM267", + "offset": "0xC2C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM268", + "offset": "0xC30", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM269", + "offset": "0xC34", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM270", + "offset": "0xC38", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM271", + "offset": "0xC3C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM272", + "offset": "0xC40", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM273", + "offset": "0xC44", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM274", + "offset": "0xC48", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM275", + "offset": "0xC4C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM276", + "offset": "0xC50", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM277", + "offset": "0xC54", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM278", + "offset": "0xC58", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM279", + "offset": "0xC5C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM280", + "offset": "0xC60", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM281", + "offset": "0xC64", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM282", + "offset": "0xC68", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM283", + "offset": "0xC6C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM284", + "offset": "0xC70", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM285", + "offset": "0xC74", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM286", + "offset": "0xC78", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM287", + "offset": "0xC7C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM288", + "offset": "0xC80", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM289", + "offset": "0xC84", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM290", + "offset": "0xC88", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM291", + "offset": "0xC8C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM292", + "offset": "0xC90", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM293", + "offset": "0xC94", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM294", + "offset": "0xC98", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM295", + "offset": "0xC9C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM296", + "offset": "0xCA0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM297", + "offset": "0xCA4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM298", + "offset": "0xCA8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM299", + "offset": "0xCAC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM300", + "offset": "0xCB0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM301", + "offset": "0xCB4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM302", + "offset": "0xCB8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM303", + "offset": "0xCBC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM304", + "offset": "0xCC0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM305", + "offset": "0xCC4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM306", + "offset": "0xCC8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM307", + "offset": "0xCCC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM308", + "offset": "0xCD0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM309", + "offset": "0xCD4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM310", + "offset": "0xCD8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM311", + "offset": "0xCDC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM312", + "offset": "0xCE0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM313", + "offset": "0xCE4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM314", + "offset": "0xCE8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM315", + "offset": "0xCEC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM316", + "offset": "0xCF0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM317", + "offset": "0xCF4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM318", + "offset": "0xCF8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM319", + "offset": "0xCFC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM320", + "offset": "0xD00", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM321", + "offset": "0xD04", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM322", + "offset": "0xD08", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM323", + "offset": "0xD0C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM324", + "offset": "0xD10", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM325", + "offset": "0xD14", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM326", + "offset": "0xD18", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM327", + "offset": "0xD1C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM328", + "offset": "0xD20", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM329", + "offset": "0xD24", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM330", + "offset": "0xD28", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM331", + "offset": "0xD2C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM332", + "offset": "0xD30", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM333", + "offset": "0xD34", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM334", + "offset": "0xD38", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM335", + "offset": "0xD3C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM336", + "offset": "0xD40", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM337", + "offset": "0xD44", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM338", + "offset": "0xD48", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM339", + "offset": "0xD4C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM340", + "offset": "0xD50", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM341", + "offset": "0xD54", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM342", + "offset": "0xD58", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM343", + "offset": "0xD5C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM344", + "offset": "0xD60", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM345", + "offset": "0xD64", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM346", + "offset": "0xD68", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM347", + "offset": "0xD6C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM348", + "offset": "0xD70", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM349", + "offset": "0xD74", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM350", + "offset": "0xD78", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM351", + "offset": "0xD7C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM352", + "offset": "0xD80", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM353", + "offset": "0xD84", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM354", + "offset": "0xD88", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM355", + "offset": "0xD8C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM356", + "offset": "0xD90", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM357", + "offset": "0xD94", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM358", + "offset": "0xD98", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM359", + "offset": "0xD9C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM360", + "offset": "0xDA0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM361", + "offset": "0xDA4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM362", + "offset": "0xDA8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM363", + "offset": "0xDAC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM364", + "offset": "0xDB0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM365", + "offset": "0xDB4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM366", + "offset": "0xDB8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM367", + "offset": "0xDBC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM368", + "offset": "0xDC0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM369", + "offset": "0xDC4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM370", + "offset": "0xDC8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM371", + "offset": "0xDCC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM372", + "offset": "0xDD0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM373", + "offset": "0xDD4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM374", + "offset": "0xDD8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM375", + "offset": "0xDDC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM376", + "offset": "0xDE0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM377", + "offset": "0xDE4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM378", + "offset": "0xDE8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM379", + "offset": "0xDEC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM380", + "offset": "0xDF0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM381", + "offset": "0xDF4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM382", + "offset": "0xDF8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM383", + "offset": "0xDFC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM384", + "offset": "0xE00", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM385", + "offset": "0xE04", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM386", + "offset": "0xE08", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM387", + "offset": "0xE0C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM388", + "offset": "0xE10", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM389", + "offset": "0xE14", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM390", + "offset": "0xE18", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM391", + "offset": "0xE1C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM392", + "offset": "0xE20", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM393", + "offset": "0xE24", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM394", + "offset": "0xE28", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM395", + "offset": "0xE2C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM396", + "offset": "0xE30", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM397", + "offset": "0xE34", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM398", + "offset": "0xE38", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM399", + "offset": "0xE3C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM400", + "offset": "0xE40", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM401", + "offset": "0xE44", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM402", + "offset": "0xE48", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM403", + "offset": "0xE4C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM404", + "offset": "0xE50", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM405", + "offset": "0xE54", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM406", + "offset": "0xE58", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM407", + "offset": "0xE5C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM408", + "offset": "0xE60", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM409", + "offset": "0xE64", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM410", + "offset": "0xE68", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM411", + "offset": "0xE6C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM412", + "offset": "0xE70", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM413", + "offset": "0xE74", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM414", + "offset": "0xE78", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM415", + "offset": "0xE7C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM416", + "offset": "0xE80", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM417", + "offset": "0xE84", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM418", + "offset": "0xE88", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM419", + "offset": "0xE8C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM420", + "offset": "0xE90", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM421", + "offset": "0xE94", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM422", + "offset": "0xE98", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM423", + "offset": "0xE9C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM424", + "offset": "0xEA0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM425", + "offset": "0xEA4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM426", + "offset": "0xEA8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM427", + "offset": "0xEAC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM428", + "offset": "0xEB0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM429", + "offset": "0xEB4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM430", + "offset": "0xEB8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM431", + "offset": "0xEBC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM432", + "offset": "0xEC0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM433", + "offset": "0xEC4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM434", + "offset": "0xEC8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM435", + "offset": "0xECC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM436", + "offset": "0xED0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM437", + "offset": "0xED4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM438", + "offset": "0xED8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM439", + "offset": "0xEDC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM440", + "offset": "0xEE0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM441", + "offset": "0xEE4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM442", + "offset": "0xEE8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM443", + "offset": "0xEEC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM444", + "offset": "0xEF0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM445", + "offset": "0xEF4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM446", + "offset": "0xEF8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM447", + "offset": "0xEFC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM448", + "offset": "0xF00", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM449", + "offset": "0xF04", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM450", + "offset": "0xF08", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM451", + "offset": "0xF0C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM452", + "offset": "0xF10", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM453", + "offset": "0xF14", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM454", + "offset": "0xF18", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM455", + "offset": "0xF1C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM456", + "offset": "0xF20", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM457", + "offset": "0xF24", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM458", + "offset": "0xF28", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM459", + "offset": "0xF2C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM460", + "offset": "0xF30", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM461", + "offset": "0xF34", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM462", + "offset": "0xF38", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM463", + "offset": "0xF3C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM464", + "offset": "0xF40", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM465", + "offset": "0xF44", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM466", + "offset": "0xF48", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM467", + "offset": "0xF4C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM468", + "offset": "0xF50", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM469", + "offset": "0xF54", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM470", + "offset": "0xF58", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM471", + "offset": "0xF5C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM472", + "offset": "0xF60", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM473", + "offset": "0xF64", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM474", + "offset": "0xF68", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM475", + "offset": "0xF6C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM476", + "offset": "0xF70", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM477", + "offset": "0xF74", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM478", + "offset": "0xF78", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM479", + "offset": "0xF7C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM480", + "offset": "0xF80", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM481", + "offset": "0xF84", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM482", + "offset": "0xF88", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM483", + "offset": "0xF8C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM484", + "offset": "0xF90", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM485", + "offset": "0xF94", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM486", + "offset": "0xF98", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM487", + "offset": "0xF9C", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM488", + "offset": "0xFA0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM489", + "offset": "0xFA4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM490", + "offset": "0xFA8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM491", + "offset": "0xFAC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM492", + "offset": "0xFB0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM493", + "offset": "0xFB4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM494", + "offset": "0xFB8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM495", + "offset": "0xFBC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM496", + "offset": "0xFC0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM497", + "offset": "0xFC4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM498", + "offset": "0xFC8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM499", + "offset": "0xFCC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM500", + "offset": "0xFD0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM501", + "offset": "0xFD4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM502", + "offset": "0xFD8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM503", + "offset": "0xFDC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM504", + "offset": "0xFE0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM505", + "offset": "0xFE4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM506", + "offset": "0xFE8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM507", + "offset": "0xFEC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM508", + "offset": "0xFF0", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM509", + "offset": "0xFF4", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM510", + "offset": "0xFF8", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + }, + { + "name": "RAM511", + "offset": "0xFFC", + "fields": [ + [ + "DATA", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "PCNT", + "base": "0x3FF57000", + "interrupts": [ + "PCNT" + ], + "registers": [ + { + "name": "U0_CONF0", + "offset": "0x00", + "reset": "0x00003C10", + "fields": [ + [ + "FILTER_THRES", + 0, + 10 + ], + [ + "FILTER_EN", + 10, + 1 + ], + [ + "THR_ZERO_EN", + 11, + 1 + ], + [ + "THR_H_LIM_EN", + 12, + 1 + ], + [ + "THR_L_LIM_EN", + 13, + 1 + ], + [ + "THR_THRES0_EN", + 14, + 1 + ], + [ + "THR_THRES1_EN", + 15, + 1 + ], + [ + "CH0_NEG_MODE", + 16, + 2 + ], + [ + "CH0_POS_MODE", + 18, + 2 + ], + [ + "CH0_HCTRL_MODE", + 20, + 2 + ], + [ + "CH0_LCTRL_MODE", + 22, + 2 + ], + [ + "CH1_NEG_MODE", + 24, + 2 + ], + [ + "CH1_POS_MODE", + 26, + 2 + ], + [ + "CH1_HCTRL_MODE", + 28, + 2 + ], + [ + "CH1_LCTRL_MODE", + 30, + 2 + ] + ] + }, + { + "name": "U1_CONF0", + "offset": "0x0C", + "reset": "0x00003C10", + "fields": [ + [ + "FILTER_THRES", + 0, + 10 + ], + [ + "FILTER_EN", + 10, + 1 + ], + [ + "THR_ZERO_EN", + 11, + 1 + ], + [ + "THR_H_LIM_EN", + 12, + 1 + ], + [ + "THR_L_LIM_EN", + 13, + 1 + ], + [ + "THR_THRES0_EN", + 14, + 1 + ], + [ + "THR_THRES1_EN", + 15, + 1 + ], + [ + "CH0_NEG_MODE", + 16, + 2 + ], + [ + "CH0_POS_MODE", + 18, + 2 + ], + [ + "CH0_HCTRL_MODE", + 20, + 2 + ], + [ + "CH0_LCTRL_MODE", + 22, + 2 + ], + [ + "CH1_NEG_MODE", + 24, + 2 + ], + [ + "CH1_POS_MODE", + 26, + 2 + ], + [ + "CH1_HCTRL_MODE", + 28, + 2 + ], + [ + "CH1_LCTRL_MODE", + 30, + 2 + ] + ] + }, + { + "name": "U2_CONF0", + "offset": "0x18", + "reset": "0x00003C10", + "fields": [ + [ + "FILTER_THRES", + 0, + 10 + ], + [ + "FILTER_EN", + 10, + 1 + ], + [ + "THR_ZERO_EN", + 11, + 1 + ], + [ + "THR_H_LIM_EN", + 12, + 1 + ], + [ + "THR_L_LIM_EN", + 13, + 1 + ], + [ + "THR_THRES0_EN", + 14, + 1 + ], + [ + "THR_THRES1_EN", + 15, + 1 + ], + [ + "CH0_NEG_MODE", + 16, + 2 + ], + [ + "CH0_POS_MODE", + 18, + 2 + ], + [ + "CH0_HCTRL_MODE", + 20, + 2 + ], + [ + "CH0_LCTRL_MODE", + 22, + 2 + ], + [ + "CH1_NEG_MODE", + 24, + 2 + ], + [ + "CH1_POS_MODE", + 26, + 2 + ], + [ + "CH1_HCTRL_MODE", + 28, + 2 + ], + [ + "CH1_LCTRL_MODE", + 30, + 2 + ] + ] + }, + { + "name": "U3_CONF0", + "offset": "0x24", + "reset": "0x00003C10", + "fields": [ + [ + "FILTER_THRES", + 0, + 10 + ], + [ + "FILTER_EN", + 10, + 1 + ], + [ + "THR_ZERO_EN", + 11, + 1 + ], + [ + "THR_H_LIM_EN", + 12, + 1 + ], + [ + "THR_L_LIM_EN", + 13, + 1 + ], + [ + "THR_THRES0_EN", + 14, + 1 + ], + [ + "THR_THRES1_EN", + 15, + 1 + ], + [ + "CH0_NEG_MODE", + 16, + 2 + ], + [ + "CH0_POS_MODE", + 18, + 2 + ], + [ + "CH0_HCTRL_MODE", + 20, + 2 + ], + [ + "CH0_LCTRL_MODE", + 22, + 2 + ], + [ + "CH1_NEG_MODE", + 24, + 2 + ], + [ + "CH1_POS_MODE", + 26, + 2 + ], + [ + "CH1_HCTRL_MODE", + 28, + 2 + ], + [ + "CH1_LCTRL_MODE", + 30, + 2 + ] + ] + }, + { + "name": "U4_CONF0", + "offset": "0x30", + "reset": "0x00003C10", + "fields": [ + [ + "FILTER_THRES", + 0, + 10 + ], + [ + "FILTER_EN", + 10, + 1 + ], + [ + "THR_ZERO_EN", + 11, + 1 + ], + [ + "THR_H_LIM_EN", + 12, + 1 + ], + [ + "THR_L_LIM_EN", + 13, + 1 + ], + [ + "THR_THRES0_EN", + 14, + 1 + ], + [ + "THR_THRES1_EN", + 15, + 1 + ], + [ + "CH0_NEG_MODE", + 16, + 2 + ], + [ + "CH0_POS_MODE", + 18, + 2 + ], + [ + "CH0_HCTRL_MODE", + 20, + 2 + ], + [ + "CH0_LCTRL_MODE", + 22, + 2 + ], + [ + "CH1_NEG_MODE", + 24, + 2 + ], + [ + "CH1_POS_MODE", + 26, + 2 + ], + [ + "CH1_HCTRL_MODE", + 28, + 2 + ], + [ + "CH1_LCTRL_MODE", + 30, + 2 + ] + ] + }, + { + "name": "U5_CONF0", + "offset": "0x3C", + "reset": "0x00003C10", + "fields": [ + [ + "FILTER_THRES", + 0, + 10 + ], + [ + "FILTER_EN", + 10, + 1 + ], + [ + "THR_ZERO_EN", + 11, + 1 + ], + [ + "THR_H_LIM_EN", + 12, + 1 + ], + [ + "THR_L_LIM_EN", + 13, + 1 + ], + [ + "THR_THRES0_EN", + 14, + 1 + ], + [ + "THR_THRES1_EN", + 15, + 1 + ], + [ + "CH0_NEG_MODE", + 16, + 2 + ], + [ + "CH0_POS_MODE", + 18, + 2 + ], + [ + "CH0_HCTRL_MODE", + 20, + 2 + ], + [ + "CH0_LCTRL_MODE", + 22, + 2 + ], + [ + "CH1_NEG_MODE", + 24, + 2 + ], + [ + "CH1_POS_MODE", + 26, + 2 + ], + [ + "CH1_HCTRL_MODE", + 28, + 2 + ], + [ + "CH1_LCTRL_MODE", + 30, + 2 + ] + ] + }, + { + "name": "U6_CONF0", + "offset": "0x48", + "reset": "0x00003C10", + "fields": [ + [ + "FILTER_THRES", + 0, + 10 + ], + [ + "FILTER_EN", + 10, + 1 + ], + [ + "THR_ZERO_EN", + 11, + 1 + ], + [ + "THR_H_LIM_EN", + 12, + 1 + ], + [ + "THR_L_LIM_EN", + 13, + 1 + ], + [ + "THR_THRES0_EN", + 14, + 1 + ], + [ + "THR_THRES1_EN", + 15, + 1 + ], + [ + "CH0_NEG_MODE", + 16, + 2 + ], + [ + "CH0_POS_MODE", + 18, + 2 + ], + [ + "CH0_HCTRL_MODE", + 20, + 2 + ], + [ + "CH0_LCTRL_MODE", + 22, + 2 + ], + [ + "CH1_NEG_MODE", + 24, + 2 + ], + [ + "CH1_POS_MODE", + 26, + 2 + ], + [ + "CH1_HCTRL_MODE", + 28, + 2 + ], + [ + "CH1_LCTRL_MODE", + 30, + 2 + ] + ] + }, + { + "name": "U7_CONF0", + "offset": "0x54", + "reset": "0x00003C10", + "fields": [ + [ + "FILTER_THRES", + 0, + 10 + ], + [ + "FILTER_EN", + 10, + 1 + ], + [ + "THR_ZERO_EN", + 11, + 1 + ], + [ + "THR_H_LIM_EN", + 12, + 1 + ], + [ + "THR_L_LIM_EN", + 13, + 1 + ], + [ + "THR_THRES0_EN", + 14, + 1 + ], + [ + "THR_THRES1_EN", + 15, + 1 + ], + [ + "CH0_NEG_MODE", + 16, + 2 + ], + [ + "CH0_POS_MODE", + 18, + 2 + ], + [ + "CH0_HCTRL_MODE", + 20, + 2 + ], + [ + "CH0_LCTRL_MODE", + 22, + 2 + ], + [ + "CH1_NEG_MODE", + 24, + 2 + ], + [ + "CH1_POS_MODE", + 26, + 2 + ], + [ + "CH1_HCTRL_MODE", + 28, + 2 + ], + [ + "CH1_LCTRL_MODE", + 30, + 2 + ] + ] + }, + { + "name": "U0_CONF1", + "offset": "0x04", + "fields": [ + [ + "CNT_THRES0", + 0, + 16 + ], + [ + "CNT_THRES1", + 16, + 16 + ] + ] + }, + { + "name": "U1_CONF1", + "offset": "0x10", + "fields": [ + [ + "CNT_THRES0", + 0, + 16 + ], + [ + "CNT_THRES1", + 16, + 16 + ] + ] + }, + { + "name": "U2_CONF1", + "offset": "0x1C", + "fields": [ + [ + "CNT_THRES0", + 0, + 16 + ], + [ + "CNT_THRES1", + 16, + 16 + ] + ] + }, + { + "name": "U3_CONF1", + "offset": "0x28", + "fields": [ + [ + "CNT_THRES0", + 0, + 16 + ], + [ + "CNT_THRES1", + 16, + 16 + ] + ] + }, + { + "name": "U4_CONF1", + "offset": "0x34", + "fields": [ + [ + "CNT_THRES0", + 0, + 16 + ], + [ + "CNT_THRES1", + 16, + 16 + ] + ] + }, + { + "name": "U5_CONF1", + "offset": "0x40", + "fields": [ + [ + "CNT_THRES0", + 0, + 16 + ], + [ + "CNT_THRES1", + 16, + 16 + ] + ] + }, + { + "name": "U6_CONF1", + "offset": "0x4C", + "fields": [ + [ + "CNT_THRES0", + 0, + 16 + ], + [ + "CNT_THRES1", + 16, + 16 + ] + ] + }, + { + "name": "U7_CONF1", + "offset": "0x58", + "fields": [ + [ + "CNT_THRES0", + 0, + 16 + ], + [ + "CNT_THRES1", + 16, + 16 + ] + ] + }, + { + "name": "U0_CONF2", + "offset": "0x08", + "fields": [ + [ + "CNT_H_LIM", + 0, + 16 + ], + [ + "CNT_L_LIM", + 16, + 16 + ] + ] + }, + { + "name": "U1_CONF2", + "offset": "0x14", + "fields": [ + [ + "CNT_H_LIM", + 0, + 16 + ], + [ + "CNT_L_LIM", + 16, + 16 + ] + ] + }, + { + "name": "U2_CONF2", + "offset": "0x20", + "fields": [ + [ + "CNT_H_LIM", + 0, + 16 + ], + [ + "CNT_L_LIM", + 16, + 16 + ] + ] + }, + { + "name": "U3_CONF2", + "offset": "0x2C", + "fields": [ + [ + "CNT_H_LIM", + 0, + 16 + ], + [ + "CNT_L_LIM", + 16, + 16 + ] + ] + }, + { + "name": "U4_CONF2", + "offset": "0x38", + "fields": [ + [ + "CNT_H_LIM", + 0, + 16 + ], + [ + "CNT_L_LIM", + 16, + 16 + ] + ] + }, + { + "name": "U5_CONF2", + "offset": "0x44", + "fields": [ + [ + "CNT_H_LIM", + 0, + 16 + ], + [ + "CNT_L_LIM", + 16, + 16 + ] + ] + }, + { + "name": "U6_CONF2", + "offset": "0x50", + "fields": [ + [ + "CNT_H_LIM", + 0, + 16 + ], + [ + "CNT_L_LIM", + 16, + 16 + ] + ] + }, + { + "name": "U7_CONF2", + "offset": "0x5C", + "fields": [ + [ + "CNT_H_LIM", + 0, + 16 + ], + [ + "CNT_L_LIM", + 16, + 16 + ] + ] + }, + { + "name": "U0_CNT", + "offset": "0x60", + "fields": [ + [ + "CNT", + 0, + 16, + "r" + ] + ] + }, + { + "name": "U1_CNT", + "offset": "0x64", + "fields": [ + [ + "CNT", + 0, + 16, + "r" + ] + ] + }, + { + "name": "U2_CNT", + "offset": "0x68", + "fields": [ + [ + "CNT", + 0, + 16, + "r" + ] + ] + }, + { + "name": "U3_CNT", + "offset": "0x6C", + "fields": [ + [ + "CNT", + 0, + 16, + "r" + ] + ] + }, + { + "name": "U4_CNT", + "offset": "0x70", + "fields": [ + [ + "CNT", + 0, + 16, + "r" + ] + ] + }, + { + "name": "U5_CNT", + "offset": "0x74", + "fields": [ + [ + "CNT", + 0, + 16, + "r" + ] + ] + }, + { + "name": "U6_CNT", + "offset": "0x78", + "fields": [ + [ + "CNT", + 0, + 16, + "r" + ] + ] + }, + { + "name": "U7_CNT", + "offset": "0x7C", + "fields": [ + [ + "CNT", + 0, + 16, + "r" + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x80", + "fields": [ + [ + "CNT_THR_EVENT_U0", + 0, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U1", + 1, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U2", + 2, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U3", + 3, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U4", + 4, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U5", + 5, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U6", + 6, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U7", + 7, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0x84", + "fields": [ + [ + "CNT_THR_EVENT_U0", + 0, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U1", + 1, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U2", + 2, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U3", + 3, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U4", + 4, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U5", + 5, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U6", + 6, + 1, + "r" + ], + [ + "CNT_THR_EVENT_U7", + 7, + 1, + "r" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x88", + "fields": [ + [ + "CNT_THR_EVENT_U0", + 0, + 1 + ], + [ + "CNT_THR_EVENT_U1", + 1, + 1 + ], + [ + "CNT_THR_EVENT_U2", + 2, + 1 + ], + [ + "CNT_THR_EVENT_U3", + 3, + 1 + ], + [ + "CNT_THR_EVENT_U4", + 4, + 1 + ], + [ + "CNT_THR_EVENT_U5", + 5, + 1 + ], + [ + "CNT_THR_EVENT_U6", + 6, + 1 + ], + [ + "CNT_THR_EVENT_U7", + 7, + 1 + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x8C", + "fields": [ + [ + "CNT_THR_EVENT_U0", + 0, + 1, + "w" + ], + [ + "CNT_THR_EVENT_U1", + 1, + 1, + "w" + ], + [ + "CNT_THR_EVENT_U2", + 2, + 1, + "w" + ], + [ + "CNT_THR_EVENT_U3", + 3, + 1, + "w" + ], + [ + "CNT_THR_EVENT_U4", + 4, + 1, + "w" + ], + [ + "CNT_THR_EVENT_U5", + 5, + 1, + "w" + ], + [ + "CNT_THR_EVENT_U6", + 6, + 1, + "w" + ], + [ + "CNT_THR_EVENT_U7", + 7, + 1, + "w" + ] + ] + }, + { + "name": "U0_STATUS", + "offset": "0x90", + "fields": [ + [ + "ZERO_MODE", + 0, + 2 + ], + [ + "THRES1", + 2, + 1 + ], + [ + "THRES0", + 3, + 1 + ], + [ + "L_LIM", + 4, + 1 + ], + [ + "H_LIM", + 5, + 1 + ], + [ + "ZERO", + 6, + 1 + ] + ] + }, + { + "name": "U1_STATUS", + "offset": "0x94", + "fields": [ + [ + "ZERO_MODE", + 0, + 2 + ], + [ + "THRES1", + 2, + 1 + ], + [ + "THRES0", + 3, + 1 + ], + [ + "L_LIM", + 4, + 1 + ], + [ + "H_LIM", + 5, + 1 + ], + [ + "ZERO", + 6, + 1 + ] + ] + }, + { + "name": "U2_STATUS", + "offset": "0x98", + "fields": [ + [ + "ZERO_MODE", + 0, + 2 + ], + [ + "THRES1", + 2, + 1 + ], + [ + "THRES0", + 3, + 1 + ], + [ + "L_LIM", + 4, + 1 + ], + [ + "H_LIM", + 5, + 1 + ], + [ + "ZERO", + 6, + 1 + ] + ] + }, + { + "name": "U3_STATUS", + "offset": "0x9C", + "fields": [ + [ + "ZERO_MODE", + 0, + 2 + ], + [ + "THRES1", + 2, + 1 + ], + [ + "THRES0", + 3, + 1 + ], + [ + "L_LIM", + 4, + 1 + ], + [ + "H_LIM", + 5, + 1 + ], + [ + "ZERO", + 6, + 1 + ] + ] + }, + { + "name": "U4_STATUS", + "offset": "0xA0", + "fields": [ + [ + "ZERO_MODE", + 0, + 2 + ], + [ + "THRES1", + 2, + 1 + ], + [ + "THRES0", + 3, + 1 + ], + [ + "L_LIM", + 4, + 1 + ], + [ + "H_LIM", + 5, + 1 + ], + [ + "ZERO", + 6, + 1 + ] + ] + }, + { + "name": "U5_STATUS", + "offset": "0xA4", + "fields": [ + [ + "ZERO_MODE", + 0, + 2 + ], + [ + "THRES1", + 2, + 1 + ], + [ + "THRES0", + 3, + 1 + ], + [ + "L_LIM", + 4, + 1 + ], + [ + "H_LIM", + 5, + 1 + ], + [ + "ZERO", + 6, + 1 + ] + ] + }, + { + "name": "U6_STATUS", + "offset": "0xA8", + "fields": [ + [ + "ZERO_MODE", + 0, + 2 + ], + [ + "THRES1", + 2, + 1 + ], + [ + "THRES0", + 3, + 1 + ], + [ + "L_LIM", + 4, + 1 + ], + [ + "H_LIM", + 5, + 1 + ], + [ + "ZERO", + 6, + 1 + ] + ] + }, + { + "name": "U7_STATUS", + "offset": "0xAC", + "fields": [ + [ + "ZERO_MODE", + 0, + 2 + ], + [ + "THRES1", + 2, + 1 + ], + [ + "THRES0", + 3, + 1 + ], + [ + "L_LIM", + 4, + 1 + ], + [ + "H_LIM", + 5, + 1 + ], + [ + "ZERO", + 6, + 1 + ] + ] + }, + { + "name": "CTRL", + "offset": "0xB0", + "reset": "0x00005555", + "fields": [ + [ + "CNT_RST_U0", + 0, + 1 + ], + [ + "CNT_PAUSE_U0", + 1, + 1 + ], + [ + "CNT_RST_U1", + 2, + 1 + ], + [ + "CNT_PAUSE_U1", + 3, + 1 + ], + [ + "CNT_RST_U2", + 4, + 1 + ], + [ + "CNT_PAUSE_U2", + 5, + 1 + ], + [ + "CNT_RST_U3", + 6, + 1 + ], + [ + "CNT_PAUSE_U3", + 7, + 1 + ], + [ + "CNT_RST_U4", + 8, + 1 + ], + [ + "CNT_PAUSE_U4", + 9, + 1 + ], + [ + "CNT_RST_U5", + 10, + 1 + ], + [ + "CNT_PAUSE_U5", + 11, + 1 + ], + [ + "CNT_RST_U6", + 12, + 1 + ], + [ + "CNT_PAUSE_U6", + 13, + 1 + ], + [ + "CNT_RST_U7", + 14, + 1 + ], + [ + "CNT_PAUSE_U7", + 15, + 1 + ], + [ + "CLK_EN", + 16, + 1 + ] + ] + }, + { + "name": "DATE", + "offset": "0xFC", + "reset": "0x14122600", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "SLC", + "base": "0x3FF58000", + "registers": [ + { + "name": "CONF0", + "offset": "0x00", + "reset": "0xFF3CFF30", + "fields": [ + [ + "SLC0_TX_RST", + 0, + 1 + ], + [ + "SLC0_RX_RST", + 1, + 1 + ], + [ + "AHBM_FIFO_RST", + 2, + 1 + ], + [ + "AHBM_RST", + 3, + 1 + ], + [ + "SLC0_TX_LOOP_TEST", + 4, + 1 + ], + [ + "SLC0_RX_LOOP_TEST", + 5, + 1 + ], + [ + "SLC0_RX_AUTO_WRBACK", + 6, + 1 + ], + [ + "SLC0_RX_NO_RESTART_CLR", + 7, + 1 + ], + [ + "SLC0_RXDSCR_BURST_EN", + 8, + 1 + ], + [ + "SLC0_RXDATA_BURST_EN", + 9, + 1 + ], + [ + "SLC0_RXLINK_AUTO_RET", + 10, + 1 + ], + [ + "SLC0_TXLINK_AUTO_RET", + 11, + 1 + ], + [ + "SLC0_TXDSCR_BURST_EN", + 12, + 1 + ], + [ + "SLC0_TXDATA_BURST_EN", + 13, + 1 + ], + [ + "SLC0_TOKEN_AUTO_CLR", + 14, + 1 + ], + [ + "SLC0_TOKEN_SEL", + 15, + 1 + ], + [ + "SLC1_TX_RST", + 16, + 1 + ], + [ + "SLC1_RX_RST", + 17, + 1 + ], + [ + "SLC0_WR_RETRY_MASK_EN", + 18, + 1 + ], + [ + "SLC1_WR_RETRY_MASK_EN", + 19, + 1 + ], + [ + "SLC1_TX_LOOP_TEST", + 20, + 1 + ], + [ + "SLC1_RX_LOOP_TEST", + 21, + 1 + ], + [ + "SLC1_RX_AUTO_WRBACK", + 22, + 1 + ], + [ + "SLC1_RX_NO_RESTART_CLR", + 23, + 1 + ], + [ + "SLC1_RXDSCR_BURST_EN", + 24, + 1 + ], + [ + "SLC1_RXDATA_BURST_EN", + 25, + 1 + ], + [ + "SLC1_RXLINK_AUTO_RET", + 26, + 1 + ], + [ + "SLC1_TXLINK_AUTO_RET", + 27, + 1 + ], + [ + "SLC1_TXDSCR_BURST_EN", + 28, + 1 + ], + [ + "SLC1_TXDATA_BURST_EN", + 29, + 1 + ], + [ + "SLC1_TOKEN_AUTO_CLR", + 30, + 1 + ], + [ + "SLC1_TOKEN_SEL", + 31, + 1 + ] + ] + }, + { + "name": "_0INT_RAW", + "offset": "0x04", + "fields": [ + [ + "FRHOST_BIT0_INT_RAW", + 0, + 1, + "r" + ], + [ + "FRHOST_BIT1_INT_RAW", + 1, + 1, + "r" + ], + [ + "FRHOST_BIT2_INT_RAW", + 2, + 1, + "r" + ], + [ + "FRHOST_BIT3_INT_RAW", + 3, + 1, + "r" + ], + [ + "FRHOST_BIT4_INT_RAW", + 4, + 1, + "r" + ], + [ + "FRHOST_BIT5_INT_RAW", + 5, + 1, + "r" + ], + [ + "FRHOST_BIT6_INT_RAW", + 6, + 1, + "r" + ], + [ + "FRHOST_BIT7_INT_RAW", + 7, + 1, + "r" + ], + [ + "SLC0_RX_START_INT_RAW", + 8, + 1, + "r" + ], + [ + "SLC0_TX_START_INT_RAW", + 9, + 1, + "r" + ], + [ + "SLC0_RX_UDF_INT_RAW", + 10, + 1, + "r" + ], + [ + "SLC0_TX_OVF_INT_RAW", + 11, + 1, + "r" + ], + [ + "SLC0_TOKEN0_1TO0_INT_RAW", + 12, + 1, + "r" + ], + [ + "SLC0_TOKEN1_1TO0_INT_RAW", + 13, + 1, + "r" + ], + [ + "SLC0_TX_DONE_INT_RAW", + 14, + 1, + "r" + ], + [ + "SLC0_TX_SUC_EOF_INT_RAW", + 15, + 1, + "r" + ], + [ + "SLC0_RX_DONE_INT_RAW", + 16, + 1, + "r" + ], + [ + "SLC0_RX_EOF_INT_RAW", + 17, + 1, + "r" + ], + [ + "SLC0_TOHOST_INT_RAW", + 18, + 1, + "r" + ], + [ + "SLC0_TX_DSCR_ERR_INT_RAW", + 19, + 1, + "r" + ], + [ + "SLC0_RX_DSCR_ERR_INT_RAW", + 20, + 1, + "r" + ], + [ + "SLC0_TX_DSCR_EMPTY_INT_RAW", + 21, + 1, + "r" + ], + [ + "SLC0_HOST_RD_ACK_INT_RAW", + 22, + 1, + "r" + ], + [ + "SLC0_WR_RETRY_DONE_INT_RAW", + 23, + 1, + "r" + ], + [ + "SLC0_TX_ERR_EOF_INT_RAW", + 24, + 1, + "r" + ], + [ + "CMD_DTC_INT_RAW", + 25, + 1, + "r" + ], + [ + "SLC0_RX_QUICK_EOF_INT_RAW", + 26, + 1, + "r" + ] + ] + }, + { + "name": "_0INT_ST", + "offset": "0x08", + "fields": [ + [ + "FRHOST_BIT0_INT_ST", + 0, + 1, + "r" + ], + [ + "FRHOST_BIT1_INT_ST", + 1, + 1, + "r" + ], + [ + "FRHOST_BIT2_INT_ST", + 2, + 1, + "r" + ], + [ + "FRHOST_BIT3_INT_ST", + 3, + 1, + "r" + ], + [ + "FRHOST_BIT4_INT_ST", + 4, + 1, + "r" + ], + [ + "FRHOST_BIT5_INT_ST", + 5, + 1, + "r" + ], + [ + "FRHOST_BIT6_INT_ST", + 6, + 1, + "r" + ], + [ + "FRHOST_BIT7_INT_ST", + 7, + 1, + "r" + ], + [ + "SLC0_RX_START_INT_ST", + 8, + 1, + "r" + ], + [ + "SLC0_TX_START_INT_ST", + 9, + 1, + "r" + ], + [ + "SLC0_RX_UDF_INT_ST", + 10, + 1, + "r" + ], + [ + "SLC0_TX_OVF_INT_ST", + 11, + 1, + "r" + ], + [ + "SLC0_TOKEN0_1TO0_INT_ST", + 12, + 1, + "r" + ], + [ + "SLC0_TOKEN1_1TO0_INT_ST", + 13, + 1, + "r" + ], + [ + "SLC0_TX_DONE_INT_ST", + 14, + 1, + "r" + ], + [ + "SLC0_TX_SUC_EOF_INT_ST", + 15, + 1, + "r" + ], + [ + "SLC0_RX_DONE_INT_ST", + 16, + 1, + "r" + ], + [ + "SLC0_RX_EOF_INT_ST", + 17, + 1, + "r" + ], + [ + "SLC0_TOHOST_INT_ST", + 18, + 1, + "r" + ], + [ + "SLC0_TX_DSCR_ERR_INT_ST", + 19, + 1, + "r" + ], + [ + "SLC0_RX_DSCR_ERR_INT_ST", + 20, + 1, + "r" + ], + [ + "SLC0_TX_DSCR_EMPTY_INT_ST", + 21, + 1, + "r" + ], + [ + "SLC0_HOST_RD_ACK_INT_ST", + 22, + 1, + "r" + ], + [ + "SLC0_WR_RETRY_DONE_INT_ST", + 23, + 1, + "r" + ], + [ + "SLC0_TX_ERR_EOF_INT_ST", + 24, + 1, + "r" + ], + [ + "CMD_DTC_INT_ST", + 25, + 1, + "r" + ], + [ + "SLC0_RX_QUICK_EOF_INT_ST", + 26, + 1, + "r" + ] + ] + }, + { + "name": "_0INT_ENA", + "offset": "0x0C", + "fields": [ + [ + "FRHOST_BIT0_INT_ENA", + 0, + 1 + ], + [ + "FRHOST_BIT1_INT_ENA", + 1, + 1 + ], + [ + "FRHOST_BIT2_INT_ENA", + 2, + 1 + ], + [ + "FRHOST_BIT3_INT_ENA", + 3, + 1 + ], + [ + "FRHOST_BIT4_INT_ENA", + 4, + 1 + ], + [ + "FRHOST_BIT5_INT_ENA", + 5, + 1 + ], + [ + "FRHOST_BIT6_INT_ENA", + 6, + 1 + ], + [ + "FRHOST_BIT7_INT_ENA", + 7, + 1 + ], + [ + "SLC0_RX_START_INT_ENA", + 8, + 1 + ], + [ + "SLC0_TX_START_INT_ENA", + 9, + 1 + ], + [ + "SLC0_RX_UDF_INT_ENA", + 10, + 1 + ], + [ + "SLC0_TX_OVF_INT_ENA", + 11, + 1 + ], + [ + "SLC0_TOKEN0_1TO0_INT_ENA", + 12, + 1 + ], + [ + "SLC0_TOKEN1_1TO0_INT_ENA", + 13, + 1 + ], + [ + "SLC0_TX_DONE_INT_ENA", + 14, + 1 + ], + [ + "SLC0_TX_SUC_EOF_INT_ENA", + 15, + 1 + ], + [ + "SLC0_RX_DONE_INT_ENA", + 16, + 1 + ], + [ + "SLC0_RX_EOF_INT_ENA", + 17, + 1 + ], + [ + "SLC0_TOHOST_INT_ENA", + 18, + 1 + ], + [ + "SLC0_TX_DSCR_ERR_INT_ENA", + 19, + 1 + ], + [ + "SLC0_RX_DSCR_ERR_INT_ENA", + 20, + 1 + ], + [ + "SLC0_TX_DSCR_EMPTY_INT_ENA", + 21, + 1 + ], + [ + "SLC0_HOST_RD_ACK_INT_ENA", + 22, + 1 + ], + [ + "SLC0_WR_RETRY_DONE_INT_ENA", + 23, + 1 + ], + [ + "SLC0_TX_ERR_EOF_INT_ENA", + 24, + 1 + ], + [ + "CMD_DTC_INT_ENA", + 25, + 1 + ], + [ + "SLC0_RX_QUICK_EOF_INT_ENA", + 26, + 1 + ] + ] + }, + { + "name": "_0INT_CLR", + "offset": "0x10", + "fields": [ + [ + "FRHOST_BIT0_INT_CLR", + 0, + 1, + "w" + ], + [ + "FRHOST_BIT1_INT_CLR", + 1, + 1, + "w" + ], + [ + "FRHOST_BIT2_INT_CLR", + 2, + 1, + "w" + ], + [ + "FRHOST_BIT3_INT_CLR", + 3, + 1, + "w" + ], + [ + "FRHOST_BIT4_INT_CLR", + 4, + 1, + "w" + ], + [ + "FRHOST_BIT5_INT_CLR", + 5, + 1, + "w" + ], + [ + "FRHOST_BIT6_INT_CLR", + 6, + 1, + "w" + ], + [ + "FRHOST_BIT7_INT_CLR", + 7, + 1, + "w" + ], + [ + "SLC0_RX_START_INT_CLR", + 8, + 1, + "w" + ], + [ + "SLC0_TX_START_INT_CLR", + 9, + 1, + "w" + ], + [ + "SLC0_RX_UDF_INT_CLR", + 10, + 1, + "w" + ], + [ + "SLC0_TX_OVF_INT_CLR", + 11, + 1, + "w" + ], + [ + "SLC0_TOKEN0_1TO0_INT_CLR", + 12, + 1, + "w" + ], + [ + "SLC0_TOKEN1_1TO0_INT_CLR", + 13, + 1, + "w" + ], + [ + "SLC0_TX_DONE_INT_CLR", + 14, + 1, + "w" + ], + [ + "SLC0_TX_SUC_EOF_INT_CLR", + 15, + 1, + "w" + ], + [ + "SLC0_RX_DONE_INT_CLR", + 16, + 1, + "w" + ], + [ + "SLC0_RX_EOF_INT_CLR", + 17, + 1, + "w" + ], + [ + "SLC0_TOHOST_INT_CLR", + 18, + 1, + "w" + ], + [ + "SLC0_TX_DSCR_ERR_INT_CLR", + 19, + 1, + "w" + ], + [ + "SLC0_RX_DSCR_ERR_INT_CLR", + 20, + 1, + "w" + ], + [ + "SLC0_TX_DSCR_EMPTY_INT_CLR", + 21, + 1, + "w" + ], + [ + "SLC0_HOST_RD_ACK_INT_CLR", + 22, + 1, + "w" + ], + [ + "SLC0_WR_RETRY_DONE_INT_CLR", + 23, + 1, + "w" + ], + [ + "SLC0_TX_ERR_EOF_INT_CLR", + 24, + 1, + "w" + ], + [ + "CMD_DTC_INT_CLR", + 25, + 1, + "w" + ], + [ + "SLC0_RX_QUICK_EOF_INT_CLR", + 26, + 1, + "w" + ] + ] + }, + { + "name": "_1INT_RAW", + "offset": "0x14", + "fields": [ + [ + "FRHOST_BIT8_INT_RAW", + 0, + 1, + "r" + ], + [ + "FRHOST_BIT9_INT_RAW", + 1, + 1, + "r" + ], + [ + "FRHOST_BIT10_INT_RAW", + 2, + 1, + "r" + ], + [ + "FRHOST_BIT11_INT_RAW", + 3, + 1, + "r" + ], + [ + "FRHOST_BIT12_INT_RAW", + 4, + 1, + "r" + ], + [ + "FRHOST_BIT13_INT_RAW", + 5, + 1, + "r" + ], + [ + "FRHOST_BIT14_INT_RAW", + 6, + 1, + "r" + ], + [ + "FRHOST_BIT15_INT_RAW", + 7, + 1, + "r" + ], + [ + "SLC1_RX_START_INT_RAW", + 8, + 1, + "r" + ], + [ + "SLC1_TX_START_INT_RAW", + 9, + 1, + "r" + ], + [ + "SLC1_RX_UDF_INT_RAW", + 10, + 1, + "r" + ], + [ + "SLC1_TX_OVF_INT_RAW", + 11, + 1, + "r" + ], + [ + "SLC1_TOKEN0_1TO0_INT_RAW", + 12, + 1, + "r" + ], + [ + "SLC1_TOKEN1_1TO0_INT_RAW", + 13, + 1, + "r" + ], + [ + "SLC1_TX_DONE_INT_RAW", + 14, + 1, + "r" + ], + [ + "SLC1_TX_SUC_EOF_INT_RAW", + 15, + 1, + "r" + ], + [ + "SLC1_RX_DONE_INT_RAW", + 16, + 1, + "r" + ], + [ + "SLC1_RX_EOF_INT_RAW", + 17, + 1, + "r" + ], + [ + "SLC1_TOHOST_INT_RAW", + 18, + 1, + "r" + ], + [ + "SLC1_TX_DSCR_ERR_INT_RAW", + 19, + 1, + "r" + ], + [ + "SLC1_RX_DSCR_ERR_INT_RAW", + 20, + 1, + "r" + ], + [ + "SLC1_TX_DSCR_EMPTY_INT_RAW", + 21, + 1, + "r" + ], + [ + "SLC1_HOST_RD_ACK_INT_RAW", + 22, + 1, + "r" + ], + [ + "SLC1_WR_RETRY_DONE_INT_RAW", + 23, + 1, + "r" + ], + [ + "SLC1_TX_ERR_EOF_INT_RAW", + 24, + 1, + "r" + ] + ] + }, + { + "name": "_1INT_ST", + "offset": "0x18", + "fields": [ + [ + "FRHOST_BIT8_INT_ST", + 0, + 1, + "r" + ], + [ + "FRHOST_BIT9_INT_ST", + 1, + 1, + "r" + ], + [ + "FRHOST_BIT10_INT_ST", + 2, + 1, + "r" + ], + [ + "FRHOST_BIT11_INT_ST", + 3, + 1, + "r" + ], + [ + "FRHOST_BIT12_INT_ST", + 4, + 1, + "r" + ], + [ + "FRHOST_BIT13_INT_ST", + 5, + 1, + "r" + ], + [ + "FRHOST_BIT14_INT_ST", + 6, + 1, + "r" + ], + [ + "FRHOST_BIT15_INT_ST", + 7, + 1, + "r" + ], + [ + "SLC1_RX_START_INT_ST", + 8, + 1, + "r" + ], + [ + "SLC1_TX_START_INT_ST", + 9, + 1, + "r" + ], + [ + "SLC1_RX_UDF_INT_ST", + 10, + 1, + "r" + ], + [ + "SLC1_TX_OVF_INT_ST", + 11, + 1, + "r" + ], + [ + "SLC1_TOKEN0_1TO0_INT_ST", + 12, + 1, + "r" + ], + [ + "SLC1_TOKEN1_1TO0_INT_ST", + 13, + 1, + "r" + ], + [ + "SLC1_TX_DONE_INT_ST", + 14, + 1, + "r" + ], + [ + "SLC1_TX_SUC_EOF_INT_ST", + 15, + 1, + "r" + ], + [ + "SLC1_RX_DONE_INT_ST", + 16, + 1, + "r" + ], + [ + "SLC1_RX_EOF_INT_ST", + 17, + 1, + "r" + ], + [ + "SLC1_TOHOST_INT_ST", + 18, + 1, + "r" + ], + [ + "SLC1_TX_DSCR_ERR_INT_ST", + 19, + 1, + "r" + ], + [ + "SLC1_RX_DSCR_ERR_INT_ST", + 20, + 1, + "r" + ], + [ + "SLC1_TX_DSCR_EMPTY_INT_ST", + 21, + 1, + "r" + ], + [ + "SLC1_HOST_RD_ACK_INT_ST", + 22, + 1, + "r" + ], + [ + "SLC1_WR_RETRY_DONE_INT_ST", + 23, + 1, + "r" + ], + [ + "SLC1_TX_ERR_EOF_INT_ST", + 24, + 1, + "r" + ] + ] + }, + { + "name": "_1INT_ENA", + "offset": "0x1C", + "fields": [ + [ + "FRHOST_BIT8_INT_ENA", + 0, + 1 + ], + [ + "FRHOST_BIT9_INT_ENA", + 1, + 1 + ], + [ + "FRHOST_BIT10_INT_ENA", + 2, + 1 + ], + [ + "FRHOST_BIT11_INT_ENA", + 3, + 1 + ], + [ + "FRHOST_BIT12_INT_ENA", + 4, + 1 + ], + [ + "FRHOST_BIT13_INT_ENA", + 5, + 1 + ], + [ + "FRHOST_BIT14_INT_ENA", + 6, + 1 + ], + [ + "FRHOST_BIT15_INT_ENA", + 7, + 1 + ], + [ + "SLC1_RX_START_INT_ENA", + 8, + 1 + ], + [ + "SLC1_TX_START_INT_ENA", + 9, + 1 + ], + [ + "SLC1_RX_UDF_INT_ENA", + 10, + 1 + ], + [ + "SLC1_TX_OVF_INT_ENA", + 11, + 1 + ], + [ + "SLC1_TOKEN0_1TO0_INT_ENA", + 12, + 1 + ], + [ + "SLC1_TOKEN1_1TO0_INT_ENA", + 13, + 1 + ], + [ + "SLC1_TX_DONE_INT_ENA", + 14, + 1 + ], + [ + "SLC1_TX_SUC_EOF_INT_ENA", + 15, + 1 + ], + [ + "SLC1_RX_DONE_INT_ENA", + 16, + 1 + ], + [ + "SLC1_RX_EOF_INT_ENA", + 17, + 1 + ], + [ + "SLC1_TOHOST_INT_ENA", + 18, + 1 + ], + [ + "SLC1_TX_DSCR_ERR_INT_ENA", + 19, + 1 + ], + [ + "SLC1_RX_DSCR_ERR_INT_ENA", + 20, + 1 + ], + [ + "SLC1_TX_DSCR_EMPTY_INT_ENA", + 21, + 1 + ], + [ + "SLC1_HOST_RD_ACK_INT_ENA", + 22, + 1 + ], + [ + "SLC1_WR_RETRY_DONE_INT_ENA", + 23, + 1 + ], + [ + "SLC1_TX_ERR_EOF_INT_ENA", + 24, + 1 + ] + ] + }, + { + "name": "_1INT_CLR", + "offset": "0x20", + "fields": [ + [ + "FRHOST_BIT8_INT_CLR", + 0, + 1, + "w" + ], + [ + "FRHOST_BIT9_INT_CLR", + 1, + 1, + "w" + ], + [ + "FRHOST_BIT10_INT_CLR", + 2, + 1, + "w" + ], + [ + "FRHOST_BIT11_INT_CLR", + 3, + 1, + "w" + ], + [ + "FRHOST_BIT12_INT_CLR", + 4, + 1, + "w" + ], + [ + "FRHOST_BIT13_INT_CLR", + 5, + 1, + "w" + ], + [ + "FRHOST_BIT14_INT_CLR", + 6, + 1, + "w" + ], + [ + "FRHOST_BIT15_INT_CLR", + 7, + 1, + "w" + ], + [ + "SLC1_RX_START_INT_CLR", + 8, + 1, + "w" + ], + [ + "SLC1_TX_START_INT_CLR", + 9, + 1, + "w" + ], + [ + "SLC1_RX_UDF_INT_CLR", + 10, + 1, + "w" + ], + [ + "SLC1_TX_OVF_INT_CLR", + 11, + 1, + "w" + ], + [ + "SLC1_TOKEN0_1TO0_INT_CLR", + 12, + 1, + "w" + ], + [ + "SLC1_TOKEN1_1TO0_INT_CLR", + 13, + 1, + "w" + ], + [ + "SLC1_TX_DONE_INT_CLR", + 14, + 1, + "w" + ], + [ + "SLC1_TX_SUC_EOF_INT_CLR", + 15, + 1, + "w" + ], + [ + "SLC1_RX_DONE_INT_CLR", + 16, + 1, + "w" + ], + [ + "SLC1_RX_EOF_INT_CLR", + 17, + 1, + "w" + ], + [ + "SLC1_TOHOST_INT_CLR", + 18, + 1, + "w" + ], + [ + "SLC1_TX_DSCR_ERR_INT_CLR", + 19, + 1, + "w" + ], + [ + "SLC1_RX_DSCR_ERR_INT_CLR", + 20, + 1, + "w" + ], + [ + "SLC1_TX_DSCR_EMPTY_INT_CLR", + 21, + 1, + "w" + ], + [ + "SLC1_HOST_RD_ACK_INT_CLR", + 22, + 1, + "w" + ], + [ + "SLC1_WR_RETRY_DONE_INT_CLR", + 23, + 1, + "w" + ], + [ + "SLC1_TX_ERR_EOF_INT_CLR", + 24, + 1, + "w" + ] + ] + }, + { + "name": "RX_STATUS", + "offset": "0x24", + "reset": "0x00020002", + "fields": [ + [ + "SLC0_RX_FULL", + 0, + 1, + "r" + ], + [ + "SLC0_RX_EMPTY", + 1, + 1, + "r" + ], + [ + "SLC1_RX_FULL", + 16, + 1, + "r" + ], + [ + "SLC1_RX_EMPTY", + 17, + 1, + "r" + ] + ] + }, + { + "name": "_0RXFIFO_PUSH", + "offset": "0x28", + "fields": [ + [ + "SLC0_RXFIFO_WDATA", + 0, + 9 + ], + [ + "SLC0_RXFIFO_PUSH", + 16, + 1 + ] + ] + }, + { + "name": "_1RXFIFO_PUSH", + "offset": "0x2C", + "fields": [ + [ + "SLC1_RXFIFO_WDATA", + 0, + 9 + ], + [ + "SLC1_RXFIFO_PUSH", + 16, + 1 + ] + ] + }, + { + "name": "TX_STATUS", + "offset": "0x30", + "reset": "0x00020002", + "fields": [ + [ + "SLC0_TX_FULL", + 0, + 1, + "r" + ], + [ + "SLC0_TX_EMPTY", + 1, + 1, + "r" + ], + [ + "SLC1_TX_FULL", + 16, + 1, + "r" + ], + [ + "SLC1_TX_EMPTY", + 17, + 1, + "r" + ] + ] + }, + { + "name": "_0TXFIFO_POP", + "offset": "0x34", + "fields": [ + [ + "SLC0_TXFIFO_RDATA", + 0, + 11, + "r" + ], + [ + "SLC0_TXFIFO_POP", + 16, + 1 + ] + ] + }, + { + "name": "_1TXFIFO_POP", + "offset": "0x38", + "fields": [ + [ + "SLC1_TXFIFO_RDATA", + 0, + 11, + "r" + ], + [ + "SLC1_TXFIFO_POP", + 16, + 1 + ] + ] + }, + { + "name": "_0RX_LINK", + "offset": "0x3C", + "fields": [ + [ + "SLC0_RXLINK_ADDR", + 0, + 20 + ], + [ + "SLC0_RXLINK_STOP", + 28, + 1 + ], + [ + "SLC0_RXLINK_START", + 29, + 1 + ], + [ + "SLC0_RXLINK_RESTART", + 30, + 1 + ], + [ + "SLC0_RXLINK_PARK", + 31, + 1, + "r" + ] + ] + }, + { + "name": "_0TX_LINK", + "offset": "0x40", + "fields": [ + [ + "SLC0_TXLINK_ADDR", + 0, + 20 + ], + [ + "SLC0_TXLINK_STOP", + 28, + 1 + ], + [ + "SLC0_TXLINK_START", + 29, + 1 + ], + [ + "SLC0_TXLINK_RESTART", + 30, + 1 + ], + [ + "SLC0_TXLINK_PARK", + 31, + 1, + "r" + ] + ] + }, + { + "name": "_1RX_LINK", + "offset": "0x44", + "reset": "0x00100000", + "fields": [ + [ + "SLC1_RXLINK_ADDR", + 0, + 20 + ], + [ + "SLC1_BT_PACKET", + 20, + 1 + ], + [ + "SLC1_RXLINK_STOP", + 28, + 1 + ], + [ + "SLC1_RXLINK_START", + 29, + 1 + ], + [ + "SLC1_RXLINK_RESTART", + 30, + 1 + ], + [ + "SLC1_RXLINK_PARK", + 31, + 1, + "r" + ] + ] + }, + { + "name": "_1TX_LINK", + "offset": "0x48", + "fields": [ + [ + "SLC1_TXLINK_ADDR", + 0, + 20 + ], + [ + "SLC1_TXLINK_STOP", + 28, + 1 + ], + [ + "SLC1_TXLINK_START", + 29, + 1 + ], + [ + "SLC1_TXLINK_RESTART", + 30, + 1 + ], + [ + "SLC1_TXLINK_PARK", + 31, + 1, + "r" + ] + ] + }, + { + "name": "INTVEC_TOHOST", + "offset": "0x4C", + "fields": [ + [ + "SLC0_TOHOST_INTVEC", + 0, + 8, + "w" + ], + [ + "SLC1_TOHOST_INTVEC", + 16, + 8, + "w" + ] + ] + }, + { + "name": "_0TOKEN0", + "offset": "0x50", + "fields": [ + [ + "SLC0_TOKEN0_WDATA", + 0, + 12, + "w" + ], + [ + "SLC0_TOKEN0_WR", + 12, + 1, + "w" + ], + [ + "SLC0_TOKEN0_INC", + 13, + 1, + "w" + ], + [ + "SLC0_TOKEN0_INC_MORE", + 14, + 1, + "w" + ], + [ + "SLC0_TOKEN0", + 16, + 12, + "r" + ] + ] + }, + { + "name": "_0TOKEN1", + "offset": "0x54", + "fields": [ + [ + "SLC0_TOKEN1_WDATA", + 0, + 12, + "w" + ], + [ + "SLC0_TOKEN1_WR", + 12, + 1, + "w" + ], + [ + "SLC0_TOKEN1_INC", + 13, + 1, + "w" + ], + [ + "SLC0_TOKEN1_INC_MORE", + 14, + 1, + "w" + ], + [ + "SLC0_TOKEN1", + 16, + 12, + "r" + ] + ] + }, + { + "name": "_1TOKEN0", + "offset": "0x58", + "fields": [ + [ + "SLC1_TOKEN0_WDATA", + 0, + 12, + "w" + ], + [ + "SLC1_TOKEN0_WR", + 12, + 1, + "w" + ], + [ + "SLC1_TOKEN0_INC", + 13, + 1, + "w" + ], + [ + "SLC1_TOKEN0_INC_MORE", + 14, + 1, + "w" + ], + [ + "SLC1_TOKEN0", + 16, + 12, + "r" + ] + ] + }, + { + "name": "_1TOKEN1", + "offset": "0x5C", + "fields": [ + [ + "SLC1_TOKEN1_WDATA", + 0, + 12, + "w" + ], + [ + "SLC1_TOKEN1_WR", + 12, + 1, + "w" + ], + [ + "SLC1_TOKEN1_INC", + 13, + 1, + "w" + ], + [ + "SLC1_TOKEN1_INC_MORE", + 14, + 1, + "w" + ], + [ + "SLC1_TOKEN1", + 16, + 12, + "r" + ] + ] + }, + { + "name": "CONF1", + "offset": "0x60", + "reset": "0x00300078", + "fields": [ + [ + "SLC0_CHECK_OWNER", + 0, + 1 + ], + [ + "SLC0_TX_CHECK_SUM_EN", + 1, + 1 + ], + [ + "SLC0_RX_CHECK_SUM_EN", + 2, + 1 + ], + [ + "CMD_HOLD_EN", + 3, + 1 + ], + [ + "SLC0_LEN_AUTO_CLR", + 4, + 1 + ], + [ + "SLC0_TX_STITCH_EN", + 5, + 1 + ], + [ + "SLC0_RX_STITCH_EN", + 6, + 1 + ], + [ + "SLC1_CHECK_OWNER", + 16, + 1 + ], + [ + "SLC1_TX_CHECK_SUM_EN", + 17, + 1 + ], + [ + "SLC1_RX_CHECK_SUM_EN", + 18, + 1 + ], + [ + "HOST_INT_LEVEL_SEL", + 19, + 1 + ], + [ + "SLC1_TX_STITCH_EN", + 20, + 1 + ], + [ + "SLC1_RX_STITCH_EN", + 21, + 1 + ], + [ + "CLK_EN", + 22, + 1 + ] + ] + }, + { + "name": "_0_STATE0", + "offset": "0x64", + "fields": [ + [ + "SLC0_STATE0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_STATE1", + "offset": "0x68", + "fields": [ + [ + "SLC0_STATE1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_STATE0", + "offset": "0x6C", + "fields": [ + [ + "SLC1_STATE0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_STATE1", + "offset": "0x70", + "fields": [ + [ + "SLC1_STATE1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BRIDGE_CONF", + "offset": "0x74", + "reset": "0x000A7720", + "fields": [ + [ + "TXEOF_ENA", + 0, + 6 + ], + [ + "FIFO_MAP_ENA", + 8, + 4 + ], + [ + "SLC0_TX_DUMMY_MODE", + 12, + 1 + ], + [ + "HDA_MAP_128K", + 13, + 1 + ], + [ + "SLC1_TX_DUMMY_MODE", + 14, + 1 + ], + [ + "TX_PUSH_IDLE_NUM", + 16, + 16 + ] + ] + }, + { + "name": "_0_TO_EOF_DES_ADDR", + "offset": "0x78", + "fields": [ + [ + "SLC0_TO_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_TX_EOF_DES_ADDR", + "offset": "0x7C", + "fields": [ + [ + "SLC0_TX_SUC_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_TO_EOF_BFR_DES_ADDR", + "offset": "0x80", + "fields": [ + [ + "SLC0_TO_EOF_BFR_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_TO_EOF_DES_ADDR", + "offset": "0x84", + "fields": [ + [ + "SLC1_TO_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_TX_EOF_DES_ADDR", + "offset": "0x88", + "fields": [ + [ + "SLC1_TX_SUC_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_TO_EOF_BFR_DES_ADDR", + "offset": "0x8C", + "fields": [ + [ + "SLC1_TO_EOF_BFR_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "AHB_TEST", + "offset": "0x90", + "fields": [ + [ + "AHB_TESTMODE", + 0, + 3 + ], + [ + "AHB_TESTADDR", + 4, + 2 + ] + ] + }, + { + "name": "SDIO_ST", + "offset": "0x94", + "fields": [ + [ + "CMD_ST", + 0, + 3, + "r" + ], + [ + "FUNC_ST", + 4, + 4, + "r" + ], + [ + "SDIO_WAKEUP", + 8, + 1, + "r" + ], + [ + "BUS_ST", + 12, + 3, + "r" + ], + [ + "FUNC1_ACC_STATE", + 16, + 5, + "r" + ], + [ + "FUNC2_ACC_STATE", + 24, + 5, + "r" + ] + ] + }, + { + "name": "RX_DSCR_CONF", + "offset": "0x98", + "reset": "0x101B101A", + "fields": [ + [ + "SLC0_TOKEN_NO_REPLACE", + 0, + 1 + ], + [ + "SLC0_INFOR_NO_REPLACE", + 1, + 1 + ], + [ + "SLC0_RX_FILL_MODE", + 2, + 1 + ], + [ + "SLC0_RX_EOF_MODE", + 3, + 1 + ], + [ + "SLC0_RX_FILL_EN", + 4, + 1 + ], + [ + "SLC0_RD_RETRY_THRESHOLD", + 5, + 11 + ], + [ + "SLC1_TOKEN_NO_REPLACE", + 16, + 1 + ], + [ + "SLC1_INFOR_NO_REPLACE", + 17, + 1 + ], + [ + "SLC1_RX_FILL_MODE", + 18, + 1 + ], + [ + "SLC1_RX_EOF_MODE", + 19, + 1 + ], + [ + "SLC1_RX_FILL_EN", + 20, + 1 + ], + [ + "SLC1_RD_RETRY_THRESHOLD", + 21, + 11 + ] + ] + }, + { + "name": "_0_TXLINK_DSCR", + "offset": "0x9C", + "fields": [ + [ + "SLC0_TXLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_TXLINK_DSCR_BF0", + "offset": "0xA0", + "fields": [ + [ + "SLC0_TXLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_TXLINK_DSCR_BF1", + "offset": "0xA4", + "fields": [ + [ + "SLC0_TXLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_RXLINK_DSCR", + "offset": "0xA8", + "fields": [ + [ + "SLC0_RXLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_RXLINK_DSCR_BF0", + "offset": "0xAC", + "fields": [ + [ + "SLC0_RXLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_RXLINK_DSCR_BF1", + "offset": "0xB0", + "fields": [ + [ + "SLC0_RXLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_TXLINK_DSCR", + "offset": "0xB4", + "fields": [ + [ + "SLC1_TXLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_TXLINK_DSCR_BF0", + "offset": "0xB8", + "fields": [ + [ + "SLC1_TXLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_TXLINK_DSCR_BF1", + "offset": "0xBC", + "fields": [ + [ + "SLC1_TXLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_RXLINK_DSCR", + "offset": "0xC0", + "fields": [ + [ + "SLC1_RXLINK_DSCR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_RXLINK_DSCR_BF0", + "offset": "0xC4", + "fields": [ + [ + "SLC1_RXLINK_DSCR_BF0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_RXLINK_DSCR_BF1", + "offset": "0xC8", + "fields": [ + [ + "SLC1_RXLINK_DSCR_BF1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_TX_ERREOF_DES_ADDR", + "offset": "0xCC", + "fields": [ + [ + "SLC0_TX_ERR_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_1_TX_ERREOF_DES_ADDR", + "offset": "0xD0", + "fields": [ + [ + "SLC1_TX_ERR_EOF_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "TOKEN_LAT", + "offset": "0xD4", + "fields": [ + [ + "SLC0_TOKEN", + 0, + 12, + "r" + ], + [ + "SLC1_TOKEN", + 16, + 12, + "r" + ] + ] + }, + { + "name": "TX_DSCR_CONF", + "offset": "0xD8", + "reset": "0x00000080", + "fields": [ + [ + "WR_RETRY_THRESHOLD", + 0, + 11 + ] + ] + }, + { + "name": "CMD_INFOR0", + "offset": "0xDC", + "fields": [ + [ + "CMD_CONTENT0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CMD_INFOR1", + "offset": "0xE0", + "fields": [ + [ + "CMD_CONTENT1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_LEN_CONF", + "offset": "0xE4", + "fields": [ + [ + "SLC0_LEN_WDATA", + 0, + 20, + "w" + ], + [ + "SLC0_LEN_WR", + 20, + 1, + "w" + ], + [ + "SLC0_LEN_INC", + 21, + 1, + "w" + ], + [ + "SLC0_LEN_INC_MORE", + 22, + 1, + "w" + ], + [ + "SLC0_RX_PACKET_LOAD_EN", + 23, + 1 + ], + [ + "SLC0_TX_PACKET_LOAD_EN", + 24, + 1 + ], + [ + "SLC0_RX_GET_USED_DSCR", + 25, + 1, + "w" + ], + [ + "SLC0_TX_GET_USED_DSCR", + 26, + 1, + "w" + ], + [ + "SLC0_RX_NEW_PKT_IND", + 27, + 1, + "r" + ], + [ + "SLC0_TX_NEW_PKT_IND", + 28, + 1, + "r" + ] + ] + }, + { + "name": "_0_LENGTH", + "offset": "0xE8", + "fields": [ + [ + "SLC0_LEN", + 0, + 20, + "r" + ] + ] + }, + { + "name": "_0_TXPKT_H_DSCR", + "offset": "0xEC", + "fields": [ + [ + "SLC0_TX_PKT_H_DSCR_ADDR", + 0, + 32 + ] + ] + }, + { + "name": "_0_TXPKT_E_DSCR", + "offset": "0xF0", + "fields": [ + [ + "SLC0_TX_PKT_E_DSCR_ADDR", + 0, + 32 + ] + ] + }, + { + "name": "_0_RXPKT_H_DSCR", + "offset": "0xF4", + "fields": [ + [ + "SLC0_RX_PKT_H_DSCR_ADDR", + 0, + 32 + ] + ] + }, + { + "name": "_0_RXPKT_E_DSCR", + "offset": "0xF8", + "fields": [ + [ + "SLC0_RX_PKT_E_DSCR_ADDR", + 0, + 32 + ] + ] + }, + { + "name": "_0_TXPKTU_H_DSCR", + "offset": "0xFC", + "fields": [ + [ + "SLC0_TX_PKT_START_DSCR_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_TXPKTU_E_DSCR", + "offset": "0x100", + "fields": [ + [ + "SLC0_TX_PKT_END_DSCR_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_RXPKTU_H_DSCR", + "offset": "0x104", + "fields": [ + [ + "SLC0_RX_PKT_START_DSCR_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_RXPKTU_E_DSCR", + "offset": "0x108", + "fields": [ + [ + "SLC0_RX_PKT_END_DSCR_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "SEQ_POSITION", + "offset": "0x114", + "reset": "0x00000509", + "fields": [ + [ + "SLC0_SEQ_POSITION", + 0, + 8 + ], + [ + "SLC1_SEQ_POSITION", + 8, + 8 + ] + ] + }, + { + "name": "_0_DSCR_REC_CONF", + "offset": "0x118", + "reset": "0x000003FF", + "fields": [ + [ + "SLC0_RX_DSCR_REC_LIM", + 0, + 10 + ] + ] + }, + { + "name": "SDIO_CRC_ST0", + "offset": "0x11C", + "fields": [ + [ + "DAT0_CRC_ERR_CNT", + 0, + 8, + "r" + ], + [ + "DAT1_CRC_ERR_CNT", + 8, + 8, + "r" + ], + [ + "DAT2_CRC_ERR_CNT", + 16, + 8, + "r" + ], + [ + "DAT3_CRC_ERR_CNT", + 24, + 8, + "r" + ] + ] + }, + { + "name": "SDIO_CRC_ST1", + "offset": "0x120", + "fields": [ + [ + "CMD_CRC_ERR_CNT", + 0, + 8, + "r" + ], + [ + "ERR_CNT_CLR", + 31, + 1 + ] + ] + }, + { + "name": "_0_EOF_START_DES", + "offset": "0x124", + "fields": [ + [ + "SLC0_EOF_START_DES_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_PUSH_DSCR_ADDR", + "offset": "0x128", + "fields": [ + [ + "SLC0_RX_PUSH_DSCR_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_DONE_DSCR_ADDR", + "offset": "0x12C", + "fields": [ + [ + "SLC0_RX_DONE_DSCR_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_SUB_START_DES", + "offset": "0x130", + "fields": [ + [ + "SLC0_SUB_PAC_START_DSCR_ADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "_0_DSCR_CNT", + "offset": "0x134", + "fields": [ + [ + "SLC0_RX_DSCR_CNT_LAT", + 0, + 10, + "r" + ], + [ + "SLC0_RX_GET_EOF_OCC", + 16, + 1, + "r" + ] + ] + }, + { + "name": "_0_LEN_LIM_CONF", + "offset": "0x138", + "reset": "0x00005400", + "fields": [ + [ + "SLC0_LEN_LIM", + 0, + 20 + ] + ] + }, + { + "name": "_0INT_ST1", + "offset": "0x13C", + "fields": [ + [ + "FRHOST_BIT0_INT_ST1", + 0, + 1, + "r" + ], + [ + "FRHOST_BIT1_INT_ST1", + 1, + 1, + "r" + ], + [ + "FRHOST_BIT2_INT_ST1", + 2, + 1, + "r" + ], + [ + "FRHOST_BIT3_INT_ST1", + 3, + 1, + "r" + ], + [ + "FRHOST_BIT4_INT_ST1", + 4, + 1, + "r" + ], + [ + "FRHOST_BIT5_INT_ST1", + 5, + 1, + "r" + ], + [ + "FRHOST_BIT6_INT_ST1", + 6, + 1, + "r" + ], + [ + "FRHOST_BIT7_INT_ST1", + 7, + 1, + "r" + ], + [ + "SLC0_RX_START_INT_ST1", + 8, + 1, + "r" + ], + [ + "SLC0_TX_START_INT_ST1", + 9, + 1, + "r" + ], + [ + "SLC0_RX_UDF_INT_ST1", + 10, + 1, + "r" + ], + [ + "SLC0_TX_OVF_INT_ST1", + 11, + 1, + "r" + ], + [ + "SLC0_TOKEN0_1TO0_INT_ST1", + 12, + 1, + "r" + ], + [ + "SLC0_TOKEN1_1TO0_INT_ST1", + 13, + 1, + "r" + ], + [ + "SLC0_TX_DONE_INT_ST1", + 14, + 1, + "r" + ], + [ + "SLC0_TX_SUC_EOF_INT_ST1", + 15, + 1, + "r" + ], + [ + "SLC0_RX_DONE_INT_ST1", + 16, + 1, + "r" + ], + [ + "SLC0_RX_EOF_INT_ST1", + 17, + 1, + "r" + ], + [ + "SLC0_TOHOST_INT_ST1", + 18, + 1, + "r" + ], + [ + "SLC0_TX_DSCR_ERR_INT_ST1", + 19, + 1, + "r" + ], + [ + "SLC0_RX_DSCR_ERR_INT_ST1", + 20, + 1, + "r" + ], + [ + "SLC0_TX_DSCR_EMPTY_INT_ST1", + 21, + 1, + "r" + ], + [ + "SLC0_HOST_RD_ACK_INT_ST1", + 22, + 1, + "r" + ], + [ + "SLC0_WR_RETRY_DONE_INT_ST1", + 23, + 1, + "r" + ], + [ + "SLC0_TX_ERR_EOF_INT_ST1", + 24, + 1, + "r" + ], + [ + "CMD_DTC_INT_ST1", + 25, + 1, + "r" + ], + [ + "SLC0_RX_QUICK_EOF_INT_ST1", + 26, + 1, + "r" + ] + ] + }, + { + "name": "_0INT_ENA1", + "offset": "0x140", + "fields": [ + [ + "FRHOST_BIT0_INT_ENA1", + 0, + 1 + ], + [ + "FRHOST_BIT1_INT_ENA1", + 1, + 1 + ], + [ + "FRHOST_BIT2_INT_ENA1", + 2, + 1 + ], + [ + "FRHOST_BIT3_INT_ENA1", + 3, + 1 + ], + [ + "FRHOST_BIT4_INT_ENA1", + 4, + 1 + ], + [ + "FRHOST_BIT5_INT_ENA1", + 5, + 1 + ], + [ + "FRHOST_BIT6_INT_ENA1", + 6, + 1 + ], + [ + "FRHOST_BIT7_INT_ENA1", + 7, + 1 + ], + [ + "SLC0_RX_START_INT_ENA1", + 8, + 1 + ], + [ + "SLC0_TX_START_INT_ENA1", + 9, + 1 + ], + [ + "SLC0_RX_UDF_INT_ENA1", + 10, + 1 + ], + [ + "SLC0_TX_OVF_INT_ENA1", + 11, + 1 + ], + [ + "SLC0_TOKEN0_1TO0_INT_ENA1", + 12, + 1 + ], + [ + "SLC0_TOKEN1_1TO0_INT_ENA1", + 13, + 1 + ], + [ + "SLC0_TX_DONE_INT_ENA1", + 14, + 1 + ], + [ + "SLC0_TX_SUC_EOF_INT_ENA1", + 15, + 1 + ], + [ + "SLC0_RX_DONE_INT_ENA1", + 16, + 1 + ], + [ + "SLC0_RX_EOF_INT_ENA1", + 17, + 1 + ], + [ + "SLC0_TOHOST_INT_ENA1", + 18, + 1 + ], + [ + "SLC0_TX_DSCR_ERR_INT_ENA1", + 19, + 1 + ], + [ + "SLC0_RX_DSCR_ERR_INT_ENA1", + 20, + 1 + ], + [ + "SLC0_TX_DSCR_EMPTY_INT_ENA1", + 21, + 1 + ], + [ + "SLC0_HOST_RD_ACK_INT_ENA1", + 22, + 1 + ], + [ + "SLC0_WR_RETRY_DONE_INT_ENA1", + 23, + 1 + ], + [ + "SLC0_TX_ERR_EOF_INT_ENA1", + 24, + 1 + ], + [ + "CMD_DTC_INT_ENA1", + 25, + 1 + ], + [ + "SLC0_RX_QUICK_EOF_INT_ENA1", + 26, + 1 + ] + ] + }, + { + "name": "_1INT_ST1", + "offset": "0x144", + "fields": [ + [ + "FRHOST_BIT8_INT_ST1", + 0, + 1, + "r" + ], + [ + "FRHOST_BIT9_INT_ST1", + 1, + 1, + "r" + ], + [ + "FRHOST_BIT10_INT_ST1", + 2, + 1, + "r" + ], + [ + "FRHOST_BIT11_INT_ST1", + 3, + 1, + "r" + ], + [ + "FRHOST_BIT12_INT_ST1", + 4, + 1, + "r" + ], + [ + "FRHOST_BIT13_INT_ST1", + 5, + 1, + "r" + ], + [ + "FRHOST_BIT14_INT_ST1", + 6, + 1, + "r" + ], + [ + "FRHOST_BIT15_INT_ST1", + 7, + 1, + "r" + ], + [ + "SLC1_RX_START_INT_ST1", + 8, + 1, + "r" + ], + [ + "SLC1_TX_START_INT_ST1", + 9, + 1, + "r" + ], + [ + "SLC1_RX_UDF_INT_ST1", + 10, + 1, + "r" + ], + [ + "SLC1_TX_OVF_INT_ST1", + 11, + 1, + "r" + ], + [ + "SLC1_TOKEN0_1TO0_INT_ST1", + 12, + 1, + "r" + ], + [ + "SLC1_TOKEN1_1TO0_INT_ST1", + 13, + 1, + "r" + ], + [ + "SLC1_TX_DONE_INT_ST1", + 14, + 1, + "r" + ], + [ + "SLC1_TX_SUC_EOF_INT_ST1", + 15, + 1, + "r" + ], + [ + "SLC1_RX_DONE_INT_ST1", + 16, + 1, + "r" + ], + [ + "SLC1_RX_EOF_INT_ST1", + 17, + 1, + "r" + ], + [ + "SLC1_TOHOST_INT_ST1", + 18, + 1, + "r" + ], + [ + "SLC1_TX_DSCR_ERR_INT_ST1", + 19, + 1, + "r" + ], + [ + "SLC1_RX_DSCR_ERR_INT_ST1", + 20, + 1, + "r" + ], + [ + "SLC1_TX_DSCR_EMPTY_INT_ST1", + 21, + 1, + "r" + ], + [ + "SLC1_HOST_RD_ACK_INT_ST1", + 22, + 1, + "r" + ], + [ + "SLC1_WR_RETRY_DONE_INT_ST1", + 23, + 1, + "r" + ], + [ + "SLC1_TX_ERR_EOF_INT_ST1", + 24, + 1, + "r" + ] + ] + }, + { + "name": "_1INT_ENA1", + "offset": "0x148", + "fields": [ + [ + "FRHOST_BIT8_INT_ENA1", + 0, + 1 + ], + [ + "FRHOST_BIT9_INT_ENA1", + 1, + 1 + ], + [ + "FRHOST_BIT10_INT_ENA1", + 2, + 1 + ], + [ + "FRHOST_BIT11_INT_ENA1", + 3, + 1 + ], + [ + "FRHOST_BIT12_INT_ENA1", + 4, + 1 + ], + [ + "FRHOST_BIT13_INT_ENA1", + 5, + 1 + ], + [ + "FRHOST_BIT14_INT_ENA1", + 6, + 1 + ], + [ + "FRHOST_BIT15_INT_ENA1", + 7, + 1 + ], + [ + "SLC1_RX_START_INT_ENA1", + 8, + 1 + ], + [ + "SLC1_TX_START_INT_ENA1", + 9, + 1 + ], + [ + "SLC1_RX_UDF_INT_ENA1", + 10, + 1 + ], + [ + "SLC1_TX_OVF_INT_ENA1", + 11, + 1 + ], + [ + "SLC1_TOKEN0_1TO0_INT_ENA1", + 12, + 1 + ], + [ + "SLC1_TOKEN1_1TO0_INT_ENA1", + 13, + 1 + ], + [ + "SLC1_TX_DONE_INT_ENA1", + 14, + 1 + ], + [ + "SLC1_TX_SUC_EOF_INT_ENA1", + 15, + 1 + ], + [ + "SLC1_RX_DONE_INT_ENA1", + 16, + 1 + ], + [ + "SLC1_RX_EOF_INT_ENA1", + 17, + 1 + ], + [ + "SLC1_TOHOST_INT_ENA1", + 18, + 1 + ], + [ + "SLC1_TX_DSCR_ERR_INT_ENA1", + 19, + 1 + ], + [ + "SLC1_RX_DSCR_ERR_INT_ENA1", + 20, + 1 + ], + [ + "SLC1_TX_DSCR_EMPTY_INT_ENA1", + 21, + 1 + ], + [ + "SLC1_HOST_RD_ACK_INT_ENA1", + 22, + 1 + ], + [ + "SLC1_WR_RETRY_DONE_INT_ENA1", + 23, + 1 + ], + [ + "SLC1_TX_ERR_EOF_INT_ENA1", + 24, + 1 + ] + ] + }, + { + "name": "DATE", + "offset": "0x1F8", + "reset": "0x16022500", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + }, + { + "name": "ID", + "offset": "0x1FC", + "reset": "0x00000100", + "fields": [ + [ + "ID", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "LEDC", + "base": "0x3FF59000", + "interrupts": [ + "LEDC", + "TIMER1", + "TIMER2" + ], + "registers": [ + { + "name": "HSCH0_CONF0", + "offset": "0x00", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ] + ] + }, + { + "name": "HSCH1_CONF0", + "offset": "0x14", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ] + ] + }, + { + "name": "HSCH2_CONF0", + "offset": "0x28", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ] + ] + }, + { + "name": "HSCH3_CONF0", + "offset": "0x3C", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ] + ] + }, + { + "name": "HSCH4_CONF0", + "offset": "0x50", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ] + ] + }, + { + "name": "HSCH5_CONF0", + "offset": "0x64", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ] + ] + }, + { + "name": "HSCH6_CONF0", + "offset": "0x78", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ] + ] + }, + { + "name": "HSCH7_CONF0", + "offset": "0x8C", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ] + ] + }, + { + "name": "HSCH0_HPOINT", + "offset": "0x04", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "HSCH1_HPOINT", + "offset": "0x18", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "HSCH2_HPOINT", + "offset": "0x2C", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "HSCH3_HPOINT", + "offset": "0x40", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "HSCH4_HPOINT", + "offset": "0x54", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "HSCH5_HPOINT", + "offset": "0x68", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "HSCH6_HPOINT", + "offset": "0x7C", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "HSCH7_HPOINT", + "offset": "0x90", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "HSCH0_DUTY", + "offset": "0x08", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "HSCH1_DUTY", + "offset": "0x1C", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "HSCH2_DUTY", + "offset": "0x30", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "HSCH3_DUTY", + "offset": "0x44", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "HSCH4_DUTY", + "offset": "0x58", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "HSCH5_DUTY", + "offset": "0x6C", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "HSCH6_DUTY", + "offset": "0x80", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "HSCH7_DUTY", + "offset": "0x94", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "HSCH0_CONF1", + "offset": "0x0C", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "HSCH1_CONF1", + "offset": "0x20", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "HSCH2_CONF1", + "offset": "0x34", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "HSCH3_CONF1", + "offset": "0x48", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "HSCH4_CONF1", + "offset": "0x5C", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "HSCH5_CONF1", + "offset": "0x70", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "HSCH6_CONF1", + "offset": "0x84", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "HSCH7_CONF1", + "offset": "0x98", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "HSCH0_DUTY_R", + "offset": "0x10", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "HSCH1_DUTY_R", + "offset": "0x24", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "HSCH2_DUTY_R", + "offset": "0x38", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "HSCH3_DUTY_R", + "offset": "0x4C", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "HSCH4_DUTY_R", + "offset": "0x60", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "HSCH5_DUTY_R", + "offset": "0x74", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "HSCH6_DUTY_R", + "offset": "0x88", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "HSCH7_DUTY_R", + "offset": "0x9C", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "LSCH0_CONF0", + "offset": "0xA0", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ], + [ + "PARA_UP", + 4, + 1 + ] + ] + }, + { + "name": "LSCH1_CONF0", + "offset": "0xB4", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ], + [ + "PARA_UP", + 4, + 1 + ] + ] + }, + { + "name": "LSCH2_CONF0", + "offset": "0xC8", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ], + [ + "PARA_UP", + 4, + 1 + ] + ] + }, + { + "name": "LSCH3_CONF0", + "offset": "0xDC", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ], + [ + "PARA_UP", + 4, + 1 + ] + ] + }, + { + "name": "LSCH4_CONF0", + "offset": "0xF0", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ], + [ + "PARA_UP", + 4, + 1 + ] + ] + }, + { + "name": "LSCH5_CONF0", + "offset": "0x104", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ], + [ + "PARA_UP", + 4, + 1 + ] + ] + }, + { + "name": "LSCH6_CONF0", + "offset": "0x118", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ], + [ + "PARA_UP", + 4, + 1 + ] + ] + }, + { + "name": "LSCH7_CONF0", + "offset": "0x12C", + "fields": [ + [ + "TIMER_SEL", + 0, + 2 + ], + [ + "SIG_OUT_EN", + 2, + 1 + ], + [ + "IDLE_LV", + 3, + 1 + ], + [ + "PARA_UP", + 4, + 1 + ] + ] + }, + { + "name": "LSCH0_HPOINT", + "offset": "0xA4", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "LSCH1_HPOINT", + "offset": "0xB8", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "LSCH2_HPOINT", + "offset": "0xCC", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "LSCH3_HPOINT", + "offset": "0xE0", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "LSCH4_HPOINT", + "offset": "0xF4", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "LSCH5_HPOINT", + "offset": "0x108", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "LSCH6_HPOINT", + "offset": "0x11C", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "LSCH7_HPOINT", + "offset": "0x130", + "fields": [ + [ + "HPOINT", + 0, + 20 + ] + ] + }, + { + "name": "LSCH0_DUTY", + "offset": "0xA8", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "LSCH1_DUTY", + "offset": "0xBC", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "LSCH2_DUTY", + "offset": "0xD0", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "LSCH3_DUTY", + "offset": "0xE4", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "LSCH4_DUTY", + "offset": "0xF8", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "LSCH5_DUTY", + "offset": "0x10C", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "LSCH6_DUTY", + "offset": "0x120", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "LSCH7_DUTY", + "offset": "0x134", + "fields": [ + [ + "DUTY", + 0, + 25 + ] + ] + }, + { + "name": "LSCH0_CONF1", + "offset": "0xAC", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "LSCH1_CONF1", + "offset": "0xC0", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "LSCH2_CONF1", + "offset": "0xD4", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "LSCH3_CONF1", + "offset": "0xE8", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "LSCH4_CONF1", + "offset": "0xFC", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "LSCH5_CONF1", + "offset": "0x110", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "LSCH6_CONF1", + "offset": "0x124", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "LSCH7_CONF1", + "offset": "0x138", + "reset": "0x40000000", + "fields": [ + [ + "DUTY_SCALE", + 0, + 10 + ], + [ + "DUTY_CYCLE", + 10, + 10 + ], + [ + "DUTY_NUM", + 20, + 10 + ], + [ + "DUTY_INC", + 30, + 1 + ], + [ + "DUTY_START", + 31, + 1 + ] + ] + }, + { + "name": "LSCH0_DUTY_R", + "offset": "0xB0", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "LSCH1_DUTY_R", + "offset": "0xC4", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "LSCH2_DUTY_R", + "offset": "0xD8", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "LSCH3_DUTY_R", + "offset": "0xEC", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "LSCH4_DUTY_R", + "offset": "0x100", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "LSCH5_DUTY_R", + "offset": "0x114", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "LSCH6_DUTY_R", + "offset": "0x128", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "LSCH7_DUTY_R", + "offset": "0x13C", + "fields": [ + [ + "DUTY_R", + 0, + 25, + "r" + ] + ] + }, + { + "name": "HSTIMER0_CONF", + "offset": "0x140", + "reset": "0x01000000", + "fields": [ + [ + "DUTY_RES", + 0, + 5 + ], + [ + "DIV_NUM", + 5, + 18 + ], + [ + "PAUSE", + 23, + 1 + ], + [ + "RST", + 24, + 1 + ], + [ + "TICK_SEL", + 25, + 1 + ] + ] + }, + { + "name": "HSTIMER1_CONF", + "offset": "0x148", + "reset": "0x01000000", + "fields": [ + [ + "DUTY_RES", + 0, + 5 + ], + [ + "DIV_NUM", + 5, + 18 + ], + [ + "PAUSE", + 23, + 1 + ], + [ + "RST", + 24, + 1 + ], + [ + "TICK_SEL", + 25, + 1 + ] + ] + }, + { + "name": "HSTIMER2_CONF", + "offset": "0x150", + "reset": "0x01000000", + "fields": [ + [ + "DUTY_RES", + 0, + 5 + ], + [ + "DIV_NUM", + 5, + 18 + ], + [ + "PAUSE", + 23, + 1 + ], + [ + "RST", + 24, + 1 + ], + [ + "TICK_SEL", + 25, + 1 + ] + ] + }, + { + "name": "HSTIMER3_CONF", + "offset": "0x158", + "reset": "0x01000000", + "fields": [ + [ + "DUTY_RES", + 0, + 5 + ], + [ + "DIV_NUM", + 5, + 18 + ], + [ + "PAUSE", + 23, + 1 + ], + [ + "RST", + 24, + 1 + ], + [ + "TICK_SEL", + 25, + 1 + ] + ] + }, + { + "name": "HSTIMER0_VALUE", + "offset": "0x144", + "fields": [ + [ + "CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "HSTIMER1_VALUE", + "offset": "0x14C", + "fields": [ + [ + "CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "HSTIMER2_VALUE", + "offset": "0x154", + "fields": [ + [ + "CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "HSTIMER3_VALUE", + "offset": "0x15C", + "fields": [ + [ + "CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "LSTIMER0_CONF", + "offset": "0x160", + "reset": "0x01000000", + "fields": [ + [ + "DUTY_RES", + 0, + 5 + ], + [ + "DIV_NUM", + 5, + 18 + ], + [ + "PAUSE", + 23, + 1 + ], + [ + "RST", + 24, + 1 + ], + [ + "TICK_SEL", + 25, + 1 + ], + [ + "PARA_UP", + 26, + 1 + ] + ] + }, + { + "name": "LSTIMER1_CONF", + "offset": "0x168", + "reset": "0x01000000", + "fields": [ + [ + "DUTY_RES", + 0, + 5 + ], + [ + "DIV_NUM", + 5, + 18 + ], + [ + "PAUSE", + 23, + 1 + ], + [ + "RST", + 24, + 1 + ], + [ + "TICK_SEL", + 25, + 1 + ], + [ + "PARA_UP", + 26, + 1 + ] + ] + }, + { + "name": "LSTIMER2_CONF", + "offset": "0x170", + "reset": "0x01000000", + "fields": [ + [ + "DUTY_RES", + 0, + 5 + ], + [ + "DIV_NUM", + 5, + 18 + ], + [ + "PAUSE", + 23, + 1 + ], + [ + "RST", + 24, + 1 + ], + [ + "TICK_SEL", + 25, + 1 + ], + [ + "PARA_UP", + 26, + 1 + ] + ] + }, + { + "name": "LSTIMER3_CONF", + "offset": "0x178", + "reset": "0x01000000", + "fields": [ + [ + "DUTY_RES", + 0, + 5 + ], + [ + "DIV_NUM", + 5, + 18 + ], + [ + "PAUSE", + 23, + 1 + ], + [ + "RST", + 24, + 1 + ], + [ + "TICK_SEL", + 25, + 1 + ], + [ + "PARA_UP", + 26, + 1 + ] + ] + }, + { + "name": "LSTIMER0_VALUE", + "offset": "0x164", + "fields": [ + [ + "CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "LSTIMER1_VALUE", + "offset": "0x16C", + "fields": [ + [ + "CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "LSTIMER2_VALUE", + "offset": "0x174", + "fields": [ + [ + "CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "LSTIMER3_VALUE", + "offset": "0x17C", + "fields": [ + [ + "CNT", + 0, + 20, + "r" + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x180", + "fields": [ + [ + "HSTIMER0_OVF_INT_RAW", + 0, + 1, + "r" + ], + [ + "HSTIMER1_OVF_INT_RAW", + 1, + 1, + "r" + ], + [ + "HSTIMER2_OVF_INT_RAW", + 2, + 1, + "r" + ], + [ + "HSTIMER3_OVF_INT_RAW", + 3, + 1, + "r" + ], + [ + "LSTIMER0_OVF_INT_RAW", + 4, + 1, + "r" + ], + [ + "LSTIMER1_OVF_INT_RAW", + 5, + 1, + "r" + ], + [ + "LSTIMER2_OVF_INT_RAW", + 6, + 1, + "r" + ], + [ + "LSTIMER3_OVF_INT_RAW", + 7, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH0_INT_RAW", + 8, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH1_INT_RAW", + 9, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH2_INT_RAW", + 10, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH3_INT_RAW", + 11, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH4_INT_RAW", + 12, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH5_INT_RAW", + 13, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH6_INT_RAW", + 14, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH7_INT_RAW", + 15, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH0_INT_RAW", + 16, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH1_INT_RAW", + 17, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH2_INT_RAW", + 18, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH3_INT_RAW", + 19, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH4_INT_RAW", + 20, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH5_INT_RAW", + 21, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH6_INT_RAW", + 22, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH7_INT_RAW", + 23, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0x184", + "fields": [ + [ + "HSTIMER0_OVF_INT_ST", + 0, + 1, + "r" + ], + [ + "HSTIMER1_OVF_INT_ST", + 1, + 1, + "r" + ], + [ + "HSTIMER2_OVF_INT_ST", + 2, + 1, + "r" + ], + [ + "HSTIMER3_OVF_INT_ST", + 3, + 1, + "r" + ], + [ + "LSTIMER0_OVF_INT_ST", + 4, + 1, + "r" + ], + [ + "LSTIMER1_OVF_INT_ST", + 5, + 1, + "r" + ], + [ + "LSTIMER2_OVF_INT_ST", + 6, + 1, + "r" + ], + [ + "LSTIMER3_OVF_INT_ST", + 7, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH0_INT_ST", + 8, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH1_INT_ST", + 9, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH2_INT_ST", + 10, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH3_INT_ST", + 11, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH4_INT_ST", + 12, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH5_INT_ST", + 13, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH6_INT_ST", + 14, + 1, + "r" + ], + [ + "DUTY_CHNG_END_HSCH7_INT_ST", + 15, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH0_INT_ST", + 16, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH1_INT_ST", + 17, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH2_INT_ST", + 18, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH3_INT_ST", + 19, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH4_INT_ST", + 20, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH5_INT_ST", + 21, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH6_INT_ST", + 22, + 1, + "r" + ], + [ + "DUTY_CHNG_END_LSCH7_INT_ST", + 23, + 1, + "r" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x188", + "fields": [ + [ + "HSTIMER0_OVF_INT_ENA", + 0, + 1 + ], + [ + "HSTIMER1_OVF_INT_ENA", + 1, + 1 + ], + [ + "HSTIMER2_OVF_INT_ENA", + 2, + 1 + ], + [ + "HSTIMER3_OVF_INT_ENA", + 3, + 1 + ], + [ + "LSTIMER0_OVF_INT_ENA", + 4, + 1 + ], + [ + "LSTIMER1_OVF_INT_ENA", + 5, + 1 + ], + [ + "LSTIMER2_OVF_INT_ENA", + 6, + 1 + ], + [ + "LSTIMER3_OVF_INT_ENA", + 7, + 1 + ], + [ + "DUTY_CHNG_END_HSCH0_INT_ENA", + 8, + 1 + ], + [ + "DUTY_CHNG_END_HSCH1_INT_ENA", + 9, + 1 + ], + [ + "DUTY_CHNG_END_HSCH2_INT_ENA", + 10, + 1 + ], + [ + "DUTY_CHNG_END_HSCH3_INT_ENA", + 11, + 1 + ], + [ + "DUTY_CHNG_END_HSCH4_INT_ENA", + 12, + 1 + ], + [ + "DUTY_CHNG_END_HSCH5_INT_ENA", + 13, + 1 + ], + [ + "DUTY_CHNG_END_HSCH6_INT_ENA", + 14, + 1 + ], + [ + "DUTY_CHNG_END_HSCH7_INT_ENA", + 15, + 1 + ], + [ + "DUTY_CHNG_END_LSCH0_INT_ENA", + 16, + 1 + ], + [ + "DUTY_CHNG_END_LSCH1_INT_ENA", + 17, + 1 + ], + [ + "DUTY_CHNG_END_LSCH2_INT_ENA", + 18, + 1 + ], + [ + "DUTY_CHNG_END_LSCH3_INT_ENA", + 19, + 1 + ], + [ + "DUTY_CHNG_END_LSCH4_INT_ENA", + 20, + 1 + ], + [ + "DUTY_CHNG_END_LSCH5_INT_ENA", + 21, + 1 + ], + [ + "DUTY_CHNG_END_LSCH6_INT_ENA", + 22, + 1 + ], + [ + "DUTY_CHNG_END_LSCH7_INT_ENA", + 23, + 1 + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x18C", + "fields": [ + [ + "HSTIMER0_OVF_INT_CLR", + 0, + 1, + "w" + ], + [ + "HSTIMER1_OVF_INT_CLR", + 1, + 1, + "w" + ], + [ + "HSTIMER2_OVF_INT_CLR", + 2, + 1, + "w" + ], + [ + "HSTIMER3_OVF_INT_CLR", + 3, + 1, + "w" + ], + [ + "LSTIMER0_OVF_INT_CLR", + 4, + 1, + "w" + ], + [ + "LSTIMER1_OVF_INT_CLR", + 5, + 1, + "w" + ], + [ + "LSTIMER2_OVF_INT_CLR", + 6, + 1, + "w" + ], + [ + "LSTIMER3_OVF_INT_CLR", + 7, + 1, + "w" + ], + [ + "DUTY_CHNG_END_HSCH0_INT_CLR", + 8, + 1, + "w" + ], + [ + "DUTY_CHNG_END_HSCH1_INT_CLR", + 9, + 1, + "w" + ], + [ + "DUTY_CHNG_END_HSCH2_INT_CLR", + 10, + 1, + "w" + ], + [ + "DUTY_CHNG_END_HSCH3_INT_CLR", + 11, + 1, + "w" + ], + [ + "DUTY_CHNG_END_HSCH4_INT_CLR", + 12, + 1, + "w" + ], + [ + "DUTY_CHNG_END_HSCH5_INT_CLR", + 13, + 1, + "w" + ], + [ + "DUTY_CHNG_END_HSCH6_INT_CLR", + 14, + 1, + "w" + ], + [ + "DUTY_CHNG_END_HSCH7_INT_CLR", + 15, + 1, + "w" + ], + [ + "DUTY_CHNG_END_LSCH0_INT_CLR", + 16, + 1, + "w" + ], + [ + "DUTY_CHNG_END_LSCH1_INT_CLR", + 17, + 1, + "w" + ], + [ + "DUTY_CHNG_END_LSCH2_INT_CLR", + 18, + 1, + "w" + ], + [ + "DUTY_CHNG_END_LSCH3_INT_CLR", + 19, + 1, + "w" + ], + [ + "DUTY_CHNG_END_LSCH4_INT_CLR", + 20, + 1, + "w" + ], + [ + "DUTY_CHNG_END_LSCH5_INT_CLR", + 21, + 1, + "w" + ], + [ + "DUTY_CHNG_END_LSCH6_INT_CLR", + 22, + 1, + "w" + ], + [ + "DUTY_CHNG_END_LSCH7_INT_CLR", + 23, + 1, + "w" + ] + ] + }, + { + "name": "CONF", + "offset": "0x190", + "fields": [ + [ + "APB_CLK_SEL", + 0, + 1 + ] + ] + }, + { + "name": "DATE", + "offset": "0x1FC", + "reset": "0x16031700", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "EFUSE", + "base": "0x3FF5A000", + "interrupts": [ + "EFUSE" + ], + "registers": [ + { + "name": "BLK0_RDATA0", + "offset": "0x00", + "fields": [ + [ + "RD_EFUSE_WR_DIS", + 0, + 16, + "r" + ], + [ + "RD_EFUSE_RD_DIS", + 16, + 4, + "r" + ], + [ + "RD_FLASH_CRYPT_CNT", + 20, + 7, + "r" + ], + [ + "RD_UART_DOWNLOAD_DIS", + 27, + 1, + "r" + ], + [ + "RESERVED_0_28", + 28, + 4, + "r" + ] + ] + }, + { + "name": "BLK0_RDATA1", + "offset": "0x04", + "fields": [ + [ + "RD_MAC", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK0_RDATA2", + "offset": "0x08", + "fields": [ + [ + "RD_MAC_1", + 0, + 16, + "r" + ], + [ + "RD_MAC_CRC", + 16, + 8, + "r" + ], + [ + "RD_RESERVE_0_88", + 24, + 8 + ] + ] + }, + { + "name": "BLK0_RDATA3", + "offset": "0x0C", + "fields": [ + [ + "RD_DISABLE_APP_CPU", + 0, + 1, + "r" + ], + [ + "RD_DISABLE_BT", + 1, + 1, + "r" + ], + [ + "RD_CHIP_PACKAGE_4BIT", + 2, + 1, + "r" + ], + [ + "RD_DIS_CACHE", + 3, + 1, + "r" + ], + [ + "RD_SPI_PAD_CONFIG_HD", + 4, + 5, + "r" + ], + [ + "RD_CHIP_PACKAGE", + 9, + 3 + ], + [ + "RD_CHIP_CPU_FREQ_LOW", + 12, + 1 + ], + [ + "RD_CHIP_CPU_FREQ_RATED", + 13, + 1 + ], + [ + "RD_BLK3_PART_RESERVE", + 14, + 1 + ], + [ + "RD_CHIP_VER_REV1", + 15, + 1 + ], + [ + "RD_RESERVE_0_112", + 16, + 16 + ] + ] + }, + { + "name": "BLK0_RDATA4", + "offset": "0x10", + "fields": [ + [ + "RD_CLK8M_FREQ", + 0, + 8, + "r" + ], + [ + "RD_ADC_VREF", + 8, + 5 + ], + [ + "RD_RESERVE_0_141", + 13, + 1 + ], + [ + "RD_XPD_SDIO", + 14, + 1, + "r" + ], + [ + "RD_XPD_SDIO_TIEH", + 15, + 1, + "r" + ], + [ + "RD_XPD_SDIO_FORCE", + 16, + 1, + "r" + ], + [ + "RD_RESERVE_0_145", + 17, + 15 + ] + ] + }, + { + "name": "BLK0_RDATA5", + "offset": "0x14", + "fields": [ + [ + "RD_SPI_PAD_CONFIG_CLK", + 0, + 5, + "r" + ], + [ + "RD_SPI_PAD_CONFIG_Q", + 5, + 5, + "r" + ], + [ + "RD_SPI_PAD_CONFIG_D", + 10, + 5, + "r" + ], + [ + "RD_SPI_PAD_CONFIG_CS0", + 15, + 5, + "r" + ], + [ + "RD_CHIP_VER_REV2", + 20, + 1, + "r" + ], + [ + "RD_RESERVE_0_181", + 21, + 1 + ], + [ + "RD_VOL_LEVEL_HP_INV", + 22, + 2, + "r" + ], + [ + "RD_WAFER_VERSION_MINOR", + 24, + 2, + "r" + ], + [ + "RD_RESERVE_0_186", + 26, + 2 + ], + [ + "RD_FLASH_CRYPT_CONFIG", + 28, + 4, + "r" + ] + ] + }, + { + "name": "BLK0_RDATA6", + "offset": "0x18", + "fields": [ + [ + "RD_CODING_SCHEME", + 0, + 2, + "r" + ], + [ + "RD_CONSOLE_DEBUG_DISABLE", + 2, + 1, + "r" + ], + [ + "RD_DISABLE_SDIO_HOST", + 3, + 1, + "r" + ], + [ + "RD_ABS_DONE_0", + 4, + 1, + "r" + ], + [ + "RD_ABS_DONE_1", + 5, + 1, + "r" + ], + [ + "RD_JTAG_DISABLE", + 6, + 1, + "r" + ], + [ + "RD_DISABLE_DL_ENCRYPT", + 7, + 1, + "r" + ], + [ + "RD_DISABLE_DL_DECRYPT", + 8, + 1, + "r" + ], + [ + "RD_DISABLE_DL_CACHE", + 9, + 1, + "r" + ], + [ + "RD_KEY_STATUS", + 10, + 1, + "r" + ], + [ + "RD_RESERVE_0_203", + 11, + 21 + ] + ] + }, + { + "name": "BLK0_WDATA0", + "offset": "0x1C", + "fields": [ + [ + "WR_DIS", + 0, + 16 + ], + [ + "RD_DIS", + 16, + 4 + ], + [ + "FLASH_CRYPT_CNT", + 20, + 7 + ] + ] + }, + { + "name": "BLK0_WDATA1", + "offset": "0x20", + "fields": [ + [ + "WIFI_MAC_CRC_LOW", + 0, + 32 + ] + ] + }, + { + "name": "BLK0_WDATA2", + "offset": "0x24", + "fields": [ + [ + "WIFI_MAC_CRC_HIGH", + 0, + 24 + ] + ] + }, + { + "name": "BLK0_WDATA3", + "offset": "0x28", + "fields": [ + [ + "DISABLE_APP_CPU", + 0, + 1, + "r" + ], + [ + "DISABLE_BT", + 1, + 1, + "r" + ], + [ + "CHIP_PACKAGE_4BIT", + 2, + 1, + "r" + ], + [ + "DIS_CACHE", + 3, + 1, + "r" + ], + [ + "SPI_PAD_CONFIG_HD", + 4, + 5, + "r" + ], + [ + "CHIP_PACKAGE", + 9, + 3 + ], + [ + "CHIP_CPU_FREQ_LOW", + 12, + 1 + ], + [ + "CHIP_CPU_FREQ_RATED", + 13, + 1 + ], + [ + "BLK3_PART_RESERVE", + 14, + 1 + ], + [ + "CHIP_VER_REV1", + 15, + 1 + ], + [ + "RESERVE_0_112", + 16, + 16 + ] + ] + }, + { + "name": "BLK0_WDATA4", + "offset": "0x2C", + "fields": [ + [ + "CLK8M_FREQ", + 0, + 8, + "r" + ], + [ + "ADC_VREF", + 8, + 5 + ], + [ + "RESERVE_0_141", + 13, + 1 + ], + [ + "XPD_SDIO", + 14, + 1, + "r" + ], + [ + "XPD_SDIO_TIEH", + 15, + 1, + "r" + ], + [ + "XPD_SDIO_FORCE", + 16, + 1, + "r" + ], + [ + "RESERVE_0_145", + 17, + 15 + ] + ] + }, + { + "name": "BLK0_WDATA5", + "offset": "0x30", + "fields": [ + [ + "SPI_PAD_CONFIG_CLK", + 0, + 5, + "r" + ], + [ + "SPI_PAD_CONFIG_Q", + 5, + 5, + "r" + ], + [ + "SPI_PAD_CONFIG_D", + 10, + 5, + "r" + ], + [ + "SPI_PAD_CONFIG_CS0", + 15, + 5, + "r" + ], + [ + "CHIP_VER_REV2", + 20, + 1, + "r" + ], + [ + "RESERVE_0_181", + 21, + 1 + ], + [ + "VOL_LEVEL_HP_INV", + 22, + 2, + "r" + ], + [ + "WAFER_VERSION_MINOR", + 24, + 2, + "r" + ], + [ + "RESERVE_0_186", + 26, + 2 + ], + [ + "FLASH_CRYPT_CONFIG", + 28, + 4, + "r" + ] + ] + }, + { + "name": "BLK0_WDATA6", + "offset": "0x34", + "fields": [ + [ + "CODING_SCHEME", + 0, + 2 + ], + [ + "CONSOLE_DEBUG_DISABLE", + 2, + 1 + ], + [ + "DISABLE_SDIO_HOST", + 3, + 1 + ], + [ + "ABS_DONE_0", + 4, + 1 + ], + [ + "ABS_DONE_1", + 5, + 1 + ], + [ + "DISABLE_JTAG", + 6, + 1 + ], + [ + "DISABLE_DL_ENCRYPT", + 7, + 1 + ], + [ + "DISABLE_DL_DECRYPT", + 8, + 1 + ], + [ + "DISABLE_DL_CACHE", + 9, + 1 + ], + [ + "KEY_STATUS", + 10, + 1 + ] + ] + }, + { + "name": "BLK1_RDATA0", + "offset": "0x38", + "fields": [ + [ + "RD_BLOCK1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK1_RDATA1", + "offset": "0x3C", + "fields": [ + [ + "RD_BLOCK1_1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK1_RDATA2", + "offset": "0x40", + "fields": [ + [ + "RD_BLOCK1_2", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK1_RDATA3", + "offset": "0x44", + "fields": [ + [ + "RD_BLOCK1_3", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK1_RDATA4", + "offset": "0x48", + "fields": [ + [ + "RD_BLOCK1_4", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK1_RDATA5", + "offset": "0x4C", + "fields": [ + [ + "RD_BLOCK1_5", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK1_RDATA6", + "offset": "0x50", + "fields": [ + [ + "RD_BLOCK1_6", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK1_RDATA7", + "offset": "0x54", + "fields": [ + [ + "RD_BLOCK1_7", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK2_RDATA0", + "offset": "0x58", + "fields": [ + [ + "RD_BLOCK2", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK2_RDATA1", + "offset": "0x5C", + "fields": [ + [ + "RD_BLOCK2_1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK2_RDATA2", + "offset": "0x60", + "fields": [ + [ + "RD_BLOCK2_2", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK2_RDATA3", + "offset": "0x64", + "fields": [ + [ + "RD_BLOCK2_3", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK2_RDATA4", + "offset": "0x68", + "fields": [ + [ + "RD_BLOCK2_4", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK2_RDATA5", + "offset": "0x6C", + "fields": [ + [ + "RD_BLOCK2_5", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK2_RDATA6", + "offset": "0x70", + "fields": [ + [ + "RD_BLOCK2_6", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK2_RDATA7", + "offset": "0x74", + "fields": [ + [ + "RD_BLOCK2_7", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK3_RDATA0", + "offset": "0x78", + "fields": [ + [ + "RD_CUSTOM_MAC_CRC", + 0, + 8, + "r" + ], + [ + "RD_CUSTOM_MAC", + 8, + 24, + "r" + ] + ] + }, + { + "name": "BLK3_RDATA1", + "offset": "0x7C", + "fields": [ + [ + "RD_CUSTOM_MAC_1", + 0, + 24, + "r" + ], + [ + "RESERVED_3_56", + 24, + 8, + "r" + ] + ] + }, + { + "name": "BLK3_RDATA2", + "offset": "0x80", + "fields": [ + [ + "RD_BLK3_RESERVED_2", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK3_RDATA3", + "offset": "0x84", + "fields": [ + [ + "RD_ADC1_TP_LOW", + 0, + 7 + ], + [ + "RD_ADC1_TP_HIGH", + 7, + 9 + ], + [ + "RD_ADC2_TP_LOW", + 16, + 7 + ], + [ + "RD_ADC2_TP_HIGH", + 23, + 9 + ] + ] + }, + { + "name": "BLK3_RDATA4", + "offset": "0x88", + "fields": [ + [ + "RD_SECURE_VERSION", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK3_RDATA5", + "offset": "0x8C", + "fields": [ + [ + "RESERVED_3_160", + 0, + 24, + "r" + ], + [ + "RD_MAC_VERSION", + 24, + 8, + "r" + ] + ] + }, + { + "name": "BLK3_RDATA6", + "offset": "0x90", + "fields": [ + [ + "RD_BLK3_RESERVED_6", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK3_RDATA7", + "offset": "0x94", + "fields": [ + [ + "RD_BLK3_RESERVED_7", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK1_WDATA0", + "offset": "0x98", + "fields": [ + [ + "BLK1_DIN0", + 0, + 32 + ] + ] + }, + { + "name": "BLK1_WDATA1", + "offset": "0x9C", + "fields": [ + [ + "BLK1_DIN1", + 0, + 32 + ] + ] + }, + { + "name": "BLK1_WDATA2", + "offset": "0xA0", + "fields": [ + [ + "BLK1_DIN2", + 0, + 32 + ] + ] + }, + { + "name": "BLK1_WDATA3", + "offset": "0xA4", + "fields": [ + [ + "BLK1_DIN3", + 0, + 32 + ] + ] + }, + { + "name": "BLK1_WDATA4", + "offset": "0xA8", + "fields": [ + [ + "BLK1_DIN4", + 0, + 32 + ] + ] + }, + { + "name": "BLK1_WDATA5", + "offset": "0xAC", + "fields": [ + [ + "BLK1_DIN5", + 0, + 32 + ] + ] + }, + { + "name": "BLK1_WDATA6", + "offset": "0xB0", + "fields": [ + [ + "BLK1_DIN6", + 0, + 32 + ] + ] + }, + { + "name": "BLK1_WDATA7", + "offset": "0xB4", + "fields": [ + [ + "BLK1_DIN7", + 0, + 32 + ] + ] + }, + { + "name": "BLK2_WDATA0", + "offset": "0xB8", + "fields": [ + [ + "BLK2_DIN0", + 0, + 32 + ] + ] + }, + { + "name": "BLK2_WDATA1", + "offset": "0xBC", + "fields": [ + [ + "BLK2_DIN1", + 0, + 32 + ] + ] + }, + { + "name": "BLK2_WDATA2", + "offset": "0xC0", + "fields": [ + [ + "BLK2_DIN2", + 0, + 32 + ] + ] + }, + { + "name": "BLK2_WDATA3", + "offset": "0xC4", + "fields": [ + [ + "BLK2_DIN3", + 0, + 32 + ] + ] + }, + { + "name": "BLK2_WDATA4", + "offset": "0xC8", + "fields": [ + [ + "BLK2_DIN4", + 0, + 32 + ] + ] + }, + { + "name": "BLK2_WDATA5", + "offset": "0xCC", + "fields": [ + [ + "BLK2_DIN5", + 0, + 32 + ] + ] + }, + { + "name": "BLK2_WDATA6", + "offset": "0xD0", + "fields": [ + [ + "BLK2_DIN6", + 0, + 32 + ] + ] + }, + { + "name": "BLK2_WDATA7", + "offset": "0xD4", + "fields": [ + [ + "BLK2_DIN7", + 0, + 32 + ] + ] + }, + { + "name": "BLK3_WDATA0", + "offset": "0xD8", + "fields": [ + [ + "BLK3_DIN0", + 0, + 32 + ] + ] + }, + { + "name": "BLK3_WDATA1", + "offset": "0xDC", + "fields": [ + [ + "BLK3_DIN1", + 0, + 32 + ] + ] + }, + { + "name": "BLK3_WDATA2", + "offset": "0xE0", + "fields": [ + [ + "BLK3_DIN2", + 0, + 32 + ] + ] + }, + { + "name": "BLK3_WDATA3", + "offset": "0xE4", + "fields": [ + [ + "ADC1_TP_LOW", + 0, + 7 + ], + [ + "ADC1_TP_HIGH", + 7, + 9 + ], + [ + "ADC2_TP_LOW", + 16, + 7 + ], + [ + "ADC2_TP_HIGH", + 23, + 9 + ] + ] + }, + { + "name": "BLK3_WDATA4", + "offset": "0xE8", + "fields": [ + [ + "SECURE_VERSION", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BLK3_WDATA5", + "offset": "0xEC", + "fields": [ + [ + "BLK3_DIN5", + 0, + 32 + ] + ] + }, + { + "name": "BLK3_WDATA6", + "offset": "0xF0", + "fields": [ + [ + "BLK3_DIN6", + 0, + 32 + ] + ] + }, + { + "name": "BLK3_WDATA7", + "offset": "0xF4", + "fields": [ + [ + "BLK3_DIN7", + 0, + 32 + ] + ] + }, + { + "name": "CLK", + "offset": "0xF8", + "reset": "0x00004052", + "fields": [ + [ + "SEL0", + 0, + 8 + ], + [ + "SEL1", + 8, + 8 + ], + [ + "EN", + 16, + 1 + ] + ] + }, + { + "name": "CONF", + "offset": "0xFC", + "reset": "0x00010000", + "fields": [ + [ + "OP_CODE", + 0, + 16 + ], + [ + "FORCE_NO_WR_RD_DIS", + 16, + 1 + ] + ] + }, + { + "name": "STATUS", + "offset": "0x100", + "fields": [ + [ + "DEBUG", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CMD", + "offset": "0x104", + "fields": [ + [ + "READ_CMD", + 0, + 1 + ], + [ + "PGM_CMD", + 1, + 1 + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x108", + "fields": [ + [ + "READ_DONE_INT_RAW", + 0, + 1, + "r" + ], + [ + "PGM_DONE_INT_RAW", + 1, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0x10C", + "fields": [ + [ + "READ_DONE_INT_ST", + 0, + 1, + "r" + ], + [ + "PGM_DONE_INT_ST", + 1, + 1, + "r" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x110", + "fields": [ + [ + "READ_DONE_INT_ENA", + 0, + 1 + ], + [ + "PGM_DONE_INT_ENA", + 1, + 1 + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x114", + "fields": [ + [ + "READ_DONE_INT_CLR", + 0, + 1, + "w" + ], + [ + "PGM_DONE_INT_CLR", + 1, + 1, + "w" + ] + ] + }, + { + "name": "DAC_CONF", + "offset": "0x118", + "reset": "0x00000028", + "fields": [ + [ + "DAC_CLK_DIV", + 0, + 8 + ], + [ + "DAC_CLK_PAD_SEL", + 8, + 1 + ] + ] + }, + { + "name": "DEC_STATUS", + "offset": "0x11C", + "fields": [ + [ + "DEC_WARNINGS", + 0, + 12, + "r" + ] + ] + }, + { + "name": "DATE", + "offset": "0x1FC", + "reset": "0x16042600", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "NRX", + "base": "0x3FF5CC00", + "registers": [ + { + "name": "NRXPD_CTRL", + "offset": "0xD4", + "fields": [ + [ + "DEMAP_FORCE_PD", + 0, + 1 + ], + [ + "DEMAP_FORCE_PU", + 1, + 1 + ], + [ + "VIT_FORCE_PD", + 2, + 1 + ], + [ + "VIT_FORCE_PU", + 3, + 1 + ], + [ + "RX_ROT_FORCE_PD", + 4, + 1 + ], + [ + "RX_ROT_FORCE_PU", + 5, + 1 + ], + [ + "CHAN_EST_FORCE_PD", + 6, + 1 + ], + [ + "CHAN_EST_FORCE_PU", + 7, + 1 + ] + ] + } + ] + }, + { + "name": "BB", + "base": "0x3FF5D000", + "registers": [ + { + "name": "BBPD_CTRL", + "offset": "0x54", + "fields": [ + [ + "DC_EST_FORCE_PD", + 0, + 1 + ], + [ + "DC_EST_FORCE_PU", + 1, + 1 + ], + [ + "FFT_FORCE_PD", + 2, + 1 + ], + [ + "FFT_FORCE_PU", + 3, + 1 + ] + ] + } + ] + }, + { + "name": "MCPWM0", + "base": "0x3FF5E000", + "interrupts": [ + "MCPWM0", + "MCPWM1", + "MCPWM2", + "MCPWM3" + ], + "registers": [ + { + "name": "CLK_CFG", + "offset": "0x00", + "fields": [ + [ + "CLK_PRESCALE", + 0, + 8 + ] + ] + }, + { + "name": "TIMER0_CFG0", + "offset": "0x04", + "reset": "0x0000FF00", + "fields": [ + [ + "TIMER0_PRESCALE", + 0, + 8 + ], + [ + "TIMER0_PERIOD", + 8, + 16 + ], + [ + "TIMER0_PERIOD_UPMETHOD", + 24, + 2 + ] + ] + }, + { + "name": "TIMER0_CFG1", + "offset": "0x08", + "fields": [ + [ + "TIMER0_START", + 0, + 3 + ], + [ + "TIMER0_MOD", + 3, + 2 + ] + ] + }, + { + "name": "TIMER0_SYNC", + "offset": "0x0C", + "fields": [ + [ + "TIMER0_SYNCI_EN", + 0, + 1 + ], + [ + "SW", + 1, + 1 + ], + [ + "TIMER0_SYNCO_SEL", + 2, + 2 + ], + [ + "TIMER0_PHASE", + 4, + 16 + ], + [ + "TIMER0_PHASE_DIRECTION", + 20, + 1 + ] + ] + }, + { + "name": "TIMER0_STATUS", + "offset": "0x10", + "fields": [ + [ + "TIMER0_VALUE", + 0, + 16, + "r" + ], + [ + "TIMER0_DIRECTION", + 16, + 1, + "r" + ] + ] + }, + { + "name": "TIMER1_CFG0", + "offset": "0x14", + "reset": "0x0000FF00", + "fields": [ + [ + "TIMER1_PRESCALE", + 0, + 8 + ], + [ + "TIMER1_PERIOD", + 8, + 16 + ], + [ + "TIMER1_PERIOD_UPMETHOD", + 24, + 2 + ] + ] + }, + { + "name": "TIMER1_CFG1", + "offset": "0x18", + "fields": [ + [ + "TIMER1_START", + 0, + 3 + ], + [ + "TIMER1_MOD", + 3, + 2 + ] + ] + }, + { + "name": "TIMER1_SYNC", + "offset": "0x1C", + "fields": [ + [ + "TIMER1_SYNCI_EN", + 0, + 1 + ], + [ + "SW", + 1, + 1 + ], + [ + "TIMER1_SYNCO_SEL", + 2, + 2 + ], + [ + "TIMER1_PHASE", + 4, + 16 + ], + [ + "TIMER1_PHASE_DIRECTION", + 20, + 1 + ] + ] + }, + { + "name": "TIMER1_STATUS", + "offset": "0x20", + "fields": [ + [ + "TIMER1_VALUE", + 0, + 16, + "r" + ], + [ + "TIMER1_DIRECTION", + 16, + 1, + "r" + ] + ] + }, + { + "name": "TIMER2_CFG0", + "offset": "0x24", + "reset": "0x0000FF00", + "fields": [ + [ + "TIMER2_PRESCALE", + 0, + 8 + ], + [ + "TIMER2_PERIOD", + 8, + 16 + ], + [ + "TIMER2_PERIOD_UPMETHOD", + 24, + 2 + ] + ] + }, + { + "name": "TIMER2_CFG1", + "offset": "0x28", + "fields": [ + [ + "TIMER2_START", + 0, + 3 + ], + [ + "TIMER2_MOD", + 3, + 2 + ] + ] + }, + { + "name": "TIMER2_SYNC", + "offset": "0x2C", + "fields": [ + [ + "TIMER2_SYNCI_EN", + 0, + 1 + ], + [ + "SW", + 1, + 1 + ], + [ + "TIMER2_SYNCO_SEL", + 2, + 2 + ], + [ + "TIMER2_PHASE", + 4, + 16 + ], + [ + "TIMER2_PHASE_DIRECTION", + 20, + 1 + ] + ] + }, + { + "name": "TIMER2_STATUS", + "offset": "0x30", + "fields": [ + [ + "TIMER2_VALUE", + 0, + 16, + "r" + ], + [ + "TIMER2_DIRECTION", + 16, + 1, + "r" + ] + ] + }, + { + "name": "TIMER_SYNCI_CFG", + "offset": "0x34", + "fields": [ + [ + "TIMER0_SYNCISEL", + 0, + 3 + ], + [ + "TIMER1_SYNCISEL", + 3, + 3 + ], + [ + "TIMER2_SYNCISEL", + 6, + 3 + ], + [ + "EXTERNAL_SYNCI0_INVERT", + 9, + 1 + ], + [ + "EXTERNAL_SYNCI1_INVERT", + 10, + 1 + ], + [ + "EXTERNAL_SYNCI2_INVERT", + 11, + 1 + ] + ] + }, + { + "name": "OPERATOR_TIMERSEL", + "offset": "0x38", + "fields": [ + [ + "OPERATOR0_TIMERSEL", + 0, + 2 + ], + [ + "OPERATOR1_TIMERSEL", + 2, + 2 + ], + [ + "OPERATOR2_TIMERSEL", + 4, + 2 + ] + ] + }, + { + "name": "GEN0_STMP_CFG", + "offset": "0x3C", + "fields": [ + [ + "GEN0_A_UPMETHOD", + 0, + 4 + ], + [ + "GEN0_B_UPMETHOD", + 4, + 4 + ], + [ + "GEN0_A_SHDW_FULL", + 8, + 1 + ], + [ + "GEN0_B_SHDW_FULL", + 9, + 1 + ] + ] + }, + { + "name": "GEN0_TSTMP_A", + "offset": "0x40", + "fields": [ + [ + "GEN0_A", + 0, + 16 + ] + ] + }, + { + "name": "GEN0_TSTMP_B", + "offset": "0x44", + "fields": [ + [ + "GEN0_B", + 0, + 16 + ] + ] + }, + { + "name": "GEN0_CFG0", + "offset": "0x48", + "fields": [ + [ + "GEN0_CFG_UPMETHOD", + 0, + 4 + ], + [ + "GEN0_T0_SEL", + 4, + 3 + ], + [ + "GEN0_T1_SEL", + 7, + 3 + ] + ] + }, + { + "name": "GEN0_FORCE", + "offset": "0x4C", + "reset": "0x00000020", + "fields": [ + [ + "GEN0_CNTUFORCE_UPMETHOD", + 0, + 6 + ], + [ + "GEN0_A_CNTUFORCE_MODE", + 6, + 2 + ], + [ + "GEN0_B_CNTUFORCE_MODE", + 8, + 2 + ], + [ + "GEN0_A_NCIFORCE", + 10, + 1 + ], + [ + "GEN0_A_NCIFORCE_MODE", + 11, + 2 + ], + [ + "GEN0_B_NCIFORCE", + 13, + 1 + ], + [ + "GEN0_B_NCIFORCE_MODE", + 14, + 2 + ] + ] + }, + { + "name": "GEN0_A", + "offset": "0x50", + "fields": [ + [ + "UTEZ", + 0, + 2 + ], + [ + "UTEP", + 2, + 2 + ], + [ + "UTEA", + 4, + 2 + ], + [ + "UTEB", + 6, + 2 + ], + [ + "UT0", + 8, + 2 + ], + [ + "UT1", + 10, + 2 + ], + [ + "DTEZ", + 12, + 2 + ], + [ + "DTEP", + 14, + 2 + ], + [ + "DTEA", + 16, + 2 + ], + [ + "DTEB", + 18, + 2 + ], + [ + "DT0", + 20, + 2 + ], + [ + "DT1", + 22, + 2 + ] + ] + }, + { + "name": "GEN0_B", + "offset": "0x54", + "fields": [ + [ + "UTEZ", + 0, + 2 + ], + [ + "UTEP", + 2, + 2 + ], + [ + "UTEA", + 4, + 2 + ], + [ + "UTEB", + 6, + 2 + ], + [ + "UT0", + 8, + 2 + ], + [ + "UT1", + 10, + 2 + ], + [ + "DTEZ", + 12, + 2 + ], + [ + "DTEP", + 14, + 2 + ], + [ + "DTEA", + 16, + 2 + ], + [ + "DTEB", + 18, + 2 + ], + [ + "DT0", + 20, + 2 + ], + [ + "DT1", + 22, + 2 + ] + ] + }, + { + "name": "DT0_CFG", + "offset": "0x58", + "reset": "0x00018000", + "fields": [ + [ + "DT0_FED_UPMETHOD", + 0, + 4 + ], + [ + "DT0_RED_UPMETHOD", + 4, + 4 + ], + [ + "DT0_DEB_MODE", + 8, + 1 + ], + [ + "DT0_A_OUTSWAP", + 9, + 1 + ], + [ + "DT0_B_OUTSWAP", + 10, + 1 + ], + [ + "DT0_RED_INSEL", + 11, + 1 + ], + [ + "DT0_FED_INSEL", + 12, + 1 + ], + [ + "DT0_RED_OUTINVERT", + 13, + 1 + ], + [ + "DT0_FED_OUTINVERT", + 14, + 1 + ], + [ + "DT0_A_OUTBYPASS", + 15, + 1 + ], + [ + "DT0_B_OUTBYPASS", + 16, + 1 + ], + [ + "DT0_CLK_SEL", + 17, + 1 + ] + ] + }, + { + "name": "DT0_FED_CFG", + "offset": "0x5C", + "fields": [ + [ + "DT0_FED", + 0, + 16 + ] + ] + }, + { + "name": "DT0_RED_CFG", + "offset": "0x60", + "fields": [ + [ + "DT0_RED", + 0, + 16 + ] + ] + }, + { + "name": "CARRIER0_CFG", + "offset": "0x64", + "fields": [ + [ + "CARRIER0_EN", + 0, + 1 + ], + [ + "CARRIER0_PRESCALE", + 1, + 4 + ], + [ + "CARRIER0_DUTY", + 5, + 3 + ], + [ + "CARRIER0_OSHTWTH", + 8, + 4 + ], + [ + "CARRIER0_OUT_INVERT", + 12, + 1 + ], + [ + "CARRIER0_IN_INVERT", + 13, + 1 + ] + ] + }, + { + "name": "FH0_CFG0", + "offset": "0x68", + "fields": [ + [ + "FH0_SW_CBC", + 0, + 1 + ], + [ + "FH0_F2_CBC", + 1, + 1 + ], + [ + "FH0_F1_CBC", + 2, + 1 + ], + [ + "FH0_F0_CBC", + 3, + 1 + ], + [ + "FH0_SW_OST", + 4, + 1 + ], + [ + "FH0_F2_OST", + 5, + 1 + ], + [ + "FH0_F1_OST", + 6, + 1 + ], + [ + "FH0_F0_OST", + 7, + 1 + ], + [ + "FH0_A_CBC_D", + 8, + 2 + ], + [ + "FH0_A_CBC_U", + 10, + 2 + ], + [ + "FH0_A_OST_D", + 12, + 2 + ], + [ + "FH0_A_OST_U", + 14, + 2 + ], + [ + "FH0_B_CBC_D", + 16, + 2 + ], + [ + "FH0_B_CBC_U", + 18, + 2 + ], + [ + "FH0_B_OST_D", + 20, + 2 + ], + [ + "FH0_B_OST_U", + 22, + 2 + ] + ] + }, + { + "name": "FH0_CFG1", + "offset": "0x6C", + "fields": [ + [ + "FH0_CLR_OST", + 0, + 1 + ], + [ + "FH0_CBCPULSE", + 1, + 2 + ], + [ + "FH0_FORCE_CBC", + 3, + 1 + ], + [ + "FH0_FORCE_OST", + 4, + 1 + ] + ] + }, + { + "name": "FH0_STATUS", + "offset": "0x70", + "fields": [ + [ + "FH0_CBC_ON", + 0, + 1, + "r" + ], + [ + "FH0_OST_ON", + 1, + 1, + "r" + ] + ] + }, + { + "name": "GEN1_STMP_CFG", + "offset": "0x74", + "fields": [ + [ + "GEN1_A_UPMETHOD", + 0, + 4 + ], + [ + "GEN1_B_UPMETHOD", + 4, + 4 + ], + [ + "GEN1_A_SHDW_FULL", + 8, + 1 + ], + [ + "GEN1_B_SHDW_FULL", + 9, + 1 + ] + ] + }, + { + "name": "GEN1_TSTMP_A", + "offset": "0x78", + "fields": [ + [ + "GEN1_A", + 0, + 16 + ] + ] + }, + { + "name": "GEN1_TSTMP_B", + "offset": "0x7C", + "fields": [ + [ + "GEN1_B", + 0, + 16 + ] + ] + }, + { + "name": "GEN1_CFG0", + "offset": "0x80", + "fields": [ + [ + "GEN1_CFG_UPMETHOD", + 0, + 4 + ], + [ + "GEN1_T0_SEL", + 4, + 3 + ], + [ + "GEN1_T1_SEL", + 7, + 3 + ] + ] + }, + { + "name": "GEN1_FORCE", + "offset": "0x84", + "reset": "0x00000020", + "fields": [ + [ + "GEN1_CNTUFORCE_UPMETHOD", + 0, + 6 + ], + [ + "GEN1_A_CNTUFORCE_MODE", + 6, + 2 + ], + [ + "GEN1_B_CNTUFORCE_MODE", + 8, + 2 + ], + [ + "GEN1_A_NCIFORCE", + 10, + 1 + ], + [ + "GEN1_A_NCIFORCE_MODE", + 11, + 2 + ], + [ + "GEN1_B_NCIFORCE", + 13, + 1 + ], + [ + "GEN1_B_NCIFORCE_MODE", + 14, + 2 + ] + ] + }, + { + "name": "GEN1_A", + "offset": "0x88", + "fields": [ + [ + "UTEZ", + 0, + 2 + ], + [ + "UTEP", + 2, + 2 + ], + [ + "UTEA", + 4, + 2 + ], + [ + "UTEB", + 6, + 2 + ], + [ + "UT0", + 8, + 2 + ], + [ + "UT1", + 10, + 2 + ], + [ + "DTEZ", + 12, + 2 + ], + [ + "DTEP", + 14, + 2 + ], + [ + "DTEA", + 16, + 2 + ], + [ + "DTEB", + 18, + 2 + ], + [ + "DT0", + 20, + 2 + ], + [ + "DT1", + 22, + 2 + ] + ] + }, + { + "name": "GEN1_B", + "offset": "0x8C", + "fields": [ + [ + "UTEZ", + 0, + 2 + ], + [ + "UTEP", + 2, + 2 + ], + [ + "UTEA", + 4, + 2 + ], + [ + "UTEB", + 6, + 2 + ], + [ + "UT0", + 8, + 2 + ], + [ + "UT1", + 10, + 2 + ], + [ + "DTEZ", + 12, + 2 + ], + [ + "DTEP", + 14, + 2 + ], + [ + "DTEA", + 16, + 2 + ], + [ + "DTEB", + 18, + 2 + ], + [ + "DT0", + 20, + 2 + ], + [ + "DT1", + 22, + 2 + ] + ] + }, + { + "name": "DT1_CFG", + "offset": "0x90", + "reset": "0x00018000", + "fields": [ + [ + "DT1_FED_UPMETHOD", + 0, + 4 + ], + [ + "DT1_RED_UPMETHOD", + 4, + 4 + ], + [ + "DT1_DEB_MODE", + 8, + 1 + ], + [ + "DT1_A_OUTSWAP", + 9, + 1 + ], + [ + "DT1_B_OUTSWAP", + 10, + 1 + ], + [ + "DT1_RED_INSEL", + 11, + 1 + ], + [ + "DT1_FED_INSEL", + 12, + 1 + ], + [ + "DT1_RED_OUTINVERT", + 13, + 1 + ], + [ + "DT1_FED_OUTINVERT", + 14, + 1 + ], + [ + "DT1_A_OUTBYPASS", + 15, + 1 + ], + [ + "DT1_B_OUTBYPASS", + 16, + 1 + ], + [ + "DT1_CLK_SEL", + 17, + 1 + ] + ] + }, + { + "name": "DT1_FED_CFG", + "offset": "0x94", + "fields": [ + [ + "DT1_FED", + 0, + 16 + ] + ] + }, + { + "name": "DT1_RED_CFG", + "offset": "0x98", + "fields": [ + [ + "DT1_RED", + 0, + 16 + ] + ] + }, + { + "name": "CARRIER1_CFG", + "offset": "0x9C", + "fields": [ + [ + "CARRIER1_EN", + 0, + 1 + ], + [ + "CARRIER1_PRESCALE", + 1, + 4 + ], + [ + "CARRIER1_DUTY", + 5, + 3 + ], + [ + "CARRIER1_OSHTWTH", + 8, + 4 + ], + [ + "CARRIER1_OUT_INVERT", + 12, + 1 + ], + [ + "CARRIER1_IN_INVERT", + 13, + 1 + ] + ] + }, + { + "name": "FH1_CFG0", + "offset": "0xA0", + "fields": [ + [ + "FH1_SW_CBC", + 0, + 1 + ], + [ + "FH1_F2_CBC", + 1, + 1 + ], + [ + "FH1_F1_CBC", + 2, + 1 + ], + [ + "FH1_F0_CBC", + 3, + 1 + ], + [ + "FH1_SW_OST", + 4, + 1 + ], + [ + "FH1_F2_OST", + 5, + 1 + ], + [ + "FH1_F1_OST", + 6, + 1 + ], + [ + "FH1_F0_OST", + 7, + 1 + ], + [ + "FH1_A_CBC_D", + 8, + 2 + ], + [ + "FH1_A_CBC_U", + 10, + 2 + ], + [ + "FH1_A_OST_D", + 12, + 2 + ], + [ + "FH1_A_OST_U", + 14, + 2 + ], + [ + "FH1_B_CBC_D", + 16, + 2 + ], + [ + "FH1_B_CBC_U", + 18, + 2 + ], + [ + "FH1_B_OST_D", + 20, + 2 + ], + [ + "FH1_B_OST_U", + 22, + 2 + ] + ] + }, + { + "name": "FH1_CFG1", + "offset": "0xA4", + "fields": [ + [ + "FH1_CLR_OST", + 0, + 1 + ], + [ + "FH1_CBCPULSE", + 1, + 2 + ], + [ + "FH1_FORCE_CBC", + 3, + 1 + ], + [ + "FH1_FORCE_OST", + 4, + 1 + ] + ] + }, + { + "name": "FH1_STATUS", + "offset": "0xA8", + "fields": [ + [ + "FH1_CBC_ON", + 0, + 1, + "r" + ], + [ + "FH1_OST_ON", + 1, + 1, + "r" + ] + ] + }, + { + "name": "GEN2_STMP_CFG", + "offset": "0xAC", + "fields": [ + [ + "GEN2_A_UPMETHOD", + 0, + 4 + ], + [ + "GEN2_B_UPMETHOD", + 4, + 4 + ], + [ + "GEN2_A_SHDW_FULL", + 8, + 1 + ], + [ + "GEN2_B_SHDW_FULL", + 9, + 1 + ] + ] + }, + { + "name": "GEN2_TSTMP_A", + "offset": "0xB0", + "fields": [ + [ + "GEN2_A", + 0, + 16 + ] + ] + }, + { + "name": "GEN2_TSTMP_B", + "offset": "0xB4", + "fields": [ + [ + "GEN2_B", + 0, + 16 + ] + ] + }, + { + "name": "GEN2_CFG0", + "offset": "0xB8", + "fields": [ + [ + "GEN2_CFG_UPMETHOD", + 0, + 4 + ], + [ + "GEN2_T0_SEL", + 4, + 3 + ], + [ + "GEN2_T1_SEL", + 7, + 3 + ] + ] + }, + { + "name": "GEN2_FORCE", + "offset": "0xBC", + "reset": "0x00000020", + "fields": [ + [ + "GEN2_CNTUFORCE_UPMETHOD", + 0, + 6 + ], + [ + "GEN2_A_CNTUFORCE_MODE", + 6, + 2 + ], + [ + "GEN2_B_CNTUFORCE_MODE", + 8, + 2 + ], + [ + "GEN2_A_NCIFORCE", + 10, + 1 + ], + [ + "GEN2_A_NCIFORCE_MODE", + 11, + 2 + ], + [ + "GEN2_B_NCIFORCE", + 13, + 1 + ], + [ + "GEN2_B_NCIFORCE_MODE", + 14, + 2 + ] + ] + }, + { + "name": "GEN2_A", + "offset": "0xC0", + "fields": [ + [ + "UTEZ", + 0, + 2 + ], + [ + "UTEP", + 2, + 2 + ], + [ + "UTEA", + 4, + 2 + ], + [ + "UTEB", + 6, + 2 + ], + [ + "UT0", + 8, + 2 + ], + [ + "UT1", + 10, + 2 + ], + [ + "DTEZ", + 12, + 2 + ], + [ + "DTEP", + 14, + 2 + ], + [ + "DTEA", + 16, + 2 + ], + [ + "DTEB", + 18, + 2 + ], + [ + "DT0", + 20, + 2 + ], + [ + "DT1", + 22, + 2 + ] + ] + }, + { + "name": "GEN2_B", + "offset": "0xC4", + "fields": [ + [ + "UTEZ", + 0, + 2 + ], + [ + "UTEP", + 2, + 2 + ], + [ + "UTEA", + 4, + 2 + ], + [ + "UTEB", + 6, + 2 + ], + [ + "UT0", + 8, + 2 + ], + [ + "UT1", + 10, + 2 + ], + [ + "DTEZ", + 12, + 2 + ], + [ + "DTEP", + 14, + 2 + ], + [ + "DTEA", + 16, + 2 + ], + [ + "DTEB", + 18, + 2 + ], + [ + "DT0", + 20, + 2 + ], + [ + "DT1", + 22, + 2 + ] + ] + }, + { + "name": "DT2_CFG", + "offset": "0xC8", + "reset": "0x00018000", + "fields": [ + [ + "DT2_FED_UPMETHOD", + 0, + 4 + ], + [ + "DT2_RED_UPMETHOD", + 4, + 4 + ], + [ + "DT2_DEB_MODE", + 8, + 1 + ], + [ + "DT2_A_OUTSWAP", + 9, + 1 + ], + [ + "DT2_B_OUTSWAP", + 10, + 1 + ], + [ + "DT2_RED_INSEL", + 11, + 1 + ], + [ + "DT2_FED_INSEL", + 12, + 1 + ], + [ + "DT2_RED_OUTINVERT", + 13, + 1 + ], + [ + "DT2_FED_OUTINVERT", + 14, + 1 + ], + [ + "DT2_A_OUTBYPASS", + 15, + 1 + ], + [ + "DT2_B_OUTBYPASS", + 16, + 1 + ], + [ + "DT2_CLK_SEL", + 17, + 1 + ] + ] + }, + { + "name": "DT2_FED_CFG", + "offset": "0xCC", + "fields": [ + [ + "DT2_FED", + 0, + 16 + ] + ] + }, + { + "name": "DT2_RED_CFG", + "offset": "0xD0", + "fields": [ + [ + "DT2_RED", + 0, + 16 + ] + ] + }, + { + "name": "CARRIER2_CFG", + "offset": "0xD4", + "fields": [ + [ + "CARRIER2_EN", + 0, + 1 + ], + [ + "CARRIER2_PRESCALE", + 1, + 4 + ], + [ + "CARRIER2_DUTY", + 5, + 3 + ], + [ + "CARRIER2_OSHTWTH", + 8, + 4 + ], + [ + "CARRIER2_OUT_INVERT", + 12, + 1 + ], + [ + "CARRIER2_IN_INVERT", + 13, + 1 + ] + ] + }, + { + "name": "FH2_CFG0", + "offset": "0xD8", + "fields": [ + [ + "FH2_SW_CBC", + 0, + 1 + ], + [ + "FH2_F2_CBC", + 1, + 1 + ], + [ + "FH2_F1_CBC", + 2, + 1 + ], + [ + "FH2_F0_CBC", + 3, + 1 + ], + [ + "FH2_SW_OST", + 4, + 1 + ], + [ + "FH2_F2_OST", + 5, + 1 + ], + [ + "FH2_F1_OST", + 6, + 1 + ], + [ + "FH2_F0_OST", + 7, + 1 + ], + [ + "FH2_A_CBC_D", + 8, + 2 + ], + [ + "FH2_A_CBC_U", + 10, + 2 + ], + [ + "FH2_A_OST_D", + 12, + 2 + ], + [ + "FH2_A_OST_U", + 14, + 2 + ], + [ + "FH2_B_CBC_D", + 16, + 2 + ], + [ + "FH2_B_CBC_U", + 18, + 2 + ], + [ + "FH2_B_OST_D", + 20, + 2 + ], + [ + "FH2_B_OST_U", + 22, + 2 + ] + ] + }, + { + "name": "FH2_CFG1", + "offset": "0xDC", + "fields": [ + [ + "FH2_CLR_OST", + 0, + 1 + ], + [ + "FH2_CBCPULSE", + 1, + 2 + ], + [ + "FH2_FORCE_CBC", + 3, + 1 + ], + [ + "FH2_FORCE_OST", + 4, + 1 + ] + ] + }, + { + "name": "FH2_STATUS", + "offset": "0xE0", + "fields": [ + [ + "FH2_CBC_ON", + 0, + 1, + "r" + ], + [ + "FH2_OST_ON", + 1, + 1, + "r" + ] + ] + }, + { + "name": "FAULT_DETECT", + "offset": "0xE4", + "fields": [ + [ + "F0_EN", + 0, + 1 + ], + [ + "F1_EN", + 1, + 1 + ], + [ + "F2_EN", + 2, + 1 + ], + [ + "F0_POLE", + 3, + 1 + ], + [ + "F1_POLE", + 4, + 1 + ], + [ + "F2_POLE", + 5, + 1 + ], + [ + "EVENT_F0", + 6, + 1, + "r" + ], + [ + "EVENT_F1", + 7, + 1, + "r" + ], + [ + "EVENT_F2", + 8, + 1, + "r" + ] + ] + }, + { + "name": "CAP_TIMER_CFG", + "offset": "0xE8", + "fields": [ + [ + "CAP_TIMER_EN", + 0, + 1 + ], + [ + "CAP_SYNCI_EN", + 1, + 1 + ], + [ + "CAP_SYNCI_SEL", + 2, + 3 + ], + [ + "CAP_SYNC_SW", + 5, + 1, + "w" + ] + ] + }, + { + "name": "CAP_TIMER_PHASE", + "offset": "0xEC", + "fields": [ + [ + "CAP_TIMER_PHASE", + 0, + 32 + ] + ] + }, + { + "name": "CAP_CH0_CFG", + "offset": "0xF0", + "fields": [ + [ + "CAP0_EN", + 0, + 1 + ], + [ + "CAP0_MODE", + 1, + 2 + ], + [ + "CAP0_PRESCALE", + 3, + 8 + ], + [ + "CAP0_IN_INVERT", + 11, + 1 + ], + [ + "CAP0_SW", + 12, + 1, + "w" + ] + ] + }, + { + "name": "CAP_CH1_CFG", + "offset": "0xF4", + "fields": [ + [ + "CAP1_EN", + 0, + 1 + ], + [ + "CAP1_MODE", + 1, + 2 + ], + [ + "CAP1_PRESCALE", + 3, + 8 + ], + [ + "CAP1_IN_INVERT", + 11, + 1 + ], + [ + "CAP1_SW", + 12, + 1, + "w" + ] + ] + }, + { + "name": "CAP_CH2_CFG", + "offset": "0xF8", + "fields": [ + [ + "CAP2_EN", + 0, + 1 + ], + [ + "CAP2_MODE", + 1, + 2 + ], + [ + "CAP2_PRESCALE", + 3, + 8 + ], + [ + "CAP2_IN_INVERT", + 11, + 1 + ], + [ + "CAP2_SW", + 12, + 1, + "w" + ] + ] + }, + { + "name": "CAP_CH0", + "offset": "0xFC", + "fields": [ + [ + "CAP0_VALUE", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CAP_CH1", + "offset": "0x100", + "fields": [ + [ + "CAP1_VALUE", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CAP_CH2", + "offset": "0x104", + "fields": [ + [ + "CAP2_VALUE", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CAP_STATUS", + "offset": "0x108", + "fields": [ + [ + "CAP0_EDGE", + 0, + 1, + "r" + ], + [ + "CAP1_EDGE", + 1, + 1, + "r" + ], + [ + "CAP2_EDGE", + 2, + 1, + "r" + ] + ] + }, + { + "name": "UPDATE_CFG", + "offset": "0x10C", + "reset": "0x00000055", + "fields": [ + [ + "GLOBAL_UP_EN", + 0, + 1 + ], + [ + "GLOBAL_FORCE_UP", + 1, + 1 + ], + [ + "OP0_UP_EN", + 2, + 1 + ], + [ + "OP0_FORCE_UP", + 3, + 1 + ], + [ + "OP1_UP_EN", + 4, + 1 + ], + [ + "OP1_FORCE_UP", + 5, + 1 + ], + [ + "OP2_UP_EN", + 6, + 1 + ], + [ + "OP2_FORCE_UP", + 7, + 1 + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x110", + "fields": [ + [ + "TIMER0_STOP_INT_ENA", + 0, + 1 + ], + [ + "TIMER1_STOP_INT_ENA", + 1, + 1 + ], + [ + "TIMER2_STOP_INT_ENA", + 2, + 1 + ], + [ + "TIMER0_TEZ_INT_ENA", + 3, + 1 + ], + [ + "TIMER1_TEZ_INT_ENA", + 4, + 1 + ], + [ + "TIMER2_TEZ_INT_ENA", + 5, + 1 + ], + [ + "TIMER0_TEP_INT_ENA", + 6, + 1 + ], + [ + "TIMER1_TEP_INT_ENA", + 7, + 1 + ], + [ + "TIMER2_TEP_INT_ENA", + 8, + 1 + ], + [ + "FAULT0_INT_ENA", + 9, + 1 + ], + [ + "FAULT1_INT_ENA", + 10, + 1 + ], + [ + "FAULT2_INT_ENA", + 11, + 1 + ], + [ + "FAULT0_CLR_INT_ENA", + 12, + 1 + ], + [ + "FAULT1_CLR_INT_ENA", + 13, + 1 + ], + [ + "FAULT2_CLR_INT_ENA", + 14, + 1 + ], + [ + "OP0_TEA_INT_ENA", + 15, + 1 + ], + [ + "OP1_TEA_INT_ENA", + 16, + 1 + ], + [ + "OP2_TEA_INT_ENA", + 17, + 1 + ], + [ + "OP0_TEB_INT_ENA", + 18, + 1 + ], + [ + "OP1_TEB_INT_ENA", + 19, + 1 + ], + [ + "OP2_TEB_INT_ENA", + 20, + 1 + ], + [ + "FH0_CBC_INT_ENA", + 21, + 1 + ], + [ + "FH1_CBC_INT_ENA", + 22, + 1 + ], + [ + "FH2_CBC_INT_ENA", + 23, + 1 + ], + [ + "FH0_OST_INT_ENA", + 24, + 1 + ], + [ + "FH1_OST_INT_ENA", + 25, + 1 + ], + [ + "FH2_OST_INT_ENA", + 26, + 1 + ], + [ + "CAP0_INT_ENA", + 27, + 1 + ], + [ + "CAP1_INT_ENA", + 28, + 1 + ], + [ + "CAP2_INT_ENA", + 29, + 1 + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x114", + "fields": [ + [ + "TIMER0_STOP_INT_RAW", + 0, + 1, + "r" + ], + [ + "TIMER1_STOP_INT_RAW", + 1, + 1, + "r" + ], + [ + "TIMER2_STOP_INT_RAW", + 2, + 1, + "r" + ], + [ + "TIMER0_TEZ_INT_RAW", + 3, + 1, + "r" + ], + [ + "TIMER1_TEZ_INT_RAW", + 4, + 1, + "r" + ], + [ + "TIMER2_TEZ_INT_RAW", + 5, + 1, + "r" + ], + [ + "TIMER0_TEP_INT_RAW", + 6, + 1, + "r" + ], + [ + "TIMER1_TEP_INT_RAW", + 7, + 1, + "r" + ], + [ + "TIMER2_TEP_INT_RAW", + 8, + 1, + "r" + ], + [ + "FAULT0_INT_RAW", + 9, + 1, + "r" + ], + [ + "FAULT1_INT_RAW", + 10, + 1, + "r" + ], + [ + "FAULT2_INT_RAW", + 11, + 1, + "r" + ], + [ + "FAULT0_CLR_INT_RAW", + 12, + 1, + "r" + ], + [ + "FAULT1_CLR_INT_RAW", + 13, + 1, + "r" + ], + [ + "FAULT2_CLR_INT_RAW", + 14, + 1, + "r" + ], + [ + "OP0_TEA_INT_RAW", + 15, + 1, + "r" + ], + [ + "OP1_TEA_INT_RAW", + 16, + 1, + "r" + ], + [ + "OP2_TEA_INT_RAW", + 17, + 1, + "r" + ], + [ + "OP0_TEB_INT_RAW", + 18, + 1, + "r" + ], + [ + "OP1_TEB_INT_RAW", + 19, + 1, + "r" + ], + [ + "OP2_TEB_INT_RAW", + 20, + 1, + "r" + ], + [ + "FH0_CBC_INT_RAW", + 21, + 1, + "r" + ], + [ + "FH1_CBC_INT_RAW", + 22, + 1, + "r" + ], + [ + "FH2_CBC_INT_RAW", + 23, + 1, + "r" + ], + [ + "FH0_OST_INT_RAW", + 24, + 1, + "r" + ], + [ + "FH1_OST_INT_RAW", + 25, + 1, + "r" + ], + [ + "FH2_OST_INT_RAW", + 26, + 1, + "r" + ], + [ + "CAP0_INT_RAW", + 27, + 1, + "r" + ], + [ + "CAP1_INT_RAW", + 28, + 1, + "r" + ], + [ + "CAP2_INT_RAW", + 29, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST", + "offset": "0x118", + "fields": [ + [ + "TIMER0_STOP_INT_ST", + 0, + 1, + "r" + ], + [ + "TIMER1_STOP_INT_ST", + 1, + 1, + "r" + ], + [ + "TIMER2_STOP_INT_ST", + 2, + 1, + "r" + ], + [ + "TIMER0_TEZ_INT_ST", + 3, + 1, + "r" + ], + [ + "TIMER1_TEZ_INT_ST", + 4, + 1, + "r" + ], + [ + "TIMER2_TEZ_INT_ST", + 5, + 1, + "r" + ], + [ + "TIMER0_TEP_INT_ST", + 6, + 1, + "r" + ], + [ + "TIMER1_TEP_INT_ST", + 7, + 1, + "r" + ], + [ + "TIMER2_TEP_INT_ST", + 8, + 1, + "r" + ], + [ + "FAULT0_INT_ST", + 9, + 1, + "r" + ], + [ + "FAULT1_INT_ST", + 10, + 1, + "r" + ], + [ + "FAULT2_INT_ST", + 11, + 1, + "r" + ], + [ + "FAULT0_CLR_INT_ST", + 12, + 1, + "r" + ], + [ + "FAULT1_CLR_INT_ST", + 13, + 1, + "r" + ], + [ + "FAULT2_CLR_INT_ST", + 14, + 1, + "r" + ], + [ + "OP0_TEA_INT_ST", + 15, + 1, + "r" + ], + [ + "OP1_TEA_INT_ST", + 16, + 1, + "r" + ], + [ + "OP2_TEA_INT_ST", + 17, + 1, + "r" + ], + [ + "OP0_TEB_INT_ST", + 18, + 1, + "r" + ], + [ + "OP1_TEB_INT_ST", + 19, + 1, + "r" + ], + [ + "OP2_TEB_INT_ST", + 20, + 1, + "r" + ], + [ + "FH0_CBC_INT_ST", + 21, + 1, + "r" + ], + [ + "FH1_CBC_INT_ST", + 22, + 1, + "r" + ], + [ + "FH2_CBC_INT_ST", + 23, + 1, + "r" + ], + [ + "FH0_OST_INT_ST", + 24, + 1, + "r" + ], + [ + "FH1_OST_INT_ST", + 25, + 1, + "r" + ], + [ + "FH2_OST_INT_ST", + 26, + 1, + "r" + ], + [ + "CAP0_INT_ST", + 27, + 1, + "r" + ], + [ + "CAP1_INT_ST", + 28, + 1, + "r" + ], + [ + "CAP2_INT_ST", + 29, + 1, + "r" + ] + ] + }, + { + "name": "INT_CLR", + "offset": "0x11C", + "fields": [ + [ + "TIMER0_STOP_INT_CLR", + 0, + 1, + "w" + ], + [ + "TIMER1_STOP_INT_CLR", + 1, + 1, + "w" + ], + [ + "TIMER2_STOP_INT_CLR", + 2, + 1, + "w" + ], + [ + "TIMER0_TEZ_INT_CLR", + 3, + 1, + "w" + ], + [ + "TIMER1_TEZ_INT_CLR", + 4, + 1, + "w" + ], + [ + "TIMER2_TEZ_INT_CLR", + 5, + 1, + "w" + ], + [ + "TIMER0_TEP_INT_CLR", + 6, + 1, + "w" + ], + [ + "TIMER1_TEP_INT_CLR", + 7, + 1, + "w" + ], + [ + "TIMER2_TEP_INT_CLR", + 8, + 1, + "w" + ], + [ + "FAULT0_INT_CLR", + 9, + 1, + "w" + ], + [ + "FAULT1_INT_CLR", + 10, + 1, + "w" + ], + [ + "FAULT2_INT_CLR", + 11, + 1, + "w" + ], + [ + "FAULT0_CLR_INT_CLR", + 12, + 1, + "w" + ], + [ + "FAULT1_CLR_INT_CLR", + 13, + 1, + "w" + ], + [ + "FAULT2_CLR_INT_CLR", + 14, + 1, + "w" + ], + [ + "OP0_TEA_INT_CLR", + 15, + 1, + "w" + ], + [ + "OP1_TEA_INT_CLR", + 16, + 1, + "w" + ], + [ + "OP2_TEA_INT_CLR", + 17, + 1, + "w" + ], + [ + "OP0_TEB_INT_CLR", + 18, + 1, + "w" + ], + [ + "OP1_TEB_INT_CLR", + 19, + 1, + "w" + ], + [ + "OP2_TEB_INT_CLR", + 20, + 1, + "w" + ], + [ + "FH0_CBC_INT_CLR", + 21, + 1, + "w" + ], + [ + "FH1_CBC_INT_CLR", + 22, + 1, + "w" + ], + [ + "FH2_CBC_INT_CLR", + 23, + 1, + "w" + ], + [ + "FH0_OST_INT_CLR", + 24, + 1, + "w" + ], + [ + "FH1_OST_INT_CLR", + 25, + 1, + "w" + ], + [ + "FH2_OST_INT_CLR", + 26, + 1, + "w" + ], + [ + "CAP0_INT_CLR", + 27, + 1, + "w" + ], + [ + "CAP1_INT_CLR", + 28, + 1, + "w" + ], + [ + "CAP2_INT_CLR", + 29, + 1, + "w" + ] + ] + }, + { + "name": "CLK", + "offset": "0x120", + "fields": [ + [ + "EN", + 0, + 1 + ] + ] + }, + { + "name": "VERSION", + "offset": "0x124", + "reset": "0x02107230", + "fields": [ + [ + "DATE", + 0, + 28 + ] + ] + } + ] + }, + { + "name": "TIMG0", + "base": "0x3FF5F000", + "interrupts": [ + "TG0_T0_LEVEL", + "TG0_T1_LEVEL", + "TG0_WDT_LEVEL", + "TG0_LACT_LEVEL", + "TG0_T0_EDGE", + "TG0_T1_EDGE", + "TG0_WDT_EDGE", + "TG0_LACT_EDGE" + ], + "registers": [ + { + "name": "T0CONFIG", + "offset": "0x00", + "reset": "0x60002000", + "fields": [ + [ + "ALARM_EN", + 10, + 1 + ], + [ + "LEVEL_INT_EN", + 11, + 1 + ], + [ + "EDGE_INT_EN", + 12, + 1 + ], + [ + "DIVIDER", + 13, + 16 + ], + [ + "AUTORELOAD", + 29, + 1 + ], + [ + "INCREASE", + 30, + 1 + ], + [ + "EN", + 31, + 1 + ] + ] + }, + { + "name": "T0LO", + "offset": "0x04", + "fields": [ + [ + "LO", + 0, + 32, + "r" + ] + ] + }, + { + "name": "T0HI", + "offset": "0x08", + "fields": [ + [ + "HI", + 0, + 32, + "r" + ] + ] + }, + { + "name": "T0UPDATE", + "offset": "0x0C", + "fields": [ + [ + "UPDATE", + 0, + 32, + "w" + ] + ] + }, + { + "name": "T0ALARMLO", + "offset": "0x10", + "fields": [ + [ + "ALARM_LO", + 0, + 32 + ] + ] + }, + { + "name": "T0ALARMHI", + "offset": "0x14", + "fields": [ + [ + "ALARM_HI", + 0, + 32 + ] + ] + }, + { + "name": "T0LOADLO", + "offset": "0x18", + "fields": [ + [ + "LOAD_LO", + 0, + 32 + ] + ] + }, + { + "name": "T0LOADHI", + "offset": "0x1C", + "fields": [ + [ + "LOAD_HI", + 0, + 32 + ] + ] + }, + { + "name": "T0LOAD", + "offset": "0x20", + "fields": [ + [ + "LOAD", + 0, + 32, + "w" + ] + ] + }, + { + "name": "T1CONFIG", + "offset": "0x24", + "reset": "0x60002000", + "fields": [ + [ + "ALARM_EN", + 10, + 1 + ], + [ + "LEVEL_INT_EN", + 11, + 1 + ], + [ + "EDGE_INT_EN", + 12, + 1 + ], + [ + "DIVIDER", + 13, + 16 + ], + [ + "AUTORELOAD", + 29, + 1 + ], + [ + "INCREASE", + 30, + 1 + ], + [ + "EN", + 31, + 1 + ] + ] + }, + { + "name": "T1LO", + "offset": "0x28", + "fields": [ + [ + "LO", + 0, + 32, + "r" + ] + ] + }, + { + "name": "T1HI", + "offset": "0x2C", + "fields": [ + [ + "HI", + 0, + 32, + "r" + ] + ] + }, + { + "name": "T1UPDATE", + "offset": "0x30", + "fields": [ + [ + "UPDATE", + 0, + 32, + "w" + ] + ] + }, + { + "name": "T1ALARMLO", + "offset": "0x34", + "fields": [ + [ + "ALARM_LO", + 0, + 32 + ] + ] + }, + { + "name": "T1ALARMHI", + "offset": "0x38", + "fields": [ + [ + "ALARM_HI", + 0, + 32 + ] + ] + }, + { + "name": "T1LOADLO", + "offset": "0x3C", + "fields": [ + [ + "LOAD_LO", + 0, + 32 + ] + ] + }, + { + "name": "T1LOADHI", + "offset": "0x40", + "fields": [ + [ + "LOAD_HI", + 0, + 32 + ] + ] + }, + { + "name": "T1LOAD", + "offset": "0x44", + "fields": [ + [ + "LOAD", + 0, + 32, + "w" + ] + ] + }, + { + "name": "WDTCONFIG0", + "offset": "0x48", + "reset": "0x0004C000", + "fields": [ + [ + "WDT_FLASHBOOT_MOD_EN", + 14, + 1 + ], + [ + "WDT_SYS_RESET_LENGTH", + 15, + 3 + ], + [ + "WDT_CPU_RESET_LENGTH", + 18, + 3 + ], + [ + "WDT_LEVEL_INT_EN", + 21, + 1 + ], + [ + "WDT_EDGE_INT_EN", + 22, + 1 + ], + [ + "WDT_STG3", + 23, + 2 + ], + [ + "WDT_STG2", + 25, + 2 + ], + [ + "WDT_STG1", + 27, + 2 + ], + [ + "WDT_STG0", + 29, + 2 + ], + [ + "WDT_EN", + 31, + 1 + ] + ] + }, + { + "name": "WDTCONFIG1", + "offset": "0x4C", + "reset": "0x00010000", + "fields": [ + [ + "WDT_CLK_PRESCALE", + 16, + 16 + ] + ] + }, + { + "name": "WDTCONFIG2", + "offset": "0x50", + "reset": "0x018CBA80", + "fields": [ + [ + "WDT_STG0_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "WDTCONFIG3", + "offset": "0x54", + "reset": "0x07FFFFFF", + "fields": [ + [ + "WDT_STG1_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "WDTCONFIG4", + "offset": "0x58", + "reset": "0x000FFFFF", + "fields": [ + [ + "WDT_STG2_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "WDTCONFIG5", + "offset": "0x5C", + "reset": "0x000FFFFF", + "fields": [ + [ + "WDT_STG3_HOLD", + 0, + 32 + ] + ] + }, + { + "name": "WDTFEED", + "offset": "0x60", + "fields": [ + [ + "WDT_FEED", + 0, + 32, + "w" + ] + ] + }, + { + "name": "WDTWPROTECT", + "offset": "0x64", + "reset": "0x50D83AA1", + "fields": [ + [ + "WDT_WKEY", + 0, + 32 + ] + ] + }, + { + "name": "RTCCALICFG", + "offset": "0x68", + "reset": "0x00013000", + "fields": [ + [ + "RTC_CALI_START_CYCLING", + 12, + 1 + ], + [ + "RTC_CALI_CLK_SEL", + 13, + 2 + ], + [ + "RTC_CALI_RDY", + 15, + 1, + "r" + ], + [ + "RTC_CALI_MAX", + 16, + 15 + ], + [ + "RTC_CALI_START", + 31, + 1 + ] + ] + }, + { + "name": "RTCCALICFG1", + "offset": "0x6C", + "fields": [ + [ + "RTC_CALI_VALUE", + 7, + 25, + "r" + ] + ] + }, + { + "name": "LACTCONFIG", + "offset": "0x70", + "reset": "0x60002300", + "fields": [ + [ + "LACT_RTC_ONLY", + 7, + 1 + ], + [ + "LACT_CPST_EN", + 8, + 1 + ], + [ + "LACT_LAC_EN", + 9, + 1 + ], + [ + "LACT_ALARM_EN", + 10, + 1 + ], + [ + "LACT_LEVEL_INT_EN", + 11, + 1 + ], + [ + "LACT_EDGE_INT_EN", + 12, + 1 + ], + [ + "LACT_DIVIDER", + 13, + 16 + ], + [ + "LACT_AUTORELOAD", + 29, + 1 + ], + [ + "LACT_INCREASE", + 30, + 1 + ], + [ + "LACT_EN", + 31, + 1 + ] + ] + }, + { + "name": "LACTRTC", + "offset": "0x74", + "fields": [ + [ + "LACT_RTC_STEP_LEN", + 6, + 26 + ] + ] + }, + { + "name": "LACTLO", + "offset": "0x78", + "fields": [ + [ + "LACT_LO", + 0, + 32, + "r" + ] + ] + }, + { + "name": "LACTHI", + "offset": "0x7C", + "fields": [ + [ + "LACT_HI", + 0, + 32, + "r" + ] + ] + }, + { + "name": "LACTUPDATE", + "offset": "0x80", + "fields": [ + [ + "LACT_UPDATE", + 0, + 32, + "w" + ] + ] + }, + { + "name": "LACTALARMLO", + "offset": "0x84", + "fields": [ + [ + "LACT_ALARM_LO", + 0, + 32 + ] + ] + }, + { + "name": "LACTALARMHI", + "offset": "0x88", + "fields": [ + [ + "LACT_ALARM_HI", + 0, + 32 + ] + ] + }, + { + "name": "LACTLOADLO", + "offset": "0x8C", + "fields": [ + [ + "LACT_LOAD_LO", + 0, + 32 + ] + ] + }, + { + "name": "LACTLOADHI", + "offset": "0x90", + "fields": [ + [ + "LACT_LOAD_HI", + 0, + 32 + ] + ] + }, + { + "name": "LACTLOAD", + "offset": "0x94", + "fields": [ + [ + "LACT_LOAD", + 0, + 32, + "w" + ] + ] + }, + { + "name": "INT_ENA_TIMERS", + "offset": "0x98", + "fields": [ + [ + "T0_INT_ENA", + 0, + 1 + ], + [ + "T1_INT_ENA", + 1, + 1 + ], + [ + "WDT_INT_ENA", + 2, + 1 + ], + [ + "LACT_INT_ENA", + 3, + 1 + ] + ] + }, + { + "name": "INT_RAW_TIMERS", + "offset": "0x9C", + "fields": [ + [ + "T0_INT_RAW", + 0, + 1, + "r" + ], + [ + "T1_INT_RAW", + 1, + 1, + "r" + ], + [ + "WDT_INT_RAW", + 2, + 1, + "r" + ], + [ + "LACT_INT_RAW", + 3, + 1, + "r" + ] + ] + }, + { + "name": "INT_ST_TIMERS", + "offset": "0xA0", + "fields": [ + [ + "T0_INT_ST", + 0, + 1, + "r" + ], + [ + "T1_INT_ST", + 1, + 1, + "r" + ], + [ + "WDT_INT_ST", + 2, + 1, + "r" + ], + [ + "LACT_INT_ST", + 3, + 1, + "r" + ] + ] + }, + { + "name": "INT_CLR_TIMERS", + "offset": "0xA4", + "fields": [ + [ + "T0_INT_CLR", + 0, + 1, + "w" + ], + [ + "T1_INT_CLR", + 1, + 1, + "w" + ], + [ + "WDT_INT_CLR", + 2, + 1, + "w" + ], + [ + "LACT_INT_CLR", + 3, + 1, + "w" + ] + ] + }, + { + "name": "NTIMERS_DATE", + "offset": "0xF8", + "reset": "0x01604290", + "fields": [ + [ + "NTIMERS_DATE", + 0, + 28 + ] + ] + }, + { + "name": "TIMGCLK", + "offset": "0xFC", + "fields": [ + [ + "CLK_EN", + 31, + 1 + ] + ] + } + ] + }, + { + "name": "TIMG1", + "base": "0x3FF60000", + "interrupts": [ + "TG1_T0_LEVEL", + "TG1_T1_LEVEL", + "TG1_WDT_LEVEL", + "TG1_LACT_LEVEL", + "TG1_T0_EDGE", + "TG1_T1_EDGE", + "TG1_WDT_EDGE", + "TG1_LACT_EDGE" + ], + "derived_from": "TIMG0" + }, + { + "name": "SPI2", + "base": "0x3FF64000", + "interrupts": [ + "SPI2", + "SPI2_DMA" + ], + "derived_from": "SPI0" + }, + { + "name": "SPI3", + "base": "0x3FF65000", + "interrupts": [ + "SPI3", + "SPI3_DMA" + ], + "derived_from": "SPI0" + }, + { + "name": "APB_CTRL", + "base": "0x3FF66000", + "registers": [ + { + "name": "SYSCLK_CONF", + "offset": "0x00", + "reset": "0x00002000", + "fields": [ + [ + "PRE_DIV_CNT", + 0, + 10 + ], + [ + "CLK_320M_EN", + 10, + 1 + ], + [ + "CLK_EN", + 11, + 1 + ], + [ + "RST_TICK_CNT", + 12, + 1 + ], + [ + "QUICK_CLK_CHNG", + 13, + 1 + ] + ] + }, + { + "name": "XTAL_TICK_CONF", + "offset": "0x04", + "reset": "0x00000027", + "fields": [ + [ + "XTAL_TICK_NUM", + 0, + 8 + ] + ] + }, + { + "name": "PLL_TICK_CONF", + "offset": "0x08", + "reset": "0x0000004F", + "fields": [ + [ + "PLL_TICK_NUM", + 0, + 8 + ] + ] + }, + { + "name": "CK8M_TICK_CONF", + "offset": "0x0C", + "reset": "0x0000000B", + "fields": [ + [ + "CK8M_TICK_NUM", + 0, + 8 + ] + ] + }, + { + "name": "APB_SARADC_CTRL", + "offset": "0x10", + "reset": "0x007F8240", + "fields": [ + [ + "SARADC_START_FORCE", + 0, + 1 + ], + [ + "SARADC_START", + 1, + 1 + ], + [ + "SARADC_SAR2_MUX", + 2, + 1 + ], + [ + "SARADC_WORK_MODE", + 3, + 2 + ], + [ + "SARADC_SAR_SEL", + 5, + 1 + ], + [ + "SARADC_SAR_CLK_GATED", + 6, + 1 + ], + [ + "SARADC_SAR_CLK_DIV", + 7, + 8 + ], + [ + "SARADC_SAR1_PATT_LEN", + 15, + 4 + ], + [ + "SARADC_SAR2_PATT_LEN", + 19, + 4 + ], + [ + "SARADC_SAR1_PATT_P_CLEAR", + 23, + 1 + ], + [ + "SARADC_SAR2_PATT_P_CLEAR", + 24, + 1 + ], + [ + "SARADC_DATA_SAR_SEL", + 25, + 1 + ], + [ + "SARADC_DATA_TO_I2S", + 26, + 1 + ] + ] + }, + { + "name": "APB_SARADC_CTRL2", + "offset": "0x14", + "reset": "0x000001FE", + "fields": [ + [ + "SARADC_MEAS_NUM_LIMIT", + 0, + 1 + ], + [ + "SARADC_MAX_MEAS_NUM", + 1, + 8 + ], + [ + "SARADC_SAR1_INV", + 9, + 1 + ], + [ + "SARADC_SAR2_INV", + 10, + 1 + ] + ] + }, + { + "name": "APB_SARADC_FSM", + "offset": "0x18", + "reset": "0x0208FF08", + "fields": [ + [ + "SARADC_RSTB_WAIT", + 0, + 8 + ], + [ + "SARADC_STANDBY_WAIT", + 8, + 8 + ], + [ + "SARADC_START_WAIT", + 16, + 8 + ], + [ + "SARADC_SAMPLE_CYCLE", + 24, + 8 + ] + ] + }, + { + "name": "APB_SARADC_SAR1_PATT_TAB1", + "offset": "0x1C", + "reset": "0x0F0F0F0F", + "fields": [ + [ + "SARADC_SAR1_PATT_TAB1", + 0, + 32 + ] + ] + }, + { + "name": "APB_SARADC_SAR1_PATT_TAB2", + "offset": "0x20", + "reset": "0x0F0F0F0F", + "fields": [ + [ + "SARADC_SAR1_PATT_TAB1", + 0, + 32 + ] + ] + }, + { + "name": "APB_SARADC_SAR1_PATT_TAB3", + "offset": "0x24", + "reset": "0x0F0F0F0F", + "fields": [ + [ + "SARADC_SAR1_PATT_TAB1", + 0, + 32 + ] + ] + }, + { + "name": "APB_SARADC_SAR1_PATT_TAB4", + "offset": "0x28", + "reset": "0x0F0F0F0F", + "fields": [ + [ + "SARADC_SAR1_PATT_TAB1", + 0, + 32 + ] + ] + }, + { + "name": "APB_SARADC_SAR2_PATT_TAB1", + "offset": "0x2C", + "reset": "0x0F0F0F0F", + "fields": [ + [ + "SARADC_SAR2_PATT_TAB1", + 0, + 32 + ] + ] + }, + { + "name": "APB_SARADC_SAR2_PATT_TAB2", + "offset": "0x30", + "reset": "0x0F0F0F0F", + "fields": [ + [ + "SARADC_SAR2_PATT_TAB1", + 0, + 32 + ] + ] + }, + { + "name": "APB_SARADC_SAR2_PATT_TAB3", + "offset": "0x34", + "reset": "0x0F0F0F0F", + "fields": [ + [ + "SARADC_SAR2_PATT_TAB1", + 0, + 32 + ] + ] + }, + { + "name": "APB_SARADC_SAR2_PATT_TAB4", + "offset": "0x38", + "reset": "0x0F0F0F0F", + "fields": [ + [ + "SARADC_SAR2_PATT_TAB1", + 0, + 32 + ] + ] + }, + { + "name": "APLL_TICK_CONF", + "offset": "0x3C", + "reset": "0x00000063", + "fields": [ + [ + "APLL_TICK_NUM", + 0, + 8 + ] + ] + }, + { + "name": "DATE", + "offset": "0x7C", + "reset": "0x16042000", + "fields": [ + [ + "DATE", + 0, + 32 + ] + ] + } + ] + }, + { + "name": "I2C1", + "base": "0x3FF67000", + "interrupts": [ + "I2C_EXT1" + ], + "derived_from": "I2C0" + }, + { + "name": "SDHOST", + "base": "0x3FF68000", + "registers": [ + { + "name": "CTRL", + "offset": "0x00", + "fields": [ + [ + "CONTROLLER_RESET", + 0, + 1 + ], + [ + "FIFO_RESET", + 1, + 1 + ], + [ + "DMA_RESET", + 2, + 1 + ], + [ + "INT_ENABLE", + 4, + 1 + ], + [ + "READ_WAIT", + 6, + 1 + ], + [ + "SEND_IRQ_RESPONSE", + 7, + 1 + ], + [ + "ABORT_READ_DATA", + 8, + 1 + ], + [ + "SEND_CCSD", + 9, + 1 + ], + [ + "SEND_AUTO_STOP_CCSD", + 10, + 1 + ], + [ + "CEATA_DEVICE_INTERRUPT_STATUS", + 11, + 1 + ] + ] + }, + { + "name": "CLKDIV", + "offset": "0x08", + "fields": [ + [ + "CLK_DIVIDER0", + 0, + 8 + ], + [ + "CLK_DIVIDER1", + 8, + 8 + ], + [ + "CLK_DIVIDER2", + 16, + 8 + ], + [ + "CLK_DIVIDER3", + 24, + 8 + ] + ] + }, + { + "name": "CLKSRC", + "offset": "0x0C", + "fields": [ + [ + "CLKSRC", + 0, + 4 + ] + ] + }, + { + "name": "CLKENA", + "offset": "0x10", + "fields": [ + [ + "CCLK_ENABLE", + 0, + 2 + ], + [ + "LP_ENABLE", + 16, + 2 + ] + ] + }, + { + "name": "TMOUT", + "offset": "0x14", + "reset": "0xFFFFFF40", + "fields": [ + [ + "RESPONSE_TIMEOUT", + 0, + 8 + ], + [ + "DATA_TIMEOUT", + 8, + 24 + ] + ] + }, + { + "name": "CTYPE", + "offset": "0x18", + "fields": [ + [ + "CARD_WIDTH4", + 0, + 2 + ], + [ + "CARD_WIDTH8", + 16, + 2 + ] + ] + }, + { + "name": "BLKSIZ", + "offset": "0x1C", + "reset": "0x00000200", + "fields": [ + [ + "BLOCK_SIZE", + 0, + 16 + ] + ] + }, + { + "name": "BYTCNT", + "offset": "0x20", + "reset": "0x00000200", + "fields": [ + [ + "BYTE_COUNT", + 0, + 32 + ] + ] + }, + { + "name": "INTMASK", + "offset": "0x24", + "fields": [ + [ + "INT_MASK", + 0, + 16 + ], + [ + "SDIO_INT_MASK", + 16, + 2 + ] + ] + }, + { + "name": "CMDARG", + "offset": "0x28", + "fields": [ + [ + "CMDARG", + 0, + 32 + ] + ] + }, + { + "name": "CMD", + "offset": "0x2C", + "reset": "0x20000000", + "fields": [ + [ + "INDEX", + 0, + 6 + ], + [ + "RESPONSE_EXPECT", + 6, + 1 + ], + [ + "RESPONSE_LENGTH", + 7, + 1 + ], + [ + "CHECK_RESPONSE_CRC", + 8, + 1 + ], + [ + "DATA_EXPECTED", + 9, + 1 + ], + [ + "READ_WRITE", + 10, + 1 + ], + [ + "TRANSFER_MODE", + 11, + 1 + ], + [ + "SEND_AUTO_STOP", + 12, + 1 + ], + [ + "WAIT_PRVDATA_COMPLETE", + 13, + 1 + ], + [ + "STOP_ABORT_CMD", + 14, + 1 + ], + [ + "SEND_INITIALIZATION", + 15, + 1 + ], + [ + "CARD_NUMBER", + 16, + 5 + ], + [ + "UPDATE_CLOCK_REGISTERS_ONLY", + 21, + 1 + ], + [ + "READ_CEATA_DEVICE", + 22, + 1 + ], + [ + "CCS_EXPECTED", + 23, + 1 + ], + [ + "USE_HOLE", + 29, + 1 + ], + [ + "START_CMD", + 31, + 1 + ] + ] + }, + { + "name": "RESP0", + "offset": "0x30", + "fields": [ + [ + "RESPONSE0", + 0, + 32, + "r" + ] + ] + }, + { + "name": "RESP1", + "offset": "0x34", + "fields": [ + [ + "RESPONSE1", + 0, + 32, + "r" + ] + ] + }, + { + "name": "RESP2", + "offset": "0x38", + "fields": [ + [ + "RESPONSE2", + 0, + 32, + "r" + ] + ] + }, + { + "name": "RESP3", + "offset": "0x3C", + "fields": [ + [ + "RESPONSE3", + 0, + 32, + "r" + ] + ] + }, + { + "name": "MINTSTS", + "offset": "0x40", + "fields": [ + [ + "INT_STATUS_MSK", + 0, + 16, + "r" + ], + [ + "SDIO_INTERRUPT_MSK", + 16, + 2, + "r" + ] + ] + }, + { + "name": "RINTSTS", + "offset": "0x44", + "fields": [ + [ + "INT_STATUS_RAW", + 0, + 16 + ], + [ + "SDIO_INTERRUPT_RAW", + 16, + 2 + ] + ] + }, + { + "name": "STATUS", + "offset": "0x48", + "reset": "0x00000716", + "fields": [ + [ + "FIFO_RX_WATERMARK", + 0, + 1, + "r" + ], + [ + "FIFO_TX_WATERMARK", + 1, + 1, + "r" + ], + [ + "FIFO_EMPTY", + 2, + 1, + "r" + ], + [ + "FIFO_FULL", + 3, + 1, + "r" + ], + [ + "COMMAND_FSM_STATES", + 4, + 4, + "r" + ], + [ + "DATA_3_STATUS", + 8, + 1, + "r" + ], + [ + "DATA_BUSY", + 9, + 1, + "r" + ], + [ + "DATA_STATE_MC_BUSY", + 10, + 1, + "r" + ], + [ + "RESPONSE_INDEX", + 11, + 6, + "r" + ], + [ + "FIFO_COUNT", + 17, + 13, + "r" + ] + ] + }, + { + "name": "FIFOTH", + "offset": "0x4C", + "fields": [ + [ + "TX_WMARK", + 0, + 12 + ], + [ + "RX_WMARK", + 16, + 11 + ], + [ + "DMA_MULTIPLE_TRANSACTION_SIZE", + 28, + 3 + ] + ] + }, + { + "name": "CDETECT", + "offset": "0x50", + "fields": [ + [ + "CARD_DETECT_N", + 0, + 2, + "r" + ] + ] + }, + { + "name": "WRTPRT", + "offset": "0x54", + "fields": [ + [ + "WRITE_PROTECT", + 0, + 2, + "r" + ] + ] + }, + { + "name": "TCBCNT", + "offset": "0x5C", + "fields": [ + [ + "TCBCNT", + 0, + 32, + "r" + ] + ] + }, + { + "name": "TBBCNT", + "offset": "0x60", + "fields": [ + [ + "TBBCNT", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DEBNCE", + "offset": "0x64", + "fields": [ + [ + "DEBOUNCE_COUNT", + 0, + 24 + ] + ] + }, + { + "name": "USRID", + "offset": "0x68", + "fields": [ + [ + "USRID", + 0, + 32 + ] + ] + }, + { + "name": "VERID", + "offset": "0x6C", + "reset": "0x5432270A", + "fields": [ + [ + "VERSIONID", + 0, + 32, + "r" + ] + ] + }, + { + "name": "HCON", + "offset": "0x70", + "reset": "0x03444CC3", + "fields": [ + [ + "CARD_TYPE", + 0, + 1, + "r" + ], + [ + "CARD_NUM", + 1, + 5, + "r" + ], + [ + "BUS_TYPE", + 6, + 1, + "r" + ], + [ + "DATA_WIDTH", + 7, + 3, + "r" + ], + [ + "ADDR_WIDTH", + 10, + 6, + "r" + ], + [ + "DMA_WIDTH", + 18, + 3, + "r" + ], + [ + "RAM_INDISE", + 21, + 1, + "r" + ], + [ + "HOLD", + 22, + 1, + "r" + ], + [ + "NUM_CLK_DIV", + 24, + 2, + "r" + ] + ] + }, + { + "name": "UHS", + "offset": "0x74", + "fields": [ + [ + "DDR", + 16, + 2 + ] + ] + }, + { + "name": "RST_N", + "offset": "0x78", + "reset": "0x00000001", + "fields": [ + [ + "CARD_RESET", + 0, + 2 + ] + ] + }, + { + "name": "BMOD", + "offset": "0x80", + "fields": [ + [ + "SWR", + 0, + 1 + ], + [ + "FB", + 1, + 1 + ], + [ + "DE", + 7, + 1 + ], + [ + "PBL", + 8, + 3 + ] + ] + }, + { + "name": "PLDMND", + "offset": "0x84", + "fields": [ + [ + "PD", + 0, + 32, + "w" + ] + ] + }, + { + "name": "DBADDR", + "offset": "0x88", + "fields": [ + [ + "DBADDR", + 0, + 32 + ] + ] + }, + { + "name": "IDSTS", + "offset": "0x8C", + "fields": [ + [ + "TI", + 0, + 1 + ], + [ + "RI", + 1, + 1 + ], + [ + "FBE", + 2, + 1 + ], + [ + "DU", + 4, + 1 + ], + [ + "CES", + 5, + 1 + ], + [ + "NIS", + 8, + 1 + ], + [ + "AIS", + 9, + 1 + ], + [ + "FBE_CODE", + 10, + 3 + ], + [ + "FSM", + 13, + 4 + ] + ] + }, + { + "name": "IDINTEN", + "offset": "0x90", + "fields": [ + [ + "TI", + 0, + 1 + ], + [ + "RI", + 1, + 1 + ], + [ + "FBE", + 2, + 1 + ], + [ + "DU", + 4, + 1 + ], + [ + "CES", + 5, + 1 + ], + [ + "NI", + 8, + 1 + ], + [ + "AI", + 9, + 1 + ] + ] + }, + { + "name": "DSCADDR", + "offset": "0x94", + "fields": [ + [ + "DSCADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "BUFADDR", + "offset": "0x98", + "fields": [ + [ + "BUFADDR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "CARDTHRCTL", + "offset": "0x100", + "fields": [ + [ + "CARDRDTHREN", + 0, + 1 + ], + [ + "CARDCLRINTEN", + 1, + 1 + ], + [ + "CARDWRTHREN", + 2, + 1 + ], + [ + "CARDTHRESHOLD", + 16, + 16 + ] + ] + }, + { + "name": "EMMCDDR", + "offset": "0x10C", + "fields": [ + [ + "HALFSTARTBIT", + 0, + 2 + ], + [ + "HS400_MODE", + 31, + 1 + ] + ] + }, + { + "name": "ENSHIFT", + "offset": "0x110", + "fields": [ + [ + "ENABLE_SHIFT", + 0, + 4 + ] + ] + }, + { + "name": "BUFFIFO", + "offset": "0x200", + "fields": [ + [ + "BUFFIFO", + 0, + 32 + ] + ] + }, + { + "name": "CLK_EDGE_SEL", + "offset": "0x800", + "reset": "0x00820200", + "fields": [ + [ + "CCLKIN_EDGE_DRV_SEL", + 0, + 3 + ], + [ + "CCLKIN_EDGE_SAM_SEL", + 3, + 3 + ], + [ + "CCLKIN_EDGE_SLF_SEL", + 6, + 3 + ], + [ + "CCLLKIN_EDGE_H", + 9, + 4 + ], + [ + "CCLLKIN_EDGE_L", + 13, + 4 + ], + [ + "CCLLKIN_EDGE_N", + 17, + 4 + ], + [ + "ESDIO_MODE", + 21, + 1 + ], + [ + "ESD_MODE", + 22, + 1 + ], + [ + "CCLK_EN", + 23, + 1 + ] + ] + } + ] + }, + { + "name": "EMAC_DMA", + "base": "0x3FF69000", + "registers": [ + { + "name": "DMABUSMODE", + "offset": "0x00", + "fields": [ + [ + "SW_RST", + 0, + 1 + ], + [ + "DMA_ARB_SCH", + 1, + 1 + ], + [ + "DESC_SKIP_LEN", + 2, + 5 + ], + [ + "ALT_DESC_SIZE", + 7, + 1 + ], + [ + "PROG_BURST_LEN", + 8, + 6 + ], + [ + "PRI_RATIO", + 14, + 2 + ], + [ + "FIXED_BURST", + 16, + 1 + ], + [ + "RX_DMA_PBL", + 17, + 6 + ], + [ + "USE_SEP_PBL", + 23, + 1 + ], + [ + "PBLX8_MODE", + 24, + 1 + ], + [ + "DMAADDRALIBEA", + 25, + 1 + ], + [ + "DMAMIXEDBURST", + 26, + 1 + ] + ] + }, + { + "name": "DMATXPOLLDEMAND", + "offset": "0x04", + "fields": [ + [ + "DMATXPOLLDEMAND", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMARXPOLLDEMAND", + "offset": "0x08", + "fields": [ + [ + "DMARXPOLLDEMAND", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMARXBASEADDR", + "offset": "0x0C" + }, + { + "name": "DMATXBASEADDR", + "offset": "0x10" + }, + { + "name": "DMASTATUS", + "offset": "0x14", + "fields": [ + [ + "TRANS_INT", + 0, + 1 + ], + [ + "TRANS_PROC_STOP", + 1, + 1 + ], + [ + "TRANS_BUF_UNAVAIL", + 2, + 1 + ], + [ + "TRANS_JABBER_TO", + 3, + 1 + ], + [ + "RECV_OVFLOW", + 4, + 1 + ], + [ + "TRANS_UNDFLOW", + 5, + 1 + ], + [ + "RECV_INT", + 6, + 1 + ], + [ + "RECV_BUF_UNAVAIL", + 7, + 1 + ], + [ + "RECV_PROC_STOP", + 8, + 1 + ], + [ + "RECV_WDT_TO", + 9, + 1 + ], + [ + "EARLY_TRANS_INT", + 10, + 1 + ], + [ + "FATAL_BUS_ERR_INT", + 13, + 1 + ], + [ + "EARLY_RECV_INT", + 14, + 1 + ], + [ + "ABN_INT_SUMM", + 15, + 1 + ], + [ + "NORM_INT_SUMM", + 16, + 1 + ], + [ + "RECV_PROC_STATE", + 17, + 3 + ], + [ + "TRANS_PROC_STATE", + 20, + 3 + ], + [ + "ERROR_BITS", + 23, + 3 + ], + [ + "PMT_INT", + 28, + 1 + ], + [ + "TS_TRI_INT", + 29, + 1 + ] + ] + }, + { + "name": "DMAOPERATION_MODE", + "offset": "0x18", + "fields": [ + [ + "START_STOP_RX", + 1, + 1 + ], + [ + "OPT_SECOND_FRAME", + 2, + 1 + ], + [ + "RX_THRESH_CTRL", + 3, + 2 + ], + [ + "DROP_GFRM", + 5, + 1 + ], + [ + "FWD_UNDER_GF", + 6, + 1 + ], + [ + "FWD_ERR_FRAME", + 7, + 1 + ], + [ + "START_STOP_TRANSMISSION_COMMAND", + 13, + 1 + ], + [ + "TX_THRESH_CTRL", + 14, + 3 + ], + [ + "FLUSH_TX_FIFO", + 20, + 1 + ], + [ + "TX_STR_FWD", + 21, + 1 + ], + [ + "DIS_FLUSH_RECV_FRAMES", + 24, + 1 + ], + [ + "RX_STORE_FORWARD", + 25, + 1 + ], + [ + "DIS_DROP_TCPIP_ERR_FRAM", + 26, + 1 + ] + ] + }, + { + "name": "DMAIN_EN", + "offset": "0x1C", + "fields": [ + [ + "DMAIN_TIE", + 0, + 1 + ], + [ + "DMAIN_TSE", + 1, + 1 + ], + [ + "DMAIN_TBUE", + 2, + 1 + ], + [ + "DMAIN_TJTE", + 3, + 1 + ], + [ + "DMAIN_OIE", + 4, + 1 + ], + [ + "DMAIN_UIE", + 5, + 1 + ], + [ + "DMAIN_RIE", + 6, + 1 + ], + [ + "DMAIN_RBUE", + 7, + 1 + ], + [ + "DMAIN_RSE", + 8, + 1 + ], + [ + "DMAIN_RWTE", + 9, + 1 + ], + [ + "DMAIN_ETIE", + 10, + 1 + ], + [ + "DMAIN_FBEE", + 13, + 1 + ], + [ + "DMAIN_ERIE", + 14, + 1 + ], + [ + "DMAIN_AISE", + 15, + 1 + ], + [ + "DMAIN_NISE", + 16, + 1 + ] + ] + }, + { + "name": "DMAMISSEDFR", + "offset": "0x20", + "fields": [ + [ + "MISSED_FC", + 0, + 16 + ], + [ + "OVERFLOW_BMFC", + 16, + 1 + ], + [ + "OVERFLOW_FC", + 17, + 11 + ], + [ + "OVERFLOW_BFOC", + 28, + 1 + ] + ] + }, + { + "name": "DMARINTWDTIMER", + "offset": "0x24", + "fields": [ + [ + "RIWTC", + 0, + 8 + ] + ] + }, + { + "name": "DMATXCURRDESC", + "offset": "0x48", + "fields": [ + [ + "DMATXCURRDESC", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMARXCURRDESC", + "offset": "0x4C", + "fields": [ + [ + "DMARXCURRDESC", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMATXCURRADDR_BUF", + "offset": "0x50", + "fields": [ + [ + "DMATXCURRADDR_BUF", + 0, + 32, + "r" + ] + ] + }, + { + "name": "DMARXCURRADDR_BUF", + "offset": "0x54", + "fields": [ + [ + "DMARXCURRADDR_BUF", + 0, + 32, + "r" + ] + ] + } + ] + }, + { + "name": "EMAC_EXT", + "base": "0x3FF69800", + "registers": [ + { + "name": "EX_CLKOUT_CONF", + "offset": "0x00", + "fields": [ + [ + "DIV_NUM", + 0, + 4 + ], + [ + "H_DIV_NUM", + 4, + 4 + ], + [ + "DLY_NUM", + 8, + 2 + ] + ] + }, + { + "name": "EX_OSCCLK_CONF", + "offset": "0x04", + "fields": [ + [ + "DIV_NUM_10M", + 0, + 6 + ], + [ + "H_DIV_NUM_10M", + 6, + 6 + ], + [ + "DIV_NUM_100M", + 12, + 6 + ], + [ + "H_DIV_NUM_100M", + 18, + 6 + ], + [ + "CLK_SEL", + 24, + 1 + ] + ] + }, + { + "name": "EX_CLK_CTRL", + "offset": "0x08", + "fields": [ + [ + "EXT_EN", + 0, + 1 + ], + [ + "INT_EN", + 1, + 1 + ], + [ + "RX_125_CLK_EN", + 2, + 1 + ], + [ + "MII_CLK_TX_EN", + 3, + 1 + ], + [ + "MII_CLK_RX_EN", + 4, + 1 + ], + [ + "CLK_EN", + 5, + 1 + ] + ] + }, + { + "name": "EX_PHYINF_CONF", + "offset": "0x0C", + "fields": [ + [ + "INT_REVMII_RX_CLK_SEL", + 0, + 1 + ], + [ + "EXT_REVMII_RX_CLK_SEL", + 1, + 1 + ], + [ + "SBD_FLOWCTRL", + 2, + 1 + ], + [ + "CORE_PHY_ADDR", + 3, + 5 + ], + [ + "REVMII_PHY_ADDR", + 8, + 5 + ], + [ + "PHY_INTF_SEL", + 13, + 3 + ], + [ + "SS_MODE", + 16, + 1 + ], + [ + "SBD_CLK_GATING_EN", + 17, + 1 + ], + [ + "PMT_CTRL_EN", + 18, + 1 + ], + [ + "SCR_SMI_DLY_RX_SYNC", + 19, + 1 + ], + [ + "TX_ERR_OUT_EN", + 20, + 1 + ] + ] + }, + { + "name": "PD_SEL", + "offset": "0x10", + "fields": [ + [ + "RAM_PD_EN", + 0, + 2 + ] + ] + }, + { + "name": "EX_DATE", + "offset": "0xFC" + } + ] + }, + { + "name": "EMAC_MAC", + "base": "0x3FF6A000", + "registers": [ + { + "name": "EMACCONFIG", + "offset": "0x00", + "fields": [ + [ + "PLTF", + 0, + 2 + ], + [ + "RX", + 2, + 1 + ], + [ + "TX", + 3, + 1 + ], + [ + "DEFERRALCHECK", + 4, + 1 + ], + [ + "BACKOFFLIMIT", + 5, + 2 + ], + [ + "PADCRCSTRIP", + 7, + 1 + ], + [ + "RETRY", + 9, + 1 + ], + [ + "RXIPCOFFLOAD", + 10, + 1 + ], + [ + "DUPLEX", + 11, + 1 + ], + [ + "LOOPBACK", + 12, + 1 + ], + [ + "RXOWN", + 13, + 1 + ], + [ + "FESPEED", + 14, + 1 + ], + [ + "MII", + 15, + 1 + ], + [ + "DISABLECRS", + 16, + 1 + ], + [ + "INTERFRAMEGAP", + 17, + 3 + ], + [ + "JUMBOFRAME", + 20, + 1 + ], + [ + "JABBER", + 22, + 1 + ], + [ + "WATCHDOG", + 23, + 1 + ], + [ + "ASS2KP", + 27, + 1 + ], + [ + "SAIRC", + 28, + 3 + ] + ] + }, + { + "name": "EMACFF", + "offset": "0x04", + "fields": [ + [ + "PMODE", + 0, + 1 + ], + [ + "DAIF", + 3, + 1 + ], + [ + "PAM", + 4, + 1 + ], + [ + "DBF", + 5, + 1 + ], + [ + "PCF", + 6, + 2 + ], + [ + "SAIF", + 8, + 1 + ], + [ + "SAFE", + 9, + 1 + ], + [ + "RECEIVE_ALL", + 31, + 1 + ] + ] + }, + { + "name": "EMACGMIIADDR", + "offset": "0x10", + "fields": [ + [ + "MIIBUSY", + 0, + 1 + ], + [ + "MIIWRITE", + 1, + 1 + ], + [ + "MIICSRCLK", + 2, + 4 + ], + [ + "MIIREG", + 6, + 5 + ], + [ + "MIIDEV", + 11, + 5 + ] + ] + }, + { + "name": "EMACMIIDATA", + "offset": "0x14", + "fields": [ + [ + "MII_DATA", + 0, + 16 + ] + ] + }, + { + "name": "EMACFC", + "offset": "0x18", + "fields": [ + [ + "FCBBA", + 0, + 1 + ], + [ + "TFCE", + 1, + 1 + ], + [ + "RFCE", + 2, + 1 + ], + [ + "UPFD", + 3, + 1 + ], + [ + "PLT", + 4, + 2 + ], + [ + "DZPQ", + 7, + 1 + ], + [ + "PAUSE_TIME", + 16, + 16 + ] + ] + }, + { + "name": "EMACDEBUG", + "offset": "0x24", + "fields": [ + [ + "MACRPES", + 0, + 1 + ], + [ + "MACRFFCS", + 1, + 2 + ], + [ + "MTLRFWCAS", + 4, + 1 + ], + [ + "MTLRFRCS", + 5, + 2 + ], + [ + "MTLRFFLS", + 8, + 2 + ], + [ + "MACTPES", + 16, + 1 + ], + [ + "MACTFCS", + 17, + 2 + ], + [ + "MACTP", + 19, + 1 + ], + [ + "MTLTFRCS", + 20, + 2 + ], + [ + "MTLTFWCS", + 22, + 1 + ], + [ + "MTLTFNES", + 24, + 1 + ], + [ + "MTLTSFFS", + 25, + 1 + ] + ] + }, + { + "name": "PMT_RWUFFR", + "offset": "0x28", + "fields": [ + [ + "PMT_RWUFFR", + 0, + 32, + "r" + ] + ] + }, + { + "name": "PMT_CSR", + "offset": "0x2C", + "fields": [ + [ + "PWRDWN", + 0, + 1 + ], + [ + "MGKPKTEN", + 1, + 1 + ], + [ + "RWKPKTEN", + 2, + 1 + ], + [ + "MGKPRCVD", + 5, + 1 + ], + [ + "RWKPRCVD", + 6, + 1 + ], + [ + "GLBLUCAST", + 9, + 1 + ], + [ + "RWKPTR", + 24, + 5 + ], + [ + "RWKFILTRST", + 31, + 1 + ] + ] + }, + { + "name": "EMACLPI_CRS", + "offset": "0x30", + "fields": [ + [ + "TLPIEN", + 0, + 1 + ], + [ + "TLPIEX", + 1, + 1 + ], + [ + "RLPIEN", + 2, + 1 + ], + [ + "RLPIEX", + 3, + 1 + ], + [ + "TLPIST", + 8, + 1 + ], + [ + "RLPIST", + 9, + 1 + ], + [ + "LPIEN", + 16, + 1 + ], + [ + "PLS", + 17, + 1 + ], + [ + "LPITXA", + 19, + 1 + ] + ] + }, + { + "name": "EMACLPITIMERSCONTROL", + "offset": "0x34", + "fields": [ + [ + "LPI_TW_TIMER", + 0, + 16 + ], + [ + "LPI_LS_TIMER", + 16, + 10 + ] + ] + }, + { + "name": "EMACINTS", + "offset": "0x38", + "fields": [ + [ + "PMTINTS", + 3, + 1 + ], + [ + "LPIIS", + 10, + 1 + ] + ] + }, + { + "name": "EMACINTMASK", + "offset": "0x3C", + "fields": [ + [ + "PMTINTMASK", + 3, + 1 + ], + [ + "LPIINTMASK", + 10, + 1 + ] + ] + }, + { + "name": "EMACADDR0HIGH", + "offset": "0x40", + "fields": [ + [ + "ADDRESS0_HI", + 0, + 16 + ], + [ + "ADDRESS_ENABLE0", + 31, + 1 + ] + ] + }, + { + "name": "EMACADDR0LOW", + "offset": "0x44" + }, + { + "name": "EMACADDR1HIGH", + "offset": "0x48", + "fields": [ + [ + "MAC_ADDRESS1_HI", + 0, + 16 + ], + [ + "MASK_BYTE_CONTROL", + 24, + 6 + ], + [ + "SOURCE_ADDRESS", + 30, + 1 + ], + [ + "ADDRESS_ENABLE1", + 31, + 1 + ] + ] + }, + { + "name": "EMACADDR1LOW", + "offset": "0x4C" + }, + { + "name": "EMACADDR2HIGH", + "offset": "0x50", + "fields": [ + [ + "MAC_ADDRESS2_HI", + 0, + 16 + ], + [ + "MASK_BYTE_CONTROL2", + 24, + 6 + ], + [ + "SOURCE_ADDRESS2", + 30, + 1 + ], + [ + "ADDRESS_ENABLE2", + 31, + 1 + ] + ] + }, + { + "name": "EMACADDR2LOW", + "offset": "0x54" + }, + { + "name": "EMACADDR3HIGH", + "offset": "0x58", + "fields": [ + [ + "MAC_ADDRESS3_HI", + 0, + 16 + ], + [ + "MASK_BYTE_CONTROL3", + 24, + 6 + ], + [ + "SOURCE_ADDRESS3", + 30, + 1 + ], + [ + "ADDRESS_ENABLE3", + 31, + 1 + ] + ] + }, + { + "name": "EMACADDR3LOW", + "offset": "0x5C" + }, + { + "name": "EMACADDR4HIGH", + "offset": "0x60", + "fields": [ + [ + "MAC_ADDRESS4_HI", + 0, + 16 + ], + [ + "MASK_BYTE_CONTROL4", + 24, + 6 + ], + [ + "SOURCE_ADDRESS4", + 30, + 1 + ], + [ + "ADDRESS_ENABLE4", + 31, + 1 + ] + ] + }, + { + "name": "EMACADDR4LOW", + "offset": "0x64" + }, + { + "name": "EMACADDR5HIGH", + "offset": "0x68", + "fields": [ + [ + "MAC_ADDRESS5_HI", + 0, + 16 + ], + [ + "MASK_BYTE_CONTROL5", + 24, + 6 + ], + [ + "SOURCE_ADDRESS5", + 30, + 1 + ], + [ + "ADDRESS_ENABLE5", + 31, + 1 + ] + ] + }, + { + "name": "EMACADDR5LOW", + "offset": "0x6C" + }, + { + "name": "EMACADDR6HIGH", + "offset": "0x70", + "fields": [ + [ + "MAC_ADDRESS6_HI", + 0, + 16 + ], + [ + "MASK_BYTE_CONTROL6", + 24, + 6 + ], + [ + "SOURCE_ADDRESS6", + 30, + 1 + ], + [ + "ADDRESS_ENABLE6", + 31, + 1 + ] + ] + }, + { + "name": "EMACADDR6LOW", + "offset": "0x74" + }, + { + "name": "EMACADDR7HIGH", + "offset": "0x78", + "fields": [ + [ + "MAC_ADDRESS7_HI", + 0, + 16 + ], + [ + "MASK_BYTE_CONTROL7", + 24, + 6 + ], + [ + "SOURCE_ADDRESS7", + 30, + 1 + ], + [ + "ADDRESS_ENABLE7", + 31, + 1 + ] + ] + }, + { + "name": "EMACADDR7LOW", + "offset": "0x7C" + }, + { + "name": "EMACCSTATUS", + "offset": "0xD8", + "fields": [ + [ + "LINK_MODE", + 0, + 1 + ], + [ + "LINK_SPEED", + 1, + 2 + ], + [ + "JABBER_TIMEOUT", + 4, + 1 + ] + ] + }, + { + "name": "EMACWDOGTO", + "offset": "0xDC", + "fields": [ + [ + "WDOGTO", + 0, + 14 + ], + [ + "PWDOGEN", + 16, + 1 + ] + ] + } + ] + }, + { + "name": "TWAI0", + "base": "0x3FF6B000", + "interrupts": [ + "TWAI0" + ], + "registers": [ + { + "name": "MODE", + "offset": "0x00", + "reset": "0x00000001", + "fields": [ + [ + "RESET_MODE", + 0, + 1 + ], + [ + "LISTEN_ONLY_MODE", + 1, + 1 + ], + [ + "SELF_TEST_MODE", + 2, + 1 + ], + [ + "RX_FILTER_MODE", + 3, + 1 + ] + ] + }, + { + "name": "CMD", + "offset": "0x04", + "fields": [ + [ + "TX_REQ", + 0, + 1, + "w" + ], + [ + "ABORT_TX", + 1, + 1, + "w" + ], + [ + "RELEASE_BUF", + 2, + 1, + "w" + ], + [ + "CLR_OVERRUN", + 3, + 1, + "w" + ], + [ + "SELF_RX_REQ", + 4, + 1, + "w" + ] + ] + }, + { + "name": "STATUS", + "offset": "0x08", + "fields": [ + [ + "RX_BUF_ST", + 0, + 1, + "r" + ], + [ + "OVERRUN_ST", + 1, + 1, + "r" + ], + [ + "TX_BUF_ST", + 2, + 1, + "r" + ], + [ + "TX_COMPLETE", + 3, + 1, + "r" + ], + [ + "RX_ST", + 4, + 1, + "r" + ], + [ + "TX_ST", + 5, + 1, + "r" + ], + [ + "ERR_ST", + 6, + 1, + "r" + ], + [ + "BUS_OFF_ST", + 7, + 1, + "r" + ], + [ + "MISS_ST", + 8, + 1, + "r" + ] + ] + }, + { + "name": "INT_RAW", + "offset": "0x0C", + "fields": [ + [ + "RX_INT_ST", + 0, + 1, + "r" + ], + [ + "TX_INT_ST", + 1, + 1, + "r" + ], + [ + "ERR_WARN_INT_ST", + 2, + 1, + "r" + ], + [ + "OVERRUN_INT_ST", + 3, + 1, + "r" + ], + [ + "ERR_PASSIVE_INT_ST", + 5, + 1, + "r" + ], + [ + "ARB_LOST_INT_ST", + 6, + 1, + "r" + ], + [ + "BUS_ERR_INT_ST", + 7, + 1, + "r" + ] + ] + }, + { + "name": "INT_ENA", + "offset": "0x10", + "fields": [ + [ + "RX_INT_ENA", + 0, + 1 + ], + [ + "TX_INT_ENA", + 1, + 1 + ], + [ + "ERR_WARN_INT_ENA", + 2, + 1 + ], + [ + "OVERRUN_INT_ENA", + 3, + 1 + ], + [ + "ERR_PASSIVE_INT_ENA", + 5, + 1 + ], + [ + "ARB_LOST_INT_ENA", + 6, + 1 + ], + [ + "BUS_ERR_INT_ENA", + 7, + 1 + ] + ] + }, + { + "name": "BUS_TIMING_0", + "offset": "0x18", + "fields": [ + [ + "BAUD_PRESC", + 0, + 6 + ], + [ + "SYNC_JUMP_WIDTH", + 6, + 2 + ] + ] + }, + { + "name": "BUS_TIMING_1", + "offset": "0x1C", + "fields": [ + [ + "TIME_SEG1", + 0, + 4 + ], + [ + "TIME_SEG2", + 4, + 3 + ], + [ + "TIME_SAMP", + 7, + 1 + ] + ] + }, + { + "name": "ARB_LOST_CAP", + "offset": "0x2C", + "fields": [ + [ + "ARB_LOST_CAP", + 0, + 5, + "r" + ] + ] + }, + { + "name": "ERR_CODE_CAP", + "offset": "0x30", + "fields": [ + [ + "ECC_SEGMENT", + 0, + 5, + "r" + ], + [ + "ECC_DIRECTION", + 5, + 1, + "r" + ], + [ + "ECC_TYPE", + 6, + 2, + "r" + ] + ] + }, + { + "name": "ERR_WARNING_LIMIT", + "offset": "0x34", + "reset": "0x00000060", + "fields": [ + [ + "ERR_WARNING_LIMIT", + 0, + 8 + ] + ] + }, + { + "name": "RX_ERR_CNT", + "offset": "0x38", + "fields": [ + [ + "RX_ERR_CNT", + 0, + 8 + ] + ] + }, + { + "name": "TX_ERR_CNT", + "offset": "0x3C", + "fields": [ + [ + "TX_ERR_CNT", + 0, + 8 + ] + ] + }, + { + "name": "DATA_0", + "offset": "0x40", + "fields": [ + [ + "TX_BYTE_0", + 0, + 8 + ] + ] + }, + { + "name": "DATA_1", + "offset": "0x44", + "fields": [ + [ + "TX_BYTE_1", + 0, + 8 + ] + ] + }, + { + "name": "DATA_2", + "offset": "0x48", + "fields": [ + [ + "TX_BYTE_2", + 0, + 8 + ] + ] + }, + { + "name": "DATA_3", + "offset": "0x4C", + "fields": [ + [ + "TX_BYTE_3", + 0, + 8 + ] + ] + }, + { + "name": "DATA_4", + "offset": "0x50", + "fields": [ + [ + "TX_BYTE_4", + 0, + 8 + ] + ] + }, + { + "name": "DATA_5", + "offset": "0x54", + "fields": [ + [ + "TX_BYTE_5", + 0, + 8 + ] + ] + }, + { + "name": "DATA_6", + "offset": "0x58", + "fields": [ + [ + "TX_BYTE_6", + 0, + 8 + ] + ] + }, + { + "name": "DATA_7", + "offset": "0x5C", + "fields": [ + [ + "TX_BYTE_7", + 0, + 8 + ] + ] + }, + { + "name": "DATA_8", + "offset": "0x60", + "fields": [ + [ + "TX_BYTE_8", + 0, + 8 + ] + ] + }, + { + "name": "DATA_9", + "offset": "0x64", + "fields": [ + [ + "TX_BYTE_9", + 0, + 8 + ] + ] + }, + { + "name": "DATA_10", + "offset": "0x68", + "fields": [ + [ + "TX_BYTE_10", + 0, + 8 + ] + ] + }, + { + "name": "DATA_11", + "offset": "0x6C", + "fields": [ + [ + "TX_BYTE_11", + 0, + 8 + ] + ] + }, + { + "name": "DATA_12", + "offset": "0x70", + "fields": [ + [ + "TX_BYTE_12", + 0, + 8 + ] + ] + }, + { + "name": "RX_MESSAGE_CNT", + "offset": "0x74", + "fields": [ + [ + "RX_MESSAGE_COUNTER", + 0, + 7, + "r" + ] + ] + }, + { + "name": "CLOCK_DIVIDER", + "offset": "0x7C", + "fields": [ + [ + "CD", + 0, + 8 + ], + [ + "CLOCK_OFF", + 8, + 1 + ] + ] + } + ] + }, + { + "name": "MCPWM1", + "base": "0x3FF6C000", + "derived_from": "MCPWM0" + }, + { + "name": "I2S1", + "base": "0x3FF6D000", + "interrupts": [ + "I2S1" + ], + "derived_from": "I2S0" + }, + { + "name": "UART2", + "base": "0x3FF6E000", + "interrupts": [ + "UART2" + ], + "derived_from": "UART0" + } + ] +} diff --git a/catalog/mcus/espressif/esp32/rom.bin b/catalog/mcus/espressif/esp32/rom.bin new file mode 100644 index 000000000..0c4c8aa7c Binary files /dev/null and b/catalog/mcus/espressif/esp32/rom.bin differ diff --git a/catalog/mcus/espressif/esp32/wroom32e.json b/catalog/mcus/espressif/esp32/wroom32e.json new file mode 100644 index 000000000..fa40b3469 --- /dev/null +++ b/catalog/mcus/espressif/esp32/wroom32e.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "kind": "package", + "id": "espressif/esp32/wroom32e", + "name": "ESP32-WROOM-32E", + "description": "The ESP32-WROOM-32E module (ESP32-WROOM-32E & WROOM-32UE datasheet v1.7, table 3-1), 18 x 25.5 mm, 38 pads and the exposed ground pad: an ESP32-D0WD-V3 with its 40 MHz crystal, a 4 MB quad SPI flash on GPIO6-11 (which the module keeps to itself) and the antenna, so the module is the chip in another package. Pads that are GPIOs carry the GPIO's signal; the module's pad name is in each one's doc.", + "pins": [ + { + "number": 1, + "signal": "GND" + }, + { + "number": 2, + "signal": "VDD3P3", + "doc": "pin 3V3, the module's supply" + }, + { + "number": 3, + "signal": "CHIP_EN", + "doc": "pin EN: high on, low off and reset" + }, + { + "number": 4, + "signal": "GPIO36", + "doc": "pin SENSOR_VP: input only" + }, + { + "number": 5, + "signal": "GPIO39", + "doc": "pin SENSOR_VN: input only" + }, + { + "number": 6, + "signal": "GPIO34", + "doc": "pin IO34: input only" + }, + { + "number": 7, + "signal": "GPIO35", + "doc": "pin IO35: input only" + }, + { + "number": 8, + "signal": "GPIO32", + "doc": "pin IO32, XTAL_32K_P" + }, + { + "number": 9, + "signal": "GPIO33", + "doc": "pin IO33, XTAL_32K_N" + }, + { + "number": 10, + "signal": "GPIO25", + "doc": "pin IO25, DAC_1" + }, + { + "number": 11, + "signal": "GPIO26", + "doc": "pin IO26, DAC_2" + }, + { + "number": 12, + "signal": "GPIO27", + "doc": "pin IO27" + }, + { + "number": 13, + "signal": "GPIO14", + "doc": "pin IO14, MTMS" + }, + { + "number": 14, + "signal": "GPIO12", + "doc": "pin IO12, MTDI: a strapping pin (VDD_SDIO)" + }, + { + "number": 15, + "signal": "GND" + }, + { + "number": 16, + "signal": "GPIO13", + "doc": "pin IO13, MTCK" + }, + { + "number": 17, + "signal": "NC", + "doc": "not connected (the in-package flash's SD2 on other modules)" + }, + { + "number": 18, + "signal": "NC" + }, + { + "number": 19, + "signal": "NC" + }, + { + "number": 20, + "signal": "NC" + }, + { + "number": 21, + "signal": "NC" + }, + { + "number": 22, + "signal": "NC" + }, + { + "number": 23, + "signal": "GPIO15", + "doc": "pin IO15, MTDO: a strapping pin (the ROM's messages)" + }, + { + "number": 24, + "signal": "GPIO2", + "doc": "pin IO2: a strapping pin" + }, + { + "number": 25, + "signal": "GPIO0", + "doc": "pin IO0: a strapping pin (boot mode)" + }, + { + "number": 26, + "signal": "GPIO4", + "doc": "pin IO4" + }, + { + "number": 27, + "signal": "GPIO16", + "doc": "pin IO16" + }, + { + "number": 28, + "signal": "GPIO17", + "doc": "pin IO17" + }, + { + "number": 29, + "signal": "GPIO5", + "doc": "pin IO5: a strapping pin (SDIO timing)" + }, + { + "number": 30, + "signal": "GPIO18", + "doc": "pin IO18" + }, + { + "number": 31, + "signal": "GPIO19", + "doc": "pin IO19" + }, + { + "number": 32, + "signal": "NC" + }, + { + "number": 33, + "signal": "GPIO21", + "doc": "pin IO21" + }, + { + "number": 34, + "signal": "GPIO3", + "doc": "pin RXD0, U0RXD" + }, + { + "number": 35, + "signal": "GPIO1", + "doc": "pin TXD0, U0TXD" + }, + { + "number": 36, + "signal": "GPIO22", + "doc": "pin IO22" + }, + { + "number": 37, + "signal": "GPIO23", + "doc": "pin IO23" + }, + { + "number": 38, + "signal": "GND" + }, + { + "number": 39, + "signal": "GND", + "doc": "the exposed pad" + } + ], + "provenance": { + "author": "EmbSIM", + "license": "Apache-2.0", + "sources": [ + { + "title": "ESP32-WROOM-32E & ESP32-WROOM-32UE datasheet (Espressif)", + "rev": "v1.7" + } + ] + } +} \ No newline at end of file diff --git a/catalog/toolchains/gcc-xtensa.json b/catalog/toolchains/gcc-xtensa.json new file mode 100644 index 000000000..ad69dd7f4 --- /dev/null +++ b/catalog/toolchains/gcc-xtensa.json @@ -0,0 +1,69 @@ +{ + "schema_version": 1, + "kind": "toolchain", + "id": "gcc-xtensa", + "name": "Espressif's GNU Xtensa toolchain (xtensa-esp32-elf-gcc)", + "description": "Espressif's crosstool-NG GCC for the ESP32's Xtensa LX6 cores, the one ESP-IDF installs (idf_tools.py, ~/.espressif/tools/xtensa-esp-elf): xtensa-esp32-elf-gcc is the ESP32's configuration (core-isa.h's), with newlib. ESP-IDF's own build (idf.py) makes the flash images the vendor scenarios run; this profile compiles a project's sources into an ELF.", + "detect": { + "command": [ + "xtensa-esp32-elf-gcc", + "--version" + ], + "version_regex": "\\) ([0-9.]+)", + "min_version": "12.2", + "prefix": "xtensa-esp32-elf-" + }, + "targets": { + "esp32": { + "cc": [ + "xtensa-esp32-elf-gcc", + "-mlongcalls" + ], + "link_flags": [ + "-nostartfiles", + "-Wl,--gc-sections", + "--specs=nosys.specs" + ] + } + }, + "steps": { + "compile": [ + "${cc}", + "${cflags}", + "${defines}", + "${include}", + "-g", + "-O2", + "-ffunction-sections", + "-fdata-sections", + "-Wall", + "-c", + "${source}", + "-o", + "${object}" + ], + "link": [ + "${cc}", + "${cflags}", + "${link_flags}", + "-T${linker_script}", + "-Wl,-Map=${map}", + "${objects}", + "-o", + "${image}" + ], + "convert": null + }, + "outputs": { + "image": "elf", + "debug": "dwarf", + "map": true + }, + "environment": { + "PATH_hint": [ + "~/.espressif/tools/xtensa-esp-elf/*/xtensa-esp-elf/bin", + "C:/Espressif/tools/xtensa-esp-elf/*/xtensa-esp-elf/bin", + "/opt/esp/tools/xtensa-esp-elf/*/xtensa-esp-elf/bin" + ] + } +} diff --git a/core/mcu/build.c b/core/mcu/build.c index da2817089..3ce591f50 100644 --- a/core/mcu/build.c +++ b/core/mcu/build.c @@ -12,6 +12,7 @@ #include "mcu/build.h" #include "mcu/mips/mips.h" #include "mcu/pic24/pic24.h" +#include "mcu/xtensa/lx6.h" #include "mcu/rf.h" #include "util/num.h" #include "util/str.h" @@ -202,6 +203,9 @@ es_status esk_mach_build(struct esk_mach *m, const esk_json *mcu, const esk_json st = esk_riscv_create(m, esk_json_get_str(core, "model", ""), reset_pc, &cpu); if (st == ES_OK && esk_json_get(core, "pmp_entries")) esk_riscv_pmp_entries(cpu, (int)esk_json_get_int(core, "pmp_entries", 16)); + } else if (esk_str_eq(esk_json_get_str(core, "backend", ""), "xtensa")) { + st = esk_lx6_create(m, esk_json_get_str(core, "model", ""), + (int)esk_json_get_int(core, "cores", 1), &cpu); } else if (esk_str_eq(esk_json_get_str(core, "backend", ""), "mips")) { st = esk_mips_create(m, esk_json_get_str(core, "model", ""), &cpu); } else if (esk_str_eq(esk_json_get_str(core, "backend", ""), "pic24")) { diff --git a/core/mcu/esp32/soc/adc.c b/core/mcu/esp32/soc/adc.c new file mode 100644 index 000000000..2400152b0 --- /dev/null +++ b/core/mcu/esp32/soc/adc.c @@ -0,0 +1,204 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* adc.c -- the ESP32's SAR ADCs as the RTC controller drives them (SENS, + * TRM v5 chapter 29): one conversion at a time on SAR ADC1 or ADC2, as + * ESP-IDF's adc_oneshot and Arduino's analogRead use them. + * + * - ADC1 reads GPIO36, 37, 38, 39, 32, 33, 34, 35 (channels 0-7), ADC2 + * GPIO4, 0, 2, 15, 13, 12, 14, 27, 25, 26 (channels 0-9). + * - MEAS1_START_SAR (SAR_MEAS_START1) rising starts a conversion of the + * channel SAR1_EN_PAD selects (its lowest bit set), at SAR_ATTEN1's + * attenuation for it (two bits a channel: 0, 2.5, 6, 11 dB); MEAS1_DONE_SAR + * reads 0 until (SAR1_SAMPLE_CYCLE + bits + 1) SAR clocks have passed + * (RTC_FAST_CLK's 8 MHz divided by SAR1_CLK_DIV), then 1, with the code + * in MEAS1_DATA_SAR; a new start clears it. ADC2 the same with + * SAR_MEAS_START2, SAR_ATTEN2 and SAR_READ_CTRL2. + * - The code is SAR1_SAMPLE_BIT's 9 to 12 bits wide (the 12-bit code + * shifted down). The converter's own output is inverted; SAR1_DATA_INV + * (SAR2_DATA_INV) set, as ESP-IDF sets it, gives the code itself. + * - The transfer: the line ESP-IDF's Vref calibration fits for the chip + * (esp_adc's adc_cali_line_fitting.c, from Espressif's + * characterisation of the ESP32): V = a code / 65536 + b mV, with a = + * Vref x scale / 4096, scale and b per unit and attenuation (ADC1: + * 57431, 76236, 105481, 196602 and 75, 78, 107, 142 mV; ADC2: 57236, + * 76175, 105678, 197170 and 63, 66, 89, 128 mV), Vref the chip's eFuse + * ADC_VREF (1100 mV + 7 mV a step); a voltage below b reads 0, one past + * the range 4095. ESP-IDF's calibrated voltage is so the pin's within + * its rounding. + * Where it differs inside: the RTC IO MUX's routing of a pad to the ADC + * (RTC_IO's ADC pad and FUN_SEL bits) is not checked: the pad's voltage + * is read whatever its function. Not yet: the nonlinearity above about + * 2450 mV at 11 dB (ESP-IDF's LUT region) and a chip's spread from the + * fitted line, noise, the ULP's and the digital controller's (DMA, + * I2S) conversions, the Hall sensor, ADC2's arbitration with Wi-Fi, the + * amplifier (SAR_MEAS_WAIT, the AMP FSM). */ +#include + +#include "mcu/esp32/soc/esp32.h" + +#define READ_CTRL 0x00u +#define ATTEN1 0x34u +#define ATTEN2 0x38u +#define MEAS_START1 0x54u +#define READ_CTRL2 0x90u +#define MEAS_START2 0x94u +#define START_SAR (1u << 17) +#define DONE_SAR (1u << 16) +#define RTC_FAST_HZ 8000000.0 + +struct e32_adc { + struct esk_mach *s; + struct esk_rf_periph *p; + int busy[2]; + u64 due[2]; /* the conversion's end, in core cycles */ + u32 code[2]; + int clocked; +}; + +static const int pads[2][10] = { + { 36, 37, 38, 39, 32, 33, 34, 35, -1, -1 }, + { 4, 0, 2, 15, 13, 12, 14, 27, 25, 26 }, +}; +static const double scale[2][4] = { { 57431, 76236, 105481, 196602 }, { 57236, 76175, 105678, 197170 } }; +static const double offset_mv[2][4] = { { 75, 78, 107, 142 }, { 63, 66, 89, 128 } }; + +static u32 rd(const struct e32_adc *k, u32 off) { return esk_rf_read(k->p, off, 4); } + +static void hw(struct e32_adc *k, u32 off, u32 v) +{ + struct esk_rf_reg *r = esk_rf_reg_at(k->p, off); + if (r) + esk_rf_hw(r, v); +} + +/* the chip's ADC Vref in mV, from the eFuse (BLOCK0 word 4's ADC_VREF: + * sign and magnitude, 7 mV a step) */ +static double vref_mv(struct esk_mach *m) +{ + u32 bits = (esk_esp32_efuse_word(m, 0, 4) >> 8) & 0x1fu; + int steps = (int)(bits & 0xfu); + return 1100.0 + (double)((bits & 0x10u) ? -steps : steps) * 7.0; +} + +static u32 convert(struct e32_adc *k, int unit) +{ + struct esk_mach *s = k->s; + u32 start = rd(k, unit ? MEAS_START2 : MEAS_START1), ctrl = rd(k, unit ? READ_CTRL2 : READ_CTRL); + u32 pads_on = (start >> 19) & 0xfffu, bits = 9u + ((ctrl >> 16) & 3u), atten; + int ch, gpio; + double v = 0, a, d; + u32 code; + for (ch = 0; ch < 10 && !(pads_on & (1u << ch)); ch++) + ; + gpio = ch < 10 ? pads[unit][ch] : -1; + atten = ch < 10 ? (rd(k, unit ? ATTEN2 : ATTEN1) >> (2 * ch)) & 3u : 3u; + if (gpio >= 0 && s->host.pin_volts && !s->host.pin_volts(s->host.ctx, gpio / 16, gpio % 16, &v)) + v = 0; + a = vref_mv(s) * scale[unit][atten] / 4096.0; + d = (v * 1000.0 - offset_mv[unit][atten]) * 65536.0 / a + 0.5; + code = d <= 0 ? 0u : d >= 4095.0 ? 4095u : (u32)d; + code >>= 12u - bits; + if (!(ctrl & (1u << (unit ? 29 : 28)))) /* the converter's own, inverted */ + code = ((1u << bits) - 1u) - code; + return code; +} + +static void clocking(struct e32_adc *k) +{ + esk_rf_clock(k->p, &k->clocked, k->busy[0] || k->busy[1]); +} + +static void finish(struct e32_adc *k, int unit) +{ + u32 off = unit ? MEAS_START2 : MEAS_START1; + k->busy[unit] = 0; + hw(k, off, (rd(k, off) & ~0xffffu) | DONE_SAR | (k->code[unit] & 0xffffu)); +} + +static void start(struct e32_adc *k, int unit) +{ + u32 off = unit ? MEAS_START2 : MEAS_START1, ctrl = rd(k, unit ? READ_CTRL2 : READ_CTRL); + u32 div = ctrl & 0xffu, cycles = ((ctrl >> 8) & 0xffu) + 9u + ((ctrl >> 16) & 3u) + 1u; + double t = (double)cycles * (double)(div ? div : 1u) / RTC_FAST_HZ; + hw(k, off, rd(k, off) & ~DONE_SAR); + k->code[unit] = convert(k, unit); + k->busy[unit] = 1; + k->due[unit] = k->s->cycles + (u64)(t * (double)esk_mach_core_hz(k->s) + 0.5) + 1u; +} + +static void adc_tick(void *ctx, u32 cycles) +{ + struct e32_adc *k = (struct e32_adc *)ctx; + int u; + (void)cycles; + for (u = 0; u < 2; u++) + if (k->busy[u] && k->s->cycles >= k->due[u]) + finish(k, u); + clocking(k); +} + +static int adc_next(void *ctx, u32 *cycles) +{ + struct e32_adc *k = (struct e32_adc *)ctx; + u64 best = 0; + int u, any = 0; + for (u = 0; u < 2; u++) { + u64 d; + if (!k->busy[u]) + continue; + d = k->due[u] > k->s->cycles ? k->due[u] - k->s->cycles : 1u; + if (!any || d < best) + best = d; + any = 1; + } + if (!any) + return 0; + *cycles = best > 0xffffffffu ? 0xffffffffu : (u32)best; + return 1; +} + +static u32 adc_read(void *ctx, u32 off, int n) +{ + struct e32_adc *k = (struct e32_adc *)ctx; + return esk_rf_read(k->p, off, n); +} + +static void adc_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_adc *k = (struct e32_adc *)ctx; + u32 w = off & ~3u; + int unit = w == MEAS_START2 ? 1 : 0; + u32 was = (w == MEAS_START1 || w == MEAS_START2) ? rd(k, w) : 0; + esk_rf_write(k->p, off, n, v); + if (w == MEAS_START1 || w == MEAS_START2) { + u32 now = rd(k, w); + /* DATA and DONE are the converter's: what was written there is not kept */ + hw(k, w, (now & ~(0xffffu | DONE_SAR)) | (was & (0xffffu | DONE_SAR))); + if ((now & START_SAR) && !(was & START_SAR)) + start(k, unit); + } + clocking(k); +} + +static void adc_reset(void *ctx) +{ + struct e32_adc *k = (struct e32_adc *)ctx; + k->busy[0] = k->busy[1] = 0; + k->clocked = 0; + clocking(k); +} + +const struct esk_dev_ops esk_esp32_adc_ops = { + "esp32-sens", adc_read, adc_write, adc_reset, adc_tick, adc_next, +}; + +void *esk_esp32_adc_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_adc *k = (struct e32_adc *)esk_mach_alloc(s, sizeof *k); + if (!k) + return 0; + memset(k, 0, sizeof *k); + k->s = s; + k->p = p; + return k; +} diff --git a/core/mcu/esp32/soc/apbctrl.c b/core/mcu/esp32/soc/apbctrl.c new file mode 100644 index 000000000..b3506aa6c --- /dev/null +++ b/core/mcu/esp32/soc/apbctrl.c @@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* apbctrl.c -- the ESP32's APB_CTRL (TRM v5 chapter 3.2) and the clock + * tree it, RTC_CNTL and DPORT set together: + * + * - CPU_CLK: RTC_CNTL CLK_CONF's SOC_CLK_SEL picks XTL_CLK (40 MHz), + * PLL_CLK, RC_FAST_CLK (8 MHz) or APLL_CLK; from XTL_CLK and + * RC_FAST_CLK the CPU runs at the source divided by SYSCLK_CONF's + * PRE_DIV_CNT + 1, from PLL_CLK at 80, 160 or 240 MHz as DPORT + * CPU_PER_CONF's CPUPERIOD_SEL says (TRM table 3.2-3); + * - APB_CLK: 80 MHz from the PLL, else CPU_CLK; + * - DATE: bit 31 set, as on chip revision v3 (ESP-IDF reads it with the + * eFuse's CHIP_VER_REV1 and REV2 for the major revision). + * Not yet: APLL_CLK (taken as the PLL's 80 MHz setting), the REF_TICK + * dividers (XTAL_TICK_CONF and the others keep what is written), the + * SAR ADC controller's registers. */ +#include "mcu/esp32/soc/esp32.h" + +#define SYSCLK_CONF 0x00u +#define DATE 0x7Cu +#define RC_FAST_HZ 8000000u + + +struct e32_apbctrl { + struct esk_mach *s; + struct esk_rf_periph *p; + u32 hz; +}; + +static u32 cpu_hz(struct e32_apbctrl *k) +{ + u32 sel = esk_esp32_rtc_soc_clk_sel(k->s), div = (esk_rf_read(k->p, SYSCLK_CONF, 4) & 0x3ffu) + 1u; + if (sel == 1 || sel == 3) { + u32 per = esk_esp32_dport_cpuperiod(k->s); + return per == 2 ? 240000000u : per == 1 ? 160000000u : 80000000u; + } + return (sel == 2 ? RC_FAST_HZ : ESP32_XTAL_HZ) / div; +} + +static u32 core_hz(struct esk_mach *m) +{ + struct e32_apbctrl *k = (struct e32_apbctrl *)m->clock_ctx; + if (!k) + return ESP32_XTAL_HZ; + k->hz = cpu_hz(k); + return k->hz; +} + +u32 esk_esp32_cpu_hz(struct esk_mach *m) +{ + return core_hz(m); +} + +u32 esk_esp32_apb_hz(struct esk_mach *m) +{ + u32 sel = esk_esp32_rtc_soc_clk_sel(m); + return sel == 1 || sel == 3 ? 80000000u : core_hz(m); +} + +static u32 ap_read(void *ctx, u32 off, int n) +{ + struct e32_apbctrl *k = (struct e32_apbctrl *)ctx; + return esk_rf_read(k->p, off, n); +} + +static void ap_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_apbctrl *k = (struct e32_apbctrl *)ctx; + esk_rf_write(k->p, off, n, v); + if (off == SYSCLK_CONF) + k->s->yield = 1; /* the runtime sees the core's new clock now */ +} + +static void ap_reset(void *ctx) +{ + struct e32_apbctrl *k = (struct e32_apbctrl *)ctx; + k->hz = ESP32_XTAL_HZ; +} + +const struct esk_dev_ops esk_esp32_apbctrl_ops = { + "esp32-apbctrl", ap_read, ap_write, ap_reset, 0, 0, +}; + +void *esk_esp32_apbctrl_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_apbctrl *k = (struct e32_apbctrl *)esk_mach_alloc(s, sizeof *k); + struct esk_rf_reg *date = esk_rf_reg_at(p, DATE); + if (!k) + return 0; + k->s = s; + k->p = p; + k->hz = ESP32_XTAL_HZ; + if (date) + esk_rf_set_reset(date, date->reset | 0x80000000u); + s->core_hz = core_hz; + s->clock_ctx = k; + return k; +} diff --git a/core/mcu/esp32/soc/dport.c b/core/mcu/esp32/soc/dport.c new file mode 100644 index 000000000..1091cfbd1 --- /dev/null +++ b/core/mcu/esp32/soc/dport.c @@ -0,0 +1,369 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* dport.c -- the ESP32's DPORT registers (TRM v5 chapters 3, 4 and 5): + * + * - the APP_CPU: held in reset while APPCPU_CTRL_A's RESETTING is set + * (1 out of reset), its clock gated while APPCPU_CTRL_B's CLKGATE_EN + * is clear, stalled while APPCPU_CTRL_C's RUNSTALL is set; released, + * it starts at its reset vector, where the ROM reads APPCPU_CTRL_D's + * boot address; + * - the interrupt matrix (chapter 4): 69 peripheral sources, each mapped + * by its PRO_ and APP_ *_MAP register onto one of each CPU's 32 + * interrupts; an interrupt sees the OR of the sources mapped onto it, + * those numbers the CPU drives itself (its timers 6, 15 and 16, its + * software interrupts 7 and 29, profiling 11) none; PRO_ and + * APP_INTR_STATUS_0-2 read the sources' levels; CPU_INTR_FROM_CPU_0-3 + * drive sources 24-27; + * - the caches and their flash MMU (chapter 3.3.2): each CPU's table of + * 64 KB pages at 0x3FF10000 (PRO_CPU) and 0x3FF12000 (APP_CPU), an + * entry's bits [7:0] the flash page and bit 8 invalid; entries 0-63 + * map DROM0 (0x3F400000), 64-127 IRAM0 (0x40000000, of which + * 0x400D0000 up is the description's flash_irom window); the window + * reads the flash's bytes the PRO_CPU's entries name. A cache flush + * (PRO_ or APP_CACHE_CTRL's FLUSH_ENA) is done at once (FLUSH_DONE), + * and the caches' state (PRO_ and APP_DCACHE_DBUG0's CACHE_STATE) + * reads 1, idle, which ESP-IDF waits for before disabling them; + * pages whose flash the program has written since they were mapped + * show it after a flush; + * - CPU_PER_CONF's CPUPERIOD_SEL, which with RTC_CNTL's SOC_CLK_SEL and + * APB_CTRL's divider sets the CPU's clock (apbctrl.c); + * - PERIP_RST_EN: setting the bit of I2C0 (7), LEDC (11) or I2C1 (18) + * returns that peripheral to its reset state. + * Inside, the caches hold the mapped pages whole rather than 32 KB of + * lines, and both CPUs read through the PRO_CPU's table (ESP-IDF keeps + * the two the same); a CPU's cache enable and the buses' mask bits + * (PRO_CACHE_CTRL1) do not stop accesses. + * Not yet: the cache's lock regions, PSRAM (DRAM1, which the module does + * not have), the boot remap (PRO_BOOT_REMAP_CTRL), the APB and AHB + * access permissions (DPORT_APB_MASK, AHBLITE_MPU_TABLE), the MMU's + * access-error interrupts, the trace memory and the CPU record, the other + * peripherals' PERIP_RST_EN bits and every PERIP_CLK_EN gate (a gated + * peripheral still answers). */ +#include + +#include "mcu/esp32/soc/esp32.h" +#include "mcu/xtensa/lx6.h" + + +#define APPCPU_CTRL_A 0x2Cu +#define APPCPU_CTRL_B 0x30u +#define APPCPU_CTRL_C 0x34u +#define CPU_PER_CONF 0x3Cu +#define PRO_CACHE_CTRL 0x40u +#define APP_CACHE_CTRL 0x58u +#define FROM_CPU_0 0xDCu +#define PRO_STATUS_0 0xECu +#define APP_STATUS_0 0xF8u +#define PRO_MAP 0x104u +#define APP_MAP 0x218u +#define PRO_DCACHE_DBUG0 0x3F0u +#define APP_DCACHE_DBUG0 0x418u +#define CACHE_FLUSH_ENA 0x10u +#define CACHE_FLUSH_DONE 0x20u +#define PERIP_RST_EN 0xC4u + +/* PERIP_RST_EN's bits of the modelled peripherals */ +static const struct { + const char *name; + int bit; +} resets[] = { { "I2C0", 7 }, { "LEDC", 11 }, { "I2C1", 18 } }; +#define NRESETS (sizeof resets / sizeof resets[0]) + +#define MMU_BASE 0x3FF10000u +#define MMU_WORDS 2048 /* per CPU: 0x2000 bytes */ +#define MMU_INVALID 0x100u +#define PAGE 0x10000u +#define DROM 0x3F400000u +#define IROM 0x400D0000u +#define IROM_FIRST 77 /* 0x400D0000's entry */ +#define INTERNAL_INTS 0x20018840u /* 6, 7, 11, 15, 16, 29: the CPU's own */ + +struct e32_dport { + struct esk_mach *s; + struct esk_rf_periph *p; + u8 src[ESP32_NSOURCES]; + u32 lines[2]; /* each CPU's interrupt inputs as the matrix drives them */ + u32 mmu[2][MMU_WORDS]; + u8 stale[128]; + u8 *app_rom; /* the ROM as the APP_CPU sees it */ + struct esk_rf_periph *rst[3]; /* resets[]'s peripherals */ +}; + +static struct e32_dport *dport_of(struct esk_mach *m) +{ + return m->rf ? (struct e32_dport *)esk_rf_ctx_of(m->rf, &esk_esp32_dport_ops) : 0; +} + +static u32 reg(struct e32_dport *k, u32 off) +{ + return esk_rf_read(k->p, off, 4); +} + +static void hw(struct e32_dport *k, u32 off, u32 v) +{ + struct esk_rf_reg *r = esk_rf_reg_at(k->p, off); + if (r) + esk_rf_hw(r, v); +} + +/* ---- the interrupt matrix ---------------------------------------------- */ + +static void route(struct e32_dport *k) +{ + int cpu, i, n = esk_lx6_cores(k->s); + for (cpu = 0; cpu < 2; cpu++) { + u32 lines = 0, st[3] = { 0, 0, 0 }; + for (i = 0; i < ESP32_NSOURCES; i++) { + u32 map = reg(k, (cpu ? APP_MAP : PRO_MAP) + 4u * (u32)i) & 31u; + if (!(k->src[i] & (1u << cpu))) + continue; + st[i / 32] |= 1u << (i % 32); + if (!(INTERNAL_INTS & (1u << map))) + lines |= 1u << map; + } + for (i = 0; i < 3; i++) + hw(k, (cpu ? APP_STATUS_0 : PRO_STATUS_0) + 4u * (u32)i, st[i]); + if (cpu < n && lines != k->lines[cpu]) { + u32 ch = lines ^ k->lines[cpu]; + k->lines[cpu] = lines; + for (i = 0; i < 32; i++) + if (ch & (1u << i)) + esk_lx6_irq(k->s, cpu, i, (int)((lines >> i) & 1u)); + } + } +} + +void esk_esp32_source(struct esk_mach *m, int src, int level) +{ + struct e32_dport *k = dport_of(m); + u8 v = level ? 3u : 0u; + if (!k || src < 0 || src >= ESP32_NSOURCES || k->src[src] == v) + return; + k->src[src] = v; + route(k); +} + +void esk_esp32_source_cpu(struct esk_mach *m, int cpu, int src, int level) +{ + struct e32_dport *k = dport_of(m); + u8 v; + if (!k || src < 0 || src >= ESP32_NSOURCES || cpu < 0 || cpu > 1) + return; + v = (u8)(level ? k->src[src] | (1u << cpu) : k->src[src] & ~(1u << cpu)); + if (v == k->src[src]) + return; + k->src[src] = v; + route(k); +} + +/* ---- the flash MMU and the windows ------------------------------------- */ + +static void fill(struct e32_dport *k, int entry) +{ + struct esk_store *st = esk_mach_store(k->s, "flash"); + u32 base = entry < 64 ? DROM + (u32)entry * PAGE : IROM + (u32)(entry - IROM_FIRST) * PAGE; + struct esk_region *w; + u32 e = k->mmu[0][entry]; + u8 *dst; + if (entry >= 64 && entry < IROM_FIRST) + return; + w = esk_bus_region(&k->s->bus, base, PAGE); + if (!w || w->kind != ESK_MEM_WINDOW) + return; + dst = w->mem + (base - w->base); + if ((e & MMU_INVALID) || !st || st->size < PAGE) + memset(dst, 0, PAGE); + else + memcpy(dst, st->mem + ((e & 0xffu) * PAGE) % st->size, PAGE); + if (entry < 128) + k->stale[entry] = 0; + esk_bus_code_changed(&k->s->bus); +} + +void esk_esp32_flash_written(struct esk_mach *m, u32 addr, u32 len) +{ + struct e32_dport *k = dport_of(m); + int i; + if (!k || !len) + return; + for (i = 0; i < 128; i++) { + u32 at = (k->mmu[0][i] & 0xffu) * PAGE; + if (!(k->mmu[0][i] & MMU_INVALID) && addr < at + PAGE && at < addr + len) + k->stale[i] = 1; + } +} + +static void flush(struct e32_dport *k) +{ + int i; + for (i = 0; i < 128; i++) + if (k->stale[i]) + fill(k, i); +} + +static u32 mmu_read(void *ctx, u32 off, int n) +{ + struct e32_dport *k = (struct e32_dport *)ctx; + u32 cpu = off >= 0x2000u, i = (off & 0x1fffu) / 4u; + ES_UNUSED(n); + return k->mmu[cpu][i] >> (8 * (off & 3u)); +} + +static void mmu_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_dport *k = (struct e32_dport *)ctx; + u32 cpu = off >= 0x2000u, i = (off & 0x1fffu) / 4u; + if (n != 4) + return; + v &= 0x1ffu; + if (k->mmu[cpu][i] == v) + return; + k->mmu[cpu][i] = v; + if (cpu == 0 && i < 128) + fill(k, (int)i); +} + +static void mmu_reset(void *ctx) +{ + struct e32_dport *k = (struct e32_dport *)ctx; + int i, c; + for (c = 0; c < 2; c++) + for (i = 0; i < MMU_WORDS; i++) + k->mmu[c][i] = MMU_INVALID; + for (i = 0; i < 128; i++) + fill(k, i); +} + +static const struct esk_dev_ops mmu_ops = { + "esp32-mmu", mmu_read, mmu_write, mmu_reset, 0, 0, +}; + +/* ---- the APP_CPU ------------------------------------------------------- */ + +static void app_cpu(struct e32_dport *k) +{ + esk_lx6_core_stall(k->s, 1, 0, !(reg(k, APPCPU_CTRL_B) & 1u)); + esk_lx6_core_stall(k->s, 1, 1, (int)(reg(k, APPCPU_CTRL_C) & 1u)); + esk_lx6_core_reset(k->s, 1, (int)(reg(k, APPCPU_CTRL_A) & 1u)); +} + +/* ---- the APP_CPU's ROM -------------------------------------------------- */ + +/* The APP_CPU's ROM: the PRO_CPU's with every word that points into the + * PRO_CPU's ROM data (0x3FFE0010-0x3FFE3F20: its .data, .bss and stack) + * pointing into the APP_CPU's (0x3FFE3F20 on: +0x3F10), so that the ROM's + * routines keep each CPU's state apart (ESP-IDF's esp32.rom.ld names + * g_ticks_per_us_pro and _app, and ets_update_cpu_frequency_rom "updates + * g_ticks_per_us on the current CPU only"). Espressif's QEMU loads this + * view as a second image (esp32-v3-rom-app.bin, sha256 6d3240e7...8442): + * the one made here equals it byte for byte over its 455,722 bytes. */ +#define ROM_BASE 0x40000000u +#define ROM_SIZE 0x70000u +#define ROM1_DBUS 0x3FF90000u +#define PRO_DATA_LO 0x3FFE0010u +#define PRO_DATA_HI 0x3FFE3F20u +#define APP_DATA_SHIFT 0x3F10u + +static void app_rom(struct e32_dport *k) +{ + struct esk_region *r = esk_bus_region(&k->s->bus, ROM_BASE, ROM_SIZE); + u32 o; + if (k->app_rom || !r || esk_lx6_cores(k->s) < 2) + return; + k->app_rom = (u8 *)esk_mach_alloc(k->s, ROM_SIZE); + if (!k->app_rom) + return; + memcpy(k->app_rom, r->mem + (ROM_BASE - r->base), ROM_SIZE); + for (o = 0; o < ROM_SIZE; o += 4) { + u8 *p = k->app_rom + o; + u32 v = (u32)p[0] | (u32)p[1] << 8 | (u32)p[2] << 16 | (u32)p[3] << 24; + if (v >= PRO_DATA_LO && v <= PRO_DATA_HI) { + v += APP_DATA_SHIFT; + p[0] = (u8)v; + p[1] = (u8)(v >> 8); + p[2] = (u8)(v >> 16); + p[3] = (u8)(v >> 24); + } + } + (void)esk_lx6_view(k->s, 1, ROM_BASE, ROM_SIZE, k->app_rom); + (void)esk_lx6_view(k->s, 1, ROM1_DBUS, 0x10000u, k->app_rom + 0x60000u); +} + +/* ---- the registers ----------------------------------------------------- */ + +static u32 dp_read(void *ctx, u32 off, int n) +{ + struct e32_dport *k = (struct e32_dport *)ctx; + return esk_rf_read(k->p, off, n); +} + +static void dp_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_dport *k = (struct e32_dport *)ctx; + u32 was = reg(k, PERIP_RST_EN); + size_t i; + esk_rf_write(k->p, off, n, v); + if (off == PERIP_RST_EN) { + u32 now = reg(k, PERIP_RST_EN); + for (i = 0; i < NRESETS; i++) + if (k->rst[i] && (now & ~was & (1u << resets[i].bit))) + esk_rf_periph_reset(k->rst[i]); + } else if (off >= APPCPU_CTRL_A && off <= APPCPU_CTRL_C) { + app_cpu(k); + } else if (off == PRO_CACHE_CTRL || off == APP_CACHE_CTRL) { + u32 c = reg(k, off); + if (c & CACHE_FLUSH_ENA) { + flush(k); + c |= CACHE_FLUSH_DONE; + } else { + c &= ~CACHE_FLUSH_DONE; + } + hw(k, off, c); + } else if (off >= FROM_CPU_0 && off < FROM_CPU_0 + 16u) { + esk_esp32_source(k->s, 24 + (int)((off - FROM_CPU_0) / 4u), (int)(reg(k, off) & 1u)); + } else if (off >= PRO_MAP && off < APP_MAP + 4u * ESP32_NSOURCES) { + route(k); + } else if (off == CPU_PER_CONF) { + k->s->yield = 1; /* the CPU's clock may change (apbctrl.c) */ + } +} + +static void dp_reset(void *ctx) +{ + struct e32_dport *k = (struct e32_dport *)ctx; + app_rom(k); + memset(k->src, 0, sizeof k->src); + k->lines[0] = k->lines[1] = 0; + hw(k, PRO_CACHE_CTRL, reg(k, PRO_CACHE_CTRL) | CACHE_FLUSH_DONE); + hw(k, APP_CACHE_CTRL, reg(k, APP_CACHE_CTRL) | CACHE_FLUSH_DONE); + hw(k, PRO_DCACHE_DBUG0, 1u << 7); /* CACHE_STATE: idle */ + hw(k, APP_DCACHE_DBUG0, 1u << 7); + route(k); +} + +const struct esk_dev_ops esk_esp32_dport_ops = { + "esp32-dport", dp_read, dp_write, dp_reset, 0, 0, +}; + +void *esk_esp32_dport_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_dport *k = (struct e32_dport *)esk_mach_alloc(s, sizeof *k); + size_t i; + if (!k) + return 0; + k->s = s; + k->p = p; + for (i = 0; i < NRESETS; i++) + k->rst[i] = esk_rf_periph(s->rf, resets[i].name); + if (esk_mach_add_dev(s, MMU_BASE, 2u * MMU_WORDS * 4u, &mmu_ops, k) != ES_OK || + esk_esp32_misc_add(s) || esk_esp32_regi2c_add(s)) + return 0; + mmu_reset(k); + return k; +} + +u32 esk_esp32_dport_cpuperiod(struct esk_mach *m) +{ + struct e32_dport *k = dport_of(m); + return k ? reg(k, CPU_PER_CONF) & 3u : 0; +} diff --git a/core/mcu/esp32/soc/efuse.c b/core/mcu/esp32/soc/efuse.c new file mode 100644 index 000000000..050574ec0 --- /dev/null +++ b/core/mcu/esp32/soc/efuse.c @@ -0,0 +1,261 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* efuse.c -- the ESP32's eFuse controller (TRM v5 chapter 20): four blocks + * of one-time-programmable bits (BLOCK0's seven words, BLOCK1-3's eight), + * read into the RDATA registers at a chip reset and again by a read + * command, programmed (bits only from 0 to 1) from the WDATA registers by + * a program command. + * + * - CMD's READ_CMD (bit 0) with CONF's OP_CODE 0x5AA5 loads every block + * into its RDATA registers; PGM_CMD (bit 1) with 0x5A5A ORs every + * block's WDATA into its bits. CMD reads the command until it is done + * (the ROM checks that it does: a CMD that reads 0 at once is a + * glitch, and it resets the chip), then 0, and INT_RAW's READ_DONE or + * PGM_DONE is set; another op code does nothing. The WDATA registers + * keep what is written until written again. + * - Read protection: BLOCK0's RD_DIS bits (16-19) make BLOCK1, BLOCK2 or + * BLOCK3 read 0 (the flash encryption key in BLOCK1 is still used by + * the hardware). Write protection: a block whose WR_DIS bit (7, 8, 9 + * for BLOCK1-3) is set is not programmed; BLOCK0's own fields are + * programmed whatever their WR_DIS bits say (not yet: per field). + * + * The chip's bits out of the factory, those of an ESP32-D0WD-V3 of chip + * revision v3.1 as esptool reads the owner's board: CHIP_PACKAGE 1 + * (D0WD), CHIP_VER_REV1 and CHIP_VER_REV2 set (with APB_CTRL's DATE bit + * 31, the major revision 3), WAFER_VERSION_MINOR 1; Coding Scheme None; + * an ADC reference voltage calibration (ADC_VREF, "Vref calibration in + * eFuse"); the MAC 24:0A:C4:45:6D:62, Espressif's OUI and a serial of the + * model's, with its CRC-8 (the ROM's esp_rom_efuse_mac_address_crc8), or + * the one a board's settings give its chip (settings.mac); every other + * bit 0 (no secure boot, no flash encryption, no keys). + * Inside, a read takes 1 us and a program 1 ms, whatever EFUSE_CLK's + * timing fields say (estimates: the TRM gives the timing parameters, not + * the operations' durations). + * Not yet: the 3/4 coding scheme's check, BLOCK0's per-field write + * protection. */ +#include + +#include "mcu/esp32/soc/esp32.h" + +#define OP_READ 0x5AA5u +#define OP_PGM 0x5A5Au +#define CONF 0xFCu +#define CMD 0x104u +#define INT_RAW 0x108u +#define INT_ST 0x10Cu +#define INT_ENA 0x110u +#define INT_CLR 0x114u + +/* each block's RDATA and WDATA offsets and words */ +static const struct { + u32 rd, wr; + int words; +} blocks[4] = { { 0x00, 0x1C, 7 }, { 0x38, 0x98, 8 }, { 0x58, 0xB8, 8 }, { 0x78, 0xD8, 8 } }; + +struct e32_efuse { + struct esk_mach *s; + struct esk_rf_periph *p; + u32 fuse[4][8]; /* the bits themselves */ + u32 raw; /* INT_RAW */ + int programmed; /* the bits differ from the factory's */ + u32 busy; /* the command in progress (1 read, 2 program), or 0 */ + u64 left; /* its cycles still to go */ + int clocked; +}; + +static void hw(struct esk_rf_periph *p, u32 off, u32 v) +{ + struct esk_rf_reg *r = esk_rf_reg_at(p, off); + if (r) + esk_rf_hw(r, v); +} + +static struct e32_efuse *efuse_of(struct esk_mach *m) +{ + return m->rf ? (struct e32_efuse *)esk_rf_ctx_of(m->rf, &esk_esp32_efuse_ops) : 0; +} + +/* CRC-8, polynomial x^8 + x^5 + x^4 + 1 reflected (0x8C), as the ROM's + * esp_rom_efuse_mac_address_crc8 computes it over the MAC */ +static u8 crc8(const u8 *p, int n) +{ + u8 crc = 0; + int i, b; + for (i = 0; i < n; i++) { + crc ^= p[i]; + for (b = 0; b < 8; b++) + crc = (u8)((crc & 1u) ? (crc >> 1) ^ 0x8Cu : crc >> 1); + } + return crc; +} + +static void factory(struct e32_efuse *k) +{ + static const u8 dflt[6] = { 0x24, 0x0A, 0xC4, 0x45, 0x6D, 0x62 }; + const u8 *mac = k->s->has_factory_mac ? k->s->factory_mac : dflt; + memset(k->fuse, 0, sizeof k->fuse); + /* MAC: byte 0 at bit 72, ..., byte 5 at bit 32; its CRC at bit 80 */ + k->fuse[0][1] = (u32)mac[5] | (u32)mac[4] << 8 | (u32)mac[3] << 16 | (u32)mac[2] << 24; + k->fuse[0][2] = (u32)mac[1] | (u32)mac[0] << 8 | (u32)crc8(mac, 6) << 16; + k->fuse[0][3] = 1u << 9 /* CHIP_PACKAGE 1: D0WD */ + | 1u << 15; /* CHIP_VER_REV1 */ + k->fuse[0][4] = 0x0Au << 8; /* ADC_VREF */ + k->fuse[0][5] = 1u << 20 /* CHIP_VER_REV2 */ + | 1u << 24; /* WAFER_VERSION_MINOR 1 */ +} + +/* the RDATA registers from the bits, with read protection */ +static void reload(struct e32_efuse *k) +{ + u32 rd_dis = (k->fuse[0][0] >> 16) & 15u; + int b, w; + for (b = 0; b < 4; b++) + for (w = 0; w < blocks[b].words; w++) { + u32 v = k->fuse[b][w]; + if (b > 0 && (rd_dis & (1u << (b - 1)))) + v = 0; + hw(k->p, blocks[b].rd + 4u * (u32)w, v); + } +} + +static void program(struct e32_efuse *k) +{ + u32 wr_dis = k->fuse[0][0] & 0xffffu; + int b, w; + for (b = 0; b < 4; b++) { + if (b > 0 && (wr_dis & (1u << (6 + b)))) + continue; + for (w = 0; w < blocks[b].words; w++) + k->fuse[b][w] |= esk_rf_read(k->p, blocks[b].wr + 4u * (u32)w, 4); + } + k->programmed = 1; +} + +static void irq(struct e32_efuse *k) +{ + u32 ena = esk_rf_read(k->p, INT_ENA, 4); + hw(k->p, INT_RAW, k->raw); + hw(k->p, INT_ST, k->raw & ena); + esk_esp32_source(k->s, esk_rf_irq(k->p, "EFUSE"), (k->raw & ena) != 0); +} + +static void start(struct e32_efuse *k, u32 cmd, u32 us) +{ + k->busy = cmd; + k->left = (u64)esk_mach_core_hz(k->s) * us / 1000000u; + if (!k->left) + k->left = 1; + hw(k->p, CMD, cmd); + esk_rf_clock(k->p, &k->clocked, 1); +} + +static void done(struct e32_efuse *k) +{ + if (k->busy == 1) { + reload(k); + k->raw |= 1u; + } else { + program(k); + k->raw |= 2u; + } + k->busy = 0; + hw(k->p, CMD, 0); + esk_rf_clock(k->p, &k->clocked, 0); + irq(k); +} + +static void ef_tick(void *ctx, u32 cycles) +{ + struct e32_efuse *k = (struct e32_efuse *)ctx; + if (!k->busy) + return; + if (k->left > cycles) { + k->left -= cycles; + return; + } + done(k); +} + +static int ef_next(void *ctx, u32 *cycles) +{ + struct e32_efuse *k = (struct e32_efuse *)ctx; + if (!k->busy) + return 0; + *cycles = k->left > 0xffffffffu ? 0xffffffffu : (u32)k->left; + return 1; +} + +static u32 ef_read(void *ctx, u32 off, int n) +{ + struct e32_efuse *k = (struct e32_efuse *)ctx; + return esk_rf_read(k->p, off, n); +} + +static void ef_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_efuse *k = (struct e32_efuse *)ctx; + esk_rf_write(k->p, off, n, v); + if (off == CMD) { + u32 op = esk_rf_read(k->p, CONF, 4) & 0xffffu; + if (!k->busy && (v & 1u) && op == OP_READ) + start(k, 1, 1); + else if (!k->busy && (v & 2u) && op == OP_PGM) + start(k, 2, 1000); + else + hw(k->p, CMD, k->busy); + } else if (off == INT_CLR) { + k->raw &= ~v; + hw(k->p, INT_CLR, 0); + irq(k); + } else if (off == INT_ENA) { + irq(k); + } +} + +static void ef_reset(void *ctx) +{ + struct e32_efuse *k = (struct e32_efuse *)ctx; + if (!k->programmed) + factory(k); /* the board's MAC is known by now */ + k->raw = 0; + k->busy = 0; + k->clocked = 0; + reload(k); +} + +const struct esk_dev_ops esk_esp32_efuse_ops = { + "esp32-efuse", ef_read, ef_write, ef_reset, ef_tick, ef_next, +}; + +void *esk_esp32_efuse_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_efuse *k = (struct e32_efuse *)esk_mach_alloc(s, sizeof *k); + if (!k) + return 0; + k->s = s; + k->p = p; + factory(k); + return k; +} + +int esk_esp32_efuse_flash_crypt(struct esk_mach *m) +{ + struct e32_efuse *k = efuse_of(m); + u32 cnt, ones = 0; + if (!k) + return 0; + cnt = (k->fuse[0][0] >> 20) & 0x7fu; + while (cnt) { + ones += cnt & 1u; + cnt >>= 1; + } + return (int)(ones & 1u); +} + +u32 esk_esp32_efuse_word(struct esk_mach *m, int block, int word) +{ + struct e32_efuse *k = efuse_of(m); + if (!k || block < 0 || block > 3 || word < 0 || word >= blocks[block].words) + return 0; + return k->fuse[block][word]; +} diff --git a/core/mcu/esp32/soc/esp32.h b/core/mcu/esp32/soc/esp32.h new file mode 100644 index 000000000..fdb5d6f75 --- /dev/null +++ b/core/mcu/esp32/soc/esp32.h @@ -0,0 +1,125 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* esp32.h -- the ESP32's peripheral models (ESP32 Technical Reference + * Manual v5), over the register file converted from Espressif's esp32.svd, + * for the framework's Xtensa LX6 cores (mcu/xtensa/lx6.c). + * + * efuse.c the eFuse controller and the chip's factory bits + * dport.c DPORT: the APP_CPU's reset, clock and stall, the CPU clock, + * the caches and their flash MMU, the interrupt matrix, the + * cross-CPU interrupts + * rtc.c RTC_CNTL: the reset causes, the RTC timer and watchdog, the + * software resets and stalls, the store registers + * uart.c UART0-2: FIFOs, frames at the baud rate, interrupts + * timg.c TIMG0 and TIMG1: T0, T1, the MWDT, RTC_SLOW_CLK's calibration + * gpio.c the GPIO matrix, the IO MUX and the strapping latch + * spi.c SPI0 and SPI1 in front of the flash, and the flash itself + * apbctrl.c APB_CTRL: the CPU's and APB's clock dividers + * sha.c the SHA accelerator + * ledc.c the LED PWM controller + * i2c.c I2C0 and I2C1 + * rmt.c the remote control peripheral's eight channels + * adc.c the SAR ADCs as SENS's RTC controller drives them + * rtcio.c the RTC IO MUX's DACs + * misc.c the random number generator, the AHB view of the + * peripherals */ +#ifndef ESK_MCU_ESP32_SOC_H +#define ESK_MCU_ESP32_SOC_H + +#include "mcu/rf.h" + +/* the interrupt matrix's sources (TRM table 4.3-2) */ +#define ESP32_NSOURCES 69 + +/* a peripheral's interrupt source `src` (0-68) is at `level`, for both + * CPUs or (_cpu) one CPU's matrix (GPIO's PRO_CPU and APP_CPU interrupts) */ +void esk_esp32_source(struct esk_mach *m, int src, int level); +void esk_esp32_source_cpu(struct esk_mach *m, int cpu, int src, int level); + +extern const struct esk_dev_ops esk_esp32_efuse_ops; +void *esk_esp32_efuse_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_dport_ops; +void *esk_esp32_dport_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_rtc_ops; +void *esk_esp32_rtc_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_uart_ops; +void *esk_esp32_uart_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_timg_ops; +void *esk_esp32_timg_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_gpio_ops; +void *esk_esp32_gpio_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_iomux_ops; +void *esk_esp32_iomux_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_spi_ops; +void *esk_esp32_spi_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_apbctrl_ops; +void *esk_esp32_apbctrl_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_ledc_ops; +void *esk_esp32_ledc_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_i2c_ops; +void *esk_esp32_i2c_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_rmt_ops; +void *esk_esp32_rmt_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_adc_ops; +void *esk_esp32_adc_create(struct esk_mach *s, struct esk_rf_periph *p); +extern const struct esk_dev_ops esk_esp32_rtcio_ops; +void *esk_esp32_rtcio_create(struct esk_mach *s, struct esk_rf_periph *p); +/* DAC1 on GPIO25, DAC2 on GPIO26 (rtcio.c): 1 and the voltage it drives + * behind its output resistance, or 0 when the pad is not the DAC's */ +int esk_esp32_dac_out(struct esk_mach *m, int gpio, double *volts, double *rout); +extern const struct esk_dev_ops esk_esp32_sha_ops; +void *esk_esp32_sha_create(struct esk_mach *s, struct esk_rf_periph *p); +/* the RNG and the AHB view of the peripherals (misc.c): 0, or -1 */ +int esk_esp32_misc_add(struct esk_mach *s); +/* the internal I2C master to the analog blocks (regi2c.c): 0, or -1 */ +int esk_esp32_regi2c_add(struct esk_mach *s); + +/* the chip's eFuse fields the hardware reads */ +int esk_esp32_efuse_flash_crypt(struct esk_mach *m); +u32 esk_esp32_efuse_word(struct esk_mach *m, int block, int word); + +/* the clocks: the CPU's (CPU_CLK), the APB's, the crystal's, in Hz */ +u32 esk_esp32_cpu_hz(struct esk_mach *m); +u32 esk_esp32_apb_hz(struct esk_mach *m); +#define ESP32_XTAL_HZ 40000000u +/* RTC_CNTL CLK_CONF's SOC_CLK_SEL, and RTC_SLOW_CLK in Hz */ +u32 esk_esp32_rtc_soc_clk_sel(struct esk_mach *m); +double esk_esp32_rtc_slow_hz(struct esk_mach *m); +/* DPORT CPU_PER_CONF's CPUPERIOD_SEL */ +u32 esk_esp32_dport_cpuperiod(struct esk_mach *m); + +/* a reset of TRM table 4.3-? `code` (1 POWERON, 3 SW_SYS, 12 SW_CPU, ...), + * of the whole chip (system) or one CPU */ +void esk_esp32_reset(struct esk_mach *m, int code); +void esk_esp32_cpu_reset(struct esk_mach *m, int core, int code); +/* the reset cause each CPU reports (RTC_CNTL RESET_STATE) */ +void esk_esp32_rtc_reset_cause(struct esk_mach *m, int core, int code); + +/* the flash's bytes from `addr` on, `len` of them, changed: the caches' + * pages over them are stale */ +void esk_esp32_flash_written(struct esk_mach *m, u32 addr, u32 len); + +/* the strapping pins' levels latched at reset (GPIO_STRAP) */ +u32 esk_esp32_strap(struct esk_mach *m); +/* where a UART's TXD (tx) or RXD is: 0 and the runtime's port and bit */ +int esk_esp32_uart_pin(struct esk_mach *m, const char *unit, int tx, int *port, int *bit); +/* the board drove a pin or let it go: the levels again */ +void esk_esp32_pins_changed(struct esk_mach *m); +/* a peripheral output signal of the GPIO matrix (TRM table 4-2) driven by + * its model: its level and enable */ +void esk_esp32_signal(struct esk_mach *m, int sig, int level, int oe); +/* a peripheral input signal's level as the matrix or the IO MUX gives it */ +int esk_esp32_signal_in(struct esk_mach *m, int sig); +/* `fn` is called when a pad's input level changed: -1 when full */ +int esk_esp32_signal_watch(struct esk_mach *m, void (*fn)(void *ctx), void *ctx); + +/* the flash chip (spi.c) */ +struct esk_esp32_nor; +struct esk_esp32_nor *esk_esp32_nor_of(struct esk_mach *m); +struct esk_esp32_nor *esk_esp32_nor_create(struct esk_mach *m); +void esk_esp32_nor_power_on(struct esk_esp32_nor *f); +int esk_esp32_nor_busy(struct esk_esp32_nor *f); +/* one transaction: `ntx` bytes the chip receives (the instruction first), + * then `nrx` bytes it answers with */ +void esk_esp32_nor_xfer(struct esk_esp32_nor *f, const u8 *tx, int ntx, u8 *rx, int nrx); +#endif diff --git a/core/mcu/esp32/soc/gpio.c b/core/mcu/esp32/soc/gpio.c new file mode 100644 index 000000000..89be81ebc --- /dev/null +++ b/core/mcu/esp32/soc/gpio.c @@ -0,0 +1,560 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* gpio.c -- the ESP32's GPIO matrix and IO MUX (TRM v5 chapter 4, + * "IO_MUX and GPIO Matrix"; ESP32 Series Datasheet's pin tables) on its 34 + * pads GPIO0-19, 21-23, 25-27 and 32-39 (the runtime's port n / 16, bit + * n % 16). The ESP32-C3's model (mcu/esp32c3/gpio.c) on the ESP32's + * registers. + * + * Each pad's IO_MUX register picks its function (MCU_SEL): function 2 is + * the GPIO matrix on every pad, and so is function 0 on the pads whose + * first function is their GPIO; GPIO1's function 0 is U0TXD and GPIO3's + * U0RXD, directly; GPIO6-11 (the module's flash) and the JTAG pads + * (GPIO12-15) leave the pad to their functions, which no model drives. + * - Through the matrix, GPIO_FUNCn_OUT_SEL_CFG's OUT_SEL names the pad's + * output: 256 is GPIO_OUT's (OUT1's) bit, with GPIO_ENABLE's + * (ENABLE1's) as its enable; a peripheral signal (TRM table 4-2) is + * that signal, its enable the peripheral's (1 for the UARTs' TXD, RTS + * and DTR) unless OEN_SEL takes GPIO_ENABLE's; INV_SEL and OEN_INV_SEL + * invert them. A peripheral's model sets its signals' levels and + * enables (esk_esp32_signal); a signal no model drives leaves the pad + * undriven. GPIO34-39 have no output driver. + * - GPIO_PINn's PAD_DRIVER makes the output open-drain; FUN_WPU and + * FUN_WPD pull the pad; FUN_IE lets its level into GPIO_IN (IN1), the + * interrupt and the peripherals' inputs. + * - The pad is its output where enabled; else what the board drives; + * else its pull; else 0. + * - A peripheral input (GPIO_FUNCy_IN_SEL_CFG) comes through the matrix + * from IN_SEL's pad (0x38: 1, 0x30: 0, IN_INV_SEL inverting) when SEL + * is set, else directly from the pad whose IO MUX function it is, else + * 0 (1 for the I2C controllers' SCL and SDA). A model may watch the + * pads' input levels (esk_esp32_signal_watch). + * - Interrupts (GPIO_PINn's INT_TYPE: 1 rising, 2 falling, 3 any edge, + * 4 low level, 5 high level; INT_ENA bit 0 the APP_CPU's, 1 its NMI's, + * 2 the PRO_CPU's, 3 its NMI's) set GPIO_STATUS (STATUS1; W1TS and + * W1TC set and clear it; a level sets it again while it lasts); + * PCPU_INT, PCPU_NMI_INT, ACPU_INT and ACPU_NMI_INT (and their *1) are + * the enabled ones; the matrix sources GPIO (22) and GPIO_NMI (23) + * reach each CPU with that CPU's own. + * - GPIO_STRAP latches at a chip reset the boot-mode pins (TRM 4.? and + * the datasheet's strapping table): MTDI (GPIO12) bit 5, GPIO0 bit 4, + * GPIO2 bit 3, GPIO4 bit 2, MTDO (GPIO15) bit 1, GPIO5 bit 0, each + * its reset pull's level when nothing drives it (GPIO0, MTDO, GPIO5 + * up; GPIO2, GPIO4, MTDI down): 0x13, SPI_FAST_FLASH_BOOT; GPIO0 held + * low gives 0x03, the download mode. It keeps them through every other + * reset. + * IO MUX's pads come out of reset as the datasheet's table has them (each + * pad's IE and pull), not with the SVD's one reset value for all. + * Not yet: the RTC IO MUX (RTC_IO's pad functions, its pulls, the + * hold), the input filter, sleep mode (the MCU_ pad bits, SLP_SEL), the + * drive strengths' effect, the pads' wake-up, the SDIO interrupt. */ +#include +#include + +#include "mcu/esp32/soc/esp32.h" + +#define NPIN 40 +#define SIG_U0TXD 14 +#define SIG_U0RTS 15 +#define SIG_U0DTR 16 +#define SIG_U1TXD 17 +#define SIG_U1RTS 18 +#define SIG_U2TXD 198 +#define SIG_U2RTS 199 +#define SIG_GPIO 256 +#define NSIG 256 + +#define MUX_FUN_WPD (1u << 7) +#define MUX_FUN_WPU (1u << 8) +#define MUX_FUN_IE (1u << 9) + +/* the pads that exist */ +#define PADS 0xFF0EFFFFFFull +/* the datasheet's reset column: 0 IE off; 1 IE; 2 IE and WPD; 3 IE and WPU */ +static const u8 reset_kind[NPIN] = { + 3, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 3, 1, 1, 1, 1, + 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +/* function 0 is the pad's GPIO */ +static const u8 f0_is_gpio[NPIN] = { + 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; + +struct e32_gpio { + struct esk_mach *s; + struct esk_rf_periph *p, *mux; + struct esk_rf_reg *out, *out1, *enable, *enable1, *strap, *in, *in1, *status, *status1; + struct esk_rf_reg *pcpu, *pnmi, *acpu, *anmi, *pcpu1, *pnmi1, *acpu1, *anmi1; + struct esk_rf_reg *pin[NPIN], *fout[NPIN], *fin[NSIG], *iomux[NPIN]; + u32 latched; + int have, known, busy, irq[2], irq_nmi[2]; + u64 level, input; + esk_mach_pin cfg[NPIN]; + u8 sig_on[NSIG], sig_lv[NSIG], sig_oe[NSIG]; + int again; + struct { + void (*fn)(void *ctx); + void *ctx; + } watch[8]; + int nwatch; +}; + +static u32 reg(const struct esk_rf_reg *r) { return r ? (u32)r->value : 0; } + +static int pad(int n) { return n >= 0 && n < NPIN && ((PADS >> n) & 1u); } + +static struct e32_gpio *gpio_of(struct esk_mach *m) +{ + return m->rf ? (struct e32_gpio *)esk_rf_ctx_of(m->rf, &esk_esp32_gpio_ops) : 0; +} + +static u64 out64(const struct e32_gpio *k) { return (u64)reg(k->out) | (u64)reg(k->out1) << 32; } +static u64 en64(const struct e32_gpio *k) { return (u64)reg(k->enable) | (u64)reg(k->enable1) << 32; } + +/* the pad's IO MUX function: 2 the matrix (also function 0 of the pads + * whose function 0 is their GPIO), else its own */ +static u32 mux_sel(const struct e32_gpio *k, int n) +{ + u32 sel = (reg(k->iomux[n]) >> 12) & 7u; + return sel == 0 && f0_is_gpio[n] ? 2u : sel; +} + +static int signal_out(const struct e32_gpio *k, int sig, int *level, int *oe) +{ + if (sig >= 0 && sig < NSIG && k->sig_on[sig]) { + *level = k->sig_lv[sig]; + *oe = k->sig_oe[sig]; + return 1; + } + switch (sig) { + case SIG_U0TXD: case SIG_U1TXD: case SIG_U2TXD: /* idle high: the frames are the runtime's */ + case SIG_U0RTS: case SIG_U0DTR: case SIG_U1RTS: case SIG_U2RTS: + *level = 1; + *oe = 1; + return 1; + default: + return 0; + } +} + +static int pin_out(const struct e32_gpio *k, int n, int *level, int *oe, int *af) +{ + u32 sel = mux_sel(k, n); + *af = 0; + if (n >= 34) + return 0; /* input only */ + if (sel == 2) { + u32 f = reg(k->fout[n]), sig = f & 0x1ffu; + int lv = 0, en = 0; + if (sig == SIG_GPIO) { + lv = (int)(out64(k) >> n & 1u); + en = (int)(en64(k) >> n & 1u); + } else { + if (!signal_out(k, (int)sig, &lv, &en)) + return 0; + *af = 1; + if (f & (1u << 10)) + en = (int)(en64(k) >> n & 1u); + } + if (f & (1u << 9)) + lv = !lv; + if (f & (1u << 11)) + en = !en; + *level = lv; + *oe = en; + return 1; + } + if (sel == 0 && n == 1) { /* U0TXD */ + *level = 1; + *oe = 1; + *af = 1; + return 1; + } + return 0; +} + +static void irqs(struct e32_gpio *k, u64 rise, u64 fall) +{ + u64 st = (u64)reg(k->status) | (u64)reg(k->status1) << 32, ints[4] = { 0, 0, 0, 0 }; + int n, c; + for (n = 0; n < NPIN; n++) { + u32 pr, type, ena; + int in, hit; + if (!pad(n)) + continue; + pr = reg(k->pin[n]); + type = (pr >> 7) & 7u; + ena = (pr >> 13) & 0x1fu; + in = (int)(k->input >> n & 1u); + hit = (type == 1 && (rise >> n & 1u)) || (type == 2 && (fall >> n & 1u)) || + (type == 3 && ((rise | fall) >> n & 1u)) || (type == 4 && !in) || (type == 5 && in); + if (hit) + st |= 1ull << n; + if (type && (st >> n & 1u)) + for (c = 0; c < 4; c++) + if (ena & (1u << c)) + ints[c] |= 1ull << n; + } + esk_rf_hw(k->status, (u32)st); + esk_rf_hw(k->status1, (u32)(st >> 32) & 0xffu); + esk_rf_hw(k->acpu, (u32)ints[0]); + esk_rf_hw(k->anmi, (u32)ints[1]); + esk_rf_hw(k->pcpu, (u32)ints[2]); + esk_rf_hw(k->pnmi, (u32)ints[3]); + if (k->acpu1) { + esk_rf_hw(k->acpu1, (u32)(ints[0] >> 32)); + esk_rf_hw(k->anmi1, (u32)(ints[1] >> 32)); + esk_rf_hw(k->pcpu1, (u32)(ints[2] >> 32)); + esk_rf_hw(k->pnmi1, (u32)(ints[3] >> 32)); + } + for (c = 0; c < 2; c++) { + int cpu_int = ints[c ? 0 : 2] != 0, cpu_nmi = ints[c ? 1 : 3] != 0; + if (cpu_int != k->irq[c]) { + k->irq[c] = cpu_int; + esk_esp32_source_cpu(k->s, c, 22, cpu_int); + } + if (cpu_nmi != k->irq_nmi[c]) { + k->irq_nmi[c] = cpu_nmi; + esk_esp32_source_cpu(k->s, c, 23, cpu_nmi); + } + } +} + +/* the pads the matrix gives a UART's RX: the runtime reads their frames */ +static u64 uart_rx_pins(const struct e32_gpio *k) +{ + static const int sig[3] = { 14, 17, 198 }; + u64 m = 0; + int i; + for (i = 0; i < 3; i++) { + u32 f = reg(k->fin[sig[i]]), n = f & 0x3fu; + if ((f & (1u << 7)) && n < NPIN) + m |= 1ull << n; + } + return m; +} + +static void settle(struct e32_gpio *k) +{ + struct esk_mach *s = k->s; + u64 lvl = 0, in = 0, rise, fall, rx; + int n; + if (k->busy) { + k->again = 1; + return; + } + k->busy = 1; +again: + k->again = 0; + rx = uart_rx_pins(k); + for (n = 0; n < NPIN; n++) { + u32 mux; + int level = 0, oe = 0, af = 0, drive, ext = 0, pin, wpu, wpd, od; + esk_mach_pin o; + if (!pad(n)) + continue; + mux = reg(k->iomux[n]); + wpu = (mux & MUX_FUN_WPU) != 0; + wpd = (mux & MUX_FUN_WPD) != 0; + od = (reg(k->pin[n]) & (1u << 2)) != 0; + if (!pin_out(k, n, &level, &oe, &af)) + oe = 0; + drive = oe && !(od && level); + memset(&o, 0, sizeof o); + o.drive = oe ? level : -1; + o.open_drain = od; + o.pull = wpu && !wpd ? 1 : wpd && !wpu ? 2 : 0; + o.af = af || (mux_sel(k, n) == 0 && n == 3) /* U0RXD */ || (rx >> n & 1u); + o.analog = !(mux & MUX_FUN_IE) && !oe; + if (esk_esp32_dac_out(s, n, &o.volts, &o.aout_r)) { /* a DAC's pad */ + o.aout = 1; + o.analog = 1; + o.drive = -1; + drive = 0; + } + if (s->host.pin_cfg && (!k->known || memcmp(&k->cfg[n], &o, sizeof o) != 0)) + s->host.pin_cfg(s->host.ctx, n / 16, n % 16, &o); + k->cfg[n] = o; + if (drive) + pin = level; + else if (s->host.pin_in && s->host.pin_in(s->host.ctx, n / 16, n % 16, &ext)) + pin = ext != 0; + else + pin = wpu ? 1 : 0; + lvl |= (u64)pin << n; + if (mux & MUX_FUN_IE) + in |= (u64)pin << n; + } + rise = k->known ? in & ~k->input : 0; + fall = k->known ? ~in & k->input : 0; + k->level = lvl; + k->input = in; + k->known = 1; + esk_rf_hw(k->in, (u32)in); + esk_rf_hw(k->in1, (u32)(in >> 32) & 0xffu); + irqs(k, rise, fall); + if (rise | fall) + for (n = 0; n < k->nwatch; n++) + k->watch[n].fn(k->watch[n].ctx); + if (k->again) + goto again; + k->busy = 0; +} + +void esk_esp32_signal(struct esk_mach *m, int sig, int level, int oe) +{ + struct e32_gpio *k = gpio_of(m); + u8 lv = (u8)(level != 0), en = (u8)(oe != 0); + if (!k || sig < 0 || sig >= NSIG) + return; + if (k->sig_on[sig] && k->sig_lv[sig] == lv && k->sig_oe[sig] == en) + return; + k->sig_on[sig] = 1; + k->sig_lv[sig] = lv; + k->sig_oe[sig] = en; + if (k->known) + settle(k); +} + +int esk_esp32_signal_in(struct esk_mach *m, int sig) +{ + struct e32_gpio *k = gpio_of(m); + u32 f; + if (!k || sig < 0 || sig >= NSIG) + return 0; + f = reg(k->fin[sig]); + if (f & (1u << 7)) { + u32 n = f & 0x3fu; + int v = n == 0x38u ? 1 : n == 0x30u ? 0 : n < NPIN ? (int)(k->input >> n & 1u) : 0; + return (f & (1u << 6)) ? !v : v; + } + if (sig == 14 && mux_sel(k, 3) == 0) /* U0RXD */ + return (int)(k->input >> 3 & 1u); + /* the table's defaults: I2CEXT0/1's SCL and SDA idle high */ + return sig == 29 || sig == 30 || sig == 95 || sig == 96; +} + +int esk_esp32_signal_watch(struct esk_mach *m, void (*fn)(void *ctx), void *ctx) +{ + struct e32_gpio *k = gpio_of(m); + if (!k || k->nwatch >= (int)(sizeof k->watch / sizeof k->watch[0])) + return -1; + k->watch[k->nwatch].fn = fn; + k->watch[k->nwatch].ctx = ctx; + k->nwatch++; + return 0; +} + +void esk_esp32_pins_changed(struct esk_mach *m) +{ + struct e32_gpio *k = gpio_of(m); + if (k) + settle(k); +} + +int esk_esp32_uart_pin(struct esk_mach *m, const char *unit, int tx, int *port, int *bit) +{ + static const int txs[3] = { SIG_U0TXD, SIG_U1TXD, SIG_U2TXD }, rxs[3] = { 14, 17, 198 }; + struct e32_gpio *k = gpio_of(m); + int u, n; + if (!k || strncmp(unit, "UART", 4) || unit[4] < '0' || unit[4] > '2' || unit[5]) + return -1; + u = unit[4] - '0'; + if (tx) { + for (n = 0; n < 34; n++) { + u32 sel; + if (!pad(n)) + continue; + sel = mux_sel(k, n); + if ((sel == 2 && (int)(reg(k->fout[n]) & 0x1ffu) == txs[u]) || (u == 0 && sel == 0 && n == 1)) { + *port = n / 16; + *bit = n % 16; + return 0; + } + } + return -1; + } + { + u32 f = reg(k->fin[rxs[u]]); + if (f & (1u << 7)) { + n = (int)(f & 0x3fu); + if (!pad(n)) + return -1; + } else if (u == 0 && mux_sel(k, 3) == 0) { + n = 3; + } else { + return -1; + } + *port = n / 16; + *bit = n % 16; + return 0; + } +} + +u32 esk_esp32_strap(struct esk_mach *m) +{ + struct e32_gpio *k = gpio_of(m); + return k ? k->latched : 0x13u; +} + +/* ---- the GPIO block ---------------------------------------------------- */ + +static u32 gp_read(void *ctx, u32 off, int n) +{ + struct e32_gpio *k = (struct e32_gpio *)ctx; + return esk_rf_read(k->p, off, n); +} + +static void set_clr(struct esk_rf_reg *r, int set, u32 v, u32 mask) +{ + esk_rf_hw(r, set ? reg(r) | (v & mask) : reg(r) & ~v); +} + +static void gp_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_gpio *k = (struct e32_gpio *)ctx; + const u32 lo = (u32)(PADS & 0xffffffffull), hi = (u32)(PADS >> 32) & 0xffu; + switch (off) { + case 0x38: case 0x3C: case 0x40: case 0x60: case 0x64: case 0x68: case 0x6C: + return; /* read-only */ + case 0x08: case 0x0C: set_clr(k->out, off == 0x08, v, lo); break; + case 0x14: case 0x18: set_clr(k->out1, off == 0x14, v, hi); break; + case 0x24: case 0x28: set_clr(k->enable, off == 0x24, v, lo); break; + case 0x30: case 0x34: set_clr(k->enable1, off == 0x30, v, hi); break; + case 0x48: case 0x4C: set_clr(k->status, off == 0x48, v, lo); break; + case 0x54: case 0x58: set_clr(k->status1, off == 0x54, v, hi); break; + default: + esk_rf_write(k->p, off, n, v); + } + settle(k); +} + +static int pin_level(struct e32_gpio *k, int gpio, int dflt) +{ + int level = dflt; + if (k->s->host.pin_in && k->s->host.pin_in(k->s->host.ctx, gpio / 16, gpio % 16, &level)) + return level != 0; + return dflt; +} + +static void gp_reset(void *ctx) +{ + struct e32_gpio *k = (struct e32_gpio *)ctx; + int c; + if (!k->have || k->s->reset_cause == ESK_RESET_POWER || k->s->reset_cause == ESK_RESET_PIN) { + k->latched = (u32)pin_level(k, 12, 0) << 5 | (u32)pin_level(k, 0, 1) << 4 | + (u32)pin_level(k, 2, 0) << 3 | (u32)pin_level(k, 4, 0) << 2 | + (u32)pin_level(k, 15, 1) << 1 | (u32)pin_level(k, 5, 1); + k->have = 1; + } + esk_rf_hw(k->strap, k->latched); + for (c = 0; c < 2; c++) { + k->irq[c] = k->irq_nmi[c] = 0; + esk_esp32_source_cpu(k->s, c, 22, 0); + esk_esp32_source_cpu(k->s, c, 23, 0); + } + k->known = 0; + settle(k); +} + +const struct esk_dev_ops esk_esp32_gpio_ops = { + "esp32-gpio", gp_read, gp_write, gp_reset, 0, 0, +}; + +/* ---- IO MUX ------------------------------------------------------------ */ + +static u32 mx_read(void *ctx, u32 off, int n) +{ + struct esk_rf_periph *p = (struct esk_rf_periph *)ctx; + return esk_rf_read(p, off, n); +} + +static void mx_write(void *ctx, u32 off, int n, u32 v) +{ + struct esk_rf_periph *p = (struct esk_rf_periph *)ctx; + esk_rf_write(p, off, n, v); + esk_esp32_pins_changed(p->sim); +} + +static void mx_reset(void *ctx) +{ + struct esk_rf_periph *p = (struct esk_rf_periph *)ctx; + char name[16]; + int i; + for (i = 0; i < NPIN; i++) { + struct esk_rf_reg *r; + u32 v = 2u << 10; /* FUN_DRV 2 */ + snprintf(name, sizeof name, "GPIO%d", i); + r = esk_rf_reg(p, name); + if (!r || !pad(i)) + continue; + switch (reset_kind[i]) { + case 1: v |= MUX_FUN_IE; break; + case 2: v |= MUX_FUN_IE | MUX_FUN_WPD; break; + case 3: v |= MUX_FUN_IE | MUX_FUN_WPU; break; + default: break; + } + esk_rf_hw(r, v); + } + esk_esp32_pins_changed(p->sim); +} + +const struct esk_dev_ops esk_esp32_iomux_ops = { + "esp32-iomux", mx_read, mx_write, mx_reset, 0, 0, +}; + +void *esk_esp32_iomux_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + ES_UNUSED(s); + return esk_rf_reg(p, "GPIO39") ? p : 0; +} + +void *esk_esp32_gpio_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_gpio *k = (struct e32_gpio *)esk_mach_alloc(s, sizeof *k); + char name[32]; + int i; + if (!k) + return 0; + k->s = s; + k->p = p; + k->mux = esk_rf_periph(s->rf, "IO_MUX"); + k->out = esk_rf_reg(p, "OUT"); + k->out1 = esk_rf_reg(p, "OUT1"); + k->enable = esk_rf_reg(p, "ENABLE"); + k->enable1 = esk_rf_reg(p, "ENABLE1"); + k->strap = esk_rf_reg(p, "STRAP"); + k->in = esk_rf_reg(p, "IN"); + k->in1 = esk_rf_reg(p, "IN1"); + k->status = esk_rf_reg(p, "STATUS"); + k->status1 = esk_rf_reg(p, "STATUS1"); + k->acpu = esk_rf_reg(p, "ACPU_INT"); + k->anmi = esk_rf_reg(p, "ACPU_NMI_INT"); + k->pcpu = esk_rf_reg(p, "PCPU_INT"); + k->pnmi = esk_rf_reg(p, "PCPU_NMI_INT"); + k->acpu1 = esk_rf_reg(p, "ACPU_INT1"); + k->anmi1 = esk_rf_reg(p, "ACPU_NMI_INT1"); + k->pcpu1 = esk_rf_reg(p, "PCPU_INT1"); + k->pnmi1 = esk_rf_reg(p, "PCPU_NMI_INT1"); + if (!k->mux || !k->out || !k->out1 || !k->enable || !k->enable1 || !k->strap || !k->in || !k->in1 || + !k->status || !k->status1 || !k->acpu || !k->anmi || !k->pcpu || !k->pnmi) + return 0; + for (i = 0; i < NPIN; i++) { + if (!pad(i)) + continue; + snprintf(name, sizeof name, "PIN%d", i); + k->pin[i] = esk_rf_reg(p, name); + snprintf(name, sizeof name, "FUNC%d_OUT_SEL_CFG", i); + k->fout[i] = esk_rf_reg(p, name); + snprintf(name, sizeof name, "GPIO%d", i); + k->iomux[i] = esk_rf_reg(k->mux, name); + if (!k->pin[i] || !k->fout[i] || !k->iomux[i]) + return 0; + } + for (i = 0; i < NSIG; i++) { + snprintf(name, sizeof name, "FUNC%d_IN_SEL_CFG", i); + k->fin[i] = esk_rf_reg(p, name); + } + s->pins_changed = esk_esp32_pins_changed; + s->uart_pin = esk_esp32_uart_pin; + return k; +} diff --git a/core/mcu/esp32/soc/i2c.c b/core/mcu/esp32/soc/i2c.c new file mode 100644 index 000000000..5919bafe3 --- /dev/null +++ b/core/mcu/esp32/soc/i2c.c @@ -0,0 +1,944 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* i2c.c -- the ESP32's I2C controllers I2C0 and I2C1 (TRM v5 chapter 11) + * on the GPIO matrix's I2CEXT0_SCL and _SDA (signals 29 and 30) and + * I2CEXT1_SCL and _SDA (95 and 96), master or slave (CTR's MS_MODE), + * their interrupts on matrix sources 49 and 50. The ESP32-C3's model + * (mcu/esp32c3/i2c.c) on the ESP32's registers, timing and commands. + * + * - The controller runs from APB_CLK; its settings act as written (the + * ESP32 has no CONF_UPGATE). + * - A master runs COMD0-15 from TRANS_START: each command's byte_num + * (bits 7:0), ack_check_en (8), ack_exp (9), ack_value (10) and + * op_code (13:11: 0 RSTART, 1 WRITE, 2 READ, 3 STOP, 4 END), its + * COMMAND_DONE (bit 31) set when it is done. RSTART makes a START (once + * SCL is high) or a repeated START; WRITE sends byte_num bytes from the + * TX FIFO, the address among them, each with its ACK checked against + * ack_exp when ack_check_en is set (ACK_ERR, then a STOP and the + * commands stop); READ takes byte_num bytes into the RX FIFO, + * answering ack_value; STOP ends the transfer and the commands; END + * holds SCL low and stops (END_DETECT) until the next TRANS_START runs + * the commands from COMD0 again. Each byte a master sends or receives + * raises MASTER_TRAN_COMP and sets SR's BYTE_TRANS. + * - The bus's timing in APB_CLK cycles, as ESP-IDF's i2c_ll counts it: + * SCL low SCL_LOW_PERIOD + 1; let go, high from its rise for + * SCL_HIGH_PERIOD + 7, or + 8 with the SCL filter on at a threshold + * up to 2, + threshold + 6 above (a slave holding SCL low stretches + * the low time); SDA changes SDA_HOLD after SCL falls and is read + * SDA_SAMPLE after it rises; a START holds SDA low SCL_START_HOLD + * before SCL falls, a repeated START waits SCL_RSTART_SETUP with SCL + * high, a STOP SCL_STOP_SETUP before SDA rises and SCL_STOP_HOLD + * after it. + * - The lines are open-drain: with SCL_FORCE_OUT and SDA_FORCE_OUT the + * output is enabled throughout (the pad's PAD_DRIVER then makes it + * open-drain, as ESP-IDF configures it), without them the level and + * the enable are exchanged (low driven, high let go). A master letting + * SDA go that reads it low loses the bus (ARBITRATION_LOST, SR's + * ARB_LOST) and lets both lines go. SCL held low by someone else for + * more than TO's TIME_OUT_REG cycles ends the transfer (TIME_OUT, SR's + * TIME_OUT). + * - The TX and RX FIFOs (32 bytes each) are filled and emptied through + * DATA (ESP-IDF writes it through the AHB view, 0x6001301C and + * 0x6002701C, and reads it at the DPORT address): RXFIFO_OVF receiving + * into a full one; TX_FIFO_RST and RX_FIFO_RST empty them; TXFIFO_EMPTY + * while the TX FIFO holds fewer than TXFIFO_EMPTY_THRHD bytes and + * RXFIFO_FULL while the RX FIFO holds more than RXFIFO_FULL_THRHD; + * RXFIFO_ST and SR's counts follow them. + * - A slave answers SLAVE_ADDR (7 bits, or 10 with ADDR_10BIT_EN: the + * first byte 0x78 | its two high bits, then the low eight): it ACKs, + * puts the bytes written into the RX FIFO (with FIFO_ADDR_CFG_EN the + * first is the RAM address the bytes go to and come from), sends the + * TX FIFO's bytes when read (a NACK from the master ends them), ACKs + * a full RX FIFO (RXFIFO_OVF). SR's SLAVE_ADDRESSED and SLAVE_RW say + * how it was addressed; a STOP raises SLAVE_TRAN_COMP. + * - Both see the bus: BUS_BUSY from a START to a STOP, TRANS_COMPLETE at + * a STOP; TRANS_START when a master makes a START; ACK_REC is the last + * ACK. + * - INT_STATUS is INT_RAW and INT_ENA; INT_CLR clears. DPORT's + * PERIP_RST_EN bits 7 and 18 reset I2C0 and I2C1 (dport.c). + * Where it differs inside: the filters (SCL_ and SDA_FILTER_CFG) are not + * applied (the nets' levels are clean) beyond their share of the high + * time; SR's state fields read 0; a slave reacts at the edge it sees, not + * at its SDA_SAMPLE point. Not yet: the non-FIFO mode (NONFIFO_EN, its + * RX_REC_FULL and TX_SEND_EMPTY, the RAM read directly at 0x100), + * SAMPLE_SCL_LEVEL (sampling while SCL is low), 10-bit addressing's R/W + * check. */ +#include +#include +#include + +#include "mcu/esp32/soc/esp32.h" + +#define FS_PER_S 1000000000000000ull +#define NCMD 16 + +/* CTR */ +#define C_SDA_FORCE (1u << 0) +#define C_SCL_FORCE (1u << 1) +#define C_MS_MODE (1u << 4) +#define C_TRANS_START (1u << 5) +#define C_TX_LSB (1u << 6) +#define C_RX_LSB (1u << 7) +/* FIFO_CONF */ +#define F_ADDR_CFG (1u << 11) +#define F_RX_RST (1u << 12) +#define F_TX_RST (1u << 13) +/* INT_RAW */ +#define I_RXFIFO_FULL (1u << 0) +#define I_TXFIFO_EMPTY (1u << 1) +#define I_RXFIFO_OVF (1u << 2) +#define I_END_DETECT (1u << 3) +#define I_SLAVE_TRAN_COMP (1u << 4) +#define I_ARB_LOST (1u << 5) +#define I_MASTER_TRAN_COMP (1u << 6) +#define I_TRANS_COMPLETE (1u << 7) +#define I_TIME_OUT (1u << 8) +#define I_TRANS_START (1u << 9) +#define I_ACK_ERR (1u << 10) +/* SR */ +#define SR_ACK_REC (1u << 0) +#define SR_SLAVE_RW (1u << 1) +#define SR_TIME_OUT (1u << 2) +#define SR_ARB_LOST (1u << 3) +#define SR_BUS_BUSY (1u << 4) +#define SR_ADDRESSED (1u << 5) +#define SR_BYTE_TRANS (1u << 6) + +enum { OP_RSTART = 0, OP_WRITE = 1, OP_READ = 2, OP_STOP = 3, OP_END = 4 }; + +/* the master's step */ +enum { + P_IDLE, + P_WAIT_BUS, /* SCL low (someone holds it): a START waits for it */ + P_START, /* SDA low: SCL falls after the START hold */ + P_LOW0, /* SCL low: SDA changes after the hold */ + P_LOW1, /* SCL low: let go of it at the low period's end */ + P_WAITHI, /* SCL let go, waiting for it to rise */ + P_HIGH0, /* SCL high: SDA read at the sample point */ + P_HIGH1, /* SCL high: SCL falls at the high period's end */ + P_RS_SETUP, /* SCL high: SDA falls for the repeated START */ + P_STOP_SETUP, /* SCL high: SDA rises for the STOP */ + P_STOP_HOLD, /* the bus free time after a STOP */ + P_HELD /* END: SCL held low */ +}; + +/* what a clock pulse carries */ +enum { K_DOUT, K_DIN, K_AIN, K_AOUT, K_RS, K_STOP }; + +/* the slave's state */ +enum { S_IDLE, S_ADDR, S_ADDR2, S_RX, S_TX, S_WAIT }; + +struct e32_i2c { + struct esk_mach *s; + struct esk_rf_periph *p; + struct esk_rf_reg *ctr, *sr, *to, *saddr, *fifo_st, *fifo_conf, *raw, *ena, *st; + struct esk_rf_reg *low, *high, *hold, *sample, *sth, *rss, *sph, *sps, *sclf; + struct esk_rf_reg *comd[NCMD]; + int source, sig_scl, sig_sda; + /* the FIFOs' RAM */ + u8 txram[32], rxram[32]; + u32 twr, trd, tcnt, rwr, rrd, rcnt; + /* the lines: what it drives (1 lets go), what it sees */ + int scl_o, sda_o, scl_i, sda_i; + /* the next event: an absolute cycle and fs past it */ + int ev; + u64 ev_c, ev_f, cur_c, cur_f; + /* the master */ + int phase, kind, waiting_to, ci, op, bitn; + u32 cmd, nbytes, byte; + int sda_next; + /* the slave */ + int sstate, sbit, srw, sfirst, spend, spend_sda; + u32 sbyte; + int clocked, level, in_step; +}; + +static u32 reg(const struct esk_rf_reg *r) { return (u32)r->value; } + +static void update(struct e32_i2c *k) +{ + u32 st = reg(k->raw) & reg(k->ena) & 0x1fffu; + int level = st != 0; + esk_rf_hw(k->st, st); + if (level != k->level) { + k->level = level; + esk_esp32_source(k->s, k->source, level); + } +} + +static void raise(struct e32_i2c *k, u32 bits) +{ + esk_rf_hw(k->raw, reg(k->raw) | bits); + update(k); +} + +static void sr_set(struct e32_i2c *k, u32 bits, int on) +{ + esk_rf_hw(k->sr, on ? reg(k->sr) | bits : reg(k->sr) & ~bits); +} + +static u32 reverse8(u32 b) +{ + u32 r = 0; + int i; + for (i = 0; i < 8; i++) + r |= ((b >> i) & 1u) << (7 - i); + return r; +} + +/* ---- time ------------------------------------------------------------------ */ + +static double apb_fs(const struct e32_i2c *k) +{ + u32 hz = esk_esp32_apb_hz(k->s); + return hz ? (double)FS_PER_S / (double)hz : 0; +} + +static u64 fs_per_cycle(const struct e32_i2c *k) +{ + u32 hz = esk_mach_core_hz(k->s); + return hz ? FS_PER_S / hz : 0; +} + +/* the event `n` APB_CLK cycles after the present */ +static void after(struct e32_i2c *k, u32 n) +{ + u64 fpc = fs_per_cycle(k), d; + double af = apb_fs(k); + if (!fpc || af <= 0) { + k->ev = 0; + return; + } + d = (u64)((double)n * af + 0.5) + k->cur_f; + k->ev_c = k->cur_c + d / fpc; + k->ev_f = d % fpc; + k->ev = 1; + k->s->bus.touched = 1; /* the machine's next event may be this one */ +} + +/* the present: a register write's, an edge's or an event's time */ +static void now_at(struct e32_i2c *k, u64 cycle) +{ + k->cur_c = cycle; + k->cur_f = 0; +} + +static void clocking(struct e32_i2c *k) +{ + esk_rf_clock(k->p, &k->clocked, k->ev); +} + +/* ---- the lines ------------------------------------------------------------------ */ + +static void lines(struct e32_i2c *k, int scl, int sda) +{ + u32 c = reg(k->ctr); + int force_scl = (c & C_SCL_FORCE) != 0, force_sda = (c & C_SDA_FORCE) != 0; + k->scl_o = scl; + k->sda_o = sda; + esk_esp32_signal(k->s, k->sig_scl, scl, force_scl || !scl); + esk_esp32_signal(k->s, k->sig_sda, sda, force_sda || !sda); +} + +static int scl_in(struct e32_i2c *k) { return esk_esp32_signal_in(k->s, k->sig_scl); } +static int sda_in(struct e32_i2c *k) { return esk_esp32_signal_in(k->s, k->sig_sda); } + +/* ---- the FIFOs ------------------------------------------------------------------- */ + +static void fifo_status(struct e32_i2c *k) +{ + u32 conf = reg(k->fifo_conf), raw = reg(k->raw); + esk_rf_hw(k->sr, (reg(k->sr) & ~(0x3fu << 8 | 0x3fu << 18)) | (k->rcnt & 0x3fu) << 8 | (k->tcnt & 0x3fu) << 18); + esk_rf_hw(k->fifo_st, (k->rrd & 31u) | (k->rwr & 31u) << 5 | (k->trd & 31u) << 10 | (k->twr & 31u) << 15); + if (k->tcnt < ((conf >> 5) & 31u)) + raw |= I_TXFIFO_EMPTY; + if (k->rcnt > (conf & 31u)) + raw |= I_RXFIFO_FULL; + esk_rf_hw(k->raw, raw); + update(k); +} + +static u32 tx_pop(struct e32_i2c *k) +{ + u32 b = k->txram[k->trd & 31u]; + k->trd = (k->trd + 1u) & 31u; + if (k->tcnt) + k->tcnt--; + fifo_status(k); + return b; +} + +static void rx_push(struct e32_i2c *k, u32 b) +{ + if (k->rcnt >= 32u) { + raise(k, I_RXFIFO_OVF); + return; + } + k->rxram[k->rwr & 31u] = (u8)(b & 0xffu); + k->rwr = (k->rwr + 1u) & 31u; + k->rcnt++; + fifo_status(k); +} + +/* ---- the master ------------------------------------------------------------------ */ + +static u32 t_low(const struct e32_i2c *k) { return (reg(k->low) & 0x3fffu) + 1u; } + +static u32 t_high(const struct e32_i2c *k) +{ + u32 f = reg(k->sclf), thres = f & 7u, extra = 7u; + if (f & 8u) + extra = thres <= 2u ? 8u : thres + 6u; + return (reg(k->high) & 0x3fffu) + extra; +} + +static u32 at_least1(u32 v) { return v ? v : 1u; } +static u32 t_hold(const struct e32_i2c *k) { return at_least1(reg(k->hold) & 0x3ffu); } +static u32 t_sample(const struct e32_i2c *k) { return at_least1(reg(k->sample) & 0x3ffu); } + +static void master_idle(struct e32_i2c *k) +{ + k->phase = P_IDLE; + k->ev = 0; + lines(k, 1, 1); +} + +static void cmd_done(struct e32_i2c *k) +{ + if (k->ci < NCMD) + esk_rf_hw(k->comd[k->ci], reg(k->comd[k->ci]) | 1u << 31); +} + +/* a clock pulse from SCL's fall: SDA's level for it after the hold */ +static void begin_pulse(struct e32_i2c *k, int kind, int sda) +{ + u32 hold = t_hold(k), low = t_low(k); + k->kind = kind; + k->sda_next = sda; + k->phase = P_LOW0; + after(k, hold < low ? hold : low - 1u); +} + +static void begin_byte(struct e32_i2c *k) +{ + k->bitn = 0; + sr_set(k, SR_BYTE_TRANS, 0); + if (k->op == OP_WRITE) { + u32 b = tx_pop(k); + if (reg(k->ctr) & C_TX_LSB) /* the bits reversed: still sent from bit 7 */ + b = reverse8(b); + k->byte = b; + begin_pulse(k, K_DOUT, (int)((b >> 7) & 1u)); + } else { + k->byte = 0; + begin_pulse(k, K_DIN, 1); + } +} + +/* the next command, SCL low (or the bus idle for a first START) */ +static void next_command(struct e32_i2c *k) +{ + for (;;) { + u32 c; + if (k->ci >= NCMD) { + k->phase = P_HELD; + k->ev = 0; + return; + } + c = reg(k->comd[k->ci]); + k->cmd = c; + k->op = (int)((c >> 11) & 7u); + k->nbytes = c & 0xffu; + switch (k->op) { + case OP_RSTART: + if (k->phase == P_IDLE || k->phase == P_STOP_HOLD) { + if (!scl_in(k)) { + k->phase = P_WAIT_BUS; + k->ev = 0; + return; + } + k->phase = P_START; + raise(k, I_TRANS_START); + lines(k, 1, 0); + after(k, at_least1(reg(k->sth) & 0x3ffu)); + } else { + begin_pulse(k, K_RS, 1); + } + return; + case OP_WRITE: + case OP_READ: + if (!k->nbytes) { + cmd_done(k); + k->ci++; + continue; + } + begin_byte(k); + return; + case OP_STOP: + begin_pulse(k, K_STOP, 0); + return; + case OP_END: + cmd_done(k); + k->phase = P_HELD; + k->ev = 0; + raise(k, I_END_DETECT); + return; + default: /* not a command: nothing to do */ + cmd_done(k); + k->ci++; + continue; + } + } +} + +/* SCL just fell after a pulse: what comes next */ +static void pulse_done(struct e32_i2c *k) +{ + switch (k->kind) { + case K_DOUT: + if (++k->bitn < 8) { + begin_pulse(k, K_DOUT, (int)((k->byte >> (7 - k->bitn)) & 1u)); + return; + } + begin_pulse(k, K_AIN, 1); + return; + case K_DIN: + if (++k->bitn < 8) { + begin_pulse(k, K_DIN, 1); + return; + } + begin_pulse(k, K_AOUT, (int)((k->cmd >> 10) & 1u)); + return; + case K_AIN: { + int ack = (reg(k->sr) & SR_ACK_REC) != 0; + sr_set(k, SR_BYTE_TRANS, 1); + raise(k, I_MASTER_TRAN_COMP); + if ((k->cmd & (1u << 8)) && ack != (int)((k->cmd >> 9) & 1u)) { + raise(k, I_ACK_ERR); + k->ci = NCMD; /* the commands stop */ + begin_pulse(k, K_STOP, 0); + return; + } + break; + } + case K_AOUT: { + u32 b = k->byte; + if (reg(k->ctr) & C_RX_LSB) + b = reverse8(b); + rx_push(k, b); + sr_set(k, SR_BYTE_TRANS, 1); + raise(k, I_MASTER_TRAN_COMP); + break; + } + case K_RS: + cmd_done(k); + k->ci++; + next_command(k); + return; + default: + return; + } + /* a byte done */ + if (--k->nbytes > 0) { + begin_byte(k); + return; + } + cmd_done(k); + k->ci++; + next_command(k); +} + +/* SCL is high: the high time counts from its rise */ +static void high_begins(struct e32_i2c *k) +{ + u32 s = t_sample(k), h = t_high(k); + k->waiting_to = 0; + switch (k->kind) { + case K_RS: + k->phase = P_RS_SETUP; + after(k, at_least1(reg(k->rss) & 0x3ffu)); + return; + case K_STOP: + k->phase = P_STOP_SETUP; + after(k, at_least1(reg(k->sps) & 0x3ffu)); + return; + default: + k->phase = P_HIGH0; + after(k, s < h ? s : h - 1u); + return; + } +} + +static void master_step(struct e32_i2c *k) +{ + switch (k->phase) { + case P_START: + lines(k, 0, 0); + cmd_done(k); + k->ci++; + next_command(k); + return; + case P_LOW0: + lines(k, 0, k->sda_next); + k->phase = P_LOW1; + after(k, t_low(k) > t_hold(k) ? t_low(k) - t_hold(k) : 1u); + return; + case P_LOW1: + k->phase = P_WAITHI; + k->ev = 0; + lines(k, 1, k->sda_o); + if (k->phase == P_WAITHI && scl_in(k)) { + high_begins(k); + } else if (k->phase == P_WAITHI) { /* SCL held: the timeout */ + k->waiting_to = 1; + after(k, at_least1(reg(k->to) & 0xfffffu)); + } + return; + case P_WAITHI: /* the timeout came first */ + if (k->waiting_to) { + sr_set(k, SR_TIME_OUT, 1); + raise(k, I_TIME_OUT); + master_idle(k); + } + return; + case P_HIGH0: { + int sda = sda_in(k); + u32 h = t_high(k), s = t_sample(k); + if (k->kind == K_DOUT && k->sda_o && !sda) { + sr_set(k, SR_ARB_LOST, 1); + raise(k, I_ARB_LOST); + k->ci = NCMD; + master_idle(k); + return; + } + if (k->kind == K_DIN) + k->byte = k->byte << 1 | (u32)sda; + if (k->kind == K_AIN) + sr_set(k, SR_ACK_REC, sda); + k->phase = P_HIGH1; + after(k, h > s ? h - s : 1u); + return; + } + case P_HIGH1: + lines(k, 0, k->sda_o); + pulse_done(k); + return; + case P_RS_SETUP: + raise(k, I_TRANS_START); + lines(k, 1, 0); + k->phase = P_START; + after(k, at_least1(reg(k->sth) & 0x3ffu)); + return; + case P_STOP_SETUP: + lines(k, 1, 1); + cmd_done(k); + k->phase = P_STOP_HOLD; + after(k, at_least1(reg(k->sph) & 0x3fffu)); + return; + case P_STOP_HOLD: + k->phase = P_IDLE; + k->ev = 0; + return; + default: + return; + } +} + +/* ---- the slave -------------------------------------------------------------------- */ + +/* SDA's next level, SDA_HOLD after SCL fell */ +static void slave_sda(struct e32_i2c *k, int level) +{ + k->spend = 1; + k->spend_sda = level; + after(k, t_hold(k)); +} + +static u32 slave_tx_byte(struct e32_i2c *k) +{ + u32 b = k->txram[k->trd & 31u]; + k->trd = (k->trd + 1u) & 31u; + if (k->tcnt) + k->tcnt--; + fifo_status(k); + return b; +} + +static void slave_rise(struct e32_i2c *k) +{ + int sda = k->sda_i; + switch (k->sstate) { + case S_ADDR: + case S_ADDR2: + case S_RX: + if (k->sbit < 8) { + k->sbyte = k->sbyte << 1 | (u32)sda; + k->sbit++; + } else { + k->sbit = 9; + } + return; + case S_TX: + if (k->sbit < 8) { + k->sbit++; + } else { + k->sbit = 9; + sr_set(k, SR_ACK_REC, sda); + if (sda) /* the master's NACK: the last byte */ + k->sstate = S_WAIT; + } + return; + default: + return; + } +} + +static void slave_fall(struct e32_i2c *k) +{ + u32 sa = reg(k->saddr); + switch (k->sstate) { + case S_ADDR: + if (k->sbit == 8) { + if ((k->sbyte >> 1) != (sa & 0x7fu)) { + k->sstate = S_WAIT; + return; + } + k->srw = (int)(k->sbyte & 1u); + sr_set(k, SR_ADDRESSED, 1); + sr_set(k, SR_SLAVE_RW, k->srw); + k->sfirst = 1; + slave_sda(k, 0); + return; + } + if (k->sbit == 9) { /* after the address's ACK */ + k->sbit = 0; + k->sbyte = 0; + if ((sa & (1u << 31)) && !k->srw) { + k->sstate = S_ADDR2; + slave_sda(k, 1); + return; + } + if (k->srw) { + u32 b = slave_tx_byte(k); + k->sstate = S_TX; + k->sbyte = b; + slave_sda(k, (int)((b >> 7) & 1u)); + } else { + k->sstate = S_RX; + slave_sda(k, 1); + } + } + return; + case S_ADDR2: + if (k->sbit == 8) { + if ((k->sbyte & 0xffu) != ((sa >> 7) & 0xffu)) { + k->sstate = S_WAIT; + return; + } + slave_sda(k, 0); + return; + } + if (k->sbit == 9) { + k->sbit = 0; + k->sbyte = 0; + k->sstate = S_RX; + slave_sda(k, 1); + } + return; + case S_RX: + if (k->sbit == 8) { + u32 b = k->sbyte & 0xffu; + if (reg(k->ctr) & C_RX_LSB) + b = reverse8(b); + if (k->sfirst && (reg(k->fifo_conf) & F_ADDR_CFG)) /* the RAM address */ + k->rwr = k->trd = b & 31u; + else + rx_push(k, b); + k->sfirst = 0; + sr_set(k, SR_BYTE_TRANS, 1); + slave_sda(k, 0); + return; + } + if (k->sbit == 9) { + k->sbit = 0; + k->sbyte = 0; + sr_set(k, SR_BYTE_TRANS, 0); + slave_sda(k, 1); + } + return; + case S_TX: + if (k->sbit < 8) { + slave_sda(k, (int)((k->sbyte >> (7 - k->sbit)) & 1u)); + return; + } + if (k->sbit == 8) { /* the master's ACK: let SDA go */ + sr_set(k, SR_BYTE_TRANS, 1); + slave_sda(k, 1); + return; + } + { /* the next byte */ + u32 b; + k->sbit = 0; + sr_set(k, SR_BYTE_TRANS, 0); + b = slave_tx_byte(k); + k->sbyte = b; + slave_sda(k, (int)((b >> 7) & 1u)); + } + return; + default: + return; + } +} + +static void slave_step(struct e32_i2c *k) +{ + if (k->spend) { + k->spend = 0; + lines(k, 1, k->spend_sda); + } +} + +/* ---- the bus as seen -------------------------------------------------------------- */ + +static void watch(void *ctx) +{ + struct e32_i2c *k = (struct e32_i2c *)ctx; + struct esk_mach *s = k->s; + int scl = scl_in(k), sda = sda_in(k), master = (reg(k->ctr) & C_MS_MODE) != 0; + u64 lag = (u64)s->input_lead + s->output_lag; + if (scl == k->scl_i && sda == k->sda_i) + return; + if (!k->in_step) + now_at(k, s->cycles > lag ? s->cycles - lag : 0); + /* START and STOP: SDA moving while SCL stays high */ + if (scl && k->scl_i && sda != k->sda_i) { + k->sda_i = sda; + if (!sda) { + sr_set(k, SR_BUS_BUSY, 1); + if (!master) { + k->sstate = S_ADDR; + k->sbit = 0; + k->sbyte = 0; + k->spend = 0; + if (k->sda_o == 0 || k->scl_o == 0) + lines(k, 1, 1); + } + } else { /* a STOP */ + sr_set(k, SR_BUS_BUSY, 0); + raise(k, I_TRANS_COMPLETE); + if (!master) { + k->sstate = S_IDLE; + sr_set(k, SR_ADDRESSED, 0); + raise(k, I_SLAVE_TRAN_COMP); + if (k->sda_o == 0) + lines(k, 1, 1); + } + } + } + k->sda_i = sda; + if (scl != k->scl_i) { + k->scl_i = scl; + if (master) { + if (scl && k->phase == P_WAITHI) { + k->ev = 0; + high_begins(k); + } else if (scl && k->phase == P_WAIT_BUS) { + k->phase = P_IDLE; + next_command(k); + } + } else if (scl) { + slave_rise(k); + } else { + slave_fall(k); + } + } + clocking(k); +} + +/* ---- registers ---------------------------------------------------------------------- */ + +static void fsm_reset(struct e32_i2c *k) +{ + k->phase = P_IDLE; + k->ev = 0; + k->sstate = S_IDLE; + k->spend = 0; + k->waiting_to = 0; + lines(k, 1, 1); + k->scl_i = scl_in(k); + k->sda_i = sda_in(k); +} + +static void i2c_tick(void *ctx, u32 cycles) +{ + struct e32_i2c *k = (struct e32_i2c *)ctx; + struct esk_mach *s = k->s; + (void)cycles; + while (k->ev && k->ev_c <= s->cycles) { + k->ev = 0; + k->cur_c = k->ev_c; + k->cur_f = k->ev_f; + s->output_lag = (u32)(s->cycles - k->ev_c); + k->in_step = 1; + if (reg(k->ctr) & C_MS_MODE) + master_step(k); + else + slave_step(k); + k->in_step = 0; + s->output_lag = 0; + } + clocking(k); +} + +static int i2c_next(void *ctx, u32 *cycles) +{ + struct e32_i2c *k = (struct e32_i2c *)ctx; + u64 d; + if (!k->ev) + return 0; + d = k->ev_c > k->s->cycles ? k->ev_c - k->s->cycles : 1u; + *cycles = d > 0xffffffffu ? 0xffffffffu : (u32)d; + return 1; +} + +static u32 i2c_read(void *ctx, u32 off, int n) +{ + struct e32_i2c *k = (struct e32_i2c *)ctx; + if ((off & ~3u) == 0x1Cu) { /* DATA: the RX FIFO */ + u32 b = k->rxram[k->rrd & 31u]; + if (!k->rcnt) + return b; + k->rrd = (k->rrd + 1u) & 31u; + k->rcnt--; + fifo_status(k); + return b; + } + return esk_rf_read(k->p, off, n); +} + +static void i2c_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_i2c *k = (struct e32_i2c *)ctx; + u32 w = off & ~3u, was = reg(k->ctr); + now_at(k, k->s->cycles); + switch (w) { + case 0x1Cu: /* DATA: the TX FIFO */ + if (k->tcnt >= 32u) + return; /* full: the byte is lost */ + k->txram[k->twr & 31u] = (u8)(v & 0xffu); + k->twr = (k->twr + 1u) & 31u; + k->tcnt++; + fifo_status(k); + return; + case 0x24u: /* INT_CLR */ + esk_rf_hw(k->raw, reg(k->raw) & ~v); + fifo_status(k); /* the FIFO levels' interrupts raise again */ + return; + case 0x08u: + case 0x14u: + case 0x2Cu: + return; /* SR, RXFIFO_ST, INT_STATUS */ + default: + break; + } + esk_rf_write(k->p, off, n, v); + if (w == 0x20u || w == 0x28u) + update(k); + if (w == esk_rf_off(k->fifo_conf)) { + if (v & F_TX_RST) + k->twr = k->trd = k->tcnt = 0; + if (v & F_RX_RST) + k->rwr = k->rrd = k->rcnt = 0; + fifo_status(k); + } + if (w == esk_rf_off(k->ctr)) { + u32 c = reg(k->ctr); + if ((c ^ was) & (C_SCL_FORCE | C_SDA_FORCE | C_MS_MODE)) + lines(k, k->scl_o, k->sda_o); + if ((c & C_TRANS_START) && (c & C_MS_MODE) && apb_fs(k) > 0) { + int held = k->phase == P_HELD; + sr_set(k, SR_ARB_LOST | SR_TIME_OUT, 0); + k->ci = 0; + if (held) { /* SCL is low: the next command's pulse from now */ + k->phase = P_LOW0; + next_command(k); + } else if (k->phase == P_IDLE || k->phase == P_STOP_HOLD) { + k->phase = P_IDLE; + next_command(k); + } + } + esk_rf_hw(k->ctr, c & ~C_TRANS_START); /* it clears itself */ + } + clocking(k); +} + +static void i2c_reset(void *ctx) +{ + struct e32_i2c *k = (struct e32_i2c *)ctx; + k->twr = k->trd = k->tcnt = k->rwr = k->rrd = k->rcnt = 0; + k->level = 0; + esk_esp32_source(k->s, k->source, 0); + k->clocked = 0; + fsm_reset(k); + fifo_status(k); + update(k); + clocking(k); +} + +const struct esk_dev_ops esk_esp32_i2c_ops = { + "esp32-i2c", i2c_read, i2c_write, i2c_reset, i2c_tick, i2c_next, +}; + +void *esk_esp32_i2c_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_i2c *k = (struct e32_i2c *)esk_mach_alloc(s, sizeof *k); + static const struct { + size_t at; + const char *name; + } regs[] = { + { offsetof(struct e32_i2c, ctr), "CTR" }, + { offsetof(struct e32_i2c, sr), "SR" }, + { offsetof(struct e32_i2c, to), "TO" }, + { offsetof(struct e32_i2c, saddr), "SLAVE_ADDR" }, + { offsetof(struct e32_i2c, fifo_st), "RXFIFO_ST" }, + { offsetof(struct e32_i2c, fifo_conf), "FIFO_CONF" }, + { offsetof(struct e32_i2c, raw), "INT_RAW" }, + { offsetof(struct e32_i2c, ena), "INT_ENA" }, + { offsetof(struct e32_i2c, st), "INT_STATUS" }, + { offsetof(struct e32_i2c, low), "SCL_LOW_PERIOD" }, + { offsetof(struct e32_i2c, high), "SCL_HIGH_PERIOD" }, + { offsetof(struct e32_i2c, hold), "SDA_HOLD" }, + { offsetof(struct e32_i2c, sample), "SDA_SAMPLE" }, + { offsetof(struct e32_i2c, sth), "SCL_START_HOLD" }, + { offsetof(struct e32_i2c, rss), "SCL_RSTART_SETUP" }, + { offsetof(struct e32_i2c, sph), "SCL_STOP_HOLD" }, + { offsetof(struct e32_i2c, sps), "SCL_STOP_SETUP" }, + { offsetof(struct e32_i2c, sclf), "SCL_FILTER_CFG" }, + }; + char name[24]; + size_t i; + int unit; + if (!k) + return 0; + memset(k, 0, sizeof *k); + k->s = s; + k->p = p; + unit = strcmp(p->name, "I2C1") == 0; + k->source = unit ? 50 : 49; + k->sig_scl = unit ? 95 : 29; + k->sig_sda = unit ? 96 : 30; + for (i = 0; i < sizeof regs / sizeof regs[0]; i++) { + struct esk_rf_reg *r = esk_rf_reg(p, regs[i].name); + if (!r) + return 0; + memcpy((char *)k + regs[i].at, &r, sizeof r); + } + for (i = 0; i < NCMD; i++) { + snprintf(name, sizeof name, "COMD%d", (int)i); + if (!(k->comd[i] = esk_rf_reg(p, name))) + return 0; + } + if (esk_esp32_signal_watch(s, watch, k) != 0) + return 0; + return k; +} diff --git a/core/mcu/esp32/soc/ledc.c b/core/mcu/esp32/soc/ledc.c new file mode 100644 index 000000000..576e4c938 --- /dev/null +++ b/core/mcu/esp32/soc/ledc.c @@ -0,0 +1,500 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* ledc.c -- the ESP32's LED PWM controller (LEDC, TRM v5 chapter 14): + * eight high-speed and eight low-speed channels on four timers each, + * ledc_hs_sig_out0-7 and ledc_ls_sig_out0-7 (signals 71-86 of the GPIO + * matrix). The ESP32-C3's model (mcu/esp32c3/ledc.c) on the ESP32's + * registers. + * + * - A timer counts its clock -- REF_TICK (1 MHz) with TICK_SEL 0; with + * TICK_SEL 1 APB_CLK for the high-speed timers, SLOW_CLK (APB_CLK with + * CONF's APB_CLK_SEL, else the 8 MHz RC_FAST_CLK) for the low-speed ones + * -- divided by DIV_NUM / 256 (10 integer and 8 fractional bits), from + * 0 to 2^DUTY_RES - 1 (up to 20 bits), then overflows; RST holds it at + * 0, PAUSE stops it. A high-speed timer's new DIV_NUM and DUTY_RES + * take effect at its next overflow, a low-speed one's at the overflow + * after PARA_UP. + * - A channel (TIMER_SEL's timer of its group) goes high at its HPOINT + * count and low at HPOINT + DUTY[24:4]; DUTY[3:0] of every 16 periods + * last one count longer; with SIG_OUT_EN 0 it outputs IDLE_LV. Its + * settings take effect at the timer's overflow after DUTY_START (a + * high-speed channel) or the PARA_UP that follows it (a low-speed one). + * - Fading: from DUTY, every DUTY_CYCLE overflows the duty steps + * DUTY_SCALE up (DUTY_INC) or down, DUTY_NUM times, then + * DUTY_CHNG_END. DUTY_R is the duty in use. + * - INT_ST is INT_RAW and INT_ENA (the timers' overflows, bits 0-7; the + * channels' fade ends, 8-23), raising matrix source 43; INT_CLR clears. + * Where it differs inside: a fractional divider's counts are all of the + * average length; the dithered periods are spread by an accumulator. + * Not yet: light sleep, the clock gate's effect on a running timer. */ +#include +#include + +#include "mcu/esp32/soc/esp32.h" + +#define NCH 16 /* HSCH0-7, LSCH0-7 */ +#define NTM 8 /* HSTIMER0-3, LSTIMER0-3 */ +#define SIG_OUT0 71 /* ledc_hs_sig_out0; ledc_ls_sig_out0 is 79 */ +#define RC_FAST_HZ 8000000u +#define REF_TICK_HZ 1000000u +#define FS_PER_S 1000000000000000ull + +#define T_PAUSE (1u << 23) +#define T_RST (1u << 24) +#define T_TICK_SEL (1u << 25) +#define T_PARA_UP (1u << 26) +#define C_SIG_OUT_EN (1u << 2) +#define C_IDLE_LV (1u << 3) +#define C_PARA_UP (1u << 4) +#define F_INC (1u << 30) +#define F_START (1u << 31) + +struct tmr { + struct esk_rf_reg *conf, *value; + u32 res, div; /* in use: DUTY_RES, CLK_DIV */ + int update; /* PARA_UP: the new ones at the next overflow */ + u32 cnt; /* the count */ + u64 pos; /* fs into the period */ +}; + +struct chan { + struct esk_rf_reg *conf0, *hpoint, *duty, *conf1, *duty_r; + int update; /* PARA_UP: the new settings at the next overflow */ + u32 sel, hp, en, idle; /* in use */ + u32 duty_cur; /* the duty (19 bits, 4 of them fractions) */ + u32 lp; /* this period's low point */ + u32 dither; /* the fractions' accumulator */ + int fading; + u32 cyc, steps, ovf; + int out; +}; + +struct e32_ledc { + struct esk_mach *s; + struct esk_rf_periph *p; + struct esk_rf_reg *conf, *raw, *st, *ena; + struct tmr t[NTM]; + struct chan c[NCH]; + int clocked, level, source; +}; + +static u32 reg(const struct esk_rf_reg *r) { return (u32)r->value; } + +static void update(struct e32_ledc *k) +{ + u32 st = reg(k->raw) & reg(k->ena) & 0xffffffu; + int level = st != 0; + esk_rf_hw(k->st, st); + if (level != k->level) { + k->level = level; + esk_esp32_source(k->s, k->source, level); + } +} + +static void raise(struct e32_ledc *k, u32 bits) +{ + esk_rf_hw(k->raw, reg(k->raw) | bits); + update(k); +} + +/* a count's length in fs, or 0 while the timer does not count */ +static double tick_fs(const struct e32_ledc *k, const struct tmr *t) +{ + u32 hz, c = reg(t->conf), x = (u32)(t - k->t); + if ((c & (T_RST | T_PAUSE)) || t->div < 256u) + return 0; + if (!(c & T_TICK_SEL)) + hz = REF_TICK_HZ; + else if (x < 4u || (reg(k->conf) & 1u)) + hz = esk_esp32_apb_hz(k->s); /* high speed: APB_CLK; low speed: SLOW_CLK */ + else + hz = RC_FAST_HZ; + if (!hz) + return 0; + return (double)t->div / 256.0 * (double)FS_PER_S / (double)hz; +} + +static u32 top(const struct tmr *t) { return (1u << (t->res > 20u ? 20u : t->res)) - 1u; } + +static u64 fs_per_cycle(const struct e32_ledc *k) +{ + u32 hz = esk_mach_core_hz(k->s); + return hz ? FS_PER_S / hz : 0; +} + +static void drive(struct e32_ledc *k, int n, int out) +{ + struct chan *c = &k->c[n]; + if (out != c->out) { + c->out = out; + esk_esp32_signal(k->s, SIG_OUT0 + n, out, 1); + } +} + +/* the channel's settings as written, in use from now */ +static void chan_apply(struct e32_ledc *k, int n) +{ + struct chan *c = &k->c[n]; + u32 c0 = reg(c->conf0); + c->sel = (c0 & 3u) + (n >= 8 ? 4u : 0u); /* its group's timer */ + c->hp = reg(c->hpoint) & 0xfffffu; + c->en = (c0 & C_SIG_OUT_EN) != 0; + c->idle = (c0 & C_IDLE_LV) != 0; + c->update = 0; + if (!c->en) + drive(k, n, (int)c->idle); +} + +/* the low point of the period starting: HPOINT + the duty, a count longer + * in DUTY[3:0] periods of 16 */ +static void period_start(struct e32_ledc *k, int n) +{ + struct chan *c = &k->c[n]; + u32 frac = c->duty_cur & 0xfu, d = c->duty_cur >> 4; + c->dither += frac; + if (c->dither >= 16u) { + c->dither -= 16u; + d++; + } + c->lp = c->hp + d; + esk_rf_hw(c->duty_r, c->duty_cur); +} + +/* the timer overflowed: what waits for it */ +static void overflow(struct e32_ledc *k, int x) +{ + struct tmr *t = &k->t[x]; + int n; + if (t->update) { + t->res = reg(t->conf) & 0x1fu; + t->div = (reg(t->conf) >> 5) & 0x3ffffu; + t->update = 0; + } + raise(k, 1u << x); + for (n = 0; n < NCH; n++) { + struct chan *c = &k->c[n]; + u32 c1; + if (c->sel != (u32)x) + continue; + if (c->update) + chan_apply(k, n); + c1 = reg(c->conf1); + if (c->fading) { + u32 every = (c1 >> 10) & 0x3ffu; + if (++c->cyc >= (every ? every : 1u)) { + u32 num = (c1 >> 20) & 0x3ffu, scale = (c1 & 0x3ffu) << 4; + c->cyc = 0; + if (c->steps < num) { + if (c1 & F_INC) + c->duty_cur = c->duty_cur + scale > 0x1ffffffu ? 0x1ffffffu : c->duty_cur + scale; + else + c->duty_cur = c->duty_cur > scale ? c->duty_cur - scale : 0; + c->steps++; + } + if (c->steps >= num) { + c->fading = 0; + raise(k, 1u << (8 + n)); + } + } + } + if (c->sel == (u32)x) + period_start(k, n); + } +} + +/* the timer entered count `cnt`: the outputs that switch there */ +static void at_count(struct e32_ledc *k, int x) +{ + struct tmr *t = &k->t[x]; + int n; + for (n = 0; n < NCH; n++) { + struct chan *c = &k->c[n]; + if (c->sel != (u32)x || !c->en) + continue; + if (t->cnt == c->hp && c->lp != c->hp) + drive(k, n, 1); + if (t->cnt == c->lp) + drive(k, n, 0); + } +} + +/* the next count after the present one where something happens: an output + * switching or the overflow (top + 1) */ +static u32 next_count(const struct e32_ledc *k, int x) +{ + const struct tmr *t = &k->t[x]; + u32 best = top(t) + 1u; + int n; + for (n = 0; n < NCH; n++) { + const struct chan *c = &k->c[n]; + if (c->sel != (u32)x || !c->en) + continue; + if (c->hp > t->cnt && c->hp < best) + best = c->hp; + if (c->lp > t->cnt && c->lp < best) + best = c->lp; + } + return best; +} + +/* fs from the present to the timer's next event, or 0 when it stands */ +static u64 due(const struct e32_ledc *k, int x) +{ + const struct tmr *t = &k->t[x]; + double tf = tick_fs(k, t); + u64 at; + if (tf <= 0) + return 0; + at = (u64)((double)next_count(k, x) * tf + 0.5); + return at > t->pos ? at - t->pos : 1u; +} + +static void clocking(struct e32_ledc *k) +{ + int x, on = 0; + for (x = 0; x < NTM; x++) + if (tick_fs(k, &k->t[x]) > 0) + on = 1; + esk_rf_clock(k->p, &k->clocked, on); +} + +static void advance(struct e32_ledc *k, u64 budget) +{ + struct esk_mach *s = k->s; + u64 fpc = fs_per_cycle(k); + int x; + if (!fpc) + return; + for (;;) { + u64 d = 0; + int which = -1; + for (x = 0; x < NTM; x++) { + u64 dx = due(k, x); + if (dx && (which < 0 || dx < d)) { + d = dx; + which = x; + } + } + if (which < 0 || d > budget) { + for (x = 0; x < NTM; x++) { + struct tmr *t = &k->t[x]; + double tf = tick_fs(k, t); + if (tf <= 0) + continue; + t->pos += budget; + t->cnt = (u32)((double)t->pos / tf); + if (t->cnt > top(t)) + t->cnt = top(t); + } + break; + } + budget -= d; + s->output_lag = (u32)(budget / fpc); + for (x = 0; x < NTM; x++) { + struct tmr *t = &k->t[x]; + double tf = tick_fs(k, t); + if (tf <= 0) + continue; + if (x == which) { + u32 c = next_count(k, x); + t->pos += d; + if (c > top(t)) { + t->pos = 0; + t->cnt = 0; + overflow(k, x); + } else { + t->cnt = c; + } + at_count(k, x); + } else { + t->pos += d; + t->cnt = (u32)((double)t->pos / tf); + } + } + s->output_lag = 0; + } + for (x = 0; x < NTM; x++) + esk_rf_hw(k->t[x].value, k->t[x].cnt & 0xfffffu); +} + +static void ledc_tick(void *ctx, u32 cycles) +{ + struct e32_ledc *k = (struct e32_ledc *)ctx; + advance(k, (u64)cycles * fs_per_cycle(k)); +} + +static int ledc_next(void *ctx, u32 *cycles) +{ + struct e32_ledc *k = (struct e32_ledc *)ctx; + u64 fpc = fs_per_cycle(k), best = 0; + int x, any = 0; + if (!fpc) + return 0; + for (x = 0; x < NTM; x++) { + u64 d = due(k, x), c; + if (!d) + continue; + c = (d + fpc - 1u) / fpc; + if (!any || c < best) + best = c; + any = 1; + } + if (!any) + return 0; + *cycles = best == 0 ? 1u : best > 0xffffffffu ? 0xffffffffu : (u32)best; + return 1; +} + +static u32 ledc_read(void *ctx, u32 off, int n) +{ + struct e32_ledc *k = (struct e32_ledc *)ctx; + return esk_rf_read(k->p, off, n); +} + +/* the timer starts counting (out of RST): its generators' first period */ +static void timer_starts(struct e32_ledc *k, int x) +{ + int n; + for (n = 0; n < NCH; n++) + if (k->c[n].sel == (u32)x) + period_start(k, n); + at_count(k, x); +} + +static void ledc_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_ledc *k = (struct e32_ledc *)ctx; + u32 w = off & ~3u, held[NTM]; + int i; + for (i = 0; i < NTM; i++) + held[i] = reg(k->t[i].conf) & T_RST; + if (w == 0x18Cu) { /* INT_CLR */ + esk_rf_hw(k->raw, reg(k->raw) & ~v); + update(k); + return; + } + if (w == 0x184u) + return; /* INT_ST */ + esk_rf_write(k->p, off, n, v); + if (w == 0x180u || w == 0x188u) + update(k); + for (i = 0; i < NTM; i++) { + struct tmr *t = &k->t[i]; + if (w != esk_rf_off(t->conf)) + continue; + if (reg(t->conf) & T_RST) { + t->cnt = 0; + t->pos = 0; + } + if (i < 4 || (v & T_PARA_UP)) + t->update = 1; /* a high-speed timer's settings: at its next overflow */ + if (!t->div && !t->res) /* never set: the first settings at once */ + t->update = 1; + if (t->update && (reg(t->conf) & T_RST)) { /* held: nothing to wait for */ + t->res = reg(t->conf) & 0x1fu; + t->div = (reg(t->conf) >> 5) & 0x3ffffu; + t->update = 0; + } + if (held[i] && !(reg(t->conf) & T_RST)) + timer_starts(k, i); + } + for (i = 0; i < NCH; i++) { + struct chan *c = &k->c[i]; + /* a high-speed channel takes DUTY_START (CONF1), a low-speed one + * its PARA_UP (CONF0) after it */ + if (!(i < 8 ? w == esk_rf_off(c->conf1) && (v & F_START) : w == esk_rf_off(c->conf0) && (v & C_PARA_UP))) + continue; + { + u32 c1 = reg(c->conf1); + c->update = 1; + c->duty_cur = reg(c->duty) & 0x1ffffffu; /* the fade's start, at once */ + c->fading = (c1 & F_START) != 0; + c->cyc = 0; + c->steps = 0; + esk_rf_hw(c->duty_r, c->duty_cur); + if (tick_fs(k, &k->t[c->sel]) <= 0) { /* no overflow coming: now */ + chan_apply(k, i); + period_start(k, i); + } + } + } + clocking(k); +} + +static void ledc_reset(void *ctx) +{ + struct e32_ledc *k = (struct e32_ledc *)ctx; + int i; + for (i = 0; i < NTM; i++) { + struct tmr *t = &k->t[i]; + t->res = reg(t->conf) & 0x1fu; + t->div = (reg(t->conf) >> 5) & 0x3ffffu; + t->update = 0; + t->cnt = 0; + t->pos = 0; + } + for (i = 0; i < NCH; i++) { + struct chan *c = &k->c[i]; + c->update = 0; + c->duty_cur = 0; + c->lp = 0; + c->dither = 0; + c->fading = 0; + c->cyc = c->steps = c->ovf = 0; + c->out = -1; + chan_apply(k, i); + drive(k, i, (int)c->idle); + } + k->level = 0; + esk_esp32_source(k->s, k->source, 0); + k->clocked = 0; + update(k); + clocking(k); +} + +const struct esk_dev_ops esk_esp32_ledc_ops = { + "esp32-ledc", ledc_read, ledc_write, ledc_reset, ledc_tick, ledc_next, +}; + +void *esk_esp32_ledc_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_ledc *k = (struct e32_ledc *)esk_mach_alloc(s, sizeof *k); + char name[24]; + int i; + if (!k) + return 0; + memset(k, 0, sizeof *k); + k->s = s; + k->p = p; + k->conf = esk_rf_reg(p, "CONF"); + k->raw = esk_rf_reg(p, "INT_RAW"); + k->st = esk_rf_reg(p, "INT_ST"); + k->ena = esk_rf_reg(p, "INT_ENA"); + if (!k->conf || !k->raw || !k->st || !k->ena) + return 0; + k->source = esk_rf_irq(p, "LEDC"); + for (i = 0; i < NTM; i++) { + snprintf(name, sizeof name, "%sTIMER%d_CONF", i < 4 ? "HS" : "LS", i % 4); + k->t[i].conf = esk_rf_reg(p, name); + snprintf(name, sizeof name, "%sTIMER%d_VALUE", i < 4 ? "HS" : "LS", i % 4); + k->t[i].value = esk_rf_reg(p, name); + if (!k->t[i].conf || !k->t[i].value) + return 0; + } + for (i = 0; i < NCH; i++) { + struct chan *c = &k->c[i]; + snprintf(name, sizeof name, "%sCH%d_CONF0", i < 8 ? "HS" : "LS", i % 8); + c->conf0 = esk_rf_reg(p, name); + snprintf(name, sizeof name, "%sCH%d_HPOINT", i < 8 ? "HS" : "LS", i % 8); + c->hpoint = esk_rf_reg(p, name); + snprintf(name, sizeof name, "%sCH%d_DUTY", i < 8 ? "HS" : "LS", i % 8); + c->duty = esk_rf_reg(p, name); + snprintf(name, sizeof name, "%sCH%d_CONF1", i < 8 ? "HS" : "LS", i % 8); + c->conf1 = esk_rf_reg(p, name); + snprintf(name, sizeof name, "%sCH%d_DUTY_R", i < 8 ? "HS" : "LS", i % 8); + c->duty_r = esk_rf_reg(p, name); + if (!c->conf0 || !c->hpoint || !c->duty || !c->conf1 || !c->duty_r) + return 0; + } + return k; +} diff --git a/core/mcu/esp32/soc/misc.c b/core/mcu/esp32/soc/misc.c new file mode 100644 index 000000000..18cd14be0 --- /dev/null +++ b/core/mcu/esp32/soc/misc.c @@ -0,0 +1,93 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* misc.c -- what the ESP32 answers outside its register description: + * + * - the random number generator's RNG_DATA (TRM v5 chapter 26) at + * 0x3FF75144: every read a new 32-bit number. The chip's numbers come + * from the noise of its RF and SAR ADC circuits; the model's from a + * generator (xorshift64* seeded by the chip's MAC), the same sequence + * every run so a run replays, another for each chip; + * - the peripherals' AHB view (TRM 3.1.4): 0x60000000-0x6003FFFF reaches + * the same registers as 0x3FF40000-0x3FF7FFFF (ESP-IDF reads UART FIFOs + * there). Inside, the access is passed to the bus at the DPORT address. */ +#include "mcu/esp32/soc/esp32.h" + +#define RNG_DATA 0x3FF75144u +#define AHB_BASE 0x60000000u +#define AHB_SIZE 0x40000u +#define DPORT_VIEW 0x3FF40000u + +struct e32_rng { + struct esk_mach *s; + u64 state; + int seeded; +}; + +static u32 rng_next(struct e32_rng *k) +{ + if (!k->seeded) { + int i; + k->seeded = 1; + if (k->s->has_factory_mac) + for (i = 0; i < 6; i++) + k->state = (k->state ^ k->s->factory_mac[i]) * 0x100000001B3ull; + if (!k->state) + k->state = 1; + } + k->state ^= k->state >> 12; + k->state ^= k->state << 25; + k->state ^= k->state >> 27; + return (u32)((k->state * 0x2545F4914F6CDD1Dull) >> 32); +} + +static u32 rng_read(void *ctx, u32 off, int n) +{ + ES_UNUSED(n); + return rng_next((struct e32_rng *)ctx) >> (8 * (off & 3u)); +} + +static void rng_write(void *ctx, u32 off, int n, u32 v) +{ + ES_UNUSED(ctx); + ES_UNUSED(off); + ES_UNUSED(n); + ES_UNUSED(v); +} + +const struct esk_dev_ops esk_esp32_rng_ops = { + "esp32-rng", rng_read, rng_write, 0, 0, 0, +}; + +static u32 ahb_read(void *ctx, u32 off, int n) +{ + struct esk_mach *s = (struct esk_mach *)ctx; + u32 v = 0; + if (esk_bus_read(&s->bus, DPORT_VIEW + off, n, &v)) + esk_bus_fault(&s->bus); + return v; +} + +static void ahb_write(void *ctx, u32 off, int n, u32 v) +{ + struct esk_mach *s = (struct esk_mach *)ctx; + if (esk_bus_write(&s->bus, DPORT_VIEW + off, n, v)) + esk_bus_fault(&s->bus); +} + +static const struct esk_dev_ops ahb_ops = { + "esp32-ahb", ahb_read, ahb_write, 0, 0, 0, +}; + +/* the RNG and the AHB view: 0, or -1 */ +int esk_esp32_misc_add(struct esk_mach *s) +{ + struct e32_rng *k = (struct e32_rng *)esk_mach_alloc(s, sizeof *k); + if (!k) + return -1; + k->s = s; + k->state = 0x456D6253696D0032ull; + if (esk_mach_add_dev(s, RNG_DATA, 4, &esk_esp32_rng_ops, k) != ES_OK || + esk_mach_add_dev(s, AHB_BASE, AHB_SIZE, &ahb_ops, s) != ES_OK) + return -1; + return 0; +} diff --git a/core/mcu/esp32/soc/nor.c b/core/mcu/esp32/soc/nor.c new file mode 100644 index 000000000..dee39cc21 --- /dev/null +++ b/core/mcu/esp32/soc/nor.c @@ -0,0 +1,365 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* nor.c -- the module's 4 MB SPI flash: a Giantec GT25Q32A-U (datasheet + * V2.5, section 9; JEDEC ID C4 60 16, the ID esptool reads on the owner's + * ESP32 board, docs/engineering/esp32-giantec-profile.md), what SPI0 and + * SPI1 (spi.c) see of it. Its bytes are the description's `flash` store, + * which keeps them through every reset. The instruction set is the + * ESP32-C3's XMC model's (mcu/esp32c3/nor.c), which the GT25Q32A shares: + * - Write Enable (06h), Volatile SR Write Enable (50h), Write Disable + * (04h); Read Status Register-1, -2, -3 (05h, 35h, 15h); Write Status + * Register-1 (01h, and -2 after it), -2 (31h), -3 (11h); + * - Read Data (03h), Fast Read (0Bh), Dual Output (3Bh), Quad Output + * (6Bh), Dual I/O (BBh), Quad I/O (EBh), Word Read Quad I/O (E7h): the + * quad ones need QE (S9); + * - Page Program (02h), Quad Page Program (32h), Sector Erase (20h), + * Block Erase (52h, D8h), Chip Erase (C7h, 60h), each needing WEL; + * - the three Security Registers (44h, 42h, 48h), Suspend (75h) and + * Resume (7Ah), Power-down (B9h) and Release (ABh: device ID 15h), + * Manufacturer/Device ID (90h: C4h 15h), JEDEC ID (9Fh: C4 60 16), + * Unique ID (4Bh), Enable Reset and Reset (66h, 99h). + * Busy times are the datasheet's maximums as the owner's profile records + * them (a one-byte program 150 us, a page 1.5 ms, a 4, 32 or 64 KB erase + * 8 ms, the chip 16 ms; a status write taken as an erase's), counted on the + * machine's clock. It ships with QE clear: a QIO image's bootloader sets + * it (bootloader_enable_qio_mode), as on the part. + * Not yet: QPI mode, burst wrap, the continuous read mode, SFDP (5Ah + * answers FFh), the block protection bits (kept, protecting nothing). */ +#include + +#include "mcu/esp32/soc/esp32.h" + +#define PAGE 256u +#define NOR_DEVICE_ID 0x15u +#define T_W_PS 8000000000ull /* 8 ms */ +#define T_BP_PS 150000000ull /* 150 us: a one-byte program */ +#define T_PP_PS 1500000000ull /* 1.5 ms */ +#define T_SE_PS 8000000000ull /* 8 ms */ +#define T_BE1_PS 8000000000ull /* 8 ms */ +#define T_BE2_PS 8000000000ull /* 8 ms */ +#define T_CE_PS 16000000000ull /* 16 ms */ + +#define SR1_BUSY 0x01u +#define SR1_WEL 0x02u +#define SR2_QE 0x02u +#define SR2_LB_SHIFT 3 +#define SR2_SUS 0x80u + +static const u8 unique_id[8] = { 0x45, 0x6d, 0x62, 0x53, 0x69, 0x6d, 0x00, 0x03 }; + +struct esk_esp32_nor { + struct esk_mach *m; + struct esk_store *st; + u8 sr[3]; /* the status registers as read */ + u8 sr_nv[3]; /* their non-volatile values */ + int vwe; /* 50h: the next status write is volatile */ + int pd, udpd; /* power-down, ultra-deep power-down */ + int reset_en; /* 66h was the last instruction */ + u64 now_ps, last_cycles; + u64 busy_end; /* the self-timed operation ends then (ps) */ + u64 sus_left; /* a suspended operation's remaining time */ + u8 sec[3][256]; +}; + +static u64 now_ps(struct esk_esp32_nor *f) +{ + u32 hz = esk_mach_core_hz(f->m); + u64 dc = f->m->cycles - f->last_cycles; + f->last_cycles = f->m->cycles; + if (hz) + f->now_ps += (u64)((double)dc * 1e12 / (double)hz); + return f->now_ps; +} + +static void sr_clear(struct esk_esp32_nor *f, int k, u32 bits) +{ + f->sr[k] = (u8)(f->sr[k] & ~bits); +} +static void sr_set(struct esk_esp32_nor *f, int k, u32 bits) +{ + f->sr[k] = (u8)(f->sr[k] | bits); +} + +static int busy(struct esk_esp32_nor *f) +{ + if ((f->sr[0] & SR1_BUSY) && now_ps(f) >= f->busy_end) { + sr_clear(f, 0, SR1_BUSY | SR1_WEL); + } + return (f->sr[0] & SR1_BUSY) != 0; +} + +static void start(struct esk_esp32_nor *f, u64 ps) +{ + sr_set(f, 0, SR1_BUSY); + f->busy_end = now_ps(f) + ps; +} + +static u32 addr24(const u8 *tx, int n) +{ + u32 a = 0; + int i; + for (i = 1; i <= 3; i++) + a = a << 8 | (i < n ? tx[i] : 0xffu); + return a; +} + +static void program(struct esk_esp32_nor *f, u32 a, const u8 *d, int n) +{ + u32 page = a & ~(PAGE - 1u), off = a & (PAGE - 1u); + int i; + for (i = 0; i < n; i++) { + u32 x = (page + ((off + (u32)i) & (PAGE - 1u))) % f->st->size; + f->st->mem[x] = (u8)(f->st->mem[x] & d[i]); + } + esk_esp32_flash_written(f->m, page % f->st->size, PAGE); +} + +static void erase(struct esk_esp32_nor *f, u32 a, u32 size) +{ + u32 base = (a & ~(size - 1u)) % f->st->size; + memset(f->st->mem + base, 0xff, size); + esk_esp32_flash_written(f->m, base, size); +} + +/* the security register an address names (0x1000, 0x2000, 0x3000), or -1 */ +static int sec_reg(u32 a) +{ + u32 r = a >> 12; + return (a >> 16) == 0 && (a & 0xf00u) == 0 && r >= 1 && r <= 3 ? (int)r - 1 : -1; +} + +static void write_sr(struct esk_esp32_nor *f, int k, u8 v) +{ + static const u8 writable[3] = { 0xfc, 0x7b, 0xe4 }; + u8 w = writable[k]; + if (k == 1) { + /* LB3-1 are one-time programmable: once set they stay */ + v = (u8)(v | (f->sr[1] & (7u << SR2_LB_SHIFT))); + } + f->sr[k] = (u8)((f->sr[k] & ~w) | (v & w)); + if (!f->vwe) + f->sr_nv[k] = (u8)((f->sr_nv[k] & ~w) | (v & w)); +} + +static void reset_device(struct esk_esp32_nor *f) +{ + memcpy(f->sr, f->sr_nv, sizeof f->sr); + sr_clear(f, 0, SR1_BUSY | SR1_WEL); + sr_clear(f, 1, SR2_SUS); + f->sus_left = 0; + f->vwe = 0; +} + +static int is_read_status(u8 op) +{ + return op == 0x05 || op == 0x35 || op == 0x15; +} + +void esk_esp32_nor_xfer(struct esk_esp32_nor *f, const u8 *tx, int ntx, u8 *rx, int nrx) +{ + u8 op; + u32 a; + int i, qe, sr; + memset(rx, 0xff, (size_t)nrx); + if (f->udpd) { + f->udpd = 0; /* any /CS pulse brings it out (7.2.40) */ + return; + } + if (ntx < 1) + return; + op = tx[0]; + if (f->pd) { + if (op == 0x79 && !busy(f)) { + f->udpd = 1; + return; + } + if (op != 0xab) + return; + } + if (busy(f) && !is_read_status(op) && op != 0x75 && op != 0x66 && op != 0x99) + return; + if (op != 0x99) + f->reset_en = op == 0x66; + qe = (f->sr[1] & SR2_QE) != 0; + a = addr24(tx, ntx); + switch (op) { + case 0x06: /* write enable */ + sr_set(f, 0, SR1_WEL); + f->vwe = 0; + break; + case 0x50: + f->vwe = 1; + break; + case 0x04: + sr_clear(f, 0, SR1_WEL); + f->vwe = 0; + break; + case 0x05: + case 0x35: + case 0x15: + sr = op == 0x05 ? 0 : op == 0x35 ? 1 : 2; + busy(f); + for (i = 0; i < nrx; i++) + rx[i] = f->sr[sr]; + break; + case 0x01: + case 0x31: + case 0x11: + if (!f->vwe && !(f->sr[0] & SR1_WEL)) + break; + if (ntx < 2) + break; + sr = op == 0x01 ? 0 : op == 0x31 ? 1 : 2; + write_sr(f, sr, tx[1]); + if (op == 0x01 && ntx >= 3) + write_sr(f, 1, tx[2]); + if (f->vwe) + f->vwe = 0; + else + start(f, T_W_PS); /* WEL clears as the cycle ends */ + break; + case 0x6b: + case 0xeb: + case 0xe7: + if (!qe) + break; + /* fall through */ + case 0x03: + case 0x0b: + case 0x3b: + case 0xbb: + for (i = 0; i < nrx; i++) + rx[i] = f->st->mem[(a + (u32)i) % f->st->size]; + break; + case 0x32: + if (!qe) + break; + /* fall through */ + case 0x02: + if (!(f->sr[0] & SR1_WEL) || ntx < 5) + break; + program(f, a, tx + 4, ntx - 4); + start(f, ntx - 4 == 1 ? T_BP_PS : T_PP_PS); + break; + case 0x20: + case 0x52: + case 0xd8: + if (!(f->sr[0] & SR1_WEL) || ntx < 4) + break; + erase(f, a, op == 0x20 ? 4096u : op == 0x52 ? 32768u : 65536u); + start(f, op == 0x20 ? T_SE_PS : op == 0x52 ? T_BE1_PS : T_BE2_PS); + break; + case 0xc7: + case 0x60: + if (!(f->sr[0] & SR1_WEL)) + break; + erase(f, 0, f->st->size); + start(f, T_CE_PS); + break; + case 0x44: + case 0x42: + sr = sec_reg(a); + if (!(f->sr[0] & SR1_WEL) || ntx < 4 || sr < 0 || ((f->sr[1] >> (SR2_LB_SHIFT + sr)) & 1)) { + sr_clear(f, 0, SR1_WEL); + break; + } + if (op == 0x44) { + memset(f->sec[sr], 0xff, 256); + start(f, T_SE_PS); + } else { + for (i = 4; i < ntx; i++) + f->sec[sr][(a + (u32)(i - 4)) & 0xffu] = + (u8)(f->sec[sr][(a + (u32)(i - 4)) & 0xffu] & tx[i]); + start(f, T_PP_PS); + } + break; + case 0x48: + sr = sec_reg(a); + for (i = 0; sr >= 0 && i < nrx; i++) + rx[i] = (u8)((a & 0xffu) + (u32)i < 256u ? f->sec[sr][(a & 0xffu) + (u32)i] : 0xffu); + break; + case 0x75: /* suspend */ + if (busy(f)) { + f->sus_left = f->busy_end - now_ps(f); + sr_clear(f, 0, SR1_BUSY); + sr_set(f, 1, SR2_SUS); + } + break; + case 0x7a: /* resume */ + if (f->sr[1] & SR2_SUS) { + sr_clear(f, 1, SR2_SUS); + start(f, f->sus_left); + f->sus_left = 0; + } + break; + case 0xb9: + f->pd = 1; + break; + case 0xab: + /* the ID after three dummy bytes, repeated: sent as an address or + * counted as dummy clocks, the bytes read are the ID */ + f->pd = 0; + for (i = 0; i < nrx; i++) + rx[i] = NOR_DEVICE_ID; + break; + case 0x90: + case 0x92: + case 0x94: + if (op == 0x94 && !qe) + break; + for (i = 0; i < nrx; i++) + rx[i] = (u8)(((u32)i & 1u) == (a & 1u) ? 0xC4u : NOR_DEVICE_ID); + break; + case 0x9f: + for (i = 0; i < nrx && i < 3; i++) + rx[i] = (u8)(0xC46016u >> (16 - 8 * i)); + break; + case 0x4b: + for (i = 0; i < nrx && i < 8; i++) + rx[i] = unique_id[i]; + break; + case 0x99: + if (f->reset_en) + reset_device(f); + f->reset_en = 0; + break; + default: + break; + } +} + +int esk_esp32_nor_busy(struct esk_esp32_nor *f) +{ + return busy(f); +} + +struct esk_esp32_nor *esk_esp32_nor_create(struct esk_mach *m) +{ + struct esk_esp32_nor *f; + struct esk_store *st = esk_mach_store(m, "flash"); + if (!st || st->size == 0 || (st->size & (st->size - 1u))) + return 0; + f = (struct esk_esp32_nor *)esk_mach_alloc(m, sizeof *f); + if (!f) + return 0; + memset(f, 0, sizeof *f); + f->m = m; + f->st = st; + /* as shipped: no protection, QE 0 (the "G" ordering code), driver + * strength 25% (DRV1-0 = 11b), /HOLD (HOLD/RST 0) */ + f->sr_nv[2] = 0x60; + memcpy(f->sr, f->sr_nv, sizeof f->sr); + memset(f->sec, 0xff, sizeof f->sec); + f->last_cycles = m->cycles; + return f; +} + +/* a power-on: the volatile state from the non-volatile bits (the array, the + * status registers' non-volatile bits and the security registers stay) */ +void esk_esp32_nor_power_on(struct esk_esp32_nor *f) +{ + reset_device(f); + f->pd = f->udpd = f->reset_en = 0; + sr_clear(f, 0, SR1_BUSY | SR1_WEL); + f->last_cycles = f->m->cycles; +} diff --git a/core/mcu/esp32/soc/regi2c.c b/core/mcu/esp32/soc/regi2c.c new file mode 100644 index 000000000..93368e859 --- /dev/null +++ b/core/mcu/esp32/soc/regi2c.c @@ -0,0 +1,100 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* regi2c.c -- the ESP32's internal I2C master to its analog blocks, at + * 0x3FF4E000 (0x6000E000 on the AHB view, where the ROM reaches it): the + * bus over which the BBPLL, the APLL, the bias and the regulators are set + * up. The TRM does not describe it; what is modelled is what the boot + * ROM's rom_chip_i2c_readReg and rom_chip_i2c_writeReg (0x40004110, + * 0x40004168) do with it -- the routines ESP-IDF reaches through + * esp_rom_regi2c_* -- and the registers ESP-IDF's soc/regi2c_*.h name. + * The ESP32-C3's model (mcu/esp32c3/regi2c.c) has the same protocol. + * + * - Host n's control register (+4n, n 0-7): the block's address in bits + * 7:0, the register's in 15:8, the data in 23:16, bit 24 for a write, + * bit 25 busy. A write of it reads or writes the block's register at + * once: busy reads 0, and a read's byte is in bits 23:16. + * - ANA_CONFIG (+0x44, ESP-IDF's ANA_CONFIG_REG: the blocks' I2C enables, + * I2C_BBPLL bit 17, I2C_APLL bit 14) and the words up to +0xFFC: kept as + * written. + * - The blocks keep their registers through every reset but a chip's + * (power-on, CHIP_PU): they are analog, outside the digital system. + * Not yet: the registers' reset values (a block's registers read 0 until + * written), the transfers' time, and what the values do (the PLL's + * frequency comes from DPORT's CPU_PER_CONF and RTC_CNTL's SOC_CLK_SEL, + * the regulators' voltages are not modelled). */ +#include + +#include "mcu/esp32/soc/esp32.h" + +#define REGI2C_BASE 0x3FF4E000u +#define REGI2C_SIZE 0x1000u +#define NBLOCKS 16 /* the blocks' addresses are 0x60 to 0x6F */ + +struct e32_regi2c { + struct esk_mach *s; + u32 word[REGI2C_SIZE / 4u]; + u8 reg[NBLOCKS][256]; +}; + +static u8 *block_reg(struct e32_regi2c *k, u32 block, u32 r) +{ + if (block < 0x60u || block >= 0x60u + NBLOCKS) + return 0; + return &k->reg[block - 0x60u][r & 0xffu]; +} + +static void transfer(struct e32_regi2c *k, u32 w, u32 v) +{ + u32 block = v & 0xffu, r = (v >> 8) & 0xffu, data = (v >> 16) & 0xffu; + u8 *p = block_reg(k, block, r); + if (v & 1u << 24) { + if (p) + *p = (u8)data; + k->word[w / 4u] = v & ~(1u << 25); + } else { + data = p ? *p : 0; + k->word[w / 4u] = (v & ~(0xffu << 16 | 1u << 25)) | data << 16; + } +} + +static u32 ri_read(void *ctx, u32 off, int n) +{ + struct e32_regi2c *k = (struct e32_regi2c *)ctx; + ES_UNUSED(n); + return k->word[(off & ~3u) / 4u] >> (8u * (off & 3u)); +} + +static void ri_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_regi2c *k = (struct e32_regi2c *)ctx; + u32 w = off & ~3u, sh = 8u * (off & 3u); + u32 mask = (n >= 4 ? 0xffffffffu : ((1u << (8 * n)) - 1u)) << sh; + v = (k->word[w / 4u] & ~mask) | (v << sh & mask); + if (w < 0x20u) + transfer(k, w, v); + else + k->word[w / 4u] = v; +} + +static void ri_reset(void *ctx) +{ + struct e32_regi2c *k = (struct e32_regi2c *)ctx; + if (k->s->reset_cause == ESK_RESET_POWER || k->s->reset_cause == ESK_RESET_PIN) { + memset(k->word, 0, sizeof k->word); + memset(k->reg, 0, sizeof k->reg); + } + memset(k->word, 0, 0x20u); /* the hosts are idle */ +} + +static const struct esk_dev_ops regi2c_ops = { + "esp32-regi2c", ri_read, ri_write, ri_reset, 0, 0, +}; + +int esk_esp32_regi2c_add(struct esk_mach *s) +{ + struct e32_regi2c *k = (struct e32_regi2c *)esk_mach_alloc(s, sizeof *k); + if (!k) + return -1; + k->s = s; + return esk_mach_add_dev(s, REGI2C_BASE, REGI2C_SIZE, ®i2c_ops, k) == ES_OK ? 0 : -1; +} diff --git a/core/mcu/esp32/soc/rmt.c b/core/mcu/esp32/soc/rmt.c new file mode 100644 index 000000000..99472863f --- /dev/null +++ b/core/mcu/esp32/soc/rmt.c @@ -0,0 +1,679 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* rmt.c -- the ESP32's remote control peripheral (RMT, TRM v5 chapter 15): + * eight channels, each a transmitter or a receiver (rmt_sig_out0-7, + * signals 87-94 of the GPIO matrix; rmt_sig_in0-7, 83-90), sharing a + * 512 x 32-bit RAM at +0x800, 64 words to a block; matrix source 47. The + * ESP32-C3's model (mcu/esp32c3/rmt.c) on the ESP32's registers. + * + * - A word holds two entries, the low half first: bits 14:0 a period in + * the channel's clock, bit 15 the level; a period of 0 ends the data. + * The channel's clock is APB_CLK (CONF1's REF_ALWAYS_ON 1) or + * REF_TICK's 1 MHz (0), divided by CONF0's DIV_CNT (0 is 256). The + * settings act as written (the ESP32 has no CONF_UPDATE). + * - Channel n uses MEM_SIZE blocks from its own (block n). The CPU + * reaches the RAM at its addresses or, with APB_CONF's APB_FIFO_MASK 0, + * through CHnDATA: a write appends to the channel's memory, a read takes + * its next word; APB_MEM_RST rewinds it (CHnADDR). + * - TX_START sends from the start of the channel's memory: each entry's + * level for its period. An end marker stops it (CHn_TX_END) and leaves + * the output at IDLE_OUT_LV when IDLE_OUT_EN is set, else at the + * marker's level. Past the end of its memory it goes on from the start + * with APB_CONF's MEM_TX_WRAP_EN, else stops with CHn_ERR. Every TX_LIM + * words sent raise CHn_TX_THR_EVENT. In continuous mode (TX_CONTI_MODE) + * an end marker, or the end of the memory, starts the data again. + * - The carrier (CARRIER_EN): while the channel sends the level + * CARRIER_OUT_LV, the output is CARRIER_DUTY's HIGH source-clock cycles + * high and LOW low, from the start of each such stretch. + * - RX_EN starts a receiver: from the input's first edge it writes each + * level and its length in the channel's clock; a level longer than + * IDLE_THRES ends it with an end marker (period 0, the idle level) and + * CHn_RX_END. With RX_FILTER_EN a pulse shorter than RX_FILTER_THRES + * APB_CLK cycles is dropped. At the end of its memory a receiver stops + * with CHn_ERR and MEM_FULL. A receiver whose memory the CPU owns + * (MEM_OWNER 0) writes nothing and sets MEM_OWNER_ERR. + * - CHnSTATUS: MEM_WADDR_EX and MEM_RADDR_EX the RAM's word addresses + * (ESP-IDF counts what a receiver wrote from the first), MEM_FULL, + * MEM_OWNER_ERR. + * - INT_ST is INT_RAW and INT_ENA, raising the source; INT_CLR clears. + * Where it differs inside: the edges are timed from the start of each + * transmission, not from a free-running divider (REF_CNT_RST has nothing + * to reset), and a carrier restarts with each stretch it modulates; the + * receiver's filter does not delay what it passes. Not yet: the memory's + * power-down (MEM_PD), STATUS's STATE and the APB-side error bits, the + * clock gate's effect on a running channel. */ +#include +#include + +#include "mcu/esp32/soc/esp32.h" + +#define SOURCE 47 +#define NCH 8 +#define NWORDS 512 +#define BLOCK 64 +#define SIG_OUT0 87 +#define SIG_IN0 83 +#define REF_TICK_HZ 1000000u +#define FS_PER_S 1000000000000000ull + +/* CONF0 */ +#define CARRIER_EN (1u << 28) +#define CARRIER_LV (1u << 29) +/* CONF1 */ +#define TX_START (1u << 0) +#define RX_EN (1u << 1) +#define MEM_WR_RST (1u << 2) +#define MEM_RD_RST (1u << 3) +#define APB_MEM_RST (1u << 4) +#define MEM_OWNER (1u << 5) +#define TX_CONTI (1u << 6) +#define FILTER_EN (1u << 7) +#define REF_ALWAYS_ON (1u << 17) +#define IDLE_LV (1u << 18) +#define IDLE_EN (1u << 19) +/* APB_CONF */ +#define FIFO_MASK (1u << 0) +#define TX_WRAP (1u << 1) +/* INT_RAW */ +#define I_TX_END(n) (1u << (3 * (n))) +#define I_RX_END(n) (1u << (3 * (n) + 1)) +#define I_ERR(n) (1u << (3 * (n) + 2)) +#define I_TX_THR(n) (1u << (24 + (n))) + +struct ch { + struct esk_rf_reg *conf0, *conf1, *status, *addr, *duty, *lim; + /* transmitting */ + int busy; + u32 e; /* the entry being sent, from the channel's first */ + u64 left; /* fs until the entry's end */ + int level; /* the data's level (while idle: the idle output's) */ + int out; /* the output */ + int carrying; /* the carrier modulates the output now */ + int cphase; /* the carrier's high half */ + u64 cleft; /* fs until the carrier's next edge */ + u32 sent; + /* receiving */ + int on, active, raw, full; + int c_level, p_level; /* the level written next, the input's since p_t */ + u64 c_t, p_t; /* their starts, in core cycles */ + u32 wr; /* entries written, from the channel's first */ + u32 apb; /* CHnDATA's word, from the channel's first */ +}; + +struct e32_rmt { + struct esk_mach *s; + struct esk_rf_periph *p; + struct esk_rf_reg *apb_conf, *raw, *st, *ena, *ram[NWORDS]; + struct ch ch[NCH]; + int clocked, level; +}; + +static u32 reg(const struct esk_rf_reg *r) { return (u32)r->value; } + +static void update(struct e32_rmt *k) +{ + u32 st = reg(k->raw) & reg(k->ena); + int level = st != 0; + esk_rf_hw(k->st, st); + if (level != k->level) { + k->level = level; + esk_esp32_source(k->s, SOURCE, level); + } +} + +static void raise(struct e32_rmt *k, u32 bits) +{ + esk_rf_hw(k->raw, reg(k->raw) | bits); + update(k); +} + +/* the channel's source clock period in fs: APB_CLK or REF_TICK */ +static double src_fs(const struct e32_rmt *k, const struct ch *c) +{ + u32 hz = (reg(c->conf1) & REF_ALWAYS_ON) ? esk_esp32_apb_hz(k->s) : REF_TICK_HZ; + return hz ? (double)FS_PER_S / (double)hz : 0; +} + +/* the channel clock's period in fs: DIV_CNT source cycles */ +static double tick_fs(const struct e32_rmt *k, const struct ch *c) +{ + u32 div = reg(c->conf0) & 0xffu; + return (div ? (double)div : 256.0) * src_fs(k, c); +} + +static u64 fs_per_cycle(const struct e32_rmt *k) +{ + u32 hz = esk_mach_core_hz(k->s); + return hz ? FS_PER_S / hz : 0; +} + +static u64 fs_of(double fs) { return fs <= 0 ? 0 : (u64)(fs + 0.5); } + +static u32 mem_size(const struct ch *c) +{ + u32 n = (reg(c->conf0) >> 24) & 15u; + return n ? n : 1u; +} + +static u32 entry(const struct e32_rmt *k, int n, u32 e) +{ + u32 w = (u32)BLOCK * (u32)n + e / 2u, v; + if (w >= NWORDS) + return 0; + v = reg(k->ram[w]); + return e & 1u ? v >> 16 : v & 0xffffu; +} + +static void status(struct e32_rmt *k, int n) +{ + struct ch *c = &k->ch[n]; + u32 raddr = (u32)BLOCK * (u32)n + c->e / 2u, waddr = (u32)BLOCK * (u32)n + (c->wr + 1u) / 2u; + u32 v = (waddr & 0x3ffu) | (raddr & 0x3ffu) << 12; + if (c->full) + v |= 1u << 28; + if (c->on && c->active && !(reg(c->conf1) & MEM_OWNER)) + v |= 1u << 27; + esk_rf_hw(c->status, v); + esk_rf_hw(c->addr, 0x3FF56800u + 4u * ((u32)BLOCK * (u32)n + c->apb)); +} + +/* ---- transmitting ------------------------------------------------------------ */ + +static void tx_drive(struct e32_rmt *k, int n) +{ + struct ch *c = &k->ch[n]; + int out = c->carrying ? c->cphase : c->level; + if (out != c->out) { + c->out = out; + esk_esp32_signal(k->s, SIG_OUT0 + n, out, 1); + } +} + +static u32 duty_half(const struct ch *c, int high) +{ + u32 v = high ? reg(c->duty) >> 16 : reg(c->duty) & 0xffffu; + return v ? v : 1u; +} + +/* the carrier for the output's present level: on (from its high half) or off */ +static void tx_carrier(struct e32_rmt *k, int n) +{ + struct ch *c = &k->ch[n]; + u32 c0 = reg(c->conf0); + int want = (c0 & CARRIER_EN) && c->busy && c->level == ((c0 & CARRIER_LV) != 0) && src_fs(k, c) > 0; + if (want && !c->carrying) { + c->carrying = 1; + c->cphase = 1; + c->cleft = fs_of((double)duty_half(c, 1) * src_fs(k, c)); + } else if (!want) { + c->carrying = 0; + } +} + +static void tx_idle(struct e32_rmt *k, int n, int marker_level) +{ + struct ch *c = &k->ch[n]; + u32 c1 = reg(c->conf1); + c->busy = 0; + c->level = (c1 & IDLE_EN) ? (c1 & IDLE_LV) != 0 : marker_level; + tx_carrier(k, n); + tx_drive(k, n); + status(k, n); +} + +/* the entry at c->e, after the one before ended: its level and period, or + * what an end marker or the memory's end does */ +static void tx_load(struct e32_rmt *k, int n) +{ + struct ch *c = &k->ch[n]; + u32 total = 2u * (u32)BLOCK * mem_size(c); + int restarts = 0; + for (;;) { + u32 v, period; + if (c->e >= total) { + if ((reg(k->apb_conf) & TX_WRAP) || (reg(c->conf1) & TX_CONTI)) { + c->e = 0; + } else { + raise(k, I_ERR(n)); + tx_idle(k, n, c->level); + return; + } + } + v = entry(k, n, c->e); + period = v & 0x7fffu; + if (period) { + c->level = (v >> 15) & 1u; + c->left = fs_of((double)period * tick_fs(k, c)); + if (!c->left) + c->left = 1; + tx_carrier(k, n); + tx_drive(k, n); + status(k, n); + return; + } + /* an end marker */ + if (!(reg(c->conf1) & TX_CONTI)) { + raise(k, I_TX_END(n)); + tx_idle(k, n, (int)((v >> 15) & 1u)); + return; + } + if (c->e == 0 || ++restarts > 1) { /* nothing but markers: nothing to send */ + raise(k, I_ERR(n)); + tx_idle(k, n, c->level); + return; + } + c->e = 0; + } +} + +static void tx_start(struct e32_rmt *k, int n) +{ + struct ch *c = &k->ch[n]; + if (src_fs(k, c) <= 0) + return; + c->busy = 1; + c->e = 0; + c->sent = 0; + c->carrying = 0; + tx_load(k, n); +} + +/* the entry ended: on to the next */ +static void tx_next(struct e32_rmt *k, int n) +{ + struct ch *c = &k->ch[n]; + c->e++; + if (!(c->e & 1u)) { /* a word sent */ + u32 lim = reg(c->lim) & 0x1ffu; + if (lim && ++c->sent >= lim) { + c->sent = 0; + raise(k, I_TX_THR(n)); + } + } + tx_load(k, n); +} + +/* ---- receiving ---------------------------------------------------------------- */ + +/* one entry into the memory: level and period */ +static void rx_write(struct e32_rmt *k, int n, int level, u32 period) +{ + struct ch *c = &k->ch[n]; + u32 total = 2u * (u32)BLOCK * mem_size(c), w; + if (c->full) + return; + if (!(reg(c->conf1) & MEM_OWNER)) { /* the CPU's: MEM_OWNER_ERR */ + status(k, n); + return; + } + if (c->wr >= total) { + c->full = 1; + c->active = 0; + raise(k, I_ERR(n)); + status(k, n); + return; + } + w = (u32)BLOCK * (u32)n + c->wr / 2u; + if (w < NWORDS) { + struct esk_rf_reg *cell = k->ram[w]; + u32 half = (period & 0x7fffu) | (u32)(level != 0) << 15; + esk_rf_hw(cell, c->wr & 1u ? (reg(cell) & 0xffffu) | half << 16 : (reg(cell) & 0xffff0000u) | half); + } + c->wr++; + status(k, n); +} + +static u32 rx_ticks(const struct e32_rmt *k, const struct ch *c, u64 cycles) +{ + double tf = tick_fs(k, c), t; + if (tf <= 0) + return 0; + t = (double)cycles * (double)fs_per_cycle(k) / tf + 0.5; + return t > 32767.0 ? 32767u : (u32)t; +} + +/* the receiver's idle threshold in core cycles */ +static u64 rx_idle_cycles(const struct e32_rmt *k, const struct ch *c) +{ + u64 fpc = fs_per_cycle(k); + double thres = (double)((reg(c->conf0) >> 8) & 0xffffu); + if (!fpc) + return 0; + return (u64)(thres * tick_fs(k, c) / (double)fpc) + 1u; +} + +/* a pulse from `from` to `to` (cycles) the filter drops */ +static int rx_drops(const struct e32_rmt *k, const struct ch *c, u64 from, u64 to) +{ + u32 apb = esk_esp32_apb_hz(k->s); + double len = (double)(to - from) * (double)fs_per_cycle(k); + return (reg(c->conf1) & FILTER_EN) && apb && + len < (double)((reg(c->conf1) >> 8) & 0xffu) * (double)FS_PER_S / (double)apb; +} + +static void rx_end(struct e32_rmt *k, int n) +{ + struct ch *c = &k->ch[n]; + if (c->p_level != c->c_level) { /* the last change held: it counts */ + rx_write(k, n, c->c_level, rx_ticks(k, c, c->p_t - c->c_t)); + c->c_level = c->p_level; + c->c_t = c->p_t; + } + rx_write(k, n, c->c_level, 0); + c->active = 0; + raise(k, I_RX_END(n)); + status(k, n); +} + +static void clocking(struct e32_rmt *k); + +/* the inputs changed: each receiver's edge at the time the change came */ +static void rx_watch(void *ctx) +{ + struct e32_rmt *k = (struct e32_rmt *)ctx; + struct esk_mach *s = k->s; + u64 lag = (u64)s->input_lead + s->output_lag, t = s->cycles > lag ? s->cycles - lag : 0; + int n; + for (n = 0; n < NCH; n++) { + struct ch *c = &k->ch[n]; + int level; + if (!c->on) + continue; + level = esk_esp32_signal_in(s, SIG_IN0 + n); + if (level == c->raw) + continue; + c->raw = level; + if (c->full) + continue; + if (!c->active) { /* the first edge starts it */ + c->active = 1; + c->c_level = c->p_level = level; + c->c_t = c->p_t = t; + status(k, n); + continue; + } + if (c->p_level != c->c_level) { + if (rx_drops(k, c, c->p_t, t)) { /* back as it was */ + c->p_level = c->c_level; + continue; + } + rx_write(k, n, c->c_level, rx_ticks(k, c, c->p_t - c->c_t)); + if (!c->active) + continue; + c->c_level = c->p_level; + c->c_t = c->p_t; + } + c->p_level = level; + c->p_t = t; + } + clocking(k); +} + +/* ---- time --------------------------------------------------------------------- */ + +static void clocking(struct e32_rmt *k) +{ + int n, on = 0; + for (n = 0; n < NCH; n++) + if (k->ch[n].busy || k->ch[n].carrying || k->ch[n].active) + on = 1; + esk_rf_clock(k->p, &k->clocked, on); +} + +/* fs until the channel's next edge, or 0 for none */ +static u64 tx_due(const struct ch *c) +{ + u64 d = 0; + if (c->busy) + d = c->left; + if (c->carrying && (!d || c->cleft < d)) + d = c->cleft; + return d; +} + +static void rmt_tick(void *ctx, u32 cycles) +{ + struct e32_rmt *k = (struct e32_rmt *)ctx; + struct esk_mach *s = k->s; + u64 fpc = fs_per_cycle(k), budget = (u64)cycles * fpc; + int n; + if (!fpc) + return; + for (;;) { + u64 d = 0; + for (n = 0; n < NCH; n++) { + u64 x = tx_due(&k->ch[n]); + if (x && (!d || x < d)) + d = x; + } + if (!d || d > budget) { + for (n = 0; n < NCH; n++) { + struct ch *c = &k->ch[n]; + if (c->busy) + c->left -= budget < c->left ? budget : c->left; + if (c->carrying) + c->cleft -= budget < c->cleft ? budget : c->cleft; + } + break; + } + budget -= d; + /* the edges switch at their time: this many cycles before now */ + s->output_lag = (u32)(budget / fpc); + for (n = 0; n < NCH; n++) { + struct ch *c = &k->ch[n]; + int ended = c->busy && c->left == d; + if (c->busy) + c->left -= d; + if (c->carrying) { + c->cleft -= d; + if (!c->cleft) { + c->cphase = !c->cphase; + c->cleft = fs_of((double)duty_half(c, c->cphase) * src_fs(k, c)); + if (!c->cleft) + c->cleft = 1; + if (!ended) + tx_drive(k, n); + } + } + if (ended) + tx_next(k, n); + } + s->output_lag = 0; + } + for (n = 0; n < NCH; n++) { + struct ch *c = &k->ch[n]; + u64 last = c->p_t > c->c_t ? c->p_t : c->c_t; + if (c->active && s->cycles >= last + rx_idle_cycles(k, c)) + rx_end(k, n); + } + clocking(k); +} + +static int rmt_next(void *ctx, u32 *cycles) +{ + struct e32_rmt *k = (struct e32_rmt *)ctx; + u64 fpc = fs_per_cycle(k), best = 0; + int n, any = 0; + if (!fpc) + return 0; + for (n = 0; n < NCH; n++) { + struct ch *c = &k->ch[n]; + u64 d = tx_due(c); + if (d) { + u64 x = (d + fpc - 1u) / fpc; + if (!any || x < best) + best = x; + any = 1; + } + if (c->active) { + u64 last = c->p_t > c->c_t ? c->p_t : c->c_t, at = last + rx_idle_cycles(k, c); + at = at > k->s->cycles ? at - k->s->cycles : 1u; + if (!any || at < best) + best = at; + any = 1; + } + } + if (!any) + return 0; + *cycles = best == 0 ? 1u : best > 0xffffffffu ? 0xffffffffu : (u32)best; + return 1; +} + +/* ---- registers ---------------------------------------------------------------- */ + +static u32 rmt_read(void *ctx, u32 off, int n) +{ + struct e32_rmt *k = (struct e32_rmt *)ctx; + u32 w = off & ~3u; + if (w < 0x20u && !(reg(k->apb_conf) & FIFO_MASK)) { /* CHnDATA: the channel's next word */ + int i = (int)(w / 4u); + struct ch *c = &k->ch[i]; + u32 at = (u32)BLOCK * (u32)i + c->apb, v = at < NWORDS ? reg(k->ram[at]) : 0; + if (!k->s->bus.debug) { + c->apb = (c->apb + 1u) % ((u32)BLOCK * mem_size(c)); + status(k, i); + } + return v >> (8u * (off & 3u)); + } + return esk_rf_read(k->p, off, n); +} + +static void conf1_write(struct e32_rmt *k, int n, u32 v, u32 was) +{ + struct ch *c = &k->ch[n]; + if (v & MEM_RD_RST) + c->e = 0; + if (v & APB_MEM_RST) + c->apb = 0; + if (v & MEM_WR_RST) { + c->wr = 0; + c->full = 0; + } + if ((v & RX_EN) && !(was & RX_EN)) { + c->on = 1; + c->active = 0; + c->full = 0; + c->raw = esk_esp32_signal_in(k->s, SIG_IN0 + n); + } else if (!(v & RX_EN)) { + c->on = 0; + c->active = 0; + } + if (!c->busy) /* the idle output as now configured */ + tx_idle(k, n, c->level); + if (v & TX_START) { + esk_rf_hw(c->conf1, reg(c->conf1) & ~TX_START); /* it clears itself */ + tx_start(k, n); + } + status(k, n); +} + +static void rmt_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_rmt *k = (struct e32_rmt *)ctx; + u32 w = off & ~3u; + int i; + if (w < 0x20u) { /* CHnDATA */ + if (!(reg(k->apb_conf) & FIFO_MASK)) { + struct ch *c = &k->ch[w / 4u]; + u32 at = (u32)BLOCK * (w / 4u) + c->apb; + if (at < NWORDS) + esk_rf_hw(k->ram[at], v); + c->apb = (c->apb + 1u) % ((u32)BLOCK * mem_size(c)); + status(k, (int)(w / 4u)); + } + return; + } + if (w == 0xACu) { /* INT_CLR */ + esk_rf_hw(k->raw, reg(k->raw) & ~v); + update(k); + return; + } + if ((w >= 0x60u && w < 0xA8u)) + return; /* STATUS, ADDR, INT_RAW and INT_ST are read-only */ + { + u32 was[NCH]; + for (i = 0; i < NCH; i++) + was[i] = reg(k->ch[i].conf1); + esk_rf_write(k->p, off, n, v); + if (w == 0xA8u) /* INT_ENA */ + update(k); + for (i = 0; i < NCH; i++) + if (w == esk_rf_off(k->ch[i].conf1)) + conf1_write(k, i, reg(k->ch[i].conf1), was[i]); + } + clocking(k); +} + +static void rmt_reset(void *ctx) +{ + struct e32_rmt *k = (struct e32_rmt *)ctx; + int i; + for (i = 0; i < NCH; i++) { + struct ch *c = &k->ch[i]; + struct ch keep = *c; + memset(c, 0, sizeof *c); + c->conf0 = keep.conf0; + c->conf1 = keep.conf1; + c->status = keep.status; + c->addr = keep.addr; + c->duty = keep.duty; + c->lim = keep.lim; + c->out = -1; + } + k->level = 0; + esk_esp32_source(k->s, SOURCE, 0); + k->clocked = 0; + for (i = 0; i < NCH; i++) { + tx_idle(k, i, 0); + k->ch[i].raw = esk_esp32_signal_in(k->s, SIG_IN0 + i); + } + update(k); + clocking(k); +} + +const struct esk_dev_ops esk_esp32_rmt_ops = { + "esp32-rmt", rmt_read, rmt_write, rmt_reset, rmt_tick, rmt_next, +}; + +void *esk_esp32_rmt_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_rmt *k = (struct e32_rmt *)esk_mach_alloc(s, sizeof *k); + char name[24]; + int i; + if (!k) + return 0; + memset(k, 0, sizeof *k); + k->s = s; + k->p = p; + k->apb_conf = esk_rf_reg(p, "APB_CONF"); + k->raw = esk_rf_reg(p, "INT_RAW"); + k->st = esk_rf_reg(p, "INT_ST"); + k->ena = esk_rf_reg(p, "INT_ENA"); + if (!k->apb_conf || !k->raw || !k->st || !k->ena) + return 0; + for (i = 0; i < NCH; i++) { + struct ch *c = &k->ch[i]; + snprintf(name, sizeof name, "CH%dCONF0", i); + c->conf0 = esk_rf_reg(p, name); + snprintf(name, sizeof name, "CH%dCONF1", i); + c->conf1 = esk_rf_reg(p, name); + snprintf(name, sizeof name, "CH%dSTATUS", i); + c->status = esk_rf_reg(p, name); + snprintf(name, sizeof name, "CH%dADDR", i); + c->addr = esk_rf_reg(p, name); + snprintf(name, sizeof name, "CH%dCARRIER_DUTY", i); + c->duty = esk_rf_reg(p, name); + snprintf(name, sizeof name, "CH%d_TX_LIM", i); + c->lim = esk_rf_reg(p, name); + if (!c->conf0 || !c->conf1 || !c->status || !c->addr || !c->duty || !c->lim) + return 0; + } + for (i = 0; i < NWORDS; i++) { + snprintf(name, sizeof name, "RAM%d", i); + if (!(k->ram[i] = esk_rf_reg(p, name))) + return 0; + } + if (esk_esp32_signal_watch(s, rx_watch, k) != 0) + return 0; + return k; +} diff --git a/core/mcu/esp32/soc/rtc.c b/core/mcu/esp32/soc/rtc.c new file mode 100644 index 000000000..021337b7f --- /dev/null +++ b/core/mcu/esp32/soc/rtc.c @@ -0,0 +1,398 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* rtc.c -- the ESP32's RTC_CNTL (TRM v5 chapters 31 and 32): the reset + * causes, the RTC timer, the RTC watchdog (RWDT), the software resets and + * stalls, the clock selection the CPU's clock follows, the store + * registers and the RTC interrupts. + * + * - RESET_STATE's RESET_CAUSE_PROCPU and RESET_CAUSE_APPCPU report each + * CPU's last reset by the TRM's code: 1 POWERON for a chip reset + * (power-on, CHIP_PU), 3 SW_RESET (OPTIONS0.SW_SYS_RST), 12 SW_CPU + * (SW_PROCPU_RST, SW_APPCPU_RST), 9, 13 and 16 the RWDT's system, CPU + * and RTC resets, 7 and 8 the timer groups' watchdogs + * (esk_esp32_reset); the APP_CPU reports 14 (EXT_CPU) while it was + * held by the PRO_CPU (DPORT); + * - the RTC domain keeps its registers through CPU and system resets + * and loses them in a chip or RTC reset; a CPU reset restarts that CPU + * alone (esk_lx6_core_restart); + * - the RTC timer counts RTC_SLOW_CLK (CLK_CONF's ANA_CLK_RTC_SEL: the + * 150 kHz RC oscillator, the 32.768 kHz crystal, 8MD256) from the chip's + * reset; a write of TIME_UPDATE's bit 31 latches it in TIME0 and TIME1 + * and sets TIME_VALID; SLP_TIMER0/1 with MAIN_TIMER_ALARM_EN raise + * MAIN_TIMER when it reaches them; + * - the RWDT counts RTC_SLOW_CLK through four stages (WDT_STGn_HOLD); + * each stage's action is off, an interrupt (WDT), a CPU, system or RTC + * reset; WDT_EN runs it, and so does WDT_FLASHBOOT_MOD_EN (set at a + * chip reset) with stage 0 an RTC reset; WDTFEED returns it to stage + * 0; WDTCONFIG0-4 and WDTFEED take writes only while WDT_WKEY holds + * 0x50D83AA1; + * - a CPU stalls while its SW_STALL_*CPU_C1 (SW_CPU_STALL) is 0x21 and + * its C0 (OPTIONS0) 2; + * - INT_RAW, INT_ST = INT_RAW & INT_ENA, INT_CLR, and the matrix source + * RTC_CORE (46). + * Not modelled: sleep and wake-up (light and deep sleep, the power + * domains, the ULP coprocessor), brown-out, the slow clocks' error (the + * RC oscillator is exactly 150 kHz), the reset pulse widths + * (WDT_*_RESET_LENGTH), STAT_VECTOR_SEL (the cores always start at the + * ROM). */ +#include + +#include "mcu/esp32/soc/esp32.h" +#include "mcu/xtensa/lx6.h" + +#define RC_SLOW_HZ 150000.0 +#define RC_FAST_HZ 8000000.0 +#define WDT_KEY 0x50D83AA1u +#define CFG0_FLASHBOOT (1u << 10) +#define CFG0_EN (1u << 31) +#define INT_WDT (1u << 3) +#define INT_MAIN_TIMER (1u << 8) +#define OPT0_SW_APPCPU_RST (1u << 4) +#define OPT0_SW_PROCPU_RST (1u << 5) +#define OPT0_SW_SYS_RST (1u << 31) + +#define OPTIONS0 0x00u +#define SLP_TIMER0 0x04u +#define SLP_TIMER1 0x08u +#define TIME_UPDATE 0x0Cu +#define TIME0 0x10u +#define TIME1 0x14u +#define RESET_STATE 0x34u +#define INT_ENA 0x3Cu +#define INT_RAW 0x40u +#define INT_ST 0x44u +#define INT_CLR 0x48u +#define CLK_CONF 0x70u +#define WDTCONFIG0 0x8Cu +#define WDTFEED 0xA0u +#define WDTWPROTECT 0xA4u +#define SW_CPU_STALL 0xACu + +enum { ACT_OFF, ACT_INT, ACT_CPU, ACT_SYSTEM, ACT_RTC }; + +struct e32_rtc { + struct esk_mach *s; + struct esk_rf_periph *p; + int code[2]; /* the cause each CPU's next reset reports */ + int level; /* the RTC_CORE source */ + int clocked; + u64 slow, base_cycles; + double frac; + int stage; + u64 wdt_from; +}; + +static struct e32_rtc *rtc_of(struct esk_mach *m) +{ + return m->rf ? (struct e32_rtc *)esk_rf_ctx_of(m->rf, &esk_esp32_rtc_ops) : 0; +} + +static u32 reg(struct e32_rtc *k, u32 off) +{ + struct esk_rf_reg *r = esk_rf_reg_at(k->p, off); + return r ? (u32)r->value : 0; +} + +static void hw(struct e32_rtc *k, u32 off, u32 v) +{ + struct esk_rf_reg *r = esk_rf_reg_at(k->p, off); + if (r) + esk_rf_hw(r, v); +} + +static double slow_hz(struct e32_rtc *k) +{ + switch ((reg(k, CLK_CONF) >> 30) & 3u) { + case 1: + return k->s->lse_hz ? (double)k->s->lse_hz : 32768.0; + case 2: + return RC_FAST_HZ / 256.0; + default: + return RC_SLOW_HZ; + } +} + +u32 esk_esp32_rtc_soc_clk_sel(struct esk_mach *m) +{ + struct e32_rtc *k = rtc_of(m); + return k ? (reg(k, CLK_CONF) >> 27) & 3u : 0; +} + +double esk_esp32_rtc_slow_hz(struct esk_mach *m) +{ + struct e32_rtc *k = rtc_of(m); + return k ? slow_hz(k) : RC_SLOW_HZ; +} + +static void sync(struct e32_rtc *k) +{ + u64 now = k->s->cycles; + double t; + if (now <= k->base_cycles) { + k->base_cycles = now; + return; + } + t = (double)(now - k->base_cycles) * slow_hz(k) / (double)esk_mach_core_hz(k->s) + k->frac; + k->slow += (u64)t; + k->frac = t - (double)(u64)t; + k->base_cycles = now; +} + +static u64 cycles_to(struct e32_rtc *k, u64 n) +{ + double c = ((double)n - k->frac) * (double)esk_mach_core_hz(k->s) / slow_hz(k); + return c <= 1.0 ? 1u : (u64)c + 1u; +} + +static int wdt_on(struct e32_rtc *k) +{ + return (reg(k, WDTCONFIG0) & (CFG0_EN | CFG0_FLASHBOOT)) != 0; +} + +static int stage_action(struct e32_rtc *k, int stage) +{ + u32 c = reg(k, WDTCONFIG0); + if (stage == 0 && (c & CFG0_FLASHBOOT)) + return ACT_RTC; /* flash boot protection */ + return (int)((c >> (28 - 3 * stage)) & 7u); +} + +static u64 stage_hold(struct e32_rtc *k, int stage) +{ + u64 h = reg(k, WDTCONFIG0 + 4u * (u32)(stage + 1)); + return h ? h : 1; +} + +static void update(struct e32_rtc *k) +{ + u32 st = reg(k, INT_RAW) & reg(k, INT_ENA); + hw(k, INT_ST, st); + if ((st != 0) != k->level) { + k->level = st != 0; + esk_esp32_source(k->s, esk_rf_irq(k->p, "RTC_CORE"), k->level); + } +} + +static void clocking(struct e32_rtc *k) +{ + int on = wdt_on(k) || (reg(k, SLP_TIMER1) & (1u << 16)); + esk_rf_clock(k->p, &k->clocked, on); +} + +static void expire(struct e32_rtc *k) +{ + int guard = 4; + if (reg(k, SLP_TIMER1) & (1u << 16)) { + u64 alarm = (u64)reg(k, SLP_TIMER0) | (u64)(reg(k, SLP_TIMER1) & 0xffffu) << 32; + if ((k->slow & 0xffffffffffffull) >= alarm) { + hw(k, INT_RAW, reg(k, INT_RAW) | INT_MAIN_TIMER); + hw(k, SLP_TIMER1, reg(k, SLP_TIMER1) & ~(1u << 16)); + } + } + while (wdt_on(k) && k->slow - k->wdt_from >= stage_hold(k, k->stage) && guard--) { + int act = stage_action(k, k->stage); + k->wdt_from += stage_hold(k, k->stage); + k->stage = (k->stage + 1) & 3; + if (act == ACT_INT) { + hw(k, INT_RAW, reg(k, INT_RAW) | INT_WDT); + } else if (act == ACT_CPU) { + esk_esp32_cpu_reset(k->s, 0, 13); + esk_esp32_cpu_reset(k->s, 1, 13); + break; + } else if (act == ACT_SYSTEM) { + esk_esp32_reset(k->s, 9); + break; + } else if (act == ACT_RTC) { + esk_esp32_reset(k->s, 16); + break; + } + } + update(k); + clocking(k); +} + +static void stalls(struct e32_rtc *k) +{ + u32 o = reg(k, OPTIONS0), c1 = reg(k, SW_CPU_STALL); + esk_lx6_core_stall(k->s, 0, 2, ((o >> 2) & 3u) == 2u && ((c1 >> 26) & 0x3fu) == 0x21u); + esk_lx6_core_stall(k->s, 1, 2, (o & 3u) == 2u && ((c1 >> 20) & 0x3fu) == 0x21u); +} + +static u32 rt_read(void *ctx, u32 off, int n) +{ + struct e32_rtc *k = (struct e32_rtc *)ctx; + sync(k); + return esk_rf_read(k->p, off, n); +} + +static void rt_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_rtc *k = (struct e32_rtc *)ctx; + int keyed = reg(k, WDTWPROTECT) == WDT_KEY; + sync(k); + if (off == WDTFEED) { + if (keyed && (v & (1u << 31))) { + k->stage = 0; + k->wdt_from = k->slow; + } + return; + } + if (off >= WDTCONFIG0 && off <= WDTCONFIG0 + 16u && !keyed) + return; + if (off == INT_CLR) { + hw(k, INT_RAW, reg(k, INT_RAW) & ~v); + update(k); + return; + } + if (off == INT_RAW || off == INT_ST) + return; + if (off == WDTCONFIG0) { + u32 was = reg(k, WDTCONFIG0); + esk_rf_write(k->p, off, n, v); + if (!(was & (CFG0_EN | CFG0_FLASHBOOT)) && wdt_on(k)) { + k->stage = 0; + k->wdt_from = k->slow; + } + } else { + esk_rf_write(k->p, off, n, v); + } + if (off == TIME_UPDATE && (v & (1u << 31))) { + u64 t = k->slow & 0xffffffffffffull; + hw(k, TIME0, (u32)t); + hw(k, TIME1, (u32)(t >> 32)); + hw(k, TIME_UPDATE, (reg(k, TIME_UPDATE) & ~(1u << 31)) | (1u << 30)); + } + if (off == CLK_CONF) + k->s->yield = 1; /* SOC_CLK_SEL: the CPU's clock (apbctrl.c) */ + if (off == OPTIONS0 || off == SW_CPU_STALL) + stalls(k); + if (off == OPTIONS0) { + u32 o = reg(k, OPTIONS0); + hw(k, OPTIONS0, o & ~(OPT0_SW_SYS_RST | OPT0_SW_PROCPU_RST | OPT0_SW_APPCPU_RST)); + if (v & OPT0_SW_SYS_RST) { + esk_esp32_reset(k->s, 3); + return; + } + if (v & OPT0_SW_APPCPU_RST) + esk_esp32_cpu_reset(k->s, 1, 12); + if (v & OPT0_SW_PROCPU_RST) + esk_esp32_cpu_reset(k->s, 0, 12); + } + expire(k); +} + +static void rt_tick(void *ctx, u32 cycles) +{ + struct e32_rtc *k = (struct e32_rtc *)ctx; + ES_UNUSED(cycles); + sync(k); + expire(k); +} + +static int rt_next(void *ctx, u32 *cycles) +{ + struct e32_rtc *k = (struct e32_rtc *)ctx; + u64 best = 0, c; + sync(k); + if (wdt_on(k)) { + u64 hold = stage_hold(k, k->stage), done = k->slow - k->wdt_from; + best = cycles_to(k, hold > done ? hold - done : 1); + } + if (reg(k, SLP_TIMER1) & (1u << 16)) { + u64 alarm = (u64)reg(k, SLP_TIMER0) | (u64)(reg(k, SLP_TIMER1) & 0xffffu) << 32, + now = k->slow & 0xffffffffffffull; + c = cycles_to(k, alarm > now ? alarm - now : 1); + if (!best || c < best) + best = c; + } + if (!best) + return 0; + *cycles = best > 0xffffffffu ? 0xffffffffu : (u32)best; + return 1; +} + +static int rtc_domain_lost(int code) +{ + return code == 1 || code == 16; +} + +static void rt_reset(void *ctx) +{ + struct e32_rtc *k = (struct e32_rtc *)ctx; + int chip = k->s->reset_cause == ESK_RESET_POWER || k->s->reset_cause == ESK_RESET_PIN; + int code = chip ? 1 : k->code[0]; + if (chip || rtc_domain_lost(code)) { + int i; + k->slow = 0; + k->frac = 0; + for (i = 0; i < k->p->nreg; i++) { /* a CHIP_PU reset too: the RTC domain starts again */ + k->p->reg[i]->value = k->p->reg[i]->reset; + k->p->reg[i]->once = 0; + } + } + k->stage = 0; + k->wdt_from = k->slow; + k->base_cycles = 0; + k->clocked = 0; + k->level = 0; + hw(k, RESET_STATE, (reg(k, RESET_STATE) & ~0xfffu) | (u32)code | (u32)(chip ? 1 : k->code[1]) << 6); + k->code[0] = k->code[1] = 1; + k->p->backup = 1; /* kept through the next system reset */ + update(k); + clocking(k); +} + +const struct esk_dev_ops esk_esp32_rtc_ops = { + "esp32-rtc", rt_read, rt_write, rt_reset, rt_tick, rt_next, +}; + +void *esk_esp32_rtc_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_rtc *k = (struct e32_rtc *)esk_mach_alloc(s, sizeof *k); + if (!k) + return 0; + k->s = s; + k->p = p; + k->code[0] = k->code[1] = 1; + return k; +} + +/* a reset of the whole digital system (and of the RTC domain for 1, 16) */ +void esk_esp32_reset(struct esk_mach *m, int code) +{ + struct e32_rtc *k = rtc_of(m); + if (k) { + k->code[0] = k->code[1] = code; + if (rtc_domain_lost(code)) + k->p->backup = 0; + } + m->reset_cpu_only = 0; + m->reset_cause = code == 3 ? ESK_RESET_SOFTWARE : ESK_RESET_WATCHDOG; + m->reset_req = 1; + m->yield = 1; +} + +/* one CPU alone: it restarts at its reset vector and reports `code` */ +void esk_esp32_cpu_reset(struct esk_mach *m, int core, int code) +{ + struct e32_rtc *k = rtc_of(m); + if (k) { + u32 rs = reg(k, RESET_STATE); + if (core == 0) + rs = (rs & ~0x3fu) | (u32)code; + else + rs = (rs & ~0xfc0u) | (u32)code << 6; + hw(k, RESET_STATE, rs); + } + esk_lx6_core_restart(m, core); +} + +void esk_esp32_rtc_reset_cause(struct esk_mach *m, int core, int code) +{ + struct e32_rtc *k = rtc_of(m); + if (k) { + u32 rs = reg(k, RESET_STATE); + rs = core == 0 ? (rs & ~0x3fu) | (u32)code : (rs & ~0xfc0u) | (u32)code << 6; + hw(k, RESET_STATE, rs); + } +} diff --git a/core/mcu/esp32/soc/rtcio.c b/core/mcu/esp32/soc/rtcio.c new file mode 100644 index 000000000..62087a8c5 --- /dev/null +++ b/core/mcu/esp32/soc/rtcio.c @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* rtcio.c -- the ESP32's RTC IO MUX (RTC_IO, TRM v5 chapter 4.11) as far as + * its two DACs (chapter 29.5): DAC1 on GPIO25 (PAD_DAC1), DAC2 on GPIO26 + * (PAD_DAC2). + * + * - While the pad is the RTC IO MUX's (MUX_SEL) and its DAC powered + * (XPD_DAC, with DAC_XPD_FORCE as ESP-IDF sets it), the pad is the DAC's + * output: VDD3P3_RTC x DAC / 255 for the eight-bit code in PDACn_DAC, + * the relation ESP-IDF's dac_oneshot documents; the GPIO model gives the + * pad that voltage (gpio.c). + * - Writes to the registers settle the pads again. + * Where it differs inside: the output is a stiff source (the datasheet gives + * no output impedance). Not yet: the cosine-wave generator (SENS's + * SAR_DAC_CTRL1/2: SW_TONE_EN, DAC_CW_EN1/2, the scale, phase and offset) + * and the DMA path (DAC_DIG_FORCE, I2S0), whose outputs read as the code + * written; the other RTC pads' functions, pulls and hold. */ +#include + +#include "mcu/esp32/soc/esp32.h" + +#define PAD_DAC1 0x84u +#define PAD_DAC2 0x88u +#define XPD_DAC (1u << 18) +#define MUX_SEL (1u << 17) + +struct e32_rtcio { + struct esk_mach *s; + struct esk_rf_periph *p; +}; + +static struct e32_rtcio *rtcio_of(struct esk_mach *m) +{ + return m->rf ? (struct e32_rtcio *)esk_rf_ctx_of(m->rf, &esk_esp32_rtcio_ops) : 0; +} + +int esk_esp32_dac_out(struct esk_mach *m, int gpio, double *volts, double *rout) +{ + struct e32_rtcio *k = gpio == 25 || gpio == 26 ? rtcio_of(m) : 0; + u32 v; + double vdd; + if (!k) + return 0; + v = esk_rf_read(k->p, gpio == 25 ? PAD_DAC1 : PAD_DAC2, 4); + if (!(v & XPD_DAC) || !(v & MUX_SEL)) + return 0; + vdd = m->vdd > 0.0 ? m->vdd : 3.3; + *volts = vdd * (double)((v >> 19) & 0xffu) / 255.0; + *rout = 1.0; + return 1; +} + +static u32 rio_read(void *ctx, u32 off, int n) +{ + struct e32_rtcio *k = (struct e32_rtcio *)ctx; + return esk_rf_read(k->p, off, n); +} + +static void rio_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_rtcio *k = (struct e32_rtcio *)ctx; + esk_rf_write(k->p, off, n, v); + if ((off & ~3u) == PAD_DAC1 || (off & ~3u) == PAD_DAC2) + esk_esp32_pins_changed(k->s); +} + +static void rio_reset(void *ctx) { (void)ctx; } + +const struct esk_dev_ops esk_esp32_rtcio_ops = { + "esp32-rtcio", rio_read, rio_write, rio_reset, 0, 0, +}; + +void *esk_esp32_rtcio_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_rtcio *k = (struct e32_rtcio *)esk_mach_alloc(s, sizeof *k); + if (!k) + return 0; + memset(k, 0, sizeof *k); + k->s = s; + k->p = p; + return k; +} diff --git a/core/mcu/esp32/soc/sha.c b/core/mcu/esp32/soc/sha.c new file mode 100644 index 000000000..5e29d7899 --- /dev/null +++ b/core/mcu/esp32/soc/sha.c @@ -0,0 +1,202 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* sha.c -- the ESP32's SHA accelerator (TRM v5 chapter 23): SHA-1, + * SHA-256, SHA-384 and SHA-512 (FIPS 180-4) over message blocks the + * program writes in SHA_TEXT. + * + * - SHA_TEXT (0x00-0x7C) holds a block as 32-bit words in message order, + * each the big-endian value of four message bytes (ESP-IDF's sha_ll + * swaps them in): 16 words for SHA-1 and SHA-256, 32 for SHA-384 and + * SHA-512 (a 64-bit word's high half first); + * - writing 1 to a type's START (0x80, 0x90, 0xA0, 0xB0) hashes the block + * from the type's initial state, CONTINUE (+4) from the state so far; + * LOAD (+8) puts the state in SHA_TEXT, in the same word order, for + * the program to read; BUSY (+0xC) reads 0: each operation is done by + * the time the next access comes (the TRM gives no cycle counts). + * The state is the accelerator's, so a program that hashes with two types + * in turn without LOAD loses nothing it could see. SHA-384's LOAD puts + * its full 512-bit state, of which the digest is the first 384 bits. + * Not yet: DPORT's SHA clock gate and reset (PERI_CLK_EN, PERI_RST_EN). */ +#include + +#include "mcu/esp32/soc/esp32.h" +#include "util/sha256.h" + +#define TEXT_WORDS 32 + +struct e32_sha { + struct esk_mach *s; + struct esk_rf_periph *p; + u32 text[TEXT_WORDS]; + u32 h1[5], h256[8]; + u64 h512[8]; +}; + +static const u32 iv1[5] = { 0x67452301u, 0xefcdab89u, 0x98badcfeu, 0x10325476u, 0xc3d2e1f0u }; +static const u32 iv256[8] = { 0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au, + 0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u }; +static const u64 iv384[8] = { 0xcbbb9d5dc1059ed8ull, 0x629a292a367cd507ull, 0x9159015a3070dd17ull, + 0x152fecd8f70e5939ull, 0x67332667ffc00b31ull, 0x8eb44a8768581511ull, + 0xdb0c2e0d64f98fa7ull, 0x47b5481dbefa4fa4ull }; +static const u64 iv512[8] = { 0x6a09e667f3bcc908ull, 0xbb67ae8584caa73bull, 0x3c6ef372fe94f82bull, + 0xa54ff53a5f1d36f1ull, 0x510e527fade682d1ull, 0x9b05688c2b3e6c1full, + 0x1f83d9abfb41bd6bull, 0x5be0cd19137e2179ull }; +static const u64 k512[80] = { + 0x428a2f98d728ae22ull, 0x7137449123ef65cdull, 0xb5c0fbcfec4d3b2full, 0xe9b5dba58189dbbcull, + 0x3956c25bf348b538ull, 0x59f111f1b605d019ull, 0x923f82a4af194f9bull, 0xab1c5ed5da6d8118ull, + 0xd807aa98a3030242ull, 0x12835b0145706fbeull, 0x243185be4ee4b28cull, 0x550c7dc3d5ffb4e2ull, + 0x72be5d74f27b896full, 0x80deb1fe3b1696b1ull, 0x9bdc06a725c71235ull, 0xc19bf174cf692694ull, + 0xe49b69c19ef14ad2ull, 0xefbe4786384f25e3ull, 0x0fc19dc68b8cd5b5ull, 0x240ca1cc77ac9c65ull, + 0x2de92c6f592b0275ull, 0x4a7484aa6ea6e483ull, 0x5cb0a9dcbd41fbd4ull, 0x76f988da831153b5ull, + 0x983e5152ee66dfabull, 0xa831c66d2db43210ull, 0xb00327c898fb213full, 0xbf597fc7beef0ee4ull, + 0xc6e00bf33da88fc2ull, 0xd5a79147930aa725ull, 0x06ca6351e003826full, 0x142929670a0e6e70ull, + 0x27b70a8546d22ffcull, 0x2e1b21385c26c926ull, 0x4d2c6dfc5ac42aedull, 0x53380d139d95b3dfull, + 0x650a73548baf63deull, 0x766a0abb3c77b2a8ull, 0x81c2c92e47edaee6ull, 0x92722c851482353bull, + 0xa2bfe8a14cf10364ull, 0xa81a664bbc423001ull, 0xc24b8b70d0f89791ull, 0xc76c51a30654be30ull, + 0xd192e819d6ef5218ull, 0xd69906245565a910ull, 0xf40e35855771202aull, 0x106aa07032bbd1b8ull, + 0x19a4c116b8d2d0c8ull, 0x1e376c085141ab53ull, 0x2748774cdf8eeb99ull, 0x34b0bcb5e19b48a8ull, + 0x391c0cb3c5c95a63ull, 0x4ed8aa4ae3418acbull, 0x5b9cca4f7763e373ull, 0x682e6ff3d6b2b8a3ull, + 0x748f82ee5defb2fcull, 0x78a5636f43172f60ull, 0x84c87814a1f0ab72ull, 0x8cc702081a6439ecull, + 0x90befffa23631e28ull, 0xa4506cebde82bde9ull, 0xbef9a3f7b2c67915ull, 0xc67178f2e372532bull, + 0xca273eceea26619cull, 0xd186b8c721c0c207ull, 0xeada7dd6cde0eb1eull, 0xf57d4f7fee6ed178ull, + 0x06f067aa72176fbaull, 0x0a637dc5a2c898a6ull, 0x113f9804bef90daeull, 0x1b710b35131c471bull, + 0x28db77f523047d84ull, 0x32caab7b40c72493ull, 0x3c9ebe0a15c9bebcull, 0x431d67c49c100d4cull, + 0x4cc5d4becb3e42b6ull, 0x597f299cfc657e2aull, 0x5fcb6fab3ad6faecull, 0x6c44198c4a475817ull }; + +static u32 rol(u32 x, int n) { return (x << n) | (x >> (32 - n)); } +static u64 ror64(u64 x, int n) { return (x >> n) | (x << (64 - n)); } + +static void sha1_block(u32 h[5], const u32 m[16]) +{ + u32 w[80], a = h[0], b = h[1], c = h[2], d = h[3], e = h[4], f, k, t; + int i; + for (i = 0; i < 16; i++) + w[i] = m[i]; + for (; i < 80; i++) + w[i] = rol(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16], 1); + for (i = 0; i < 80; i++) { + if (i < 20) { f = (b & c) | (~b & d); k = 0x5a827999u; } + else if (i < 40) { f = b ^ c ^ d; k = 0x6ed9eba1u; } + else if (i < 60) { f = (b & c) | (b & d) | (c & d); k = 0x8f1bbcdcu; } + else { f = b ^ c ^ d; k = 0xca62c1d6u; } + t = rol(a, 5) + f + e + k + w[i]; + e = d; d = c; c = rol(b, 30); b = a; a = t; + } + h[0] += a; h[1] += b; h[2] += c; h[3] += d; h[4] += e; +} + +static void sha512_block(u64 h[8], const u32 m[32]) +{ + u64 w[80], v[8], t1, t2; + int i, j; + for (i = 0; i < 16; i++) + w[i] = (u64)m[2 * i] << 32 | m[2 * i + 1]; + for (; i < 80; i++) { + u64 s0 = ror64(w[i - 15], 1) ^ ror64(w[i - 15], 8) ^ (w[i - 15] >> 7); + u64 s1 = ror64(w[i - 2], 19) ^ ror64(w[i - 2], 61) ^ (w[i - 2] >> 6); + w[i] = w[i - 16] + s0 + w[i - 7] + s1; + } + for (j = 0; j < 8; j++) + v[j] = h[j]; + for (i = 0; i < 80; i++) { + t1 = v[7] + (ror64(v[4], 14) ^ ror64(v[4], 18) ^ ror64(v[4], 41)) + ((v[4] & v[5]) ^ (~v[4] & v[6])) + + k512[i] + w[i]; + t2 = (ror64(v[0], 28) ^ ror64(v[0], 34) ^ ror64(v[0], 39)) + + ((v[0] & v[1]) ^ (v[0] & v[2]) ^ (v[1] & v[2])); + v[7] = v[6]; v[6] = v[5]; v[5] = v[4]; v[4] = v[3] + t1; + v[3] = v[2]; v[2] = v[1]; v[1] = v[0]; v[0] = t1 + t2; + } + for (j = 0; j < 8; j++) + h[j] += v[j]; +} + +static void sha256_words(u32 h[8], const u32 m[16]) +{ + u8 blk[64]; + int i; + for (i = 0; i < 16; i++) { + blk[4 * i] = (u8)(m[i] >> 24); + blk[4 * i + 1] = (u8)(m[i] >> 16); + blk[4 * i + 2] = (u8)(m[i] >> 8); + blk[4 * i + 3] = (u8)m[i]; + } + esk_sha256_block(h, blk); +} + +/* type 0 SHA-1, 1 SHA-256, 2 SHA-384, 3 SHA-512; op 0 start, 1 continue, 2 load */ +static void operate(struct e32_sha *k, int type, int op) +{ + int i; + if (op == 2) { + if (type == 0) + for (i = 0; i < 5; i++) + k->text[i] = k->h1[i]; + else if (type == 1) + for (i = 0; i < 8; i++) + k->text[i] = k->h256[i]; + else + for (i = 0; i < 8; i++) { + k->text[2 * i] = (u32)(k->h512[i] >> 32); + k->text[2 * i + 1] = (u32)k->h512[i]; + } + return; + } + if (type == 0) { + if (op == 0) + memcpy(k->h1, iv1, sizeof k->h1); + sha1_block(k->h1, k->text); + } else if (type == 1) { + if (op == 0) + memcpy(k->h256, iv256, sizeof k->h256); + sha256_words(k->h256, k->text); + } else { + if (op == 0) + memcpy(k->h512, type == 2 ? iv384 : iv512, sizeof k->h512); + sha512_block(k->h512, k->text); + } +} + +static u32 sh_read(void *ctx, u32 off, int n) +{ + struct e32_sha *k = (struct e32_sha *)ctx; + if (off < 4u * TEXT_WORDS) + return k->text[off / 4u] >> (8u * (off & 3u)); + if (off >= 0x80u && off < 0xC0u) + return 0; /* START, CONTINUE, LOAD are write-only; BUSY: done */ + return esk_rf_read(k->p, off, n); +} + +static void sh_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_sha *k = (struct e32_sha *)ctx; + if (off < 4u * TEXT_WORDS) { + if (n == 4) + k->text[off / 4u] = v; + return; + } + if (off >= 0x80u && off < 0xC0u && (off & 0xCu) != 0xCu && (v & 1u)) { + operate(k, (int)((off - 0x80u) / 0x10u), (int)((off & 0xCu) / 4u)); + return; + } + esk_rf_write(k->p, off, n, v); +} + +static void sh_reset(void *ctx) +{ + struct e32_sha *k = (struct e32_sha *)ctx; + memset(k->text, 0, sizeof k->text); +} + +const struct esk_dev_ops esk_esp32_sha_ops = { + "esp32-sha", sh_read, sh_write, sh_reset, 0, 0, +}; + +void *esk_esp32_sha_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_sha *k = (struct e32_sha *)esk_mach_alloc(s, sizeof *k); + if (!k) + return 0; + k->s = s; + k->p = p; + return k; +} diff --git a/core/mcu/esp32/soc/spi.c b/core/mcu/esp32/soc/spi.c new file mode 100644 index 000000000..8e57abbf1 --- /dev/null +++ b/core/mcu/esp32/soc/spi.c @@ -0,0 +1,354 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* spi.c -- the ESP32's SPI0 and SPI1 (TRM v5 chapter 7), the controllers + * in front of the module's flash (nor.c): SPI0 the caches', SPI1 the + * program's. + * + * A write of CMD starts the transaction its bit names, on the flash: + * - FLASH_READ: ADDR[31:24] bytes from ADDR[23:0] into W0-W15, with the + * read instruction CTRL selects (FREAD_QIO EBh, FREAD_DIO BBh, + * FREAD_QUAD 6Bh, FREAD_DUAL 3Bh, FASTRD_MODE 0Bh, else 03h); + * - FLASH_PP: ADDR[31:24] bytes from W0 (02h, or 32h with FWRITE_QUAD); + * FLASH_SE (20h), FLASH_BE (D8h), FLASH_CE (C7h) at ADDR; + * - FLASH_WREN (06h), FLASH_WRDI (04h), FLASH_RDSR (05h into + * RD_STATUS), FLASH_WRSR (01h from RD_STATUS: one byte, two with + * WRSR_2B), FLASH_RDID (9Fh into W0), FLASH_DP (B9h), FLASH_RES (ABh), + * FLASH_HPM (A3h), FLASH_PES (75h), FLASH_PER (7Ah); + * - USR: the user transaction USER enables: the command (USER2's + * USR_COMMAND_VALUE, USR_COMMAND_BITLEN + 1 bits), the address + * (ADDR's USR_ADDR_BITLEN + 1 most significant bits), the dummy + * cycles, MOSI_DLEN + 1 bits out of W0 (W8 with USR_MOSI_HIGHPART) and + * MISO_DLEN + 1 bits into W0 (W8 with USR_MISO_HIGHPART). + * The command's bit reads 1 while the transaction is on the bus -- the + * bits it carries at the SPI clock (CLOCK: APB_CLK with CLK_EQU_SYSCLK, + * else APB_CLK / (CLKDIV_PRE + 1) / (CLKCNT_N + 1)), its address and data + * on two or four lines as the mode says -- and EXT2's ST is not idle; + * then SLAVE's TRANS_DONE is set, and with its INT_EN bit the matrix + * source (SPI0 30, SPI1 31 in the register description's table). + * Bytes in the W buffers are little-endian (RD_BYTE_ORDER and + * WR_BYTE_ORDER 0). + * Not modelled: the byte and bit orders' other settings, the controllers' + * DMA and slave modes (SPI0 and SPI1 are masters on the flash), the CRC, + * the flash encryption on SPI1's writes, PSRAM (SPI0's cache path to it), + * the cache's own reads (dport.c reads the flash directly). */ +#include + +#include "mcu/esp32/soc/esp32.h" + +#define CMD 0x00u +#define ADDR 0x04u +#define CTRL 0x08u +#define RD_STATUS 0x10u +#define CLOCK 0x18u +#define USER 0x1Cu +#define USER1 0x20u +#define USER2 0x24u +#define MOSI_DLEN 0x28u +#define MISO_DLEN 0x2Cu +#define SLAVE 0x38u +#define W0 0x80u +#define EXT2 0xF8u + +#define CMD_USR (1u << 18) +#define CMD_HPM (1u << 19) +#define CMD_RES (1u << 20) +#define CMD_DP (1u << 21) +#define CMD_CE (1u << 22) +#define CMD_BE (1u << 23) +#define CMD_SE (1u << 24) +#define CMD_PP (1u << 25) +#define CMD_WRSR (1u << 26) +#define CMD_RDSR (1u << 27) +#define CMD_RDID (1u << 28) +#define CMD_WRDI (1u << 29) +#define CMD_WREN (1u << 30) +#define CMD_READ (1u << 31) +#define CMD_PES (1u << 17) +#define CMD_PER (1u << 16) +#define CMD_ANY 0xFFFF0000u + +struct e32_spi { + struct esk_mach *s; + struct esk_rf_periph *p; + struct esk_esp32_nor *nor; + int unit, source, level; + u32 busy; /* the command bit in progress */ + u64 left; + int clocked; +}; + +static u32 reg(struct e32_spi *k, u32 off) +{ + return esk_rf_read(k->p, off, 4); +} + +static void hw(struct e32_spi *k, u32 off, u32 v) +{ + struct esk_rf_reg *r = esk_rf_reg_at(k->p, off); + if (r) + esk_rf_hw(r, v); +} + +static void buf_get(struct e32_spi *k, u32 at, u8 *d, int n) +{ + int i; + for (i = 0; i < n && i < 64; i++) + d[i] = (u8)(reg(k, W0 + at + (u32)(i & ~3)) >> (8 * (i & 3))); +} + +static void buf_put(struct e32_spi *k, u32 at, const u8 *d, int n) +{ + int i; + for (i = 0; i < n && i < 64; i += 4) { + u32 w = reg(k, W0 + at + (u32)i); + int b; + for (b = 0; b < 4 && i + b < n; b++) + w = (w & ~(0xffu << (8 * b))) | (u32)d[i + b] << (8 * b); + hw(k, W0 + at + (u32)i, w); + } +} + +/* the SPI clock in Hz */ +static double spi_hz(struct e32_spi *k) +{ + u32 c = reg(k, CLOCK); + double apb = (double)esk_esp32_apb_hz(k->s); + if (c & (1u << 31)) + return apb; + return apb / (double)(((c >> 18) & 0x1fffu) + 1u) / (double)(((c >> 12) & 0x3fu) + 1u); +} + +/* the flash read instruction CTRL selects, and its data lines */ +static u8 read_op(struct e32_spi *k, int *lines) +{ + u32 c = reg(k, CTRL); + *lines = 1; + if (c & (1u << 24)) { *lines = 4; return 0xEB; } + if (c & (1u << 23)) { *lines = 2; return 0xBB; } + if (c & (1u << 20)) { *lines = 4; return 0x6B; } + if (c & (1u << 14)) { *lines = 2; return 0x3B; } + if (c & (1u << 13)) + return 0x0B; + return 0x03; +} + +static void addr3(u8 *tx, u32 a) +{ + tx[1] = (u8)(a >> 16); + tx[2] = (u8)(a >> 8); + tx[3] = (u8)a; +} + +static void update(struct e32_spi *k) +{ + u32 sl = reg(k, SLAVE); + int lv = ((sl & 0x1fu) & ((sl >> 5) & 0x1fu)) != 0; + if (lv != k->level && k->source >= 0) { + k->level = lv; + esk_esp32_source(k->s, k->source, lv); + } +} + +/* the transaction: the flash's part now, its bus time in SPI clocks */ +static u64 run(struct e32_spi *k, u32 cmd) +{ + u8 tx[80], rx[64]; + u32 a = reg(k, ADDR), len = a >> 24, user = reg(k, USER); + int lines = 1, n; + u64 clocks = 8; + memset(tx, 0, sizeof tx); + memset(rx, 0xff, sizeof rx); + if (len > 64) + len = 64; + if (cmd == CMD_READ) { + tx[0] = read_op(k, &lines); + addr3(tx, a); + esk_esp32_nor_xfer(k->nor, tx, 4, rx, (int)len); + buf_put(k, 0, rx, (int)len); + return clocks + (24u + 8u * len) / (u32)lines + (tx[0] == 0x03 ? 0u : 8u); + } + if (cmd == CMD_PP) { + tx[0] = (user & (1u << 13)) ? 0x32 : 0x02; + addr3(tx, a); + buf_get(k, 0, tx + 4, (int)len); + esk_esp32_nor_xfer(k->nor, tx, 4 + (int)len, rx, 0); + return clocks + 24u + 8u * len; + } + if (cmd == CMD_SE || cmd == CMD_BE) { + tx[0] = cmd == CMD_SE ? 0x20 : 0xD8; + addr3(tx, a); + esk_esp32_nor_xfer(k->nor, tx, 4, rx, 0); + return clocks + 24u; + } + if (cmd == CMD_RDSR) { + tx[0] = 0x05; + esk_esp32_nor_xfer(k->nor, tx, 1, rx, 1); + hw(k, RD_STATUS, (reg(k, RD_STATUS) & ~0xffu) | rx[0]); + return clocks + 8u; + } + if (cmd == CMD_WRSR) { + u32 st = reg(k, RD_STATUS); + int two = (reg(k, CTRL) & (1u << 22)) != 0; + tx[0] = 0x01; + tx[1] = (u8)st; + tx[2] = (u8)(st >> 8); + esk_esp32_nor_xfer(k->nor, tx, two ? 3 : 2, rx, 0); + return clocks + (two ? 16u : 8u); + } + if (cmd == CMD_RDID) { + tx[0] = 0x9F; + esk_esp32_nor_xfer(k->nor, tx, 1, rx, 3); + hw(k, W0, (u32)rx[0] | (u32)rx[1] << 8 | (u32)rx[2] << 16); + return clocks + 24u; + } + if (cmd != CMD_USR) { + tx[0] = cmd == CMD_WREN ? 0x06 : cmd == CMD_WRDI ? 0x04 : cmd == CMD_CE ? 0xC7 : cmd == CMD_DP ? 0xB9 + : cmd == CMD_RES ? 0xAB : cmd == CMD_HPM ? 0xA3 : cmd == CMD_PES ? 0x75 : 0x7A; + esk_esp32_nor_xfer(k->nor, tx, 1, rx, 0); + return clocks; + } + /* a user transaction */ + n = 0; + clocks = 0; + if (user & (1u << 31)) { + u32 bits = ((reg(k, USER2) >> 28) & 15u) + 1u, v = reg(k, USER2) & 0xffffu; + int nb = (int)((bits + 7u) / 8u), i; + for (i = 0; i < nb; i++) + tx[n++] = (u8)(v >> (8 * i)); + clocks += bits; + } + if (user & (1u << 30)) { + u32 bits = ((reg(k, USER1) >> 26) & 0x3fu) + 1u; + int nb = (int)((bits + 7u) / 8u), i; + for (i = 0; i < nb && i < 4; i++) + tx[n++] = (u8)(a >> (24 - 8 * i)); + clocks += bits; + } + if (user & (1u << 29)) + clocks += (reg(k, USER1) & 0xffu) + 1u; + if (user & (1u << 27)) { + u32 bits = (reg(k, MOSI_DLEN) & 0xffffffu) + 1u; + int nb = (int)((bits + 7u) / 8u); + if (nb > 64) + nb = 64; + buf_get(k, (user & (1u << 25)) ? 32u : 0u, tx + n, nb); + n += nb; + clocks += bits; + } + { + int nrx = 0; + if (user & (1u << 28)) { + u32 bits = (reg(k, MISO_DLEN) & 0xffffffu) + 1u; + nrx = (int)((bits + 7u) / 8u); + if (nrx > 64) + nrx = 64; + clocks += bits; + } + if (n) + esk_esp32_nor_xfer(k->nor, tx, n, rx, nrx); + if (nrx) + buf_put(k, (user & (1u << 24)) ? 32u : 0u, rx, nrx); + } + return clocks; +} + +static void done(struct e32_spi *k) +{ + k->busy = 0; + hw(k, CMD, reg(k, CMD) & ~CMD_ANY); + hw(k, EXT2, 0); + hw(k, SLAVE, reg(k, SLAVE) | (1u << 4)); /* TRANS_DONE */ + esk_rf_clock(k->p, &k->clocked, 0); + update(k); +} + +static u32 sp_read(void *ctx, u32 off, int n) +{ + struct e32_spi *k = (struct e32_spi *)ctx; + return esk_rf_read(k->p, off, n); +} + +static void sp_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_spi *k = (struct e32_spi *)ctx; + esk_rf_write(k->p, off, n, v); + if (off == CMD && !k->busy && (v & CMD_ANY)) { + u32 cmd = 0x80000000u, clocks; + while (cmd && !(v & cmd)) + cmd >>= 1; + clocks = (u32)run(k, cmd); + k->busy = cmd; + hw(k, CMD, cmd); + hw(k, EXT2, 1); + k->left = (u64)((double)clocks * (double)esk_mach_core_hz(k->s) / spi_hz(k)) + 1u; + esk_rf_clock(k->p, &k->clocked, 1); + } else if (off == CMD && k->busy) { + hw(k, CMD, (reg(k, CMD) & ~CMD_ANY) | k->busy); + } else if (off == SLAVE) { + update(k); + } +} + +static void sp_tick(void *ctx, u32 cycles) +{ + struct e32_spi *k = (struct e32_spi *)ctx; + if (!k->busy) + return; + if (k->left > cycles) { + k->left -= cycles; + return; + } + done(k); +} + +static int sp_next(void *ctx, u32 *cycles) +{ + struct e32_spi *k = (struct e32_spi *)ctx; + if (!k->busy) + return 0; + *cycles = k->left > 0xffffffffu ? 0xffffffffu : (u32)k->left; + return 1; +} + +static void sp_reset(void *ctx) +{ + struct e32_spi *k = (struct e32_spi *)ctx; + k->busy = 0; + k->clocked = 0; + k->level = 0; + if (k->unit == 1 && k->nor && k->s->reset_cause == ESK_RESET_POWER) + esk_esp32_nor_power_on(k->nor); +} + +const struct esk_dev_ops esk_esp32_spi_ops = { + "esp32-spi", sp_read, sp_write, sp_reset, sp_tick, sp_next, +}; + +void *esk_esp32_spi_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_spi *k; + if (strcmp(p->name, "SPI0") && strcmp(p->name, "SPI1")) + return 0; + k = (struct e32_spi *)esk_mach_alloc(s, sizeof *k); + if (!k) + return 0; + k->s = s; + k->p = p; + k->unit = p->name[3] - '0'; + k->source = esk_rf_irq(p, p->name); + k->nor = esk_esp32_nor_of(s); + if (!k->nor) + return 0; + return k; +} + +/* the one flash chip both controllers reach, made by whichever comes first */ +struct esk_esp32_nor *esk_esp32_nor_of(struct esk_mach *m) +{ + struct esk_rf_periph *p; + int i; + for (i = 0; m->rf && (p = esk_rf_periph_at(m->rf, i)) != 0; i++) + if (p->ops == &esk_esp32_spi_ops && p->ctx && ((struct e32_spi *)p->ctx)->nor) + return ((struct e32_spi *)p->ctx)->nor; + return esk_esp32_nor_create(m); +} diff --git a/core/mcu/esp32/soc/timg.c b/core/mcu/esp32/soc/timg.c new file mode 100644 index 000000000..7aa7a9b46 --- /dev/null +++ b/core/mcu/esp32/soc/timg.c @@ -0,0 +1,434 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* timg.c -- the ESP32's timer groups TIMG0 and TIMG1 (TRM v5 chapters 18 + * and 19): in each, the 64-bit timers T0 and T1, the LAC timer (LACT), the + * main system watchdog (MWDT) and the RTC_SLOW_CLK calibration. The + * ESP32-C3's model (mcu/esp32c3/timg.c) on the ESP32's registers. + * + * - T0, T1 and LACT count APB_CLK over DIVIDER (0 is 65536, 1 is 2), up + * or down (INCREASE) over 64 bits while EN is set. A write to UPDATE + * latches the count in LO/HI; one to LOAD loads LOADLO/HI. With + * ALARM_EN a timer alarms when it reaches ALARMLO/HI, or at once when + * the alarm is up to 2^63 behind it in its direction; the alarm clears + * ALARM_EN, sets its INT_RAW bit and reloads with AUTORELOAD. + * - The MWDT counts APB_CLK over WDT_CLK_PRESCALE through four stages + * (WDTCONFIG2-5's holds), each's action off, an interrupt (WDT's + * INT_RAW bit), a CPU reset (TGWDT_CPU_RESET, 11) or a system reset + * (TG0WDT_SYS_RESET 7, TG1WDT_SYS_RESET 8); WDT_EN runs it. With + * WDT_FLASHBOOT_MOD_EN, set out of reset in TIMG0, it runs with stage + * 0 a system reset. WDTFEED returns it to stage 0. While WDTWPROTECT + * is not 0x50D83AA1 the WDT registers ignore writes. + * - RTCCALICFG's START counts MAX cycles of the clock CLK_SEL names + * (RTC_SLOW_CLK as RTC_CNTL selects it, 8MD256's 31.25 kHz, the + * board's 32.768 kHz crystal) against the 40 MHz crystal once; when + * done RDY is set and RTCCALICFG1's VALUE holds the crystal's count; + * a MAX of 0 sets RDY at the clock's next cycle (taken one period + * away). START_CYCLING counts again and again. A clock that does not run (no + * 32 kHz crystal) never makes RDY. + * - INT_ST is INT_RAW and INT_ENA; each bit drives its level source + * (TIMG0's T0 14, T1 15, WDT 16, LACT 17; TIMG1's 18-21), and an alarm + * whose EDGE_INT_EN is set pulses its edge source (TIMG0 51-54, TIMG1 + * 55-58). + * Inside, the RC oscillators run at their nominal frequencies. + * Not yet: LACT's RTC step mode (LACTRTC, RTC_ONLY, CPST_EN: it counts + * APB_CLK), the reset signals' lengths. */ +#include + +#include "mcu/esp32/soc/esp32.h" + +#define HALF63 (1ull << 63) +#define WKEY 0x50D83AA1u + +#define T_ALARM_EN (1u << 10) +#define T_LEVEL_INT_EN (1u << 11) +#define T_EDGE_INT_EN (1u << 12) +#define T_AUTORELOAD (1u << 29) +#define T_INCREASE (1u << 30) +#define T_EN (1u << 31) + +#define W0_FLASHBOOT (1u << 14) +#define W0_EN (1u << 31) + +#define CALI_CYCLING (1u << 12) +#define CALI_RDY (1u << 15) +#define CALI_START (1u << 31) + +#define WDTCONFIG0 0x48u +#define WDTFEED 0x60u +#define WPROTECT 0x64u +#define RTCCALICFG 0x68u +#define RTCCALICFG1 0x6Cu +#define INT_ENA 0x98u +#define INT_RAW 0x9Cu +#define INT_ST 0xA0u +#define INT_CLR 0xA4u + +/* each timer's registers: config, lo, hi, update, alarm lo/hi, load lo/hi, load */ +static const u32 tbase[3] = { 0x00, 0x24, 0x70 }; + +struct e32_timg { + struct esk_mach *s; + struct esk_rf_periph *p; + int group, level[4], clocked; + u64 value[3], frac[3]; + int stage; + u64 wcount, w_frac; + int cali_on; + u64 cali_x, cali_need, x_frac; + u64 cali_wait; /* MAX 0: the crystal's cycles to the next slow cycle */ +}; + +static u32 rd(struct e32_timg *k, u32 off) { return esk_rf_read(k->p, off, 4); } + +static void hw(struct e32_timg *k, u32 off, u32 v) +{ + struct esk_rf_reg *r = esk_rf_reg_at(k->p, off); + if (r) + esk_rf_hw(r, v); +} + +/* a timer's register: 0 config, 1 lo, 2 hi, 3 update, 4/5 alarm, 6/7 load, 8 load trigger */ +static u32 toff(int t, int r) +{ + return tbase[t] + (t == 2 && r > 0 ? 8u : 0u) + 4u * (u32)r - (t == 2 && r > 0 ? 4u : 0u); +} + +static void update(struct e32_timg *k) +{ + u32 st = rd(k, INT_RAW) & rd(k, INT_ENA) & 15u; + int i; + hw(k, INT_ST, st); + for (i = 0; i < 4; i++) { + int l = (int)(st >> i & 1u); + if (l != k->level[i]) { + k->level[i] = l; + esk_esp32_source(k->s, (k->group ? 18 : 14) + i, l); + } + } +} + +static void edge(struct e32_timg *k, int i) +{ + int src = (k->group ? 55 : 51) + i; + esk_esp32_source(k->s, src, 1); + esk_esp32_source(k->s, src, 0); +} + +static u64 ticks(struct e32_timg *k, u32 cycles, u32 src_hz, u32 div, u64 *frac) +{ + u64 hz = (u64)esk_mach_core_hz(k->s) * div, n; + if (!hz) + return 0; + *frac += (u64)cycles * src_hz; + n = *frac / hz; + *frac %= hz; + return n; +} + +static u32 t_div(struct e32_timg *k, int t) +{ + u32 d = (rd(k, toff(t, 0)) >> 13) & 0xffffu; + return d == 0 ? 65536u : d == 1 ? 2u : d; +} + +static u64 pair(struct e32_timg *k, u32 lo) +{ + return (u64)rd(k, lo + 4u) << 32 | rd(k, lo); +} + +static void t_alarm(struct e32_timg *k, int t) +{ + u32 c = rd(k, toff(t, 0)); + hw(k, toff(t, 0), c & ~T_ALARM_EN); + hw(k, INT_RAW, rd(k, INT_RAW) | (t == 2 ? 8u : 1u << t)); + if (c & T_AUTORELOAD) + k->value[t] = pair(k, toff(t, 6)); + if (c & T_EDGE_INT_EN) + edge(k, t == 2 ? 3 : t); +} + +static u64 t_ahead(struct e32_timg *k, int t) +{ + u64 a = pair(k, toff(t, 4)), d; + d = rd(k, toff(t, 0)) & T_INCREASE ? a - k->value[t] : k->value[t] - a; + return d > HALF63 ? 0 : d; +} + +static void t_run(struct e32_timg *k, int t, u32 cycles) +{ + u64 n; + if (!(rd(k, toff(t, 0)) & T_EN)) + return; + n = ticks(k, cycles, esk_esp32_apb_hz(k->s), t_div(k, t), &k->frac[t]); + while (n) { + u64 step = n; + u32 c = rd(k, toff(t, 0)); + if (c & T_ALARM_EN) { + u64 d = t_ahead(k, t); + if (d == 0) { + t_alarm(k, t); + continue; + } + if (d <= n) + step = d; + } + k->value[t] = c & T_INCREASE ? k->value[t] + step : k->value[t] - step; + n -= step; + if ((rd(k, toff(t, 0)) & T_ALARM_EN) && t_ahead(k, t) == 0) + t_alarm(k, t); + } +} + +/* ---- the MWDT ------------------------------------------------------------ */ + +static u32 w0(struct e32_timg *k) { return rd(k, WDTCONFIG0); } +static int flashboot(struct e32_timg *k) { return k->group == 0 && (w0(k) & W0_FLASHBOOT); } +static int wdt_on(struct e32_timg *k) { return (w0(k) & W0_EN) || flashboot(k); } +static u32 prescale(struct e32_timg *k) +{ + u32 p = (rd(k, WDTCONFIG0 + 4u) >> 16) & 0xffffu; + return p ? p : 65536u; +} +static u64 hold(struct e32_timg *k, int s) { return rd(k, WDTCONFIG0 + 8u + 4u * (u32)s); } + +static u32 stage_action(struct e32_timg *k, int s) +{ + if (s == 0 && flashboot(k)) + return 3; + return (w0(k) >> (29 - 2 * s)) & 3u; +} + +static void wdt_expire(struct e32_timg *k) +{ + u32 act = stage_action(k, k->stage); + k->wcount = 0; + k->stage = (k->stage + 1) & 3; + if (act == 1) { + hw(k, INT_RAW, rd(k, INT_RAW) | 4u); + if (w0(k) & (1u << 22)) + edge(k, 2); + } else if (act == 2) { + esk_esp32_cpu_reset(k->s, 0, 11); + esk_esp32_cpu_reset(k->s, 1, 11); + } else if (act == 3) { + esk_esp32_reset(k->s, k->group ? 8 : 7); + } +} + +static void wdt_run(struct e32_timg *k, u32 cycles) +{ + u64 n; + int guard = 8; + if (!wdt_on(k)) + return; + n = ticks(k, cycles, esk_esp32_apb_hz(k->s), prescale(k), &k->w_frac); + while (n && guard--) { + u64 h = hold(k, k->stage), left = h > k->wcount ? h - k->wcount : 0; + if (n < left) { + k->wcount += n; + return; + } + n -= left; + wdt_expire(k); + if (k->s->reset_req) + return; + } +} + +/* ---- the calibration ----------------------------------------------------- */ + +static double cali_hz(struct e32_timg *k) +{ + u32 sel = (rd(k, RTCCALICFG) >> 13) & 3u; + return sel == 0 ? esk_esp32_rtc_slow_hz(k->s) : sel == 1 ? 8000000.0 / 256.0 : (double)k->s->lse_hz; +} + +static void cali_start(struct e32_timg *k, int periodic) +{ + double hz = cali_hz(k); + u32 max = (rd(k, RTCCALICFG) >> 16) & 0x7fffu; + k->cali_on = periodic ? 2 : 1; + k->cali_x = 0; + k->cali_need = hz > 0 ? (u64)((double)max * ESP32_XTAL_HZ / hz + 0.5) : 0; + k->cali_wait = 0; + if (hz > 0 && max == 0) { + /* none counted: RDY at the clock's next cycle (ESP-IDF's + * rtc_clk_wait_for_slow_cycle), taken as one period away */ + k->cali_wait = (u64)((double)ESP32_XTAL_HZ / hz + 0.5); + } + if (!periodic) + hw(k, RTCCALICFG, rd(k, RTCCALICFG) & ~CALI_RDY); +} + +static u64 cali_end(struct e32_timg *k) +{ + return k->cali_need ? k->cali_need : k->cali_wait; +} + +static void cali_run(struct e32_timg *k, u32 cycles) +{ + if (!k->cali_on || !cali_end(k)) + return; + k->cali_x += ticks(k, cycles, ESP32_XTAL_HZ, 1, &k->x_frac); + if (k->cali_x < cali_end(k)) + return; + hw(k, RTCCALICFG1, (u32)(k->cali_need & 0x1ffffffu) << 7); + hw(k, RTCCALICFG, rd(k, RTCCALICFG) | CALI_RDY); + if (k->cali_on == 2) + k->cali_x %= cali_end(k); + else + k->cali_on = 0; +} + +/* ---- the device ---------------------------------------------------------- */ + +static int any_on(struct e32_timg *k) +{ + int t; + for (t = 0; t < 3; t++) + if (rd(k, toff(t, 0)) & T_EN) + return 1; + return wdt_on(k) || (k->cali_on && cali_end(k)); +} + +static void clocking(struct e32_timg *k) +{ + esk_rf_clock(k->p, &k->clocked, any_on(k)); +} + +static void tg_tick(void *ctx, u32 cycles) +{ + struct e32_timg *k = (struct e32_timg *)ctx; + int t; + for (t = 0; t < 3; t++) + t_run(k, t, cycles); + wdt_run(k, cycles); + cali_run(k, cycles); + update(k); + clocking(k); +} + +static u64 to_cycles(struct e32_timg *k, u64 n, double src_hz, u64 div, u64 frac) +{ + double c = ((double)n * (double)esk_mach_core_hz(k->s) * (double)div - (double)frac) / src_hz; + if (src_hz <= 0 || c > 4.0e9) + return 0xffffffffu; + return c < 1.0 ? 1u : (u64)c + 1u; +} + +static int tg_next(void *ctx, u32 *cycles) +{ + struct e32_timg *k = (struct e32_timg *)ctx; + u64 best = 0, c; + int any = 0, t; + for (t = 0; t < 3; t++) { + u32 conf = rd(k, toff(t, 0)); + if ((conf & T_EN) && (conf & T_ALARM_EN)) { + u64 d = t_ahead(k, t); + c = d ? to_cycles(k, d, (double)esk_esp32_apb_hz(k->s), t_div(k, t), k->frac[t]) : 1; + if (!any || c < best) + best = c; + any = 1; + } + } + if (wdt_on(k)) { + u64 h = hold(k, k->stage), left = h > k->wcount ? h - k->wcount : 1; + c = to_cycles(k, left, (double)esk_esp32_apb_hz(k->s), prescale(k), k->w_frac); + if (!any || c < best) + best = c; + any = 1; + } + if (k->cali_on && cali_end(k)) { + u64 left = cali_end(k) > k->cali_x ? cali_end(k) - k->cali_x : 1; + c = to_cycles(k, left, (double)ESP32_XTAL_HZ, 1, k->x_frac); + if (!any || c < best) + best = c; + any = 1; + } + if (!any) + return 0; + *cycles = best == 0 ? 1u : best > 0xffffffffu ? 0xffffffffu : (u32)best; + return 1; +} + +static u32 tg_read(void *ctx, u32 off, int n) +{ + struct e32_timg *k = (struct e32_timg *)ctx; + return esk_rf_read(k->p, off, n); +} + +static void tg_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_timg *k = (struct e32_timg *)ctx; + u32 cali0 = rd(k, RTCCALICFG), conf[3]; + int t; + if (((off >= WDTCONFIG0 && off <= WDTFEED)) && rd(k, WPROTECT) != WKEY) + return; /* write-protected */ + for (t = 0; t < 3; t++) + conf[t] = rd(k, toff(t, 0)); + esk_rf_write(k->p, off, n, v); + for (t = 0; t < 3; t++) { + if (off == toff(t, 3)) { + hw(k, toff(t, 1), (u32)k->value[t]); + hw(k, toff(t, 2), (u32)(k->value[t] >> 32)); + } else if (off == toff(t, 8)) { + k->value[t] = pair(k, toff(t, 6)); + } else if (off == toff(t, 0)) { + if ((rd(k, off) & T_ALARM_EN) && !(conf[t] & T_ALARM_EN) && t_ahead(k, t) == 0) + t_alarm(k, t); + } + } + if (off == WDTFEED) { + k->stage = 0; + k->wcount = 0; + } else if (off == WDTCONFIG0 && !(v & W0_EN) && !(v & W0_FLASHBOOT)) { + k->stage = 0; + k->wcount = 0; + } else if (off == RTCCALICFG) { + u32 now = rd(k, RTCCALICFG); + if ((now & CALI_START) && !(cali0 & CALI_START)) + cali_start(k, 0); + else if ((now & CALI_CYCLING) && !(cali0 & CALI_CYCLING) && !(now & CALI_START)) + cali_start(k, 1); + else if (!(now & (CALI_START | CALI_CYCLING))) + k->cali_on = 0; + } else if (off == INT_CLR) { + hw(k, INT_RAW, rd(k, INT_RAW) & ~(v & 15u)); + } + update(k); + clocking(k); +} + +static void tg_reset(void *ctx) +{ + struct e32_timg *k = (struct e32_timg *)ctx; + int t; + for (t = 0; t < 3; t++) + k->value[t] = k->frac[t] = 0; + k->stage = 0; + k->wcount = k->w_frac = 0; + k->cali_on = 0; + k->cali_x = k->x_frac = 0; + k->clocked = 0; + memset(k->level, 0, sizeof k->level); + update(k); + clocking(k); +} + +const struct esk_dev_ops esk_esp32_timg_ops = { + "esp32-timg", tg_read, tg_write, tg_reset, tg_tick, tg_next, +}; + +void *esk_esp32_timg_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_timg *k; + if (strcmp(p->name, "TIMG0") && strcmp(p->name, "TIMG1")) + return 0; + k = (struct e32_timg *)esk_mach_alloc(s, sizeof *k); + if (!k) + return 0; + k->s = s; + k->p = p; + k->group = p->name[4] == '1'; + return k; +} diff --git a/core/mcu/esp32/soc/uart.c b/core/mcu/esp32/soc/uart.c new file mode 100644 index 000000000..23eb0ab14 --- /dev/null +++ b/core/mcu/esp32/soc/uart.c @@ -0,0 +1,464 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* uart.c -- the ESP32's UART0, UART1 and UART2 (ESP32 TRM v5, chapter + * 13), over the register file, at their baud rate (the ESP32-C3's model, + * mcu/esp32c3/uart.c, on the ESP32's registers). + * + * - the clock is APB_CLK, or REF_TICK's 1 MHz while CONF0's + * TICK_REF_ALWAYS_ON is clear; a bit is CLKDIV + FRAG / 16 of its + * cycles; + * - a write of FIFO (here or at its AHB address) queues a byte in the TX + * FIFO (128 bytes times MEM_CONF's TX_SIZE; a write to a full FIFO is + * lost); while nCTS lets it (TX_FLOW_EN) the transmitter sends a frame + * at a time: a start bit, 5 to 8 data bits (BIT_NUM), the parity + * (PARITY_EN, PARITY odd) and 1, 1.5 or 2 stop bits (STOP_BIT_NUM); + * frames in the FIFO go out back to back, and once it has emptied the + * line stays idle TX_IDLE_NUM bit times before the next transfer; + * TXD_BRK sends TX_BRK_NUM NULL characters once the FIFO is empty; + * - bytes arrive from the session's serial input or the RX pin into the + * RX FIFO (128 times RX_SIZE); a frame with no room is lost + * (RXFIFO_OVF); a read of FIFO takes the oldest byte; LOOPBACK sends + * the transmitter's frames to its own receiver; + * - INT_RAW's bits: RXFIFO_FULL while more than RXFIFO_FULL_THRHD bytes + * wait, TXFIFO_EMPTY while fewer than TXFIFO_EMPTY_THRHD do, + * PARITY_ERR and FRM_ERR for a received frame, RXFIFO_OVF, BRK_DET, + * RXFIFO_TOUT after RX_TOUT_THRHD times eight bit times of idle line + * with bytes waiting (RX_TOUT_EN; ESP-IDF's uart_ll converts its + * symbols so), TX_BRK_DONE, TX_BRK_IDLE_DONE, TX_DONE; INT_CLR clears + * them (a level condition sets its bit again while it lasts); INT_ST + * is INT_RAW and INT_ENA, and raises the matrix source (UART0 34, + * UART1 35, UART2 36) while nonzero; + * - STATUS reads the FIFOs' counts (with MEM_CNT_STATUS's high bits) + * and the lines; MEM_RX_STATUS the RX RAM's read and write addresses + * (RD_ADDR, WR_ADDR), from which ESP-IDF's uart_ll counts the bytes + * waiting on the ESP32, each moving on a byte and wrapping at the RX + * FIFO's size (counted from the FIFO's start: the RAM's absolute + * addresses are not modelled); RXFIFO_RST and TXFIFO_RST empty the FIFOs while set. + * Not modelled: autobaud, IrDA, RS485, the AT_CMD character, software + * flow control (XON/XOFF), the RX glitch filter, light-sleep wake-up, + * UHCI, the FIFO RAM's sharing between the UARTs beyond its sizes. */ +#include + +#include "mcu/esp32/soc/esp32.h" + +#define BLOCK 128 /* bytes of FIFO RAM per block (TRM 26.4.2) */ +#define RAW_RXFIFO_FULL (1u << 0) +#define RAW_TXFIFO_EMPTY (1u << 1) +#define RAW_PARITY_ERR (1u << 2) +#define RAW_FRM_ERR (1u << 3) +#define RAW_RXFIFO_OVF (1u << 4) +#define RAW_BRK_DET (1u << 7) +#define RAW_RXFIFO_TOUT (1u << 8) +#define RAW_TX_BRK_DONE (1u << 12) +#define RAW_TX_BRK_IDLE_DONE (1u << 13) +#define RAW_TX_DONE (1u << 14) +#define CONF0_PARITY (1u << 0) +#define CONF0_PARITY_EN (1u << 1) +#define CONF0_TXD_BRK (1u << 8) +#define CONF0_LOOPBACK (1u << 14) +#define CONF0_TX_FLOW_EN (1u << 15) +#define CONF0_RXFIFO_RST (1u << 17) +#define CONF0_TXFIFO_RST (1u << 18) +#define CONF1_RX_TOUT_EN (1u << 31) +#define CONF0_TICK_REF (1u << 27) +#define REF_TICK_HZ 1000000.0 + +struct e32_uart { + struct esk_mach *s; + struct esk_rf_periph *p; + struct esk_rf_reg *fifo, *raw, *st, *ena, *clr, *clkdiv, *status, *conf0, *conf1, *idle, *mem, + *memcnt, *memrx; + int unit, source, level; + u8 tx[4 * BLOCK], rx[2 * BLOCK]; + int ntx, nrx; + u32 rx_rd, rx_wr; /* the RX RAM's read and write addresses (MEM_RX_STATUS) */ + int busy; /* a frame, a break or the idle gap is on the TX line */ + int clocked; /* the device's clock runs (esk_rf_clock) */ + int phase; /* 0 a frame, 1 the idle after it, 2 a break */ + int brk_left; /* NULL characters of a break still to send */ + u64 left, since; + u64 rx_idle; /* bit times of idle RX line, for RXFIFO_TOUT */ + int rx_any; /* a byte arrived since the FIFO was last empty */ + int cts; /* nCTS high: the peer is not ready */ +}; + +static u32 reg(const struct esk_rf_reg *r) { return (u32)r->value; } + +static int tx_cap(const struct e32_uart *u) +{ + int n = (int)((reg(u->mem) >> 7) & 15u); + return (n ? (n > 8 ? 8 : n) : 1) * BLOCK; +} + +static int rx_cap(const struct e32_uart *u) +{ + int n = (int)((reg(u->mem) >> 3) & 15u); + return (n ? (n > 8 ? 8 : n) : 1) * BLOCK; +} + +/* the UART's clock, in Hz */ +static double sclk_hz(const struct e32_uart *u) +{ + return (reg(u->conf0) & CONF0_TICK_REF) ? (double)esk_esp32_apb_hz(u->s) : REF_TICK_HZ; +} + +/* a bit's time in core cycles */ +static u32 bit_cycles(const struct e32_uart *u) +{ + u32 d = reg(u->clkdiv), div = d & 0xfffffu, frag = (d >> 20) & 15u; + double per = (double)div + (double)frag / 16.0, baud, c; + if (per < 1.0) + per = 1.0; + baud = sclk_hz(u) / per; + c = (double)esk_mach_core_hz(u->s) / baud; + return c < 1.0 ? 1u : (u32)(c + 0.5); +} + +/* RXFIFO_TOUT's threshold in bit times: RX_TOUT_THRHD (with MEM_CONF's + * three high bits) times eight */ +static u64 timeout_bits(const struct e32_uart *u) +{ + u64 t = ((reg(u->conf1) >> 24) & 0x7fu) | (u64)((reg(u->mem) >> 18) & 7u) << 7; + return t * 8u; +} + +static int data_bits(const struct e32_uart *u) { return 5 + (int)((reg(u->conf0) >> 2) & 3u); } + +/* STOP_BIT_NUM: 1 one bit, 2 one and a half, 3 two */ +static int stop_halves(const struct e32_uart *u) +{ + u32 n = (reg(u->conf0) >> 4) & 3u; + return n == 2 ? 3 : n == 3 ? 4 : 2; +} + +static int nbits(const struct e32_uart *u) { return data_bits(u) + ((reg(u->conf0) & CONF0_PARITY_EN) ? 1 : 0); } + +static u32 with_parity(const struct e32_uart *u, u32 c) +{ + int n = data_bits(u), ones = 0, i; + c &= (1u << n) - 1u; + if (!(reg(u->conf0) & CONF0_PARITY_EN)) + return c; + for (i = 0; i < n; i++) + ones += (int)((c >> i) & 1u); + /* PARITY 0 even, 1 odd */ + return c | (u32)((ones & 1) ^ ((reg(u->conf0) & CONF0_PARITY) ? 1 : 0)) << n; +} + +static int parity_ok(const struct e32_uart *u, u32 bits) +{ + int n = data_bits(u); + if (!(reg(u->conf0) & CONF0_PARITY_EN)) + return 1; + return with_parity(u, bits) == (bits & ((2u << n) - 1u)); +} + +/* the level conditions, INT_ST and the matrix source */ +static void update(struct e32_uart *u) +{ + u32 raw = reg(u->raw), c1 = reg(u->conf1); + if ((u32)u->nrx > (c1 & 0x7fu)) + raw |= RAW_RXFIFO_FULL; + if ((u32)u->ntx < ((c1 >> 8) & 0x7fu)) + raw |= RAW_TXFIFO_EMPTY; + esk_rf_hw(u->raw, raw); + esk_rf_hw(u->st, raw & reg(u->ena)); + esk_rf_hw(u->status, (reg(u->status) & ~(0xffu | 0xffu << 16)) | ((u32)u->nrx & 0xffu) | + ((u32)u->ntx & 0xffu) << 16); + if (u->memcnt) + esk_rf_hw(u->memcnt, (u32)(u->nrx >> 8) | (u32)(u->ntx >> 8) << 3); + if (u->memrx) + esk_rf_hw(u->memrx, (u->rx_rd & 0x7ffu) << 2 | (u->rx_wr & 0x7ffu) << 13); + if ((reg(u->st) != 0) != u->level) { + u->level = reg(u->st) != 0; + esk_esp32_source(u->s, u->source, u->level); + } +} + +static void set_raw(struct e32_uart *u, u32 bits) +{ + esk_rf_hw(u->raw, reg(u->raw) | bits); +} + +static void receive(struct e32_uart *u, u32 bits, int framing_error, int brk); + +/* the clock runs while the line is busy or a receive timeout counts */ +static void clocking(struct e32_uart *u) +{ + int on = u->busy || (u->rx_any && (reg(u->conf1) & CONF1_RX_TOUT_EN)); + if (on != u->clocked) { + if (on) + u->since = u->s->cycles; + esk_rf_clock(u->p, &u->clocked, on); + } +} + +static void run(struct e32_uart *u, u64 cycles) +{ + u->left = cycles; + u->since = u->s->cycles; + u->busy = 1; + clocking(u); +} + +/* the next thing on the TX line: a frame, or a break once the FIFO is empty */ +static void tx_next(struct e32_uart *u) +{ + struct esk_mach *s = u->s; + u64 b; + int n; + if (u->busy) + return; + b = bit_cycles(u); + n = nbits(u); + if (u->ntx && !((reg(u->conf0) & CONF0_TX_FLOW_EN) && u->cts)) { + u32 c = u->tx[0], bits = with_parity(u, c); + memmove(u->tx, u->tx + 1, (size_t)(u->ntx - 1)); + u->ntx--; + u->phase = 0; + run(u, b * (u64)(1 + n) + (b * (u64)stop_halves(u) + 1) / 2); + if (s->host.uart_frame) + s->host.uart_frame(s->host.ctx, u->p->name, (int)(c & ((1u << data_bits(u)) - 1u)), bits, n, + stop_halves(u), (u32)b); + else if (s->host.uart_tx) + s->host.uart_tx(s->host.ctx, u->p->name, (int)c, (u32)b); + if (reg(u->conf0) & CONF0_LOOPBACK) + receive(u, bits, 0, 0); + return; + } + if (!u->ntx && u->brk_left > 0) { + u->phase = 2; + u->brk_left--; + run(u, b * (u64)(1 + n + 1)); + if (s->host.uart_frame) + s->host.uart_frame(s->host.ctx, u->p->name, -1, 0, n + 1, 2, (u32)b); + } +} + +/* ---- the receiver ------------------------------------------------------------------ */ + +static void receive(struct e32_uart *u, u32 bits, int framing_error, int brk) +{ + int n = data_bits(u); + if (reg(u->conf0) & CONF0_RXFIFO_RST) + return; + u->rx_idle = 0; + if (brk) { + set_raw(u, RAW_BRK_DET); + } else { + if (!parity_ok(u, bits)) + set_raw(u, RAW_PARITY_ERR); + if (framing_error) + set_raw(u, RAW_FRM_ERR); + if (u->nrx < rx_cap(u)) { + u->rx[u->nrx++] = (u8)(bits & ((1u << n) - 1u)); + u->rx_wr = (u->rx_wr + 1u) % (u32)rx_cap(u); + u->rx_any = 1; + } else { + set_raw(u, RAW_RXFIFO_OVF); + } + } + clocking(u); /* the timeout counts in ticks */ + update(u); +} + +static int ur_room(void *ctx) +{ + const struct e32_uart *u = (const struct e32_uart *)ctx; + return !(reg(u->conf0) & CONF0_RXFIFO_RST); +} + +static void ur_put(void *ctx, int c) +{ + struct e32_uart *u = (struct e32_uart *)ctx; + receive(u, with_parity(u, (u32)c), 0, 0); +} + +static u32 ur_format(void *ctx) +{ + const struct e32_uart *u = (const struct e32_uart *)ctx; + return (u32)nbits(u) | (u32)stop_halves(u) << 8; +} + +static void ur_put_frame(void *ctx, u32 bits, int framing_error) +{ + struct e32_uart *u = (struct e32_uart *)ctx; + /* all zeros with a framing error: a break */ + receive(u, bits, framing_error, framing_error && !bits); +} + +static void ur_started(void *ctx) +{ + struct e32_uart *u = (struct e32_uart *)ctx; + u->rx_idle = 0; +} + +static u32 ur_bit_cycles(void *ctx) { return bit_cycles((const struct e32_uart *)ctx); } + +/* ---- the registers -------------------------------------------------------------------- */ + +static u32 ur_read(void *ctx, u32 off, int n) +{ + struct e32_uart *u = (struct e32_uart *)ctx; + if (off == esk_rf_off(u->fifo)) { + u32 v; + if (!u->nrx) + return 0; + v = u->rx[0]; + if (!u->s->bus.debug) { + memmove(u->rx, u->rx + 1, (size_t)(u->nrx - 1)); + u->nrx--; + u->rx_rd = (u->rx_rd + 1u) % (u32)rx_cap(u); + if (!u->nrx) + u->rx_any = 0; + update(u); + } + return v; + } + return esk_rf_read(u->p, off, n); +} + +static void ur_write(void *ctx, u32 off, int n, u32 v) +{ + struct e32_uart *u = (struct e32_uart *)ctx; + if (off == esk_rf_off(u->fifo)) { + if (!(reg(u->conf0) & CONF0_TXFIFO_RST) && u->ntx < tx_cap(u)) + u->tx[u->ntx++] = (u8)v; + } else if (off == esk_rf_off(u->clr)) { + esk_rf_hw(u->raw, reg(u->raw) & ~v); + } else if (off == esk_rf_off(u->raw) || off == esk_rf_off(u->st) || off == esk_rf_off(u->status)) { + /* read only */ + } else { + u32 was0 = reg(u->conf0); + esk_rf_write(u->p, off, n, v); + if (off == esk_rf_off(u->conf0)) { + if (reg(u->conf0) & CONF0_TXFIFO_RST) + u->ntx = 0; + if (reg(u->conf0) & CONF0_RXFIFO_RST) { + u->nrx = 0; + u->rx_rd = u->rx_wr = 0; + u->rx_any = 0; + } + if ((reg(u->conf0) & CONF0_TXD_BRK) && !(was0 & CONF0_TXD_BRK)) + u->brk_left = (int)((reg(u->idle) >> 20) & 0xffu); + } + } + tx_next(u); + update(u); +} + +static void ur_tick(void *ctx, u32 cycles) +{ + struct e32_uart *u = (struct e32_uart *)ctx; + u64 b = bit_cycles(u); + cycles = esk_mach_after(u->s, cycles, u->since); + if (u->rx_any && (reg(u->conf1) & CONF1_RX_TOUT_EN)) { + u64 thr = timeout_bits(u); + u->rx_idle += cycles; + if (u->rx_idle >= thr * b && u->nrx) { + set_raw(u, RAW_RXFIFO_TOUT); + u->rx_any = 0; + update(u); + } + } + if (!u->busy) { + clocking(u); + return; + } + if (u->left > cycles) { + u->left -= cycles; + return; + } + u->left = 0; + if (u->phase == 0) { + /* the frame is out; the FIFO empty, the transfer is over: at least + * TX_IDLE_NUM bit times of idle line before the next */ + u64 idle = (reg(u->idle) >> 10) & 0x3ffu; + if (!u->ntx) + set_raw(u, RAW_TX_DONE); + if (idle && !u->ntx) { + u->phase = 1; + u->left = idle * b; + u->since = u->s->cycles; + update(u); + return; + } + } else if (u->phase == 2) { + if (u->brk_left <= 0) + set_raw(u, RAW_TX_BRK_DONE | RAW_TX_BRK_IDLE_DONE); + } + u->busy = 0; + tx_next(u); + clocking(u); + update(u); +} + +static int ur_next(void *ctx, u32 *cycles) +{ + struct e32_uart *u = (struct e32_uart *)ctx; + u64 c = u->busy ? u->left : 0; + if (u->rx_any && (reg(u->conf1) & CONF1_RX_TOUT_EN)) { + u64 thr = timeout_bits(u) * bit_cycles(u); + u64 t = thr > u->rx_idle ? thr - u->rx_idle : 1; + if (!c || t < c) + c = t; + } + if (!c) + return 0; + *cycles = c > 0xffffffffu ? 0xffffffffu : (u32)c; + return 1; +} + +static void ur_reset(void *ctx) +{ + struct e32_uart *u = (struct e32_uart *)ctx; + u->ntx = u->nrx = 0; + u->rx_rd = u->rx_wr = 0; + u->busy = 0; + u->clocked = 0; + u->left = 0; + u->brk_left = 0; + u->rx_any = 0; + u->rx_idle = 0; + u->level = 0; + u->cts = 0; + update(u); +} + +const struct esk_dev_ops esk_esp32_uart_ops = { + "esp32-uart", ur_read, ur_write, ur_reset, ur_tick, ur_next, +}; + +void *esk_esp32_uart_create(struct esk_mach *s, struct esk_rf_periph *p) +{ + struct e32_uart *c; + if (strcmp(p->name, "UART0") && strcmp(p->name, "UART1") && strcmp(p->name, "UART2")) + return 0; + c = (struct e32_uart *)esk_mach_alloc(s, sizeof *c); + if (!c) + return 0; + memset(c, 0, sizeof *c); + c->s = s; + c->p = p; + c->unit = p->name[4] - '0'; + c->source = esk_rf_irq(p, p->name); + c->fifo = esk_rf_reg(p, "FIFO"); + c->raw = esk_rf_reg(p, "INT_RAW"); + c->st = esk_rf_reg(p, "INT_ST"); + c->ena = esk_rf_reg(p, "INT_ENA"); + c->clr = esk_rf_reg(p, "INT_CLR"); + c->clkdiv = esk_rf_reg(p, "CLKDIV"); + c->status = esk_rf_reg(p, "STATUS"); + c->conf0 = esk_rf_reg(p, "CONF0"); + c->conf1 = esk_rf_reg(p, "CONF1"); + c->idle = esk_rf_reg(p, "IDLE_CONF"); + c->mem = esk_rf_reg(p, "MEM_CONF"); + c->memcnt = esk_rf_reg(p, "MEM_CNT_STATUS"); + c->memrx = esk_rf_reg(p, "MEM_RX_STATUS"); + if (!c->fifo || !c->raw || !c->st || !c->ena || !c->clr || !c->clkdiv || !c->status || !c->conf0 || + !c->conf1 || !c->idle || !c->mem) + return 0; + esk_mach_rx_port(s, p->name, ur_room, ur_put, ur_bit_cycles, c); + esk_mach_rx_frames(s, ur_format, ur_put_frame, ur_started); + return c; +} diff --git a/core/mcu/mcu.c b/core/mcu/mcu.c index dc2222bab..05464c286 100644 --- a/core/mcu/mcu.c +++ b/core/mcu/mcu.c @@ -773,6 +773,8 @@ static int h_pin_volts(void *ctx, int port, int bit, double *v) n = p->net; if (n->island) *v = esk_net_voltage_now(p->net); /* an ADC samples it now */ + else if (st->pq[port][bit].cfg.aout) + *v = st->pq[port][bit].cfg.volts; /* the pin's own DAC, alone on its net */ else *v = esk_net_value(n) == ESK_L1 ? st->m.vdd : 0.0; return 1; @@ -1167,8 +1169,8 @@ static int irq_entry(const mcu_state *st, int n) return -1; if (!strcmp(arch, "cortex-m") || !strcmp(arch, "mips")) want = n - 16; /* 16 + the vector */ - else if (!strcmp(arch, "riscv")) - return -1; + else if (!strcmp(arch, "riscv") || !strcmp(arch, "xtensa")) + return -1; /* causes and CPU interrupt numbers, not the matrix's sources */ else want = n; /* the vector itself (an AVR's, a PIC24's) */ for (i = 0; want >= 0 && i < rf->nirq; i++) diff --git a/core/mcu/models.c b/core/mcu/models.c index a2dbc1c5f..b7cfbea77 100644 --- a/core/mcu/models.c +++ b/core/mcu/models.c @@ -5,6 +5,7 @@ #include #include "mcu/avr/avr.h" +#include "mcu/esp32/soc/esp32.h" #include "mcu/esp32c3/esp32c3.h" #include "mcu/nrf52/nrf52.h" #include "mcu/pic24/pic24.h" @@ -61,6 +62,21 @@ static const struct esk_rf_model_type model_types[] = { { "fe310-aon", &esk_fe310_aon_ops, esk_fe310_aon_create }, { "fe310-pwm", &esk_fe310_pwm_ops, esk_fe310_pwm_create }, { "fe310-spi", &esk_fe310_spi_ops, esk_fe310_spi_create }, + { "esp32-dport", &esk_esp32_dport_ops, esk_esp32_dport_create }, + { "esp32-efuse", &esk_esp32_efuse_ops, esk_esp32_efuse_create }, + { "esp32-rtc", &esk_esp32_rtc_ops, esk_esp32_rtc_create }, + { "esp32-uart", &esk_esp32_uart_ops, esk_esp32_uart_create }, + { "esp32-apbctrl", &esk_esp32_apbctrl_ops, esk_esp32_apbctrl_create }, + { "esp32-gpio", &esk_esp32_gpio_ops, esk_esp32_gpio_create }, + { "esp32-spi", &esk_esp32_spi_ops, esk_esp32_spi_create }, + { "esp32-timg", &esk_esp32_timg_ops, esk_esp32_timg_create }, + { "esp32-sha", &esk_esp32_sha_ops, esk_esp32_sha_create }, + { "esp32-ledc", &esk_esp32_ledc_ops, esk_esp32_ledc_create }, + { "esp32-i2c", &esk_esp32_i2c_ops, esk_esp32_i2c_create }, + { "esp32-rmt", &esk_esp32_rmt_ops, esk_esp32_rmt_create }, + { "esp32-sens", &esk_esp32_adc_ops, esk_esp32_adc_create }, + { "esp32-rtcio", &esk_esp32_rtcio_ops, esk_esp32_rtcio_create }, + { "esp32-iomux", &esk_esp32_iomux_ops, esk_esp32_iomux_create }, { "esp32c3-intmtx", &esk_esp32c3_intmtx_ops, esk_esp32c3_intmtx_create }, { "esp32c3-uart", &esk_esp32c3_uart_ops, esk_esp32c3_uart_create }, { "esp32c3-rtc", &esk_esp32c3_rtc_ops, esk_esp32c3_rtc_create }, diff --git a/core/mcu/rf.c b/core/mcu/rf.c index fb8fa4750..09688157d 100644 --- a/core/mcu/rf.c +++ b/core/mcu/rf.c @@ -853,6 +853,15 @@ struct esk_rf_reg *esk_rf_reg(struct esk_rf_periph *p, const char *name) return 0; } +struct esk_rf_reg *esk_rf_reg_at(struct esk_rf_periph *p, u32 off) +{ + int i; + for (i = 0; p && i < p->nreg; i++) + if (p->reg[i]->addr - p->base == off) + return p->reg[i]; + return 0; +} + u64 esk_rf_mask(const struct esk_rf_reg *r, const char *field) { int i; diff --git a/core/mcu/rf.h b/core/mcu/rf.h index 71286b003..9afc95be6 100644 --- a/core/mcu/rf.h +++ b/core/mcu/rf.h @@ -221,6 +221,8 @@ struct esk_rf_periph *esk_rf_periph_at(struct esk_rf *rf, int i); * answer is kept, as a model's context does not move once created */ void *esk_rf_ctx_of(struct esk_rf *rf, const void *ops); struct esk_rf_reg *esk_rf_reg(struct esk_rf_periph *p, const char *name); +/* the register at offset `off` from the peripheral's base, or 0 */ +struct esk_rf_reg *esk_rf_reg_at(struct esk_rf_periph *p, u32 off); /* the bits of the register's field of that name, or 0 */ u64 esk_rf_mask(const struct esk_rf_reg *r, const char *field); /* the program's read and write, as the description says the fields behave */ diff --git a/core/mcu/xtensa/lx6.c b/core/mcu/xtensa/lx6.c new file mode 100644 index 000000000..d2fb215f9 --- /dev/null +++ b/core/mcu/xtensa/lx6.c @@ -0,0 +1,2171 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* lx6.c -- the ESP32's Xtensa LX6 cores (Cadence's Xtensa Instruction Set + * Architecture Reference Manual; the configuration of Espressif's + * core-isa.h for the ESP32, esp32_v3_49_prod, LX6.0.3), two of them as + * the chip's PRO_CPU and APP_CPU behind the machine's one core interface. + * + * The configuration, as core-isa.h states it: + * - the core instructions with the density (16-bit) instructions, + * zero-overhead loops, NSA/NSAU, MIN/MAX, SEXT, CLAMPS, MUL16, MULL, + * MULUH/MULSH, QUOS/QUOU/REMS/REMU, ADDX/SUBX, ABS, L32AI/S32RI, + * S32C1I with SCOMPARE1 and ATOMCTL, booleans (16), THREADPTR, four + * MISC registers, PRID (0xCDCD on PRO_CPU, 0xABAB on APP_CPU), the + * external registers' RER/WER, the MAC16 package and the single + * precision floating-point coprocessor (CP0, lx6fp.c); + * - the windowed registers: 64 physical, WindowBase and WindowStart, + * CALL4/8/12, ENTRY, RETW, MOVSP, ROTW, the window overflow check of + * every instruction while PS.WOE is set and PS.EXCM clear (the frame + * of the first live window above the registers it names spilled by + * the WindowOverflow4/8/12 vector), RETW's underflow, RFWO/RFWU, and + * L32E/S32E for the handlers; + * - the exception architecture XEA2: EPC1, EXCCAUSE, EXCVADDR, the + * kernel, user and double exception vectors, DEPC; relocatable + * vectors (VECBASE, 0x40000000 at reset); + * - 32 interrupts at core-isa.h's levels (1-5, the debug level 6, the + * NMI at 7) and types (level, edge, software 7 and 29, timers 6, 15 + * and 16 from CCOMPARE0-2 against CCOUNT, profiling 11), INTERRUPT, + * INTSET, INTCLEAR, INTENABLE, EXCMLEVEL 3, RSIL, WAITI, RFI; + * - the debug option's BREAK, BREAK.N, two IBREAKs, two DBREAKs and + * ICOUNT, raising the debug exception (level 6) with DEBUGCAUSE; + * - region protection: eight 512 MB regions in each of the instruction + * and data TLBs, attribute 2 at reset, 15 a region no access reaches + * (InstFetchProhibited, LoadProhibited, StoreProhibited); + * - unaligned loads and stores done by the hardware (no alignment + * exception); the ESP32's instruction bus (0x40000000-0x40BFFFFF: + * ROM, IRAM, the flash's instruction window) takes 32-bit aligned + * loads and stores only, others raising LoadStoreError, as the + * chip's TRM says (chapter 1.3.2.2); + * - no MMU, no Xtensa caches (the cache instructions do nothing), one + * ring, MEMCTL's loop buffer as storage (it changes no result). + * An access nothing answers raises the PIF address error (14 for a + * fetch, 15 for a load or store), and is reported (esk_mach_bus_error). + * + * Where it differs inside: each instruction takes an estimated time (one + * cycle, a taken branch, jump, call or return three, a load one, MULL + * and the high products two, a division twelve, an exception's entry + * three); the pipeline, its interlocks and the loop buffer's timing are + * not modelled. CCOUNT counts those cycles. + * + * Two cores share the machine as mcu/cortexm/smp.c's do: each keeps its + * own time, the one furthest behind runs next, the devices see the + * earliest. APP_CPU starts held in reset, its clock gated, until the + * part's DPORT model releases it (esk_lx6_core_reset, _stall). + * + * Written for EmbSIM from the ISA reference and core-isa.h; it shares no + * code with the experimental engine in windows.c and execute.c, whose + * notes on the ESP32's interrupt levels and types it agrees with. */ +#include +#include +#include + +#include "mcu/xtensa/lx6.h" + +#define NCORES 2 + +/* PS */ +#define PS_INTLEVEL 0xfu +#define PS_EXCM 0x10u +#define PS_UM 0x20u +#define PS_OWB_SHIFT 8 +#define PS_OWB (0xfu << PS_OWB_SHIFT) +#define PS_CALLINC_SHIFT 16 +#define PS_CALLINC (3u << PS_CALLINC_SHIFT) +#define PS_WOE 0x40000u +#define PS_MASK 0x00070f3fu + +/* EXCCAUSE */ +#define EXC_ILLEGAL 0u +#define EXC_SYSCALL 1u +#define EXC_LOADSTORE 3u +#define EXC_LEVEL1 4u +#define EXC_ALLOCA 5u +#define EXC_DIVZERO 6u +#define EXC_IFETCH_ADDR 14u +#define EXC_LS_ADDR 15u +#define EXC_IFETCH_PROHIBITED 20u +#define EXC_LOAD_PROHIBITED 28u +#define EXC_STORE_PROHIBITED 29u +#define EXC_CP0_DISABLED 32u + +/* DEBUGCAUSE */ +#define DBG_ICOUNT 0x1u +#define DBG_IBREAK 0x2u +#define DBG_DBREAK 0x4u +#define DBG_BREAK 0x8u +#define DBG_BREAKN 0x10u + +/* the interrupts' types and levels (core-isa.h) */ +#define INT_SOFTWARE 0x20000080u +#define INT_EDGE 0x50400400u +#define INT_NMI 0x00004000u +#define INT_LATCHED (INT_SOFTWARE | INT_EDGE | INT_NMI) +static const u32 level_mask[8] = { 0, 0x000637ffu, 0x00380000u, 0x28c08800u, 0x53000000u, + 0x84010000u, 0, 0x00004000u }; +static const int timer_int[3] = { 6, 15, 16 }; +#define EXCM_LEVEL 3u +#define DEBUG_LEVEL 6u + +/* the vectors' offsets from VECBASE */ +#define VEC_OF4 0x000u +#define VEC_UF4 0x040u +#define VEC_OF8 0x080u +#define VEC_UF8 0x0c0u +#define VEC_OF12 0x100u +#define VEC_UF12 0x140u +static const u32 level_vec[8] = { 0, 0, 0x180u, 0x1c0u, 0x200u, 0x240u, 0x280u, 0x2c0u }; +#define VEC_KERNEL 0x300u +#define VEC_USER 0x340u +#define VEC_DOUBLE 0x3c0u + +#define CONFIGID0 0xC2BCFFFEu +#define CONFIGID1 0x1CC5FE96u + +struct smp; + +struct lx6 { + struct esk_cpu cpu; /* first */ + struct esk_mach *m; + struct smp *x; + int id; + u32 ar[64]; + u32 pc, npc; + u32 wb, ws; /* WindowBase, WindowStart */ + u32 ps, sar, lbeg, lend, lcount, br, scompare1; + u32 acclo, acchi, mr[4]; + u32 epc[8], eps[8], excsave[8], depc, exccause, excvaddr, debugcause; + u32 intenable, lines, latched; + u32 vecbase, ccompare[3]; + u64 ccount_at; /* the core's time CCOUNT counts from */ + u32 ccount_base; + u32 cpenable, threadptr, fcr, fsr, f[16], misc[4], prid, atomctl, memctl; + u32 expstate, f64r_lo, f64r_hi, f64s; /* the ESP32's double-precision accelerator's state */ + u32 ibreakenable, ibreaka[2], dbreaka[2], dbreakc[2], icount, icountlevel, ddr; + u32 itlb[8], dtlb[8]; + u32 reset_vector; + /* the core's own view of read-only memory, ahead of the bus (the + * ESP32's APP_CPU's ROM): base, size and bytes */ + struct { + u32 base, size; + const u8 *mem; + } view[2]; + int nview; + int exc; /* the instruction took an exception: nothing more of it */ + int jumped; /* it branched, jumped, called or returned: no loop-back */ + int waiti; /* waiting in WAITI */ + u32 cost; +}; + +enum { CORE_RUN, CORE_SLEEP, CORE_HELD, CORE_STALLED }; + +struct smp { + struct esk_cpu cpu; /* first */ + struct esk_mach *m; + int n; + struct lx6 *c[NCORES]; + int state[NCORES]; + int held[NCORES], stalled[NCORES]; + u64 lt[NCORES]; + int cur, stepping; + int running; +}; + +/* ---- registers -------------------------------------------------------- */ + +#define AR(c, i) ((c)->ar[((c)->wb * 4u + (u32)(i)) & 63u]) + +static u32 sext(u32 v, int bits) +{ + u32 b = 1u << (bits - 1); + v &= (b << 1) - 1u; + return (v ^ b) - b; +} + +/* the core's time: the machine's while its instruction runs */ +static u64 now(const struct lx6 *c) +{ + return c->m->cycles; +} + +static u32 ccount(const struct lx6 *c) +{ + return c->ccount_base + (u32)(now(c) - c->ccount_at); +} + +static u32 interrupt_reg(const struct lx6 *c) +{ + return (c->lines & ~INT_LATCHED) | c->latched; +} + +/* WindowStart turned so that bit 0 is WindowBase's */ +static u32 ws_rot(const struct lx6 *c) +{ + u32 w = c->ws | c->ws << 16; + return (w >> c->wb) & 0xffffu; +} + +/* ---- exceptions ------------------------------------------------------- */ + +static void to(struct lx6 *c, u32 pc) +{ + c->npc = pc; + c->exc = 1; +} + +static void exception(struct lx6 *c, u32 cause) +{ + c->exccause = cause; + if (c->ps & PS_EXCM) { + c->depc = c->pc; + to(c, c->vecbase + VEC_DOUBLE); + } else { + c->epc[1] = c->pc; + to(c, c->vecbase + ((c->ps & PS_UM) ? VEC_USER : VEC_KERNEL)); + c->ps |= PS_EXCM; + } + c->cost += 2; + esk_mach_exc(c->m, c->id, (int)cause, c->pc); +} + +static void mem_exception(struct lx6 *c, u32 cause, u32 a) +{ + c->excvaddr = a; + exception(c, cause); +} + +void esk_lx6_illegal(struct lx6 *c) +{ + exception(c, EXC_ILLEGAL); +} + +/* a high-priority interrupt or the debug exception at `level` */ +static void level_entry(struct lx6 *c, u32 level, u32 epc) +{ + c->epc[level] = epc; + c->eps[level] = c->ps; + c->ps = (c->ps & ~PS_INTLEVEL) | level | PS_EXCM; + to(c, c->vecbase + level_vec[level]); + c->cost += 2; +} + +static void debug_exception(struct lx6 *c, u32 cause) +{ + if ((c->ps & PS_INTLEVEL) >= DEBUG_LEVEL) + return; + c->debugcause = cause; + level_entry(c, DEBUG_LEVEL, c->pc); + esk_mach_exc(c->m, c->id, 64 + (int)DEBUG_LEVEL, c->pc); +} + +/* the window overflow check: registers up to `hi` must be the frame's */ +static int win(struct lx6 *c, u32 hi) +{ + u32 n, w, owb, k; + if (hi < 4 || (c->ps & (PS_WOE | PS_EXCM)) != PS_WOE) + return 0; + w = ws_rot(c) >> 1; + if (!(w & ((1u << (hi >> 2)) - 1u))) + return 0; + /* the first live frame above is spilled: rotate to it */ + for (n = 1; !(w & 1u); n++) + w >>= 1; + w >>= 1; + owb = c->wb; + c->wb = (c->wb + n) & 15u; + c->ps = (c->ps & ~PS_OWB) | owb << PS_OWB_SHIFT | PS_EXCM; + c->epc[1] = c->pc; + for (k = 0; k < 3 && !(w & 1u); k++) + w >>= 1; + to(c, c->vecbase + (k == 0 ? VEC_OF4 : k == 1 ? VEC_OF8 : VEC_OF12)); + c->cost += 2; + return 1; +} + +/* ---- memory ----------------------------------------------------------- */ + +static int prohibited(u32 attr) +{ + return attr == 15u; +} + +/* the ESP32's instruction bus: 32-bit aligned data accesses only */ +static int ibus_narrow(u32 a, int n) +{ + return a >= 0x40000000u && a < 0x40c00000u && (n != 4 || (a & 3u)); +} + +static int dbreak_hit(struct lx6 *c, u32 a, int n, int store) +{ + int i; + for (i = 0; i < 2; i++) { + u32 ctl = c->dbreakc[i], mask; + if (!(ctl & (store ? 0x80000000u : 0x40000000u))) + continue; + /* MASK's set bits are the low address bits compared (ESP-IDF's + * 32-byte stack-end watchpoint: 0x20, bits 4:0 ignored) */ + mask = 0xffffffc0u | (ctl & 0x3fu); + if (((a ^ c->dbreaka[i]) & mask) == 0 || + (((a + (u32)n - 1u) ^ c->dbreaka[i]) & mask) == 0) { + if ((c->ps & PS_INTLEVEL) < DEBUG_LEVEL) { + c->debugcause = DBG_DBREAK | (u32)i << 8; + level_entry(c, DEBUG_LEVEL, c->pc); + return 1; + } + } + } + return 0; +} + +int esk_lx6_load(struct lx6 *c, u32 a, int n, u32 *v) +{ + struct esk_bus *b = &c->m->bus; + struct esk_region *r; + int i; + *v = 0; + if (prohibited(c->dtlb[a >> 29])) { + mem_exception(c, EXC_LOAD_PROHIBITED, a); + return -1; + } + if (ibus_narrow(a, n)) { + mem_exception(c, EXC_LOADSTORE, a); + return -1; + } + if (b->nwatch && esk_bus_watch_check(b, a, n, 0)) { + c->m->yield = 1; + c->exc = 2; /* not run: the debugger stops before it */ + return -1; + } + if ((c->dbreakc[0] | c->dbreakc[1]) && dbreak_hit(c, a, n, 0)) + return -1; + for (i = 0; i < c->nview; i++) + if (a - c->view[i].base < c->view[i].size && c->view[i].size - (a - c->view[i].base) >= (u32)n) { + const u8 *p = c->view[i].mem + (a - c->view[i].base); + u32 x = 0; + int j; + for (j = n - 1; j >= 0; j--) + x = x << 8 | p[j]; + *v = x; + return 0; + } + r = esk_bus_region(b, a, (u32)n); + if (r) { + const u8 *p = r->mem + (a - r->base); + u32 x = 0; + for (i = n - 1; i >= 0; i--) + x = x << 8 | p[i]; + *v = x; + if (b->trace) + esk_bus_traced(b, a, n, 0, x, 0); + return 0; + } + for (i = 0; i < n;) { + u32 x; + int k = n - i >= 4 && !((a + (u32)i) & 3u) ? 4 : n - i >= 2 && !((a + (u32)i) & 1u) ? 2 : 1; + if (esk_bus_read(b, a + (u32)i, k, &x)) { + esk_bus_traced(b, a + (u32)i, k, 0, 0, 1); + esk_mach_bus_error(c->m, a, n, 0); + mem_exception(c, EXC_LS_ADDR, a); + return -1; + } + esk_bus_traced(b, a + (u32)i, k, 0, x, 0); + *v |= x << (8 * i); + i += k; + } + return 0; +} + +int esk_lx6_store(struct lx6 *c, u32 a, int n, u32 v) +{ + struct esk_bus *b = &c->m->bus; + struct esk_region *r; + int i; + if (prohibited(c->dtlb[a >> 29])) { + mem_exception(c, EXC_STORE_PROHIBITED, a); + return -1; + } + if (ibus_narrow(a, n)) { + mem_exception(c, EXC_LOADSTORE, a); + return -1; + } + if (b->nwatch && esk_bus_watch_check(b, a, n, 1)) { + c->m->yield = 1; + c->exc = 2; + return -1; + } + if ((c->dbreakc[0] | c->dbreakc[1]) && dbreak_hit(c, a, n, 1)) + return -1; + r = esk_bus_region(b, a, (u32)n); + if (r) { + if (!r->rom) { + u8 *p = r->mem + (a - r->base); + for (i = 0; i < n; i++) + p[i] = (u8)(v >> (8 * i)); + } + if (b->trace) + esk_bus_traced(b, a, n, 1, v, 0); + return 0; + } + for (i = 0; i < n;) { + int k = n - i >= 4 && !((a + (u32)i) & 3u) ? 4 : n - i >= 2 && !((a + (u32)i) & 1u) ? 2 : 1; + u32 x = v >> (8 * i); + if (k < 4) + x &= (1u << (8 * k)) - 1u; + if (esk_bus_write(b, a + (u32)i, k, x)) { + esk_bus_traced(b, a + (u32)i, k, 1, x, 1); + esk_mach_bus_error(c->m, a, n, 1); + mem_exception(c, EXC_LS_ADDR, a); + return -1; + } + esk_bus_traced(b, a + (u32)i, k, 1, x, 0); + i += k; + } + return 0; +} + +/* the instruction's bytes at pc: 0, or -1 (nothing answers) */ +static int fetch(struct lx6 *c, u32 pc, u32 *w) +{ + struct esk_bus *b = &c->m->bus; + struct esk_region *r; + u32 lo, hi = 0; + int i; + for (i = 0; i < c->nview; i++) + if (pc - c->view[i].base < c->view[i].size && c->view[i].size - (pc - c->view[i].base) >= 3u) { + const u8 *p = c->view[i].mem + (pc - c->view[i].base); + *w = (u32)p[0] | (u32)p[1] << 8 | (u32)p[2] << 16; + return 0; + } + r = esk_bus_region(b, pc, 3); + if (r) { + const u8 *p = r->mem + (pc - r->base); + *w = (u32)p[0] | (u32)p[1] << 8 | (u32)p[2] << 16; + return 0; + } + r = esk_bus_region(b, pc, 2); + if (r) { /* a narrow instruction at a region's end */ + const u8 *p = r->mem + (pc - r->base); + *w = (u32)p[0] | (u32)p[1] << 8; + if ((p[0] & 15u) < 8u) { + if (esk_bus_read(b, pc + 2u, 1, &hi)) + return -1; + *w |= (hi & 0xffu) << 16; + } + return 0; + } + if (esk_bus_read(b, pc & ~3u, 4, &lo)) + return -1; + if ((pc & 3u) >= 2u) { + u32 need = (pc & 3u) == 3u ? 3u : ((lo >> 16) & 15u) < 8u ? 3u : 2u; + if (need > 4u - (pc & 3u) && esk_bus_read(b, (pc & ~3u) + 4u, 4, &hi)) + return -1; + } + *w = (u32)(((u64)hi << 32 | lo) >> (8 * (pc & 3u))) & 0xffffffu; + return 0; +} + +/* ---- special registers ------------------------------------------------ */ + +static void timer_check(struct lx6 *c, u32 from, u32 cycles) +{ + int i; + for (i = 0; i < 3; i++) { + u32 d = c->ccompare[i] - from; + if (d && d <= cycles) + c->latched |= 1u << timer_int[i]; + } +} + +static void set_ccount(struct lx6 *c, u32 v) +{ + c->ccount_base = v; + c->ccount_at = now(c); +} + +/* RSR: 0, or -1 for no such register */ +static int rsr(struct lx6 *c, u32 sr, u32 *v) +{ + switch (sr) { + case 0: *v = c->lbeg; return 0; + case 1: *v = c->lend; return 0; + case 2: *v = c->lcount; return 0; + case 3: *v = c->sar; return 0; + case 4: *v = c->br; return 0; + case 12: *v = c->scompare1; return 0; + case 16: *v = c->acclo; return 0; + case 17: *v = sext(c->acchi, 8); return 0; + case 32: case 33: case 34: case 35: *v = c->mr[sr - 32]; return 0; + case 72: *v = c->wb; return 0; + case 73: *v = c->ws; return 0; + case 96: *v = c->ibreakenable; return 0; + case 97: *v = c->memctl; return 0; + case 99: *v = c->atomctl; return 0; + case 104: *v = c->ddr; return 0; + case 128: case 129: *v = c->ibreaka[sr - 128]; return 0; + case 144: case 145: *v = c->dbreaka[sr - 144]; return 0; + case 160: case 161: *v = c->dbreakc[sr - 160]; return 0; + case 176: *v = CONFIGID0; return 0; + case 208: *v = CONFIGID1; return 0; + case 192: *v = c->depc; return 0; + case 224: *v = c->cpenable; return 0; + case 226: *v = interrupt_reg(c); return 0; + case 228: *v = c->intenable; return 0; + case 230: *v = c->ps; return 0; + case 231: *v = c->vecbase; return 0; + case 232: *v = c->exccause; return 0; + case 233: *v = c->debugcause; return 0; + case 234: *v = ccount(c); return 0; + case 235: *v = c->prid; return 0; + case 236: *v = c->icount; return 0; + case 237: *v = c->icountlevel; return 0; + case 238: *v = c->excvaddr; return 0; + case 240: case 241: case 242: *v = c->ccompare[sr - 240]; return 0; + case 244: case 245: case 246: case 247: *v = c->misc[sr - 244]; return 0; + } + if (sr >= 177 && sr <= 183) { + *v = c->epc[sr - 176]; + return 0; + } + if (sr >= 194 && sr <= 199) { + *v = c->eps[sr - 192]; + return 0; + } + if (sr >= 209 && sr <= 215) { + *v = c->excsave[sr - 208]; + return 0; + } + return -1; +} + +static int wsr(struct lx6 *c, u32 sr, u32 v) +{ + switch (sr) { + case 0: c->lbeg = v; return 0; + case 1: c->lend = v; return 0; + case 2: c->lcount = v; return 0; + case 3: c->sar = v & 0x3fu; return 0; + case 4: c->br = v & 0xffffu; return 0; + case 12: c->scompare1 = v; return 0; + case 16: c->acclo = v; return 0; + case 17: c->acchi = v & 0xffu; return 0; + case 32: case 33: case 34: case 35: c->mr[sr - 32] = v; return 0; + case 72: c->wb = v & 15u; return 0; + case 73: c->ws = v & 0xffffu; return 0; + case 96: c->ibreakenable = v & 3u; return 0; + case 97: c->memctl = v; return 0; + case 99: c->atomctl = v & 0x3fu; return 0; + case 104: c->ddr = v; return 0; + case 128: case 129: c->ibreaka[sr - 128] = v; return 0; + case 144: case 145: c->dbreaka[sr - 144] = v; return 0; + case 160: case 161: c->dbreakc[sr - 160] = v & 0xc000003fu; return 0; + case 192: c->depc = v; return 0; + case 224: c->cpenable = v & 0xffu; return 0; + case 226: c->latched |= v & INT_SOFTWARE; return 0; /* INTSET */ + case 227: c->latched &= ~(v & (INT_SOFTWARE | INT_EDGE)); return 0; /* INTCLEAR */ + case 228: c->intenable = v; return 0; + case 230: c->ps = v & PS_MASK; return 0; + case 231: c->vecbase = v & ~0x3ffu; return 0; + case 232: c->exccause = v & 0x3fu; return 0; + case 233: return 0; /* DEBUGCAUSE: read-only */ + case 234: set_ccount(c, v); return 0; + case 235: return 0; /* PRID: read-only */ + case 236: c->icount = v; return 0; + case 237: c->icountlevel = v & 15u; return 0; + case 238: c->excvaddr = v; return 0; + case 240: case 241: case 242: + c->ccompare[sr - 240] = v; + c->latched &= ~(1u << timer_int[sr - 240]); + return 0; + case 244: case 245: case 246: case 247: c->misc[sr - 244] = v; return 0; + } + if (sr >= 177 && sr <= 183) { + c->epc[sr - 176] = v; + return 0; + } + if (sr >= 194 && sr <= 199) { + c->eps[sr - 192] = v & PS_MASK; + return 0; + } + if (sr >= 209 && sr <= 215) { + c->excsave[sr - 208] = v; + return 0; + } + if (sr == 176 || sr == 208) + return 0; /* CONFIGID: read-only */ + return -1; +} + +/* the user registers: THREADPTR, the FPU's FCR and FSR, and the ESP32's + * EXPSTATE and double-precision accelerator registers F64R_LO, F64R_HI, + * F64S (core-isa.h's XCHAL_HAVE_DFP_ACCEL; Espressif's xtensa-modules) */ +static u32 *dfp_ur(struct lx6 *c, u32 ur) +{ + switch (ur) { + case 230: return &c->expstate; + case 234: return &c->f64r_lo; + case 235: return &c->f64r_hi; + case 236: return &c->f64s; + } + return 0; +} + +static int rur(struct lx6 *c, u32 ur, u32 *v) +{ + if (ur == 231) { + *v = c->threadptr; + return 0; + } + if (dfp_ur(c, ur)) { + *v = *dfp_ur(c, ur); + return 0; + } + if (ur == 232 || ur == 233) { + if (!(c->cpenable & 1u)) { + exception(c, EXC_CP0_DISABLED); + return 1; + } + *v = ur == 232 ? c->fcr : c->fsr; + return 0; + } + return -1; +} + +static int wur(struct lx6 *c, u32 ur, u32 v) +{ + if (ur == 231) { + c->threadptr = v; + return 0; + } + if (dfp_ur(c, ur)) { + *dfp_ur(c, ur) = v; + return 0; + } + if (ur == 232 || ur == 233) { + if (!(c->cpenable & 1u)) { + exception(c, EXC_CP0_DISABLED); + return 1; + } + if (ur == 232) + c->fcr = v & 0x7fu; + else + c->fsr = v & 0xf80u; + return 0; + } + return -1; +} + +/* ---- the instructions ------------------------------------------------- */ + +#define OP0(w) ((w) & 15u) +#define FT(w) (((w) >> 4) & 15u) +#define FS(w) (((w) >> 8) & 15u) +#define FR(w) (((w) >> 12) & 15u) +#define OP1(w) (((w) >> 16) & 15u) +#define OP2(w) (((w) >> 20) & 15u) +#define IMM8(w) (((w) >> 16) & 255u) + +static const u32 b4const[16] = { 0xffffffffu, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16, 32, 64, 128, 256 }; +static const u32 b4constu[16] = { 32768, 65536, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16, 32, 64, 128, 256 }; + +static u32 max3(u32 a, u32 b, u32 c) +{ + u32 m = a > b ? a : b; + return m > c ? m : c; +} + +static void branch(struct lx6 *c, int taken, u32 target) +{ + if (taken) { + c->npc = target; + c->jumped = 1; + c->cost += 2; + } +} + +/* a call: return address and CALLINC, then the target */ +static void call(struct lx6 *c, u32 n, u32 target, u32 len) +{ + if (n) { + AR(c, n * 4u) = n << 30 | ((c->pc + len) & 0x3fffffffu); + c->ps = (c->ps & ~PS_CALLINC) | n << PS_CALLINC_SHIFT; + } else { + AR(c, 0) = c->pc + len; + } + c->npc = target; + c->jumped = 1; + c->cost += 2; +} + +static void retw(struct lx6 *c) +{ + u32 a0 = AR(c, 0), n = a0 >> 30, owb = c->wb, m = 0, k; + for (k = 1; k <= 3; k++) + if ((c->ws >> ((c->wb - k) & 15u)) & 1u) { + m = k; + break; + } + if (n == 0 || (m != 0 && m != n) || (c->ps & (PS_WOE | PS_EXCM)) != PS_WOE) { + esk_lx6_illegal(c); + return; + } + c->wb = (c->wb - n) & 15u; + c->cost += 2; + if ((c->ws >> c->wb) & 1u) { + c->ws &= ~(1u << owb); + c->jumped = 1; + c->npc = (c->pc & 0xc0000000u) | (a0 & 0x3fffffffu); + } else { + /* the caller's frame was spilled: the underflow handler brings + * it back, and RETW runs again */ + c->ps = (c->ps & ~PS_OWB) | owb << PS_OWB_SHIFT | PS_EXCM; + c->epc[1] = c->pc; + to(c, c->vecbase + (n == 1 ? VEC_UF4 : n == 2 ? VEC_UF8 : VEC_UF12)); + } +} + +static void entry(struct lx6 *c, u32 s, u32 imm) +{ + u32 callinc = (c->ps & PS_CALLINC) >> PS_CALLINC_SHIFT, v; + if (s > 3 || (c->ps & (PS_WOE | PS_EXCM)) != PS_WOE) { + esk_lx6_illegal(c); + return; + } + if (win(c, callinc * 4u + s)) + return; + v = AR(c, s) - imm; + AR(c, callinc * 4u + s) = v; + c->wb = (c->wb + callinc) & 15u; + c->ws |= 1u << c->wb; +} + +static void rfwo(struct lx6 *c, int underflow) +{ + if (underflow) + c->ws |= 1u << c->wb; + else + c->ws &= ~(1u << c->wb); + c->wb = (c->ps & PS_OWB) >> PS_OWB_SHIFT; + c->ps &= ~PS_EXCM; + c->npc = c->epc[1]; + c->cost += 2; +} + +static u32 nsa(u32 v) +{ + u32 n = 0; + v ^= (u32)((s32)v >> 31); + if (!v) + return 31; + while (!(v & 0x80000000u)) { + v <<= 1; + n++; + } + return n - 1u; +} + +static u32 nsau(u32 v) +{ + u32 n = 0; + if (!v) + return 32; + while (!(v & 0x80000000u)) { + v <<= 1; + n++; + } + return n; +} + +/* the external registers (RER/WER): the debug, trace and performance + * monitor blocks, which no one drives here: reads are 0 */ +static u32 rer(struct lx6 *c, u32 a) +{ + ES_UNUSED(c); + ES_UNUSED(a); + return 0; +} + +/* the MAC16 package: 16 x 16-bit products of the operands' halves into + * the 40-bit accumulator ACCHI:ACCLO (UMUL, MUL: set; MULA: add; MULS: + * subtract), the operands from AR (A) or M0-M3 (D), and the forms that + * load an M register meanwhile (LDINC, LDDEC: the address register moves + * by 4 first). op2: 0 DD.LDINC, 1 DD.LDDEC, 2 DD, 3 AD, 4 DA.LDINC, + * 5 DA.LDDEC, 6 DA, 7 AA, 8 LDINC, 9 LDDEC; op1: the operation (bits 3:2) + * and the halves (bit 0 the first operand's high half, bit 1 the + * second's) */ +static void mac16(struct lx6 *c, u32 w) +{ + u32 op2 = OP2(w), op1 = OP1(w), r = FR(w), s = FS(w), t = FT(w); + u32 x, y, oper = op1 >> 2, lda = 0, ldv = 0, hi = 0; + int ld = op2 <= 1 || op2 == 4 || op2 == 5 || op2 == 8 || op2 == 9; + int dec = op2 == 1 || op2 == 5 || op2 == 9; + int first_m = op2 <= 2 || (op2 >= 4 && op2 <= 6); + int second_m = op2 <= 3; + s64 acc, p; + if (op2 > 9 || (op2 >= 8 && (op1 || t)) || (op2 < 8 && oper == 0 && op2 != 7)) { + esk_lx6_illegal(c); + return; + } + if (op2 < 8) { + if (!first_m) + hi = s; + if (!second_m) + hi = t > hi ? t : hi; + } + if (ld) + hi = s > hi ? s : hi; + if (win(c, hi)) + return; + if (ld) { + lda = AR(c, s) + (dec ? (u32)-4 : 4u); + if (esk_lx6_load(c, lda, 4, &ldv)) + return; + } + if (op2 < 8) { + x = first_m ? c->mr[(r >> 2) & 1u] : AR(c, s); + y = second_m ? c->mr[2u + ((t >> 2) & 1u)] : AR(c, t); + x = (op1 & 1u) ? x >> 16 : x & 0xffffu; + y = (op1 & 2u) ? y >> 16 : y & 0xffffu; + if (oper == 0) + p = (s64)((u64)(x & 0xffffu) * (u64)(y & 0xffffu)); + else + p = (s64)(s32)sext(x, 16) * (s64)(s32)sext(y, 16); + acc = (s64)(((u64)(c->acchi & 0xffu) << 32 | c->acclo) << 24) >> 24; + acc = oper <= 1 ? p : oper == 2 ? acc + p : acc - p; + c->acclo = (u32)(u64)acc; + c->acchi = (u32)((u64)acc >> 32) & 0xffu; + } + if (ld) { + c->mr[r & 3u] = ldv; + AR(c, s) = lda; + } +} + +/* the ESP32's double-precision accelerator instructions (F64ITER, + * F64RND, F64ADDC, F64SUBC, F64SIG, F64CMPL, F64CMPH, F64NORM, F64SEXP, + * RF64R: Espressif's xtensa-modules): Espressif publishes their encodings, + * not what they do, so the run ends here rather than guessing */ +static void dfp(struct lx6 *c, u32 w) +{ + esk_mach_end(c->m, ESK_MACH_LOCKUP, + "core %d at 0x%08x: the double-precision accelerator's instruction 0x%06x is not modelled", + c->id, (unsigned)c->pc, (unsigned)w); + c->exc = 1; + c->npc = c->pc; +} + +static int cp0(struct lx6 *c) +{ + if (c->cpenable & 1u) + return 0; + exception(c, EXC_CP0_DISABLED); + return 1; +} + +/* RST0's ST0: the calls through a register, returns, syncs, the returns + * from exceptions, BREAK, SYSCALL, RSIL, WAITI and the boolean groups */ +static void st0(struct lx6 *c, u32 w) +{ + u32 r = FR(w), s = FS(w), t = FT(w), v; + switch (r) { + case 0: { /* SNM0 */ + u32 m = t >> 2, n = t & 3u; + if (m == 0 && n == 0) { + esk_lx6_illegal(c); + } else if (m == 2 && n == 0) { /* RET */ + if (win(c, 0)) + return; + c->npc = AR(c, 0); + c->jumped = 1; + c->cost += 2; + } else if (m == 2 && n == 1) { /* RETW */ + retw(c); + } else if (m == 2 && n == 2) { /* JX */ + if (win(c, s)) + return; + c->npc = AR(c, s); + c->jumped = 1; + c->cost += 2; + } else if (m == 3) { /* CALLX0, 4, 8, 12 */ + if (win(c, s > n * 4u ? s : n * 4u)) + return; + v = AR(c, s); + call(c, n, v, 3); + } else { + esk_lx6_illegal(c); + } + return; + } + case 1: /* MOVSP at, as */ + if (win(c, s > t ? s : t)) + return; + if (!(((c->ws >> ((c->wb - 1u) & 15u)) | (c->ws >> ((c->wb - 2u) & 15u)) | + (c->ws >> ((c->wb - 3u) & 15u))) & 1u)) { + exception(c, EXC_ALLOCA); + return; + } + AR(c, t) = AR(c, s); + return; + case 2: /* SYNC: ISYNC RSYNC ESYNC DSYNC EXCW MEMW EXTW NOP */ + if (s || (t > 3 && t != 8 && t != 12 && t != 13 && t != 15)) + esk_lx6_illegal(c); + return; + case 3: /* RFEI */ + if (t == 0) { + switch (s) { + case 0: /* RFE */ + c->ps &= ~PS_EXCM; + c->npc = c->epc[1]; + c->cost += 2; + esk_mach_exc_return(c->m, c->id); + return; + case 1: /* RFUE: XEA1 only */ + esk_lx6_illegal(c); + return; + case 2: /* RFDE */ + c->npc = c->depc; + c->cost += 2; + esk_mach_exc_return(c->m, c->id); + return; + case 4: rfwo(c, 0); return; + case 5: rfwo(c, 1); return; + } + } else if (t == 1 && s >= 2 && s <= 7) { /* RFI level */ + c->ps = c->eps[s]; + c->npc = c->epc[s]; + c->cost += 2; + esk_mach_exc_return(c->m, c->id); + return; + } + esk_lx6_illegal(c); + return; + case 4: /* BREAK s, t */ + debug_exception(c, DBG_BREAK); + return; + case 5: /* SYSCALL, SIMCALL (no simulator: nothing) */ + if (t == 0 && s == 0) + exception(c, EXC_SYSCALL); + else if (!(t == 0 && s == 1)) + esk_lx6_illegal(c); + return; + case 6: /* RSIL at, level */ + if (win(c, t)) + return; + AR(c, t) = c->ps; + c->ps = (c->ps & ~PS_INTLEVEL) | s; + return; + case 7: /* WAITI */ + c->ps = (c->ps & ~PS_INTLEVEL) | s; + c->waiti = 1; + return; + case 8: case 9: case 10: case 11: { /* ANY4 ALL4 ANY8 ALL8 */ + u32 width = r < 10 ? 4u : 8u, mask = (1u << width) - 1u, bits; + if (s & (width - 1u)) { + esk_lx6_illegal(c); + return; + } + bits = (c->br >> s) & mask; + v = (r & 1u) ? bits == mask : bits != 0; + c->br = (c->br & ~(1u << t)) | v << t; + return; + } + } + esk_lx6_illegal(c); +} + +/* region protection's TLB instructions (RST0's op2 5) */ +static void tlb(struct lx6 *c, u32 w) +{ + u32 r = FR(w), s = FS(w), t = FT(w), a, *tl; + if (win(c, s > t ? s : t)) + return; + a = AR(c, s); + tl = r < 8 ? c->itlb : c->dtlb; + switch (r & 7u) { + case 3: AR(c, t) = a & 0xe0000000u; return; /* R?TLB0 */ + case 4: return; /* I?TLB */ + case 5: AR(c, t) = (a & 0xe0000000u) | 1u; return; /* P?TLB */ + case 6: tl[a >> 29] = AR(c, t) & 15u; return; /* W?TLB */ + case 7: AR(c, t) = (a & 0xe0000000u) | tl[a >> 29]; return; /* R?TLB1 */ + } + esk_lx6_illegal(c); +} + +/* one instruction `w` of `len` bytes at c->pc */ +static void exec(struct lx6 *c, u32 w, u32 len) +{ + u32 op0 = OP0(w), r = FR(w), s = FS(w), t = FT(w), op1 = OP1(w), op2 = OP2(w); + u32 a, v, x, y; + switch (op0) { + case 0: /* QRST */ + switch (op1) { + case 0: /* RST0 */ + switch (op2) { + case 0: st0(c, w); return; + case 1: case 2: case 3: /* AND OR XOR */ + if (win(c, max3(r, s, t))) + return; + x = AR(c, s); + y = AR(c, t); + AR(c, r) = op2 == 1 ? x & y : op2 == 2 ? x | y : x ^ y; + return; + case 4: /* ST1 */ + switch (r) { + case 0: case 1: case 2: case 3: + if (win(c, s)) + return; + x = AR(c, s); + c->sar = r == 0 ? x & 31u : r == 1 ? 32u - (x & 31u) : r == 2 ? (x & 3u) * 8u + : 32u - (x & 3u) * 8u; + return; + case 4: /* SSAI */ + c->sar = s | (t & 1u) << 4; + return; + case 6: /* RER */ + if (win(c, s > t ? s : t)) + return; + AR(c, t) = rer(c, AR(c, s)); + return; + case 7: /* WER */ + if (win(c, s > t ? s : t)) + return; + return; + case 8: /* ROTW */ + c->wb = (c->wb + t) & 15u; + return; + case 14: case 15: /* NSA NSAU */ + if (win(c, s > t ? s : t)) + return; + AR(c, t) = r == 14 ? nsa(AR(c, s)) : nsau(AR(c, s)); + return; + } + break; + case 5: tlb(c, w); return; + case 6: /* NEG ABS */ + if (s > 1) + break; + if (win(c, r > t ? r : t)) + return; + x = AR(c, t); + AR(c, r) = s == 0 ? 0u - x : (x & 0x80000000u) ? 0u - x : x; + return; + case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: + if (win(c, max3(r, s, t))) + return; + x = AR(c, s) << (op2 & 3u); + y = AR(c, t); + AR(c, r) = op2 < 12 ? x + y : x - y; + return; + } + break; + case 1: /* RST1 */ + switch (op2) { + case 0: case 1: /* SLLI */ + if (win(c, r > s ? r : s)) + return; + AR(c, r) = (u32)((u64)AR(c, s) << (32u - (t | (op2 & 1u) << 4))); + return; + case 2: case 3: /* SRAI */ + if (win(c, r > t ? r : t)) + return; + AR(c, r) = (u32)((s32)AR(c, t) >> (s | (op2 & 1u) << 4)); + return; + case 4: /* SRLI */ + if (win(c, r > t ? r : t)) + return; + AR(c, r) = AR(c, t) >> s; + return; + case 6: /* XSR */ + if (win(c, t)) + return; + if (rsr(c, r << 4 | s, &v)) { + esk_lx6_illegal(c); + return; + } + x = AR(c, t); + if (wsr(c, r << 4 | s, x)) { + esk_lx6_illegal(c); + return; + } + AR(c, t) = v; + return; + case 8: /* SRC */ + if (win(c, max3(r, s, t))) + return; + AR(c, r) = (u32)(((u64)AR(c, s) << 32 | AR(c, t)) >> c->sar); + return; + case 9: /* SRL */ + if (win(c, r > t ? r : t)) + return; + AR(c, r) = (u32)((u64)AR(c, t) >> c->sar); + return; + case 10: /* SLL */ + if (win(c, r > s ? r : s)) + return; + AR(c, r) = (u32)(((u64)AR(c, s) << 32) >> c->sar); + return; + case 11: /* SRA */ + if (win(c, r > t ? r : t)) + return; + AR(c, r) = (u32)((s64)(s32)AR(c, t) >> (c->sar > 63u ? 63u : c->sar)); + return; + case 12: /* MUL16U */ + if (win(c, max3(r, s, t))) + return; + AR(c, r) = (AR(c, s) & 0xffffu) * (AR(c, t) & 0xffffu); + return; + case 13: /* MUL16S */ + if (win(c, max3(r, s, t))) + return; + AR(c, r) = (u32)((s32)sext(AR(c, s), 16) * (s32)sext(AR(c, t), 16)); + return; + } + break; + case 2: /* RST2 */ + if (op2 <= 4) { /* ANDB ANDBC ORB ORBC XORB */ + u32 bs = (c->br >> s) & 1u, bt = (c->br >> t) & 1u, b; + b = op2 == 0 ? bs & bt : op2 == 1 ? bs & !bt : op2 == 2 ? bs | bt : op2 == 3 ? bs | !bt + : bs ^ bt; + c->br = (c->br & ~(1u << r)) | b << r; + return; + } + if (op2 < 8 || op2 == 9) + break; + if (win(c, max3(r, s, t))) + return; + x = AR(c, s); + y = AR(c, t); + switch (op2) { + case 8: AR(c, r) = x * y; c->cost += 1; return; /* MULL */ + case 10: AR(c, r) = (u32)(((u64)x * y) >> 32); c->cost += 1; return; /* MULUH */ + case 11: AR(c, r) = (u32)((u64)((s64)(s32)x * (s32)y) >> 32); c->cost += 1; return; /* MULSH */ + } + if (!y) { + exception(c, EXC_DIVZERO); + return; + } + c->cost += 11; + switch (op2) { + case 12: AR(c, r) = x / y; return; /* QUOU */ + case 13: /* QUOS */ + AR(c, r) = (x == 0x80000000u && y == 0xffffffffu) ? x : (u32)((s32)x / (s32)y); + return; + case 14: AR(c, r) = x % y; return; /* REMU */ + case 15: /* REMS */ + AR(c, r) = (x == 0x80000000u && y == 0xffffffffu) ? 0u : (u32)((s32)x % (s32)y); + return; + } + break; + case 3: /* RST3 */ + switch (op2) { + case 0: /* RSR */ + if (win(c, t)) + return; + if (rsr(c, r << 4 | s, &v)) { + esk_lx6_illegal(c); + return; + } + AR(c, t) = v; + return; + case 1: /* WSR */ + if (win(c, t)) + return; + if (wsr(c, r << 4 | s, AR(c, t))) + esk_lx6_illegal(c); + return; + case 2: /* SEXT */ + if (win(c, r > s ? r : s)) + return; + AR(c, r) = sext(AR(c, s), (int)t + 8); + return; + case 3: { /* CLAMPS */ + s32 lim = (s32)(1u << (t + 7u)), z; + if (win(c, r > s ? r : s)) + return; + z = (s32)AR(c, s); + AR(c, r) = (u32)(z < -lim ? -lim : z > lim - 1 ? lim - 1 : z); + return; + } + case 4: case 5: case 6: case 7: /* MIN MAX MINU MAXU */ + if (win(c, max3(r, s, t))) + return; + x = AR(c, s); + y = AR(c, t); + if (op2 == 4) + AR(c, r) = (s32)x < (s32)y ? x : y; + else if (op2 == 5) + AR(c, r) = (s32)x < (s32)y ? y : x; + else if (op2 == 6) + AR(c, r) = x < y ? x : y; + else + AR(c, r) = x < y ? y : x; + return; + case 8: case 9: case 10: case 11: { /* MOVEQZ MOVNEZ MOVLTZ MOVGEZ */ + int mv; + if (win(c, max3(r, s, t))) + return; + y = AR(c, t); + mv = op2 == 8 ? y == 0 : op2 == 9 ? y != 0 : op2 == 10 ? (s32)y < 0 : (s32)y >= 0; + if (mv) + AR(c, r) = AR(c, s); + return; + } + case 12: case 13: /* MOVF MOVT */ + if (win(c, r > s ? r : s)) + return; + if (((c->br >> t) & 1u) == (u32)(op2 == 13)) + AR(c, r) = AR(c, s); + return; + case 14: { /* RUR */ + int k; + if (win(c, r)) + return; + k = rur(c, s << 4 | t, &v); + if (k < 0) + esk_lx6_illegal(c); + else if (k == 0) + AR(c, r) = v; + return; + } + case 15: /* WUR */ + if (win(c, t)) + return; + if (wur(c, r << 4 | s, AR(c, t)) < 0) + esk_lx6_illegal(c); + return; + } + break; + case 4: case 5: /* EXTUI */ + if (win(c, r > t ? r : t)) + return; + x = AR(c, t) >> (s | (op1 & 1u) << 4); + AR(c, r) = x & (u32)((1ull << (op2 + 1u)) - 1u); + return; + case 8: case 10: case 11: /* LSCX, FP0, FP1 */ + if (op1 == 11 && (op2 == 0 || op2 == 14 || op2 == 15)) { + dfp(c, w); /* F64ADDC, F64SUBC, F64CMPL, RF64R */ + return; + } + if (cp0(c)) + return; + if (esk_lx6_fp(c, w) < 0) + esk_lx6_illegal(c); + return; + case 14: case 15: /* the double-precision accelerator's other instructions */ + if ((op1 == 14 && op2 <= 8) || (op1 == 15 && op2 == 0)) { + dfp(c, w); + return; + } + break; + case 9: /* LSC4: L32E S32E */ + if (op2 != 0 && op2 != 4) + break; + if (win(c, s > t ? s : t)) + return; + a = AR(c, s) + ((r << 2) | 0xffffffc0u); + if (op2 == 0) { + if (esk_lx6_load(c, a, 4, &v) == 0) + AR(c, t) = v; + } else { + (void)esk_lx6_store(c, a, 4, AR(c, t)); + } + return; + } + esk_lx6_illegal(c); + return; + case 1: /* L32R */ + if (win(c, t)) + return; + a = ((c->pc + 3u) & ~3u) + ((0xffff0000u | (w >> 8)) << 2); + if (esk_lx6_load(c, a, 4, &v) == 0) + AR(c, t) = v; + return; + case 2: { /* LSAI */ + u32 imm = IMM8(w); + switch (r) { + case 0: case 1: case 2: case 9: case 11: { /* L8UI L16UI L32I L16SI L32AI */ + int n = r == 0 ? 1 : r == 1 || r == 9 ? 2 : 4; + if (win(c, s > t ? s : t)) + return; + a = AR(c, s) + imm * (u32)n; + if (esk_lx6_load(c, a, n, &v)) + return; + AR(c, t) = r == 9 ? sext(v, 16) : v; + return; + } + case 4: case 5: case 6: case 15: { /* S8I S16I S32I S32RI */ + int n = r == 4 ? 1 : r == 5 ? 2 : 4; + if (win(c, s > t ? s : t)) + return; + a = AR(c, s) + imm * (u32)n; + (void)esk_lx6_store(c, a, n, AR(c, t)); + return; + } + case 7: /* CACHE: no caches, nothing to do (DPFR, IPF, ...) */ + if (win(c, s)) + return; + return; + case 10: /* MOVI */ + if (win(c, t)) + return; + AR(c, t) = sext(imm | s << 8, 12); + return; + case 12: /* ADDI */ + if (win(c, s > t ? s : t)) + return; + AR(c, t) = AR(c, s) + sext(imm, 8); + return; + case 13: /* ADDMI */ + if (win(c, s > t ? s : t)) + return; + AR(c, t) = AR(c, s) + (sext(imm, 8) << 8); + return; + case 14: /* S32C1I */ + if (win(c, s > t ? s : t)) + return; + a = AR(c, s) + imm * 4u; + if (esk_lx6_load(c, a, 4, &v)) + return; + if (v == c->scompare1 && esk_lx6_store(c, a, 4, AR(c, t))) + return; + AR(c, t) = v; + return; + } + esk_lx6_illegal(c); + return; + } + case 3: /* LSCI: LSI SSI (LSIU, SSIU are not in this configuration) */ + if (r != 0 && r != 4) { + esk_lx6_illegal(c); + return; + } + if (cp0(c)) + return; + if (win(c, s)) + return; + a = AR(c, s) + IMM8(w) * 4u; + if (r == 0) { + if (esk_lx6_load(c, a, 4, &v) == 0) + c->f[t] = v; + } else { + (void)esk_lx6_store(c, a, 4, c->f[t]); + } + return; + case 4: /* MAC16 */ + mac16(c, w); + return; + case 5: { /* CALLN */ + u32 n = (w >> 4) & 3u; + if (win(c, n * 4u)) + return; + call(c, n, (c->pc & ~3u) + 4u + (sext(w >> 6, 18) << 2), 3); + return; + } + case 6: { /* SI */ + u32 n = (w >> 4) & 3u, m = (w >> 6) & 3u; + if (n == 0) { /* J */ + c->npc = c->pc + 4u + sext(w >> 6, 18); + c->jumped = 1; + c->cost += 2; + return; + } + if (n == 1) { /* BZ */ + if (win(c, s)) + return; + x = AR(c, s); + branch(c, m == 0 ? x == 0 : m == 1 ? x != 0 : m == 2 ? (s32)x < 0 : (s32)x >= 0, + c->pc + 4u + sext(w >> 12, 12)); + return; + } + if (n == 2) { /* BI0 */ + if (win(c, s)) + return; + x = AR(c, s); + y = b4const[r]; + branch(c, m == 0 ? x == y : m == 1 ? x != y : m == 2 ? (s32)x < (s32)y : (s32)x >= (s32)y, + c->pc + 4u + sext(IMM8(w), 8)); + return; + } + /* BI1 */ + if (m == 0) { /* ENTRY */ + entry(c, s, (w >> 12) << 3); + return; + } + if (m == 1) { /* B1 */ + switch (r) { + case 0: case 1: /* BF BT */ + branch(c, ((c->br >> s) & 1u) == r, c->pc + 4u + sext(IMM8(w), 8)); + return; + case 8: case 9: case 10: /* LOOP LOOPNEZ LOOPGTZ */ + if (win(c, s)) + return; + x = AR(c, s); + c->lcount = x - 1u; + c->lbeg = c->pc + 3u; + c->lend = c->pc + 4u + IMM8(w); + if ((r == 9 && x == 0) || (r == 10 && (s32)x <= 0)) { + c->npc = c->lend; + c->jumped = 1; + c->cost += 2; + } + return; + } + esk_lx6_illegal(c); + return; + } + if (win(c, s)) + return; + x = AR(c, s); + y = b4constu[r]; + branch(c, m == 2 ? x < y : x >= y, c->pc + 4u + sext(IMM8(w), 8)); /* BLTUI BGEUI */ + return; + } + case 7: { /* B */ + int taken; + u32 bit; + if (win(c, (r & 7u) == 6u || (r & 7u) == 7u ? s : s > t ? s : t)) + return; + x = AR(c, s); + switch (r) { + case 0: taken = (x & AR(c, t)) == 0; break; /* BNONE */ + case 1: taken = x == AR(c, t); break; /* BEQ */ + case 2: taken = (s32)x < (s32)AR(c, t); break; /* BLT */ + case 3: taken = x < AR(c, t); break; /* BLTU */ + case 4: taken = (~x & AR(c, t)) == 0; break; /* BALL */ + case 5: taken = !((x >> (AR(c, t) & 31u)) & 1u); break; /* BBC */ + case 6: case 7: bit = t | (r & 1u) << 4; taken = !((x >> bit) & 1u); break; /* BBCI */ + case 8: taken = (x & AR(c, t)) != 0; break; /* BANY */ + case 9: taken = x != AR(c, t); break; /* BNE */ + case 10: taken = (s32)x >= (s32)AR(c, t); break; /* BGE */ + case 11: taken = x >= AR(c, t); break; /* BGEU */ + case 12: taken = (~x & AR(c, t)) != 0; break; /* BNALL */ + case 13: taken = (x >> (AR(c, t) & 31u)) & 1u; break; /* BBS */ + default: bit = t | (r & 1u) << 4; taken = (x >> bit) & 1u; break; /* BBSI */ + } + branch(c, taken, c->pc + 4u + sext(IMM8(w), 8)); + return; + } + case 8: /* L32I.N */ + if (win(c, s > t ? s : t)) + return; + if (esk_lx6_load(c, AR(c, s) + r * 4u, 4, &v) == 0) + AR(c, t) = v; + return; + case 9: /* S32I.N */ + if (win(c, s > t ? s : t)) + return; + (void)esk_lx6_store(c, AR(c, s) + r * 4u, 4, AR(c, t)); + return; + case 10: /* ADD.N */ + if (win(c, max3(r, s, t))) + return; + AR(c, r) = AR(c, s) + AR(c, t); + return; + case 11: /* ADDI.N */ + if (win(c, r > s ? r : s)) + return; + AR(c, r) = AR(c, s) + (t ? t : 0xffffffffu); + return; + case 12: /* ST2: MOVI.N BEQZ.N BNEZ.N */ + if (win(c, s)) + return; + if (!(t & 8u)) { + v = r | (t & 7u) << 4; + AR(c, s) = v >= 96u ? v - 128u : v; + } else { + x = AR(c, s); + branch(c, (t & 4u) ? x != 0 : x == 0, c->pc + 4u + (r | (t & 3u) << 4)); + } + return; + case 13: /* ST3 */ + if (r == 0) { /* MOV.N */ + if (win(c, s > t ? s : t)) + return; + AR(c, t) = AR(c, s); + return; + } + if (r == 15) { + switch (t) { + case 0: /* RET.N */ + c->npc = AR(c, 0); + c->jumped = 1; + c->cost += 2; + return; + case 1: retw(c); return; + case 2: debug_exception(c, DBG_BREAKN); return; + case 3: return; /* NOP.N */ + } + } + esk_lx6_illegal(c); + return; + } + ES_UNUSED(len); + esk_lx6_illegal(c); +} + + +/* ---- interrupts and a step -------------------------------------------- */ + +/* the level of the interrupt the core would take now, or 0 */ +static u32 irq_level(const struct lx6 *c) +{ + u32 pend = interrupt_reg(c) & c->intenable, th = c->ps & PS_INTLEVEL, l; + if (!pend) + return 0; + if ((c->ps & PS_EXCM) && th < EXCM_LEVEL) + th = EXCM_LEVEL; + if (pend & level_mask[7]) + return 7; + for (l = 5; l > th; l--) + if (pend & level_mask[l]) + return l; + return 0; +} + +static int take_irq(struct lx6 *c) +{ + u32 l = irq_level(c); + if (!l) + return 0; + if (l == 1) + exception(c, EXC_LEVEL1); + else + level_entry(c, l, c->pc); + if (l == 7) + c->latched &= ~INT_NMI; + if (l != 1) + esk_mach_exc(c->m, c->id, 64 + (int)l, c->pc); + c->waiti = 0; + return 1; +} + +static void core_step(struct lx6 *c) +{ + struct esk_mach *m = c->m; + u32 w = 0, len = 3, before = ccount(c); + c->exc = 0; + c->cost = 1; + if (take_irq(c)) + goto done; + if (c->waiti) { + m->asleep = 1; + return; + } + if (c->ibreakenable && (c->ps & PS_INTLEVEL) < DEBUG_LEVEL && + (((c->ibreakenable & 1u) && c->pc == c->ibreaka[0]) || + ((c->ibreakenable & 2u) && c->pc == c->ibreaka[1]))) { + c->debugcause = DBG_IBREAK; + level_entry(c, DEBUG_LEVEL, c->pc); + goto done; + } + if (prohibited(c->itlb[c->pc >> 29])) { + c->excvaddr = c->pc; + exception(c, EXC_IFETCH_PROHIBITED); + goto done; + } + if (fetch(c, c->pc, &w)) { + if (c->pc == c->vecbase + VEC_KERNEL || c->pc == c->vecbase + VEC_DOUBLE) { + esk_mach_end(m, ESK_MACH_LOCKUP, "core %d: the exception vector 0x%08x cannot be fetched", + c->id, (unsigned)c->pc); + return; + } + esk_mach_bus_error(m, c->pc, 3, 0); + c->excvaddr = c->pc; + exception(c, EXC_IFETCH_ADDR); + goto done; + } + if ((w & 15u) >= 8u) { + len = 2; + w &= 0xffffu; + } + c->npc = c->pc + len; + c->jumped = 0; + m->insns++; + if ((w & 15u) >= 14u) + esk_lx6_illegal(c); + else + exec(c, w, len); + if (c->exc == 3) { /* the core was reset by its own store */ + c->exc = 0; + m->cycles += c->cost; + return; + } + if (c->exc == 2) { /* a watchpoint: the debugger stops before it */ + m->insns--; + c->exc = 0; + return; + } + if (!c->exc) { + if (!c->jumped && c->npc == c->pc + len && c->npc == c->lend && c->lcount && !(c->ps & PS_EXCM)) { + c->lcount--; + c->npc = c->lbeg; + } + if (c->icountlevel > (c->ps & PS_INTLEVEL) && ++c->icount == 0) { + c->pc = c->npc; + c->debugcause = DBG_ICOUNT; + level_entry(c, DEBUG_LEVEL, c->pc); + } + } +done: + c->pc = c->npc; + m->cycles += c->cost; + timer_check(c, before, c->cost); +} + +static int core_wake_pending(const struct lx6 *c) +{ + return irq_level(c) != 0; +} + +static void core_reset(struct lx6 *c) +{ + int i; + u32 prid = c->prid, rv = c->reset_vector; + memset(c->ar, 0, sizeof c->ar); + c->pc = c->npc = rv ? 0x40000400u : 0x50000000u; + c->wb = 0; + c->ws = 1; + c->ps = 0x1fu; /* INTLEVEL 15, EXCM */ + c->sar = c->lbeg = c->lend = c->lcount = c->br = c->scompare1 = 0; + c->acclo = c->acchi = 0; + memset(c->mr, 0, sizeof c->mr); + memset(c->epc, 0, sizeof c->epc); + memset(c->eps, 0, sizeof c->eps); + memset(c->excsave, 0, sizeof c->excsave); + c->depc = c->exccause = c->excvaddr = c->debugcause = 0; + c->intenable = c->latched = 0; + c->vecbase = 0x40000000u; + memset(c->ccompare, 0, sizeof c->ccompare); + c->ccount_base = 0; + c->ccount_at = c->m->cycles; + c->cpenable = c->threadptr = c->fcr = c->fsr = 0; + c->expstate = c->f64r_lo = c->f64r_hi = c->f64s = 0; + memset(c->f, 0, sizeof c->f); + memset(c->misc, 0, sizeof c->misc); + c->prid = prid; + c->atomctl = 0x28u; + c->memctl = 1u; + c->ibreakenable = c->icount = c->icountlevel = c->ddr = 0; + memset(c->ibreaka, 0, sizeof c->ibreaka); + memset(c->dbreaka, 0, sizeof c->dbreaka); + memset(c->dbreakc, 0, sizeof c->dbreakc); + for (i = 0; i < 8; i++) + c->itlb[i] = c->dtlb[i] = 2u; + c->waiti = 0; + c->exc = 0; +} + +/* ---- two cores, one interface ----------------------------------------- */ + +static void smp_step(struct esk_cpu *cpu); + +static struct smp *smp_of(struct esk_mach *m) +{ + return m->cpu && m->cpu->ops->step == smp_step ? (struct smp *)m->cpu : 0; +} + +static int next_core(const struct smp *x) +{ + int i, best = -1; + for (i = 0; i < x->n; i++) + if (x->state[i] == CORE_RUN && (best < 0 || x->lt[i] < x->lt[best])) + best = i; + return best < 0 ? 0 : best; +} + +static int current(const struct smp *x) +{ + return x->stepping ? x->cur : next_core(x); +} + +static int any_running(const struct smp *x) +{ + int i; + for (i = 0; i < x->n; i++) + if (x->state[i] == CORE_RUN) + return 1; + return 0; +} + +static void settle(struct smp *x, int i) +{ + int st = x->held[i] ? CORE_HELD : x->stalled[i] ? CORE_STALLED + : x->c[i]->waiti && !core_wake_pending(x->c[i]) ? CORE_SLEEP : CORE_RUN; + if (st == CORE_RUN && x->state[i] != CORE_RUN) { + if (x->lt[i] < x->m->cycles) + x->lt[i] = x->m->cycles; + x->m->asleep = 0; + } + x->state[i] = st; +} + +static void smp_reset(struct esk_cpu *cpu) +{ + struct smp *x = (struct smp *)cpu; + int i; + for (i = 0; i < x->n; i++) { + core_reset(x->c[i]); + x->held[i] = i != 0; /* APP_CPU: DPORT holds it until released */ + x->stalled[i] = 0; + x->lt[i] = x->m->cycles; + x->state[i] = i == 0 ? CORE_RUN : CORE_HELD; + } + x->stepping = 0; + x->cur = 0; +} + +static void smp_step(struct esk_cpu *cpu) +{ + struct smp *x = (struct smp *)cpu; + struct esk_mach *m = x->m; + u64 g0 = m->cycles, g = ~(u64)0; + int i = next_core(x), counting = m->counting, j; + if (x->state[i] != CORE_RUN) { + m->asleep = 1; + return; + } + m->cycles = x->lt[i]; + m->counting = 0; + m->asleep = 0; + x->cur = i; + x->stepping = 1; + esk_mach_step_core(m, i, &x->c[i]->cpu); + x->stepping = 0; + x->lt[i] = m->cycles; + m->counting += counting; + if (x->c[i]->waiti && x->state[i] == CORE_RUN && !core_wake_pending(x->c[i])) + x->state[i] = CORE_SLEEP; + for (j = 0; j < x->n; j++) + if (x->state[j] == CORE_RUN && x->lt[j] < g) + g = x->lt[j]; + if (g == ~(u64)0) + g = x->lt[i] > g0 ? x->lt[i] : g0; + m->cycles = g0; + if (g > g0) { + m->cycles = g; + if (m->counting) + esk_mach_advance(m, (u32)(g - g0)); + } + m->asleep = !any_running(x); +} + +/* the core interface on one core: the analyses step it */ +static void one_step(struct esk_cpu *cpu) +{ + core_step((struct lx6 *)cpu); +} + +/* the CPU timers of the cores that wait: they wake at CCOMPARE */ +static void tm_tick(void *ctx, u32 cycles) +{ + struct smp *x = (struct smp *)ctx; + int i; + for (i = 0; i < x->n; i++) { + struct lx6 *c = x->c[i]; + if (x->state[i] != CORE_SLEEP) + continue; + timer_check(c, ccount(c) - cycles, cycles); + if (core_wake_pending(c)) + settle(x, i); + } +} + +static int tm_next(void *ctx, u32 *cycles) +{ + struct smp *x = (struct smp *)ctx; + int i, k, any = 0; + for (i = 0; i < x->n; i++) { + struct lx6 *c = x->c[i]; + if (x->state[i] != CORE_SLEEP) + continue; + for (k = 0; k < 3; k++) { + u32 d = c->ccompare[k] - ccount(c); + if (!(c->intenable & (1u << timer_int[k])) || (c->latched & (1u << timer_int[k]))) + continue; + if (!d) + d = 0xffffffffu; + if (!any || d < *cycles) + *cycles = d; + any = 1; + } + } + return any; +} + +static void tm_reset(void *ctx) +{ + ES_UNUSED(ctx); +} + +static const struct esk_dev_ops timer_ops = { + "lx6-timers", 0, 0, tm_reset, tm_tick, tm_next, +}; + +/* ---- registers, as GDB numbers them ----------------------------------- + * + * Espressif's xtensa-esp32-elf-gdb: pc 0, the 64 physical ARs 1-64, lbeg, + * lend, lcount, sar, windowbase, windowstart, configid0, configid1, ps, + * threadptr, br, scompare1, acclo, acchi, m0-m3, expstate, f64r_lo, + * f64r_hi, f64s, f0-f15, fcr, fsr (65-104). The window's a0-a15 follow + * here at 105-120 for a register view. */ + +enum { GR_PC = 0, GR_AR = 1, GR_LBEG = 65, GR_F = 87, GR_FCR = 103, GR_FSR = 104, GR_A = 105, GR_N = 121 }; + +static int put(u8 *b, u32 v) +{ + b[0] = (u8)v; + b[1] = (u8)(v >> 8); + b[2] = (u8)(v >> 16); + b[3] = (u8)(v >> 24); + return 4; +} + +static u32 get(const u8 *b) +{ + return (u32)b[0] | (u32)b[1] << 8 | (u32)b[2] << 16 | (u32)b[3] << 24; +} + +static u32 *reg_ptr(struct lx6 *c, int n) +{ + if (n == GR_PC) + return &c->pc; + if (n >= GR_AR && n < GR_AR + 64) + return &c->ar[n - GR_AR]; + if (n >= GR_A && n < GR_A + 16) + return &AR(c, n - GR_A); + if (n >= GR_F && n < GR_F + 16) + return &c->f[n - GR_F]; + switch (n) { + case 65: return &c->lbeg; + case 66: return &c->lend; + case 67: return &c->lcount; + case 68: return &c->sar; + case 69: return &c->wb; + case 70: return &c->ws; + case 73: return &c->ps; + case 74: return &c->threadptr; + case 75: return &c->br; + case 76: return &c->scompare1; + case 77: return &c->acclo; + case 78: return &c->acchi; + case 79: case 80: case 81: case 82: return &c->mr[n - 79]; + case GR_FCR: return &c->fcr; + case GR_FSR: return &c->fsr; + } + switch (n) { + case 83: return &c->expstate; + case 84: return &c->f64r_lo; + case 85: return &c->f64r_hi; + case 86: return &c->f64s; + } + return 0; +} + +static int core_reg_read(struct lx6 *c, int n, u8 *buf) +{ + u32 *p; + if (n == 71) + return put(buf, CONFIGID0); + if (n == 72) + return put(buf, CONFIGID1); + p = reg_ptr(c, n); + return p ? put(buf, *p) : 0; +} + +static int core_reg_write(struct lx6 *c, int n, const u8 *buf) +{ + u32 *p = n == 71 || n == 72 ? 0 : reg_ptr(c, n); + if (!p) + return 0; + *p = get(buf); + c->wb &= 15u; + c->ws &= 0xffffu; + c->ps &= PS_MASK; + if (n == GR_PC) + c->npc = c->pc; + return 4; +} + +static const char *core_reg_name(int n) +{ + static const char *const a[16] = { "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", + "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15" }; + static const char *const sr[] = { "lbeg", "lend", "lcount", "sar", "windowbase", "windowstart", + "configid0", "configid1", "ps", "threadptr", "br", "scompare1", + "acclo", "acchi", "m0", "m1", "m2", "m3", "expstate", + "f64r_lo", "f64r_hi", "f64s" }; + static const char *const f[16] = { "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15" }; + static const char *const ar[64] = { + "ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7", "ar8", "ar9", "ar10", "ar11", + "ar12", "ar13", "ar14", "ar15", "ar16", "ar17", "ar18", "ar19", "ar20", "ar21", "ar22", + "ar23", "ar24", "ar25", "ar26", "ar27", "ar28", "ar29", "ar30", "ar31", "ar32", "ar33", + "ar34", "ar35", "ar36", "ar37", "ar38", "ar39", "ar40", "ar41", "ar42", "ar43", "ar44", + "ar45", "ar46", "ar47", "ar48", "ar49", "ar50", "ar51", "ar52", "ar53", "ar54", "ar55", + "ar56", "ar57", "ar58", "ar59", "ar60", "ar61", "ar62", "ar63" }; + if (n == GR_PC) + return "pc"; + if (n >= GR_AR && n < GR_AR + 64) + return ar[n - GR_AR]; + if (n >= GR_LBEG && n < GR_F) + return sr[n - GR_LBEG]; + if (n >= GR_F && n < GR_F + 16) + return f[n - GR_F]; + if (n == GR_FCR) + return "fcr"; + if (n == GR_FSR) + return "fsr"; + if (n >= GR_A && n < GR_A + 16) + return a[n - GR_A]; + return 0; +} + +static const int g_regs[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1 }; + +/* the disassembly: the instruction's bytes and size (the debugger and + * the trace show the mnemonic from the ELF's own tools) */ +static int core_disasm(struct lx6 *c, u32 addr, char *text, size_t cap) +{ + u32 lo, hi = 0, w; + int len; + if (esk_bus_debug_read(&c->m->bus, addr, 2, &lo) != 0) + return 0; + len = (lo & 15u) >= 8u ? 2 : 3; + if (len == 3 && esk_bus_debug_read(&c->m->bus, addr + 2u, 1, &hi) != 0) + return 0; + w = (lo & 0xffffu) | (hi & 0xffu) << 16; + snprintf(text, cap, len == 3 ? ".byte 0x%02x, 0x%02x, 0x%02x" : ".byte 0x%02x, 0x%02x", + (unsigned)(w & 0xffu), (unsigned)((w >> 8) & 0xffu), (unsigned)((w >> 16) & 0xffu)); + return len; +} + +/* the interface's hooks: the core that runs next */ +static struct lx6 *cur(struct esk_cpu *cpu) +{ + struct smp *x = (struct smp *)cpu; + return x->c[current(x)]; +} + +static u32 smp_pc(struct esk_cpu *cpu) { return cur(cpu)->pc; } +static int smp_reg_read(struct esk_cpu *cpu, int n, u8 *buf) { return core_reg_read(cur(cpu), n, buf); } +static int smp_reg_write(struct esk_cpu *cpu, int n, const u8 *buf) { return core_reg_write(cur(cpu), n, buf); } +static const int *smp_g_regs(struct esk_cpu *cpu) { ES_UNUSED(cpu); return g_regs; } +static const char *smp_xml(struct esk_cpu *cpu, const char *annex) +{ + ES_UNUSED(cpu); + ES_UNUSED(annex); + return 0; +} +static void smp_interrupt(struct esk_cpu *cpu, int n) +{ + struct smp *x = (struct smp *)cpu; + struct lx6 *c = x->c[current(x)]; + if (n >= 16) + n -= 16; + if (n >= 0 && n < 32 && ((1u << n) & INT_SOFTWARE)) { + c->latched |= 1u << n; + settle(x, current(x)); + } +} +static const char *smp_reg_name(struct esk_cpu *cpu, int n) { ES_UNUSED(cpu); return core_reg_name(n); } +static int smp_wake_pending(struct esk_cpu *cpu) +{ + struct smp *x = (struct smp *)cpu; + int i; + for (i = 0; i < x->n; i++) + if (!x->held[i] && !x->stalled[i] && core_wake_pending(x->c[i])) + return 1; + return 0; +} +static int smp_disasm(struct esk_cpu *cpu, u32 addr, char *text, size_t cap) +{ + return core_disasm(cur(cpu), addr, text, cap); +} + +static const struct esk_cpu_ops smp_ops = { + "xtensa", 94, "an Xtensa image", + smp_reset, smp_step, smp_pc, smp_reg_read, smp_reg_write, + smp_g_regs, smp_xml, 3, smp_interrupt, GR_PC, 1, 0, smp_reg_name, smp_wake_pending, + smp_disasm, 0, 0, +}; + +/* each core's own interface, for the analyses' step (esk_mach_step_core) */ +static u32 one_pc(struct esk_cpu *cpu) { return ((struct lx6 *)cpu)->pc; } +static int one_reg_read(struct esk_cpu *cpu, int n, u8 *buf) { return core_reg_read((struct lx6 *)cpu, n, buf); } +static int one_reg_write(struct esk_cpu *cpu, int n, const u8 *buf) { return core_reg_write((struct lx6 *)cpu, n, buf); } +static void one_reset(struct esk_cpu *cpu) { core_reset((struct lx6 *)cpu); } +static int one_wake_pending(struct esk_cpu *cpu) { return core_wake_pending((struct lx6 *)cpu); } +static int one_disasm(struct esk_cpu *cpu, u32 addr, char *text, size_t cap) +{ + return core_disasm((struct lx6 *)cpu, addr, text, cap); +} + +static const struct esk_cpu_ops one_ops = { + "xtensa", 94, "an Xtensa image", + one_reset, one_step, one_pc, one_reg_read, one_reg_write, + smp_g_regs, smp_xml, 3, 0, GR_PC, 1, 0, smp_reg_name, one_wake_pending, + one_disasm, 0, 0, +}; + +int esk_lx6_is(const struct esk_cpu *c) +{ + return c && c->ops == &smp_ops; +} + +es_status esk_lx6_create(struct esk_mach *m, const char *model, int cores, struct esk_cpu **out) +{ + struct smp *x; + int i; + es_status st; + if (strcmp(model, "esp32-lx6") || cores < 1 || cores > NCORES) + return ES_ENOTFOUND; + x = (struct smp *)esk_mach_alloc(m, sizeof *x); + if (!x) + return ES_ENOMEM; + x->cpu.ops = &smp_ops; + x->m = m; + x->n = cores; + for (i = 0; i < cores; i++) { + struct lx6 *c = (struct lx6 *)esk_mach_alloc(m, sizeof *c); + if (!c) + return ES_ENOMEM; + c->cpu.ops = &one_ops; + c->m = m; + c->x = x; + c->id = i; + c->prid = i == 0 ? 0xCDCDu : 0xABABu; + c->reset_vector = 1; + x->c[i] = c; + } + st = esk_mach_add_dev(m, 0, 0, &timer_ops, x); + if (st != ES_OK) + return st; + esk_mach_clock(m, &x->running, 1); /* the CPU timers' clock never stops */ + m->steps_cores = 1; + m->cpu = &x->cpu; + smp_reset(&x->cpu); + *out = &x->cpu; + return ES_OK; +} + +/* ---- the part's controls ---------------------------------------------- */ + +int esk_lx6_cores(struct esk_mach *m) +{ + struct smp *x = smp_of(m); + return x ? x->n : 0; +} + +int esk_lx6_core(struct esk_mach *m) +{ + struct smp *x = smp_of(m); + return x ? current(x) : 0; +} + +void esk_lx6_irq(struct esk_mach *m, int core, int line, int level) +{ + struct smp *x = smp_of(m); + struct lx6 *c; + u32 bit; + if (!x || core < 0 || core >= x->n || line < 0 || line > 31) + return; + c = x->c[core]; + bit = 1u << line; + if (level) { + if (!(c->lines & bit) && (bit & (INT_EDGE | INT_NMI))) + c->latched |= bit; + c->lines |= bit; + } else { + c->lines &= ~bit; + } + if (x->state[core] == CORE_SLEEP && core_wake_pending(c)) + settle(x, core); +} + +void esk_lx6_core_reset(struct esk_mach *m, int core, int held) +{ + struct smp *x = smp_of(m); + if (!x || core < 0 || core >= x->n || x->held[core] == (held != 0)) + return; + x->held[core] = held != 0; + if (!held) { + core_reset(x->c[core]); + x->lt[core] = m->cycles; + } + settle(x, core); +} + +void esk_lx6_core_stall(struct esk_mach *m, int core, int why, int stalled) +{ + struct smp *x = smp_of(m); + if (!x || core < 0 || core >= x->n || why < 0 || why > 7) + return; + if (stalled) + x->stalled[core] |= 1 << why; + else + x->stalled[core] &= ~(1 << why); + settle(x, core); +} + +void esk_lx6_core_restart(struct esk_mach *m, int core) +{ + struct smp *x = smp_of(m); + if (!x || core < 0 || core >= x->n) + return; + core_reset(x->c[core]); + x->lt[core] = m->cycles; + if (x->stepping && x->cur == core) + x->c[core]->exc = 3; /* the instruction in progress is gone with it */ + settle(x, core); +} + +int esk_lx6_view(struct esk_mach *m, int core, u32 base, u32 size, const u8 *mem) +{ + struct smp *x = smp_of(m); + struct lx6 *c; + if (!x || core < 0 || core >= x->n) + return -1; + c = x->c[core]; + if (c->nview >= 2) + return -1; + c->view[c->nview].base = base; + c->view[c->nview].size = size; + c->view[c->nview].mem = mem; + c->nview++; + return 0; +} + +void esk_lx6_reset_vector(struct esk_mach *m, int core, int sel) +{ + struct smp *x = smp_of(m); + if (x && core >= 0 && core < x->n) + x->c[core]->reset_vector = sel != 0; +} + +u32 esk_lx6_pc(struct esk_mach *m, int core) +{ + struct smp *x = smp_of(m); + return x && core >= 0 && core < x->n ? x->c[core]->pc : 0; +} + +u32 esk_lx6_sp(struct esk_mach *m, int core) +{ + struct smp *x = smp_of(m); + return x && core >= 0 && core < x->n ? AR(x->c[core], 1) : 0; +} + +/* ---- for lx6fp.c ------------------------------------------------------ */ + +u32 *esk_lx6_fregs(struct lx6 *c) { return c->f; } +u32 *esk_lx6_fcr(struct lx6 *c) { return &c->fcr; } +u32 *esk_lx6_fsr(struct lx6 *c) { return &c->fsr; } +u32 esk_lx6_fp_rd(struct lx6 *c, int n) { return c->f[n & 15]; } +void esk_lx6_fp_wr(struct lx6 *c, int n, u32 v) { c->f[n & 15] = v; } +u32 esk_lx6_ar(struct lx6 *c, int n) { return AR(c, (u32)n); } +void esk_lx6_set_ar(struct lx6 *c, int n, u32 v) { AR(c, (u32)n) = v; } +u32 esk_lx6_br(struct lx6 *c) { return c->br; } +void esk_lx6_set_br(struct lx6 *c, u32 v) { c->br = v & 0xffffu; } +int esk_lx6_win(struct lx6 *c, u32 hi) { return win(c, hi); } diff --git a/core/mcu/xtensa/lx6.h b/core/mcu/xtensa/lx6.h new file mode 100644 index 000000000..623d1ec89 --- /dev/null +++ b/core/mcu/xtensa/lx6.h @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* lx6.h -- the Xtensa LX6 cores of the ESP32 (lx6.c, lx6fp.c), behind + * the machine's one core interface: the configuration Espressif's + * core-isa.h gives (esp32_v3_49_prod, LX6.0.3), two of them as the chip's + * PRO_CPU and APP_CPU. */ +#ifndef ESK_MCU_XTENSA_LX6_H +#define ESK_MCU_XTENSA_LX6_H + +#include "mcu/mach.h" + +/* the cores of model "esp32-lx6" (`cores` 1 or 2): core 0 runs from + * reset, core 1 is held in reset until the part releases it */ +es_status esk_lx6_create(struct esk_mach *m, const char *model, int cores, struct esk_cpu **out); +int esk_lx6_is(const struct esk_cpu *c); +/* the number of cores, and the one whose instruction is in progress (a + * debugger's: the one that runs next) */ +int esk_lx6_cores(struct esk_mach *m); +int esk_lx6_core(struct esk_mach *m); +/* interrupt input `line` (0-31) of core `core` is at `level`: a level + * input is pending while it is high, an edge input latches a rise + * (core-isa.h's XCHAL_INTTYPE_MASK_EXTERN_EDGE) */ +void esk_lx6_irq(struct esk_mach *m, int core, int line, int level); +/* the core is held in reset (1) or released (0): released, it starts + * at its reset vector */ +void esk_lx6_core_reset(struct esk_mach *m, int core, int held); +/* the core's clock is gated or stalled (1: it stops where it is) for + * reason `why` (0-7: the part's sources, any of which stops it), or runs */ +void esk_lx6_core_stall(struct esk_mach *m, int core, int why, int stalled); +/* the core alone is reset (a software or watchdog CPU reset): it starts + * again at its reset vector, the devices as they are */ +void esk_lx6_core_restart(struct esk_mach *m, int core); +/* the core sees `size` bytes of read-only memory at `base` from `mem` + * rather than the bus (its own ROM): 0, or -1 (two views at most) */ +int esk_lx6_view(struct esk_mach *m, int core, u32 base, u32 size, const u8 *mem); +/* the core's reset vector: 0x40000400 (1) or 0x50000000 (0) */ +void esk_lx6_reset_vector(struct esk_mach *m, int core, int sel); +/* the core's program counter, and its stack pointer (a1) */ +u32 esk_lx6_pc(struct esk_mach *m, int core); +u32 esk_lx6_sp(struct esk_mach *m, int core); + +/* ---- inside: the core's state, for lx6fp.c ------------------------------ */ + +struct lx6; +/* FP instruction `w` (op0 0 with op1 8, 10 or 11; op0 3): 0 when done, + * or -1 when not an FP instruction */ +int esk_lx6_fp(struct lx6 *c, u32 w); +u32 esk_lx6_fp_rd(struct lx6 *c, int n); +void esk_lx6_fp_wr(struct lx6 *c, int n, u32 v); +u32 *esk_lx6_fregs(struct lx6 *c); +u32 *esk_lx6_fcr(struct lx6 *c); +u32 *esk_lx6_fsr(struct lx6 *c); +u32 esk_lx6_ar(struct lx6 *c, int n); +void esk_lx6_set_ar(struct lx6 *c, int n, u32 v); +u32 esk_lx6_br(struct lx6 *c); +void esk_lx6_set_br(struct lx6 *c, u32 v); +/* a load or store of the core's: 0, or -1 when it took an exception */ +int esk_lx6_load(struct lx6 *c, u32 a, int n, u32 *v); +/* the window overflow check of registers up to `hi`: 1 when it was taken */ +int esk_lx6_win(struct lx6 *c, u32 hi); +int esk_lx6_store(struct lx6 *c, u32 a, int n, u32 v); +void esk_lx6_illegal(struct lx6 *c); +#endif diff --git a/core/mcu/xtensa/lx6fp.c b/core/mcu/xtensa/lx6fp.c new file mode 100644 index 000000000..8c3b1786e --- /dev/null +++ b/core/mcu/xtensa/lx6fp.c @@ -0,0 +1,418 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* lx6fp.c -- the ESP32's floating-point coprocessor (CP0): the Xtensa + * Floating-Point Coprocessor Option, single precision, with the + * division, reciprocal and square root instructions of core-isa.h + * (XCHAL_HAVE_FP_DIV, _RECIP, _SQRT, _RSQRT). + * + * Sixteen 32-bit registers f0-f15; FCR's rounding mode (bits 1:0: + * nearest even, toward zero, up, down) and FSR's sticky flags (bits 11:7: + * inexact, underflow, overflow, divide by zero, invalid). Arithmetic is + * IEEE 754: ADD.S, SUB.S, MUL.S, MADD.S and MSUB.S (fused, one rounding) + * are rounded as FCR says, with their flags; FLOAT.S and UFLOAT.S scale + * by 2^-imm, ROUND.S, TRUNC.S, FLOOR.S, CEIL.S and UTRUNC.S by 2^imm, out + * of range or NaN giving the limits (0x7fffffff, 0x80000000, or for + * UTRUNC.S 0xffffffff); the comparisons set a boolean register; the + * moves (MOV.S, ABS.S, NEG.S, the conditional ones, RFR, WFR, CONST.S's + * 0, 1, 2 and 0.5) change no flag. A NaN result is the first NaN operand + * made quiet, or 0x7fc00000. + * + * Where it differs inside: the division and square root sequences + * libgcc runs (DIV0.S, NEXP01.S, MADDN.S, MKDADJ.S, ADDEXP.S, ADDEXPM.S, + * DIVN.S; SQRT0.S, MKSADJ.S, ...) give the quotient or root correctly + * rounded, as the hardware's do, but the registers in between hold other + * values: MKDADJ.S fr, fs computes fs / fr, MKSADJ.S the root, ADDEXPM.S + * moves it to its destination, the others change nothing (Espressif's + * QEMU does the same). RECIP0.S and RSQRT0.S give the exact reciprocal + * and reciprocal root rounded, where the hardware gives a seed of fewer + * bits. The arithmetic is the host's double precision with fma(), which + * holds every single-precision result exactly or with its residual. */ +#include +#include +#include + +#include "mcu/xtensa/lx6.h" + +#define F_I 0x1u /* the flags, as FSR holds them from bit 7 */ +#define F_U 0x2u +#define F_O 0x4u +#define F_Z 0x8u +#define F_V 0x10u +#define QNAN 0x7fc00000u + +static float f_of(u32 v) +{ + float f; + memcpy(&f, &v, 4); + return f; +} + +static u32 bits_of(float f) +{ + u32 v; + memcpy(&v, &f, 4); + return v; +} + +static int is_nan(u32 v) +{ + return (v & 0x7f800000u) == 0x7f800000u && (v & 0x7fffffu); +} + +static int is_snan(u32 v) +{ + return is_nan(v) && !(v & 0x400000u); +} + +static void flag(struct lx6 *c, u32 f) +{ + *esk_lx6_fsr(c) |= f << 7; +} + +static u32 rmode(struct lx6 *c) +{ + return *esk_lx6_fcr(c) & 3u; +} + +/* a NaN result of operands a and b (and c): the first NaN quieted */ +static u32 nan_of(struct lx6 *c, u32 a, u32 b, u32 x, int n) +{ + if (is_snan(a) || is_snan(b) || (n > 2 && is_snan(x))) + flag(c, F_V); + if (is_nan(a)) + return a | 0x400000u; + if (is_nan(b)) + return b | 0x400000u; + if (n > 2 && is_nan(x)) + return x | 0x400000u; + return QNAN; +} + +/* the value hi + lo (lo below hi's last bit, only its sign and whether + * it is 0 matter) rounded to single precision in mode `m` */ +static u32 round_f(struct lx6 *c, double hi, double lo, u32 m) +{ + float f; + double diff, res; + int inexact; + if (hi != hi) + return QNAN; + if (isinf(hi)) + return bits_of((float)hi); + f = (float)hi; + if (isinf(f)) { /* overflow */ + flag(c, F_O | F_I); + if ((m == 1) || (m == 2 && hi < 0) || (m == 3 && hi > 0)) + return bits_of(hi < 0 ? -FLT_MAX : FLT_MAX); + return bits_of(f); + } + diff = hi - (double)f; + res = diff != 0 ? diff : lo; + inexact = diff != 0 || lo != 0; + if (m == 0) { + /* a tie broken the wrong way by the host, lo deciding */ + if (diff != 0 && lo != 0 && (lo > 0) == (diff > 0)) { + float g = nextafterf(f, diff > 0 ? INFINITY : -INFINITY); + if (fabs((double)g - (double)f) == 2 * fabs(diff)) + f = g; + } + } else if (res != 0) { + if (m == 1) { /* toward zero */ + if ((f > 0 && res < 0) || (f < 0 && res > 0)) + f = nextafterf(f, 0.0f); + } else if (m == 2) { /* up */ + if (res > 0) + f = nextafterf(f, INFINITY); + } else if (res < 0) { /* down */ + f = nextafterf(f, -INFINITY); + } + if (f == 0 && hi != 0) + f = hi < 0 ? -0.0f : 0.0f; + } + if (isinf(f)) { + flag(c, F_O | F_I); + return bits_of(f); + } + if (inexact) { + flag(c, F_I); + if (fabs((double)f) < FLT_MIN || (f == 0 && hi != 0)) + flag(c, F_U); + } + return bits_of(f); +} + +static int is_inf(u32 v) +{ + return (v & 0x7fffffffu) == 0x7f800000u; +} + +static int is_zero(u32 v) +{ + return !(v & 0x7fffffffu); +} + +/* a + b * x fused (sub: a - b * x), or b + x (mul 0) / b * x (add 0) */ +static u32 add_s(struct lx6 *c, u32 a, u32 b) +{ + double x = f_of(a), y = f_of(b), s, bb, lo; + if (is_nan(a) || is_nan(b)) + return nan_of(c, a, b, 0, 2); + if (is_inf(a) && is_inf(b) && ((a ^ b) & 0x80000000u)) { + flag(c, F_V); + return QNAN; + } + s = x + y; + if (is_inf(a) || is_inf(b)) + return bits_of((float)s); + if (s == 0 && x == -y && x != 0) + return rmode(c) == 3 ? 0x80000000u : 0; /* an exact zero sum: +0 but rounding down */ + if (s == 0) + return (a & b & 0x80000000u) | (rmode(c) == 3 ? (a | b) & 0x80000000u : 0u); + bb = s - x; + lo = (x - (s - bb)) + (y - bb); /* TwoSum: s + lo is x + y exactly */ + return round_f(c, s, lo, rmode(c)); +} + +static u32 mul_s(struct lx6 *c, u32 a, u32 b) +{ + if (is_nan(a) || is_nan(b)) + return nan_of(c, a, b, 0, 2); + if ((is_inf(a) && is_zero(b)) || (is_zero(a) && is_inf(b))) { + flag(c, F_V); + return QNAN; + } + return round_f(c, (double)f_of(a) * (double)f_of(b), 0, rmode(c)); /* exact in double */ +} + +static u32 madd_s(struct lx6 *c, u32 acc, u32 a, u32 b, int sub) +{ + double p, x, s, bb, lo; + u32 pb; + if (is_nan(acc) || is_nan(a) || is_nan(b)) { + if ((is_inf(a) && is_zero(b)) || (is_zero(a) && is_inf(b))) + flag(c, F_V); + return nan_of(c, a, b, acc, 3); + } + if ((is_inf(a) && is_zero(b)) || (is_zero(a) && is_inf(b))) { + flag(c, F_V); + return QNAN; + } + p = (double)f_of(a) * (double)f_of(b); + if (sub) + p = -p; + x = f_of(acc); + pb = (u32)(p < 0 || (p == 0 && signbit(p))) << 31; + if ((is_inf(a) || is_inf(b)) && is_inf(acc) && ((pb ^ acc) & 0x80000000u)) { + flag(c, F_V); + return QNAN; + } + s = x + p; + if (isinf(s) || is_inf(acc)) + return bits_of((float)s); + if (s == 0) { + if (x == 0 && p == 0) + return (acc & pb) | (rmode(c) == 3 ? (acc | pb) & 0x80000000u : 0u); + return rmode(c) == 3 ? 0x80000000u : 0; + } + bb = s - x; + lo = (x - (s - bb)) + (p - bb); + return round_f(c, s, lo, rmode(c)); +} + +static u32 div_s(struct lx6 *c, u32 a, u32 b) +{ + double q, r; + if (is_nan(a) || is_nan(b)) + return nan_of(c, a, b, 0, 2); + if ((is_zero(a) && is_zero(b)) || (is_inf(a) && is_inf(b))) { + flag(c, F_V); + return QNAN; + } + if (is_zero(b)) { + if (!is_inf(a)) + flag(c, F_Z); + return ((a ^ b) & 0x80000000u) | 0x7f800000u; + } + if (is_inf(a) || is_zero(a) || is_inf(b)) + return bits_of(f_of(a) / f_of(b)); + q = (double)f_of(a) / (double)f_of(b); + r = fma(-q, (double)f_of(b), (double)f_of(a)); /* the exact remainder */ + return round_f(c, q, (f_of(b) < 0 ? -r : r), rmode(c)); +} + +static u32 sqrt_s(struct lx6 *c, u32 a) +{ + double x = f_of(a), r, e; + if (is_nan(a)) + return nan_of(c, a, 0, 0, 1); + if (is_zero(a)) + return a; + if (a & 0x80000000u) { + flag(c, F_V); + return QNAN; + } + if (is_inf(a)) + return a; + r = sqrt(x); + e = fma(-r, r, x); + return round_f(c, r, e, rmode(c)); +} + +/* to an integer: v * 2^scale rounded in mode m, signed or not */ +static u32 to_int(struct lx6 *c, u32 v, u32 scale, u32 m, int uns) +{ + double x = ldexp((double)f_of(v), (int)scale), y; + if (is_nan(v)) { + flag(c, F_V); + return uns ? 0xffffffffu : 0x7fffffffu; + } + y = m == 0 ? nearbyint(x) : m == 1 ? trunc(x) : m == 2 ? ceil(x) : floor(x); + if (m == 0 && fabs(x - trunc(x)) == 0.5) + y = 2.0 * nearbyint(x / 2.0); /* ties to even, whatever the host's mode */ + if (uns && !(v & 0x80000000u)) { + if (y > 4294967295.0) { + flag(c, F_V); + return 0xffffffffu; + } + if (y != x) + flag(c, F_I); + return (u32)y; + } + if (y > 2147483647.0) { + flag(c, F_V); + return 0x7fffffffu; + } + if (y < -2147483648.0) { + flag(c, F_V); + return 0x80000000u; + } + if (uns && y != 0) + flag(c, F_V); /* UTRUNC.S of a negative value */ + else if (y != x) + flag(c, F_I); + return (u32)(s32)y; +} + +static u32 from_int(struct lx6 *c, u32 v, u32 scale, int uns) +{ + double x = uns ? (double)v : (double)(s32)v; + return round_f(c, ldexp(x, -(int)scale), 0, rmode(c)); /* exact in double */ +} + +/* the comparisons: 1 UN, 2 OEQ, 3 UEQ, 4 OLT, 5 ULT, 6 OLE, 7 ULE */ +static int compare(struct lx6 *c, u32 op, u32 a, u32 b) +{ + int un = is_nan(a) || is_nan(b); + float x = f_of(a), y = f_of(b); + if (is_snan(a) || is_snan(b) || (un && op >= 4 && (op & 1u) == 0)) + flag(c, F_V); + switch (op) { + case 1: return un; + case 2: return !un && x == y; + case 3: return un || x == y; + case 4: return !un && x < y; + case 5: return un || x < y; + case 6: return !un && x <= y; + case 7: return un || x <= y; + } + return 0; +} + +int esk_lx6_fp(struct lx6 *c, u32 w) +{ + u32 op1 = (w >> 16) & 15u, op2 = (w >> 20) & 15u, r = (w >> 12) & 15u, s = (w >> 8) & 15u, + t = (w >> 4) & 15u, *f = esk_lx6_fregs(c), a, v; + if (op1 == 8) { /* LSX, SSX (LSXU, SSXU: not in this configuration) */ + if (op2 != 0 && op2 != 4) + return -1; + if (esk_lx6_win(c, s > t ? s : t)) + return 0; + a = esk_lx6_ar(c, (int)s) + esk_lx6_ar(c, (int)t); + if (op2 == 0) { + if (esk_lx6_load(c, a, 4, &v) == 0) + f[r] = v; + } else { + (void)esk_lx6_store(c, a, 4, f[r]); + } + return 0; + } + if (op1 == 10) { /* FP0 */ + switch (op2) { + case 0: f[r] = add_s(c, f[s], f[t]); return 0; + case 1: f[r] = add_s(c, f[s], f[t] ^ (is_nan(f[t]) ? 0u : 0x80000000u)); return 0; + case 2: f[r] = mul_s(c, f[s], f[t]); return 0; + case 4: f[r] = madd_s(c, f[r], f[s], f[t], 0); return 0; + case 5: f[r] = madd_s(c, f[r], f[s], f[t], 1); return 0; + case 6: case 7: return 0; /* MADDN.S DIVN.S: in MKDADJ.S's result */ + case 8: case 9: case 10: case 11: case 14: { /* ROUND TRUNC FLOOR CEIL UTRUNC */ + static const u32 mode[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 0, 0, 1, 0 }; + if (esk_lx6_win(c, r)) + return 0; + esk_lx6_set_ar(c, (int)r, to_int(c, f[s], t, mode[op2], op2 == 14)); + return 0; + } + case 12: case 13: /* FLOAT.S UFLOAT.S */ + if (esk_lx6_win(c, s)) + return 0; + f[r] = from_int(c, esk_lx6_ar(c, (int)s), t, op2 == 13); + return 0; + case 15: /* FP1OP */ + switch (t) { + case 0: f[r] = f[s]; return 0; /* MOV.S */ + case 1: f[r] = f[s] & 0x7fffffffu; return 0; /* ABS.S */ + case 3: { /* CONST.S */ + static const u32 k[4] = { 0x00000000u, 0x3f800000u, 0x40000000u, 0x3f000000u }; + f[r] = k[s & 3u]; + return 0; + } + case 4: /* RFR */ + if (esk_lx6_win(c, r)) + return 0; + esk_lx6_set_ar(c, (int)r, f[s]); + return 0; + case 5: /* WFR */ + if (esk_lx6_win(c, s)) + return 0; + f[r] = esk_lx6_ar(c, (int)s); + return 0; + case 6: f[r] = f[s] ^ 0x80000000u; return 0; /* NEG.S */ + case 7: case 9: case 11: return 0; /* DIV0.S SQRT0.S NEXP01.S */ + case 8: f[r] = div_s(c, 0x3f800000u, f[s]); return 0; /* RECIP0.S */ + case 10: /* RSQRT0.S */ + f[r] = div_s(c, 0x3f800000u, sqrt_s(c, f[s])); + return 0; + case 12: f[r] = sqrt_s(c, f[s]); return 0; /* MKSADJ.S */ + case 13: f[r] = div_s(c, f[s], f[r]); return 0; /* MKDADJ.S */ + case 14: return 0; /* ADDEXP.S */ + case 15: f[r] = f[s]; return 0; /* ADDEXPM.S */ + } + return -1; + } + return -1; + } + if (op1 == 11) { /* FP1 */ + if (op2 >= 1 && op2 <= 7) { + u32 br = esk_lx6_br(c); + int b = compare(c, op2, f[s], f[t]); + esk_lx6_set_br(c, (br & ~(1u << r)) | (u32)b << r); + return 0; + } + if (op2 >= 8 && op2 <= 11) { /* MOVEQZ.S MOVNEZ.S MOVLTZ.S MOVGEZ.S */ + int mv; + if (esk_lx6_win(c, t)) + return 0; + v = esk_lx6_ar(c, (int)t); + mv = op2 == 8 ? v == 0 : op2 == 9 ? v != 0 : op2 == 10 ? (s32)v < 0 : (s32)v >= 0; + if (mv) + f[r] = f[s]; + return 0; + } + if (op2 == 12 || op2 == 13) { /* MOVF.S MOVT.S */ + if (((esk_lx6_br(c) >> t) & 1u) == (u32)(op2 == 13)) + f[r] = f[s]; + return 0; + } + return -1; + } + return -1; +} diff --git a/docs/STATUS.md b/docs/STATUS.md index a8394f400..4ea1a62bc 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -5,6 +5,29 @@ maintained by hand until evidence tooling exists. It is not a generated support matrix. Specifications define target contracts; their acceptance does not mean the described behaviour exists. +## ESP32 on the machine framework (2026-11-08) + +The ESP32 now runs as a catalog MCU (`espressif/esp32`) on the +`emblink/esp32_devkitc` board: two Xtensa LX6 cores in the framework +(`core/mcu/xtensa/lx6.c`), the SoC models in `core/mcu/esp32/soc/`, and +Espressif's ROM (ECO3), ESP-IDF v5.4's second-stage bootloader and its +hello_world running unmodified on both cores at 160 MHz to `Hello world!` +and through `esp_restart` (rst:0xc SW_CPU_RESET). Evidence: `test_lx6` +(4,332 checks), the board's three fixtures, and the ESP-IDF vendor +scenarios `esp32_hello_world` (9/9), `esp32_blink` (6/6), +`esp32_ledc_basic` (2/2), `esp32_i2c_eeprom` (3/3, I2C0 writing and +reading a 24LC256 at 400 kHz), `esp32_gptimer` (17/17), `esp32_uart_echo` +(6/6), `esp32_real_time_stats` (10/10) , `esp32_blink_strip` (7/7, a +WS2812B through the RMT) and `esp32_adc_oneshot_read` (6/6, ADC1 and ADC2 +with the eFuse Vref's calibration), `esp32_dac_oneshot` (4/4, the DACs +read back by ADC2); Arduino-ESP32's AnalogReadSerial, +ReadAnalogVoltage, DigitalReadSerial, GetChipID and RepeatTimer for "ESP32 +Dev Module" (`tests/vendor/arduino-esp32`, `ESP32_*`). Not yet: Wi-Fi and Bluetooth, the +double-precision accelerator's instructions, the peripherals the +description's fidelity lists (I2S, SPI2/3, touch, ...), +sleep. The standalone harness below remains as its own qualification +fixtures. + ## Original ESP32 dual-core target investigation (2026-11-04) **Latest digital pad-hold update:** [Per-pin digital hold](engineering/esp32-digital-pad-hold.md) diff --git a/docs/coverage.md b/docs/coverage.md index b112be32e..ad9dc481a 100644 --- a/docs/coverage.md +++ b/docs/coverage.md @@ -8,6 +8,7 @@ evidence for each model is in [STATUS.md](STATUS.md). | MCU | Modelled | Registers only | Missing | Peripherals | |---|---|---|---|---| +| ESP32 | 20 | 0 | 25 | 45 | | ESP32-C3 | 35 | 0 | 0 | 35 | | ATmega328P | 15 | 0 | 0 | 15 | | PIC24FJ1024GB610 | 11 | 4 | 17 | 32 | @@ -19,6 +20,61 @@ evidence for each model is in [STATUS.md](STATUS.md). | STM32F446RE | 53 | 0 | 15 | 68 | | STM32F446ZE | 53 | 0 | 15 | 68 | +## ESP32 (`espressif/esp32`) + +Boards: ESP32-DevKitC V4. +20 of 45 peripherals modelled, 0 registers only, 25 missing. + +| Peripheral | Model | State | +|---|---|---| +| DPORT | `esp32-dport` | modelled | +| AES | — | **missing** | +| RSA | — | **missing** | +| SHA | `esp32-sha` | modelled | +| UART0 | `esp32-uart` | modelled | +| SPI1 | `esp32-spi` | modelled | +| SPI0 | `esp32-spi` | modelled | +| GPIO | `esp32-gpio` | modelled | +| GPIO_SD | — | **missing** | +| FLASH_ENCRYPTION | — | **missing** | +| FRC_TIMER | — | **missing** | +| RTC_CNTL | `esp32-rtc` | modelled | +| RTC_IO | `esp32-rtcio` | modelled | +| SENS | `esp32-sens` | modelled | +| RTC_I2C | — | **missing** | +| IO_MUX | `esp32-iomux` | modelled | +| HINF | — | **missing** | +| UHCI1 | — | **missing** | +| I2S0 | — | **missing** | +| UART1 | `esp32-uart` | modelled | +| I2C0 | `esp32-i2c` | modelled | +| UHCI0 | — | **missing** | +| SLCHOST | — | **missing** | +| RMT | `esp32-rmt` | modelled | +| PCNT | — | **missing** | +| SLC | — | **missing** | +| LEDC | `esp32-ledc` | modelled | +| EFUSE | `esp32-efuse` | modelled | +| NRX | — | **missing** | +| BB | — | **missing** | +| MCPWM0 | — | **missing** | +| TIMG0 | `esp32-timg` | modelled | +| TIMG1 | `esp32-timg` | modelled | +| SPI2 | — | **missing** | +| SPI3 | — | **missing** | +| APB_CTRL | `esp32-apbctrl` | modelled | +| I2C1 | `esp32-i2c` | modelled | +| SDHOST | — | **missing** | +| EMAC_DMA | — | **missing** | +| EMAC_EXT | — | **missing** | +| EMAC_MAC | — | **missing** | +| TWAI0 | — | **missing** | +| MCPWM1 | — | **missing** | +| I2S1 | — | **missing** | +| UART2 | `esp32-uart` | modelled | + +Declared omissions: Wi-Fi, Bluetooth and the RF front end (WIFI_MAC, BB, NRX, FE: their registers keep what is written); the double-precision accelerator's instructions (F64ADDC, F64ITER and the others: their encodings are public, not what they do; a program that runs one stops with a diagnostic), though its registers are kept; PSRAM (DRAM1), the boot remap, the APB/AHB access permissions, the caches' lock regions and timing (the mapped pages are read whole), the MMU's access-error interrupts; RMT: the memory's power-down (MEM_PD), STATUS's STATE and the APB-side error bits, the carrier on an idle output; the SAR ADCs: the nonlinearity above about 2450 mV at 11 dB and a chip's spread from the fitted line, noise, the ULP's and the digital controller's (DMA, I2S) conversions, the Hall sensor, ADC2's arbitration with Wi-Fi, the RTC IO MUX's routing of a pad to the ADC (not checked); the DACs: the cosine-wave generator and the DMA path (I2S0), the output's impedance (a stiff source: the datasheet gives none) and its offset and nonlinearity; I2C: the non-FIFO mode (NONFIFO_EN, RX_REC_FULL, TX_SEND_EMPTY), SAMPLE_SCL_LEVEL, the input filters (only their share of the SCL high time), 10-bit addressing's R/W check; the peripherals without a model yet: I2S0/1, SPI2/3 (HSPI, VSPI), MCPWM, PCNT, TWAI, SDMMC, EMAC, the touch sensor, the RTC IO MUX's other pads and the ULP coprocessor, the AES and RSA accelerators, flash encryption; sleep modes (light and deep sleep, the power domains), brown-out; the eFuse 3/4 coding scheme's check, BLOCK0's per-field write protection. + ## ESP32-C3 (`espressif/esp32c3`) Boards: ESP32-C3-DevKitM-1. diff --git a/docs/gallery/README.md b/docs/gallery/README.md index 4b9fd97db..115e2093f 100644 --- a/docs/gallery/README.md +++ b/docs/gallery/README.md @@ -5,6 +5,15 @@ evolves. Newer milestones come first. The milestone sets from M1 on are captured `ui/apps/workbench/scripts/screenshots.mjs` (the same views each time: `pnpm build`, then `node scripts/screenshots.mjs --out ../../../docs/gallery/`). +## The ESP32-DevKitC running ESP-IDF's i2c_eeprom (2026-11-08) + +The original ESP32 on the machine framework: ESP-IDF v5.4's i2c_eeprom, +built unmodified, writing a 24LC256 through I2C0 at 400 kHz and reading it +back (the part's write cycles counted under the meters). + +| ![Design](esp32-devkitc/design.png) | ![Run](esp32-devkitc/run.png) | +|---|---| + ## The library by category and sub-category (2026-11-03) The real catalog's 205 parts filed as an EDA's device picker files them; diff --git a/docs/gallery/esp32-devkitc/design.png b/docs/gallery/esp32-devkitc/design.png new file mode 100644 index 000000000..0dddb9b51 Binary files /dev/null and b/docs/gallery/esp32-devkitc/design.png differ diff --git a/docs/gallery/esp32-devkitc/run.png b/docs/gallery/esp32-devkitc/run.png new file mode 100644 index 000000000..c7f895dd4 Binary files /dev/null and b/docs/gallery/esp32-devkitc/run.png differ diff --git a/schemas/mcu.schema.json b/schemas/mcu.schema.json index 2105fc1cb..ca9562da9 100644 --- a/schemas/mcu.schema.json +++ b/schemas/mcu.schema.json @@ -27,7 +27,7 @@ "required": ["backend", "model"], "additionalProperties": false, "properties": { - "backend": {"type": "string", "enum": ["cortex-m", "riscv", "avr", "mips", "pic32", "pic24", "pic16"]}, + "backend": {"type": "string", "enum": ["cortex-m", "riscv", "avr", "mips", "pic32", "pic24", "pic16", "xtensa"]}, "model": {"type": "string", "minLength": 1}, "priority_bits": {"type": "integer", "minimum": 0, "maximum": 8}, "pmp_entries": {"type": "integer", "minimum": 0, "maximum": 64, "description": "A RISC-V core's physical memory protection entries (16 when absent); pmpcfg and pmpaddr past them read 0"}, @@ -209,7 +209,7 @@ "additionalProperties": false, "properties": { "name": {"type": "string", "pattern": "^[A-Z][A-Z0-9]*$"}, - "pins": {"type": "integer", "minimum": 1, "maximum": 32}, + "pins": {"type": "integer", "minimum": 1, "maximum": 64, "description": "Pins in the port: up to 32 for most parts, more where one bank is wider (the ESP32's 40 GPIOs, GPIO_OUT and OUT1)."}, "mask": {"$ref": "common.schema.json#/$defs/hex_or_size", "description": "Bit mask of implemented pins when not contiguous from 0."} } } diff --git a/tests/unit/gen_lx6_programs.py b/tests/unit/gen_lx6_programs.py new file mode 100644 index 000000000..f20404dad --- /dev/null +++ b/tests/unit/gen_lx6_programs.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2026 Junior Deogracias +"""Assemble test_lx6.c's programs with Espressif's Xtensa assembler and +write lx6_programs.h, so the test needs no toolchain. + + gen_lx6_programs.py --as xtensa-esp32-elf-as --objcopy xtensa-esp32-elf-objcopy + +Each program is linked at 0x40080000 (IRAM), its data at 0x3FFB0000. +The sources are the PROGRAMS below; their expected results are in +test_lx6.c, computed by hand from the Xtensa ISA reference.""" +import argparse +import subprocess +import sys +import tempfile +from pathlib import Path + +HERE = Path(__file__).resolve().parent + +PROGRAMS = { + # integer arithmetic and logic: results left in a2-a15 + "alu": """ + movi a2, 7 + movi a3, -3 + add a4, a2, a3 # 4 + addx4 a5, a2, a3 # 25 + subx8 a6, a2, a3 # 59 + neg a7, a3 # 3 + abs a8, a3 # 3 + min a9, a2, a3 # -3 + maxu a10, a2, a3 # 0xfffffffd + sext a11, a3, 7 # -3 + movi a12, 300 + clamps a12, a12, 7 # 127 + nsau a13, a2 # 29 + nsa a14, a3 # 29 + extui a15, a3, 4, 8 # 0xff + j . +""", + "shifts": """ + movi a2, 0x123 + slli a3, a2, 20 # 0x12300000 + srli a4, a3, 8 # 0x00123000 + movi a5, -256 + srai a6, a5, 4 # -16 + ssl a2 # shift left by a2 & 31 = 3 + sll a7, a2 # 0x918 + movi a8, 12 + ssr a8 + srl a9, a3 # 0x00012300 + sra a10, a5 # -1 + movi a11, 0x87654321 + ssai 8 + src a12, a11, a2 # (0x87654321:0x123) >> 8 = 0x21000001 + ssa8l a8 # sar = (12 & 3) * 8 = 0 + rsr.sar a13 # 0 + ssa8b a2 # sar = 32 - (0x123 & 3) * 8 = 8 + rsr.sar a14 # 8 + j . +""", + "muldiv": """ + movi a2, -7 + movi a3, 3 + mull a4, a2, a3 # -21 + muluh a5, a2, a3 # 2 + mulsh a6, a2, a3 # -1 + quos a7, a2, a3 # -2 + rems a8, a2, a3 # -1 + quou a9, a2, a3 # 0x55555553 + remu a10, a2, a3 # 0 + mul16u a11, a2, a3 # 0xfff9 * 3 = 0x2ffeb + mul16s a12, a2, a3 # -21 + movi a13, 0 + j . +""", + # a loop exited by a branch taken to LEND (the ROM's strcmp does it) + "loops": """ + movi a2, 0 + movi a3, 5 + loop a3, 1f + addi a2, a2, 1 +1: + movi a4, 0 + movi a5, 0 + loopnez a5, 2f + addi a4, a4, 1 +2: + movi a6, 0 + movi a7, 10 + movi a8, 0 + loop a8, 3f # LCOUNT 0xffffffff: only the branch leaves + addi a6, a6, 1 + addi a7, a7, -1 + beqz a7, 3f +3: + movi a9, 0 + movi a10, -2 + loopgtz a10, 4f + addi a9, a9, 1 +4: + j . +""", + "branches": """ + movi a2, 0 + movi a3, 0x80 + bbci a3, 7, 1f + addi a2, a2, 1 # taken path skips nothing: bit 7 is set +1: bbsi a3, 7, 2f + addi a2, a2, 16 # not reached +2: movi a4, 65536 + bltui a4, 32768, 3f + addi a2, a2, 2 # reached: 65536 >= 32768 +3: bgeui a4, 65536, 4f + addi a2, a2, 32 # not reached +4: movi a5, -1 + beqi a5, -1, 5f + addi a2, a2, 64 # not reached +5: movi a6, 0xf0 + movi a7, 0x30 + ball a6, a7, 6f + addi a2, a2, 128 # not reached +6: bnone a6, a7, 7f + addi a2, a2, 4 # reached +7: movi a8, 5 + bbs a3, a8, 8f # bit 5 of 0x80: clear + addi a2, a2, 8 # reached +8: j . +""", + "memory": """ + j 1f + .align 4 +lit: .word 0xcafef00d +1: + movi a2, 0x3ffb0000 + movi a3, 0x8081 + s16i a3, a2, 0 + l16si a4, a2, 0 # 0xffff8081 + l16ui a5, a2, 0 # 0x8081 + l8ui a6, a2, 1 # 0x80 + movi a7, 0x11223344 + s32i a7, a2, 4 + addi a15, a2, 3 + l32i a8, a15, 0 # unaligned: bytes 3..6, 0x22334400 + movi a9, 0x55 + wsr.scompare1 a9 + movi a10, 0x55 + s32i a10, a2, 8 + movi a11, 0x66 + s32c1i a11, a2, 8 # memory 0x55 == SCOMPARE1: stored; a11 = 0x55 + l32i a12, a2, 8 # 0x66 + movi a13, 0x77 + s32c1i a13, a2, 8 # 0x66 != 0x55: not stored; a13 = 0x66 + l32r a14, lit + j . +""", + # windowed calls deep enough to spill and fill through the ROM's vectors + "windows": """ + movi a1, 0x3ffb8000 + movi a3, 0x3ffb8100 # the outermost frame's caller's stack pointer + addi a4, a1, -16 + s32i a3, a4, 4 # at sp - 12, for WindowOverflow8 to find its save area + movi a10, 12 + call8 fib + mov a15, a10 + j . + .align 4 +fib: + entry a1, 32 + bltui a2, 2, 1f + addi a10, a2, -1 + call8 fib + mov a3, a10 + addi a10, a2, -2 + call8 fib + add a2, a3, a10 +1: retw +""", + # an exception and its return, through a vector table of the test's + "syscall": """ + movi a2, vectors + wsr.vecbase a2 + movi a3, 0 + syscall + addi a3, a3, 1 + j . + .align 1024 +vectors: + .org vectors + 0x300 +kernel: + rsr.exccause a4 + rsr.epc1 a5 + addi a5, a5, 3 + wsr.epc1 a5 + rfe +""", + # CCOMPARE0 against CCOUNT: the timer interrupt (6) at level 1 + "timer": """ + movi a2, vectors + wsr.vecbase a2 + movi a6, 0 + rsr.ccount a3 + addi a3, a3, 200 + wsr.ccompare0 a3 + movi a4, 1 << 6 + wsr.intenable a4 + rsil a5, 0 +1: beqz a6, 1b + j . + .align 1024 +vectors: + .org vectors + 0x300 +kernel: + rsr.exccause a7 + rsr.interrupt a8 + movi a6, 1 + movi a9, 0 + wsr.intenable a9 + rfe +""", + # a store watchpoint over 32 bytes as ESP-IDF sets one (DBREAKC 0x20: + # address bits 4:0 ignored): a store past it misses, one in it takes + # the debug exception (level 6) before it is done + "dbreak": """ + movi a2, vectors + wsr.vecbase a2 + movi a6, 0 + movi a3, 0x3ffb0040 + wsr.dbreaka0 a3 + movi a4, 0x80000020 + wsr.dbreakc0 a4 + isync + movi a5, 0x55 + s32i a5, a3, 32 # 0x3ffb0060: outside + s32i a5, a3, 28 # 0x3ffb005c: inside + l32i a9, a3, 28 # the store was done after the handler + j . + .align 1024 +vectors: + .org vectors + 0x280 +debug: + addi a6, a6, 1 + rsr.debugcause a7 + movi a8, 0 + wsr.dbreakc0 a8 + rfi 6 +""", + "float": """ + movi a2, 1 + wsr.cpenable a2 + rsync + movi a3, 3 + float.s f0, a3, 0 # 3.0 + movi a4, 5 + float.s f1, a4, 1 # 2.5 + add.s f2, f0, f1 # 5.5 + mul.s f3, f0, f1 # 7.5 + madd.s f2, f0, f1 # 5.5 + 7.5 = 13.0 + trunc.s a5, f2, 0 # 13 + round.s a6, f1, 0 # 2 (ties to even) + olt.s b0, f1, f0 + movi a7, 0 + movt a7, a4, b0 # 5: 2.5 < 3.0 + rfr a8, f3 # 0x40f00000 + j . +""", + "mac16": """ + movi a2, 0x00030004 + movi a3, 0xfffe0005 + mul.aa.ll a2, a3 # 4 * 5 = 20 + mula.aa.hh a2, a3 # + 3 * -2 = 14 + rsr.acclo a4 + rsr.acchi a5 + umul.aa.hl a2, a3 # 3 * 5 = 15 + rsr.acclo a6 + j . +""", +} + + +def main(argv=None) -> int: + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--as", dest="asm", default="xtensa-esp32-elf-as") + ap.add_argument("--ld", default="xtensa-esp32-elf-ld") + ap.add_argument("--objcopy", default="xtensa-esp32-elf-objcopy") + ap.add_argument("--nm", default="xtensa-esp32-elf-nm") + ap.add_argument("-o", "--output", type=Path, default=HERE / "lx6_programs.h") + args = ap.parse_args(argv) + out = ["/* SPDX-License-Identifier: Apache-2.0 */", + "/* Copyright 2026 Junior Deogracias */", + "/* lx6_programs.h -- test_lx6.c's programs, assembled by Espressif's", + " * xtensa-esp32-elf-as and linked at 0x40080000 by gen_lx6_programs.py", + " * (generated: do not edit; the sources are in the script). */", + "#ifndef LX6_PROGRAMS_H", "#define LX6_PROGRAMS_H", ""] + with tempfile.TemporaryDirectory() as tmp: + t = Path(tmp) + for name, src in PROGRAMS.items(): + s = t / f"{name}.S" + s.write_text(".text\n.literal_position\n.global _start\n_start:\n" + src, encoding="utf-8") + subprocess.run([args.asm, "--text-section-literals", "-o", str(t / f"{name}.o"), str(s)], check=True) + subprocess.run([args.ld, "-Ttext=0x40080000", "-o", str(t / f"{name}.elf"), str(t / f"{name}.o")], + check=True) + subprocess.run([args.objcopy, "-O", "binary", "-j", ".text", str(t / f"{name}.elf"), + str(t / f"{name}.bin")], check=True) + data = (t / f"{name}.bin").read_bytes() + syms = subprocess.run([args.nm, str(t / f"{name}.elf")], check=True, capture_output=True, + text=True).stdout.split("\n") + entry = next(int(x.split()[0], 16) for x in syms if x.endswith(" _start")) + out.append(f"#define PROG_{name.upper()}_ENTRY 0x{entry:08X}u") + out.append(f"static const unsigned char prog_{name}[{len(data)}] = {{") + for i in range(0, len(data), 16): + out.append(" " + " ".join(f"0x{b:02x}," for b in data[i:i + 16])) + out.append("};") + out.append("") + out += ["#endif", ""] + args.output.write_text("\n".join(out), encoding="utf-8") + print(f"{args.output}: {len(PROGRAMS)} programs") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tests/unit/lx6_programs.h b/tests/unit/lx6_programs.h new file mode 100644 index 000000000..61a897d73 --- /dev/null +++ b/tests/unit/lx6_programs.h @@ -0,0 +1,421 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* lx6_programs.h -- test_lx6.c's programs, assembled by Espressif's + * xtensa-esp32-elf-as and linked at 0x40080000 by gen_lx6_programs.py + * (generated: do not edit; the sources are in the script). */ +#ifndef LX6_PROGRAMS_H +#define LX6_PROGRAMS_H + +#define PROG_ALU_ENTRY 0x40080000u +static const unsigned char prog_alu[45] = { + 0x0c, 0x72, 0x7c, 0xd3, 0x3a, 0x42, 0x30, 0x52, 0xa0, 0x30, 0x62, 0xf0, 0x30, 0x70, 0x60, 0x30, + 0x81, 0x60, 0x30, 0x92, 0x43, 0x30, 0xa2, 0x73, 0x00, 0xb3, 0x23, 0xc2, 0xa1, 0x2c, 0x00, 0xcc, + 0x33, 0xd0, 0xf2, 0x40, 0xe0, 0xe3, 0x40, 0x30, 0xf4, 0x74, 0x06, 0xff, 0xff, +}; + +#define PROG_SHIFTS_ENTRY 0x40080004u +static const unsigned char prog_shifts[60] = { + 0x21, 0x43, 0x65, 0x87, 0x22, 0xa1, 0x23, 0xc0, 0x32, 0x01, 0x30, 0x48, 0x41, 0x52, 0xaf, 0x00, + 0x50, 0x64, 0x21, 0x00, 0x12, 0x40, 0x00, 0x72, 0xa1, 0x0c, 0xc8, 0x00, 0x08, 0x40, 0x30, 0x90, + 0x91, 0x50, 0xa0, 0xb1, 0xb1, 0xf7, 0xff, 0x00, 0x48, 0x40, 0x20, 0xcb, 0x81, 0x00, 0x28, 0x40, + 0xd0, 0x03, 0x03, 0x00, 0x32, 0x40, 0xe0, 0x03, 0x03, 0x06, 0xff, 0xff, +}; + +#define PROG_MULDIV_ENTRY 0x40080000u +static const unsigned char prog_muldiv[36] = { + 0x7c, 0x92, 0x0c, 0x33, 0x30, 0x42, 0x82, 0x30, 0x52, 0xa2, 0x30, 0x62, 0xb2, 0x30, 0x72, 0xd2, + 0x30, 0x82, 0xf2, 0x30, 0x92, 0xc2, 0x30, 0xa2, 0xe2, 0x30, 0xb2, 0xc1, 0x30, 0xc2, 0xd1, 0x0c, + 0x0d, 0x06, 0xff, 0xff, +}; + +#define PROG_LOOPS_ENTRY 0x40080000u +static const unsigned char prog_loops[47] = { + 0x0c, 0x02, 0x32, 0xa0, 0x05, 0x76, 0x83, 0x01, 0x1b, 0x22, 0x0c, 0x04, 0x0c, 0x05, 0x76, 0x95, + 0x01, 0x1b, 0x44, 0x0c, 0x06, 0x0c, 0xa7, 0x0c, 0x08, 0x76, 0x88, 0x06, 0x1b, 0x66, 0x0b, 0x77, + 0x16, 0xf7, 0xff, 0x0c, 0x09, 0x7c, 0xea, 0x76, 0xaa, 0x01, 0x1b, 0x99, 0x06, 0xff, 0xff, +}; + +#define PROG_BRANCHES_ENTRY 0x40080004u +static const unsigned char prog_branches[76] = { + 0x00, 0x00, 0x01, 0x00, 0x22, 0xa0, 0x00, 0x32, 0xa0, 0x80, 0x77, 0x63, 0x02, 0x22, 0xc2, 0x01, + 0x77, 0xe3, 0x02, 0x22, 0xc2, 0x10, 0x41, 0xfa, 0xff, 0xb6, 0x04, 0x01, 0x2b, 0x22, 0xf6, 0x14, + 0x02, 0x22, 0xc2, 0x20, 0x7c, 0xf5, 0x26, 0x05, 0x02, 0x22, 0xc2, 0x40, 0x62, 0xa0, 0xf0, 0x3c, + 0x07, 0x77, 0x46, 0x05, 0x22, 0xd2, 0x01, 0x22, 0xc2, 0x80, 0x77, 0x06, 0x02, 0x22, 0xc2, 0x04, + 0x0c, 0x58, 0x87, 0xd3, 0x02, 0x22, 0xc2, 0x08, 0x06, 0xff, 0xff, 0x00, +}; + +#define PROG_MEMORY_ENTRY 0x4008000Cu +static const unsigned char prog_memory[76] = { + 0x00, 0x00, 0xfb, 0x3f, 0x81, 0x80, 0x00, 0x00, 0x44, 0x33, 0x22, 0x11, 0x06, 0x01, 0x00, 0x00, + 0x0d, 0xf0, 0xfe, 0xca, 0x21, 0xfb, 0xff, 0x31, 0xfb, 0xff, 0x32, 0x52, 0x00, 0x42, 0x92, 0x00, + 0x52, 0x12, 0x00, 0x62, 0x02, 0x01, 0x71, 0xf8, 0xff, 0x79, 0x12, 0x3b, 0xf2, 0x88, 0x0f, 0x5c, + 0x59, 0x90, 0x0c, 0x13, 0x5c, 0x5a, 0xa9, 0x22, 0xb2, 0xa0, 0x66, 0xb2, 0xe2, 0x02, 0xc8, 0x22, + 0xd2, 0xa0, 0x77, 0xd2, 0xe2, 0x02, 0xe1, 0xf2, 0xff, 0x06, 0xff, 0xff, +}; + +#define PROG_WINDOWS_ENTRY 0x40080008u +static const unsigned char prog_windows[56] = { + 0x00, 0x80, 0xfb, 0x3f, 0x00, 0x81, 0xfb, 0x3f, 0x11, 0xfe, 0xff, 0x31, 0xfe, 0xff, 0x42, 0xc1, + 0xf0, 0x39, 0x14, 0x0c, 0xca, 0xa5, 0x00, 0x00, 0xfd, 0x0a, 0x06, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x36, 0x41, 0x00, 0xb6, 0x22, 0x0f, 0xa2, 0xc2, 0xff, 0x65, 0xff, 0xff, 0x3d, 0x0a, 0xa2, 0xc2, + 0xfe, 0xe5, 0xfe, 0xff, 0xaa, 0x23, 0x1d, 0xf0, +}; + +#define PROG_SYSCALL_ENTRY 0x40080004u +static const unsigned char prog_syscall[1808] = { + 0x00, 0x04, 0x08, 0x40, 0x21, 0xff, 0xff, 0x20, 0xe7, 0x13, 0x0c, 0x03, 0x00, 0x50, 0x00, 0x1b, + 0x33, 0x06, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0xe8, 0x03, 0x50, 0xb1, 0x03, 0x3b, 0x55, 0x50, 0xb1, 0x13, 0x00, 0x30, 0x00, 0x00, 0x00, +}; + +#define PROG_TIMER_ENTRY 0x40080004u +static const unsigned char prog_timer[1808] = { + 0x00, 0x04, 0x08, 0x40, 0x21, 0xff, 0xff, 0x20, 0xe7, 0x13, 0x0c, 0x06, 0x30, 0xea, 0x03, 0x32, + 0xd3, 0x01, 0x32, 0xc3, 0xc8, 0x30, 0xf0, 0x13, 0x4c, 0x04, 0x40, 0xe4, 0x13, 0x50, 0x60, 0x00, + 0x16, 0xc6, 0xff, 0x06, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0xe8, 0x03, 0x80, 0xe2, 0x03, 0x0c, 0x16, 0x0c, 0x09, 0x90, 0xe4, 0x13, 0x00, 0x30, 0x00, +}; + +#define PROG_DBREAK_ENTRY 0x4008000Cu +static const unsigned char prog_dbreak[1680] = { + 0x00, 0x04, 0x08, 0x40, 0x40, 0x00, 0xfb, 0x3f, 0x20, 0x00, 0x00, 0x80, 0x21, 0xfd, 0xff, 0x20, + 0xe7, 0x13, 0x0c, 0x06, 0x31, 0xfc, 0xff, 0x30, 0x90, 0x13, 0x41, 0xfb, 0xff, 0x40, 0xa0, 0x13, + 0x00, 0x20, 0x00, 0x5c, 0x55, 0x59, 0x83, 0x59, 0x73, 0x98, 0x73, 0x06, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1b, 0x66, 0x70, 0xe9, 0x03, 0x0c, 0x08, 0x80, 0xa0, 0x13, 0x10, 0x36, 0x00, 0x00, 0x00, 0x00, +}; + +#define PROG_FLOAT_ENTRY 0x40080000u +static const unsigned char prog_float[47] = { + 0x0c, 0x12, 0x20, 0xe0, 0x13, 0x10, 0x20, 0x00, 0x0c, 0x33, 0x00, 0x03, 0xca, 0x0c, 0x54, 0x10, + 0x14, 0xca, 0x10, 0x20, 0x0a, 0x10, 0x30, 0x2a, 0x10, 0x20, 0x4a, 0x00, 0x52, 0x9a, 0x00, 0x61, + 0x8a, 0x00, 0x01, 0x4b, 0x0c, 0x07, 0x00, 0x74, 0xd3, 0x40, 0x83, 0xfa, 0x06, 0xff, 0xff, +}; + +#define PROG_MAC16_ENTRY 0x40080008u +static const unsigned char prog_mac16[36] = { + 0x04, 0x00, 0x03, 0x00, 0x05, 0x00, 0xfe, 0xff, 0x21, 0xfe, 0xff, 0x31, 0xfe, 0xff, 0x34, 0x02, + 0x74, 0x34, 0x02, 0x7b, 0x40, 0x10, 0x03, 0x50, 0x11, 0x03, 0x34, 0x02, 0x71, 0x60, 0x10, 0x03, + 0x06, 0xff, 0xff, 0x00, +}; + +#endif diff --git a/tests/unit/test_lx6.c b/tests/unit/test_lx6.c new file mode 100644 index 000000000..cffa48c5c --- /dev/null +++ b/tests/unit/test_lx6.c @@ -0,0 +1,364 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2026 Junior Deogracias */ +/* test_lx6.c -- the ESP32's Xtensa LX6 cores (mcu/xtensa/lx6.c, lx6fp.c) + * on the machine the catalog's ESP32 description builds: programs + * assembled by Espressif's assembler (lx6_programs.h, gen_lx6_programs.py) + * run from IRAM, their results checked against the Xtensa ISA reference + * worked by hand. The window spills and fills of the recursive program go + * through the ESP32 ROM's own window vectors. */ +#include "harness.h" +#include "lx6_programs.h" +#include "mcu/build.h" +#include "mcu/xtensa/lx6.h" +#include "util/json.h" + +#define IRAM 0x40080000u +#define GR_PC 0 +#define GR_WB 69 +#define GR_WS 70 +#define GR_PS 73 +#define GR_A 105 +#define J_SELF 0xffff06u + +typedef struct t32 { + esk_alloc a; + esk_json *mcu, *regs; + struct esk_mach m; +} t32; + +static unsigned char *slurp(const char *rel, size_t *len) +{ + char path[1024]; + FILE *f; + unsigned char *buf; + long n; + snprintf(path, sizeof path, "%s/%s", EMBSIM_SOURCE_DIR, rel); + f = fopen(path, "rb"); + if (!f) + return NULL; + fseek(f, 0, SEEK_END); + n = ftell(f); + fseek(f, 0, SEEK_SET); + buf = (unsigned char *)malloc(n > 0 ? (size_t)n : 1); + if (buf && fread(buf, 1, (size_t)n, f) != (size_t)n) { + free(buf); + buf = NULL; + } + fclose(f); + *len = (size_t)n; + return buf; +} + +static esk_json *load_json(esk_alloc *a, const char *rel) +{ + size_t len = 0; + unsigned char *text = slurp(rel, &len); + esk_json *j; + int line = 0; + const char *err = NULL; + if (!text) + return NULL; + j = esk_json_parse(a, (const char *)text, len, &line, &err); + free(text); + return j; +} + +static void put32(u8 *b, u32 v) +{ + b[0] = (u8)v; + b[1] = (u8)(v >> 8); + b[2] = (u8)(v >> 16); + b[3] = (u8)(v >> 24); +} + +static u32 reg(t32 *t, int n) +{ + u8 b[8] = { 0 }; + t->m.cpu->ops->reg_read(t->m.cpu, n, b); + return (u32)b[0] | (u32)b[1] << 8 | (u32)b[2] << 16 | (u32)b[3] << 24; +} + +static void set_reg(t32 *t, int n, u32 v) +{ + u8 b[4]; + put32(b, v); + CHECK_EQ(t->m.cpu->ops->reg_write(t->m.cpu, n, b), 4); +} + +static u32 a(t32 *t, int n) { return reg(t, GR_A + n); } + +/* the ESP32 out of reset, `prog` in IRAM, the PRO_CPU at `entry` with + * windowed calls on (PS.WOE), interrupts open, a stack in DRAM */ +static int open32(t32 *t, const unsigned char *prog, size_t n, u32 entry) +{ + char why[200]; + es_status st; + size_t i; + memset(t, 0, sizeof *t); + esk_alloc_init(&t->a, NULL); + t->mcu = load_json(&t->a, "catalog/mcus/espressif/esp32/mcu.json"); + t->regs = load_json(&t->a, "catalog/mcus/espressif/esp32/registers.json"); + CHECK(t->mcu != NULL && t->regs != NULL); + if (!t->mcu || !t->regs) + return 0; + esk_mach_init(&t->m, &t->a); + st = esk_mach_build(&t->m, t->mcu, t->regs, 40000000u, why, sizeof why); + if (st != ES_OK) { + FAIL(why); + return 0; + } + { + size_t rlen = 0; + unsigned char *rom = slurp("catalog/mcus/espressif/esp32/rom.bin", &rlen); + CHECK(rom != NULL); + if (!rom) + return 0; + CHECK_EQ(esk_mach_factory(&t->m, 0x40000000u, rom, rlen), ES_OK); + free(rom); + } + esk_mach_reset(&t->m); + CHECK(esk_lx6_is(t->m.cpu)); + CHECK_STR(t->m.cpu->ops->name, "xtensa"); + CHECK_EQ(esk_lx6_cores(&t->m), 2); + CHECK_EQ(reg(t, GR_PC), 0x40000400u); /* the reset vector */ + for (i = 0; i < n; i++) + CHECK_EQ(esk_bus_debug_write(&t->m.bus, IRAM + (u32)i, 1, prog[i]), 0); + set_reg(t, GR_PC, entry); + set_reg(t, GR_PS, 0x00040000u); /* WOE, INTLEVEL 0 */ + set_reg(t, GR_WB, 0); + set_reg(t, GR_WS, 1); + set_reg(t, GR_A + 1, 0x3FFB8000u); + return 1; +} + +static void close32(t32 *t) +{ + esk_mach_free(&t->m); + esk_json_free(&t->a, t->mcu); + esk_json_free(&t->a, t->regs); + CHECK_EQ(t->a.live_bytes, 0); +} + +/* runs until the program's final `j .`: 1 when it got there */ +static int run_to_end(t32 *t, u64 max_insns) +{ + u32 w = 0; + esk_mach_run(&t->m, 0xffffffffu, max_insns); + if (esk_bus_debug_read(&t->m.bus, reg(t, GR_PC), 4, &w)) + return 0; + return (w & 0xffffffu) == J_SELF; +} + +#define OPEN(t, name, NAME) open32(&(t), prog_##name, sizeof prog_##name, PROG_##NAME##_ENTRY) + +static void test_alu(void) +{ + t32 t; + if (!OPEN(t, alu, ALU)) + return; + CHECK(run_to_end(&t, 100)); + CHECK_EQ(a(&t, 4), 4u); + CHECK_EQ(a(&t, 5), 25u); + CHECK_EQ(a(&t, 6), 59u); + CHECK_EQ(a(&t, 7), 3u); + CHECK_EQ(a(&t, 8), 3u); + CHECK_EQ(a(&t, 9), (u32)-3); + CHECK_EQ(a(&t, 10), 0xfffffffdu); + CHECK_EQ(a(&t, 11), (u32)-3); + CHECK_EQ(a(&t, 12), 127u); + CHECK_EQ(a(&t, 13), 29u); + CHECK_EQ(a(&t, 14), 29u); + CHECK_EQ(a(&t, 15), 0xffu); + close32(&t); +} + +static void test_shifts(void) +{ + t32 t; + if (!OPEN(t, shifts, SHIFTS)) + return; + CHECK(run_to_end(&t, 100)); + CHECK_EQ(a(&t, 3), 0x12300000u); + CHECK_EQ(a(&t, 4), 0x00123000u); + CHECK_EQ(a(&t, 6), (u32)-16); + CHECK_EQ(a(&t, 7), 0x918u); + CHECK_EQ(a(&t, 9), 0x12300u); + CHECK_EQ(a(&t, 10), 0xffffffffu); + CHECK_EQ(a(&t, 12), 0x21000001u); + CHECK_EQ(a(&t, 13), 0u); + CHECK_EQ(a(&t, 14), 8u); + close32(&t); +} + +static void test_muldiv(void) +{ + t32 t; + if (!OPEN(t, muldiv, MULDIV)) + return; + CHECK(run_to_end(&t, 100)); + CHECK_EQ(a(&t, 4), (u32)-21); + CHECK_EQ(a(&t, 5), 2u); + CHECK_EQ(a(&t, 6), 0xffffffffu); + CHECK_EQ(a(&t, 7), (u32)-2); + CHECK_EQ(a(&t, 8), (u32)-1); + CHECK_EQ(a(&t, 9), 0x55555553u); + CHECK_EQ(a(&t, 10), 0u); + CHECK_EQ(a(&t, 11), 0x2ffebu); + CHECK_EQ(a(&t, 12), (u32)-21); + close32(&t); +} + +/* the zero-overhead loops, one left by a branch taken to its end */ +static void test_loops(void) +{ + t32 t; + if (!OPEN(t, loops, LOOPS)) + return; + CHECK(run_to_end(&t, 200)); + CHECK_EQ(a(&t, 2), 5u); + CHECK_EQ(a(&t, 4), 0u); /* LOOPNEZ of 0: skipped */ + CHECK_EQ(a(&t, 6), 10u); /* left by BEQZ to LEND, not looped again */ + CHECK_EQ(a(&t, 7), 0u); + CHECK_EQ(a(&t, 9), 0u); /* LOOPGTZ of -2: skipped */ + close32(&t); +} + +static void test_branches(void) +{ + t32 t; + if (!OPEN(t, branches, BRANCHES)) + return; + CHECK(run_to_end(&t, 100)); + CHECK_EQ(a(&t, 2), 15u); + close32(&t); +} + +static void test_memory(void) +{ + t32 t; + if (!OPEN(t, memory, MEMORY)) + return; + CHECK(run_to_end(&t, 100)); + CHECK_EQ(a(&t, 4), 0xffff8081u); + CHECK_EQ(a(&t, 5), 0x8081u); + CHECK_EQ(a(&t, 6), 0x80u); + CHECK_EQ(a(&t, 8), 0x22334400u); + CHECK_EQ(a(&t, 11), 0x55u); /* S32C1I stored, and returned the old word */ + CHECK_EQ(a(&t, 12), 0x66u); + CHECK_EQ(a(&t, 13), 0x66u); /* compare failed: nothing stored */ + CHECK_EQ(a(&t, 14), 0xcafef00du); + close32(&t); +} + +/* fib(12) by CALL8/ENTRY/RETW: twelve frames deep, spilled and filled by + * the ROM's WindowOverflow8 and WindowUnderflow8 */ +static void test_windows(void) +{ + t32 t; + if (!OPEN(t, windows, WINDOWS)) + return; + CHECK(run_to_end(&t, 200000)); + CHECK_EQ(a(&t, 15), 144u); + CHECK_EQ(reg(&t, GR_WB), 0u); + close32(&t); +} + +static void test_syscall(void) +{ + t32 t; + if (!OPEN(t, syscall, SYSCALL)) + return; + CHECK(run_to_end(&t, 100)); + CHECK_EQ(a(&t, 4), 1u); /* EXCCAUSE: SyscallCause */ + CHECK_EQ(a(&t, 3), 1u); /* back after it */ + CHECK_EQ(reg(&t, GR_PS) & 0x10u, 0u); /* RFE cleared EXCM */ + close32(&t); +} + +static void test_timer(void) +{ + t32 t; + if (!OPEN(t, timer, TIMER)) + return; + CHECK(run_to_end(&t, 2000)); + CHECK_EQ(a(&t, 6), 1u); + CHECK_EQ(a(&t, 7), 4u); /* Level1InterruptCause */ + CHECK_EQ(a(&t, 8) & 0x40u, 0x40u); /* INTERRUPT: timer 0 */ + close32(&t); +} + +static void test_dbreak(void) +{ + t32 t; + if (!OPEN(t, dbreak, DBREAK)) + return; + CHECK(run_to_end(&t, 200)); + CHECK_EQ(a(&t, 6), 1u); /* one hit: the store inside */ + CHECK_EQ(a(&t, 7) & 0x4u, 0x4u); /* DEBUGCAUSE: DBREAK */ + CHECK_EQ(a(&t, 9), 0x55u); /* the store done after it */ + close32(&t); +} + +static void test_float(void) +{ + t32 t; + if (!OPEN(t, float, FLOAT)) + return; + CHECK(run_to_end(&t, 100)); + CHECK_EQ(a(&t, 5), 13u); + CHECK_EQ(a(&t, 6), 2u); + CHECK_EQ(a(&t, 7), 5u); + CHECK_EQ(a(&t, 8), 0x40f00000u); + close32(&t); +} + +static void test_mac16(void) +{ + t32 t; + if (!OPEN(t, mac16, MAC16)) + return; + CHECK(run_to_end(&t, 100)); + CHECK_EQ(a(&t, 4), 14u); + CHECK_EQ(a(&t, 5), 0u); + CHECK_EQ(a(&t, 6), 15u); + close32(&t); +} + +/* the APP_CPU's ROM keeps its own data: released, it runs the ROM's start, + * which sets g_ticks_per_us_app (0x3FFE40F0) and leaves the PRO_CPU's + * g_ticks_per_us_pro (0x3FFE01E0) as the PRO_CPU set it */ +static void test_app_cpu_rom_data(void) +{ + static const unsigned char spin[3] = { 0x06, 0xff, 0xff }; /* j . */ + t32 t; + u32 pro = 0, app = 0; + if (!open32(&t, spin, sizeof spin, IRAM)) + return; + CHECK_EQ(esk_bus_debug_write(&t.m.bus, 0x3FFE01E0u, 4, 80u), 0); + CHECK_EQ(esk_bus_debug_write(&t.m.bus, 0x3FFE40F0u, 4, 0xdeadbeefu), 0); + /* DPORT: the APP_CPU's clock on, out of reset (APPCPU_CTRL_B, _A) */ + CHECK_EQ(esk_bus_write(&t.m.bus, 0x3FF00030u, 4, 1u), 0); + CHECK_EQ(esk_bus_write(&t.m.bus, 0x3FF0002Cu, 4, 0u), 0); + esk_mach_run(&t.m, 0xffffffffu, 20000); + CHECK_EQ(esk_bus_debug_read(&t.m.bus, 0x3FFE01E0u, 4, &pro), 0); + CHECK_EQ(esk_bus_debug_read(&t.m.bus, 0x3FFE40F0u, 4, &app), 0); + CHECK_EQ(pro, 80u); + CHECK_EQ(app, 13u); /* the ROM's initial value, unpacked by the APP_CPU */ + close32(&t); +} + +TEST_MAIN_BEGIN +RUN(test_alu); +RUN(test_shifts); +RUN(test_muldiv); +RUN(test_loops); +RUN(test_branches); +RUN(test_memory); +RUN(test_windows); +RUN(test_syscall); +RUN(test_timer); +RUN(test_dbreak); +RUN(test_float); +RUN(test_mac16); +RUN(test_app_cpu_rom_data); +TEST_MAIN_END diff --git a/tests/vendor/arduino-esp32/examples/ESP32_AnalogReadSerial/project.json b/tests/vendor/arduino-esp32/examples/ESP32_AnalogReadSerial/project.json new file mode 100644 index 000000000..3a70b1874 --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_AnalogReadSerial/project.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "arduino-esp32-ESP32_AnalogReadSerial", + "description": "AnalogReadSerial on the ESP32-DevKitC V4: A0 is GPIO36 (the header's VP), fed 1.1 V from a source.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + }, + { + "id": "V1", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 1.1 + }, + "layout": { + "x": 120, + "y": 460 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1", + "V1.-" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "A0": [ + "V1.+", + "B1.VP" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_AnalogReadSerial/scenario.json b/tests/vendor/arduino-esp32/examples/ESP32_AnalogReadSerial/scenario.json new file mode 100644 index 000000000..76299928b --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_AnalogReadSerial/scenario.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "ESP32_AnalogReadSerial", + "until": "1200ms", + "description": "AnalogReadSerial on the ESP32: analogRead(A0) on GPIO36 at Arduino-ESP32's defaults (12 bits, 11 dB), 1.1 V reading 1118 as on ESP-IDF's oneshot_read (the line ESP-IDF's Vref calibration fits for this chip, Vref 1170 mV), printed every millisecond.", + "inputs": [], + "assertions": [ + { + "id": "reads", + "at": "1s", + "probe": "console", + "expect": { + "contains": "\r\n1118\r\n1118\r\n1118\r\n" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_DigitalReadSerial/project.json b/tests/vendor/arduino-esp32/examples/ESP32_DigitalReadSerial/project.json new file mode 100644 index 000000000..0fba094a7 --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_DigitalReadSerial/project.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "arduino-esp32-ESP32_DigitalReadSerial", + "description": "DigitalReadSerial as its comment wires it: a push button from 3V3 to IO2 (pin 2), 10 kohm from IO2 to ground. On the ESP32-DevKitC V4 (pin 2 is GPIO2).", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + }, + { + "id": "SW1", + "component": "emblink/push_button", + "layout": { + "x": 120, + "y": 460 + } + }, + { + "id": "R1", + "component": "emblink/resistor", + "params": { + "resistance": 10000 + }, + "layout": { + "x": 260, + "y": 460 + } + } + ], + "nets": { + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1", + "R1.2" + ], + "3V3": [ + "B1.3V3", + "SW1.1" + ], + "BTN": [ + "SW1.2", + "B1.IO2", + "R1.1" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_DigitalReadSerial/scenario.json b/tests/vendor/arduino-esp32/examples/ESP32_DigitalReadSerial/scenario.json new file mode 100644 index 000000000..614c6b9dc --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_DigitalReadSerial/scenario.json @@ -0,0 +1,47 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "ESP32_DigitalReadSerial", + "until": "2000ms", + "description": "DigitalReadSerial: the button's state printed at 9600 baud, a line a millisecond or as fast as the UART takes it: 0 until the button is pressed at 1 s, 1 while it is held.", + "inputs": [ + { + "at": "1s", + "target": "SW1", + "input": "pressed", + "value": true + }, + { + "at": "1500ms", + "target": "SW1", + "input": "pressed", + "value": false + } + ], + "assertions": [ + { + "id": "released", + "at": "900ms", + "probe": "console", + "expect": { + "contains": "\r\n0\r\n0\r\n" + } + }, + { + "id": "not-yet", + "at": "900ms", + "probe": "console", + "expect": { + "not_contains": "\r\n1\r\n" + } + }, + { + "id": "pressed", + "at": "1450ms", + "probe": "console", + "expect": { + "contains": "\r\n1\r\n1\r\n1\r\n" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_GetChipID/project.json b/tests/vendor/arduino-esp32/examples/ESP32_GetChipID/project.json new file mode 100644 index 000000000..a9df5493f --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_GetChipID/project.json @@ -0,0 +1,61 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "arduino-esp32-ESP32_GetChipID", + "description": "GetChipID on the ESP32-DevKitC V4, plugged into USB; Serial is UART0 through the CP2102N.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_GetChipID/scenario.json b/tests/vendor/arduino-esp32/examples/ESP32_GetChipID/scenario.json new file mode 100644 index 000000000..4b56af140 --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_GetChipID/scenario.json @@ -0,0 +1,34 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "ESP32_GetChipID", + "until": "3600ms", + "description": "GetChipID on the ESP32: the chip as ESP.getChipModel, getChipRevision and getChipCores report it (ESP32-D0WD-V3, 301 for v3.1, two cores) and the ESP8266-style ID, the eFuse MAC's last three bytes (24:0A:C4:45:6D:62: 0x456D62), printed again after 3 s. Serial.printf's \\n goes out alone.", + "inputs": [], + "assertions": [ + { + "id": "model", + "at": "1s", + "probe": "console", + "expect": { + "contains": "ESP32 Chip model = ESP32-D0WD-V3 Rev 301\nThis chip has 2 cores\nChip ID: 4549986\r\n" + } + }, + { + "id": "once", + "at": "1s", + "probe": "console", + "expect": { + "not_contains": "4549986\r\nESP32" + } + }, + { + "id": "again", + "at": "3500ms", + "probe": "console", + "expect": { + "contains": "Chip ID: 4549986\r\nESP32 Chip model = ESP32-D0WD-V3 Rev 301\n" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_ReadAnalogVoltage/project.json b/tests/vendor/arduino-esp32/examples/ESP32_ReadAnalogVoltage/project.json new file mode 100644 index 000000000..0378b2579 --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_ReadAnalogVoltage/project.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "arduino-esp32-ESP32_ReadAnalogVoltage", + "description": "ReadAnalogVoltage on the ESP32-DevKitC V4: A0 is GPIO36 (the header's VP), fed 1.1 V from a source.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + }, + { + "id": "V1", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 1.1 + }, + "layout": { + "x": 120, + "y": 460 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1", + "V1.-" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "A0": [ + "V1.+", + "B1.VP" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_ReadAnalogVoltage/scenario.json b/tests/vendor/arduino-esp32/examples/ESP32_ReadAnalogVoltage/scenario.json new file mode 100644 index 000000000..8bde6d32c --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_ReadAnalogVoltage/scenario.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "ESP32_ReadAnalogVoltage", + "until": "1200ms", + "description": "ReadAnalogVoltage on the ESP32: the sketch converts as for the Uno (value x 5.0 / 1023), so the ESP32's 12-bit 1118 for 1.1 V prints 5.46, as it does on a real ESP32.", + "inputs": [], + "assertions": [ + { + "id": "reads", + "at": "1s", + "probe": "console", + "expect": { + "contains": "\r\n5.46\r\n5.46\r\n5.46\r\n" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_RepeatTimer/project.json b/tests/vendor/arduino-esp32/examples/ESP32_RepeatTimer/project.json new file mode 100644 index 000000000..300352de6 --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_RepeatTimer/project.json @@ -0,0 +1,61 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "arduino-esp32-ESP32_RepeatTimer", + "description": "RepeatTimer on the ESP32-DevKitC V4: BTN_STOP_ALARM is GPIO0, the board's own Boot button (SW1).", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/examples/ESP32_RepeatTimer/scenario.json b/tests/vendor/arduino-esp32/examples/ESP32_RepeatTimer/scenario.json new file mode 100644 index 000000000..ab30ee778 --- /dev/null +++ b/tests/vendor/arduino-esp32/examples/ESP32_RepeatTimer/scenario.json @@ -0,0 +1,47 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "ESP32_RepeatTimer", + "until": "6s", + "description": "RepeatTimer: a timer at 1 MHz with a 1 s auto-reload alarm, its ISR giving a semaphore the loop prints from, with millis() as the ISR saw it; the board's Boot button (IO0) pressed at 3.5 s ends the timer, so there is no fourth. The alarms come at 1006, 2006 and 3006 ms of millis(): setup starts the timer 6 ms after the clock millis() reads began, later than on the C3.", + "inputs": [ + { + "at": "3500ms", + "target": "B1.SW1", + "input": "pressed", + "value": true + }, + { + "at": "3700ms", + "target": "B1.SW1", + "input": "pressed", + "value": false + } + ], + "assertions": [ + { + "id": "first", + "at": "1200ms", + "probe": "console", + "expect": { + "contains": "onTimer no. 1 at 1006 ms\r\n" + } + }, + { + "id": "third", + "at": "3400ms", + "probe": "console", + "expect": { + "contains": "onTimer no. 2 at 2006 ms\r\nonTimer no. 3 at 3006 ms\r\n" + } + }, + { + "id": "stopped", + "at": "6s", + "probe": "console", + "expect": { + "not_contains": "onTimer no. 4" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/arduino-esp32/run.py b/tests/vendor/arduino-esp32/run.py index a99c3050f..1f284a934 100644 --- a/tests/vendor/arduino-esp32/run.py +++ b/tests/vendor/arduino-esp32/run.py @@ -2,7 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2026 Junior Deogracias """Arduino sketches built with Espressif's Arduino-ESP32 core, unmodified, on -EmbSIM's ESP32-C3-DevKitM-1 (the RTOS boards plan, part 2, step 7; 01 §8.2). +EmbSIM's ESP32-C3-DevKitM-1 (the RTOS boards plan, part 2, step 7; 01 §8.2) +and, for the examples named ESP32_*, its ESP32-DevKitC V4. The core is not vendored. --cli names arduino-cli and --config its configuration, in whose data directory the esp32 platform (3.2.0, on ESP-IDF @@ -14,7 +15,8 @@ Each example under examples// is one of those sketches (EXAMPLES below names where), compiled as the IDE compiles it for "ESP32C3 Dev Module" (`arduino-cli compile --fqbn esp32:esp32:esp32c3`, the board's defaults: -UART0 as Serial, 4 MB flash in QIO at 80 MHz). The build's merged image +UART0 as Serial, 4 MB flash in QIO at 80 MHz), the ESP32_* ones for "ESP32 +Dev Module" (esp32:esp32:esp32, its defaults). The build's merged image (bootloader, partition table, boot_app0 and the sketch at their offsets, the rest erased) runs examples//project.json, or this directory's, under the example's scenario.json, whose assertions must all pass. @@ -36,10 +38,19 @@ from vendor_run import run_scenario, sh # noqa: E402 FQBN = "esp32:esp32:esp32c3" +# the board an example is compiled for, when not "ESP32C3 Dev Module" (its +# project.json names the EmbSIM board): "ESP32 Dev Module" for the +# ESP32-DevKitC V4's ESP32_ examples +FQBNS = {"ESP32_": "esp32:esp32:esp32"} PLATFORM = "3.2.0" # examples// and its sketch: the IDE's built-in examples ("builtin", # arduino-examples' examples/) or the core's ("core", its libraries/) EXAMPLES = { + "ESP32_AnalogReadSerial": ("builtin", "01.Basics/AnalogReadSerial"), + "ESP32_ReadAnalogVoltage": ("builtin", "01.Basics/ReadAnalogVoltage"), + "ESP32_DigitalReadSerial": ("builtin", "01.Basics/DigitalReadSerial"), + "ESP32_GetChipID": ("core", "ESP32/examples/ChipID/GetChipID"), + "ESP32_RepeatTimer": ("core", "ESP32/examples/Timer/RepeatTimer"), "Blink": ("builtin", "01.Basics/Blink"), "DigitalReadSerial": ("builtin", "01.Basics/DigitalReadSerial"), "Fade": ("builtin", "01.Basics/Fade"), @@ -63,12 +74,16 @@ def platform_dir(cli: str, config: str) -> Path: return d if (d / "platform.txt").exists() else None -def build(cli: str, config: str, sketch: Path, out: Path) -> Path: +def fqbn_of(name: str) -> str: + return next((f for prefix, f in FQBNS.items() if name.startswith(prefix)), FQBN) + + +def build(cli: str, config: str, sketch: Path, out: Path, fqbn: str = FQBN) -> Path: """The sketch compiled as the IDE compiles it: its merged flash image""" - work = out / sketch.name + work = out / fqbn.rsplit(":", 1)[-1] / sketch.name shutil.rmtree(work, ignore_errors=True) shutil.copytree(sketch, work / sketch.name) - sh([cli, "--config-file", config, "compile", "--fqbn", FQBN, "--output-dir", work / "out", work / sketch.name]) + sh([cli, "--config-file", config, "compile", "--fqbn", fqbn, "--output-dir", work / "out", work / sketch.name]) return work / "out" / f"{sketch.name}.ino.merged.bin" @@ -99,7 +114,7 @@ def main() -> int: for name in names: where, path = EXAMPLES[name] sketch = (Path(args.examples) / "examples" if where == "builtin" else core / "libraries") / path - flash = build(args.cli, args.config, sketch, work / "build") + flash = build(args.cli, args.config, sketch, work / "build", fqbn_of(name)) mine = HERE / "examples" / name project = mine / "project.json" if (mine / "project.json").exists() else HERE / "project.json" bad += not run_scenario(Path(args.embsim), project, name, flash, mine / "scenario.json", work / "run", diff --git a/tests/vendor/esp-idf/examples/esp32_adc_oneshot_read/project.json b/tests/vendor/esp-idf/examples/esp32_adc_oneshot_read/project.json new file mode 100644 index 000000000..7262f65b1 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_adc_oneshot_read/project.json @@ -0,0 +1,112 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_adc_oneshot_read", + "description": "ESP-IDF's adc/oneshot_read on the ESP32-DevKitC V4: 1.1 V on IO32 (ADC1 channel 4), 2.2 V on IO33 (ADC1 channel 5) and 0.5 V on IO4 (ADC2 channel 0) from three sources.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + }, + { + "id": "V2", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 1.1 + }, + "layout": { + "x": 120, + "y": 440 + } + }, + { + "id": "V3", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 2.2 + }, + "layout": { + "x": 120, + "y": 560 + } + }, + { + "id": "V4", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 0.5 + }, + "layout": { + "x": 120, + "y": 700 + } + } + ], + "nets": { + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1", + "V2.-", + "V3.-", + "V4.-" + ], + "IO32": [ + "V2.+", + "B1.IO32" + ], + "IO33": [ + "V3.+", + "B1.IO33" + ], + "IO4": [ + "V4.+", + "B1.IO4" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_adc_oneshot_read/scenario.json b/tests/vendor/esp-idf/examples/esp32_adc_oneshot_read/scenario.json new file mode 100644 index 000000000..9d0d3b8b0 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_adc_oneshot_read/scenario.json @@ -0,0 +1,58 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_adc_oneshot_read", + "until": "3500ms", + "description": "adc/oneshot_read on the ESP32: ADC1's channels 4 and 5 and ADC2's channel 0 at 12 dB, one read a second each, with the eFuse's Vref calibration (ESP-IDF's line fitting, Vref 1170 mV on this chip). The model's transfer is that fitted line, so the raw codes are its inverse and the calibrated voltages the sources' within a millivolt. ADC1 at 12 dB: a = 1170 x 196602 / 4096 = 56158, b = 142 mV, so 1.1 V is (1100 - 142) x 65536 / 56158 = 1118 and 2.2 V 2402; ADC2: a = 56320, b = 128 mV, so 0.5 V is 433.", + "inputs": [], + "assertions": [ + { + "id": "adc1-ch4-raw", + "at": "3400ms", + "probe": "console", + "expect": { + "contains": "ADC1 Channel[4] Raw Data: 1118\r\n" + } + }, + { + "id": "adc1-ch4-mv", + "at": "3400ms", + "probe": "console", + "expect": { + "contains": "ADC1 Channel[4] Cali Voltage: 1100 mV\r\n" + } + }, + { + "id": "adc1-ch5-raw", + "at": "3400ms", + "probe": "console", + "expect": { + "contains": "ADC1 Channel[5] Raw Data: 2402\r\n" + } + }, + { + "id": "adc1-ch5-mv", + "at": "3400ms", + "probe": "console", + "expect": { + "contains": "ADC1 Channel[5] Cali Voltage: 2200 mV\r\n" + } + }, + { + "id": "adc2-ch0-raw", + "at": "3400ms", + "probe": "console", + "expect": { + "contains": "ADC2 Channel[0] Raw Data: 433\r\n" + } + }, + { + "id": "adc2-ch0-mv", + "at": "3400ms", + "probe": "console", + "expect": { + "contains": "ADC2 Channel[0] Cali Voltage: 500 mV\r\n" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_blink/project.json b/tests/vendor/esp-idf/examples/esp32_blink/project.json new file mode 100644 index 000000000..0ba8734e5 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_blink/project.json @@ -0,0 +1,102 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_blink", + "description": "ESP-IDF's blink on the ESP32-DevKitC V4 with an LED on IO2 through 330 ohm (the DevKitC has no LED of its own; sdkconfig.defaults chooses the GPIO LED on GPIO2).", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + }, + { + "id": "R1", + "component": "emblink/resistor", + "params": { + "resistance": "330" + }, + "layout": { + "x": 600, + "y": 160 + } + }, + { + "id": "LED1", + "component": "emblink/led", + "params": { + "color": "red" + }, + "layout": { + "x": 680, + "y": 160 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1", + "LED1.K" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "IO2": [ + "B1.IO2", + "R1.1" + ], + "LA": [ + "R1.2", + "LED1.A" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + }, + { + "id": "io2", + "target": "net:IO2", + "kind": "digital" + }, + { + "id": "led", + "target": "output:LED1.luminance", + "kind": "value" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_blink/scenario.json b/tests/vendor/esp-idf/examples/esp32_blink/scenario.json new file mode 100644 index 000000000..636b319a9 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_blink/scenario.json @@ -0,0 +1,58 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_blink", + "until": "3900ms", + "description": "blink on the ESP32, the GPIO LED on GPIO2 (sdkconfig.defaults): gpio_set_level through the GPIO matrix every second, the console saying each; the LED off first, then on, off, on.", + "inputs": [], + "assertions": [ + { + "id": "gpio", + "at": "1s", + "probe": "console", + "expect": { + "contains": "Example configured to blink GPIO LED!" + } + }, + { + "id": "on", + "at": "1800ms", + "probe": "io2", + "expect": { + "equals": 1 + } + }, + { + "id": "lit", + "at": "1800ms", + "probe": "led", + "expect": { + "min": 0.1 + } + }, + { + "id": "off", + "at": "2800ms", + "probe": "io2", + "expect": { + "equals": 0 + } + }, + { + "id": "on-again", + "at": "3800ms", + "probe": "io2", + "expect": { + "equals": 1 + } + }, + { + "id": "said", + "at": "3800ms", + "probe": "console", + "expect": { + "contains": "Turning the LED ON!" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_blink/sdkconfig.defaults b/tests/vendor/esp-idf/examples/esp32_blink/sdkconfig.defaults new file mode 100644 index 000000000..fdea10c5d --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_blink/sdkconfig.defaults @@ -0,0 +1,2 @@ +CONFIG_BLINK_LED_GPIO=y +CONFIG_BLINK_GPIO=2 diff --git a/tests/vendor/esp-idf/examples/esp32_blink_strip/project.json b/tests/vendor/esp-idf/examples/esp32_blink_strip/project.json new file mode 100644 index 000000000..f56d3b192 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_blink_strip/project.json @@ -0,0 +1,100 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_blink_strip", + "description": "ESP-IDF's get-started/blink with its LED-strip option on the ESP32-DevKitC V4 (sdkconfig.defaults: CONFIG_BLINK_LED_STRIP, the RMT backend, GPIO18): a WS2812B on IO18, powered from the board's 5 V through a 1N4007, a common way to drive one from 3.3 V logic: the diode's drop at the LED's supply current lowers VDD to about 4.2 V, and with it the input's high threshold (0.7 VDD) below the ESP32's 3.3 V. The part's model draws no supply current (its fidelity says so), so here the diode carries none and LED_VDD reads the board's 5 V net.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + }, + { + "id": "D1", + "component": "emblink/diode_1n4007", + "layout": { + "x": 120, + "y": 460 + } + }, + { + "id": "LED1", + "component": "emblink/ws2812b", + "layout": { + "x": 120, + "y": 560 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1", + "LED1.GND" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "5V": [ + "B1.5V", + "D1.A" + ], + "LED_VDD": [ + "D1.K", + "LED1.VDD" + ], + "DATA": [ + "B1.IO18", + "LED1.DIN" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + }, + { + "id": "led", + "target": "output:LED1.color", + "kind": "value" + }, + { + "id": "frames", + "target": "output:LED1.frames", + "kind": "value" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_blink_strip/scenario.json b/tests/vendor/esp-idf/examples/esp32_blink_strip/scenario.json new file mode 100644 index 000000000..89de6eef0 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_blink_strip/scenario.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_blink_strip", + "until": "3900ms", + "description": "blink with the LED strip on the ESP32: the RMT (channel 0, 10 MHz from APB_CLK, through the matrix's rmt_sig_out0) sends the WS2812B white at 16/255 for one second, then black, and again; the console says each. Five frames by 3.8 s: the clear when the strip is configured, then OFF, ON, OFF, ON.", + "inputs": [], + "assertions": [ + { + "id": "strip", + "at": "1s", + "probe": "console", + "expect": { + "contains": "Example configured to blink addressable LED!" + } + }, + { + "id": "off-first", + "at": "1s", + "probe": "led", + "expect": { + "equals": "#000000" + } + }, + { + "id": "on", + "at": "1800ms", + "probe": "led", + "expect": { + "equals": "#101010" + } + }, + { + "id": "off", + "at": "2800ms", + "probe": "led", + "expect": { + "equals": "#000000" + } + }, + { + "id": "on-again", + "at": "3800ms", + "probe": "led", + "expect": { + "equals": "#101010" + } + }, + { + "id": "frames", + "at": "3800ms", + "probe": "frames", + "expect": { + "equals": 5 + } + }, + { + "id": "said", + "at": "3800ms", + "probe": "console", + "expect": { + "contains": "Turning the LED ON!" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_blink_strip/sdkconfig.defaults b/tests/vendor/esp-idf/examples/esp32_blink_strip/sdkconfig.defaults new file mode 100644 index 000000000..4557fd979 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_blink_strip/sdkconfig.defaults @@ -0,0 +1,3 @@ +CONFIG_BLINK_LED_STRIP=y +CONFIG_BLINK_LED_STRIP_BACKEND_RMT=y +CONFIG_BLINK_GPIO=18 diff --git a/tests/vendor/esp-idf/examples/esp32_dac_oneshot/project.json b/tests/vendor/esp-idf/examples/esp32_dac_oneshot/project.json new file mode 100644 index 000000000..ba2de2ed0 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_dac_oneshot/project.json @@ -0,0 +1,61 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_dac_oneshot", + "description": "ESP-IDF's dac/dac_oneshot on the ESP32-DevKitC V4: DAC1 on IO25 and DAC2 on IO26, read back by ADC2's channels 8 and 9 on the same pads, plugged into USB.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_dac_oneshot/scenario.json b/tests/vendor/esp-idf/examples/esp32_dac_oneshot/scenario.json new file mode 100644 index 000000000..32a438554 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_dac_oneshot/scenario.json @@ -0,0 +1,42 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_dac_oneshot", + "until": "3s", + "description": "dac/dac_oneshot on the ESP32: each DAC steps its code by 10 every 500 ms (DAC2 half a second behind), VDD3P3_RTC x code / 255 on its pad, and ADC2 (channels 8 and 9, GPIO25 and GPIO26, 12 dB) reads the pads every 100 ms. With this chip's Vref (1170 mV) ADC2's fitted line is a = 56320, b = 128 mV: code 10 (129.4 mV) reads 2, 20 reads 152, 30 reads 303, 40 reads 453, 50 (647.1 mV) reads 604. The example prints with a bare \\n.", + "inputs": [], + "assertions": [ + { + "id": "started", + "at": "1s", + "probe": "console", + "expect": { + "contains": "DAC channel 0 value: 2\tDAC channel 1 value: 0\n" + } + }, + { + "id": "steps", + "at": "2900ms", + "probe": "console", + "expect": { + "contains": "DAC channel 0 value: 152\tDAC channel 1 value: 2\n" + } + }, + { + "id": "steps2", + "at": "2900ms", + "probe": "console", + "expect": { + "contains": "DAC channel 0 value: 453\tDAC channel 1 value: 303\n" + } + }, + { + "id": "code50", + "at": "2900ms", + "probe": "console", + "expect": { + "contains": "DAC channel 0 value: 604\tDAC channel 1 value: 453\n" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_gptimer/project.json b/tests/vendor/esp-idf/examples/esp32_gptimer/project.json new file mode 100644 index 000000000..d30d5c047 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_gptimer/project.json @@ -0,0 +1,61 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_gptimer", + "description": "ESP-IDF's peripherals/timer_group/gptimer on the ESP32-DevKitC V4, plugged into USB; the console is UART0 through the CP2102N.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_gptimer/scenario.json b/tests/vendor/esp-idf/examples/esp32_gptimer/scenario.json new file mode 100644 index 000000000..fba0039f7 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_gptimer/scenario.json @@ -0,0 +1,146 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_gptimer", + "until": "9600ms", + "description": "gptimer: TIMG0's T0 at 1 MHz (APB_CLK / 80). Stopped at its 1 s alarm, the count the ISR reads is 1000001 (about 1 us from the alarm to the read at 160 MHz; ESP-IDF's README shows 1000002 on its chip); set to 100 and read back; four auto-reloads a second apart, each read 1 after its reload to 0; then four alarms moved 1 s on each time. Each event is pinned by a window (absent before, present after) rather than by the log's timestamps, which move by a millisecond with the image's size (the build's paths and compile time are in it).", + "inputs": [], + "assertions": [ + { + "id": "not-before-alarm", + "at": "1200ms", + "probe": "console", + "expect": { + "not_contains": "Timer stopped" + } + }, + { + "id": "stopped", + "at": "1300ms", + "probe": "console", + "expect": { + "contains": "example: Timer stopped, count=1000001\r\n" + } + }, + { + "id": "set", + "at": "1300ms", + "probe": "console", + "expect": { + "contains": "example: Timer count value=100\r\n" + } + }, + { + "id": "reload-not-early", + "at": "2200ms", + "probe": "console", + "expect": { + "not_contains": "Timer reloaded" + } + }, + { + "id": "reloaded", + "at": "2300ms", + "probe": "console", + "expect": { + "contains": "example: Timer reloaded, count=1\r\n" + } + }, + { + "id": "reloading", + "at": "5200ms", + "probe": "console", + "expect": { + "not_contains": "example: Stop timer" + } + }, + { + "id": "reloads-done", + "at": "5300ms", + "probe": "console", + "expect": { + "contains": "example: Stop timer" + } + }, + { + "id": "alarm1-not-early", + "at": "6200ms", + "probe": "console", + "expect": { + "not_contains": "example: Timer alarmed, count=1000001" + } + }, + { + "id": "alarm1", + "at": "6300ms", + "probe": "console", + "expect": { + "contains": "example: Timer alarmed, count=1000001\r\n" + } + }, + { + "id": "alarm2-not-early", + "at": "7200ms", + "probe": "console", + "expect": { + "not_contains": "example: Timer alarmed, count=2000001" + } + }, + { + "id": "alarm2", + "at": "7300ms", + "probe": "console", + "expect": { + "contains": "example: Timer alarmed, count=2000001\r\n" + } + }, + { + "id": "alarm3-not-early", + "at": "8200ms", + "probe": "console", + "expect": { + "not_contains": "example: Timer alarmed, count=3000001" + } + }, + { + "id": "alarm3", + "at": "8300ms", + "probe": "console", + "expect": { + "contains": "example: Timer alarmed, count=3000001\r\n" + } + }, + { + "id": "alarm4-not-early", + "at": "9200ms", + "probe": "console", + "expect": { + "not_contains": "example: Timer alarmed, count=4000001" + } + }, + { + "id": "alarm4", + "at": "9300ms", + "probe": "console", + "expect": { + "contains": "example: Timer alarmed, count=4000001\r\n" + } + }, + { + "id": "deleted", + "at": "9600ms", + "probe": "console", + "expect": { + "contains": "example: Delete timer" + } + }, + { + "id": "no-miss", + "at": "9600ms", + "probe": "console", + "expect": { + "not_contains": "Missed one count event" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_hello_world/project.json b/tests/vendor/esp-idf/examples/esp32_hello_world/project.json new file mode 100644 index 000000000..b223b1942 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_hello_world/project.json @@ -0,0 +1,61 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_hello_world", + "description": "An ESP32-DevKitC V4 running ESP-IDF's hello_world, built unmodified by ESP-IDF's tools for the esp32 target (tests/vendor/esp-idf/run.py puts its 4 MB flash image beside this file as flash.bin), plugged into USB. The console is UART0 through the CP2102N.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_hello_world/scenario.json b/tests/vendor/esp-idf/examples/esp32_hello_world/scenario.json new file mode 100644 index 000000000..4ae1bd0b2 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_hello_world/scenario.json @@ -0,0 +1,82 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_hello_world", + "until": "11600ms", + "description": "hello_world on the ESP32: Espressif's ROM (ECO3, its banner and boot mode), ESP-IDF's second-stage bootloader (chip revision v3.1 from the eFuses, the image's SHA-256 on the SHA accelerator), the application on both cores at 160 MHz, its chip report, a countdown of eleven one-second FreeRTOS delays, and esp_restart back to the ROM with a software CPU reset of the PRO_CPU.", + "inputs": [], + "assertions": [ + { + "id": "rom", + "at": "100ms", + "probe": "console", + "expect": { + "contains": "rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)" + } + }, + { + "id": "banner", + "at": "100ms", + "probe": "console", + "expect": { + "contains": "ets Jul 29 2019 12:21:46" + } + }, + { + "id": "revision", + "at": "300ms", + "probe": "console", + "expect": { + "contains": "boot: chip revision: v3.1" + } + }, + { + "id": "app", + "at": "500ms", + "probe": "console", + "expect": { + "contains": "cpu_start: Multicore app" + } + }, + { + "id": "freq", + "at": "500ms", + "probe": "console", + "expect": { + "contains": "cpu freq: 160000000 Hz" + } + }, + { + "id": "hello", + "at": "1s", + "probe": "console", + "expect": { + "contains": "Hello world!" + } + }, + { + "id": "chip", + "at": "1s", + "probe": "console", + "expect": { + "contains": "This is esp32 chip with 2 CPU core(s), WiFi/BTBLE, silicon revision v3.1" + } + }, + { + "id": "not-yet", + "at": "11200ms", + "probe": "console", + "expect": { + "not_contains": "Restarting now." + } + }, + { + "id": "restart", + "at": "11600ms", + "probe": "console", + "expect": { + "contains": "rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_i2c_eeprom/project.json b/tests/vendor/esp-idf/examples/esp32_i2c_eeprom/project.json new file mode 100644 index 000000000..b6da657ea --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_i2c_eeprom/project.json @@ -0,0 +1,126 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_i2c_eeprom", + "description": "ESP-IDF's i2c/i2c_eeprom on the ESP32-DevKitC V4: a 24LC256 at 0x50 (A0-A2 and WP grounded) on SCL IO4 and SDA IO5 at 400 kHz, the example's defaults, with 4.7 kohm pull-ups to 3V3 (the example enables no internal pull-ups). The part's write cycle is set to 2 ms, a part faster than the datasheet's 5 ms maximum: the example waits pdMS_TO_TICKS(10), one tick at FreeRTOS's 100 Hz, which ends at the next tick, and a part taking its maximum would NACK the read, on a real bench too.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + }, + { + "id": "U2", + "component": "emblink/eeprom_24lc256", + "params": { + "view_at": 16, + "twr": "2m" + }, + "layout": { + "x": 120, + "y": 460 + } + }, + { + "id": "R1", + "component": "emblink/resistor", + "params": { + "resistance": 4700 + }, + "layout": { + "x": 300, + "y": 440 + } + }, + { + "id": "R2", + "component": "emblink/resistor", + "params": { + "resistance": 4700 + }, + "layout": { + "x": 340, + "y": 440 + } + } + ], + "nets": { + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1", + "U2.GND", + "U2.A0", + "U2.A1", + "U2.A2", + "U2.WP" + ], + "3V3": [ + "B1.3V3", + "U2.VCC", + "R1.1", + "R2.1" + ], + "I2C_SCL": [ + "B1.IO4", + "U2.SCL", + "R1.2" + ], + "I2C_SDA": [ + "B1.IO5", + "U2.SDA", + "R2.2" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + }, + { + "id": "eeprom", + "target": "output:U2.view", + "kind": "value" + }, + { + "id": "cycles", + "target": "output:U2.cycles", + "kind": "value" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_i2c_eeprom/scenario.json b/tests/vendor/esp-idf/examples/esp32_i2c_eeprom/scenario.json new file mode 100644 index 000000000..d2d891de0 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_i2c_eeprom/scenario.json @@ -0,0 +1,34 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_i2c_eeprom", + "until": "1500ms", + "description": "i2c_eeprom on the ESP32: 0..47 written in one transaction (two address bytes, 48 data, a page from 0x0010 within the 64-byte page), 10 ms for the write cycle, then read back with a repeated START and printed 16 to a line, again every 50 ticks (500 ms). I2C0 runs it as one command and an END at a time (the ESP32's STOP needs its own transfer, SOC_I2C_STOP_INDEPENDENT), from APB_CLK at 400 kHz.", + "inputs": [], + "assertions": [ + { + "id": "stored", + "at": "1s", + "probe": "eeprom", + "expect": { + "contains": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2FFFFF" + } + }, + { + "id": "read-back", + "at": "1s", + "probe": "console", + "expect": { + "contains": "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f \r\n10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f \r\n20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f \r\n" + } + }, + { + "id": "again", + "at": "1400ms", + "probe": "cycles", + "expect": { + "equals": 3 + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_ledc_basic/project.json b/tests/vendor/esp-idf/examples/esp32_ledc_basic/project.json new file mode 100644 index 000000000..dab003ced --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_ledc_basic/project.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_ledc_basic", + "description": "ESP-IDF's ledc_basic on the ESP32-DevKitC V4: the low-speed timer 0 at 4 kHz, 13 bits, channel 0 at half duty on GPIO5.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + } + ], + "nets": { + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + }, + { + "id": "pwm", + "target": "net:B1.GPIO5", + "kind": "digital" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_ledc_basic/scenario.json b/tests/vendor/esp-idf/examples/esp32_ledc_basic/scenario.json new file mode 100644 index 000000000..2fffa0c63 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_ledc_basic/scenario.json @@ -0,0 +1,33 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_ledc_basic", + "until": "1200ms", + "description": "ledc_basic on the ESP32: the low-speed timer 0 at 4 kHz with 13 bits from APB_CLK (ESP-IDF's divider, CONF's APB_CLK_SEL), channel 0 at a duty of 4096/8192 on GPIO5 through the GPIO matrix (ledc_ls_sig_out0).", + "inputs": [], + "assertions": [ + { + "id": "frequency", + "between": [ + "1000ms", + "1100ms" + ], + "probe": "pwm", + "expect": { + "frequency_hz": 4000, + "tolerance": 0.01 + } + }, + { + "id": "edges", + "between": [ + "1000ms", + "1100ms" + ], + "probe": "pwm", + "expect": { + "edges": 800 + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_real_time_stats/project.json b/tests/vendor/esp-idf/examples/esp32_real_time_stats/project.json new file mode 100644 index 000000000..1b585c2b9 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_real_time_stats/project.json @@ -0,0 +1,61 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_real_time_stats", + "description": "ESP-IDF's system/freertos/real_time_stats on the ESP32-DevKitC V4, plugged into USB; the console is UART0 through the CP2102N.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + } + ], + "nets": { + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1" + ], + "USB5V": [ + "USB.+", + "B1.VBUS" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_real_time_stats/scenario.json b/tests/vendor/esp-idf/examples/esp32_real_time_stats/scenario.json new file mode 100644 index 000000000..31671eb94 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_real_time_stats/scenario.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_real_time_stats", + "until": "3500ms", + "description": "real_time_stats (FreeRTOS's run-time statistics on esp_timer's microseconds): six spin tasks of 500000 iterations and 100 ms sleeps, measured over 100 ticks (1 s) twice. The table's run times are the core's timing model's (each spin about 30 ms on either core at 160 MHz, about ten cycles an iteration from the flash cache), so the scenario checks the table's rows, not the figures: every spin task and both cores' idle tasks (IDLE0, IDLE1) listed, main deleted, the stats obtained each time. ESP-IDF's console turns each \\n into \\r\\n.", + "inputs": [], + "assertions": [ + { + "id": "first", + "at": "600ms", + "probe": "console", + "expect": { + "contains": "Getting real time stats over 100 ticks\r\n" + } + }, + { + "id": "table", + "at": "1500ms", + "probe": "console", + "expect": { + "contains": "| Task | Run Time | Percentage\r\n" + } + }, + { + "id": "spin0", + "at": "1500ms", + "probe": "console", + "expect": { + "contains": "| spin0 | " + } + }, + { + "id": "spin5", + "at": "1500ms", + "probe": "console", + "expect": { + "contains": "| spin5 | " + } + }, + { + "id": "idle0", + "at": "1500ms", + "probe": "console", + "expect": { + "contains": "| IDLE0 | " + } + }, + { + "id": "idle1", + "at": "1500ms", + "probe": "console", + "expect": { + "contains": "| IDLE1 | " + } + }, + { + "id": "main-deleted", + "at": "1500ms", + "probe": "console", + "expect": { + "contains": "| main | Deleted\r\n" + } + }, + { + "id": "obtained", + "at": "1500ms", + "probe": "console", + "expect": { + "contains": "Real time stats obtained\r\n" + } + }, + { + "id": "second", + "at": "3500ms", + "probe": "console", + "expect": { + "contains": "Real time stats obtained\r\n\r\n\r\nGetting real time stats over 100 ticks\r\n" + } + }, + { + "id": "no-error", + "at": "3500ms", + "probe": "console", + "expect": { + "not_contains": "Error getting real time stats" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_uart_echo/project.json b/tests/vendor/esp-idf/examples/esp32_uart_echo/project.json new file mode 100644 index 000000000..ceed1c3d4 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_uart_echo/project.json @@ -0,0 +1,91 @@ +{ + "schema_version": 1, + "kind": "project", + "name": "esp-idf-esp32_uart_echo", + "description": "ESP-IDF's uart/uart_echo on the ESP32-DevKitC V4: UART2 (the example's port on the ESP32) on TXD IO4 and RXD IO5 at 115200 baud, the example's defaults, to a 3.3 V USB-serial adapter's terminal.", + "policy": "electrical", + "boards": [ + { + "id": "B1", + "board": "emblink/esp32_devkitc", + "layout": { + "x": 360, + "y": 120 + }, + "firmware": { + "image": "flash.bin", + "format": "bin" + } + } + ], + "components": [ + { + "id": "USB", + "component": "emblink/vsource", + "params": { + "kind": "dc", + "dc": 5 + }, + "layout": { + "x": 120, + "y": 160 + } + }, + { + "id": "GND1", + "component": "emblink/gnd", + "layout": { + "x": 120, + "y": 320 + } + }, + { + "id": "VT1", + "component": "emblink/virtual_terminal", + "params": { + "baud": 115200 + }, + "layout": { + "x": 120, + "y": 460 + } + } + ], + "nets": { + "USB5V": [ + "USB.+", + "B1.VBUS" + ], + "GND": [ + "USB.-", + "GND1.GND", + "B1.GND1", + "VT1.GND" + ], + "U2TXD": [ + "B1.IO4", + "VT1.RX" + ], + "U2RXD": [ + "B1.IO5", + "VT1.TX" + ] + }, + "probes": [ + { + "id": "console", + "target": "serial:B1", + "kind": "serial" + }, + { + "id": "sent", + "target": "serial:VT1", + "kind": "serial" + }, + { + "id": "received", + "target": "output:VT1.rx_text", + "kind": "value" + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/examples/esp32_uart_echo/scenario.json b/tests/vendor/esp-idf/examples/esp32_uart_echo/scenario.json new file mode 100644 index 000000000..c8b4c25c6 --- /dev/null +++ b/tests/vendor/esp-idf/examples/esp32_uart_echo/scenario.json @@ -0,0 +1,71 @@ +{ + "schema_version": 1, + "kind": "scenario", + "name": "esp32_uart_echo", + "until": "1200ms", + "description": "uart_echo: what the terminal sends to IO5 comes back on IO4, and the console logs it. The echo task reads with a 20 ms timeout (two FreeRTOS ticks), so a line typed at once comes back whole.", + "inputs": [ + { + "at": "500ms", + "target": "VT1", + "input": "tx_text", + "value": "hello EmbSIM" + }, + { + "at": "900ms", + "target": "VT1", + "input": "tx_text", + "value": "0123456789" + } + ], + "assertions": [ + { + "id": "quiet", + "at": "450ms", + "probe": "received", + "expect": { + "equals": "" + } + }, + { + "id": "sent", + "at": "600ms", + "probe": "sent", + "expect": { + "equals": "hello EmbSIM" + } + }, + { + "id": "echo", + "at": "600ms", + "probe": "received", + "expect": { + "equals": "hello EmbSIM" + } + }, + { + "id": "logged", + "at": "600ms", + "probe": "console", + "expect": { + "contains": "UART TEST: Recv str: hello EmbSIM\r\n" + } + }, + { + "id": "again", + "at": "1200ms", + "probe": "received", + "expect": { + "equals": "hello EmbSIM0123456789" + } + }, + { + "id": "logged-again", + "at": "1200ms", + "probe": "console", + "expect": { + "contains": "UART TEST: Recv str: 0123456789\r\n" + } + } + ] +} \ No newline at end of file diff --git a/tests/vendor/esp-idf/run.py b/tests/vendor/esp-idf/run.py index 46f36f9a9..b07671e86 100644 --- a/tests/vendor/esp-idf/run.py +++ b/tests/vendor/esp-idf/run.py @@ -3,11 +3,12 @@ # Copyright 2026 Junior Deogracias """ESP-IDF's own examples for the ESP32-C3, built unmodified by ESP-IDF's build system and run on EmbSIM's ESP32-C3-DevKitM-1 (the RTOS boards plan, -part 2, step 7; 01 §8.2). +part 2, step 7; 01 §8.2), and for the ESP32 on the ESP32-DevKitC V4 (the +examples TARGETS names, built for that target). ESP-IDF is not vendored. --idf names an ESP-IDF checkout (v5.4) whose tools are installed, or IDF_PATH does; the riscv32-esp-elf toolchain must be on -PATH and ESP-IDF's Python environment the one running `idf.py` (its +PATH (xtensa-esp32-elf for the ESP32's) and ESP-IDF's Python environment the one running `idf.py` (its export.sh sets both up). An example's managed components (blink's led_strip) come from Espressif's component registry, as `idf.py` fetches them. @@ -70,7 +71,32 @@ "wifi_softap": "examples/wifi/getting_started/softAP", "wifi_station": "examples/wifi/getting_started/station", "wifi_station_open": "examples/wifi/getting_started/station", + "esp32_hello_world": "examples/get-started/hello_world", + "esp32_blink": "examples/get-started/blink", + "esp32_ledc_basic": "examples/peripherals/ledc/ledc_basic", + "esp32_i2c_eeprom": "examples/peripherals/i2c/i2c_eeprom", + "esp32_gptimer": "examples/peripherals/timer_group/gptimer", + "esp32_uart_echo": "examples/peripherals/uart/uart_echo", + "esp32_real_time_stats": "examples/system/freertos/real_time_stats", + "esp32_blink_strip": "examples/get-started/blink", + "esp32_adc_oneshot_read": "examples/peripherals/adc/oneshot_read", + "esp32_dac_oneshot": "examples/peripherals/dac/dac_oneshot", } +# the target an example is built for, when not the ESP32-C3 (its board in +# examples//project.json), and the toolchain that target needs +TARGETS = { + "esp32_hello_world": "esp32", + "esp32_blink": "esp32", + "esp32_ledc_basic": "esp32", + "esp32_i2c_eeprom": "esp32", + "esp32_gptimer": "esp32", + "esp32_uart_echo": "esp32", + "esp32_real_time_stats": "esp32", + "esp32_blink_strip": "esp32", + "esp32_adc_oneshot_read": "esp32", + "esp32_dac_oneshot": "esp32", +} +TOOLCHAINS = {"esp32c3": "riscv32-esp-elf-gcc", "esp32": "xtensa-esp32-elf-gcc"} # examples built only for another's project (with examples//'s # sdkconfig.defaults), not run on their own VARIANTS = { @@ -100,7 +126,7 @@ def build(idf: Path, name: str, out: Path) -> Path: cmd = [sys.executable, idf / "tools" / "idf.py", "-C", proj, "-B", proj / "build"] if defaults: cmd += ["-D", "SDKCONFIG_DEFAULTS=" + ";".join(str(d) for d in defaults)] - sh(cmd + ["set-target", "esp32c3"], env=env) + sh(cmd + ["set-target", TARGETS.get(name, "esp32c3")], env=env) sh(cmd + ["build"], env=env) args = json.loads((proj / "build" / "flasher_args.json").read_text(encoding="utf-8")) image = bytearray(b"\xff" * FLASH_SIZE) @@ -120,11 +146,15 @@ def main() -> int: ap.add_argument("--keep", help="build here, and keep it, instead of a temporary directory") ap.add_argument("examples", nargs="*") args = ap.parse_args() - if not args.idf or not shutil.which("riscv32-esp-elf-gcc"): - print("skip: ESP-IDF (--idf or IDF_PATH) and its riscv32-esp-elf toolchain are needed") + if not args.idf: + print("skip: ESP-IDF (--idf or IDF_PATH) and its toolchains are needed") return 0 idf = Path(args.idf).resolve() names = args.examples or sorted(EXAMPLES) + names = [n for n in names if n not in EXAMPLES or shutil.which(TOOLCHAINS[TARGETS.get(n, "esp32c3")]) + or print(f"skip: {n} needs {TOOLCHAINS[TARGETS.get(n, 'esp32c3')]}")] + if not names: + return 0 unknown = [n for n in names if n not in EXAMPLES] if unknown: raise SystemExit(f"unknown example(s): {', '.join(unknown)}") diff --git a/tools/importers/esprom.py b/tools/importers/esprom.py index 74716ce75..dd95dacf8 100644 --- a/tools/importers/esprom.py +++ b/tools/importers/esprom.py @@ -98,7 +98,9 @@ def build(elf: bytes, base: int, size: int, tables=(), words=(), aliases=()) -> entries = [struct.unpack_from("<3I", img, o - base) for o in range(start, end, 16)] for addr, data in sections(elf): for dst, dst_end, src in entries: - if dst <= addr and addr + len(data) <= dst_end and dst < dst_end: + if dst <= addr < dst_end: + # a section may outrun its entry by its alignment padding + # (the ESP32's .data_xtos_pro, 0x420 bytes for 0x418) o = src + (addr - dst) - base if 0 <= o and o + len(data) <= size: img[o:o + len(data)] = data diff --git a/tools/importers/svd2regs.py b/tools/importers/svd2regs.py index 24c437dac..1585941c2 100644 --- a/tools/importers/svd2regs.py +++ b/tools/importers/svd2regs.py @@ -40,7 +40,15 @@ (repeatable) a memory inside a peripheral the SVD leaves out, as WORDS 32-bit registers NAME0, NAME1, ... (the ESP32-C3's - RMT RAM); recorded likewise""" + RMT RAM); recorded likewise + --resolve-overlaps fields that share bits, which some SVDs + list as alternative views of one register + (Espressif's: a whole-register STATUS + beside its parts): a field containing + another is taken out, and of fields over + the same bits the first is kept; recorded + likewise (after --reserve, so a wrong + field can be taken out first)""" import argparse import json import re @@ -308,6 +316,36 @@ def apply_reserved(doc: dict, specs: list[str]) -> None: doc["source"] += "; fields reserved by the reference manual taken out: " + ", ".join(done) +def resolve_overlaps(doc: dict) -> None: + """In each register, fields that contain another taken out, and of + fields over the same bits all but the first.""" + done = [] + for p in doc["peripherals"]: + for r in p.get("registers", []): + fields = r.get("fields", []) + masks = [((1 << f[2]) - 1) << f[1] for f in fields] + out = set() + for i, mi in enumerate(masks): + for j, mj in enumerate(masks): + if i == j or j in out: + continue + if mi == mj and j < i: + out.add(i) # the same bits: the first kept + elif mi != mj and mi & mj == mj: + out.add(i) # i contains j + kept = [f for k, f in enumerate(fields) if k not in out] + masks = [((1 << f[2]) - 1) << f[1] for f in kept] + if any(masks[a] & masks[b] for a in range(len(masks)) for b in range(a + 1, len(masks))): + raise SystemExit(f"--resolve-overlaps: {p['name']}.{r['name']}: fields still overlap; " + "take the wrong one out with --reserve") + if not out: + continue + r["fields"] = kept + done.append(f"{p['name']}.{r['name']} ({', '.join(fields[k][0] for k in sorted(out))})") + if done: + doc["source"] += "; overlapping fields taken out: " + ", ".join(done) + + def apply_merges(doc: dict, specs: list[str]) -> None: """The one-bit fields NAME0..NAMEn, contiguous, joined into NAME.""" done = [] @@ -412,6 +450,8 @@ def main(argv: Optional[list[str]] = None) -> int: help="one-bit fields NAME0..NAMEn joined into NAME") ap.add_argument("--reserve", action="append", default=[], metavar="PERIPH.REG.NAME", help="a field whose bits the reference manual reserves, taken out") + ap.add_argument("--resolve-overlaps", action="store_true", + help="fields containing another, or repeating its bits, taken out") args = ap.parse_args(argv) doc = convert(args.svd, args.id or (args.svd.stem.lower() + "/registers")) apply_drops(doc, args.drop) @@ -421,6 +461,8 @@ def main(argv: Optional[list[str]] = None) -> int: apply_registers(doc, args.register) apply_fields(doc, args.field) apply_reserved(doc, args.reserve) + if args.resolve_overlaps: + resolve_overlaps(doc) apply_resets(doc, args.reset) apply_interrupts(doc, args.interrupts) args.output.write_text(json.dumps(doc, indent=1) + "\n", encoding="utf-8") diff --git a/tools/test_svd2regs.py b/tools/test_svd2regs.py index 7c78471f7..bc9145c98 100644 --- a/tools/test_svd2regs.py +++ b/tools/test_svd2regs.py @@ -111,6 +111,21 @@ def test_reserved_field(self): with self.assertRaises(SystemExit): svd2regs.apply_reserved(doc, ["TIM3.CNT.CNT_H"]) + def test_resolve_overlaps(self): + def doc_of(fields): + return {"source": "s", "interrupts": {}, "peripherals": [{"name": "PCNT", "base": "0x0", "registers": [ + {"name": "U0_STATUS", "offset": "0x90", "fields": fields}]}]} + # a whole-register view beside its parts, and two names for one bit + doc = doc_of([["CORE_STATUS_U0", 0, 32, "r"], ["ZERO_MODE", 0, 2, "r"], ["THRES1", 2, 1, "r"], + ["DET", 31, 1, "r"], ["FINISH", 31, 1, "r"]]) + svd2regs.resolve_overlaps(doc) + self.assertEqual([f[0] for f in doc["peripherals"][0]["registers"][0]["fields"]], + ["ZERO_MODE", "THRES1", "DET"]) + self.assertIn("PCNT.U0_STATUS (CORE_STATUS_U0, FINISH)", doc["source"]) + # a partial overlap is left to --reserve + with self.assertRaises(SystemExit): + svd2regs.resolve_overlaps(doc_of([["A", 0, 4], ["B", 2, 4]])) + def test_added_register(self): doc = {"source": "s", "interrupts": {}, "peripherals": [{"name": "SYSCFG", "base": "0x0", "registers": [ {"name": "CMPCR", "offset": "0x20", "fields": []}]}]}