diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 23bb049a5dd..253c3531ce2 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -54,14 +54,6 @@ config CPU_ARCV2 help This option signifies the use of a CPU of the ARCv2 family. -config RAM_START - prompt "RAM start address" - hex - -config RAM_SIZE - prompt "RAM size (in kB)" - int - config NSIM prompt "Running on the MetaWare nSIM simulator" bool @@ -164,6 +156,47 @@ config XIP default n if NSIM default y +config DCCM_SIZE + int "DCCM Size in kB" + help + This option specifies the size of the DCCM in kB. It is normally set by + the platform's defconfig file and the user should generally avoid modifying + it via the menu configuration. + +config DCCM_BASE_ADDRESS + hex "DCCM Base Address" + help + This option specifies the base address of the DCCM on the platform. It is + normally set by the platform's defconfig file and the user should generally + avoid modifying it via the menu configuration. + +config SRAM_SIZE + int "SRAM Size in kB" + help + This option specifies the size of the SRAM in kB. It is normally set by + the platform's defconfig file and the user should generally avoid modifying + it via the menu configuration. + +config SRAM_BASE_ADDRESS + hex "SRAM Base Address" + help + This option specifies the base address of the SRAM on the platform. It is + normally set by the platform's defconfig file and the user should generally + avoid modifying it via the menu configuration. + +config FLASH_SIZE + int "Flash Size in kB" + help + This option specifies the size of the flash in kB. It is normally set by + the platform's defconfig file and the user should generally avoid modifying + it via the menu configuration. + +config FLASH_BASE_ADDRESS + hex "Flash Base Address" + help + This option specifies the base address of the flash on the platform. It is + normally set by the platform's defconfig file and the user should generally + avoid modifying it via the menu configuration. config NSIM prompt "Running on the MetaWare nSIM simulator" bool diff --git a/arch/arc/core/reset.S b/arch/arc/core/reset.S index 50acd320e95..20367783a39 100644 --- a/arch/arc/core/reset.S +++ b/arch/arc/core/reset.S @@ -28,7 +28,7 @@ #include #include -#define _RAM_END (CONFIG_RAM_START + CONFIG_RAM_SIZE * 1024) +#define _RAM_END (CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE * 1024) GTEXT(__reset) diff --git a/arch/arc/soc/quark_se_ss/Kconfig.defconfig b/arch/arc/soc/quark_se_ss/Kconfig.defconfig index e17aa0c6f99..6ae9b55ac84 100644 --- a/arch/arc/soc/quark_se_ss/Kconfig.defconfig +++ b/arch/arc/soc/quark_se_ss/Kconfig.defconfig @@ -37,14 +37,26 @@ config NUM_IRQS config SYS_CLOCK_HW_CYCLES_PER_SEC default 32000000 -config RAM_START +config FLASH_BASE_ADDRESS + default 0x40000000 + +config FLASH_SIZE + default 152 + +config SRAM_BASE_ADDRESS default 0x4000 if NSIM default 0xa8000400 -config RAM_SIZE +config SRAM_SIZE default 16 if NSIM default 24 +config DCCM_BASE_ADDRESS + default 0x80000000 + +config DCCM_SIZE + default 8 + if GPIO config GPIO_DW diff --git a/arch/arc/soc/quark_se_ss/linker.cmd b/arch/arc/soc/quark_se_ss/linker.cmd index 568f19b22c6..9ff16a384ad 100644 --- a/arch/arc/soc/quark_se_ss/linker.cmd +++ b/arch/arc/soc/quark_se_ss/linker.cmd @@ -20,8 +20,8 @@ */ /* Flash base address and size */ -#define FLASH_START 0x40000000 /* Flash bank 1 */ -#define FLASH_SIZE 152K +#define FLASH_START CONFIG_FLASH_BASE_ADDRESS /* Flash bank 1 */ +#define FLASH_SIZE CONFIG_FLASH_SIZE /* * SRAM base address and size @@ -29,11 +29,11 @@ * Internal SRAM includes the exception vector table at reset, which is at * the beginning of the region. */ -#define SRAM_START CONFIG_RAM_START -#define SRAM_SIZE CONFIG_RAM_SIZE +#define SRAM_START CONFIG_SRAM_BASE_ADDRESS +#define SRAM_SIZE CONFIG_SRAM_SIZE /* Data Closely Coupled Memory (DCCM) base address and size */ -#define DCCM_START 0x80000000 -#define DCCM_SIZE 8K +#define DCCM_START CONFIG_DCCM_BASE_ADDRESS +#define DCCM_SIZE CONFIG_DCCM_SIZE #include diff --git a/boards/arduino_101_sss/Makefile.board b/boards/arduino_101_sss/Makefile.board index 5d34a8b2781..d2e80b98135 100644 --- a/boards/arduino_101_sss/Makefile.board +++ b/boards/arduino_101_sss/Makefile.board @@ -1,7 +1,7 @@ FLASH_SCRIPT = openocd.sh OPENOCD_PRE_CMD = "-c targets 1" -OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} 0x40000000" -OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} 0x40000000" +OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" +OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" GDB_PORT = 3334 diff --git a/boards/quark_se_sss_devboard/Makefile.board b/boards/quark_se_sss_devboard/Makefile.board index b0f3f6d0a5e..5c7a11f604d 100644 --- a/boards/quark_se_sss_devboard/Makefile.board +++ b/boards/quark_se_sss_devboard/Makefile.board @@ -1,6 +1,6 @@ FLASH_SCRIPT = openocd.sh OPENOCD_PRE_CMD = "-c targets 1" -OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} 0x40000000" -OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} 0x40000000" +OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" +OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" export OPENOCD_PRE_CMD FLASH_SCRIPT OPENOCD_VERIFY_CMD OPENOCD_LOAD_CMD diff --git a/include/arch/arc/v2/linker.cmd b/include/arch/arc/v2/linker.cmd index d7f928dd20c..6fa455fb083 100644 --- a/include/arch/arc/v2/linker.cmd +++ b/include/arch/arc/v2/linker.cmd @@ -47,9 +47,9 @@ #endif MEMORY { - FLASH (rx) : ORIGIN = FLASH_START, LENGTH = FLASH_SIZE - SRAM (wx) : ORIGIN = SRAM_START, LENGTH = SRAM_SIZE*1K - DCCM (wx) : ORIGIN = DCCM_START, LENGTH = DCCM_SIZE + FLASH (rx) : ORIGIN = FLASH_START, LENGTH = FLASH_SIZE*1k + SRAM (wx) : ORIGIN = SRAM_START, LENGTH = SRAM_SIZE*1k + DCCM (wx) : ORIGIN = DCCM_START, LENGTH = DCCM_SIZE*1k } SECTIONS {