├── Jenkinsfile ├── conf ├── icicle-kit-es-amp │ ├── defconfig.append │ ├── board.mk │ ├── uEnv_s-mode.txt │ ├── smode_defconfig │ ├── config.yaml │ ├── osbi-fit-image.its │ └── buildroot_initramfs_config ├── initramfs.txt ├── icicle-kit-es │ ├── board.mk │ ├── uEnv_s-mode.txt │ ├── smode_defconfig │ ├── config.yaml │ ├── osbi-fit-image.its │ ├── hss_def_config │ └── buildroot_initramfs_config ├── aries-m100pfsevp │ ├── board.mk │ ├── uEnv_s-mode.txt │ ├── smode_defconfig │ ├── config.yaml │ ├── osbi-fit-image.its │ ├── hss_def_config │ └── buildroot_initramfs_config ├── motd ├── u540-openocd.cfg └── buildroot_rootfs_config ├── .gitignore ├── patches ├── fsbl │ ├── 0001-dont-build-dtb.patch │ ├── 0003-remove-lib-version-build.patch │ └── 0002-import-detect-null.patch └── buildroot │ ├── 0002-Add-Microchip-AMP-examples-package.patch │ └── 0001-mchp_examples-add-polarfire-soc-linux-examples.patch ├── bsp └── env │ └── freedom-u500-unleashed │ └── openocd.cfg ├── .gitmodules ├── .github ├── pull_request_template.md ├── issue_template.md ├── CONTRIBUTING.md └── CODE_OF_CONDUCT.md ├── README.md └── Makefile /Jenkinsfile: -------------------------------------------------------------------------------- 1 | @Library('automated-testing-library') _ 2 | pipelineBRLINUXSDK() 3 | 4 | -------------------------------------------------------------------------------- /conf/icicle-kit-es-amp/defconfig.append: -------------------------------------------------------------------------------- 1 | CONFIG_CMDLINE="earlyprintk debug clk_ignore_unused uio_pdrv_genirq.of_id=generic-uio" -------------------------------------------------------------------------------- /conf/initramfs.txt: -------------------------------------------------------------------------------- 1 | dir /dev 755 0 0 2 | nod /dev/console 644 0 0 c 5 1 3 | nod /dev/null 644 0 0 c 1 3 4 | slink /init /bin/busybox 755 0 0 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.tar.xz 2 | work/ 3 | toolchain 4 | arch/ 5 | include/ 6 | scripts/ 7 | .cache.mk 8 | /conf/old_configs 9 | *.orig 10 | rootfs.tar.gz 11 | br-dl-dir/ 12 | -------------------------------------------------------------------------------- /conf/icicle-kit-es-amp/board.mk: -------------------------------------------------------------------------------- 1 | HSS_SUPPORT ?= y 2 | HSS_TARGET ?= mpfs-icicle-kit-es 3 | AMP_SUPPORT ?= y 4 | linux_defconfig := mpfs_amp_defconfig 5 | linux_dtb := $(riscv_dtbdir)/microchip/mpfs-icicle-kit-context-a.dtb 6 | -------------------------------------------------------------------------------- /conf/icicle-kit-es/board.mk: -------------------------------------------------------------------------------- 1 | HSS_SUPPORT ?= y 2 | HSS_TARGET ?= mpfs-icicle-kit-es 3 | UBOOT_VERSION = 4b28e3e93ae339d7d29e6b0efc26777bfef714eb 4 | linux_defconfig := mpfs_defconfig 5 | linux_dtb := $(riscv_dtbdir)/microchip/mpfs-icicle-kit.dtb 6 | -------------------------------------------------------------------------------- /conf/aries-m100pfsevp/board.mk: -------------------------------------------------------------------------------- 1 | HSS_SUPPORT ?= y 2 | HSS_TARGET ?= aries-m100pfsevp 3 | UBOOT_VERSION = 4b28e3e93ae339d7d29e6b0efc26777bfef714eb 4 | linux_defconfig := mpfs_defconfig 5 | linux_dtb := $(riscv_dtbdir)/microchip/mpfs-m100pfsevp-sdcard.dtb -------------------------------------------------------------------------------- /conf/aries-m100pfsevp/uEnv_s-mode.txt: -------------------------------------------------------------------------------- 1 | # This is the s-mode U-Boot script for the {,lc-}mpfs development kits. 2 | 3 | # this assumes ${fileaddr} is already set!! 4 | 5 | load mmc 0:2 ${fileaddr} fitImage.fit; 6 | bootm start 0x90000000; 7 | bootm loados 0x90000000; 8 | bootm ramdisk; 9 | bootm fdt; 10 | fdt addr 0x82200000; 11 | bootm prep; 12 | fdt set /soc/ethernet@20112000 mac-address ${icicle_mac_addr0}; 13 | fdt set /soc/ethernet@20110000 mac-address ${icicle_mac_addr1}; 14 | bootm go; 15 | -------------------------------------------------------------------------------- /conf/motd: -------------------------------------------------------------------------------- 1 | This is version v2022.09 of the Polarfire SoC Buildroot SDK. 2 | 3 | Updated images and documentation are available at: 4 | https://github.com/polarfire-soc/ 5 | * FPGA reference design 6 | https://github.com/polarfire-soc/icicle-kit-reference-design/releases 7 | * Yocto releases 8 | https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp/releases 9 | * Buildroot releases 10 | https://github.com/polarfire-soc/polarfire-soc-buildroot-sdk/releases 11 | -------------------------------------------------------------------------------- /patches/fsbl/0001-dont-build-dtb.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile b/Makefile 2 | index 8c4699f..299bb86 100644 3 | --- a/Makefile 4 | +++ b/Makefile 5 | @@ -73,7 +73,7 @@ fsbl.elf: $(LIB_FS1_O) fsbl/main.o $(LIB_FS2_O) ux00_fsbl.lds 6 | board_setup.elf: $(LIB_FS1_O) $(LIB_FS2_O) ux00_fsbl.lds fsbl/main-board_setup.o 7 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.o,$^) -T$(filter %.lds,$^) 8 | 9 | -fsbl/dtb.o: fsbl/ux00_fsbl.dtb 10 | +# fsbl/dtb.o: fsbl/ux00_fsbl.dtb 11 | 12 | zsbl/start.o: zsbl/ux00_zsbl.dtb 13 | 14 | -------------------------------------------------------------------------------- /conf/icicle-kit-es/uEnv_s-mode.txt: -------------------------------------------------------------------------------- 1 | # This is the s-mode U-Boot script for the {,lc-}mpfs development kits. 2 | 3 | # this assumes ${fileaddr} is already set!! 4 | 5 | # Try to boot a fitImage from QSPI or eMMC/SD 6 | if test -n ${mtd_present}; then 7 | mtd read fitimage ${fileaddr} 0x0; 8 | else 9 | load mmc 0:${mmcbootpart} ${fileaddr} fitImage.fit; 10 | fi; 11 | 12 | bootm start ${fileaddr}; 13 | bootm loados ${fileaddr}; 14 | # Try to load a ramdisk if available inside fitImage 15 | bootm ramdisk; 16 | bootm prep; 17 | fdt set /soc/ethernet@20112000 mac-address ${icicle_mac_addr0}; 18 | fdt set /soc/ethernet@20110000 mac-address ${icicle_mac_addr1}; 19 | bootm go; 20 | 21 | -------------------------------------------------------------------------------- /conf/icicle-kit-es-amp/uEnv_s-mode.txt: -------------------------------------------------------------------------------- 1 | # This is the s-mode U-Boot script for the {,lc-}mpfs development kits. 2 | 3 | # this assumes ${fileaddr} is already set!! 4 | 5 | # Try to boot a fitImage from QSPI or eMMC/SD 6 | if test -n ${mtd_present}; then 7 | mtd read fitimage ${fileaddr} 0x0; 8 | else 9 | load mmc 0:${mmcbootpart} ${fileaddr} fitImage.fit; 10 | fi; 11 | 12 | bootm start ${fileaddr}; 13 | bootm loados ${fileaddr}; 14 | # Try to load a ramdisk if available inside fitImage 15 | bootm ramdisk; 16 | bootm prep; 17 | fdt set /soc/ethernet@20112000 mac-address ${icicle_mac_addr0}; 18 | fdt set /soc/ethernet@20110000 mac-address ${icicle_mac_addr1}; 19 | bootm go; 20 | 21 | -------------------------------------------------------------------------------- /conf/aries-m100pfsevp/smode_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_RISCV=y 2 | CONFIG_SYS_MALLOC_F_LEN=0x2000 3 | CONFIG_ENV_SIZE=0x2000 4 | CONFIG_DEFAULT_DEVICE_TREE="m100pfsevp" 5 | CONFIG_TARGET_ARIES_M100PFSEVP=y 6 | CONFIG_ARCH_RV64I=y 7 | CONFIG_RISCV_SMODE=y 8 | CONFIG_DISTRO_DEFAULTS=y 9 | CONFIG_FIT=y 10 | CONFIG_DISPLAY_CPUINFO=y 11 | CONFIG_DISPLAY_BOARDINFO=y 12 | CONFIG_SYS_PROMPT="RISC-V # " 13 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 14 | CONFIG_BOOTP_SEND_HOSTNAME=y 15 | CONFIG_DM_MTD=y 16 | CONFIG_BOOTCOMMAND="setenv fileaddr 0x90000000; load mmc 0:2 ${fileaddr} boot.scr; source ${fileaddr};" 17 | CONFIG_SYS_BOOT_RAMDISK_HIGH=y 18 | CONFIG_DM_I2C=y 19 | CONFIG_SYS_I2C_MICROCHIP=y 20 | CONFIG_CMD_I2C=y 21 | CONFIG_SYS_I2C_SPEED=100000 22 | CONFIG_SYS_LOAD_ADDR=0x80200000 23 | -------------------------------------------------------------------------------- /patches/fsbl/0003-remove-lib-version-build.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile b/Makefile 2 | index 87b35e2..80f13d9 100644 3 | --- a/Makefile 4 | +++ b/Makefile 5 | @@ -52,12 +52,6 @@ elf: $(ELF) 6 | 7 | asm: $(ASM) 8 | 9 | -lib/version.c: .git/HEAD .git/index 10 | - echo "const char *gitid = \"$(shell git describe --always --dirty)\";" > lib/version.c 11 | - echo "const char *gitdate = \"$(shell git log -n 1 --date=short --format=format:"%ad.%h" HEAD)\";" >> lib/version.c 12 | - echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" >> lib/version.c 13 | -# echo "const char *gitstatus = \"$(shell git status -s )\";" >> lib/version.c 14 | - 15 | zsbl/ux00boot.o: ux00boot/ux00boot.c 16 | $(CC) $(CFLAGS) -DUX00BOOT_BOOT_STAGE=0 -c -o $@ $^ 17 | 18 | -------------------------------------------------------------------------------- /bsp/env/freedom-u500-unleashed/openocd.cfg: -------------------------------------------------------------------------------- 1 | adapter_khz 10000 2 | 3 | interface ftdi 4 | ftdi_device_desc "Dual RS232-HS" 5 | ftdi_vid_pid 0x0403 0x6010 6 | 7 | ftdi_layout_init 0x0008 0x001b 8 | ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020 9 | 10 | set _CHIPNAME riscv 11 | jtag newtap $_CHIPNAME cpu -irlen 5 12 | 13 | set _TARGETNAME $_CHIPNAME.cpu 14 | target create $_TARGETNAME riscv -chain-position $_TARGETNAME -rtos riscv 15 | $_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 16 | 17 | flash bank onboard_spi_flash fespi 0x20000000 0 0 0 $_TARGETNAME 0x10040000 18 | init 19 | halt 20 | 21 | # Uncomment this if you want to be able to clobber your SPI Flash, which 22 | # probably you don't since you can do it through Linux 23 | 24 | # flash protect 0 0 last off 25 | -------------------------------------------------------------------------------- /conf/u540-openocd.cfg: -------------------------------------------------------------------------------- 1 | adapter_khz 10000 2 | 3 | interface ftdi 4 | ftdi_device_desc "Dual RS232-HS" 5 | ftdi_vid_pid 0x0403 0x6010 6 | 7 | ftdi_layout_init 0x0008 0x001b 8 | ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020 9 | 10 | set _CHIPNAME riscv 11 | jtag newtap $_CHIPNAME cpu -irlen 5 12 | 13 | set _TARGETNAME $_CHIPNAME.cpu 14 | target create $_TARGETNAME riscv -chain-position $_TARGETNAME -rtos riscv 15 | $_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 16 | 17 | gdb_memory_map disable 18 | 19 | flash bank onboard_spi_flash fespi 0x20000000 0 0 0 $_TARGETNAME 0x10040000 20 | init 21 | halt 22 | 23 | # Uncomment this if you want to be able to clobber your SPI Flash, which 24 | # probably you don't since you can do it through Linux 25 | 26 | # flash protect 0 0 last off 27 | -------------------------------------------------------------------------------- /conf/icicle-kit-es/smode_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_RISCV=y 2 | CONFIG_SYS_MALLOC_F_LEN=0x2000 3 | CONFIG_ENV_SIZE=0x2000 4 | CONFIG_DEFAULT_DEVICE_TREE="microchip-mpfs-icicle-kit" 5 | CONFIG_TARGET_MICROCHIP_ICICLE=y 6 | CONFIG_ARCH_RV64I=y 7 | CONFIG_RISCV_SMODE=y 8 | CONFIG_DISTRO_DEFAULTS=y 9 | CONFIG_FIT=y 10 | CONFIG_DISPLAY_CPUINFO=y 11 | CONFIG_DISPLAY_BOARDINFO=y 12 | CONFIG_SYS_PROMPT="RISC-V # " 13 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 14 | CONFIG_BOOTP_SEND_HOSTNAME=y 15 | CONFIG_DM_MTD=y 16 | CONFIG_BOOTCOMMAND="setenv fileaddr 0x1030000000; setenv mmcbootpart 2; run bootcmd_qspi; setenv scriptname boot.scr; load mmc 0:${mmcbootpart} ${scriptaddr} ${scriptname}; source ${scriptaddr}" 17 | CONFIG_SYS_BOOT_RAMDISK_HIGH=y 18 | CONFIG_DM_I2C=y 19 | CONFIG_SYS_I2C_MICROCHIP=y 20 | CONFIG_CMD_I2C=y 21 | CONFIG_SYS_I2C_SPEED=100000 22 | CONFIG_SYS_LOAD_ADDR=0x100200000 23 | CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-nand0:8m(payload),128k(env),48m(fitimage)" 24 | -------------------------------------------------------------------------------- /conf/icicle-kit-es-amp/smode_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_RISCV=y 2 | CONFIG_SYS_MALLOC_F_LEN=0x2000 3 | CONFIG_ENV_SIZE=0x2000 4 | CONFIG_DEFAULT_DEVICE_TREE="microchip-mpfs-icicle-kit" 5 | CONFIG_TARGET_MICROCHIP_ICICLE=y 6 | CONFIG_ARCH_RV64I=y 7 | CONFIG_RISCV_SMODE=y 8 | CONFIG_DISTRO_DEFAULTS=y 9 | CONFIG_FIT=y 10 | CONFIG_DISPLAY_CPUINFO=y 11 | CONFIG_DISPLAY_BOARDINFO=y 12 | CONFIG_SYS_PROMPT="RISC-V # " 13 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 14 | CONFIG_BOOTP_SEND_HOSTNAME=y 15 | CONFIG_DM_MTD=y 16 | CONFIG_BOOTCOMMAND="setenv fileaddr 0x1030000000; setenv mmcbootpart 2; run bootcmd_qspi; setenv scriptname boot.scr; load mmc 0:${mmcbootpart} ${scriptaddr} ${scriptname}; source ${scriptaddr}" 17 | CONFIG_SYS_BOOT_RAMDISK_HIGH=y 18 | CONFIG_DM_I2C=y 19 | CONFIG_SYS_I2C_MICROCHIP=y 20 | CONFIG_CMD_I2C=y 21 | CONFIG_SYS_I2C_SPEED=100000 22 | CONFIG_SYS_LOAD_ADDR=0x100200000 23 | CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-nand0:8m(payload),128k(env),48m(fitimage)" 24 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "linux"] 2 | path = linux 3 | url = https://github.com/linux4microchip/linux.git 4 | [submodule "buildroot"] 5 | path = buildroot 6 | url = https://github.com/buildroot/buildroot.git 7 | [submodule "riscv-gnu-toolchain"] 8 | path = riscv-gnu-toolchain 9 | url = https://github.com/riscv/riscv-gnu-toolchain.git 10 | [submodule "opensbi"] 11 | path = opensbi 12 | url = https://github.com/riscv/opensbi.git 13 | [submodule "riscv-openocd"] 14 | path = riscv-openocd 15 | url = https://github.com/riscv/riscv-openocd.git 16 | [submodule "fsbl"] 17 | path = fsbl 18 | url = https://github.com/sifive/freedom-u540-c000-bootloader.git 19 | [submodule "polarfire-soc-examples/polarfire-soc-linux-examples"] 20 | path = polarfire-soc-examples/polarfire-soc-linux-examples 21 | url = https://github.com/polarfire-soc/polarfire-soc-linux-examples.git 22 | [submodule "polarfire-soc-examples/polarfire-soc-amp-examples"] 23 | path = polarfire-soc-examples/polarfire-soc-amp-examples 24 | url = https://github.com/polarfire-soc/polarfire-soc-amp-examples.git 25 | -------------------------------------------------------------------------------- /conf/aries-m100pfsevp/config.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # HSS Payload Generator - buildroot configuration file 3 | # 4 | 5 | # First, we can optionally set a name for our image, otherwise one will be created dynamically 6 | set-name: 'PolarFire-SoC-HSS::U-Boot' 7 | 8 | # 9 | # Next, we'll define the entry point addresses for each hart, as follows: 10 | # 11 | hart-entry-points: {u54_1: '0x80200000', u54_2: '0x80200000', u54_3: '0x80200000', u54_4: '0x80200000'} 12 | 13 | # 14 | # Finally, we'll define a payloads (source binary file) that will be placed at certain regions in memory 15 | # The payload section is defined with the keyword payloads, and then a number of individual 16 | # payload descriptors. 17 | # 18 | # Each payload has a name (path to its ELF/bin file), an owner-hart, and optionally 1-3 secondary-harts. 19 | # 20 | # Additionally, it has a privilege mode in which it will start execution. 21 | # * Valid privilege modes are PRV_M, PRV_S and PRV_U. 22 | # 23 | # 24 | # In this case, the only payload is the u-boot s-mode binary. 25 | # 26 | # Case only matters for the ELF path names, not the keywords. 27 | # 28 | payloads: 29 | u-boot.bin: {exec-addr: '0x80200000', owner-hart: u54_1, secondary-hart: u54_2, secondary-hart: u54_3, secondary-hart: u54_4, priv-mode: prv_s} 30 | -------------------------------------------------------------------------------- /conf/icicle-kit-es/config.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # HSS Payload Generator - buildroot configuration file 3 | # 4 | 5 | # First, we can optionally set a name for our image, otherwise one will be created dynamically 6 | set-name: 'PolarFire-SoC-HSS::U-Boot' 7 | 8 | # 9 | # Next, we'll define the entry point addresses for each hart, as follows: 10 | # 11 | hart-entry-points: {u54_1: '0x1000200000', u54_2: '0x1000200000', u54_3: '0x1000200000', u54_4: '0x1000200000'} 12 | # 13 | # Finally, we'll define a payloads (source binary file) that will be placed at certain regions in memory 14 | # The payload section is defined with the keyword payloads, and then a number of individual 15 | # payload descriptors. 16 | # 17 | # Each payload has a name (path to its ELF/bin file), an owner-hart, and optionally 1-3 secondary-harts. 18 | # 19 | # Additionally, it has a privilege mode in which it will start execution. 20 | # * Valid privilege modes are PRV_M, PRV_S and PRV_U. 21 | # 22 | # 23 | # In this case, the only payload is the u-boot s-mode binary. 24 | # 25 | # Case only matters for the ELF path names, not the keywords. 26 | # 27 | payloads: 28 | u-boot.bin: {exec-addr: '0x1000200000', owner-hart: u54_1, secondary-hart: u54_2, secondary-hart: u54_3, secondary-hart: u54_4, priv-mode: prv_s} 29 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please include a summary of the changes and the related issue. Explain why this change is needed, what bugs are fixed or why this feature should be merged. List any dependencies that are required for this change. 4 | 5 | Fixes # (issue) 6 | 7 | ## Type of change 8 | 9 | Please delete options that are not relevant. 10 | 11 | - [ ] Bug fix (non-breaking change which fixes an issue) 12 | - [ ] New feature (non-breaking change which adds functionality) 13 | - [ ] This change requires a documentation update 14 | 15 | # How Has This Been Tested? 16 | 17 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration 18 | 19 | - [ ] Test A 20 | - [ ] Test B 21 | 22 | **Test Configuration**: 23 | * Reference design release: 24 | * Hardware: 25 | * HSS version: 26 | * Bare metal examples version: 27 | * Buildroot / Yocto release: 28 | 29 | # Checklist: 30 | 31 | - [ ] I have reviewed my code 32 | - [ ] I have made corresponding changes to the documentation 33 | - [ ] My changes generate no new warnings 34 | - [ ] I have tested that my fix is effective or that my feature works 35 | - [ ] I have added a maintainers file for any new board support 36 | -------------------------------------------------------------------------------- /conf/icicle-kit-es-amp/config.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # HSS Payload Generator - buildroot configuration file 3 | # 4 | 5 | # First, we can optionally set a name for our image, otherwise one will be created dynamically 6 | set-name: 'PolarFire-SoC-HSS::Linux + FreeRTOS AMP' 7 | 8 | # 9 | # Next, we'll define the entry point addresses for each hart, as follows: 10 | # 11 | hart-entry-points: {u54_1: '0x1000200000', u54_2: '0x1000200000', u54_3: '0x1000200000', u54_4: '0x81000000'} 12 | # 13 | # Finally, we'll define a payloads (source binary file) that will be placed at certain regions in memory 14 | # The payload section is defined with the keyword payloads, and then a number of individual 15 | # payload descriptors. 16 | # 17 | # Each payload has a name (path to its ELF/bin file), an owner-hart, and optionally 1-3 secondary-harts. 18 | # 19 | # Additionally, it has a privilege mode in which it will start execution. 20 | # * Valid privilege modes are PRV_M, PRV_S and PRV_U. 21 | # 22 | # 23 | # In this case, we have two payloads, one for Linux context one and another one for FreeRTOS context 24 | # 25 | # Case only matters for the ELF path names, not the keywords. 26 | # 27 | payloads: 28 | u-boot.bin: {exec-addr: '0x1000200000', owner-hart: u54_1, secondary-hart: u54_2, secondary-hart: u54_3, priv-mode: prv_s} 29 | mpfs-rpmsg-remote.elf: {exec-addr: '0x1075BB0000', owner-hart: u54_4, priv-mode: prv_m, skip-opensbi: true} 30 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | # Microchip PolarFire SoC Issue Template 2 | 3 | [discussion-forum]: https://github.com/polarfire-soc/polarfire-soc-documentation/discussions 4 | 5 | ## Checklist 6 | 7 | Please complete this checklist before filing an issue: 8 | - [ ] Are you using the latest releases of our deliverables? 9 | - If not please update to the latest version of the each deliverable needed (reference design, HSS, Linux / bare metal example) and re-test as this issue may already have been resolved. 10 | - [ ] Is this something you can debug and fix? 11 | - Send a pull request! Bug fixes and documentation fixes are welcome. 12 | - [ ] Have a usage question? 13 | - Ask your question on our [discussion forum](discussion-forum). We use the discussion forum for usage questions. 14 | - [ ] Have an idea for a feature? 15 | - Post the feature request on the [discussion forum](discussion-forum). This will allow us to assess and plan for the feature without having an open issue until it is released. GitHub issues should only be used for code bugs. 16 | - [ ] Is this issue directly related to Microchip code? I.e have you found an upstream bug? 17 | - If so please open an issue against the upstream repository and not the Microchip fork. 18 | 19 | 20 | ## None of the above, create an issue 21 | 22 | Please make sure to add all the information needed to understand the bug so that someone can help. If the info is missing we'll add the 'Needs more information' label and close the issue until there is enough information. 23 | 24 | - [ ] Provide a minimal code snippet example that reproduces the bug where appropriate. 25 | - [ ] Provide screenshots where appropriate 26 | - [ ] Does this occur all of the time or is it intermittent? 27 | - [ ] Have you tried on another board? 28 | -------------------------------------------------------------------------------- /conf/aries-m100pfsevp/osbi-fit-image.its: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | description = "U-Boot fitImage for the MPFS"; 5 | #address-cells = <1>; 6 | 7 | images { 8 | vmlinux.bin { 9 | description = "Linux kernel"; 10 | data = /incbin/("../../work/vmlinux.bin"); 11 | type = "kernel"; 12 | arch = "riscv"; 13 | os = "linux"; 14 | compression = "none"; 15 | load = <0x80200000>; 16 | entry = <0x80200000>; 17 | hash-1 { 18 | algo = "sha256"; 19 | }; 20 | }; 21 | initramfs.cpio.gz { 22 | description = "buildroot initramfs"; 23 | data = /incbin/("../../work/initramfs.cpio.gz"); 24 | type = "ramdisk"; 25 | arch = "riscv"; 26 | os = "linux"; 27 | load = <0x84000000>; 28 | hash-1 { 29 | algo = "sha256"; 30 | }; 31 | }; 32 | riscvpc.dtb { 33 | description = "Flattened Device Tree blob"; 34 | data = /incbin/("../../work/riscvpc.dtb"); 35 | type = "flat_dt"; 36 | arch = "riscv"; 37 | compression = "none"; 38 | load = <0x82200000>; 39 | hash-1 { 40 | algo = "sha256"; 41 | }; 42 | }; 43 | }; 44 | 45 | configurations { 46 | default = "conf-riscvpc.dtb"; 47 | conf-riscvpc.dtb { 48 | description = "1 Linux kernel, initramfs, FDT blob"; 49 | kernel = "vmlinux.bin"; 50 | ramdisk = "initramfs.cpio.gz"; 51 | fdt = "riscvpc.dtb"; 52 | hash-1 { 53 | algo = "sha256"; 54 | }; 55 | }; 56 | }; 57 | }; -------------------------------------------------------------------------------- /conf/icicle-kit-es-amp/osbi-fit-image.its: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | description = "U-Boot fitImage for the MPFS"; 5 | #address-cells = <2>; 6 | 7 | images { 8 | vmlinux.bin { 9 | description = "Linux kernel"; 10 | data = /incbin/("../../work/vmlinux.bin"); 11 | type = "kernel"; 12 | arch = "riscv"; 13 | os = "linux"; 14 | compression = "none"; 15 | load = <0x10 0x0200000>; 16 | entry = <0x10 0x0200000>; 17 | hash-1 { 18 | algo = "sha256"; 19 | }; 20 | }; 21 | initramfs.cpio.gz { 22 | description = "buildroot initramfs"; 23 | data = /incbin/("../../work/initramfs.cpio.gz"); 24 | type = "ramdisk"; 25 | arch = "riscv"; 26 | os = "linux"; 27 | load = <0x10 0x40000000>; 28 | hash-1 { 29 | algo = "sha256"; 30 | }; 31 | }; 32 | riscvpc.dtb { 33 | description = "Flattened Device Tree blob"; 34 | data = /incbin/("../../work/riscvpc.dtb"); 35 | type = "flat_dt"; 36 | arch = "riscv"; 37 | compression = "none"; 38 | load = <0x10 0x2200000>; 39 | hash-1 { 40 | algo = "sha256"; 41 | }; 42 | }; 43 | }; 44 | 45 | configurations { 46 | default = "conf-riscvpc.dtb"; 47 | conf-riscvpc.dtb { 48 | description = "1 Linux kernel, initramfs, FDT blob"; 49 | kernel = "vmlinux.bin"; 50 | ramdisk = "initramfs.cpio.gz"; 51 | fdt = "riscvpc.dtb"; 52 | hash-1 { 53 | algo = "sha256"; 54 | }; 55 | }; 56 | }; 57 | }; 58 | -------------------------------------------------------------------------------- /conf/icicle-kit-es/osbi-fit-image.its: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | description = "U-Boot fitImage for the MPFS"; 5 | #address-cells = <2>; 6 | 7 | images { 8 | vmlinux.bin { 9 | description = "Linux kernel"; 10 | data = /incbin/("../../work/vmlinux.bin"); 11 | type = "kernel"; 12 | arch = "riscv"; 13 | os = "linux"; 14 | compression = "none"; 15 | load = <0x10 0x0200000>; 16 | entry = <0x10 0x0200000>; 17 | hash-1 { 18 | algo = "sha256"; 19 | }; 20 | }; 21 | initramfs.cpio.gz { 22 | description = "buildroot initramfs"; 23 | data = /incbin/("../../work/initramfs.cpio.gz"); 24 | type = "ramdisk"; 25 | arch = "riscv"; 26 | os = "linux"; 27 | load = <0x10 0x40000000>; 28 | hash-1 { 29 | algo = "sha256"; 30 | }; 31 | }; 32 | riscvpc.dtb { 33 | description = "Flattened Device Tree blob"; 34 | data = /incbin/("../../work/riscvpc.dtb"); 35 | type = "flat_dt"; 36 | arch = "riscv"; 37 | compression = "none"; 38 | load = <0x10 0x2200000>; 39 | hash-1 { 40 | algo = "sha256"; 41 | }; 42 | }; 43 | }; 44 | 45 | configurations { 46 | default = "conf-riscvpc.dtb"; 47 | conf-riscvpc.dtb { 48 | description = "1 Linux kernel, initramfs, FDT blob"; 49 | kernel = "vmlinux.bin"; 50 | ramdisk = "initramfs.cpio.gz"; 51 | fdt = "riscvpc.dtb"; 52 | hash-1 { 53 | algo = "sha256"; 54 | }; 55 | }; 56 | }; 57 | }; 58 | -------------------------------------------------------------------------------- /patches/fsbl/0002-import-detect-null.patch: -------------------------------------------------------------------------------- 1 | From ec746a9216e18d31a72407c93de51901a46f7669 Mon Sep 17 00:00:00 2001 2 | From: Palmer Dabbelt 3 | Date: Wed, 14 Aug 2019 18:05:01 -0700 4 | Subject: [PATCH 2/3] Don't warn on our odd main arguments 5 | 6 | Signed-off-by: Palmer Dabbelt 7 | --- 8 | Makefile | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/Makefile b/Makefile 12 | index ae023e9..d2fa53a 100644 13 | --- a/Makefile 14 | +++ b/Makefile 15 | @@ -8,7 +8,7 @@ CC=${CROSSCOMPILE}gcc 16 | LD=${CROSSCOMPILE}ld 17 | OBJCOPY=${CROSSCOMPILE}objcopy 18 | OBJDUMP=${CROSSCOMPILE}objdump 19 | -CFLAGS=-I. -O2 -ggdb -march=rv64imafdc -mabi=lp64d -Wall -mcmodel=medany -mexplicit-relocs 20 | +CFLAGS=-I. -O2 -ggdb -march=rv64imafdc -mabi=lp64d -Wall -mcmodel=medany -mexplicit-relocs -Wno-main 21 | CCASFLAGS=-I. -mcmodel=medany -mexplicit-relocs 22 | LDFLAGS=-nostdlib -nostartfiles 23 | 24 | 25 | From 068041f77c63dd1878376ba54d29c9f227a8a2d4 Mon Sep 17 00:00:00 2001 26 | From: Palmer Dabbelt 27 | Date: Wed, 14 Aug 2019 18:26:04 -0700 28 | Subject: [PATCH 3/3] Import __libc_detect_null as detect_null 29 | 30 | This is a newlib function that doesn't exist in glibc, so just import 31 | it. Fixes https://github.com/sifive/freedom-u540-c000-bootloader/issues/15 . 32 | 33 | Signed-off-by: Palmer Dabbelt 34 | --- 35 | lib/strlen.c | 10 +++++++++- 36 | 1 file changed, 9 insertions(+), 1 deletion(-) 37 | 38 | diff --git a/lib/strlen.c b/lib/strlen.c 39 | index 565955f..3d6addf 100644 40 | --- a/lib/strlen.c 41 | +++ b/lib/strlen.c 42 | @@ -17,6 +17,14 @@ 43 | #include 44 | #include 45 | 46 | +static __inline unsigned long detect_null(unsigned long w) 47 | +{ 48 | + unsigned long mask = 0x7f7f7f7f; 49 | + if (sizeof (long) == 8) 50 | + mask = ((mask << 16) << 16) | mask; 51 | + return ~(((w & mask) + mask) | w | mask); 52 | +} 53 | + 54 | size_t strlen(const char *str) 55 | { 56 | const char *start = str; 57 | @@ -35,7 +43,7 @@ size_t strlen(const char *str) 58 | } while ((uintptr_t)str & (sizeof (long) - 1)); 59 | 60 | unsigned long *ls = (unsigned long *)str; 61 | - while (!__libc_detect_null (*ls++)) 62 | + while (!detect_null (*ls++)) 63 | ; 64 | asm volatile ("" : "+r"(ls)); /* prevent "optimization" */ 65 | 66 | -------------------------------------------------------------------------------- /conf/aries-m100pfsevp/hss_def_config: -------------------------------------------------------------------------------- 1 | # Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) 2 | 3 | # 4 | # Services 5 | # 6 | CONFIG_SERVICE_BOOT=y 7 | 8 | # 9 | # Boot Service 10 | # 11 | CONFIG_SERVICE_BOOT_SETS_SUPPORT=y 12 | CONFIG_SERVICE_BOOT_DDR_TARGET_ADDR=0xA0000000 13 | # CONFIG_SERVICE_BOOT_USE_PAYLOAD is not set 14 | CONFIG_SERVICE_BOOT_MMC_USE_GPT=y 15 | CONFIG_SERVICE_DDR=y 16 | CONFIG_SERVICE_GOTO=y 17 | # CONFIG_SERVICE_CRYPTO is not set 18 | # CONFIG_SERVICE_FLASHFREEZE is not set 19 | # CONFIG_SERVICE_POWERMODE is not set 20 | CONFIG_SERVICE_MMC=y 21 | 22 | # 23 | # MMC Mode 24 | # 25 | CONFIG_SERVICE_MMC_MODE_EMMC=y 26 | CONFIG_SERVICE_MMC_MODE_SDCARD=y 27 | 28 | # 29 | # MMC Voltage 30 | # 31 | CONFIG_SERVICE_MMC_BUS_VOLTAGE_1V8=y 32 | # CONFIG_SERVICE_MMC_BUS_VOLTAGE_3V3 is not set 33 | # CONFIG_SERVICE_QSPI is not set 34 | CONFIG_SERVICE_SGDMA=y 35 | # CONFIG_SERVICE_SPI is not set 36 | # CONFIG_SERVICE_UART is not set 37 | # CONFIG_SERVICE_WDOG is not set 38 | CONFIG_SERVICE_IPI_POLL=y 39 | CONFIG_SERVICE_OPENSBI=y 40 | # CONFIG_SERVICE_YMODEM is not set 41 | CONFIG_SERVICE_USBDMSC=y 42 | 43 | # 44 | # SDIO Control 45 | # 46 | CONFIG_SERVICE_SDIO_REGISTER_PRESENT=y 47 | CONFIG_SERVICE_SDIO_REGISTER_ADDRESS=0x4f000000 48 | 49 | # 50 | # USB Device Mass Storage Class 51 | # 52 | CONFIG_SERVICE_USBDMSC_REGISTER=y 53 | CONFIG_SERVICE_TINYCLI=y 54 | 55 | # 56 | # Tiny Command Line Interface 57 | # 58 | CONFIG_SERVICE_TINYCLI_TIMEOUT=5 59 | # CONFIG_SERVICE_TINYCLI_REGISTER is not set 60 | 61 | # 62 | # Compression 63 | # 64 | # CONFIG_COMPRESSION is not set 65 | 66 | # 67 | # General Configuration Options 68 | # 69 | CONFIG_OPENSBI=y 70 | 71 | # 72 | # OpenSBI 73 | # 74 | # CONFIG_PROVIDE_DTB is not set 75 | # CONFIG_SUPERLOOP_IN_U_MODE is not set 76 | 77 | # 78 | # Memory Options 79 | # 80 | CONFIG_MEMTEST=y 81 | CONFIG_IPI_MAX_NUM_QUEUE_MESSAGES=16 82 | # CONFIG_IPI_FIXED_BASE is not set 83 | CONFIG_USE_PDMA=y 84 | # CONFIG_INITIALIZE_MEMORIES is not set 85 | CONFIG_USE_PCIE=y 86 | 87 | # 88 | # Build Options 89 | # 90 | CONFIG_COLOR_OUTPUT=y 91 | CONFIG_USE_LOGO=y 92 | CONFIG_CC_STACKPROTECTOR_STRONG=y 93 | # CONFIG_CC_DUMP_STACKSIZE is not set 94 | # CONFIG_LD_RELAX is not set 95 | CONFIG_CC_USE_MAKEDEP=y 96 | CONFIG_CC_USE_GNU_BUILD_ID=y 97 | CONFIG_CC_HAS_INTTYPES=y 98 | CONFIG_DISPLAY_TOOL_VERSIONS=y 99 | 100 | # 101 | # Debug Options 102 | # 103 | CONFIG_DEBUG_LOG_STATE_TRANSITIONS=y 104 | # CONFIG_DEBUG_LOOP_TIMES is not set 105 | CONFIG_DEBUG_LOOP_TIMES_THRESHOLD=2500000 106 | # CONFIG_DEBUG_IPI_STATS is not set 107 | # CONFIG_DEBUG_CHUNK_DOWNLOADS is not set 108 | # CONFIG_DEBUG_MSCGEN_IPI is not set 109 | # CONFIG_DEBUG_PROFILING_SUPPORT is not set 110 | -------------------------------------------------------------------------------- /conf/icicle-kit-es/hss_def_config: -------------------------------------------------------------------------------- 1 | # Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) 2 | 3 | # 4 | # Services 5 | # 6 | CONFIG_SERVICE_BOOT=y 7 | 8 | # 9 | # Boot Service 10 | # 11 | CONFIG_SERVICE_BOOT_SETS_SUPPORT=y 12 | CONFIG_SERVICE_BOOT_DDR_TARGET_ADDR=0xA0000000 13 | # CONFIG_SERVICE_BOOT_USE_PAYLOAD is not set 14 | CONFIG_SERVICE_BOOT_MMC_USE_GPT=y 15 | CONFIG_SERVICE_DDR=y 16 | CONFIG_SERVICE_GOTO=y 17 | # CONFIG_SERVICE_CRYPTO is not set 18 | # CONFIG_SERVICE_FLASHFREEZE is not set 19 | # CONFIG_SERVICE_POWERMODE is not set 20 | CONFIG_SERVICE_MMC=y 21 | 22 | # 23 | # MMC Mode 24 | # 25 | CONFIG_SERVICE_MMC_MODE_EMMC=y 26 | CONFIG_SERVICE_MMC_MODE_SDCARD=y 27 | 28 | # 29 | # MMC Voltage 30 | # 31 | CONFIG_SERVICE_MMC_BUS_VOLTAGE_1V8=y 32 | # CONFIG_SERVICE_MMC_BUS_VOLTAGE_3V3 is not set 33 | # CONFIG_SERVICE_QSPI is not set 34 | CONFIG_SERVICE_SGDMA=y 35 | # CONFIG_SERVICE_SPI is not set 36 | # CONFIG_SERVICE_UART is not set 37 | # CONFIG_SERVICE_WDOG is not set 38 | CONFIG_SERVICE_IPI_POLL=y 39 | CONFIG_SERVICE_OPENSBI=y 40 | # CONFIG_SERVICE_YMODEM is not set 41 | CONFIG_SERVICE_USBDMSC=y 42 | 43 | # 44 | # SDIO Control 45 | # 46 | CONFIG_SERVICE_SDIO_REGISTER_PRESENT=y 47 | CONFIG_SERVICE_SDIO_REGISTER_ADDRESS=0x4f000000 48 | 49 | # 50 | # USB Device Mass Storage Class 51 | # 52 | CONFIG_SERVICE_USBDMSC_REGISTER=y 53 | CONFIG_SERVICE_TINYCLI=y 54 | 55 | # 56 | # Tiny Command Line Interface 57 | # 58 | CONFIG_SERVICE_TINYCLI_TIMEOUT=5 59 | # CONFIG_SERVICE_TINYCLI_REGISTER is not set 60 | 61 | # 62 | # Compression 63 | # 64 | # CONFIG_COMPRESSION is not set 65 | 66 | # 67 | # General Configuration Options 68 | # 69 | CONFIG_OPENSBI=y 70 | 71 | # 72 | # OpenSBI 73 | # 74 | # CONFIG_PROVIDE_DTB is not set 75 | # CONFIG_SUPERLOOP_IN_U_MODE is not set 76 | 77 | # 78 | # Memory Options 79 | # 80 | CONFIG_MEMTEST=y 81 | CONFIG_IPI_MAX_NUM_QUEUE_MESSAGES=16 82 | # CONFIG_IPI_FIXED_BASE is not set 83 | CONFIG_USE_PDMA=y 84 | # CONFIG_INITIALIZE_MEMORIES is not set 85 | CONFIG_USE_PCIE=y 86 | 87 | # 88 | # Build Options 89 | # 90 | CONFIG_COLOR_OUTPUT=y 91 | CONFIG_USE_LOGO=y 92 | CONFIG_CC_STACKPROTECTOR_STRONG=y 93 | # CONFIG_CC_DUMP_STACKSIZE is not set 94 | # CONFIG_LD_RELAX is not set 95 | CONFIG_CC_USE_MAKEDEP=y 96 | CONFIG_CC_USE_GNU_BUILD_ID=y 97 | CONFIG_CC_HAS_INTTYPES=y 98 | CONFIG_DISPLAY_TOOL_VERSIONS=y 99 | 100 | # 101 | # Debug Options 102 | # 103 | CONFIG_DEBUG_LOG_STATE_TRANSITIONS=y 104 | # CONFIG_DEBUG_LOOP_TIMES is not set 105 | CONFIG_DEBUG_LOOP_TIMES_THRESHOLD=2500000 106 | # CONFIG_DEBUG_IPI_STATS is not set 107 | # CONFIG_DEBUG_CHUNK_DOWNLOADS is not set 108 | # CONFIG_DEBUG_MSCGEN_IPI is not set 109 | # CONFIG_DEBUG_PROFILING_SUPPORT is not set 110 | -------------------------------------------------------------------------------- /patches/buildroot/0002-Add-Microchip-AMP-examples-package.patch: -------------------------------------------------------------------------------- 1 | From 2867f1d1231ba7ad7028b0f5bcd2e05bbe3c6e67 Mon Sep 17 00:00:00 2001 2 | From: Valentina Fernandez 3 | Date: Wed, 21 Sep 2022 20:40:07 +0100 4 | Subject: [PATCH] Add Microchip AMP examples package 5 | 6 | --- 7 | package/Config.in | 1 + 8 | package/mchp_amp_examples/Config.in | 9 +++++++++ 9 | package/mchp_amp_examples/mchp_amp_examples.mk | 17 +++++++++++++++++ 10 | 3 files changed, 27 insertions(+) 11 | create mode 100644 package/mchp_amp_examples/Config.in 12 | create mode 100644 package/mchp_amp_examples/mchp_amp_examples.mk 13 | 14 | diff --git a/package/Config.in b/package/Config.in 15 | index ea1fc9edcb..1350e1862d 100644 16 | --- a/package/Config.in 17 | +++ b/package/Config.in 18 | @@ -9,6 +9,7 @@ menu "Target packages" 19 | source "package/skeleton-init-systemd/Config.in" 20 | source "package/skeleton-init-sysv/Config.in" 21 | source "package/mchp_examples/Config.in" 22 | + source "package/mchp_amp_examples/Config.in" 23 | 24 | menu "Audio and video applications" 25 | source "package/alsa-utils/Config.in" 26 | diff --git a/package/mchp_amp_examples/Config.in b/package/mchp_amp_examples/Config.in 27 | new file mode 100644 28 | index 0000000000..a38e901d6c 29 | --- /dev/null 30 | +++ b/package/mchp_amp_examples/Config.in 31 | @@ -0,0 +1,9 @@ 32 | +config BR2_PACKAGE_MCHP_AMP_EXAMPLES 33 | + bool "mchp_examples" 34 | + help 35 | + Microchip PolarFire SoC AMP Examples 36 | + 37 | +config BR2_PACKAGE_MCHP_AMP_CONTEXT_B 38 | + string "context_b_binary_name" 39 | + help 40 | + Microchip PolarFire SoC AMP example project to run as context b 41 | \ No newline at end of file 42 | diff --git a/package/mchp_amp_examples/mchp_amp_examples.mk b/package/mchp_amp_examples/mchp_amp_examples.mk 43 | new file mode 100644 44 | index 0000000000..ac39ad6a32 45 | --- /dev/null 46 | +++ b/package/mchp_amp_examples/mchp_amp_examples.mk 47 | @@ -0,0 +1,17 @@ 48 | +MCHP_AMP_EXAMPLES_VERSION = 7ad7f5ec3a064b6e8f06cf7e81596b8ef0753679 49 | +MCHP_AMP_EXAMPLES_SITE = ../../polarfire-soc-examples/polarfire-soc-amp-examples 50 | +MCHP_AMP_EXAMPLES_SITE_METHOD = local 51 | + 52 | +MCHP_AMP_EXAMPLES_DIRS += $(BR2_PACKAGE_MCHP_AMP_CONTEXT_B) 53 | +MCHP_AMP_EXAMPLES_TARGET_DIR = /lib/firmware 54 | + 55 | +define MCHP_AMP_EXAMPLES_INSTALL_TARGET_CMDS 56 | + 57 | + $(INSTALL) -d $(TARGET_DIR)$(MCHP_AMP_EXAMPLES_TARGET_DIR) 58 | + $(foreach project,$(MCHP_AMP_EXAMPLES_DIRS), \ 59 | + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$(project) CROSS_COMPILE=$(CROSS_COMPILE) REMOTE=1 REMOTEPROC=1 EXT_CFLAGS='-DMPFS_HAL_FIRST_HART=4 -DMPFS_HAL_LAST_HART=4'; \ 60 | + $(INSTALL) -D -m 775 $(@D)/$(project)/Remote-Default/mpfs-rpmsg-remote.elf $(TARGET_DIR)$(MCHP_AMP_EXAMPLES_TARGET_DIR)/rproc-miv-rproc-fw; 61 | + cp $(@D)/$(project)/Remote-Default/mpfs-rpmsg-remote.elf $(BINARIES_DIR);) 62 | +endef 63 | + 64 | +$(eval $(generic-package)) 65 | -- 66 | 2.37.3 67 | 68 | -------------------------------------------------------------------------------- /conf/aries-m100pfsevp/buildroot_initramfs_config: -------------------------------------------------------------------------------- 1 | BR2_ARCH_IS_64=y 2 | BR2_ARCH_HAS_MMU_MANDATORY=y 3 | BR2_riscv=y 4 | BR2_ARCH_HAS_TOOLCHAIN_BUILDROOT=y 5 | BR2_ARCH_NEEDS_GCC_AT_LEAST_9=y 6 | BR2_ARCH="riscv64" 7 | BR2_ENDIAN="LITTLE" 8 | BR2_riscv_custom=y 9 | 10 | BR2_RISCV_64=y 11 | 12 | BR2_RISCV_ISA_CUSTOM_RVM=y 13 | BR2_RISCV_ISA_CUSTOM_RVA=y 14 | BR2_RISCV_ISA_CUSTOM_RVF=y 15 | BR2_RISCV_ISA_CUSTOM_RVD=y 16 | BR2_RISCV_ISA_CUSTOM_RVC=y 17 | BR2_RISCV_64=y 18 | BR2_RISCV_ABI_LP64D=y 19 | 20 | BR2_TOOLCHAIN=y 21 | BR2_TOOLCHAIN_EXTERNAL=y 22 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y 23 | BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y 24 | BR2_TOOLCHAIN_EXTERNAL_PATH="$(RISCV)" 25 | BR2_PACKAGE_HAS_TOOLCHAIN_EXTERNAL=y 26 | BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL="toolchain-external-custom" 27 | BR2_TOOLCHAIN_EXTERNAL_PREFIX="$(ARCH)-unknown-linux-gnu" 28 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu" 29 | BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="bin" 30 | BR2_TOOLCHAIN_EXTERNAL_GCC_10=y 31 | BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_12=y 32 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y 33 | BR2_PACKAGE_GDB_NEEDS_CXX11=y 34 | BR2_TOOLCHAIN_EXTERNAL_CXX=y 35 | BR2_TOOLCHAIN_EXTERNAL_INET_RPC=n 36 | 37 | BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y 38 | BR2_TARGET_GENERIC_ROOT_PASSWD="" 39 | BR2_SYSTEM_DHCP="eth0" 40 | BR2_PACKAGE_DHRYSTONE=y 41 | BR2_PACKAGE_LMBENCH=y 42 | BR2_PACKAGE_E2FSPROGS=y 43 | BR2_PACKAGE_MTD=y 44 | BR2_PACKAGE_GPTFDISK=y 45 | BR2_PACKAGE_GPTFDISK_GDISK=y 46 | BR2_PACKAGE_GPTFDISK_SGDISK=y 47 | BR2_PACKAGE_PCIUTILS=y 48 | BR2_PACKAGE_DROPBEAR=y 49 | BR2_PACKAGE_IPERF=y 50 | BR2_PACKAGE_IPERF3=y 51 | BR2_PACKAGE_SCREEN=y 52 | BR2_PACKAGE_HTOP=y 53 | BR2_PACKAGE_HOST_GDB=y 54 | BR2_PACKAGE_HOST_GENEXT2FS=y 55 | BR2_PACKAGE_HOST_GENIMAGE=y 56 | BR2_PACKAGE_HOST_GPTFDISK=y 57 | BR2_PACKAGE_HOST_MTOOLS=y 58 | BR2_PACKAGE_HOST_SQUASHFS=y 59 | BR2_PACKAGE_LIBGPIOD=y 60 | BR2_PACKAGE_LIBGPIOD_TOOLS=y 61 | BR2_PACKAGE_LINUX_TOOLS_GPIO=y 62 | BR2_PACKAGE_PYTHON3=y 63 | BR2_PACKAGE_PYTHON_FLASK=y 64 | BR2_PACKAGE_LIBIIO=y 65 | BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON=y 66 | BR2_PACKAGE_LIBIIO_IIOD=y 67 | BR2_PACKAGE_LINUX_TOOLS_IIO=y 68 | BR2_PACKAGE_I2C_TOOLS=y 69 | BR2_PACKAGE_POPT=y 70 | BR2_PACKAGE_COLLECTD=y 71 | BR2_PACKAGE_COLLECTD_CSV=y 72 | BR2_PACKAGE_COLLECTD_EXEC=y 73 | BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y 74 | BR2_PACKAGE_BASH=y 75 | BR2_PACKAGE_MCHP_EXAMPLES=y 76 | BR2_PACKAGE_WGET=y 77 | BR2_PACKAGE_UTIL_LINUX=y 78 | BR2_PACKAGE_RNG_TOOLS=y 79 | 80 | BR2_DL_DIR="../../br-dl-dir/" 81 | BR2_CCACHE=y 82 | BR2_CCACHE_DIR="../br-ccache-dir/" 83 | 84 | BR2_TARGET_UBOOT=y 85 | BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y 86 | BR2_TARGET_UBOOT_CUSTOM_VERSION=y 87 | BR2_TARGET_UBOOT_CUSTOM_GIT=y 88 | BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/polarfire-soc/u-boot.git" 89 | BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="4b28e3e93ae339d7d29e6b0efc26777bfef714eb" 90 | BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y 91 | BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="../../conf/$(DEVKIT)/smode_defconfig" 92 | BR2_PACKAGE_HOST_UBOOT_TOOLS=y 93 | BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y 94 | BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="../../conf/$(DEVKIT)/uEnv_s-mode.txt" -------------------------------------------------------------------------------- /conf/icicle-kit-es/buildroot_initramfs_config: -------------------------------------------------------------------------------- 1 | BR2_ARCH_IS_64=y 2 | BR2_ARCH_HAS_MMU_MANDATORY=y 3 | BR2_riscv=y 4 | BR2_ARCH_HAS_TOOLCHAIN_BUILDROOT=y 5 | BR2_ARCH_NEEDS_GCC_AT_LEAST_9=y 6 | BR2_ARCH="riscv64" 7 | BR2_ENDIAN="LITTLE" 8 | BR2_riscv_custom=y 9 | 10 | BR2_RISCV_64=y 11 | 12 | BR2_RISCV_ISA_CUSTOM_RVM=y 13 | BR2_RISCV_ISA_CUSTOM_RVA=y 14 | BR2_RISCV_ISA_CUSTOM_RVF=y 15 | BR2_RISCV_ISA_CUSTOM_RVD=y 16 | BR2_RISCV_ISA_CUSTOM_RVC=y 17 | BR2_RISCV_64=y 18 | BR2_RISCV_ABI_LP64D=y 19 | 20 | BR2_TOOLCHAIN=y 21 | BR2_TOOLCHAIN_EXTERNAL=y 22 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y 23 | BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y 24 | BR2_TOOLCHAIN_EXTERNAL_PATH="$(RISCV)" 25 | BR2_PACKAGE_HAS_TOOLCHAIN_EXTERNAL=y 26 | BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL="toolchain-external-custom" 27 | BR2_TOOLCHAIN_EXTERNAL_PREFIX="$(ARCH)-unknown-linux-gnu" 28 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu" 29 | BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="bin" 30 | BR2_TOOLCHAIN_EXTERNAL_GCC_10=y 31 | BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_12=y 32 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y 33 | BR2_PACKAGE_GDB_NEEDS_CXX11=y 34 | BR2_TOOLCHAIN_EXTERNAL_CXX=y 35 | BR2_TOOLCHAIN_EXTERNAL_INET_RPC=n 36 | 37 | BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y 38 | BR2_TARGET_GENERIC_ROOT_PASSWD="" 39 | BR2_SYSTEM_DHCP="eth0" 40 | BR2_PACKAGE_DHRYSTONE=y 41 | BR2_PACKAGE_LMBENCH=y 42 | BR2_PACKAGE_E2FSPROGS=y 43 | BR2_PACKAGE_MTD=y 44 | BR2_PACKAGE_GPTFDISK=y 45 | BR2_PACKAGE_GPTFDISK_GDISK=y 46 | BR2_PACKAGE_GPTFDISK_SGDISK=y 47 | BR2_PACKAGE_PCIUTILS=y 48 | BR2_PACKAGE_DROPBEAR=y 49 | BR2_PACKAGE_IPERF=y 50 | BR2_PACKAGE_IPERF3=y 51 | BR2_PACKAGE_SCREEN=y 52 | BR2_PACKAGE_HTOP=y 53 | BR2_PACKAGE_HOST_GDB=y 54 | BR2_PACKAGE_HOST_GENEXT2FS=y 55 | BR2_PACKAGE_HOST_GENIMAGE=y 56 | BR2_PACKAGE_HOST_GPTFDISK=y 57 | BR2_PACKAGE_HOST_MTOOLS=y 58 | BR2_PACKAGE_HOST_SQUASHFS=y 59 | BR2_PACKAGE_LIBGPIOD=y 60 | BR2_PACKAGE_LIBGPIOD_TOOLS=y 61 | BR2_PACKAGE_LINUX_TOOLS_GPIO=y 62 | BR2_PACKAGE_PYTHON3=y 63 | BR2_PACKAGE_PYTHON_FLASK=y 64 | BR2_PACKAGE_LIBIIO=y 65 | BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON=y 66 | BR2_PACKAGE_LIBIIO_IIOD=y 67 | BR2_PACKAGE_LINUX_TOOLS_IIO=y 68 | BR2_PACKAGE_I2C_TOOLS=y 69 | BR2_PACKAGE_POPT=y 70 | BR2_PACKAGE_COLLECTD=y 71 | BR2_PACKAGE_COLLECTD_CSV=y 72 | BR2_PACKAGE_COLLECTD_EXEC=y 73 | BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y 74 | BR2_PACKAGE_BASH=y 75 | BR2_PACKAGE_MCHP_EXAMPLES=y 76 | BR2_PACKAGE_WGET=y 77 | BR2_PACKAGE_UTIL_LINUX=y 78 | BR2_PACKAGE_RNG_TOOLS=y 79 | BR2_PACKAGE_JPEG=y 80 | 81 | BR2_DL_DIR="../../br-dl-dir/" 82 | BR2_CCACHE=y 83 | BR2_CCACHE_DIR="../br-ccache-dir/" 84 | 85 | BR2_TARGET_UBOOT=y 86 | BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y 87 | BR2_TARGET_UBOOT_CUSTOM_VERSION=y 88 | BR2_TARGET_UBOOT_CUSTOM_GIT=y 89 | BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/polarfire-soc/u-boot.git" 90 | BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="4b28e3e93ae339d7d29e6b0efc26777bfef714eb" 91 | BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y 92 | BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="../../conf/$(DEVKIT)/smode_defconfig" 93 | BR2_PACKAGE_HOST_UBOOT_TOOLS=y 94 | BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y 95 | BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="../../conf/$(DEVKIT)/uEnv_s-mode.txt" 96 | -------------------------------------------------------------------------------- /conf/icicle-kit-es-amp/buildroot_initramfs_config: -------------------------------------------------------------------------------- 1 | BR2_ARCH_IS_64=y 2 | BR2_ARCH_HAS_MMU_MANDATORY=y 3 | BR2_riscv=y 4 | BR2_ARCH_HAS_TOOLCHAIN_BUILDROOT=y 5 | BR2_ARCH_NEEDS_GCC_AT_LEAST_9=y 6 | BR2_ARCH="riscv64" 7 | BR2_ENDIAN="LITTLE" 8 | BR2_riscv_custom=y 9 | 10 | BR2_RISCV_64=y 11 | 12 | BR2_RISCV_ISA_CUSTOM_RVM=y 13 | BR2_RISCV_ISA_CUSTOM_RVA=y 14 | BR2_RISCV_ISA_CUSTOM_RVF=y 15 | BR2_RISCV_ISA_CUSTOM_RVD=y 16 | BR2_RISCV_ISA_CUSTOM_RVC=y 17 | BR2_RISCV_64=y 18 | BR2_RISCV_ABI_LP64D=y 19 | 20 | BR2_TOOLCHAIN=y 21 | BR2_TOOLCHAIN_EXTERNAL=y 22 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y 23 | BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y 24 | BR2_TOOLCHAIN_EXTERNAL_PATH="$(RISCV)" 25 | BR2_PACKAGE_HAS_TOOLCHAIN_EXTERNAL=y 26 | BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL="toolchain-external-custom" 27 | BR2_TOOLCHAIN_EXTERNAL_PREFIX="$(ARCH)-unknown-linux-gnu" 28 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu" 29 | BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="bin" 30 | BR2_TOOLCHAIN_EXTERNAL_GCC_10=y 31 | BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_12=y 32 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y 33 | BR2_PACKAGE_GDB_NEEDS_CXX11=y 34 | BR2_TOOLCHAIN_EXTERNAL_CXX=y 35 | BR2_TOOLCHAIN_EXTERNAL_INET_RPC=n 36 | 37 | BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y 38 | BR2_TARGET_GENERIC_ROOT_PASSWD="" 39 | BR2_SYSTEM_DHCP="eth0" 40 | BR2_PACKAGE_DHRYSTONE=y 41 | BR2_PACKAGE_LMBENCH=y 42 | BR2_PACKAGE_E2FSPROGS=y 43 | BR2_PACKAGE_MTD=y 44 | BR2_PACKAGE_GPTFDISK=y 45 | BR2_PACKAGE_GPTFDISK_GDISK=y 46 | BR2_PACKAGE_GPTFDISK_SGDISK=y 47 | BR2_PACKAGE_PCIUTILS=y 48 | BR2_PACKAGE_DROPBEAR=y 49 | BR2_PACKAGE_IPERF=y 50 | BR2_PACKAGE_IPERF3=y 51 | BR2_PACKAGE_SCREEN=y 52 | BR2_PACKAGE_HTOP=y 53 | BR2_PACKAGE_HOST_GDB=y 54 | BR2_PACKAGE_HOST_GENEXT2FS=y 55 | BR2_PACKAGE_HOST_GENIMAGE=y 56 | BR2_PACKAGE_HOST_GPTFDISK=y 57 | BR2_PACKAGE_HOST_MTOOLS=y 58 | BR2_PACKAGE_HOST_SQUASHFS=y 59 | BR2_PACKAGE_LIBGPIOD=y 60 | BR2_PACKAGE_LIBGPIOD_TOOLS=y 61 | BR2_PACKAGE_LINUX_TOOLS_GPIO=y 62 | BR2_PACKAGE_PYTHON3=y 63 | BR2_PACKAGE_PYTHON_FLASK=y 64 | BR2_PACKAGE_LIBIIO=y 65 | BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON=y 66 | BR2_PACKAGE_LIBIIO_IIOD=y 67 | BR2_PACKAGE_LINUX_TOOLS_IIO=y 68 | BR2_PACKAGE_I2C_TOOLS=y 69 | BR2_PACKAGE_POPT=y 70 | BR2_PACKAGE_COLLECTD=y 71 | BR2_PACKAGE_COLLECTD_CSV=y 72 | BR2_PACKAGE_COLLECTD_EXEC=y 73 | BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y 74 | BR2_PACKAGE_BASH=y 75 | BR2_PACKAGE_MCHP_EXAMPLES=y 76 | BR2_PACKAGE_MCHP_AMP_EXAMPLES=y 77 | BR2_PACKAGE_MCHP_AMP_CONTEXT_B="mpfs-rpmsg-freertos" 78 | BR2_PACKAGE_WGET=y 79 | BR2_PACKAGE_UTIL_LINUX=y 80 | BR2_PACKAGE_RNG_TOOLS=y 81 | BR2_PACKAGE_JPEG=y 82 | 83 | BR2_DL_DIR="../../br-dl-dir/" 84 | BR2_CCACHE=y 85 | BR2_CCACHE_DIR="../br-ccache-dir/" 86 | 87 | BR2_TARGET_UBOOT=y 88 | BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y 89 | BR2_TARGET_UBOOT_CUSTOM_VERSION=y 90 | BR2_TARGET_UBOOT_CUSTOM_GIT=y 91 | BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/polarfire-soc/u-boot.git" 92 | BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="4b28e3e93ae339d7d29e6b0efc26777bfef714eb" 93 | BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y 94 | BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="../../conf/$(DEVKIT)/smode_defconfig" 95 | BR2_PACKAGE_HOST_UBOOT_TOOLS=y 96 | BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y 97 | BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="../../conf/$(DEVKIT)/uEnv_s-mode.txt" -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Microchip PolarFire SoC Contributing Guidelines 2 | 3 | [fork]: /fork 4 | [pr]: /compare 5 | [style]: https://standardjs.com/ 6 | [code-of-conduct]: CODE_OF_CONDUCT.md 7 | [discussion-forum]: https://github.com/polarfire-soc/polarfire-soc-documentation/discussions 8 | 9 | Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. 10 | 11 | Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. 12 | 13 | ## Discussions, Issues and PRs 14 | 15 | If you have suggestions for how this project or an individual component could be improved, have a question or need help please open a discussion thread in the organization's [discussion forum](discussion-forum). 16 | Note: if your question is related to a fork of an external repository (e.g Zephyr) and the query isn't directly related to any Microchip code, please be aware that it may be better to open an discussion thread in the source repository. 17 | If you want to report a bug, open an issue against the source repository containing the offending code. 18 | We appreciate any contributions. 19 | 20 | We also welcome PRs to add features, board support for new targets and fix issues. If you would like to add a new feature it is advised to make an enhancement request in our [discussion forum](discussion-forum) so the feature request can be discussed. If you would like to add board support please reach out to your Mi-V ecosystem contact before opening a PR. Look at the links below if you're not sure how to open a PR. 21 | 22 | ## Submitting a pull request 23 | 24 | 1. Fork and clone the repository. 25 | 1. Create a new branch: `git checkout -b my-branch-name`. 26 | 1. Make and test your changes. 27 | 1. When you're happy that your fix or improvement is stable commit your changes and push to your fork. 28 | 1. Verify that your changes apply to the head of the source branch. 29 | 1. Submit a pull request. 30 | 1. Wait for your pull request to be reviewed. 31 | 1. As we push to GitHub from an internal git repository, we may not merge your change directly on GitHub, it is more likely to be applied internally as a patch and mirrored to GitHub. 32 | 1. If this is the case we will let you know when change has been reviewed and if it has been accepted or not. 33 | 1. We will update the PR and let you know when the change has been released and subsequently close the PR. 34 | 35 | Here are a few things you can do that will increase the likelihood of your pull request being accepted: 36 | 37 | - Explain why this change is needed, what bugs are fixed or why this feature should be merged. 38 | - Demonstrate how you have tested and verified your change is stable. 39 | - Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. 40 | - Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). 41 | 42 | ## Resources 43 | 44 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) 45 | - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) 46 | - [GitHub Help](https://help.github.com) 47 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microchip PolarFire SoC Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to make participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contribute to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies within all project spaces, and it also applies when 49 | an individual is representing the project or its community in public spaces. 50 | Examples of representing a project or community include using an official 51 | project e-mail address, posting via an official social media account, or acting 52 | as an appointed representative at an online or offline event. Representation of 53 | a project may be further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at polarfiresoc@microchip.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | ## Attribution 65 | 66 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 67 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 68 | 69 | [homepage]: https://www.contributor-covenant.org 70 | 71 | For answers to common questions about this code of conduct, see 72 | https://www.contributor-covenant.org/faq 73 | -------------------------------------------------------------------------------- /patches/buildroot/0001-mchp_examples-add-polarfire-soc-linux-examples.patch: -------------------------------------------------------------------------------- 1 | From fb47a515e330cd60d8a96e82c8a56a9239e6a070 Mon Sep 17 00:00:00 2001 2 | From: Conor Dooley 3 | Date: Wed, 2 Feb 2022 12:50:47 +0000 4 | Subject: [PATCH] mchp_examples: add polarfire soc linux examples 5 | 6 | --- 7 | package/Config.in | 1 + 8 | package/mchp_examples/Config.in | 4 +++ 9 | package/mchp_examples/mchp_examples.mk | 50 ++++++++++++++++++++++++++ 10 | 3 files changed, 55 insertions(+) 11 | create mode 100644 package/mchp_examples/Config.in 12 | create mode 100644 package/mchp_examples/mchp_examples.mk 13 | 14 | diff --git a/package/Config.in b/package/Config.in 15 | index 4d323d440f..76520e13ba 100644 16 | --- a/package/Config.in 17 | +++ b/package/Config.in 18 | @@ -8,6 +8,7 @@ menu "Target packages" 19 | source "package/skeleton-init-openrc/Config.in" 20 | source "package/skeleton-init-systemd/Config.in" 21 | source "package/skeleton-init-sysv/Config.in" 22 | + source "package/mchp_examples/Config.in" 23 | 24 | menu "Audio and video applications" 25 | source "package/alsa-utils/Config.in" 26 | diff --git a/package/mchp_examples/Config.in b/package/mchp_examples/Config.in 27 | new file mode 100644 28 | index 0000000000..c6ad9a7068 29 | --- /dev/null 30 | +++ b/package/mchp_examples/Config.in 31 | @@ -0,0 +1,4 @@ 32 | +config BR2_PACKAGE_MCHP_EXAMPLES 33 | + bool "mchp_examples" 34 | + help 35 | + blah blah blah 36 | diff --git a/package/mchp_examples/mchp_examples.mk b/package/mchp_examples/mchp_examples.mk 37 | new file mode 100644 38 | index 0000000000..74ec2fa481 39 | --- /dev/null 40 | +++ b/package/mchp_examples/mchp_examples.mk 41 | @@ -0,0 +1,50 @@ 42 | +MCHP_EXAMPLES_VERSION = 031e52ce1b20a026d6f04da6c45595948a41d9b1 43 | +MCHP_EXAMPLES_SITE = ../../polarfire-soc-examples 44 | +MCHP_EXAMPLES_SITE_METHOD = local 45 | + 46 | + 47 | +EXAMPLE_DIRS += amp can gpio system-services ethernet fpga-fabric-interfaces dma pdma 48 | +EXAMPLE_FILES += amp/rpmsg-pingpong/rpmsg-pingpong amp/rpmsg-tty-example/rpmsg-tty can/uio-can-example gpio/gpiod-test gpio/gpiod-event system-services/system-services-example system-services/signature-verification-demo fpga-fabric-interfaces/lsram/uio-lsram-read-write dma/uio-dma-interrupt pdma/pdma-ex 49 | +EXAMPLE_TARGET_DIR = /opt/microchip/ 50 | + 51 | +define MCHP_EXAMPLES_INSTALL_DIRS 52 | + $(foreach d,$(EXAMPLE_DIRS), \ 53 | + rm -rf $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)$(d); \ 54 | + cp -a $(@D)/polarfire-soc-linux-examples/$(d) $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)$(d)$(sep)) 55 | +endef 56 | + 57 | +define MCHP_EXAMPLES_INSTALL_TARGET_CMDS 58 | + $(INSTALL) -m 755 -D ../../conf/motd \ 59 | + $(TARGET_DIR)/etc/motd 60 | + 61 | + $(INSTALL) -d $(TARGET_DIR)$(EXAMPLE_TARGET_DIR) 62 | + $(foreach d,$(EXAMPLE_DIRS), \ 63 | + rm -rf $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)$(d); \ 64 | + cp -a $(@D)/polarfire-soc-linux-examples/$(d) $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)$(d)$(sep)) 65 | + 66 | + echo $(EXAMPLE_FILES) 67 | + $(foreach example_file,$(EXAMPLE_FILES), \ 68 | + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/polarfire-soc-linux-examples/$(dir $(example_file)) $(notdir $(example_file)) CC=$(TARGET_CC); \ 69 | + $(INSTALL) -D -m 775 $(@D)/polarfire-soc-linux-examples/$(example_file) $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)/$(dir $(example_file));) 70 | + 71 | + ln -s $(EXAMPLE_TARGET_DIR)/ethernet/iio-http-server $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)/iiohttpserver 72 | + 73 | +endef 74 | + 75 | +define MCHP_EXAMPLES_INSTALL_INIT_SYSTEMD 76 | +$(INSTALL) -D -m 644 $(@D)/polarfire-soc-linux-examples/ethernet/iio-http-server/collection/collectdiio.service \ 77 | + $(TARGET_DIR)/usr/lib/systemd/system/collectdiio.service 78 | +endef 79 | + 80 | +define MCHP_EXAMPLES_INSTALL_INIT_SYSV 81 | +# iiohttp server 82 | +$(INSTALL) -D -m 775 $(@D)/polarfire-soc-linux-examples/ethernet/iio-http-server/collection/collectdiio.busybox \ 83 | + $(TARGET_DIR)/etc/init.d/collectdiio 84 | +# busy box init requires script renames 85 | +mv $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)ethernet/iio-http-server/run.{sh,systemd} 86 | +mv $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)ethernet/iio-http-server/run.{busybox,sh} 87 | +chmod +x $(TARGET_DIR)$(EXAMPLE_TARGET_DIR)ethernet/iio-http-server/run.sh 88 | + 89 | +endef 90 | + 91 | +$(eval $(generic-package)) 92 | -- 93 | 2.35.1 94 | 95 | -------------------------------------------------------------------------------- /conf/buildroot_rootfs_config: -------------------------------------------------------------------------------- 1 | BR2_ARCH_IS_64=y 2 | BR2_ARCH_HAS_MMU_MANDATORY=y 3 | BR2_riscv=y 4 | BR2_ARCH_HAS_TOOLCHAIN_BUILDROOT=y 5 | BR2_ARCH_NEEDS_GCC_AT_LEAST_4_8=y 6 | BR2_ARCH_NEEDS_GCC_AT_LEAST_4_9=y 7 | BR2_ARCH_NEEDS_GCC_AT_LEAST_5=y 8 | BR2_ARCH_NEEDS_GCC_AT_LEAST_6=y 9 | BR2_ARCH_NEEDS_GCC_AT_LEAST_7=y 10 | BR2_ARCH_NEEDS_GCC_AT_LEAST_8=y 11 | BR2_ARCH_NEEDS_GCC_AT_LEAST_9=y 12 | BR2_ARCH="riscv64" 13 | BR2_ENDIAN="LITTLE" 14 | BR2_riscv_custom=y 15 | 16 | BR2_RISCV_64=y 17 | 18 | BR2_RISCV_ISA_CUSTOM_RVM=y 19 | BR2_RISCV_ISA_CUSTOM_RVA=y 20 | BR2_RISCV_ISA_CUSTOM_RVF=y 21 | BR2_RISCV_ISA_CUSTOM_RVD=y 22 | BR2_RISCV_ISA_CUSTOM_RVC=y 23 | BR2_RISCV_64=y 24 | BR2_RISCV_ABI_LP64D=y 25 | 26 | BR2_TOOLCHAIN=y 27 | BR2_TOOLCHAIN_EXTERNAL=y 28 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y 29 | #BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y 30 | BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y 31 | BR2_TOOLCHAIN_EXTERNAL_PATH="$(RISCV)" 32 | BR2_PACKAGE_HAS_TOOLCHAIN_EXTERNAL=y 33 | BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL="toolchain-external-custom" 34 | BR2_TOOLCHAIN_EXTERNAL_PREFIX="$(ARCH)-unknown-linux-gnu" 35 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu" 36 | BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="bin" 37 | BR2_TOOLCHAIN_EXTERNAL_GCC_10=y 38 | BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_12=y 39 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y 40 | BR2_PACKAGE_GDB_NEEDS_CXX11=y 41 | BR2_TOOLCHAIN_EXTERNAL_CXX=y 42 | BR2_TOOLCHAIN_EXTERNAL_INET_RPC=n 43 | 44 | 45 | BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y 46 | BR2_TARGET_GENERIC_ROOT_PASSWD="microchip" 47 | BR2_SYSTEM_DHCP="eth0" 48 | BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y 49 | BR2_PACKAGE_BONNIE=y 50 | BR2_PACKAGE_CACHE_CALIBRATOR=y 51 | BR2_PACKAGE_DHRYSTONE=y 52 | BR2_PACKAGE_LMBENCH=y 53 | BR2_PACKAGE_RAMSMP=y 54 | BR2_PACKAGE_RAMSPEED=y 55 | BR2_PACKAGE_STRESS_NG=y 56 | BR2_PACKAGE_WHETSTONE=y 57 | BR2_PACKAGE_PCIUTILS=y 58 | BR2_PACKAGE_MSMTP=y 59 | BR2_PACKAGE_MUTT=y 60 | BR2_PACKAGE_MUTT_IMAP=y 61 | BR2_PACKAGE_MUTT_POP3=y 62 | BR2_PACKAGE_BASH=y 63 | BR2_PACKAGE_WHICH=y 64 | BR2_PACKAGE_COREUTILS=y 65 | BR2_PACKAGE_UTIL_LINUX=y 66 | BR2_PACKAGE_UTIL_LINUX_BINARIES=y 67 | BR2_PACKAGE_UTIL_LINUX_AGETTY=y 68 | BR2_PACKAGE_UTIL_LINUX_BFS=y 69 | BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH=y 70 | BR2_PACKAGE_UTIL_LINUX_CRAMFS=y 71 | BR2_PACKAGE_UTIL_LINUX_EJECT=y 72 | BR2_PACKAGE_UTIL_LINUX_FALLOCATE=y 73 | BR2_PACKAGE_UTIL_LINUX_FDFORMAT=y 74 | BR2_PACKAGE_UTIL_LINUX_FINDFS=y 75 | BR2_PACKAGE_UTIL_LINUX_FSCK=y 76 | BR2_PACKAGE_UTIL_LINUX_HWCLOCK=y 77 | BR2_PACKAGE_UTIL_LINUX_KILL=y 78 | BR2_PACKAGE_UTIL_LINUX_LAST=y 79 | BR2_PACKAGE_UTIL_LINUX_LINE=y 80 | BR2_PACKAGE_UTIL_LINUX_LOGIN=y 81 | BR2_PACKAGE_UTIL_LINUX_LOSETUP=y 82 | BR2_PACKAGE_UTIL_LINUX_LSBLK=y 83 | BR2_PACKAGE_UTIL_LINUX_LSUSB=y 84 | BR2_PACKAGE_UTIL_LINUX_MESG=y 85 | BR2_PACKAGE_UTIL_LINUX_MINIX=y 86 | BR2_PACKAGE_UTIL_LINUX_MORE=y 87 | BR2_PACKAGE_UTIL_LINUX_MOUNT=y 88 | BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT=y 89 | BR2_PACKAGE_UTIL_LINUX_NEWGRP=y 90 | BR2_PACKAGE_UTIL_LINUX_NOLOGIN=y 91 | BR2_PACKAGE_UTIL_LINUX_NSENTER=y 92 | BR2_PACKAGE_UTIL_LINUX_PARTX=y 93 | BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT=y 94 | BR2_PACKAGE_UTIL_LINUX_RAW=y 95 | BR2_PACKAGE_UTIL_LINUX_RENAME=y 96 | BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS=y 97 | BR2_PACKAGE_UTIL_LINUX_SETPRIV=y 98 | BR2_PACKAGE_UTIL_LINUX_SETTERM=y 99 | BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT=y 100 | BR2_PACKAGE_UTIL_LINUX_TUNELP=y 101 | BR2_PACKAGE_UTIL_LINUX_UL=y 102 | BR2_PACKAGE_UTIL_LINUX_UNSHARE=y 103 | BR2_PACKAGE_UTIL_LINUX_UTMPDUMP=y 104 | BR2_PACKAGE_UTIL_LINUX_UUIDD=y 105 | BR2_PACKAGE_UTIL_LINUX_VIPW=y 106 | BR2_PACKAGE_UTIL_LINUX_WALL=y 107 | BR2_PACKAGE_UTIL_LINUX_WDCTL=y 108 | BR2_PACKAGE_UTIL_LINUX_WRITE=y 109 | BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y 110 | 111 | BR2_TARGET_ROOTFS_EXT2=y 112 | BR2_TARGET_ROOTFS_EXT2_4=y 113 | BR2_TARGET_ROOTFS_EXT2_GEN=4 114 | BR2_TARGET_ROOTFS_EXT2_REV=1 115 | BR2_TARGET_ROOTFS_EXT2_LABEL="" 116 | BR2_TARGET_ROOTFS_EXT2_SIZE="60M" 117 | BR2_TARGET_ROOTFS_EXT2_INODES=0 118 | BR2_TARGET_ROOTFS_EXT2_RESBLKS=5 119 | BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS="-O ^64bit" 120 | 121 | BR2_PACKAGE_LIBGPIOD=y 122 | BR2_PACKAGE_LIBGPIOD_TOOLS=y 123 | BR2_PACKAGE_LINUX_TOOLS_GPIO=y 124 | BR2_PACKAGE_PYTHON3=y 125 | BR2_PACKAGE_PYTHON_FLASK=y 126 | BR2_PACKAGE_LIBIIO=y 127 | BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON=y 128 | BR2_PACKAGE_LIBIIO_IIOD=y 129 | BR2_PACKAGE_LINUX_TOOLS_IIO=y 130 | BR2_PACKAGE_I2C_TOOLS=y 131 | BR2_PACKAGE_POPT=y 132 | BR2_PACKAGE_COLLECTD=y 133 | BR2_PACKAGE_COLLECTD_CSV=y 134 | BR2_PACKAGE_COLLECTD_EXEC=y 135 | BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y 136 | BR2_PACKAGE_BASH=y 137 | BR2_PACKAGE_MCHP_EXAMPLES=y 138 | 139 | BR2_DL_DIR="../../br-dl-dir/" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository is archived, please see: https://github.com/linux4microchip/buildroot-external-microchip 2 | 3 | # Microchip PolarFire SoC Linux Software Development Kit 4 | 5 | This repository builds a command line only RISC-V Linux image for the Microchip PolarFire SoC Development Boards. 6 | It first will build the GNU cross-compilation toolchain for RISC-V, which will be installed in the `toolchain/` subdirectory. This toolchain is then used to build a Linux image consisting of the kernel, a Busybox based root file system and the necessary bootloaders for each development platform. 7 | 8 | Currently the following development platforms are supported: 9 | 10 | - Icicle Kit (Engineering Sample) (Requires minimum FPGA design: [v2021.08](https://github.com/polarfire-soc/icicle-kit-reference-design/releases/tag/2021.08). Designs prior to this release use a different memory map and will fail to boot.) 11 | 12 | The complete User Guides for each development platform, containing board and boot instructions, are available in the [polarfire-soc documentation repository](https://github.com/polarfire-soc/polarfire-soc-documentation). 13 | 14 | ## Building Linux Using Buildroot 15 | 16 | This section describes the procedure to build the Linux boot image and load it onto an SD card, eMMC or external QSPI flash memory using Buildroot. Please check the [Supported Build Hosts](#supported-build-hosts) and the [Prerequisite Packages](#prerequisite-packages) before continuing. 17 | 18 | ### Build instructions 19 | 20 | The following commands checkout the Software Development Kit (SDK) in a new directory: 21 | 22 | ```bash 23 | git clone https://github.com/polarfire-soc/polarfire-soc-buildroot-sdk.git 24 | cd polarfire-soc-buildroot-sdk 25 | git checkout master 26 | ``` 27 | 28 | Before building for the first time (or if updating to the latest version), the contents of the sub-modules must be acquired: 29 | 30 | ```bash 31 | git submodule sync 32 | git submodule update --init --recursive 33 | ``` 34 | 35 | Then the Linux image can be built in the `work` sub-directory: 36 | 37 | ```bash 38 | unset RISCV 39 | make all DEVKIT=icicle-kit-es 40 | ``` 41 | 42 | The `DEVKIT` option can be used to set the target board for which linux is built, and if left blank it will default to `DEVKIT=icicle-kit-es`. 43 | 44 | The following table details the available targets: 45 | 46 | | `DEVKIT` | Board Name | 47 | | --- | --- | 48 | | `DEVKIT=icicle-kit-es` | Icicle Development Kit with engineering sample silicon | 49 | | `DEVKIT=icicle-kit-es-amp` | Icicle Development Kit with engineering sample silicon running in AMP mode | 50 | 51 | The `icicle-kit-es-amp` target can be used to build the Icicle Development using a Linux + FreeRTOS AMP configuration demo. Please see the [Asymmetric Multiprocessing (AMP)](https://github.com/polarfire-soc/polarfire-soc-documentation/blob/master/asymmetric-multiprocessing/amp.md) documentation for further information. 52 | 53 | To boot Linux on your board using this image, see: [Loading the Image onto the Target](#Loading-the-Image-onto-the-Target). 54 | 55 | Note: The first time the build is run it can take a long time, as it also builds the RISC-V cross compiler toolchain. 56 | 57 | The output file contains the first stage bootloader, the root file system and an image containing the linux kernel, device tree blob & second stage bootloader. 58 | 59 | For other boards, the source is located in `linux/arch/riscv/boot/dts/microchip`. 60 | The configuration options used for the Linux kernel are in `linux/arch/riscv/configs/_defconfig`. 61 | `conf/` contains the U-Boot and buildroot initramfs config files. 62 | 63 | ### Rebuilding the Linux Image 64 | 65 | If you need to rebuild your image or change the board being targeted, type the following from the top level directory of the polarfire-soc-buildroot-sdk: 66 | 67 | ```bash 68 | $ make clean 69 | $ make all DEVKIT= 70 | ``` 71 | 72 | ## Loading the Image onto the Target 73 | 74 | The instructions for the [eMMC on the Icicle Kit can be found here](#Preparing-the-eMMC-for-the-Icicle-Kit),for the [QSPI on the Icicle Kit here](#Preparing-an-external-QSPI-flash-memory-for-the-Icicle-Kit),for the [SD card on the Icicle Kit here](#Preparing-an-SD-Card-for-the-Icicle-Kit). 75 | 76 | ### Preparing the eMMC for the Icicle Kit 77 | 78 | If the HSS is not present in eNVM, using the y-modem loader, transfer the HSS to eNVM on the Icicle kit. 79 | Connect to UART0 (J11), and power on the board. Settings are 115200 baud, 8 data bits, 1 stop bit, no parity, and no flow control. 80 | Press a key to stop automatic boot. In the HSS console, type `mmc` to select the interface and type `usbdmsc` to expose the eMMC as a block device. 81 | Connect the board to your host PC using J16, located beside the SD card slot. 82 | 83 | Once this is complete, on the host PC, use `dmesg` to check what the drive identifier for the onboard eMMC is. 84 | 85 | ```bash 86 | $ dmesg | egrep "sd|mmcblk" 87 | ``` 88 | 89 | The output should contain a line similar to one of the following lines: 90 | 91 | ```bash 92 | [85089.431896] sd 6:0:0:2: [sdX] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB) 93 | [51273.539768] mmcblkX: mmc0:0001 EB1QT 29.8 GiB 94 | ``` 95 | 96 | `sdX` or `mmcblkX` is the drive identifier that should be used in the following commands, where `X` should be replaced with the specific character from the output of the previous command. 97 | For these examples the identifier `sdX` is used. 98 | 99 | **WARNING:** 100 | The drive with the identifier `sda` is the default location for your operating system. 101 | DO NOT pass this identifier to any of the commands listed here without being absolutely sure that your OS is not located here. 102 | Check that the size of the card matches the dmesg output before continuing. 103 | 104 | Once sure of the drive identifier, use the following command to copy your Linux image to the board, replacing the X and `` as appropriate: 105 | 106 | ```bash 107 | $ sudo make DISK=/dev/sdX DEVKIT= format-icicle-image 108 | ``` 109 | 110 | When the transfer has completed, press `CTRL+C` in the HSS serial console to return to the HSS console. 111 | To boot into Linux, type `boot` in the HSS console. U-Boot and Linux will use UART1. When Linux boots, log in with the username `root`. There is no password required. 112 | 113 | If you are using the `icicle-kit-es-amp` machine, attach to UART3 to observe its output. 114 | 115 | Similarly, a root file system can be written to the eMMC using 116 | 117 | ```bash 118 | $ sudo make DISK=/dev/sdX DEVKIT= format-rootfs-image 119 | ``` 120 | 121 | ### Preparing an SD Card for the Icicle Kit 122 | 123 | Insert an SD Card (16 GB or 32 GB) into the card reader of your host PC. If the SD card is auto-mounted, first unmount it manually. 124 | The following steps will allow you to check and unmount the card if required: 125 | 126 | After inserting your SD card, on the host PC, use `dmesg` to check what your card's identifier is. 127 | 128 | ```bash 129 | $ dmesg | egrep "sd|mmcblk" 130 | ``` 131 | 132 | The output should contain a line similar to one of the following lines: 133 | 134 | ```bash 135 | [85089.431896] sd 6:0:0:2: [sdX] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB) 136 | [51273.539768] mmcblkX: mmc0:0001 EB1QT 29.8 GiB 137 | ``` 138 | 139 | `sdX` or `mmcblkX` is the drive identifier that should be used in the following commands, where `X` should be replaced with the specific character from the output of the previous command. 140 | For these examples the identifier `sdX` is used. 141 | 142 | **WARNING:** 143 | The drive with the identifier `sda` is the default location for your operating system. 144 | DO NOT pass this identifier to any of the commands listed here without being absolutely sure that your OS is not located here. 145 | Check that the size of the card matches the dmesg output before continuing. 146 | 147 | Next check if this card is mounted: 148 | 149 | ```bash 150 | $ mount | grep sdX 151 | ``` 152 | 153 | If any entries are present, then run the following. If not then skip this command: 154 | 155 | ```bash 156 | $ sudo umount /dev/sdX 157 | ``` 158 | 159 | The SD card should have a GUID Partition Table (GPT) rather than a Master Boot Record (MBR) without any partitions defined. 160 | 161 | #### Programming an Image for the First Time 162 | 163 | To automatically partition and format your SD card, in the top level of polarfire-soc-buildroot-sdk, type: 164 | 165 | ```bash 166 | $ sudo make DISK=/dev/sdX DEVKIT=icicle-kit-es format-icicle-image 167 | ``` 168 | 169 | At this point, your SD card should be ready to boot Linux. 170 | You can remove it from your PC and insert it into the SD card slot on the Icicle kit, and then power-on the board. 171 | Connect to UART0 (J11) for the HSS and UART1 (also J11) for U-Boot and Linux. Settings are 115200 baud, 8 data bits, 1 stop bit, no parity, and no flow control. 172 | When Linux boots, log in with the username `root`. There is no password required. 173 | 174 | If you are using the `icicle-kit-es-amp` machine, attach to UART3 to observe its output. 175 | 176 | Similarly, a root file system can be written to the SD card using 177 | 178 | ```bash 179 | $ sudo make DISK=/dev/sdX DEVKIT= format-rootfs-image 180 | ``` 181 | 182 | ### Preparing an external QSPI flash memory for the Icicle Kit 183 | 184 | This section explains how to prepare the Icicle Kit to boot from an external flash memory device using QSPI. 185 | 186 | The Icicle Kit supports booting Linux from an external QSPI flash memory connected to the Raspberry Pi 4 Interface (J26) on an Icicle Kit. 187 | 188 | For more information on QSPI support on the Icicle Kit, please refer to the [booting from QSPI](https://github.com/polarfire-soc/polarfire-soc-documentation/tree/master/boards/mpfs-icicle-kit-es/booting-from-qspi/booting-from-qspi.md) documentation. 189 | 190 | Connect to UART0 (J11), and power on the board. Settings are 115200 baud, 8 data bits, 1 stop bit, no parity, and no flow control. 191 | 192 | Press a key to stop automatic boot. In the HSS console, type `qspi` to select the QSPI interface and then type `usbdmsc` to expose the QSPI flash memory device as a block device. 193 | 194 | Connect the board to your host PC using J16, located beside the SD card slot. 195 | 196 | Once this is complete, on the host PC, use `dmesg` to check what the drive identifier for the QSPI flash memory device is. 197 | 198 | ```bash 199 | $ dmesg | egrep "sd" 200 | ``` 201 | 202 | The output should contain a line similar to one of the following lines: 203 | 204 | ```bash 205 | [114353.477108] sd 11:0:0:0: [sdX] 65536 2048-byte logical blocks: (134 MB/128 MiB) 206 | [114353.477111] sd 11:0:0:0: [sdX] Write Protect is off 207 | [114353.477471] sd 11:0:0:0: [sdX] Mode Sense: 00 00 00 00 208 | ``` 209 | 210 | `sdX` is the drive identifier that should be used in the following commands, where `X` should be replaced with the specific character from the output of the previous command. 211 | 212 | **WARNING:** 213 | The drive with the identifier `sda` is the default location for your operating system. 214 | DO NOT pass this identifier to any of the commands listed here without being absolutely sure that your OS is not located here. 215 | 216 | Once sure of the drive identifier, use the following command to copy your Linux image to the external QSPI flash memory device, replacing the X and as appropriate: 217 | 218 | ```bash 219 | $ sudo make DISK=/dev/sdX DEVKIT= format-icicle-image-flash 220 | ``` 221 | 222 | When the transfer has completed, press CTRL+C in the HSS serial console to return to the HSS console. 223 | 224 | Wait for the image transfer to complete. A progress bar will be shown in the HSS serial console. 225 | 226 | To boot into Linux, type boot in the HSS console. U-Boot and Linux will use UART1. When Linux boots, log in with the username root. There is no password required. 227 | 228 | If you are using the icicle-kit-es-amp machine, attach to UART3 to observe its output. 229 | 230 | ## Supported Build Hosts 231 | 232 | This document assumes you are running on a modern Linux system. The process documented here was tested using Ubuntu 20.04/18.04 LTS. 233 | It should also work with other Linux distributions if the equivalent prerequisite packages are installed. 234 | 235 | ### Prerequisite Packages 236 | 237 | #### Ubuntu 238 | 239 | Before starting, use the `apt` command to install prerequisite packages: 240 | 241 | ```bash 242 | sudo apt install autoconf automake autotools-dev bc bison build-essential curl \ 243 | flex gawk gdisk git gperf libgmp-dev libmpc-dev libmpfr-dev libncurses-dev \ 244 | libssl-dev libtool patchutils python screen texinfo unzip zlib1g-dev \ 245 | libblkid-dev device-tree-compiler libglib2.0-dev libpixman-1-dev mtools \ 246 | linux-firmware rsync python3 libexpat1-dev wget cpio xxd dosfstools \ 247 | python3-pip libyaml-dev libelf-dev zlib1g-dev xutils-dev libc6-dev \ 248 | u-boot-tools 249 | ``` 250 | 251 | For Ubuntu 22.04, replace `python` with `python2` in the above command. 252 | 253 | Install the python library `kconfiglib`. Without this the Hart Software Services (HSS) will fail to build with a genconfig error. 254 | 255 | ```bash 256 | sudo pip3 install kconfiglib 257 | ``` 258 | 259 | ## Known Issues 260 | 261 | ### U-Boot Error: "Can't set block device" or Linux "Error: Partition(s) 1, 2, 3 on /dev/sdX have been written, but we have been unable to inform the kernel of the change" 262 | 263 | This error is caused by auto mounting of the SD/onboard eMMC, preventing the image being written correctly to the disk. To fix this, install dconf-editor and disable automounting of the SD card. 264 | 265 | Install dconf-editor: 266 | 267 | ```bash 268 | sudo apt install dconf-editor 269 | ``` 270 | 271 | Run the program: 272 | 273 | ```bash 274 | dconf-editor 275 | ``` 276 | 277 | Navigate to `org/gnome/desktop/media-handling` and turn off auto mount. 278 | Now you should be able to run the `format-icicle-image` command without any issues. 279 | 280 | ### "Error: Could not find bootloader partition for /dev/sdX" 281 | 282 | This problem may occur when writing to a new SD card, or after deleting all partitions using GParted or similar. 283 | If you encounter this problem, simply rerun the `format-icicle-image` make command and the image should be written correctly to the disk. 284 | 285 | ## Additional Reading 286 | 287 | [Buildroot User Manual](https://buildroot.org/docs.html) 288 | [PolarFire SoC Yocto BSP](https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp) 289 | [Kernel Documentation for Linux](https://www.kernel.org/doc/html/v5.12/) 290 | [Asymmetric Multiprocessing Documentation](https://github.com/polarfire-soc/polarfire-soc-documentation/blob/master/asymmetric-multiprocessing/amp.md) 291 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ISA ?= rv64imafdc 2 | ABI ?= lp64d 3 | 4 | LIBERO_PATH ?= /usr/local/microsemi/Libero_v2021.1/ 5 | SC_PATH ?= /usr/local/microsemi/SoftConsole-v2021.1/ 6 | fpgenprog := $(LIBERO_PATH)/bin64/fpgenprog 7 | num_threads = $(shell nproc --ignore=1) 8 | 9 | srcdir := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) 10 | srcdir := $(srcdir:/=) 11 | patchdir := $(CURDIR)/patches 12 | confdir := $(srcdir)/conf 13 | wrkdir := $(CURDIR)/work 14 | 15 | # target icicle w/ emmc by default 16 | DEVKIT ?= icicle-kit-es 17 | ifeq "$(DEVKIT)" "icicle-kit-es-sd" 18 | override DEVKIT = icicle-kit-es 19 | endif 20 | 21 | AMP_DEMO ?= freertos 22 | ifneq ($(AMP_DEMO),$(filter $(AMP_DEMO),freertos bm)) 23 | $(error AMP_DEMO variable should be freertos or bm) 24 | endif 25 | 26 | RISCV ?= $(CURDIR)/toolchain 27 | PATH := $(RISCV)/bin:$(PATH) 28 | GITID := $(shell git describe --dirty --always) 29 | 30 | toolchain_srcdir := $(srcdir)/riscv-gnu-toolchain 31 | toolchain_wrkdir := $(wrkdir)/riscv-gnu-toolchain 32 | toolchain_dest := $(CURDIR)/toolchain 33 | target := riscv64-unknown-linux-gnu 34 | CROSS_COMPILE := $(RISCV)/bin/$(target)- 35 | export CROSS_COMPILE 36 | target_gdb := $(CROSS_COMPILE)gdb 37 | 38 | buildroot_srcdir := $(srcdir)/buildroot 39 | buildroot_initramfs_wrkdir := $(wrkdir)/buildroot_initramfs 40 | buildroot_initramfs_tar := $(buildroot_initramfs_wrkdir)/images/rootfs.tar 41 | buildroot_initramfs_config := $(confdir)/$(DEVKIT)/buildroot_initramfs_config 42 | buildroot_initramfs_sysroot_stamp := $(wrkdir)/.buildroot_initramfs_sysroot 43 | buildroot_initramfs_sysroot := $(wrkdir)/buildroot_initramfs_sysroot 44 | buildroot_rootfs_wrkdir := $(wrkdir)/buildroot_rootfs 45 | buildroot_rootfs_ext := $(buildroot_rootfs_wrkdir)/images/rootfs.ext4 46 | buildroot_rootfs_config := $(confdir)/buildroot_rootfs_config 47 | 48 | buildroot_patchdir := $(patchdir)/buildroot/ 49 | buildroot_patches := $(shell ls $(buildroot_patchdir)/*.patch) 50 | buildroot_builddir := $(wrkdir)/buildroot_build 51 | buildroot_builddir_stamp := $(wrkdir)/.buildroot_builddir 52 | 53 | linux_srcdir := $(srcdir)/linux 54 | linux_wrkdir := $(wrkdir)/linux 55 | riscv_dtbdir := $(linux_wrkdir)/arch/riscv/boot/dts/ 56 | 57 | vmlinux := $(linux_wrkdir)/vmlinux 58 | vmlinux_stripped := $(linux_wrkdir)/vmlinux-stripped 59 | vmlinux_bin := $(wrkdir)/vmlinux.bin 60 | 61 | kernel-modules-stamp := $(wrkdir)/.modules_stamp 62 | kernel-modules-install-stamp := $(wrkdir)/.modules_install_stamp 63 | 64 | flash_image := $(wrkdir)/$(DEVKIT)-$(GITID).gpt 65 | vfat_image := $(wrkdir)/$(DEVKIT)-vfat.part 66 | mtd_image := $(wrkdir)/$(DEVKIT).mtd 67 | initramfs_uc := $(wrkdir)/initramfs.cpio 68 | initramfs := $(wrkdir)/initramfs.cpio.gz 69 | rootfs := $(wrkdir)/rootfs.bin 70 | fit := $(wrkdir)/fitImage.fit 71 | 72 | device_tree_blob := $(wrkdir)/riscvpc.dtb 73 | 74 | fsbl_srcdir := $(srcdir)/fsbl 75 | fsbl_wrkdir := $(wrkdir)/fsbl 76 | fsbl_wrkdir_stamp := $(wrkdir)/.fsbl_wrkdir 77 | fsbl_patchdir := $(patchdir)/fsbl/ 78 | libversion := $(fsbl_wrkdir)/lib/version.c 79 | fsbl := $(wrkdir)/fsbl.bin 80 | 81 | uboot_s := $(buildroot_initramfs_wrkdir)/images/u-boot.bin 82 | uboot_s_cfg := $(confdir)/$(DEVKIT)/smode_defconfig 83 | uboot_s_txt := $(confdir)/$(DEVKIT)/uEnv_s-mode.txt 84 | uboot_s_scr := $(buildroot_initramfs_wrkdir)/images/boot.scr 85 | 86 | opensbi_srcdir := $(srcdir)/opensbi 87 | opensbi_wrkdir := $(wrkdir)/opensbi 88 | opensbi := $(wrkdir)/fw_payload.bin 89 | 90 | openocd_srcdir := $(srcdir)/riscv-openocd 91 | openocd_wrkdir := $(wrkdir)/riscv-openocd 92 | openocd := $(openocd_wrkdir)/src/openocd 93 | 94 | payload_generator_url := https://github.com/polarfire-soc/hart-software-services/releases/download/2021.11/hss-payload-generator.zip 95 | payload_generator_tarball := $(srcdir)/br-dl-dir/payload_generator.zip 96 | hss_payload_generator := $(wrkdir)/hss-payload-generator 97 | hss_srcdir := $(srcdir)/hart-software-services 98 | hss_uboot_payload_bin := $(wrkdir)/payload.bin 99 | payload_config := $(confdir)/$(DEVKIT)/config.yaml 100 | its := $(confdir)/$(DEVKIT)/osbi-fit-image.its 101 | 102 | amp_example := $(buildroot_initramfs_wrkdir)/images/mpfs-rpmsg-remote.elf 103 | 104 | include conf/$(DEVKIT)/board.mk 105 | 106 | bootloaders-$(FSBL_SUPPORT) += $(fsbl) 107 | bootloaders-$(OSBI_SUPPORT) += $(opensbi) 108 | bootloaders-$(HSS_SUPPORT) += $(hss_uboot_payload_bin) 109 | 110 | all: $(fit) $(vfat_image) $(mtd_image) $(bootloaders-y) 111 | @echo 112 | @echo "GPT (for SPI flash or SDcard) and U-boot Image files have" 113 | @echo "been generated for an ISA of $(ISA) and an ABI of $(ABI)" 114 | @echo 115 | @echo $(fit) 116 | @echo $(flash_image) 117 | @echo 118 | @echo "Refer to the readme for instructions on how to format" 119 | @echo "an SD/eMMC with the image & boot Linux." 120 | 121 | ifneq ($(RISCV),$(toolchain_dest)) 122 | $(CROSS_COMPILE)gcc: 123 | ifeq (,$(CROSS_COMPILE)gcc --version 2>/dev/null) 124 | $(error The RISCV environment variable was set, but is not pointing at a toolchain install tree) 125 | else 126 | $(CROSS_COMPILE)gcc: $(toolchain_srcdir) 127 | mkdir -p $(toolchain_wrkdir) 128 | mkdir -p $(toolchain_wrkdir)/header_workdir 129 | $(MAKE) -C $(linux_srcdir) O=$(toolchain_wrkdir)/header_workdir ARCH=riscv INSTALL_HDR_PATH=$(abspath $(toolchain_srcdir)/linux-headers) headers_install 130 | cd $(toolchain_wrkdir); $(toolchain_srcdir)/configure \ 131 | --prefix=$(toolchain_dest) \ 132 | --with-arch=$(ISA) \ 133 | --with-abi=$(ABI) \ 134 | --enable-linux 135 | $(MAKE) -C $(toolchain_wrkdir) -j$(num_threads) 136 | sed 's/^#define LINUX_VERSION_CODE.*/#define LINUX_VERSION_CODE 330752/' -i $(toolchain_dest)/sysroot/usr/include/linux/version.h 137 | endif 138 | 139 | $(buildroot_builddir_stamp): $(buildroot_srcdir) $(buildroot_patches) 140 | - rm -rf $(buildroot_builddir) 141 | mkdir -p $(buildroot_builddir) && cd $(buildroot_builddir) && cp $(buildroot_srcdir)/* . -r 142 | for file in $(buildroot_patches) ; do \ 143 | cd $(buildroot_builddir) && patch -p1 < $${file} ; \ 144 | done 145 | touch $@ 146 | rm -rf $(buildroot_initramfs_wrkdir) 147 | mkdir -p $(buildroot_initramfs_wrkdir) 148 | rm -rf $(buildroot_rootfs_wrkdir) 149 | mkdir -p $(buildroot_rootfs_wrkdir) 150 | 151 | $(buildroot_initramfs_wrkdir)/.config: $(buildroot_builddir_stamp) $(confdir)/initramfs.txt $(buildroot_rootfs_config) $(buildroot_initramfs_config) $(uboot_s_cfg) $(uboot_s_txt) 152 | cp $(buildroot_initramfs_config) $(buildroot_initramfs_wrkdir)/.config 153 | $(MAKE) -C $(buildroot_builddir) RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_initramfs_wrkdir) olddefconfig CROSS_COMPILE=$(CROSS_COMPILE) -j$(num_threads) 154 | 155 | $(buildroot_initramfs_tar): $(buildroot_builddir_stamp) $(buildroot_initramfs_wrkdir)/.config $(CROSS_COMPILE)gcc $(buildroot_initramfs_config) 156 | $(MAKE) -C $(buildroot_builddir) RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_initramfs_wrkdir) -j$(num_threads) DEVKIT=$(DEVKIT) 157 | 158 | $(buildroot_initramfs_sysroot_stamp): $(buildroot_initramfs_tar) 159 | mkdir -p $(buildroot_initramfs_sysroot) 160 | tar -xpf $< -C $(buildroot_initramfs_sysroot) --exclude ./dev --exclude ./usr/share/locale 161 | touch $@ 162 | 163 | .PHONY: buildroot_initramfs_menuconfig 164 | buildroot_initramfs_menuconfig: $(buildroot_initramfs_wrkdir)/.config $(buildroot_builddir_stamp) 165 | $(MAKE) -C $(buildroot_builddir) O=$(buildroot_initramfs_wrkdir) menuconfig 166 | $(MAKE) -C $(buildroot_builddir) O=$(buildroot_initramfs_wrkdir) savedefconfig 167 | cp $(buildroot_initramfs_wrkdir)/defconfig $(buildroot_initramfs_config) 168 | 169 | $(buildroot_rootfs_wrkdir)/.config: $(buildroot_builddir_stamp) 170 | cp $(buildroot_rootfs_config) $@ 171 | $(MAKE) -C $(buildroot_builddir) RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_rootfs_wrkdir) olddefconfig 172 | 173 | $(buildroot_rootfs_ext): $(buildroot_builddir_stamp) $(buildroot_rootfs_wrkdir)/.config $(CROSS_COMPILE)gcc $(buildroot_rootfs_config) 174 | $(MAKE) -C $(buildroot_builddir) RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_rootfs_wrkdir) -j$(num_threads) 175 | 176 | .PHONY: buildroot_rootfs_menuconfig 177 | buildroot_rootfs_menuconfig: $(buildroot_rootfs_wrkdir)/.config $(buildroot_builddir_stamp) 178 | $(MAKE) -C $(buildroot_builddir) O=$(buildroot_rootfs_wrkdir) menuconfig 179 | $(MAKE) -C $(buildroot_builddir) O=$(buildroot_rootfs_wrkdir) savedefconfig 180 | cp $(buildroot_rootfs_wrkdir)/defconfig conf/buildroot_rootfs_config 181 | 182 | .PHONY: linux_cfg 183 | cfg: $(linux_wrkdir)/.config 184 | $(linux_wrkdir)/.config: $(linux_srcdir) $(CROSS_COMPILE)gcc 185 | mkdir -p $(dir $@) 186 | $(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=riscv $(linux_defconfig) 187 | ifeq (,$(filter rv%c,$(ISA))) 188 | sed 's/^.*CONFIG_RISCV_ISA_C.*$$/CONFIG_RISCV_ISA_C=n/' -i $@ 189 | $(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=riscv $(linux_defconfig) 190 | endif 191 | ifeq ($(ISA),$(filter rv32%,$(ISA))) 192 | sed 's/^.*CONFIG_ARCH_RV32I.*$$/CONFIG_ARCH_RV32I=y/' -i $@ 193 | sed 's/^.*CONFIG_ARCH_RV64I.*$$/CONFIG_ARCH_RV64I=n/' -i $@ 194 | $(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=riscv rv32_defconfig 195 | endif 196 | 197 | $(initramfs).d: $(buildroot_initramfs_sysroot) $(kernel-modules-install-stamp) 198 | cd $(wrkdir) && $(linux_srcdir)/usr/gen_initramfs.sh -l $(confdir)/initramfs.txt $(buildroot_initramfs_sysroot) > $@ 199 | 200 | $(initramfs_uc): $(buildroot_initramfs_sysroot) $(vmlinux) $(kernel-modules-install-stamp) 201 | cd $(linux_wrkdir) && \ 202 | $(linux_srcdir)/usr/gen_initramfs.sh \ 203 | -o $@ -u $(shell id -u) -g $(shell id -g) \ 204 | $(confdir)/initramfs.txt \ 205 | $(buildroot_initramfs_sysroot) 206 | 207 | $(initramfs): $(initramfs_uc) 208 | gzip $(initramfs_uc) --keep -q 209 | 210 | $(vmlinux): $(linux_wrkdir)/.config $(CROSS_COMPILE)gcc 211 | $(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) \ 212 | ARCH=riscv \ 213 | CROSS_COMPILE=$(CROSS_COMPILE) \ 214 | PATH=$(PATH) \ 215 | vmlinux -j$(num_threads) 216 | 217 | $(vmlinux_stripped): $(vmlinux) 218 | PATH=$(PATH) $(target)-strip -o $@ $< 219 | 220 | $(vmlinux_bin): $(vmlinux) 221 | PATH=$(PATH) $(CROSS_COMPILE)objcopy -O binary $< $@ 222 | 223 | .PHONY: kernel-modules kernel-modules-install 224 | $(kernel-modules-stamp): $(linux_srcdir) $(vmlinux) 225 | $(MAKE) -C $< O=$(linux_wrkdir) \ 226 | ARCH=riscv \ 227 | CROSS_COMPILE=$(CROSS_COMPILE) \ 228 | PATH=$(PATH) \ 229 | modules -j$(num_threads) 230 | touch $@ 231 | 232 | $(kernel-modules-install-stamp): $(linux_srcdir) $(buildroot_initramfs_sysroot) $(kernel-modules-stamp) 233 | rm -rf $(buildroot_initramfs_sysroot)/lib/modules/ 234 | $(MAKE) -C $< O=$(linux_wrkdir) \ 235 | ARCH=riscv \ 236 | CROSS_COMPILE=$(CROSS_COMPILE) \ 237 | PATH=$(PATH) \ 238 | modules_install \ 239 | INSTALL_MOD_PATH=$(buildroot_initramfs_sysroot) 240 | touch $@ 241 | 242 | .PHONY: linux-menuconfig 243 | linux-menuconfig: $(linux_wrkdir)/.config 244 | $(MAKE) -C $(linux_srcdir) O=$(dir $<) ARCH=riscv menuconfig CROSS_COMPILE=$(CROSS_COMPILE) 245 | $(MAKE) -C $(linux_srcdir) O=$(dir $<) ARCH=riscv savedefconfig CROSS_COMPILE=$(CROSS_COMPILE) 246 | cp $(dir $<)/defconfig $(linux_defconfig) 247 | 248 | $(device_tree_blob): $(vmlinux) 249 | $(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=riscv dtbs 250 | cp $(linux_dtb) $(device_tree_blob) 251 | 252 | $(fit): $(uboot_s) $(vmlinux_bin) $(initramfs) $(device_tree_blob) $(its) $(kernel-modules-install-stamp) 253 | PATH=$(PATH) mkimage -f $(its) -A riscv -O linux -T flat_dt $@ 254 | 255 | $(libversion): $(fsbl_wrkdir_stamp) 256 | - rm -rf $(libversion) 257 | echo "const char *gitid = \"$(shell git describe --always --dirty)\";" > $(libversion) 258 | echo "const char *gitdate = \"$(shell git log -n 1 --date=short --format=format:"%ad.%h" HEAD)\";" >> $(libversion) 259 | echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" >> $(libversion) 260 | 261 | $(fsbl_wrkdir_stamp): $(fsbl_srcdir) $(fsbl_patchdir) 262 | - rm -rf $(fsbl_wrkdir) 263 | mkdir $(fsbl_wrkdir) -p && cd $(fsbl_wrkdir) && cp $(fsbl_srcdir)/* . -r 264 | for file in $(fsbl_patchdir)/* ; do \ 265 | cd $(fsbl_wrkdir) && patch -p1 < $${file} ; \ 266 | done 267 | touch $@ 268 | 269 | $(fsbl): $(libversion) $(fsbl_wrkdir_stamp) $(device_tree_blob) 270 | rm -f $(fsbl_wrkdir)/fsbl/ux00_fsbl.dts 271 | cp -f $(wrkdir)/riscvpc.dtb $(fsbl_wrkdir)/fsbl/ux00_fsbl.dtb 272 | $(MAKE) -C $(fsbl_wrkdir) O=$(fsbl_wrkdir) CROSSCOMPILE=$(CROSS_COMPILE) all -j$(num_threads) 273 | cp $(fsbl_wrkdir)/fsbl.bin $(fsbl) 274 | 275 | $(uboot_s): $(buildroot_initramfs_sysroot_stamp) 276 | 277 | $(opensbi): $(uboot_s) $(CROSS_COMPILE)gcc 278 | rm -rf $(opensbi_wrkdir) 279 | mkdir -p $(opensbi_wrkdir) 280 | mkdir -p $(dir $@) 281 | $(MAKE) -C $(opensbi_srcdir) O=$(opensbi_wrkdir) CROSS_COMPILE=$(CROSS_COMPILE) \ 282 | PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=$(uboot_s) 283 | cp $(opensbi_wrkdir)/platform/sifive/fu540/firmware/fw_payload.bin $@ 284 | 285 | $(rootfs): $(buildroot_rootfs_ext) 286 | cp $< $@ 287 | 288 | $(buildroot_initramfs_sysroot): $(buildroot_initramfs_sysroot_stamp) 289 | 290 | $(payload_generator_tarball): 291 | mkdir -p $(srcdir)/br-dl-dir/ 292 | wget $(payload_generator_url) -O $(payload_generator_tarball) --show-progress 293 | 294 | $(hss_payload_generator): $(payload_generator_tarball) 295 | # tar -xzf $(payload_generator_tarball) -C $(wrkdir) 296 | unzip $(payload_generator_tarball) -d $(wrkdir)/payload_gen 297 | cp $(wrkdir)/payload_gen/hss-payload-generator/binaries/hss-payload-generator $(wrkdir) 298 | 299 | $(hss_uboot_payload_bin): $(uboot_s) $(hss_payload_generator) $(bootloaders-y) 300 | cd $(buildroot_initramfs_wrkdir)/images && $(hss_payload_generator) -c $(payload_config) -v $(hss_uboot_payload_bin) 301 | 302 | .PHONY: buildroot_initramfs_sysroot vmlinux bbl fit flash_image initrd opensbi u-boot bootloaders dtbs 303 | buildroot_initramfs_sysroot: $(buildroot_initramfs_sysroot) 304 | vmlinux: $(vmlinux) 305 | fit: $(fit) 306 | initrd: $(initramfs) 307 | u-boot: $(hss_uboot_payload_bin) 308 | flash_image: $(flash_image) 309 | opensbi: $(opensbi) 310 | fsbl: $(fsbl) 311 | bootloaders: $(bootloaders-y) 312 | root-fs: $(rootfs) 313 | dtbs: ${device_tree_blob} 314 | 315 | .PHONY: clean distclean 316 | clean: 317 | rm -rf -- $(wrkdir) 318 | 319 | clean-linux: 320 | rm -rf -- $(initramfs) $(fit) $(device_tree_blob) $(vfat_image) $(kernel-modules-stamp) $(kernel-modules-install-stamp) $(vmlinux_bin) $(linux_wrkdir) $(hss_uboot_payload_bin) 321 | 322 | distclean: 323 | rm -rf -- $(wrkdir) $(toolchain_dest) br-dl-dir/ arch/ include/ scripts/ .cache.mk 324 | 325 | .PHONY: gdb 326 | gdb: $(target_gdb) 327 | 328 | .PHONY: openocd 329 | openocd: $(openocd) 330 | $(openocd) -f $(confdir)/u540-openocd.cfg 331 | 332 | $(openocd): $(openocd_srcdir) 333 | rm -rf $(openocd_wrkdir) 334 | mkdir -p $(openocd_wrkdir) 335 | mkdir -p $(dir $@) 336 | cd $(openocd_srcdir) && ./bootstrap 337 | cd $(openocd_wrkdir) && $