ramips: add Poray M4 4M/8M support
authorJohn Crispin <john@openwrt.org>
Thu, 1 Aug 2013 14:30:58 +0000 (14:30 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 1 Aug 2013 14:30:58 +0000 (14:30 +0000)
Signed-off-by: Felix Kaechele <heffer@fedoraproject.org>
SVN-Revision: 37637

target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/etc/uci-defaults/02_network
target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/M4-4M.dts [new file with mode: 0644]
target/linux/ramips/dts/M4-8M.dts [new file with mode: 0644]
target/linux/ramips/image/Makefile
target/linux/ramips/rt305x/profiles/poray.mk

index a68538b2f7e7fdd45e5d5ef3e6604897a2139585..57c8beb6c271d881c1ef77617bfa86e9294cb921 100755 (executable)
@@ -55,6 +55,9 @@ get_status_led() {
        m3)
                status_led="m3:blue:status"
                ;;
+       m4)
+               status_led="m4:blue:status"
+               ;;
        mofi3500-3gn)
                status_led="mofi3500-3gn:green:status"
                ;;
index 307330b0636726e0da2cb1c9be4f5d105c50c640..133c2decb9a031c0f4e8d264e5613c684ceb785d 100755 (executable)
@@ -226,7 +226,8 @@ ramips_setup_macs()
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
-       m3)
+       m3 |\
+       m4)
                lan_mac=$(mtd_get_mac_binary factory 4)
                lan_mac=$(macaddr_add "$lan_mac" -1)
                ;;
index 86c19b0b819164c05796560fb23766db6a05c7ee..f9aabd5c4e81e853ffa081f5507e4f2d87ea5bde 100644 (file)
@@ -75,7 +75,8 @@ preinit_set_mac_address() {
                mac=$(mtd_get_mac_binary factory 40)
                ifconfig eth0 hw ether $mac 2>/dev/null
                ;;
-       m3)
+       m3 |\
+       m4)
                mac=$(mtd_get_mac_binary factory 4)
                mac=$(macaddr_add "$mac" -1)
                ifconfig eth0 hw ether $mac 2>/dev/null
index 7afa707363abe32720668ae48522454616a689c4..e3776f1304d2d641f088820d5d09d90dad0b4034 100755 (executable)
@@ -151,6 +151,9 @@ ramips_board_detect() {
        *"Poray M3")
                name="m3"
                ;;
+       *"Poray M4")
+               name="m4"
+               ;;
        *"PWH2004")
                name="pwh2004"
                ;;
