brcm63xx: use dtb for cvg834g
authorjogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 27 Feb 2015 17:39:07 +0000 (17:39 +0000)
committerjogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 27 Feb 2015 17:39:07 +0000 (17:39 +0000)
Add a dtsi for bcm3368, add a dts and profile for cvg834g, and convert
it to use ImageDTB. Since HCS requires more arguments, enhance the max
arguments of the call.
The image name is intentionally left blank to prevent non-initramfs
images to be built, as they currently contain no rootfs and consequently
won't work.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44561 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/brcm63xx/dts/bcm3368.dtsi [new file with mode: 0644]
target/linux/brcm63xx/dts/cvg834g.dts [new file with mode: 0644]
target/linux/brcm63xx/image/Makefile
target/linux/brcm63xx/profiles/netgear.mk

diff --git a/target/linux/brcm63xx/dts/bcm3368.dtsi b/target/linux/brcm63xx/dts/bcm3368.dtsi
new file mode 100644 (file)
index 0000000..dba73b5
--- /dev/null
@@ -0,0 +1,75 @@
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       compatible = "brcm,bcm3368";
+
+       aliases {
+               pflash = &pflash;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       compatible = "brcm,bmips4350", "mips,mips4Kc";
+                       device_type = "cpu";
+                       reg = <0>;
+               };
+
+               cpu@1 {
+                       compatible = "brcm,bmips4350", "mips,mips4Kc";
+                       device_type = "cpu";
+                       reg = <1>;
+               };
+       };
+
+       cpu_intc: interrupt-controller {
+               #address-cells = <0>;
+               compatible = "mti,cpu-interrupt-controller";
+
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+
+       memory { device_type = "memory"; reg = <0 0>; };
+
+       pflash: nor@1e000000 {
+               compatible = "cfi-flash";
+               reg = <0x1e000000 0x2000000>;
+               bank-width = <2>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               status = "disabled";
+       };
+
+       ubus@fff00000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               compatible = "simple-bus";
+
+               periph_intc: interrupt-controller@fff8c00c {
+                       compatible = "brcm,bcm6345-periph-intc";
+                       reg = <0xfffe000c 0x8>;
+
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+
+                       interrupt-parent = <&cpu_intc>;
+                       interrupts = <2>;
+               };
+
+               ext_intc0: interrupt-controller@fff8c014 {
+                       compatible = "brcm,bcm6345-ext-intc";
+                       reg = <0xfffe0014 0x4>;
+
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+
+                       interrupt-parent = <&periph_intc>;
+                       interrupts = <24>, <25>, <26>, <27>;
+               };
+       };
+};
diff --git a/target/linux/brcm63xx/dts/cvg834g.dts b/target/linux/brcm63xx/dts/cvg834g.dts
new file mode 100644 (file)
index 0000000..8481003
--- /dev/null
@@ -0,0 +1,30 @@
+/dts-v1/;
+
+/include/ "bcm3368.dtsi"
+
+/ {
+       model = "Netgear CVG834G";
+       compatible = "netgear,cvg834g", "brcm,bcm6348";
+};
+
+&pflash {
+       status = "ok";
+
+       linux,part-probe = "bcm63xxpart";
+
+       cfe@0 {
+               label = "CFE";
+               reg = <0x000000 0x010000>;
+               read-only;
+       };
+
+       linux@10000 {
+               label = "linux";
+               reg = <0x010000 0x3e0000>;
+       };
+
+       nvram@3f0000 {
+               label = "nvram";
+               reg = <0x3f0000 0x010000>;
+       };
+};
index 4c56693..e7b633b 100755 (executable)
@@ -103,9 +103,9 @@ define Image/Build/RedBootDTB
        dd if=$(KDIR)/vmlinux-$(3).bin.gz of=$(BIN_DIR)/openwrt-$(2)-vmlinux.gz bs=65536 conv=sync
 endef
 
-define Image/Build/HCS
-       $(STAGING_DIR_HOST)/bin/hcsmakeimage --magic_byte=$(3) \
-               --rev_maj=$(4) --rev_min=$(5) --input_file=$(6) \
+define Image/Build/HCSDTB
+       $(STAGING_DIR_HOST)/bin/hcsmakeimage --magic_byte=$(4) \
+               --rev_maj=$(5) --rev_min=$(6) --input_file=$(KDIR)/$(7) \
                --output_file=$(BIN_DIR)/openwrt-$(2)-$(1).bin
 endef
 
@@ -122,10 +122,10 @@ define Image/PrepareLoader
        $(MAKE) -C lzma-loader \
                $(LOADER_MAKEOPTS) \
                BUILD_DIR="$(KDIR)" \
-               TARGET_DIR="$(BIN_DIR)" \
+               TARGET_DIR="$(2)" \
                LOADER_DATA="$(KDIR)/vmlinux$(1).lzma" \
