e814977c0f
The SD boot loader was not satisfactory because 1) the SD slot is on an optional board and, hence, cannot be part of a fundamental solution. And 2) it is too big. The only storage on borard is the Winbond W25 SPI-bsed FLASH. This commit adds support for a bootload to 1) read code in HEX format from a serial port and write it to the W25 FLASH, or 2) read code in binary form from the W25 FLASH into SRAM and execute the loaded program. boards/z80/ez80/z20x/configs: Added w25boot configuration boards/z80/ez80/z20x/src: Add bootloader logic, w25_main.c. Add logic to manage shared SRAM memory map so that the loaded program does not clobber the bootloader memory. Add logic to recover the bootloader memory into the heap after the loaded program as started. boards/z80/ez80/z20x/scripts: Rework scripts and configuration to support a bootloader and program build. The boolloader cannot use all of SRAM; the program must not clobber the SRAM region used by the bootloader.
100 lines
2.4 KiB
Plaintext
100 lines
2.4 KiB
Plaintext
#
|
|
# For a description of the syntax of this configuration file,
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
#
|
|
|
|
if ARCH_BOARD_Z20X
|
|
|
|
config Z20X_BOOTLOADER
|
|
bool
|
|
default n
|
|
select BOOT_RUNFROMFLASH
|
|
|
|
choice
|
|
prompt "Build selection"
|
|
default Z20X_PROGRAM
|
|
|
|
config Z20X_SDBOOT
|
|
bool "SD boot loader"
|
|
select LIB_HEX2BIN
|
|
select Z20X_BOOTLOADER
|
|
depends on EZ80_SPI && MMCSD_SPI
|
|
---help---
|
|
Select this option only with the boards/z20x/sdboot
|
|
configuration. This will enable the components needed only by the
|
|
boot loader.
|
|
|
|
config Z20X_W25BOOT
|
|
bool "W25 boot loader"
|
|
select Z20X_W25_CHARDEV
|
|
select LIB_HEX2BIN
|
|
select Z20X_BOOTLOADER
|
|
depends on EZ80_SPI && MTD_W25
|
|
---help---
|
|
Select this option only with the boards/z20x/w25boot
|
|
configuration. This will enable the components needed only by the
|
|
boot loader.
|
|
|
|
config Z20X_PROGRAM
|
|
bool "Loadable program"
|
|
select CONFIG_BOOT_RUNFROMEXTSRAM
|
|
---help---
|
|
Normal program that resides on SD card or in W25 FLASH and is
|
|
loaded into RAM by a bootloader.
|
|
|
|
config Z20X_STANDALONE
|
|
bool "Standalone FLASH progroam"
|
|
select BOOT_RUNFROMFLASH
|
|
---help---
|
|
Select this option only to build a small program that executes
|
|
from z20x FLASH memory.
|
|
|
|
config Z20X_COPYTORAM
|
|
bool "Copy to RAM"
|
|
select BOOT_RUNFROMEXTSRAM
|
|
---help---
|
|
This option is available only when running from external SRAM
|
|
(CONFIG_BOOT_RUNFROMEXTSRAM). In that case there are two possible
|
|
options: (1) The configuration runs entirely out of SRAM and must
|
|
be copied into SRAM by a boot loader. Or (2) The configuration
|
|
boots out of FLASH, copies itself to SRAM, and runs from SRAM. This
|
|
configuration setting selects that latter option.
|
|
|
|
endchoice
|
|
|
|
config Z20X_W25_PROGSIZE
|
|
int "W25 partition size"
|
|
default 262144
|
|
range 131072 524288
|
|
depends on Z20X_W25BOOT
|
|
---help---
|
|
This is the size of the partition at the beginning to the W25
|
|
serial FLASH that will be used to hold the boot program. Since
|
|
this program must run from SRAM, there would be no purpose int
|
|
making this size any larger than the size of the internal SRAM.
|
|
|
|
choice
|
|
prompt "Winbond W25 Usage"
|
|
default Z20X_W25_CHARDEV
|
|
depends on EZ80_SPI && MTD_W25
|
|
|
|
config Z20X_W25_CHARDEV
|
|
bool "Character device"
|
|
select BCH
|
|
|
|
config Z20X_W25_BLOCKDEV
|
|
bool "Block device"
|
|
|
|
config Z20X_W25_MTDDEV
|
|
bool "MTD device"
|
|
|
|
endchoice
|
|
|
|
config Z20X_W25_MINOR
|
|
int "W25 device minor number"
|
|
default 0
|
|
range 0 255
|
|
depends on Z20X_W25_CHARDEV
|
|
|
|
endif # ARCH_BOARD_Z20X
|