layerscape: support LSDK ppfe
[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=$(STAGING_DIR_IMAGE)/$(1)-rcw.bin >> $@
13 endef
14
15 define Build/append-ls-uboot
16 dd if=$(STAGING_DIR_IMAGE)/$(1)-$(SUBTARGET)-uboot.bin >> $@
17 endef
18
19 define Build/append-ls-fman
20 dd if=$(STAGING_DIR_IMAGE)/$(1)-fman.bin >> $@
21 endef
22
23 define Build/append-ls-mc
24 dd if=$(STAGING_DIR_IMAGE)/$(1)-mc.itb >> $@
25 endef
26
27 define Build/append-ls-ppfe
28 dd if=$(STAGING_DIR_IMAGE)/pfe.itb >> $@
29 endef
30
31 define Build/append-ls-dpl
32 dd if=$(STAGING_DIR_IMAGE)/$(1)-dpl.dtb >> $@
33 endef
34
35 define Build/append-ls-dpc
36 dd if=$(STAGING_DIR_IMAGE)/$(1)-dpc.dtb >> $@
37 endef
38
39 define Build/append-ls-dtb
40 $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb)
41 dd if=$(DTS_DIR)/$(1).dtb >> $@
42 endef
43
44 define Build/append-ls-rootfs-ext4
45 $(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)
46 dd if=$(KDIR)/$(word 1,$(1))-$(word 2,$(1)).root.ext4 >> $@
47 endef
48
49 define Device/Default
50 PROFILES = Default
51 FILESYSTEMS := squashfs
52 DEVICE_DTS :=
53 IMAGES = firmware.bin
54
55 ifeq ($(SUBTARGET),armv8_64b)
56 KERNEL := kernel-bin | gzip | uImage gzip
57 KERNEL_LOADADDR = 0x80080000
58 KERNEL_ENTRY_POINT = 0x80080000
59 endif
60 ifeq ($(SUBTARGET),armv8_32b)
61 KERNEL := kernel-bin | uImage none
62 KERNEL_NAME := zImage
63 KERNEL_LOADADDR = 0x80008000
64 KERNEL_ENTRY_POINT = 0x80008000
65 endif
66 endef
67
68 define Device/ls1043ardb
69 DEVICE_TITLE := ls1043ardb-$(SUBTARGET)
70 DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb fman-layerscape-ls1043ardb
71 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk
72 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
73 append-ls-uboot $(1) | pad-to 9M | \
74 append-ls-fman $(1) | pad-to 15M | \
75 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
76 append-kernel | pad-to 32M | \
77 append-rootfs | pad-rootfs | check-size 67108865
78 endef
79 TARGET_DEVICES += ls1043ardb
80
81 define Device/ls1046ardb
82 DEVICE_TITLE := ls1046ardb-$(SUBTARGET)
83 DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb fman-layerscape-ls1046ardb
84 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk
85 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
86 append-ls-uboot $(1) | pad-to 9M | \
87 append-ls-fman $(1) | pad-to 15M | \
88 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
89 append-kernel | pad-to 32M | \
90 append-ls-rootfs-ext4 $(1) 22M | check-size 67108865
91 endef
92 TARGET_DEVICES += ls1046ardb
93
94 define Device/ls1012ardb
95 DEVICE_TITLE := ls1012ardb-$(SUBTARGET)
96 DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \
97 kmod-ppfe layerscape-ppfe
98 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb
99 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
100 append-ls-uboot $(1) | pad-to 10M | \
101 append-ls-ppfe | pad-to 15M | \
102 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
103 append-kernel | pad-to 32M | \
104 append-ls-rootfs-ext4 $(1) 23M | check-size 67108865
105 endef
106 TARGET_DEVICES += ls1012ardb
107
108 ifeq ($(SUBTARGET),armv8_64b)
109 define Device/ls1088ardb
110 DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
111 DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb \
112 layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool
113 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb
114 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
115 append-ls-uboot $(1) | pad-to 10M | \
116 append-ls-mc $(1) | pad-to 13M | \
117 append-ls-dpl $(1) | pad-to 14M | \
118 append-ls-dpc $(1) | pad-to 15M | \
119 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
120 append-kernel | pad-to 32M | \
121 append-ls-rootfs-ext4 $(1) 17M | check-size 67108865
122 endef
123 TARGET_DEVICES += ls1088ardb
124
125 define Device/ls2088ardb
126 DEVICE_TITLE := ls2088ardb-$(SUBTARGET)
127 DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb \
128 layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool
129 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb
130 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
131 append-ls-uboot $(1) | pad-to 10M | \
132 append-ls-mc $(1) | pad-to 13M | \
133 append-ls-dpl $(1) | pad-to 14M | \
134 append-ls-dpc $(1) | pad-to 15M | \
135 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
136 append-kernel | pad-to 32M | \
137 append-rootfs | pad-rootfs | check-size 67108865
138 endef
139 TARGET_DEVICES += ls2088ardb
140 endif
141
142 $(eval $(call BuildImage))