index 4ac86e97e00255c61631dee4688e602b7efbacc0..5e1a7a5651ed10ac734a9c024ee8c9ebfc8e6077 100755 (executable)
@@ -45,6 +45,7 @@ platform_check_image() {
        hw550-3g | \
        hg255d | \
        m3 | \
+       m4 | \
        mofi3500-3gn | \
        mpr-a1 | \
        mpr-a2 | \
diff --git a/target/linux/ramips/dts/M4-4M.dts b/target/linux/ramips/dts/M4-4M.dts
new file mode 100644 (file)
index 0000000..86bd832
--- /dev/null
@@ -0,0 +1,99 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+       compatible = "M4", "ralink,rt5350-soc";
+       model = "Poray M4";
+
+       palmbus@10000000 {
+               sysc@0 {
+                       ralink,pinmux = "i2c", "spi", "uartlite", "jtag", "mdio", "sdram", "rgmii";
+                       ralink,uartmux = "gpio";
+                       ralink,wdtmux = <1>;
+               };
+
+               gpio0: gpio@600 {
+                       status = "okay";
+               };
+
+               spi@b00 {
+                       status = "okay";
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "pm25lq032";
+                               reg = <0 0>;
+                               linux,modalias = "m25p80", "pm25lq032";
+                               spi-max-frequency = <10000000>;
+
+                               partition@0 {
+                                       label = "u-boot";
+                                       reg = <0x0 0x30000>;
+                                       read-only;
+                               };
+
+                               partition@30000 {
+                                       label = "u-boot-env";
+                                       reg = <0x30000 0x10000>;
+                                       read-only;
+                               };
+
+                               factory: partition@40000 {
+                                       label = "factory";
+                                       reg = <0x40000 0x10000>;
+                                       read-only;
+                               };
+
+                               partition@50000 {
+                                       label = "firmware";
+                                       reg = <0x50000 0x3b0000>;
+                               };
+                       };
+               };
+       };
+
+       ethernet@10100000 {
+               status = "okay";
+       };
+
+       esw@10110000 {
+               status = "okay";
+               ralink,portmap = <0x2f>;
+               ralink,led_polarity = <1>;
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               status {
+                       label = "m4:blue:status";
+                       gpios = <&gpio0 9 1>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 10 1>;
+                       linux,code = <0x198>;
+               };
+       };
+
+       wmac@10180000 {
+               status = "okay";
+               ralink,mtd-eeprom = <&factory 0>;
+               ralink,led-polarity = <1>;
+       };
+
+       ehci@101c0000 {
+               status = "okay";
+       };
+
+       ohci@101c1000 {
+               status = "okay";
+       };
+};
diff --git a/target/linux/ramips/dts/M4-8M.dts b/target/linux/ramips/dts/M4-8M.dts
new file mode 100644 (file)
index 0000000..d07eb49
--- /dev/null
@@ -0,0 +1,99 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+       compatible = "M4", "ralink,rt5350-soc";
+       model = "Poray M4";
+
+       palmbus@10000000 {
+               sysc@0 {
+                       ralink,pinmux = "i2c", "spi", "uartlite", "jtag", "mdio", "sdram", "rgmii";
+                       ralink,uartmux = "gpio";
+                       ralink,wdtmux = <1>;
+               };
+
+               gpio0: gpio@600 {
+                       status = "okay";
+               };
+
+               spi@b00 {
+                       status = "okay";
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "gd25q64";
+                               reg = <0 0>;
+                               linux,modalias = "m25p80", "gd25q64";
+                               spi-max-frequency = <10000000>;
+
+                               partition@0 {
+                                       label = "u-boot";
+                                       reg = <0x0 0x30000>;
+                                       read-only;
+                               };
+
+                               partition@30000 {
+                                       label = "u-boot-env";
+                                       reg = <0x30000 0x10000>;
+                                       read-only;
+                               };
+
+                               factory: partition@40000 {
+                                       label = "factory";
+                                       reg = <0x40000 0x10000>;
+                                       read-only;
+                               };
+
+                               partition@50000 {
+                                       label = "firmware";
+                                       reg = <0x50000 0x7b0000>;
+                               };
+                       };
+               };
+       };
+
+       ethernet@10100000 {
+               status = "okay";
+       };
+
+       esw@10110000 {
+               status = "okay";
+               ralink,portmap = <0x2f>;
+               ralink,led_polarity = <1>;
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               status {
+                       label = "m4:blue:status";
+                       gpios = <&gpio0 9 1>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 10 1>;
+                       linux,code = <0x198>;
+               };
+       };
+
+       wmac@10180000 {
+               status = "okay";
+               ralink,mtd-eeprom = <&factory 0>;
+               ralink,led-polarity = <1>;
+       };
+
+       ehci@101c0000 {
+               status = "okay";
+       };
+
+       ohci@101c1000 {
+               status = "okay";
+       };
+};
index b626bec7c4a858d509c0fe68df8d7b1aa62630f2..68343e3fdde011c27052a77149f82614cb816dc1 100644 (file)
@@ -376,6 +376,8 @@ Image/Build/Profile/FREESTATION5=$(call BuildFirmware/Default8M/$(1),$(1),freest
 
 Image/Build/Profile/M3=$(call BuildFirmware/Poray4M/$(1),$(1),m3,M3)
 
+Image/Build/Profile/M4=$(call BuildFirmware/PorayDualSize/$(1),$(1),m4,M4)
+
 Image/Build/Profile/MOFI3500-3GN=$(call BuildFirmware/Default8M/$(1),$(1),mofi3500-3gn,MOFI3500-3GN)
 
 # Kernel name should be "Linux Kernel Image" to make the OpenWrt image installable from factory Web UI
@@ -511,6 +513,7 @@ define Image/Build/Profile/Default
 #      $(call Image/Build/Profile/HG255D,$(1))
        $(call Image/Build/Profile/HW550-3G,$(1))
        $(call Image/Build/Profile/M3,$(1))
+       $(call Image/Build/Profile/M4,$(1))
        $(call Image/Build/Profile/MOFI3500-3GN,$(1))
        $(call Image/Build/Profile/MPRA2,$(1))
        $(call Image/Build/Profile/MZKW300NH2,$(1))
index 972d7fdbd6052d0fb894b8a121aef5ddb9ec7ffd..10cf37f3812c2cb298304237cbce32c7b01fc055 100644 (file)
@@ -15,3 +15,13 @@ define Profile/M3/Description
 endef
 
 $(eval $(call Profile,M3))
+
+define Profile/M4
+       NAME:=Poray M4
+       PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
+endef
+define Profile/M4/Description
+       Package set for Poray M4 board
+endef
+
+$(eval $(call Profile,M4))