Преглед изворни кода

Merge branch 'master' of git+ssh://openadk.org/git/openadk

Waldemar Brodkorb пре 10 година
родитељ
комит
ea1244a1be

+ 1 - 0
Config.in

@@ -17,6 +17,7 @@ mainmenu "OpenADK Configuration"
 
 config ADK_CHOOSE_TARGET_SYSTEM
 	boolean
+	default y if ADK_CHOOSE_TARGET_SYSTEM_AARCH64
 	default y if ADK_CHOOSE_TARGET_SYSTEM_ARM
 	default y if ADK_CHOOSE_TARGET_SYSTEM_M68K
 	default y if ADK_CHOOSE_TARGET_SYSTEM_MICROBLAZE

+ 4 - 0
mk/kernel-build.mk

@@ -19,6 +19,10 @@ ifeq ($(ADK_TARGET_KERNEL_BZIMAGE),y)
 KERNEL_FILE:=vmlinux
 KERNEL_TARGET:=all
 endif
+ifeq ($(ADK_TARGET_KERNEL_IMAGE),y)
+KERNEL_FILE:=vmlinux
+KERNEL_TARGET:=$(ADK_TARGET_KERNEL)
+endif
 
 $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched:
 	$(TRACE) target/kernel-patch

+ 27 - 0
package/boot-wrapper-aarch64/Makefile

@@ -0,0 +1,27 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		boot-wrapper-aarch64
+PKG_VERSION:=		0.1
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		2ffdbf8c05854e3b855314d9ac21bbc4
+PKG_DESCR:=		boot-wrapper for aarch64
+PKG_SECTION:=		boot
+PKG_BUILDDEP:=		autotool
+PKG_SITES:=		http://www.openadk.org/distfiles/
+
+DISTFILES:=             ${PKG_NAME}-${PKG_VERSION}.tar.xz
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,BOOT_WRAPPER_AARCH64,boot-wrapper-aarch64,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+AUTOTOOL_STYLE:=	autoreconf
+CONFIGURE_ARGS+=	--with-kernel-dir=${LINUX_DIR}
+
+boot-wrapper-aarch64-install:
+	${CP} ${WRKBUILD}/linux-system.axf ${LINUX_DIR}
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 13 - 0
package/boot-wrapper-aarch64/patches/patch-Makefile_am

@@ -0,0 +1,13 @@
+--- boot-wrapper-aarch64-0.1.orig/Makefile.am	2014-04-13 21:10:47.000000000 +0200
++++ boot-wrapper-aarch64-0.1/Makefile.am	2014-04-13 21:58:16.848991221 +0200
+@@ -83,8 +83,8 @@ $(IMAGE): boot.o cache.o gic.o mmu.o ns.
+ model.lds: $(LD_SCRIPT) Makefile
+ 	$(CPP) $(CPPFLAGS) -ansi -DPHYS_OFFSET=$(PHYS_OFFSET) -DMBOX_OFFSET=$(MBOX_OFFSET) -DKERNEL_OFFSET=$(KERNEL_OFFSET) -DFDT_OFFSET=$(FDT_OFFSET) -DFS_OFFSET=$(FS_OFFSET) -DKERNEL=$(KERNEL_IMAGE) -DFILESYSTEM=$(FILESYSTEM) -DBOOTMETHOD=$(BOOTMETHOD) -P -C -o $@ $<
+ 
+-fdt.dtb: $(KERNEL_DTB) Makefile gen-cpu-nodes.sh
+-	( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) $(CPUS_NODE) };" ) | $(DTC) -O dtb -o $@ -
++fdt.dtb: $(KERNEL_DTS) Makefile gen-cpu-nodes.sh
++	( cat $(KERNEL_DTS) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) $(CPUS_NODE) };" ) | $(DTC) -O dtb -o $@ -
+ 
+ # The filesystem archive might not exist if INITRD is not being used
+ .PHONY: all clean $(FILESYSTEM)

