diff options
author | skrll <skrll@pkgsrc.org> | 2018-11-05 07:27:59 +0000 |
---|---|---|
committer | skrll <skrll@pkgsrc.org> | 2018-11-05 07:27:59 +0000 |
commit | e10427dcdb989c72b1eb40a5ab44534220f1e974 (patch) | |
tree | c90b4bbb1ad067e3c7b12cba12acd4eccc22bb0c /emulators | |
parent | c3b13d2c4c54174f2f60beb0795958c49099f26f (diff) | |
download | pkgsrc-e10427dcdb989c72b1eb40a5ab44534220f1e974.tar.gz |
Support the uboot kernel_noload image type as used by NetBSD/evbarm
GENERIC kernel.
Bump PKGREVISION
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/qemu/Makefile | 4 | ||||
-rw-r--r-- | emulators/qemu/distinfo | 5 | ||||
-rw-r--r-- | emulators/qemu/patches/patch-hw_arm_boot.c | 26 | ||||
-rw-r--r-- | emulators/qemu/patches/patch-hw_core_loader.c | 27 | ||||
-rw-r--r-- | emulators/qemu/patches/patch-hw_core_uboot__image.h | 20 |
5 files changed, 79 insertions, 3 deletions
diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile index f937139d886..d2dd9491ffd 100644 --- a/emulators/qemu/Makefile +++ b/emulators/qemu/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.191 2018/08/22 09:45:05 wiz Exp $ +# $NetBSD: Makefile,v 1.192 2018/11/05 07:27:59 skrll Exp $ DISTNAME= qemu-3.0.0 -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= emulators MASTER_SITES= https://download.qemu.org/ EXTRACT_SUFX= .tar.xz diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo index c5bdff65887..2ccf48ce562 100644 --- a/emulators/qemu/distinfo +++ b/emulators/qemu/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.137 2018/08/16 10:15:09 adam Exp $ +$NetBSD: distinfo,v 1.138 2018/11/05 07:27:59 skrll Exp $ SHA1 (qemu-3.0.0.tar.xz) = fffb4aa0139c7290295a129e040cec0df4468ea6 RMD160 (qemu-3.0.0.tar.xz) = ea61cb8b6b144c7017c3a53161f883c3aeb15611 @@ -9,6 +9,9 @@ SHA1 (patch-audio_audio.c) = 98a1de2fd48638886b5d16f6a61dc72910e98b41 SHA1 (patch-block.c) = 5eb15a87d6646719bf1e9277fbe73a99e4905481 SHA1 (patch-contrib_ivshmem-client_ivshmem-client.c) = 40c8751607cbf66a37e4c4e08f2664b864e2e984 SHA1 (patch-contrib_ivshmem-server_ivshmem-server.c) = d8f53432b5752f4263dc4ef96108a976a05147a3 +SHA1 (patch-hw_arm_boot.c) = bd28e4b8e8732a2b01ba1d0e8a727e8e7bc5227a +SHA1 (patch-hw_core_loader.c) = 06ff8bfa5be720e428668987598d55b6799202e7 +SHA1 (patch-hw_core_uboot__image.h) = 26a656310d991747b7080b9f28042afd536e4c28 SHA1 (patch-hw_display_omap__dss.c) = 6b13242f28e32346bc70548c216c578d98fd3420 SHA1 (patch-hw_net_etraxfs__eth.c) = e5dd1661d60dbcd27b332403e0843500ba9544bc SHA1 (patch-hw_net_xilinx__axienet.c) = ebcd2676d64ce6f31e4a8c976d4fdf530ad5e8b7 diff --git a/emulators/qemu/patches/patch-hw_arm_boot.c b/emulators/qemu/patches/patch-hw_arm_boot.c new file mode 100644 index 00000000000..60b69f66a8a --- /dev/null +++ b/emulators/qemu/patches/patch-hw_arm_boot.c @@ -0,0 +1,26 @@ +$NetBSD: patch-hw_arm_boot.c,v 1.1 2018/11/05 07:27:59 skrll Exp $ + +--- hw/arm/boot.c.orig 2018-11-04 17:27:47.000000000 +0000 ++++ hw/arm/boot.c +@@ -29,8 +29,9 @@ + * Documentation/arm/Booting and Documentation/arm64/booting.txt + * They have different preferred image load offsets from system RAM base. + */ +-#define KERNEL_ARGS_ADDR 0x100 +-#define KERNEL_LOAD_ADDR 0x00010000 ++#define KERNEL_ARGS_ADDR 0x100 ++#define KERNEL_NOLOAD_ADDR 0x00000000 ++#define KERNEL_LOAD_ADDR 0x00010000 + #define KERNEL64_LOAD_ADDR 0x00080000 + + #define ARM64_TEXT_OFFSET_OFFSET 8 +@@ -1049,7 +1050,8 @@ void arm_load_kernel(ARMCPU *cpu, struct + } + entry = elf_entry; + if (kernel_size < 0) { +- kernel_size = load_uimage_as(info->kernel_filename, &entry, NULL, ++ uint64_t loadaddr = info->loader_start + KERNEL_NOLOAD_ADDR; ++ kernel_size = load_uimage_as(info->kernel_filename, &entry, &loadaddr, + &is_linux, NULL, NULL, as); + } + if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64) && kernel_size < 0) { diff --git a/emulators/qemu/patches/patch-hw_core_loader.c b/emulators/qemu/patches/patch-hw_core_loader.c new file mode 100644 index 00000000000..700792064e4 --- /dev/null +++ b/emulators/qemu/patches/patch-hw_core_loader.c @@ -0,0 +1,27 @@ +$NetBSD: patch-hw_core_loader.c,v 1.1 2018/11/05 07:27:59 skrll Exp $ + +--- hw/core/loader.c.orig 2018-08-14 19:10:34.000000000 +0000 ++++ hw/core/loader.c +@@ -637,13 +637,19 @@ static int load_uboot_image(const char * + goto out; + + if (hdr->ih_type != image_type) { +- fprintf(stderr, "Wrong image type %d, expected %d\n", hdr->ih_type, +- image_type); +- goto out; ++ if (image_type != IH_TYPE_KERNEL && hdr->ih_type != IH_TYPE_KERNEL_NOLOAD) { ++ fprintf(stderr, "Wrong image type %d, expected %d\n", hdr->ih_type, ++ image_type); ++ goto out; ++ } + } + + /* TODO: Implement other image types. */ + switch (hdr->ih_type) { ++ case IH_TYPE_KERNEL_NOLOAD: ++ hdr->ih_load = *loadaddr + sizeof(*hdr); ++ hdr->ih_ep += hdr->ih_load; ++ + case IH_TYPE_KERNEL: + address = hdr->ih_load; + if (translate_fn) { diff --git a/emulators/qemu/patches/patch-hw_core_uboot__image.h b/emulators/qemu/patches/patch-hw_core_uboot__image.h new file mode 100644 index 00000000000..a9a005762bd --- /dev/null +++ b/emulators/qemu/patches/patch-hw_core_uboot__image.h @@ -0,0 +1,20 @@ +$NetBSD: patch-hw_core_uboot__image.h,v 1.1 2018/11/05 07:27:59 skrll Exp $ + +--- hw/core/uboot_image.h.orig 2018-08-14 19:10:34.000000000 +0000 ++++ hw/core/uboot_image.h +@@ -75,6 +75,7 @@ + #define IH_CPU_NIOS2 15 /* Nios-II */ + #define IH_CPU_BLACKFIN 16 /* Blackfin */ + #define IH_CPU_AVR32 17 /* AVR32 */ ++#define IH_CPU_ARM64 22 /* ARM64 */ + + /* + * Image Types +@@ -124,6 +125,7 @@ + #define IH_TYPE_SCRIPT 6 /* Script file */ + #define IH_TYPE_FILESYSTEM 7 /* Filesystem Image (any type) */ + #define IH_TYPE_FLATDT 8 /* Binary Flat Device Tree Blob */ ++#define IH_TYPE_KERNEL_NOLOAD 14 /* OS Kernel Image (noload) */ + + /* + * Compression Types |