generic: v6.1, v6.6: add patch to fix PHY-muxing on MT7530
[openwrt/openwrt.git] / target / linux / ixp4xx / image / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # Copyright (C) 2006-2021 OpenWrt.org
4
5 include $(TOPDIR)/rules.mk
6 include $(INCLUDE_DIR)/image.mk
7
8 # Cook a Linksys NSLU2 etc image
9 define Build/linksys-ixp425-image
10 touch $@.null-initrd
11 $(TOPDIR)/scripts/slugimage.pl -L $(STAGING_DIR_IMAGE)/apex/apex-$(1)-armeb.bin -k $@ -r $@.null-initrd -p -o $@.new
12 mv $@.new $@
13 endef
14
15 # Build sysupgrade image
16 define BuildFirmware/Generic
17 dd if=$(KDIR)/zImage of=$(KDIR)/zImage.pad bs=64k conv=sync; \
18 dd if=$(KDIR)/root.$(1) of=$(KDIR)/root.$(1).pad bs=128k conv=sync; \
19 sh $(TOPDIR)/scripts/combined-image.sh \
20 $(KDIR)/zImage.pad \
21 $(KDIR)/root.$(1).pad \
22 $(BIN_DIR)/$(IMG_PREFIX)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))-sysupgrade.bin
23 endef
24
25 define Image/Build
26 $(call Image/Build/$(1),$(1))
27 $(call BuildFirmware/Generic,$(1))
28 endef
29
30 define Device/Default
31 PROFILES := Default
32 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
33 KERNEL_NAME := zImage
34 KERNEL := kernel-bin | append-dtb
35 BLOCKSIZE := 128k
36 endef
37
38 define Device/gateworks_avila
39 DEVICE_VENDOR := Gateworks
40 DEVICE_MODEL := Avila GW2348-4
41 DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-ds1672 kmod-eeprom-at24 kmod-hwmon-ad7418
42 DEVICE_DTS := intel-ixp42x-gateworks-gw2348
43 KERNEL := kernel-bin | append-dtb
44 IMAGES := kernel.bin rootfs.bin
45 IMAGE/kernel.bin := append-kernel
46 IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
47 endef
48 TARGET_DEVICES += gateworks_avila
49
50 define Device/gateworks_cambria
51 DEVICE_VENDOR := Gateworks
52 DEVICE_MODEL := Cambria GW2358-4
53 DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-ds1672 kmod-eeprom-at24 kmod-hwmon-ad7418
54 DEVICE_DTS := intel-ixp43x-gateworks-gw2358
55 KERNEL := kernel-bin | append-dtb
56 IMAGES := kernel.bin rootfs.bin
57 IMAGE/kernel.bin := append-kernel
58 IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
59 endef
60 TARGET_DEVICES += gateworks_cambria
61
62 define Device/linksys_nslu2
63 DEVICE_VENDOR := Linksys
64 DEVICE_MODEL := NSLU2
65 # USB2 is compiled in and needs no package
66 DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-x1205
67 # Only 32 MB of RAM so not building by default
68 DEFAULT := n
69 DEVICE_DTS := intel-ixp42x-linksys-nslu2
70 KERNEL := kernel-bin | append-dtb
71 IMAGES := factory.bin
72 # This has to boot from harddisk so just append the kernel
73 IMAGE/factory.bin := append-kernel | linksys-ixp425-image "nslu2"
74 endef
75 TARGET_DEVICES += linksys_nslu2
76
77 define Device/usrobotics_usr8200
78 DEVICE_VENDOR := USRobotics
79 DEVICE_MODEL := USR8200
80 # USB2 is compiled in and needs no package
81 DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-r7301 kmod-firewire kmod-firewire-ohci
82 DEVICE_DTS := intel-ixp42x-usrobotics-usr8200
83 KERNEL := kernel-bin | append-dtb
84 IMAGES := kernel.bin rootfs.bin
85 IMAGE/kernel.bin := append-kernel
86 IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
87 endef
88 TARGET_DEVICES += usrobotics_usr8200
89
90 $(eval $(call BuildImage))