diff options
author | db <db@FreeBSD.org> | 2017-02-05 04:09:25 +0800 |
---|---|---|
committer | db <db@FreeBSD.org> | 2017-02-05 04:09:25 +0800 |
commit | e3165aba9a25e9b979a6d8ae6a1d6afac214bb64 (patch) | |
tree | 71826415eb369d0dd12a86618fd8cfe40faddbed /sysutils/u-boot-rpi3 | |
parent | ef7e698885133d2361a7d077f9fdda8035eecbee (diff) | |
download | freebsd-ports-gnome-e3165aba9a25e9b979a6d8ae6a1d6afac214bb64.tar.gz freebsd-ports-gnome-e3165aba9a25e9b979a6d8ae6a1d6afac214bb64.tar.zst freebsd-ports-gnome-e3165aba9a25e9b979a6d8ae6a1d6afac214bb64.zip |
Use github for psci monitor [brd]
Chase upstream
Redo save_boot_params in lowlevel__init.S to add reserve_memory remove
save_boot_params from rpi.c
Note network code diffs are now upstreamed already
PR: ports/216757
Submitted by: brd
Diffstat (limited to 'sysutils/u-boot-rpi3')
10 files changed, 65 insertions, 140 deletions
diff --git a/sysutils/u-boot-rpi3/Makefile b/sysutils/u-boot-rpi3/Makefile index 259344b24952..1762dd4810f8 100644 --- a/sysutils/u-boot-rpi3/Makefile +++ b/sysutils/u-boot-rpi3/Makefile @@ -1,15 +1,14 @@ # $FreeBSD$ PORTNAME= u-boot -PORTVERSION= 2016.11 -PORTREVISION= 1 +PORTVERSION= 2017.01 CATEGORIES= sysutils MASTER_SITES= ftp://ftp.denx.de/pub/u-boot/ \ LOCAL/db:bootfiles PKGNAMESUFFIX= -rpi3 -DISTFILES= u-boot-${PORTVERSION}.tar.bz2 \ +DISTFILES= u-boot-${PORTVERSION}.tar.bz2:uboot \ rpi3-boot-files-2016.05.tar.bz2:bootfiles \ - rpi3-psci-monitor-master.tgz:bootfiles + rpi3-psci-monitor-master.tgz:pscimon MAINTAINER= db@FreeBSD.org COMMENT= Cross-build U-Boot loader for RPi3 @@ -18,6 +17,12 @@ LICENSE= GPLv2 BUILD_DEPENDS= aarch64-none-elf-gcc:devel/aarch64-none-elf-gcc +USE_GITHUB= nodefault +GH_ACCOUNT= gonzoua:pscimon +GH_PROJECT= rpi3-psci-monitor:pscimon +GIT_TAG= 5782052 +GH_TAGNAME= ${GIT_TAG}:pscimon + NO_ARCH= yes WRKSRC= ${WRKDIR}/u-boot-${DISTVERSION} @@ -25,7 +30,7 @@ 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_MONITOR= rpi3-psci-monitor-${GIT_TAG} PSCI_DIR= ${WRKDIR}/${PSCI_MONITOR} U_BOOT_DIR= share/u-boot/${PORTNAME}${PKGNAMESUFFIX} @@ -48,7 +53,6 @@ MAKE_ARGS+= ARCH=arm \ CONFIG_EFI=y do-configure: - (cd ${WRKDIR}; tar xvf ${DISTDIR}/${PSCI_MONITOR}.tgz) (cd ${WRKSRC}; ${GMAKE} rpi_3_defconfig) do-build: @@ -60,6 +64,7 @@ do-build: # are capable of booting u-boot.bin directly. Also copy the entire # contents of the bootfiles distribution (these are proprietary binary # files required to boot). +# Also include the armstub8.bin needed to go SMP on RPI3 do-install: ${MKDIR} ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR} ${INSTALL_DATA} ${WRKSRC}/u-boot.bin ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/ diff --git a/sysutils/u-boot-rpi3/distinfo b/sysutils/u-boot-rpi3/distinfo index 76084257447a..b972b3fd38f6 100644 --- a/sysutils/u-boot-rpi3/distinfo +++ b/sysutils/u-boot-rpi3/distinfo @@ -1,7 +1,9 @@ -TIMESTAMP = 1486071382 -SHA256 (u-boot-2016.11.tar.bz2) = 45813e6565dcc0436abe6752624324cdbf5f3ac106570d76d32b46ec529bcdc8 -SIZE (u-boot-2016.11.tar.bz2) = 12019669 +TIMESTAMP = 1486166232 +SHA256 (u-boot-2017.01.tar.bz2) = 6c425175f93a4bcf2ec9faf5658ef279633dbd7856a293d95bd1ff516528ecf2 +SIZE (u-boot-2017.01.tar.bz2) = 12224884 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 +SHA256 (gonzoua-rpi3-psci-monitor-5782052_GH0.tar.gz) = 0d1095492a31a6bcb726b688a75769959099bc4d1701c888e46711b1d528c3ae +SIZE (gonzoua-rpi3-psci-monitor-5782052_GH0.tar.gz) = 5110 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 index a974a4677251..607b8153571e 100644 --- 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 @@ -1,6 +1,6 @@ ---- arch/arm/include/asm/system.h.orig 2016-11-14 16:27:11 UTC +--- arch/arm/include/asm/system.h.orig 2017-01-09 16:57:05 UTC +++ arch/arm/include/asm/system.h -@@ -201,22 +201,6 @@ void __noreturn psci_system_off(void); +@@ -329,22 +329,6 @@ void psci_arch_init(void); * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3); */ @@ -23,7 +23,7 @@ #ifdef CONFIG_ARMV7_LPAE void switch_to_hypervisor_ret(void); #endif -@@ -410,6 +394,22 @@ void mmu_page_table_flush(unsigned long +@@ -538,6 +522,22 @@ void mmu_page_table_flush(unsigned long #ifndef __ASSEMBLY__ /** diff --git a/sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_lowlevel__init.S b/sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_lowlevel__init.S new file mode 100644 index 000000000000..8042881941fe --- /dev/null +++ b/sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_lowlevel__init.S @@ -0,0 +1,28 @@ +--- board/raspberrypi/rpi/lowlevel_init.S.orig 2017-01-09 16:57:05 UTC ++++ board/raspberrypi/rpi/lowlevel_init.S +@@ -9,10 +9,15 @@ + + .align 8 + .global fw_dtb_pointer +-fw_dtb_pointer: ++ + #ifdef CONFIG_ARM64 ++fw_dtb_pointer: ++ .dword 0x0 ++.global reserve_memory ++reserve_memory: + .dword 0x0 + #else ++fw_dtb_pointer: + .word 0x0 + #endif + +@@ -28,6 +33,8 @@ save_boot_params: + #ifdef CONFIG_ARM64 + adr x8, fw_dtb_pointer + str x0, [x8] ++ adr x8, reserve_memory ++ str x1, [x8] + #else + str r2, fw_dtb_pointer + #endif 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 index 64a35ce5af6d..711503752db1 100644 --- a/sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_rpi.c +++ b/sysutils/u-boot-rpi3/files/patch-board_raspberrypi_rpi_rpi.c @@ -1,6 +1,6 @@ ---- board/raspberrypi/rpi/rpi.c.orig 2016-11-14 16:27:11 UTC +--- board/raspberrypi/rpi/rpi.c.orig 2017-01-09 16:57:05 UTC +++ board/raspberrypi/rpi/rpi.c -@@ -13,6 +13,7 @@ +@@ -14,6 +14,7 @@ #include <lcd.h> #include <memalign.h> #include <mmc.h> @@ -8,21 +8,20 @@ #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[ +@@ -27,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR; + + /* From lowlevel_init.S */ + extern unsigned long fw_dtb_pointer; +- ++extern unsigned long reserve_memory; + + struct msg_get_arm_mem { + struct bcm2835_mbox_hdr hdr; +@@ -220,6 +221,12 @@ 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; @@ -31,13 +30,13 @@ #endif int dram_init(void) -@@ -362,6 +379,10 @@ int misc_init_r(void) +@@ -355,6 +362,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); ++ if (fw_dtb_pointer) ++ setenv_hex("fdt_addr_r", (ulong)fw_dtb_pointer); +#endif return 0; diff --git a/sysutils/u-boot-rpi3/files/patch-include_configs_rpi.h b/sysutils/u-boot-rpi3/files/patch-include_configs_rpi.h index 6b133b4cb4b0..f41fa14a1ff9 100644 --- a/sysutils/u-boot-rpi3/files/patch-include_configs_rpi.h +++ b/sysutils/u-boot-rpi3/files/patch-include_configs_rpi.h @@ -1,6 +1,6 @@ ---- include/configs/rpi.h.orig 2016-11-14 16:27:11 UTC +--- include/configs/rpi.h.orig 2017-01-09 16:57:05 UTC +++ include/configs/rpi.h -@@ -104,11 +104,13 @@ +@@ -99,11 +99,13 @@ #endif /* Console UART */ diff --git a/sysutils/u-boot-rpi3/files/patch-include_efi__api.h b/sysutils/u-boot-rpi3/files/patch-include_efi__api.h deleted file mode 100644 index f3793f87a4a0..000000000000 --- a/sysutils/u-boot-rpi3/files/patch-include_efi__api.h +++ /dev/null @@ -1,21 +0,0 @@ ---- include/efi_api.h.orig 2016-11-14 16:27:11 UTC -+++ include/efi_api.h -@@ -268,6 +268,18 @@ struct efi_device_path { - u16 length; - }; - -+struct efi_mac_addr { -+ u8 addr[32]; -+}; -+ -+#define DEVICE_PATH_TYPE_MESSAGING_DEVICE 0x03 -+struct efi_device_path_mac_addr { -+ struct efi_device_path dp; -+ struct efi_mac_addr mac; -+ u8 if_type; -+}; -+ -+# define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR 0x0b - #define DEVICE_PATH_TYPE_MEDIA_DEVICE 0x04 - # define DEVICE_PATH_SUB_TYPE_FILE_PATH 0x04 - diff --git a/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__console.c b/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__console.c deleted file mode 100644 index 6262ba6ea588..000000000000 --- a/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__console.c +++ /dev/null @@ -1,40 +0,0 @@ ---- lib/efi_loader/efi_console.c.orig 2016-11-14 16:27:11 UTC -+++ lib/efi_loader/efi_console.c -@@ -9,9 +9,9 @@ - #include <common.h> - #include <efi_loader.h> - --/* If we can't determine the console size, default to 80x24 */ -+/* If we can't determine the console size, default to 80x25 */ - static int console_columns = 80; --static int console_rows = 24; -+static int console_rows = 25; - static bool console_size_queried; - - const efi_guid_t efi_guid_console_control = CONSOLE_CONTROL_GUID; -@@ -165,6 +165,8 @@ static efi_status_t EFIAPI efi_cout_quer - unsigned long mode_number, unsigned long *columns, - unsigned long *rows) - { -+ unsigned long current_mode; -+ - EFI_ENTRY("%p, %ld, %p, %p", this, mode_number, columns, rows); - - if (!console_size_queried) { -@@ -196,6 +198,16 @@ static efi_status_t EFIAPI efi_cout_quer - } - - out: -+ if (console_columns == 80 && console_rows == 25) -+ current_mode = 0; -+ else if (console_columns == 80 && console_rows == 50) -+ current_mode = 1; -+ else -+ current_mode = 2; -+ -+ if (mode_number != current_mode) -+ return EFI_EXIT(EFI_UNSUPPORTED); -+ - if (columns) - *columns = console_columns; - if (rows) diff --git a/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__disk.c b/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__disk.c index 0a870faa26dc..23242847aef4 100644 --- a/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__disk.c +++ b/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__disk.c @@ -1,4 +1,4 @@ ---- lib/efi_loader/efi_disk.c.orig 2016-11-14 16:27:11 UTC +--- lib/efi_loader/efi_disk.c.orig 2017-01-09 16:57:05 UTC +++ lib/efi_loader/efi_disk.c @@ -197,11 +197,13 @@ static void efi_disk_add_dev(const char const char *if_typename, diff --git a/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__net.c b/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__net.c deleted file mode 100644 index c79caa2fb6a9..000000000000 --- a/sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__net.c +++ /dev/null @@ -1,48 +0,0 @@ ---- lib/efi_loader/efi_net.c.orig 2016-11-14 16:27:11 UTC -+++ lib/efi_loader/efi_net.c -@@ -27,7 +27,8 @@ struct efi_net_obj { - struct efi_simple_network net; - struct efi_simple_network_mode net_mode; - /* Device path to the network adapter */ -- struct efi_device_path_file_path dp[2]; -+ struct efi_device_path_mac_addr dp_mac; -+ struct efi_device_path_file_path dp_end; - /* PXE struct to transmit dhcp data */ - struct efi_pxe pxe; - struct efi_pxe_mode pxe_mode; -@@ -205,7 +206,7 @@ static efi_status_t EFIAPI efi_net_open_ - struct efi_simple_network *net = handle; - struct efi_net_obj *netobj = container_of(net, struct efi_net_obj, net); - -- *protocol_interface = netobj->dp; -+ *protocol_interface = &netobj->dp_mac; - - return EFI_SUCCESS; - } -@@ -236,11 +237,10 @@ void efi_net_set_dhcp_ack(void *pkt, int - int efi_net_register(void **handle) - { - struct efi_net_obj *netobj; -- struct efi_device_path_file_path dp_net = { -- .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE, -- .dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH, -+ struct efi_device_path_mac_addr dp_net = { -+ .dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE, -+ .dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR, - .dp.length = sizeof(dp_net), -- .str = { 'N', 'e', 't' }, - }; - struct efi_device_path_file_path dp_end = { - .dp.type = DEVICE_PATH_TYPE_END, -@@ -279,8 +279,9 @@ int efi_net_register(void **handle) - netobj->net.receive = efi_net_receive; - netobj->net.mode = &netobj->net_mode; - netobj->net_mode.state = EFI_NETWORK_STARTED; -- netobj->dp[0] = dp_net; -- netobj->dp[1] = dp_end; -+ netobj->dp_mac = dp_net; -+ netobj->dp_end = dp_end; -+ memcpy(netobj->dp_mac.mac.addr, eth_get_ethaddr(), 6); - memcpy(netobj->net_mode.current_address.mac_addr, eth_get_ethaddr(), 6); - netobj->net_mode.max_packet_size = PKTSIZE; - |