CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2015-07-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 17 20:32:27 UTC 2015

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c

Log Message:
Deal with  1GB of memory.


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.3 -r1.7.4.4 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.4
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3	Wed Mar 26 02:15:02 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Fri Jul 17 20:32:27 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.4 2015/07/17 20:32:27 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.7.4.4 2015/07/17 20:32:27 matt Exp $);
 
 #include opt_evbarm_boardtype.h
 #include opt_broadcom.h
@@ -258,6 +258,20 @@ initarm(void *arg)
 #endif
 	const bool bigmem_p = (memsize  PGSHIFT)  bp_first256.bp_pages;
 
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+	const bool mapallmem_p = true;
+#ifndef PMAP_NEED_ALLOC_POOLPAGE
+	if (memsize  KERNEL_VM_BASE - KERNEL_BASE) {
+		printf(%s: dropping RAM size from %luMB to %uMB\n,
+		   __func__, (unsigned long) (ram_size  20),
+		   (KERNEL_VM_BASE - KERNEL_BASE)  20);
+		memsize = KERNEL_VM_BASE - KERNEL_BASE;
+	}
+#endif
+#else
+	const bool mapallmem_p = false;
+#endif
+	KASSERT((armreg_pfr1_read()  ARM_PFR1_SEC_MASK) != 0);
 	arm32_bootmem_init(KERN_VTOPHYS(KERNEL_BASE), memsize,
 	(paddr_t)KERNEL_BASE_phys);
 
@@ -273,7 +287,8 @@ initarm(void *arg)
 	 * abtstack, undstack, kernelstack, msgbufphys will be set to point to
 	 * the memory that was allocated for them.
 	 */
-	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap, true);
+	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap,
+	mapallmem_p);
 
 	cpu_reset_address = bcm53xx_system_reset;
 	/* we've a specific device_register routine */



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2015-07-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 17 20:32:27 UTC 2015

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c

Log Message:
Deal with  1GB of memory.


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.3 -r1.7.4.4 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:15:02 UTC 2014

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c

Log Message:
Use apb/4 for the com freq on !BCM5301X


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.2 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.2	Sat Feb 15 16:18:37 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Wed Mar 26 02:15:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.2 2014/02/15 16:18:37 matt Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.7.4.2 2014/02/15 16:18:37 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $);
 
 #include opt_evbarm_boardtype.h
 #include opt_broadcom.h
@@ -330,14 +330,20 @@ consinit(void)
 	/*
 	 * Switch to the reference clock
 	 */
+#ifdef BCM5301X
+	const int comfreq = BCM53XX_REF_CLK;
 	v = bus_space_read_4(bcm53xx_ioreg_bst, bcm53xx_ioreg_bsh,
 	CCA_MISC_BASE + MISC_CORECTL);
 	v = ~CORECTL_UART_CLK_OVERRIDE;
 	bus_space_write_4(bcm53xx_ioreg_bst, bcm53xx_ioreg_bsh,
 	CCA_MISC_BASE + MISC_CORECTL, v);
+#else
+	const struct cpu_softc * const cpu = curcpu()-ci_softc;
+	const int comfreq = cpu-cpu_clk.clk_apb / 4;
+#endif
 
 if (comcnattach(bcm53xx_ioreg_bst, comcnaddr, comcnspeed,
-BCM53XX_REF_CLK, COM_TYPE_NORMAL, comcnmode))
+comfreq, COM_TYPE_NORMAL, comcnmode))
 panic(Serial console can not be initialized.);
 }
 



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:16:05 UTC 2014

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_start.S

Log Message:
Use adr/bfi to access kernel variables.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.2 -r1.10.2.3 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.10.2.2 src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.10.2.3
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.10.2.2	Sat Feb 15 16:18:37 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S	Wed Mar 26 02:16:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_start.S,v 1.10.2.2 2014/02/15 16:18:37 matt Exp $	*/
+/*	$NetBSD: bcm53xx_start.S,v 1.10.2.3 2014/03/26 02:16:05 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -45,7 +45,7 @@
 #define	CONADDR		0x18000300
 #endif
 
-RCSID($NetBSD: bcm53xx_start.S,v 1.10.2.2 2014/02/15 16:18:37 matt Exp $)
+RCSID($NetBSD: bcm53xx_start.S,v 1.10.2.3 2014/03/26 02:16:05 matt Exp $)
 
 #undef VERBOSE_INIT_ARM
 #define VERBOSE_INIT_ARM
@@ -74,10 +74,14 @@ _C_LABEL(bcm53xx_start):
 	/*
 	 * Save any arguments u-boot passed us.
 	 */
-	ldr	r4, .Luboot_args_pic0
-	add	r4, r4, pc
+#ifdef KERNEL_BASES_EQUAL
+	ldr	r4, .Luboot_args
+#else
+	adr	r4, bcm53xx_start
+	ldr	r5, .Luboot_args
+	bfi	r4, r5, #0, #28
+#endif
 	stmia	r4, {r0-r3}
-.LPIC0:
 
 	/*
 	 * Let's turn on the CCA watchdog in case something goes horribly wrong.
@@ -121,15 +125,6 @@ _C_LABEL(bcm53xx_start):
 
 	XPUTC(#89)
 
-	ldr	r0, .Luboot_args
-	ldr	r2, [r0]
-	ldr	r1, .Luboot_args_pic1
-	add	r1, r1, pc
-	ldr	r1, [r1]
-.LPIC1:
-	cmp	r1, r2
-1:	bne	1b
-
 	XPUTC(#90)
 
 	/*
@@ -153,10 +148,6 @@ _C_LABEL(bcm53xx_start):
 	nop
 
 	/* NOTREACHED */
-.Luboot_args_pic0:
-	.word	uboot_args - .LPIC0
-.Luboot_args_pic1:
-	.word	uboot_args - .LPIC0
 .Luboot_args:
 	.word	uboot_args
 .Lstart:



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:15:02 UTC 2014

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c

Log Message:
Use apb/4 for the com freq on !BCM5301X


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:16:05 UTC 2014

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_start.S

Log Message:
Use adr/bfi to access kernel variables.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.2 -r1.10.2.3 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.