octeon: add new target and support for Ubiquiti EdgeRouter 6P
[openwrt/openwrt.git] / target / linux / octeon / image / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # Copyright (C) 2009-2010 OpenWrt.org
4
5 include $(TOPDIR)/rules.mk
6 include $(INCLUDE_DIR)/image.mk
7
8 define Build/append-dtb-to-elf
9 $(TARGET_CROSS)objcopy --update-section .appended_dtb=$(KDIR)/image-$(DEVICE_DTS).dtb $@
10 endef
11
12 define Build/strip-kernel
13 # Workaround pre-SDK-1.9.0 u-boot versions not handling the .notes section
14 $(TARGET_CROSS)strip -R .notes $@ -o $@.stripped && mv $@.stripped $@
15 endef
16
17 DTS_DIR := $(DTS_DIR)/cavium-octeon
18
19 define Device/Default
20 PROFILES = Default $$(DEVICE_NAME)
21 KERNEL_NAME := vmlinux.elf
22 KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf
23 KERNEL := kernel-bin | strip-kernel | patch-cmdline
24 IMAGES := sysupgrade.tar
25 IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-extra 128k | sysupgrade-tar rootfs=$$$$@
26 IMAGE/sysupgrade.tar := sysupgrade-tar
27 endef
28
29 define Device/generic
30 DEVICE_VENDOR := Generic
31 DEVICE_MODEL := Octeon
32 FILESYSTEMS := ext4
33 endef
34 TARGET_DEVICES += generic
35
36 ITUSROUTER_CMDLINE:=console=ttyS0,115200 root=/dev/mmcblk1p2 rootfstype=squashfs,ext4,f2fs rootwait
37 define Device/itus_shield-router
38 DEVICE_VENDOR := Itus Networks
39 DEVICE_MODEL := Shield Router
40 CMDLINE := $(ITUSROUTER_CMDLINE)
41 IMAGE/sysupgrade.tar/squashfs += | append-metadata
42 endef
43 TARGET_DEVICES += itus_shield-router
44
45 ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
46 define Device/ubnt_edgerouter
47 DEVICE_VENDOR := Ubiquiti
48 DEVICE_MODEL := EdgeRouter
49 BOARD_NAME := er
50 CMDLINE := $(ER_CMDLINE)
51 endef
52 TARGET_DEVICES += ubnt_edgerouter
53
54 define Device/ubnt_edgerouter-e300
55 DEVICE_VENDOR := Ubiquiti
56 DEVICE_PACKAGES += kmod-gpio-button-hotplug kmod-leds-gpio kmod-of-mdio kmod-sfp kmod-usb3 kmod-usb-dwc3 kmod-usb-storage-uas
57 KERNEL := kernel-bin | patch-cmdline | append-dtb-to-elf
58 KERNEL_DEPENDS := $$(wildcard $(DTS_DIR)/$(DEVICE_DTS).dts)
59 CMDLINE := root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
60 endef
61
62 define Device/ubnt_edgerouter-4
63 $(Device/ubnt_edgerouter-e300)
64 DEVICE_MODEL := EdgeRouter 4
65 DEVICE_DTS := cn7130_ubnt_edgerouter-4
66 endef
67 TARGET_DEVICES += ubnt_edgerouter-4
68
69 define Device/ubnt_edgerouter-6p
70 $(Device/ubnt_edgerouter-e300)
71 DEVICE_MODEL := EdgeRouter 6P
72 DEVICE_DTS := cn7130_ubnt_edgerouter-6p
73 endef
74 TARGET_DEVICES += ubnt_edgerouter-6p
75
76 ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0)ro,512k(boot1)ro,64k(eeprom)ro root=/dev/sda2 rootfstype=squashfs,ext4 rootwait
77 define Device/ubnt_edgerouter-lite
78 DEVICE_VENDOR := Ubiquiti
79 DEVICE_MODEL := EdgeRouter Lite
80 BOARD_NAME := erlite
81 CMDLINE := $(ERLITE_CMDLINE)
82 endef
83 TARGET_DEVICES += ubnt_edgerouter-lite
84
85 $(eval $(call BuildImage))