浏览代码

synpsys-hsdk: add sample

Waldemar Brodkorb 6 年之前
父节点
当前提交
71c4b08ed6

+ 4 - 0
target/arc/Makefile

@@ -5,7 +5,11 @@ include $(ADK_TOPDIR)/rules.mk
 include $(ADK_TOPDIR)/mk/kernel-build.mk
 include $(ADK_TOPDIR)/mk/image.mk
 
+ifeq ($(ADK_TARGET_KERNEL_UIMAGE),y)
+KERNEL:=$(LINUX_DIR)/arch/arc/boot/uImage
+else
 KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
+endif
 
 # target helper text
 ifeq ($(ADK_TARGET_FS),archive)

+ 3 - 0
target/arc/kernel/synopsys-hsdk

@@ -0,0 +1,3 @@
+CONFIG_ISA_ARCV2=y
+CONFIG_ARC_SOC_HSDK=y
+CONFIG_ARC_UBOOT_SUPPORT=y

+ 14 - 0
target/arc/systems/synopsys-hsdk

@@ -0,0 +1,14 @@
+config ADK_TARGET_SYSTEM_SYNOPSYS_HSDK
+	bool "Synopsys HSDK"
+	select ADK_TARGET_LITTLE_ENDIAN
+	select ADK_TARGET_CPU_ARC_ARCHS
+	select ADK_TARGET_KERNEL_UIMAGE
+	select ADK_TARGET_WITH_SERIAL
+	select ADK_TARGET_WITH_NET
+	select ADK_TARGET_WITH_NETDEVICE
+	select ADK_TARGET_WITH_BLOCK
+	select ADK_TARGET_WITH_SMP
+	select ADK_HOST_BUILD_U_BOOT
+	help
+	  Support for Synopsys HSDK.
+

+ 3 - 3
target/config/Config.in.cpu

@@ -67,7 +67,7 @@ config ADK_TARGET_CPU_ARC_ARC700
 	select ADK_TARGET_WITH_MMU
 	depends on ADK_TARGET_ARCH_ARC
 
-config ADK_TARGET_CPU_ARC_ARC_HS
+config ADK_TARGET_CPU_ARC_ARCHS
 	bool "ARC HS (ARCv2)"
 	select ADK_TARGET_SUPPORTS_THREADS
 	select ADK_TARGET_SUPPORTS_NPTL
@@ -1874,7 +1874,7 @@ config ADK_TARGET_GCC_CPU
 	default "68040" if ADK_TARGET_CPU_M68K_68040
 	default "68060" if ADK_TARGET_CPU_M68K_68060
 	default "arc700" if ADK_TARGET_CPU_ARC_ARC700
-	default "archs" if ADK_TARGET_CPU_ARC_ARC_HS
+	default "archs" if ADK_TARGET_CPU_ARC_ARCHS
 	default "arm1176jzf-s" if ADK_TARGET_CPU_ARM_ARM1176JZF_S
 	default "arm926ej-s" if ADK_TARGET_CPU_ARM_ARM926EJ_S
 	default "cortex-a5" if ADK_TARGET_CPU_ARM_CORTEX_A5
@@ -2027,7 +2027,7 @@ config ADK_TARGET_CPU_FLAGS
 config ADK_TARGET_CPU_TYPE
 	string
 	default "arc700" if ADK_TARGET_CPU_ARC_ARC700
-	default "archs" if ADK_TARGET_CPU_ARC_ARC_HS
+	default "archs" if ADK_TARGET_CPU_ARC_ARCHS
 	default "bf512" if ADK_TARGET_CPU_BFIN_BF512
 	default "bf514" if ADK_TARGET_CPU_BFIN_BF514
 	default "bf516" if ADK_TARGET_CPU_BFIN_BF516

+ 4 - 3
target/linux/config/Config.in.arc

@@ -14,12 +14,13 @@ config ADK_LINUX_KERNEL_ARC_CPU_770
 config ADK_LINUX_KERNEL_ISA_ARCV2
 	bool
 	depends on ADK_TARGET_ARCH_ARC
-	default y if ADK_TARGET_CPU_ARC_ARC_HS
+	default y if ADK_TARGET_CPU_ARC_ARCHS
 
 config ADK_LINUX_KERNEL_ARC_BUILTIN_DTB_NAME
 	string
 	depends on ADK_TARGET_ARCH_ARC
-	default "nsim_hs" if ADK_TARGET_CPU_ARC_ARC_HS
-	default "nsim_700" if ADK_TARGET_CPU_ARC_ARC700
+	default "hsdk" if ADK_TARGET_CPU_ARC_ARCHS && ADK_TARGET_SYSTEM_SYNOPSYS_HSDK
+	default "nsim_hs" if ADK_TARGET_CPU_ARC_ARCHS && ADK_TARGET_SYSTEM_SYNOPSYS_NSIM
+	default "nsim_700" if ADK_TARGET_CPU_ARC_ARC700 && ADK_TARGET_SYSTEM_SYNOPSYS_NSIM
 	
 

+ 5 - 1
target/linux/config/Config.in.ethernet

@@ -499,16 +499,20 @@ config ADK_LINUX_KERNEL_STMMAC_ETH
 	select ADK_LINUX_KERNEL_DWMAC_GENERIC if ADK_TARGET_SYSTEM_QEMU_CSKY_CK610
 	select ADK_LINUX_KERNEL_DWMAC_GENERIC if ADK_TARGET_SYSTEM_QEMU_CSKY_CK807
 	select ADK_LINUX_KERNEL_DWMAC_GENERIC if ADK_TARGET_SYSTEM_QEMU_CSKY_CK810
