|
5 | 5 | #pragma once |
6 | 6 |
|
7 | 7 | /* SRAM0 (192kB) instruction cache+memory */ |
8 | | -#define SRAM0_IRAM_START 0x40070000 |
| 8 | +#define SRAM0_IRAM_START DT_REG_ADDR(DT_NODELABEL(sram0)) |
9 | 9 | #define SRAM0_CACHE_SIZE 0x10000 |
10 | | -#define SRAM0_SIZE 0x30000 |
| 10 | +#define SRAM0_SIZE DT_REG_SIZE(DT_NODELABEL(sram0)) |
11 | 11 |
|
12 | 12 | /* SRAM1 (128kB) instruction/data memory */ |
13 | | -#define SRAM1_IRAM_START 0x400a0000 |
14 | | -#define SRAM1_DRAM_START 0x3ffe0000 |
15 | | -#define SRAM1_SIZE 0x20000 |
16 | | -#define SRAM1_DRAM_END (SRAM1_DRAM_START + SRAM1_SIZE) |
| 13 | +#define SRAM1_IRAM_START (SRAM0_IRAM_START + SRAM0_SIZE) |
| 14 | +#define SRAM1_DRAM_START DT_REG_ADDR(DT_NODELABEL(sram1)) |
| 15 | +#define SRAM1_SIZE DT_REG_SIZE(DT_NODELABEL(sram1)) |
| 16 | +#define SRAM1_DRAM_END (SRAM1_DRAM_START + SRAM1_SIZE) |
17 | 17 | #define SRAM1_DRAM_PROAPP_PRIV_SIZE 0x8000 |
18 | | -#define SRAM1_DRAM_USER_START 0x3ffe8000 |
19 | | -#define SRAM1_USER_SIZE (0x40000000 - SRAM1_DRAM_USER_START) |
| 18 | +#define SRAM1_DRAM_USER_START (SRAM1_DRAM_START + SRAM1_DRAM_PROAPP_PRIV_SIZE) |
| 19 | +#define SRAM1_USER_SIZE (0x40000000 - SRAM1_DRAM_USER_START) |
20 | 20 |
|
21 | 21 | /* SRAM2 (200kB) data memory */ |
22 | | -#define SRAM2_DRAM_START 0x3ffae000 |
23 | | -#define SRAM2_DRAM_SIZE 0x32000 |
| 22 | +#define SRAM2_DRAM_START DT_REG_ADDR(DT_NODELABEL(sram2)) |
| 23 | +#define SRAM2_DRAM_SIZE DT_REG_SIZE(DT_NODELABEL(sram2)) |
24 | 24 | #define SRAM2_DRAM_SHM_SIZE 0x2000 |
25 | 25 | #define SRAM2_DRAM_END (SRAM2_DRAM_START + SRAM2_DRAM_SIZE) |
26 | 26 | #define SRAM2_DRAM_USER_START (SRAM2_DRAM_START + SRAM2_DRAM_SHM_SIZE) |
|
46 | 46 | /* Convert IRAM address to its DRAM counterpart in SRAM1 memory */ |
47 | 47 | #define SRAM1_IRAM_DRAM_CALC(addr_iram) ((addr_iram > SRAM1_IRAM_START) ? \ |
48 | 48 | (SRAM1_SIZE - (addr_iram - SRAM1_IRAM_START) + SRAM1_DRAM_START) : (SRAM1_DRAM_END)) |
| 49 | + |
49 | 50 | /* Convert DRAM address to its IRAM counterpart in SRAM1 memory */ |
50 | 51 | #define SRAM1_DRAM_IRAM_CALC(addr_dram) \ |
51 | 52 | (SRAM1_SIZE - (addr_dram - SRAM1_DRAM_START) + SRAM1_IRAM_START) |
|
0 commit comments