Revert "treewide: add sysupgrade comment for early DSA-adopters"
[openwrt/staging/dedeckeh.git] / target / linux / kirkwood / image / Makefile
index 11b28fd58b4a339f48f09eb11fcdf7d9a29b7b02..0816add47499597e9f3c6ba91001d4b01cc55d80 100644 (file)
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
+
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-NAND_BLOCKSIZE := 2048:128k
+KERNEL_LOADADDR:=0x8000
 
-define sanitize_profile_name
-$(shell echo $(PROFILE) | tr '[:upper:]' '[:lower:]')
+define Device/dsa-migration
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
 endef
 
-define Image/BuildKernel/Template
-
-       $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
-       echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage
-       $(call Image/BuildKernel/MkuImage, \
-               none, 0x8000, 0x8000, \
-               $(BIN_DIR)/$(IMG_PREFIX)-zImage, \
-               $(BIN_DIR)/$(IMG_PREFIX)-uImage \
-       )
-
- ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
-       $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
-       echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
-       $(call Image/BuildKernel/MkuImage, \
-               none, 0x8000, 0x8000, \
-               $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
-               $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
-       )
- endif
-
- ifneq ($(1),)
-       $(CP) $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(1).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb
-
-       $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage
-       cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage
-       $(call Image/BuildKernel/MkuImage, \
-               none, 0x8000, 0x8000, \
-               $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage, \
-               $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-uImage \
-       )
-
-  ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
-       $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs
-       cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs
-       $(call Image/BuildKernel/MkuImage, \
-               none, 0x8000, 0x8000, \
-               $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs, \
-               $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-uImage-initramfs \
-       )
-  endif
- endif
+define Device/Default
+  PROFILES := Default
+  DEVICE_DTS = kirkwood-$(lastword $(subst _, ,$(1)))
+  KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
+  KERNEL := kernel-bin | append-dtb | uImage none
+  KERNEL_NAME := zImage
+  KERNEL_SUFFIX  := -uImage
+  KERNEL_IN_UBI := 1
+
+  PAGESIZE := 2048
+  SUBPAGESIZE := 512
+  BLOCKSIZE := 128k
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  IMAGE/factory.bin := append-ubi
+  SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
 endef
 
-define Image/InstallKernel/Template
-
- ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
-       $(INSTALL_DIR) $(TARGET_DIR)/boot
-   ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE),)
-       $(CP) $(BIN_DIR)/$(IMG_PREFIX)-uImage $(TARGET_DIR)/boot/
-       ln -sf $(IMG_PREFIX)-uImage $(TARGET_DIR)/boot/uImage
-   endif
-   ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE),)
-       $(CP) $(BIN_DIR)/$(IMG_PREFIX)-zImage $(TARGET_DIR)/boot/
-       ln -sf $(IMG_PREFIX)-zImage $(TARGET_DIR)/boot/zImage
-   endif
- endif
-
- ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
-       $(INSTALL_DIR) $(TARGET_DIR)/boot
-  ifneq ($(1),)
-       $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb $(TARGET_DIR)/boot/
-       ln -sf $(IMG_PREFIX)-$(1).dtb $(TARGET_DIR)/boot/$(1).dtb
-  endif
- endif
+define Device/checkpoint_l-50
+  DEVICE_VENDOR := Check Point
+  DEVICE_MODEL := L-50
+  DEVICE_PACKAGES := kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \
+       kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-wolfssl
+  IMAGES := sysupgrade.bin
 endef
-
-define Image/Build/jffs2-nand-2048-128k
-       dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img \
-               bs=2048 conv=sync
+TARGET_DEVICES += checkpoint_l-50
+
+define Device/cisco_on100
+  DEVICE_VENDOR := Cisco Systems
+  DEVICE_MODEL := ON100
+  KERNEL_SIZE := 5376k
+  KERNEL_IN_UBI :=
+  UBINIZE_OPTS := -E 5
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
+  DEVICE_PACKAGES := kmod-mvsdio
+  SUPPORTED_DEVICES += on100
 endef
+TARGET_DEVICES += cisco_on100
 
-define Image/Build/squashfs
-       $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
-       ( \
-               dd if=$(KDIR)/zImage bs=4096k conv=sync; \
-               dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
-       ) > $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img
+define Device/cloudengines_pogoe02
+  DEVICE_VENDOR := Cloud Engines
+  DEVICE_MODEL := Pogoplug E02
+  DEVICE_DTS := kirkwood-pogo_e02
+  SUPPORTED_DEVICES += pogo_e02
 endef
-
-define Image/mkfs/targz
-
-       $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ .
+TARGET_DEVICES += cloudengines_pogoe02
+
+define Device/cloudengines_pogoplugv4
+  DEVICE_VENDOR := Cloud Engines
+  DEVICE_MODEL := Pogoplug V4
+  DEVICE_DTS := kirkwood-pogoplug-series-4
+  DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 kmod-mvsdio kmod-usb3 \
+       kmod-gpio-button-hotplug
 endef
+TARGET_DEVICES += cloudengines_pogoplugv4
 
-define Image/Build/ubifs
-
- ifneq ($($(PROFILE)_UBIFS_OPTS),)
-       $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.ubifs
- endif
+define Device/iom_iconnect-1.1
+  DEVICE_VENDOR := Iomega
+  DEVICE_MODEL := Iconnect
+  DEVICE_DTS := kirkwood-iconnect
+  SUPPORTED_DEVICES += iconnect
 endef
-
-define Image/Build/ubi
-
- ifneq ($($(PROFILE)_UBI_OPTS),)
-       $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.ubi
- endif
+TARGET_DEVICES += iom_iconnect-1.1
+
+define Device/iom_ix2-200
+  DEVICE_VENDOR := Iomega
+  DEVICE_MODEL := StorCenter ix2-200
+  DEVICE_DTS := kirkwood-iomega_ix2_200
+  DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 \
+       kmod-gpio-button-hotplug kmod-hwmon-lm63
+  PAGESIZE := 512
+  SUBPAGESIZE := 256
+  BLOCKSIZE := 16k
+  KERNEL_SIZE := 3072k
+  KERNEL_IN_UBI :=
+  UBINIZE_OPTS := -E 5
+  IMAGE_SIZE := 31744k
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
+       check-size
+endef
+TARGET_DEVICES += iom_ix2-200
+
+define Device/linksys
+  DEVICE_VENDOR := Linksys
+  DEVICE_PACKAGES := kmod-mwl8k wpad-basic-wolfssl kmod-gpio-button-hotplug
+  KERNEL_IN_UBI :=
+  UBINIZE_OPTS := -E 5
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
 endef
 
-Image/BuildKernel/Template/Generic=$(call Image/BuildKernel/Template)
-Image/InstallKernel/Template/Generic=$(call Image/InstallKernel/Template)
-
-Image/BuildKernel/Template/DOCKSTAR=$(call Image/BuildKernel/Template,dockstar)
-Image/InstallKernel/Template/DOCKSTAR=$(call Image/InstallKernel/Template,dockstar)
-
-Image/BuildKernel/Template/ICONNECT=$(call Image/BuildKernel/Template,iconnect)
-Image/InstallKernel/Template/ICONNECT=$(call Image/InstallKernel/Template,iconnect)
-
-Image/BuildKernel/Template/IB62X0=$(call Image/BuildKernel/Template,ib62x0)
-Image/InstallKernel/Template/IB62X0=$(call Image/InstallKernel/Template,ib62x0)
+define Device/linksys_e4200-v2
+  $(Device/linksys)
+  $(Device/dsa-migration)
+  DEVICE_MODEL := E4200
+  DEVICE_VARIANT := v2
+  KERNEL_SIZE := 2688k
+  SUPPORTED_DEVICES += linksys,viper linksys-viper
+endef
+TARGET_DEVICES += linksys_e4200-v2
+
+define Device/linksys_ea3500
+  $(Device/linksys)
+  $(Device/dsa-migration)
+  DEVICE_MODEL := EA3500
+  PAGESIZE := 512
+  SUBPAGESIZE := 256
+  BLOCKSIZE := 16k
+  KERNEL_SIZE := 2624k
+  SUPPORTED_DEVICES += linksys,audi linksys-audi
+endef
+TARGET_DEVICES += linksys_ea3500
+
+define Device/linksys_ea4500
+  $(Device/linksys)
+  $(Device/dsa-migration)
+  DEVICE_MODEL := EA4500
+  KERNEL_SIZE := 2688k
+  SUPPORTED_DEVICES += linksys,viper linksys-viper
+endef
+TARGET_DEVICES += linksys_ea4500
+
+define Device/raidsonic_ib-nas62x0
+  DEVICE_VENDOR := RaidSonic
+  DEVICE_MODEL := ICY BOX IB-NAS62x0
+  DEVICE_DTS := kirkwood-ib62x0
+  DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4
+  SUPPORTED_DEVICES += ib62x0
+endef
+TARGET_DEVICES += raidsonic_ib-nas62x0
 
-Image/BuildKernel/Template/POGOE02=$(call Image/BuildKernel/Template,pogo_e02)
-Image/InstallKernel/Template/POGOE02=$(call Image/InstallKernel/Template,pogo_e02)
+define Device/seagate_dockstar
+  DEVICE_VENDOR := Seagate
+  DEVICE_MODEL := FreeAgent Dockstar
+  SUPPORTED_DEVICES += dockstar
+endef
+TARGET_DEVICES += seagate_dockstar
 
-define Image/BuildKernel
-       $(call Image/BuildKernel/Template/$(PROFILE))
+define Device/seagate_goflexnet
+  DEVICE_VENDOR := Seagate
+  DEVICE_MODEL := GoFlexNet
+  DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4
+  SUPPORTED_DEVICES += goflexnet
 endef
+TARGET_DEVICES += seagate_goflexnet
 
-define Image/InstallKernel
-       $(call Image/InstallKernel/Template/$(PROFILE))
+define Device/seagate_goflexhome
+  DEVICE_VENDOR := Seagate
+  DEVICE_MODEL := GoFlexHome
+  DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4
+  SUPPORTED_DEVICES += goflexhome
+endef
+TARGET_DEVICES += seagate_goflexhome
+
+define Device/zyxel_nsa310b
+  DEVICE_VENDOR := ZyXEL
+  DEVICE_MODEL := NSA310b
+  DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-r8169 kmod-fs-ext4 \
+       kmod-gpio-button-hotplug kmod-hwmon-lm85
+  SUPPORTED_DEVICES += nsa310b
 endef
+TARGET_DEVICES += zyxel_nsa310b
 
-define Image/Build
-       $(if $(Image/Build/$(1)), \
-               $(call Image/Build/$(1),$(1)), \
-               $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img \
-       )
+define Device/zyxel_nsa310s
+  DEVICE_VENDOR := ZyXEL
+  DEVICE_MODEL := NSA310S
+  DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 kmod-gpio-button-hotplug
+endef
+TARGET_DEVICES += zyxel_nsa310s
+
+define Device/zyxel_nsa325
+  DEVICE_VENDOR := ZyXEL
+  DEVICE_MODEL := NSA325
+  DEVICE_VARIANT := v1/v2
+  DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 \
+       kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3
+  SUPPORTED_DEVICES += nsa325
 endef
+TARGET_DEVICES += zyxel_nsa325
 
 $(eval $(call BuildImage))