# # Copyright (C) 2008-2011 OpenWrt.org # # 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 IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default) JFFS2_BLOCKSIZE = 64k 128k 256k rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1))) define imgname $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(call rootfs_type,$(1)) endef define rootfs_align $(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1)))))) endef define sysupname $(call imgname,$(1),$(2))-sysupgrade.bin endef define factoryname $(call imgname,$(1),$(2))-factory.bin endef COMMA:=, define mkcmdline $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3)) endef define mtdpartsize $(shell echo $$((`echo '$(2)' | sed -e 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/'` * 1024))) endef SINGLE_PROFILES:= define SingleProfile define Image/Build/Profile/$(3) $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12)) endef SINGLE_PROFILES += $(3) endef define MultiProfile define Image/Build/Profile/$(1) $(foreach p,$(2), $$(call Image/Build/Profile/$p,$$(1)) ) endef endef LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR) KDIR_TMP:=$(KDIR)/tmp VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage define CompressLzma $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(3) $(2) endef define PatchKernel cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1) $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))" endef define PatchKernel/initramfs $(call PatchKernel,$(1),$(2),-initramfs) cp $(KDIR_TMP)/vmlinux-initramfs-$(1) $(call imgname,initramfs,$(1)).bin endef define PatchKernelLzma cp $(KDIR)/vmlinux$(4) $(KDIR_TMP)/vmlinux$(4)-$(1) $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(4)-$(1) "$(strip $(2))" $(call CompressLzma,$(KDIR_TMP)/vmlinux$(4)-$(1),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(3)) endef define PatchKernelGzip cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1) $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))" gzip -9 -c $(KDIR_TMP)/vmlinux$(3)-$(1) > $(KDIR_TMP)/vmlinux$(3)-$(1).bin.gz endef ifneq ($(SUBTARGET),mikrotik) define MkuImage mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \ -e 0x80060000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \ -d $(3) $(4) endef define MkuImageLzma $(call PatchKernelLzma,$(1),$(2),$(3),$(4)) $(call MkuImage,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage) endef define MkuImageLzma/initramfs $(call PatchKernelLzma,$(1),$(2),$(3),-initramfs) $(call MkuImage,lzma,$(4),$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.lzma,$(call imgname,initramfs,$(1))-uImage.bin) endef define MkuImageGzip $(call PatchKernelGzip,$(1),$(2)) $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-$(1).bin.gz,$(KDIR_TMP)/vmlinux-$(1).uImage) endef define MkuImageGzip/initramfs $(call PatchKernelGzip,$(1),$(2),-initramfs) $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.gz,$(call imgname,initramfs,$(1))-uImage.bin) endef define MkuImageOKLI $(call MkuImage,lzma,-M 0x4f4b4c49,$(KDIR)/vmlinux.bin.lzma,$(KDIR_TMP)/vmlinux-$(1).okli) endef endif define CatFiles if [ $(2) -eq 0 ]; then \ filename="$(3)"; fstype=$$$${filename##*\.}; \ case "$$$${fstype}" in \ "jffs2-64k") bs=65536;; \ "jffs2-128k") bs=131072;; \ "jffs2-256k") bs=262144;; \ *) bs=`stat -c%s $(1)`;; \ esac; \ ( dd if=$(1) bs=$$$${bs} conv=sync; cat $(3) ) > $(5); \ if [ -n "$(6)" ]; then \ case "$$$${fstype}" in \ squashfs*) \ padjffs2 $(5) $(6); \ ;; \ esac; \ fi; \ if [ `stat -c%s $(5)` -gt $(4) ]; then \ echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \ rm -f $(5); \ fi; \ else if [ $(2) -gt 262144 ]; then \ if [ `stat -c%s "$(1)"` -gt $(2) ]; then \ echo "Warning: $(1) is too big (> $(2) bytes)" >&2; \ else if [ `stat -c%s $(3)` -gt $(4) ]; then \ echo "Warning: $(3) is too big (> $(4) bytes)" >&2; \ else \ ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \ fi; fi; \ else \ ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \ if [ `stat -c%s $(5)` -gt $(4) ]; then \ echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \ rm -f $(5); \ fi; \ fi; fi endef Sysupgrade/KR=$(call CatFiles,$(2),$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(5))) Sysupgrade/KRuImage=$(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)),$(5)) Sysupgrade/RKuImage=$(call CatFiles,$(KDIR)/root.$(1),$(4),$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(call sysupname,$(1),$(2))) # $(1): ubinize ini file # $(2): working directory # $(3): output file # $(4): physical erase block size # $(5): minimum I/O unit size # $(6): custom options define ubinize $(CP) $(1) $(2) ( cd $(2); $(STAGING_DIR_HOST)/bin/ubinize -o $(3) -p $(4) -m $(5) $(6) $(1)) endef define Image/BuildLoader -rm -rf $(KDIR)/lzma-loader $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\ LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \ LOADER_DATA="$(KDIR)/vmlinux$(5).bin.lzma" BOARD="$(1)" \ compile loader.$(2) -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2) endef define Image/BuildLoaderAlone -rm -rf $(KDIR)/lzma-loader $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \ LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \ BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \ compile loader.$(2) endef define B
From 25a1ac92997df2b1e2c76a374d444605cbc96a9f Mon Sep 17 00:00:00 2001
From: Roman Byshko <rbyshko@gmail.com>
Date: Fri, 7 Feb 2014 16:21:53 +0100
Subject: [PATCH] ARM: sun7i: dt: Add bindings for USB clocks
Signed-off-by: Roman Byshko <rbyshko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
arch/arm/boot/dts/sun7i-a20.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -313,6 +313,15 @@
clock-output-names = "ir1";
};
+ usb_clk: clk@01c200cc {
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ compatible = "allwinner,sun4i-a10-usb-clk";
+ reg = <0x01c200cc 0x4>;
+ clocks = <&pll6 1>;
+ clock-output-names = "usb_ohci0", "usb_ohci1", "usb_phy";
+ };
+
spi3_clk: clk@01c200d4 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-mod0-clk";