+ 23 - 0
package/boot-wrapper-aarch64/patches/patch-configure_ac

@@ -0,0 +1,23 @@
+--- boot-wrapper-aarch64-0.1.orig/configure.ac	2014-04-13 21:10:47.000000000 +0200
++++ boot-wrapper-aarch64-0.1/configure.ac	2014-04-13 21:58:39.944973128 +0200
+@@ -22,18 +22,10 @@ AC_ARG_WITH([kernel-dir],
+ 	AC_SUBST([KERN_DIR], [$withval]),
+ 	AC_MSG_ERROR([No kernel directory specified. Use --with-kernel-dir]))
+ KERN_IMAGE=/arch/arm64/boot/Image
+-KERN_DTB=/arch/arm64/boot/dts/rtsm_ve-aemv8a.dtb
+-
+-# Ensure that the user has provided us with a sane kernel dir.
+-m4_define([CHECKFILES], [KERN_DIR,
+-	KERN_DIR$KERN_DTB,
+-	KERN_DIR$KERN_IMAGE])
+-
+-m4_foreach([checkfile], [CHECKFILES],
+-	[AC_CHECK_FILE([$checkfile], [], AC_MSG_ERROR([No such file or directory: $checkfile]))])
++KERN_DTS=/arch/arm64/boot/dts/foundation-v8.dts
+ 
+ AC_SUBST([KERNEL_IMAGE], [$KERN_DIR$KERN_IMAGE])
+-AC_SUBST([KERNEL_DTB], [$KERN_DIR$KERN_DTB])
++AC_SUBST([KERNEL_DTS], [$KERN_DIR$KERN_DTS])
+ 
+ # Allow a user to pass --enable-psci
+ USE_PSCI=no

+ 9 - 0
target/aarch64/Config.in

@@ -0,0 +1,9 @@
+choice
+depends on ADK_LINUX_AARCH64 && !ADK_CHOOSE_TARGET_ARCH
+prompt "Target system"
+
+config ADK_CHOOSE_TARGET_SYSTEM_AARCH64
+	boolean "Choose target system"
+
+source "target/aarch64/Config.in.systems"
+endchoice

+ 38 - 0
target/aarch64/Makefile

