diff options
author | db <db@FreeBSD.org> | 2017-02-03 07:18:45 +0800 |
---|---|---|
committer | db <db@FreeBSD.org> | 2017-02-03 07:18:45 +0800 |
commit | d8f8d4290eb62009b7c6416788939ccf34d5cd73 (patch) | |
tree | a2c91cb6f0efdfc7a92c3ce0b5e617e483da00f4 /sysutils/u-boot-rpi3 | |
parent | 3f96e6fe73c9ed46e465279a87cd9693919ac3e6 (diff) | |
download | freebsd-ports-gnome-d8f8d4290eb62009b7c6416788939ccf34d5cd73.tar.gz freebsd-ports-gnome-d8f8d4290eb62009b7c6416788939ccf34d5cd73.tar.zst freebsd-ports-gnome-d8f8d4290eb62009b7c6416788939ccf34d5cd73.zip |
Add gonzo's psci monitor code to support RPI3 SMP
Diffstat (limited to 'sysutils/u-boot-rpi3')
-rw-r--r-- | sysutils/u-boot-rpi3/Makefile | 15 | ||||
-rw-r--r-- | sysutils/u-boot-rpi3/distinfo | 4 | ||||
-rw-r--r-- | sysutils/u-boot-rpi3/files/patch-arch_arm_include_asm_system.h | 48 | ||||
-rw-r--r-- | sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_rpi.c | 44 |
4 files changed, 108 insertions, 3 deletions
diff --git a/sysutils/u-boot-rpi3/Makefile b/sysutils/u-boot-rpi3/Makefile index 838f27c36b5c..259344b24952 100644 --- a/sysutils/u-boot-rpi3/Makefile +++ b/sysutils/u-boot-rpi3/Makefile @@ -2,12 +2,14 @@ PORTNAME= u-boot PORTVERSION= 2016.11 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ftp://ftp.denx.de/pub/u-boot/ \ LOCAL/db:bootfiles PKGNAMESUFFIX= -rpi3 DISTFILES= u-boot-${PORTVERSION}.tar.bz2 \ - rpi3-boot-files-2016.05.tar.bz2:bootfiles + rpi3-boot-files-2016.05.tar.bz2:bootfiles \ + rpi3-psci-monitor-master.tgz:bootfiles MAINTAINER= db@FreeBSD.org COMMENT= Cross-build U-Boot loader for RPi3 @@ -23,6 +25,8 @@ USES= gmake tar:bzip2 SSP_UNSAFE= yes # cross-LD does not support -fstack-protector WRK_BOOTFILES= ${WRKDIR}/rpi3-boot-files-2016.05 +PSCI_MONITOR= rpi3-psci-monitor-master +PSCI_DIR= ${WRKDIR}/${PSCI_MONITOR} U_BOOT_DIR= share/u-boot/${PORTNAME}${PKGNAMESUFFIX} PLIST_FILES= ${U_BOOT_DIR}/u-boot.bin \ @@ -37,14 +41,20 @@ PLIST_FILES= ${U_BOOT_DIR}/u-boot.bin \ ${U_BOOT_DIR}/start_db.elf \ ${U_BOOT_DIR}/start_x.elf \ ${U_BOOT_DIR}/config.txt \ - ${U_BOOT_DIR}/LICENCE.broadcom + ${U_BOOT_DIR}/LICENCE.broadcom \ + ${U_BOOT_DIR}/armstub8.bin MAKE_ARGS+= ARCH=arm \ CROSS_COMPILE=aarch64-none-elf- \ CONFIG_EFI=y do-configure: + (cd ${WRKDIR}; tar xvf ${DISTDIR}/${PSCI_MONITOR}.tgz) (cd ${WRKSRC}; ${GMAKE} rpi_3_defconfig) +do-build: + (cd ${WRKSRC}; ${GMAKE} ${MAKE_ARGS}) + (cd ${PSCI_DIR}; ${MAKE}) + # The output of the u-boot build process is u-boot.bin. Older firmware # versions require a standard header, but the recent versions (our case) # are capable of booting u-boot.bin directly. Also copy the entire @@ -55,5 +65,6 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/u-boot.bin ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/ ${INSTALL_DATA} ${DESCR} ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/README ${INSTALL_DATA} ${WRK_BOOTFILES}/* ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR} + ${INSTALL_DATA} ${PSCI_DIR}/pscimon.bin ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/armstub8.bin .include <bsd.port.mk> diff --git a/sysutils/u-boot-rpi3/distinfo b/sysutils/u-boot-rpi3/distinfo index 93b5211f51a6..76084257447a 100644 --- a/sysutils/u-boot-rpi3/distinfo +++ b/sysutils/u-boot-rpi3/distinfo @@ -1,5 +1,7 @@ -TIMESTAMP = 1479225351 +TIMESTAMP = 1486071382 SHA256 (u-boot-2016.11.tar.bz2) = 45813e6565dcc0436abe6752624324cdbf5f3ac106570d76d32b46ec529bcdc8 SIZE (u-boot-2016.11.tar.bz2) = 12019669 SHA256 (rpi3-boot-files-2016.05.tar.bz2) = 8d5a2e453c9140d989133bc7cd991456138f4eb6c9722cd9eee4af4c1722e216 SIZE (rpi3-boot-files-2016.05.tar.bz2) = 6905733 +SHA256 (rpi3-psci-monitor-master.tgz) = 47bbda7baede4e0a018869e9a7a9a05e37de5f8255ce6b5939c90bbd4f42f5a2 +SIZE (rpi3-psci-monitor-master.tgz) = 5033 diff --git a/sysutils/u-boot-rpi3/files/patch-arch_arm_include_asm_system.h b/sysutils/u-boot-rpi3/files/patch-arch_arm_include_asm_system.h new file mode 100644 index 000000000000..a974a4677251 --- /dev/null +++ b/sysutils/u-boot-rpi3/files/patch-arch_arm_include_asm_system.h @@ -0,0 +1,48 @@ +--- arch/arm/include/asm/system.h.orig 2016-11-14 16:27:11 UTC ++++ arch/arm/include/asm/system.h +@@ -201,22 +201,6 @@ void __noreturn psci_system_off(void); + * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3); + */ + +-/** +- * save_boot_params_ret() - Return from save_boot_params() +- * +- * If you provide save_boot_params(), then you should jump back to this +- * function when done. Try to preserve all registers. +- * +- * If your implementation of save_boot_params() is in C then it is acceptable +- * to simply call save_boot_params_ret() at the end of your function. Since +- * there is no link register set up, you cannot just exit the function. U-Boot +- * will return to the (initialised) value of lr, and likely crash/hang. +- * +- * If your implementation of save_boot_params() is in assembler then you +- * should use 'b' or 'bx' to return to save_boot_params_ret. +- */ +-void save_boot_params_ret(void); +- + #ifdef CONFIG_ARMV7_LPAE + void switch_to_hypervisor_ret(void); + #endif +@@ -410,6 +394,22 @@ void mmu_page_table_flush(unsigned long + + #ifndef __ASSEMBLY__ + /** ++ * save_boot_params_ret() - Return from save_boot_params() ++ * ++ * If you provide save_boot_params(), then you should jump back to this ++ * function when done. Try to preserve all registers. ++ * ++ * If your implementation of save_boot_params() is in C then it is acceptable ++ * to simply call save_boot_params_ret() at the end of your function. Since ++ * there is no link register set up, you cannot just exit the function. U-Boot ++ * will return to the (initialised) value of lr, and likely crash/hang. ++ * ++ * If your implementation of save_boot_params() is in assembler then you ++ * should use 'b' or 'bx' to return to save_boot_params_ret. ++ */ ++void save_boot_params_ret(void); ++ ++/** + * Change the cache settings for a region. + * + * \param start start address of memory region to change diff --git a/sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_rpi.c b/sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_rpi.c new file mode 100644 index 000000000000..64a35ce5af6d --- /dev/null +++ b/sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_rpi.c @@ -0,0 +1,44 @@ +--- board/raspberrypi/rpi/rpi.c.orig 2016-11-14 16:27:11 UTC ++++ board/raspberrypi/rpi/rpi.c +@@ -13,6 +13,7 @@ + #include <lcd.h> + #include <memalign.h> + #include <mmc.h> ++#include <asm/system.h> + #include <asm/gpio.h> + #include <asm/arch/mbox.h> + #include <asm/arch/sdhci.h> +@@ -253,6 +254,22 @@ static struct mm_region bcm2837_mem_map[ + }; + + struct mm_region *mem_map = bcm2837_mem_map; ++ ++static u64 fw_fdt_address __attribute__ ((section(".data"))); ++static u64 reserve_memory __attribute__ ((section(".data"))); ++ ++void save_boot_params(u64 x0, u64 x1, u64 x2, u64 x3) ++{ ++ fw_fdt_address = x0; ++ reserve_memory = x1; ++ save_boot_params_ret(); ++} ++ ++void dram_init_banksize(void) ++{ ++ gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE + reserve_memory; ++ gd->bd->bi_dram[0].size = get_effective_memsize() - reserve_memory; ++} + #endif + + int dram_init(void) +@@ -362,6 +379,10 @@ int misc_init_r(void) + set_board_info(); + #endif + set_serial_number(); ++#ifdef CONFIG_ARM64 ++ if (fw_fdt_address) ++ setenv_hex("fdt_addr_r", (ulong)fw_fdt_address); ++#endif + + return 0; + } |