├── .gitignore ├── gen-machineconf ├── gen-machine-scripts ├── data │ ├── yocto_esw_sdt.conf │ ├── yocto_esw_xsct.conf │ ├── intc.yaml │ ├── reset_gpio.yaml │ ├── memory.yaml │ ├── serial.yaml │ ├── sysconf_koptions.yaml │ ├── ethernet.yaml │ ├── processor.yaml │ ├── flash.yaml │ ├── README │ └── sdt_ipinfo.yaml ├── rootfsconfigs │ ├── user-rootfsconfig │ ├── rootfsconfig_microblaze │ ├── rootfsconfig_zynq │ ├── rootfsconfig_versal │ └── rootfsconfig_zynqmp ├── configs │ ├── Kconfig.main │ ├── Kconfig.autoconfigsettings │ ├── Kconfig.yoctomachinesettings │ ├── config_microblaze │ ├── Kconfig.imagepkgconfigurations │ ├── config_zynq │ ├── config_versal │ ├── Kconfig.dtgsettings │ ├── config_zynqmp │ ├── config_versal-2ve-2vm │ ├── Kconfig.bootcompselection │ ├── Kconfig.yoctobuildsettings │ ├── Kconfig.linuxcompselection │ └── Kconfig.bootcompconfigurations ├── petalinux-find-ipaddr ├── libs │ ├── u-boot_bsp.tcl │ ├── kconf_parser.tcl │ └── simple_yaml_parser.tcl ├── petalinux_hsm.tcl └── petalinux_hsm_bridge.tcl ├── LICENSE.MIT ├── lib ├── logger_setup.py ├── rootfs_config.py ├── update_buildconf.py ├── xilinx_mirrors.py └── multiconfigs.py ├── docs ├── intro.rst ├── examples.rst └── usage.rst └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /gen-machineconf: -------------------------------------------------------------------------------- 1 | gen-machine-conf -------------------------------------------------------------------------------- /gen-machine-scripts/data/yocto_esw_sdt.conf: -------------------------------------------------------------------------------- 1 | XILINX_WITH_ESW = "sdt" 2 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/yocto_esw_xsct.conf: -------------------------------------------------------------------------------- 1 | XILINX_WITH_ESW = "xsct" 2 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/intc.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | ### 7 | ### Interrupt controller 8 | axi_intc: 9 | ip_type: intc 10 | -------------------------------------------------------------------------------- /gen-machine-scripts/rootfsconfigs/user-rootfsconfig: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | #Note: Mention Each package in individual line 7 | #These packages will get added into rootfs menu entry 8 | 9 | CONFIG_gpio-demo 10 | CONFIG_peekpoke 11 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/reset_gpio.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | 7 | axi_gpio: 8 | ip_type: gpio 9 | hsm: 10 | primary_define: 11 | CONFIG.C_BASEADDR: 12 | uboot_config: CONFIG_CMD_GPIO CONFIG_XILINX_GPIO 13 | -------------------------------------------------------------------------------- /gen-machine-scripts/rootfsconfigs/rootfsconfig_microblaze: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | CONFIG_mtd-utils=y 7 | CONFIG_can-utils=y 8 | CONFIG_pciutils=y 9 | CONFIG_dosfstools=y 10 | CONFIG_run-postinsts=y 11 | CONFIG_packagegroup-core-boot=y 12 | CONFIG_packagegroup-core-ssh-dropbear=y 13 | CONFIG_tcf-agent=y 14 | CONFIG_bridge-utils=y 15 | CONFIG_ADD_EXTRA_USERS="root:root;petalinux::passwd-expire;" 16 | CONFIG_CREATE_NEW_GROUPS="aie;" 17 | CONFIG_ADD_USERS_TO_GROUPS="petalinux:audio,video,aie,input;" 18 | CONFIG_ADD_USERS_TO_SUDOERS="petalinux" 19 | CONFIG_nfs-utils=y 20 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/memory.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | ddr4: 7 | ip_type: main_memory 8 | 9 | ddr3: 10 | ip_type: main_memory 11 | 12 | mig: 13 | ip_type: main_memory 14 | 15 | mig_7series: 16 | ip_type: main_memory 17 | 18 | axi_noc: 19 | ip_type: main_memory 20 | 21 | axi_s6_ddrx: 22 | ip_type: main_memory_multibank 23 | 24 | axi_v6_ddrx: 25 | ip_type: main_memory 26 | 27 | axi_7series_ddrx: 28 | ip_type: main_memory 29 | 30 | ps7_ddr: 31 | ip_type: main_memory 32 | 33 | psu_ddr: 34 | ip_type: main_memory 35 | 36 | simple: 37 | ip_type: main_memory 38 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/serial.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | ### 7 | ### UART 8 | axi_uart16550: 9 | ip_type: uart 10 | var_count: uartfull_count 11 | hsm: 12 | primary_define: 13 | IP_NAME: 14 | uboot_config: CONFIG_SYS_NS16550 15 | 16 | uartlite: 17 | var_count: uartlite_count 18 | hsm: 19 | primary_define: 20 | CONFIG.C_BASEADDR: 21 | uboot_config: CONFIG_XILINX_UARTLITE 22 | 23 | axi_uartlite: 24 | var_count: uartlite_count 25 | ip_type: uartlite 26 | 27 | mdm: 28 | var_count: uartlite_count 29 | ip_type: uartlite 30 | 31 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/sysconf_koptions.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | selected_device: 7 | flash: 8 | is_valid_and: 9 | SUBSYSTEM_FLASH_MANUAL_SELECT: n 10 | linux_kernel_properties: 11 | MTD: bool y 12 | MTD_OF_PARTS: bool y 13 | serial: 14 | is_valid_and: 15 | SUBSYSTEM_SERIAL_MANUAL_SELECT: n 16 | linux_kernel_properties: 17 | SERIAL_OF_PLATFORM: bool y 18 | ethernet: 19 | is_valid_and: 20 | SUBSYSTEM_ETHERNET_MANUAL_SELECT: n 21 | linux_kernel_properties: 22 | NET: bool y 23 | PACKET: bool y 24 | UNIX: bool y 25 | INET: bool y 26 | -------------------------------------------------------------------------------- /gen-machine-scripts/rootfsconfigs/rootfsconfig_zynq: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | CONFIG_e2fsprogs-mke2fs=y 7 | CONFIG_mtd-utils=y 8 | CONFIG_can-utils=y 9 | CONFIG_dosfstools=y 10 | CONFIG_pciutils=y 11 | CONFIG_run-postinsts=y 12 | CONFIG_fpga-manager-script=y 13 | CONFIG_packagegroup-core-boot=y 14 | CONFIG_tcf-agent=y 15 | CONFIG_bridge-utils=y 16 | CONFIG_udev-extraconf=y 17 | CONFIG_imagefeature-ssh-server-openssh=y 18 | CONFIG_imagefeature-hwcodecs=y 19 | CONFIG_linux-xlnx-udev-rules=y 20 | CONFIG_ADD_EXTRA_USERS="root:root;petalinux::passwd-expire;" 21 | CONFIG_CREATE_NEW_GROUPS="aie;" 22 | CONFIG_ADD_USERS_TO_GROUPS="petalinux:audio,video,aie,input;" 23 | CONFIG_ADD_USERS_TO_SUDOERS="petalinux" 24 | CONFIG_nfs-utils=y 25 | -------------------------------------------------------------------------------- /gen-machine-scripts/rootfsconfigs/rootfsconfig_versal: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | CONFIG_e2fsprogs-mke2fs=y 7 | CONFIG_mtd-utils=y 8 | CONFIG_packagegroup-core-boot=y 9 | CONFIG_bridge-utils=y 10 | CONFIG_can-utils=y 11 | CONFIG_dosfstools=y 12 | CONFIG_pciutils=y 13 | CONFIG_run-postinsts=y 14 | CONFIG_fpga-manager-script=y 15 | CONFIG_tcf-agent=y 16 | CONFIG_udev-extraconf=y 17 | CONFIG_imagefeature-ssh-server-openssh=y 18 | CONFIG_imagefeature-hwcodecs=y 19 | CONFIG_linux-xlnx-udev-rules=y 20 | CONFIG_ADD_EXTRA_USERS="root:root;petalinux::passwd-expire;" 21 | CONFIG_CREATE_NEW_GROUPS="aie;" 22 | CONFIG_ADD_USERS_TO_GROUPS="petalinux:audio,video,aie,input;" 23 | CONFIG_ADD_USERS_TO_SUDOERS="petalinux" 24 | CONFIG_nfs-utils=y 25 | CONFIG_libdfx=y 26 | -------------------------------------------------------------------------------- /gen-machine-scripts/rootfsconfigs/rootfsconfig_zynqmp: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | CONFIG_e2fsprogs-mke2fs=y 7 | CONFIG_mtd-utils=y 8 | CONFIG_can-utils=y 9 | CONFIG_dosfstools=y 10 | CONFIG_pciutils=y 11 | CONFIG_run-postinsts=y 12 | CONFIG_fpga-manager-script=y 13 | CONFIG_packagegroup-core-boot=y 14 | CONFIG_tcf-agent=y 15 | CONFIG_bridge-utils=y 16 | CONFIG_udev-extraconf=y 17 | CONFIG_imagefeature-ssh-server-openssh=y 18 | CONFIG_imagefeature-hwcodecs=y 19 | CONFIG_linux-xlnx-udev-rules=y 20 | CONFIG_ADD_EXTRA_USERS="root:root;petalinux::passwd-expire;" 21 | CONFIG_CREATE_NEW_GROUPS="aie;" 22 | CONFIG_ADD_USERS_TO_GROUPS="petalinux:audio,video,aie,input;" 23 | CONFIG_ADD_USERS_TO_SUDOERS="petalinux" 24 | CONFIG_nfs-utils=y 25 | CONFIG_libdfx=y 26 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/ethernet.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | ### Ethernet 7 | ethernet: 8 | var_count: eth_count 9 | hsm: 10 | primary_define: 11 | IP_NAME: 12 | uboot_config: CONFIG_NET CONFIG_PHY_GIGE CONFIG_NETDEVICES CONFIG_CMD_NET CONFIG_DM_ETH CONFIG_CMD_PING CONFIG_CMD_DHCP CONFIG_PHYLIB CONFIG_CMD_TFTPPUT CONFIG_CMD_NFS CONFIG_CMD_MII CONFIG_PHY_MARVELL CONFIG_PHY_REALTEK CONFIG_PHY_NATSEMI 13 | 14 | axi_ethernet_buffer: 15 | var_count: ethfull_count eth_count 16 | ip_type: ethernet 17 | 18 | axi_dma: 19 | ip_type: dma 20 | 21 | axi_ethernet: 22 | var_count: ethfull_count eth_count 23 | ip_type: ethernet 24 | hsm: 25 | define: 26 | IP_NAME: 27 | uboot_config: CONFIG_XILINX_AXIEMAC CONFIG_PHY_XILINX CONFIG_PHY_TI 28 | 29 | axi_ethernetlite: 30 | var_count: ethlite_count eth_count 31 | ip_type: ethernet 32 | hsm: 33 | define: 34 | IP_NAME: 35 | uboot_config: CONFIG_XILINX_EMACLITE 36 | 37 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/processor.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | microblaze: 7 | ip_type: processor 8 | hsm: 9 | config: 10 | CONFIG.C_USE_BARREL: 11 | uboot_config: XILINX_MICROBLAZE0_USE_BARREL 12 | CONFIG.C_USE_DIV: 13 | uboot_config: XILINX_MICROBLAZE0_USE_DIV 14 | CONFIG.C_USE_PCMP_INSTR: 15 | uboot_config: XILINX_MICROBLAZE0_USE_PCMP_INSTR 16 | CONFIG.C_USE_HW_MUL: 17 | uboot_config: XILINX_MICROBLAZE0_USE_HW_MUL 18 | CONFIG.C_DCACHE_BYTE_SIZE: 19 | uboot_config: XILINX_MICROBLAZE0_DCACHE_SIZE 20 | CONFIG.C_CACHE_BYTE_SIZE: 21 | uboot_config: XILINX_MICROBLAZE0_ICACHE_SIZE 22 | CONFIG.C_PVR: 23 | uboot_config: XILINX_MICROBLAZE0_PVR 24 | define: 25 | IP_NAME: 26 | uboot_config: CONFIG_DM CONFIG_SYS_MALLOC_F 27 | define_chk_1: 28 | CONFIG.C_USE_DCACHE: 29 | uboot_config: CONFIG_DCACHE 30 | -------------------------------------------------------------------------------- /LICENSE.MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a 2 | copy of this software and associated documentation files (the 3 | "Software"), to deal in the Software without restriction, including 4 | without limitation the rights to use, copy, modify, merge, publish, 5 | distribute, sublicense, and/or sell copies of the Software, and to 6 | permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included 9 | in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 14 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 15 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 16 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | Note: 20 | Individual files contain the following tag instead of the full license text. 21 | 22 | SPDX-License-Identifier: MIT 23 | 24 | This enables machine processing of license information based on the 25 | SPDX License Identifiers that are here available: 26 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.main: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022-2024, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | 7 | choice 8 | prompt "Subsystem Architecture (NO EDIT!)" 9 | default SUBSYSTEM_ARCH_ARM 10 | help 11 | This option is to control the processor targeted by System Configuration. 12 | WARNING: Do not edit this option. 13 | 14 | config SUBSYSTEM_ARCH_AARCH64 15 | bool "aarch64" 16 | help 17 | Choose this option to specify AARCH64 as the SUBSYSTEM architecture 18 | 19 | config SUBSYSTEM_ARCH_ARM 20 | bool "arm" 21 | help 22 | Choose this option to specify ARM as the SUBSYSTEM architecture 23 | 24 | config SUBSYSTEM_ARCH_MICROBLAZE 25 | bool "microblaze" 26 | help 27 | Choose this option to specify MicroBlaze as the SUBSYSTEM architecture 28 | endchoice 29 | 30 | config SUBSYSTEM_ENDIAN_LITTLE 31 | bool 32 | default y 33 | 34 | if SUBSYSTEM_SDT_FLOW 35 | 36 | source ./Kconfig.bootcompselection 37 | 38 | endif 39 | 40 | if SUBSYSTEM_DISTRO_PETALINUX 41 | 42 | source ./Kconfig.linuxcompselection 43 | 44 | source ./Kconfig.autoconfigsettings 45 | 46 | endif 47 | 48 | source ./Kconfig.syshw 49 | 50 | source ./Kconfig.dtgsettings 51 | 52 | source ./Kconfig.bootcompconfigurations 53 | 54 | if SUBSYSTEM_DISTRO_PETALINUX 55 | 56 | source ./Kconfig.imagepkgconfigurations 57 | 58 | endif 59 | 60 | source ./Kconfig.yoctobuildsettings 61 | -------------------------------------------------------------------------------- /lib/logger_setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 4 | # Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 5 | # 6 | # Author: 7 | # Raju Kumar Pothuraju 8 | # 9 | # SPDX-License-Identifier: MIT 10 | 11 | import logging 12 | import sys 13 | 14 | logger = None 15 | format = logging.Formatter("[%(levelname)s] %(message)s") 16 | logformat = logging.Formatter("%(asctime)s - [%(levelname)s] %(message)s") 17 | 18 | 19 | def plain(self, message, *args, **kwargs): 20 | print(message) 21 | 22 | 23 | def note(self, message, *args, **kwargs): 24 | self._log(logging.INFO + 2, message, args, **kwargs) 25 | 26 | 27 | logging.addLevelName(logging.INFO + 2, 'NOTE') 28 | logging.Logger.plain = plain 29 | logging.Logger.note = note 30 | 31 | 32 | def setup_logger(name=''): 33 | global logger 34 | if logger: 35 | return logger 36 | logger = logging.getLogger(name) 37 | logger.setLevel(logging.DEBUG) 38 | 39 | console_h = logging.StreamHandler(sys.stdout) 40 | console_h.setLevel(logging.INFO) 41 | console_h.setFormatter(format) 42 | logger.addHandler(console_h) 43 | 44 | return logger, console_h 45 | 46 | 47 | def setup_logger_file(filename): 48 | global logger 49 | file_h = logging.FileHandler(filename) 50 | file_h.setLevel(logging.DEBUG) 51 | file_h.setFormatter(logformat) 52 | logger.addHandler(file_h) 53 | -------------------------------------------------------------------------------- /docs/intro.rst: -------------------------------------------------------------------------------- 1 | .. Copyright (C) 2022-2025, Advanced Micro Devices, Inc. All rights reserved. 2 | 3 | .. SPDX-License-Identifier: MIT 4 | 5 | Introduction 6 | ************ 7 | 8 | The gen-machine-conf tool is a comprehensive automation tool designed 9 | for generating machine configuration files for embedded Linux platforms, 10 | specifically targeting PetaLinux and Yocto build environments. Developed 11 | to streamline the hardware-to-software integration process. 12 | 13 | gen-machine-conf simplifies the conversion of hardware descriptions, 14 | such as Xilinx System Architecture (.xsa) files or System Device-tree 15 | directories into ready-to-use machine configuration files. 16 | These files are essential for customizing and building Linux images 17 | tailored to specific hardware platforms. 18 | 19 | The tool features robust command-line argument parsing, template-driven 20 | configuration, and dynamic output directory management. It integrates 21 | seamlessly with Bitbake for Yocto workflows and offers a dedicated mode 22 | for PetaLinux, ensuring compatibility and flexibility across different 23 | development scenarios. Its plugin architecture allows for easy extension, 24 | enabling users to add custom subcommands and processing logic as needed. 25 | 26 | With strong error handling, detailed logging, and support for advanced 27 | configuration options, gen-machine-conf empowers developers to automate 28 | and manage complex build setups efficiently, reducing manual effort and 29 | minimizing errors in the configuration process. Whether used for rapid 30 | prototyping or production deployment, this tool provides a reliable 31 | foundation for embedded Linux development. 32 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.autoconfigsettings: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | 6 | menu "Auto Config Settings" 7 | 8 | config SUBSYSTEM_AUTOCONFIG_DEVICE__TREE 9 | bool "Device tree autoconfig" 10 | default y 11 | help 12 | Select this option to enable auto generation of device-tree configuration 13 | files into components/plnx_workspace/device-tree/device-tree. 14 | 15 | config SUBSYSTEM_DEVICE_TREE_MANUAL_INCLUDE 16 | bool "Specify a manual device tree include directory" 17 | default n 18 | help 19 | Select this option to allow you to specify a custom include directory 20 | to use when compiling the device tree. 21 | 22 | config SUBSYSTEM_DEVICE_TREE_INCLUDE_DIR 23 | string "Manual device tree include directory" 24 | default "${STAGING_KERNEL_DIR}/include" 25 | depends on SUBSYSTEM_DEVICE_TREE_MANUAL_INCLUDE 26 | help 27 | This is the include directory used by DTC during device tree compliation. 28 | By default it points to "${STAGING_KERNEL_DIR}/include" which is 29 | "${TMPDIR}/work-shared/${MACHINE}/kernel-source/include" 30 | 31 | if SYSTEM_MICROBLAZE 32 | config SUBSYSTEM_AUTOCONFIG_KERNEL 33 | bool "kernel autoconfig" 34 | default y 35 | help 36 | Choose this option to use PetaLinux kernel configuration generated based on 37 | system config. 38 | Over this petalinux auto generated fragments -- plnx_kernel.cfg applied 39 | 40 | config SUBSYSTEM_AUTOCONFIG_U__BOOT 41 | bool "u-boot autoconfig" 42 | default y 43 | help 44 | Choose this option to use PetaLinux u-boot configuration. 45 | See CONFIG_SUBSYSTEM_UBOOT_CONFIG_TARGET for defconfig used from U-boot src, 46 | Over this petalinux auto generated fragments -- platform-auto.h, platform-top.h, config.cfg are applied 47 | 48 | endif 49 | endmenu 50 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/flash.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | ### Flash 7 | # common qspi-flash property 8 | spi_flash: 9 | var_count: spiflash_count 10 | hsm: 11 | define: 12 | IP_NAME: 13 | uboot_config: CONFIG_CMD_SPI CONFIG_CMD_SF CONFIG_SPI_FLASH CONFIG_SPI_FLASH_BAR CONFIG_DM_SPI_FLASH CONFIG_DM_SPI CONFIG_SPI_FLASH_SPANSION CONFIG_SPI_FLASH_STMICRO CONFIG_SPI_FLASH_WINBOND CONFIG_SPI_FLASH_MACRONIX CONFIG_SPI CONFIG_SPI_FLASH_ISSI 14 | custom_define_1: 15 | IP_NAME: 16 | sys_property: SYS_FLASH_TYPE SPI 17 | 18 | 19 | axi_quad_spi: 20 | var_count: spiflash_count 21 | ip_type: spi_flash 22 | flash_type: spi 23 | hsm: 24 | define: 25 | CONFIG.C_BASEADDR: 26 | uboot_config: CONFIG_XILINX_SPI 27 | 28 | # common setting for flashs 29 | nor_flash: 30 | hsm: 31 | define: 32 | IP_NAME: 33 | uboot_config: CONFIG_SYS_FLASH_USE_BUFFER_WRITE CONFIG_SYS_FLASH_CFI CONFIG_FLASH_CFI_DRIVER CONFIG_CMD_FLASH CONFIG_CMD_IMLS CONFIG_MTD_NOR_FLASH 34 | custom_define_1: 35 | IP_NAME: 36 | sys_property: SYS_FLASH_TYPE NOR 37 | axi_emc: 38 | ip_type: nor_flash 39 | flash_type: nor 40 | hsm: 41 | define: 42 | IP_NAME: 43 | uboot_config: CONFIG_SYS_FLASH_PROTECTION 44 | ps7_qspi: 45 | var_count: spiflash_count 46 | ip_type: spi_flash 47 | flash_type: spi 48 | 49 | psu_qspi: 50 | var_count: spiflash_count 51 | ip_type: spi_flash 52 | flash_type: spi 53 | 54 | psv_pmc_qspi: 55 | var_count: spiflash_count 56 | ip_type: spi_flash 57 | flash_type: spi 58 | 59 | psv_pmc_qspi_ospi: 60 | var_count: spiflash_count 61 | ip_type: spi_flash 62 | flash_type: spi 63 | 64 | psx_pmc_qspi: 65 | var_count: spiflash_count 66 | ip_type: spi_flash 67 | flash_type: spi 68 | 69 | psx_pmc_qspi_ospi: 70 | var_count: spiflash_count 71 | ip_type: spi_flash 72 | flash_type: spi 73 | 74 | ps7_spi: 75 | var_count: spiflash_count 76 | ip_type: spi_flash 77 | flash_type: spi 78 | 79 | nand_flash: 80 | ip_type: nand_flash 81 | flash_type: nand 82 | 83 | ps7_nand: 84 | ip_type: nand_flash 85 | flash_type: nand 86 | 87 | psu_nand: 88 | ip_type: nand_flash 89 | flash_type: nand 90 | 91 | ps7_sram: 92 | ip_type: nor_flash 93 | flash_type: nor 94 | -------------------------------------------------------------------------------- /gen-machine-scripts/petalinux-find-ipaddr: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2013-2022, Xilinx, Inc. All rights reserved. 3 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | 7 | MYCMD=$(basename $0) 8 | 9 | function usage { 10 | echo "This command is used to determine IP addresses of host interfaces" 11 | echo "" 12 | echo "Usage:" 13 | echo " petalinux-find-ipaddr " 14 | echo "" 15 | echo "Options:" 16 | echo " -h|--help Show this message" 17 | echo " IFSPEC AUTO | AUTO:ethN etc" 18 | } 19 | 20 | function parse_args { 21 | 22 | args=$(getopt -o "h" --long "help" -- "$@") 23 | 24 | [ $? -ne 0 ] && usage && exit -1 25 | 26 | eval set -- "${args}" 27 | 28 | while true ; do 29 | case $1 in 30 | -h|--help) usage; exit 0 ;; 31 | --) shift; break; ;; 32 | *) usage; exit -1; ;; 33 | esac 34 | done 35 | 36 | ifspec=$1; shift 37 | 38 | [ -z "${ifspec}" ] && ifspec="AUTO" 39 | 40 | [ ! -z "$@" ] && echo "Extra arguments provided: $@" && usage && exit -1 41 | } 42 | 43 | parse_args "$@" 44 | 45 | IFCONFIG=$(which ifconfig) 46 | intfs_path="/sys/class/net/" 47 | 48 | if [ "${ifspec:0:4}" == "AUTO" ] || [ "${ifspec:0:4}" == "auto" ]; then 49 | # AUTO: will grab the IP of that interface, if possible 50 | intf_list=${ifspec:5} 51 | # Was a specific interface given? IF so, make sure it exists 52 | if [ -n "${intf_list}" ]; then 53 | if ! ${IFCONFIG} ${intf_list} > /dev/null 2>&1 ; then 54 | echo "WARNING: Specified interface ${intf_list} does not exist, using default" 1>&2 55 | intf_list= 56 | fi 57 | fi 58 | 59 | if [ -z "${intf_list}" ]; then 60 | # Otherwise, find all available interfaces 61 | temp_intf_list=$(ls "${intfs_path}") 62 | for intf in ${temp_intf_list} 63 | do 64 | if [ -d "${intfs_path}/${intf}/" ] ; then 65 | if grep -q "up" "${intfs_path}/${intf}/operstate" ; then 66 | # Grab the IP address of the first valid interface in the list 67 | if ${IFCONFIG} $intf | grep -q "inet addr"; then 68 | #delimiter is ':' 69 | ipaddr="$(${IFCONFIG} $intf 2>/dev/null | egrep -o "inet addr:[0-9]+.[0-9]+.[0-9]+.[0-9]+" | cut -d ':' -f 2)" 70 | elif $(${IFCONFIG} $intf | grep -q "inet "); then 71 | #delimiter is 'space' 72 | ipaddr="$(${IFCONFIG} $intf 2>/dev/null | egrep -o "inet [0-9]+.[0-9]+.[0-9]+.[0-9]+" | cut -d ' ' -f 2)" 73 | fi 74 | if [ ! -z "${ipaddr}" ] && [ ! "${ipaddr}" = "127.0.0.1" ]; then 75 | break; 76 | fi 77 | fi 78 | fi 79 | done 80 | fi 81 | else 82 | intf_list= 83 | fi 84 | 85 | if [ -z ${ipaddr} ]; then 86 | echo "${ifspec}" 87 | else 88 | echo "${ipaddr}" 89 | fi 90 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/README: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # must be 4 spaces 7 | # no space after : 8 | # no space in key 9 | # it is very pick on the format at time 10 | 11 | # currently work as associative array 12 | 13 | ############### 14 | # Basic format 15 | ############### 16 | # IP_TYPE: 17 | # ip_type: 18 | # var_count: 19 | # # e.g. processor/memory/flash/ethernet. it also trigger a common setting for different ip cores> 20 | # hsm: 21 | # # determine the value based on hsi data 22 | # rules: # type of rules applies to the system 23 | # IP property key: 24 | # config file type: 25 | # kconfig: 26 | # # determine the value based on kconfig dictionary 27 | # rules: # type of rules applies to the system 28 | # dictionary key: # separated with ? 29 | # config file type: 30 | # 31 | ################# 32 | # FIXME: some of rules are overlapped in feature, clean it 33 | # Available rules: 34 | # - config([0-9]|): define a variable based on the return of dictionary 35 | # key or ip property (if return is found) 36 | # - config([0-9]|)_chk__custom_define: define a variable 37 | # based on the if the dictionary key 38 | # return value matches the desired value 39 | # - config([0-9]|)_chk__str: Output the custom string if 40 | # the dictionary key return value matches the desired value 41 | # - config([0-9]|)_chk_: define a variable base on the 42 | # return if the dictionary key return value matches the desired value 43 | # - config([0-9]|)_value_plus_: define a variable based on the 44 | # return value + increment 45 | # - custom_define([0-9]|)_chk_.*: define variable based on the if the dictionary key return value matches the desired value 47 | # - custom_define([0-9]|): define variable based on the if the dictionary key returns 49 | # - undefine([0-9]|): undefine a variable if return founded 50 | # - define([0-9]|)_chk_not_: define variable if the return 51 | # does not matche the desired value 52 | # - define_chk([0-9]|)_: define variable if the return 53 | # matches the desired value 54 | # - define([0-9]|)_zero: define a variable with 0 55 | # - define([0-9]|)_: define variable with desired value 56 | # - define([0-9]|) : define varaibles base on the 57 | 58 | # primary_: this only applies when the var_count variable is set to 0 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ###### Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | ###### Copyright (C) 2022-2025, Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | ###### SPDX-License-Identifier: MIT 5 | 6 | gen-machine-conf 7 | ---------------- 8 | 9 | This repo provides support to generate machine conf and plnxtool.conf 10 | files for the given HW file. 11 | 12 | gen-machine-conf is a tool for creating [Yocto project](https://www.yoctoproject.org/) 13 | [machine configurations](https://docs.yoctoproject.org/ref-manual/variables.html#term-MACHINE) 14 | for [AMD FPGAs](https://www.amd.com/en/products/adaptive-socs-and-fpgas/fpga.html) from 15 | [Vivado](https://www.xilinx.com/products/design-tools/vivado.html) binary output, from 16 | [System Device Trees](https://www.devicetree.org/) generated by the 17 | [system device tree generator](https://github.com/Xilinx/system-device-tree-xlnx), 18 | or device trees created by hand from within a Yocto Project environment. 19 | 20 | See detailed Introduction in [Gen-Machine-Conf Introduction](docs/intro.rst) 21 | 22 | See detailed Usage in [Gen-Machine-Conf Usage](docs/usage.rst) 23 | 24 | See detailed examples in [Gen-Machine-Conf Examples](docs/examples.rst) 25 | 26 | See detailed commandline options in [Gen-Machine-Conf options](docs/options.rst) 27 | 28 | Maintainers, Patches/Submissions, Community 29 | ------------------------------------------- 30 | 31 | gen-machine-conf maintainers occasionally review the github pull requests 32 | associated with the project. There is no mailing list for submission of 33 | patches, but for format and style guidance please see the OE community patch 34 | submission guidelines, as described in: 35 | 36 | https://docs.yoctoproject.org/dev/contributor-guide/submit-changes.html 37 | 38 | **Maintainers:** 39 | 40 | Mark Hatle 41 | Sandeep Gundlupet Raju 42 | Varalaxmi Bingi 43 | Raju Kumar Pothuraju 44 | Swagath Gadde 45 | Ashwini Lomate 46 | John Toomey 47 | 48 | 49 | Dependencies 50 | ------------ 51 | 52 | This repo depends on: 53 | 54 | URI: https://git.yoctoproject.org/poky 55 | layers: meta, meta-poky 56 | branch: langdale 57 | 58 | URI: https://git.openembedded.org/meta-openembedded 59 | layers: meta-oe, meta-perl, meta-python, meta-filesystems, meta-gnome, 60 | meta-multimedia, meta-networking, meta-webserver, meta-xfce, 61 | meta-initramfs. 62 | branch: langdale 63 | 64 | URI: 65 | https://git.yoctoproject.org/meta-xilinx (official version) 66 | https://github.com/Xilinx/meta-xilinx (development and amd xilinx release) 67 | layers: meta-xilinx-core, meta-xilinx-microblaze, meta-xilinx-bsp, 68 | meta-xilinx-standalone, meta-xilinx-vendor. 69 | branch: langdale or amd xilinx release version (e.g. rel-v2023.1) 70 | 71 | URI: 72 | https://git.yoctoproject.org/meta-xilinx-tools (official version) 73 | https://github.com/Xilinx/meta-xilinx-tools (development and amd xilinx release) 74 | branch: langdale or amd xilinx release version (e.g. rel-v2023.1) 75 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.yoctomachinesettings: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | # 6 | config YOCTO_MACHINE_NAME 7 | string "Yocto Machine Name" 8 | default "versal-net-generic" if SUBSYSTEM_VARIANT_VERSALNET 9 | default "versal-generic" if SYSTEM_VERSAL 10 | default "versal-2ve-2vm-generic" if SYSTEM_VERSAL-2VE-2VM 11 | default "zynqmp-generic" if SYSTEM_ZYNQMP 12 | default "zynq-generic" if SUBSYSTEM_ARCH_ARM 13 | default "microblaze-generic" if SUBSYSTEM_ARCH_MICROBLAZE 14 | help 15 | You can specify MACHINE_NAME using this variable. 16 | Auto append the deviceId to Machine Name if this matches with INCLUDE_MACHINE_NAME 17 | 18 | config YOCTO_INCLUDE_MACHINE_NAME 19 | string "Yocto Include Machine name" 20 | default "ac701-microblazeel" if YOCTO_MACHINE_NAME = "xilinx-ac701" 21 | default "kc705-microblazeel" if YOCTO_MACHINE_NAME = "xilinx-kc705" 22 | default "kcu105-microblazeel" if YOCTO_MACHINE_NAME = "xilinx-kcu105" 23 | default "vcu118-microblazeel" if YOCTO_MACHINE_NAME = "xilinx-vcu118" 24 | default "kcu105-tmr-microblazeel" if YOCTO_MACHINE_NAME = "xilinx-sp701" 25 | default "zc702-zynq7" if YOCTO_MACHINE_NAME = "xilinx-zc702" 26 | default "zc706-zynq7" if YOCTO_MACHINE_NAME = "xilinx-zc706" 27 | default "zedboard-zynq7" if YOCTO_MACHINE_NAME = "avnet-digilent-zedboard" 28 | default "zc1751-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-zc1751-dc1" 29 | default "zcu102-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-zcu102" 30 | default "zcu104-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-zcu104" 31 | default "zcu106-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-zcu106" 32 | default "zcu111-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-zcu111" 33 | default "zcu208-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-zcu208" 34 | default "zcu216-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-zcu216" 35 | default "zcu670-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-zcu670" 36 | default "k26-sm" if YOCTO_MACHINE_NAME = "xilinx-k26-som" 37 | default "k24-sm" if YOCTO_MACHINE_NAME = "xilinx-k24-som" 38 | default "k26-smk-kr" if YOCTO_MACHINE_NAME = "xilinx-k26-kr" 39 | default "k26-smk-kv" if YOCTO_MACHINE_NAME = "xilinx-k26-kv" 40 | default "k24-smk-kd" if YOCTO_MACHINE_NAME = "xilinx-k24-kd" 41 | default "vck-sc-zynqmp" if YOCTO_MACHINE_NAME = "xilinx-vck190-sc" 42 | default "eval-brd-sc-zynqmp" if YOCTO_MACHINE_NAME = "eval-brd-sc" 43 | default "vck190-versal" if YOCTO_MACHINE_NAME = "xilinx-vck190" 44 | default "vc-p-a2197-00-versal" if YOCTO_MACHINE_NAME = "xilinx-vc-p-a2197-00" 45 | default "vck5000-versal" if YOCTO_MACHINE_NAME = "xilinx-vck5000" 46 | default "vek280-versal" if YOCTO_MACHINE_NAME = "xilinx-vek280" 47 | default "vhk158-versal" if YOCTO_MACHINE_NAME = "xilinx-vhk158" 48 | default "vmk180-versal" if YOCTO_MACHINE_NAME = "xilinx-vmk180" 49 | default "vpk120-versal" if YOCTO_MACHINE_NAME = "xilinx-vpk120" 50 | default "vpk180-versal" if YOCTO_MACHINE_NAME = "xilinx-vpk180" 51 | help 52 | Specify MACHINE_NAME which will need to be include into the YOCTO_MACHINE file 53 | 54 | config YOCTO_ADD_OVERRIDES 55 | string "Yocto Additional Overrides" 56 | default "" 57 | help 58 | Specify additional overrides to the generated machine conf file 59 | Specify multiple overrides with ':' separator 60 | 61 | if SUBSYSTEM_SDT_FLOW 62 | 63 | @@multiconfigmenustr@@ 64 | 65 | config YOCTO_MC_DOMAIN_FILEPATH 66 | string "Domain file Path" 67 | default "" 68 | help 69 | Specify the domain file path to use in the generation of multiconfig files. 70 | 71 | endif 72 | -------------------------------------------------------------------------------- /lib/rootfs_config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 4 | # Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 5 | # 6 | # Author: 7 | # Raju Kumar Pothuraju 8 | # 9 | # SPDX-License-Identifier: MIT 10 | 11 | 12 | import os 13 | import common_utils 14 | import project_config 15 | import logging 16 | 17 | logger = logging.getLogger('Gen-Machineconf') 18 | 19 | socvariant_menu = ''' 20 | config SUBSYSTEM_VARIANT_{0}{1} 21 | bool 22 | default y 23 | help 24 | ''' 25 | 26 | Kconfig_arch = ''' 27 | config system-{0} 28 | bool 29 | default y 30 | ''' 31 | 32 | Kconfig_sdt = ''' 33 | config subsystem-sdt-flow 34 | bool 35 | default y 36 | help 37 | ''' 38 | 39 | def GenRootfsConfig(args, system_conffile): 40 | arch = common_utils.GetConfigValue('CONFIG_SUBSYSTEM_ARCH_', 41 | system_conffile, 'choice', '=y').lower() 42 | genmachine_scripts = project_config.GenMachineScriptsPath() 43 | # template files for rootfs 44 | template_rfsfile = os.path.join(genmachine_scripts, 45 | 'rootfsconfigs/rootfsconfig_%s' % args.soc_family) 46 | template_Kconfig = os.path.join(genmachine_scripts, 47 | 'rootfsconfigs/Kconfig-%s.part' % arch) 48 | rfsconfig_py = os.path.join(genmachine_scripts, 49 | 'rootfsconfigs/rootfs_config.py') 50 | if args.add_rootfsconfig: 51 | user_cfg = os.path.realpath(args.add_rootfsconfig) 52 | else: 53 | user_cfg = os.path.join(genmachine_scripts, 54 | 'rootfsconfigs/user-rootfsconfig') 55 | 56 | # Create rootfsconfigs dir if not found 57 | rootfs_cfgdir = os.path.join(args.output, 'rootfsconfigs') 58 | common_utils.CreateDir(rootfs_cfgdir) 59 | 60 | rootfs_conffile = os.path.join(args.output, 'rootfs_config') 61 | rfsKconfig_part = os.path.join(rootfs_cfgdir, 'Kconfig.part') 62 | rfsKconfig_user = os.path.join(rootfs_cfgdir, 'Kconfig.user') 63 | rootfs_Kconfig = os.path.join(rootfs_cfgdir, 'Kconfig') 64 | 65 | for file_path in [template_rfsfile, template_Kconfig, rfsconfig_py]: 66 | if not os.path.isfile(file_path): 67 | raise Exception('%s is not found in tool' % file_path) 68 | 69 | if not os.path.isfile(rootfs_conffile): 70 | common_utils.CopyFile(template_rfsfile, rootfs_conffile) 71 | if not os.path.isfile(rfsKconfig_part): 72 | common_utils.CopyFile(template_Kconfig, rfsKconfig_part) 73 | common_utils.CopyFile(user_cfg, rootfs_cfgdir) 74 | # No need to run if user_rootfsconfig doesnot changes 75 | if not common_utils.ValidateHashFile(args.output, 'USER_RFS_CFG', user_cfg) or \ 76 | not os.path.exists(rfsKconfig_user): 77 | logger.info('Generating kconfig for rootfs') 78 | cmd = 'python3 %s --generate_kconfig %s %s' \ 79 | % (rfsconfig_py, user_cfg, rootfs_cfgdir) 80 | common_utils.RunCmd(cmd, args.output, shell=True) 81 | rfsKconfig_str = Kconfig_arch.format(args.soc_family) 82 | if args.hw_flow == 'sdt': 83 | rfsKconfig_str += Kconfig_sdt 84 | 85 | with open(rfsKconfig_part, 'r', encoding='utf-8') as rfskconfig_part_f: 86 | rfskconfig_part_data = rfskconfig_part_f.read() 87 | rfskconfig_part_f.close() 88 | rfsKconfig_str += rfskconfig_part_data.replace( 89 | 'source ./Kconfig.user', 'source %s' % rfsKconfig_user) 90 | with open(rootfs_Kconfig, 'w') as rfskconfig_f: 91 | rfskconfig_f.write(rfsKconfig_str) 92 | rfskconfig_f.close() 93 | common_utils.RunMenuconfig(rootfs_Kconfig, rootfs_conffile, 94 | True if args.menuconfig == 'rootfs' else False, 95 | args.output, 'rootfs') 96 | -------------------------------------------------------------------------------- /docs/examples.rst: -------------------------------------------------------------------------------- 1 | .. Copyright (C) 2022-2025, Advanced Micro Devices, Inc. All rights reserved. 2 | 3 | .. SPDX-License-Identifier: MIT 4 | 5 | gen-machine-conf Examples 6 | ------------------------- 7 | 8 | The below examples generally take one of five forms: 9 | 10 | - parse-xsa Custom .xsa; This is an example of using the .xsa file 11 | output by AMD `Vivado `_ Design Suite 12 | - parse-xsa .xsa from AMD; This is an example of using an AMD™ provided xsa from our JFrog Artifactory. 13 | gen-machine-conf is capable of ingesting these directly from the web at https://edf.amd.com/sswreleases/rel-v/hdf-examples/ 14 | - parse-sdt Without pl overlay; This method is for when users want their programmable logic loaded at 15 | boot by the AMD™ bootloaders 16 | - parse-sdt With full bitstream pl overlay; This method is used when users want to delay loading of 17 | their programmable logic until the software (e.g. U-Boot, Linux) can perform the load. 18 | - parse-sdt With dfx static pl overlay; This method is used when users want some of their programmable 19 | logic loaded by the AMD™ bootloaders but still have some re-configurable regions in their PL. 20 | 21 | Examples Using .xsa file (deprecated and will be removed in future releases) 22 | ---------------------------------------------------------------------------- 23 | 24 | .. code-block:: console 25 | 26 | # With template YAML file: 27 | $ gen-machine-conf --template 28 | 29 | .. code-block:: console 30 | 31 | # Custom xsa file: 32 | $ gen-machine-conf --soc-family --hw-description /.xsa --machine-name 33 | 34 | .. code-block:: console 35 | 36 | # xsa file from AMD: 37 | $ gen-machine-conf --soc-family --hw-description //system.xsa --machine-name 38 | 39 | System device tree(SDT) Based Examples 40 | -------------------------------------- 41 | 42 | .. note:: 43 | 44 | - MicroBlaze is not supported in system device tree generator at this time. 45 | - Zinq-7000 does not support DFX static pl overlay 46 | 47 | .. code-block:: console 48 | 49 | # With template YAML file 50 | $ gen-machine-conf --template 51 | 52 | .. code-block:: console 53 | 54 | # Without pl overlay 55 | $ gen-machine-conf --hw-description // -c conf --machine-name 56 | 57 | # With full bitstream pl overlay 58 | $ gen-machine-conf --hw-description // -c conf --machine-name -g full 59 | 60 | # With dfx static pl overlay 61 | $ gen-machine-conf --hw-description // -c conf --machine-name zynqmp-zcu102-sdt -g dfx 62 | 63 | # Using a custom xsct install location 64 | $ gen-machine-conf parse-xsa --soc-family versal --hw-description //vck190-versal/system.xsa --machine-name vck190-versal --xsct-tool //tools/xsct 65 | 66 | 67 | Using gen-machine-conf with native sysroot 68 | ------------------------------------------ 69 | 70 | gen-machine-conf needs the additional host tools like conf, mconf and lopper tools. You can get these tools 71 | by downloading and installing pre-built buildtools installer from https://edf.amd.com/sswreleases//sdkupdate/buildtools. 72 | 73 | .. code-block:: console 74 | 75 | # Locate and download the pre-built buildtools 76 | $ wget https://edf.amd.com/sswreleases/rel-v2025.2/sdkupdate/buildtools 77 | $ chmod a+x ./buildtools 78 | 79 | # Execute the installation script 80 | $ ./buildtools -d //x86-sysroot -y 81 | 82 | # Specify installed SDK to gen-machine-conf 83 | $ source //x86-sysroot/environment-setup-x86_64-petalinux-linux 84 | $ gen-machine-conf --hw-description // 85 | 86 | (OR) 87 | $ gen-machine-conf --hw-description // --native-sysroot //x86-sysroot/sysroots/x86_64-petalinux-linux/ 88 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/config_microblaze: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Automatically generated file; DO NOT EDIT. 7 | # linux Configuration 8 | # 9 | CONFIG_SUBSYSTEM_TYPE_LINUX=y 10 | CONFIG_SYSTEM_MICROBLAZE=y 11 | 12 | # 13 | # linux Components Selection 14 | # 15 | CONFIG_SUBSYSTEM_COMPONENT_DEVICE__TREE_NAME_DEVICE__TREE__GENERATOR=y 16 | CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_AUTO_FSBL=y 17 | CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_NAME_FS__BOOT=y 18 | CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_U__BOOT__PLNX=y 19 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE is not set 20 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_NONE is not set 21 | CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_XLNX__4___4=y 22 | # CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_REMOTE is not set 23 | 24 | # 25 | # Generic Components 26 | # 27 | 28 | # 29 | # Auto Config Settings 30 | # 31 | CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE=y 32 | CONFIG_SUBSYSTEM_AUTOCONFIG_KERNEL=y 33 | CONFIG_SUBSYSTEM_AUTOCONFIG_U__BOOT=y 34 | CONFIG_SUBSYSTEM_PROCESSOR_MICROBLAZE_0_SELECT=y 35 | CONFIG_SUBSYSTEM_ARCH_MICROBLAZE=y 36 | 37 | # 38 | # Serial Settings 39 | # 40 | CONFIG_SUBSYSTEM_FSBOOT_SERIAL_RS232_UART_SELECT=y 41 | CONFIG_SUBSYSTEM_SERIAL_RS232_UART_SELECT=y 42 | # CONFIG_SUBSYSTEM_SERIAL_MANUAL_SELECT is not set 43 | # CONFIG_SUBSYSTEM_SERIAL_RS232_UART_BAUDRATE_9600 is not set 44 | # CONFIG_SUBSYSTEM_SERIAL_RS232_UART_BAUDRATE_19200 is not set 45 | # CONFIG_SUBSYSTEM_SERIAL_RS232_UART_BAUDRATE_38400 is not set 46 | # CONFIG_SUBSYSTEM_SERIAL_RS232_UART_BAUDRATE_57600 is not set 47 | CONFIG_SUBSYSTEM_SERIAL_RS232_UART_BAUDRATE_115200=y 48 | # CONFIG_SUBSYSTEM_SERIAL_RS232_UART_BAUDRATE_230400 is not set 49 | 50 | # 51 | # Ethernet Settings 52 | # 53 | CONFIG_SUBSYSTEM_ETHERNET_AXI_ETHERNET_ETH_BUF_SELECT=y 54 | # CONFIG_SUBSYSTEM_ETHERNET_MANUAL_SELECT is not set 55 | CONFIG_SUBSYSTEM_ETHERNET_AXI_ETHERNET_ETH_BUF_MAC_AUTO=y 56 | CONFIG_SUBSYSTEM_ETHERNET_AXI_ETHERNET_ETH_BUF_MAC_PATTERN="00:0a:35:00:??:??" 57 | CONFIG_SUBSYSTEM_ETHERNET_AXI_ETHERNET_ETH_BUF_USE_DHCP=y 58 | 59 | # 60 | # Flash Settings 61 | # 62 | CONFIG_SUBSYSTEM_FLASH_LINEAR_FLASH_BANK0_SELECT=y 63 | # CONFIG_SUBSYSTEM_FLASH_MANUAL_SELECT is not set 64 | # CONFIG_SUBSYSTEM_FLASH__ADVANCED_AUTOCONFIG is not set 65 | 66 | # 67 | # Timer Settings 68 | # 69 | CONFIG_SUBSYSTEM_TIMER_AXI_TIMER_0_SELECT=y 70 | # CONFIG_SUBSYSTEM_TIMER_MANUAL_SELECT is not set 71 | 72 | # 73 | # Reset GPIO Settings 74 | # 75 | CONFIG_SUBSYSTEM_RESET_GPIO_RESET_GPIO_SELECT=y 76 | # CONFIG_SUBSYSTEM_RESET_GPIO_NONE is not set 77 | CONFIG_SUBSYSTEM_RESET_GPIO_RESET_GPIO_CHANNEL0_SELECT=y 78 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG is not set 79 | CONFIG_SUBSYSTEM_ENDIAN_LITTLE=y 80 | 81 | # 82 | # Kernel Bootargs 83 | # 84 | CONFIG_SUBSYSTEM_BOOTARGS_AUTO=y 85 | CONFIG_SUBSYSTEM_BOOTARGS_EARLYPRINTK=y 86 | CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="console=ttyS0,115200 earlycon" 87 | 88 | # 89 | # u-boot Configuration 90 | # 91 | CONFIG_SUBSYSTEM_UBOOT_CONFIG_TARGET="microblaze-generic_defconfig" 92 | CONFIG_SUBSYSTEM_NETBOOT_OFFSET=0x1000000 93 | CONFIG_SUBSYSTEM_U__BOOT_TFTPSERVER_IP="AUTO" 94 | 95 | # 96 | # Image Packaging Configuration 97 | # 98 | # CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS is not set 99 | CONFIG_SUBSYSTEM_ROOTFS_INITRD=y 100 | # CONFIG_SUBSYSTEM_ROOTFS_JFFS2 is not set 101 | # CONFIG_SUBSYSTEM_ROOTFS_NFS is not set 102 | # CONFIG_SUBSYSTEM_ROOTFS_EXT4 is not set 103 | # CONFIG_SUBSYSTEM_ROOTFS_OTHER is not set 104 | CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub" 105 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_NONE is not set 106 | CONFIG_SUBSYSTEM_UIMAGE_HASH_CRC32=y 107 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_SHA1 is not set 108 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_BOTH is not set 109 | CONFIG_SUBSYSTEM_COMPRESS_IMAGE=y 110 | CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000 111 | CONFIG_SUBSYSTEM_COPY_TO_TFTPBOOT=y 112 | CONFIG_SUBSYSTEM_TFTPBOOT_DIR="/tftpboot" 113 | 114 | # 115 | # Firmware Version Configuration 116 | # 117 | CONFIG_SUBSYSTEM_HOSTNAME="microblaze" 118 | CONFIG_SUBSYSTEM_PRODUCT="microblaze" 119 | CONFIG_SUBSYSTEM_FW_VERSION="1.00" 120 | CONFIG_SUBSYSTEM_MACHINE_NAME="template" 121 | 122 | # 123 | # Yocto Settings 124 | # 125 | 126 | 127 | CONFIG_TMP_DIR_LOCATION="${TOPDIR}/tmp" 128 | CONFIG_PRE_MIRROR_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER}/downloads" 129 | CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER}/microblaze/sstate-cache" 130 | -------------------------------------------------------------------------------- /gen-machine-scripts/data/sdt_ipinfo.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | ps7_cortexa9: 7 | properties: 8 | compatible: 9 | OneOf: 10 | - items: 11 | - const: arm,cortex-a9 12 | device_type: processor 13 | 14 | psu_cortexa53: 15 | properties: 16 | compatible: 17 | OneOf: 18 | - items: 19 | - const: arm,cortex-a53 20 | device_type: processor 21 | 22 | psv_cortexa72: 23 | properties: 24 | compatible: 25 | OneOf: 26 | - items: 27 | - const: arm,cortex-a72 28 | device_type: processor 29 | 30 | psx_cortexa78: 31 | properties: 32 | compatible: 33 | OneOf: 34 | - items: 35 | - const: arm,cortex-a78 36 | device_type: processor 37 | 38 | microblaze: 39 | properties: 40 | compatible: 41 | OneOf: 42 | - items: 43 | - enum: 44 | - pmu-microblaze 45 | - xlnx,microblaze-11.0 46 | - xlnx,microblaze 47 | - pmc-microblaze 48 | - psm-microblaze 49 | device_type: processor 50 | 51 | ps7_ddr: 52 | device_type: memory 53 | 54 | psu_ddr: 55 | device_type: memory 56 | 57 | axi_emc: 58 | device_type: memory 59 | 60 | psv_sbsauart: 61 | properties: 62 | compatible: 63 | OneOf: 64 | - items: 65 | - enum: 66 | - arm,pl011 67 | - arm,sbsa-uart 68 | device_type: serial 69 | baudrate_editable: y 70 | 71 | psu_uart: 72 | properties: 73 | compatible: 74 | OneOf: 75 | - items: 76 | - enum: 77 | - cdns,uart-r1p12 78 | - xlnx,zynqmp-uart 79 | - enum: 80 | - cdns,uart-r1p8 81 | - xlnx,xuartps 82 | device_type: serial 83 | baudrate_editable: y 84 | 85 | psu_ethernet: 86 | properties: 87 | compatible: 88 | OneOf: 89 | - items: 90 | - enum: 91 | - xlnx,zynqmp-gem 92 | - cdns,zynqmp-gem 93 | device_type: ethernet 94 | 95 | psv_ethernet: 96 | properties: 97 | compatible: 98 | OneOf: 99 | - items: 100 | - enum: 101 | - xlnx,versal-gem 102 | - cdns,versal-gem 103 | - cdns,gem 104 | device_type: ethernet 105 | 106 | 107 | psv_pmc_sd: 108 | properties: 109 | compatible: 110 | OneOf: 111 | - items: 112 | - enum: 113 | - xlnx,versal-8.9a 114 | - arasan,sdhci-8.9a 115 | device_type: sd 116 | 117 | psu_sd: 118 | properties: 119 | compatible: 120 | OneOf: 121 | - items: 122 | - enum: 123 | - xlnx,zynqmp-8.9a 124 | - arasan,sdhci-8.9a 125 | device_type: sd 126 | 127 | 128 | psu_qspi: 129 | properties: 130 | compatible: 131 | OneOf: 132 | - items: 133 | - enum: 134 | - xlnx,zynqmp-qspi-1.0 135 | - enum: 136 | - xlnx,versal-qspi-1.0 137 | device_type: flash 138 | flash_type: spi 139 | flash_prefix: qspi 140 | 141 | psv_pmc_qspi: 142 | properties: 143 | compatible: 144 | OneOf: 145 | - items: 146 | - enum: 147 | - xlnx,versal-qspi-1.0 148 | - enum: 149 | - xlnx,zynqmp-qspi-1.0 150 | device_type: flash 151 | flash_type: spi 152 | flash_prefix: qspi 153 | 154 | psv_pmc_qspi_ospi: 155 | properties: 156 | compatible: 157 | OneOf: 158 | - items: 159 | - enum: 160 | - xlnx,versal-ospi-1.0 161 | - enum: 162 | - xlnx,zynqmp-ospi-1.0 163 | device_type: flash 164 | flash_type: spi 165 | flash_prefix: spi0 166 | 167 | psx_pmc_qspi: 168 | properties: 169 | compatible: 170 | OneOf: 171 | - items: 172 | - enum: 173 | - xlnx,versal-qspi-1.0 174 | - enum: 175 | - xlnx,zynqmp-qspi-1.0 176 | device_type: flash 177 | flash_type: spi 178 | flash_prefix: qspi 179 | 180 | psx_pmc_qspi_ospi: 181 | properties: 182 | compatible: 183 | OneOf: 184 | - items: 185 | - enum: 186 | - xlnx,versal-ospi-1.0 187 | - enum: 188 | - xlnx,zynqmp-ospi-1.0 189 | device_type: flash 190 | flash_type: spi 191 | flash_prefix: spi0 192 | 193 | axi_quad_spi: 194 | properties: 195 | compatible: 196 | OneOf: 197 | - items: 198 | - enum: 199 | - xlnx,xps-spi-2.00.a 200 | device_type: flash 201 | flash_type: spi 202 | flash_prefix: spi0 203 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.imagepkgconfigurations: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | 6 | menu "Image Packaging Configuration" 7 | choice 8 | prompt "Root filesystem type" 9 | default SUBSYSTEM_ROOTFS_INITRAMFS 10 | 11 | config SUBSYSTEM_ROOTFS_INITRAMFS 12 | bool "INITRAMFS" 13 | help 14 | Choose this option to configure your PetaLinux build to use 15 | the kernel INITRAMFS mechanism for the root filesystem. 16 | 17 | The root filesystem will be writeable, but not persistent, 18 | meaning that any changes are lost upon reboot. 19 | 20 | config SUBSYSTEM_ROOTFS_INITRD 21 | bool "INITRD" 22 | help 23 | Choose this opion to configure your PetaLinux build to use 24 | kernel INITRD mechinsm for the root filesystem. 25 | 26 | config SUBSYSTEM_ROOTFS_UBIFS 27 | bool "UBI/UBIFS" 28 | help 29 | Choose this option to configure your PetaLinux build for the 30 | root filesystem to be mounted on a UBI/UBIFS flash partition. 31 | 32 | You must also ensure that your Flash Partition Table 33 | contains a partition named "ubi" and is of a suitable size. 34 | 35 | config SUBSYSTEM_ROOTFS_NFS 36 | bool "NFS" 37 | help 38 | Choose this setting to configure your PetaLinux build for NFS Root. 39 | 40 | Your workstation must be properly configured for NFS, and the 41 | NFS root directory (see below) must be exported properly. 42 | 43 | config SUBSYSTEM_ROOTFS_EXT4 44 | bool "EXT4 (SD/eMMC/SATA/USB)" 45 | help 46 | Choose this setting to configure your PetaLinux build for EXT4 Root. 47 | 48 | device examples: 49 | eMMC or SD root=/dev/mmcblkYpX 50 | SATA or USB root=/dev/sdX 51 | 52 | config SUBSYSTEM_ROOTFS_OTHER 53 | bool "other" 54 | help 55 | Choose this setting to configure your PetaLinux build for other root. 56 | 57 | You will need to manually generate the Root FS image. 58 | 59 | endchoice 60 | 61 | config SUBSYSTEM_NFSROOT_DIR 62 | string "Location of NFS root directory" 63 | depends on SUBSYSTEM_ROOTFS_NFS 64 | default "/tftpboot/nfsroot" 65 | 66 | config SUBSYSTEM_NFSSERVER_IP 67 | string "NFS Server IP address" 68 | default "AUTO" 69 | depends on SUBSYSTEM_ROOTFS_NFS 70 | help 71 | The IP address of your NFS server in the main network interface. 72 | 73 | config SUBSYSTEM_SDROOT_DEV 74 | string "Device node of SD device" 75 | depends on SUBSYSTEM_ROOTFS_EXT4 76 | default "/dev/mmcblk0p2" 77 | 78 | config SUBSYSTEM_INITRD_RAMDISK_LOADADDR 79 | hex "RAMDISK loadaddr" 80 | default "0x0" 81 | depends on SUBSYSTEM_ROOTFS_INITRD 82 | help 83 | RAMDISK Load address if INITRD is selected as rootfs type 84 | 85 | config SUBSYSTEM_INITRAMFS_IMAGE_NAME 86 | string "INITRAMFS/INITRD Image name" 87 | default "petalinux-image-minimal" 88 | depends on SUBSYSTEM_ROOTFS_INITRD || SUBSYSTEM_ROOTFS_INITRAMFS 89 | help 90 | Specifies the PROVIDES name of an image recipe that is used to 91 | build an initial RAM filesystem (initramfs/initrd) image 92 | 93 | config SUBSYSTEM_UBI_MKUBIFS_ARGS 94 | string "mkfs.ubifs args" 95 | default "" 96 | depends on SUBSYSTEM_ROOTFS_UBIFS 97 | help 98 | Specify the arguments which needs to be used in mkfs.ubifs for creation of ubifs filesystem. 99 | Ex: -m 2048 -e 129024 -c 2047 100 | -m 2048 : is the minimum I/O unit here its 2KB. 101 | -e 129024: logical eraseblock size of the UBI volume. 102 | -c 2047 : specifies maximum file-system size in logical eraseblocks. 103 | NOTE: make sure to add "ubifs" into "SUBSYSTEM_RFS_FORMATS" to take these values into consider. 104 | 105 | config SUBSYSTEM_UBI_UBINIZE_ARGS 106 | string "ubinize args" 107 | default "" 108 | depends on SUBSYSTEM_ROOTFS_UBIFS 109 | help 110 | Specify the arguments which needs to be used in ubinize for creation of ubifs filesystem. 111 | Ex: -m 2048 -p 128KiB -s 512 112 | -m 2048 : is the minimum I/O unit here its 2KB. 113 | -p 128KiB: tells ubinize that physical eraseblock size of the flash chip the UBI image is created for is 128KiB 114 | -s 512: tells ubinize that the flash supports sub-pages and sub-page size is 512 bytes 115 | NOTE: make sure to add "ubifs" into "SUBSYSTEM_RFS_FORMATS" to take these values into consider. 116 | 117 | config SUBSYSTEM_UBI_PART_NAME 118 | string "ubi part name" 119 | default "ubifs" 120 | depends on SUBSYSTEM_ROOTFS_UBIFS 121 | help 122 | Specify the ubifs part name to be added into bootargs. 123 | 124 | config SUBSYSTEM_UIMAGE_NAME 125 | string "name for bootable kernel image" 126 | default "image.ub" 127 | help 128 | Specify the name of uboot bootable kernel image 129 | 130 | config SUBSYSTEM_RFS_FORMATS 131 | string "Root filesystem formats" 132 | default "cpio cpio.gz cpio.gz.u-boot ext4 tar.gz" if SUBSYSTEM_ARCH_AARCH64 133 | default "cpio cpio.gz cpio.gz.u-boot ext4 tar.gz" if SUBSYSTEM_ARCH_ARM 134 | default "cpio cpio.gz cpio.gz.u-boot tar.gz" if SUBSYSTEM_ARCH_MICROBLAZE 135 | help 136 | Specifies the formats the build system uses during the build 137 | when creating the root filesystem. 138 | Supported image formats: 139 | tar.gz cpio cpio.gz.u-boot cpio.gz ext4 ext3 ext3.bz2 tar.bz2 cpio.bz2 ext4.gz 140 | 141 | config SUBSYSTEM_COPY_TO_TFTPBOOT 142 | bool "Copy final images to tftpboot" 143 | help 144 | Set this if you would like the final build image to be automatically 145 | copied to your TFTP server directory. 146 | 147 | config SUBSYSTEM_TFTPBOOT_DIR 148 | string "tftpboot directory" 149 | depends on SUBSYSTEM_COPY_TO_TFTPBOOT 150 | default "/tftpboot" 151 | help 152 | The directory that your TFTP server serves its files from. 153 | 154 | if SYSTEM_VERSAL 155 | config SUBSYSTEM_PDI_FILENAME 156 | string "PDI File name" 157 | default "" 158 | help 159 | Specify the PDI file name If design file has a multiple .pdi files. 160 | 161 | endif 162 | endmenu 163 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/config_zynq: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Automatically generated file; DO NOT EDIT. 7 | # linux System Configuration 8 | # 9 | CONFIG_SUBSYSTEM_TYPE_LINUX=y 10 | CONFIG_SYSTEM_ZYNQ=y 11 | 12 | # 13 | # linux Components Selection 14 | # 15 | CONFIG_SUBSYSTEM_COMPONENT_DEVICE__TREE_NAME_DEVICE__TREE__GENERATOR=y 16 | CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_AUTO_FSBL=y 17 | CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_NAME_ZYNQ_FSBL=y 18 | CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_U__BOOT__PLNX=y 19 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE is not set 20 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_NONE is not set 21 | CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_XLNX__4___4=y 22 | # CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_REMOTE is not set 23 | 24 | # 25 | # Generic Components 26 | # 27 | 28 | # 29 | # Auto Config Settings 30 | # 31 | CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE=y 32 | # CONFIG_SUBSYSTEM_DEVICE_TREE_MANUAL_INCLUDE is not set 33 | CONFIG_SUBSYSTEM_PROCESSOR_PS7_CORTEXA9_0_SELECT=y 34 | CONFIG_SUBSYSTEM_ARCH_ARM=y 35 | 36 | # 37 | # Serial Settings 38 | # 39 | CONFIG_SUBSYSTEM_FSBL_SERIAL_PS7_UART_1_SELECT=y 40 | CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_SELECT=y 41 | # CONFIG_SUBSYSTEM_SERIAL_MANUAL_SELECT is not set 42 | # CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_9600 is not set 43 | # CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_19200 is not set 44 | # CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_38400 is not set 45 | # CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_57600 is not set 46 | CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_115200=y 47 | # CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_230400 is not set 48 | 49 | # 50 | # Ethernet Settings 51 | # 52 | CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_SELECT=y 53 | # CONFIG_SUBSYSTEM_ETHERNET_MANUAL_SELECT is not set 54 | # CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_MAC_AUTO is not set 55 | CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_MAC="00:0a:35:00:1e:53" 56 | CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_USE_DHCP=y 57 | 58 | # 59 | # Flash Settings 60 | # 61 | CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_SELECT=y 62 | # CONFIG_SUBSYSTEM_FLASH_MANUAL_SELECT is not set 63 | # CONFIG_SUBSYSTEM_FLASH__ADVANCED_AUTOCONFIG is not set 64 | # 65 | # SD/SDIO Settings 66 | # 67 | CONFIG_SUBSYSTEM_PRIMARY_SD_PS7_SD_0_SELECT=y 68 | # CONFIG_SUBSYSTEM_SD_MANUAL_SELECT is not set 69 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG=y 70 | 71 | # 72 | # boot image settings 73 | # 74 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_FLASH_SELECT is not set 75 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_SD_SELECT=y 76 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_MANUAL_SELECT is not set 77 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_IMAGE_NAME="BOOT.BIN" 78 | 79 | # 80 | # u-boot env partition settings 81 | # 82 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_FLASH_SELECT=y 83 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_MANUAL_SELECT is not set 84 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_PART_NAME="bootenv" 85 | 86 | # 87 | # kernel image settings 88 | # 89 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_FLASH_SELECT is not set 90 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_SD_SELECT=y 91 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_ETHERNET_SELECT is not set 92 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_MANUAL_SELECT is not set 93 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_IMAGE_NAME="image.ub" 94 | 95 | # 96 | # dtb image settings 97 | # 98 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_BOOTIMAGE_SELECT=y 99 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_FLASH_SELECT is not set 100 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_SD_SELECT is not set 101 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_ETHERNET_SELECT is not set 102 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_MANUAL_SELECT is not set 103 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_IMAGE_NAME="system.dtb" 104 | CONFIG_SUBSYSTEM_ENDIAN_LITTLE=y 105 | CONFIG_SUBSYSTEM_DEVICETREE_COMPILER_FLAGS="-@" 106 | 107 | # 108 | # Kernel Bootargs 109 | # 110 | CONFIG_SUBSYSTEM_BOOTARGS_AUTO=y 111 | CONFIG_SUBSYSTEM_BOOTARGS_EARLYPRINTK=y 112 | CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="console=ttyPS0,115200 earlycon" 113 | 114 | # 115 | # u-boot Configuration 116 | # 117 | CONFIG_SUBSYSTEM_UBOOT_CONFIG_TARGET="xilinx_zynq_virt_defconfig" 118 | CONFIG_SUBSYSTEM_NETBOOT_OFFSET=0x10000000 119 | CONFIG_SUBSYSTEM_U__BOOT_TFTPSERVER_IP="AUTO" 120 | 121 | # 122 | # Image Packaging Configuration 123 | # 124 | # CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS is not set 125 | CONFIG_SUBSYSTEM_ROOTFS_INITRD=y 126 | # CONFIG_SUBSYSTEM_ROOTFS_JFFS2 is not set 127 | # CONFIG_SUBSYSTEM_ROOTFS_NFS is not set 128 | # CONFIG_SUBSYSTEM_ROOTFS_EXT4 is not set 129 | # CONFIG_SUBSYSTEM_ROOTFS_OTHER is not set 130 | CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub" 131 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_NONE is not set 132 | CONFIG_SUBSYSTEM_UIMAGE_HASH_CRC32=y 133 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_SHA1 is not set 134 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_BOTH is not set 135 | CONFIG_SUBSYSTEM_COMPRESS_IMAGE=y 136 | CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000 137 | CONFIG_SUBSYSTEM_COPY_TO_TFTPBOOT=y 138 | CONFIG_SUBSYSTEM_TFTPBOOT_DIR="/tftpboot" 139 | 140 | # 141 | # Firmware Version Configuration 142 | # 143 | CONFIG_SUBSYSTEM_HOSTNAME="zynq" 144 | CONFIG_SUBSYSTEM_PRODUCT="zynq" 145 | CONFIG_SUBSYSTEM_FW_VERSION="1.00" 146 | CONFIG_SUBSYSTEM_MACHINE_NAME="template" 147 | 148 | # 149 | # Yocto Settings 150 | # 151 | 152 | CONFIG_TMP_DIR_LOCATION="${TOPDIR}/tmp" 153 | CONFIG_PRE_MIRROR_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER}/downloads" 154 | CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER}/arm/sstate-cache" 155 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/config_versal: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Automatically generated file; DO NOT EDIT. 7 | # linux System Configuration 8 | # 9 | CONFIG_SUBSYSTEM_TYPE_LINUX=y 10 | CONFIG_SYSTEM_VERSAL=y 11 | 12 | # 13 | # linux Components Selection 14 | # 15 | CONFIG_SUBSYSTEM_COMPONENT_DEVICE__TREE_NAME_DEVICE__TREE__GENERATOR=y 16 | CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_U__BOOT__PLNX=y 17 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE is not set 18 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_NONE is not set 19 | CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_TF-A=y 20 | # CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE is not set 21 | # CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_NONE is not set 22 | CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_XLNX__4___4=y 23 | # CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_REMOTE is not set 24 | 25 | CONFIG_SUBSYSTEM_COMPONENT_PLM_NAME_PLM=y 26 | # CONFIG_SUBSYSTEM_COMPONENT_PLM_NAME_REMOTE is not set 27 | # CONFIG_SUBSYSTEM_COMPONENT_PLM_NAME_EXT__LOCAL__SRC is not set 28 | CONFIG_SUBSYSTEM_COMPONENT_PSM__FIRMWARE_NAME_PSM__FIRMWARE=y 29 | # CONFIG_SUBSYSTEM_COMPONENT_PSM__FIRMWARE_NAME_REMOTE is not set 30 | # CONFIG_SUBSYSTEM_COMPONENT_PSM__FIRMWARE_NAME_EXT__LOCAL__SRC is not set 31 | 32 | # 33 | # Generic Components 34 | # 35 | 36 | # 37 | # Auto Config Settings 38 | # 39 | CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE=y 40 | # CONFIG_SUBSYSTEM_DEVICE_TREE_MANUAL_INCLUDE is not set 41 | CONFIG_SUBSYSTEM_PROCESSOR_PSU_CORTEXA72_0_SELECT=y 42 | CONFIG_SUBSYSTEM_ARCH_AARCH64=y 43 | 44 | # 45 | # Serial Settings 46 | # 47 | CONFIG_SUBSYSTEM_PLM_SERIAL_PSV_SBSAUART_0_SELECT=y 48 | CONFIG_SUBSYSTEM_TF-A_SERIAL_PSV_SBSAUART_0_SELECT=y 49 | CONFIG_SUBSYSTEM_SERIAL_PSV_SBSAUART_0_SELECT=y 50 | # 51 | # 52 | 53 | # 54 | # Ethernet Settings 55 | # 56 | CONFIG_SUBSYSTEM_ETHERNET_PSV_ETHERNET_0_SELECT=y 57 | CONFIG_SUBSYSTEM_ETHERNET_PSV_ETHERNET_0_USE_DHCP=y 58 | # CONFIG_SUBSYSTEM_ETHERNET_MANUAL_SELECT is not set 59 | 60 | # 61 | # Flash Settings 62 | # 63 | CONFIG_SUBSYSTEM_FLASH_PSV_PMC_QSPI_0_BANKLESS_SELECT=y 64 | # CONFIG_SUBSYSTEM_FLASH_MANUAL_SELECT is not set 65 | 66 | # 67 | # SD/SDIO Settings 68 | # 69 | # CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_0_SELECT is not set 70 | # CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_1_SELECT is not set 71 | CONFIG_SUBSYSTEM_PRIMARY_SD_MANUAL_SELECT=y 72 | CONFIG_SUBSYSTEM_SD_PSU_SD_0_SELECT=y 73 | CONFIG_SUBSYSTEM_SD_PSU_SD_1_SELECT=y 74 | 75 | # 76 | # RTC Settings 77 | # 78 | CONFIG_SUBSYSTEM_RTC_MANUAL_SELECT=y 79 | CONFIG_SUBSYSTEM_I2C_PSU_I2C_0_SELECT=y 80 | CONFIG_SUBSYSTEM_I2C_PSU_I2C_1_SELECT=y 81 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG=y 82 | 83 | # 84 | # boot image settings 85 | # 86 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_FLASH_SELECT is not set 87 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_SD_SELECT=y 88 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_MANUAL_SELECT is not set 89 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_IMAGE_NAME="BOOT.BIN" 90 | 91 | # 92 | # u-boot env partition settings 93 | # 94 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_FLASH_SELECT=y 95 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_MANUAL_SELECT is not set 96 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_PART_NAME="bootenv" 97 | 98 | # 99 | # kernel image settings 100 | # 101 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_FLASH_SELECT is not set 102 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_SD_SELECT=y 103 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_ETHERNET_SELECT is not set 104 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_MANUAL_SELECT is not set 105 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_IMAGE_NAME="image.ub" 106 | 107 | # 108 | # dtb image settings 109 | # 110 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_BOOTIMAGE_SELECT=y 111 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_FLASH_SELECT is not set 112 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_SD_SELECT is not set 113 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_ETHERNET_SELECT is not set 114 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_MANUAL_SELECT is not set 115 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_IMAGE_NAME="system.dtb" 116 | CONFIG_SUBSYSTEM_ENDIAN_LITTLE=y 117 | CONFIG_SUBSYSTEM_DEVICETREE_COMPILER_FLAGS="-@" 118 | 119 | # 120 | # Kernel Bootargs 121 | # 122 | CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="console=ttyAMA0 earlycon=pl011,mmio32,0xFF000000,115200n8" 123 | 124 | # 125 | # ARM Trusted Firmware Compilation Configuration 126 | # 127 | CONFIG_SUBSYSTEM_TF-A_EXTRA_COMPILER_FLAGS="" 128 | 129 | # 130 | # u-boot Configuration 131 | # 132 | CONFIG_SUBSYSTEM_UBOOT_CONFIG_TARGET="xilinx_versal_virt_defconfig" 133 | 134 | # 135 | # Image Packaging Configuration 136 | # 137 | # CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS is not set 138 | CONFIG_SUBSYSTEM_ROOTFS_INITRD=y 139 | # CONFIG_SUBSYSTEM_ROOTFS_JFFS2 is not set 140 | # CONFIG_SUBSYSTEM_ROOTFS_NFS is not set 141 | # CONFIG_SUBSYSTEM_ROOTFS_EXT4 is not set 142 | # CONFIG_SUBSYSTEM_ROOTFS_OTHER is not set 143 | CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub" 144 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_NONE is not set 145 | CONFIG_SUBSYSTEM_UIMAGE_HASH_CRC32=y 146 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_SHA1 is not set 147 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_BOTH is not set 148 | CONFIG_SUBSYSTEM_COMPRESS_IMAGE=y 149 | CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000 150 | CONFIG_SUBSYSTEM_COPY_TO_TFTPBOOT=y 151 | CONFIG_SUBSYSTEM_TFTPBOOT_DIR="/tftpboot" 152 | 153 | # 154 | # Firmware Version Configuration 155 | # 156 | CONFIG_SUBSYSTEM_HOSTNAME="versal" 157 | CONFIG_SUBSYSTEM_PRODUCT="versal" 158 | CONFIG_SUBSYSTEM_FW_VERSION="1.00" 159 | CONFIG_SUBSYSTEM_MACHINE_NAME="template" 160 | # 161 | # Yocto Settings 162 | # 163 | CONFIG_TMP_DIR_LOCATION="${TOPDIR}/tmp" 164 | CONFIG_PRE_MIRROR_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER}/downloads" 165 | CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER}/aarch64/sstate-cache" 166 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.dtgsettings: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | 6 | menu "DT Settings" 7 | config SUBSYSTEM_MACHINE_NAME 8 | string "MACHINE_NAME" 9 | default "template" 10 | depends on !SUBSYSTEM_SDT_FLOW 11 | help 12 | Keep empty or specify auto/AUTO it will point to DTG machine name based on the 13 | yocto machine name specified in config. 14 | This is machine name or board name. Ex: zcu102, zc702 15 | This is used to create board related nodes. 16 | Change this only when you also change the corresponding hardware design. 17 | Change of hardware design or Machine_name between same architecture is allowed 18 | 19 | config SUBSYSTEM_DT_XSCT_WORKSPACE 20 | string "Device-tree workspace" 21 | help 22 | Provide the location to use as Device-tree XSCT workspace location. 23 | 24 | config SUBSYSTEM_DTB_PADDING_SIZE 25 | hex "DTB padding size" 26 | default 0x1000 27 | depends on !SUBSYSTEM_SDT_FLOW 28 | help 29 | Set this value for DTB padding size 30 | 31 | if SUBSYSTEM_DISTRO_PETALINUX 32 | if SUBSYSTEM_AUTOCONFIG_DEVICE__TREE 33 | config SUBSYSTEM_EXTRA_DT_FILES 34 | string "Extra dts/dtsi files" 35 | default "" 36 | help 37 | Provide the extra dt files path separated with space. 38 | This config should be set with dts/dtsi absolute/full path. 39 | Provided dts/dtsi will be build as part of device-tree and deploy into /boot/devicetree. 40 | NOTE: All dtsi files should be added to this config which are included in dts file. 41 | Example: /extra-dt-path/can.dtsi /extra-dt-path/test.dtsi 42 | 43 | menu "Kernel Bootargs" 44 | config SUBSYSTEM_BOOTARGS_AUTO 45 | bool "generate boot args automatically" 46 | default y 47 | depends on !SUBSYSTEM_SERIAL_MANUAL_SELECT 48 | help 49 | Generates the default bootargs. 50 | 51 | config SUBSYSTEM_USER_CMDLINE 52 | string "user set kernel bootargs" 53 | default "" 54 | depends on !SUBSYSTEM_BOOTARGS_AUTO 55 | help 56 | Specify any commandline arguments you wish to pass to the kernel 57 | at boot. 58 | 59 | config SUBSYSTEM_BOOTARGS_EARLYPRINTK 60 | bool "enable kernel earlyprintk" 61 | default y 62 | depends on SUBSYSTEM_BOOTARGS_AUTO 63 | help 64 | Select this option to enable kernel earlyprintk. 65 | 66 | config SUBSYSTEM_BOOTARGS_GENERATED 67 | string "Auto generated bootargs (NO EDIT!)" 68 | default "" 69 | depends on SUBSYSTEM_BOOTARGS_AUTO 70 | help 71 | system auto generated bootargs. 72 | WARNING: Do not edit, your changes will be lost. 73 | Disable SUBSYSTEM_BOOTARGS_AUTO to edit bootargs through SUBSYSTEM_USER_CMDLINE option 74 | 75 | config SUBSYSTEM_EXTRA_BOOTARGS 76 | string "Add extra boot args" 77 | default "" 78 | depends on SUBSYSTEM_BOOTARGS_AUTO 79 | help 80 | Select this option to append extra bootargs 81 | 82 | endmenu 83 | endif 84 | config SUBSYSTEM_DEVICETREE_COMPILER_FLAGS 85 | string "Devicetree compiler flags" 86 | default "" 87 | help 88 | Mention device-tree compiler flags. 89 | These will be passed to dtc while compiling device-trees. 90 | Ex: -@ 91 | 92 | if !SUBSYSTEM_ARCH_MICROBLAZE 93 | config SUBSYSTEM_DTB_OVERLAY 94 | bool "Devicetree overlay" 95 | default n 96 | help 97 | Select this option to separate pl from base dtb 98 | and build the pl.dtsi to generate pl.dtbo. 99 | 100 | config SUBSYSTEM_REMOVE_PL_DTB 101 | bool "Remove PL from devicetree" 102 | default n 103 | help 104 | Remove PL nodes if user doesn't depend on the PL IPs and 105 | if any PL IP in DTG generates an error then user can 106 | simply enable this flag and DTG won't generate any PL nodes. 107 | 108 | endif 109 | 110 | if !SUBSYSTEM_ARCH_MICROBLAZE && !SUBSYSTEM_ARCH_ARM 111 | config SUBSYSTEM_ENABLE_XEN_HW_DTSI 112 | bool "Enable xen hardware dtsi" 113 | default n 114 | help 115 | Enable this config to automatically add Xen hardware related 116 | device tree nodes (xen.dtsi) to the final system.dtb 117 | 118 | config SUBSYSTEM_ENABLE_XEN_QEMU_DTSI 119 | bool "Enable xen QEMU dtsi" 120 | default n 121 | help 122 | Enable this config to automatically add Xen qemu related 123 | device tree nodes (xen-qemu.dtsi) to the final system.dtb 124 | 125 | endif 126 | 127 | if !SUBSYSTEM_SDT_FLOW 128 | config SUBSYSTEM_ENABLE_NO_ALIAS 129 | bool "Enable board specific aliases" 130 | default n 131 | help 132 | Enable board specific aliases defined in DT machine file for different evluation boards. 133 | 134 | config SUBSYSTEM_ENABLE_DTG_ALIAS 135 | bool "Enable aliases generated by DTG" 136 | default n 137 | help 138 | Enable this option to get DTG generated aliases. 139 | NOTE: This will not effect if ENABLE_NO_ALIAS selected So final DT will have board aliases. 140 | 141 | config SUBSYSTEM_ENABLE_NO_LABELS 142 | bool "Disable labels For Partial DT files" 143 | default n 144 | depends on SUBSYSTEM_FPGA_MANAGER 145 | help 146 | Enable this option to not generated the labels in partial dtbo files. 147 | There will not be any Changes in base dtb or PL dtb or dtbo files. 148 | User should take care of the nodes if any build failures. 149 | 150 | config SUBSYSTEM_ENABLE_DT_VERBOSE 151 | bool "Enable dt verbose" 152 | default n 153 | help 154 | Enable this option to get additional logs for device-tree. 155 | These debug prints can be seen in log.do_configure which will be saved in device-tree workspace directory. 156 | 157 | if !SUBSYSTEM_ENABLE_NO_ALIAS 158 | config SUBSYSTEM_ADD_EEPROM_ALIAS 159 | bool "Enable eeprom alias" 160 | default n 161 | help 162 | Enable this option to add eeprom in aliases node 163 | E.g: nvmem0 = &eeprom 164 | 165 | config SUBSYSTEM_ADD_RTC_ALIAS 166 | bool "Enable rtc alias" 167 | default n 168 | help 169 | Enable this option to add rtc in alias node 170 | E.g: rtc0 = &rtc 171 | endif 172 | endif 173 | endif 174 | endmenu 175 | 176 | if !SUBSYSTEM_ARCH_MICROBLAZE 177 | menu "FPGA Manager" 178 | config SUBSYSTEM_FPGA_MANAGER 179 | bool "Fpga Manager" 180 | help 181 | Select this option to provides an interface to the Linux for configuring the programmable logic(PL). 182 | 183 | if SUBSYSTEM_FPGA_MANAGER && SUBSYSTEM_SDT_FLOW 184 | choice 185 | prompt "PL Device-Tree Overlay Type" 186 | 187 | config SUBSYSTEM_PL_DT_OVERLAY_FULL 188 | bool "full" 189 | 190 | config SUBSYSTEM_PL_DT_OVERLAY_DFX 191 | bool "dfx" 192 | 193 | endchoice 194 | endif 195 | endmenu 196 | endif 197 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/config_zynqmp: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Automatically generated file; DO NOT EDIT. 7 | # linux System Configuration 8 | # 9 | CONFIG_SUBSYSTEM_TYPE_LINUX=y 10 | CONFIG_SYSTEM_ZYNQMP=y 11 | 12 | # 13 | # linux Components Selection 14 | # 15 | CONFIG_SUBSYSTEM_COMPONENT_DEVICE__TREE_NAME_DEVICE__TREE__GENERATOR=y 16 | # CONFIG_SUBSYSTEM_COMPONENT_IMG_SEL is not set 17 | CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_AUTO_FSBL=y 18 | CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_NAME_ZYNQMP_FSBL=y 19 | CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_U__BOOT__PLNX=y 20 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE is not set 21 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_NONE is not set 22 | CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_TF-A=y 23 | # CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE is not set 24 | # CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_NONE is not set 25 | CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_XLNX__4___4=y 26 | # CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_REMOTE is not set 27 | 28 | # 29 | # Generic Components 30 | # 31 | 32 | # 33 | # Auto Config Settings 34 | # 35 | CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE=y 36 | # CONFIG_SUBSYSTEM_DEVICE_TREE_MANUAL_INCLUDE is not set 37 | CONFIG_SUBSYSTEM_PROCESSOR_PSU_CORTEXA53_0_SELECT=y 38 | CONFIG_SUBSYSTEM_ARCH_AARCH64=y 39 | 40 | # 41 | # Serial Settings 42 | # 43 | CONFIG_SUBSYSTEM_PMUFW_SERIAL_PSU_UART_0_SELECT=y 44 | CONFIG_SUBSYSTEM_FSBL_SERIAL_PSU_UART_0_SELECT=y 45 | CONFIG_SUBSYSTEM_TF-A_SERIAL_PSU_UART_0_SELECT=y 46 | CONFIG_SUBSYSTEM_SERIAL_PSU_UART_0_SELECT=y 47 | # CONFIG_SUBSYSTEM_SERIAL_MANUAL_SELECT is not set 48 | # CONFIG_SUBSYSTEM_SERIAL_PSU_UART_0_BAUDRATE_9600 is not set 49 | # CONFIG_SUBSYSTEM_SERIAL_PSU_UART_0_BAUDRATE_19200 is not set 50 | # CONFIG_SUBSYSTEM_SERIAL_PSU_UART_0_BAUDRATE_38400 is not set 51 | # CONFIG_SUBSYSTEM_SERIAL_PSU_UART_0_BAUDRATE_57600 is not set 52 | CONFIG_SUBSYSTEM_SERIAL_PSU_UART_0_BAUDRATE_115200=y 53 | # CONFIG_SUBSYSTEM_SERIAL_PSU_UART_0_BAUDRATE_230400 is not set 54 | 55 | # 56 | # Ethernet Settings 57 | # 58 | CONFIG_SUBSYSTEM_ETHERNET_PSU_ETHERNET_3_SELECT=y 59 | # CONFIG_SUBSYSTEM_ETHERNET_MANUAL_SELECT is not set 60 | # CONFIG_SUBSYSTEM_ETHERNET_PSU_ETHERNET_3_MAC_AUTO is not set 61 | CONFIG_SUBSYSTEM_ETHERNET_PSU_ETHERNET_3_MAC="ff:ff:ff:ff:ff:ff" 62 | CONFIG_SUBSYSTEM_ETHERNET_PSU_ETHERNET_3_USE_DHCP=y 63 | 64 | # 65 | # Flash Settings 66 | # 67 | CONFIG_SUBSYSTEM_FLASH_PSU_QSPI_0_BANKLESS_SELECT=y 68 | # CONFIG_SUBSYSTEM_FLASH_MANUAL_SELECT is not set 69 | # CONFIG_SUBSYSTEM_FLASH__ADVANCED_AUTOCONFIG is not set 70 | 71 | # 72 | 73 | # 74 | # SD/SDIO Settings 75 | # 76 | CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_0_SELECT=y 77 | # CONFIG_SUBSYSTEM_SD_MANUAL_SELECT is not set 78 | 79 | # 80 | # RTC Settings 81 | # 82 | CONFIG_SUBSYSTEM_RTC_PSU_RTC_SELECT=y 83 | # CONFIG_SUBSYSTEM_RTC_MANUAL_SELECT is not set 84 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG=y 85 | 86 | # 87 | # boot image settings 88 | # 89 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_FLASH_SELECT is not set 90 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_SD_SELECT=y 91 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_MANUAL_SELECT is not set 92 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_IMAGE_NAME="BOOT.BIN" 93 | 94 | # 95 | # u-boot env partition settings 96 | # 97 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_FLASH_SELECT=y 98 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_MANUAL_SELECT is not set 99 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_PART_NAME="bootenv" 100 | 101 | # 102 | # kernel image settings 103 | # 104 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_FLASH_SELECT is not set 105 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_SD_SELECT=y 106 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_ETHERNET_SELECT is not set 107 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_MANUAL_SELECT is not set 108 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_IMAGE_NAME="image.ub" 109 | 110 | # 111 | # dtb image settings 112 | # 113 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_BOOTIMAGE_SELECT=y 114 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_FLASH_SELECT is not set 115 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_SD_SELECT is not set 116 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_ETHERNET_SELECT is not set 117 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_MANUAL_SELECT is not set 118 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_IMAGE_NAME="system.dtb" 119 | CONFIG_SUBSYSTEM_ENDIAN_LITTLE=y 120 | CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="earlycon" 121 | CONFIG_SUBSYSTEM_DEVICETREE_COMPILER_FLAGS="-@" 122 | 123 | # 124 | # ARM Trusted Firmware Compilation Configuration 125 | # 126 | CONFIG_SUBSYSTEM_TF-A_EXTRA_COMPILER_FLAGS="" 127 | 128 | # 129 | # u-boot Configuration 130 | # 131 | CONFIG_SUBSYSTEM_UBOOT_CONFIG_TARGET="xilinx_zynqmp_virt_defconfig" 132 | CONFIG_SUBSYSTEM_NETBOOT_OFFSET=0x10000000 133 | CONFIG_SUBSYSTEM_U__BOOT_TFTPSERVER_IP="AUTO" 134 | 135 | # 136 | # Image Packaging Configuration 137 | # 138 | # CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS is not set 139 | CONFIG_SUBSYSTEM_ROOTFS_INITRD=y 140 | # CONFIG_SUBSYSTEM_ROOTFS_JFFS2 is not set 141 | # CONFIG_SUBSYSTEM_ROOTFS_NFS is not set 142 | # CONFIG_SUBSYSTEM_ROOTFS_EXT4 is not set 143 | # CONFIG_SUBSYSTEM_ROOTFS_OTHER is not set 144 | CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub" 145 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_NONE is not set 146 | CONFIG_SUBSYSTEM_UIMAGE_HASH_CRC32=y 147 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_SHA1 is not set 148 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_BOTH is not set 149 | CONFIG_SUBSYSTEM_COMPRESS_IMAGE=y 150 | CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000 151 | CONFIG_SUBSYSTEM_COPY_TO_TFTPBOOT=y 152 | CONFIG_SUBSYSTEM_TFTPBOOT_DIR="/tftpboot" 153 | 154 | # 155 | # Firmware Version Configuration 156 | # 157 | CONFIG_SUBSYSTEM_HOSTNAME="zynqmp" 158 | CONFIG_SUBSYSTEM_PRODUCT="zynqmp" 159 | CONFIG_SUBSYSTEM_FW_VERSION="1.00" 160 | CONFIG_SUBSYSTEM_MACHINE_NAME="template" 161 | # 162 | # Yocto Settings 163 | # 164 | CONFIG_TMP_DIR_LOCATION="${TOPDIR}/tmp" 165 | CONFIG_PRE_MIRROR_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER}/downloads" 166 | CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER}/aarch64/sstate-cache" 167 | -------------------------------------------------------------------------------- /lib/update_buildconf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 4 | # Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 5 | # 6 | # Author: 7 | # Raju Kumar Pothuraju 8 | # 9 | # SPDX-License-Identifier: MIT 10 | 11 | import os 12 | import re 13 | import shutil 14 | import common_utils 15 | import logging 16 | 17 | logger = logging.getLogger('Gen-Machineconf') 18 | 19 | 20 | def SearchStrInFile(filename, string, remove_if_exists=False): 21 | with open(filename, 'r') as filename_f: 22 | lines = filename_f.readlines() 23 | filename_f.close() 24 | str_found = '' 25 | lines_f = [] 26 | for line in lines: 27 | _line = line.replace('\\', '').strip() 28 | if re.search(string, _line): 29 | str_found = True 30 | continue 31 | lines_f.append(line) 32 | if str_found and remove_if_exists: 33 | with open(filename, 'w') as file_f: 34 | file_f.writelines(lines_f) 35 | return str_found 36 | 37 | 38 | def AddUserLayers(args): 39 | bb_layers = [] 40 | proot = '' 41 | builddir = '' 42 | bitbake_layers = '' 43 | system_conffile = os.path.join(args.output, 'config') 44 | 45 | # Return if sysconf cannot be modified 46 | try: 47 | bitbake_layers = common_utils.check_tool('bitbake-layers') 48 | builddir = os.environ.get('BUILDDIR') 49 | except Exception: 50 | pass 51 | 52 | if not bitbake_layers or not builddir or not \ 53 | 'UPDATE_USER_LAYERS' in os.environ.keys(): 54 | logger.debug( 55 | 'Skip adding layers as no bitbake-layers or builddir found') 56 | return 57 | layers_list = '%s/conf/layerslist' % builddir 58 | old_layers = [] 59 | if os.path.exists(layers_list): 60 | with open(layers_list, 'r') as layers_list_f: 61 | old_layers = layers_list_f.read().splitlines() 62 | 63 | proot = os.environ.get('PROOT') 64 | if proot and args.petalinux: 65 | bb_layers += os.path.join(proot, 'project-spec', 'meta-user').split() 66 | 67 | layer_cnt = 0 68 | while True: 69 | # Read layers from configs 70 | user_layer = common_utils.GetConfigValue( 71 | 'CONFIG_USER_LAYER_%s' % layer_cnt, system_conffile) 72 | if not user_layer: 73 | break 74 | if proot: 75 | user_layer = user_layer.replace('${PROOT}', proot) 76 | bb_layers += user_layer.split() 77 | layer_cnt += 1 78 | 79 | # Get the layers which to be add 80 | add_layers = list(set(bb_layers).difference(old_layers)) 81 | # Get the layers which to be removed 82 | remove_layers = list(set(old_layers).difference(bb_layers)) 83 | 84 | if add_layers: 85 | logger.info('Adding user layers') 86 | with open(layers_list, 'a') as layers_list_f: 87 | for layer in bb_layers: 88 | if layer in add_layers and os.path.isdir(layer): 89 | common_utils.Bitbake.shutdown() 90 | logger.debug('Adding layer: %s' % layer) 91 | command = 'bitbake-layers -F add-layer %s' % (layer) 92 | common_utils.RunCmd(command, builddir, shell=True) 93 | layers_list_f.write(layer + '\n') 94 | 95 | for layer in remove_layers: 96 | cmd = r'sed -i "\|%s|d" "%s"' % (layer, layers_list) 97 | common_utils.RunCmd(cmd, os.getcwd(), shell=True) 98 | cmd = r'sed -i "\|%s|d" "%s/conf/bblayers.conf"' % (layer, builddir) 99 | common_utils.RunCmd(cmd, os.getcwd(), shell=True) 100 | 101 | 102 | def GenLocalConf(conf_file, machine_conf_file, system_conffile, petalinux): 103 | sdt_conf_str = '# Use the newly generated MACHINE\n' 104 | sdt_conf_str += 'MACHINE = "%s"\n' % machine_conf_file 105 | 106 | multiconfig_min = common_utils.GetConfigValue('CONFIG_YOCTO_BBMC_', system_conffile, 107 | 'choicelist', '=y').lower().replace('_', '-') 108 | if multiconfig_min: 109 | sdt_conf_str += '\n# Avoid errors in some baremetal configs as these layers may be present\n' 110 | sdt_conf_str += '# but are not used. Note the following lines are optional and can be\n' 111 | sdt_conf_str += '# safetly disabled.\n' 112 | sdt_conf_str += 'SKIP_META_VIRT_SANITY_CHECK = "1"\n' 113 | sdt_conf_str += 'SKIP_META_SECURITY_SANITY_CHECK = "1"\n' 114 | sdt_conf_str += 'SKIP_META_TPM_SANITY_CHECK = "1"\n' 115 | 116 | if not conf_file: 117 | if not petalinux: 118 | logger.note('To enable this, add the following to your local.conf:\n') 119 | logger.plain(sdt_conf_str) 120 | else: 121 | if not petalinux: 122 | logger.note('Configuration for local.conf written to %s' % 123 | conf_file) 124 | logger.debug(sdt_conf_str) 125 | common_utils.CreateFile(conf_file) 126 | common_utils.AddStrToFile(conf_file, sdt_conf_str, 'a+') 127 | 128 | 129 | def UpdateLocalConf(args, plnx_conf_file, machine_conf_file): 130 | builddir = '' 131 | hw_flow = args.hw_flow 132 | 133 | if 'BUILDDIR' in os.environ.keys(): 134 | builddir = os.environ['BUILDDIR'] 135 | if builddir: 136 | local_conf = os.path.join(builddir, 'conf', 'local.conf') 137 | if not os.path.isfile(local_conf): 138 | logger.debug('No local.conf file found in %s/conf directory to add .conf' 139 | ' file' % builddir) 140 | else: 141 | # Check if the build/xsa directory exist or not. 142 | # Copy XSA from HDF_PATH to ${TOPDIR}/xsa/machine_conf_file 143 | # directory if not --petalinux 144 | if not args.petalinux and hw_flow == 'xsct': 145 | xsapath = os.path.join(builddir, 'xsa', machine_conf_file) 146 | common_utils.CreateDir(xsapath) 147 | common_utils.CopyFile(args.hw_file, xsapath) 148 | 149 | localconf_strs = [] 150 | if hw_flow == 'sdt': 151 | localconf_strs += ['include conf/sdt-auto.conf'] 152 | if args.petalinux: 153 | conf_dir = os.path.join(builddir, 'conf') 154 | # Copy plnxtool.conf file to ${TOPDIR}/conf directory 155 | localconf_strs += ['include conf/plnxtool.conf'] 156 | for file_str in localconf_strs: 157 | SearchStrInFile(local_conf, file_str, remove_if_exists=True) 158 | with open(local_conf, 'a') as local_conf_f: 159 | local_conf_f.write(file_str + '\n') 160 | local_conf_f.close() 161 | -------------------------------------------------------------------------------- /gen-machine-scripts/libs/u-boot_bsp.tcl: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | 6 | proc uboot_common {kconfig_fid} { 7 | uboot_set_kconfig_value $kconfig_fid "BOOTARGS" "n" 8 | uboot_set_kconfig_value $kconfig_fid "USE_BOOTARGS" "n" 9 | } 10 | 11 | # get the interrupt controller that is connected to the 12 | proc get_current_ip_intc {target_ip} { 13 | set proc_handle [hsi get_cells -hier $target_ip] 14 | set proc_ips [hsi::utils::get_proc_slave_periphs $proc_handle] 15 | foreach ip $proc_ips { 16 | if { [hsi::utils::is_intr_cntrl $ip] == 1 } { 17 | set intr_pin [hsi get_pins -of_objects $ip "Irq"] 18 | if { [llength $intr_pin] != 0} { 19 | set sink_pins [hsi::utils::get_sink_pins $intr_pin] 20 | foreach sink_pin $sink_pins { 21 | set connected_ip [hsi get_cells -of_objects $sink_pin] 22 | set ip_name [hsi get_property NAME $connected_ip] 23 | if { [string match -nocase "ip_name" "$target_ip"] == 0 } { 24 | return $ip 25 | } 26 | } 27 | } 28 | } 29 | } 30 | return "" 31 | } 32 | 33 | proc uboot_config_gen {} { 34 | global target_app target_cpu 35 | global out_dir 36 | global kconfig_dict 37 | set platform_config_h "$out_dir/platform-auto.h" 38 | set kconfig_f "$out_dir/config.cfg" 39 | set kconfig_fid [open "${kconfig_f}" "w+"] 40 | set cpu_arch [get_sw_proc_arch $target_cpu] 41 | 42 | uboot_hw_config_gen ${kconfig_fid} 43 | uboot_common ${kconfig_fid} 44 | 45 | uboot_set_kconfig_value $kconfig_fid BOOTDELAY 4 46 | if { "${cpu_arch}" == "microblaze" } { 47 | # set uboot text base 48 | set mem_base [dict get $kconfig_dict memory baseaddr] 49 | set uboot_offset [dict get $kconfig_dict memory "u__boot_textbase_offset"] 50 | set uboot_textbase $uboot_offset 51 | # get cpu version 52 | set vlnv [hsi get_property "VLNV" [hsi get_cells -hier $target_cpu]] 53 | set cpu_ver [lindex [split $vlnv ":"] 3] 54 | uboot_set_kconfig_value $kconfig_fid XILINX_MICROBLAZE0_HW_VER "\\\"$cpu_ver\\\"" 55 | uboot_set_kconfig_value $kconfig_fid TEXT_BASE $uboot_textbase 56 | uboot_set_kconfig_value $kconfig_fid SYS_PROMPT "\\\"U-Boot>\\\"" 57 | } 58 | if { [dict exists $kconfig_dict subsys_conf autoconfig_u__boot]} { 59 | uboot_set_kconfig_value $kconfig_fid SYS_CONFIG_NAME "\\\"platform-top\\\"" 60 | uboot_set_kconfig_value $kconfig_fid BOOT_SCRIPT_OFFSET "0x1F00000" 61 | } else { 62 | uboot_set_kconfig_value $kconfig_fid SYS_CONFIG_NAME 0 1 63 | } 64 | 65 | foreach config "SPL I2C_EEPROM CMD_EEPROM SYS_I2C_EEPROM_ADDR_OVERFLOW SYS_I2C_EEPROM_ADDR" { 66 | uboot_set_kconfig_value $kconfig_fid $config "n" 67 | } 68 | close $kconfig_fid 69 | } 70 | 71 | proc uboot_conf_define {fid name value} { 72 | global conf_prefix 73 | if {[string equal -nocase $name ""]} { 74 | puts $fid "${conf_prefix}$value" 75 | } elseif {[string equal -nocase $value ""]} { 76 | puts $fid "${conf_prefix}$name" 77 | } else { 78 | puts $fid "${conf_prefix}$name\t$value" 79 | } 80 | } 81 | 82 | proc uboot_conf_undefine {fid name} { 83 | puts $fid "#ifdef $name" 84 | puts $fid "# undef $name" 85 | puts $fid "#endif" 86 | } 87 | 88 | 89 | proc uboot_set_kconfig_value {fid names {vals y} {del 0}} { 90 | seek ${fid} 0 start 91 | set lines [split [read ${fid}] "\n"] 92 | if { "${vals}" == "y" } { 93 | set len [llength ${names}] 94 | set vals [lrepeat $len y] 95 | debug "uboot_set_kconfig_value" "len : $len" 96 | } 97 | debug "uboot_set_kconfig_value" "vals : $vals $names : $names" 98 | foreach n ${names} v ${vals} { 99 | set n [regsub "^CONFIG_" $n ""] 100 | set idx [lsearch -regex -all ${lines} "CONFIG_${n}\[ =\]"] 101 | if { [llength ${idx}] > 0 } { 102 | set i [lindex ${idx} 0] 103 | set lines [lreplace $lines $i $i] 104 | } 105 | if { "${v}" == "n" } { 106 | set rline "\# CONFIG_${n} is not set" 107 | } elseif {$del == 1} { 108 | #DO nothing 109 | } else { 110 | set rline "CONFIG_${n}=${v}" 111 | } 112 | if {$del == 0} { 113 | set lines [lappend lines "${rline}"] 114 | } 115 | } 116 | seek ${fid} 0 start 117 | chan truncate ${fid} 0 118 | puts ${fid} [join ${lines} "\n"] 119 | } 120 | 121 | proc uboot_data_find_kconfig {dict_var} { 122 | if { [catch {set tmp_keys [dict keys ${dict_var}]}]} { 123 | return 124 | } 125 | set opt_list {} 126 | foreach k ${tmp_keys} { 127 | if { "${k}" == "uboot_config" } { 128 | foreach o [dict get ${dict_var} "${k}"] { 129 | set o [lindex [split $o "="] 0] 130 | lappend opt_list ${o} 131 | } 132 | } else { 133 | foreach o [uboot_data_find_kconfig [dict get ${dict_var} "${k}"]] { 134 | lappend opt_list ${o} 135 | } 136 | } 137 | } 138 | return ${opt_list} 139 | } 140 | 141 | proc uboot_kconfig_disable {fid} { 142 | set opt_list {} 143 | set mapping_list {serial_dict flash_dict ethernet_dict processor_dict} 144 | global serial_dict processor_dict 145 | global flash_dict ethernet_dict 146 | foreach iptype ${mapping_list} { 147 | eval "set mapping_dict \$${iptype}" 148 | foreach o [uboot_data_find_kconfig ${mapping_dict}] { 149 | lappend opt_list ${o} 150 | } 151 | } 152 | seek ${fid} 0 start 153 | set lines [split [read ${fid}] "\n"] 154 | foreach o ${opt_list} { 155 | set idx [lsearch -regex -all ${lines} "${o}="] 156 | if { [llength ${idx}] > 0 } { 157 | foreach d ${idx} { 158 | set lines [lreplace $lines $idx $idx ] 159 | } 160 | } 161 | set idx [lsearch -regex -all ${lines} "${o} is not"] 162 | if { [llength ${idx}] > 0 } { 163 | continue 164 | } else { 165 | set lines [lappend lines "\# ${o} is not set"] 166 | } 167 | } 168 | seek ${fid} 0 start 169 | chan truncate ${fid} 0 170 | puts ${fid} [join ${lines} "\n"] 171 | } 172 | 173 | 174 | proc uboot_hw_config_gen {kconfig_fid} { 175 | global timer_dict dict_lut def_ip_list 176 | 177 | uboot_kconfig_disable ${kconfig_fid} 178 | foreach ip $def_ip_list { 179 | if {[string equal -nocase "simple" $ip]} { 180 | set ip_name simple 181 | } elseif {[string equal -nocase "chip_device" $ip]} { 182 | set ip_name $ip 183 | } else { 184 | set ip_obj [hsi get_cell -hier $ip] 185 | set ip_name [hsi get_property IP_NAME $ip_obj] 186 | } 187 | if {[dict exist $dict_lut $ip]} { 188 | set dict_name [dict get $dict_lut $ip type] 189 | eval "global ${dict_name}_dict" 190 | eval "set mapping_dict \$${dict_name}_dict" 191 | } else { 192 | global misc_dict 193 | set mapping_dict misc_dict 194 | } 195 | 196 | if {[dict exist $mapping_dict $ip_name]} { 197 | debug "1" "got ip $ip_name" 198 | db_gen_config ${kconfig_fid} $ip $mapping_dict "uboot_config" 199 | } 200 | } 201 | db_gen_config ${kconfig_fid} "chip_device" $mapping_dict "uboot_config" 202 | 203 | } 204 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/config_versal-2ve-2vm: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Automatically generated file; DO NOT EDIT. 7 | # linux System Configuration 8 | # 9 | CONFIG_SUBSYSTEM_TYPE_LINUX=y 10 | CONFIG_SYSTEM_VERSAL-2VE-2VM=y 11 | 12 | # 13 | # linux Components Selection 14 | # 15 | CONFIG_SUBSYSTEM_COMPONENT_DEVICE__TREE_NAME_DEVICE__TREE__GENERATOR=y 16 | CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_U__BOOT__PLNX=y 17 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE is not set 18 | # CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_NONE is not set 19 | CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_TF-A=y 20 | # CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE is not set 21 | # CONFIG_SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_NONE is not set 22 | CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_XLNX__4___4=y 23 | # CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_INSTANCE_KERNEL_NAME_REMOTE is not set 24 | CONFIG_SUBSYSTEM_COMPONENT_ROOTFS_NAME_PETALINUX__ROOTFS=y 25 | 26 | CONFIG_SUBSYSTEM_COMPONENT_PLM_NAME_PLM=y 27 | # CONFIG_SUBSYSTEM_COMPONENT_PLM_NAME_REMOTE is not set 28 | # CONFIG_SUBSYSTEM_COMPONENT_PLM_NAME_EXT__LOCAL__SRC is not set 29 | CONFIG_SUBSYSTEM_COMPONENT_PSM__FIRMWARE_NAME_PSM__FIRMWARE=y 30 | # CONFIG_SUBSYSTEM_COMPONENT_PSM__FIRMWARE_NAME_REMOTE is not set 31 | # CONFIG_SUBSYSTEM_COMPONENT_PSM__FIRMWARE_NAME_EXT__LOCAL__SRC is not set 32 | 33 | # 34 | # Generic Components 35 | # 36 | 37 | # 38 | # Auto Config Settings 39 | # 40 | CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE=y 41 | # CONFIG_SUBSYSTEM_DEVICE_TREE_MANUAL_INCLUDE is not set 42 | CONFIG_SUBSYSTEM_PROCESSOR_PSU_CORTEXA72_0_SELECT=y 43 | CONFIG_SUBSYSTEM_ARCH_AARCH64=y 44 | 45 | # 46 | # Serial Settings 47 | # 48 | CONFIG_SUBSYSTEM_PLM_SERIAL_PSV_SBSAUART_0_SELECT=y 49 | CONFIG_SUBSYSTEM_TF-A_SERIAL_PSV_SBSAUART_0_SELECT=y 50 | CONFIG_SUBSYSTEM_SERIAL_PSV_SBSAUART_0_SELECT=y 51 | # 52 | # 53 | 54 | # 55 | # Ethernet Settings 56 | # 57 | CONFIG_SUBSYSTEM_ETHERNET_PSV_ETHERNET_0_SELECT=y 58 | CONFIG_SUBSYSTEM_ETHERNET_PSV_ETHERNET_0_MAC="ff:ff:ff:ff:ff:ff" 59 | CONFIG_SUBSYSTEM_ETHERNET_PSV_ETHERNET_0_USE_DHCP=y 60 | # CONFIG_SUBSYSTEM_ETHERNET_MANUAL_SELECT is not set 61 | 62 | # 63 | # Flash Settings 64 | # 65 | CONFIG_SUBSYSTEM_FLASH_PSV_PMC_QSPI_0_BANKLESS_SELECT=y 66 | # CONFIG_SUBSYSTEM_FLASH_MANUAL_SELECT is not set 67 | 68 | # 69 | # SD/SDIO Settings 70 | # 71 | # CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_0_SELECT is not set 72 | # CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_1_SELECT is not set 73 | CONFIG_SUBSYSTEM_PRIMARY_SD_MANUAL_SELECT=y 74 | CONFIG_SUBSYSTEM_SD_PSU_SD_0_SELECT=y 75 | CONFIG_SUBSYSTEM_SD_PSU_SD_1_SELECT=y 76 | 77 | # 78 | # RTC Settings 79 | # 80 | CONFIG_SUBSYSTEM_RTC_MANUAL_SELECT=y 81 | CONFIG_SUBSYSTEM_I2C_PSU_I2C_0_SELECT=y 82 | CONFIG_SUBSYSTEM_I2C_PSU_I2C_1_SELECT=y 83 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG=y 84 | 85 | # 86 | # boot image settings 87 | # 88 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_FLASH_SELECT is not set 89 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_SD_SELECT=y 90 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_MANUAL_SELECT is not set 91 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_IMAGE_NAME="BOOT.BIN" 92 | 93 | # 94 | # u-boot env partition settings 95 | # 96 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_FLASH_SELECT=y 97 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_MANUAL_SELECT is not set 98 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_PART_NAME="bootenv" 99 | 100 | # 101 | # kernel image settings 102 | # 103 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_FLASH_SELECT is not set 104 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_SD_SELECT=y 105 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_ETHERNET_SELECT is not set 106 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_MANUAL_SELECT is not set 107 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_IMAGE_NAME="image.ub" 108 | 109 | # 110 | # jffs2 rootfs image settings 111 | # 112 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_JFFS2_MEDIA_FLASH_SELECT=y 113 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_JFFS2_MEDIA_MANUAL_SELECT is not set 114 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_JFFS2_PART_NAME="jffs2" 115 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_JFFS2_IMAGE_NAME="rootfs.jffs2" 116 | 117 | # 118 | # dtb image settings 119 | # 120 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_BOOTIMAGE_SELECT=y 121 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_FLASH_SELECT is not set 122 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_SD_SELECT is not set 123 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_ETHERNET_SELECT is not set 124 | # CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_MANUAL_SELECT is not set 125 | CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_IMAGE_NAME="system.dtb" 126 | CONFIG_SUBSYSTEM_ENDIAN_LITTLE=y 127 | CONFIG_SUBSYSTEM_DEVICETREE_COMPILER_FLAGS="-@" 128 | 129 | # 130 | # Kernel Bootargs 131 | # 132 | CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="console=ttyAMA0 earlycon=pl011,mmio32,0xFF000000,115200n8" 133 | 134 | # 135 | # ARM Trusted Firmware Compilation Configuration 136 | # 137 | CONFIG_SUBSYSTEM_TF-A_EXTRA_COMPILER_FLAGS="" 138 | 139 | # 140 | # u-boot Configuration 141 | # 142 | CONFIG_SUBSYSTEM_UBOOT_CONFIG_TARGET="amd_versal2_virt_defconfig" 143 | 144 | # 145 | # Image Packaging Configuration 146 | # 147 | # CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS is not set 148 | CONFIG_SUBSYSTEM_ROOTFS_INITRD=y 149 | # CONFIG_SUBSYSTEM_ROOTFS_JFFS2 is not set 150 | # CONFIG_SUBSYSTEM_ROOTFS_NFS is not set 151 | # CONFIG_SUBSYSTEM_ROOTFS_EXT4 is not set 152 | # CONFIG_SUBSYSTEM_ROOTFS_OTHER is not set 153 | CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub" 154 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_NONE is not set 155 | CONFIG_SUBSYSTEM_UIMAGE_HASH_CRC32=y 156 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_SHA1 is not set 157 | # CONFIG_SUBSYSTEM_UIMAGE_HASH_BOTH is not set 158 | CONFIG_SUBSYSTEM_COMPRESS_IMAGE=y 159 | CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000 160 | CONFIG_SUBSYSTEM_COPY_TO_TFTPBOOT=y 161 | CONFIG_SUBSYSTEM_TFTPBOOT_DIR="/tftpboot" 162 | 163 | # 164 | # Firmware Version Configuration 165 | # 166 | CONFIG_SUBSYSTEM_HOSTNAME="versal-2ve-2vm" 167 | CONFIG_SUBSYSTEM_PRODUCT="versal-2ve-2vm" 168 | CONFIG_SUBSYSTEM_FW_VERSION="1.00" 169 | CONFIG_SUBSYSTEM_MACHINE_NAME="template" 170 | # 171 | # Yocto Settings 172 | # 173 | CONFIG_TMP_DIR_LOCATION="${TOPDIR}/tmp" 174 | CONFIG_PRE_MIRROR_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_MAJOR_VER}/downloads" 175 | CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="https://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_MAJOR_VER}/aarch64/sstate-cache" 176 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.bootcompselection: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | 6 | if SUBSYSTEM_ARCH_ARM || SUBSYSTEM_ARCH_AARCH64 7 | 8 | menu "Boot Components Selection" 9 | 10 | if SYSTEM_VERSAL || SYSTEM_VERSAL-2VE-2VM 11 | choice 12 | prompt "PLM" 13 | config SUBSYSTEM_COMPONENT_PLM_FROM_SOURCE 14 | bool "PLM From Source" 15 | help 16 | Use the Embeddedsw Source code to build the PLM. 17 | 18 | config SUBSYSTEM_COMPONENT_PLM_FROM_BASE_PDI 19 | bool "PLM From Base PDI" 20 | help 21 | Use the PLM comes from Base PDI instead of built one. 22 | No additional plm elf will be packed as part of boot.bin. 23 | 24 | config SUBSYSTEM_COMPONENT_PLM_FROM_SDT_PATH 25 | bool "PLM From SDT Path" 26 | help 27 | Use the PLM comes from SDT dir/artifactory instead of built one. 28 | 29 | config SUBSYSTEM_COMPONENT_PLM_FROM_LOCAL_PATH 30 | bool "PLM From local Path" 31 | help 32 | Use the PLM from specified local path instead of build one. 33 | endchoice 34 | 35 | if SUBSYSTEM_COMPONENT_PLM_FROM_SDT_PATH 36 | config SUBSYSTEM_COMPONENT_PLM_ELF_NAME 37 | string "PLM elf File Name" 38 | default "plm.elf" 39 | help 40 | Specify the Plm elf file name from System Device Tree Directory. 41 | endif 42 | 43 | if SUBSYSTEM_COMPONENT_PLM_FROM_LOCAL_PATH 44 | config SUBSYSTEM_COMPONENT_PLM_ELF_PATH 45 | string "PLM elf File Path" 46 | default "" 47 | help 48 | Specify Full Path of Plm elf file. Ex: /home//plm.elf. 49 | endif 50 | endif 51 | 52 | if SYSTEM_VERSAL 53 | choice 54 | prompt "PSMFW" 55 | config SUBSYSTEM_COMPONENT_PSMFW_FROM_SOURCE 56 | bool "PSMFW From Source" 57 | help 58 | Use the Embeddedsw Source code to build the PSMFW. 59 | 60 | config SUBSYSTEM_COMPONENT_PSMFW_FROM_BASE_PDI 61 | bool "PSMFW From Base PDI" 62 | help 63 | Use the PSMFW comes from Base PDI instead of built one. 64 | No additional psmfw elf will be packed as part of boot.bin. 65 | 66 | config SUBSYSTEM_COMPONENT_PSMFW_FROM_SDT_PATH 67 | bool "PSMFW From SDT Path" 68 | help 69 | Use the PSMFW comes from SDT dir/artifactory instead of built one. 70 | 71 | config SUBSYSTEM_COMPONENT_PSMFW_FROM_LOCAL_PATH 72 | bool "PSMFW From local Path" 73 | help 74 | Use the PSMFW from specified local path instead of build one. 75 | 76 | endchoice 77 | 78 | if SUBSYSTEM_COMPONENT_PSMFW_FROM_SDT_PATH 79 | config SUBSYSTEM_COMPONENT_PSMFW_ELF_NAME 80 | string "PSMFW elf File Name" 81 | default "psmfw.elf" 82 | help 83 | Specify the Psm elf file name from System Device Tree Directory. 84 | endif 85 | 86 | if SUBSYSTEM_COMPONENT_PSMFW_FROM_LOCAL_PATH 87 | config SUBSYSTEM_COMPONENT_PSMFW_ELF_PATH 88 | string "PSMFW elf File Path" 89 | default "" 90 | help 91 | Specify Full Path of Psm elf file. Ex: /home//psmfw.elf. 92 | endif 93 | endif 94 | 95 | if SYSTEM_VERSAL-2VE-2VM 96 | choice 97 | prompt "ASU" 98 | config SUBSYSTEM_COMPONENT_ASU_FROM_SOURCE 99 | bool "ASU From Source" 100 | help 101 | Use the Embeddedsw Source code to build the ASU. 102 | 103 | config SUBSYSTEM_COMPONENT_ASU_FROM_BASE_PDI 104 | bool "ASU From Base PDI" 105 | help 106 | Use the ASU comes from Base PDI instead of built one. 107 | No additional asu elf will be packed as part of boot.bin. 108 | 109 | config SUBSYSTEM_COMPONENT_ASU_FROM_SDT_PATH 110 | bool "ASU From SDT Path" 111 | help 112 | Use the ASU comes from SDT dir/artifactory instead of built one. 113 | 114 | config SUBSYSTEM_COMPONENT_ASU_FROM_LOCAL_PATH 115 | bool "ASU From local Path" 116 | help 117 | Use the ASU from specified local path instead of build one. 118 | 119 | endchoice 120 | 121 | if SUBSYSTEM_COMPONENT_ASU_FROM_SDT_PATH 122 | config SUBSYSTEM_COMPONENT_ASU_ELF_NAME 123 | string "ASU elf File Name" 124 | default "asufw.elf" 125 | help 126 | Specify the Asu elf file name from System Device Tree Directory. 127 | endif 128 | 129 | if SUBSYSTEM_COMPONENT_ASU_FROM_LOCAL_PATH 130 | config SUBSYSTEM_COMPONENT_ASU_ELF_PATH 131 | string "ASU elf File Path" 132 | default "" 133 | help 134 | Specify Full Path of Asu elf file. Ex: /home//asufw.elf. 135 | endif 136 | endif 137 | 138 | if SUBSYSTEM_ARCH_ARM || SYSTEM_ZYNQMP 139 | choice 140 | prompt "FSBL" 141 | config SUBSYSTEM_COMPONENT_FSBL_FROM_SOURCE 142 | bool "FSBL From Source" 143 | help 144 | Use the Embeddedsw Source code to build the FSBL. 145 | 146 | config SUBSYSTEM_COMPONENT_FSBL_FROM_SDT_PATH 147 | bool "FSBL From SDT Path" 148 | help 149 | Use the FSBL comes from SDT dir/artifactory instead of built one. 150 | 151 | config SUBSYSTEM_COMPONENT_FSBL_FROM_LOCAL_PATH 152 | bool "FSBL From Local Path" 153 | help 154 | Use the FSBL from specified local path instead of build one. 155 | endchoice 156 | 157 | if SUBSYSTEM_COMPONENT_FSBL_FROM_SDT_PATH 158 | config SUBSYSTEM_COMPONENT_FSBL_ELF_NAME 159 | string "FSBL elf File Name" 160 | default "fsbl.elf" 161 | help 162 | Specify the FSBL elf file name from System Device Tree Directory. 163 | endif 164 | 165 | if SUBSYSTEM_COMPONENT_FSBL_FROM_LOCAL_PATH 166 | config SUBSYSTEM_COMPONENT_FSBL_ELF_PATH 167 | string "FSBL elf File Path" 168 | default "" 169 | help 170 | Specify Full Path of FSBL elf file. Ex: /home//fsbl.elf. 171 | endif 172 | endif 173 | 174 | if SYSTEM_ZYNQMP 175 | choice 176 | prompt "PMUFW" 177 | config SUBSYSTEM_COMPONENT_PMUFW_FROM_SOURCE 178 | bool "PMUFW From Source" 179 | help 180 | Use the Embeddedsw Source code to build the PMUFW. 181 | 182 | config SUBSYSTEM_COMPONENT_PMUFW_FROM_SDT_PATH 183 | bool "PMUFW From SDT Path" 184 | help 185 | Use the PMUFW comes from SDT dir/artifactory instead of built one. 186 | 187 | config SUBSYSTEM_COMPONENT_PMUFW_FROM_LOCAL_PATH 188 | bool "PMUFW From Local Path" 189 | help 190 | Use the PMUFW from specified local path instead of build one. 191 | endchoice 192 | 193 | if SUBSYSTEM_COMPONENT_PMUFW_FROM_SDT_PATH 194 | config SUBSYSTEM_COMPONENT_PMUFW_ELF_NAME 195 | string "PMUFW elf File Name" 196 | default "pmufw.elf" 197 | help 198 | Specify the PMUFW elf file name from System Device Tree Directory. 199 | endif 200 | 201 | if SUBSYSTEM_COMPONENT_PMUFW_FROM_LOCAL_PATH 202 | config SUBSYSTEM_COMPONENT_PMUFW_ELF_PATH 203 | string "PMUFW elf File Path" 204 | default "" 205 | help 206 | Specify Full Path of PMUFW elf file. Ex: /home//pmufw.elf. 207 | endif 208 | endif 209 | 210 | endmenu 211 | 212 | endif 213 | -------------------------------------------------------------------------------- /lib/xilinx_mirrors.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright (C) 2021-2022, Xilinx, Inc. All rights reserved. 4 | # Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 5 | # 6 | # Author: 7 | # Raju Kumar Pothuraju 8 | # 9 | # SPDX-License-Identifier: MIT 10 | 11 | import common_utils 12 | import os 13 | import re 14 | import shutil 15 | 16 | 17 | def ExpandMirrors(mirror_url): 18 | urls = '\\\n' 19 | urls += '\tcvs://.*/.* %s \\\n' % mirror_url 20 | urls += '\tsvn://.*/.* %s \\\n' % mirror_url 21 | urls += '\tgit://.*/.* %s \\\n' % mirror_url 22 | urls += '\tgitsm://.*/.* %s \\\n' % mirror_url 23 | urls += '\thg://.*/.* %s \\\n' % mirror_url 24 | urls += '\tbzr://.*/.* %s \\\n' % mirror_url 25 | urls += '\tp4://.*/.* %s \\\n' % mirror_url 26 | urls += '\tosc://.*/.* %s \\\n' % mirror_url 27 | urls += '\thttps?://.*/.* %s \\\n' % mirror_url 28 | urls += '\tftp://.*/.* %s \\\n' % mirror_url 29 | urls += '\tnpm://.*/?.* %s \\\n' % mirror_url 30 | urls += '\ts3://.*/.* %s \\\n' % mirror_url 31 | urls += '\tcrate://.*/.* %s \\\n' % mirror_url 32 | return urls 33 | 34 | 35 | def GenerateSiteConf(args, arch, xilinx_network): 36 | if xilinx_network and 'PETALINUX' in os.environ.keys(): 37 | site_conf_path = os.path.join(args.config_dir, 'site.conf') 38 | buildfile_path = os.path.realpath(os.path.join( 39 | os.environ['PETALINUX'], '../../commitids/dep.conf')) 40 | sstate_path = '' 41 | downloads_path = '' 42 | if os.path.exists(buildfile_path): 43 | with open(buildfile_path, 'r') as buildfile_path_f: 44 | lines = buildfile_path_f.readlines() 45 | buildfile_path_f.close() 46 | for line in lines: 47 | if re.search('^sstate_path', line): 48 | sstate_path = line.split(':')[1] 49 | elif re.search('^downloads_path', line): 50 | downloads_path = line.split(':')[1] 51 | 52 | siteconf_string = '' 53 | if sstate_path and downloads_path: 54 | siteconf_string += 'SSTATE_MIRRORS:prepend = " \\\n' 55 | siteconf_string += '\tfile://.* file://%s/PATH \\n \\\n' % ( 56 | os.path.join(sstate_path.strip(), arch)) 57 | if 'XILINX_INT_SSTATES' in os.environ.keys(): 58 | siteconf_string += '\tfile://.* %s/PATH \\n"\n' % ( 59 | os.path.join(os.environ['XILINX_INT_SSTATES'], arch)) 60 | siteconf_string += 'SOURCE_MIRROR_URL = "file://%s"\n' % downloads_path.strip() 61 | if 'XILINX_INT_DOWNLOADS' in os.environ.keys(): 62 | siteconf_string += 'PREMIRRORS:prepend = "%s"\n' % ExpandMirrors( 63 | os.environ['XILINX_INT_DOWNLOADS']) 64 | else: 65 | if 'XILINX_INT_SSTATES' in os.environ.keys(): 66 | siteconf_string += 'SSTATE_MIRRORS:prepend = "file://.* %s/PATH \\n"\n' % ( 67 | os.path.join(os.environ['XILINX_INT_SSTATES'], arch)) 68 | if 'XILINX_INT_DOWNLOADS' in os.environ.keys(): 69 | siteconf_string += 'SOURCE_MIRROR_URL = "%s"\n' % os.environ['XILINX_INT_DOWNLOADS'] 70 | 71 | if siteconf_string: 72 | with open(site_conf_path, 'w') as site_conf_f: 73 | site_conf_f.write(siteconf_string) 74 | site_conf_f.close() 75 | 76 | 77 | def GenerateMirrors(args, arch): 78 | nslookup_exe = common_utils.check_tool('nslookup') 79 | system_conffile = os.path.join(args.output, 'config') 80 | if not nslookup_exe or not 'XILINX_INT_SITE' in os.environ.keys(): 81 | xilinx_network = False 82 | else: 83 | cmd = 'nslookup -timeout=10 %s | grep "Address" | \ 84 | awk \'{print $2}\' | sed -n 2p' % os.environ['XILINX_INT_SITE'] 85 | stdout, stderr = common_utils.RunCmd(cmd, args.output, shell=True) 86 | xilinx_network = False 87 | if stdout: 88 | xilinx_network = True 89 | mirrors_string = '' 90 | pre_mirror_url = common_utils.GetConfigValue( 91 | 'CONFIG_PRE_MIRROR_URL', system_conffile) 92 | if 'PETALINUX_VER' in os.environ.keys(): 93 | plnx_ver = os.environ['PETALINUX_VER'] 94 | else: 95 | plnx_ver = '2024.2' 96 | default_downloads_url = 'https://petalinux.xilinx.com/sswreleases/rel-v%s/downloads' % ( 97 | plnx_ver) 98 | # Add Download mirrors 99 | if pre_mirror_url != default_downloads_url: 100 | # if user configured different premirrors than default 101 | if not xilinx_network: 102 | mirrors_string += 'SOURCE_MIRROR_URL = "%s"\n' % pre_mirror_url 103 | # Add Pre-mirrors from petalinux.xilinx.com 104 | # if user configured different downloads' 105 | mirrors_string += 'PREMIRRORS = "%s"\n' % ExpandMirrors( 106 | default_downloads_url) 107 | else: 108 | mirrors_string += '# Add Pre-mirrors from config\n' 109 | mirrors_string += 'PREMIRRORS = "%s"\n' % ExpandMirrors( 110 | pre_mirror_url) 111 | # Add Pre-mirrors from petalinux.xilinx.com 112 | # if user configured different downloads' 113 | mirrors_string += 'PREMIRRORS:append = "%s"\n' % ExpandMirrors( 114 | default_downloads_url) 115 | else: 116 | if not xilinx_network: 117 | mirrors_string += 'SOURCE_MIRROR_URL = "%s"\n' % pre_mirror_url 118 | else: 119 | mirrors_string += '# Add Pre-mirrors from config\n' 120 | mirrors_string += 'PREMIRRORS = "%s"\n' % ExpandMirrors( 121 | pre_mirror_url) 122 | 123 | # Add SSTATE mirrors 124 | local_sstate_url = common_utils.GetConfigValue( 125 | 'CONFIG_YOCTO_LOCAL_SSTATE_FEEDS_URL', system_conffile) 126 | network_sstate = common_utils.GetConfigValue( 127 | 'CONFIG_YOCTO_NETWORK_SSTATE_FEEDS', system_conffile) 128 | network_sstate_url = common_utils.GetConfigValue( 129 | 'CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL', system_conffile) 130 | if local_sstate_url: 131 | local_sstate_url = '\tfile://.* file://%s/PATH \\\n' % local_sstate_url 132 | else: 133 | local_sstate_url = '' 134 | 135 | if network_sstate == "y" and network_sstate_url: 136 | network_sstate_url = '\tfile://.* %s/PATH;downloadfilename=PATH \\n \\\n' % network_sstate_url 137 | else: 138 | network_sstate_url = '' 139 | 140 | mirrors_string += '# Sstate mirror settings\n' 141 | mirrors_string += 'SSTATE_MIRRORS = " \\\n%s%s"\n' % ( 142 | local_sstate_url, network_sstate_url) 143 | 144 | GenerateSiteConf(args, arch, xilinx_network) 145 | return mirrors_string 146 | -------------------------------------------------------------------------------- /docs/usage.rst: -------------------------------------------------------------------------------- 1 | .. Copyright (C) 2022-2025, Advanced Micro Devices, Inc. All rights reserved. 2 | 3 | .. SPDX-License-Identifier: MIT 4 | 5 | Gen Machine Conf Usage Introduction 6 | ----------------------------------- 7 | 8 | gen-machine-conf has two sub commands parse-xsa and parse-sdt you must 9 | use one or the other. Most options work for either sub command but some 10 | are only available/required in one sub command or the other. 11 | 12 | gen-machine-conf is capible of auto-detecting the subcommand based on 13 | the file/URI specified with --hw-description. 14 | If a .xsa file is specified, it uses the subcommand parse-xsa, and 15 | if system-top.dts is specified, it uses the subcommand parse-sdt. 16 | 17 | If a directory is specified and it contains both a .xsa file and 18 | system-top.dts, the tool will use system-top.dts (therefore assuming parse-sdt). 19 | 20 | gen-machine-conf usage 21 | ---------------------- 22 | 23 | .. code-block:: console 24 | 25 | $ gen-machine-conf -h 26 | usage: gen-machine-conf [--template Template yaml file] [--hw-description [/.xsa] or ] 27 | [--soc-family {microblaze,zynq,zynqmp,versal,versal-2ve-2vm}] [--soc-variant SOC_VARIANT] [--machine-name MACHINE] 28 | [-c ] [-r REQUIRE_MACHINE] [-O MACHINE_OVERRIDES] [--output OUTPUT] [--native-sysroot NATIVE_SYSROOT] 29 | [--menuconfig [{project,rootfs}]] [--petalinux] [--add-config [CONFIG_=y]] [--add-rootfsconfig ADD_ROOTFSCONFIG] [-D] 30 | [-h] [-v] 31 | ... 32 | 33 | PetaLinux/Yocto Machine Configuration File generation tool 34 | 35 | required arguments: 36 | --hw-description [/.xsa] or 37 | Specify Hardware(xsa) file or System Device-tree Directory 38 | 39 | options: 40 | --template Template yaml file 41 | Yaml template file 42 | --soc-family {microblaze,zynq,zynqmp,versal,versal-2ve-2vm} 43 | SOC family type from choice list (usually auto detected). 44 | --soc-variant SOC_VARIANT 45 | SOC Variant: Ex: cg, dr, eg, ev, ai-prime, premium (usually auto detected). 46 | --machine-name MACHINE 47 | Provide a name to generate machine configuration 48 | -c , --config-dir 49 | Location of the build conf directory 50 | -r REQUIRE_MACHINE, --require-machine REQUIRE_MACHINE 51 | This machine will be required, instead of the generic machine if defined 52 | -O MACHINE_OVERRIDES, --machine-overrides MACHINE_OVERRIDES 53 | Provide additional overrides to the generated machine 54 | --output OUTPUT Output directory name 55 | --native-sysroot NATIVE_SYSROOT 56 | Native sysroot path to use the mconf/conf or lopper commands. 57 | --menuconfig [{project,rootfs}] 58 | UI menuconfig option to update configuration(default is project). 59 | project - To update System Level configurations 60 | rootfs - To update Rootfs configurations 61 | --petalinux Generate Rootfs and PetaLinux Tool conf files and update the build/local.conf file with generated .conf files. 62 | --add-config [CONFIG_=y] 63 | Specify config macro or file containing config macros to be added on top of default configs 64 | --add-rootfsconfig ADD_ROOTFSCONFIG 65 | Specify a file with list of package names to add into rootfs menu entry 66 | -D, --debug Enable debug output 67 | -h, --help show this help message and exit 68 | -v, --version show version information and exit 69 | 70 | subcommands: 71 | 72 | parse-sdt Parse System devicet-tree file and generate Yocto/PetaLinux configurations. 73 | parse-xsa Parse xsa file and generate Yocto/PetaLinux configurations. 74 | 75 | Use gen-machine-conf --help to get help on a specific command 76 | 77 | 78 | gen-machine-conf parse-xsa usage 79 | -------------------------------- 80 | The parse-xsa is the "older" way of getting hardware configuration 81 | information into Yocto. It uses the output of AMD Vivado™ Design Suite 82 | directly. 83 | 84 | .. code-block:: console 85 | 86 | $ gen-machine-conf parse-xsa -h 87 | usage: gen-machine-conf parse-xsa [--hw-description /.xsa] [other options] 88 | 89 | options: 90 | -h, --help show this help message and exit 91 | --xsct-tool [XSCT_TOOL_PATH] 92 | Vivado or Vitis XSCT path to use xsct commands (Optional if you are already have AMD tools in your path) 93 | -l , --localconf 94 | Write local.conf changes to this file 95 | --multiconfigfull Generate/Enable Full set of multiconfig .conf and .dts files. Default is minimal 96 | --multiconfigenable Enable multiconfig support. default is disabled. 97 | 98 | gen-machine-conf parse-sdt usage 99 | -------------------------------- 100 | The parse-sdt is the "newer" way of getting hardware configuration 101 | information into Yocto. It uses the output of AMD Vivado™ Design Suite 102 | after it has been processed by System Device Tree Generator. 103 | 104 | .. code-block:: console 105 | 106 | $ gen-machine-conf parse-sdt -h 107 | usage: gen-machine-conf parse-sdt [--hw-description ] [other options] 108 | 109 | options: 110 | -h, --help show this help message and exit 111 | -g {full,dfx}, --gen-pl-overlay {full,dfx} 112 | Generate pl overlay for full, dfx configuration using xlnx_overlay_pl_dt lopper script 113 | -d , --domain-file 114 | Path to domain file (.yaml) to use for generating the device tree. 115 | -i , --psu-init-path 116 | Path to psu_init or ps7_init files, defaults to system device tree output directory 117 | -p , --pl 118 | Path to pdi or bitstream file 119 | -l , --localconf 120 | Write local.conf changes to this file 121 | --multiconfigfull Generate/Enable Full set of multiconfig .conf and .dts files. Default is minimal. Search for CONFIG_YOCTO_BBMC prefix in 122 | --menuconfig to get the available multiconfig targets. 123 | --dts-path 124 | Absolute path or subdirectory of conf/dts to place DTS files in (usually auto detected from DTS) 125 | 126 | 127 | .. note:: 128 | 129 | When using gen-machine-conf in Yocto the SDT builds 130 | --soc-family arguments is not mandatory as the needed information 131 | is provided by the system device tree. 132 | -------------------------------------------------------------------------------- /gen-machine-scripts/petalinux_hsm.tcl: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | 6 | proc get_ipinfo {ipinfofile} { 7 | 8 | if { [catch {open "${ipinfofile}" r} ipinfof] } { 9 | error "Failed to open IP information file ${ipinfofile}." 10 | } 11 | 12 | set ipinfodata "" 13 | set previous_indent_level -1 14 | set key {} 15 | set ipdict [dict create] 16 | while {1} { 17 | if { [eof ${ipinfof}] > 0} { 18 | close ${ipinfof} 19 | break 20 | } 21 | set line [gets ${ipinfof}] 22 | incr linenum 23 | #regsub -all {\s+} $line { } line 24 | if { [regexp "^#.*" $line matched] == 1 || \ 25 | [regexp "^\s+#.*" $line matched] == 1 || \ 26 | [string compare -nocase [string trim $line] ""] <= 0 } { 27 | continue 28 | } 29 | set trimline [string trim ${line}] 30 | if { [regexp {^( )*[A-Za-z0-9_]+:.*} "${line}" matched] == 1} { 31 | set tmpkey [lindex [split ${trimline} ":"] 0] 32 | set tmpval [regsub "${tmpkey}:" "${trimline}" ""] 33 | set tmpkey [string trim "${tmpkey}"] 34 | set tmpval [string trim "${tmpval}"] 35 | set indent_level [regexp -all "( )" ${line}] 36 | if { [llength ${key}] > ${indent_level}} { 37 | set key [lreplace ${key} ${indent_level} end] 38 | } 39 | lappend key ${tmpkey} 40 | if { "${tmpval}" != ""} { 41 | dict set ipdict [join ${key}] "${tmpval}" 42 | } 43 | } 44 | } 45 | return ${ipdict} 46 | } 47 | 48 | proc get_primary_ip_kconfig {sysconfig ipclass} { 49 | # get baudrate from sysconfig 50 | if { [catch {open "${sysconfig}" r} sysconfhd] } { 51 | error "Failed to open system config file \"${sysconfig}\"." 52 | } 53 | if {${ipclass} == ""} { 54 | return 55 | } 56 | set upipclass [string toupper "${ipclass}"] 57 | set data [read ${sysconfhd}] 58 | close "${sysconfhd}" 59 | set lines [split "${data}" "\n"] 60 | set idx [lsearch -regexp ${lines} "^CONFIG_SUBSYSTEM_${upipclass}_(.*)_SELECT=y"] 61 | if {${idx} < 0} { 62 | return 63 | } 64 | 65 | set selectip [lindex ${lines} ${idx}] 66 | set ipstrmap [list "CONFIG_SUBSYSTEM_${upipclass}_" "" "_SELECT=y" ""] 67 | set selectip [string map ${ipstrmap} "${selectip}"] 68 | if {"${selectip}" == "MANUAL"} { 69 | return 70 | } else { 71 | return "${selectip}" 72 | } 73 | } 74 | 75 | proc get_partitions {sysconfig flash_kname} { 76 | if { "${flash_kname}" == ""} { 77 | return 78 | } 79 | # get partitions info from sysconfig 80 | if { [catch {open "${sysconfig}" r} sysconfhd] } { 81 | error "Failed to open system config file \"${sysconfig}\"." 82 | } 83 | set data [read ${sysconfhd}] 84 | close "${sysconfhd}" 85 | set lines [split "${data}" "\n"] 86 | # setup part offset list 87 | set part_sizes [lsearch -all -inline -regexp ${lines} "^CONFIG_SUBSYSTEM_FLASH_${flash_kname}_PART(.*)_SIZE="] 88 | if {[llength ${part_sizes}] == 0} { 89 | return 90 | } 91 | set partlength [llength ${part_sizes}] 92 | set lpsizes {} 93 | for {set i 0} {$i < ${partlength}} {incr i} { 94 | lappend lpsizes 0 95 | } 96 | set poffsets {0} 97 | set psize {} 98 | for {set i 0} {$i < ${partlength}} {incr i} { 99 | set tmppsize [lsearch -inline -regexp ${lines} "^CONFIG_SUBSYSTEM_FLASH_${flash_kname}_PART${i}_SIZE="] 100 | if {[llength ${tmppsize}] == 0} { 101 | error "Failed to get the parition size of partition $i." 102 | } 103 | set tmppsize [regsub -all {.*=} "${tmppsize}" {}] 104 | set next_offset [format "0x%x" [expr [lindex ${poffsets} ${i}] + ${tmppsize}]] 105 | lappend poffsets ${next_offset} 106 | lappend psize ${tmppsize} 107 | } 108 | 109 | # get part name 110 | set ret_part_offsets {} 111 | foreach p {fpga boot kernel dtb} { 112 | set upperp [string toupper "${p}"] 113 | set idx [lsearch -regexp ${lines} "^CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_${flash_kname}_PART_NAME="] 114 | set partname "${p}" 115 | if {${idx} >= 0} { 116 | set partname [lindex ${lines} ${idx}] 117 | set partname_rm_map [list "\"" "" "CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_${flash_kname}_PART_NAME=" ""] 118 | set partname [string map ${partname_rm_map} "${partname}"] 119 | } 120 | set part_id_str [lsearch -inline -regexp ${lines} "^CONFIG_SUBSYSTEM_FLASH_${flash_kname}_PART(.*)_NAME=\"(.*)${partname}\""] 121 | if { [llength ${part_id_str}] == 0} { 122 | continue 123 | } 124 | set act_part_name [lindex [split ${part_id_str} "\""] 1] 125 | set part_id_map [list "CONFIG_SUBSYSTEM_FLASH_${flash_kname}_PART" "" "_NAME=\"${act_part_name}\"" ""] 126 | set part_id [string map ${part_id_map} "${part_id_str}"] 127 | lappend ret_part_offsets "${partname}=[lindex ${poffsets} ${part_id}] [lindex ${psize} ${part_id}]" 128 | } 129 | return ${ret_part_offsets} 130 | } 131 | 132 | proc get_flash_width {sysconfig ipinfof hdf} { 133 | set retlist {} 134 | 135 | set flash_kname [get_primary_ip_kconfig "${sysconfig}" flash] 136 | set flash_name [string tolower [regsub -all {_BANK.*} "${flash_kname}" {}]] 137 | set flash_bank [regsub -all {.*_BANK} "${flash_kname}" {}] 138 | if { "${flash_kname}" == "" || "${flash_kname}" == "MANUAL"} { 139 | return 140 | } 141 | 142 | if { [catch {openhw "${hdf}"} msg] } { 143 | error "Failed to open the hardware description file \"${hdf}\"." 144 | } 145 | 146 | set ipdict [get_ipinfo "${ipinfof}"] 147 | set ipname [hsi get_property IP_NAME [hsi get_cell -hier "${flash_name}"]] 148 | if { "${ipname}" == ""} { 149 | error "Flash IP ${flash_name} is not in the hardware." 150 | } 151 | set flash_type [dict get ${ipdict} "${ipname} device_type flash flash_type"] 152 | if { "${flash_type}" != ""} { 153 | lappend retlist "flash_type=${flash_type}" 154 | } 155 | 156 | if { [catch {dict get ${ipdict} "${ipname} device_type flash bank_property bank_width"} flash_width_property] } { 157 | set flash_width_property "" 158 | } 159 | if { "${flash_width_property}" != "" } { 160 | set flash_width [hsi get_property [regsub -all {} "${flash_width_property}" "${flash_bank}"] [hsi get_cell -hier "${flash_name}"]] 161 | lappend retlist "flash_width=${flash_width}" 162 | } 163 | if { [catch {dict get ${ipdict} "${ipname} device_type flash bank_property bank_baseaddr"} flash_base_property] } { 164 | set flash_base_property "" 165 | } 166 | 167 | if { [catch {dict get ${ipdict} "${ipname} device_type flash bank_property bank_highaddr"} flash_high_property] } { 168 | set flash_high_property "" 169 | } 170 | if { "${flash_base_property}" != "" } { 171 | set flash_base [hsi get_property [regsub -all {} "${flash_base_property}" "${flash_bank}"] [hsi get_cell -hier "${flash_name}"]] 172 | set flash_high [hsi get_property [regsub -all {} "${flash_high_property}" "${flash_bank}"] [hsi get_cell -hier "${flash_name}"]] 173 | set flash_size [format "0x%x" [expr ${flash_high} - ${flash_base} + 1]] 174 | lappend retlist "flash_size=${flash_size}" 175 | } 176 | hsi close_hw_design [hsi current_hw_design] 177 | return ${retlist} 178 | } 179 | 180 | proc get_flash_width_parts {args} { 181 | set args [split [lindex ${args} 0]] 182 | set sysconfig [lindex ${args} 0] 183 | set ipinfof [lindex ${args} 1] 184 | set hdf [lindex ${args} 2] 185 | set outputf [lindex ${args} 3] 186 | 187 | set flash_kname [get_primary_ip_kconfig "${sysconfig}" flash] 188 | set flash_parts [get_partitions "${sysconfig}" "${flash_kname}"] 189 | set flash_widths [get_flash_width "${sysconfig}" "${ipinfof}" "${hdf}"] 190 | 191 | if { [catch {open "${outputf}" w} outputd] } { 192 | error "Failed to open output file \"${outputf}\" for capture Flash information." 193 | } 194 | foreach i ${flash_widths} { 195 | puts ${outputd} "${i}" 196 | } 197 | 198 | foreach i ${flash_parts} { 199 | puts ${outputd} "${i}" 200 | } 201 | close ${outputd} 202 | } 203 | 204 | proc get_search_path {proj} { 205 | set proj [file join [pwd] "${proj}"] 206 | if { [catch {open "${proj}/config.project" r} pconfd] } { 207 | error "Failed to get project search path, failed to open config file \"${proj}/config.project\"." 208 | } 209 | set searchpath_list {} 210 | while {[gets ${pconfd} line] >= 0} { 211 | if {[regexp -- "^CONFIG_PROJECT_ADDITIONAL_COMPONENTS_SEARCH_PATH=" "${line}"] > 0} { 212 | set replace_map [list "CONFIG_PROJECT_ADDITIONAL_COMPONENTS_SEARCH_PATH=" "" "\"" ""] 213 | set proj_searchpath [string map ${replace_map} ${line}] 214 | set searchpath_list [concat ${searchpath_list} [split "${proj_searchpath}" ":"]] 215 | break 216 | } 217 | } 218 | set ret_searchpath_list [list "${proj}/components"] 219 | foreach p ${searchpath_list} { 220 | set p [string trim "${p}"] 221 | if { "${p}" == "" } { 222 | continue 223 | } 224 | set p [file join "${proj}" "${p}"] 225 | lappend ret_searchpath_list "${p}" 226 | } 227 | return ${ret_searchpath_list} 228 | } 229 | 230 | set cmdline $argv 231 | #set tclproc [shift cmdline] 232 | set tclproc [lindex ${cmdline} 0] 233 | set cmdline [lreplace ${cmdline} 0 0] 234 | set plnx_kconfig 0 235 | set plnx_data 0 236 | set current_arch "" 237 | set plnx_ips_record {} 238 | if { "[info procs ${tclproc}]" eq "${tclproc}"} { 239 | ${tclproc} ${cmdline} 240 | } else { 241 | error "proc ${tclproc} doesn't exit." 242 | } 243 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.yoctobuildsettings: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | 6 | if SUBSYSTEM_DISTRO_PETALINUX 7 | menu "Firmware Version Configuration" 8 | config SUBSYSTEM_HOSTNAME 9 | string "Host name" 10 | default "petalinux" 11 | help 12 | The host name of your SUBSYSTEM, set at startup. 13 | 14 | config SUBSYSTEM_PRODUCT 15 | string "Product name" 16 | default "" 17 | help 18 | This is an string inserted into /etc/product during the build. 19 | 20 | config SUBSYSTEM_FW_VERSION 21 | string "Firmware Version" 22 | default "1.00" 23 | help 24 | This is an arbitrary string value that is inserted into 25 | /etc/version during the build. 26 | endmenu 27 | endif 28 | 29 | if !SUBSYSTEM_DISTRO_PETALINUX 30 | source ./Kconfig.yoctomachinesettings 31 | endif 32 | 33 | if SUBSYSTEM_DISTRO_PETALINUX 34 | menu "Yocto Settings" 35 | 36 | source ./Kconfig.yoctomachinesettings 37 | 38 | if SUBSYSTEM_SDT_FLOW 39 | config MC_PLNX_IMAGES_LOCATION 40 | string "PetaLinux Multiconfig Deploy Directory" 41 | help 42 | Specify the PetaLinux multiconfig deploy directory to place the generated build artifacts. 43 | 44 | endif 45 | 46 | menu "TMPDIR Location" 47 | config TMP_DIR_LOCATION 48 | string "TMPDIR Location" 49 | default "${PROOT}/build/tmp" 50 | help 51 | Relative path can be used with reference to ${PROOT} 52 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 53 | ${TOPDIR} will not be functional. 54 | endmenu 55 | 56 | menu "Devtool Workspace Location" 57 | config DEVTOOL_WORKSPACE_LOCATION 58 | string "Devtool Workspace Location" 59 | default "${PROOT}/components/yocto/workspace" 60 | help 61 | Specify the devtool workspace directory, This will setup a workspace layer 62 | in an alternative specified absolute or releative path using layerpath option. 63 | Relative path can be used with reference to ${PROOT} 64 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 65 | ${TOPDIR} will not be functional. 66 | endmenu 67 | 68 | config PLNX_IMAGES_LOCATION 69 | string "PetaLinux Deploy Directory" 70 | help 71 | Specify the PetaLinux deploy directory to place the generated build artifacts. 72 | 73 | menu "Parallel thread execution" 74 | config YOCTO_BB_NUMBER_THREADS 75 | string "Set number of bb threads (BB_NUMBER_THREADS)" 76 | help 77 | Sets the number of tasks BitBake should run in parallel at any one time. 78 | By default BitBake calculates the number of tasks is equal to the 79 | number of cores on the build system. 80 | 81 | config YOCTO_BB_NUMBER_PARSE_THREADS 82 | string "Set number of bb parse threads (BB_NUMBER_PARSE_THREADS)" 83 | help 84 | Sets the number of threads BitBake uses when parsing. 85 | By default BitBake calculates the number of threads is equal 86 | to the number of cores on the build system. 87 | 88 | config YOCTO_PARALLEL_MAKE 89 | string "Set number of parallel make -j (PARALLEL_MAKE)" 90 | help 91 | Specify parallel compilation on the local build host 92 | during the do_compile task. 93 | By default BitBake calculates the number of cores on the build system. 94 | 95 | endmenu 96 | 97 | menu "Add pre-mirror url " 98 | config PRE_MIRROR_URL 99 | string "pre-mirror url path" 100 | help 101 | pre-mirrors is used by bitbake to fetch sources from specified location first. 102 | If sources are not available in pre-mirrors, bitbake then fetches from SRC_URI in the recipes. 103 | 104 | path can be ftp, https or local directory.examples are 105 | "file::///path/to/your/downloads/" 106 | "https://example.com/your/downloadsmirrors/" 107 | "ftp://example.com/your/downloadsmirrors/" 108 | endmenu 109 | 110 | menu "Local sstate feeds settings" 111 | config YOCTO_LOCAL_SSTATE_FEEDS_URL 112 | string "local sstate feeds url" 113 | default "" 114 | help 115 | Provide NFS/local sstate feed path. 116 | The sstate cache will be pulled from these path and used to build the components. 117 | E.g: /some/local/dir/sstate/ 118 | endmenu 119 | 120 | config YOCTO_NETWORK_SSTATE_FEEDS 121 | bool "Enable Network sstate feeds" 122 | default y 123 | help 124 | The sstate feeds which are hosted on webserver has to be provided. 125 | The sstate cache will be pulled from these servers and rootfs was generated. 126 | 127 | menu "Network sstate feeds URL" 128 | depends on YOCTO_NETWORK_SSTATE_FEEDS 129 | config YOCTO_NETWORK_SSTATE_FEEDS_URL 130 | string "network sstate feeds url" 131 | default "" 132 | help 133 | Provide Network sstate feed URI. 134 | The sstate cache will be pulled from these servers and used to build the components. 135 | E.g: https://someserver.tld/share/sstate/ 136 | endmenu 137 | 138 | config YOCTO_BB_NO_NETWORK 139 | bool "Enable BB NO NETWORK" 140 | default n 141 | help 142 | Enabling this option restricts bitbake to go to internet for fetching. 143 | 144 | config YOCTO_BUILDTOOLS_EXTENDED 145 | bool "Enable Buildtools Extended" 146 | default n 147 | help 148 | Enabling this option to use the gcc and other libraries from $PETALINUX/components/yocto/buildtools_extended/ 149 | Use this option on a machine that does not meet the minimal gcc, Git, tar, and Python requirements. 150 | 151 | menu "User Layers" 152 | config USER_LAYER_0 153 | string "user layer 0" 154 | help 155 | You can specify relative path or absolute path of layer. 156 | To add layer at /project-spec/meta-security 157 | Enter: ${PROOT}/project-spec/meta-security 158 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 159 | ${TOPDIR} will not be functional. 160 | 161 | config USER_LAYER_1 162 | string "user layer 1" 163 | depends on USER_LAYER_0 != "" 164 | help 165 | You can specify relative path or absolute path of layer. 166 | To add layer at /project-spec/meta-security 167 | Enter: ${PROOT}/project-spec/meta-security 168 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 169 | ${TOPDIR} will not be functional. 170 | 171 | config USER_LAYER_2 172 | string "user layer 2" 173 | depends on USER_LAYER_1 != "" 174 | help 175 | You can specify relative path or absolute path of layer. 176 | To add layer at /project-spec/meta-security 177 | Enter: ${PROOT}/project-spec/meta-security 178 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 179 | ${TOPDIR} will not be functional. 180 | 181 | config USER_LAYER_3 182 | string "user layer 3" 183 | depends on USER_LAYER_2 != "" 184 | help 185 | You can specify relative path or absolute path of layer. 186 | To add layer at /project-spec/meta-security 187 | Enter: ${PROOT}/project-spec/meta-security 188 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 189 | ${TOPDIR} will not be functional. 190 | 191 | config USER_LAYER_4 192 | string "user layer 4" 193 | depends on USER_LAYER_3 != "" 194 | help 195 | You can specify relative path or absolute path of layer. 196 | To add layer at /project-spec/meta-security 197 | Enter: ${PROOT}/project-spec/meta-security 198 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 199 | ${TOPDIR} will not be functional. 200 | 201 | config USER_LAYER_5 202 | string "user layer 5" 203 | depends on USER_LAYER_4 != "" 204 | help 205 | You can specify relative path or absolute path of layer. 206 | To add layer at /project-spec/meta-security 207 | Enter: ${PROOT}/project-spec/meta-security 208 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 209 | ${TOPDIR} will not be functional. 210 | 211 | config USER_LAYER_6 212 | string "user layer 6" 213 | depends on USER_LAYER_5 != "" 214 | help 215 | You can specify relative path or absolute path of layer. 216 | To add layer at /project-spec/meta-security 217 | Enter: ${PROOT}/project-spec/meta-security 218 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 219 | ${TOPDIR} will not be functional. 220 | 221 | config USER_LAYER_7 222 | string "user layer 7" 223 | depends on USER_LAYER_6 != "" 224 | help 225 | You can specify relative path or absolute path of layer. 226 | To add layer at /project-spec/meta-security 227 | Enter: ${PROOT}/project-spec/meta-security 228 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 229 | ${TOPDIR} will not be functional. 230 | 231 | config USER_LAYER_8 232 | string "user layer 8" 233 | depends on USER_LAYER_7 != "" 234 | help 235 | You can specify relative path or absolute path of layer. 236 | To add layer at /project-spec/meta-security 237 | Enter: ${PROOT}/project-spec/meta-security 238 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 239 | ${TOPDIR} will not be functional. 240 | 241 | config USER_LAYER_9 242 | string "user layer 9" 243 | depends on USER_LAYER_8 != "" 244 | help 245 | You can specify relative path or absolute path of layer. 246 | To add layer at /project-spec/meta-security 247 | Enter: ${PROOT}/project-spec/meta-security 248 | Note: ${PROOT} is a PetaLinux variable, Using bitbake variable such as 249 | ${TOPDIR} will not be functional. 250 | 251 | endmenu 252 | endmenu 253 | endif 254 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.linuxcompselection: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | 6 | menu "Linux Components Selection" 7 | config SUBSYSTEM_COMPONENT_DEVICE__TREE_NAME_DEVICE__TREE__GENERATOR 8 | bool 9 | default y 10 | 11 | config SUBSYSTEM_COMPONENT_IMG_SEL 12 | bool "Image Selector" 13 | default n 14 | depends on SYSTEM_ZYNQMP 15 | help 16 | If you select this option, PetaLinux will auto generate the pre 17 | bootloader through xsct.The ELF file for the same is in /images/linux. 18 | If you DONOT select this option, petalinux will not generate, config or 19 | build your bootloader. 20 | 21 | config SUBSYSTEM_COMPONENT_BOOTLOADER_AUTO_FSBL 22 | bool 23 | default y 24 | depends on !SYSTEM_VERSAL 25 | 26 | config SUBSYSTEM_COMPONENT_BOOTLOADER_NAME_FS__BOOT 27 | bool 28 | default y 29 | depends on SUBSYSTEM_ARCH_MICROBLAZE 30 | 31 | config SUBSYSTEM_COMPONENT_BOOTLOADER_NAME_ZYNQ_FSBL 32 | bool 33 | default y 34 | depends on SUBSYSTEM_ARCH_ARM 35 | 36 | config SUBSYSTEM_COMPONENT_BOOTLOADER_NAME_ZYNQMP_FSBL 37 | bool 38 | default y 39 | depends on SYSTEM_ZYNQMP 40 | 41 | config SUBSYSTEM_COMPONENT_PMU_FIRMWARE 42 | bool 43 | default y 44 | depends on SYSTEM_ZYNQMP 45 | 46 | config SUBSYSTEM_COMPONENT_PLM 47 | bool 48 | default y 49 | depends on SYSTEM_VERSAL 50 | 51 | config SUBSYSTEM_COMPONENT_PSM_FIRMWARE 52 | bool 53 | default y 54 | depends on SYSTEM_VERSAL 55 | 56 | choice 57 | prompt "u-boot" 58 | config SUBSYSTEM_COMPONENT_U__BOOT_NAME_U__BOOT__XLNX 59 | bool "u-boot-xlnx" 60 | help 61 | You can find about this option 62 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 63 | 64 | config SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE 65 | bool "remote" 66 | help 67 | You can find about this option 68 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 69 | 70 | config SUBSYSTEM_COMPONENT_U__BOOT_NAME_EXT__LOCAL__SRC 71 | bool "ext-local-src" 72 | help 73 | You can find about this option 74 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 75 | endchoice 76 | 77 | menu "Remote u-boot settings" 78 | depends on SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE 79 | 80 | config SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE_DOWNLOAD_PATH 81 | string "Remote u-boot git URL" 82 | depends on SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE 83 | help 84 | It will git clone the specified remote git url repo 85 | 86 | config SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE_REFERENCE 87 | string "Remote u-boot git TAG/Commit ID" 88 | depends on SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE 89 | help 90 | It will git clone the remote with the specified commitid 91 | into the project's components dir 92 | 93 | config SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE_BRANCH 94 | string "Remote u-boot git BRANCH" 95 | depends on SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE 96 | help 97 | Specify the BRANCH of the remote repo 98 | This is optional, anyway if you dont specify it will take from the component bb file 99 | 100 | config SUBSYSTEM_COMPONENT_U__BOOT_LIC_FILES_CHKSUM_REMOTE 101 | string "Remote u-boot license checksum" 102 | depends on SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE 103 | help 104 | Specify the LIC_FILES_CHKSUM of the license text in the source code for the recipe 105 | This is optional, anyway if you dont specify it will take from the component bb file 106 | Ex: file://license.txt;md5=xxxx 107 | 108 | endmenu 109 | 110 | menu "External u-boot local source settings" 111 | depends on SUBSYSTEM_COMPONENT_U__BOOT_NAME_EXT__LOCAL__SRC 112 | 113 | config SUBSYSTEM_COMPONENT_U__BOOT_NAME_EXT_LOCAL_SRC_PATH 114 | string "External u-boot local source path" 115 | help 116 | It will point the u-boot source path to this location 117 | 118 | config SUBSYSTEM_COMPONENT_U__BOOT_LIC_FILES_CHKSUM_LOCAL__SRC 119 | string "External u-boot license checksum" 120 | depends on SUBSYSTEM_COMPONENT_U__BOOT_NAME_EXT__LOCAL__SRC 121 | help 122 | Specify the LIC_FILES_CHKSUM of the license text in the source code for the recipe 123 | This is optional, anyway if you dont specify it will take from the component bb file 124 | Ex: file://license.txt;md5=xxxx 125 | 126 | endmenu 127 | 128 | if SUBSYSTEM_ARCH_AARCH64 129 | choice 130 | prompt "trusted-firmware-arm" 131 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_TRUSTED__FIRMWARE__ARM 132 | bool "trusted-firmware-arm" 133 | help 134 | You can find about this option 135 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 136 | 137 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE 138 | bool "remote" 139 | help 140 | You can find about this option 141 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 142 | 143 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_EXT__LOCAL__SRC 144 | bool "ext-local-src" 145 | help 146 | You can find about this option 147 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 148 | 149 | endchoice 150 | 151 | menu "Remote trusted-firmware-arm settings" 152 | depends on SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE 153 | 154 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE_DOWNLOAD_PATH 155 | string "Remote trusted-firmware-arm git URL" 156 | depends on SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE 157 | help 158 | It will git clone the specified remote git url repo 159 | 160 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE_REFERENCE 161 | string "Remote trusted-firmware-arm git TAG/Commit ID" 162 | depends on SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE 163 | help 164 | It will git clone the remote with the specified commitid 165 | into the project's components dir 166 | 167 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE_BRANCH 168 | string "Remote trusted-firmware-arm git BRANCH" 169 | depends on SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE 170 | help 171 | Specify the BRANCH of the remote repo 172 | This is optional, anyway if you dont specify it will take from the component bb file 173 | 174 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_LIC_FILES_CHKSUM_REMOTE 175 | string "Remote trusted-firmware-arm license checksum" 176 | depends on SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_REMOTE 177 | help 178 | Specify the LIC_FILES_CHKSUM of the license text in the source code for the recipe 179 | This is optional, anyway if you dont specify it will take from the component bb file 180 | Ex: file://license.txt;md5=xxxx 181 | endmenu 182 | 183 | menu "External trusted-firmware-arm local source settings" 184 | depends on SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_EXT__LOCAL__SRC 185 | 186 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_EXT_LOCAL_SRC_PATH 187 | string "External trusted-firmware-arm local source path" 188 | help 189 | It will point the trusted-firmware-arm source path to this location 190 | 191 | config SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_LIC_FILES_CHKSUM_LOCAL__SRC 192 | string "External trusted-firmware-arm license checksum" 193 | depends on SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_EXT__LOCAL__SRC 194 | help 195 | Specify the LIC_FILES_CHKSUM of the license text in the source code for the recipe 196 | This is optional, anyway if you dont specify it will take from the component bb file 197 | Ex: file://license.txt;md5=xxxx 198 | 199 | endmenu 200 | endif 201 | 202 | choice 203 | prompt "linux-kernel" 204 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_LINUX__XLNX 205 | bool "linux-xlnx" 206 | help 207 | You can find about this option 208 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 209 | 210 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE 211 | bool "remote" 212 | help 213 | You can find about this option 214 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 215 | 216 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_EXT__LOCAL__SRC 217 | bool "ext-local-src" 218 | help 219 | You can find about this option 220 | in UG1144 in "Steps to Configure Out-of-tree Build" section. 221 | 222 | endchoice 223 | 224 | menu "Remote linux-kernel settings" 225 | depends on SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE 226 | 227 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE_DOWNLOAD_PATH 228 | string "Remote linux-kernel git URL" 229 | depends on SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE 230 | help 231 | It will git clone the specified remote git url repo 232 | 233 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE_REFERENCE 234 | string "Remote linux-kernel git TAG/Commit ID" 235 | depends on SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE 236 | help 237 | It will git clone the remote with the specified commitid 238 | into the project's components dir 239 | 240 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE_BRANCH 241 | string "Remote linux-kernel git BRANCH" 242 | depends on SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE 243 | help 244 | Specify the BRANCH of the remote repo 245 | This is optional, anyway if you dont specify it will take from the component bb file 246 | 247 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_LIC_FILES_CHKSUM_REMOTE 248 | string "Remote linux-kernel license checksum" 249 | depends on SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE 250 | help 251 | Specify the LIC_FILES_CHKSUM of the license text in the source code for the recipe 252 | This is optional, anyway if you dont specify it will take from the component bb file 253 | Ex: file://license.txt;md5=xxxx 254 | endmenu 255 | 256 | menu "External linux-kernel local source settings" 257 | depends on SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_EXT__LOCAL__SRC 258 | 259 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_EXT_LOCAL_SRC_PATH 260 | string "External linux-kernel local source path" 261 | help 262 | It will point the linux-kernel source path to this location 263 | 264 | config SUBSYSTEM_COMPONENT_LINUX__KERNEL_LIC_FILES_CHKSUM_LOCAL__SRC 265 | string "External linux-kernel license checksum" 266 | depends on SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_EXT__LOCAL__SRC 267 | help 268 | Specify the LIC_FILES_CHKSUM of the license text in the source code for the recipe 269 | This is optional, anyway if you dont specify it will take from the component bb file 270 | Ex: file://license.txt;md5=xxxx 271 | 272 | endmenu 273 | endmenu 274 | -------------------------------------------------------------------------------- /gen-machine-scripts/libs/kconf_parser.tcl: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | 6 | proc partition_info_lookup {kconfig_dict media part_name key} { 7 | set part_no 0 8 | while {$part_no < 20} { 9 | if {[dict exists $kconfig_dict $media "part$part_no" "name"]} { 10 | set cur_part_name [dict get $kconfig_dict flash "part$part_no" "name"] 11 | if {[string equal $cur_part_name $part_name] && \ 12 | [dict exists $kconfig_dict flash "part$part_no" $key]} { 13 | set key_value [dict get $kconfig_dict flash "part$part_no" $key] 14 | return $key_value 15 | } 16 | } else { 17 | break 18 | } 19 | incr part_no 20 | } 21 | # Maybe this should be a error, in theory this should be captured by plnx tools 22 | debug "partition_info_lookup" "Unable to determine the $key for partition '$part_name' from media '$media'" 23 | } 24 | 25 | proc set_serial_dict_data {inst_name conf_str data} { 26 | global kconfig_dict 27 | set lookup_string "serial" 28 | set property "baudrate" 29 | foreach p ${property} { 30 | set up_p [string toupper ${p}] 31 | regsub -- "_SELECT=y" $conf_str "_${up_p}_" up_p_prefix 32 | set p_line [lsearch -regexp -inline ${data} "^${up_p_prefix}.*=y"] 33 | if { "${p_line}" != "" } { 34 | regsub -- "${up_p_prefix}" ${p_line} "" p_line 35 | regsub -- "=y" ${p_line} "" p_val 36 | set p_val [string tolower "${p_val}"] 37 | dict set kconfig_dict $lookup_string ${p} ${inst_name} ${p_val} 38 | } 39 | } 40 | } 41 | 42 | proc read_config {} { 43 | # TODO: Clean up 44 | global plnx_sys_conf_file kconfig_dict dict_lut 45 | 46 | set fp [open $plnx_sys_conf_file r] 47 | set file_data [read $fp] 48 | set data [split $file_data "\n"] 49 | global target_cpu def_ip_list 50 | 51 | # check list 52 | set lookup_list "processor memory serial reset_gpio flash ethernet" 53 | foreach line [lsearch -regexp -all -inline $data "^CONFIG_SUBSYSTEM_.*_SELECT=y"] { 54 | foreach lookup_string $lookup_list { 55 | eval "global ${lookup_string}_dict" 56 | eval "set mapping_dict \$${lookup_string}_dict" 57 | set lookup_string [string toupper $lookup_string] 58 | set lookup_regexp "^CONFIG_SUBSYSTEM_${lookup_string}.*_SELECT=y" 59 | if {[regexp $lookup_regexp $line matched] == 1 } { 60 | set ch_regexp "^CONFIG_SUBSYSTEM_${lookup_string}.*CHANNEL[0-9]_SELECT=y" 61 | if {[regexp $ch_regexp $line matched] == 1 } {continue} 62 | set value [string tolower [regsub -- "CONFIG_SUBSYSTEM_${lookup_string}_" $line ""]] 63 | regsub -- "_select=y" $value "" value 64 | if {[string equal "manual" $value]} { 65 | continue 66 | } 67 | set lookup_string [string tolower $lookup_string] 68 | if { "${lookup_string}" == "memory" } { 69 | } 70 | dict set kconfig_dict $lookup_string ip_str $value 71 | # TODO: check up bank no 72 | if {[regexp [string toupper "^CONFIG_SUBSYSTEM_${lookup_string}.*_BANK.*="] $line matched] == 1} { 73 | set bank_no [regsub -- ".*_bank" $value ""] 74 | # FIXME: is this a good idea to set bankless to 0 75 | if {[regexp "less" $bank_no matched] == 1} { 76 | dict set kconfig_dict $lookup_string bank "" 77 | } else { 78 | dict set kconfig_dict $lookup_string bank $bank_no 79 | } 80 | } 81 | regsub -- "_bankless" $value "" value 82 | regsub -- "_bank[0-9]" $value "" value 83 | # get the real ip name in the system 84 | foreach real_ip_name [hsi get_cells -hier] { 85 | if {[regexp -nocase -- $value $real_ip_name match]} { 86 | set value $real_ip_name 87 | break 88 | } 89 | } 90 | dict set kconfig_dict $lookup_string inst_name $value 91 | lappend def_ip_list $value 92 | dict set dict_lut $value type $lookup_string 93 | if {[string equal "simple" $value]} { 94 | continue 95 | } 96 | # now check if flash_type exists 97 | if { ![regexp "(.*hbm.*)|(.*ddr.*)" $value matched] } { 98 | set ip_name [hsi get_property IP_NAME [hsi get_cells -hier $value]] 99 | if {[dict exists $mapping_dict $ip_name flash_type]} { 100 | set flash_typ [dict get $mapping_dict $ip_name flash_type] 101 | dict set kconfig_dict $lookup_string flash_type $flash_typ 102 | } 103 | } 104 | # now check if uart baudrate exists 105 | if { "${lookup_string}" == "serial" } { 106 | set_serial_dict_data "${value}" "${line}" ${data} 107 | } 108 | break 109 | } 110 | } 111 | } 112 | 113 | set target_cpu [dict get $kconfig_dict processor inst_name] 114 | if {[string compare ${target_cpu} ""] == 0} { 115 | error "No cpu detected." 116 | } 117 | set cpu_arch [get_sw_proc_arch $target_cpu] 118 | if {[string equal -nocase $cpu_arch "microblaze"] == 1} { 119 | set proc_intc [get_current_ip_intc $target_cpu] 120 | if {![string equal "$proc_intc" ""]} { 121 | lappend def_ip_list $proc_intc 122 | dict set dict_lut $proc_intc type intc 123 | } 124 | } 125 | 126 | # separate into second loop to ensure that the _select=y is not at the end(unlikely) 127 | foreach line $data { 128 | if {[regexp [string toupper "^#.*"] $line matched]} { 129 | continue 130 | } 131 | foreach lookup_string $lookup_list { 132 | if {![dict exists $kconfig_dict $lookup_string inst_name]} { 133 | continue 134 | } 135 | set ip_str [dict get $kconfig_dict $lookup_string ip_str] 136 | set inst_name [dict get $kconfig_dict $lookup_string inst_name] 137 | set lookup_regexp [string toupper "^CONFIG_SUBSYSTEM_${lookup_string}_${inst_name}_.*=" ] 138 | if { [regexp $lookup_regexp $line matched] == 1 } { 139 | set prop_data [string tolower [regsub -- [string toupper "CONFIG_SUBSYSTEM_${lookup_string}_(${ip_str}|${inst_name})_"] $line ""]] 140 | set prop_data [split $prop_data "="] 141 | set prop_key [lindex $prop_data 0] 142 | set prop_value [lindex $prop_data 1] 143 | regsub -all {"} $prop_value "" prop_value 144 | # FIXME: flash spi - CS, emc bank 145 | # handle partition tables 146 | if {[regexp "part[0-1]?[0-9]_.*" $prop_key]} { 147 | if {[string equal $prop_value ""]} {continue} 148 | set part_key_data [split $prop_key "_"] 149 | set prop_pri_key [lindex $part_key_data 0] 150 | set prop_sec_key [lindex $part_key_data 1] 151 | dict set kconfig_dict $lookup_string $prop_pri_key $prop_sec_key $prop_value 152 | } else { 153 | dict set kconfig_dict $lookup_string $prop_key $prop_value 154 | } 155 | } 156 | } 157 | # check for adv partition 158 | if {[regexp "^CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_.*" $line matched] == 1} { 159 | set prop_data [regsub -- [string toupper "CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_"] $line ""] 160 | set prop_data [split $prop_data "="] 161 | set prop_value [lindex $prop_data 1] 162 | regsub -all {"} $prop_value "" prop_value 163 | set prop_key [string tolower [lindex $prop_data 0]] 164 | set primary_key [lindex [split $prop_key "_"] 0] 165 | set option [lindex [split $prop_key "_"] 1] 166 | switch -exact $option { 167 | "media" { 168 | set prop_value [lindex [split $prop_key "_"] 2] 169 | if {[string equal "flash" $prop_value]} { 170 | set flash_typ [dict get $kconfig_dict flash flash_type] 171 | dict set kconfig_dict adv_partition $primary_key flash_type $flash_typ 172 | } 173 | } 174 | default { } 175 | } 176 | dict set kconfig_dict adv_partition $primary_key $option $prop_value 177 | } 178 | if {[regexp "^CONFIG_SUBSYSTEM_.*" $line matched] == 1} { 179 | set prop_data [regsub -- [string toupper "CONFIG_SUBSYSTEM_"] $line ""] 180 | set prop_data [split $prop_data "="] 181 | set prop_key [string tolower [lindex $prop_data 0]] 182 | set prop_value [join [lrange $prop_data 1 end] "="] 183 | if {[regexp "^user_cmdline" $prop_key matched] == 1} { 184 | set prop_value [string range $prop_value 1 end-1] 185 | } else { 186 | regsub -all {"} $prop_value "" prop_value 187 | } 188 | dict set kconfig_dict subsys_conf $prop_key $prop_value 189 | } 190 | } 191 | 192 | if {[dict exists $kconfig_dict subsys_conf images_advanced_autoconfig]} { 193 | set adv_partition_used 1 194 | } else { 195 | set adv_partition_used 0 196 | } 197 | # update partition offset and target image file (no adv_partition setting) 198 | set part_no 0 199 | set offset 0x0 200 | while {$part_no < 20} { 201 | if {[dict exists $kconfig_dict flash "part$part_no" "size"]} { 202 | set size [dict get $kconfig_dict flash "part$part_no" "size"] 203 | set flash_type [dict get $kconfig_dict flash flash_type] 204 | if {[string equal "nor" $flash_type]} { 205 | set flash_inst [dict get $kconfig_dict flash inst_name] 206 | set flash_bank [dict get $kconfig_dict flash bank] 207 | set cntl_base [get_ip_property $flash_inst $flash_bank BASEADDR] 208 | set p_offset [format "0x%08x" [expr $cntl_base + $offset]] 209 | dict set kconfig_dict flash "part$part_no" "cntl_base" $cntl_base 210 | } else { 211 | set p_offset $offset 212 | } 213 | dict set kconfig_dict flash "part$part_no" "offset" $p_offset 214 | if {$adv_partition_used == 0} { 215 | set part_name [dict get $kconfig_dict flash "part$part_no" "name"] 216 | set image_file "" 217 | # boot is arch dependent 218 | switch -exact $part_name { 219 | "boot" { 220 | if {[string equal -nocase $cpu_arch "microblaze"] == 1} { 221 | set image_file "u-boot-s.bin" 222 | } else { 223 | set image_file "BOOT.BIN" 224 | } 225 | } 226 | "kernel" { 227 | set image_file [dict get $kconfig_dict "subsys_conf" "uimage_name"] 228 | } 229 | "dtb" {set image_file "system.dtb"} 230 | "fpga" {set image_file "system.bit.bin"} 231 | default { } 232 | } 233 | if {![string equal $image_file ""]} { 234 | dict set kconfig_dict flash "part$part_no" "image_file" $image_file 235 | # create adv_partition image key 236 | dict set kconfig_dict adv_partition $part_name image $image_file 237 | dict set kconfig_dict adv_partition $part_name flash_type $image_file 238 | } 239 | # create adv_partition keys 240 | dict set kconfig_dict adv_partition $part_name media flash 241 | dict set kconfig_dict adv_partition $part_name part $part_name 242 | dict set kconfig_dict adv_partition $part_name size $size 243 | # 244 | dict set kconfig_dict adv_partition $part_name flash_type $flash_type 245 | } 246 | set offset [format "0x%x" [expr $size + $offset]] 247 | } else { 248 | break 249 | } 250 | incr part_no 251 | } 252 | # for adv partition we need workout the off set and size 253 | if {[dict exists $kconfig_dict adv_partition]} { 254 | dict for {prop prop_mapping} [dict get $kconfig_dict adv_partition] { 255 | set media [dict get $kconfig_dict adv_partition $prop media] 256 | if {![string equal "flash" $media]} {continue} 257 | set part_name [dict get $kconfig_dict adv_partition $prop part] 258 | set offset [partition_info_lookup $kconfig_dict $media $part_name "offset"] 259 | set size [partition_info_lookup $kconfig_dict $media $part_name "size"] 260 | if {[string equal $offset ""]} {continue} 261 | dict set kconfig_dict adv_partition $prop offset $offset 262 | dict set kconfig_dict adv_partition $prop size $size 263 | set cntl_base [partition_info_lookup $kconfig_dict $media $part_name "cntl_base"] 264 | if {[string equal $cntl_base ""]} {continue} 265 | dict set kconfig_dict adv_partition $prop cntl_base $cntl_base 266 | } 267 | } 268 | 269 | if {! [dict exists $kconfig_dict subsys_conf netboot_offset]} { 270 | dict set kconfig_dict subsys_conf netboot_offset 0x1000000 271 | } 272 | close $fp 273 | } 274 | -------------------------------------------------------------------------------- /gen-machine-scripts/petalinux_hsm_bridge.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # HSM bridge 3 | # 4 | # Copyright (C) 2014-2022, Xilinx, Inc. All rights reserved. 5 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 6 | # 7 | # SPDX-License-Identifier: MIT 8 | 9 | proc debug {level message} { 10 | return 11 | puts ">> $level: $message" 12 | } 13 | 14 | proc get_primary_inst_name {ip} { 15 | global kconfig_dict 16 | set inst_name "" 17 | set str [dict filter [dict get $kconfig_dict subsys_conf] key primary_${ip}_*_select] 18 | if {[llength $str] > 0} { 19 | set inst_name [regsub -- "_select" [regsub -- "primary_${ip}_" [lindex $str 0] ""] ""] 20 | } 21 | if {[string equal -nocase $inst_name "manual"] == 1} { 22 | return "" 23 | } 24 | return $inst_name 25 | } 26 | 27 | proc plnx_error_exit {msg} { 28 | puts stderr "Error code: ${errorCode}." 29 | puts stderr "Error info: ${errorInfo}." 30 | error "ERROR: ${msg}" 31 | } 32 | 33 | proc load_hw_desc_file {hw_desc_file} { 34 | debug 1 "openhw $hw_desc_file" 35 | openhw $hw_desc_file 36 | set hw_design_obj [hsi current_hw_design] 37 | return $hw_design_obj 38 | } 39 | 40 | proc add_def_ip_list {} { 41 | global target_cpu def_ip_list dict_lut 42 | set cpu_arch [get_sw_proc_arch $target_cpu] 43 | # for arch arm, we should also check up ps7_slcr ps7_scuc ps7_dev_cfg ps7_scutimer 44 | if {[string equal -nocase $cpu_arch "armv7"] == 1} { 45 | set ip_lookup_list "ps7_slcr ps7_scuc ps7_dev_cfg ps7_scutimer processing_system7" 46 | foreach ip [hsi get_cells -hier] { 47 | set ip_type [hsi get_property "IP_NAME" [hsi get_cells -hier $ip]] 48 | if {[lsearch -exact $ip_lookup_list $ip_type] >= 0} { 49 | lappend def_ip_list $ip 50 | dict set dict_lut $ip type misc 51 | } 52 | } 53 | } elseif {[string equal -nocase $cpu_arch "armv8"] == 1} { 54 | set ip_lookup_list "psu_acpu_gic zynq_ultra_ps_e" 55 | foreach ip [hsi get_cells -hier] { 56 | set ip_type [hsi get_property "IP_NAME" [hsi get_cells -hier $ip]] 57 | if {[lsearch -exact $ip_lookup_list $ip_type] >= 0} { 58 | lappend def_ip_list $ip 59 | dict set dict_lut $ip type misc 60 | } 61 | } 62 | } 63 | } 64 | 65 | proc get_os_config_list {} { 66 | set prop_data [hsi report_property -all -return_string [hsi get_os] CONFIG.*] 67 | set conf_data [split $prop_data "\n"] 68 | set config_list {} 69 | foreach line $conf_data { 70 | if { [regexp "^CONFIG..*" $line matched] == 1 } { 71 | set config_name [split $line " "] 72 | set config_name [lindex $config_name 0] 73 | regsub -- "CONFIG." $config_name "" config_name 74 | lappend config_list $config_name 75 | } 76 | } 77 | return $config_list 78 | } 79 | 80 | proc Pop {varname {nth 0}} { 81 | upvar $varname args 82 | set r [lindex $args $nth] 83 | set args [lreplace $args $nth $nth] 84 | return $r 85 | } 86 | 87 | proc arg_parse { } { 88 | global argv0 argv argc hw_desc_file plnx_sys_conf_file out_dir db_dir sw_design function repo 89 | # required for hsi after 02.04 build 90 | set args [split [join $argv " " ] " "] 91 | while {[string match -* [lindex $args 0]]} { 92 | switch -glob -- [lindex $args 0] { 93 | -hdf* {set hw_desc_file [Pop args 1]} 94 | -c* {set plnx_sys_conf_file [Pop args 1]} 95 | -a* {set function [Pop args 1]} 96 | -o* {set out_dir [Pop args 1]} 97 | -data* {set db_dir [Pop args 1]} 98 | -repo* {set repo [Pop args 1]} 99 | -sw* {set sw_design [Pop args 1]} 100 | -- { Pop args ; break } 101 | default { 102 | set opts [join [lsort [array names state -*]] ", "] 103 | return -code error "bad option [lindex $args 0]: \ 104 | must be one of $opts" 105 | } 106 | } 107 | Pop args 108 | } 109 | 110 | if {![file exists $hw_desc_file]} { 111 | error "Unable to located the HW description file - ${hw_desc_file}" 112 | } 113 | if {![file exists $plnx_sys_conf_file]} { 114 | error "Unable to located the PetaLinux sub system config file - ${plnx_sys_conf_file}" 115 | } 116 | } 117 | 118 | proc get_conf_list {db_dict ip_list} { 119 | set tconf_list "" 120 | foreach ip_var "$ip_list" { 121 | if {![dict exist $db_dict $ip_var]} {continue} 122 | foreach conf_type [get_db_type_list $db_dict $ip_var] { 123 | if {![dict exist $db_dict $ip_var $conf_type]} {continue} 124 | dict for {conf conf_data} [dict get $db_dict $ip_var $conf_type] { 125 | set rt_code [catch {dict keys [dict get $db_dict $ip_var $conf_type $conf]}] 126 | if {$rt_code == 0} { 127 | if {[lsearch -exact $tconf_list $conf] >= 0} { 128 | continue 129 | } 130 | lappend tconf_list "$conf" 131 | } 132 | } 133 | } 134 | } 135 | return $tconf_list 136 | } 137 | 138 | proc get_sw_proc_arch {name} { 139 | # processor arch mapping 140 | set armv7_string {cortexa9} 141 | set armv8_string {cortexa53 cortexa57 cortexa72 cortexa78} 142 | set mb_string {microblaze} 143 | 144 | # two different method of using get_cells -hier 145 | foreach cpu_str $armv7_string { 146 | if { [regexp $cpu_str [hsi report_property [eval hsi get_cells -hier -filter "NAME==$name"] -return_string -regexp "VLNV"] matched] == 1 } { 147 | return {armv7} 148 | } 149 | } 150 | foreach cpu_str $armv8_string { 151 | if { [regexp $cpu_str [hsi report_property [eval hsi get_cells -hier -filter "NAME==$name"] -return_string -regexp "VLNV"] matched] == 1 } { 152 | return {armv8} 153 | } 154 | } 155 | foreach cpu_str $mb_string { 156 | if { [regexp $cpu_str [hsi report_property [hsi get_cells -hier -regexp "$name"] -return_string -regexp "VLNV"] matched] == 1 } { 157 | return {microblaze} 158 | } 159 | } 160 | error "Unsupported CPU architecture" 161 | } 162 | 163 | proc rnd_name len { 164 | set s "abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789" 165 | for {set i 0} {$i <= $len} {incr i} { 166 | append p [string index $s [expr {int([string length $s]*rand())}]] 167 | } 168 | return $p 169 | } 170 | 171 | # generated a system config settings 172 | proc report_sys_property {} { 173 | global kconfig_dict dict_lut def_ip_list out_dir conf_prefix 174 | set conf_prefix "" 175 | set sys_property "${out_dir}/sys-property" 176 | set fid [open "$sys_property" "w+"]; 177 | 178 | foreach ip $def_ip_list { 179 | if {[dict exist $dict_lut $ip]} { 180 | set dict_name [dict get $dict_lut $ip type] 181 | eval "global ${dict_name}_dict" 182 | eval "set mapping_dict \$${dict_name}_dict" 183 | } else { 184 | global misc_dict 185 | set mapping_dict misc_dict 186 | } 187 | db_gen_config $fid $ip $mapping_dict "sys_property" 188 | } 189 | close $fid 190 | } 191 | 192 | proc add_dtsi {main_dts dtsi} { 193 | global out_dir 194 | if {[file exists "${out_dir}/${main_dts}"]} { 195 | set fd [open "${out_dir}/${main_dts}" "a"] 196 | puts "$fd" "#include \"${dtsi}\"" 197 | close $fd 198 | } else { 199 | debug "add_dtsi" "$main_dts not found " 200 | } 201 | } 202 | 203 | proc update_alias_node {main_dts} { 204 | global out_dir kconfig_dict 205 | if {[file exists "${out_dir}/${main_dts}"]} { 206 | set eeprom_alias "" 207 | set rtc_alias "" 208 | if {[dict exists $kconfig_dict subsys_conf add_eeprom_alias]} { 209 | set eeprom_alias [dict get $kconfig_dict subsys_conf add_eeprom_alias] 210 | } 211 | if {[dict exists $kconfig_dict subsys_conf add_rtc_alias]} { 212 | set rtc_alias [dict get $kconfig_dict subsys_conf add_rtc_alias] 213 | } 214 | if {[llength $eeprom_alias] || [llength $rtc_alias]} { 215 | set fd [open "${out_dir}/${main_dts}" "r"] 216 | set data_read [split [read "$fd"] "\n"] 217 | close $fd 218 | foreach line $data_read { 219 | if {[string match -nocase "*aliases \{*" $line]} { 220 | if {[llength $eeprom_alias]} { 221 | regsub -all "aliases \{" $line "aliases \{\n\t\tnvmem0 = \\&eeprom;" line 222 | } 223 | if {[llength $rtc_alias]} { 224 | regsub -all "aliases \{" $line "aliases \{\n\t\trtc0 = \\&rtc;" line 225 | } 226 | } 227 | set append_data [append append_data "$line" "\n"] 228 | } 229 | set data_write [open "${out_dir}/${main_dts}" "w"] 230 | puts "$data_write" "$append_data" 231 | close $data_write 232 | } 233 | } 234 | } 235 | # 236 | # === main === 237 | # 238 | 239 | package require yaml 240 | 241 | set scripts_path [ file dirname [ file normalize [ info script ] ] ] 242 | # source libs 243 | foreach lib_file [glob -directory $scripts_path/libs/ *] { 244 | source $lib_file 245 | } 246 | 247 | #source tools script which are not longer exported to user 248 | set xsct_path [exec which xsct] 249 | set xsct_root_dir [file dirname [file dirname "${xsct_path}"]] 250 | 251 | variable hw_desc_file 252 | 253 | 254 | variable kconfig_dict [dict create] * 255 | variable dict_lut [dict create] 256 | variable ps7_mapping [dict create] 257 | variable def_ip_list "" 258 | 259 | # xml files 260 | #variable xml_file "hw/zc706.xml" 261 | variable xml_file "kc705.xml" 262 | # system configuration files (setting to software apps/bsp) 263 | 264 | # this target_os can be remove as the app usually have default bsp 265 | variable target_os "standalone" 266 | 267 | # type of application 268 | #variable target_app "zynq_fsbl" 269 | 270 | # TODO: allow os config to be override with additional args or file 271 | #variable plnx_sys_conf_file "config" 272 | variable plnx_sys_conf_file 273 | 274 | # TODO: target_proc should get it from config file 275 | variable target_cpu 276 | variable sw_design 277 | variable repo 278 | variable out_dir "" 279 | variable db_dir "." 280 | variable find_ip_cmd "$scripts_path/petalinux-find-ipaddr" 281 | variable sata_count 0 282 | variable i2c_count 0 283 | variable usb_count 0 284 | variable eth_count 0 285 | variable ethlite_count 0 286 | variable ethfull_count 0 287 | variable ps7eth_count 0 288 | variable uart_count 0 289 | variable ps_uart_count 0 290 | variable uartfull_count 0 291 | variable uartlite_count 0 292 | variable gpio_count 0 293 | variable ps_sdio_count 0 294 | variable spiflash_count 0 295 | variable func_called_list "" 296 | 297 | variable conf_prefix "#define " 298 | 299 | # list of partition that we care about 300 | variable sys_part_list "boot bootenv kernel dtb fpga" 301 | 302 | 303 | variable function 304 | 305 | arg_parse 306 | load_hw_desc_file $hw_desc_file 307 | foreach fn "processor intc memory serial reset_gpio flash ethernet" { 308 | eval "variable ${fn}_dict {[simple_yaml_parser ${db_dir}/${fn}.yaml]}" 309 | eval "set temp_dict \$${fn}_dict" 310 | debug "petalinux_hsm_bridge" "temp_dict : $temp_dict" 311 | } 312 | 313 | read_config 314 | hsi get_property DEVICE [hsi get_hw_designs] 315 | if {[string equal -nocase $function "u-boot_bsp"]} { 316 | add_def_ip_list 317 | uboot_config_gen 318 | } elseif {[string equal -nocase $function "soc_mapping"]} { 319 | if { ![ file isdirectory $db_dir ] } { 320 | puts "Unable to find output directory - $db_dir" 321 | } 322 | if { ![file isdirectory $sw_design] } { 323 | puts "Unable to find sw_design - $sw_design" 324 | } 325 | if { ![file isdirectory $repo] } { 326 | puts "Unable to find repo - $repo" 327 | } 328 | hsi set_repo_path $repo 329 | set target_os "device_tree" 330 | set dtsifile "" 331 | hsi open_sw_design "$sw_design/device-tree.mss" 332 | # copy device tree out of here 333 | foreach tmpdts {skeleton.dtsi versal.dtsi zynq-7000.dtsi zynqmp.dtsi \ 334 | pcw.dtsi pl.dtsi zynqmp-clk-ccf.dtsi versal-clk.dtsi \ 335 | versal-net.dtsi versal-net-clk-ccf.dtsi versal-net-clk.dtsi \ 336 | } { 337 | if {[file exists "${out_dir}/${tmpdts}"]} { 338 | lappend dtsifile "${tmpdts}" 339 | if { \ 340 | [string equal -nocase "zynq-7000.dtsi" ${tmpdts}] \ 341 | || [string equal -nocase "zynqmp.dtsi" ${tmpdts}] \ 342 | || [string equal -nocase "versal.dtsi" ${tmpdts}] \ 343 | || [string equal -nocase "versal-net.dtsi" ${tmpdts}] \ 344 | } { 345 | create_soc_mapping_from_dts_file ${out_dir}/${tmpdts} 346 | } 347 | } 348 | } 349 | if {[file exists "${out_dir}/system.dts"]} { 350 | file delete -force "${out_dir}/system.dts" 351 | } 352 | # now generate the system config dtsi 353 | set machinename [dict get $kconfig_dict subsys_conf machine_name] 354 | set dtsifile "" 355 | if {[file exists "${out_dir}/${machinename}.dtsi"]} { 356 | set dtsifile "${out_dir}/${machinename}.dtsi" 357 | } 358 | generate_system_dtsi ${out_dir}/system-conf.dtsi ${dtsifile} 359 | update_alias_node "system-top.dts" 360 | add_dtsi "system-top.dts" "system-user.dtsi" 361 | } elseif {[string equal -nocase $function "sys-property"]} { 362 | report_sys_property 363 | } else { 364 | debug 1 "function name is not valid" 365 | } 366 | 367 | exit 0 368 | -------------------------------------------------------------------------------- /gen-machine-scripts/configs/Kconfig.bootcompconfigurations: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | 6 | if !SUBSYSTEM_SDT_FLOW && SYSTEM_ZYNQMP 7 | menu "PMUFW Configuration" 8 | if SUBSYSTEM_DISTRO_PETALINUX 9 | config SUBSYSTEM_PMUFW_BSPCOMPILER_FLAGSSET 10 | bool 11 | default y if SUBSYSTEM_PMUFW_BSPCOMPILER_FLAGS != "" 12 | 13 | config SUBSYSTEM_PMUFW_BSPCOMPILER_FLAGS 14 | string "PMUFW BSP extra compiler flags" 15 | default "" 16 | help 17 | PMUFW BSP extra compiler flags. You can specify multiple flags separated with space. 18 | E.g: -DXSK_ACCESS_USER_EFUSE for enabling USER EFUSE access 19 | endif 20 | 21 | config SUBSYSTEM_PMUFW_COMPILER_EXTRA_FLAGS 22 | string "PMUFW compiler flags" 23 | default "" 24 | help 25 | PMUFW compilation flags. You can specify multiple flags separated with space. 26 | E.g: -DENABLE_IPI_CRC for enabling CRC check on IPI messages 27 | 28 | endmenu 29 | endif 30 | 31 | if SUBSYSTEM_DISTRO_PETALINUX && !SUBSYSTEM_SDT_FLOW && (SYSTEM_ZYNQMP || SUBSYSTEM_ARCH_ARM) 32 | menu "FSBL Configuration" 33 | config SUBSYSTEM_FSBL_BSPCOMPILER_FLAGSSET 34 | bool 35 | default y if SUBSYSTEM_FSBL_BSPCOMPILER_FLAGS != "" 36 | 37 | config SUBSYSTEM_FSBL_BSPCOMPILER_FLAGS 38 | string "FSBL BSP extra compiler flags" 39 | default "" 40 | help 41 | FSBL BSP extra compiler flags. You can specify multiple flags separated with space. 42 | E.g: -DENABLE_IPI_CRC for enabling CRC check on IPI messages 43 | 44 | config SUBSYSTEM_FSBL_COMPILER_EXTRA_FLAGS 45 | string "FSBL compiler flags" 46 | default "" 47 | help 48 | FSBL compilation flags. You can specify multiple flags separated with space. 49 | E.g: -DFSBL_PROT_BYPASS 50 | 51 | endmenu 52 | endif 53 | 54 | if SUBSYSTEM_ARCH_AARCH64 && !SUBSYSTEM_COMPONENT_TRUSTED__FIRMWARE__ARM_NAME_NONE 55 | menu "Trusted Firmware ARM (TF-A) Configuration" 56 | config SUBSYSTEM_TF-A_MEMORY_SETTINGS 57 | bool "TF-A memory settings" 58 | default n 59 | help 60 | Select this option, if membase and memsize settings of TF-A are to be modified.These are defined already in tfa source. 61 | Use this option inorder to over-ride these values.For further info: ref trusted-firmware-arm/docs/plat/*.md's 62 | 63 | if SUBSYSTEM_TF-A_MEMORY_SETTINGS 64 | config SUBSYSTEM_TF-A_MEM_BASE 65 | hex "TF-A MEM BASE" 66 | default 0xFFFEA000 67 | help 68 | On default the TF-A is placed in OCM memory. Alternatively, the TF-A can be 69 | placed in DRAM by updating TF-A_MEM_BASE and TF-A_MEM_SIZE. 70 | 71 | config SUBSYSTEM_TF-A_MEM_SIZE 72 | hex "TF-A MEM SIZE" 73 | default 0x16000 74 | help 75 | Mention the TF-A size. 76 | endif 77 | 78 | config SUBSYSTEM_TF-A_EXTRA_COMPILER_FLAGS 79 | string "TF-A extra compiler flags" 80 | default "" 81 | help 82 | TF-A extra compilation flags. You can specify multiple flags separated with semicolon. 83 | (NEW!) : ZYNQMP_WDT_RESTART=1 for Special handling to cleanly restart the APU during AWDT recovery 84 | Other E.g. MAKEARCH+=RESET_TO_BL31=1 SPD=tspd; ATF_BUILD_TARGET=bl31 bl32 85 | 86 | if SUBSYSTEM_DISTRO_PETALINUX 87 | config SUBSYSTEM_TF-A_DEBUG 88 | bool "TF-A debug" 89 | default n 90 | help 91 | Select this option for selecting TF-A debug mode 92 | endif 93 | 94 | endmenu 95 | endif 96 | 97 | if SUBSYSTEM_ARCH_AARCH64 98 | menu "optee configuration" 99 | config SUBSYSTEM_OPTEE 100 | bool "OP-TEE config" 101 | default "" 102 | help 103 | Select this option for enable/disable OP-TEE 104 | endmenu 105 | endif 106 | 107 | if !SUBSYSTEM_COMPONENT_U__BOOT_NAME_NONE 108 | menu "u-boot Configuration" 109 | config SUBSYSTEM_UBOOT_CONFIG_TARGET 110 | string "u-boot config target" 111 | help 112 | Keep empty or specify auto/AUTO it will point to the default 113 | defconfig file based on the yocto machine name. 114 | Specify a u-boot config target when building u-boot, it will run 115 | run u-boot XXX config target: make XXX_config to configure u-boot 116 | first. 117 | 118 | menu "u-boot script configuration" 119 | config SUBSYSTEM_UBOOT_APPEND_BASEADDR 120 | bool "Append base address to image offsets" 121 | default y 122 | help 123 | Enable this to apped Memory/DDR base address to the offsets specified. 124 | 125 | if SUBSYSTEM_DISTRO_PETALINUX 126 | config SUBSYSTEM_UBOOT_PRE_BOOTENV 127 | string "Pre bootenv" 128 | default "" 129 | help 130 | Add uboot environment variables which will add into boot.scr script. 131 | 132 | menu "JTAG/DDR image offsets" 133 | config SUBSYSTEM_UBOOT_DEVICETREE_OFFSET 134 | string "Devicetree offset" 135 | default 0x1000 if SYSTEM_VERSAL 136 | default 0x100000 if SYSTEM_ZYNQMP 137 | default 0x100000 if SUBSYSTEM_ARCH_ARM 138 | default 0x1e00000 if SUBSYSTEM_ARCH_MICROBLAZE 139 | help 140 | Offset to load the Device-tree to the DDR/JTAG. 141 | 142 | config SUBSYSTEM_UBOOT_KERNEL_OFFSET 143 | hex "Kernel offset" 144 | default 0x200000 if SYSTEM_VERSAL 145 | default 0x200000 if SYSTEM_ZYNQMP 146 | default 0x200000 if SUBSYSTEM_ARCH_ARM 147 | default 0x0 if SUBSYSTEM_ARCH_MICROBLAZE 148 | help 149 | Offset to load the Kernel image to the DDR/JTAG. 150 | 151 | config SUBSYSTEM_UBOOT_RAMDISK_IMAGE_OFFSET 152 | hex "Ramdisk image offset" 153 | default 0x4000000 if SYSTEM_VERSAL 154 | default 0x4000000 if SYSTEM_ZYNQMP 155 | default 0x4000000 if SUBSYSTEM_ARCH_ARM 156 | default 0x2e00000 if SUBSYSTEM_ARCH_MICROBLAZE 157 | help 158 | Offset to load the Ramdisk image to the DDR/JTAG. 159 | 160 | config SUBSYSTEM_UBOOT_FIT_IMAGE_OFFSET 161 | hex "Fit image offset" 162 | default "0x10000000" 163 | help 164 | Offset to load the Fit image to the DDR/JTAG. 165 | 166 | if !SUBSYSTEM_ARCH_MICROBLAZE 167 | config SUBSYSTEM_UBOOT_BOOTSCR_OFFSET 168 | hex "Boot script offset" 169 | default 0x20000000 if SYSTEM_VERSAL 170 | default 0x20000000 if SYSTEM_ZYNQMP 171 | default 0x3000000 if SUBSYSTEM_ARCH_ARM 172 | help 173 | Boot script offset to the DDR/JTAG. 174 | endif 175 | endmenu 176 | 177 | menu "QSPI/OSPI image offsets" 178 | config SUBSYSTEM_UBOOT_QSPI_KERNEL_OFFSET 179 | hex "QSPI/OSPI Kernel offset" 180 | default 0xF00000 if SYSTEM_VERSAL 181 | default 0x3F00000 if SUBSYSTEM_VARIANT_ZYNQMPDR 182 | default 0xF00000 if SYSTEM_ZYNQMP 183 | default 0xA00000 if SUBSYSTEM_ARCH_ARM 184 | default 0xBC0000 if SUBSYSTEM_ARCH_MICROBLAZE 185 | help 186 | Specify the QSPI/OSPI Kernel image offset to read the Kernel image from Flash. 187 | 188 | config SUBSYSTEM_UBOOT_QSPI_KERNEL_SIZE 189 | hex "QSPI/OSPI Kernel size" 190 | default 0x1D00000 if SYSTEM_VERSAL 191 | default 0x1D00000 if SYSTEM_ZYNQMP 192 | default 0x600000 if SUBSYSTEM_ARCH_ARM 193 | default 0x500000 if SUBSYSTEM_ARCH_MICROBLAZE 194 | help 195 | Specify the QSPI/OSPI Kernel image size to read the Kernel image from Flash. 196 | 197 | config SUBSYSTEM_UBOOT_QSPI_RAMDISK_OFFSET 198 | hex "QSPI/OSPI Ramdisk offset" 199 | default 0x2E00000 if SYSTEM_VERSAL 200 | default 0x5D00000 if SUBSYSTEM_VARIANT_ZYNQMPDR 201 | default 0x4000000 if SYSTEM_ZYNQMP 202 | default 0x1000000 if SUBSYSTEM_ARCH_ARM 203 | default 0x4000000 if SUBSYSTEM_ARCH_MICROBLAZE 204 | help 205 | Specify the QSPI/OSPI Ramdisk image offset to read the Ramdisk image from Flash. 206 | 207 | config SUBSYSTEM_UBOOT_QSPI_RAMDISK_SIZE 208 | hex "QSPI/OSPI Ramdisk size" 209 | default 0x4000000 if SYSTEM_VERSAL 210 | default 0x1D00000 if SUBSYSTEM_VARIANT_ZYNQMPDR 211 | default 0x4000000 if SYSTEM_ZYNQMP 212 | default 0xF80000 if SUBSYSTEM_ARCH_ARM 213 | default 0xA00000 if SUBSYSTEM_ARCH_MICROBLAZE 214 | help 215 | Specify the QSPI/OSPI Ramdisk image size to read the Ramdisk image from Flash. 216 | 217 | config SUBSYSTEM_UBOOT_QSPI_FIT_IMAGE_OFFSET 218 | hex "QSPI/OSPI fit image offset" 219 | default 0xF40000 if SYSTEM_VERSAL 220 | default 0x3F80000 if SUBSYSTEM_VARIANT_ZYNQMPDR 221 | default 0xF40000 if SYSTEM_ZYNQMP 222 | default 0xA80000 if SUBSYSTEM_ARCH_ARM 223 | default 0xE00000 if SUBSYSTEM_ARCH_MICROBLAZE 224 | help 225 | Specify the QSPI/OSPI Fit image offset to read the Fit image from Flash. 226 | 227 | config SUBSYSTEM_UBOOT_QSPI_FIT_IMAGE_SIZE 228 | hex "QSPI/OSPI fit image size" 229 | default 0x6400000 if SYSTEM_VERSAL 230 | default 0x3F00000 if SUBSYSTEM_VARIANT_ZYNQMPDR 231 | default 0x6400000 if SYSTEM_ZYNQMP 232 | default 0x1500000 if SUBSYSTEM_ARCH_ARM 233 | default 0xF00000 if SUBSYSTEM_ARCH_MICROBLAZE 234 | help 235 | Specify the QSPI/OSPI Fit image size to read the Fit image from Flash. 236 | 237 | if !SUBSYSTEM_ARCH_MICROBLAZE 238 | config SUBSYSTEM_UBOOT_QSPI_BOOTSCR_OFFSET 239 | string "QSPI/OSPI Boot script offset" 240 | default "AUTO" 241 | help 242 | Specify the QSPI/OSPI boot script offset to read the boot script from Flash. 243 | if QSPI/OSPI boot script offset value modified then QSPI/OSPI boot script size 244 | value should also change. 245 | 246 | config SUBSYSTEM_UBOOT_QSPI_BOOTSCR_SIZE 247 | string "QSPI/OSPI Boot script size" 248 | default "AUTO" 249 | help 250 | Specify the QSPI/OSPI boot script size to read the boot script from Flash. 251 | if QSPI/OSPI boot script size value modified then QSPI/OSPI boot script offset 252 | value should also change. 253 | endif 254 | endmenu 255 | menu "NAND image offsets" 256 | config SUBSYSTEM_UBOOT_NAND_KERNEL_OFFSET 257 | hex "NAND Kernel offset" 258 | default 0x4100000 if SYSTEM_VERSAL 259 | default 0x4100000 if SYSTEM_ZYNQMP 260 | default 0x1000000 if SUBSYSTEM_ARCH_ARM 261 | default 0x0 262 | help 263 | Specify the NAND Kernel image offset to read the Kernel image from Flash. 264 | 265 | config SUBSYSTEM_UBOOT_NAND_KERNEL_SIZE 266 | hex "NAND Kernel size" 267 | default 0x3200000 268 | help 269 | Specify the NAND Kernel image size to read the Kernel image from Flash. 270 | 271 | config SUBSYSTEM_UBOOT_NAND_RAMDISK_OFFSET 272 | hex "NAND Ramdisk offset" 273 | default 0x8200000 if SYSTEM_VERSAL 274 | default 0x7800000 if SYSTEM_ZYNQMP 275 | default 0x4600000 if SUBSYSTEM_ARCH_ARM 276 | default 0x0 277 | help 278 | Specify the NAND ramdisk image offset to load the ramdisk image from Flash. 279 | 280 | config SUBSYSTEM_UBOOT_NAND_RAMDISK_SIZE 281 | hex "NAND Ramdisk size" 282 | default 0x3200000 283 | help 284 | Specify the NAND ramdisk size to load the ramdisk image from Flash. 285 | 286 | config SUBSYSTEM_UBOOT_NAND_FIT_IMAGE_OFFSET 287 | hex "NAND fit image offset" 288 | default 0x4180000 if SYSTEM_VERSAL 289 | default 0x4180000 if SYSTEM_ZYNQMP 290 | default 0x1080000 if SUBSYSTEM_ARCH_ARM 291 | default 0x0 292 | help 293 | Specify the fit image offset to load the fit image from Flash. 294 | 295 | config SUBSYSTEM_UBOOT_NAND_FIT_IMAGE_SIZE 296 | hex "NAND fit image size" 297 | default 0x6400000 298 | help 299 | Specify the NAND fit image size to load the fit image from Flash. 300 | 301 | endmenu 302 | config SUBSYSTEM_UBOOT_KERNEL_IMAGE 303 | string "Kernel image name" 304 | default "Image" if SYSTEM_VERSAL 305 | default "Image" if SYSTEM_ZYNQMP 306 | default "uImage" if SUBSYSTEM_ARCH_ARM 307 | default "linux.bin.ub" if SUBSYSTEM_ARCH_MICROBLAZE 308 | help 309 | Specify the kernel image name. 310 | 311 | config SUBSYSTEM_UBOOT_FIT_IMAGE 312 | string "Fit image name" 313 | default "image.ub" 314 | help 315 | Specify the fit image name. 316 | 317 | endif 318 | endmenu 319 | 320 | if SUBSYSTEM_DISTRO_PETALINUX 321 | if SUBSYSTEM_AUTOCONFIG_U__BOOT 322 | config SUBSYSTEM_NETBOOT_OFFSET 323 | hex "netboot offset" 324 | default 0x1000000 325 | help 326 | Set this to define the memory offset to load the image of netboot command in u-boot. 327 | 328 | config SUBSYSTEM_U__BOOT_TFTPSERVER_IP 329 | string "TFTP Server IP address" 330 | default "AUTO" 331 | help 332 | The IP address of your TFTP file server in the main network interface. 333 | Specify the special value "AUTO" to use the IP address of your 334 | development host. 335 | 336 | endif 337 | config SUBSYSTEM_UBOOT_EXT_DTB 338 | bool "u-boot-ext-dtb" 339 | default n 340 | help 341 | Select this option to build seperate dtb for u-boot. 342 | If user select this option the source files will come from 343 | design using DTG and user can customize the nodes by creating 344 | system-user.dtsi in /project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree 345 | 346 | if SUBSYSTEM_UBOOT_EXT_DTB 347 | config UBOOT_EXT_DTB_FROM_DTS 348 | string "uboot dts file path" 349 | default "" 350 | help 351 | Provide the absolute path for customized .dts file. The build system will use the 352 | provided .dts file and generate the u-boot dtb in /images/linux directory. 353 | NOTE: All dtsi files should be specified here with space separator 354 | which are included in dts file 355 | Example: /u-boot-dt-path/system-top.dts /u-boot-dt-path/zcu102.dtsi 356 | 357 | config UBOOT_DTB_PACKAGE_NAME 358 | string "uboot dtb package name" 359 | default "u-boot.dtb" 360 | help 361 | Select this option to specify desired u-boot dtb name. 362 | Default it will be set to u-boot.dtb 363 | endif 364 | endif 365 | endmenu 366 | 367 | menu "Linux Configuration" 368 | config SUBSYSTEM_LINUX_CONFIG_TARGET 369 | string "linux config target" 370 | help 371 | Keep empty or specify auto/AUTO it will point to the default 372 | defconfig file based on the yocto machine name. 373 | Specify a linux config target when building linux, it will run 374 | run linux XXX config target: make XXX_config to configure linux 375 | first. 376 | 377 | endmenu 378 | endif 379 | -------------------------------------------------------------------------------- /gen-machine-scripts/libs/simple_yaml_parser.tcl: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014-2022, Xilinx, Inc. All rights reserved. 2 | # Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | 6 | proc simple_yaml_parser {ip_data_file} { 7 | set mapping_dict [dict create] 8 | set fp [open $ip_data_file r] 9 | set file_data [read $fp] 10 | set data [split $file_data "\n"] 11 | foreach line $data { 12 | #regsub -all {\s+} $line { } line 13 | if { [regexp "^#.*" $line matched] == 1 || \ 14 | [regexp "^\s+#.*" $line matched] == 1 || \ 15 | [string compare -nocase $line ""] <= 0 } { 16 | continue 17 | } 18 | # TODO: use first none_string started line for tab space(number) detection 19 | # FIXME: use auto detection 20 | regsub -all { } $line {-~#%@} line 21 | #regsub -all { } $line {} line 22 | set data [split $line "@ "] 23 | set data_depth [llength [lsearch -all "$data" "-~#%"]] 24 | eval "set data_depth_$data_depth [lindex $data $data_depth]" 25 | if {$data_depth == 0} { 26 | continue 27 | } 28 | 29 | set tmp 0 30 | set eval_dict_arg "" 31 | while {$tmp <= $data_depth} { 32 | eval "set eval_dict_arg \"$eval_dict_arg \$data_depth_$tmp\"" 33 | set tmp [expr {$tmp + 1}] 34 | } 35 | regsub -all {:} $eval_dict_arg {} eval_dict_arg 36 | regsub -all {^ } $eval_dict_arg {} eval_dict_arg 37 | 38 | # FIXME: use set instead of while loop to get value 39 | #set value [lrange $data [expr $data_depth + 1] [llength $data]] 40 | set tmp [expr $data_depth + 1] 41 | set tmp_depth [expr [llength $data] + 1] 42 | set value "" 43 | while {$tmp <= $tmp_depth} { 44 | eval "set value {$value [lindex $data $tmp]}" 45 | set tmp [expr {$tmp + 1}] 46 | } 47 | regsub -all {^\s+} $value {} value 48 | regsub -all {\s+$} $value {} value 49 | if { [string compare -nocase $value ""] == 0 } { 50 | continue 51 | } 52 | #regsub -all {\\n} $value "\n" value 53 | #regsub -all {\\t} $value "\t" value 54 | debug "yaml_parser" "puts dict set mapping_dict $eval_dict_arg {$value}" 55 | eval "dict set mapping_dict $eval_dict_arg {$value}" 56 | } 57 | close $fp 58 | return $mapping_dict 59 | } 60 | 61 | proc get_db_type_list {db_dict main_key} { 62 | set db_type_list "" 63 | if {![dict exist $db_dict $main_key]} {return} 64 | dict for {db_type conf_data} [dict get $db_dict $main_key] { 65 | set rt_code [catch {dict keys [dict get $db_dict $main_key $db_type]}] 66 | if {$rt_code == 0} { 67 | if {[lsearch -exact $db_type_list $db_type] >= 0} { 68 | continue 69 | } 70 | set db_type_list "$db_type_list $db_type" 71 | } 72 | } 73 | return $db_type_list 74 | } 75 | 76 | proc db_gen_prop_wrapper {fid db_dict ip main_key config_cat config_var} { 77 | set db_type_list [get_db_type_list $db_dict $main_key] 78 | foreach db_type $db_type_list { 79 | db_gen_prop $fid $db_dict $ip $main_key $db_type $config_cat $config_var 80 | } 81 | } 82 | 83 | proc db_gen_prop {fid db_dict ip main_key db_type config_cat config_var} { 84 | debug "db_gen_prop" "$ip main_key : $main_key db_type : $db_type config_cat : $config_cat config_var : $config_var" 85 | if {[dict exist $db_dict $main_key $db_type $config_cat]} { 86 | debug "db_gen_prop1" [dict get $db_dict $main_key $db_type $config_cat] 87 | } else { 88 | return 89 | } 90 | 91 | if {[string equal "kconfig" $db_type]} { 92 | global kconfig_dict 93 | } 94 | 95 | # ensure key exist 96 | set rt_code [catch {dict key [dict get $db_dict $main_key $db_type $config_cat]}] 97 | if {$rt_code != 0} {return} 98 | 99 | dict for {prop prop_mapping} [dict get $db_dict $main_key $db_type $config_cat] { 100 | set real_prop $prop 101 | debug "db_gen_prop" "prop : $prop prop_mapping : $prop_mapping" 102 | if {[regexp -all {%bn%} $prop ] == 1 } { 103 | # FIXME: bank id should read from kconfig 104 | set bank_id 0 105 | set real_prop [regsub -all {%bn%} $prop $bank_id] 106 | } 107 | if {! [dict exist $db_dict $main_key $db_type $config_cat $prop $config_var]} { 108 | continue 109 | } 110 | if {[string equal -nocase "chip_device" $ip]} { 111 | set target_obj [hsi get_hw_designs] 112 | } else { 113 | set target_obj [hsi get_cells -hier $ip] 114 | } 115 | 116 | set key_value [dict get $db_dict $main_key $db_type $config_cat $prop $config_var] 117 | if {[string compare -nocase $key_value ""] <= 0} { 118 | debug "Unknown $config_var" [hsi report_property $target_obj] 119 | continue 120 | } 121 | 122 | # handle different way of getting key_value 123 | if {[string equal "kconfig" $db_type]} { 124 | global kconfig_dict 125 | set kconf_ip_type [lindex [split $prop "?"] 0] 126 | set prop_list [split $prop "?"] 127 | set list_tsize [expr [llength $prop_list] - 1] 128 | set kconf_key [lindex [split $prop "?"] $list_tsize] 129 | set tmp 0 130 | set kconf_path "" 131 | while {$tmp < $list_tsize} { 132 | lappend kconf_path [lindex [split $prop "?"] $tmp] 133 | incr tmp 134 | } 135 | eval set param_value [dict get $kconfig_dict $kconf_path $kconf_key] 136 | } else { 137 | set param_value [hsi get_property $real_prop $target_obj] 138 | } 139 | if {[string compare -nocase $param_value ""] <= 0} { 140 | continue 141 | } 142 | if { "${config_var}" != "uboot_config" } { 143 | # ensure the same ip only been processed once only 144 | if {[dict exist $db_dict $main_key var_count]} { 145 | set var_name_list [dict get $db_dict $main_key var_count] 146 | foreach var_name $var_name_list { 147 | eval global $var_name 148 | eval set tmp $var_name 149 | eval set tmp_value $$var_name 150 | set tmp_value1 ${tmp_value} 151 | eval regsub -all {\%$tmp\%} {$key_value} {$tmp_value} key_value 152 | eval regsub -all {\%$tmp\%} {$param_value} {$tmp_value} param_value 153 | if { $tmp_value == 0 } { 154 | eval regsub -all {\~$tmp\~} {$key_value} {""} key_value 155 | eval regsub -all {\~$tmp\~} {$param_value} {""} param_value 156 | } else { 157 | eval regsub -all {\~$tmp\~} {$key_value} {$tmp_value} key_value 158 | eval regsub -all {\~$tmp\~} {$param_value} {$tmp_value} param_value 159 | } 160 | } 161 | # check if primary string exists in the $config_cat 162 | if {[regexp "^primary_.*" $config_cat matched] == 1} { 163 | if {$tmp_value != 0} { 164 | continue 165 | } 166 | } 167 | } 168 | } 169 | 170 | set striped_config_cat [regsub -all {primary_} $config_cat {}] 171 | debug "db_gen_prop" "striped_config_cat : $striped_config_cat" 172 | #TODO: Clean up 173 | switch -regexp $striped_config_cat { 174 | "config([0-9]|)_value_plus_" { 175 | debug "db_gen_prop" "config([0-9]|)_value_plus_" 176 | set inc_value [regsub -all {config([0-9]|)_value_plus_} $striped_config_cat {} ] 177 | set param_value [format "0x%08x" [expr $param_value + $inc_value]] 178 | } 179 | "config([0-9]|)_chk_.*_str" { 180 | debug "db_gen_prop" "([0-9]|)_chk_.*_str" 181 | set desired_value [regsub -all {config([0-9]|)_chk_} $striped_config_cat {} ] 182 | regsub -all {_str} $desired_value {} desired_value 183 | if {![string equal -nocase $param_value $desired_value]} { 184 | continue 185 | } 186 | puts $fid "$key_value" 187 | continue 188 | } 189 | "config([0-9]|)_chk_.*_custom_define" { 190 | debug "db_gen_prop" "config([0-9]|)_chk_.*_custom_define" 191 | set desired_value [regsub -all {config([0-9]|)_chk_} $striped_config_cat {} ] 192 | regsub -all {_custom_define} $desired_value {} desired_value 193 | if {![string equal -nocase $key_value $desired_value]} { 194 | continue 195 | } 196 | set param_value $key_value 197 | set key_value "remove_me" 198 | } 199 | "config([0-9]|)_chk_.*" { 200 | debug "db_gen_prop" "config([0-9]|)_chk_.*" 201 | set desired_value [regsub -all {config([0-9]|)_chk_} $striped_config_cat {} ] 202 | if {![string equal -nocase $desired_value $param_value]} { 203 | continue 204 | } 205 | } 206 | "custom_define([0-9]|)_chk_.*" { 207 | debug "db_gen_prop" "custom_define([0-9]|)_chk_.*" 208 | set desired_value [regsub -all "custom_define([0-9]|)_chk_" $striped_config_cat {} ] 209 | if {![string equal -nocase $desired_value $param_value]} { 210 | continue 211 | } 212 | set param_value $key_value 213 | set key_value "remove_me" 214 | } 215 | "custom_define([0-9]|)" { 216 | debug "db_gen_prop" "custom_define([0-9]|)" 217 | # check if key define founded 218 | set param_value $key_value 219 | set key_value "remove_me" 220 | } 221 | "undefine([0-9]|)" { 222 | foreach k $key_value { 223 | uboot_conf_undefine $fid $k 224 | } 225 | continue 226 | } 227 | "get_clk" { 228 | continue 229 | } 230 | "define([0-9]|)_chk_not_.*" { 231 | set desired_value [regsub -all {define([0-9]|)_chk_not_} $striped_config_cat {} ] 232 | if {![string equal -nocase $desired_value $param_value]} { 233 | set param_value "" 234 | } else { 235 | continue 236 | } 237 | } 238 | "define_chk([0-9]|)_.*" { 239 | set desired_value [regsub -all "define_chk([0-9]|)_" $striped_config_cat {} ] 240 | if {![string equal -nocase $desired_value $param_value]} { 241 | continue 242 | } 243 | set param_value "" 244 | } 245 | "define([0-9]|)_zero" { 246 | set param_value 0 247 | } 248 | "define([0-9]|)_.*" { 249 | set desired_value [regsub -all "define([0-9]|)_" $striped_config_cat {} ] 250 | set param_value $desired_value 251 | } 252 | "define([0-9]|)" { 253 | set param_value "" 254 | } default { } 255 | } 256 | if { "${config_var}" == "uboot_config" } { 257 | debug "db_gen_prop" "param_value : $param_value key_value : $key_value" 258 | seek ${fid} 0 start 259 | set lines [split [read ${fid}] "\n"] 260 | if {[llength ${param_value}] > 0} { 261 | #remove me or value from hsi property 262 | if {[string compare -nocase $key_value "remove_me"] == 0} { 263 | set first [lindex [split $param_value "="] 0] 264 | set second [lindex [split $param_value "="] 1] 265 | uboot_set_kconfig_value $fid $first $second 266 | } else { 267 | #param_value got from hsi 268 | uboot_set_kconfig_value $fid $key_value $param_value 269 | } 270 | } else { 271 | #only "=y" configs here 272 | uboot_set_kconfig_value $fid $key_value 273 | } 274 | } else { 275 | foreach k $key_value { 276 | debug "db_gen_prop" "set $k to $param_value [string compare -nocase $k "remove_me"]" 277 | if {[string compare -nocase $k "remove_me"] == 0} { 278 | uboot_conf_define $fid "" $param_value 279 | } else { 280 | uboot_conf_define $fid $k $param_value 281 | } 282 | } 283 | } 284 | } 285 | } 286 | 287 | 288 | proc call_dict_functions {fid ip_name db_dict ip ins_type config_cat config_var} { 289 | global func_called_list 290 | foreach ip_var "$ip_name $ins_type" { 291 | foreach call_t "call call_once" { 292 | if {[dict exist $db_dict $ip_var $call_t]} { 293 | if {![dict exist $db_dict $ip_var $call_t $config_var]} { 294 | continue 295 | } 296 | set func_list [dict get $db_dict $ip_var $call_t $config_var] 297 | foreach func $func_list { 298 | if {[lsearch -exact [info procs] $func] < 0} {continue} 299 | if {[string equal "call_once" $call_t]} { 300 | if {[lsearch -exact $func $func_called_list] >= 0} { 301 | continue 302 | } 303 | } 304 | eval "$func \$fid \$db_dict \$ip $ins_type $config_cat $config_var" 305 | lappend func_called_list $func 306 | } 307 | } 308 | } 309 | } 310 | } 311 | 312 | 313 | proc db_gen_config {fid ip_list db_dict tconf_name} { 314 | set config_var $tconf_name 315 | 316 | foreach ip $ip_list { 317 | # special handle for chip_device 318 | if {[string equal -nocase "simple" $ip]} { 319 | set ip_name simple 320 | } elseif {[string equal -nocase "chip_device" $ip]} { 321 | set ip_name $ip 322 | } else { 323 | set ip_obj [hsi get_cell -hier $ip] 324 | set ip_name [hsi get_property IP_NAME $ip_obj] 325 | } 326 | 327 | if {[dict exist $db_dict $ip_name]} { 328 | debug "1" "got ip $ip_name" 329 | if {[dict exist $db_dict $ip_name ip_type]} { 330 | set ins_type [dict get $db_dict $ip_name ip_type] 331 | } else { 332 | set ins_type "" 333 | } 334 | 335 | # get config list 336 | set tconf_list [get_conf_list $db_dict "$ip_name $ins_type"] 337 | 338 | # start fetch data and write to file 339 | foreach config_cat $tconf_list { 340 | db_gen_prop_wrapper $fid $db_dict $ip $ip_name $config_cat $config_var 341 | } 342 | 343 | # get common data for the ip 344 | foreach db_type [get_db_type_list $db_dict $ins_type] { 345 | foreach config_cat $tconf_list { 346 | if {[dict exist $db_dict $ins_type $db_type $config_cat]} { 347 | db_gen_prop_wrapper $fid $db_dict $ip $ins_type $config_cat $config_var 348 | } 349 | } 350 | } 351 | 352 | if { "${config_var}" == "uboot_config" } { 353 | continue 354 | } 355 | 356 | # call functions -- only called once 357 | foreach config_cat $tconf_list { 358 | call_dict_functions $fid $ip_name $db_dict $ip $ins_type $config_cat $config_var 359 | break 360 | } 361 | 362 | # now increase the var_count variables 363 | if {[dict exist $db_dict $ip_name var_count]} { 364 | set var_name_list [dict get $db_dict $ip_name var_count] 365 | foreach var_name $var_name_list { 366 | eval global $var_name 367 | eval incr $var_name 368 | eval set mytest $$var_name 369 | } 370 | } 371 | } 372 | } 373 | } 374 | -------------------------------------------------------------------------------- /lib/multiconfigs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. 4 | # 5 | # Author: 6 | # Raju Kumar Pothuraju 7 | # 8 | # SPDX-License-Identifier: MIT 9 | 10 | 11 | import os 12 | import common_utils 13 | import project_config 14 | import logging 15 | import glob 16 | import pathlib 17 | 18 | logger = logging.getLogger('Gen-Machineconf') 19 | 20 | class ParseMultiConfigFiles(): 21 | def ArmCortexSetup(self): 22 | cpu = self.cpu[4:].replace('-', '') 23 | domain_suffix = '-%s' % self.domain if self.domain and self.domain != 'None' else '' 24 | if self.os_hint != 'None': 25 | if self.os_hint.startswith('linux'): 26 | # Linux is the default OS 27 | mc_name = '' 28 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : self.os_hint }; 29 | else: 30 | mc_name = '%s-%s%s-%s' % (cpu, self.core, domain_suffix, self.os_hint) 31 | self.MultiConfFiles.append(mc_name) 32 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : self.os_hint }; 33 | else: 34 | # Default Cortex-A is Linux 35 | if self.cpu.startswith('arm,cortex-a') and self.core == '0': 36 | mc_name = '' 37 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : 'linux' }; 38 | 39 | # Do we need an FSBL? 40 | if self.args.soc_family in [ 'zynq', 'zynqmp' ] and self.cpu in [ 'arm,cortex-a9', 'arm,cortex-a53', 'arm,cortex-r5' ] and self.core == '0': 41 | mc_name = '%s-fsbl' % cpu 42 | self.MultiConfFiles.append(mc_name) 43 | # Only the cortex-a is the default FSBL 44 | if self.cpu in [ 'arm,cortex-a9', 'arm,cortex-a53' ]: 45 | self.MultiConfMin.append(mc_name) 46 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : 'fsbl' }; 47 | 48 | # Iterate over the non-Linux OSes 49 | NonLinuxOS = [ 'baremetal', 'freertos' ] 50 | if self.cpu in ['arm,cortex-r52', 'arm,cortex-a78']: 51 | NonLinuxOS.append('zephyr') 52 | for os_hint in NonLinuxOS: 53 | mc_name = '%s-%s%s-%s' % (cpu, self.core, domain_suffix, os_hint) 54 | self.MultiConfFiles.append(mc_name) 55 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : os_hint }; 56 | 57 | def MicroblazeSetup(self): 58 | logger.warn('Microblaze configuration detected, this is not supported.') 59 | # Do nothing, this is presumed to be Linux 60 | pass 61 | 62 | def MicroblazeVSetup(self): 63 | cpu = self.cpu.replace('xlnx,','') 64 | if self.args.soc_family == 'microblaze': 65 | mc_name = '' 66 | os_hint = 'linux' 67 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : os_hint}; 68 | # For Mb-v add zephyr as default MC 69 | os_hint = 'zephyr' 70 | mc_name = '%s-%s-%s' % (cpu, self.core, os_hint) 71 | self.MultiConfFiles.append(mc_name) 72 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : os_hint}; 73 | 74 | def ParseCpuDict(self): 75 | for cpuname in self.cpu_info_dict.keys(): 76 | self.cpuname = cpuname 77 | self.cpu, self.core, self.domain, self.os_hint = ( 78 | self.cpu_info_dict[self.cpuname].get(v) for v in ( 79 | 'cpu', 'core', 'domain', 'os_hint')) 80 | if self.cpu.startswith('arm,cortex'): 81 | self.ArmCortexSetup() 82 | elif self.cpu == 'xlnx,microblaze': 83 | self.MicroblazeSetup() 84 | elif self.cpu.startswith('xlnx,microblaze-riscv'): 85 | self.MicroblazeVSetup() 86 | elif self.cpu == 'pmu-microblaze': 87 | mc_name = 'microblaze-pmu' 88 | self.MultiConfFiles.append(mc_name) 89 | self.MultiConfMin.append(mc_name) 90 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : self.os_hint }; 91 | elif self.cpu == 'pmc-microblaze': 92 | mc_name = 'microblaze-pmc' 93 | self.MultiConfFiles.append(mc_name) 94 | self.MultiConfMin.append(mc_name) 95 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : self.os_hint }; 96 | elif self.cpu == 'psm-microblaze': 97 | mc_name = 'microblaze-psm' 98 | self.MultiConfFiles.append(mc_name) 99 | self.MultiConfMin.append(mc_name) 100 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : self.os_hint }; 101 | elif self.cpu == 'xlnx,asu-microblaze_riscv': 102 | mc_name = 'microblaze-riscv-asu' 103 | self.MultiConfFiles.append(mc_name) 104 | self.MultiConfMin.append(mc_name) 105 | self.MultiConfMap[mc_name] = { 'cpuname' : self.cpuname, 'cpu' : self.cpu, 'core' : self.core, 'domain' : self.domain, 'os_hint' : self.os_hint }; 106 | else: 107 | logger.warning('Unknown CPU %s' % self.cpu) 108 | # Return list of conf files if files_only True 109 | return self.MultiConfFiles, self.MultiConfMin 110 | 111 | def __init__(self, args, cpu_info_dict): 112 | self.MultiConfFiles = [] 113 | self.MultiConfMin = [] 114 | self.MultiConfMap = {} 115 | self.cpu_info_dict = cpu_info_dict 116 | self.args = args 117 | 118 | class GenerateMultiConfigFiles(): 119 | def ZephyrConfigurations(self, mc_target): 120 | ZephyrDict = { 121 | 'microblaze' : { 'board' : 'mbv32' }, 122 | 'versal-net' : { 'board' : 'versalnet_rpu'}, 123 | 'versal-2ve-2vm' : { 'board' : 'versal2_rpu'} 124 | } 125 | distro = 'amd-zephyr' 126 | ZephyrVars = '# Zephyr RTOS settings.\n' 127 | board = '' 128 | if ZephyrDict.get(mc_target): 129 | board = ZephyrDict[mc_target].get('board', '') 130 | if board: 131 | ZephyrVars += 'ZEPHYR_BOARD = "%s"\n' % board 132 | return distro, ZephyrVars 133 | 134 | def GenerateMultiConfigs(self): 135 | tuneDict = { 'arm,cortex-a9' : 'cortexa9', 136 | 'arm,cortex-a53' : 'cortexa53', 137 | 'arm,cortex-a72' : 'cortexa72', 138 | 'arm,cortex-a78' : 'cortexa72', 139 | 'arm,cortex-r5' : 'cortexr5', 140 | 'arm,cortex-r52' : 'cortexr52', 141 | 'pmu-microblaze' : 'microblaze-pmu', 142 | 'pmc-microblaze' : 'microblaze-pmc', 143 | 'psm-microblaze' : 'microblaze-psm', 144 | 'xlnx,microblaze-riscv-1.0' : 'riscv32', 145 | 'xlnx,asu-microblaze_riscv' : 'microblaze-riscv-asu' } 146 | 147 | if not self.MultiConfUser or not self.MultiConfMap: 148 | logger.debug("No multilibs enabled.") 149 | return self.MultiConfDict 150 | 151 | bbmulticonfig = [] 152 | for mc_name in self.MultiConfUser: 153 | if mc_name not in self.MultiConfMap: 154 | logger.error("Unable to find selected multiconfig (%s)" % mc_name) 155 | else: 156 | if mc_name == "": 157 | # Generate files here, if needed 158 | pass 159 | else: 160 | mc_filename = self.args.machine + '-' + mc_name 161 | 162 | cpu = self.MultiConfMap[mc_name]['cpu'] 163 | defaulttune = cpu 164 | if cpu in tuneDict: 165 | defaulttune = tuneDict[cpu] 166 | 167 | distro = self.MultiConfMap[mc_name]['os_hint'] 168 | McExtraVars = '' 169 | if cpu == 'pmu-microblaze': 170 | self.MultiConfDict['PmuTune'] = defaulttune 171 | self.MultiConfDict['PmuMcDepends'] = 'mc::%s:pmu-firmware:do_deploy' % mc_filename 172 | self.MultiConfDict['PmuFWDeployDir'] = '${TMPDIR}-%s/deploy/images/${MACHINE}' % mc_filename 173 | distro = 'xilinx-standalone' 174 | elif cpu == 'pmc-microblaze': 175 | self.MultiConfDict['PlmTune'] = defaulttune 176 | self.MultiConfDict['PlmMcDepends'] = 'mc::%s:plm-firmware:do_deploy' % mc_filename 177 | self.MultiConfDict['PlmDeployDir'] = '${TMPDIR}-%s/deploy/images/${MACHINE}' % mc_filename 178 | distro = 'xilinx-standalone' 179 | elif cpu == 'psm-microblaze': 180 | self.MultiConfDict['PsmTune'] = defaulttune 181 | self.MultiConfDict['PsmMcDepends'] = 'mc::%s:psm-firmware:do_deploy' % mc_filename 182 | self.MultiConfDict['PsmFWDeployDir'] = '${TMPDIR}-%s/deploy/images/${MACHINE}' % mc_filename 183 | distro = 'xilinx-standalone-nolto' 184 | elif cpu == 'xlnx,asu-microblaze_riscv': 185 | self.MultiConfDict['AsuTune'] = defaulttune 186 | self.MultiConfDict['AsuMcDepends'] = 'mc::%s:asu-firmware:do_deploy' % mc_filename 187 | self.MultiConfDict['AsuFWDeployDir'] = '${TMPDIR}-%s/deploy/images/${MACHINE}' % mc_filename 188 | distro = 'xilinx-standalone-nolto' 189 | 190 | if distro == 'fsbl': 191 | if cpu in [ 'arm,cortex-a9', 'arm,cortex-a53' ]: 192 | self.MultiConfDict['FsblMcDepends'] = 'mc::%s:fsbl-firmware:do_deploy' % mc_filename 193 | self.MultiConfDict['FsblDeployDir'] = '${TMPDIR}-%s/deploy/images/${MACHINE}' % mc_filename 194 | elif cpu in [ 'arm,cortex-r5' ]: 195 | self.MultiConfDict['R5FsblMcDepends'] = 'mc::%s:fsbl-firmware:do_deploy' % mc_filename 196 | self.MultiConfDict['R5FsblDeployDir'] = '${TMPDIR}-%s/deploy/images/${MACHINE}' % mc_filename 197 | else: 198 | logger.error('Unknown FSBL CPU type %s' % cpu) 199 | distro = 'xilinx-standalone' 200 | elif distro.startswith('baremetal'): 201 | lto = '-nolto' if 'domain' not in self.MultiConfMap[mc_name] or self.MultiConfMap[mc_name]['domain'] == 'None' else '' 202 | distro = 'xilinx-standalone%s' % lto 203 | elif distro.startswith('freertos'): 204 | distro = 'xilinx-freertos' 205 | elif distro.startswith('zephyr'): 206 | mc_target = self.args.soc_family 207 | if self.args.soc_family == 'versal' and self.args.soc_variant == 'net': 208 | mc_target += '-net' 209 | if cpu.startswith('xlnx,microblaze-riscv'): 210 | McExtraVars += '#Risc-V Tune features\n' 211 | McExtraVars += 'require conf/machine/include/riscv/tune-riscv.inc\n' 212 | mc_target = 'microblaze' 213 | distro, ExtraVars = self.ZephyrConfigurations(mc_target) 214 | McExtraVars += ExtraVars 215 | 216 | bbmulticonfig.append(mc_filename) 217 | conf_file = os.path.join(self.args.config_dir, 'multiconfig', mc_filename + '.conf') 218 | with open(conf_file, 'w') as file_f: 219 | if McExtraVars: 220 | file_f.write(McExtraVars) 221 | file_f.write('TMPDIR .= "-${BB_CURRENT_MC}"\n') 222 | file_f.write('\n') 223 | file_f.write('DISTRO = "%s"\n' % distro) 224 | file_f.write('DEFAULTTUNE = "%s"\n' % defaulttune) 225 | 226 | self.MultiConfDict['BBMULTICONFIG'] = ' '.join(bbmulticonfig) 227 | 228 | return self.MultiConfDict 229 | 230 | def __init__(self, args, multi_conf_map, system_conffile=''): 231 | self.MBTunesDone = self.GenLinuxDts = False 232 | self.MultiConfFiles = [] 233 | self.MultiConfMin = [] 234 | self.MultiConfMap = multi_conf_map 235 | self.MultiConfUser = [] 236 | self.MultiConfDict = {} 237 | self.args = args 238 | self.system_conffile = system_conffile 239 | 240 | # Get the BBMC targets from system config file and generate 241 | # multiconfig targets only for enabled 242 | self.MultiConfUser = common_utils.GetConfigValue( 243 | 'CONFIG_YOCTO_BBMC_', system_conffile, 244 | 'choicelist', '=y').lower().replace('_', '-') 245 | self.MultiConfUser = list(self.MultiConfUser.split(' ')) 246 | --------------------------------------------------------------------------------