MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mtk_soc_set_cpu_model

Function mtk_soc_set_cpu_model

freebsd/mips/mediatek/mtk_soc.c:399–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399void
400mtk_soc_set_cpu_model(void)
401{
402 int idx, offset = sizeof(mtk_soc_chipid0_3);
403 char *chipid0_3 = (char *)(&mtk_soc_chipid0_3);
404 char *chipid4_7 = (char *)(&mtk_soc_chipid4_7);
405
406 /*
407 * CHIPID is always 2x32 bit registers, containing the ASCII
408 * representation of the chip, so use that directly.
409 *
410 * The info is either pre-populated in mtk_soc_try_early_detect() or
411 * it is left at its default value of "unknown " if it could not be
412 * obtained for some reason.
413 */
414 for (idx = 0; idx < offset; idx++) {
415 cpu_model[idx] = chipid0_3[idx];
416 cpu_model[idx + offset] = chipid4_7[idx];
417 }
418
419 /* Null-terminate the string */
420 cpu_model[2 * offset] = 0;
421}
422
423uint32_t
424mtk_soc_get_uartclk(void)

Callers 1

platform_startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected