CVS commit: src/sys/arch/evbarm/cubie

2014-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 28 06:36:48 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c cubie_start.S

Log Message:
pull in opt_arm_debug.h for VERBOSE_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/cubie/cubie_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.19 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.20
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.19	Thu May 15 17:05:15 2014
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Thu Aug 28 06:36:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.19 2014/05/15 17:05:15 matt Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.20 2014/08/28 06:36:48 skrll Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.19 2014/05/15 17:05:15 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.20 2014/08/28 06:36:48 skrll Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -134,6 +134,7 @@ __KERNEL_RCSID(0, $NetBSD: cubie_machde
 #include opt_md.h
 #include opt_com.h
 #include opt_allwinner.h
+#include opt_arm_debug.h
 
 #include com.h
 #include ukbd.h

Index: src/sys/arch/evbarm/cubie/cubie_start.S
diff -u src/sys/arch/evbarm/cubie/cubie_start.S:1.9 src/sys/arch/evbarm/cubie/cubie_start.S:1.10
--- src/sys/arch/evbarm/cubie/cubie_start.S:1.9	Fri Apr 18 06:53:13 2014
+++ src/sys/arch/evbarm/cubie/cubie_start.S	Thu Aug 28 06:36:48 2014
@@ -32,6 +32,7 @@
 #include opt_cpuoptions.h
 #include opt_cputypes.h
 #include opt_multiprocessor.h
+#include opt_arm_debug.h
 
 #include arm/asm.h
 #include arm/armreg.h
@@ -40,7 +41,7 @@
 #include arm/allwinner/awin_reg.h
 #include evbarm/cubie/platform.h  
 
-RCSID($NetBSD: cubie_start.S,v 1.9 2014/04/18 06:53:13 matt Exp $)
+RCSID($NetBSD: cubie_start.S,v 1.10 2014/08/28 06:36:48 skrll Exp $)
 
 #if defined(VERBOSE_INIT_ARM)
 #define	XPUTC(n)	mov r0, n; bl xputc



CVS commit: src/sys/arch/evbarm/cubie

2014-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 28 06:36:48 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c cubie_start.S

Log Message:
pull in opt_arm_debug.h for VERBOSE_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/cubie/cubie_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/cubie/cubie_start.S

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



CVS commit: src/sys/arch/evbarm/cubie

2014-05-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu May 15 17:05:16 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Don't access cbar on a cortex-a8


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.18 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.19
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.18	Sun Apr 20 10:06:08 2014
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Thu May 15 17:05:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.18 2014/04/20 10:06:08 martin Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.19 2014/05/15 17:05:15 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.18 2014/04/20 10:06:08 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.19 2014/05/15 17:05:15 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -342,7 +342,9 @@ initarm(void *arg)
 	printf(initarm: Configuring system ...\n);
 
 #if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA9) || defined(CPU_CORTEXA15)
-	printf(initarm: cbar=%#x\n, armreg_cbar_read());
+	if (!CPU_ID_CORTEX_A8_P(curcpu()-ci_arm_cpuid)) {
+		printf(initarm: cbar=%#x\n, armreg_cbar_read());
+	}
 #endif
 #endif
 



CVS commit: src/sys/arch/evbarm/cubie

2014-05-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu May 15 17:05:16 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Don't access cbar on a cortex-a8


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2014-04-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 20 10:06:08 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Fetch the ethernet address from u-boot boardinfo and provide it as mac-address
property for ethernet controllers.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2014-04-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Apr 18 06:53:13 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c cubie_start.S

Log Message:
Use KERNEL_BASE_VOFFSET.  s/bbs/bss
Move temp_l1_table to last 16KB before 128mb after kernel_base.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/cubie/cubie_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/cubie/cubie_start.S

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



CVS commit: src/sys/arch/evbarm/cubie

2014-03-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Mar 29 14:00:30 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c cubie_start.S

Log Message:
Properly powerup the 2nd CPU.  Other MP changes.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/cubie/cubie_machdep.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.14 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.15
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.14	Wed Feb 26 02:01:29 2014
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Sat Mar 29 14:00:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.14 2014/02/26 02:01:29 jmcneill Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.15 2014/03/29 14:00:30 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.14 2014/02/26 02:01:29 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.15 2014/03/29 14:00:30 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -203,10 +203,6 @@ uintptr_t uboot_args[4] = { 0 };
 extern char KERNEL_BASE_phys[];	/* physical start of kernel */
 extern char _end[];		/* physical end of kernel */
 
-#ifdef MULTIPROCESSOR
-extern uintptr_t cortex_mpfault[4];
-#endif
-
 #if NAWIN_FB  0
 #if NCOM  0
 int use_fb_console = false;
@@ -312,11 +308,6 @@ initarm(void *arg)
 #ifdef VERBOSE_INIT_ARM
 	printf(\nuboot arg = %#PRIxPTR, %#PRIxPTR, %#PRIxPTR, %#PRIxPTR\n,
 	uboot_args[0], uboot_args[1], uboot_args[2], uboot_args[3]);
-#ifdef MULTIPROCESSOR
-	printf(mpfault = %#PRIxPTR, %#PRIxPTR, %#PRIxPTR, %#PRIxPTR\n,
-	cortex_mpfault[0], cortex_mpfault[1], cortex_mpfault[2],
-	cortex_mpfault[3]);
-#endif
 #endif
 
 #ifdef KGDB

Index: src/sys/arch/evbarm/cubie/cubie_start.S
diff -u src/sys/arch/evbarm/cubie/cubie_start.S:1.6 src/sys/arch/evbarm/cubie/cubie_start.S:1.7
--- src/sys/arch/evbarm/cubie/cubie_start.S:1.6	Fri Feb 21 22:22:48 2014
+++ src/sys/arch/evbarm/cubie/cubie_start.S	Sat Mar 29 14:00:30 2014
@@ -40,7 +40,7 @@
 #include arm/allwinner/awin_reg.h
 #include evbarm/cubie/platform.h  
 
-RCSID($NetBSD: cubie_start.S,v 1.6 2014/02/21 22:22:48 matt Exp $)
+RCSID($NetBSD: cubie_start.S,v 1.7 2014/03/29 14:00:30 matt Exp $)
 
 #if defined(VERBOSE_INIT_ARM)
 #define	XPUTC(n)	mov r0, n; bl xputc
@@ -70,6 +70,7 @@ _C_LABEL(cubie_start):
 #ifdef __ARMEB__
 	setend	be			/* force big endian */
 #endif
+	mov	r9, #0
 
 	/* Move into supervisor mode and disable IRQs/FIQs. */
 	cpsid	if, #PSR_SVC32_MODE
@@ -88,25 +89,11 @@ _C_LABEL(cubie_start):
 	bfi	r4, r5, #0, #28
 
 	stmia	r4, {r0-r3}		// Save the arguments
+
 	/*
 	 * Turn on the SMP bit
 	 */
 	bl	cortex_init
-	XPUTC(#67)
-
-#if defined(MULTIPROCESSOR)  0
-	movw	r0, #:lower16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET)
-	movt	r0, #:upper16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET)
-
-	/* Set where the other CPU(s) are going to execute */
-	adr	r1, cortex_mpstart
-	str	r1, [r0, #AWIN_CPUCFG_PRIVATE_REG]
-
-	/* Bring CPU1 out of reset */
-	ldr	r1, [r0, #AWIN_CPUCFG_CPU1_RST_CTRL_REG]
-	orr	r1, r1, #(AWIN_CPUCFG_CPU_RST_CTRL_CORE_RESET|AWIN_CPUCFG_CPU_RST_CTRL_RESET)
-	str	r1, [r0, #AWIN_CPUCFG_CPU1_RST_CTRL_REG]
-#endif /* MULTIPROCESSOR */
 
 	/*
 	 * Set up a preliminary mapping in the MMU to allow us to run
@@ -114,9 +101,9 @@ _C_LABEL(cubie_start):
 	 */
 	movw	r0, #:lower16:TEMP_L1_TABLE
 	movt	r0, #:upper16:TEMP_L1_TABLE
-	adr	r1, .Lmmu_init_table
+	movw	r1, #:lower16:.Lmmu_init_table
+	movt	r1, #:upper16:.Lmmu_init_table
 	bl	arm_boot_l1pt_init
-
 	XPUTC(#68)
 
 	/*
@@ -127,6 +114,17 @@ _C_LABEL(cubie_start):
 	bl	arm_cpuinit
 
 	XPUTC(#90)
+
+#if defined(MULTIPROCESSOR)
+	// Now spin up the second processors into the same state we are now.
+	XPUTC(#77)
+	XPUTC(#80)
+	XPUTC(#60)
+	// Make sure the cache is flushed out to RAM for the other CPUs
+	bl	_C_LABEL(armv7_dcache_wbinv_all)
+	bl	a20_mpinit
+	XPUTC(#62)
+#endif /* MULTIPROCESSOR */
 	XPUTC(#13)
 	XPUTC(#10)
 
@@ -141,26 +139,101 @@ _C_LABEL(cubie_start):
 
 #include arm/cortex/a9_mpsubr.S
 
+#if defined(MULTIPROCESSOR)
+a20_mpinit:
+	mov	r4, lr			// because we call gtmr_bootdelay
+	movw	r5, #:lower16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET)
+	movt	r5, #:upper16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET)
+
+	/* Set where the other CPU(s) are going to execute */
+	movw	r1, #:lower16:cortex_mpstart
+	movt	r1, #:upper16:cortex_mpstart
+	str	r1, [r5, #AWIN_CPUCFG_PRIVATE_REG]
+	dsb
+
+	/* Assert CPU core reset */
+	mov	r1, #0
+	str	r1, [r5, #AWIN_CPUCFG_CPU1_RST_CTRL_REG]
+	dsb
+
+	/* Ensure CPU1 reset also invalidates its L1 caches */
+	ldr	r1, [r5, #AWIN_CPUCFG_GENCTRL_REG] 
+	bic	r1, r1, #(1  1)
+	str	r1, [r5, #AWIN_CPUCFG_GENCTRL_REG]

CVS commit: src/sys/arch/evbarm/cubie

2014-03-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Mar 29 14:00:30 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c cubie_start.S

Log Message:
Properly powerup the 2nd CPU.  Other MP changes.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/cubie/cubie_machdep.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/cubie/cubie_start.S

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



CVS commit: src/sys/arch/evbarm/cubie

2014-03-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar  3 03:06:13 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: platform.h

Log Message:
Move IO KVA so it doesn't share the same TLB index as the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/cubie/platform.h

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/cubie/platform.h
diff -u src/sys/arch/evbarm/cubie/platform.h:1.1 src/sys/arch/evbarm/cubie/platform.h:1.2
--- src/sys/arch/evbarm/cubie/platform.h:1.1	Tue Sep  3 18:01:33 2013
+++ src/sys/arch/evbarm/cubie/platform.h	Mon Mar  3 03:06:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform.h,v 1.1 2013/09/03 18:01:33 matt Exp $	*/
+/*	$NetBSD: platform.h,v 1.2 2014/03/03 03:06:13 matt Exp $	*/
 /*
  * Copyright (c) 2007 Microsoft
  * All rights reserved.
@@ -35,10 +35,10 @@
 
 /*
  * Memory may be mapped VA:PA starting at 0x8000:0x4000
- * Kernel VM space: 512MB at KERNEL_VM_BASE
+ * Kernel VM space: 576MB at KERNEL_VM_BASE
  */
 #define KERNEL_VM_BASE		0xc000
-#define KERNEL_VM_SIZE		0x2000
+#define KERNEL_VM_SIZE		0x2400
 
 /*
  * We devmap IO starting at KERNEL_VM_BASE + KERNEL_VM_SIZE
@@ -48,5 +48,7 @@
 #define AWIN_SRAM_VBASE		(AWIN_CORE_VBASE + AWIN_CORE_SIZE)
 #define AWIN_KERNEL_IO_VEND	(AWIN_SRAM_VBASE + AWIN_SRAM_SIZE)
 #define CONADDR_VA		((CONADDR - AWIN_CORE_PBASE) + AWIN_CORE_VBASE)
-
+#ifndef _LOCORE
+CTASSERT(AWIN_KERNEL_IO_VEND = VM_MAX_KERNEL_ADDRESS);
+#endif
 #endif /* _EVBARM_CUBIE_PLATFORM_H */



CVS commit: src/sys/arch/evbarm/cubie

2014-03-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar  3 03:06:13 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: platform.h

Log Message:
Move IO KVA so it doesn't share the same TLB index as the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/cubie/platform.h

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



CVS commit: src/sys/arch/evbarm/cubie

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 00:20:59 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Deal with cubietruck GPIO differences.
Use its 2GB of RAM to distinguish it.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.11 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.12
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.11	Wed Feb 26 00:12:21 2014
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Wed Feb 26 00:20:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.11 2014/02/26 00:12:21 jmcneill Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.12 2014/02/26 00:20:59 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.11 2014/02/26 00:12:21 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.12 2014/02/26 00:20:59 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -191,6 +191,7 @@ static char bootargs[MAX_BOOT_STRING];
 char *boot_args = NULL;
 char *boot_file = NULL;
 
+bool cubietruck_p;
 /*
  * uboot_args are filled in by cubie_start.S and must be in .data
  * and not .bbs since .bss is cleared after uboot_args are filled in.
@@ -202,6 +203,10 @@ uintptr_t uboot_args[4] = { 0 };
 extern char KERNEL_BASE_phys[];	/* physical start of kernel */
 extern char _end[];		/* physical end of kernel */
 
+#ifdef MULTIPROCESSOR
+extern uintptr_t cortex_mpfault[4];
+#endif
+
 #if NAWIN_FB  0
 #if NCOM  0
 int use_fb_console = false;
@@ -307,6 +312,11 @@ initarm(void *arg)
 #ifdef VERBOSE_INIT_ARM
 	printf(\nuboot arg = %#PRIxPTR, %#PRIxPTR, %#PRIxPTR, %#PRIxPTR\n,
 	uboot_args[0], uboot_args[1], uboot_args[2], uboot_args[3]);
+#ifdef MULTIPROCESSOR
+	printf(mpfault = %#PRIxPTR, %#PRIxPTR, %#PRIxPTR, %#PRIxPTR\n,
+	cortex_mpfault[0], cortex_mpfault[1], cortex_mpfault[2],
+	cortex_mpfault[3]);
+#endif
 #endif
 
 #ifdef KGDB
@@ -339,6 +349,9 @@ initarm(void *arg)
 	 */
 	psize_t ram_size = awin_memprobe();
 
+	/* the cubietruck has 2GB whereas the cubieboards only has 1GB */
+	cubietruck_p = (ram_size == 0x8000);
+
 	/*
 	 * If MEMSIZE specified less than what we really have, limit ourselves
 	 * to that.
@@ -350,6 +363,11 @@ initarm(void *arg)
 	KASSERTMSG(ram_size  0, RAM size unknown and MEMSIZE undefined);
 #endif
 
+	/*
+	 * Configure DMA tags
+	 */
+	awin_dma_bootstrap(ram_size);
+
 	/* Fake bootconfig structure for the benefit of pmap.c. */
 	bootconfig.dramblocks = 1;
 	bootconfig.dram[0].address = AWIN_SDRAM_PBASE;
@@ -412,7 +430,7 @@ initarm(void *arg)
 #define CONSPEED 115200
 #endif
 #ifndef CONMODE
-#define CONMODE ((TTYDEF_CFLAG  ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
+#define CONMODE ((TTYDEF_CFLAG  ~(CSIZE | CSTOPB | PARENB | HUPCL)) | CS8) /* 8N1 */
 #endif
 
 __CTASSERT(AWIN_CORE_PBASE + AWIN_UART0_OFFSET = CONADDR);
@@ -529,7 +547,11 @@ cubie_device_register(device_t self, voi
 #endif
 
 	if (device_is_a(self, awinio)) {
-		prop_dictionary_set_bool(dict, no-awge, true);
+		if (cubietruck_p) {
+			prop_dictionary_set_bool(dict, no-awe, true);
+		} else {
+			prop_dictionary_set_bool(dict, no-awge, true);
+		}
 		return;
 	}
 
@@ -537,16 +559,25 @@ cubie_device_register(device_t self, voi
 		/*
 		 * These are GPIOs being used for various functions.
 		 */
-		prop_dictionary_set_cstring(dict, satapwren, PB8);
-		prop_dictionary_set_cstring(dict, usb0drv, PB9);
+		prop_dictionary_set_cstring(dict, satapwren,
+		(cubietruck_p ? PH12 : PB8));
+		prop_dictionary_set_cstring(dict, usb0drv,
+		(cubietruck_p ? PH17 : PB2));
 		prop_dictionary_set_cstring(dict, usb2drv, PH3);
-		prop_dictionary_set_cstring(dict, usb0iddet, PH4);
-		prop_dictionary_set_cstring(dict, usb0vbusdet, PH5);
+		prop_dictionary_set_cstring(dict, usb0iddet,
+		(cubietruck_p ? PH19 : PH4));
+		prop_dictionary_set_cstring(dict, usb0vbusdet,
+		(cubietruck_p ? PH22 : PH5));
 		prop_dictionary_set_cstring(dict, usb1drv, PH6);
-		prop_dictionary_set_cstring(dict, hdd5ven, PH17);
-		prop_dictionary_set_cstring(dict, emacpwren, PH19);
 		prop_dictionary_set_cstring(dict, status-led1, PH21);
 		prop_dictionary_set_cstring(dict, status-led2, PH20);
+		if (cubietruck_p) {
+			prop_dictionary_set_cstring(dict, status-led3, PH11);
+			prop_dictionary_set_cstring(dict, status-led4, PH7);
+		} else {
+			prop_dictionary_set_cstring(dict, hdd5ven, PH17);
+			prop_dictionary_set_cstring(dict, emacpwren, PH19);
+		}
 
 		/*
 		 * These pins have no connections.
@@ -563,7 +594,7 @@ cubie_device_register(device_t self, voi
 	}
 
 	if (device_is_a(self, ahcisata)) {
-		/* PIO PB8 output */
+		/* PIO PB8 / PIO PH12 

CVS commit: src/sys/arch/evbarm/cubie

2014-02-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Feb 26 00:12:21 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
sdhc - awinmmc


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.10 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.11
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.10	Thu Jan 30 00:08:46 2014
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Wed Feb 26 00:12:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.10 2014/01/30 00:08:46 matt Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.11 2014/02/26 00:12:21 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.10 2014/01/30 00:08:46 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.11 2014/02/26 00:12:21 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -136,7 +136,6 @@ __KERNEL_RCSID(0, $NetBSD: cubie_machde
 #include opt_allwinner.h
 
 #include com.h
-#include sdhc.h
 #include ukbd.h
 
 #include sys/param.h
@@ -569,11 +568,7 @@ cubie_device_register(device_t self, voi
 		return;
 	}
 
-	if (device_is_a(self, sdhc)) {
-#if 0
-		prop_dictionary_set_uint32(dict, clkmask, 0);
-		prop_dictionary_set_bool(dict, 8bit, true);
-#endif
+	if (device_is_a(self, awinmmc)) {
 		return;
 	}
 



CVS commit: src/sys/arch/evbarm/cubie

2014-02-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Feb 26 00:39:50 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
hook up MMC0 to status-led2


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.12 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.13
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.12	Wed Feb 26 00:20:59 2014
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Wed Feb 26 00:39:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.12 2014/02/26 00:20:59 matt Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.13 2014/02/26 00:39:50 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.12 2014/02/26 00:20:59 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.13 2014/02/26 00:39:50 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -600,6 +600,11 @@ cubie_device_register(device_t self, voi
 	}
 
 	if (device_is_a(self, awinmmc)) {
+		struct awinio_attach_args * const aio = aux;
+		if (aio-aio_loc.loc_port == 0) {
+			prop_dictionary_set_cstring(dict,
+			led-gpio, status-led2);
+		}
 		return;
 	}
 



CVS commit: src/sys/arch/evbarm/cubie

2014-02-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Feb 26 02:01:29 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
hook up mmc card detect gpio


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.13 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.14
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.13	Wed Feb 26 00:39:50 2014
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Wed Feb 26 02:01:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.13 2014/02/26 00:39:50 jmcneill Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.14 2014/02/26 02:01:29 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.13 2014/02/26 00:39:50 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.14 2014/02/26 02:01:29 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -578,6 +578,7 @@ cubie_device_register(device_t self, voi
 			prop_dictionary_set_cstring(dict, hdd5ven, PH17);
 			prop_dictionary_set_cstring(dict, emacpwren, PH19);
 		}
+		prop_dictionary_set_cstring(dict, mmc0detect, PH1);
 
 		/*
 		 * These pins have no connections.
@@ -603,6 +604,8 @@ cubie_device_register(device_t self, voi
 		struct awinio_attach_args * const aio = aux;
 		if (aio-aio_loc.loc_port == 0) {
 			prop_dictionary_set_cstring(dict,
+			detect-gpio, mmc0detect);
+			prop_dictionary_set_cstring(dict,
 			led-gpio, status-led2);
 		}
 		return;



CVS commit: src/sys/arch/evbarm/cubie

2014-02-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Feb 26 00:12:21 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
sdhc - awinmmc


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 00:20:59 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Deal with cubietruck GPIO differences.
Use its 2GB of RAM to distinguish it.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2014-02-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Feb 26 00:39:50 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
hook up MMC0 to status-led2


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2014-01-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan 30 00:08:46 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Print uboot_args using PRIxPTR


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.9 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.10
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.9	Thu Jan 23 19:26:55 2014
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Thu Jan 30 00:08:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.9 2014/01/23 19:26:55 matt Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.10 2014/01/30 00:08:46 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.9 2014/01/23 19:26:55 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.10 2014/01/30 00:08:46 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -306,7 +306,7 @@ initarm(void *arg)
 	consinit();
 
 #ifdef VERBOSE_INIT_ARM
-	printf(\nuboot arg = %#x, %#x, %#x, %#x\n,
+	printf(\nuboot arg = %#PRIxPTR, %#PRIxPTR, %#PRIxPTR, %#PRIxPTR\n,
 	uboot_args[0], uboot_args[1], uboot_args[2], uboot_args[3]);
 #endif
 



CVS commit: src/sys/arch/evbarm/cubie

2014-01-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan 30 00:08:46 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Print uboot_args using PRIxPTR


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2014-01-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 24 04:19:10 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_start.S

Log Message:
Replace copyright with TNF
Clear upper 4 bits of pc-relative offset for uboot_args since .start is
1GB below .text so we can access using the load address, not the KERNEL_BASE
address.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_start.S
diff -u src/sys/arch/evbarm/cubie/cubie_start.S:1.3 src/sys/arch/evbarm/cubie/cubie_start.S:1.4
--- src/sys/arch/evbarm/cubie/cubie_start.S:1.3	Thu Jan 23 19:26:55 2014
+++ src/sys/arch/evbarm/cubie/cubie_start.S	Fri Jan 24 04:19:10 2014
@@ -1,9 +1,9 @@
-/*
- * Machine dependent startup code for BEAGLEBOARD boards.
- * Based on omap_start.S
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
  *
- * Copyright (c) 2002, 2003  Genetec Corporation.  All rights reserved.
- * Written by Hiroyuki Bessho for Genetec Corporation.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -13,14 +13,11 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. The name of Genetec Corporation may not be used to endorse or
- *promote products derived from this software without specific prior
- *written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GENETEC CORPORATION
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -28,58 +25,6 @@
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
- *
- * Copyright (c) 2003
- *	Ichiro FUKUHARA ich...@ichiro.org.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Copyright (c) 2007 Microsoft
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *	This product includes software developed by Microsoft
- *
- * 

CVS commit: src/sys/arch/evbarm/cubie

2014-01-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 24 05:13:06 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_start.S

Log Message:
Add a flag so the xputc will bswap registers.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_start.S
diff -u src/sys/arch/evbarm/cubie/cubie_start.S:1.4 src/sys/arch/evbarm/cubie/cubie_start.S:1.5
--- src/sys/arch/evbarm/cubie/cubie_start.S:1.4	Fri Jan 24 04:19:10 2014
+++ src/sys/arch/evbarm/cubie/cubie_start.S	Fri Jan 24 05:13:06 2014
@@ -40,13 +40,12 @@
 #include arm/allwinner/awin_reg.h
 #include evbarm/cubie/platform.h  
 
-RCSID($NetBSD: cubie_start.S,v 1.4 2014/01/24 04:19:10 matt Exp $)
+RCSID($NetBSD: cubie_start.S,v 1.5 2014/01/24 05:13:06 matt Exp $)
 
 #if defined(VERBOSE_INIT_ARM)
-#ifdef __ARMEB__
-#define	XPUTC(n)	mov r0, n  24; bl xputc
-#else
 #define	XPUTC(n)	mov r0, n; bl xputc
+#ifdef __ARMEB__
+#define COM_BSWAP
 #endif
 #define COM_MULT	4
 #define XPUTC_COM	1



CVS commit: src/sys/arch/evbarm/cubie

2014-01-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 24 04:19:10 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_start.S

Log Message:
Replace copyright with TNF
Clear upper 4 bits of pc-relative offset for uboot_args since .start is
1GB below .text so we can access using the load address, not the KERNEL_BASE
address.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/cubie/cubie_start.S

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



CVS commit: src/sys/arch/evbarm/cubie

2014-01-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 24 05:13:06 UTC 2014

Modified Files:
src/sys/arch/evbarm/cubie: cubie_start.S

Log Message:
Add a flag so the xputc will bswap registers.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/cubie/cubie_start.S

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



CVS commit: src/sys/arch/evbarm/cubie

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 17:54:38 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Cleanup.  Make KGDB work.
We now process the u-boot boot args.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.7 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.8
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.7	Sun Sep  8 04:06:44 2013
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Mon Sep  9 17:54:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.7 2013/09/08 04:06:44 matt Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.8 2013/09/09 17:54:38 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.7 2013/09/08 04:06:44 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.8 2013/09/09 17:54:38 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -192,29 +192,32 @@ static char bootargs[MAX_BOOT_STRING];
 char *boot_args = NULL;
 char *boot_file = NULL;
 
-u_int uboot_args[4] = { 0 };	/* filled in by cubie_start.S (not in bss) */
+/*
+ * uboot_args are filled in by cubie_start.S and must be in .data
+ * and not .bbs since .bss is cleared after uboot_args are filled in.
+ */
+uintptr_t uboot_args[4] = { 0 };
 
 /* Same things, but for the free (unused by the kernel) memory. */
 
-extern char KERNEL_BASE_phys[];
-extern char _end[];
+extern char KERNEL_BASE_phys[];	/* physical start of kernel */
+extern char _end[];		/* physical end of kernel */
 
+#if NAWIN_FB  0
 #if NCOM  0
 int use_fb_console = false;
 #else
 int use_fb_console = true;
 #endif
-
-#ifdef CPU_CORTEXA7
-uint32_t arm_cnt_frq;
 #endif
 
 /*
  * Macros to translate between physical and virtual for a subset of the
  * kernel address space.  *Not* for general use.
  */
-#define KERNEL_BASE_PHYS ((paddr_t)KERNEL_BASE_phys)
-#define	AWIN_CORE_VOFFSET	(AWIN_CORE_VBASE - AWIN_CORE_PBASE)
+#define KERNEL_BASE_PHYS	((paddr_t)KERNEL_BASE_phys)
+#define KERNEL_PHYS_VOFFSET	(KERNEL_BASE - AWIN_SDRAM_PBASE)
+#define AWIN_CORE_VOFFSET	(AWIN_CORE_VBASE - AWIN_CORE_PBASE)
 
 /* Prototypes */
 
@@ -223,11 +226,8 @@ void consinit(void);
 static void kgdb_port_init(void);
 #endif
 
-static void init_clocks(void);
 static void cubie_device_register(device_t, void *);
 
-bs_protos(bs_notimpl);
-
 #if NCOM  0
 #include dev/ic/comreg.h
 #include dev/ic/comvar.h
@@ -248,8 +248,8 @@ bs_protos(bs_notimpl);
  * using the 2nd page tables.
  */
 
-#define	_A(a)	((a)  ~L1_S_OFFSET)
-#define	_S(s)	(((s) + L1_S_SIZE - 1)  ~(L1_S_SIZE-1))
+#define _A(a)	((a)  ~L1_S_OFFSET)
+#define _S(s)	(((s) + L1_S_SIZE - 1)  ~(L1_S_SIZE-1))
 
 static const struct pmap_devmap devmap[] = {
 	{
@@ -295,9 +295,6 @@ static const struct pmap_devmap devmap[]
 u_int
 initarm(void *arg)
 {
-	psize_t ram_size = 0;
-	char *ptr;
-
 	pmap_devmap_register(devmap);
 	awin_bootstrap(AWIN_CORE_VBASE, CONADDR_VA);
 
@@ -305,13 +302,13 @@ initarm(void *arg)
 	if (set_cpufuncs())
 		panic(cpu not recognized!);
 
-	init_clocks();
-
 	/* The console is going to try to map things.  Give pmap a devmap. */
 	consinit();
 
+#ifdef VERBOSE_INIT_ARM
 	printf(\nuboot arg = %#x, %#x, %#x, %#x\n,
 	uboot_args[0], uboot_args[1], uboot_args[2], uboot_args[3]);
+#endif
 
 #ifdef KGDB
 	kgdb_port_init();
@@ -331,17 +328,17 @@ initarm(void *arg)
 
 #ifdef VERBOSE_INIT_ARM
 	printf(initarm: Configuring system ...\n);
-#endif
 
 #if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA9) || defined(CPU_CORTEXA15)
 	printf(initarm: cbar=%#x\n, armreg_cbar_read());
 #endif
+#endif
 
 	/*
 	 * Set up the variables that define the availability of physical
 	 * memory.
 	 */
-	ram_size = awin_memprobe();
+	psize_t ram_size = awin_memprobe();
 
 	/*
 	 * If MEMSIZE specified less than what we really have, limit ourselves
@@ -356,7 +353,7 @@ initarm(void *arg)
 
 	/* Fake bootconfig structure for the benefit of pmap.c. */
 	bootconfig.dramblocks = 1;
-	bootconfig.dram[0].address = KERNEL_BASE_PHYS  -0x40;
+	bootconfig.dram[0].address = AWIN_SDRAM_PBASE;
 	bootconfig.dram[0].pages = ram_size / PAGE_SIZE;
 
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
@@ -367,43 +364,45 @@ initarm(void *arg)
 #endif
 	KASSERT((armreg_pfr1_read()  ARM_PFR1_SEC_MASK) != 0);
 
-#if 0
-	/* bootargs env variable is passed as 4th argument to kernel */
-	printf(Copy bootargs);
-	if (uboot_args[3] - AWIN_SDRAM_PBASE  ram_size) {
-		strlcpy(bootargs, (char *)uboot_args[3], sizeof(bootargs));
-	}
-	printf(\n);
-#endif
-
 	arm32_bootmem_init(bootconfig.dram[0].address, ram_size,
 	KERNEL_BASE_PHYS);
 	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, devmap,
 	

CVS commit: src/sys/arch/evbarm/cubie

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 17:54:38 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Cleanup.  Make KGDB work.
We now process the u-boot boot args.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2013-09-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep  7 00:30:17 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_start.S

Log Message:
Make sure the core register are mapped PA:VA too.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_start.S
diff -u src/sys/arch/evbarm/cubie/cubie_start.S:1.1 src/sys/arch/evbarm/cubie/cubie_start.S:1.2
--- src/sys/arch/evbarm/cubie/cubie_start.S:1.1	Tue Sep  3 18:01:33 2013
+++ src/sys/arch/evbarm/cubie/cubie_start.S	Sat Sep  7 00:30:17 2013
@@ -95,7 +95,7 @@
 #include arm/allwinner/awin_reg.h
 #include evbarm/cubie/platform.h  
 
-RCSID($NetBSD: cubie_start.S,v 1.1 2013/09/03 18:01:33 matt Exp $)
+RCSID($NetBSD: cubie_start.S,v 1.2 2013/09/07 00:30:17 matt Exp $)
 
 #if defined(VERBOSE_INIT_ARM)
 #define	XPUTC(n)	mov r0, n; bl xputc
@@ -164,11 +164,7 @@ _C_LABEL(cubie_start):
 	movw	ip, #:lower16:start
 	movt	ip, #:upper16:start
 	bx	ip		/* Jump to start (flushes pipeline). */
-	nop
-	nop
-	nop
-	nop
-	
+
 	/* NOTREACHED */
 
 #include arm/cortex/a9_mpsubr.S
@@ -189,6 +185,10 @@ _C_LABEL(cubie_start):
 		(AWIN_CORE_SIZE + L1_S_SIZE - 1) / L1_S_SIZE,
 		L1_S_PROTO | L1_S_APv7_KRW)
 
+	/* Map AWIN CORE (so console will work) */
+	MMU_INIT(AWIN_CORE_PBASE, AWIN_CORE_PBASE,
+		(AWIN_CORE_SIZE + L1_S_SIZE - 1) / L1_S_SIZE,
+		L1_S_PROTO | L1_S_APv7_KRW)
 	/* end of table */
 	MMU_INIT(0, 0, 0, 0)
 



CVS commit: src/sys/arch/evbarm/cubie

2013-09-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep  7 00:31:11 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
call pmap_devmap before awin_bootstrap.
Don't copy bootargs yet.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.3 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.4
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.3	Wed Sep  4 17:45:40 2013
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Sat Sep  7 00:31:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.3 2013/09/04 17:45:40 matt Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.4 2013/09/07 00:31:10 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.3 2013/09/04 17:45:40 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.4 2013/09/07 00:31:10 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -298,6 +298,7 @@ initarm(void *arg)
 	psize_t ram_size = 0;
 	char *ptr;
 
+	pmap_devmap_register(devmap);
 	awin_bootstrap(AWIN_CORE_VBASE, CONADDR_VA);
 
 	/* Heads up ... Setup the CPU / MMU / TLB functions. */
@@ -307,7 +308,6 @@ initarm(void *arg)
 	init_clocks();
 
 	/* The console is going to try to map things.  Give pmap a devmap. */
-	pmap_devmap_register(devmap);
 	consinit();
 
 	printf(\nuboot arg = %#x, %#x, %#x, %#x\n,
@@ -367,10 +367,14 @@ initarm(void *arg)
 #endif
 	KASSERT((armreg_pfr1_read()  ARM_PFR1_SEC_MASK) != 0);
 
+#if 0
 	/* bootargs env variable is passed as 4th argument to kernel */
+	printf(Copy bootargs);
 	if (uboot_args[3] - AWIN_SDRAM_PBASE  ram_size) {
 		strlcpy(bootargs, (char *)uboot_args[3], sizeof(bootargs));
 	}
+	printf(\n);
+#endif
 
 	arm32_bootmem_init(bootconfig.dram[0].address, ram_size,
 	KERNEL_BASE_PHYS);
@@ -509,10 +513,39 @@ cubie_device_register(device_t self, voi
 	}
 #endif
 
+	if (device_is_a(self, awingpio)) {
+		/*
+		 * These are GPIOs being used for various functions.
+		 */
+		prop_dictionary_set_cstring(dict, out-satapwren, PB8);
+		prop_dictionary_set_cstring(dict, out-usb0drv, PB9);
+		prop_dictionary_set_cstring(dict, out-usb1drv, PH6);
+		prop_dictionary_set_cstring(dict, out-usb2drv, PH3);
+		prop_dictionary_set_cstring(dict, out-hdd5ven, PH17);
+		prop_dictionary_set_cstring(dict, out-emacpwren, PH19);
+		prop_dictionary_set_cstring(dict, out-status-led1, PH21);
+		prop_dictionary_set_cstring(dict, out-status-led2, PH20);
+
+		/*
+		 * These pins have no connections.
+		 */
+		prop_dictionary_set_uint32(dict, nc-b, 0x0003d0e8);
+		prop_dictionary_set_uint32(dict, nc-c, 0x00ff);
+		prop_dictionary_set_uint32(dict, nc-h, 0x03c53f04);
+		prop_dictionary_set_uint32(dict, nc-i, 0x003fc03f);
+		return;
+	}
+
 	if (device_is_a(self, ehci)) {
 		return;
 	}
 
+	if (device_is_a(self, ahcisata)) {
+		/* PIO PB8 output */
+		prop_dictionary_set_cstring(dict, power-gpio, satapwren);
+		return;
+	}
+
 	if (device_is_a(self, sdhc)) {
 #if 0
 		prop_dictionary_set_uint32(dict, clkmask, 0);



CVS commit: src/sys/arch/evbarm/cubie

2013-09-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep  7 03:34:20 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Fix comment.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/cubie/cubie_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/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.4 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.5
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.4	Sat Sep  7 00:31:10 2013
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Sat Sep  7 03:34:20 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.4 2013/09/07 00:31:10 matt Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.5 2013/09/07 03:34:20 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.4 2013/09/07 00:31:10 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.5 2013/09/07 03:34:20 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -506,8 +506,8 @@ cubie_device_register(device_t self, voi
 #if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA15)
 	if (device_is_a(self, armgtmr)) {
 		/*
-		 * The frequency of the generic timer was figured out when
-		 * determined the cpu frequency.
+		 * The frequency of the generic timer is the reference
+		 * frequency.
 		 */
 prop_dictionary_set_uint32(dict, frequency, AWIN_REF_FREQ);
 	}



CVS commit: src/sys/arch/evbarm/cubie

2013-09-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep  7 00:30:17 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_start.S

Log Message:
Make sure the core register are mapped PA:VA too.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/cubie/cubie_start.S

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



CVS commit: src/sys/arch/evbarm/cubie

2013-09-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep  7 00:31:11 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
call pmap_devmap before awin_bootstrap.
Don't copy bootargs yet.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2013-09-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep  7 03:34:20 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Fix comment.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/cubie/cubie_machdep.c

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



CVS commit: src/sys/arch/evbarm/cubie

2013-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Sep  3 18:01:33 UTC 2013

Added Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c cubie_start.S genassym.cf
platform.h

Log Message:
First attempt at initial evbarm support for cubieboard (compile tested).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/cubie/cubie_machdep.c \
src/sys/arch/evbarm/cubie/cubie_start.S \
src/sys/arch/evbarm/cubie/genassym.cf \
src/sys/arch/evbarm/cubie/platform.h

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

Added files:

Index: src/sys/arch/evbarm/cubie/cubie_machdep.c
diff -u /dev/null src/sys/arch/evbarm/cubie/cubie_machdep.c:1.1
--- /dev/null	Tue Sep  3 18:01:33 2013
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Tue Sep  3 18:01:33 2013
@@ -0,0 +1,685 @@
+/*	$NetBSD: cubie_machdep.c,v 1.1 2013/09/03 18:01:33 matt Exp $ */
+
+/*
+ * Machine dependent functions for kernel setup for TI OSK5912 board.
+ * Based on lubbock_machdep.c which in turn was based on iq80310_machhdep.c
+ *
+ * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
+ * Written by Hiroyuki Bessho for Genetec Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of Genetec Corporation may not be used to endorse or
+ *promote products derived from this software without specific prior
+ *written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GENETEC CORPORATION
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Copyright (c) 2001 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *	This product includes software developed for the NetBSD Project by
+ *	Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ *or promote products derived from this software without specific prior
+ *written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Copyright (c) 1997,1998 Mark Brinicombe.
+ * Copyright (c) 1997,1998 Causality Limited.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must 

CVS commit: src/sys/arch/evbarm/cubie

2013-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Sep  3 18:01:33 UTC 2013

Added Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c cubie_start.S genassym.cf
platform.h

Log Message:
First attempt at initial evbarm support for cubieboard (compile tested).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/cubie/cubie_machdep.c \
src/sys/arch/evbarm/cubie/cubie_start.S \
src/sys/arch/evbarm/cubie/genassym.cf \
src/sys/arch/evbarm/cubie/platform.h

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