ramips: add profile and build image for the Upvel UR-326N4G board
[openwrt/openwrt.git] / target / linux / ramips / image / Makefile
index bf64b7669693836642f5a91fb4b42d27cbae2598..6ff1bb1bdc927865db700e71121423dbe23a8e33 100644 (file)
@@ -50,7 +50,7 @@ endef
 
 define MkImage
        $(eval imagename=$(if $(4),$(4),MIPS OpenWrt Linux-$(LINUX_VERSION)))
-       mkimage -A mips -O linux -T kernel -C $(1) $(call kernel_entry)\
+       -mkimage -A mips -O linux -T kernel -C $(1) $(call kernel_entry)\
                -n "$(imagename)" \
                -d $(2) $(3)
 endef
@@ -63,9 +63,9 @@ endef
 define MkCombineduImage
        $(call PatchKernelLzma,$(2),$(3))
        if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt `expr $(4) - 64` ]; then \
-               echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big"; \
+               echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big" >&2; \
        else if [ `stat -c%s "$(KDIR)/root.$(1)"` -gt $(5) ]; then \
-               echo "Warning: $(KDIR)/root.$(1) is too big"; \
+               echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
        else \
                ( dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=`expr $(4) - 64` conv=sync ; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/vmlinux-$(2).bin.lzma.combined ; \
        fi ; fi
@@ -74,9 +74,9 @@ endef
 
 define CatFiles
        if [ `stat -c%s "$(1)"` -gt $(2) ]; then \
-               echo "Warning: $(1) is too big"; \
+               echo "Warning: $(1) is too big" >&2; \
        else if [ `stat -c%s $(3)` -gt $(4) ]; then \
-               echo "Warning: $(3) is too big"; \
+               echo "Warning: $(3) is too big" >&2; \
        else \
                ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
        fi; fi
@@ -291,6 +291,17 @@ define BuildFirmware/NW718
        $(call BuildFirmware/Generic,$(1),$(2),$(cmdline_nw718),$(kernel_size_nw718),$(rootfs_size_nw718))
 endef
 
+mtdlayout_omniembhpm=192k(u-boot)ro,64k(config)ro,64k(factory)ro,1024k(kernel),15040k(rootfs),16064k@0x50000(firmware)
+kernel_size_omniembhpm=1048576
+rootfs_size_omniembhpm=15400960
+define BuildFirmware/OMNIEMBHPM
+       $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),ttyS1,115200) $(call mkmtd/spi,$(mtdlayout_omniembhpm)),$(kernel_size_omniembhpm),$(rootfs_size_omniembhpm))
+endef
+
+define BuildFirmware/OMNIEMBHPM/initramfs
+       $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),ttyS1,115200) $(call mkmtd/spi,$(mtdlayout_omniembhpm)))
+endef
+
 mtdlayout_rtg32b1=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware)
 mtd_rtg32b1_kernel_part_size=917504
 mtd_rtg32b1_rootfs_part_size=2949120
@@ -308,9 +319,9 @@ endef
 define BuildFirmware/Seama
        $(call PatchKernelLzma,$(2),$(3))
        if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt $(4) ]; then \
-               echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big"; \
+               echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big" >&2; \
        else if [ `stat -c%s $(KDIR)/root.$(1)` -gt $(5) ]; then \
-               echo "Warning: $(KDIR)/root.$(1) is too big"; \
+               echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
        else \
                ( \
                        dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=$(4) count=1 conv=sync; \
@@ -462,6 +473,11 @@ define Image/Build/Profile/3G6200N
        $(call Image/Build/Template/$(fs_squash)/$(1),3G6200N,3g-6200n,3G-6200N,ttyS1,57600,phys)
 endef
 
+define Image/Build/Profile/3G300M
+       $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,3g300m,3G300M,ttyS1,57600,spi,3G150M_SPI Kernel Image,factory.bin)
+       $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,3g300m,3G300M,ttyS1,57600,spi)
+endef
+
 define Image/Build/Profile/AIR3GII
        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,air3gii,AIR3GII,ttyS1,57600,spi)
 endef
@@ -617,6 +633,9 @@ define Image/Build/Profile/WR5123GN
        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,wr512-3gn-8M,WR512-3GN,ttyS1,57600,phys)
 endef
 
+define Image/Build/Profile/UPVEL_326
+       $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,ur-326n4g,UR-326N4G,ttyS1,57600,phys)
+endef
 
 define Image/Build/Profile/UPVEL
        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,ur-336un,UR-336UN,ttyS1,57600,phys)
@@ -633,6 +652,7 @@ endef
 ifeq ($(CONFIG_RALINK_RT305X),y)
 define Image/Build/Profile/Default
        $(call Image/Build/Profile/3G6200N,$(1))
+       $(call Image/Build/Profile/3G300M,$(1))
        $(call Image/Build/Profile/AIR3GII,$(1))
        $(call Image/Build/Profile/ALL02393G,$(1))
        $(call Image/Build/Profile/ALL0256N,$(1))
@@ -656,6 +676,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/NBG419N,$(1))
        $(call Image/Build/Profile/NW718,$(1))
        $(call Image/Build/Profile/OMNIEMB,$(1))
+       $(call Image/Build/Profile/UPVEL_326,$(1))
        $(call Image/Build/Profile/PSR680W,$(1))
        $(call Image/Build/Profile/PWH2004,$(1))
        $(call Image/Build/Profile/RTG32B1,$(1))
@@ -682,6 +703,10 @@ define Image/Build/Profile/DIR645
        $(call Image/Build/Template/$(fs_squash)/$(1),DIR645,dir-645,DIR-645,ttyS1,57600,spi,wrgn39_dlob.hans_dir645)
 endef
 
+define Image/Build/Profile/OMNIEMBHPM
+       $(call Image/Build/Template/$(fs_squash)/$(1),OMNIEMBHPM,omni-emb-hpm,OMNI-EMB-HPM)
+endef
+
 define Image/Build/Profile/RTN56U
        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,rt-n56u,RT-N56U,ttyS1,57600,phys)
 endef
@@ -697,6 +722,7 @@ endef
 ifeq ($(CONFIG_RALINK_RT3883),y)
 define Image/Build/Profile/Default
        $(call Image/Build/Profile/DIR645,$(1))
+       $(call Image/Build/Profile/OMNIEMBHPM,$(1))
        $(call Image/Build/Profile/RTN56U,$(1))
        $(call Image/Build/Profile/TEW691GR,$(1))
        $(call Image/Build/Profile/TEW692GR,$(1))