Преглед изворни кода

Merge branch 'master' of ldpinney/GnuBee-libreCMC into master

libreCMC пре 7 година
родитељ
комит
ae523302b1

+ 3 - 2
target/linux/ramips/base-files/etc/board.d/01_leds

@@ -171,8 +171,9 @@ fonera20n)
 	set_usb_led "$board:orange:usb"
 	set_wifi_led "$board:orange:wifi"
 	;;
-gb-pc1|\
-	ucidef_set_led_default "$board:green:status"
+gb-pc1)
+	ucidef_set_led_netdev "lan" "lan" "$board:green:lan" "eth0.1"
+	ucidef_set_led_netdev "wan" "wan" "$board:green:wan" "eth0.2"
 	;;
 gl-mt300a|\
 gl-mt300n|\

+ 97 - 74
target/linux/ramips/dts/GB-PC1.dts

@@ -6,7 +6,7 @@
 #include <dt-bindings/input/input.h>
 
 / {
-	compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
+	compatible = "gnubee,gb-pc1", "mediatek,mt7621-soc";
 	model = "GB-PC1";
 
 	memory@0 {
@@ -18,61 +18,12 @@
 		bootargs = "console=ttyS0,57600";
 	};
 
-	sdhci@10130000 {
-		status = "okay";
-	};
-
-	palmbus@1E000000 {
-		spi@b00 {
-			status = "okay";
-
-			m25p80@0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "jedec,spi-nor";
-				reg = <0 0>;
-				linux,modalias = "m25p80";
-				spi-max-frequency = <10000000>;
-				m25p,chunked-io = <32>;
-
-				partition@0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-					read-only;
-				};
-
-				partition@30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-				};
-
-				partition@40000 {
-					label = "firmware";
-					reg = <0x50000 0x1fb0000>;
-				};
-
-			};
-		};
-
+	palmbus: palmbus@1E000000 {
 		i2c@900 {
-			compatible = "ralink,i2c-mt7621";
-			reg = <0x900 0x100>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-			pinctrl-names = "default";
-			pinctrl-0 = <&i2c_pins>;
 			status = "okay";
 		};
 	};
 
-	pcie@1e140000 {
-		status = "okay";
-	};
-
-	ethernet@1e100000 {
-		status = "okay";
-	};
-
 	gpio-keys-polled {
 		compatible = "gpio-keys-polled";
 		#address-cells = <1>;
@@ -89,47 +40,119 @@
 	gpio-leds {
 		compatible = "gpio-leds";
 
+		system {
+			label = "gb-pc1:green:system";
+			gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+		};
+
 		status {
-			label = "gnubee:green:status";
-			gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+			label = "gb-pc1:green:status";
+			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
 		};
 
-		system {
-			label = "gnubee:green:system";
-			gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
+		lan {
+			label = "gb-pc1:green:lan";
+			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
+		};
+
+		wan {
+			label = "gb-pc1:green:wan";
+			gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
 		};
 	};
 
-	gpio-power {
-		compatible = "gpio-power";
+	gpio-export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
 
-		26 {
-			label = "gnubee:power:gpio26";
-			gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
+		gpio26 {
+			gpio-export,name = "gpio26";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
 		};
 
-		28 {
-			label = "gnubee:power:gpio28";
+		gpio28 {
+			gpio-export,name = "gpio28";
+			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
 		};
 
-		29 {
-			label = "gnubee:power:gpio29";
-			gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
+		gpio29 {
+			gpio-export,name = "gpio29";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
 		};
 
-		30 {
-			label = "gnubee:power:gpio30";
+		gpio30 {
+			gpio-export,name = "gpio30";
+			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
 		};
 	};
+};
+
+&sdhci {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	m25p80@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <10000000>;
+		m25p,chunked-io = <32>;
+
+		partition@0 {
+			label = "u-boot";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition@30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+		};
+
+		factory: partition@40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+			read-only;
+		};
+
+		partition@50000 {
+			label = "firmware";
+			reg = <0x50000 0x1fb0000>;
+		};
+	};
+};
+
+&cpuclock {
+		compatible = "fixed-clock";
+		clock-frequency = <2000000000>;
+};
+
+&sysclock {
+		compatible = "fixed-clock";
+		clock-frequency = <80000000>;
+};
+
+&pcie {
+	status = "okay";
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0xe000>;
+};
 
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "wdt", "rgmii2", "mdio";
-				ralink,function = "gpio";
-			};
+&pinctrl {
+	state_default: pinctrl0 {
+		gpio {
+			ralink,group = "wdt", "rgmii2", "uart3";
+			ralink,function = "gpio";
 		};
 	};
 };

+ 1 - 1
target/linux/ramips/image/mt7621.mk

@@ -5,7 +5,7 @@
 define Device/gb-pc1
   DTS := GB-PC1
   DEVICE_TITLE := GnuBee Personal Cloud One
-  DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci
+  DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 uboot-envtools
   IMAGE_SIZE := $(ralink_default_fw_size_32M)
 endef