| # |
| # Google makefile to build uboot for armada products |
| # |
| |
| export CROSS_COMPILE_BH=$(PWD)/../../toolchains/armada/bin/arm-marvell-linux-uclibcgnueabi- |
| export CROSS_COMPILE=$(PWD)/../../toolchains/armada/bin/arm-marvell-linux-uclibcgnueabi- |
| |
| version = $(shell ./version) |
| |
| LOADERBIN_GFCH100 = ../../loader-bin/marvell/gfch100 |
| |
| GFCH100 = gfch100-dev gfch100-prod gfch100-openbox |
| UART1 = gfch100_uart1 |
| MARVELL = marvell-spi marvell-nand |
| |
| MV_BOARD = armada_38x |
| GF_BOARD = armada_38x_gfch100 |
| |
| all: clean $(GFCH100) extract |
| uart1: clean $(UART1) extract |
| marvell: clean $(MARVELL) extract |
| |
| # don't run parallel, the several builds would mix .o files |
| .NOTPARALLEL: |
| |
| clean: |
| make clean |
| rm -rf output.* |
| |
| clobber: clean |
| -make distclean |
| rm -rf output |
| |
| extract: |
| rm -rf output |
| for n in output.*.tar; do tar xf $$n; done |
| |
| gfiber_private.pem: |
| @echo "$@ is required to sign binaries. Get a copy and put it next to Makefile.gfiber" |
| exit 1 |
| |
| # |
| # GENERATE_DIGEST(DIR, NAME) |
| # |
| define GENERATE_DIGEST |
| @echo "Generating digest for $(1)/$(2)" |
| openssl dgst -sign gfiber_private.pem -sha512 -binary -keyform \ |
| PEM $(1)/$(2).bin > $(1)/$(2).sig |
| endef |
| |
| install: gfiber_private.pem |
| # TODO(cgibson): Add signing support. |
| mkdir -p $(LOADERBIN_GFCH100) |
| cp output/gfch100-dev/le/spi/*dev-spi.bin $(LOADERBIN_GFCH100)/u-boot-spi-dev.bin |
| cp output/gfch100-dev/le/spi/*dev-spi-uart.bin $(LOADERBIN_GFCH100)/u-boot-spi-uart-dev.bin |
| cp output/gfch100-prod/le/spi/*prod-spi.bin $(LOADERBIN_GFCH100)/u-boot-spi-prod.bin |
| cp output/gfch100-openbox/le/spi/*openbox-spi.bin $(LOADERBIN_GFCH100)/u-boot-spi-openbox.bin |
| $(call GENERATE_DIGEST,$(LOADERBIN_GFCH100),u-boot-spi-dev) |
| $(call GENERATE_DIGEST,$(LOADERBIN_GFCH100),u-boot-spi-uart-dev) |
| $(call GENERATE_DIGEST,$(LOADERBIN_GFCH100),u-boot-spi-prod) |
| $(call GENERATE_DIGEST,$(LOADERBIN_GFCH100),u-boot-spi-openbox) |
| |
| # |
| # BUILDPL(NAME, BOARD, BOOT, ARGS) |
| # |
| define BUILDPL |
| rm -rf output |
| ./build.pl -b $(2) -f $(3) -v $(1)-$(version)-$(5) -i nand:spi -c -o output/$(1) $(4) -s $(5) |
| tar cf output.$(1).tar output |
| endef |
| |
| marvell-%: |
| $(call BUILDPL,$@,$(MV_BOARD),$*,-i nand:spi,dev) |
| |
| gfch100-%: |
| $(call BUILDPL,$@,$(GF_BOARD),spi,-i spi,$*) |
| |
| gfch100_uart1: |
| $(call BUILDPL,$@,$(GF_BOARD),spi,-i spi -u 1,dev) |