pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/qemu Support the uboot kernel_noload image t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1105fd2fb3c1
branches:  trunk
changeset: 324972:1105fd2fb3c1
user:      skrll <skrll%pkgsrc.org@localhost>
date:      Mon Nov 05 07:27:59 2018 +0000

description:
Support the uboot kernel_noload image type as used by NetBSD/evbarm
GENERIC kernel.

Bump PKGREVISION

diffstat:

 emulators/qemu/Makefile                             |   4 +-
 emulators/qemu/distinfo                             |   5 +++-
 emulators/qemu/patches/patch-hw_arm_boot.c          |  26 ++++++++++++++++++++
 emulators/qemu/patches/patch-hw_core_loader.c       |  27 +++++++++++++++++++++
 emulators/qemu/patches/patch-hw_core_uboot__image.h |  20 +++++++++++++++
 5 files changed, 79 insertions(+), 3 deletions(-)

diffs (117 lines):

diff -r fe1d005af054 -r 1105fd2fb3c1 emulators/qemu/Makefile
--- a/emulators/qemu/Makefile   Mon Nov 05 05:43:04 2018 +0000
+++ b/emulators/qemu/Makefile   Mon Nov 05 07:27:59 2018 +0000
@@ -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 -r fe1d005af054 -r 1105fd2fb3c1 emulators/qemu/distinfo
--- a/emulators/qemu/distinfo   Mon Nov 05 05:43:04 2018 +0000
+++ b/emulators/qemu/distinfo   Mon Nov 05 07:27:59 2018 +0000
@@ -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-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 -r fe1d005af054 -r 1105fd2fb3c1 emulators/qemu/patches/patch-hw_arm_boot.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/qemu/patches/patch-hw_arm_boot.c        Mon Nov 05 07:27:59 2018 +0000
@@ -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 -r fe1d005af054 -r 1105fd2fb3c1 emulators/qemu/patches/patch-hw_core_loader.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/qemu/patches/patch-hw_core_loader.c     Mon Nov 05 07:27:59 2018 +0000
@@ -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 -r fe1d005af054 -r 1105fd2fb3c1 emulators/qemu/patches/patch-hw_core_uboot__image.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/qemu/patches/patch-hw_core_uboot__image.h       Mon Nov 05 07:27:59 2018 +0000
@@ -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



Home | Main Index | Thread Index | Old Index