Skip to content

Commit

Permalink
ODROID-C2: Add fip_create build tool source code
Browse files Browse the repository at this point in the history
Current fip_create is a x86_64 ELF excutable binary file. So, anyone could not
compile the u-boot on another archtectures without x86_64.
This patch adds the fip_create source codes to eliminate the build environment
architecture dependency. fip_create is generated by added source code
after applying this change.

Change-Id: I13e005b3c2502fc55deb08bd0739bf1cde5808aa
Signed-off-by: Brian Kim <brian.kim@hardkernel.com>
  • Loading branch information
bkrepo committed Jun 1, 2016
1 parent eea37c7 commit 3a2dd09
Show file tree
Hide file tree
Showing 7 changed files with 937 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,13 @@ FIP_ARGS += --bl32 $(FIP_FOLDER_SOC)/bl32.bin
endif
FIP_ARGS += --bl33 $(FIP_FOLDER_SOC)/bl33.bin

.PHONY: fip_create
fip_create:
$(Q)$(MAKE) -C $(srctree)/tools/fip_create/
$(Q)cp $(srctree)/tools/fip_create/fip_create $(FIP_FOLDER)/

.PHONY: fip.bin
fip.bin: tools prepare u-boot.bin
fip.bin: tools prepare u-boot.bin fip_create
$(Q)cp u-boot.bin $(FIP_FOLDER_SOC)/bl33.bin
$(Q)$(FIP_FOLDER)/fip_create ${FIP_ARGS} $(FIP_FOLDER_SOC)/fip.bin
$(Q)$(FIP_FOLDER)/fip_create --dump $(FIP_FOLDER_SOC)/fip.bin
Expand Down Expand Up @@ -1398,8 +1403,10 @@ distclean: mrproper
@rm -f $(FIP_FOLDER_SOC)/u-boot.bin
@rm -f $(FIP_FOLDER_SOC)/u-boot.bin.* $(FIP_FOLDER_SOC)/*.encrypt
@rm -f $(FIP_FOLDER)/u-boot.bin.* $(FIP_FOLDER)/*.bin $(FIP_FOLDER)/*.encrypt
@rm -f $(FIP_FOLDER)/fip_create
@rm -f $(srctree)/fip/aml_encrypt_gxb
@rm -f $(FUSING_FOLDER)/u-boot.bin
@$(MAKE) -C $(srctree)/tools/fip_create clean

backup:
F=`basename $(srctree)` ; cd .. ; \
Expand Down
Binary file removed fip/fip_create
Binary file not shown.
62 changes: 62 additions & 0 deletions tools/fip_create/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# Copyright (c) 2014, ARM Limited and Contributors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of ARM nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

PROJECT = fip_create
OBJECTS = fip_create.o

CFLAGS = -Wall -Werror -pedantic -std=c99
ifeq (${DEBUG},1)
CFLAGS += -g -O0 -DDEBUG
else
CFLAGS += -O2
endif

# Make soft links and include from local directory otherwise wrong headers
# could get pulled in from firmware tree.
INCLUDE_PATHS = -I.

CC := gcc
RM := rm -rf

.PHONY: all clean

all: ${PROJECT}

${PROJECT}: ${OBJECTS} Makefile
@echo " LD $@"
${Q}${CC} ${OBJECTS} -o $@

%.o: %.c %.h Makefile
@echo " CC $<"
${Q}${CC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@

clean:
${Q}${RM} ${PROJECT}
${Q}${RM} ${OBJECTS}
Loading

0 comments on commit 3a2dd09

Please sign in to comment.