# SPDX-License-Identifier: MIT # Copyright 2023 RnD Center "ELVEES", JSC # MDB script to start sbl-s1, ddrinit, tl-common, # TF-A and U-Boot on MCom-03 SoC. Script uses DDR0. pb python pb import os pb import sys pb IMAGES_PATH = 'buildroot/output/images' pb SCRIPTS_PATH = '%s/sbl/scripts' % IMAGES_PATH pb sys.path.append(SCRIPTS_PATH) pb import helpers pb end pb python pb dtb = os.environ.get('MDB_DTB_FILE', 'mcom03-bub-r1.3.0.dtb') pb board = helpers.parse_ddrinit_dtb_map('%s/ddrinit-dtb-map.txt' % SCRIPTS_PATH, dtb) pb end # Load and run sbl-s1 to setup required clocks loadbin buildroot/output/images/sbl/sbl-s1.bin 0xa0000000 hbp set 0xa0000188 run 0xa0000000 hbp unset 0xa0000188 # Load and run ddrinit to setup DDR memory py helpers.loadbin('%s/ddrinit-%s/ddrinit.bin' % (IMAGES_PATH, board), 0xa0000000) hbp set 0xa0000100 run 0xa0000000 hbp unset 0xa0000100 # Load and run set-secure-regions.elf to setup Secure Regions and # to take them into account in the DDR memory map loadelf buildroot/output/images/sbl/scripts/set-secure-regions.elf hbp set jtag run hbp unset jtag # Load U-Boots dtb to 0x8_9040_2000 which is mapped to 0xC0002000 py helpers.loadbin('%s/uboot-dtb/%s' % (IMAGES_PATH, dtb), 0xC0002000) # Load TF-A to 0x8_8030_0000 which is mapped to 0xc0300000 loadbin buildroot/output/images/bl31.bin 0xc0300000 # Load U-Boot to 0x8_9048_0000 which is mapped to 0xc0080000 loadbin buildroot/output/images/u-boot.bin 0xc0080000 # Load and run tl-core to launch TF-A and provide mailbox services loadbin buildroot/output/images/tl-core.bin 0x40003000 set RISC.PC 0x40003000 quit