+	select ADK_LINUX_KERNEL_DWMAC_GENERIC if ADK_TARGET_SYSTEM_SYNOPSYS_HSDK
+	select ADK_LINUX_KERNEL_MICREL_PHY if ADK_TARGET_SYSTEM_SYNOPSYS_HSDK
 	depends on ADK_TARGET_SYSTEM_BANANA_PRO \
 		|| ADK_TARGET_SYSTEM_ORANGE_PI0 \
 		|| ADK_TARGET_SYSTEM_QEMU_CSKY_CK610 \
 		|| ADK_TARGET_SYSTEM_QEMU_CSKY_CK807 \
-		|| ADK_TARGET_SYSTEM_QEMU_CSKY_CK810
+		|| ADK_TARGET_SYSTEM_QEMU_CSKY_CK810 \
+		|| ADK_TARGET_SYSTEM_SYNOPSYS_HSDK
 	default y if ADK_TARGET_SYSTEM_BANANA_PRO
 	default y if ADK_TARGET_SYSTEM_ORANGE_PI0
 	default y if ADK_TARGET_SYSTEM_QEMU_CSKY_CK610
 	default y if ADK_TARGET_SYSTEM_QEMU_CSKY_CK807
 	default y if ADK_TARGET_SYSTEM_QEMU_CSKY_CK810
+	default y if ADK_TARGET_SYSTEM_SYNOPSYS_HSDK
 	default n
 
 config ADK_LINUX_KERNEL_SUNGEM

+ 4 - 0
target/linux/config/Config.in.serial

@@ -100,10 +100,12 @@ config ADK_LINUX_KERNEL_SERIAL_8250
 						|| ADK_TARGET_SYSTEM_QEMU_RISCV64 \
 						|| ADK_TARGET_SYSTEM_ANDES_AG101P \
 						|| ADK_TARGET_SYSTEM_ORANGE_PI0 \
+						|| ADK_TARGET_SYSTEM_SYNOPSYS_HSDK \
 						|| ADK_TARGET_SYSTEM_SOM_C6745
 	select ADK_LINUX_KERNEL_SERIAL_8250_PNP if ADK_TARGET_SYSTEM_PCENGINES_APU
 	select ADK_LINUX_KERNEL_SERIAL_8250_DW if ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
 	select ADK_LINUX_KERNEL_SERIAL_8250_DW if ADK_TARGET_SYSTEM_ORANGE_PI0
+	select ADK_LINUX_KERNEL_SERIAL_8250_DW if ADK_TARGET_SYSTEM_SYNOPSYS_HSDK
 	select ADK_LINUX_KERNEL_SERIAL_8250_DMA if ADK_TARGET_SYSTEM_ORANGE_PI0
 	select ADK_LINUX_KERNEL_SERIAL_8250_INGENIC if ADK_TARGET_SYSTEM_IMGTEC_CI20
 	depends on ADK_TARGET_SYSTEM_XILINX_KINTEX7 \
@@ -138,6 +140,7 @@ config ADK_LINUX_KERNEL_SERIAL_8250
 		|| ADK_TARGET_SYSTEM_MIKROTIK_RB4XX \
 		|| ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG \
 		|| ADK_TARGET_SYSTEM_ORANGE_PI0 \
+		|| ADK_TARGET_SYSTEM_SYNOPSYS_HSDK \
 		|| ADK_TARGET_SYSTEM_DEC_MULTIA \
 		|| ADK_TARGET_SYSTEM_SOM_C6745
 	default y if ADK_TARGET_SYSTEM_XILINX_KINTEX7
@@ -172,6 +175,7 @@ config ADK_LINUX_KERNEL_SERIAL_8250
 	default y if ADK_TARGET_SYSTEM_MIKROTIK_RB4XX
 	default y if ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
 	default y if ADK_TARGET_SYSTEM_ORANGE_PI0
+	default y if ADK_TARGET_SYSTEM_SYNOPSYS_HSDK
 	default y if ADK_TARGET_SYSTEM_SOM_C6745
 	default y if ADK_TARGET_SYSTEM_DEC_MULTIA
 	default n

+ 12 - 0
target/linux/patches/4.16.12/arc.patch

@@ -0,0 +1,12 @@
+diff -Nur linux-4.16.12.orig/arch/arc/boot/Makefile linux-4.16.12/arch/arc/boot/Makefile
+--- linux-4.16.12.orig/arch/arc/boot/Makefile	2018-05-25 16:46:20.000000000 +0200
++++ linux-4.16.12/arch/arc/boot/Makefile	2018-06-13 00:27:38.000000000 +0200
+@@ -7,7 +7,7 @@
+ 
+ OBJCOPYFLAGS= -O binary -R .note -R .note.gnu.build-id -R .comment -S
+ 
+-LINUX_START_TEXT = $$(readelf -h vmlinux | \
++LINUX_START_TEXT = $$(${CROSS_COMPILE}readelf -h vmlinux | \
+ 			grep "Entry point address" | grep -o 0x.*)
+ 
+ UIMAGE_LOADADDR    = $(CONFIG_LINUX_LINK_BASE)