[LEDE-DEV] [PATCH] brcm63xx: fix Livebox1 support

Daniel Gonzalez Cabanelas dgcbueu at gmail.com
Mon Aug 1 08:06:16 PDT 2016


Livebox firmware is totally broken, fix it.

- Fix Image generation: missing "relocate-kernel", wrong "LOADADDR", fix it
- Fix dts file: 
     - leds are totally wrong, fix them.
     - no failsafe button, use button 1 for this purpose
     - part probe wrong, it should be RedBoot (uppercase matters). It still don't work 
      (bad partition offsets and sizes detected) so disable it.
- Add status led
- Set eth0 as the LAN port, for coherence with RedBoot and comfortability.
- Add led triggers

Signed-off-by: Daniel Gonzalez Cabanelas<dgcbueu at gmail.com>
diff --git a/target/linux/brcm63xx/base-files/etc/board.d/01_leds b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
index 4163214..8d8a942 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
@@ -58,6 +58,11 @@ homehub2a)
 	ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1"
 	ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1"
 	;;
+livebox1)
+	ucidef_set_led_netdev "lan" "LAN" "Livebox1:red:traffic" "eth0"
+	ucidef_set_led_netdev "wan" "WAN" "Livebox1:red:adsl" "eth1"
+	ucidef_set_led_netdev "wlan0" "WIFI" "Livebox1:red:wifi" "wlan0"
+	;;
 r5010un_v2)
 	ucidef_set_led_usbdev "usb" "USB" "R5010UNv2:green:usb" "1-1"
 	;;
diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network b/target/linux/brcm63xx/base-files/etc/board.d/02_network
index 83367c1..c20caf9 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network
@@ -129,6 +129,10 @@ bcm963268bu_p300)
 		"0:lan" "3:lan" "4:lan" "5:lan" "6:lan" "7:lan" "8t at eth0"
 	;;
 
+livebox1)
+	ucidef_set_interfaces_lan_wan "eth0" "eth1"
+	;;
+
 *)
 	ucidef_set_interfaces_lan_wan "eth1" "eth0"
 	;;
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
index 51756ae..852a701 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -102,6 +102,9 @@ set_state() {
 	hg655b)
 		status_led="HW65x:green:power"
 		;;
+	livebox1)
+		status_led="Livebox1:red:adsl-fail-power"
+		;;
 	p870hw-51a_v2)
 		status_led="P870HW-51a:green:power"
 		;;
diff --git a/target/linux/brcm63xx/dts/livebox-blue-5g.dts b/target/linux/brcm63xx/dts/livebox-blue-5g.dts
index 0df5fa8..f14bdd9 100644
--- a/target/linux/brcm63xx/dts/livebox-blue-5g.dts
+++ b/target/linux/brcm63xx/dts/livebox-blue-5g.dts
@@ -23,7 +23,7 @@
 		button1 {
 			label = "BTN_1";
 			gpios = <&gpio1 4 1>;
-			linux,code = <BTN_1>;
+			linux,code = <KEY_RESTART>;
 		};
 
 		button2 {
@@ -37,28 +37,28 @@
 		compatible = "gpio-leds";
 
 		red_adsl_fail {
-			label = "Livebox-blue-5g:red:adsl-fail";
+			label = "Livebox1:red:adsl-fail-power";
 			gpios = <&gpio0 0 0>;
 			default-state = "on";
 		};
 
 		red_adsl {
-			label = "Livebox-blue-5g:red:adsl-fail";
+			label = "Livebox1:red:adsl";
 			gpios = <&gpio0 1 0>;
 		};
 
 		red_traffic {
-			label = "Livebox-blue-5g:red:adsl-fail";
+			label = "Livebox1:red:traffic";
 			gpios = <&gpio0 2 0>;
 		};
 
 		red_phone {
-			label = "Livebox-blue-5g:red:adsl-fail";
+			label = "Livebox1:red:phone";
 			gpios = <&gpio0 3 0>;
 		};
 
 		red_wifi {
-			label = "Livebox-blue-5g:red:adsl-fail";
+			label = "Livebox1:red:wifi";
 			gpios = <&gpio0 4 0>;
 		};
 	};
@@ -66,7 +66,7 @@
 
 &pflash {
 	reg = <0x1e400000 0x800000>;
-	status = "ok";
+	status = "disabled";
 
-	linux,part-probe = "redboot";
+	linux,part-probe = "RedBoot";
 };
diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
index f5de673..beed8e9 100644
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -151,7 +151,7 @@ define Build/redboot-bin
 	$(TOPDIR)/scripts/redboot-script.pl \
 		-k $(BIN_DIR)/$(REDBOOT_PREFIX)-vmlinux.gz \
 		-r $(BIN_DIR)/$(REDBOOT_PREFIX)-$(notdir $(IMAGE_ROOTFS)) \
-		-a $(strip $(LOADADDR)) -f 0xbe430000 -l 0x7c0000 \
+		-a $(strip $(LOADER_ENTRY)) -f 0xbe430000 -l 0x7c0000 \
 		-s 0x1000 -t 20 -o $@.redbootscript
 	dd if="$@.redbootscript" of="$@.redbootscript.padded" bs=4096 conv=sync
 	cat \
diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk
index af14168..34d496e 100644
--- a/target/linux/brcm63xx/image/bcm63xx.mk
+++ b/target/linux/brcm63xx/image/bcm63xx.mk
@@ -44,7 +44,7 @@ DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION
 
 define Device/bcm63xx_redboot
   FILESYSTEMS := squashfs
-  KERNEL := kernel-bin | append-dtb | gzip
+  KERNEL := kernel-bin | append-dtb | relocate-kernel | gzip
   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-lzma elf
   IMAGES := redboot.bin
   IMAGE/redboot.bin := redboot-bin




More information about the Lede-dev mailing list