Add linux_firmware sample app for zynq7
authorWendy Liang <jliang@xilinx.com>
Mon, 11 Jan 2016 00:24:52 +0000 (16:24 -0800)
committerWendy Liang <jliang@xilinx.com>
Tue, 9 Feb 2016 19:55:44 +0000 (11:55 -0800)
Add linux_firmware sample application for zynq7 remoteproc
master.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
72 files changed:
apps/Makefile
apps/linux_firmware_remoteproc_slave/Makefile [new file with mode: 0644]
apps/linux_firmware_remoteproc_slave/boot.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/boot.c with 100% similarity]
apps/linux_firmware_remoteproc_slave/boot_wrapper_zynq7.S [moved from obsolete/system/generic/machine/zynq7/linux-firmware/boot_wrapper.S with 98% similarity]
apps/linux_firmware_remoteproc_slave/link_remote.ld [moved from obsolete/system/generic/machine/zynq7/linux-firmware/link_remote.ld with 100% similarity]
apps/linux_firmware_remoteproc_slave/rsc_table.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/rsc_table.c with 95% similarity]
apps/linux_firmware_remoteproc_slave/rsc_table.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/rsc_table.h with 100% similarity]
obsolete/system/generic/machine/zynq7/Makefile [new file with mode: 0644]
obsolete/system/generic/machine/zynq7/linux-firmware/make [deleted file]
obsolete/system/generic/machine/zynq7/linux_firmware/Makefile [new file with mode: 0644]
obsolete/system/generic/machine/zynq7/linux_firmware/image.ub [moved from obsolete/system/generic/machine/zynq7/linux-firmware/image.ub with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/lib/arm-none-eabi-/libfdt.a [moved from obsolete/system/generic/machine/zynq7/linux-firmware/lib/arm-none-eabi-/libfdt.a with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/lib/arm-none-eabi-/libzlib.a [moved from obsolete/system/generic/machine/zynq7/linux-firmware/lib/arm-none-eabi-/libzlib.a with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/lib/arm-xilinx-eabi-/libfdt.a [moved from obsolete/system/generic/machine/zynq7/linux-firmware/lib/arm-xilinx-eabi-/libfdt.a with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/lib/arm-xilinx-eabi-/libzlib.a [moved from obsolete/system/generic/machine/zynq7/linux-firmware/lib/arm-xilinx-eabi-/libzlib.a with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/libfdt/fdt.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/libfdt/fdt.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/libfdt/libfdt.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/libfdt/libfdt.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/libfdt/libfdt_internal.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/libfdt/libfdt_internal.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/libfdt/types.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/libfdt/types.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/patches/linux/petalinux2013.10/devtree.patch [moved from obsolete/system/generic/machine/zynq7/linux-firmware/patches/linux/petalinux2013.10/devtree.patch with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/patches/linux/petalinux2013.10/gic.patch [moved from obsolete/system/generic/machine/zynq7/linux-firmware/patches/linux/petalinux2013.10/gic.patch with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/patches/linux/petalinux2013.10/readme.txt [moved from obsolete/system/generic/machine/zynq7/linux-firmware/patches/linux/petalinux2013.10/readme.txt with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/patches/linux/petalinux2013.10/system.dts [moved from obsolete/system/generic/machine/zynq7/linux-firmware/patches/linux/petalinux2013.10/system.dts with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/scripts/makefiles/echo_test_baremetal_fw/Makefile [moved from obsolete/system/generic/machine/zynq7/linux-firmware/scripts/makefiles/echo_test_baremetal_fw/Makefile with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/scripts/makefiles/mat_mul_baremetal_fw/Makefile [moved from obsolete/system/generic/machine/zynq7/linux-firmware/scripts/makefiles/mat_mul_baremetal_fw/Makefile with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/scripts/makefiles/mat_mul_demo/Makefile [moved from obsolete/system/generic/machine/zynq7/linux-firmware/scripts/makefiles/mat_mul_demo/Makefile with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/scripts/makefiles/readme [moved from obsolete/system/generic/machine/zynq7/linux-firmware/scripts/makefiles/readme with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/scripts/makefiles/rpc_demo_baremetal_fw/Makefile [moved from obsolete/system/generic/machine/zynq7/linux-firmware/scripts/makefiles/rpc_demo_baremetal_fw/Makefile with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/scripts/open_amp_create_projects.sh [moved from obsolete/system/generic/machine/zynq7/linux-firmware/scripts/open_amp_create_projects.sh with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/Makefile [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/Makefile with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/Makefile.commons [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/Makefile.commons with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/README [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/README with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/fdt.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/fdt.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/fdt.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/fdt.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/fdt_ro.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/fdt_ro.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/fdt_rw.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/fdt_rw.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/fdt_wip.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/fdt_wip.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/libfdt.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/libfdt.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/libfdt_internal.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/libfdt_internal.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/libfdt/types.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/libfdt/types.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/Makefile [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/Makefile with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/Makefile.commons [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/Makefile.commons with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/adler32.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/adler32.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/crc32.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/crc32.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/crc32.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/crc32.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/deflate.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/deflate.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/deflate.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/deflate.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/infback.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/infback.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/inffast.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/inffast.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/inffast.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/inffast.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/inffixed.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/inffixed.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/inflate.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/inflate.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/inflate.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/inflate.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/inftrees.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/inftrees.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/inftrees.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/inftrees.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/sbrk.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/sbrk.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/trees.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/trees.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/trees.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/trees.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/zconf.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/zconf.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/zlib.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/zlib.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/zutil.c [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/zutil.c with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/src/zlib/zutil.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/src/zlib/zutil.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/crc32.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/crc32.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/deflate.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/deflate.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/inffast.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/inffast.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/inffixed.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/inffixed.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/inflate.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/inflate.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/inftrees.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/inftrees.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/trees.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/trees.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/zconf.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/zconf.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/zlib.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/zlib.h with 100% similarity]
obsolete/system/generic/machine/zynq7/linux_firmware/zlib/zutil.h [moved from obsolete/system/generic/machine/zynq7/linux-firmware/zlib/zutil.h with 100% similarity]

index aea5d37334d9a54bb3127877c1132af17a93eff7..5adfebf9efdf8aa6abb123beffaf01020ad58390 100644 (file)
@@ -6,9 +6,12 @@ export OHOME := $(SRCROOT)/../
 export BUILD := $(BUILDROOT)/apps
 
 all:
+ifeq ($(REMOTEPROC_MASTER),y)
+       make -C linux_firmware_remoteproc_slave all
+endif
        make -C matrix_multiply all
        make -C echo_test all
-       make  -C rpc_demo all
+       make -C rpc_demo all
 
 clean:
        rm -rf $(BUILD)
diff --git a/apps/linux_firmware_remoteproc_slave/Makefile b/apps/linux_firmware_remoteproc_slave/Makefile
new file mode 100644 (file)
index 0000000..b164d20
--- /dev/null
@@ -0,0 +1,73 @@
+
+include $(SRCROOT)/Makefile.common
+
+PBUILD := $(BUILD)
+BUILD := $(PBUILD)/$(shell basename $(CURDIR))
+BUILDSHARE := $(PBUILD)/share
+
+BOOTSTRAP_OUT := $(BUILDSHARE)/lnx_firmware
+
+BOOTSTRAP_SRCS := boot.c rsc_table.c
+
+ifneq ($(MACHINE),zynq7)
+$(warning "Machine $(MACHINE) is not supported by this app $(shell basename $(CURDIR))")
+all:
+
+clean:
+else
+
+ifeq ($(wildcard $(BUILDROOT)/libs/image.ub),)
+all:
+
+clean:
+else
+
+BOOTSTRAP_AS_SRCS := boot_wrapper_$(MACHINE).S
+
+BOOTSTRAP_OBJS := $(patsubst %.c,$(BUILD)/%.o,$(BOOTSTRAP_SRCS)) $(patsubst %.S,$(BUILD)/%.o,$(BOOTSTRAP_AS_SRCS))
+
+LINKERSCRIPT := link_remote.ld
+
+ifeq ($(EXTRA_INCLUDES),)
+EXTRA_INCLUDES += -I"$(OHOME)/obsolete/system/$(SYSTEM)/machine/$(MACHINE)/linux_firmware"
+endif
+
+CFLAGS += $(EXTRA_INCLUDES)
+
+all: $(BOOTSTRAP_OUT)
+       cp $(BOOTSTRAP_OUT) $(BUILD)/firmware1
+       cd $(BUILD) && $(CROSS)objcopy -I binary -O elf32-littlearm -B arm firmware1 $(BUILDSHARE)/firmware1.o
+       cp $(BOOTSTRAP_OUT) $(BUILD)/firmware2
+       cd $(BUILD) && $(CROSS)objcopy -I binary -O elf32-littlearm -B arm firmware2 $(BUILDSHARE)/firmware2.o
+
+$(BOOTSTRAP_OUT): $(BUILDSHARE) $(BOOTSTRAP_OBJS)
+
+       @echo 'Building linux aggregate image : $@'
+
+       $(LD)  -nostartfiles -T"$(LINKERSCRIPT)" $(LDFLAGS) -o "$(BOOTSTRAP_OUT)" -Wl,--start-group $(BOOTSTRAP_OBJS) -lc -lm -lstdc++ -lzlib -lfdt -Wl,--end-group
+
+       @echo 'Finished building target: $@'
+
+$(BUILD)/%.o: %.c
+       mkdir -p $(dir $@)
+       @echo CC $(<:.c=.o)
+       $(CC) $(CFLAGS) $(ARCH_CFLAGS) $(INCLUDE) -c $< -o $@
+
+$(BUILD)/%.o: $(CURDIR)/%.S $(BUILD)/image.ub
+       mkdir -p $(dir $@)
+       @echo AS $(<:.S=.o)
+       cd $(BUILD); \
+       $(AS) $(ASFLAGS) $(INCLUDE) $< -o $@
+
+$(BUILD) $(BUILDSHARE):
+       mkdir -p $@
+
+$(BUILD)/image.ub:
+       cp $(BUILDROOT)/libs/image.ub $@
+clean:
+       rm -rf $(BUILD) $(BOOTSTRAP_OUT)
+
+PHONY: all clean
+
+endif
+endif
similarity index 98%
rename from obsolete/system/generic/machine/zynq7/linux-firmware/boot_wrapper.S
rename to apps/linux_firmware_remoteproc_slave/boot_wrapper_zynq7.S
index 4f735fd28c34250a39daa44ee605387e5b515e1f..d4028da53355b2f5842aa82f0b0e9236fb117df9 100644 (file)
@@ -35,7 +35,7 @@
 
        @ include FIT format linux image
        .section fit_image, "a"
-       .incbin "libs/system/zc702evk/linux/image.ub";
+       .incbin "image.ub";
 
        .section        bootwrapper, "ax"
 
similarity index 95%
rename from obsolete/system/generic/machine/zynq7/linux-firmware/rsc_table.c
rename to apps/linux_firmware_remoteproc_slave/rsc_table.c
index bb8c7d05756eb7bfec9d91d8549680fa027c2da4..0c87a8130655d94b71f911e0f00466d2dae3e6e6 100644 (file)
@@ -34,8 +34,8 @@
 #include "rsc_table.h"
 
 /* Place resource table in special ELF section */
-#define __section(S)            __attribute__((__section__(#S)))
-#define __resource              __section(.resource_table)
+#define __section_t(S)            __attribute__((__section__(#S)))
+#define __resource              __section_t(.resource_table)
 
 #define RPMSG_IPU_C0_FEATURES       1
 
diff --git a/obsolete/system/generic/machine/zynq7/Makefile b/obsolete/system/generic/machine/zynq7/Makefile
new file mode 100644 (file)
index 0000000..91a273b
--- /dev/null
@@ -0,0 +1,5 @@
+all:
+       make -C linux_firmware all
+
+clean:
+       make -C linux_firmware clean
diff --git a/obsolete/system/generic/machine/zynq7/linux-firmware/make b/obsolete/system/generic/machine/zynq7/linux-firmware/make
deleted file mode 100644 (file)
index 312abff..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-
-include Makefile.commons
-
-BOOTSTRAP_OUT := libs/system/zc702evk/linux/firmware
-
-BOOTSTRAP_SRC := libs/system/zc702evk/linux/boot.c libs/system/zc702evk/linux/rsc_table.c 
-
-AS_SRCFILES   := libs/system/zc702evk/linux/boot_wrapper.S
-
-BOOTSTRAPOBJFILES := $(patsubst %.c, %.o, $(BOOTSTRAP_SRC)) $(patsubst %.S, %.o, $(AS_SRCFILES))
-
-BOOTSTRAPDEPS   := $(patsubst %.o, %.d, $(BOOTSTRAPOBJFILES))
-
-
-$(BOOTSTRAP_OUT): $(BOOTSTRAPOBJFILES)
-
-       @echo 'Building linux aggregate image : $@'
-
-       $(LD)  -nostartfiles -T"$(OHOME)/libs/system/$(MACHINE)/linux/link_remote.ld" -L"$(OHOME)/libs/system/$(MACHINE)/linux/lib/$(CROSS)"  -o "$(BOOTSTRAP_OUT)" -Wl,--start-group $(BOOTSTRAPOBJFILES) -lc -lm -lstdc++ -lzlib -lfdt -Wl,--end-group        
-       
-       @echo 'Copying ELF image to firmware folder'
-
-       $(CP) $(BOOTSTRAP_OUT) apps/firmware/zc702evk/linux/firmware
-    
-    @echo 'Finished building target: $@'
-       
-%.o:%.c 
-       @echo CC $(<:.c=.o)
-       @$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(INCLUDE) -c $< -o $@
-
-%.o:%.S
-       @echo AS $(<:.S=.o)
-       @$(AS) $(ASFLAGS) $(INCLUDE) $< -o $@
-       
-clean:
-       -$(RM) $(BOOTSTRAPOBJFILES) $(BOOTSTRAPDEPS) $(BOOTSTRAP_OUT)
-       
-post-build:
-       -@echo ' '
-
-secondary-outputs:
-
-PHONY: all clean dependents
-.SECONDARY: post-build
diff --git a/obsolete/system/generic/machine/zynq7/linux_firmware/Makefile b/obsolete/system/generic/machine/zynq7/linux_firmware/Makefile
new file mode 100644 (file)
index 0000000..6b43979
--- /dev/null
@@ -0,0 +1,7 @@
+include $(OHOME)/lib/system/$(SYSTEM)/machine/$(MACHINE)/Makefile.platform
+
+all:
+       cp lib/$(CROSS)/*.a $(BUILDROOT)/libs/
+       cp image.ub $(BUILDROOT)/libs/
+
+clean: