Bug 251615 - mips/mediatek: Kernel fails to build on Mediatek MT7628: error: use of undeclared identifier 'cpu_model'
Summary: mips/mediatek: Kernel fails to build on Mediatek MT7628: error: use of undecl...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: mips Any
: --- Affects Some People
Assignee: Bugmeister
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-12-05 19:55 UTC by Priit Trees
Modified: 2023-10-22 15:01 UTC (History)
2 users (show)

See Also:


Attachments
My patch for medatek mt76x8 (3.19 KB, patch)
2020-12-05 19:55 UTC, Priit Trees
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Priit Trees 2020-12-05 19:55:56 UTC
Created attachment 220290 [details]
My patch for medatek mt76x8

I compile Medaitek MT7688 kernel. I get three errors.

First error:
/src/sys/mips/mediatek/mtk_soc.c:415:3: error: use of undeclared identifier 'cpu_model'
                cpu_model[idx] = chipid0_3[idx];
                ^
/src/sys/mips/mediatek/mtk_soc.c:416:3: error: use of undeclared identifier 'cpu_model'
                cpu_model[idx + offset] = chipid4_7[idx];
                ^
/src/sys/mips/mediatek/mtk_soc.c:420:2: error: use of undeclared identifier 'cpu_model'
        cpu_model[2 * offset] = 0;
        ^

Second error:
/src/sys/mips/mediatek/mtk_clock.c:126:39: error: variable 'mask' is uninitialized when used here [-Werror,-Wuninitialized]
        if (mtk_sysctl_get(SYSCTL_CLKCFG1) & mask)
                                             ^~~~
/src/sys/mips/mediatek/mtk_clock.c:121:15: note: initialize the variable 'mask' to silence this warning
        uint32_t mask;
                     ^
                      = 0

Third error:
/src/sys/dev/rt/if_rt.c:315:54: error: cast from 'char **' to 'const char **' must have all intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
            device_get_unit(dev), "macaddr", (const char **)&var)) {
                                                            ^


I patch the problems for me. Can somebody look the patch over and add it or make better solution.
Comment 1 John Baldwin freebsd_committer freebsd_triage 2021-05-13 00:38:36 UTC
On the surface these changes look ok to me.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2022-06-02 02:03:24 UTC
@John Is this OBE now with mips removal, or is there something we can do with the attached patch relevent in other components, or for other archs?
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2023-10-22 15:01:31 UTC
^Triage: close as Overcome By Events.

I'm sorry this PR never got looked at.  In the meantime, FreeBSD has dropped MIPS support, so there is nothing to do here.