Page MenuHomeFreeBSD

[mips/broadcom] set sysctl "hw.model" by SoC ChipCommon ID
AcceptedPublic

Authored by mizhka on Oct 20 2017, 7:28 AM.

Details

Summary

Hi,

This is small patch to set "hw.model" by SoC ChipCommon ID. On BCM4718 it will be BCM4716, because 4716 is core for 4716,4717 & 4718.

It's useful in case of dmesg is already rotated, but you don't remember SoC model.

Test Plan

Tested on Netgear WNR3500L (BCM4718) and Asus RT-N53 (BCM5357).

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

mizhka created this revision.Oct 20 2017, 7:28 AM
This revision is now accepted and ready to land.Oct 21 2017, 11:41 AM
landonf requested changes to this revision.Oct 21 2017, 7:10 PM
landonf added inline comments.
sys/mips/broadcom/bcm_machdep.c
397

Is bhnd_format_chip_id() usable here?

This revision now requires changes to proceed.Oct 21 2017, 7:10 PM
mizhka added inline comments.Oct 21 2017, 7:27 PM
sys/mips/broadcom/bcm_machdep.c
397

This is broadcom machdep, so I don't want implicit dependence from kernel on BHND. Logic is simple and small, so copy-paste of code looks better than compile dependence. BTW, BHND can be loaded as module, so dependence is not good.

landonf added inline comments.Oct 21 2017, 7:43 PM
sys/mips/broadcom/bcm_machdep.c
397

FWIW, the kernel (via broadcom machdep) already have a number of hard dependencies on BHND for PMU/PWRCTL support, device enumeration, and NVRAM parsing support. It'd be rather difficult to separate the two without reproducing a lot of the bhnd(4) platform support code that is common across MIPS/ARM/Wi-Fi targets.

mizhka added inline comments.Oct 21 2017, 9:21 PM
sys/mips/broadcom/bcm_machdep.c
397

On DSL/cable platforms there is no BHND and CFE, but chipcommon is same. I agree that as of now there is hard points to avoid bhnd, but it may be worth to copy chipid printing suitable for all broadcom cases.

P.S. Small correction: DSL modems are CFE based, but there is no bcma here. AFAIK Old ones uses siba, but new ones are more FTD friendly. Cable modem has strangle bootloader, not CFE

landonf accepted this revision.Oct 26 2017, 6:51 PM
landonf added inline comments.
sys/mips/broadcom/bcm_machdep.c
397

Yeah, the DSL/Cable modems seem to be odd ducks. Later DSL and cable modem SoCs appear(ed) to use what Broadcom calls "ubus", which is seemingly nearly (but not quite) identical to BCMA. They seem to be moving away from that in the more recent ARM DSL/Cable SoCs? (I haven't investigated in significant detail).

I'd honestly still prefer using bhnd_format_chip_id here, but it doesn't seem worth sweating over.

This revision is now accepted and ready to land.Oct 26 2017, 6:51 PM