layerscape: add ls2088ardb device support
[openwrt/openwrt.git] / target / linux / layerscape / image / Makefile
1 #
2 # Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 define Build/append-ls-rcw
11 rm -f $@
12 dd if=$(KDIR)/$(1)-rcw.bin >> $@
13 endef
14
15 define Build/append-ls-uboot
16 dd if=$(KDIR)/$(1)-$(SUBTARGET)-uboot.bin >> $@
17 endef
18
19 define Build/append-ls-fman
20 dd if=$(KDIR)/$(1)-fman.bin >> $@
21 endef
22
23 define Build/append-ls-dtb
24 $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb)
25 dd if=$(DTS_DIR)/$(1).dtb >> $@
26 endef
27
28 define Build/append-ls-rootfs-ext4
29 $(STAGING_DIR_HOST)/bin/make_ext4fs -l $(word 2,$(1)) -b 4096 -i 6000 -m 0 -J $(KDIR)/$(word 1,$(1))-$(word 2,$(1)).root.ext4 $(TARGET_DIR)
30 dd if=$(KDIR)/$(word 1,$(1))-$(word 2,$(1)).root.ext4 >> $@
31 endef
32
33 define Device/Default
34 PROFILES = Default
35 FILESYSTEMS := squashfs
36 KERNEL := kernel-bin | gzip | uImage gzip
37 DEVICE_DTS :=
38 IMAGES = firmware.bin
39
40 ifeq ($(SUBTARGET),64b)
41 KERNEL_LOADADDR = 0x80080000
42 KERNEL_ENTRY_POINT = 0x80080000
43 endif
44 ifeq ($(SUBTARGET),32b)
45 KERNEL_LOADADDR = 0x80008000
46 KERNEL_ENTRY_POINT = 0x80008000
47 endif
48 endef
49
50 define Device/ls1043ardb
51 DEVICE_TITLE := ls1043ardb-$(SUBTARGET)
52 DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb fman-layerscape-ls1043ardb
53 ifeq ($(SUBTARGET),64b)
54 DEVICE_DTS = freescale/fsl-ls1043a-rdb
55 endif
56 ifeq ($(SUBTARGET),32b)
57 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb
58 endif
59 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
60 append-ls-fman $(1) | pad-to 4M | append-ls-dtb $$(DEVICE_DTS) | pad-to 5M | \
61 append-kernel | pad-to 10M | append-rootfs | pad-rootfs | check-size 67108865
62 endef
63 TARGET_DEVICES += ls1043ardb
64
65 define Device/ls1046ardb
66 DEVICE_TITLE := ls1046ardb-$(SUBTARGET)
67 DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb fman-layerscape-ls1046ardb
68 ifeq ($(SUBTARGET),64b)
69 DEVICE_DTS = freescale/fsl-ls1046a-rdb
70 endif
71 ifeq ($(SUBTARGET),32b)
72 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb
73 endif
74 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
75 append-ls-fman $(1) | pad-to 4M | append-ls-dtb $$(DEVICE_DTS) | pad-to 5M | \
76 append-kernel | pad-to 10M | append-ls-rootfs-ext4 $(1) 22M | check-size 33554433
77 endef
78 TARGET_DEVICES += ls1046ardb
79
80 define Device/ls1012ardb
81 DEVICE_TITLE := ls1012ardb-$(SUBTARGET)
82 DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb kmod-ppfe ppfe-ls1012ardb
83 ifeq ($(SUBTARGET),64b)
84 DEVICE_DTS = freescale/fsl-ls1012a-rdb
85 endif
86 ifeq ($(SUBTARGET),32b)
87 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb
88 endif
89 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | append-ls-uboot $(1) | pad-to 3M | \
90 append-ls-dtb $$(DEVICE_DTS) | pad-to 4M | append-kernel | pad-to 9M | \
91 append-ls-rootfs-ext4 $(1) 23M | check-size 33554433
92 endef
93 TARGET_DEVICES += ls1012ardb
94
95 define Device/ls1088ardb
96 DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
97 DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb mc-binary-ls1088ardb
98 ifeq ($(SUBTARGET),64b)
99 DEVICE_DTS = freescale/fsl-ls1088a-rdb
100 endif
101 ifeq ($(SUBTARGET),32b)
102 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb
103 endif
104 IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | append-kernel | pad-to 6M | \
105 append-ls-rootfs-ext4 $(1) 17M | check-size 24117249
106 endef
107 TARGET_DEVICES += ls1088ardb
108
109 define Device/ls2088ardb
110 DEVICE_TITLE := ls2088ardb-$(SUBTARGET)
111 DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb mc-binary-ls2088ardb
112 ifeq ($(SUBTARGET),64b)
113 DEVICE_DTS = freescale/fsl-ls2088a-rdb
114 endif
115 ifeq ($(SUBTARGET),32b)
116 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb
117 endif
118 IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | append-kernel | pad-to 6M | \
119 append-rootfs | pad-rootfs | check-size 24117249
120 endef
121 TARGET_DEVICES += ls2088ardb
122
123 $(eval $(call BuildImage))