Page MenuHomeFreeBSD

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

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




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

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

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.

Is bhnd_format_chip_id() usable here?

This revision now requires changes to proceed.Oct 21 2017, 7:10 PM

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.


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.


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 added inline comments.

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