Message ID | 5532428c.2cd8.569c7e5c3c2bca04.metromail@netease |
---|---|
State | Changes Requested |
Headers | show |
Hi, Yunhao The patch is not in plaintext format and is whitespace broken. You can work around this by generating a patch with git-format-patch, then send it with git-send-email. On 18 April 2015 at 19:39, 田韵豪 <tianyh2000@163.com> wrote: > HiWiFi HC5661 (Ji 1s) support. > > Signed-off-by: B Tian < tianyh2000@163.com> Real name is more preferable :) > --- > > diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds > b/target/linux/ramips/base-files/etc/board.d/01_leds > index 56ba3b7..292859d 100755 > --- a/target/linux/ramips/base-files/etc/board.d/01_leds > +++ b/target/linux/ramips/base-files/etc/board.d/01_leds > @@ -237,6 +237,11 @@ case $board in > set_usb_led "lenovo:blue:usb" > set_wifi_led "lenovo:blue:wifi" > ;; > + hc5661) > + ucidef_set_led_default "power" "power" "hiwifi:blue:power" "1" > + set_wifi_led "hiwifi:blue:wifi" > + ucidef_set_led_interface "br-lan" "hiwifi:blue:network" "hiwifi:blue:network" should be better named as "hiwifi:blue:wan" and the interface name should be "wan". > + ;; > zte-q7) > set_wifi_led "zte:blue:status" > ;; > diff --git a/target/linux/ramips/base-files/etc/board.d/02_network > b/target/linux/ramips/base-files/etc/board.d/02_network > index 24e1ba8..505f7d9 100755 > --- a/target/linux/ramips/base-files/etc/board.d/02_network > +++ b/target/linux/ramips/base-files/etc/board.d/02_network > @@ -229,6 +229,14 @@ ramips_setup_interfaces() > ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5 6t" > ucidef_add_switch_vlan "switch0" "2" "0 6t" > ;; > + > + hc5661) > + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" > + ucidef_add_switch "switch0" "1" "1" > + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t" > + ucidef_add_switch_vlan "switch0" "2" "0 6t" > + ;; > + > d105 | \ > na930 | \ > omni-emb-hpm|\ > @@ -310,6 +318,7 @@ ramips_setup_macs() > dir-320-b1 | \ > psr-680w |\ > sl-r7205 |\ > + hc5661 |\ > y1 |\ > y1s) > lan_mac=$(cat /sys/class/net/eth0/address) > diff --git a/target/linux/ramips/base-files/etc/diag.sh > b/target/linux/ramips/base-files/etc/diag.sh > index 5301593..02b3ee0 100644 > --- a/target/linux/ramips/base-files/etc/diag.sh > +++ b/target/linux/ramips/base-files/etc/diag.sh > @@ -224,6 +224,9 @@ get_status_led() { > y1s) > status_led="lenovo:blue:power" > ;; > + hc5661) > + status_led="hiwifi:blue:power" > + ;; > zte-q7) > status_led="zte:red:status" > ;; > diff --git a/target/linux/ramips/base-files/lib/ramips.sh > b/target/linux/ramips/base-files/lib/ramips.sh > index 616f4a1..8311a5f 100755 > --- a/target/linux/ramips/base-files/lib/ramips.sh > +++ b/target/linux/ramips/base-files/lib/ramips.sh > @@ -391,6 +391,9 @@ ramips_board_detect() { > *"Lenovo Y1S") > name="y1s" > ;; > + *"HiWiFi HC5661") > + name="hc5661" We already have hiwifi-hc6361 as the board name for HiWiFi HC6361 in ar71xx target, so it's better we stick to that naming convention and use hiwifi-hc5661 here. > + ;; > *"Mediatek MT7621 evaluation board") > name="mt7621" > ;; > diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh > b/target/linux/ramips/base-files/lib/upgrade/platform.sh > index 17b456b..a913c41 100755 > --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh > +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh > @@ -115,6 +115,7 @@ platform_check_image() { > xiaomi-miwifi-mini |\ > y1 |\ > y1s |\ > + hc5661 |\ > zte-q7 |\ > zbt-wa05) > [ "$magic" != "27051956" ] && { > diff --git a/target/linux/ramips/dts/HC5661.dts > b/target/linux/ramips/dts/HC5661.dts > new file mode 100644 > index 0000000..873b83c > --- /dev/null > +++ b/target/linux/ramips/dts/HC5661.dts > @@ -0,0 +1,137 @@ > +/dts-v1/; > + > +/include/ "mt7620a.dtsi" > + > +/ { > + compatible = "hiwifi,HC5661", "ralink,mt7620a-soc"; The first compatible string is better be HiWiFi-HC5661. > + model = "HiWiFi HC5661"; > + > + chosen { > + bootargs = "console=ttyS0,115200"; > + }; > + > + palmbus@10000000 { > + sysc@0 { > + ralink,gpiomux = "i2c", "jtag"; > + ralink,uartmux = "gpio"; > + ralink,wdtmux = <1>; > + }; > + > + gpio0: gpio@600 { > + status = "okay"; > + }; > + > + gpio2: gpio@660 { > + status = "okay"; > + }; > + > + gpio3: gpio@688 { > + status = "okay"; > + }; > + > + > + spi@b00 { > + status = "okay"; > + > + m25p80@0 { > + #address-cells = <1>; > + #size-cells = <1>; > + compatible = "w25q128"; > + reg = <0 0>; > + linux,modalias = "m25p80", "w25q128"; > + 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; > + }; This area is named 'hw_panic' in OEM firmware. > + > + factory: partition@40000 { > + label = "factory"; > + reg = <0x40000 0x10000>; > + read-only; > + }; > + > + partition@50000 { > + label = "firmware"; > + reg = <0x50000 0xfb0000>; > + }; "firmware" partition only has 0xf90000 bytes. There is another 0x10000 bytes for "bdinfo" which stores at least mac address and other warranty information. IMHO, this should not be overwritten without users' being aware of. In original OEM firmware, there is also another 0x10000 bytes with the name "backup" the functionality of which i am currently not sure about. > + }; > + }; > + }; > + > + ehci@101c0000 { > + status = "okay"; > + }; > + > + ohci@101c1000 { > + status = "okay"; > + }; > + > + sdhci@10130000 { > + status = "okay"; > + }; > + > + pcie@10140000 { > + status = "okay"; > + }; > + > + wmac@10180000 { > + ralink,mtd-eeprom = <&factory 0>; > + }; > + > + ethernet@10100000 { > + pinctrl-names = "default"; > + pinctrl-0 = <&ephy_pins>; > + mtd-mac-address = <&factory 0x4>; Well, as with HiWiFi HC6361, MAC address of HC5661 is in bdinfo partion in ascii format. This directive alone here is not enough. Something like target/linux/ramips/patches-3.18/0034-NET-add-of_get_mac_address_mtd.patch has to be done. Cheers. yousong
Oh...I'm planning to send support for HiWiFi HC5761 and I was dealing with the MAC address problem last week...... You should read the MAC address from bdinfo partition which is described by Yousong.(This can be done with a simple script.) I'll send the support for HC5761 now and you can have a look:-) 2015-04-18 21:47 GMT+08:00 Yousong Zhou <yszhou4tech@gmail.com>: > Hi, Yunhao > > The patch is not in plaintext format and is whitespace broken. You > can work around this by generating a patch with git-format-patch, then > send it with git-send-email. > > On 18 April 2015 at 19:39, 田韵豪 <tianyh2000@163.com> wrote: >> HiWiFi HC5661 (Ji 1s) support. >> >> Signed-off-by: B Tian < tianyh2000@163.com> > > Real name is more preferable :) > >> --- >> >> diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds >> b/target/linux/ramips/base-files/etc/board.d/01_leds >> index 56ba3b7..292859d 100755 >> --- a/target/linux/ramips/base-files/etc/board.d/01_leds >> +++ b/target/linux/ramips/base-files/etc/board.d/01_leds >> @@ -237,6 +237,11 @@ case $board in >> set_usb_led "lenovo:blue:usb" >> set_wifi_led "lenovo:blue:wifi" >> ;; >> + hc5661) >> + ucidef_set_led_default "power" "power" "hiwifi:blue:power" "1" >> + set_wifi_led "hiwifi:blue:wifi" >> + ucidef_set_led_interface "br-lan" "hiwifi:blue:network" > > "hiwifi:blue:network" should be better named as "hiwifi:blue:wan" and > the interface name should be "wan". > >> + ;; >> zte-q7) >> set_wifi_led "zte:blue:status" >> ;; >> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network >> b/target/linux/ramips/base-files/etc/board.d/02_network >> index 24e1ba8..505f7d9 100755 >> --- a/target/linux/ramips/base-files/etc/board.d/02_network >> +++ b/target/linux/ramips/base-files/etc/board.d/02_network >> @@ -229,6 +229,14 @@ ramips_setup_interfaces() >> ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5 6t" >> ucidef_add_switch_vlan "switch0" "2" "0 6t" >> ;; >> + >> + hc5661) >> + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" >> + ucidef_add_switch "switch0" "1" "1" >> + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t" >> + ucidef_add_switch_vlan "switch0" "2" "0 6t" >> + ;; >> + >> d105 | \ >> na930 | \ >> omni-emb-hpm|\ >> @@ -310,6 +318,7 @@ ramips_setup_macs() >> dir-320-b1 | \ >> psr-680w |\ >> sl-r7205 |\ >> + hc5661 |\ >> y1 |\ >> y1s) >> lan_mac=$(cat /sys/class/net/eth0/address) >> diff --git a/target/linux/ramips/base-files/etc/diag.sh >> b/target/linux/ramips/base-files/etc/diag.sh >> index 5301593..02b3ee0 100644 >> --- a/target/linux/ramips/base-files/etc/diag.sh >> +++ b/target/linux/ramips/base-files/etc/diag.sh >> @@ -224,6 +224,9 @@ get_status_led() { >> y1s) >> status_led="lenovo:blue:power" >> ;; >> + hc5661) >> + status_led="hiwifi:blue:power" >> + ;; >> zte-q7) >> status_led="zte:red:status" >> ;; >> diff --git a/target/linux/ramips/base-files/lib/ramips.sh >> b/target/linux/ramips/base-files/lib/ramips.sh >> index 616f4a1..8311a5f 100755 >> --- a/target/linux/ramips/base-files/lib/ramips.sh >> +++ b/target/linux/ramips/base-files/lib/ramips.sh >> @@ -391,6 +391,9 @@ ramips_board_detect() { >> *"Lenovo Y1S") >> name="y1s" >> ;; >> + *"HiWiFi HC5661") >> + name="hc5661" > > We already have hiwifi-hc6361 as the board name for HiWiFi HC6361 in > ar71xx target, so it's better we stick to that naming convention and > use hiwifi-hc5661 here. > >> + ;; >> *"Mediatek MT7621 evaluation board") >> name="mt7621" >> ;; >> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh >> b/target/linux/ramips/base-files/lib/upgrade/platform.sh >> index 17b456b..a913c41 100755 >> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh >> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh >> @@ -115,6 +115,7 @@ platform_check_image() { >> xiaomi-miwifi-mini |\ >> y1 |\ >> y1s |\ >> + hc5661 |\ >> zte-q7 |\ >> zbt-wa05) >> [ "$magic" != "27051956" ] && { >> diff --git a/target/linux/ramips/dts/HC5661.dts >> b/target/linux/ramips/dts/HC5661.dts >> new file mode 100644 >> index 0000000..873b83c >> --- /dev/null >> +++ b/target/linux/ramips/dts/HC5661.dts >> @@ -0,0 +1,137 @@ >> +/dts-v1/; >> + >> +/include/ "mt7620a.dtsi" >> + >> +/ { >> + compatible = "hiwifi,HC5661", "ralink,mt7620a-soc"; > > The first compatible string is better be HiWiFi-HC5661. > >> + model = "HiWiFi HC5661"; >> + >> + chosen { >> + bootargs = "console=ttyS0,115200"; >> + }; >> + >> + palmbus@10000000 { >> + sysc@0 { >> + ralink,gpiomux = "i2c", "jtag"; >> + ralink,uartmux = "gpio"; >> + ralink,wdtmux = <1>; >> + }; >> + >> + gpio0: gpio@600 { >> + status = "okay"; >> + }; >> + >> + gpio2: gpio@660 { >> + status = "okay"; >> + }; >> + >> + gpio3: gpio@688 { >> + status = "okay"; >> + }; >> + >> + >> + spi@b00 { >> + status = "okay"; >> + >> + m25p80@0 { >> + #address-cells = <1>; >> + #size-cells = <1>; >> + compatible = "w25q128"; >> + reg = <0 0>; >> + linux,modalias = "m25p80", "w25q128"; >> + 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; >> + }; > > This area is named 'hw_panic' in OEM firmware. > >> + >> + factory: partition@40000 { >> + label = "factory"; >> + reg = <0x40000 0x10000>; >> + read-only; >> + }; >> + >> + partition@50000 { >> + label = "firmware"; >> + reg = <0x50000 0xfb0000>; >> + }; > > "firmware" partition only has 0xf90000 bytes. There is another > 0x10000 bytes for "bdinfo" which stores at least mac address and other > warranty information. IMHO, this should not be overwritten without > users' being aware of. In original OEM firmware, there is also > another 0x10000 bytes with the name "backup" the functionality of > which i am currently not sure about. > >> + }; >> + }; >> + }; >> + >> + ehci@101c0000 { >> + status = "okay"; >> + }; >> + >> + ohci@101c1000 { >> + status = "okay"; >> + }; >> + >> + sdhci@10130000 { >> + status = "okay"; >> + }; >> + >> + pcie@10140000 { >> + status = "okay"; >> + }; >> + >> + wmac@10180000 { >> + ralink,mtd-eeprom = <&factory 0>; >> + }; >> + >> + ethernet@10100000 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&ephy_pins>; >> + mtd-mac-address = <&factory 0x4>; > > Well, as with HiWiFi HC6361, MAC address of HC5661 is in bdinfo > partion in ascii format. This directive alone here is not enough. > Something like target/linux/ramips/patches-3.18/0034-NET-add-of_get_mac_address_mtd.patch > has to be done. > > Cheers. > > yousong > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 56ba3b7..292859d 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -237,6 +237,11 @@ case $board in set_usb_led "lenovo:blue:usb" set_wifi_led "lenovo:blue:wifi" ;; + hc5661) + ucidef_set_led_default "power" "power" "hiwifi:blue:power" "1" + set_wifi_led "hiwifi:blue:wifi" + ucidef_set_led_interface "br-lan" "hiwifi:blue:network" + ;; zte-q7) set_wifi_led "zte:blue:status" ;; diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 24e1ba8..505f7d9 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -229,6 +229,14 @@ ramips_setup_interfaces() ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5 6t" ucidef_add_switch_vlan "switch0" "2" "0 6t" ;; + + hc5661) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t" + ucidef_add_switch_vlan "switch0" "2" "0 6t" + ;; + d105 | \ na930 | \ omni-emb-hpm|\ @@ -310,6 +318,7 @@ ramips_setup_macs() dir-320-b1 | \ psr-680w |\ sl-r7205 |\ + hc5661 |\ y1 |\ y1s) lan_mac=$(cat /sys/class/net/eth0/address) diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 5301593..02b3ee0 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -224,6 +224,9 @@ get_status_led() { y1s) status_led="lenovo:blue:power" ;; + hc5661) + status_led="hiwifi:blue:power" + ;; zte-q7) status_led="zte:red:status" ;; diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 616f4a1..8311a5f 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -391,6 +391,9 @@ ramips_board_detect() { *"Lenovo Y1S") name="y1s" ;; + *"HiWiFi HC5661") + name="hc5661" + ;; *"Mediatek MT7621 evaluation board") name="mt7621" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 17b456b..a913c41 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -115,6 +115,7 @@ platform_check_image() { xiaomi-miwifi-mini |\ y1 |\ y1s |\ + hc5661 |\ zte-q7 |\ zbt-wa05) [ "$magic" != "27051956" ] && { diff --git a/target/linux/ramips/dts/HC5661.dts b/target/linux/ramips/dts/HC5661.dts new file mode 100644 index 0000000..873b83c --- /dev/null +++ b/target/linux/ramips/dts/HC5661.dts @@ -0,0 +1,137 @@ +/dts-v1/; + +/include/ "mt7620a.dtsi" + +/ { + compatible = "hiwifi,HC5661", "ralink,mt7620a-soc"; + model = "HiWiFi HC5661"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + palmbus@10000000 { + sysc@0 { + ralink,gpiomux = "i2c", "jtag"; + ralink,uartmux = "gpio"; + ralink,wdtmux = <1>; + }; + + gpio0: gpio@600 { + status = "okay"; + }; + + gpio2: gpio@660 { + status = "okay"; + }; + + gpio3: gpio@688 { + status = "okay"; + }; + + + spi@b00 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "w25q128"; + reg = <0 0>; + linux,modalias = "m25p80", "w25q128"; + 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 0xfb0000>; + }; + }; + }; + }; + + ehci@101c0000 { + status = "okay"; + }; + + ohci@101c1000 { + status = "okay"; + }; + + sdhci@10130000 { + status = "okay"; + }; + + pcie@10140000 { + status = "okay"; + }; + + wmac@10180000 { + ralink,mtd-eeprom = <&factory 0>; + }; + + ethernet@10100000 { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + ralink,port-map = "wllll"; + }; + + pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "uartf", "wled", "nd_sd"; + ralink,function = "gpio"; + }; + pa { + ralink,group = "pa"; + ralink,function = "pa"; + }; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 12 1>; + linux,code = <0x198>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + power1 { + label = "hiwifi:blue:power"; + gpios = <&gpio0 9 1>; + }; + wlan1 { + label = "hiwifi:blue:wifi"; + gpios = <&gpio3 0 1>; + }; + internet { + label = "hiwifi:blue:network"; + gpios = <&gpio0 11 1>; + }; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index e6b5112..b537dd4 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -853,6 +853,7 @@ na930_mtd_size=20971520 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size)) Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP) Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1,Y1) +Image/Build/Profile/HC5661=$(call BuildFirmware/Default16M/$(1),$(1),HiWiFi-hc5661,HC5661) Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1s,Y1S) Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW221) Image/Build/Profile/MLWG2=$(call BuildFirmware/Default16M/$(1),$(1),mlwg2,MLWG2) @@ -885,6 +886,7 @@ define Image/Build/Profile/Default $(call Image/Build/Profile/MZK-750DHP,$(1)) $(call Image/Build/Profile/NA930,$(1)) $(call Image/Build/Profile/Y1,$(1)) + $(call Image/Build/Profile/HC5661,$(1)) $(call Image/Build/Profile/Y1S,$(1)) $(call Image/Build/Profile/MLW221,$(1)) $(call Image/Build/Profile/MLWG2,$(1))
HiWiFi HC5661 (Ji 1s) support. Signed-off-by: B Tian < tianyh2000@163.com> ---