Tue Aug 21 08:45:17 2018 UTC ()
Correctly report memory size, not clock rate when VERBOSE_INIT_ARM.


(rin)
diff -r1.12 -r1.13 src/sys/arch/arm/broadcom/bcm283x_platform.c

cvs diff -r1.12 -r1.13 src/sys/arch/arm/broadcom/bcm283x_platform.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm283x_platform.c 2018/08/10 04:44:15 1.12
+++ src/sys/arch/arm/broadcom/bcm283x_platform.c 2018/08/21 08:45:17 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm283x_platform.c,v 1.12 2018/08/10 04:44:15 rin Exp $ */ 1/* $NetBSD: bcm283x_platform.c,v 1.13 2018/08/21 08:45:17 rin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.12 2018/08/10 04:44:15 rin Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.13 2018/08/21 08:45:17 rin Exp $");
31 31
32#include "opt_arm_debug.h" 32#include "opt_arm_debug.h"
33#include "opt_bcm283x.h" 33#include "opt_bcm283x.h"
34#include "opt_cpuoptions.h" 34#include "opt_cpuoptions.h"
35#include "opt_ddb.h" 35#include "opt_ddb.h"
36#include "opt_evbarm_boardtype.h" 36#include "opt_evbarm_boardtype.h"
37#include "opt_kgdb.h" 37#include "opt_kgdb.h"
38#include "opt_fdt.h" 38#include "opt_fdt.h"
39#include "opt_rpi.h" 39#include "opt_rpi.h"
40#include "opt_vcprop.h" 40#include "opt_vcprop.h"
41 41
42#include "sdhc.h" 42#include "sdhc.h"
43#include "bcmsdhost.h" 43#include "bcmsdhost.h"
@@ -653,30 +653,29 @@ bcm283x_bootparams(bus_space_tag_t iot,  @@ -653,30 +653,29 @@ bcm283x_bootparams(bus_space_tag_t iot,
653 for (int i = 0; i < n && i < DRAM_BLOCKS; i++) { 653 for (int i = 0; i < n && i < DRAM_BLOCKS; i++) {
654 bootconfig.dram[i].address = vptp_mem->mem[i].base; 654 bootconfig.dram[i].address = vptp_mem->mem[i].base;
655 bootconfig.dram[i].pages = atop(vptp_mem->mem[i].size); 655 bootconfig.dram[i].pages = atop(vptp_mem->mem[i].size);
656 bootconfig.dramblocks++; 656 bootconfig.dramblocks++;
657 657
658 bcm283x_memorysize += vptp_mem->mem[i].size; 658 bcm283x_memorysize += vptp_mem->mem[i].size;
659 } 659 }
660 } 660 }
661 661
662 if (vcprop_tag_success_p(&vb.vbt_armclockrate.tag)) 662 if (vcprop_tag_success_p(&vb.vbt_armclockrate.tag))
663 curcpu()->ci_data.cpu_cc_freq = vb.vbt_armclockrate.rate; 663 curcpu()->ci_data.cpu_cc_freq = vb.vbt_armclockrate.rate;
664 664
665#ifdef VERBOSE_INIT_ARM 665#ifdef VERBOSE_INIT_ARM
666 if (vcprop_tag_success_p(&vb.vbt_memory.tag)) { 666 if (vcprop_tag_success_p(&vb.vbt_memory.tag))
667 printf("%s: memory size %d\n", __func__, 667 printf("%s: memory size %zu\n", __func__,
668 vb.vbt_armclockrate.rate); 668 bcm283x_memorysize);
669 } 
670 if (vcprop_tag_success_p(&vb.vbt_armclockrate.tag)) 669 if (vcprop_tag_success_p(&vb.vbt_armclockrate.tag))
671 printf("%s: arm clock %d\n", __func__, 670 printf("%s: arm clock %d\n", __func__,
672 vb.vbt_armclockrate.rate); 671 vb.vbt_armclockrate.rate);
673 if (vcprop_tag_success_p(&vb.vbt_fwrev.tag)) 672 if (vcprop_tag_success_p(&vb.vbt_fwrev.tag))
674 printf("%s: firmware rev %x\n", __func__, 673 printf("%s: firmware rev %x\n", __func__,
675 vb.vbt_fwrev.rev); 674 vb.vbt_fwrev.rev);
676 if (vcprop_tag_success_p(&vb.vbt_boardmodel.tag)) 675 if (vcprop_tag_success_p(&vb.vbt_boardmodel.tag))
677 printf("%s: board model %x\n", __func__, 676 printf("%s: board model %x\n", __func__,
678 vb.vbt_boardmodel.model); 677 vb.vbt_boardmodel.model);
679 if (vcprop_tag_success_p(&vb.vbt_macaddr.tag)) 678 if (vcprop_tag_success_p(&vb.vbt_macaddr.tag))
680 printf("%s: mac-address %" PRIx64 "\n", __func__, 679 printf("%s: mac-address %" PRIx64 "\n", __func__,
681 vb.vbt_macaddr.addr); 680 vb.vbt_macaddr.addr);
682 if (vcprop_tag_success_p(&vb.vbt_boardrev.tag)) 681 if (vcprop_tag_success_p(&vb.vbt_boardrev.tag))