ramips: Add support for HiWiFi HC5962#865
ramips: Add support for HiWiFi HC5962#865gigibox wants to merge 1 commit intolede-project:masterfrom gigibox:patch-hc5962
Conversation
|
good job |
pepe2k
left a comment
There was a problem hiding this comment.
Hello @gigibox,
Thank you for your contribution, please find my comments below.
Please, include also some short description about the device you are adding support for and how to flash LEDE image on it, inside the commit message. You can find many different examples in commit history.
Cheers,
Piotr
There was a problem hiding this comment.
This will be misleading for the user as this LED is already set for status in diag.sh. Please, drop this line.
There was a problem hiding this comment.
Please, keep boards in alphabetical order here.
There was a problem hiding this comment.
Please, keep boards in alphabetical order here.
There was a problem hiding this comment.
Please, keep boards in alphabetical order here (hc5*61 should be first).
target/linux/ramips/dts/HC5962.dts
Outdated
target/linux/ramips/dts/HC5962.dts
Outdated
target/linux/ramips/image/mt7621.mk
Outdated
There was a problem hiding this comment.
Please, keep all boards in alphabetical order here.
target/linux/ramips/image/mt7621.mk
Outdated
target/linux/ramips/image/mt7621.mk
Outdated
target/linux/ramips/image/mt7621.mk
Outdated
mkresin
left a comment
There was a problem hiding this comment.
Please use git commit --amend to add changes to your commit. Use git push --force to overwrite your github repository/branch. The PR will afterwards update automatically.
There was a problem hiding this comment.
Any specific reason why you switch the LED to on here? If not, drop it.
|
|
||
| #include "mt7621.dtsi" | ||
|
|
||
| #include <dt-bindings/input/input.h> |
There was a problem hiding this comment.
Please include <dt-bindings/gpio/gpio.h> here as well and keep alphabetical order..
Use the GPIO_ACTIVE_LOW and GPIO_ACTIVE_HIGH macros afterwards in stead of 1 and 0 in the gpio parameters.
Check the recent ramips board additions for examples.
target/linux/ramips/dts/HC5962.dts
Outdated
There was a problem hiding this comment.
Drop this node. the spi node is disabled by default in mt7621.dtsi.
target/linux/ramips/dts/HC5962.dts
Outdated
There was a problem hiding this comment.
Something is wrong here. The firmware and the kernel partition are having the same start address. Drop the firmware partition, you are having already the ubi partition.
target/linux/ramips/image/mt7621.mk
Outdated
There was a problem hiding this comment.
Drop this line and add the following instead:
IMAGE_SIZE := $(ralink_default_fw_size_32M)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
That should create the correct image format for sysupgrade.
If the sysupgrade.bin you created is intended for the first installation of LEDE (maybe via bootloader) use the following:
IMAGE_SIZE := $(ralink_default_fw_size_32M)
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
Edit:
You need to add your board to the platform_pre_upgrade() function in target/linux/ramips/base-files/lib/upgrade/platform.sh to actually do the nand specific update.
There was a problem hiding this comment.
all corrected.Thanks for you help!
target/linux/ramips/image/mt7621.mk
Outdated
There was a problem hiding this comment.
You add "kmod-usb-ledtrig-usbport" module, but you not defined any led as usbport.
target/linux/ramips/dts/HC5962.dts
Outdated
| label = "hc5962:white:status"; | ||
| gpios = <&gpio0 6 0>; | ||
| }; | ||
|
|
target/linux/ramips/dts/HC5962.dts
Outdated
target/linux/ramips/dts/HC5962.dts
Outdated
target/linux/ramips/dts/HC5962.dts
Outdated
target/linux/ramips/dts/HC5962.dts
Outdated
target/linux/ramips/dts/HC5962.dts
Outdated
target/linux/ramips/dts/HC5962.dts
Outdated
|
good advice |
|
Thanks a lot for the review and comments. ^^ |
mkresin
left a comment
There was a problem hiding this comment.
Please add a comment with a serial log which shows:
- the boot of the OEM firmware
- the switch to LEDE from the OEM software
- the LEDE boot
- sysupgrade lede-ramips-mt7621-hc5962-sysupgrade.bin
This way we can ensure that at least the basic stuff is tested.
| local board=$(ramips_board_name) | ||
|
|
||
| case "$board" in | ||
| ubnt-erx) |
There was a problem hiding this comment.
Please restore the former indentation!
There was a problem hiding this comment.
I'm quite sure the sysupgrade will fail at this point since your sysupgrade image doesn't start with the uImage magic 0x27051956.
The whole image header validation isn't required for the hc5962 since a validation based on the metadata will be done. Please add a new block for the hc5962 containing:
hc5962)
# these boards use metadata images
return 0
;;There was a problem hiding this comment.
What is the purpose of this blinking LED? I guess this can be removed, right?
There was a problem hiding this comment.
But you are already using status_led in /etc/diag.sh for this. Default behavior of status_led is to blink during system boot up process and stay on when system is booted.
There was a problem hiding this comment.
when system boot, its red light blink, after booted, become white light blink.
There was a problem hiding this comment.
Please, use then only the white LED for status_led in /etc/diag.sh instead of the red one and don't add anything else in /etc/board.d/01_leds. Using red LED could be misleading as this color is usually used to indicate some error and/or problem.
We have a common/general approach over whole code, for all targets, for status LED and there is no need to reproduce vendor firmware approach here.
Thanks!
There was a problem hiding this comment.
Nice. Thanks! That explains a lot! I'll do that.
target/linux/ramips/dts/HC5962.dts
Outdated
There was a problem hiding this comment.
drop this partition. it has still the same start address on flash (0x140000) as the kernel partition. For NAND board you don't need a firmware partition.
There was a problem hiding this comment.
Sorry, I just found it submission failed, is now complete.
| reg = <0x340000 0x1E00000>; | ||
| }; | ||
|
|
||
| partition@2140000 { |
There was a problem hiding this comment.
If this partition is required to revert to the OEM firmware, mark the partition as read-only. If this partition is not required, drop the node and use the extra space for the ubi partition.
|
With your latest changes you broke the sysupgrade again. Have you tested the sysupgrade with your latest changes? You dropped the following requested changes with your last push:
It is not necessary to do the nand_do_platform_check for the hc5962, since the validation is done via metadata. It was fine the way it was before your last change. You have just added to much in indentation. |
|
@mkresin Please forgive my ignorance. I have changed it as you suggested and has been tested. Thank you again for you time on this matter. |
|
Look really good to me. One last remark. In the ethernet node of the DTS you read the mac address as hex values from the factory partition. But later in the boot process you replace this mac address with the ASCII values read from the bdinfo partition ( In your bootlog the following can be seen: Not sure about this, but could it be that something is wrong with the EEPROM of the mt76@1,0 ( |
This patch adds supports for the HiWiFi HC5962(gee4) http://www.hiwifi.com Short specification: - MT7621AT + MT7612EN + 7603EN - 256MB DDR3 RAM - 128MB NAND flash - 1+3 x 1000M Ethernet - 1x USB 2.0 port. 1x USB 3.0 port. - reset button - UART pad on PCB (JP3: TX, RX, GND, 3.3V) Flash instruction: 1, Download lede-ramips-mt7621-hc5962-squashfs-factory.bin 2, Login as root via SSH on 192.168.199.1 and then copy factory.bin(using wget or nc or...) to /tmp/ 3, use the following commands: $ mtd write /tmp/lede-ramips-mt7621-hc5962-squashfs-factory.bin firmware $ mtd erase firmware_backup && reboot After reboot you should be able to login as root via SSH on 192.168.1.1 Signed-off-by: ZengFei Zhang <zhangzengfei@kunteng.org>
|
Yes, mkresin, you are right, I adjusted the reading position of the eeprom, Now it works very well, Signal is stable and reliable. In addition, HiWiFi use bdinfo parition to save MAC address, The ethernet node of the DTS have since been deleted. Thanks! Full log: |
|
Merged! Thanks for the PR and thanks a lot to all reviewers. |
|
#for usr 2.0: |



This patch adds supports for the HiWiFi HC5962(gee4) http://www.hiwifi.com
Short specification:
Flash instruction:
$ mtd write /tmp/lede-ramips-mt7621-hc5962-squashfs-factory.bin firmware
$ mtd erase firmware_backup && reboot
After reboot you should be able to login as root via SSH on 192.168.1.1
Signed-off-by: ZengFei Zhang zhangzengfei@kunteng.org