diff -Nru u-boot-2022.01+dfsg/debian/changelog u-boot-2022.01+dfsg/debian/changelog --- u-boot-2022.01+dfsg/debian/changelog 2022-03-25 11:15:18.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/changelog 2022-11-18 12:11:50.000000000 +0100 @@ -1,3 +1,13 @@ +u-boot (2022.01+dfsg-2ubuntu2.1) jammy; urgency=medium + + * Add package u-boot-microchip (LP: #1995848) + * Add u-boot-sifive.README.Debian + * Enable reset via SBI + d/p/riscv64/sysreset-sbi.patch + d/p/enable-reset-via-SBI-on-PolarFire-Icicle-Kit.patch + + -- Heinrich Schuchardt Fri, 18 Nov 2022 12:11:50 +0100 + u-boot (2022.01+dfsg-2ubuntu2) jammy; urgency=medium * d/patches: Add SiFive Unmatched PCIe fix (LP: #1965321) diff -Nru u-boot-2022.01+dfsg/debian/control u-boot-2022.01+dfsg/debian/control --- u-boot-2022.01+dfsg/debian/control 2022-03-10 17:54:01.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/control 2022-11-18 12:11:50.000000000 +0100 @@ -13,6 +13,7 @@ debhelper-compat (= 13), device-tree-compiler, flex, + hart-payload-generator [riscv64], libfdt-dev:native [arm64], libc6:arm64 [arm64] , libc6:armhf [armhf] , @@ -200,6 +201,23 @@ Included platforms: ${u-boot-exynos:platforms} +Package: u-boot-microchip +Architecture: riscv64 +Multi-Arch: same +Depends: ${misc:Depends} +Built-Using: ${u-boot-microchip:Built-Using} +Description: A boot loader for Microchip systems + Das U-Boot is a cross-platform bootloader for embedded systems, + used as the default boot loader by several board vendors. It is + intended to be easy to port and to debug, and runs on many + supported architectures, including PPC, ARM, MIPS, x86, m68k, + NIOS, and Microblaze. + . + This package includes boot loaders for various Microchip platforms. + . + Included platforms: + ${u-boot-microchip:platforms} + Package: u-boot-mvebu Architecture: arm64 Multi-Arch: same diff -Nru u-boot-2022.01+dfsg/debian/microchip_mpfs_icicle.yaml u-boot-2022.01+dfsg/debian/microchip_mpfs_icicle.yaml --- u-boot-2022.01+dfsg/debian/microchip_mpfs_icicle.yaml 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/microchip_mpfs_icicle.yaml 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1,4 @@ +set-name: 'PolarFire-SoC-HSS::U-Boot' +hart-entry-points: {u54_1: '0x80200000', u54_2: '0x80200000', u54_3: '0x80200000', u54_4: '0x80200000'} +payloads: + debian/build/microchip_mpfs_icicle/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} diff -Nru u-boot-2022.01+dfsg/debian/patches/riscv64/dts-mpfs-icicle-kit-update-memory-configuratio.patch u-boot-2022.01+dfsg/debian/patches/riscv64/dts-mpfs-icicle-kit-update-memory-configuratio.patch --- u-boot-2022.01+dfsg/debian/patches/riscv64/dts-mpfs-icicle-kit-update-memory-configuratio.patch 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/patches/riscv64/dts-mpfs-icicle-kit-update-memory-configuratio.patch 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1,110 @@ +From 4efdcb27771b2057dd7e5c2cd6cafa97ea0fb746 Mon Sep 17 00:00:00 2001 +From: Conor Dooley +Date: Tue, 4 Oct 2022 13:47:43 +0100 +Subject: [PATCH] riscv: dts: mpfs-icicle-kit: update memory configuration for + v2022.10 + +In the v2022.10 reference design, the seg registers are going to be +changed, resulting in a required change to the memory map in Linux. +A small 4M reservation is made at the end of 32-bit DDR to provide some +memory for the HSS to use, so that it can cache its payload.bin between +reboots of a specific context. + +Signed-off-by: Conor Dooley +Origin: https://lore.kernel.org/u-boot/20221021065922.2327875-2-padmarao.begari@microchip.com/ +--- + arch/riscv/dts/microchip-mpfs-icicle-kit.dts | 70 ++++---------------- + 1 file changed, 14 insertions(+), 56 deletions(-) + +diff --git a/arch/riscv/dts/microchip-mpfs-icicle-kit.dts b/arch/riscv/dts/microchip-mpfs-icicle-kit.dts +index 287ef3d23b..1b47865557 100644 +--- a/arch/riscv/dts/microchip-mpfs-icicle-kit.dts ++++ b/arch/riscv/dts/microchip-mpfs-icicle-kit.dts +@@ -28,70 +28,28 @@ + timebase-frequency = ; + }; + +- reserved-memory { +- ranges; +- #size-cells = <2>; +- #address-cells = <2>; +- +- fabricbuf0: fabricbuf@0 { +- compatible = "shared-dma-pool"; +- reg = <0x0 0xae000000 0x0 0x2000000>; +- label = "fabricbuf0-ddr-c"; +- }; +- +- fabricbuf1: fabricbuf@1 { +- compatible = "shared-dma-pool"; +- reg = <0x0 0xc0000000 0x0 0x8000000>; +- label = "fabricbuf1-ddr-nc"; +- }; +- +- fabricbuf2: fabricbuf@2 { +- compatible = "shared-dma-pool"; +- reg = <0x0 0xd8000000 0x0 0x8000000>; +- label = "fabricbuf2-ddr-nc-wcb"; +- }; +- }; +- +- udmabuf0 { +- compatible = "ikwzm,u-dma-buf"; +- device-name = "udmabuf-ddr-c0"; +- minor-number = <0>; +- size = <0x0 0x2000000>; +- memory-region = <&fabricbuf0>; +- sync-mode = <3>; +- }; +- +- udmabuf1 { +- compatible = "ikwzm,u-dma-buf"; +- device-name = "udmabuf-ddr-nc0"; +- minor-number = <1>; +- size = <0x0 0x8000000>; +- memory-region = <&fabricbuf1>; +- sync-mode = <3>; +- }; +- +- udmabuf2 { +- compatible = "ikwzm,u-dma-buf"; +- device-name = "udmabuf-ddr-nc-wcb0"; +- minor-number = <2>; +- size = <0x0 0x8000000>; +- memory-region = <&fabricbuf2>; +- sync-mode = <3>; +- }; +- + ddrc_cache_lo: memory@80000000 { + device_type = "memory"; +- reg = <0x0 0x80000000 0x0 0x2e000000>; +- clocks = <&clkcfg CLK_DDRC>; ++ reg = <0x0 0x80000000 0x0 0x40000000>; + status = "okay"; + }; +- ++ + ddrc_cache_hi: memory@1000000000 { + device_type = "memory"; +- reg = <0x10 0x0 0x0 0x40000000>; +- clocks = <&clkcfg CLK_DDRC>; ++ reg = <0x10 0x40000000 0x0 0x40000000>; + status = "okay"; + }; ++ ++ reserved-memory { ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ranges; ++ ++ hss_payload: region@BFC00000 { ++ reg = <0x0 0xBFC00000 0x0 0x400000>; ++ no-map; ++ }; ++ }; + }; + + &uart1 { +-- +2.37.2 + diff -Nru u-boot-2022.01+dfsg/debian/patches/riscv64/enable-reset-via-SBI-on-PolarFire-Icicle-Kit.patch u-boot-2022.01+dfsg/debian/patches/riscv64/enable-reset-via-SBI-on-PolarFire-Icicle-Kit.patch --- u-boot-2022.01+dfsg/debian/patches/riscv64/enable-reset-via-SBI-on-PolarFire-Icicle-Kit.patch 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/patches/riscv64/enable-reset-via-SBI-on-PolarFire-Icicle-Kit.patch 2022-11-18 12:05:36.000000000 +0100 @@ -0,0 +1,28 @@ +From 52ab8ff4f5fd68c066962e7cc55b87594172b5b3 Mon Sep 17 00:00:00 2001 +From: Heinrich Schuchardt +Date: Mon, 7 Nov 2022 10:45:00 +0100 +Subject: [PATCH 1/1] riscv: enable reset via SBI on PolarFire Icicle Kit + +HSS 2022.10 provides support for resetting the board. + +Signed-off-by: Heinrich Schuchardt +Reviewed-by: Padmarao Begari +Tested-by: Padmarao Begari +Origin: https://lists.denx.de/pipermail/u-boot/2022-November/499280.html +--- + configs/microchip_mpfs_icicle_defconfig | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configs/microchip_mpfs_icicle_defconfig b/configs/microchip_mpfs_icicle_defconfig +index c295b9bad3..65bd50db80 100644 +--- a/configs/microchip_mpfs_icicle_defconfig ++++ b/configs/microchip_mpfs_icicle_defconfig +@@ -21,3 +21,5 @@ CONFIG_SYS_MEM_TOP_HIDE=0x400000 + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_BOOTP_SEND_HOSTNAME=y + CONFIG_DM_MTD=y ++CONFIG_SYSRESET=y ++CONFIG_SYSRESET_SBI=y +-- +2.37.2 + diff -Nru u-boot-2022.01+dfsg/debian/patches/riscv64/mpfs-icicle-reserve-the-top-of-memory-for-the-.patch u-boot-2022.01+dfsg/debian/patches/riscv64/mpfs-icicle-reserve-the-top-of-memory-for-the-.patch --- u-boot-2022.01+dfsg/debian/patches/riscv64/mpfs-icicle-reserve-the-top-of-memory-for-the-.patch 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/patches/riscv64/mpfs-icicle-reserve-the-top-of-memory-for-the-.patch 2022-11-18 12:05:53.000000000 +0100 @@ -0,0 +1,27 @@ +From 41972b043b205b7e0847d747a41d488c5e3d189e Mon Sep 17 00:00:00 2001 +From: Conor Dooley +Date: Wed, 5 Oct 2022 13:34:13 +0100 +Subject: [PATCH 1/1] riscv: mpfs icicle: reserve the top of memory for the HSS + +Signed-off-by: Conor Dooley +Signed-off-by: Heinrich Schuchardt +--- + include/configs/microchip_mpfs_icicle.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/configs/microchip_mpfs_icicle.h b/include/configs/microchip_mpfs_icicle.h +index 4c7cfac8af..922cae9df7 100644 +--- a/include/configs/microchip_mpfs_icicle.h ++++ b/include/configs/microchip_mpfs_icicle.h +@@ -13,6 +13,8 @@ + + #define CONFIG_STANDALONE_LOAD_ADDR 0x80200000 + ++#define CONFIG_SYS_MEM_TOP_HIDE SZ_4M ++ + /* Environment options */ + + #define BOOT_TARGET_DEVICES(func) \ +-- +2.37.2 + diff -Nru u-boot-2022.01+dfsg/debian/patches/riscv64/sysreset-sbi.patch u-boot-2022.01+dfsg/debian/patches/riscv64/sysreset-sbi.patch --- u-boot-2022.01+dfsg/debian/patches/riscv64/sysreset-sbi.patch 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/patches/riscv64/sysreset-sbi.patch 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1,17 @@ +System reset via the SRST extension in the SBI should be the default. +The driver checks if the extension is available when probing. +So there is no risk in enabling it. + +Signed-off-by: Heinrich Schuchardt +Origin: https://lore.kernel.org/u-boot/20220905144049.791286-1-heinrich.schuchardt@canonical.com/ + +--- a/drivers/sysreset/Kconfig ++++ b/drivers/sysreset/Kconfig +@@ -113,6 +113,7 @@ config SYSRESET_PSCI + config SYSRESET_SBI + bool "Enable support for SBI System Reset" + depends on RISCV_SMODE && SBI_V02 ++ default y + select SYSRESET_CMD_POWEROFF if CMD_POWEROFF + help + Enable system reset and poweroff via the SBI system reset extension. diff -Nru u-boot-2022.01+dfsg/debian/patches/series u-boot-2022.01+dfsg/debian/patches/series --- u-boot-2022.01+dfsg/debian/patches/series 2022-03-25 11:12:15.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/patches/series 2022-11-18 12:08:04.000000000 +0100 @@ -38,3 +38,9 @@ efi-loader-copy-guid.patch riscv64/pci-Work-around-PCIe-link-training-failures.patch +riscv64/sysreset-sbi.patch + +# For PolarFire Icicle Kit with HSS 2022.10 +riscv64/dts-mpfs-icicle-kit-update-memory-configuratio.patch +riscv64/mpfs-icicle-reserve-the-top-of-memory-for-the-.patch +riscv64/enable-reset-via-SBI-on-PolarFire-Icicle-Kit.patch diff -Nru u-boot-2022.01+dfsg/debian/rules u-boot-2022.01+dfsg/debian/rules --- u-boot-2022.01+dfsg/debian/rules 2022-03-10 11:28:59.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/rules 2022-11-18 12:03:23.000000000 +0100 @@ -94,6 +94,10 @@ ifneq (,$(filter uboot.elf,$($(platform)_targets))) cp -u debian/build/$(platform)/u-boot debian/build/$(platform)/uboot.elf endif + ifeq ($(package),u-boot-microchip) + hss-payload-generator -c debian/microchip_mpfs_icicle.yaml \ + debian/build/microchip_mpfs_icicle/u-boot.payload + endif ifeq ($(package),u-boot-qemu) # TODO: --strip-unneeded as policy recommends? If not, why? $($(platform)_CROSS_COMPILE)strip --remove-section=.comment --remove-section=.note \ diff -Nru u-boot-2022.01+dfsg/debian/targets.mk u-boot-2022.01+dfsg/debian/targets.mk --- u-boot-2022.01+dfsg/debian/targets.mk 2022-03-10 17:53:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/targets.mk 2022-11-18 12:01:47.000000000 +0100 @@ -528,6 +528,11 @@ else ifeq (${DEB_HOST_ARCH},riscv64) +# u-boot-microchip + + u-boot-microchip_platforms += microchip_mpfs_icicle + microchip_mpfs_icicle_targets := u-boot.bin + # u-boot-sifive dpkg-gencontrol_args += "-Vu-boot-sifive:Built-Using=$(shell dpkg-query -Wf \ diff -Nru u-boot-2022.01+dfsg/debian/u-boot-microchip.docs u-boot-2022.01+dfsg/debian/u-boot-microchip.docs --- u-boot-2022.01+dfsg/debian/u-boot-microchip.docs 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/u-boot-microchip.docs 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1 @@ +doc/board/microchip/mpfs_icicle.rst diff -Nru u-boot-2022.01+dfsg/debian/u-boot-microchip.install u-boot-2022.01+dfsg/debian/u-boot-microchip.install --- u-boot-2022.01+dfsg/debian/u-boot-microchip.install 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/u-boot-microchip.install 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1 @@ +debian/build/microchip_mpfs_icicle/u-boot.payload /usr/lib/u-boot/microchip_icicle diff -Nru u-boot-2022.01+dfsg/debian/u-boot-microchip.links u-boot-2022.01+dfsg/debian/u-boot-microchip.links --- u-boot-2022.01+dfsg/debian/u-boot-microchip.links 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/u-boot-microchip.links 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1 @@ +usr/lib/u-boot/microchip_icicle usr/lib/u-boot/doc/board/microchip/mpfs_icicle.rst diff -Nru u-boot-2022.01+dfsg/debian/u-boot-microchip.lintian-overrides u-boot-2022.01+dfsg/debian/u-boot-microchip.lintian-overrides --- u-boot-2022.01+dfsg/debian/u-boot-microchip.lintian-overrides 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/u-boot-microchip.lintian-overrides 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1,15 @@ + +# There are no file conflicts across architectures for u-boot, as each +# target is only installed on a single architecture. In theory, some +# targets could be built on multiple architectures, but could instead install +# the package for the architecture needed. +u-boot-microchip binary: arch-dependent-file-not-in-arch-specific-directory *usr/lib/u-boot/*/uboot.elf* + +# These bootloaders need to be statically linked. +u-boot-microchip binary: statically-linked-binary *usr/lib/u-boot/*/uboot.elf* + +# These are bootloader binaries, and have no external dependency information +u-boot-microchip binary: shared-library-lacks-prerequisites *usr/lib/u-boot/*/uboot.elf* + +u-boot-microchip: description-synopsis-starts-with-article + diff -Nru u-boot-2022.01+dfsg/debian/u-boot-microchip.postinst u-boot-2022.01+dfsg/debian/u-boot-microchip.postinst --- u-boot-2022.01+dfsg/debian/u-boot-microchip.postinst 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/u-boot-microchip.postinst 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1,19 @@ +#!/bin/sh + +##DEBHELPER## + +set -e + +case "$1" in + configure) + target="" + if grep -q '^Microchip PolarFire-SoC Icicle Kit$' /sys/firmware/devicetree/base/model; then + target="microchip_icicle" + fi + if [ -n "$target" ] && [ -e /dev/disk/by-partlabel/loader ]; then + dd if=/usr/lib/u-boot/$target/u-boot.payload of=/dev/disk/by-partlabel/loader + fi + ;; +esac + +exit 0 diff -Nru u-boot-2022.01+dfsg/debian/u-boot-microchip.README.Debian u-boot-2022.01+dfsg/debian/u-boot-microchip.README.Debian --- u-boot-2022.01+dfsg/debian/u-boot-microchip.README.Debian 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/u-boot-microchip.README.Debian 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1,13 @@ +== Installation == + +The u-boot-microchip package installs U-Boot in its post installations script +to the partition named 'loader'. If that partition does not exist, you will +have to copy U-Boot manually. + +For the Microchip Icicle Kit, something like the following should work: + + dd conv=fsync,notrunc if=/usr/lib/u-boot/microchip_icicle/u-boot.payload \ + of=/dev/DEVICE + +Replace DEVICE by the partition with partition type EF02 +(GUID type 21686148-6449-6E6F-744E-656564454649) of the SD-card. diff -Nru u-boot-2022.01+dfsg/debian/u-boot-sifive.README.Debian u-boot-2022.01+dfsg/debian/u-boot-sifive.README.Debian --- u-boot-2022.01+dfsg/debian/u-boot-sifive.README.Debian 1970-01-01 01:00:00.000000000 +0100 +++ u-boot-2022.01+dfsg/debian/u-boot-sifive.README.Debian 2022-11-18 12:11:50.000000000 +0100 @@ -0,0 +1,12 @@ +== Installation == + +At this point, you must install U-Boot to flash yourself. + +For the SiFive HiFive Unmatched, something like the following should work: + + dd conv=fsync,notrunc if=/usr/lib/u-boot/sifive_unmatched/u-boot-spl.bin of=/dev/DEVICE bs=4096 seek=5 + dd conv=fsync,notrunc if=/usr/lib/u-boot/sifive_unmatched/u-boot.itb of=/dev/DEVICE bs=4096 seek=261 + +For DEVICE of mmcblk0, the MSEL dip switches should be set to the default of 1011. + +For mtdblock0 (the SPI flash), you'll need to "modprobe mtdblock" and set the MSEL dip switches to 0110.