Skip to content

Commit c15501e

Browse files
dspic: Fix for config SRAM and FLASH (zephyrproject-rtos#23)
Modified the configuration in SOC to get the SRAM and FLASH address and size from device tree node. Signed-off-by: Udhayanandhan Jayakumar <[email protected]>
1 parent 0d6ece2 commit c15501e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

dts/dspic/p33ak128mc106.dtsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
soc: soc {
3838
compatible = "microchip,p33ak128mc106-soc";
3939
#address-cells = <1>;
40-
#size-cells = <0>;
40+
#size-cells = <1>;
4141

42-
flash0: flash@800004 {
42+
flash0: flash@800000 {
4343
compatible = "zephyr,flash";
44-
reg = <0x800004 0x1FFFC>;
44+
reg = <0x800000 0x20000>;
4545
label = "FLASH";
4646
};
4747

soc/microchip/dspic33/dspic33a/Kconfig.defconfig.p33ak128mc106

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ if SOC_P33AK128MC106
66
config UART_CONSOLE
77
default n
88

9-
config FLASH_SIZE
10-
default 128
11-
12-
config FLASH_BASE_ADDRESS
13-
default 0x00800000
14-
159
config SRAM_SIZE
16-
default 80
10+
default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K)
1711

1812
config SRAM_BASE_ADDRESS
19-
default 0x010000
13+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))
14+
15+
config FLASH_SIZE
16+
default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_FLASH),0,K)
17+
18+
config FLASH_BASE_ADDRESS
19+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
2020

2121
config MAIN_STACK_SIZE
2222
default 128

0 commit comments

Comments
 (0)