Skip to content

clk: mediatek: mt6589: msdcpll_208m is msdcpll / 2, not / 8 - #89

Merged
akku1139 merged 2 commits into
blade/v7.1from
clk-mt6589-msdcpll-208m
Oct 31, 2026
Merged

akku1139 merged 2 commits into
blade/v7.1from
clk-mt6589-msdcpll-208m

Conversation

@trudenboy

@trudenboy trudenboy commented Oct 28, 2026 •

Copy link
Copy Markdown

msdcpll_208m is FACTOR(..., "msdcpll", 1, 8) in this tree. The MSDC source tap of MSDCPLL is the VCO divided by 8, taken before the /4 post divider. msdcpll already includes that post divider (390 MHz here), so the tap is msdcpll / 2 = 195 MHz, not msdcpll / 8 = 48.75 MHz.

With 1/8 the clock framework believes every MSDC source runs at a quarter of its real rate. mtk-sd then picks dividers that run each bus about 4x faster than requested. On our tablet the eMMC asked for 24 MHz ran at about 97 MHz. That explained our eMMC and SDIO data CRC errors, and it may be the 200 MHz MSDC instability you mentioned. The clock summary before the change (msdcpll 390000000, msdcpll_208m 48750000) is in docs/msdc-live-regs-2026-09-27.txt.

This assumes the /4 post divider that LK programs and the kernel does not change; with another post divider the factor would differ. The name 208m comes from a 1664 MHz VCO (VCO/8 = 208 MHz); LK runs the VCO at 1560 MHz, hence 195 MHz.

Only the clock is changed here. The MSDC3 SDIO pins and supply for the MT6628 belong with the B8000-H MT6628 nodes, once the binding is in this branch.

Tested: Lenovo B8000-H (MT8389). Our kernels have carried this since 27 Sep 2026, with the eMMC root and the MT6628 Wi-Fi on MSDC3 in daily use. Rebased from our tree (blade/v7.1 @ 7dd2454 + our patches) and build-tested on current blade/v7.1; not yet booted on this base. You planned to test it at 200 MHz yourself; that is the check I can't do here, since our eMMC runs at 50 MHz and our SDIO at 25 MHz.

Assisted-by: Claude:claude-opus-5-5

The MSDC source tap of MSDCPLL is the VCO divided by 8, taken before
the /4 post divider. "msdcpll" (390 MHz here) already includes that post
divider, so the tap is msdcpll / 2 (195 MHz), not msdcpll / 8
(48.75 MHz).

With 1/8 the clock framework believed every MSDC source ran at a quarter
of its real rate, so mtk-sd chose dividers that ran each bus about four
times faster than requested. The eMMC asked for 24 MHz ran at about
97 MHz. That explains the data CRC errors on the eMMC and on the SDIO
bus of the MT6628.

Tested on the Lenovo B8000-H (MT8389). The clock summary before the
change showed msdcpll at 390000000 and msdcpll_208m at 48750000. Since
27 Sep 2026 our kernels have carried this change, with the eMMC root
and the MT6628 Wi-Fi on MSDC3 (SDIO) in daily use.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Mikhail Nevskiy <trudenboy0@gmail.com>
@akku1139

Copy link
Copy Markdown
Member
==> /sys/kernel/debug/clk/msdcpll_208m/clk_rate <==
48750000

#21 (comment)

==> /sys/kernel/debug/clk/msdcpll_208m/clk_rate <==
195000000

#21 (comment)

Root cause was fixed in dev branch (with bug factor refactor)
Clock enhancement of dev branch cannot be merged yet, so it seems okay to merge it fow now.

@akku1139

Copy link
Copy Markdown
Member

fix: 85c8f8f

fix other divs based on it for now

based on 85c8f8f

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
@akku1139
akku1139 merged commit d464074 into blade/v7.1 Oct 31, 2026
2 of 3 checks passed
@akku1139
akku1139 deleted the clk-mt6589-msdcpll-208m branch October 31, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants