forked from opencomputeproject/onie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
onie-mk-itb: allow to specify kernel load address and entry point
armv7a's default load address and entry point are 0x6000_8000 now. The patch has been tested in Accton powerpc and arm platforms. Signed-off-by: Curt Brune <[email protected]>
- Loading branch information
Showing
5 changed files
with
38 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# Copyright (C) 2014,2015 Curt Brune <[email protected]> | ||
# Copyright (C) 2016 david_yang <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
|
@@ -13,6 +14,8 @@ CROSSPREFIX ?= $(TARGET)- | |
CROSSBIN ?= $(XTOOLS_INSTALL_DIR)/$(TARGET)/bin | ||
|
||
KERNEL_ARCH = arm | ||
KERNEL_LOAD_ADDRESS ?= 0x60008000 | ||
KERNEL_ENTRY_POINT ?= 0x60008000 | ||
KERNEL_DTB ?= $(MACHINE).dtb | ||
KERNEL_DTB_PATH ?= $(KERNEL_DTB) | ||
KERNEL_IMAGE_FILE = $(LINUX_BOOTDIR)/compressed/piggy.gzip | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# Copyright (C) 2013,2014,2015 Curt Brune <[email protected]> | ||
# Copyright (C) 2014 david_yang <[email protected]> | ||
# Copyright (C) 2014,2016 david_yang <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
|
@@ -14,6 +14,8 @@ CROSSPREFIX ?= $(TARGET)- | |
CROSSBIN ?= $(XTOOLS_INSTALL_DIR)/$(TARGET)/bin | ||
|
||
KERNEL_ARCH = powerpc | ||
KERNEL_LOAD_ADDRESS ?= 0x00000000 | ||
KERNEL_ENTRY_POINT ?= 0x00000000 | ||
KERNEL_DTB ?= $(MACHINE).dtb | ||
KERNEL_DTB_PATH ?= $(KERNEL_DTB) | ||
KERNEL_IMAGE_FILE = $(LINUXDIR)/vmlinux.bin.gz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# Copyright (C) 2013,2014,2015 Curt Brune <[email protected]> | ||
# Copyright (C) 2015 david_yang <[email protected]> | ||
# Copyright (C) 2015,2016 david_yang <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
|
@@ -86,6 +86,7 @@ $(DEMO_UIMAGE_COMPLETE_STAMP): $(KERNEL_INSTALL_STAMP) $(DEMO_SYSROOT_CPIO_XZ) | |
$(Q) echo "==== Create demo $(MACHINE_PREFIX) u-boot multi-file initramfs itb ====" | ||
$(Q) cd $(IMAGEDIR) && \ | ||
V=$(V) $(SCRIPTDIR)/onie-mk-itb.sh $(MACHINE) $(MACHINE_PREFIX) $(UBOOT_ITB_ARCH) \ | ||
$(KERNEL_LOAD_ADDRESS) $(KERNEL_ENTRY_POINT) \ | ||
$(KERNEL_VMLINUZ) $(IMAGEDIR)/$(MACHINE_PREFIX).dtb $(DEMO_SYSROOT_CPIO_XZ) $(DEMO_UIMAGE) | ||
$(Q) touch $@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# Copyright (C) 2013,2014,2015,2016 Curt Brune <[email protected]> | ||
# Copyright (C) 2014-2015 david_yang <[email protected]> | ||
# Copyright (C) 2014,2015,2016 david_yang <[email protected]> | ||
# Copyright (C) 2014 Stephen Su <[email protected]> | ||
# Copyright (C) 2014 Puneet <[email protected]> | ||
# Copyright (C) 2015 Carlos Cardenas <[email protected]> | ||
|
@@ -294,6 +294,7 @@ $(IMAGEDIR)/%.itb : $(KERNEL_INSTALL_STAMP) $(SYSROOT_CPIO_XZ) $(SCRIPTDIR)/onie | |
$(Q) echo "==== Create $* u-boot multi-file .itb image ====" | ||
$(Q) cd $(IMAGEDIR) && \ | ||
V=$(V) $(SCRIPTDIR)/onie-mk-itb.sh $(MACHINE) $(MACHINE_PREFIX) $(UBOOT_ITB_ARCH) \ | ||
$(KERNEL_LOAD_ADDRESS) $(KERNEL_ENTRY_POINT) \ | ||
$(KERNEL_VMLINUZ) $(IMAGEDIR)/$(MACHINE_PREFIX).dtb $(SYSROOT_CPIO_XZ) $@ | ||
|
||
$(UPDATER_ITB) : $(ITB_IMAGE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# Copyright (C) 2013,2014,2015 Curt Brune <[email protected]> | ||
# Copyright (C) 2016 david_yang <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
|
@@ -21,45 +22,47 @@ MACHINE_PREFIX="$2" | |
} | ||
|
||
ARCH="$3" | ||
case $ARCH in | ||
ppc) | ||
KERNEL_COMPRESSION="gzip" | ||
KERNEL_LOAD="0x00000000" | ||
KERNEL_ENTRY="0x00000000" | ||
INITRD_LOAD="0x00000000" | ||
FTD="fdt = \"dtb\";" | ||
;; | ||
arm) | ||
KERNEL_COMPRESSION="gzip" | ||
KERNEL_LOAD="0x61008000" | ||
KERNEL_ENTRY="0x61008000" | ||
INITRD_LOAD="0x00000000" | ||
FTD="fdt = \"dtb\";" | ||
;; | ||
*) | ||
echo "Error: Unsupported architecture: $ARCH" | ||
exit 1 | ||
esac | ||
|
||
KERNEL="$4" | ||
if [ "$ARCH" != "ppc" ] && | ||
[ "$ARCH" != "arm" ] ; then | ||
echo "Error: Unsupported architecture: $ARCH" | ||
exit 1 | ||
fi | ||
|
||
KERNEL_LOAD="$4" | ||
[ -n "$KERNEL_LOAD" ] || { | ||
echo "Error: KERNEL_LOAD was not specified" | ||
exit 1 | ||
} | ||
|
||
KERNEL_ENTRY="$5" | ||
[ -n "$KERNEL_ENTRY" ] || { | ||
echo "Error: KERNEL_ENTRY was not specified" | ||
exit 1 | ||
} | ||
|
||
KERNEL_COMPRESSION="gzip" | ||
INITRD_LOAD="0x00000000" | ||
FDT="fdt = \"dtb\";" | ||
|
||
KERNEL="$6" | ||
[ -r "$KERNEL" ] || { | ||
echo "Error: KERNEL file is not readable: $KERNEL" | ||
exit 1 | ||
} | ||
|
||
DTB="$5" | ||
DTB="$7" | ||
[ -r "$DTB" ] || { | ||
echo "Error: DTB file is not readable: $DTB" | ||
exit 1 | ||
} | ||
|
||
SYSROOT="$6" | ||
SYSROOT="$8" | ||
[ -r "$SYSROOT" ] || { | ||
echo "Error: SYSROOT file is not readable: $SYSROOT" | ||
exit 1 | ||
} | ||
|
||
OUTFILE="$7" | ||
OUTFILE="$9" | ||
[ -n "$OUTFILE" ] || { | ||
echo "Error: output .itb file not specified" | ||
exit 1 | ||
|
@@ -149,7 +152,7 @@ DTB="$(realpath $DTB)" | |
description = "${MACHINE_PREFIX}"; | ||
kernel = "kernel"; | ||
ramdisk = "initramfs"; | ||
$FTD | ||
$FDT | ||
}; | ||
}; | ||
}; | ||
|