Print CPU informtion later in boot.

Match other architectures and print CPU information during
cpu_startup().  In particular, this prints the information after the
message buffer is initialized which allows it to be retrieved after
boot via dmesg(8).

While here, add some extern declarations to <machine/md_var.h> in
place of duplicated declarations in various source files.

Reviewed by:	brooks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24936
This commit is contained in:
John Baldwin 2020-05-20 21:16:54 +00:00
parent 6adcdf6577
commit 2aa1dc7e3b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361297
7 changed files with 8 additions and 15 deletions

View File

@ -148,8 +148,6 @@ SYSCTL_STRING(_hw_device, OID_AUTO, revision, CTLFLAG_RD, hw_device_revision, 0,
"Board revision");
#endif
extern char cpu_model[];
void
platform_start(__register_t a0 __unused, __register_t a1 __unused,
__register_t a2 __unused, __register_t a3 __unused)

View File

@ -275,8 +275,6 @@ ar71xx_platform_check_mac_hints(void)
return (0);
}
extern char cpu_model[];
void
platform_start(__register_t a0 __unused, __register_t a1 __unused,
__register_t a2 __unused, __register_t a3 __unused)

View File

@ -97,8 +97,6 @@ struct octeon_feature_description {
};
extern int *end;
extern char cpu_model[];
extern char cpu_board[];
static char octeon_kenv[0x2000];
static const struct octeon_feature_description octeon_feature_descriptions[] = {

View File

@ -42,6 +42,8 @@
* Miscellaneous machine-dependent declarations.
*/
extern long Maxmem;
extern char cpu_board[];
extern char cpu_model[];
extern char sigcode[];
extern int szsigcode;
#if defined(__mips_n32) || defined(__mips_n64)
@ -75,6 +77,7 @@ void mips_cpu_init(void);
void mips_pcpu0_init(void);
void mips_proc0_init(void);
void mips_postboot_fixup(void);
void cpu_identify(void);
void cpu_switch_set_userlocal(void) __asm(__STRING(cpu_switch_set_userlocal));
extern int busdma_swi_pending;

View File

@ -396,8 +396,6 @@ mtk_soc_try_early_detect(void)
bus_space_unmap(bst, bsh, MTK_DEFAULT_SIZE);
}
extern char cpu_model[];
void
mtk_soc_set_cpu_model(void)
{

View File

@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$");
#include <contrib/octeon-sdk/octeon-model.h>
#endif
static void cpu_identify(void);
struct mips_cpuinfo cpuinfo;
#define _ENCODE_INSN(a,b,c,d,e) \
@ -294,18 +292,16 @@ mips_cpu_init(void)
mips_icache_sync_all();
mips_dcache_wbinv_all();
/* Print some info about CPU */
cpu_identify();
}
static void
void
cpu_identify(void)
{
uint32_t cfg0, cfg1, cfg2, cfg3;
#if defined(CPU_MIPS1004K) || defined (CPU_MIPS74K) || defined (CPU_MIPS24K)
uint32_t cfg7;
#endif
printf("cpu%d: ", 0); /* XXX per-cpu */
printf("CPU: ");
switch (cpuinfo.cpu_vendor) {
case MIPS_PRID_CID_MTI:
printf("MIPS Technologies");
@ -347,6 +343,8 @@ cpu_identify(void)
printf("Unknown cid %#x", cpuinfo.cpu_vendor);
break;
}
if (cpu_model[0] != '\0')
printf(" (%s)", cpu_model);
printf(" processor v%d.%d\n", cpuinfo.cpu_rev, cpuinfo.cpu_impl);
printf(" MMU: ");

View File

@ -185,7 +185,7 @@ cpu_startup(void *dummy)
if (boothowto & RB_VERBOSE)
bootverbose++;
printf("CPU model: %s\n", cpu_model);
cpu_identify();
printf("real memory = %ju (%juK bytes)\n", ptoa((uintmax_t)realmem),
ptoa((uintmax_t)realmem) / 1024);