-               LOADER=$(IMG_PREFIX)-loader$(1).elf \
-               compile loader.elf
+               LOADER=$(IMG_PREFIX)-loader$(1) \
+               compile $(3)
 
        rm -f $(KDIR)/vmlinux$(1).lzma
 endef
@@ -133,7 +133,7 @@ endef
 define Image/PrepareLoaderDTB
        # append dtb to vmlinux, then build a standard LZMA loader
        cat $(KDIR)/vmlinux$(1) $(DTS_DIR)/$(2).dtb > $(KDIR)/vmlinux$(1)-$(2)
-       $(call Image/PrepareLoader,$(1)-$(2))
+       $(call Image/PrepareLoader,$(1)-$(2),$(3),$(4))
 endef
 
 define Image/PrepareCFELzmaKernel
@@ -162,14 +162,20 @@ define Image/Prepare
        $(foreach board,$(sort $(TARGET_$(PROFILE)_DTBS)), $(call Image/PrepareCFELzmaKernelDTB,$(board)))
 
  ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
-       $(call Image/PrepareLoader,-initramfs)
-       $(foreach board,$(sort $(TARGET_$(PROFILE)_DTBS)), $(call Image/PrepareLoaderDTB,-initramfs,$(board)))
+       $(call Image/PrepareLoader,-initramfs,$(BIN_DIR),loader.elf)
+       $(foreach board,$(sort $(TARGET_$(PROFILE)_DTBS)), \
+               $(call Image/PrepareLoaderDTB,-initramfs,$(board),$(BIN_DIR),loader.elf))
+ ifneq (,$(findstring cvg834g,$(TARGET_$(PROFILE)_DTBS)))
+       $(call Image/PrepareLoaderDTB,-initramfs,cvg834g,$(KDIR),loader.bin)
+ endif
  endif
 endef
 
 define Image/Build/Initramfs
        # Netgear CVG834G
-       $(call Image/Build/HCS,initramfs,cvg834g,a020,0001,0022,$(KDIR)/vmlinux-initramfs)
+ ifneq (,$(findstring cvg834g,$(TARGET_$(PROFILE)_DTBS)))
+       $(call Image/Build/HCSDTB,initramfs,cvg834g,cvg834g,a020,0001,0022,$(IMG_PREFIX)-loader-initramfs-cvg834g.bin)
+ endif
 endef
 
 # $(1) = Image build
@@ -181,7 +187,7 @@ endef
 # $(7) = additional options
 define ImageDTB
   define Image/Build/$(3)
-        $$(call Image/Build/$(1),$$(1),$(3),$(4),$(5),$(6),$(7))
+        $$(call Image/Build/$(1),$$(1),$(3),$(4),$(5),$(6),$(7),$(8))
   endef
 
   TARGET_Default_DTBS += $(4)
@@ -200,9 +206,6 @@ define Image/Build
        # RTA1320_16M (numerous routers)
        $(call Image/Build/CFE,$(1),RTA1320_16M,6338,RTA1320_16M,,--layoutver 5)
 
-       # Netgear CVG834G
-       $(call Image/Build/HCS,$(1),cvg834g,a020,0001,0022,$(KDIR)/vmlinux)
-
        # build dtb image list
        $(foreach image,$(TARGET_$(PROFILE)_IMAGES),$(call Image/Build/$(image),$(1)))
 
@@ -295,6 +298,8 @@ $(eval $(call ImageDTB,CFEDTB,HG556a_AB,HG556a_B,hg556a-b,HW556,6358,--rsa-signa
 $(eval $(call ImageDTB,CFEDTB,HG556a_C,HG556a_C,hg556a-c,HW556,6358,--rsa-signature "EchoLife_HG556a" --image-offset 0x20000 --block-size 0x20000 --tag-version 8))
 # Inventel Livebox 1
 $(eval $(call ImageDTB,RedBootDTB,Livebox,livebox,livebox-blue-5g))
+# Netgear CVG834G
+$(eval $(call ImageDTB,HCSDTB,CVG834G,,cvg834g,a020,0001,0022,vmlinux-cvg834g))
 # Netgear DG834GT/PN
 $(eval $(call ImageDTB,CFEDTB,DG834GTPN,DG834GT_PN,dg834gtpn,96348GW-10,6348))
 # Pirelli Alice Gate VoIP 2 Plus Wi-Fi AGPF-S0
index 562e0f5..75ddab5 100644 (file)
@@ -5,6 +5,16 @@
 # See /LICENSE for more information.
 #
 
+define Profile/CVG834G
+  NAME:=Netgear CVG834G
+  PACKAGES:=
+endef
+define Profile/CVG834G/Description
+  Package set optimized for CVG834G.
+endef
+
+$(eval $(call Profile,CVG834G))
+
 define Profile/DG834GTPN
   NAME:=Netgear DG834GT/PN
   PACKAGES:=kmod-ath5k wpad-mini