@@ -0,0 +1,38 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+KERNEL:=${LINUX_DIR}/arch/arm64/boot/Image
+
+kernel-install:
+	cd $(TOPDIR) && \
+		make -f Makefile \
+		-C package/boot-wrapper-aarch64 clean
+	cd $(TOPDIR) && \
+		make -f Makefile \
+		-C package/boot-wrapper-aarch64 package
+	${CP} ${LINUX_DIR}/linux-system.axf \
+		$(FW_DIR)/$(TARGET_KERNEL)
+
+ifeq ($(ADK_TARGET_FS),archive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSUSERTARBALL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
+endif
+ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
+imageinstall: createinitramfs kernel-install
+	@echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
+ifeq ($(ADK_TARGET_SYSTEM_ARM_FM),y)
+	@echo 'Start emulator via:'
+	@echo 'Foundation_v8 --image=$(FW_DIR)/${TARGET_KERNEL}'
+endif
+endif

+ 7 - 0
target/aarch64/kernel/arm-fm

@@ -0,0 +1,7 @@
+CONFIG_ARM64=y
+CONFIG_ARCH_VEXPRESS=y
+CONFIG_AEABI=y
+CONFIG_NET_VENDOR_SMSC=y
+CONFIG_SMC91X=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y

+ 13 - 0
target/aarch64/sys-available/arm-fm

@@ -0,0 +1,13 @@
+config ADK_TARGET_SYSTEM_ARM_FM
+	bool "ARMv8 Foundation Model"
+	select ADK_aarch64
+	select ADK_arm_fm
+	select ADK_little
+	select ADK_soft_float
+	select ADK_eabi
+	select ADK_CPU_ARMV8
+	select ADK_LINUX_64
+	select ADK_TARGET_KERNEL_IMAGE
+	select ADK_PACKAGE_BOOT_WRAPPER_AARCH64
+	help
+	 Support for ARMv8 Foundation Model (aarch64).

+ 14 - 0
target/aarch64/sys-available/toolchain-aarch64

@@ -0,0 +1,14 @@
+config ADK_TARGET_SYSTEM_TOOLCHAIN_AARCH64
+	bool "Toolchain only (little endian)"
+	select ADK_aarch64
+	select ADK_toolchain_aarch64
+	select ADK_little
+	select ADK_soft_float
+	select ADK_fpu_vfp
+	select ADK_eabi
+	select ADK_TOOLCHAIN
+	select ADK_CPU_ARMV8
+	select ADK_LINUX_64
+	select ADK_TARGET_PACKAGE_TXZ
+	help
+	  AARCH64 toolchain.

+ 4 - 0
target/aarch64/target.mk

@@ -0,0 +1,4 @@
+include $(TOPDIR)/mk/kernel-ver.mk
+ARCH:=			arm64
+CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
+TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 1 - 0
target/arch.lst

@@ -1,3 +1,4 @@
+aarch64
 arm
 m68k
 microblaze

+ 11 - 0
target/config/Config.in

@@ -187,6 +187,7 @@ config ADK_TARGET_LIBC_PATH
 
 config ADK_TARGET_KERNEL_MINICONFIG
 	string
+	default "arm-fm" if ADK_TARGET_SYSTEM_ARM_FM
 	default "qemu-microblaze-s3adsp1800" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
 	default "qemu-microblaze-ml605" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605
 	default "qemu-arm-versatilepb" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB
@@ -557,6 +558,9 @@ config ADK_CPU_ARM1176JZF_S
 config ADK_CPU_CORTEX_A9
 	boolean
 
+config ADK_CPU_ARMV8
+	boolean
+
 config ADK_TARGET_CPU_ARCH
 	string
 	default "x86_64" if ADK_CPU_X86_64
@@ -574,6 +578,7 @@ config ADK_TARGET_CPU_ARCH
 	default "mips64el" if ADK_LINUX_MIPS && ADK_little && ADK_LINUX_64
 	default "mips" if ADK_LINUX_MIPS && ADK_big
 	default "mipsel" if ADK_LINUX_MIPS && ADK_little
+	default "aarch64" if ADK_LINUX_AARCH64 && ADK_little
 	default "arm" if ADK_LINUX_ARM && ADK_little
 	default "sparc" if ADK_LINUX_SPARC
 	default "sparc64" if ADK_LINUX_SPARC64
@@ -606,6 +611,7 @@ config ADK_TARGET_CFLAGS
 	default "-march=loongson2f -Wa,-mfix-loongson2f-nop" if ADK_CPU_LOONGSON2F
 	default "-march=mips32" if ADK_CPU_MIPS32
 	default "-march=mips64" if ADK_CPU_MIPS64
+	default "-march=armv8-a" if ADK_CPU_ARMV8
 	default "-march=armv5te -mtune=iwmmxt" if ADK_CPU_XSCALE
 	default "-march=armv5te -mtune=arm926ej-s -mfloat-abi=soft" if ADK_CPU_ARM926EJ_S && ADK_soft_float
 	default "-march=armv5te -mtune=arm926ej-s -mfloat-abi=hard" if ADK_CPU_ARM926EJ_S && ADK_hard_float
@@ -636,6 +642,7 @@ config ADK_TARGET_CMDLINE
 	default "console=ttyS0,115200" if ADK_TARGET_QEMU_ARM_MODEL_SPITZ
 	default "console=ttyAMA0" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB
 	default "console=ttyAMA0" if ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9
+	default "console=ttyAMA0" if ADK_TARGET_SYSTEM_ARM_FM
 	default "console=ttySC1" if ADK_TARGET_SYSTEM_QEMU_SH4
 	default "console=ttySC1" if ADK_TARGET_SYSTEM_QEMU_SH4EB
 	default "console=ttyS0,115200" if ADK_TARGET_SYSTEM_PCENGINES_ALIX2D13
@@ -668,6 +675,7 @@ config ADK_TARGET_LIB_UCLIBC
 	boolean
 	select ADK_uclibc
 	depends on \
+		   !ADK_LINUX_AARCH64 && \
 		   !ADK_LINUX_M68K && \
 		   !ADK_LINUX_MICROBLAZE && \
 		   !ADK_LINUX_SPARC64 && \
@@ -682,6 +690,7 @@ config ADK_TARGET_LIB_GLIBC
 	boolean
 	select ADK_glibc
 	depends on \
+		ADK_LINUX_AARCH64 || \
 		ADK_LINUX_ARM || \
 		ADK_LINUX_M68K || \
 		ADK_LINUX_MICROBLAZE || \
@@ -771,6 +780,7 @@ config ADK_TARGET_ROOTFS_INITRAMFS_PIGGYBACK
 	select ADK_LINUX_INITRAMFS_BUILTIN
 	depends on \
 		ADK_HARDWARE_QEMU || \
+		ADK_LINUX_AARCH64 || \
 		ADK_LINUX_ARM || \
 		ADK_LINUX_M68K || \
 		ADK_LINUX_MICROBLAZE || \
@@ -826,6 +836,7 @@ config ADK_TARGET_ROOTFS_NFSROOT
 	select ADK_KERNEL_IP_PNP_DHCP
 	depends on !ADK_HARDWARE_QEMU && !ADK_HARDWARE_VBOX && !ADK_TARGET_SYSTEM_ARANYM_M68K
 	depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI
+	depends on !ADK_TARGET_SYSTEM_ARM_FM
 	help
 	  Root filesystem mounted via NFS. (DHCP)
 

+ 6 - 0
target/config/Config.in.arch.choice

@@ -4,6 +4,12 @@ prompt "Target architecture"
 config ADK_CHOOSE_TARGET_ARCH
 	bool "Choose target architecture"
 
+config ADK_LINUX_AARCH64
+	bool "aarch64 system"
+	select ADK_aarch64
+	help
+	  Support for AARCH64 systems.
+
 config ADK_LINUX_ARM
 	bool "arm system"
 	select ADK_arm

+ 4 - 0
target/config/Config.in.arch.default

@@ -1,4 +1,7 @@
 # target architectures
+config ADK_aarch64
+	bool
+
 config ADK_arm
 	bool
 
@@ -34,6 +37,7 @@ config ADK_x86
 
 config ADK_TARGET_ARCH
 	string
+	default "aarch64"  if ADK_aarch64
 	default "arm"  if ADK_arm
 	default "m68k"  if ADK_m68k
 	default "microblaze"  if ADK_microblaze

+ 1 - 1
target/config/Config.in.runtime

@@ -88,7 +88,7 @@ config ADK_RUNTIME_CONSOLE_SERIAL_DEVICE
 	string
 	default "hvc0" if ADK_TARGET_SYSTEM_QEMU_PPC64
 	default "ttyUL0" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
-	default "ttyAMA0" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB || ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9
+	default "ttyAMA0" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB || ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9 || ADK_TARGET_SYSTEM_ARM_FM
 	default "ttySC1" if ADK_TARGET_SYSTEM_QEMU_SH4 || ADK_TARGET_SYSTEM_QEMU_SH4EB
 	default "ttymxc0" if ADK_TARGET_SYSTEM_CUBOX_I
 	default "ttyS0"

+ 1 - 0
target/config/Config.in.system.choice

@@ -1,3 +1,4 @@
+source "target/aarch64/Config.in"
 source "target/arm/Config.in"
 source "target/m68k/Config.in"
 source "target/microblaze/Config.in"

+ 1 - 0
target/tarch.lst

@@ -1,3 +1,4 @@
+aarch64
 arm
 armhf
 m68k