Bug 251615 - Mediatek MT7628 buildkernel failed
Summary: Mediatek MT7628 buildkernel failed
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: mips Any
: --- Affects Some People
Assignee: freebsd-mips (Nobody)
Depends on:
Reported: 2020-12-05 19:55 UTC by Priit Trees
Modified: 2021-05-13 00:38 UTC (History)
1 user (show)

See Also:

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.