FreeBSD Bugzilla – Attachment 220290 Details for
Bug 251615
mips/mediatek: Kernel fails to build on Mediatek MT7628: error: use of undeclared identifier 'cpu_model'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
My patch for medatek mt76x8
mediatek_mt76x8.patch (text/plain), 3.19 KB, created by
Priit Trees
on 2020-12-05 19:55:56 UTC
(
hide
)
Description:
My patch for medatek mt76x8
Filename:
MIME Type:
Creator:
Priit Trees
Created:
2020-12-05 19:55:56 UTC
Size:
3.19 KB
patch
obsolete
>Index: sys/dev/rt/if_rt.c >=================================================================== >--- sys/dev/rt/if_rt.c (revision 368344) >+++ sys/dev/rt/if_rt.c (working copy) >@@ -288,7 +288,7 @@ > static int > ether_request_mac(device_t dev, uint8_t *mac) > { >- char *var; >+ const char *var; > > /* > * "ethaddr" is passed via envp on RedBoot platforms >@@ -312,7 +312,7 @@ > * hint.[dev].[unit].macaddr > */ > if (!resource_string_value(device_get_name(dev), >- device_get_unit(dev), "macaddr", (const char **)&var)) { >+ device_get_unit(dev), "macaddr", &var)) { > if(!macaddr_atoi(var, mac)) { > printf("%s: use %s macaddr from hints\n", > device_get_nameunit(dev), var); >Index: sys/mips/mediatek/mtk_clock.c >=================================================================== >--- sys/mips/mediatek/mtk_clock.c (revision 368344) >+++ sys/mips/mediatek/mtk_clock.c (working copy) >@@ -123,6 +123,8 @@ > if (index < 0 || index > 31 || info == NULL) > return (EINVAL); > >+ mask = (1u << index); >+ > if (mtk_sysctl_get(SYSCTL_CLKCFG1) & mask) > info->flags = FDT_CIFLAG_RUNNING; > else >Index: sys/mips/mediatek/mtk_machdep.c >=================================================================== >--- sys/mips/mediatek/mtk_machdep.c (revision 368344) >+++ sys/mips/mediatek/mtk_machdep.c (working copy) >@@ -258,6 +258,7 @@ > > printf("FDT DTB at: 0x%08x\n", (uint32_t)dtbp); > >+ printf("CPU model: %s\n", mtk_soc_get_cpu_model()); > printf("CPU clock: %4dMHz\n", mtk_soc_get_cpuclk()/(1000*1000)); > printf("Timer clock: %4dMHz\n", timer_clk/(1000*1000)); > printf("UART clock: %4dMHz\n\n", mtk_soc_get_uartclk()/(1000*1000)); >@@ -264,6 +265,8 @@ > > printf("U-Boot args (from %d args):\n", argc - 1); > >+ strcpy(cpu_model, mtk_soc_get_cpu_model()); >+ > if (argc == 1) > printf("\tNone\n"); > >Index: sys/mips/mediatek/mtk_soc.c >=================================================================== >--- sys/mips/mediatek/mtk_soc.c (revision 368344) >+++ sys/mips/mediatek/mtk_soc.c (working copy) >@@ -54,6 +54,7 @@ > > static uint32_t mtk_soc_chipid0_3 = MTK_UNKNOWN_CHIPID0_3; > static uint32_t mtk_soc_chipid4_7 = MTK_UNKNOWN_CHIPID4_7; >+static char mtk_soc_cpu_model[64]; > > static const struct ofw_compat_data compat_data[] = { > { "ralink,rt2880-soc", MTK_SOC_RT2880 }, >@@ -412,14 +413,20 @@ > * obtained for some reason. > */ > for (idx = 0; idx < offset; idx++) { >- cpu_model[idx] = chipid0_3[idx]; >- cpu_model[idx + offset] = chipid4_7[idx]; >+ mtk_soc_cpu_model[idx] = chipid0_3[idx]; >+ mtk_soc_cpu_model[idx + offset] = chipid4_7[idx]; > } > > /* Null-terminate the string */ >- cpu_model[2 * offset] = 0; >+ mtk_soc_cpu_model[2 * offset] = 0; > } > >+const char * >+mtk_soc_get_cpu_model(void) >+{ >+ return mtk_soc_cpu_model; >+} >+ > uint32_t > mtk_soc_get_uartclk(void) > { >Index: sys/mips/mediatek/mtk_soc.h >=================================================================== >--- sys/mips/mediatek/mtk_soc.h (revision 368344) >+++ sys/mips/mediatek/mtk_soc.h (working copy) >@@ -123,6 +123,7 @@ > > extern void mtk_soc_try_early_detect(void); > extern void mtk_soc_set_cpu_model(void); >+extern const char *mtk_soc_get_cpu_model(void); > extern uint32_t mtk_soc_get_uartclk(void); > extern uint32_t mtk_soc_get_cpuclk(void); > extern uint32_t mtk_soc_get_timerclk(void);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 251615
: 220290