From owner-svn-src-all@freebsd.org Wed May 20 21:16:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 588392F55E1; Wed, 20 May 2020 21:16:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5D81mjxz3Yt5; Wed, 20 May 2020 21:16:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 380FB22903; Wed, 20 May 2020 21:16:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLGtaC089683; Wed, 20 May 2020 21:16:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLGsdC089676; Wed, 20 May 2020 21:16:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202116.04KLGsdC089676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 21:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361297 - in head/sys/mips: atheros atheros/ar531x cavium include mediatek mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/mips: atheros atheros/ar531x cavium include mediatek mips X-SVN-Commit-Revision: 361297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 21:16:56 -0000 Author: jhb Date: Wed May 20 21:16:54 2020 New Revision: 361297 URL: https://svnweb.freebsd.org/changeset/base/361297 Log: 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 in place of duplicated declarations in various source files. Reviewed by: brooks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24936 Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/include/md_var.h head/sys/mips/mediatek/mtk_soc.c head/sys/mips/mips/cpu.c head/sys/mips/mips/machdep.c Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c ============================================================================== --- head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -148,8 +148,6 @@ SYSCTL_STRING(_hw_device, OID_AUTO, revision, CTLFLAG_ "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) Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/atheros/ar71xx_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -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) Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/cavium/octeon_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -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[] = { Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/include/md_var.h Wed May 20 21:16:54 2020 (r361297) @@ -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; Modified: head/sys/mips/mediatek/mtk_soc.c ============================================================================== --- head/sys/mips/mediatek/mtk_soc.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mediatek/mtk_soc.c Wed May 20 21:16:54 2020 (r361297) @@ -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) { Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mips/cpu.c Wed May 20 21:16:54 2020 (r361297) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include #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: "); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mips/machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -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);