Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcm53xx: Add initial support for PHICOMM K3 #1156

Closed
wants to merge 1 commit into from
Closed

bcm53xx: Add initial support for PHICOMM K3 #1156

wants to merge 1 commit into from

Conversation

reee
Copy link

@reee reee commented Jul 7, 2018

bcm53xx: Add initial support for PHICOMM K3

Specification:

  • System-On-Chip: Broadcom BCM4709C0
  • CPU/Speed: 1400 MHz
  • Flash-Chip: MXIC MX30LF1G18AC or SAMSUNG K9F1G08U0D
  • Flash size: 128 MiB
  • RAM: 512 MiB
  • 3xLAN speed: 10/100/1000Mpbs , 1xWAN speed: 10/100/1000Mbps
  • Wireless No1 (2T2R): BCM4366 4x4 MIMO 1000Mbps -- Skyworks SE2623L 2.4GHz Power Amplifier (x4)
  • Wireless No2 (2T2R): BCM4366 4x4 MIMO 2167Mbps -- RFMD RFPA5542 5GHz Power Amplifier Module (x4)
  • USB: 1x USB 3.0 port
  • 1x LED, 1x reset button, 1x power switch

The router has a small LCD and 3 capactive keys driven by a PIC microcontroller, which is in turn wired to UART1 of main board. The LCD and the keys is supported by the package phicommk3-screenctrl

The phicommk3-firmware package contains binary firmware from other router which is for the wireless chip, If it is not allowed by openwrt , we can drop it.

Flash instruction:

For firmware version: V21.4.31.212、V21.4.33.217、V21.5.37.246, You can flash a special rom made by Tian Hao haotia@gmail.com:lede-bcm53xx-phicomm-k3-squashfs-factory-20170504.bin
Link: https://pan.baidu.com/s/1slKzrFv Password: j1bm
Mirror: https://drive.google.com/open?id=1jBCiIRNCg3cjhEKYCwzOQFeXrT_iABhq
Then flash the rom we made.

For firmware greater than those versions ,say: V21.6.11.58, You have to downgrade the firmware first:
Manually flash this rom: K3_V21.6.11.58P Link Password: ksxp | Mirror
Then flash an old firmware, say K3_V21.5.37.246 Link Password: xmrh | Mirror

Other Flash method can refer to this site: http://omugxug28.bkt.clouddn.com/posts/0101-k3.html

Known Bugs:

  1. The wireless firmware is incompatible with the mac80211 patches backported from 4.17 4.18, The version 18.06 RC1 is ok
  2. We can not adjust the Transmit Power

The main work is done by Tian Hao haotia@gmail.com
And other works from ZhongLuFan lufanzhong@gmail.com and Leanv@mujj.us

Signed-off-by: Hong Zhang zong777@gmail.com

Signed-off-by: Hong Zhang <zong777@gmail.com>
Copy link
Member

@hauke hauke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to split this into multiple commit, one just adding the base device and then the others adding the extra features like the bcm4366C0 FW, and the screenctrl tool. The base support for the device looks good, the other parts could be a little bit problematic.

bool "K3"

config K3_WF_DHD24
bool "ASUS dhd24"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this a compile time option, I would prefer if you could create 4 opkg packages.
Why is the K3_WF_AC88U seletced as the default?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create 4 packages named like phicommk3-firmware-ea9500, then require one of theses package in the image makefile? I think I can test all of them and choose the best one to make just one package. What do you say?

define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=@TARGET_bcm53xx_DEVICE_phicomm-k3 +@BUSYBOX_CONFIG_ARPING +@KERNEL_DEVMEM +bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like the dependencies.
In the normal build done by build bot we will probably not have BUSYBOX_CONFIG_ARPING and KERNEL_DEVMEM activated.
I do not know this package in detail, has someone a better solution?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The k3screenctrl is came from @updateing Aka Tian Hao haotia@gmail.com , I will try to contact him for this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The screen is connected to second serial port on bcm53xx. However setting status to okay in DTS does not suffice in activating the port - we have to change several bits in DMU registers (code in Broadcom SDK and mine). I could not find any way to control the bits in DTS, so I chose to modify that via direct memory access, and thus KERNEL_DEVMEM.

arping is not required by k3screenctrl. Probably @Hill-98 knows it better?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He is not a coder either

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arping is the device I use to determine if the device connected to the router is online so that it is displayed on the fifth page of the screen. Specific actions: A shell script monitors the DHCP list every minute, then uses arping to test whether these devices can communicate, and if so, the device is online. I know this is a stupid way, I am not a professional developer, if you have a better way to replace it, or use the ping command, and do not need arping.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Associated file: /lib/k3screenctrldevice_online.sh

rm -f /etc/uci-defaults/k3screenctrl
fi
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are you doing here?
Please explain this in a comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is made by @Hill-98 aka ZhongLuFan lufanzhong@gmail.com , maybe we can refer to the origin work by updateing: https://github.com/updateing/k3screenctrl

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a stupid code, you can delete it, in fact it is dispensable.

@@ -244,6 +244,13 @@ define Device/linksys-ea9500
endef
# TARGET_DEVICES += linksys-ea9500

define Device/phicomm-k3
DEVICE_TITLE := PHICOMM K3
DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES) phicommk3-screenctrl phicommk3-firmware
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you should define something like this somewhere:

BRCMFMAC_4366C0 := $(IEEE8021X) kmod-brcmfmac phicommk3-firmware

Then phicommk3-firmware should have a more generic name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do this part.- -

@hauke hauke added the target/bcm53xx pull request/issue for bcm53xx target label Jul 7, 2018
@reee
Copy link
Author

reee commented Jul 9, 2018

@hauke How can i split this to two commit, git rebase then create a new one ? I'm not familiar with git. Actually I'm not a coder, I'm just a big fan of openwrt

@blogic
Copy link
Contributor

blogic commented Jul 30, 2018

@reee the bcm53xx maintainer does not use github. please post the patch to the mailing list if you would like to get it merged. Thanks !

@blogic blogic closed this Jul 30, 2018
@shenzt68
Copy link

适应最新的18.06补丁,大侠放出来啊?

@reee reee deleted the phicomm-k3 branch August 7, 2018 00:09
@ghost
Copy link

ghost commented Dec 9, 2018

@reee Hi, could you send this PR to Openwrt's mailing list: git.openwrt.org so that the merged Openwrt would officially support K3 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target/bcm53xx pull request/issue for bcm53xx target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants