diff options
author | Warner Losh <imp@FreeBSD.org> | 2011-01-17 23:03:09 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2011-01-17 23:03:09 +0000 |
commit | f381c26847201b3ed8e47170a18a3340c820e732 (patch) | |
tree | 6129c6a646b72df3a0ff5db98ccad58e254dc2a9 /sys | |
parent | 5d8f773b87e1f9c5a4626d04948dca93164303d7 (diff) | |
download | src-f381c26847201b3ed8e47170a18a3340c820e732.tar.gz src-f381c26847201b3ed8e47170a18a3340c820e732.zip |
Save the CPU model, the board and the CPU clock rate so they are reported by
the approrpiate sysctl.
Notes
Notes:
svn path=/head/; revision=217518
Diffstat (limited to 'sys')
-rw-r--r-- | sys/mips/cavium/octeon_machdep.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sys/mips/cavium/octeon_machdep.c b/sys/mips/cavium/octeon_machdep.c index 43b9669abd27..0de5a468d9be 100644 --- a/sys/mips/cavium/octeon_machdep.c +++ b/sys/mips/cavium/octeon_machdep.c @@ -92,6 +92,8 @@ struct octeon_feature_description { extern int *edata; extern int *end; +extern char cpu_model[]; +extern char cpu_board[]; static const struct octeon_feature_description octeon_feature_descriptions[] = { { OCTEON_FEATURE_SAAD, "SAAD" }, @@ -384,14 +386,12 @@ platform_start(__register_t a0, __register_t a1, __register_t a2 __unused, if (boothowto & RB_KDB) kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); #endif - platform_counter_freq = cvmx_sysinfo_get()->cpu_clock_hz; - - octeon_timecounter.tc_frequency = cvmx_sysinfo_get()->cpu_clock_hz; + cpu_clock = cvmx_sysinfo_get()->cpu_clock_hz; + platform_counter_freq = cpu_clock; + octeon_timecounter.tc_frequency = cpu_clock; platform_timecounter = &octeon_timecounter; - mips_timer_init_params(platform_counter_freq, 0); - - set_cputicker(octeon_get_ticks, cvmx_sysinfo_get()->cpu_clock_hz, 0); + set_cputicker(octeon_get_ticks, cpu_clock, 0); #ifdef SMP /* @@ -610,13 +610,20 @@ octeon_boot_params_init(register_t ptr) octeon_bootinfo->mac_addr_count); #if defined(OCTEON_BOARD_CAPK_0100ND) - if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) + strcpy(cpu_board, "CAPK-0100ND"); + if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) { printf("Compiled for CAPK-0100ND, but board type is %s\n", cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); + strcat(cpu_board, " hardwired, but type is "); + strcat(cpu_board, + cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); + } #else - printf("Board: %s\n", + strcpy(cpu_board, cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); + printf("Board: %s\n", cpu_board); #endif - printf("Model: %s\n", octeon_model_get_string(cvmx_get_proc_id())); + strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id())); + printf("Model: %s\n", cpu_model); } /* impEND: This stuff should move back into the Cavium SDK */ |