4fee464a001ab395d9ab7b68b9a70d02ce66dc69
[openwrt/staging/jow.git] / target / linux / at91 / image / sama5.mk
1
2 define Device/default-nand
3 BLOCKSIZE := 128k
4 PAGESIZE := 2048
5 SUBPAGESIZE := 2048
6 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048
7 endef
8
9 define Build/at91-sdcard
10 $(if $(findstring ext4,$@), \
11 rm -f $@.boot
12 mkfs.fat -C $@.boot $(FAT32_BLOCKS)
13
14 mcopy -i $@.boot $(KDIR)/zImage ::zImage
15
16 $(if $(findstring at91-sama5d27_som1_ek,$@), \
17 mcopy -i $@.boot \
18 $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc1/u-boot.bin \
19 ::u-boot.bin
20 mcopy -i $@.boot \
21 $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd1_uboot/at91bootstrap.bin \
22 ::BOOT.bin,
23 mcopy -i $@.boot \
24 $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc/u-boot.bin \
25 ::u-boot.bin
26 mcopy -i $@.boot \
27 $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot/at91bootstrap.bin \
28 ::BOOT.bin)
29
30 $(CP) uboot-env.txt $@-uboot-env.txt
31 sed -i '2d;3d' $@-uboot-env.txt
32 sed -i '2i board='"$(DEVICE_NAME:at91-%=%)"'' $@-uboot-env.txt
33 sed -i '3i board_name='"$(DEVICE_NAME:at91-%=%)"'' $@-uboot-env.txt
34
35 mkenvimage -s 0x4000 -o $@-uboot.env $@-uboot-env.txt
36
37 mcopy -i $@.boot $@-uboot.env ::uboot.env
38
39 ./gen_at91_sdcard_img.sh \
40 $@.img \
41 $@.boot \
42 $(KDIR)/root.ext4 \
43 $(AT91_SD_BOOT_PARTSIZE) \
44 $(CONFIG_TARGET_ROOTFS_PARTSIZE)
45
46 gzip -nc9 $@.img > $@
47
48 rm -f $@.img $@.boot $@-uboot.env $@-uboot-env.txt)
49 endef
50
51 define Device/at91-sama5d2_xplained
52 $(Device/evaluation-dtb)
53 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained
54 KERNEL_SIZE := 6144k
55 $(Device/evaluation-sdimage)
56 endef
57 TARGET_DEVICES += at91-sama5d2_xplained
58
59 define Device/at91-sama5d27_som1_ek
60 $(Device/evaluation-dtb)
61 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D27 SOM1 Ek
62 KERNEL_SIZE := 6144k
63 $(Device/evaluation-sdimage)
64 endef
65 TARGET_DEVICES += at91-sama5d27_som1_ek
66
67 define Device/at91-sama5d2_ptc_ek
68 $(Device/evaluation-dtb)
69 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 PTC Ek
70 KERNEL_SIZE := 6144k
71 $(Device/evaluation-sdimage)
72 endef
73 TARGET_DEVICES += at91-sama5d2_ptc_ek
74
75
76 define Device/at91-sama5d3_xplained
77 $(Device/evaluation-dtb)
78 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained
79 KERNEL_SIZE := 6144k
80 $(Device/evaluation-sdimage)
81 endef
82 TARGET_DEVICES += at91-sama5d3_xplained
83
84 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
85 ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
86 define Device/wb50n
87 $(Device/evaluation-fit)
88 DEVICE_TITLE := Laird WB50N
89 DEVICE_PACKAGES := \
90 kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \
91 kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \
92 kmod-leds-gpio
93 BLOCKSIZE := 128k
94 PAGESIZE := 2048
95 SUBPAGESIZE := 2048
96 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955
97 endef
98 TARGET_DEVICES += wb50n
99 endif
100 endif
101
102
103 define Device/at91-sama5d4_xplained
104 $(Device/evaluation-dtb)
105 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained
106 KERNEL_SIZE := 6144k
107 BLOCKSIZE := 256k
108 PAGESIZE := 4096
109 SUBPAGESIZE := 2048
110 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082
111 $(Device/evaluation-sdimage)
112 endef
113 TARGET_DEVICES += at91-sama5d4_xplained