aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/tegra/image/Makefile
blob: 706cc65d92e86a91212c3c71b7c9f2e80bf47078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; backgro
#
# Copyright (C) 2017-2019 Tomasz Maciej Nowak <tomek_n@o2.pl>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk

SIGNATURE:=$(shell printf "%.8s" $(SOURCE_DATE_EPOCH))

define Build/tegra-sdcard
	rm -fR $@.boot
	mkdir -p $@.boot
	$(CP) $(KDIR)/$(KERNEL_NAME) $@.boot
	$(if $(DEVICE_DTS),\
		$(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb $@.boot), \
		$(CP) $(DTS_DIR)/*.dtb $@.boot)
	sed \
		-e 's#@ROOT@#$(SIGNATURE)#g' \
		-e 's#@KERNEL@#$(KERNEL_NAME)#g' \
		$(BOOT_SCRIPT) > $@-boot.scr
	mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
		-n '$(DEVICE_TITLE) OpenWrt bootscript' \
		-d $@-boot.scr \
		$@.boot/boot.scr

	PADDING="$(CONFIG_TARGET_IMAGES_PAD)" \
	SIGNATURE="$(SIGNATURE)" \
	$(SCRIPT_DIR)/gen_image_generic.sh \
		$@ \
		$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
		$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
		2048

	$(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 skip=1 seek=1 conv=notrunc)
endef

DEVICE_VARS += BOOT_SCRIPT UBOOT
define Device/Default
  BOOT_SCRIPT := generic-bootscript
  IMAGES := sdcard.img.gz
  IMAGE/sdcard.img.gz := tegra-sdcard | gzip | append-metadata
  KERNEL_NAME := zImage
  KERNEL := kernel-bin
  PROFILES := Default
endef

define Device/trimslice
  DEVICE_TITLE := CompuLab TrimSlice
  DEVICE_DTS := tegra20-trimslice
  DEVICE_PACKAGES := kmod-r8169 kmod-rt2800-usb kmod-rtc-em3027 \
	kmod-usb-storage wpad-mini
  SUPPORTED_DEVICES := compulab,trimslice
  UBOOT := trimslice-mmc
endef
TARGET_DEVICES += trimslice

$(eval $(call BuildImage))
ass="s">", object.c_str(ctx), definition.prefix.c_str(ctx)); for (size_t i = 0; i < definition.states.size(); ++i) { if (selected_states[i]) { log_info(" - %s, count = %d\n", definition.states.at(i).c_str(ctx), count[i]); } } } } template <size_t StateCount, typename StateType, typename CountType> void ExclusiveStateGroup<StateCount, StateType, CountType>::explain_implies(const Context *ctx, IdString object, IdString cell, const Definition &definition, BelId bel, int32_t next_state) const { if (check_implies(next_state)) { log_info("Placing cell %s at bel %s does not violate %s.%s\n", cell.c_str(ctx), ctx->nameOfBel(bel), object.c_str(ctx), definition.prefix.c_str(ctx)); } else { log_info("Placing cell %s at bel %s does violates %s.%s, desired state = %s.\n", cell.c_str(ctx), ctx->nameOfBel(bel), object.c_str(ctx), definition.prefix.c_str(ctx), definition.states.at(next_state).c_str(ctx)); print_debug(ctx, object, definition); } } template <size_t StateCount, typename StateType, typename CountType> template <typename StateRange> void ExclusiveStateGroup<StateCount, StateType, CountType>::explain_requires(const Context *ctx, IdString object, IdString cell, const Definition &definition, BelId bel, const StateRange state_range) const { if (requires(state_range)) { log_info("Placing cell %s at bel %s does not violate %s.%s\n", cell.c_str(ctx), ctx->nameOfBel(bel), object.c_str(ctx), definition.prefix.c_str(ctx)); } else { log_info("Placing cell %s at bel %s does violate %s.%s, because current state is %s, constraint requires one " "of:\n", cell.c_str(ctx), ctx->nameOfBel(bel), object.c_str(ctx), definition.prefix.c_str(ctx), state != -1 ? definition.states.at(state).c_str(ctx) : "unset"); for (const auto required_state : state_range) { log_info(" - %s\n", definition.states.at(required_state).c_str(ctx)); } print_debug(ctx, object, definition); } } NEXTPNR_NAMESPACE_END