Re: [PATCH 4/4] ARM: dts: qcom: msm8974: Add device tree for Samsung Galaxy S5 China

From: Rong Zhang
Date: Mon Jan 22 2024 - 13:13:39 EST


On Mon, 2024-01-22 at 11:50 +0100, Konrad Dybcio wrote:
> Looks like you didn't change the brcm,board-type though?

In "[PATCH 2/4] ARM: dts: qcom: msm8974-samsung-klte: Pin brcm,board-
type in wifi":

/*
* This aims to allow other klte* variants to load the same firmware,
* as klte variants have little differences in the wifi part.
*/

So it is intentional, in order to let them share the same FW, in
particular, the NVRAM file.

Without [PATCH 2/4] and with this [PATCH 4/4]:
- klte DT probes "brcmfmac*.samsung,klte.txt"
- kltechn DT probes "brcmfmac*.samsung,kltechn.txt", but never probes
"brcmfmac*.samsung,klte.txt"

With both [PATCH 2/4] and this [PATCH 4/4]:
- klte DT probes "brcmfmac*.samsung,klte.txt"
- kltechn DT probes "brcmfmac*.samsung,klte.txt"

I pinned "brcm,board-type" in the klte DT instead of the kltechn one
because other klte* variants are known to have little difference in the
WiFi part. By pinning it in the klte DT, future ports could be easier.

If you'd prefer not doing this, I am OK to drop [PATCH 2/4] in the v2
patchset.

FYI:

LineageOS considers all klte variants use "common" WiFi FW:
https://github.com/search?q=repo%3ALineageOS%2Fandroid_kernel_samsung_klte+CONFIG_BCMDHD_NVRAM_PATH&type=code
https://github.com/LineageOS/android_device_samsung_klte-common/blob/8f71a63415397def5ba886f4030b0d91e2253262/common-proprietary-files.txt#L251

I've tested the klte port of PostmarketOS (with klte FW and this
patchset) on kltechn, and it worked fine. For the FW used by
PostmarketOS, see also:
https://gitlab.com/postmarketOS/pmaports/-/blob/439227770ffcd32eb7e26436598c804dc35637ad/device/testing/firmware-samsung-klte/APKBUILD#L17


> > +++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-samsung-kltechn.dts
> > @@ -0,0 +1,16 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +#include "qcom-msm8974pro-samsung-klte.dts"
>
> It's customary not to include .dts files, instead split the common parts
> into e.g. qcom-msm8974pro-samsung-klte-common.dtsi and include this in
> both the existing and the new one.

At the very beginning, I thought including .dts could make the patchset
tiny (considering that the difference among klte* is also tiny).

I agree that splitting the common parts into a .dtsi will make things
more elegant and make klte* DTs consistent with the style of qcom DTs.

Will do in v2. Thanks for your advice.

Thanks,
Rong